From af8aee7cd8dfb866b71940d423481ed71235572b Mon Sep 17 00:00:00 2001 From: Jamie Neighbours Date: Wed, 19 Jun 2024 11:23:37 +0100 Subject: [PATCH] Add debugging output to resolve issue with import callback --- dist/components/form/components/FormRichText.d.ts.map | 2 +- dist/components/form/components/FormRichText.js | 6 ++++-- dist/components/form/components/FormRichText.js.map | 2 +- dist/index.es.js | 2 +- dist/index.js | 6 ++++-- dist/index.min.js | 2 +- src/components/form/components/FormRichText.tsx | 2 ++ 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dist/components/form/components/FormRichText.d.ts.map b/dist/components/form/components/FormRichText.d.ts.map index 41aa44e..3bfe19b 100644 --- a/dist/components/form/components/FormRichText.d.ts.map +++ b/dist/components/form/components/FormRichText.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"FormRichText.d.ts","sourceRoot":"","sources":["../../../../src/components/form/components/FormRichText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAS,aAAa,EAAY,MAAM,OAAO,CAAC;AAE9D,OAAO,2BAA2B,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;IAC9B,cAAc,CAAC,IAAI,GAAG,CAAC;CACxB;AAED,QAAA,MAAM,YAAY,iEAAgE,gBAAgB,sBAqDjG,CAAC;AAGF,eAAe,YAAY,CAAC"} \ No newline at end of file +{"version":3,"file":"FormRichText.d.ts","sourceRoot":"","sources":["../../../../src/components/form/components/FormRichText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAU,aAAa,EAAa,MAAM,OAAO,CAAC;AAEhE,OAAO,2BAA2B,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;IAC9B,cAAc,CAAC,IAAI,GAAG,CAAC;CACxB;AAED,QAAA,MAAM,YAAY,iEAOf,gBAAgB,sBA8DlB,CAAC;AAEF,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/dist/components/form/components/FormRichText.js b/dist/components/form/components/FormRichText.js index 7f285e9..bd562ae 100644 --- a/dist/components/form/components/FormRichText.js +++ b/dist/components/form/components/FormRichText.js @@ -42,8 +42,10 @@ var FormRichText = function (_a) { }; useEffect(function () { if (containerRef.current) { + console.log(importCallback); if (importCallback) { - //Callback to import new modules into quill, needs to be done within the same instance as the quill object. + console.log("import callback called"); + // Callback to import new modules into quill, needs to be done within the same instance as the quill object. importCallback(); } var container_1 = containerRef.current; @@ -62,7 +64,7 @@ var FormRichText = function (_a) { // NOTE: Run effect once on component mount, please recheck dependencies if effect is updated. // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - return React.createElement("div", { ref: containerRef, style: rest.style, id: rest.id, className: rest.className }); + return (React.createElement("div", { ref: containerRef, style: rest.style, id: rest.id, className: rest.className })); }; export default FormRichText; //# sourceMappingURL=FormRichText.js.map \ No newline at end of file diff --git a/dist/components/form/components/FormRichText.js.map b/dist/components/form/components/FormRichText.js.map index 266d3f8..3f40444 100644 --- a/dist/components/form/components/FormRichText.js.map +++ b/dist/components/form/components/FormRichText.js.map @@ -1 +1 @@ -{"version":3,"file":"FormRichText.js","sourceRoot":"","sources":["../../../../src/components/form/components/FormRichText.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,MAAM,EAAiB,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AAcnC,IAAM,YAAY,GAAG,UAAC,EAA4E;IAA3E,IAAA,OAAO,aAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,KAAK,WAAA,EAAE,cAAc,oBAAA,EAAK,IAAI,cAAzD,2DAA0D,CAAD;IAE7E,IAAM,QAAQ,GAAG,MAAM,CAAe,IAAI,CAAC,CAAC;IAC5C,IAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,IAAM,YAAY,yBACb,OAAO,KACV,KAAK,EAAE,KAAK,IAAI,MAAM,GACvB,CAAC;IAEF,IAAM,QAAQ,GAAG,UAAC,QAAe;QAC/B,IAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1D,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,IAAM,kBAAkB,GAAG,UAAC,KAAY;QACtC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;;YACjC,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,CAAA,MAAA,QAAQ,CAAC,OAAO,0CAAE,eAAe,EAAE,KAAI,EAAE,CAAC,CAAC;aACrD;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,SAAS,CAAC;QACR,IAAI,YAAY,CAAC,OAAO,EAAE;YAExB,IAAI,cAAc,EAAE;gBAClB,2GAA2G;gBAC3G,cAAc,EAAE,CAAC;aAClB;YAED,IAAM,WAAS,GAAG,YAAY,CAAC,OAAyB,CAAC;YACzD,IAAM,eAAe,GAAG,WAAS,CAAC,WAAW,CAAC,WAAS,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;YAE3F,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;YACvD,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,oCAAoC;YAE9D,IAAI,KAAK,EAAE;gBACT,QAAQ,CAAC,KAAK,CAAC,CAAC;aACjB;YACD,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAE1B,OAAO;gBACL,WAAS,CAAC,SAAS,GAAG,EAAE,CAAC;gBACxB,QAAQ,CAAC,OAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;YAC3D,CAAC,CAAA;SACF;QAED,8FAA8F;QAC9F,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,6BAAK,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAG,CAAC;AAC9F,CAAC,CAAC;AAGF,eAAe,YAAY,CAAC"} \ No newline at end of file +{"version":3,"file":"FormRichText.js","sourceRoot":"","sources":["../../../../src/components/form/components/FormRichText.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AAcnC,IAAM,YAAY,GAAG,UAAC,EAOH;IANjB,IAAA,OAAO,aAAA,EACP,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,cAAc,oBAAA,EACX,IAAI,cANa,2DAOrB,CADQ;IAEP,IAAM,QAAQ,GAAG,MAAM,CAAe,IAAI,CAAC,CAAC;IAC5C,IAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,IAAM,YAAY,yBACb,OAAO,KACV,KAAK,EAAE,KAAK,IAAI,MAAM,GACvB,CAAC;IAEF,IAAM,QAAQ,GAAG,UAAC,QAAe;QAC/B,IAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1D,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,IAAM,kBAAkB,GAAG,UAAC,KAAY;QACtC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;;YACjC,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,CAAA,MAAA,QAAQ,CAAC,OAAO,0CAAE,eAAe,EAAE,KAAI,EAAE,CAAC,CAAC;aACrD;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,SAAS,CAAC;QACR,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAC5B,IAAI,cAAc,EAAE;gBAClB,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;gBACtC,4GAA4G;gBAC5G,cAAc,EAAE,CAAA;aACjB;YAED,IAAM,WAAS,GAAG,YAAY,CAAC,OAAyB,CAAC;YACzD,IAAM,eAAe,GAAG,WAAS,CAAC,WAAW,CAC3C,WAAS,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAC7C,CAAC;YAEF,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;YACvD,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,oCAAoC;YAE9D,IAAI,KAAK,EAAE;gBACT,QAAQ,CAAC,KAAK,CAAC,CAAC;aACjB;YACD,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAE1B,OAAO;gBACL,WAAS,CAAC,SAAS,GAAG,EAAE,CAAC;gBACxB,QAAQ,CAAC,OAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC5D,CAAC,CAAC;SACH;QAED,8FAA8F;QAC9F,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,6BACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,SAAS,EAAE,IAAI,CAAC,SAAS,GACzB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/dist/index.es.js b/dist/index.es.js index b723cf2..b11573c 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -16,7 +16,7 @@ import*as e from"react";import t,{useRef as n,useState as r,useCallback as a,use object-assign (c) Sindre Sorhus @license MIT -*/function pe(){if(te)return ee;te=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return ee=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(r,a){for(var i,o,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),l=1;l1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),o)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var t=0;t0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(t,r,a,i,o){var s=t[r],l=y(s);if("object"!==l)return new p("Invalid "+i+" `"+o+"` of type `"+l+"` supplied to `"+a+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return g(a,i,o,c,E(u));var d=u(s,c,a,i,o+"."+c,n);if(d)return d}return null}))},exact:function(e){return m((function(a,i,o,s,l){var c=a[i],u=y(c);if("object"!==u)return new p("Invalid "+s+" `"+l+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var d=t({},a[i],e);for(var h in d){var f=e[h];if(r(e,h)&&"function"!=typeof f)return g(o,s,l,h,E(f));if(!f)return new p("Invalid "+s+" `"+l+"` key `"+h+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(a[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(c,h,o,s,l+"."+h,n);if(m)return m}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function a(a,o,s,c,u,h,f){if(c=c||d,h=h||s,f!==n){if(l){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=c+":"+s;!t[v]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,r++)}}return null==o[s]?a?null===o[s]?new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(o,s,c,u,h)}var o=a.bind(null,!1);return o.isRequired=a.bind(null,!0),o}function v(e){return m((function(t,n,r,a,i,o){var s=t[n];return y(s)!==e?new p("Invalid "+a+" `"+i+"` of type `"+E(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function g(e,t,n,r,a){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+a+"`.")}function b(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(b);if(null===e||s(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e[u]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!b(n.value))return!1}else for(;!(n=r.next()).done;){var a=n.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function y(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function E(e){if(null==e)return""+e;var t=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=E(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,h.checkPropTypes=a,h.resetWarningCache=a.resetWarningCache,h.PropTypes=h,h},le}()(ge.isElement,!0)}else G.exports=function(){if(de)return ue;de=1;var e=me();function t(){}function n(){}return n.resetWarningCache=t,ue=function(){function r(t,n,r,a,i,o){if(o!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function a(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();var be=N(G.exports),ye=!1,Ee="production"!==process.env.NODE_ENV?be.oneOfType([be.number,be.shape({enter:be.number,exit:be.number,appear:be.number}).isRequired]):null;"production"!==process.env.NODE_ENV&&be.oneOfType([be.string,be.shape({enter:be.string,exit:be.string,active:be.string}),be.shape({enter:be.string,enterDone:be.string,enterActive:be.string,exit:be.string,exitDone:be.string,exitActive:be.string})]);var we=t.createContext(null),xe="unmounted",Ne="exited",ke="entering",Oe="entered",Le="exiting",Ae=function(e){var n,r;function a(t,n){var r;r=e.call(this,t,n)||this;var a,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(a=Ne,r.appearStatus=ke):a=Oe:a=t.unmountOnExit||t.mountOnEnter?xe:Ne,r.state={status:a},r.nextCallback=null,r}r=e,(n=a).prototype=Object.create(r.prototype),n.prototype.constructor=n,R(n,r),a.getDerivedStateFromProps=function(e,t){return e.in&&t.status===xe?{status:Ne}:null};var i=a.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==ke&&n!==Oe&&(t=ke):n!==ke&&n!==Oe||(t=Le)}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===ke){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:y.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ne&&this.setState({status:xe})},i.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,a=this.props.nodeRef?[r]:[y.findDOMNode(this),r],i=a[0],o=a[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||ye?this.safeSetState({status:Oe},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,o),this.safeSetState({status:ke},(function(){t.props.onEntering(i,o),t.onTransitionEnd(l,(function(){t.safeSetState({status:Oe},(function(){t.props.onEntered(i,o)}))}))})))},i.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:y.findDOMNode(this);t&&!ye?(this.props.onExit(r),this.safeSetState({status:Le},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:Ne},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:Ne},(function(){e.props.onExited(r)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:y.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=a[0],o=a[1];this.props.addEndListener(i,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var e=this.state.status;if(e===xe)return null;var n=this.props,r=n.children;n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef;var a=A(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return t.createElement(we.Provider,{value:null},"function"==typeof r?r(e,a):t.cloneElement(t.Children.only(r),a))},a}(t.Component);function Se(){}Ae.contextType=we,Ae.propTypes="production"!==process.env.NODE_ENV?{nodeRef:be.shape({current:"undefined"==typeof Element?be.any:function(e,t,n,r,a,i){var o=e[t];return be.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,t,n,r,a,i)}}),children:be.oneOfType([be.func.isRequired,be.element.isRequired]).isRequired,in:be.bool,mountOnEnter:be.bool,unmountOnExit:be.bool,appear:be.bool,enter:be.bool,exit:be.bool,timeout:function(e){var t=Ee;e.addEndListener||(t=t.isRequired);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a{n.target===e&&(a(),t(n))}),n+r)}function Be(...e){return e.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}}),null)}function $e(e){e.offsetHeight}const He=e=>e&&"function"!=typeof e?t=>{e.current=t}:e;function Ue(e,t){return o((()=>function(e,t){const n=He(e),r=He(t);return e=>{n&&n(e),r&&r(e)}}(e,t)),[e,t])}function Fe(e){return e&&"setState"in e?y.findDOMNode(e):null!=e?e:null}const Ve=t.forwardRef((({onEnter:e,onEntering:r,onEntered:i,onExit:o,onExiting:s,onExited:l,addEndListener:c,children:u,childRef:d,...h},f)=>{const p=n(null),v=Ue(p,d),g=e=>{v(Fe(e))},b=e=>t=>{e&&p.current&&e(p.current,t)},y=a(b(e),[e]),E=a(b(r),[r]),w=a(b(i),[i]),x=a(b(o),[o]),N=a(b(s),[s]),k=a(b(l),[l]),O=a(b(c),[c]);return m(Ae,{ref:f,...h,onEnter:y,onEntered:w,onEntering:E,onExit:x,onExited:k,onExiting:N,addEndListener:O,nodeRef:p,children:"function"==typeof u?(e,t)=>u(e,{...t,ref:g}):t.cloneElement(u,{ref:g})})}));var ze=Ve;const We={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Ke(e,t){const n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=We[e];return n+parseInt(K(t,r[0]),10)+parseInt(K(t,r[1]),10)}const Ze={[Ne]:"collapse",[Le]:"collapsing",[ke]:"collapsing",[Oe]:"collapse show"};var Ge=t.forwardRef((({onEnter:e,onEntering:n,onEntered:r,onExit:a,onExiting:i,className:s,children:l,dimension:c="height",in:u=!1,timeout:d=300,mountOnEnter:h=!1,unmountOnExit:f=!1,appear:p=!1,getDimensionValue:v=Ke,...g},b)=>{const y="function"==typeof c?c():c,E=o((()=>Be((e=>{e.style[y]="0"}),e)),[y,e]),w=o((()=>Be((e=>{const t=`scroll${y[0].toUpperCase()}${y.slice(1)}`;e.style[y]=`${e[t]}px`}),n)),[y,n]),x=o((()=>Be((e=>{e.style[y]=null}),r)),[y,r]),N=o((()=>Be((e=>{e.style[y]=`${v(y,e)}px`,$e(e)}),a)),[a,v,y]),k=o((()=>Be((e=>{e.style[y]=null}),i)),[y,i]);return m(ze,{ref:b,addEndListener:De,...g,"aria-expanded":g.role?u:null,onEnter:E,onEntering:w,onEntered:x,onExit:N,onExiting:k,childRef:l.ref,in:u,timeout:d,mountOnEnter:h,unmountOnExit:f,appear:p,children:(e,n)=>t.cloneElement(l,{...n,className:O(s,l.props.className,Ze[e],"width"===y&&"collapse-horizontal")})})}));function Ye(e){const t=function(e){const t=n(e);return s((()=>{t.current=e}),[e]),t}(e);return a((function(...e){return t.current&&t.current(...e)}),[t])}var Xe=t=>e.forwardRef(((e,n)=>m("div",{...e,ref:n,className:O(e.className,t)})));function Je(){return r(null)}function Qe(){const e=n(!0),t=n((()=>e.current));return s((()=>(e.current=!0,()=>{e.current=!1})),[]),t.current}function et(e){const t=n(null);return s((()=>{t.current=e})),t.current}const tt="undefined"!=typeof global&&global.navigator&&"ReactNative"===global.navigator.product;var nt="undefined"!=typeof document||tt?l:s;const rt=["as","disabled"];function at({tagName:e,disabled:t,href:n,target:r,rel:a,role:i,onClick:o,tabIndex:s=0,type:l}){e||(e=null!=n||null!=r||null!=a?"a":"button");const c={tagName:e};if("button"===e)return[{type:l||"button",disabled:t},c];const u=r=>{(t||"a"===e&&function(e){return!e||"#"===e.trim()}(n))&&r.preventDefault(),t?r.stopPropagation():null==o||o(r)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=i?i:"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:"a"===e?r:void 0,"aria-disabled":t||void 0,rel:"a"===e?a:void 0,onClick:u,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),u(e))}},c]}const it=e.forwardRef(((e,t)=>{let{as:n,disabled:r}=e,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,rt);const[i,{tagName:o}]=at(Object.assign({tagName:n,disabled:r},a));return m(o,Object.assign({},a,i,{ref:t}))}));it.displayName="Button";const ot=["onKeyDown"];const st=e.forwardRef(((e,t)=>{let{onKeyDown:n}=e,r=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,ot);const[a]=at(Object.assign({tagName:"a"},r)),i=Ye((e=>{a.onKeyDown(e),null==n||n(e)}));return(o=r.href)&&"#"!==o.trim()&&"button"!==r.role?m("a",Object.assign({ref:t},r,{onKeyDown:n})):m("a",Object.assign({ref:t},r,a,{onKeyDown:i}));var o}));st.displayName="Anchor";var lt=st;const ct={[ke]:"show",[Oe]:"show"},ut=e.forwardRef((({className:t,children:n,transitionClasses:r={},onEnter:i,...o},s)=>{const l={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...o},c=a(((e,t)=>{$e(e),null==i||i(e,t)}),[i]);return m(ze,{ref:s,addEndListener:De,...l,onEnter:c,childRef:n.ref,children:(a,i)=>e.cloneElement(n,{...i,className:O("fade",t,n.props.className,ct[a],r[a])})})}));ut.displayName="Fade";var dt=ut;const ht={"aria-label":be.string,onClick:be.func,variant:be.oneOf(["white"])},ft=e.forwardRef((({className:e,variant:t,"aria-label":n="Close",...r},a)=>m("button",{ref:a,type:"button",className:O("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r})));ft.displayName="CloseButton",ft.propTypes=ht;var pt=ft;const mt=e.forwardRef((({as:e,bsPrefix:t,variant:n="primary",size:r,active:a=!1,disabled:i=!1,className:o,...s},l)=>{const c=I(t,"btn"),[u,{tagName:d}]=at({tagName:e,disabled:i,...s});return m(d,{...u,...s,ref:l,disabled:i,className:O(o,c,a&&"active",n&&`${c}-${n}`,r&&`${c}-${r}`,s.href&&i&&"disabled")})}));mt.displayName="Button";var vt=mt;const gt=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"card-body"),m(n,{ref:a,className:O(e,t),...r}))));gt.displayName="CardBody";var bt=gt;const yt=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"card-footer"),m(n,{ref:a,className:O(e,t),...r}))));yt.displayName="CardFooter";var Et=yt;const wt=e.createContext(null);wt.displayName="CardHeaderContext";var xt=wt;const Nt=e.forwardRef((({bsPrefix:e,className:t,as:n="div",...r},a)=>{const i=I(e,"card-header"),s=o((()=>({cardHeaderBsPrefix:i})),[i]);return m(xt.Provider,{value:s,children:m(n,{ref:a,...r,className:O(t,i)})})}));Nt.displayName="CardHeader";var kt=Nt;const Ot=e.forwardRef((({bsPrefix:e,className:t,variant:n,as:r="img",...a},i)=>{const o=I(e,"card-img");return m(r,{ref:i,className:O(n?`${o}-${n}`:o,t),...a})}));Ot.displayName="CardImg";var Lt=Ot;const At=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"card-img-overlay"),m(n,{ref:a,className:O(e,t),...r}))));At.displayName="CardImgOverlay";var St=At;const jt=e.forwardRef((({className:e,bsPrefix:t,as:n="a",...r},a)=>(t=I(t,"card-link"),m(n,{ref:a,className:O(e,t),...r}))));jt.displayName="CardLink";var Mt=jt;const Ct=Xe("h6"),Tt=e.forwardRef((({className:e,bsPrefix:t,as:n=Ct,...r},a)=>(t=I(t,"card-subtitle"),m(n,{ref:a,className:O(e,t),...r}))));Tt.displayName="CardSubtitle";var _t=Tt;const Pt=e.forwardRef((({className:e,bsPrefix:t,as:n="p",...r},a)=>(t=I(t,"card-text"),m(n,{ref:a,className:O(e,t),...r}))));Pt.displayName="CardText";var Rt=Pt;const qt=Xe("h5"),It=e.forwardRef((({className:e,bsPrefix:t,as:n=qt,...r},a)=>(t=I(t,"card-title"),m(n,{ref:a,className:O(e,t),...r}))));It.displayName="CardTitle";var Dt=It;const Bt=e.forwardRef((({bsPrefix:e,className:t,bg:n,text:r,border:a,body:i=!1,children:o,as:s="div",...l},c)=>{const u=I(e,"card");return m(s,{ref:c,...l,className:O(t,u,n&&`bg-${n}`,r&&`text-${r}`,a&&`border-${a}`),children:i?m(bt,{children:o}):o})}));Bt.displayName="Card";var $t=Object.assign(Bt,{Img:Lt,Title:Dt,Subtitle:_t,Body:bt,Link:Mt,Text:Rt,Header:kt,Footer:Et,ImgOverlay:St});function Ht(e){const t=function(e){const t=n(e);return t.current=e,t}(e);s((()=>()=>t.current()),[])}const Ut=2**31-1;function Ft(e,t,n){const r=n-Date.now();e.current=r<=Ut?setTimeout(t,r):setTimeout((()=>Ft(e,t,n)),Ut)}function Vt(){const e=Qe(),t=n();return Ht((()=>clearTimeout(t.current))),o((()=>{const n=()=>clearTimeout(t.current);return{set:function(r,a=0){e()&&(n(),a<=Ut?t.current=setTimeout(r,a):Ft(t,r,Date.now()+a))},clear:n,handleRef:t}}),[])}const zt=e.forwardRef(((e,t)=>{const[{className:n,...r},{as:a="div",bsPrefix:i,spans:o}]=function({as:e,bsPrefix:t,className:n,...r}){t=I(t,"col");const a=D(),i=B(),o=[],s=[];return a.forEach((e=>{const n=r[e];let a,l,c;delete r[e],"object"==typeof n&&null!=n?({span:a,offset:l,order:c}=n):a=n;const u=e!==i?`-${e}`:"";a&&o.push(!0===a?`${t}${u}`:`${t}${u}-${a}`),null!=c&&s.push(`order${u}-${c}`),null!=l&&s.push(`offset${u}-${l}`)})),[{...r,className:O(n,...o,...s)},{as:e,bsPrefix:t,spans:o}]}(e);return m(a,{...r,ref:t,className:O(n,!o.length&&i)})}));zt.displayName="Col";var Wt=zt;const Kt=e.forwardRef((({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...a},i)=>{const o=I(e,"container");return m(n,{ref:i,...a,className:O(r,t?`${o}${"string"==typeof t?`-${t}`:"-fluid"}`:o)})}));Kt.displayName="Container";var Zt=Kt,Gt=Function.prototype.bind.call(Function.prototype.call,[].slice);function Yt(e,t){return Gt(e.querySelectorAll(t))}function Xt(){const[,e]=c((e=>!e),!1);return e}var Jt=e.createContext(null),Qt=Object.prototype.hasOwnProperty;function en(e,t,n){for(n of e.keys())if(tn(n,t))return n}function tn(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&tn(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((a=r)&&"object"==typeof a&&!(a=en(t,a)))return!1;if(!t.has(a))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((a=r[0])&&"object"==typeof a&&!(a=en(t,a)))return!1;if(!tn(r[1],t.get(a)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(Qt.call(e,n)&&++r&&!Qt.call(t,n))return!1;if(!(n in t)||!tn(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}var nn="top",rn="bottom",an="right",on="left",sn="auto",ln=[nn,rn,an,on],cn="start",un="end",dn="clippingParents",hn="viewport",fn="popper",pn="reference",mn=ln.reduce((function(e,t){return e.concat([t+"-"+cn,t+"-"+un])}),[]),vn=[].concat(ln,[sn]).reduce((function(e,t){return e.concat([t,t+"-"+cn,t+"-"+un])}),[]),gn=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function bn(e){return e.split("-")[0]}function yn(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function En(e){return e instanceof yn(e).Element||e instanceof Element}function wn(e){return e instanceof yn(e).HTMLElement||e instanceof HTMLElement}function xn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof yn(e).ShadowRoot||e instanceof ShadowRoot)}var Nn=Math.max,kn=Math.min,On=Math.round;function Ln(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function An(){return!/^((?!chrome|android).)*safari/i.test(Ln())}function Sn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),a=1,i=1;t&&wn(e)&&(a=e.offsetWidth>0&&On(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&On(r.height)/e.offsetHeight||1);var o=(En(e)?yn(e):window).visualViewport,s=!An()&&n,l=(r.left+(s&&o?o.offsetLeft:0))/a,c=(r.top+(s&&o?o.offsetTop:0))/i,u=r.width/a,d=r.height/i;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function jn(e){var t=Sn(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Mn(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&xn(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Cn(e){return e?(e.nodeName||"").toLowerCase():null}function Tn(e){return yn(e).getComputedStyle(e)}function _n(e){return["table","td","th"].indexOf(Cn(e))>=0}function Pn(e){return((En(e)?e.ownerDocument:e.document)||window.document).documentElement}function Rn(e){return"html"===Cn(e)?e:e.assignedSlot||e.parentNode||(xn(e)?e.host:null)||Pn(e)}function qn(e){return wn(e)&&"fixed"!==Tn(e).position?e.offsetParent:null}function In(e){for(var t=yn(e),n=qn(e);n&&_n(n)&&"static"===Tn(n).position;)n=qn(n);return n&&("html"===Cn(n)||"body"===Cn(n)&&"static"===Tn(n).position)?t:n||function(e){var t=/firefox/i.test(Ln());if(/Trident/i.test(Ln())&&wn(e)&&"fixed"===Tn(e).position)return null;var n=Rn(e);for(xn(n)&&(n=n.host);wn(n)&&["html","body"].indexOf(Cn(n))<0;){var r=Tn(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Dn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bn(e,t,n){return Nn(e,kn(t,n))}function $n(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Hn(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Un={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,a=e.options,i=n.elements.arrow,o=n.modifiersData.popperOffsets,s=bn(n.placement),l=Dn(s),c=[on,an].indexOf(s)>=0?"height":"width";if(i&&o){var u=function(e,t){return $n("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Hn(e,ln))}(a.padding,n),d=jn(i),h="y"===l?nn:on,f="y"===l?rn:an,p=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],m=o[l]-n.rects.reference[l],v=In(i),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=p/2-m/2,y=u[h],E=g-d[c]-u[f],w=g/2-d[c]/2+b,x=Bn(y,w,E),N=l;n.modifiersData[r]=((t={})[N]=x,t.centerOffset=x-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Mn(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fn(e){return e.split("-")[1]}var Vn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function zn(e){var t,n=e.popper,r=e.popperRect,a=e.placement,i=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=void 0===h?0:h,p=o.y,m=void 0===p?0:p,v="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var g=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=on,E=nn,w=window;if(c){var x=In(n),N="clientHeight",k="clientWidth";if(x===yn(n)&&"static"!==Tn(x=Pn(n)).position&&"absolute"===s&&(N="scrollHeight",k="scrollWidth"),a===nn||(a===on||a===an)&&i===un)E=rn,m-=(d&&x===w&&w.visualViewport?w.visualViewport.height:x[N])-r.height,m*=l?1:-1;if(a===on||(a===nn||a===rn)&&i===un)y=an,f-=(d&&x===w&&w.visualViewport?w.visualViewport.width:x[k])-r.width,f*=l?1:-1}var O,L=Object.assign({position:s},c&&Vn),A=!0===u?function(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:On(n*a)/a||0,y:On(r*a)/a||0}}({x:f,y:m},yn(n)):{x:f,y:m};return f=A.x,m=A.y,l?Object.assign({},L,((O={})[E]=b?"0":"",O[y]=g?"0":"",O.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",O)):Object.assign({},L,((t={})[E]=b?m+"px":"",t[y]=g?f+"px":"",t.transform="",t))}var Wn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=void 0===r||r,i=n.adaptive,o=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:bn(t.placement),variation:Fn(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,zn(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,zn(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Kn={passive:!0};var Zn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,i=void 0===a||a,o=r.resize,s=void 0===o||o,l=yn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,Kn)})),s&&l.addEventListener("resize",n.update,Kn),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Kn)})),s&&l.removeEventListener("resize",n.update,Kn)}},data:{}},Gn={left:"right",right:"left",bottom:"top",top:"bottom"};function Yn(e){return e.replace(/left|right|bottom|top/g,(function(e){return Gn[e]}))}var Xn={start:"end",end:"start"};function Jn(e){return e.replace(/start|end/g,(function(e){return Xn[e]}))}function Qn(e){var t=yn(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function er(e){return Sn(Pn(e)).left+Qn(e).scrollLeft}function tr(e){var t=Tn(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function nr(e){return["html","body","#document"].indexOf(Cn(e))>=0?e.ownerDocument.body:wn(e)&&tr(e)?e:nr(Rn(e))}function rr(e,t){var n;void 0===t&&(t=[]);var r=nr(e),a=r===(null==(n=e.ownerDocument)?void 0:n.body),i=yn(r),o=a?[i].concat(i.visualViewport||[],tr(r)?r:[]):r,s=t.concat(o);return a?s:s.concat(rr(Rn(o)))}function ar(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ir(e,t,n){return t===hn?ar(function(e,t){var n=yn(e),r=Pn(e),a=n.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;var c=An();(c||!c&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:i,height:o,x:s+er(e),y:l}}(e,n)):En(t)?function(e,t){var n=Sn(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ar(function(e){var t,n=Pn(e),r=Qn(e),a=null==(t=e.ownerDocument)?void 0:t.body,i=Nn(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=Nn(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),s=-r.scrollLeft+er(e),l=-r.scrollTop;return"rtl"===Tn(a||n).direction&&(s+=Nn(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:s,y:l}}(Pn(e)))}function or(e,t,n,r){var a="clippingParents"===t?function(e){var t=rr(Rn(e)),n=["absolute","fixed"].indexOf(Tn(e).position)>=0&&wn(e)?In(e):e;return En(n)?t.filter((function(e){return En(e)&&Mn(e,n)&&"body"!==Cn(e)})):[]}(e):[].concat(t),i=[].concat(a,[n]),o=i[0],s=i.reduce((function(t,n){var a=ir(e,n,r);return t.top=Nn(a.top,t.top),t.right=kn(a.right,t.right),t.bottom=kn(a.bottom,t.bottom),t.left=Nn(a.left,t.left),t}),ir(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function sr(e){var t,n=e.reference,r=e.element,a=e.placement,i=a?bn(a):null,o=a?Fn(a):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case nn:t={x:s,y:n.y-r.height};break;case rn:t={x:s,y:n.y+n.height};break;case an:t={x:n.x+n.width,y:l};break;case on:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Dn(i):null;if(null!=c){var u="y"===c?"height":"width";switch(o){case cn:t[c]=t[c]-(n[u]/2-r[u]/2);break;case un:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function lr(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=void 0===r?e.placement:r,i=n.strategy,o=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?dn:s,c=n.rootBoundary,u=void 0===c?hn:c,d=n.elementContext,h=void 0===d?fn:d,f=n.altBoundary,p=void 0!==f&&f,m=n.padding,v=void 0===m?0:m,g=$n("number"!=typeof v?v:Hn(v,ln)),b=h===fn?pn:fn,y=e.rects.popper,E=e.elements[p?b:h],w=or(En(E)?E:E.contextElement||Pn(e.elements.popper),l,u,o),x=Sn(e.elements.reference),N=sr({reference:x,element:y,strategy:"absolute",placement:a}),k=ar(Object.assign({},y,N)),O=h===fn?k:x,L={top:w.top-O.top+g.top,bottom:O.bottom-w.bottom+g.bottom,left:w.left-O.left+g.left,right:O.right-w.right+g.right},A=e.modifiersData.offset;if(h===fn&&A){var S=A[a];Object.keys(L).forEach((function(e){var t=[an,rn].indexOf(e)>=0?1:-1,n=[nn,rn].indexOf(e)>=0?"y":"x";L[e]+=S[n]*t}))}return L}function cr(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=n.boundary,i=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?vn:l,u=Fn(r),d=u?s?mn:mn.filter((function(e){return Fn(e)===u})):ln,h=d.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=d);var f=h.reduce((function(t,n){return t[n]=lr(e,{placement:n,boundary:a,rootBoundary:i,padding:o})[bn(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}var ur={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,i=void 0===a||a,o=n.altAxis,s=void 0===o||o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=bn(v),b=l||(g===v||!p?[Yn(v)]:function(e){if(bn(e)===sn)return[];var t=Yn(e);return[Jn(e),t,Jn(t)]}(v)),y=[v].concat(b).reduce((function(e,n){return e.concat(bn(n)===sn?cr(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),E=t.rects.reference,w=t.rects.popper,x=new Map,N=!0,k=y[0],O=0;O=0,M=j?"width":"height",C=lr(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),T=j?S?an:on:S?rn:nn;E[M]>w[M]&&(T=Yn(T));var _=Yn(T),P=[];if(i&&P.push(C[A]<=0),s&&P.push(C[T]<=0,C[_]<=0),P.every((function(e){return e}))){k=L,N=!1;break}x.set(L,P)}if(N)for(var R=function(e){var t=y.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},q=p?3:1;q>0;q--){if("break"===R(q))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dr(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hr(e){return[nn,an,rn,on].some((function(t){return e[t]>=0}))}var fr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,i=t.modifiersData.preventOverflow,o=lr(t,{elementContext:"reference"}),s=lr(t,{altBoundary:!0}),l=dr(o,r),c=dr(s,a,i),u=hr(l),d=hr(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var pr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.offset,i=void 0===a?[0,0]:a,o=vn.reduce((function(e,n){return e[n]=function(e,t,n){var r=bn(e),a=[on,nn].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=i[0],s=i[1];return o=o||0,s=(s||0)*a,[on,an].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}(n,t.rects,i),e}),{}),s=o[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=o}};var mr={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=sr({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var vr={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,i=void 0===a||a,o=n.altAxis,s=void 0!==o&&o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=void 0===h||h,p=n.tetherOffset,m=void 0===p?0:p,v=lr(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=bn(t.placement),b=Fn(t.placement),y=!b,E=Dn(g),w="x"===E?"y":"x",x=t.modifiersData.popperOffsets,N=t.rects.reference,k=t.rects.popper,O="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(x){if(i){var j,M="y"===E?nn:on,C="y"===E?rn:an,T="y"===E?"height":"width",_=x[E],P=_+v[M],R=_-v[C],q=f?-k[T]/2:0,I=b===cn?N[T]:k[T],D=b===cn?-k[T]:-N[T],B=t.elements.arrow,$=f&&B?jn(B):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=H[M],F=H[C],V=Bn(0,N[T],$[T]),z=y?N[T]/2-q-V-U-L.mainAxis:I-V-U-L.mainAxis,W=y?-N[T]/2+q+V+F+L.mainAxis:D+V+F+L.mainAxis,K=t.elements.arrow&&In(t.elements.arrow),Z=K?"y"===E?K.clientTop||0:K.clientLeft||0:0,G=null!=(j=null==A?void 0:A[E])?j:0,Y=_+W-G,X=Bn(f?kn(P,_+z-G-Z):P,_,f?Nn(R,Y):R);x[E]=X,S[E]=X-_}if(s){var J,Q="x"===E?nn:on,ee="x"===E?rn:an,te=x[w],ne="y"===w?"height":"width",re=te+v[Q],ae=te-v[ee],ie=-1!==[nn,on].indexOf(g),oe=null!=(J=null==A?void 0:A[w])?J:0,se=ie?re:te-N[ne]-k[ne]-oe+L.altAxis,le=ie?te+N[ne]+k[ne]-oe-L.altAxis:ae,ce=f&&ie?function(e,t,n){var r=Bn(e,t,n);return r>n?n:r}(se,te,le):Bn(f?se:re,te,f?le:ae);x[w]=ce,S[w]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function gr(e,t,n){void 0===n&&(n=!1);var r,a,i=wn(t),o=wn(t)&&function(e){var t=e.getBoundingClientRect(),n=On(t.width)/e.offsetWidth||1,r=On(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Pn(t),l=Sn(e,o,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==Cn(t)||tr(s))&&(c=(r=t)!==yn(r)&&wn(r)?{scrollLeft:(a=r).scrollLeft,scrollTop:a.scrollTop}:Qn(r)),wn(t)?((u=Sn(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=er(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function br(e){var t=new Map,n=new Set,r=[];function a(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&a(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||a(e)})),r}var yr={placement:"bottom",modifiers:[],strategy:"absolute"};function Er(){for(var e=arguments.length,t=new Array(e),n=0;n{}},Or={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const e=(t.getAttribute("aria-describedby")||"").split(",").filter((e=>e.trim()!==n.id));e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,a=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===a&&"setAttribute"in r){const e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},Lr=[];function Ar(e,t,i={}){let{enabled:l=!0,placement:c="bottom",strategy:u="absolute",modifiers:d=Lr}=i,h=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(i,Nr);const f=n(d),p=n(),m=a((()=>{var e;null==(e=p.current)||e.update()}),[]),v=a((()=>{var e;null==(e=p.current)||e.forceUpdate()}),[]),[g,b]=function(e){const t=Qe();return[e[0],a((n=>{if(t())return e[1](n)}),[t,e[1]])]}(r({placement:c,update:m,forceUpdate:v,attributes:{},styles:{popper:{},arrow:{}}})),y=o((()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{const t={},n={};Object.keys(e.elements).forEach((r=>{t[r]=e.styles[r],n[r]=e.attributes[r]})),b({state:e,styles:t,attributes:n,update:m,forceUpdate:v,placement:e.placement})}})),[m,v,b]),E=o((()=>(tn(f.current,d)||(f.current=d),f.current)),[d]);return s((()=>{p.current&&l&&p.current.setOptions({placement:c,strategy:u,modifiers:[...E,y,kr]})}),[u,c,y,l,E]),s((()=>{if(l&&null!=e&&null!=t)return p.current=xr(e,t,Object.assign({},h,{placement:c,strategy:u,modifiers:[...E,Or,y]})),()=>{null!=p.current&&(p.current.destroy(),p.current=void 0,b((e=>Object.assign({},e,{attributes:{},styles:{popper:{}}}))))}}),[l,e,t]),g}function Sr(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var jr=function(){};if("production"!==process.env.NODE_ENV){var Mr=function(e,t){var n=arguments.length;t=new Array(n>1?n-1:0);for(var r=1;r2?r-2:0);for(var a=2;a{};const _r=e=>e&&("current"in e?e.current:e),Pr={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function Rr(e,t=Tr,{disabled:r,clickTrigger:i="click"}={}){const o=n(!1),l=n(!1),c=a((t=>{const n=_r(e);var r;Cr(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!n||!!((r=t).metaKey||r.altKey||r.ctrlKey||r.shiftKey)||!function(e){return 0===e.button}(t)||!!Sr(n,t.target)||l.current,l.current=!1}),[e]),u=Ye((t=>{const n=_r(e);n&&Sr(n,t.target)&&(l.current=!0)})),d=Ye((e=>{o.current||t(e)}));s((()=>{var t,n;if(r||null==e)return;const a=H(_r(e)),o=a.defaultView||window;let s=null!=(t=o.event)?t:null==(n=o.parent)?void 0:n.event,l=null;Pr[i]&&(l=Pe(a,Pr[i],u,!0));const h=Pe(a,i,c,!0),f=Pe(a,i,(e=>{e!==s?d(e):s=void 0}));let p=[];return"ontouchstart"in a.documentElement&&(p=[].slice.call(a.body.children).map((e=>Pe(e,"mousemove",Tr)))),()=>{null==l||l(),h(),f(),p.forEach((e=>e()))}}),[e,r,i,c,u,d])}function qr(e={}){return Array.isArray(e)?e:Object.keys(e).map((t=>(e[t].name=t,e[t])))}function Ir({enabled:e,enableEvents:t,placement:n,flip:r,offset:a,fixed:i,containerPadding:o,arrowElement:s,popperConfig:l={}}){var c,u,d,h,f;const p=function(e){const t={};return Array.isArray(e)?(null==e||e.forEach((e=>{t[e.name]=e})),t):e||t}(l.modifiers);return Object.assign({},l,{placement:n,enabled:e,strategy:i?"fixed":l.strategy,modifiers:qr(Object.assign({},p,{eventListeners:{enabled:t,options:null==(c=p.eventListeners)?void 0:c.options},preventOverflow:Object.assign({},p.preventOverflow,{options:o?Object.assign({padding:o},null==(u=p.preventOverflow)?void 0:u.options):null==(d=p.preventOverflow)?void 0:d.options}),offset:{options:Object.assign({offset:a},null==(h=p.offset)?void 0:h.options)},arrow:Object.assign({},p.arrow,{enabled:!!s,options:Object.assign({},null==(f=p.arrow)?void 0:f.options,{element:s})}),flip:Object.assign({enabled:!!r},p.flip)}))})}const Dr=["children"];const Br=()=>{};function $r(e={}){const t=i(Jt),[r,a]=Je(),o=n(!1),{flip:s,offset:l,rootCloseEvent:c,fixed:u=!1,placement:d,popperConfig:h={},enableEventListeners:f=!0,usePopper:p=!!t}=e,m=null==(null==t?void 0:t.show)?!!e.show:t.show;m&&!o.current&&(o.current=!0);const{placement:v,setMenu:g,menuElement:b,toggleElement:y}=t||{},E=Ar(y,b,Ir({placement:d||v||"bottom-start",enabled:p,enableEvents:null==f?m:f,offset:l,flip:s,fixed:u,arrowElement:r,popperConfig:h})),w=Object.assign({ref:g||Br,"aria-labelledby":null==y?void 0:y.id},E.attributes.popper,{style:E.styles.popper}),x={show:m,placement:v,hasShown:o.current,toggle:null==t?void 0:t.toggle,popper:p?E:null,arrowProps:p?Object.assign({ref:a},E.attributes.arrow,{style:E.styles.arrow}):{}};return Rr(b,(e=>{null==t||t.toggle(!1,e)}),{clickTrigger:c,disabled:!m}),[w,x]}function Hr(e){let{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,Dr);const[r,a]=$r(n);return m(v,{children:t(r,a)})}Hr.displayName="DropdownMenu",Hr.defaultProps={usePopper:!0};const Ur={prefix:String(Math.round(1e10*Math.random())),current:0},Fr=t.createContext(Ur),Vr=t.createContext(!1);let zr=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Wr=new WeakMap;const Kr="function"==typeof t.useId?function(e){let n=t.useId(),[a]=r("function"==typeof t.useSyncExternalStore?t.useSyncExternalStore(Yr,Zr,Gr):i(Vr)),o=a||"test"===process.env.NODE_ENV?"react-aria":`react-aria${Ur.prefix}`;return e||`${o}-${n}`}:function(e){let r=i(Fr);r!==Ur||zr||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let a=function(e=!1){let r=i(Fr),a=n(null);if(null===a.current&&!e){var o,s;let e=null===(s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===s||null===(o=s.ReactCurrentOwner)||void 0===o?void 0:o.current;if(e){let t=Wr.get(e);null==t?Wr.set(e,{id:r.current,state:e.memoizedState}):e.memoizedState!==t.state&&(r.current=t.id,Wr.delete(e))}a.current=++r.current}return a.current}(!!e),o=r===Ur&&"test"===process.env.NODE_ENV?"react-aria":`react-aria${r.prefix}`;return e||`${o}-${a}`};function Zr(){return!1}function Gr(){return!0}function Yr(e){return()=>{}}const Xr=e=>{var t;return"menu"===(null==(t=e.getAttribute("role"))?void 0:t.toLowerCase())},Jr=()=>{};function Qr(){const e=Kr(),{show:t=!1,toggle:n=Jr,setToggle:r,menuElement:o}=i(Jt)||{},s=a((e=>{n(!t,e)}),[t,n]),l={id:e,ref:r||Jr,onClick:s,"aria-expanded":!!t};return o&&Xr(o)&&(l["aria-haspopup"]=!0),[l,{show:t,toggle:n}]}function ea({children:e}){const[t,n]=Qr();return m(v,{children:e(t,n)})}ea.displayName="DropdownToggle";const ta=e.createContext(null),na=(e,t=null)=>null!=e?String(e):t||null,ra=e.createContext(null);ra.displayName="NavContext";var aa=ra;const ia="data-rr-ui-";function oa(e){return`${ia}${e}`}const sa=["eventKey","disabled","onClick","active","as"];function la({key:e,href:t,active:n,disabled:r,onClick:a}){const o=i(ta),s=i(aa),{activeKey:l}=s||{},c=na(e,t),u=null==n&&null!=e?na(l)===c:n;return[{onClick:Ye((e=>{r||(null==a||a(e),o&&!e.isPropagationStopped()&&o(c,e))})),"aria-disabled":r||void 0,"aria-selected":u,[oa("dropdown-item")]:""},{isActive:u}]}const ca=e.forwardRef(((e,t)=>{let{eventKey:n,disabled:r,onClick:a,active:i,as:o=it}=e,s=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,sa);const[l]=la({key:n,href:s.href,disabled:r,onClick:a,active:i});return m(o,Object.assign({},s,{ref:t},l))}));ca.displayName="DropdownItem";const ua=u(je?window:void 0);function da(){return i(ua)}function ha(){const e=Xt(),t=n(null),r=a((n=>{t.current=n,e()}),[e]);return[t,r]}function fa({defaultShow:e,show:t,onSelect:l,onToggle:c,itemSelector:u=`* [${oa("dropdown-item")}]`,focusFirstItemOnShow:d,placement:h="bottom-start",children:f}){const p=da(),[v,g]=function(e,t,i){const o=n(void 0!==e),[s,l]=r(t),c=void 0!==e,u=o.current;return o.current=c,!c&&u&&s!==t&&l(t),[c?e:s,a(((...e)=>{const[t,...n]=e;let r=null==i?void 0:i(t,...n);return l(t),r}),[i])]}(t,e,c),[b,y]=ha(),E=b.current,[w,x]=ha(),N=w.current,k=et(v),O=n(null),L=n(!1),A=i(ta),S=a(((e,t,n=(null==t?void 0:t.type))=>{g(e,{originalEvent:t,source:n})}),[g]),j=Ye(((e,t)=>{null==l||l(e,t),S(!1,t,"select"),t.isPropagationStopped()||null==A||A(e,t)})),M=o((()=>({toggle:S,placement:h,show:v,menuElement:E,toggleElement:N,setMenu:y,setToggle:x})),[S,h,v,E,N,y,x]);E&&k&&!v&&(L.current=E.contains(E.ownerDocument.activeElement));const C=Ye((()=>{N&&N.focus&&N.focus()})),T=Ye((()=>{const e=O.current;let t=d;if(null==t&&(t=!(!b.current||!Xr(b.current))&&"keyboard"),!1===t||"keyboard"===t&&!/^key.+$/.test(e))return;const n=Yt(b.current,u)[0];n&&n.focus&&n.focus()}));s((()=>{v?T():L.current&&(L.current=!1,C())}),[v,L,C,T]),s((()=>{O.current=null}));const _=(e,t)=>{if(!b.current)return null;const n=Yt(b.current,u);let r=n.indexOf(e)+t;return r=Math.max(0,Math.min(r,n.length)),n[r]};return function(e,t,n,r=!1){const a=Ye(n);s((()=>{const n="function"==typeof e?e():e;return n.addEventListener(t,a,r),()=>n.removeEventListener(t,a,r)}),[e])}(a((()=>p.document),[p]),"keydown",(e=>{var t,n;const{key:r}=e,a=e.target,i=null==(t=b.current)?void 0:t.contains(a),o=null==(n=w.current)?void 0:n.contains(a);if(/input|textarea/i.test(a.tagName)&&(" "===r||"Escape"!==r&&i||"Escape"===r&&"search"===a.type))return;if(!i&&!o)return;if(!("Tab"!==r||b.current&&v))return;O.current=e.type;const s={originalEvent:e,source:e.type};switch(r){case"ArrowUp":{const t=_(a,-1);return t&&t.focus&&t.focus(),void e.preventDefault()}case"ArrowDown":if(e.preventDefault(),v){const e=_(a,1);e&&e.focus&&e.focus()}else g(!0,s);return;case"Tab":_e(a.ownerDocument,"keyup",(e=>{var t;("Tab"!==e.key||e.target)&&null!=(t=b.current)&&t.contains(e.target)||g(!1,s)}),{once:!0});break;case"Escape":"Escape"===r&&(e.preventDefault(),e.stopPropagation()),g(!1,s)}})),m(ta.Provider,{value:j,children:m(Jt.Provider,{value:M,children:f})})}ua.Provider,fa.displayName="Dropdown",fa.Menu=Hr,fa.Toggle=ea,fa.Item=ca;const pa=e.createContext({});pa.displayName="DropdownContext";var ma=pa;const va=e.forwardRef((({className:e,bsPrefix:t,as:n="hr",role:r="separator",...a},i)=>(t=I(t,"dropdown-divider"),m(n,{ref:i,className:O(e,t),role:r,...a}))));va.displayName="DropdownDivider";var ga=va;const ba=e.forwardRef((({className:e,bsPrefix:t,as:n="div",role:r="heading",...a},i)=>(t=I(t,"dropdown-header"),m(n,{ref:i,className:O(e,t),role:r,...a}))));ba.displayName="DropdownHeader";var ya=ba;const Ea=e.forwardRef((({bsPrefix:e,className:t,eventKey:n,disabled:r=!1,onClick:a,active:i,as:o=lt,...s},l)=>{const c=I(e,"dropdown-item"),[u,d]=la({key:n,href:s.href,disabled:r,onClick:a,active:i});return m(o,{...s,...u,ref:l,className:O(t,c,d.isActive&&"active",r&&"disabled")})}));Ea.displayName="DropdownItem";var wa=Ea;const xa=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},a)=>(t=I(t,"dropdown-item-text"),m(n,{ref:a,className:O(e,t),...r}))));xa.displayName="DropdownItemText";var Na=xa;const ka=e.createContext(null);ka.displayName="InputGroupContext";var Oa=ka;const La=e.createContext(null);La.displayName="NavbarContext";var Aa=La;function Sa(e,t){if("production"===process.env.NODE_ENV)return e;return Ue(a((e=>{null!=e&&e.isReactComponent&&("production"!==process.env.NODE_ENV?M(!1,`${t} injected a ref to a provided \`as\` component that resolved to a component instance instead of a DOM element. Use \`React.forwardRef\` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element`):M(!1))}),[t]),e)}function ja(e,t,n){let r=e?n?"bottom-start":"bottom-end":n?"bottom-end":"bottom-start";return"up"===t?r=e?n?"top-start":"top-end":n?"top-end":"top-start":"end"===t?r=e?n?"left-end":"right-end":n?"left-start":"right-start":"start"===t?r=e?n?"right-end":"left-end":n?"right-start":"left-start":"down-centered"===t?r="bottom":"up-centered"===t&&(r="top"),r}const Ma=e.forwardRef((({bsPrefix:e,className:t,align:n,rootCloseEvent:r,flip:a=!0,show:o,renderOnMount:s,as:l="div",popperConfig:c,variant:u,...d},h)=>{let f=!1;const p=i(Aa),v=I(e,"dropdown-menu"),{align:g,drop:b,isRTL:y}=i(ma);n=n||g;const E=i(Oa),w=[];if(n)if("object"==typeof n){const e=Object.keys(n);if("production"!==process.env.NODE_ENV&&Cr(1===e.length,"There should only be 1 breakpoint when passing an object to `align`"),e.length){const t=e[0],r=n[t];f="start"===r,w.push(`${v}-${t}-${r}`)}}else"end"===n&&(f=!0);const x=ja(f,b,y),[N,{hasShown:k,popper:L,show:A,toggle:S}]=$r({flip:a,rootCloseEvent:r,show:o,usePopper:!p&&0===w.length,offset:[0,2],popperConfig:c,placement:x});if(N.ref=Ue(Sa(h,"DropdownMenu"),N.ref),nt((()=>{A&&(null==L||L.update())}),[A]),!k&&!s&&!E)return null;"string"!=typeof l&&(N.show=A,N.close=()=>null==S?void 0:S(!1),N.align=n);let j=d.style;return null!=L&&L.placement&&(j={...d.style,...N.style},d["x-placement"]=L.placement),m(l,{...d,...N,style:j,...(w.length||p)&&{"data-bs-popper":"static"},className:O(t,v,A&&"show",f&&`${v}-end`,u&&`${v}-${u}`,...w)})}));Ma.displayName="DropdownMenu";var Ca=Ma;const Ta=e.forwardRef((({bsPrefix:e,split:t,className:n,childBsPrefix:r,as:a=vt,...o},s)=>{const l=I(e,"dropdown-toggle"),c=i(Jt);void 0!==r&&(o.bsPrefix=r);const[u]=Qr();return u.ref=Ue(u.ref,Sa(s,"DropdownToggle")),m(a,{className:O(n,l,t&&`${l}-split`,(null==c?void 0:c.show)&&"show"),...u,...o})}));Ta.displayName="DropdownToggle";var _a=Ta;const Pa=e.forwardRef(((e,t)=>{const{bsPrefix:n,drop:r="down",show:a,className:s,align:l="start",onSelect:c,onToggle:u,focusFirstItemOnShow:d,as:h="div",navbar:f,autoClose:p=!0,...v}=P(e,{show:"onToggle"}),g=i(Oa),b=I(n,"dropdown"),y=$(),E=Ye(((e,t)=>{var n,r;var a;(null==(n=t.originalEvent)||null==(r=n.target)?void 0:r.classList.contains("dropdown-toggle"))&&"mousedown"===t.source||(t.originalEvent.currentTarget!==document||"keydown"===t.source&&"Escape"!==t.originalEvent.key||(t.source="rootClose"),a=t.source,(!1===p?"click"===a:"inside"===p?"rootClose"!==a:"outside"!==p||"select"!==a)&&(null==u||u(e,t)))})),w=ja("end"===l,r,y),x=o((()=>({align:l,drop:r,isRTL:y})),[l,r,y]),N={down:b,"down-centered":`${b}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return m(ma.Provider,{value:x,children:m(fa,{placement:w,show:a,onSelect:c,onToggle:E,focusFirstItemOnShow:d,itemSelector:`.${b}-item:not(.disabled):not(:disabled)`,children:g?v.children:m(h,{...v,ref:t,className:O(s,a&&"show",N[r])})})})}));Pa.displayName="Dropdown";var Ra=Object.assign(Pa,{Toggle:_a,Menu:Ca,Item:wa,ItemText:Na,Divider:ga,Header:ya});const qa={type:be.string,tooltip:be.bool,as:be.elementType},Ia=e.forwardRef((({as:e="div",className:t,type:n="valid",tooltip:r=!1,...a},i)=>m(e,{...a,ref:i,className:O(t,`${n}-${r?"tooltip":"feedback"}`)})));Ia.displayName="Feedback",Ia.propTypes=qa;var Da=Ia;var Ba=e.createContext({});const $a=e.forwardRef((({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:a=!1,isInvalid:o=!1,as:s="input",...l},c)=>{const{controlId:u}=i(Ba);return t=I(t,"form-check-input"),m(s,{...l,ref:c,type:r,id:e||u,className:O(n,t,a&&"is-valid",o&&"is-invalid")})}));$a.displayName="FormCheckInput";var Ha=$a;const Ua=e.forwardRef((({bsPrefix:e,className:t,htmlFor:n,...r},a)=>{const{controlId:o}=i(Ba);return e=I(e,"form-check-label"),m("label",{...r,ref:a,htmlFor:n||o,className:O(t,e)})}));Ua.displayName="FormCheckLabel";var Fa=Ua;const Va=e.forwardRef((({id:t,bsPrefix:n,bsSwitchPrefix:r,inline:a=!1,reverse:s=!1,disabled:l=!1,isValid:c=!1,isInvalid:u=!1,feedbackTooltip:d=!1,feedback:h,feedbackType:f,className:p,style:b,title:y="",type:E="checkbox",label:w,children:x,as:N="input",...k},L)=>{n=I(n,"form-check"),r=I(r,"form-switch");const{controlId:A}=i(Ba),S=o((()=>({controlId:t||A})),[A,t]),j=!x&&null!=w&&!1!==w||function(t,n){return e.Children.toArray(t).some((t=>e.isValidElement(t)&&t.type===n))}(x,Fa),M=m(Ha,{...k,type:"switch"===E?"checkbox":E,ref:L,isValid:c,isInvalid:u,disabled:l,as:N});return m(Ba.Provider,{value:S,children:m("div",{style:b,className:O(p,j&&n,a&&`${n}-inline`,s&&`${n}-reverse`,"switch"===E&&r),children:x||g(v,{children:[M,j&&m(Fa,{title:y,children:w}),h&&m(Da,{type:f,tooltip:d,children:h})]})})})}));Va.displayName="FormCheck";var za=Object.assign(Va,{Input:Ha,Label:Fa});const Wa=e.forwardRef((({bsPrefix:e,type:t,size:n,htmlSize:r,id:a,className:o,isValid:s=!1,isInvalid:l=!1,plaintext:c,readOnly:u,as:d="input",...h},f)=>{const{controlId:p}=i(Ba);return e=I(e,"form-control"),"production"!==process.env.NODE_ENV&&Cr(null==p||!a,"`controlId` is ignored on `` when `id` is specified."),m(d,{...h,type:t,size:r,ref:f,readOnly:u,id:a||p,className:O(o,c?`${e}-plaintext`:e,n&&`${e}-${n}`,"color"===t&&`${e}-color`,s&&"is-valid",l&&"is-invalid")})}));Wa.displayName="FormControl";var Ka=Object.assign(Wa,{Feedback:Da});const Za=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"form-floating"),m(n,{ref:a,className:O(e,t),...r}))));Za.displayName="FormFloating";var Ga=Za;const Ya=e.forwardRef((({controlId:e,as:t="div",...n},r)=>{const a=o((()=>({controlId:e})),[e]);return m(Ba.Provider,{value:a,children:m(t,{...n,ref:r})})}));Ya.displayName="FormGroup";var Xa=Ya;const Ja=e.forwardRef((({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:a,htmlFor:o,...s},l)=>{const{controlId:c}=i(Ba);t=I(t,"form-label");let u="col-form-label";"string"==typeof n&&(u=`${u} ${u}-${n}`);const d=O(a,t,r&&"visually-hidden",n&&u);return"production"!==process.env.NODE_ENV&&Cr(null==c||!o,"`controlId` is ignored on `` when `htmlFor` is specified."),o=o||c,n?m(Wt,{ref:l,as:"label",className:d,htmlFor:o,...s}):m(e,{ref:l,className:d,htmlFor:o,...s})}));Ja.displayName="FormLabel";var Qa=Ja;const ei=e.forwardRef((({bsPrefix:e,className:t,id:n,...r},a)=>{const{controlId:o}=i(Ba);return e=I(e,"form-range"),m("input",{...r,type:"range",ref:a,className:O(t,e),id:n||o})}));ei.displayName="FormRange";var ti=ei;const ni=e.forwardRef((({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:a=!1,isInvalid:o=!1,id:s,...l},c)=>{const{controlId:u}=i(Ba);return e=I(e,"form-select"),m("select",{...l,size:n,ref:c,className:O(r,e,t&&`${e}-${t}`,a&&"is-valid",o&&"is-invalid"),id:s||u})}));ni.displayName="FormSelect";var ri=ni;const ai=e.forwardRef((({bsPrefix:e,className:t,as:n="small",muted:r,...a},i)=>(e=I(e,"form-text"),m(n,{...a,ref:i,className:O(t,e,r&&"text-muted")}))));ai.displayName="FormText";var ii=ai;const oi=e.forwardRef(((e,t)=>m(za,{...e,ref:t,type:"switch"})));oi.displayName="Switch";var si=Object.assign(oi,{Input:za.Input,Label:za.Label});const li=e.forwardRef((({bsPrefix:e,className:t,children:n,controlId:r,label:a,...i},o)=>(e=I(e,"form-floating"),g(Xa,{ref:o,className:O(t,e),controlId:r,...i,children:[n,m("label",{htmlFor:r,children:a})]}))));li.displayName="FloatingLabel";var ci=li;const ui={_ref:be.any,validated:be.bool,as:be.elementType},di=e.forwardRef((({className:e,validated:t,as:n="form",...r},a)=>m(n,{...r,ref:a,className:O(e,t&&"was-validated")})));di.displayName="Form",di.propTypes=ui;var hi=Object.assign(di,{Group:Xa,Control:Ka,Floating:Ga,Check:za,Switch:si,Label:Qa,Text:ii,Range:ti,Select:ri,FloatingLabel:ci});const fi=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},a)=>(t=I(t,"input-group-text"),m(n,{ref:a,className:O(e,t),...r}))));fi.displayName="InputGroupText";var pi=fi;const mi=e.forwardRef((({bsPrefix:e,size:t,hasValidation:n,className:r,as:a="div",...i},s)=>{e=I(e,"input-group");const l=o((()=>({})),[]);return m(Oa.Provider,{value:l,children:m(a,{ref:s,...i,className:O(r,e,t&&`${e}-${t}`,n&&"has-validation")})})}));mi.displayName="InputGroup";var vi=Object.assign(mi,{Text:pi,Radio:e=>m(pi,{children:m(Ha,{type:"radio",...e})}),Checkbox:e=>m(pi,{children:m(Ha,{type:"checkbox",...e})})});var gi=e.createContext(null);const bi=["as","active","eventKey"];function yi({key:e,onClick:t,active:n,id:r,role:a,disabled:o}){const s=i(ta),l=i(aa),c=i(gi);let u=n;const d={role:a};if(l){a||"tablist"!==l.role||(d.role="tab");const t=l.getControllerId(null!=e?e:null),i=l.getControlledId(null!=e?e:null);d[oa("event-key")]=e,d.id=t||r,u=null==n&&null!=e?l.activeKey===e:n,!u&&(null!=c&&c.unmountOnExit||null!=c&&c.mountOnEnter)||(d["aria-controls"]=i)}return"tab"===d.role&&(d["aria-selected"]=u,u||(d.tabIndex=-1),o&&(d.tabIndex=-1,d["aria-disabled"]=!0)),d.onClick=Ye((n=>{o||(null==t||t(n),null!=e&&s&&!n.isPropagationStopped()&&s(e,n))})),[d,{isActive:u}]}const Ei=e.forwardRef(((e,t)=>{let{as:n=it,active:r,eventKey:a}=e,i=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,bi);const[o,s]=yi(Object.assign({key:na(a,i.href),active:r},i));return o[oa("active")]=s.isActive,m(n,Object.assign({},i,o,{ref:t}))}));Ei.displayName="NavItem";var wi=Ei;const xi=["as","onSelect","activeKey","role","onKeyDown"];const Ni=()=>{},ki=oa("event-key"),Oi=e.forwardRef(((e,t)=>{let{as:r="div",onSelect:a,activeKey:o,role:l,onKeyDown:c}=e,u=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,xi);const d=Xt(),h=n(!1),f=i(ta),p=i(gi);let v,g;p&&(l=l||"tablist",o=p.activeKey,v=p.getControlledId,g=p.getControllerId);const b=n(null),y=e=>{const t=b.current;if(!t)return null;const n=Yt(t,`[${ki}]:not([aria-disabled=true])`),r=t.querySelector("[aria-selected=true]");if(!r||r!==document.activeElement)return null;const a=n.indexOf(r);if(-1===a)return null;let i=a+e;return i>=n.length&&(i=0),i<0&&(i=n.length-1),n[i]},E=(e,t)=>{null!=e&&(null==a||a(e,t),null==f||f(e,t))};s((()=>{if(b.current&&h.current){const e=b.current.querySelector(`[${ki}][aria-selected=true]`);null==e||e.focus()}h.current=!1}));const w=Ue(t,b);return m(ta.Provider,{value:E,children:m(aa.Provider,{value:{role:l,activeKey:na(o),getControlledId:v||Ni,getControllerId:g||Ni},children:m(r,Object.assign({},u,{onKeyDown:e=>{if(null==c||c(e),!p)return;let t;switch(e.key){case"ArrowLeft":case"ArrowUp":t=y(-1);break;case"ArrowRight":case"ArrowDown":t=y(1);break;default:return}var n;t&&(e.preventDefault(),E(t.dataset[(n="EventKey",`rrUi${n}`)]||null,e),h.current=!0,d())},ref:w,role:l}))})})}));Oi.displayName="Nav";var Li=Object.assign(Oi,{Item:wi});function Ai(e){void 0===e&&(e=H());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}const Si=oa("modal-open");var ji=class{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt(K(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(Si,""),K(r,t)}reset(){[...this.modals].forEach((e=>this.remove(e)))}removeContainerStyle(e){const t=this.getElement();t.removeAttribute(Si),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return-1!==t?t:(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),t)}remove(e){const t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}};const Mi=(e,t)=>je?null==e?(t||H()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function Ci(e,t){const n=da(),[a,i]=r((()=>Mi(e,null==n?void 0:n.document)));if(!a){const t=Mi(e);t&&i(t)}return s((()=>{t&&a&&t(a)}),[t,a]),s((()=>{const t=Mi(e);t!==a&&i(t)}),[e,a]),a}function Ti({children:e,in:t,onExited:r,mountOnEnter:a,unmountOnExit:i}){const o=n(null),l=n(t),c=Ye(r);s((()=>{t?l.current=!0:c(o.current)}),[t,c]);const u=Ue(o,e.ref),h=d(e,{ref:u});return t?h:i||!l.current&&a?null:h}function _i({children:e,in:t,onExited:a,onEntered:i,transition:o}){const[s,l]=r(!t);t&&s&&l(!1);const c=function({in:e,onTransition:t}){const r=n(null),a=n(!0),i=Ye(t);return nt((()=>{if(!r.current)return;let t=!1;return i({in:e,element:r.current,initial:a.current,isStale:()=>t}),()=>{t=!0}}),[e,i]),nt((()=>(a.current=!1,()=>{a.current=!0})),[]),r}({in:!!t,onTransition:e=>{Promise.resolve(o(e)).then((()=>{e.isStale()||(e.in?null==i||i(e.element,e.initial):(l(!0),null==a||a(e.element)))}),(t=>{throw e.in||l(!0),t}))}}),u=Ue(c,e.ref);return s&&!t?null:d(e,{ref:u})}function Pi(e,t,n){return e?m(e,Object.assign({},n)):t?m(_i,Object.assign({},n,{transition:t})):m(Ti,Object.assign({},n))}function Ri(e){return"Escape"===e.code||27===e.keyCode}const qi=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];let Ii;function Di(e){const t=da(),r=e||function(e){return Ii||(Ii=new ji({ownerDocument:null==e?void 0:e.document})),Ii}(t),i=n({dialog:null,backdrop:null});return Object.assign(i.current,{add:()=>r.add(i.current),remove:()=>r.remove(i.current),isTopModal:()=>r.isTopModal(i.current),setDialogRef:a((e=>{i.current.dialog=e}),[]),setBackdropRef:a((e=>{i.current.backdrop=e}),[])})}const Bi=h(((t,a)=>{let{show:i=!1,role:o="dialog",className:l,style:c,children:u,backdrop:d=!0,keyboard:h=!0,onBackdropClick:p,onEscapeKeyDown:b,transition:E,runTransition:w,backdropTransition:x,runBackdropTransition:N,autoFocus:k=!0,enforceFocus:O=!0,restoreFocus:L=!0,restoreFocusOptions:A,renderDialog:S,renderBackdrop:j=(e=>m("div",Object.assign({},e))),manager:M,container:C,onShow:T,onHide:_=(()=>{}),onExit:P,onExited:R,onExiting:q,onEnter:I,onEntering:D,onEntered:B}=t,$=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(t,qi);const H=da(),U=Ci(C),F=Di(M),V=Qe(),z=et(i),[W,K]=r(!i),Z=n(null);f(a,(()=>F),[F]),je&&!z&&i&&(Z.current=Ai(null==H?void 0:H.document)),i&&W&&K(!1);const G=Ye((()=>{if(F.add(),te.current=Pe(document,"keydown",Q),ee.current=Pe(document,"focus",(()=>setTimeout(X)),!0),T&&T(),k){var e,t;const n=Ai(null!=(e=null==(t=F.dialog)?void 0:t.ownerDocument)?e:null==H?void 0:H.document);F.dialog&&n&&!Sr(F.dialog,n)&&(Z.current=n,F.dialog.focus())}})),Y=Ye((()=>{var e;(F.remove(),null==te.current||te.current(),null==ee.current||ee.current(),L)&&(null==(e=Z.current)||null==e.focus||e.focus(A),Z.current=null)}));s((()=>{i&&U&&G()}),[i,U,G]),s((()=>{W&&Y()}),[W,Y]),Ht((()=>{Y()}));const X=Ye((()=>{if(!O||!V()||!F.isTopModal())return;const e=Ai(null==H?void 0:H.document);F.dialog&&e&&!Sr(F.dialog,e)&&F.dialog.focus()})),J=Ye((e=>{e.target===e.currentTarget&&(null==p||p(e),!0===d&&_())})),Q=Ye((e=>{h&&Ri(e)&&F.isTopModal()&&(null==b||b(e),e.defaultPrevented||_())})),ee=n(),te=n();if(!U)return null;const ne=Object.assign({role:o,ref:F.setDialogRef,"aria-modal":"dialog"===o||void 0},$,{style:c,className:l,tabIndex:-1});let re=S?S(ne):m("div",Object.assign({},ne,{children:e.cloneElement(u,{role:"document"})}));re=Pi(E,w,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!i,onExit:P,onExiting:q,onExited:(...e)=>{K(!0),null==R||R(...e)},onEnter:I,onEntering:D,onEntered:B,children:re});let ae=null;return d&&(ae=j({ref:F.setBackdropRef,onClick:J}),ae=Pi(x,N,{in:!!i,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:ae})),m(v,{children:y.createPortal(g(v,{children:[ae,re]}),U)})}));Bi.displayName="Modal";var $i=Object.assign(Bi,{Manager:ji});function Hi(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function Ui(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Fi=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Vi=".sticky-top",zi=".navbar-toggler";class Wi extends ji{adjustAndStore(e,t,n){const r=t.style[e];t.dataset[e]=r,K(t,{[e]:`${parseFloat(K(t,e))+n}px`})}restore(e,t){const n=t.dataset[e];void 0!==n&&(delete t.dataset[e],K(t,{[e]:n}))}setContainerStyle(e){super.setContainerStyle(e);const t=this.getElement();var n,r;if(r="modal-open",(n=t).classList?n.classList.add(r):Hi(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)),!e.scrollBarWidth)return;const a=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";Yt(t,Fi).forEach((t=>this.adjustAndStore(a,t,e.scrollBarWidth))),Yt(t,Vi).forEach((t=>this.adjustAndStore(i,t,-e.scrollBarWidth))),Yt(t,zi).forEach((t=>this.adjustAndStore(i,t,e.scrollBarWidth)))}removeContainerStyle(e){super.removeContainerStyle(e);const t=this.getElement();var n,r;r="modal-open",(n=t).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Ui(n.className,r):n.setAttribute("class",Ui(n.className&&n.className.baseVal||"",r));const a=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";Yt(t,Fi).forEach((e=>this.restore(a,e))),Yt(t,Vi).forEach((e=>this.restore(i,e))),Yt(t,zi).forEach((e=>this.restore(i,e)))}}let Ki;var Zi=Wi;var Gi=e.createContext({onHide(){}});const Yi=e.forwardRef((({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:r,children:a,...o},s)=>{const l=i(Gi),c=Ye((()=>{null==l||l.onHide(),null==r||r()}));return g("div",{ref:s,...o,children:[a,n&&m(pt,{"aria-label":e,variant:t,onClick:c})]})}));var Xi=Yi,Ji={exports:{}},Qi={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,a,i,o){var s=a||"<>",l=o||r;if(null==n[r])return t?new Error("Required "+i+" `"+l+"` was not specified in `"+s+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),d=6;d(t=I(t,"nav-item"),m(n,{ref:a,className:O(e,t),...r}))));to.displayName="NavItem";var no=to;const ro=e.forwardRef((({bsPrefix:e,className:t,as:n=lt,active:r,eventKey:a,disabled:i=!1,...o},s)=>{e=I(e,"nav-link");const[l,c]=yi({key:na(a,o.href),active:r,disabled:i,...o});return m(n,{...o,...l,ref:s,disabled:i,className:O(t,e,i&&"disabled",c.isActive&&"active")})}));ro.displayName="NavLink";var ao=ro;const io=e.forwardRef(((e,t)=>{const{as:n="div",bsPrefix:r,variant:a,fill:o=!1,justify:s=!1,navbar:l,navbarScroll:c,className:u,activeKey:d,...h}=P(e,{activeKey:"onSelect"}),f=I(r,"nav");let p,v,g=!1;const b=i(Aa),y=i(xt);return b?(p=b.bsPrefix,g=null==l||l):y&&({cardHeaderBsPrefix:v}=y),m(Li,{as:n,ref:t,activeKey:d,className:O(u,{[f]:!g,[`${p}-nav`]:g,[`${p}-nav-scroll`]:g&&c,[`${v}-${a}`]:!!v,[`${f}-${a}`]:!!a,[`${f}-fill`]:o,[`${f}-justified`]:s}),...h})}));io.displayName="Nav";var oo=Object.assign(io,{Item:no,Link:ao});const so=e.forwardRef((({bsPrefix:e,className:t,as:n,...r},a)=>{e=I(e,"navbar-brand");const i=n||(r.href?"a":"span");return m(i,{...r,ref:a,className:O(t,e)})}));so.displayName="NavbarBrand";var lo=so;const co=e.forwardRef((({children:e,bsPrefix:t,...n},r)=>{t=I(t,"navbar-collapse");const a=i(Aa);return m(Ge,{in:!(!a||!a.expanded),...n,children:m("div",{ref:r,className:t,children:e})})}));co.displayName="NavbarCollapse";var uo=co;const ho=e.forwardRef((({bsPrefix:e,className:t,children:n,label:r="Toggle navigation",as:a="button",onClick:o,...s},l)=>{e=I(e,"navbar-toggler");const{onToggle:c,expanded:u}=i(Aa)||{},d=Ye((e=>{o&&o(e),c&&c()}));return"button"===a&&(s.type="button"),m(a,{...s,ref:l,onClick:d,"aria-label":r,className:O(t,e,!u&&"collapsed"),children:n||m("span",{className:`${e}-icon`})})}));ho.displayName="NavbarToggle";var fo=ho;const po=new WeakMap,mo=(e,t)=>{if(!e||!t)return;const n=po.get(t)||new Map;po.set(t,n);let r=n.get(e);return r||(r=t.matchMedia(e),r.refCount=0,n.set(r.media,r)),r};function vo(e,t=("undefined"==typeof window?void 0:window)){const n=mo(e,t),[a,i]=r((()=>!!n&&n.matches));return nt((()=>{let n=mo(e,t);if(!n)return i(!1);let r=po.get(t);const a=()=>{i(n.matches)};return n.refCount++,n.addListener(a),a(),()=>{n.removeListener(a),n.refCount--,n.refCount<=0&&(null==r||r.delete(n.media)),n=void 0}}),[e]),a}const go=function(e){const t=Object.keys(e);function n(e,t){return e===t?t:e?`${e} and ${t}`:t}function r(n){const r=function(e){return t[Math.min(t.indexOf(e)+1,t.length-1)]}(n);let a=e[r];return a="number"==typeof a?a-.2+"px":`calc(${a} - 0.2px)`,`(max-width: ${a})`}return function(t,a,i){let s;return"object"==typeof t?(s=t,i=a,a=!0):s={[t]:a=a||!0},vo(o((()=>Object.entries(s).reduce(((t,[a,i])=>("up"!==i&&!0!==i||(t=n(t,function(t){let n=e[t];return"number"==typeof n&&(n=`${n}px`),`(min-width: ${n})`}(a))),"down"!==i&&!0!==i||(t=n(t,r(a))),t)),"")),[JSON.stringify(s)]),i)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),bo=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"offcanvas-body"),m(n,{ref:a,className:O(e,t),...r}))));bo.displayName="OffcanvasBody";var yo=bo;const Eo={[ke]:"show",[Oe]:"show"},wo=e.forwardRef((({bsPrefix:t,className:n,children:r,in:a=!1,mountOnEnter:i=!1,unmountOnExit:o=!1,appear:s=!1,...l},c)=>(t=I(t,"offcanvas"),m(ze,{ref:c,addEndListener:De,in:a,mountOnEnter:i,unmountOnExit:o,appear:s,...l,childRef:r.ref,children:(a,i)=>e.cloneElement(r,{...i,className:O(n,r.props.className,(a===ke||a===Le)&&`${t}-toggling`,Eo[a])})}))));wo.displayName="OffcanvasToggling";var xo=wo;const No=e.forwardRef((({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...a},i)=>(e=I(e,"offcanvas-header"),m(Xi,{ref:i,...a,className:O(t,e),closeLabel:n,closeButton:r}))));No.displayName="OffcanvasHeader";var ko=No;const Oo=Xe("h5"),Lo=e.forwardRef((({className:e,bsPrefix:t,as:n=Oo,...r},a)=>(t=I(t,"offcanvas-title"),m(n,{ref:a,className:O(e,t),...r}))));Lo.displayName="OffcanvasTitle";var Ao=Lo;function So(e){return m(xo,{...e})}function jo(e){return m(dt,{...e})}const Mo=e.forwardRef((({bsPrefix:e,className:t,children:l,"aria-labelledby":c,placement:u="start",responsive:d,show:h=!1,backdrop:f=!0,keyboard:p=!0,scroll:b=!1,onEscapeKeyDown:y,onShow:E,onHide:w,container:x,autoFocus:N=!0,enforceFocus:k=!0,restoreFocus:L=!0,restoreFocusOptions:A,onEntered:S,onExit:j,onExiting:M,onEnter:C,onEntering:T,onExited:_,backdropClassName:P,manager:R,renderStaticNode:q=!1,...D},B)=>{const $=n();e=I(e,"offcanvas");const{onToggle:H}=i(Aa)||{},[U,F]=r(!1),V=go(d||"xs","up");s((()=>{F(d?h&&!V:h)}),[h,d,V]);const z=Ye((()=>{null==H||H(),null==w||w()})),W=o((()=>({onHide:z})),[z]);const K=a((t=>m("div",{...t,className:O(`${e}-backdrop`,P)})),[P,e]),Z=n=>m("div",{...n,...D,className:O(t,d?`${e}-${d}`:e,`${e}-${u}`),"aria-labelledby":c,children:l});return g(v,{children:[!U&&(d||q)&&Z({}),m(Gi.Provider,{value:W,children:m($i,{show:U,ref:B,backdrop:f,container:x,keyboard:p,autoFocus:N,enforceFocus:k&&!b,restoreFocus:L,restoreFocusOptions:A,onEscapeKeyDown:y,onShow:E,onHide:z,onEnter:(e,...t)=>{e&&(e.style.visibility="visible"),null==C||C(e,...t)},onEntering:T,onEntered:S,onExit:j,onExiting:M,onExited:(e,...t)=>{e&&(e.style.visibility=""),null==_||_(...t)},manager:R||(b?($.current||($.current=new Zi({handleContainerOverflow:!1})),$.current):function(e){return Ki||(Ki=new Wi(e)),Ki}()),transition:So,backdropTransition:jo,renderBackdrop:K,renderDialog:Z})})]})}));Mo.displayName="Offcanvas";var Co=Object.assign(Mo,{Body:yo,Header:ko,Title:Ao});const To=e.forwardRef(((e,t)=>{const n=i(Aa);return m(Co,{ref:t,show:!(null==n||!n.expanded),...e,renderStaticNode:!0})}));To.displayName="NavbarOffcanvas";var _o=To;const Po=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},a)=>(t=I(t,"navbar-text"),m(n,{ref:a,className:O(e,t),...r}))));Po.displayName="NavbarText";var Ro=Po;const qo=e.forwardRef(((e,t)=>{const{bsPrefix:n,expand:r=!0,variant:i="light",bg:s,fixed:l,sticky:c,className:u,as:d="nav",expanded:h,onToggle:f,onSelect:p,collapseOnSelect:v=!1,...g}=P(e,{expanded:"onToggle"}),b=I(n,"navbar"),y=a(((...e)=>{null==p||p(...e),v&&h&&(null==f||f(!1))}),[p,v,h,f]);void 0===g.role&&"nav"!==d&&(g.role="navigation");let E=`${b}-expand`;"string"==typeof r&&(E=`${E}-${r}`);const w=o((()=>({onToggle:()=>null==f?void 0:f(!h),bsPrefix:b,expanded:!!h,expand:r})),[b,h,r,f]);return m(Aa.Provider,{value:w,children:m(ta.Provider,{value:y,children:m(d,{ref:t,...g,className:O(u,b,r&&E,i&&`${b}-${i}`,s&&`bg-${s}`,c&&`sticky-${c}`,l&&`fixed-${l}`)})})})}));qo.displayName="Navbar";var Io=Object.assign(qo,{Brand:lo,Collapse:uo,Offcanvas:_o,Text:Ro,Toggle:fo});const Do=()=>{};const Bo=e.forwardRef(((e,t)=>{const{flip:n,offset:a,placement:i,containerPadding:o,popperConfig:l={},transition:c,runTransition:u}=e,[d,h]=Je(),[f,p]=Je(),m=Ue(h,t),v=Ci(e.container),g=Ci(e.target),[b,E]=r(!e.show),w=Ar(g,d,Ir({placement:i,enableEvents:!!e.show,containerPadding:o||5,flip:n,offset:a,arrowElement:f,popperConfig:l}));e.show&&b&&E(!1);const x=e.show||!b;if(function(e,t,{disabled:n,clickTrigger:r}={}){const a=t||Do;Rr(e,a,{disabled:n,clickTrigger:r});const i=Ye((e=>{Ri(e)&&a(e)}));s((()=>{if(n||null==e)return;const t=H(_r(e));let r=(t.defaultView||window).event;const a=Pe(t,"keyup",(e=>{e!==r?i(e):r=void 0}));return()=>{a()}}),[e,n,i])}(d,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!x)return null;const{onExit:N,onExiting:k,onEnter:O,onEntering:L,onEntered:A}=e;let S=e.children(Object.assign({},w.attributes.popper,{style:w.styles.popper,ref:m}),{popper:w,placement:i,show:!!e.show,arrowProps:Object.assign({},w.attributes.arrow,{style:w.styles.arrow,ref:p})});return S=Pi(c,u,{in:!!e.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:S,onExit:N,onExiting:k,onExited:(...t)=>{E(!0),e.onExited&&e.onExited(...t)},onEnter:O,onEntering:L,onEntered:A}),v?y.createPortal(S,v):null}));Bo.displayName="Overlay";var $o=Bo;const Ho=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"popover-header"),m(n,{ref:a,className:O(e,t),...r}))));Ho.displayName="PopoverHeader";var Uo=Ho;const Fo=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"popover-body"),m(n,{ref:a,className:O(e,t),...r}))));Fo.displayName="PopoverBody";var Vo=Fo;function zo(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}function Wo(e="absolute"){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}const Ko=e.forwardRef((({bsPrefix:e,placement:t="right",className:n,style:r,children:a,body:i,arrowProps:o,hasDoneInitialMeasure:s,popper:l,show:c,...u},d)=>{const h=I(e,"popover"),f=$(),[p]=(null==t?void 0:t.split("-"))||[],v=zo(p,f);let b=r;return c&&!s&&(b={...r,...Wo(null==l?void 0:l.strategy)}),g("div",{ref:d,role:"tooltip",style:b,"x-placement":p,className:O(n,h,p&&`bs-popover-${v}`),...u,children:[m("div",{className:"popover-arrow",...o}),i?m(Vo,{children:a}):a]})}));var Zo=Object.assign(Ko,{Header:Uo,Body:Vo,POPPER_OFFSET:[0,8]});const Go=e.forwardRef((({bsPrefix:e,placement:t="right",className:n,style:r,children:a,arrowProps:i,hasDoneInitialMeasure:o,popper:s,show:l,...c},u)=>{e=I(e,"tooltip");const d=$(),[h]=(null==t?void 0:t.split("-"))||[],f=zo(h,d);let p=r;return l&&!o&&(p={...r,...Wo(null==s?void 0:s.strategy)}),g("div",{ref:u,style:p,role:"tooltip","x-placement":h,className:O(n,e,`bs-tooltip-${f}`),...c,children:[m("div",{className:"tooltip-arrow",...i}),m("div",{className:`${e}-inner`,children:a})]})}));Go.displayName="Tooltip";var Yo=Object.assign(Go,{TOOLTIP_OFFSET:[0,6]});const Xo=e.forwardRef((({children:t,transition:a=dt,popperConfig:i={},rootClose:l=!1,placement:c="top",show:u=!1,...d},h)=>{const f=n({}),[p,v]=r(null),[g,b]=function(e){const t=n(null),r=I(void 0,"popover"),a=I(void 0,"tooltip"),i=o((()=>({name:"offset",options:{offset:()=>{if(e)return e;if(t.current){if(Hi(t.current,r))return Zo.POPPER_OFFSET;if(Hi(t.current,a))return Yo.TOOLTIP_OFFSET}return[0,0]}}})),[e,r,a]);return[t,[i]]}(d.offset),y=Ue(h,g),E=!0===a?dt:a||void 0,w=Ye((e=>{v(e),null==i||null==i.onFirstUpdate||i.onFirstUpdate(e)}));return nt((()=>{p&&d.target&&(null==f.current.scheduleUpdate||f.current.scheduleUpdate())}),[p,d.target]),s((()=>{u||v(null)}),[u]),m($o,{...d,ref:y,popperConfig:{...i,modifiers:b.concat(i.modifiers||[]),onFirstUpdate:w},transition:E,rootClose:l,placement:c,show:u,children:(n,{arrowProps:r,popper:o,show:s})=>{var l,c;!function(e,t){const{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n(Fe(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r(Fe(e)))}(n,r);const u=null==o?void 0:o.placement,d=Object.assign(f.current,{state:null==o?void 0:o.state,scheduleUpdate:null==o?void 0:o.update,placement:u,outOfBoundaries:(null==o||null==(l=o.state)||null==(c=l.modifiersData.hide)?void 0:c.isReferenceHidden)||!1,strategy:i.strategy}),h=!!p;return"function"==typeof t?t({...n,placement:u,show:s,...!a&&s&&{className:"show"},popper:d,arrowProps:r,hasDoneInitialMeasure:h}):e.cloneElement(t,{...n,placement:u,arrowProps:r,popper:d,hasDoneInitialMeasure:h,className:O(t.props.className,!a&&s&&"show"),style:{...t.props.style,...n.style}})}})}));Xo.displayName="Overlay";var Jo=Xo;function Qo(e,t,n){const[r]=t,a=r.currentTarget,i=r.relatedTarget||r.nativeEvent[n];i&&i===a||Sr(a,i)||e(...t)}be.oneOf(["click","hover","focus"]);var es=({trigger:t=["hover","focus"],overlay:r,children:i,popperConfig:o={},show:s,defaultShow:l=!1,onToggle:c,delay:u,placement:h,flip:f=h&&-1!==h.indexOf("auto"),...p})=>{const b=n(null),y=Ue(b,i.ref),E=Vt(),w=n(""),[x,N]=_(s,l,c),k=function(e){return e&&"object"==typeof e?e:{show:e,hide:e}}(u),{onFocus:O,onBlur:L,onClick:A}="function"!=typeof i?e.Children.only(i).props:{},S=a((()=>{E.clear(),w.current="show",k.show?E.set((()=>{"show"===w.current&&N(!0)}),k.show):N(!0)}),[k.show,N,E]),j=a((()=>{E.clear(),w.current="hide",k.hide?E.set((()=>{"hide"===w.current&&N(!1)}),k.hide):N(!1)}),[k.hide,N,E]),M=a(((...e)=>{S(),null==O||O(...e)}),[S,O]),C=a(((...e)=>{j(),null==L||L(...e)}),[j,L]),T=a(((...e)=>{N(!x),null==A||A(...e)}),[A,N,x]),P=a(((...e)=>{Qo(S,e,"fromElement")}),[S]),R=a(((...e)=>{Qo(j,e,"toElement")}),[j]),q=null==t?[]:[].concat(t),I={ref:e=>{y(Fe(e))}};return-1!==q.indexOf("click")&&(I.onClick=T),-1!==q.indexOf("focus")&&(I.onFocus=M,I.onBlur=C),-1!==q.indexOf("hover")&&("production"!==process.env.NODE_ENV&&Cr(q.length>1,'[react-bootstrap] Specifying only the `"hover"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'),I.onMouseOver=P,I.onMouseOut=R),g(v,{children:["function"==typeof i?i(I):d(i,I),m(Jo,{...p,show:x,onHide:j,flip:f,placement:h,popperConfig:o,target:b.current,children:r})]})};const ts=e.forwardRef((({bsPrefix:e,className:t,as:n="div",...r},a)=>{const i=I(e,"row"),o=D(),s=B(),l=`${i}-cols`,c=[];return o.forEach((e=>{const t=r[e];let n;delete r[e],null!=t&&"object"==typeof t?({cols:n}=t):n=t;const a=e!==s?`-${e}`:"";null!=n&&c.push(`${l}${a}-${n}`)})),m(n,{ref:a,...r,className:O(t,i,...c)})}));ts.displayName="Row";var ns=ts;var rs,as=e.forwardRef((({bsPrefix:e,className:t,striped:n,bordered:r,borderless:a,hover:i,size:o,variant:s,responsive:l,...c},u)=>{const d=I(e,"table"),h=O(t,d,s&&`${d}-${s}`,o&&`${d}-${o}`,n&&`${d}-${"string"==typeof n?`striped-${n}`:"striped"}`,r&&`${d}-bordered`,a&&`${d}-borderless`,i&&`${d}-hover`),f=m("table",{...c,className:h,ref:u});if(l){let e=`${d}-responsive`;return"string"==typeof l&&(e=`${e}-${l}`),m("div",{className:e,children:f})}return f})),is=function(e){var n=e.label,r=e.icon,a=e.children,i=e.className,o=e.variant,s=w(e,["label","icon","children","className","variant"]);return t.createElement(vt,E({className:i,variant:o||"primary"},s),n||null,r?t.createElement("i",{className:"bi bi-".concat(r)}):null,a)};!function(e){e[e.NONE=0]="NONE",e[e.HEAD=1]="HEAD",e[e.BODY=2]="BODY"}(rs||(rs={}));var os=u(rs.NONE),ss=function(e){var n=e.className,r=e.children,a=w(e,["className","children"]);return t.createElement(as,E({className:O(n,"texmo-table")},a),r)};ss.Head=function(e){var n=e.children,r=w(e,["children"]);return t.createElement(os.Provider,{value:rs.HEAD},t.createElement("thead",E({},r),n))},ss.Row=function(e){var n=e.borderColour,r=e.className,a=e.style,i=e.children,o=w(e,["borderColour","className","style","children"]);return t.createElement("tr",E({className:O(r,"table-responsive text-center h-100 mt-3 mx-0"),style:E({border:"2px solid ".concat(n)},a)},o),i)},ss.Cell=function(e){var n=e.borderStart,r=e.className,a=e.children,o=w(e,["borderStart","className","children"]),s=n?"border-start":void 0;switch(i(os)){case rs.HEAD:return t.createElement("th",E({scope:"col list-cell",className:r},o),a);case rs.BODY:case rs.NONE:default:return t.createElement("td",E({className:"px-0 pt-0 pb-3 texmo-table"},o),t.createElement("div",E({className:O(r,"h-100 d-flex align-items-center list-cell")},o),t.createElement($t,{className:"h-100 w-100 py-3"},t.createElement($t.Body,{className:"d-flex justify-content-center align-items-center py-0 ".concat(s)},t.createElement("div",{className:"w-100 h-100"},a)))))}},ss.Body=function(e){var n=e.children,r=w(e,["children"]);return t.createElement("tbody",E({},r),t.createElement(os.Provider,{value:rs.BODY},n))};var ls=function(e){var n=e.className,r=w(e,["className"]);return t.createElement(Ka,E({as:"input",className:n},r))};ls.Feedback=Da;var cs=function(e){var n=e.label,r=e.children,a=e.className;return t.createElement(Qa,{className:a},n?t.createElement("small",{className:"text-muted"},n):null,r)},us=function(e){var n=e.className,r=e.children,a=w(e,["className","children"]);return t.createElement(ri,E({className:n},a),r)};us.Feedback=Da;var ds=function(e){var n=e.type,r=e.className,a=w(e,["type","className"]);return t.createElement(za,E({type:n},a,{className:r}))};ds.Feedback=Da;var hs="object"==typeof global&&global&&global.Object===Object&&global,fs="object"==typeof self&&self&&self.Object===Object&&self,ps=hs||fs||Function("return this")(),ms=ps.Symbol,vs=Object.prototype,gs=vs.hasOwnProperty,bs=vs.toString,ys=ms?ms.toStringTag:void 0;var Es=Object.prototype.toString;var ws="[object Null]",xs="[object Undefined]",Ns=ms?ms.toStringTag:void 0;function ks(e){return null==e?void 0===e?xs:ws:Ns&&Ns in Object(e)?function(e){var t=gs.call(e,ys),n=e[ys];try{e[ys]=void 0;var r=!0}catch(e){}var a=bs.call(e);return r&&(t?e[ys]=n:delete e[ys]),a}(e):function(e){return Es.call(e)}(e)}function Os(e){return null!=e&&"object"==typeof e}var Ls=Array.isArray;function As(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ss(e){return e}var js="[object AsyncFunction]",Ms="[object Function]",Cs="[object GeneratorFunction]",Ts="[object Proxy]";function _s(e){if(!As(e))return!1;var t=ks(e);return t==Ms||t==Cs||t==js||t==Ts}var Ps,Rs=ps["__core-js_shared__"],qs=(Ps=/[^.]+$/.exec(Rs&&Rs.keys&&Rs.keys.IE_PROTO||""))?"Symbol(src)_1."+Ps:"";var Is=Function.prototype.toString;function Ds(e){if(null!=e){try{return Is.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Bs=/^\[object .+?Constructor\]$/,$s=Function.prototype,Hs=Object.prototype,Us=$s.toString,Fs=Hs.hasOwnProperty,Vs=RegExp("^"+Us.call(Fs).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zs(e){return!(!As(e)||(t=e,qs&&qs in t))&&(_s(e)?Vs:Bs).test(Ds(e));var t}function Ws(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return zs(n)?n:void 0}var Ks=Ws(ps,"WeakMap"),Zs=Object.create,Gs=function(){function e(){}return function(t){if(!As(t))return{};if(Zs)return Zs(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Ys(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n0){if(++Qs>=800)return arguments[0]}else Qs=0;return Js.apply(void 0,arguments)});var il=9007199254740991,ol=/^(?:0|[1-9]\d*)$/;function sl(e,t){var n=typeof e;return!!(t=null==t?il:t)&&("number"==n||"symbol"!=n&&ol.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=ml}function gl(e){return null!=e&&vl(e.length)&&!_s(e)}var bl=Object.prototype;function yl(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||bl)}function El(e){return Os(e)&&"[object Arguments]"==ks(e)}var wl=Object.prototype,xl=wl.hasOwnProperty,Nl=wl.propertyIsEnumerable,kl=El(function(){return arguments}())?El:function(e){return Os(e)&&xl.call(e,"callee")&&!Nl.call(e,"callee")};var Ol="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ll=Ol&&"object"==typeof module&&module&&!module.nodeType&&module,Al=Ll&&Ll.exports===Ol?ps.Buffer:void 0,Sl=(Al?Al.isBuffer:void 0)||function(){return!1},jl={};function Ml(e){return function(t){return e(t)}}jl["[object Float32Array]"]=jl["[object Float64Array]"]=jl["[object Int8Array]"]=jl["[object Int16Array]"]=jl["[object Int32Array]"]=jl["[object Uint8Array]"]=jl["[object Uint8ClampedArray]"]=jl["[object Uint16Array]"]=jl["[object Uint32Array]"]=!0,jl["[object Arguments]"]=jl["[object Array]"]=jl["[object ArrayBuffer]"]=jl["[object Boolean]"]=jl["[object DataView]"]=jl["[object Date]"]=jl["[object Error]"]=jl["[object Function]"]=jl["[object Map]"]=jl["[object Number]"]=jl["[object Object]"]=jl["[object RegExp]"]=jl["[object Set]"]=jl["[object String]"]=jl["[object WeakMap]"]=!1;var Cl="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tl=Cl&&"object"==typeof module&&module&&!module.nodeType&&module,_l=Tl&&Tl.exports===Cl&&hs.process,Pl=function(){try{var e=Tl&&Tl.require&&Tl.require("util").types;return e||_l&&_l.binding&&_l.binding("util")}catch(e){}}(),Rl=Pl&&Pl.isTypedArray,ql=Rl?Ml(Rl):function(e){return Os(e)&&vl(e.length)&&!!jl[ks(e)]},Il=Object.prototype.hasOwnProperty;function Dl(e,t){var n=Ls(e),r=!n&&kl(e),a=!n&&!r&&Sl(e),i=!n&&!r&&!a&&ql(e),o=n||r||a||i,s=o?function(e,t){for(var n=-1,r=Array(e);++n-1},Jl.prototype.set=function(e,t){var n=this.__data__,r=Yl(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ql=Ws(ps,"Map");function ec(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function tc(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ts))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&Tu?new ju:void 0;for(i.set(e,t),i.set(t,e);++d1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(a=fd.length>3&&"function"==typeof a?(r--,a):void 0,i&&function(e,t,n){if(!As(n))return!1;var r=typeof t;return!!("number"==r?gl(n)&&sl(t,n.length):"string"==r&&t in n)&&cl(n[t],e)}(t[0],t[1],i)&&(a=r<3?void 0:a,r=1),e=Object(e);++n(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(md||{});class vd{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const r=md.TYPE&md.ATTRIBUTE;this.scope=null!=n.scope?n.scope&md.LEVEL|r:md.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map((e=>e.name))}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class gd extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const bd=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){const a=this.query(n);if(null==a)throw new gd(`Unable to create ${n} blot`);const i=a,o=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:i.create(r),s=new i(t,o,r);return e.blots.set(s.domNode,s),s}find(t,n=!1){return e.find(t,n)}query(e,t=md.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&md.LEVEL&md.BLOCK?n=this.types.block:e&md.LEVEL&md.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((e=>(n=this.classes[e],!!n))),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&md.LEVEL&n.scope&&t&md.TYPE&n.scope?n:null}register(...e){return e.map((e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new gd("Invalid definition");if(t&&"abstract"===e.blotName)throw new gd("Cannot register abstract class");const r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map((e=>e.toUpperCase())):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach((t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)})))),e}))}};bd.blots=new WeakMap;let yd=bd;function Ed(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((e=>0===e.indexOf(`${t}-`)))}const wd=class extends vd{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((e=>e.split("-").slice(0,-1).join("-")))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){Ed(e,this.keyName).forEach((t=>{e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(Ed(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function xd(e){const t=e.split("-"),n=t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("");return t[0]+n}const Nd=class extends vd{static keys(e){return(e.getAttribute("style")||"").split(";").map((e=>e.split(":")[0].trim()))}add(e,t){return!!this.canAdd(e,t)&&(e.style[xd(this.keyName)]=t,!0)}remove(e){e.style[xd(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[xd(this.keyName)];return this.canAdd(e,t)?t:""}};const kd=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=yd.find(this.domNode);if(null==e)return;const t=vd.keys(this.domNode),n=wd.keys(this.domNode),r=Nd.keys(this.domNode);t.concat(n).concat(r).forEach((t=>{const n=e.scroll.query(t,md.ATTRIBUTE);n instanceof vd&&(this.attributes[n.attrName]=n)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((e=>{this.attributes[e].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}},Od=class{constructor(e,t){this.scroll=e,this.domNode=t,yd.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new gd("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),yd.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const a=this.isolate(e,t);if(null!=this.scroll.query(n,md.BLOT)&&r)a.wrap(n,r);else if(null!=this.scroll.query(n,md.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);a.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),a=this.split(e);this.parent.insertBefore(r,a||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new gd(`Cannot wrap ${e}`);return n.appendChild(this),n}};Od.blotName="abstract";let Ld=Od;const Ad=class extends Ld{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Ad.scope=md.INLINE_BLOT;const Sd=Ad;class jd{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let r=n();for(;r;){const a=r.length();if(ei?n(s,e-i,Math.min(t,i+r-e)):n(s,0,Math.min(r,e+t-i)),i+=r,s=o()}}map(e){return this.reduce(((t,n)=>(t.push(e(n)),t)),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=n();return t}}function Md(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create(md.INLINE);return Array.from(e.childNodes).forEach((e=>{n.domNode.appendChild(e)})),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const Cd=class e extends Ld{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new jd,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=Md(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof gd)return;throw e}}))}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,((e,t,n)=>{e.deleteAt(t,n)}))}descendant(t,n=0){const[r,a]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,a]:r instanceof e?r.descendant(t,a):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let a=[],i=r;return this.children.forEachAt(n,r,((n,r,o)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&a.push(n),n instanceof e&&(a=a.concat(n.descendants(t,r,i))),i-=o})),a}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach((n=>{t||this.statics.allowedChildren.some((e=>n instanceof e))||(n.statics.scope===md.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())}))}formatAt(e,t,n,r){this.children.forEachAt(e,t,((e,t,a)=>{e.formatAt(t,a,n,r)}))}insertAt(e,t,n){const[r,a]=this.children.find(e);if(r)r.insertAt(a,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((n=>{e.insertBefore(n,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[r,a]=this.children.find(t,n),i=[[this,t]];return r instanceof e?i.concat(r.path(a,n)):(null!=r&&i.push([r,a]),i)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),((e,r,a)=>{const i=e.split(r,t);null!=i&&n.appendChild(i)})),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],r=[];e.forEach((e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))})),r.forEach((e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()})),n.filter((e=>e.parentNode===this.domNode&&e!==this.uiNode)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=Md(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))})),this.enforceAllowedChildren()}};Cd.uiClass="";const Td=Cd;const _d=class e extends Td{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kd(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,md.INLINE);if(null==e)return;e instanceof vd?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach((t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)})),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.formats()[n]||this.scroll.query(n,md.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}wrap(t,n){const r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};_d.allowedChildren=[_d,Sd],_d.blotName="inline",_d.scope=md.INLINE_BLOT,_d.tagName="SPAN";const Pd=_d,Rd=class e extends Td{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kd(this.domNode)}format(t,n){const r=this.scroll.query(t,md.BLOCK);null!=r&&(r instanceof vd?this.attributes.attribute(r,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.scroll.query(n,md.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,md.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}};Rd.blotName="block",Rd.scope=md.BLOCK_BLOT,Rd.tagName="P",Rd.allowedChildren=[Pd,Rd,Sd];const qd=Rd,Id=class extends Td{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Id.blotName="container",Id.scope=md.BLOCK_BLOT;const Dd=Id;const Bd=class extends Sd{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},$d={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Hd=class extends Td{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((e=>{this.update(e)})),this.observer.observe(this.domNode,$d),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=md.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach((e=>{e.remove()})):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const a=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&a(e.parent))},i=e=>{n.has(e.domNode)&&(e instanceof Td&&e.children.forEach(i),n.delete(e.domNode),e.optimize(t))};let o=e;for(let t=0;o.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach((e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(a(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach((e=>{const t=this.find(e,!1);a(t,!1),t instanceof Td&&t.children.forEach((e=>{a(e,!1)}))}))):"attributes"===e.type&&a(t.prev)),a(t))})),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),r=o.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map((e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)})).forEach((e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)})),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Hd.blotName="scroll",Hd.defaultChild=qd,Hd.allowedChildren=[qd,Dd],Hd.scope=md.BLOCK_BLOT,Hd.tagName="DIV";const Ud=Hd,Fd=class e extends Sd{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some((e=>"characterData"===e.type&&e.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Fd.blotName="text",Fd.scope=md.INLINE_BLOT;const Vd=Fd;var zd=Object.freeze({__proto__:null,Attributor:vd,AttributorStore:kd,BlockBlot:qd,ClassAttributor:wd,ContainerBlot:Dd,EmbedBlot:Bd,InlineBlot:Pd,LeafBlot:Sd,ParentBlot:Td,Registry:yd,Scope:md,ScrollBlot:Ud,StyleAttributor:Nd,TextBlot:Vd}),Wd={exports:{}},Kd=-1,Zd=1,Gd=0;function Yd(e,t,n,r,a){if(e===t)return e?[[Gd,e]]:[];if(null!=n){var i=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,a="number"==typeof n?null:n.newRange,i=e.length,o=t.length;if(0===r.length&&(null===a||0===a.length)){var s=r.index,l=e.slice(0,s),c=e.slice(s),u=a?a.index:null,d=s+o-i;if((null===u||u===d)&&!(d<0||d>o)){var h=t.slice(0,d);if((m=t.slice(d))===c){var f=Math.min(s,d);if((g=l.slice(0,f))===(y=h.slice(0,f)))return dh(g,l.slice(f),h.slice(f),c)}}if(null===u||u===s){var p=s,m=(h=t.slice(0,p),t.slice(p));if(h===l){var v=Math.min(i-p,o-p);if((b=c.slice(c.length-v))===(E=m.slice(m.length-v)))return dh(l,c.slice(0,c.length-v),m.slice(0,m.length-v),b)}}}if(r.length>0&&a&&0===a.length){var g=e.slice(0,r.index),b=e.slice(r.index+r.length);if(!(o<(f=g.length)+(v=b.length))){var y=t.slice(0,f),E=t.slice(o-v);if(g===y&&b===E)return dh(g,e.slice(f,i-v),t.slice(f,o-v),b)}}return null}(e,t,n);if(i)return i}var o=Jd(e,t),s=e.substring(0,o);o=eh(e=e.substring(o),t=t.substring(o));var l=e.substring(e.length-o),c=function(e,t){var n;if(!e)return[[Zd,t]];if(!t)return[[Kd,e]];var r=e.length>t.length?e:t,a=e.length>t.length?t:e,i=r.indexOf(a);if(-1!==i)return n=[[Zd,r.substring(0,i)],[Gd,a],[Zd,r.substring(i+a.length)]],e.length>t.length&&(n[0][0]=n[2][0]=Kd),n;if(1===a.length)return[[Kd,e],[Zd,t]];var o=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,a,i,o,c]:null}var i,o,s,l,c,u=a(n,r,Math.ceil(n.length/4)),d=a(n,r,Math.ceil(n.length/2));if(!u&&!d)return null;i=d?u&&u[4].length>d[4].length?u:d:u;e.length>t.length?(o=i[0],s=i[1],l=i[2],c=i[3]):(l=i[0],c=i[1],o=i[2],s=i[3]);var h=i[4];return[o,s,l,c,h]}(e,t);if(o){var s=o[0],l=o[1],c=o[2],u=o[3],d=o[4],h=Yd(s,c),f=Yd(l,u);return h.concat([[Gd,d]],f)}return function(e,t){for(var n=e.length,r=t.length,a=Math.ceil((n+r)/2),i=a,o=2*a,s=new Array(o),l=new Array(o),c=0;cn)f+=2;else if(y>r)h+=2;else if(d){if((x=i+u-g)>=0&&x=(w=n-l[x]))return Xd(e,t,k,y)}}for(var E=-v+p;E<=v-m;E+=2){for(var w,x=i+E,N=(w=E===-v||E!==v&&l[x-1]n)m+=2;else if(N>r)p+=2;else if(!d){if((b=i+u-E)>=0&&b=(w=n-w))return Xd(e,t,k,y)}}}}return[[Kd,e],[Zd,t]]}(e,t)}(e=e.substring(0,e.length-o),t=t.substring(0,t.length-o));return s&&c.unshift([Gd,s]),l&&c.push([Gd,l]),oh(c,a),r&&function(e){var t=!1,n=[],r=0,a=null,i=0,o=0,s=0,l=0,c=0;for(;i0?n[r-1]:-1,o=0,s=0,l=0,c=0,a=null,t=!0)),i++;t&&oh(e);(function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),a=n.match(th),i=r.match(th),o=a&&n.match(nh),s=i&&r.match(nh),l=o&&n.match(rh),c=s&&r.match(rh),u=l&&e.match(ah),d=c&&t.match(ih);return u||d?5:l||c?4:a&&!o&&s?3:o||s?2:a||i?1:0}var n=1;for(;n=d&&(d=h,l=r,c=a,u=i)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=c,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}})(e),i=1;for(;i=f?(h>=u.length/2||h>=d.length/2)&&(e.splice(i,0,[Gd,d.substring(0,h)]),e[i-1][1]=u.substring(0,u.length-h),e[i+1][1]=d.substring(h),i++):(f>=u.length/2||f>=d.length/2)&&(e.splice(i,0,[Gd,u.substring(0,f)]),e[i-1][0]=Zd,e[i-1][1]=d.substring(0,d.length-f),e[i+1][0]=Kd,e[i+1][1]=u.substring(f),i++),i++}i++}}(c),c}function Xd(e,t,n,r){var a=e.substring(0,n),i=t.substring(0,r),o=e.substring(n),s=t.substring(r),l=Yd(a,i),c=Yd(o,s);return l.concat(c)}function Jd(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),a=r,i=0;nr?e=e.substring(n-r):n=0&&uh(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),o=c+o,s=c+s,!e[l][1]){e.splice(l,1),r--;var u=l-1;e[u]&&e[u][0]===Zd&&(i++,s=e[u][1]+s,u--),e[u]&&e[u][0]===Kd&&(a++,o=e[u][1]+o,u--),l=u}}if(ch(e[r][1])){c=e[r][1].charAt(0);e[r][1]=e[r][1].slice(1),o+=c,s+=c}}if(r0||s.length>0){o.length>0&&s.length>0&&(0!==(n=Jd(s,o))&&(l>=0?e[l][1]+=s.substring(0,n):(e.splice(0,0,[Gd,s.substring(0,n)]),r++),s=s.substring(n),o=o.substring(n)),0!==(n=eh(s,o))&&(e[r][1]=s.substring(s.length-n)+e[r][1],s=s.substring(0,s.length-n),o=o.substring(0,o.length-n)));var d=i+a;0===o.length&&0===s.length?(e.splice(r-d,d),r-=d):0===o.length?(e.splice(r-d,d,[Zd,s]),r=r-d+1):0===s.length?(e.splice(r-d,d,[Kd,o]),r=r-d+1):(e.splice(r-d,d,[Kd,o],[Zd,s]),r=r-d+2)}0!==r&&e[r-1][0]===Gd?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,i=0,a=0,o="",s=""}""===e[e.length-1][1]&&e.pop();var h=!1;for(r=1;r=55296&&e<=56319}function lh(e){return e>=56320&&e<=57343}function ch(e){return lh(e.charCodeAt(0))}function uh(e){return sh(e.charCodeAt(e.length-1))}function dh(e,t,n,r){return uh(e)||ch(r)?null:function(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}([[Gd,e],[Kd,t],[Zd,n],[Gd,r]])}function hh(e,t,n,r){return Yd(e,t,n,r,!0)}hh.INSERT=Zd,hh.DELETE=Kd,hh.EQUAL=Gd;var fh=hh,ph={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",i="[object Boolean]",o="[object Date]",s="[object Function]",l="[object GeneratorFunction]",c="[object Map]",u="[object Number]",d="[object Object]",h="[object Promise]",f="[object RegExp]",p="[object Set]",m="[object String]",v="[object Symbol]",g="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",E="[object Float32Array]",w="[object Float64Array]",N="[object Int8Array]",k="[object Int16Array]",O="[object Int32Array]",L="[object Uint8Array]",A="[object Uint8ClampedArray]",S="[object Uint16Array]",j="[object Uint32Array]",M=/\w*$/,C=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,_={};_[a]=_["[object Array]"]=_[b]=_[y]=_[i]=_[o]=_[E]=_[w]=_[N]=_[k]=_[O]=_[c]=_[u]=_[d]=_[f]=_[p]=_[m]=_[v]=_[L]=_[A]=_[S]=_[j]=!0,_["[object Error]"]=_[s]=_[g]=!1;var P="object"==typeof x&&x&&x.Object===Object&&x,R="object"==typeof self&&self&&self.Object===Object&&self,q=P||R||Function("return this")(),I=t&&!t.nodeType&&t,D=I&&e&&!e.nodeType&&e,B=D&&D.exports===I;function $(e,t){return e.set(t[0],t[1]),e}function H(e,t){return e.add(t),e}function U(e,t,n,r){var a=-1,i=e?e.length:0;for(r&&i&&(n=e[++a]);++a-1},Le.prototype.set=function(e,t){var n=this.__data__,r=Ce(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Oe,map:new(fe||Le),string:new Oe}},Ae.prototype.delete=function(e){return qe(this,e).delete(e)},Ae.prototype.get=function(e){return qe(this,e).get(e)},Ae.prototype.has=function(e){return qe(this,e).has(e)},Ae.prototype.set=function(e,t){return qe(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new Le},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Le){var r=n.__data__;if(!fe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ae(r)}return n.set(e,t),this};var De=ce?z(ce,Object):function(){return[]},Be=function(e){return ee.call(e)};function $e(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var We=ue||function(){return!1};function Ke(e){var t=Ze(e)?ee.call(e):"";return t==s||t==l}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ge(e){return ze(e)?je(e):function(e){if(!He(e))return de(e);var t=[];for(var n in Object(e))Q.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}(ph,ph.exports);var mh=ph.exports,vh={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=1,a=2,i=9007199254740991,o="[object Arguments]",s="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",f="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Null]",g="[object Object]",b="[object Promise]",y="[object Proxy]",E="[object RegExp]",w="[object Set]",N="[object String]",k="[object Symbol]",O="[object Undefined]",L="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",j=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[o]=C[s]=C[A]=C[c]=C[S]=C[u]=C[d]=C[h]=C[p]=C[m]=C[g]=C[E]=C[w]=C[N]=C[L]=!1;var T="object"==typeof x&&x&&x.Object===Object&&x,_="object"==typeof self&&self&&self.Object===Object&&self,P=T||_||Function("return this")(),R=t&&!t.nodeType&&t,q=R&&e&&!e.nodeType&&e,I=q&&q.exports===R,D=I&&T.process,B=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),$=B&&B.isTypedArray;function H(e,t){for(var n=-1,r=null==e?0:e.length;++nc))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var h=-1,f=!0,p=n&a?new ke:void 0;for(s.set(e,t),s.set(t,e);++h-1},xe.prototype.set=function(e,t){var n=this.__data__,r=Ae(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ne.prototype.clear=function(){this.size=0,this.__data__={hash:new we,map:new(ce||xe),string:new we}},Ne.prototype.delete=function(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t},Ne.prototype.get=function(e){return Re(this,e).get(e)},Ne.prototype.has=function(e){return Re(this,e).has(e)},Ne.prototype.set=function(e,t){var n=Re(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ke.prototype.add=ke.prototype.push=function(e){return this.__data__.set(e,n),this},ke.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.clear=function(){this.__data__=new xe,this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xe){var r=n.__data__;if(!ce||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ne(r)}return n.set(e,t),this.size=n.size,this};var Ie=ie?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,i=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=i}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ze(e){return null!=e&&"object"==typeof e}var Ge=$?function(e){return function(t){return e(t)}}($):function(e){return Ze(e)&&We(e.length)&&!!C[Se(e)]};function Ye(e){return null!=(t=e)&&We(t.length)&&!ze(t)?Le(e):Te(e);var t}e.exports=function(e,t){return Me(e,t)}}(vh,vh.exports);var gh=vh.exports,bh={};Object.defineProperty(bh,"__esModule",{value:!0});const yh=mh,Eh=gh;var wh;!function(e){e.compose=function(e={},t={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let r=yh(t);n||(r=Object.keys(r).reduce(((e,t)=>(null!=r[t]&&(e[t]=r[t]),e)),{}));for(const n in e)void 0!==e[n]&&void 0===t[n]&&(r[n]=e[n]);return Object.keys(r).length>0?r:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const n=Object.keys(e).concat(Object.keys(t)).reduce(((n,r)=>(Eh(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n)),{});return Object.keys(n).length>0?n:void 0},e.invert=function(e={},t={}){e=e||{};const n=Object.keys(t).reduce(((n,r)=>(t[r]!==e[r]&&void 0!==e[r]&&(n[r]=t[r]),n)),{});return Object.keys(e).reduce(((n,r)=>(e[r]!==t[r]&&void 0===t[r]&&(n[r]=null),n)),n)},e.transform=function(e,t,n=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!n)return t;const r=Object.keys(t).reduce(((n,r)=>(void 0===e[r]&&(n[r]=t[r]),n)),{});return Object.keys(r).length>0?r:void 0}}(wh||(wh={})),bh.default=wh;var xh,Nh={};Object.defineProperty(Nh,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(xh||(xh={})),Nh.default=xh;var kh={};Object.defineProperty(kh,"__esModule",{value:!0});const Oh=Nh;kh.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const n=this.offset,r=Oh.default.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"object"==typeof t.retain&&null!==t.retain?r.retain=t.retain:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Oh.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}return[]}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const n=fh,r=mh,a=gh,i=bh;t.AttributeMap=i.default;const o=Nh;t.Op=o.default;const s=kh;t.OpIterator=s.default;const l=String.fromCharCode(0),c=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class u{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(a(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach((r=>{(e(r)?t:n).push(r)})),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce(((e,t)=>t.insert?e+o.default.length(t):t.delete?e-t.delete:e),0)}length(){return this.reduce(((e,t)=>e+o.default.length(t)),0)}slice(e=0,t=1/0){const n=[],r=new s.default(this.ops);let a=0;for(;a0&&n.next(o.retain-e)}const l=new u(r);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===t.peekType())l.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),r=t.next(e),o=n.next(e);if(o.retain){const s={};if("number"==typeof r.retain)s.retain="number"==typeof o.retain?e:o.retain;else if("number"==typeof o.retain)null==r.retain?s.insert=r.insert:s.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,a]=c(r[e],o.retain),i=u.getHandler(t);s[e]={[t]:i.compose(n,a,"retain"===e)}}const d=i.default.compose(r.attributes,o.attributes,"number"==typeof r.retain);if(d&&(s.attributes=d),l.push(s),!n.hasNext()&&a(l.ops[l.ops.length-1],s)){const e=new u(t.rest());return l.concat(e).chop()}}else"number"==typeof o.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&l.push(o)}return l.chop()}concat(e){const t=new u(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new u;const r=[this,e].map((t=>t.map((n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join(""))),o=new u,c=n(r[0],r[1],t,!0),d=new s.default(this.ops),h=new s.default(e.ops);return c.forEach((e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(h.peekLength(),t),o.push(h.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),o.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),h.peekLength(),t);const e=d.next(r),s=h.next(r);a(e.insert,s.insert)?o.retain(r,i.default.diff(e.attributes,s.attributes)):o.push(s).delete(r)}t-=r}})),o.chop()}eachLine(e,t="\n"){const n=new s.default(this.ops);let r=new u,a=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const i=n.peek(),s=o.default.length(i)-n.peekLength(),l="string"==typeof i.insert?i.insert.indexOf(t,s)-s:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===e(r,n.next(1).attributes||{},a))return;a+=1,r=new u}}r.length()>0&&e(r,{},a)}invert(e){const t=new u;return this.reduce(((n,r)=>{if(r.insert)t.delete(o.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const a=r.delete||r.retain;return e.slice(n,n+a).forEach((e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(o.default.length(e),i.default.invert(r.attributes,e.attributes))})),n+a}if("object"==typeof r.retain&&null!==r.retain){const a=e.slice(n,n+1),o=new s.default(a.ops).next(),[l,d,h]=c(r.retain,o.insert),f=u.getHandler(l);return t.retain({[l]:f.invert(d,h)},i.default.invert(r.attributes,o.attributes)),n+1}}return n}),0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,r=new s.default(this.ops),a=new s.default(n.ops),l=new u;for(;r.hasNext()||a.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===a.peekType())if("insert"===a.peekType())l.push(a.next());else{const e=Math.min(r.peekLength(),a.peekLength()),n=r.next(e),o=a.next(e);if(n.delete)continue;if(o.delete)l.push(o);else{const r=n.retain,a=o.retain;let s="object"==typeof a&&null!==a?a:e;if("object"==typeof r&&null!==r&&"object"==typeof a&&null!==a){const e=Object.keys(r)[0];if(e===Object.keys(a)[0]){const n=u.getHandler(e);n&&(s={[e]:n.transform(r[e],a[e],t)})}}l.retain(s,i.default.transform(n.attributes,o.attributes,t))}}else l.retain(o.default.length(r.next()));return l.chop()}transformPosition(e,t=!1){t=!!t;const n=new s.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const a=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r"']/g,(e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e])))}class Ch extends Pd{static allowedChildren=[Ch,Sh,Bd,jh];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const n=Ch.order.indexOf(e),r=Ch.order.indexOf(t);return n>=0||r>=0?n-r:e===t?0:e0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}class Th extends qd{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=Ph(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,md.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(null!=n)return super.insertAt(e,t,n),void(this.cache={});if(0===t.length)return;const r=t.split("\n"),a=r.shift();a.length>0&&(e(i=i.split(e,!0),i.insertAt(0,t),t.length)),e+a.length)}insertBefore(e,t){const{head:n}=this.children;super.insertBefore(e,t),n instanceof Sh&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&(0===e||e>=this.length()-1)){const t=this.clone();return 0===e?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}const n=super.split(e,t);return this.cache={},n}}Th.blotName="block",Th.tagName="P",Th.defaultChild=Sh,Th.allowedChildren=[Sh,Ch,Bd,jh];class _h extends Bd{attach(){super.attach(),this.attributes=new kd(this.domNode)}delta(){return(new Ah).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,md.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(null!=n)return void super.insertAt(e,t,n);const r=t.split("\n"),a=r.pop(),i=r.map((e=>{const t=this.scroll.create(Th.blotName);return t.insertAt(0,e),t})),o=this.split(e);i.forEach((e=>{this.parent.insertBefore(e,o)})),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}function Ph(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(Sd).reduce(((e,n)=>0===n.length()?e:e.insert(n.value(),Rh(n,{},t))),new Ah).insert("\n",Rh(e))}function Rh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t={...t,...e.formats()},n&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:Rh(e.parent,t,n))}_h.scope=md.BLOCK_BLOT;class qh extends Bd{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(qh.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(e,t){if(0!==this.savedLength)return void super.format(e,t);let n=this,r=0;for(;null!=n&&n.statics.scope!==md.BLOCK_BLOT;)r+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=qh.CONTENTS.length,n.optimize(),n.formatAt(r,qh.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const e=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof jh?this.prev:null,n=t?t.length():0,r=this.next instanceof jh?this.next:null,a=r?r.text:"",{textNode:i}=this,o=i.data.split(qh.CONTENTS).join("");let s;if(i.data=qh.CONTENTS,t)s=t,(o||r)&&(t.insertAt(t.length(),o+a),r&&r.remove());else if(r)s=r,r.insertAt(0,o);else{const e=document.createTextNode(o);s=this.scroll.create(e),this.parent.insertBefore(s,this)}if(this.remove(),e){const a=(e,a)=>t&&e===t.domNode?a:e===i?n+a-1:r&&e===r.domNode?n+o.length+a:null,l=a(e.start.node,e.start.offset),c=a(e.end.node,e.end.offset);if(null!==l&&null!==c)return{startNode:s.domNode,startOffset:l,endNode:s.domNode,endOffset:c}}return null}update(e,t){if(e.some((e=>"characterData"===e.type&&e.target===this.textNode))){const e=this.restore();e&&(t.range=e)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if("A"===t.domNode.tagName){this.savedLength=qh.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Ih={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,i||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,i=r.length,o=new Array(i);a1?t-1:0),r=1;r(t[n]=Uh.bind(console,n,e),t)),{})}Fh.level=e=>{Hh=e},Uh.level=Fh.level;const Vh=Fh("quill:events");["selectionchange","mousedown","mouseup","click"].forEach((e=>{document.addEventListener(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n{const n=Bh.get(e);n&&n.emitter&&n.emitter.handleDOM(...t)}))}))}));class zh extends Dh{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Vh.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r{let{node:r,handler:a}=t;(e.target===r||r.contains(e.target))&&a(e,...n)}))}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}const Wh=Fh("quill:selection");class Kh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=e,this.length=t}}class Zh{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Kh(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,zh.sources.USER),1)})),this.emitter.on(zh.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const e=this.getNativeRange();null!=e&&e.start.node!==this.cursor.textNode&&this.emitter.once(zh.events.SCROLL_UPDATE,((t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);const r=n.some((e=>"characterData"===e.type||"childList"===e.type||"attributes"===e.type&&e.target===this.root));this.update(r?zh.sources.SILENT:t)}catch(e){}}))})),this.emitter.on(zh.events.SCROLL_OPTIMIZE,((e,t)=>{if(t.range){const{startNode:e,startOffset:n,endNode:r,endOffset:a}=t.range;this.setNativeRange(e,n,r,a),this.update(zh.sources.SILENT)}})),this.update(zh.sources.SILENT)}handleComposition(){this.emitter.on(zh.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(zh.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(zh.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(e,md.BLOCK)){if(n.start.node!==this.cursor.textNode){const e=this.scroll.find(n.start.node,!1);if(null==e)return;if(e instanceof Sd){const t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let r;e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let[a,i]=this.scroll.leaf(e);if(null==a)return null;if(t>0&&i===a.length()){const[t]=this.scroll.leaf(e+1);if(t){const[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(a=t,i=0)}}[r,i]=a.position(i,!0);const o=document.createRange();if(t>0)return o.setStart(r,i),[a,i]=this.scroll.leaf(e+t),null==a?null:([r,i]=a.position(i,!0),o.setEnd(r,i),o.getBoundingClientRect());let s,l="left";if(r instanceof Text){if(!r.data.length)return null;i0&&(l="right")}return{bottom:s.top+s.height,height:s.height,left:s[l],right:s[l],top:s.top,width:0}}getNativeRange(){const e=document.getSelection();if(null==e||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(null==t)return null;const n=this.normalizeNative(t);return Wh.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();if(null==t)return[null,null];return[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&Gh(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map((e=>{const[t,n]=e,r=this.scroll.find(t,!0),a=r.offset(this.scroll);return 0===n?a:r instanceof Sd?a+r.index(t,n):a+r.length()})),r=Math.min(Math.max(...n),this.scroll.length()-1),a=Math.min(r,...n);return new Kh(a,r-a)}normalizeNative(e){if(!Gh(this.root,e.startContainer)||!e.collapsed&&!Gh(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1}e.node=t,e.offset=n})),t}rangeToNative(e){const t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);const[r,a]=this.scroll.leaf(e);return r?r.position(a,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Wh.info("setNativeRange",e,t,n,r),null!=e&&(null==this.root.parentNode||null==e.parentNode||null==n.parentNode))return;const i=document.getSelection();if(null!=i)if(null!=e){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(null==o||a||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e instanceof Element&&"BR"===e.tagName&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&"BR"===n.tagName&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const a=document.createRange();a.setStart(e,t),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zh.sources.API;if("string"==typeof t&&(n=t,t=!1),Wh.info("setRange",e),null!=e){const n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zh.sources.USER;const t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!hd(t,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}const n=[zh.events.SELECTION_CHANGE,Su(this.lastRange),Su(t),e];this.emitter.emit(zh.events.EDITOR_CHANGE,...n),e!==zh.sources.SILENT&&this.emitter.emit(...n)}}}function Gh(e,t){try{t.parentNode}catch(e){return!1}return e.contains(t)}const Yh=/^[ -~]*$/;class Xh{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=nf(e),r=new Ah;return function(e){const t=[];return e.forEach((e=>{if("string"==typeof e.insert){e.insert.split("\n").forEach(((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}))}else t.push(e)})),t}(n.ops.slice()).reduce(((e,n)=>{const a=Lh.Op.length(n);let i=n.attributes||{},o=!1,s=!1;if(null!=n.insert){if(r.retain(a),"string"==typeof n.insert){const r=n.insert;s=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(_h,e)[0]),this.scroll.insertAt(e,r);const[a,o]=this.scroll.line(e);let l=pd({},Rh(a));if(a instanceof Th){const[e]=a.descendant(Sd,o);e&&(l=pd(l,Rh(e)))}i=Lh.AttributeMap.diff(l,i)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return e;const a=null!=this.scroll.query(r,md.INLINE);if(a)(t<=e||this.scroll.descendant(_h,e)[0])&&(s=!0);else if(e>0){const[t,n]=this.scroll.descendant(Sd,e-1);if(t instanceof jh){"\n"!==t.value()[n]&&(o=!0)}else t instanceof Bd&&t.statics.scope===md.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),a){const[t]=this.scroll.descendant(Sd,e);if(t){const e=pd({},Rh(t));i=Lh.AttributeMap.diff(e,i)||{}}}}t+=a}else if(r.push(n),null!==n.retain&&"object"==typeof n.retain){const t=Object.keys(n.retain)[0];if(null==t)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(i).forEach((t=>{this.scroll.formatAt(e,a,t,i[t])}));const l=o?1:0,c=s?1:0;return t+=l+c,r.retain(l),r.delete(c),e+a+l+c}),0),r.reduce(((e,t)=>"number"==typeof t.delete?(this.scroll.deleteAt(e,t.delete),e):e+Lh.Op.length(t)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new Ah).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach((r=>{this.scroll.lines(e,Math.max(t,1)).forEach((e=>{e.format(r,n[r])}))})),this.scroll.optimize();const r=(new Ah).retain(e).retain(t,Su(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t,r,n[r])}));const r=(new Ah).retain(e).retain(t,Su(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new Ah)}getFormat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach((e=>{const[t]=e;t instanceof Th?n.push(t):t instanceof Sd&&r.push(t)})):(n=this.scroll.lines(e,t),r=this.scroll.descendants(Sd,e,t));const[a,i]=[n,r].map((e=>{const t=e.shift();if(null==t)return{};let n=Rh(t);for(;Object.keys(n).length>0;){const t=e.shift();if(null==t)return n;n=ef(Rh(t),n)}return n}));return{...a,...i}}getHTML(e,t){const[n,r]=this.scroll.line(e);if(n){const a=n.length();return!(n.length()>=r+t)||0===r&&t===a?Qh(this.scroll,e,t,!0):Qh(n,r,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((e=>"string"==typeof e.insert)).map((e=>e.insert)).join("")}insertContents(e,t){const n=nf(t),r=(new Ah).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new Ah).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t.length,r,n[r])})),this.update((new Ah).retain(e).insert(t,Su(n)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==Th.blotName)return!1;const t=e;return!(t.children.length>1)&&t.children.head instanceof Sh}removeFormat(e,t){const n=this.getText(e,t),[r,a]=this.scroll.line(e+t);let i=0,o=new Ah;null!=r&&(i=r.length()-a,o=r.delta().slice(a,a+i-1).insert("\n"));const s=this.getContents(e,t+i).diff((new Ah).insert(n).concat(o)),l=(new Ah).retain(e).concat(s);return this.applyDelta(l)}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(Yh)&&this.scroll.find(t[0].target)){const a=this.scroll.find(t[0].target),i=Rh(a),o=a.offset(this.scroll),s=t[0].oldValue.replace(qh.CONTENTS,""),l=(new Ah).insert(s),c=(new Ah).insert(a.value()),u=n&&{oldRange:rf(n.oldRange,-o),newRange:rf(n.newRange,-o)};e=(new Ah).retain(o).concat(l.diff(c,u)).reduce(((e,t)=>t.insert?e.insert(t.insert,i):e.push(t)),new Ah),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&hd(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}function Jh(e,t,n){if(0===e.length){const[e]=tf(n.pop());return t<=0?``:`${Jh([],t-1,n)}`}const[{child:r,offset:a,length:i,indent:o,type:s},...l]=e,[c,u]=tf(s);if(o>t)return n.push(s),o===t+1?`<${c}>${Qh(r,a,i)}${Jh(l,o,n)}`:`<${c}>
  • ${Jh(e,t+1,n)}`;const d=n[n.length-1];if(o===t&&s===d)return`
  • ${Qh(r,a,i)}${Jh(l,o,n)}`;const[h]=tf(n.pop());return`${Jh(e,t-1,n)}`}function Qh(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in e&&"function"==typeof e.html)return e.html(t,n);if(e instanceof jh)return Mh(e.value().slice(t,t+n));if(e instanceof Td){if("list-container"===e.statics.blotName){const r=[];return e.children.forEachAt(t,n,((e,t,n)=>{const a="formats"in e&&"function"==typeof e.formats?e.formats():{};r.push({child:e,offset:t,length:n,indent:a.indent||0,type:a.list})})),Jh(r,-1,[])}const a=[];if(e.children.forEachAt(t,n,((e,t,n)=>{a.push(Qh(e,t,n))})),r||"list"===e.statics.blotName)return a.join("");const{outerHTML:i,innerHTML:o}=e.domNode,[s,l]=i.split(`>${o}<`);return"${a.join("")}<${l}`:`${s}>${a.join("")}<${l}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function ef(e,t){return Object.keys(t).reduce(((n,r)=>{if(null==e[r])return n;const a=t[r];return a===e[r]?n[r]=a:Array.isArray(a)?a.indexOf(e[r])<0?n[r]=a.concat([e[r]]):n[r]=a:n[r]=[a,e[r]],n}),{})}function tf(e){const t="ordered"===e?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function nf(e){return e.reduce(((e,t)=>{if("string"==typeof t.insert){const n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)}),new Ah)}function rf(e,t){let{index:n,length:r}=e;return new Kh(n+t,r)}class af{static DEFAULTS={};constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=e,this.options=t}}const of="\ufeff";class sf extends Bd{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((e=>{this.contentNode.appendChild(e)})),this.leftGuard=document.createTextNode(of),this.rightGuard=document.createTextNode(of),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t,n=null;const r=e.data.split(of).join("");if(e===this.leftGuard)if(this.prev instanceof jh){const e=this.prev.length();this.prev.insertAt(e,r),n={startNode:this.prev.domNode,startOffset:e+r.length}}else t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this),n={startNode:t,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof jh?(this.next.insertAt(0,r),n={startNode:this.next.domNode,startOffset:r.length}):(t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this.next),n={startNode:t,startOffset:r.length}));return e.data=of,n}update(e,t){e.forEach((e=>{if("characterData"===e.type&&(e.target===this.leftGuard||e.target===this.rightGuard)){const n=this.restore(e.target);n&&(t.range=n)}}))}}class lf{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;!t||t instanceof sf||(this.emitter.emit(zh.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(zh.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(zh.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(zh.events.COMPOSITION_END,e),this.isComposing=!1}}class cf{static DEFAULTS={modules:{}};static themes={default:cf};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{null==this.modules[e]&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const uf=e=>{const t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},df=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},hf=(e,t,n,r,a,i)=>er?0:er?t-e>r-n?e+a-n:t-r+i:0,ff=["block","break","cursor","inline","scroll","text"],pf=Fh("quill"),mf=new yd;Td.uiClass="ql-ui";class vf{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:mf,theme:"default"};static events=zh.events;static sources=zh.sources;static version="2.0.2";static imports={delta:Ah,parchment:zd,"core/module":af,"core/theme":cf};static debug(e){!0===e&&(e="log"),Fh.level(e)}static find(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Bh.get(e)||mf.find(e,t)}static import(e){return null==this.imports[e]&&pf.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const e=arguments.length<=0?void 0:arguments[0],t=!!(arguments.length<=1?void 0:arguments[1]),n="attrName"in e?e.attrName:e.blotName;"string"==typeof n?this.register(`formats/${n}`,e,t):Object.keys(e).forEach((n=>{this.register(n,e[n],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[e]||n||pf.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&"boolean"!=typeof t&&"abstract"!==t.blotName&&mf.register(t),"function"==typeof t.register&&t.register(mf)}}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(e,t){const n=gf(e);if(!n)throw new Error("Invalid Quill container");const r=!t.theme||t.theme===vf.DEFAULTS.theme,a=r?cf:vf.import(`themes/${t.theme}`);if(!a)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...o}=vf.DEFAULTS,{modules:s,...l}=a.DEFAULTS;let c=bf(t.modules);null!=c&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});const u=pd({},bf(i),bf(s),c),d={...o,...yf(l),...yf(t)};let h=t.registry;h?t.formats&&pf.warn('Ignoring "formats" option because "registry" is specified'):h=t.formats?((e,t,n)=>{const r=new yd;return ff.forEach((e=>{const n=t.query(e);n&&r.register(n)})),e.forEach((e=>{let a=t.query(e);a||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let i=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,i+=1,i>100){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}})),r})(t.formats,d.registry,pf):d.registry;return{...d,registry:h,container:n,theme:a,modules:Object.entries(u).reduce(((e,t)=>{let[n,r]=t;if(!r)return e;const a=vf.import(`modules/${n}`);return null==a?(pf.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:pd({},a.DEFAULTS||{},r)}}),{}),bounds:gf(d.bounds)}}(e,t),this.container=this.options.container,null==this.container)return void pf.error("Invalid Quill container",e);this.options.debug&&vf.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Bh.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new zh;const r=Ud.blotName,a=this.options.registry.query(r);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Xh(this.scroll),this.selection=new Zh(this.scroll,this.emitter),this.composition=new lf(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(zh.events.EDITOR_CHANGE,(e=>{e===zh.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(zh.events.SCROLL_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;Ef.call(this,(()=>this.editor.update(null,t,a)),e)})),this.emitter.on(zh.events.SCROLL_EMBED_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;Ef.call(this,(()=>{const n=(new Ah).retain(e.offset(this)).retain({[e.statics.blotName]:t});return this.editor.update(n,[],a)}),vf.sources.USER)})),n){const e=this.clipboard.convert({html:`${n}


    `,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){const t=e;(e=document.createElement("div")).classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=wf(e,t,n),Ef.call(this,(()=>this.editor.deleteText(e,t)),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zh.sources.API;return Ef.call(this,(()=>{const n=this.getSelection(!0);let r=new Ah;if(null==n)return r;if(this.scroll.query(e,md.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else{if(0===n.length)return this.selection.format(e,t),r;r=this.editor.formatText(n.index,n.length,{[e]:t})}return this.setSelection(n,zh.sources.SILENT),r}),n)}formatLine(e,t,n,r,a){let i;return[e,t,i,a]=wf(e,t,n,r,a),Ef.call(this,(()=>this.editor.formatLine(e,t,i)),a,e,0)}formatText(e,t,n,r,a){let i;return[e,t,i,a]=wf(e,t,n,r,a),Ef.call(this,(()=>this.editor.formatText(e,t,i)),a,e,0)}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;const r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;return[e,t]=wf(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=wf(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=wf(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vf.sources.API;return Ef.call(this,(()=>this.editor.insertEmbed(e,t,n)),r,e)}insertText(e,t,n,r,a){let i;return[e,,i,a]=wf(e,0,n,r,a),Ef.call(this,(()=>this.editor.insertText(e,t,i)),a,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=wf(e,t,n),Ef.call(this,(()=>this.editor.removeFormat(e,t)),n,e)}scrollRectIntoView(e){((e,t)=>{const n=e.ownerDocument;let r=t,a=e;for(;a;){const e=a===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:uf(a),o=getComputedStyle(a),s=hf(r.left,r.right,t.left,t.right,df(o.scrollPaddingLeft),df(o.scrollPaddingRight)),l=hf(r.top,r.bottom,t.top,t.bottom,df(o.scrollPaddingTop),df(o.scrollPaddingBottom));if(s||l)if(e)n.defaultView?.scrollBy(s,l);else{const{scrollLeft:e,scrollTop:t}=a;l&&(a.scrollTop+=l),s&&(a.scrollLeft+=s);const n=a.scrollLeft-e,i=a.scrollTop-t;r={left:r.left-n,top:r.top-i,right:r.right-n,bottom:r.bottom-i}}a=e||"fixed"===o.position?null:(i=a).parentElement||i.getRootNode().host||null}var i})(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh.sources.API;return Ef.call(this,(()=>{e=new Ah(e);const t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(a)}),t)}setSelection(e,t,n){null==e?this.selection.setRange(null,t||vf.sources.API):([e,t,,n]=wf(e,t,n),this.selection.setRange(new Kh(Math.max(0,e),t),n),n!==zh.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh.sources.API;const n=(new Ah).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zh.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh.sources.API;return Ef.call(this,(()=>(e=new Ah(e),this.editor.applyDelta(e))),t,!0)}}function gf(e){return"string"==typeof e?document.querySelector(e):e}function bf(e){return Object.entries(e??{}).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:!0===r?{}:r}}),{})}function yf(e){return Object.fromEntries(Object.entries(e).filter((e=>void 0!==e[1])))}function Ef(e,t,n,r){if(!this.isEnabled()&&t===zh.sources.USER&&!this.allowReadOnlyEdits)return new Ah;let a=null==n?null:this.getSelection();const i=this.editor.delta,o=e();if(null!=a&&(!0===n&&(n=a.index),null==r?a=xf(a,o,t):0!==r&&(a=xf(a,n,r,t)),this.setSelection(a,zh.sources.SILENT)),o.length()>0){const e=[zh.events.TEXT_CHANGE,o,i,t];this.emitter.emit(zh.events.EDITOR_CHANGE,...e),t!==zh.sources.SILENT&&this.emitter.emit(...e)}return o}function wf(e,t,n,r,a){let i={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(a=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(a=r,r=n,n=t,t=0),"object"==typeof n?(i=n,a=r):"string"==typeof n&&(null!=r?i[n]=r:a=n),[e,t,i,a=a||zh.sources.API]}function xf(e,t,n,r){const a="number"==typeof n?n:0;if(null==e)return null;let i,o;return t&&"function"==typeof t.transformPosition?[i,o]=[e.index,e.index+e.length].map((e=>t.transformPosition(e,r!==zh.sources.USER))):[i,o]=[e.index,e.index+e.length].map((e=>e=0?e+a:Math.max(t,e+a))),new Kh(i,o-i)}class Nf extends Dd{}function kf(e){return e instanceof Th||e instanceof _h}function Of(e){return"function"==typeof e.updateContent}function Lf(e,t,n){n.reduce(((t,n)=>{const r=Lh.Op.length(n);let a=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const r=n.insert;e.insertAt(t,r);const[i]=e.descendant(Sd,t),o=Rh(i);a=Lh.AttributeMap.diff(o,a)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return t;e.insertAt(t,r,n.insert[r]);if(null!=e.scroll.query(r,md.INLINE)){const[n]=e.descendant(Sd,t),r=Rh(n);a=Lh.AttributeMap.diff(r,a)||{}}}return Object.keys(a).forEach((n=>{e.formatAt(t,r,n,a[n])})),t+r}),t)}const Af={scope:md.BLOCK,whitelist:["right","center","justify"]},Sf=new vd("align","align",Af),jf=new wd("align","ql-align",Af),Mf=new Nd("align","text-align",Af);class Cf extends Nd{value(e){let t=super.value(e);if(!t.startsWith("rgb("))return t;t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");return`#${t.split(",").map((e=>`00${parseInt(e,10).toString(16)}`.slice(-2))).join("")}`}}const Tf=new wd("color","ql-color",{scope:md.INLINE}),_f=new Cf("color","color",{scope:md.INLINE}),Pf=new wd("background","ql-bg",{scope:md.INLINE}),Rf=new Cf("background","background-color",{scope:md.INLINE});class qf extends Nf{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((e=>e.length()<=1?"":e.domNode.innerText)).join("\n").slice(e,e+t)}html(e,t){return`
    \n${Mh(this.code(e,t))}\n
    `}}class If extends Th{static TAB=" ";static register(){vf.register(qf)}}class Df extends Ch{}Df.blotName="code",Df.tagName="CODE",If.blotName="code-block",If.className="ql-code-block",If.tagName="DIV",qf.blotName="code-block-container",qf.className="ql-code-block-container",qf.tagName="DIV",qf.allowedChildren=[If],If.allowedChildren=[jh,Sh,qh],If.requiredContainer=qf;const Bf={scope:md.BLOCK,whitelist:["rtl"]},$f=new vd("direction","dir",Bf),Hf=new wd("direction","ql-direction",Bf),Uf=new Nd("direction","direction",Bf),Ff={scope:md.INLINE,whitelist:["serif","monospace"]},Vf=new wd("font","ql-font",Ff);const zf=new class extends Nd{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",Ff),Wf=new wd("size","ql-size",{scope:md.INLINE,whitelist:["small","large","huge"]}),Kf=new Nd("size","font-size",{scope:md.INLINE,whitelist:["10px","18px","32px"]}),Zf=Fh("quill:keyboard"),Gf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Yf extends af{static match(e,t){return!["altKey","ctrlKey","metaKey","shiftKey"].some((n=>!!t[n]!==e[n]&&null!==t[n]))&&(t.key===e.key||t.key===e.which)}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){if("string"==typeof e||"number"==typeof e)e={key:e};else{if("object"!=typeof e)return null;e=Su(e)}e.shortKey&&(e[Gf]=e.shortKey,delete e.shortKey);return e}(e);if(null==r)return void Zf.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n});(Array.isArray(r.key)?r.key:[r.key]).forEach((e=>{const a={...r,key:e,...t,...n};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing)return;if(229===e.keyCode&&("Enter"===e.key||"Backspace"===e.key))return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((t=>Yf.match(e,t)));if(0===t.length)return;const n=vf.find(e.target,!0);if(n&&n.scroll!==this.quill.scroll)return;const r=this.quill.getSelection();if(null==r||!this.quill.hasFocus())return;const[a,i]=this.quill.getLine(r.index),[o,s]=this.quill.getLeaf(r.index),[l,c]=0===r.length?[o,s]:this.quill.getLeaf(r.index+r.length),u=o instanceof Vd?o.value().slice(0,s):"",d=l instanceof Vd?l.value().slice(c):"",h={collapsed:0===r.length,empty:0===r.length&&a.length()<=1,format:this.quill.getFormat(r),line:a,offset:i,prefix:u,suffix:d,event:e};t.some((e=>{if(null!=e.collapsed&&e.collapsed!==h.collapsed)return!1;if(null!=e.empty&&e.empty!==h.empty)return!1;if(null!=e.offset&&e.offset!==h.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((e=>null==h.format[e])))return!1}else if("object"==typeof e.format&&!Object.keys(e.format).every((t=>!0===e.format[t]?null!=h.format[t]:!1===e.format[t]?null==h.format[t]:hd(e.format[t],h.format[t]))))return!1;return!(null!=e.prefix&&!e.prefix.test(h.prefix))&&(!(null!=e.suffix&&!e.suffix.test(h.suffix))&&!0!==e.handler.call(this,r,h,e))}))&&e.preventDefault()}))}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(0===e.index||this.quill.getLength()<=1)return;let r={};const[a]=this.quill.getLine(e.index);let i=(new Ah).retain(e.index-n).delete(n);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(t){if(!("block"===t.statics.blotName&&t.length()<=1)){const t=a.formats(),n=this.quill.getFormat(e.index-1,1);if(r=Lh.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){const t=(new Ah).retain(e.index+a.length()-2).retain(1,r);i=i.compose(t)}}}}this.quill.updateContents(i,vf.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={};const[a]=this.quill.getLine(e.index);let i=(new Ah).retain(e.index).delete(n);if(t.offset>=a.length()-1){const[t]=this.quill.getLine(e.index+1);if(t){const n=a.formats(),o=this.quill.getFormat(e.index,1);r=Lh.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(i=i.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(i,vf.sources.USER),this.quill.focus()}handleDeleteRange(e){np({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce(((e,n)=>(this.quill.scroll.query(n,md.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e)),{}),r=(new Ah).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,vf.sources.USER),this.quill.setSelection(e.index+1,vf.sources.SILENT),this.quill.focus()}}const Xf={bindings:{bold:ep("bold"),italic:ep("italic"),underline:ep("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","+1",vf.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","-1",vf.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){null!=t.format.indent?this.quill.format("indent","-1",vf.sources.USER):null!=t.format.list&&this.quill.format("list",!1,vf.sources.USER)}},"indent code-block":Jf(!0),"outdent code-block":Jf(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,vf.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const n=(new Ah).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,vf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,vf.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,vf.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,vf.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},a=(new Ah).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(a,vf.sources.USER),this.quill.setSelection(e.index+1,vf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[n,r]=this.quill.getLine(e.index),a=(new Ah).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(a,vf.sources.USER),this.quill.setSelection(e.index+1,vf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[n,r,a,i]=t.getTable(e),o=function(e,t,n,r){if(null==t.prev&&null==t.next)return null==n.prev&&null==n.next?0===r?-1:1:null==n.prev?-1:1;if(null==t.prev)return-1;if(null==t.next)return 1;return null}(0,r,a,i);if(null==o)return;let s=n.offset();if(o<0){const t=(new Ah).retain(s).insert("\n");this.quill.updateContents(t,vf.sources.USER),this.quill.setSelection(e.index+1,e.length,vf.sources.SILENT)}else if(o>0){s+=n.length();const e=(new Ah).retain(s).insert("\n");this.quill.updateContents(e,vf.sources.USER),this.quill.setSelection(s,vf.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:n,line:r}=t,a=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(a-1,vf.sources.USER):this.quill.setSelection(a+r.length(),vf.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=t.prefix,[r,a]=this.quill.getLine(e.index);if(a>n)return!0;let i;switch(t.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(e.index," ",vf.sources.USER),this.quill.history.cutoff();const o=(new Ah).retain(e.index-a).delete(n+1).retain(r.length()-2-a).retain(1,{list:i});return this.quill.updateContents(o,vf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,vf.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,n]=this.quill.getLine(e.index);let r=2,a=t;for(;null!=a&&a.length()<=1&&a.formats()["code-block"];)if(a=a.prev,r-=1,r<=0){const r=(new Ah).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,vf.sources.USER),this.quill.setSelection(e.index-1,vf.sources.SILENT),!1}return!0}},"embed left":Qf("ArrowLeft",!1),"embed left shift":Qf("ArrowLeft",!0),"embed right":Qf("ArrowRight",!1),"embed right shift":Qf("ArrowRight",!0),"table down":tp(!1),"table up":tp(!0)}};function Jf(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n;const a=this.quill.scroll.query("code-block"),{TAB:i}=a;if(0===t.length&&!r.shiftKey)return this.quill.insertText(t.index,i,vf.sources.USER),void this.quill.setSelection(t.index+i.length,vf.sources.SILENT);const o=0===t.length?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:s,length:l}=t;o.forEach(((t,n)=>{e?(t.insertAt(0,i),0===n?s+=i.length:l+=i.length):t.domNode.textContent.startsWith(i)&&(t.deleteAt(0,i.length),0===n?s-=i.length:l-=i.length)})),this.quill.update(vf.sources.USER),this.quill.setSelection(s,l,vf.sources.SILENT)}}}function Qf(e,t){return{key:e,shiftKey:t,altKey:null,["ArrowLeft"===e?"prefix":"suffix"]:/^$/,handler(n){let{index:r}=n;"ArrowRight"===e&&(r+=n.length+1);const[a]=this.quill.getLeaf(r);return!(a instanceof Bd)||("ArrowLeft"===e?t?this.quill.setSelection(n.index-1,n.length+1,vf.sources.USER):this.quill.setSelection(n.index-1,vf.sources.USER):t?this.quill.setSelection(n.index,n.length+1,vf.sources.USER):this.quill.setSelection(n.index+n.length+1,vf.sources.USER),!1)}}}function ep(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],vf.sources.USER)}}}function tp(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){const r=e?"prev":"next",a=n.line,i=a.parent[r];if(null!=i){if("table-row"===i.statics.blotName){let e=i.children.head,t=a;for(;null!=t.prev;)t=t.prev,e=e.next;const r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,vf.sources.USER)}}else{const t=a.table()[r];null!=t&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,vf.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,vf.sources.USER))}return!1}}}function np(e){let{quill:t,range:n}=e;const r=t.getLines(n);let a={};if(r.length>1){const e=r[0].formats(),t=r[r.length-1].formats();a=Lh.AttributeMap.diff(t,e)||{}}t.deleteText(n,vf.sources.USER),Object.keys(a).length>0&&t.formatLine(n.index,1,a,vf.sources.USER),t.setSelection(n.index,vf.sources.SILENT)}Yf.DEFAULTS=Xf;const rp=/font-weight:\s*normal/,ap=["P","OL","UL"],ip=e=>e&&ap.includes(e.tagName);const op=/\bmso-list:[^;]*ignore/i,sp=/\bmso-list:[^;]*\bl(\d+)/i,lp=/\bmso-list:[^;]*\blevel(\d+)/i,cp=e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach((e=>{(e.getAttribute("style")||"").match(op)?n.push(e):r.push(e)})),n.forEach((e=>e.parentNode?.removeChild(e)));const a=e.documentElement.innerHTML,i=r.map((e=>((e,t)=>{const n=e.getAttribute("style"),r=n?.match(sp);if(!r)return null;const a=Number(r[1]),i=n?.match(lp),o=i?Number(i[1]):1,s=new RegExp(`@list l${a}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=t.match(s);return{id:a,indent:o,type:l&&"bullet"===l[1]?"bullet":"ordered",element:e}})(e,a))).filter((e=>e));for(;i.length;){const e=[];let t=i.shift();for(;t;)e.push(t),t=i.length&&i[0]?.element===t.element.nextElementSibling&&i[0].id===t.id?i.shift():null;const n=document.createElement("ul");e.forEach((e=>{const t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class","ql-indent-"+(e.indent-1)),t.innerHTML=e.element.innerHTML,n.appendChild(t)}));const r=e[0]?.element,{parentNode:a}=r??{};r&&a?.replaceChild(n,r),e.slice(1).forEach((e=>{let{element:t}=e;a?.removeChild(t)}))}};const up=[function(e){"urn:schemas-microsoft-com:office:word"===e.documentElement.getAttribute("xmlns:w")&&cp(e)},function(e){e.querySelector('[id^="docs-internal-guid-"]')&&((e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(rp))).forEach((t=>{const n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)}))})(e),(e=>{Array.from(e.querySelectorAll("br")).filter((e=>ip(e.previousElementSibling)&&ip(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))})(e))}],dp=Fh("quill:clipboard"),hp=[[Node.TEXT_NODE,function(e,t,n){let r=e.data;if("O:P"===e.parentElement?.tagName)return t.insert(r.trim());if(!yp(e)){if(0===r.trim().length&&r.includes("\n")&&!function(e,t){return e.previousElementSibling&&e.nextElementSibling&&!gp(e.previousElementSibling,t)&&!gp(e.nextElementSibling,t)}(e,n))return t;const a=(e,t)=>{const n=t.replace(/[^\u00a0]/g,"");return n.length<1&&e?" ":n};r=r.replace(/\r\n/g," ").replace(/\n/g," "),r=r.replace(/\s\s+/g,a.bind(a,!0)),(null==e.previousSibling&&null!=e.parentElement&&gp(e.parentElement,n)||e.previousSibling instanceof Element&&gp(e.previousSibling,n))&&(r=r.replace(/^\s+/,a.bind(a,!1))),(null==e.nextSibling&&null!=e.parentElement&&gp(e.parentElement,n)||e.nextSibling instanceof Element&&gp(e.nextSibling,n))&&(r=r.replace(/\s+$/,a.bind(a,!1)))}return t.insert(r)}],[Node.TEXT_NODE,xp],["br",function(e,t){vp(t,"\n")||t.insert("\n");return t}],[Node.ELEMENT_NODE,xp],[Node.ELEMENT_NODE,function(e,t,n){const r=n.query(e);if(null==r)return t;if(r.prototype instanceof Bd){const t={},a=r.value(e);if(null!=a)return t[r.blotName]=a,(new Ah).insert(t,r.formats(e,n))}else if(r.prototype instanceof qd&&!vp(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&"function"==typeof r.formats)return mp(t,r.blotName,r.formats(e,n),n);return t}],[Node.ELEMENT_NODE,function(e,t,n){const r=vd.keys(e),a=wd.keys(e),i=Nd.keys(e),o={};return r.concat(a).concat(i).forEach((t=>{let r=n.query(t,md.ATTRIBUTE);null!=r&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=fp[t],null==r||r.attrName!==t&&r.keyName!==t||(o[r.attrName]=r.value(e)||void 0),r=pp[t],null==r||r.attrName!==t&&r.keyName!==t||(r=pp[t],o[r.attrName]=r.value(e)||void 0))})),Object.entries(o).reduce(((e,t)=>{let[r,a]=t;return mp(e,r,a,n)}),t)}],[Node.ELEMENT_NODE,function(e,t,n){const r={},a=e.style||{};"italic"===a.fontStyle&&(r.italic=!0);"underline"===a.textDecoration&&(r.underline=!0);"line-through"===a.textDecoration&&(r.strike=!0);(a.fontWeight?.startsWith("bold")||parseInt(a.fontWeight,10)>=700)&&(r.bold=!0);if(t=Object.entries(r).reduce(((e,t)=>{let[r,a]=t;return mp(e,r,a,n)}),t),parseFloat(a.textIndent||0)>0)return(new Ah).insert("\t").concat(t);return t}],["li",function(e,t,n){const r=n.query(e);if(null==r||"list"!==r.blotName||!vp(t,"\n"))return t;let a=-1,i=e.parentNode;for(;null!=i;)["OL","UL"].includes(i.tagName)&&(a+=1),i=i.parentNode;return a<=0?t:t.reduce(((e,t)=>t.insert?t.attributes&&"number"==typeof t.attributes.indent?e.push(t):e.insert(t.insert,{indent:a,...t.attributes||{}}):e),new Ah)}],["ol, ul",function(e,t,n){const r=e;let a="OL"===r.tagName?"ordered":"bullet";const i=r.getAttribute("data-checked");i&&(a="true"===i?"checked":"unchecked");return mp(t,"list",a,n)}],["pre",function(e,t,n){const r=n.query("code-block"),a=!r||!("formats"in r)||"function"!=typeof r.formats||r.formats(e,n);return mp(t,"code-block",a,n)}],["tr",function(e,t,n){const r="TABLE"===e.parentElement?.tagName?e.parentElement:e.parentElement?.parentElement;if(null!=r){return mp(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n)}return t}],["b",wp("bold")],["i",wp("italic")],["strike",wp("strike")],["style",function(){return new Ah}]],fp=[Sf,$f].reduce(((e,t)=>(e[t.keyName]=t,e)),{}),pp=[Mf,Rf,_f,Uf,zf,Kf].reduce(((e,t)=>(e[t.keyName]=t,e)),{});function mp(e,t,n,r){return r.query(t)?e.reduce(((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);const a=n?{[t]:n}:{};return e.insert(r.insert,{...a,...r.attributes})}),new Ah):e}function vp(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.lengthr(t,n,e)),new Ah):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce(((i,o)=>{let s=Ep(e,o,n,r,a);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce(((t,n)=>n(o,t,e)),s),s=(a.get(o)||[]).reduce(((t,n)=>n(o,t,e)),s)),i.concat(s)}),new Ah):new Ah}function wp(e){return(t,n,r)=>mp(n,e,!0,r)}function xp(e,t,n){if(!vp(t,"\n")){if(gp(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;null!=r;){if(gp(r,n))return t.insert("\n");const e=n.query(r);if(e&&e.prototype instanceof _h)return t.insert("\n");r=r.firstChild}}}return t}function Np(e,t){let n=t;for(let t=e.length-1;t>=0;t-=1){const r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&kp(r.range,n)},n=r.delta.transform(n),0===e[t].delta.length()&&e.splice(t,1)}}function kp(e,t){if(!e)return e;const n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}class Op extends af{constructor(e,t){super(e,t),e.root.addEventListener("drop",(t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}const r=n&&e.selection.normalizeNative(n);if(r){const n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}}))}upload(e,t){const n=[];Array.from(t).forEach((e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)})),n.length>0&&this.options.handler.call(this,e,n)}}Op.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;const n=t.map((e=>new Promise((t=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}))));Promise.all(n).then((t=>{const n=t.reduce(((e,t)=>e.insert({image:t})),(new Ah).retain(e.index).delete(e.length));this.quill.updateContents(n,zh.sources.USER),this.quill.setSelection(e.index+t.length,zh.sources.SILENT)}))}};const Lp=["insertText","insertReplacementText"];const Ap=/Mac/i.test(navigator.platform);vf.register({"blots/block":Th,"blots/block/embed":_h,"blots/break":Sh,"blots/container":Nf,"blots/cursor":qh,"blots/embed":sf,"blots/inline":Ch,"blots/scroll":class extends Ud{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Th;static allowedChildren=[Th,_h,Nf];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(e=>this.handleDragStart(e)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(zh.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(zh.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(zh.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,r]=this.line(e),[a]=this.line(e+t);if(super.deleteAt(e,t),null!=a&&n!==a&&r>0){if(n instanceof _h||a instanceof _h)return void this.optimize();const e=a.children.head instanceof Sh?null:a.children.head;n.moveChildren(a,e),n.remove()}this.optimize()}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(null==n||null==this.scroll.query(t,md.BLOCK)){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),null==n&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{const e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===md.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat((new Ah).insert("\n"))),r=n.pop();if(null==r)return;this.batchStart();const a=n.shift();if(a){const t="block"===a.type&&(0===a.delta.length()||!this.descendant(_h,e)[0]&&e{this.formatAt(i-1,1,e,s[e])})),e=i}let[i,o]=this.children.find(e);if(n.length&&(i&&(i=i.split(o),o=0),n.forEach((e=>{if("block"===e.type){Lf(this.createBlock(e.attributes,i||void 0),0,e.delta)}else{const t=this.create(e.key,e.value);this.insertBefore(t,i||void 0),Object.keys(e.attributes).forEach((n=>{t.format(n,e.attributes[n])}))}}))),"block"===r.type&&r.delta.length()){Lf(this,i?i.offset(i.scroll)+o:this.length(),r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,r]=t;return n instanceof Sd?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(kf,e)}lines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(e,t,r)=>{let a=[],i=r;return e.children.forEachAt(t,r,((e,t,r)=>{kf(e)?a.push(e):e instanceof Dd&&(a=a.concat(n(e,t,i))),i-=r})),a};return n(this,e,t)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(zh.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch)return void(Array.isArray(e)&&(this.batch=this.batch.concat(e)));let t=zh.sources.USER;"string"==typeof e&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),(e=e.filter((e=>{let{target:t}=e;const n=this.find(t,!0);return n&&!Of(n)}))).length>0&&this.emitter.emit(zh.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(zh.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[r]=this.descendant((e=>e instanceof _h),e);r&&r.statics.blotName===t&&Of(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new Ah;return e.forEach((e=>{const r=e?.insert;if(r)if("string"==typeof r){const a=r.split("\n");a.slice(0,-1).forEach((r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new Ah}));const i=a[a.length-1];i&&n.insert(i,e.attributes)}else{const a=Object.keys(r)[0];if(!a)return;this.query(a,md.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new Ah,t.push({type:"blockEmbed",key:a,value:r[a],attributes:e.attributes??{}}))}})),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const r={};Object.entries(e).forEach((e=>{let[t,a]=e;null!=this.query(t,md.BLOCK&md.BLOT)?n=t:r[t]=a}));const a=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(a,t||void 0);const i=a.length();return Object.entries(r).forEach((e=>{let[t,n]=e;a.formatAt(0,i,t,n)})),a}},"blots/text":jh,"modules/clipboard":class extends af{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(e=>this.onCaptureCopy(e,!1))),this.quill.root.addEventListener("cut",(e=>this.onCaptureCopy(e,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],hp.concat(this.options.matchers??[]).forEach((e=>{let[t,n]=e;this.addMatcher(t,n)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r[If.blotName])return(new Ah).insert(n||"",{[If.blotName]:r[If.blotName]});if(!t)return(new Ah).insert(n||"",r);const a=this.convertHTML(t);return vp(a,"\n")&&(null==a.ops[a.ops.length-1].attributes||r.table)?a.compose((new Ah).retain(a.length()-1).delete(1)):a}normalizeHTML(e){(e=>{e.documentElement&&up.forEach((t=>{t(e)}))})(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,r=new WeakMap,[a,i]=this.prepareMatching(n,r);return Ep(this.quill.scroll,n,a,i,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vf.sources.API;if("string"==typeof e){const n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,vf.sources.SILENT)}else{const r=this.convert({html:t,text:""});this.quill.updateContents((new Ah).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),vf.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(null==n)return;const{html:r,text:a}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",a),e.clipboardData?.setData("text/html",r),t&&np({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((e=>"#"!==e[0])).join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(null==t)return;const n=e.clipboardData?.getData("text/html");let r=e.clipboardData?.getData("text/plain");if(!n&&!r){const t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}const a=Array.from(e.clipboardData?.files||[]);if(!n&&a.length>0)this.quill.uploader.upload(t,a);else{if(n&&a.length>0){const e=(new DOMParser).parseFromString(n,"text/html");if(1===e.body.childElementCount&&"IMG"===e.body.firstElementChild?.tagName)return void this.quill.uploader.upload(t,a)}this.onPaste(t,{html:n,text:r})}}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t;const a=this.quill.getFormat(e.index),i=this.convert({text:n,html:r},a);dp.log("onPaste",i,{text:n,html:r});const o=(new Ah).retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,vf.sources.USER),this.quill.setSelection(o.length()-e.length,vf.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],r=[];return this.matchers.forEach((a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach((e=>{if(t.has(e)){const n=t.get(e);n?.push(o)}else t.set(e,[o])}))}})),[n,r]}},"modules/history":class extends af{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(vf.events.EDITOR_CHANGE,((e,t,n,r)=>{e===vf.events.SELECTION_CHANGE?t&&r!==vf.sources.SILENT&&(this.currentRange=t):e===vf.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&r!==vf.sources.USER?this.transform(t):this.record(t,n)),this.currentRange=kp(this.currentRange,t))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(e=>{"historyUndo"===e.inputType?(this.undo(),e.preventDefault()):"historyRedo"===e.inputType&&(this.redo(),e.preventDefault())}))}change(e,t){if(0===this.stack[e].length)return;const n=this.stack[e].pop();if(!n)return;const r=this.quill.getContents(),a=n.delta.invert(r);this.stack[t].push({delta:a,range:kp(n.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,vf.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(0===e.ops.length)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=a;0!==n.length()&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Np(this.stack.undo,e),Np(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,vf.sources.USER);else{const t=function(e,t){const n=t.reduce(((e,t)=>e+(t.delete||0)),0);let r=t.length()-n;(function(e,t){const n=t.ops[t.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some((t=>null!=e.query(t,md.BLOCK)));return!1})(e,t)&&(r-=1);return r}(this.quill.scroll,e.delta);this.quill.setSelection(t,vf.sources.USER)}}},"modules/keyboard":Yf,"modules/uploader":Op,"modules/input":class extends af{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(e=>{this.handleBeforeInput(e)})),/Android/i.test(navigator.userAgent)||e.on(vf.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){np({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===e.length)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new Ah).retain(e.index).insert(t,n),vf.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,vf.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Lp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||!0===t.collapsed)return;const n=function(e){if("string"==typeof e.data)return e.data;if(e.dataTransfer?.types.includes("text/plain"))return e.dataTransfer.getData("text/plain");return null}(e);if(null==n)return;const r=this.quill.selection.normalizeNative(t),a=r?this.quill.selection.normalizedToRange(r):null;a&&this.replaceText(a,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}},"modules/uiNode":class extends af{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof Td&&n.uiNode))return!0;const a="rtl"===getComputedStyle(n.domNode).direction;return!!(a&&"ArrowRight"!==r.key||!a&&"ArrowLeft"!==r.key)||(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),vf.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&(e=>"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"Home"===e.key||!(!Ap||"a"!==e.key||!0!==e.ctrlKey))(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(!0!==t.collapsed||0!==t.startOffset)return;const n=this.quill.scroll.find(t.startContainer);if(!(n instanceof Td&&n.uiNode))return;const r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}}});const Sp=new class extends wd{add(e,t){let n=0;if("+1"===t||"-1"===t){const r=this.value(e)||0;n="+1"===t?r+1:r-1}else"number"==typeof t&&(n=t);return 0===n?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:md.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class jp extends Nf{}jp.blotName="list-container",jp.tagName="OL";class Mp extends Th{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){vf.register(jp)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;const r=this.statics.formats(t,e);"checked"===r?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===r&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Mp.blotName="list",Mp.tagName="LI",jp.allowedChildren=[Mp],Mp.requiredContainer=jp;class Cp extends Ch{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}let Tp=class extends Ch{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return _p(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("href",this.constructor.sanitize(t)):super.format(e,t)}};function _p(e,t){const n=document.createElement("a");n.href=e;const r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}const Pp=["alt","height","width"];const Rp=["height","width"];const qp=new wd("code-token","hljs",{scope:md.INLINE});class Ip extends Ch{static formats(e,t){for(;null!=e&&e!==t.domNode;){if(e.classList&&e.classList.contains(If.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),qp.add(this.domNode,n)}format(e,t){e!==Ip.blotName?super.format(e,t):t?qp.add(this.domNode,t):(qp.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),qp.value(this.domNode)||this.unwrap()}}Ip.blotName="code-token",Ip.className="ql-token";class Dp extends If{static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Ip.blotName,!1),super.replaceWith(e,t)}}class Bp extends qf{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Dp.blotName&&(this.forceNext=!0,this.children.forEach((n=>{n.format(e,t)})))}formatAt(e,t,n,r){n===Dp.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=`${Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).map((e=>e.textContent)).join("\n")}\n`,r=Dp.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||null==this.cachedText){const t=this.children.reduce(((e,t)=>e.concat(Ph(t,!1))),new Ah),a=e(n,r);t.diff(a).reduce(((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach((t=>{[Dp.blotName,Ip.blotName].includes(t)&&this.formatAt(e,n,t,r[t])})),e+n):e}),0)}this.cachedText=n,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`
    \n${Mh(this.code(e,t))}\n
    `}optimize(e){if(super.optimize(e),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const e=Dp.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Bp.allowedChildren=[Dp],Dp.requiredContainer=Bp,Dp.allowedChildren=[Ip,qh,jh,Sh];class $p extends af{static register(){vf.register(Ip,!0),vf.register(Dp,!0),vf.register(Bp,!0)}constructor(e,t){if(super(e,t),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((e,t)=>{let{key:n}=t;return e[n]=!0,e}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(vf.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Bp))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((e=>{let{key:n,label:r}=e;const a=t.ownerDocument.createElement("option");a.textContent=r,a.setAttribute("value",n),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(Dp.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),null==e.uiNode&&(e.attachUI(t),e.children.head&&(t.value=Dp.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(vf.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(vf.sources.USER);const n=this.quill.getSelection();(null==e?this.quill.scroll.descendants(Bp):[e]).forEach((e=>{e.highlight(this.highlightBlot,t)})),this.quill.update(vf.sources.SILENT),null!=n&&this.quill.setSelection(n,vf.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(t=this.languages[t]?t:"plain","plain"===t)return Mh(e).split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[If.blotName]:t}),e.insert(n))),new Ah);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(If.className),n.innerHTML=((e,t,n)=>{if("string"==typeof e.versionString){const r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value})(this.options.hljs,t,e),Ep(this.quill.scroll,n,[(e,t)=>{const n=qp.value(e);return n?t.compose((new Ah).retain(t.length(),{[Ip.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[If.blotName]:t}),e.insert(n))),n)],new WeakMap)}}$p.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class Hp extends Th{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",zp()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Hp.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Up extends Nf{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach((e=>{if(null==e.next)return;const t=e.formats(),n=e.next.formats();if(t.table!==n.table){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class Fp extends Nf{static blotName="table-body";static tagName="TBODY"}class Vp extends Nf{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Up),t=e.reduce(((e,t)=>Math.max(t.children.length,e)),0);e.forEach((e=>{new Array(t-e.children.length).fill(0).forEach((()=>{let t;null!=e.children.head&&(t=Hp.formats(e.children.head.domNode));const n=this.scroll.create(Hp.blotName,t);e.appendChild(n),n.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(Fp);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e);null!=n&&n.remove()}))}insertColumn(e){const[t]=this.descendant(Fp);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e),r=Hp.formats(t.children.head.domNode),a=this.scroll.create(Hp.blotName,r);t.insertBefore(a,n)}))}insertRow(e){const[t]=this.descendant(Fp);if(null==t||null==t.children.head)return;const n=zp(),r=this.scroll.create(Up.blotName);t.children.head.children.forEach((()=>{const e=this.scroll.create(Hp.blotName,n);r.appendChild(e)}));const a=t.children.at(e);t.insertBefore(r,a)}rows(){const e=this.children.head;return null==e?[]:e.children.map((e=>e))}}function zp(){return`row-${Math.random().toString(36).slice(2,6)}`}Vp.allowedChildren=[Fp],Fp.requiredContainer=Vp,Fp.allowedChildren=[Up],Up.requiredContainer=Fp,Up.allowedChildren=[Hp],Hp.requiredContainer=Up;const Wp=Fh("quill:toolbar");class Kp extends af{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const t=document.createElement("div");t.setAttribute("role","toolbar"),function(e,t){Array.isArray(t[0])||(t=[t]);t.forEach((t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach((e=>{if("string"==typeof e)Zp(n,e);else{const t=Object.keys(e)[0],r=e[t];Array.isArray(r)?function(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach((e=>{const t=document.createElement("option");!1!==e?t.setAttribute("value",String(e)):t.setAttribute("selected","selected"),r.appendChild(t)})),e.appendChild(r)}(n,t,r):Zp(n,t,r)}})),e.appendChild(n)}))}(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((e=>{const t=this.options.handlers?.[e];t&&this.addHandler(e,t)})),Array.from(this.container.querySelectorAll("button, select")).forEach((e=>{this.attach(e)})),this.quill.on(vf.events.EDITOR_CHANGE,(()=>{const[e]=this.quill.selection.getRange();this.update(e)}))):Wp.error("Container required for toolbar",this.options)}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void Wp.warn("ignoring attaching to nonexistent format",t,e);const n="SELECT"===e.tagName?"change":"click";e.addEventListener(n,(n=>{let r;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];r=!t.hasAttribute("selected")&&(t.value||!1)}else r=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),n.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(null!=this.handlers[t])this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof Bd){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new Ah).retain(a.index).delete(a.length).insert({[t]:r}),vf.sources.USER)}else this.quill.format(t,r,vf.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=null==e?{}:this.quill.getFormat(e);this.controls.forEach((n=>{const[r,a]=n;if("SELECT"===a.tagName){let n=null;if(null==e)n=null;else if(null==t[r])n=a.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];"string"==typeof e&&(e=e.replace(/"/g,'\\"')),n=a.querySelector(`option[value="${e}"]`)}null==n?(a.value="",a.selectedIndex=-1):n.selected=!0}else if(null==e)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const e=t[r],n=e===a.getAttribute("value")||null!=e&&e.toString()===a.getAttribute("value")||null==e&&!a.getAttribute("value");a.classList.toggle("ql-active",n),a.setAttribute("aria-pressed",n.toString())}else{const e=null!=t[r];a.classList.toggle("ql-active",e),a.setAttribute("aria-pressed",e.toString())}}))}}function Zp(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),null!=n?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}Kp.DEFAULTS={},Kp.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(null!=e)if(0===e.length){const e=this.quill.getFormat();Object.keys(e).forEach((e=>{null!=this.quill.scroll.query(e,md.INLINE)&&this.quill.format(e,!1,vf.sources.USER)}))}else this.quill.removeFormat(e.index,e.length,vf.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();"rtl"===e&&null==t?this.quill.format("align","right",vf.sources.USER):e||"right"!==t||this.quill.format("align",!1,vf.sources.USER),this.quill.format("direction",e,vf.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if("+1"===e||"-1"===e){let t="+1"===e?1:-1;"rtl"===n.direction&&(t*=-1),this.quill.format("indent",r+t,vf.sources.USER)}},link(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,vf.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,vf.sources.USER):this.quill.format("list","unchecked",vf.sources.USER):this.quill.format("list",e,vf.sources.USER)}}};const Gp='';var Yp={align:{"":'',center:'',right:'',justify:''},background:'',blockquote:'',bold:'',clean:'',code:Gp,"code-block":Gp,color:'',direction:{"":'',rtl:''},formula:'',header:{1:'',2:'',3:'',4:'',5:'',6:''},italic:'',image:'',indent:{"+1":'',"-1":''},link:'',list:{bullet:'',check:'',ordered:''},script:{sub:'',super:''},strike:'',table:'',underline:'',video:''};let Xp=0;function Jp(e,t){e.setAttribute(t,`${!("true"===e.getAttribute(t))}`)}class Qp{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(()=>{this.togglePicker()})),this.label.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Jp(this.label,"aria-expanded"),Jp(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault()}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML='',e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Xp}`,Xp+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const n=this.buildItem(t);e.appendChild(n),!0===t.selected&&this.selectItem(n)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);const t=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class em extends Qp{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((e=>{e.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=r:n.style.fill=r)}}class tm extends Qp{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((e=>{e.innerHTML=t[e.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}class nm{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(e=>{const{overflowY:t}=getComputedStyle(e,null);return"visible"!==t&&"clip"!==t})(this.quill.root)&&this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=-1*this.quill.root.scrollTop+"px"})),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>r.right&&(i=r.right-a.right,this.root.style.left=`${t+i}px`),a.leftr.bottom){const t=a.bottom-a.top,r=e.bottom-e.top+t;this.root.style.top=n-r+"px",this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const rm=[!1,"center","right","justify"],am=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],im=[!1,"serif","monospace"],om=["1","2","3",!1],sm=["small",!1,"large","huge"];class lm extends cf{constructor(e,t){super(e,t);const n=t=>{document.body.contains(e.root)?(null==this.tooltip||this.tooltip.root.contains(t.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((e=>{e.container.contains(t.target)||e.close()}))):document.body.removeEventListener("click",n)};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return"toolbar"===e&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((e=>{(e.getAttribute("class")||"").split(/\s+/).forEach((n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{const r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((e=>{if(e.classList.contains("ql-align")&&(null==e.querySelector("option")&&um(e,rm),"object"==typeof t.align))return new tm(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){const n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&um(e,am,"background"===n?"#ffffff":"#000000"),new em(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?um(e,im):e.classList.contains("ql-header")?um(e,om):e.classList.contains("ql-size")&&um(e,sm)),new Qp(e)}));this.quill.on(zh.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((e=>{e.update()}))}))}}lm.DEFAULTS=pd({},cf.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");null==e&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",(()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""})),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class cm extends nm{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{"Enter"===e.key?(this.save(),e.preventDefault()):"Escape"===e.key&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,zh.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,zh.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=function(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t)return`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`;if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`;return e}(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(null!=t){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,zh.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",zh.sources.USER),this.quill.setSelection(n+2,zh.sources.USER)}break}}this.textbox.value="",this.hide()}}function um(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((t=>{const r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)}))}const dm=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class hm extends cm{static TEMPLATE=['','
    ','','',"
    "].join("");constructor(e,t){super(e,t),this.quill.on(zh.events.EDITOR_CHANGE,((e,t,n,r)=>{if(e===zh.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===zh.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const e=this.quill.getLines(t.index,t.length);if(1===e.length){const e=this.quill.getBounds(t);null!=e&&this.position(e)}else{const n=e[e.length-1],r=this.quill.getIndex(n),a=Math.min(n.length()-1,t.index+t.length-r),i=this.quill.getBounds(new Kh(r,a));null!=i&&this.position(i)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(zh.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(null!=e){const t=this.quill.getBounds(e);null!=t&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==t&&(n.style.marginLeft=-1*t-n.offsetWidth/2+"px"),t}}class fm extends lm{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=dm),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new hm(this.quill,this.options.bounds),null!=e.container&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Yp),this.buildPickers(e.container.querySelectorAll("select"),Yp))}}fm.DEFAULTS=pd({},lm.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,vf.sources.USER)}}}}});const pm=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class mm extends cm{static TEMPLATE=['','','',''].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(null!=this.linkRange){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,zh.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(zh.events.SELECTION_CHANGE,((e,t,n)=>{if(null!=e){if(0===e.length&&n===zh.sources.USER){const[t,n]=this.quill.scroll.descendant(Tp,e.index);if(null!=t){this.linkRange=new Kh(e.index-n,t.length());const r=Tp.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();const a=this.quill.getBounds(this.linkRange);return void(null!=a&&this.position(a))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class vm extends lm{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=pm),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){null!=e.container&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Yp),this.buildPickers(e.container.querySelectorAll("select"),Yp),this.tooltip=new mm(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,n)=>{e.handlers.link.call(e,!n.format.link)})))}}vm.DEFAULTS=pd({},lm.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const e=this.quill.getSelection();if(null==e||0===e.length)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&0!==t.indexOf("mailto:")&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,vf.sources.USER)}}}}}),vf.register({"attributors/attribute/direction":$f,"attributors/class/align":jf,"attributors/class/background":Pf,"attributors/class/color":Tf,"attributors/class/direction":Hf,"attributors/class/font":Vf,"attributors/class/size":Wf,"attributors/style/align":Mf,"attributors/style/background":Rf,"attributors/style/color":_f,"attributors/style/direction":Uf,"attributors/style/font":zf,"attributors/style/size":Kf},!0),vf.register({"formats/align":jf,"formats/direction":Hf,"formats/indent":Sp,"formats/background":Rf,"formats/color":_f,"formats/font":Vf,"formats/size":Wf,"formats/blockquote":class extends Th{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":If,"formats/header":class extends Th{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},"formats/list":Mp,"formats/bold":Cp,"formats/code":Df,"formats/italic":class extends Cp{static blotName="italic";static tagName=["EM","I"]},"formats/link":Tp,"formats/script":class extends Ch{static blotName="script";static tagName=["SUB","SUP"];static create(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):super.create(e)}static formats(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}},"formats/strike":class extends Cp{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends Ch{static blotName="underline";static tagName="U"},"formats/formula":class extends sf{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return"string"==typeof e&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`${e}`}},"formats/image":class extends Bd{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Pp.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return _p(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Pp.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},"formats/video":class extends _h{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Rp.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static sanitize(e){return Tp.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Rp.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`${e}`}},"modules/syntax":$p,"modules/table":class extends af{static register(){vf.register(Hp),vf.register(Up),vf.register(Fp),vf.register(Vp)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Vp).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();null!=t&&(e.deleteColumn(t.cellOffset()),this.quill.update(vf.sources.USER))}deleteRow(){const[,e]=this.getTable();null!=e&&(e.remove(),this.quill.update(vf.sources.USER))}deleteTable(){const[e]=this.getTable();if(null==e)return;const t=e.offset();e.remove(),this.quill.update(vf.sources.USER),this.quill.setSelection(t,vf.sources.SILENT)}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==Hp.blotName)return[null,null,null,-1];const r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const i=a.cellOffset();n.insertColumn(i+e),this.quill.update(vf.sources.USER);let o=r.rowOffset();0===e&&(o+=1),this.quill.setSelection(t.index+o,t.length,vf.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const i=r.rowOffset();n.insertRow(i+e),this.quill.update(vf.sources.USER),e>0?this.quill.setSelection(t,vf.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,vf.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(null==n)return;const r=new Array(e).fill(0).reduce((e=>{const n=new Array(t).fill("\n").join("");return e.insert(n,{table:zp()})}),(new Ah).retain(n.index));this.quill.updateContents(r,vf.sources.USER),this.quill.setSelection(n.index,vf.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(vf.events.SCROLL_OPTIMIZE,(e=>{e.some((e=>!!["TD","TR","TBODY","TABLE"].includes(e.target.tagName)&&(this.quill.once(vf.events.TEXT_CHANGE,((e,t,n)=>{n===vf.sources.USER&&this.balanceTables()})),!0)))}))}},"modules/toolbar":Kp,"themes/bubble":fm,"themes/snow":vm,"ui/icons":Yp,"ui/picker":Qp,"ui/icon-picker":tm,"ui/color-picker":em,"ui/tooltip":nm},!0);var gm=function(e){var n=e.className,r=w(e,["className"]);return t.createElement(hi.Control,E({as:"input",type:"datetime-local",className:n},r))};function bm(e){return bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bm(e)}function ym(e){var t=function(e,t){if("object"!=bm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=bm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bm(t)?t:String(t)}function Em(e,t,n){return(t=ym(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wm(e,t){if(null==e)return{};var n,r,a=A(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}gm.Feedback=Da;var xm=NaN,Nm="[object Symbol]",km=/^\s+|\s+$/g,Om=/^[-+]0x[0-9a-f]+$/i,Lm=/^0b[01]+$/i,Am=/^0o[0-7]+$/i,Sm=parseInt,jm="object"==typeof x&&x&&x.Object===Object&&x,Mm="object"==typeof self&&self&&self.Object===Object&&self,Cm=jm||Mm||Function("return this")(),Tm=Object.prototype.toString,_m=Math.max,Pm=Math.min,Rm=function(){return Cm.Date.now()};function qm(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Im(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Tm.call(e)==Nm}(e))return xm;if(qm(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qm(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(km,"");var n=Lm.test(e);return n||Am.test(e)?Sm(e.slice(2),n?2:8):Om.test(e)?xm:+e}var Dm=function(e,t,n){var r,a,i,o,s,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=a;return r=a=void 0,c=t,o=e.apply(i,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function m(){var e=Rm();if(p(e))return v(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?Pm(n,i-(e-c)):n}(e))}function v(e){return s=void 0,h&&r?f(e):(r=a=void 0,o)}function g(){var e=Rm(),n=p(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?f(e):o}(l);if(d)return s=setTimeout(m,t),f(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=Im(t)||0,qm(n)&&(u=!!n.leading,i=(d="maxWait"in n)?_m(Im(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?o:v(Rm())},g},Bm=N(Dm),$m="label";function Hm(e){return"string"==typeof e?e:$m}function Um(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Fm=0;function Vm(e){return"function"==typeof e}function zm(e){return"string"==typeof e}function Wm(){}function Km(e,t){var n={};return t.forEach((function(t){n[t]=e[t]})),n}function Zm(e,t){return zm(e)||!Um(e,"paginationOption")&&!Um(e,"customOption")?(n=Vm(t)?t(e):zm(e)?e:e[t],zm(n)||("production"!==process.env.NODE_ENV?M(!1,"One or more options does not have a valid label string. Check the `labelKey` prop to ensure that it matches the correct option key and provides a string for filtering and display."):M(!1)),n):e[Hm(t)];var n}var Gm=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;0!=a--;){var o=i[a];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n},Ym=N(Gm);function Xm(e,t){if(!zm(e))return e[t]}var Jm=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹÐ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"ŒŒ"},{base:"oe",letters:"œœ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}].reduce((function(e,t){var n=t.base;return t.letters.split("").forEach((function(t){e[t]=n})),e}),{}),Qm="̀-ͯ",ev="゙゚";function tv(e){return e.normalize("NFD").replace(new RegExp("[".concat(Qm).concat(ev,"]"),"g"),"").replace(/[^\u0000-\u007E]/g,(function(e){return Jm[e]||e}))}var nv={};function rv(e,t){if(!e&&-1!==t.indexOf("deprecated")){if(nv[t])return;nv[t]=!0}for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a1?arguments[1]:void 0;return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","-item-").concat(e)}var dv=["activeIndex","id","isFocused","isMenuShown","multiple","onClick","onFocus","placeholder"];function hv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fv(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},d=Um(u,"className")?String(u.className):void 0;return fv(fv(fv(fv({autoComplete:"off",placeholder:l,type:"text"},u),c),{},{"aria-activedescendant":t>=0?uv(n,t):void 0,"aria-autocomplete":"both","aria-expanded":a,"aria-haspopup":"listbox","aria-multiselectable":i||void 0,"aria-owns":a?n:void 0,className:O((e={},Em(e,d||"",!i),Em(e,"focus",r),e))},i&&{inputClassName:d}),{},{onClick:o,onFocus:s,role:"combobox"})}};function mv(e){var t=e.activeItem,n=e.labelKey,r=e.multiple,a=e.selected,i=e.text;return t?Zm(t,n):!r&&a.length&&a[0]?Zm(a[0],n):i}function vv(e){var t=e.allowNew,n=e.highlightOnlyResult,r=e.results;return!(!n||t)&&(1===r.length&&!Xm(r[0],"disabled"))}function gv(e,t){var n=t[e];return!!n&&!!Xm(n,"disabled")}function bv(e,t,n){for(var r=e;gv(r,n);)r+="ArrowUp"===t?-1:1;return r}function yv(e){e.preventDefault()}function Ev(e){return"lg"===e}function wv(e){return"sm"===e}var xv=["className","isInvalid","isValid","size"];function Nv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kv(e){for(var t=1;t-1||s.length&&!o)return"";var c=Zm(n,i),u=cv(c.toLowerCase(),l.toLowerCase());return u&&0===u.start?l+c.slice(u.end,c.length):""}(e);s((function(){r||h.length||c()}));var m=n(!0);s((function(){m.current?m.current=!1:d(o)}),[o,d]);var v=Vv(Vv({},Km(e,Wv)),{},{getInputProps:pv(Vv(Vv({},Km(e,zv)),{},{onKeyDown:function(t){if(u(t),i){var n="Enter"===t.key&&vv(e),r=p&&function(e,t){var n=!1;return"ArrowRight"===e.key&&(n=!ov(e.currentTarget)||e.currentTarget.selectionStart===e.currentTarget.value.length),"Tab"===e.key&&(e.preventDefault(),n=!0),t?t(n,e):n}(t,f);(n||r)&&l(i)}},value:mv(e)}))}),g=Vv(Vv({},Km(e,Kv)),{},{hintText:p,isOnlyResult:vv(e)});return t.createElement(Hv.Provider,{value:g},Vm(a)?a(v):a)};function Gv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yv(e){for(var t=1;t1&&(o=o.slice(0,1))),{activeIndex:-1,activeItem:void 0,initialItem:void 0,isFocused:!1,selected:o,showMenu:n,shownResults:a,text:s}}function Jv(e,t){return Yv(Yv({},Xv(t)),{},{isFocused:e.isFocused,selected:[],text:""})}function Qv(e){return Yv(Yv({},e),{},{isFocused:!0,showMenu:!0})}function eg(e,t){var n=Xv(t),r=n.activeIndex,a=n.activeItem,i=n.initialItem,o=n.shownResults;return Yv(Yv({},e),{},{activeIndex:r,activeItem:a,initialItem:i,showMenu:!1,shownResults:o})}function tg(e,t){return e.showMenu?eg(e,t):Yv(Yv({},e),{},{showMenu:!0})}var ng=["onChange"];function rg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ag(e){for(var t=1;t=0?e.activeItem:void 0}}))})),Em(Iv(e),"_handleActiveItemChange",(function(t){Ym(t,e.state.activeItem)||e.setState({activeItem:t})})),Em(Iv(e),"_handleBlur",(function(t){t.persist(),e.setState({isFocused:!1},(function(){return e.props.onBlur(t)}))})),Em(Iv(e),"_handleChange",(function(t){e.props.onChange&&e.props.onChange(t)})),Em(Iv(e),"_handleClear",(function(){e.inputNode&&function(e,t){var n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value");n&&n.set&&n.set.call(e,t);var r=new Event("input",{bubbles:!0});e.dispatchEvent(r)}(e.inputNode,""),e.setState(Jv,(function(){e.props.multiple&&e._handleChange([])}))})),Em(Iv(e),"_handleClick",(function(t){var n;t.persist();var r=null===(n=e.props.inputProps)||void 0===n?void 0:n.onClick;e.setState(Qv,(function(){return Vm(r)&&r(t)}))})),Em(Iv(e),"_handleFocus",(function(t){t.persist(),e.setState(Qv,(function(){return e.props.onFocus(t)}))})),Em(Iv(e),"_handleInitialItemChange",(function(t){Ym(t,e.state.initialItem)||e.setState({initialItem:t})})),Em(Iv(e),"_handleInputChange",(function(t){t.persist();var n=t.currentTarget.value,r=e.props,a=r.multiple,i=r.onInputChange,o=e.state.selected.length&&!a;e.setState((function(e,t){var r=Xv(t),a=r.activeIndex,i=r.activeItem,s=r.shownResults;return{activeIndex:a,activeItem:i,selected:o?[]:e.selected,showMenu:!0,shownResults:s,text:n}}),(function(){i(n,t),o&&e._handleChange([])}))})),Em(Iv(e),"_handleKeyDown",(function(t){var n,r,a,i,o=e.state.activeItem;if(!e.isMenuShown)return"ArrowUp"!==t.key&&"ArrowDown"!==t.key||e.setState({showMenu:!0}),void e.props.onKeyDown(t);switch(t.key){case"ArrowUp":case"ArrowDown":t.preventDefault(),e._handleActiveIndexChange((n=e.state.activeIndex,r=t.key,a=e.items,i=n,(i=bv(i+="ArrowUp"===r?-1:1,r,a))===a.length?i=-1:-2===i&&(i=bv(i=a.length-1,r,a)),i));break;case"Enter":t.preventDefault(),o&&e._handleMenuItemSelect(o,t);break;case"Escape":case"Tab":e.hideMenu()}e.props.onKeyDown(t)})),Em(Iv(e),"_handleMenuItemSelect",(function(t,n){Xm(t,"paginationOption")?e._handlePaginate(n):e._handleSelectionAdd(t)})),Em(Iv(e),"_handlePaginate",(function(t){t.persist(),e.setState((function(e,t){return{shownResults:e.shownResults+t.maxResults}}),(function(){return e.props.onPaginate(t,e.state.shownResults)}))})),Em(Iv(e),"_handleSelectionAdd",(function(t){var n,r,a,i=e.props,o=i.multiple,s=i.labelKey,l=t;!zm(l)&&l.customOption&&(l=ag(ag({},l),{},{id:(a="new-id-",Fm+=1,(null==a?"":String(a))+Fm)})),o?(n=e.state.selected.concat(l),r=""):(n=[l],r=Zm(l,s)),e.setState((function(e,t){return ag(ag({},eg(e,t)),{},{initialItem:l,selected:n,text:r})}),(function(){return e._handleChange(n)}))})),Em(Iv(e),"_handleSelectionRemove",(function(t){var n=e.state.selected.filter((function(e){return!Ym(e,t)}));e.focus(),e.setState((function(e,t){return ag(ag({},eg(e,t)),{},{selected:n})}),(function(){return e._handleChange(n)}))})),e}return qv(r,[{key:"componentDidMount",value:function(){this.props.autoFocus&&this.focus()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.labelKey,a=n.multiple,i=n.selected;!function(e,t){var n,r,a,i=!e&&t;i?(n="uncontrolled",r="controlled",a="an"):(n="controlled",r="uncontrolled",a="a"),rv(!(i||e&&!t),"You are changing ".concat(a," ").concat(n," typeahead to be ").concat(r,". ")+"Input elements should not switch from ".concat(n," to ").concat(r," (or vice versa). ")+"Decide between using a controlled or uncontrolled element for the lifetime of the component.")}(i,e.selected),i&&!Ym(i,t.selected)&&(this.setState({selected:i}),a||this.setState({text:i.length?Zm(i[0],r):""}))}},{key:"render",value:function(){var e=this.props;e.onChange;var n=ag(ag({},wm(e,ng)),this.state),r=n.filterBy,a=n.labelKey,i=n.options,o=n.paginate,s=n.shownResults,l=n.text;this.isMenuShown=function(e){var t=e.open,n=e.minLength,r=e.showMenu,a=e.text;return t||!1===t?t:!(a.lengths;if(c=function(e,t){return!t||t>=e.length?e:e.slice(0,t)}(c,s),function(e,t){var n=t.allowNew,r=t.labelKey,a=t.text;return!(!n||!a.trim())&&(Vm(n)?n(e,t):!e.some((function(e){return Zm(e,r)===a})))}(c,n)&&c.push(Em({customOption:!0},Hm(a),l)),h)c.push((Em(d={},Hm(a),""),Em(d,"paginationOption",!0),d))}return t.createElement(Zv,L({},n,{hideMenu:this.hideMenu,inputNode:this.inputNode,inputRef:this.inputRef,isMenuShown:this.isMenuShown,onActiveItemChange:this._handleActiveItemChange,onAdd:this._handleSelectionAdd,onBlur:this._handleBlur,onChange:this._handleInputChange,onClear:this._handleClear,onClick:this._handleClick,onFocus:this._handleFocus,onHide:this.hideMenu,onInitialItemChange:this._handleInitialItemChange,onKeyDown:this._handleKeyDown,onMenuItemClick:this._handleMenuItemSelect,onRemove:this._handleSelectionRemove,results:c,setItem:this.setItem,toggleMenu:this.toggleMenu}))}}]),r}();Em(lg,"propTypes",og),Em(lg,"defaultProps",sg);var cg=["className","label","onClick","onKeyDown","size"],ug={label:be.string,onClick:be.func,onKeyDown:be.func,size:Av},dg=function(e){var n=e.className,r=e.label,a=void 0===r?"Clear":r,i=e.onClick,o=e.onKeyDown,s=e.size,l=wm(e,cg);return t.createElement("button",L({},l,{"aria-label":a,className:O("close","btn-close","rbt-close",{"rbt-close-lg":Ev(s),"rbt-close-sm":wv(s)},n),onClick:function(e){e.stopPropagation(),i&&i(e)},onKeyDown:function(e){"Backspace"===e.key&&e.preventDefault(),o&&o(e)},type:"button"}),t.createElement("span",{"aria-hidden":"true",className:"rbt-close-content"},"×"),t.createElement("span",{className:"sr-only visually-hidden"},a))};dg.propTypes=ug;var hg={label:be.string},fg=function(e){var n=e.label,r=void 0===n?"Loading...":n;return t.createElement("div",{className:"rbt-loader spinner-border spinner-border-sm",role:"status"},t.createElement("span",{className:"sr-only visually-hidden"},r))};function pg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"";return n&&(n=n.replace(n[0],n[0].toUpperCase())),["Top","Right","Bottom","Left"].map((function(r){return e["".concat(t).concat(r).concat(n)]})).join(" ")}var tb=function(){var e=Uv(),t=e.hintText,r=e.inputNode,a=n(null);return s((function(){r&&a.current&&function(e,t){var n=window.getComputedStyle(e);t.style.borderStyle=eb(n,"border","style"),t.style.borderWidth=eb(n,"border","width"),t.style.fontSize=n.fontSize,t.style.fontWeight=n.fontWeight,t.style.height=n.height,t.style.lineHeight=n.lineHeight,t.style.margin=eb(n,"margin"),t.style.padding=eb(n,"padding")}(r,a.current)})),{hintRef:a,hintText:t}},nb=function(e){var n=e.children,r=e.className,a=tb(),i=a.hintRef,o=a.hintText;return t.createElement("div",{className:r,style:{display:"flex",flex:1,height:"100%",position:"relative"}},n,t.createElement("input",{"aria-hidden":!0,className:"rbt-input-hint",ref:i,readOnly:!0,style:{backgroundColor:"transparent",borderColor:"transparent",boxShadow:"none",color:"rgba(0, 0, 0, 0.54)",left:0,pointerEvents:"none",position:"absolute",top:0,width:"100%"},tabIndex:-1,value:o}))},rb=h((function(e,n){return t.createElement("input",L({},e,{className:O("rbt-input-main",e.className),ref:n}))})),ab=["children","className","inputClassName","inputRef","referenceElementRef","selected"];function ib(e){var n=t.useRef(null),r=t.useRef(null),a=Ov(e),i=a.children,o=a.className,s=a.inputClassName;a.inputRef;var l=a.referenceElementRef,c=a.selected,u=wm(a,ab);function d(t){if(e.disabled)t.currentTarget.blur();else{var n=r.current;!n||t.currentTarget.contains(t.target)&&t.currentTarget!==t.target||(ov(n)&&(n.selectionStart=n.value.length),n.focus())}}return t.createElement("div",{className:O("rbt-input-multi",{disabled:e.disabled},o),onClick:d,onFocus:d,ref:l,tabIndex:-1},t.createElement("div",{className:"rbt-input-wrapper",ref:n},i,t.createElement(nb,null,t.createElement(rb,L({},u,{className:s,onKeyDown:function(t){if("Backspace"===t.key&&c.length&&!e.value){var r;t.preventDefault();var a=null===(r=n.current)||void 0===r?void 0:r.children;if(null!=a&&a.length){var i=a[a.length-2];null==i||i.focus()}}e.onKeyDown&&e.onKeyDown(t)},ref:function(t){r.current=t,e.inputRef(t)},style:{backgroundColor:"transparent",border:0,boxShadow:"none",cursor:"inherit",outline:"none",padding:0,width:"100%",zIndex:1}})))))}var ob=["inputRef","referenceElementRef"],sb=function(e){var n=e.inputRef,r=e.referenceElementRef,a=wm(e,ob);return t.createElement(nb,null,t.createElement(rb,L({},Ov(a),{ref:function(e){n(e),r(e)}})))},lb={children:be.string.isRequired,highlightClassName:be.string,search:be.string.isRequired},cb=function(e){var n=e.children,r=e.highlightClassName,a=void 0===r?"rbt-highlight-text":r,i=e.search;if(!i||!n)return t.createElement(t.Fragment,null,n);for(var o=0,s=n,l=[];s;){var c=cv(s,i);if(!c){l.push(s);break}var u=s.slice(0,c.start);u&&l.push(u);var d=s.slice(c.start,c.end);l.push(t.createElement("mark",{className:a,key:o},d)),o+=1,s=s.slice(c.end)}return t.createElement(t.Fragment,null,l)};cb.propTypes=lb;const ub=e=>"object"==typeof e&&null!=e&&1===e.nodeType,db=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,hb=(e,t)=>{if(e.clientHeight{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightit||i>e&&o=t&&s>=n?i-e-r:o>t&&sn?o-t+a:0,pb=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},mb=(e,t)=>{var n,r,a,i;if("undefined"==typeof document)return[];const{scrollMode:o,block:s,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,d="function"==typeof c?c:e=>e!==c;if(!ub(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let p=e;for(;ub(p)&&d(p);){if(p=pb(p),p===h){f.push(p);break}null!=p&&p===document.body&&hb(p)&&!hb(document.documentElement)||null!=p&&hb(p,u)&&f.push(p)}const m=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(a=window.visualViewport)?void 0:a.height)?i:innerHeight,{scrollX:g,scrollY:b}=window,{height:y,width:E,top:w,right:x,bottom:N,left:k}=e.getBoundingClientRect(),{top:O,right:L,bottom:A,left:S}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let j="start"===s||"nearest"===s?w-O:"end"===s?N+A:w+y/2-O+A,M="center"===l?k+E/2-S+L:"end"===l?x+L:k-S;const C=[];for(let e=0;e=0&&k>=0&&N<=v&&x<=m&&w>=a&&N<=c&&k>=u&&x<=i)return C;const d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),O=parseInt(d.borderTopWidth,10),L=parseInt(d.borderRightWidth,10),A=parseInt(d.borderBottomWidth,10);let S=0,T=0;const _="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-L:0,P="offsetHeight"in t?t.offsetHeight-t.clientHeight-O-A:0,R="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,q="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(h===t)S="start"===s?j:"end"===s?j-v:"nearest"===s?fb(b,b+v,v,O,A,b+j,b+j+y,y):j-v/2,T="start"===l?M:"center"===l?M-m/2:"end"===l?M-m:fb(g,g+m,m,p,L,g+M,g+M+E,E),S=Math.max(0,S+b),T=Math.max(0,T+g);else{S="start"===s?j-a-O:"end"===s?j-c+A+P:"nearest"===s?fb(a,c,n,O,A+P,j,j+y,y):j-(a+n/2)+P/2,T="start"===l?M-u-p:"center"===l?M-(u+r/2)+_/2:"end"===l?M-i+L+_:fb(u,i,r,p,L+_,M,M+E,E);const{scrollLeft:e,scrollTop:o}=t;S=0===q?0:Math.max(0,Math.min(o+S/q,t.scrollHeight-n/q+P)),T=0===R?0:Math.max(0,Math.min(e+T/R,t.scrollWidth-r/R+_)),j+=o-S,M+=e-T}C.push({el:t,top:S,left:T})}return C},vb=e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"};var gb=["label","onClick","option","position"];function bb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yb(e){for(var t=1;t{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(mb(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:a,top:i,left:o}of mb(e,vb(t))){const e=i-n.top+n.bottom,t=o-n.left+n.right;a.scroll({top:e,left:t,behavior:r})}}(e,{boundary:e.parentNode,scrollMode:"if-needed"})}}),[u,f,i,o]);var b=a((function(e){m(i,e),r&&r(e)}),[r,m,i]),y=h||u===o;return v(i,o),yb(yb({},l),{},{active:y,"aria-label":t,"aria-selected":y,id:uv(d,o),onClick:b,onMouseDown:yv,ref:g,role:"option"})}Mv.isRequired,be.number;var wb=["active","children","className","disabled","onClick"],xb=h((function(e,n){var r=e.active,a=e.children,i=e.className,o=e.disabled,s=e.onClick,l=wm(e,wb);return t.createElement("a",L({},l,{className:O("dropdown-item",{active:r,disabled:o},i),href:l.href||"#",onClick:function(e){e.preventDefault(),!o&&s&&s(e)},ref:n}),a)}));function Nb(e){return t.createElement(xb,Eb(e))}var kb=["emptyLabel","innerRef","maxHeight","style"];function Ob(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lb(e){for(var t=1;t1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),o)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var t=0;t0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(t,r,a,i,o){var s=t[r],l=y(s);if("object"!==l)return new p("Invalid "+i+" `"+o+"` of type `"+l+"` supplied to `"+a+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return g(a,i,o,c,E(u));var d=u(s,c,a,i,o+"."+c,n);if(d)return d}return null}))},exact:function(e){return m((function(a,i,o,s,l){var c=a[i],u=y(c);if("object"!==u)return new p("Invalid "+s+" `"+l+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var d=t({},a[i],e);for(var h in d){var f=e[h];if(r(e,h)&&"function"!=typeof f)return g(o,s,l,h,E(f));if(!f)return new p("Invalid "+s+" `"+l+"` key `"+h+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(a[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(c,h,o,s,l+"."+h,n);if(m)return m}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function a(a,o,s,c,u,h,f){if(c=c||d,h=h||s,f!==n){if(l){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=c+":"+s;!t[v]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,r++)}}return null==o[s]?a?null===o[s]?new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(o,s,c,u,h)}var o=a.bind(null,!1);return o.isRequired=a.bind(null,!0),o}function v(e){return m((function(t,n,r,a,i,o){var s=t[n];return y(s)!==e?new p("Invalid "+a+" `"+i+"` of type `"+E(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function g(e,t,n,r,a){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+a+"`.")}function b(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(b);if(null===e||s(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e[u]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!b(n.value))return!1}else for(;!(n=r.next()).done;){var a=n.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function y(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function E(e){if(null==e)return""+e;var t=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=E(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,h.checkPropTypes=a,h.resetWarningCache=a.resetWarningCache,h.PropTypes=h,h},le}()(ge.isElement,!0)}else G.exports=function(){if(de)return ue;de=1;var e=me();function t(){}function n(){}return n.resetWarningCache=t,ue=function(){function r(t,n,r,a,i,o){if(o!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function a(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();var be=N(G.exports),ye=!1,Ee="production"!==process.env.NODE_ENV?be.oneOfType([be.number,be.shape({enter:be.number,exit:be.number,appear:be.number}).isRequired]):null;"production"!==process.env.NODE_ENV&&be.oneOfType([be.string,be.shape({enter:be.string,exit:be.string,active:be.string}),be.shape({enter:be.string,enterDone:be.string,enterActive:be.string,exit:be.string,exitDone:be.string,exitActive:be.string})]);var we=t.createContext(null),xe="unmounted",Ne="exited",ke="entering",Oe="entered",Le="exiting",Ae=function(e){var n,r;function a(t,n){var r;r=e.call(this,t,n)||this;var a,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(a=Ne,r.appearStatus=ke):a=Oe:a=t.unmountOnExit||t.mountOnEnter?xe:Ne,r.state={status:a},r.nextCallback=null,r}r=e,(n=a).prototype=Object.create(r.prototype),n.prototype.constructor=n,R(n,r),a.getDerivedStateFromProps=function(e,t){return e.in&&t.status===xe?{status:Ne}:null};var i=a.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==ke&&n!==Oe&&(t=ke):n!==ke&&n!==Oe||(t=Le)}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===ke){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:y.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ne&&this.setState({status:xe})},i.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,a=this.props.nodeRef?[r]:[y.findDOMNode(this),r],i=a[0],o=a[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||ye?this.safeSetState({status:Oe},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,o),this.safeSetState({status:ke},(function(){t.props.onEntering(i,o),t.onTransitionEnd(l,(function(){t.safeSetState({status:Oe},(function(){t.props.onEntered(i,o)}))}))})))},i.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:y.findDOMNode(this);t&&!ye?(this.props.onExit(r),this.safeSetState({status:Le},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:Ne},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:Ne},(function(){e.props.onExited(r)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:y.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=a[0],o=a[1];this.props.addEndListener(i,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var e=this.state.status;if(e===xe)return null;var n=this.props,r=n.children;n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef;var a=A(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return t.createElement(we.Provider,{value:null},"function"==typeof r?r(e,a):t.cloneElement(t.Children.only(r),a))},a}(t.Component);function Se(){}Ae.contextType=we,Ae.propTypes="production"!==process.env.NODE_ENV?{nodeRef:be.shape({current:"undefined"==typeof Element?be.any:function(e,t,n,r,a,i){var o=e[t];return be.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,t,n,r,a,i)}}),children:be.oneOfType([be.func.isRequired,be.element.isRequired]).isRequired,in:be.bool,mountOnEnter:be.bool,unmountOnExit:be.bool,appear:be.bool,enter:be.bool,exit:be.bool,timeout:function(e){var t=Ee;e.addEndListener||(t=t.isRequired);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a{n.target===e&&(a(),t(n))}),n+r)}function Be(...e){return e.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}}),null)}function $e(e){e.offsetHeight}const He=e=>e&&"function"!=typeof e?t=>{e.current=t}:e;function Ue(e,t){return o((()=>function(e,t){const n=He(e),r=He(t);return e=>{n&&n(e),r&&r(e)}}(e,t)),[e,t])}function Fe(e){return e&&"setState"in e?y.findDOMNode(e):null!=e?e:null}const Ve=t.forwardRef((({onEnter:e,onEntering:r,onEntered:i,onExit:o,onExiting:s,onExited:l,addEndListener:c,children:u,childRef:d,...h},f)=>{const p=n(null),v=Ue(p,d),g=e=>{v(Fe(e))},b=e=>t=>{e&&p.current&&e(p.current,t)},y=a(b(e),[e]),E=a(b(r),[r]),w=a(b(i),[i]),x=a(b(o),[o]),N=a(b(s),[s]),k=a(b(l),[l]),O=a(b(c),[c]);return m(Ae,{ref:f,...h,onEnter:y,onEntered:w,onEntering:E,onExit:x,onExited:k,onExiting:N,addEndListener:O,nodeRef:p,children:"function"==typeof u?(e,t)=>u(e,{...t,ref:g}):t.cloneElement(u,{ref:g})})}));var ze=Ve;const We={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Ke(e,t){const n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=We[e];return n+parseInt(K(t,r[0]),10)+parseInt(K(t,r[1]),10)}const Ze={[Ne]:"collapse",[Le]:"collapsing",[ke]:"collapsing",[Oe]:"collapse show"};var Ge=t.forwardRef((({onEnter:e,onEntering:n,onEntered:r,onExit:a,onExiting:i,className:s,children:l,dimension:c="height",in:u=!1,timeout:d=300,mountOnEnter:h=!1,unmountOnExit:f=!1,appear:p=!1,getDimensionValue:v=Ke,...g},b)=>{const y="function"==typeof c?c():c,E=o((()=>Be((e=>{e.style[y]="0"}),e)),[y,e]),w=o((()=>Be((e=>{const t=`scroll${y[0].toUpperCase()}${y.slice(1)}`;e.style[y]=`${e[t]}px`}),n)),[y,n]),x=o((()=>Be((e=>{e.style[y]=null}),r)),[y,r]),N=o((()=>Be((e=>{e.style[y]=`${v(y,e)}px`,$e(e)}),a)),[a,v,y]),k=o((()=>Be((e=>{e.style[y]=null}),i)),[y,i]);return m(ze,{ref:b,addEndListener:De,...g,"aria-expanded":g.role?u:null,onEnter:E,onEntering:w,onEntered:x,onExit:N,onExiting:k,childRef:l.ref,in:u,timeout:d,mountOnEnter:h,unmountOnExit:f,appear:p,children:(e,n)=>t.cloneElement(l,{...n,className:O(s,l.props.className,Ze[e],"width"===y&&"collapse-horizontal")})})}));function Ye(e){const t=function(e){const t=n(e);return s((()=>{t.current=e}),[e]),t}(e);return a((function(...e){return t.current&&t.current(...e)}),[t])}var Xe=t=>e.forwardRef(((e,n)=>m("div",{...e,ref:n,className:O(e.className,t)})));function Je(){return r(null)}function Qe(){const e=n(!0),t=n((()=>e.current));return s((()=>(e.current=!0,()=>{e.current=!1})),[]),t.current}function et(e){const t=n(null);return s((()=>{t.current=e})),t.current}const tt="undefined"!=typeof global&&global.navigator&&"ReactNative"===global.navigator.product;var nt="undefined"!=typeof document||tt?l:s;const rt=["as","disabled"];function at({tagName:e,disabled:t,href:n,target:r,rel:a,role:i,onClick:o,tabIndex:s=0,type:l}){e||(e=null!=n||null!=r||null!=a?"a":"button");const c={tagName:e};if("button"===e)return[{type:l||"button",disabled:t},c];const u=r=>{(t||"a"===e&&function(e){return!e||"#"===e.trim()}(n))&&r.preventDefault(),t?r.stopPropagation():null==o||o(r)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=i?i:"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:"a"===e?r:void 0,"aria-disabled":t||void 0,rel:"a"===e?a:void 0,onClick:u,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),u(e))}},c]}const it=e.forwardRef(((e,t)=>{let{as:n,disabled:r}=e,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,rt);const[i,{tagName:o}]=at(Object.assign({tagName:n,disabled:r},a));return m(o,Object.assign({},a,i,{ref:t}))}));it.displayName="Button";const ot=["onKeyDown"];const st=e.forwardRef(((e,t)=>{let{onKeyDown:n}=e,r=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,ot);const[a]=at(Object.assign({tagName:"a"},r)),i=Ye((e=>{a.onKeyDown(e),null==n||n(e)}));return(o=r.href)&&"#"!==o.trim()&&"button"!==r.role?m("a",Object.assign({ref:t},r,{onKeyDown:n})):m("a",Object.assign({ref:t},r,a,{onKeyDown:i}));var o}));st.displayName="Anchor";var lt=st;const ct={[ke]:"show",[Oe]:"show"},ut=e.forwardRef((({className:t,children:n,transitionClasses:r={},onEnter:i,...o},s)=>{const l={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...o},c=a(((e,t)=>{$e(e),null==i||i(e,t)}),[i]);return m(ze,{ref:s,addEndListener:De,...l,onEnter:c,childRef:n.ref,children:(a,i)=>e.cloneElement(n,{...i,className:O("fade",t,n.props.className,ct[a],r[a])})})}));ut.displayName="Fade";var dt=ut;const ht={"aria-label":be.string,onClick:be.func,variant:be.oneOf(["white"])},ft=e.forwardRef((({className:e,variant:t,"aria-label":n="Close",...r},a)=>m("button",{ref:a,type:"button",className:O("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r})));ft.displayName="CloseButton",ft.propTypes=ht;var pt=ft;const mt=e.forwardRef((({as:e,bsPrefix:t,variant:n="primary",size:r,active:a=!1,disabled:i=!1,className:o,...s},l)=>{const c=I(t,"btn"),[u,{tagName:d}]=at({tagName:e,disabled:i,...s});return m(d,{...u,...s,ref:l,disabled:i,className:O(o,c,a&&"active",n&&`${c}-${n}`,r&&`${c}-${r}`,s.href&&i&&"disabled")})}));mt.displayName="Button";var vt=mt;const gt=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"card-body"),m(n,{ref:a,className:O(e,t),...r}))));gt.displayName="CardBody";var bt=gt;const yt=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"card-footer"),m(n,{ref:a,className:O(e,t),...r}))));yt.displayName="CardFooter";var Et=yt;const wt=e.createContext(null);wt.displayName="CardHeaderContext";var xt=wt;const Nt=e.forwardRef((({bsPrefix:e,className:t,as:n="div",...r},a)=>{const i=I(e,"card-header"),s=o((()=>({cardHeaderBsPrefix:i})),[i]);return m(xt.Provider,{value:s,children:m(n,{ref:a,...r,className:O(t,i)})})}));Nt.displayName="CardHeader";var kt=Nt;const Ot=e.forwardRef((({bsPrefix:e,className:t,variant:n,as:r="img",...a},i)=>{const o=I(e,"card-img");return m(r,{ref:i,className:O(n?`${o}-${n}`:o,t),...a})}));Ot.displayName="CardImg";var Lt=Ot;const At=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"card-img-overlay"),m(n,{ref:a,className:O(e,t),...r}))));At.displayName="CardImgOverlay";var St=At;const jt=e.forwardRef((({className:e,bsPrefix:t,as:n="a",...r},a)=>(t=I(t,"card-link"),m(n,{ref:a,className:O(e,t),...r}))));jt.displayName="CardLink";var Mt=jt;const Ct=Xe("h6"),Tt=e.forwardRef((({className:e,bsPrefix:t,as:n=Ct,...r},a)=>(t=I(t,"card-subtitle"),m(n,{ref:a,className:O(e,t),...r}))));Tt.displayName="CardSubtitle";var _t=Tt;const Pt=e.forwardRef((({className:e,bsPrefix:t,as:n="p",...r},a)=>(t=I(t,"card-text"),m(n,{ref:a,className:O(e,t),...r}))));Pt.displayName="CardText";var Rt=Pt;const qt=Xe("h5"),It=e.forwardRef((({className:e,bsPrefix:t,as:n=qt,...r},a)=>(t=I(t,"card-title"),m(n,{ref:a,className:O(e,t),...r}))));It.displayName="CardTitle";var Dt=It;const Bt=e.forwardRef((({bsPrefix:e,className:t,bg:n,text:r,border:a,body:i=!1,children:o,as:s="div",...l},c)=>{const u=I(e,"card");return m(s,{ref:c,...l,className:O(t,u,n&&`bg-${n}`,r&&`text-${r}`,a&&`border-${a}`),children:i?m(bt,{children:o}):o})}));Bt.displayName="Card";var $t=Object.assign(Bt,{Img:Lt,Title:Dt,Subtitle:_t,Body:bt,Link:Mt,Text:Rt,Header:kt,Footer:Et,ImgOverlay:St});function Ht(e){const t=function(e){const t=n(e);return t.current=e,t}(e);s((()=>()=>t.current()),[])}const Ut=2**31-1;function Ft(e,t,n){const r=n-Date.now();e.current=r<=Ut?setTimeout(t,r):setTimeout((()=>Ft(e,t,n)),Ut)}function Vt(){const e=Qe(),t=n();return Ht((()=>clearTimeout(t.current))),o((()=>{const n=()=>clearTimeout(t.current);return{set:function(r,a=0){e()&&(n(),a<=Ut?t.current=setTimeout(r,a):Ft(t,r,Date.now()+a))},clear:n,handleRef:t}}),[])}const zt=e.forwardRef(((e,t)=>{const[{className:n,...r},{as:a="div",bsPrefix:i,spans:o}]=function({as:e,bsPrefix:t,className:n,...r}){t=I(t,"col");const a=D(),i=B(),o=[],s=[];return a.forEach((e=>{const n=r[e];let a,l,c;delete r[e],"object"==typeof n&&null!=n?({span:a,offset:l,order:c}=n):a=n;const u=e!==i?`-${e}`:"";a&&o.push(!0===a?`${t}${u}`:`${t}${u}-${a}`),null!=c&&s.push(`order${u}-${c}`),null!=l&&s.push(`offset${u}-${l}`)})),[{...r,className:O(n,...o,...s)},{as:e,bsPrefix:t,spans:o}]}(e);return m(a,{...r,ref:t,className:O(n,!o.length&&i)})}));zt.displayName="Col";var Wt=zt;const Kt=e.forwardRef((({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...a},i)=>{const o=I(e,"container");return m(n,{ref:i,...a,className:O(r,t?`${o}${"string"==typeof t?`-${t}`:"-fluid"}`:o)})}));Kt.displayName="Container";var Zt=Kt,Gt=Function.prototype.bind.call(Function.prototype.call,[].slice);function Yt(e,t){return Gt(e.querySelectorAll(t))}function Xt(){const[,e]=c((e=>!e),!1);return e}var Jt=e.createContext(null),Qt=Object.prototype.hasOwnProperty;function en(e,t,n){for(n of e.keys())if(tn(n,t))return n}function tn(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&tn(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((a=r)&&"object"==typeof a&&!(a=en(t,a)))return!1;if(!t.has(a))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((a=r[0])&&"object"==typeof a&&!(a=en(t,a)))return!1;if(!tn(r[1],t.get(a)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(Qt.call(e,n)&&++r&&!Qt.call(t,n))return!1;if(!(n in t)||!tn(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}var nn="top",rn="bottom",an="right",on="left",sn="auto",ln=[nn,rn,an,on],cn="start",un="end",dn="clippingParents",hn="viewport",fn="popper",pn="reference",mn=ln.reduce((function(e,t){return e.concat([t+"-"+cn,t+"-"+un])}),[]),vn=[].concat(ln,[sn]).reduce((function(e,t){return e.concat([t,t+"-"+cn,t+"-"+un])}),[]),gn=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function bn(e){return e.split("-")[0]}function yn(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function En(e){return e instanceof yn(e).Element||e instanceof Element}function wn(e){return e instanceof yn(e).HTMLElement||e instanceof HTMLElement}function xn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof yn(e).ShadowRoot||e instanceof ShadowRoot)}var Nn=Math.max,kn=Math.min,On=Math.round;function Ln(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function An(){return!/^((?!chrome|android).)*safari/i.test(Ln())}function Sn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),a=1,i=1;t&&wn(e)&&(a=e.offsetWidth>0&&On(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&On(r.height)/e.offsetHeight||1);var o=(En(e)?yn(e):window).visualViewport,s=!An()&&n,l=(r.left+(s&&o?o.offsetLeft:0))/a,c=(r.top+(s&&o?o.offsetTop:0))/i,u=r.width/a,d=r.height/i;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function jn(e){var t=Sn(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Mn(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&xn(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Cn(e){return e?(e.nodeName||"").toLowerCase():null}function Tn(e){return yn(e).getComputedStyle(e)}function _n(e){return["table","td","th"].indexOf(Cn(e))>=0}function Pn(e){return((En(e)?e.ownerDocument:e.document)||window.document).documentElement}function Rn(e){return"html"===Cn(e)?e:e.assignedSlot||e.parentNode||(xn(e)?e.host:null)||Pn(e)}function qn(e){return wn(e)&&"fixed"!==Tn(e).position?e.offsetParent:null}function In(e){for(var t=yn(e),n=qn(e);n&&_n(n)&&"static"===Tn(n).position;)n=qn(n);return n&&("html"===Cn(n)||"body"===Cn(n)&&"static"===Tn(n).position)?t:n||function(e){var t=/firefox/i.test(Ln());if(/Trident/i.test(Ln())&&wn(e)&&"fixed"===Tn(e).position)return null;var n=Rn(e);for(xn(n)&&(n=n.host);wn(n)&&["html","body"].indexOf(Cn(n))<0;){var r=Tn(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Dn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bn(e,t,n){return Nn(e,kn(t,n))}function $n(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Hn(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Un={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,a=e.options,i=n.elements.arrow,o=n.modifiersData.popperOffsets,s=bn(n.placement),l=Dn(s),c=[on,an].indexOf(s)>=0?"height":"width";if(i&&o){var u=function(e,t){return $n("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Hn(e,ln))}(a.padding,n),d=jn(i),h="y"===l?nn:on,f="y"===l?rn:an,p=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],m=o[l]-n.rects.reference[l],v=In(i),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=p/2-m/2,y=u[h],E=g-d[c]-u[f],w=g/2-d[c]/2+b,x=Bn(y,w,E),N=l;n.modifiersData[r]=((t={})[N]=x,t.centerOffset=x-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Mn(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fn(e){return e.split("-")[1]}var Vn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function zn(e){var t,n=e.popper,r=e.popperRect,a=e.placement,i=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=void 0===h?0:h,p=o.y,m=void 0===p?0:p,v="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var g=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=on,E=nn,w=window;if(c){var x=In(n),N="clientHeight",k="clientWidth";if(x===yn(n)&&"static"!==Tn(x=Pn(n)).position&&"absolute"===s&&(N="scrollHeight",k="scrollWidth"),a===nn||(a===on||a===an)&&i===un)E=rn,m-=(d&&x===w&&w.visualViewport?w.visualViewport.height:x[N])-r.height,m*=l?1:-1;if(a===on||(a===nn||a===rn)&&i===un)y=an,f-=(d&&x===w&&w.visualViewport?w.visualViewport.width:x[k])-r.width,f*=l?1:-1}var O,L=Object.assign({position:s},c&&Vn),A=!0===u?function(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:On(n*a)/a||0,y:On(r*a)/a||0}}({x:f,y:m},yn(n)):{x:f,y:m};return f=A.x,m=A.y,l?Object.assign({},L,((O={})[E]=b?"0":"",O[y]=g?"0":"",O.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",O)):Object.assign({},L,((t={})[E]=b?m+"px":"",t[y]=g?f+"px":"",t.transform="",t))}var Wn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=void 0===r||r,i=n.adaptive,o=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:bn(t.placement),variation:Fn(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,zn(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,zn(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Kn={passive:!0};var Zn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,i=void 0===a||a,o=r.resize,s=void 0===o||o,l=yn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,Kn)})),s&&l.addEventListener("resize",n.update,Kn),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Kn)})),s&&l.removeEventListener("resize",n.update,Kn)}},data:{}},Gn={left:"right",right:"left",bottom:"top",top:"bottom"};function Yn(e){return e.replace(/left|right|bottom|top/g,(function(e){return Gn[e]}))}var Xn={start:"end",end:"start"};function Jn(e){return e.replace(/start|end/g,(function(e){return Xn[e]}))}function Qn(e){var t=yn(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function er(e){return Sn(Pn(e)).left+Qn(e).scrollLeft}function tr(e){var t=Tn(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function nr(e){return["html","body","#document"].indexOf(Cn(e))>=0?e.ownerDocument.body:wn(e)&&tr(e)?e:nr(Rn(e))}function rr(e,t){var n;void 0===t&&(t=[]);var r=nr(e),a=r===(null==(n=e.ownerDocument)?void 0:n.body),i=yn(r),o=a?[i].concat(i.visualViewport||[],tr(r)?r:[]):r,s=t.concat(o);return a?s:s.concat(rr(Rn(o)))}function ar(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ir(e,t,n){return t===hn?ar(function(e,t){var n=yn(e),r=Pn(e),a=n.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;var c=An();(c||!c&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:i,height:o,x:s+er(e),y:l}}(e,n)):En(t)?function(e,t){var n=Sn(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ar(function(e){var t,n=Pn(e),r=Qn(e),a=null==(t=e.ownerDocument)?void 0:t.body,i=Nn(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=Nn(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),s=-r.scrollLeft+er(e),l=-r.scrollTop;return"rtl"===Tn(a||n).direction&&(s+=Nn(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:s,y:l}}(Pn(e)))}function or(e,t,n,r){var a="clippingParents"===t?function(e){var t=rr(Rn(e)),n=["absolute","fixed"].indexOf(Tn(e).position)>=0&&wn(e)?In(e):e;return En(n)?t.filter((function(e){return En(e)&&Mn(e,n)&&"body"!==Cn(e)})):[]}(e):[].concat(t),i=[].concat(a,[n]),o=i[0],s=i.reduce((function(t,n){var a=ir(e,n,r);return t.top=Nn(a.top,t.top),t.right=kn(a.right,t.right),t.bottom=kn(a.bottom,t.bottom),t.left=Nn(a.left,t.left),t}),ir(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function sr(e){var t,n=e.reference,r=e.element,a=e.placement,i=a?bn(a):null,o=a?Fn(a):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case nn:t={x:s,y:n.y-r.height};break;case rn:t={x:s,y:n.y+n.height};break;case an:t={x:n.x+n.width,y:l};break;case on:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Dn(i):null;if(null!=c){var u="y"===c?"height":"width";switch(o){case cn:t[c]=t[c]-(n[u]/2-r[u]/2);break;case un:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function lr(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=void 0===r?e.placement:r,i=n.strategy,o=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?dn:s,c=n.rootBoundary,u=void 0===c?hn:c,d=n.elementContext,h=void 0===d?fn:d,f=n.altBoundary,p=void 0!==f&&f,m=n.padding,v=void 0===m?0:m,g=$n("number"!=typeof v?v:Hn(v,ln)),b=h===fn?pn:fn,y=e.rects.popper,E=e.elements[p?b:h],w=or(En(E)?E:E.contextElement||Pn(e.elements.popper),l,u,o),x=Sn(e.elements.reference),N=sr({reference:x,element:y,strategy:"absolute",placement:a}),k=ar(Object.assign({},y,N)),O=h===fn?k:x,L={top:w.top-O.top+g.top,bottom:O.bottom-w.bottom+g.bottom,left:w.left-O.left+g.left,right:O.right-w.right+g.right},A=e.modifiersData.offset;if(h===fn&&A){var S=A[a];Object.keys(L).forEach((function(e){var t=[an,rn].indexOf(e)>=0?1:-1,n=[nn,rn].indexOf(e)>=0?"y":"x";L[e]+=S[n]*t}))}return L}function cr(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=n.boundary,i=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?vn:l,u=Fn(r),d=u?s?mn:mn.filter((function(e){return Fn(e)===u})):ln,h=d.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=d);var f=h.reduce((function(t,n){return t[n]=lr(e,{placement:n,boundary:a,rootBoundary:i,padding:o})[bn(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}var ur={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,i=void 0===a||a,o=n.altAxis,s=void 0===o||o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=bn(v),b=l||(g===v||!p?[Yn(v)]:function(e){if(bn(e)===sn)return[];var t=Yn(e);return[Jn(e),t,Jn(t)]}(v)),y=[v].concat(b).reduce((function(e,n){return e.concat(bn(n)===sn?cr(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),E=t.rects.reference,w=t.rects.popper,x=new Map,N=!0,k=y[0],O=0;O=0,M=j?"width":"height",C=lr(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),T=j?S?an:on:S?rn:nn;E[M]>w[M]&&(T=Yn(T));var _=Yn(T),P=[];if(i&&P.push(C[A]<=0),s&&P.push(C[T]<=0,C[_]<=0),P.every((function(e){return e}))){k=L,N=!1;break}x.set(L,P)}if(N)for(var R=function(e){var t=y.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},q=p?3:1;q>0;q--){if("break"===R(q))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dr(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hr(e){return[nn,an,rn,on].some((function(t){return e[t]>=0}))}var fr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,i=t.modifiersData.preventOverflow,o=lr(t,{elementContext:"reference"}),s=lr(t,{altBoundary:!0}),l=dr(o,r),c=dr(s,a,i),u=hr(l),d=hr(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var pr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.offset,i=void 0===a?[0,0]:a,o=vn.reduce((function(e,n){return e[n]=function(e,t,n){var r=bn(e),a=[on,nn].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=i[0],s=i[1];return o=o||0,s=(s||0)*a,[on,an].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}(n,t.rects,i),e}),{}),s=o[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=o}};var mr={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=sr({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var vr={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,i=void 0===a||a,o=n.altAxis,s=void 0!==o&&o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=void 0===h||h,p=n.tetherOffset,m=void 0===p?0:p,v=lr(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=bn(t.placement),b=Fn(t.placement),y=!b,E=Dn(g),w="x"===E?"y":"x",x=t.modifiersData.popperOffsets,N=t.rects.reference,k=t.rects.popper,O="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(x){if(i){var j,M="y"===E?nn:on,C="y"===E?rn:an,T="y"===E?"height":"width",_=x[E],P=_+v[M],R=_-v[C],q=f?-k[T]/2:0,I=b===cn?N[T]:k[T],D=b===cn?-k[T]:-N[T],B=t.elements.arrow,$=f&&B?jn(B):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=H[M],F=H[C],V=Bn(0,N[T],$[T]),z=y?N[T]/2-q-V-U-L.mainAxis:I-V-U-L.mainAxis,W=y?-N[T]/2+q+V+F+L.mainAxis:D+V+F+L.mainAxis,K=t.elements.arrow&&In(t.elements.arrow),Z=K?"y"===E?K.clientTop||0:K.clientLeft||0:0,G=null!=(j=null==A?void 0:A[E])?j:0,Y=_+W-G,X=Bn(f?kn(P,_+z-G-Z):P,_,f?Nn(R,Y):R);x[E]=X,S[E]=X-_}if(s){var J,Q="x"===E?nn:on,ee="x"===E?rn:an,te=x[w],ne="y"===w?"height":"width",re=te+v[Q],ae=te-v[ee],ie=-1!==[nn,on].indexOf(g),oe=null!=(J=null==A?void 0:A[w])?J:0,se=ie?re:te-N[ne]-k[ne]-oe+L.altAxis,le=ie?te+N[ne]+k[ne]-oe-L.altAxis:ae,ce=f&&ie?function(e,t,n){var r=Bn(e,t,n);return r>n?n:r}(se,te,le):Bn(f?se:re,te,f?le:ae);x[w]=ce,S[w]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function gr(e,t,n){void 0===n&&(n=!1);var r,a,i=wn(t),o=wn(t)&&function(e){var t=e.getBoundingClientRect(),n=On(t.width)/e.offsetWidth||1,r=On(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Pn(t),l=Sn(e,o,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==Cn(t)||tr(s))&&(c=(r=t)!==yn(r)&&wn(r)?{scrollLeft:(a=r).scrollLeft,scrollTop:a.scrollTop}:Qn(r)),wn(t)?((u=Sn(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=er(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function br(e){var t=new Map,n=new Set,r=[];function a(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&a(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||a(e)})),r}var yr={placement:"bottom",modifiers:[],strategy:"absolute"};function Er(){for(var e=arguments.length,t=new Array(e),n=0;n{}},Or={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const e=(t.getAttribute("aria-describedby")||"").split(",").filter((e=>e.trim()!==n.id));e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,a=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===a&&"setAttribute"in r){const e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},Lr=[];function Ar(e,t,i={}){let{enabled:l=!0,placement:c="bottom",strategy:u="absolute",modifiers:d=Lr}=i,h=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(i,Nr);const f=n(d),p=n(),m=a((()=>{var e;null==(e=p.current)||e.update()}),[]),v=a((()=>{var e;null==(e=p.current)||e.forceUpdate()}),[]),[g,b]=function(e){const t=Qe();return[e[0],a((n=>{if(t())return e[1](n)}),[t,e[1]])]}(r({placement:c,update:m,forceUpdate:v,attributes:{},styles:{popper:{},arrow:{}}})),y=o((()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{const t={},n={};Object.keys(e.elements).forEach((r=>{t[r]=e.styles[r],n[r]=e.attributes[r]})),b({state:e,styles:t,attributes:n,update:m,forceUpdate:v,placement:e.placement})}})),[m,v,b]),E=o((()=>(tn(f.current,d)||(f.current=d),f.current)),[d]);return s((()=>{p.current&&l&&p.current.setOptions({placement:c,strategy:u,modifiers:[...E,y,kr]})}),[u,c,y,l,E]),s((()=>{if(l&&null!=e&&null!=t)return p.current=xr(e,t,Object.assign({},h,{placement:c,strategy:u,modifiers:[...E,Or,y]})),()=>{null!=p.current&&(p.current.destroy(),p.current=void 0,b((e=>Object.assign({},e,{attributes:{},styles:{popper:{}}}))))}}),[l,e,t]),g}function Sr(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var jr=function(){};if("production"!==process.env.NODE_ENV){var Mr=function(e,t){var n=arguments.length;t=new Array(n>1?n-1:0);for(var r=1;r2?r-2:0);for(var a=2;a{};const _r=e=>e&&("current"in e?e.current:e),Pr={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function Rr(e,t=Tr,{disabled:r,clickTrigger:i="click"}={}){const o=n(!1),l=n(!1),c=a((t=>{const n=_r(e);var r;Cr(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!n||!!((r=t).metaKey||r.altKey||r.ctrlKey||r.shiftKey)||!function(e){return 0===e.button}(t)||!!Sr(n,t.target)||l.current,l.current=!1}),[e]),u=Ye((t=>{const n=_r(e);n&&Sr(n,t.target)&&(l.current=!0)})),d=Ye((e=>{o.current||t(e)}));s((()=>{var t,n;if(r||null==e)return;const a=H(_r(e)),o=a.defaultView||window;let s=null!=(t=o.event)?t:null==(n=o.parent)?void 0:n.event,l=null;Pr[i]&&(l=Pe(a,Pr[i],u,!0));const h=Pe(a,i,c,!0),f=Pe(a,i,(e=>{e!==s?d(e):s=void 0}));let p=[];return"ontouchstart"in a.documentElement&&(p=[].slice.call(a.body.children).map((e=>Pe(e,"mousemove",Tr)))),()=>{null==l||l(),h(),f(),p.forEach((e=>e()))}}),[e,r,i,c,u,d])}function qr(e={}){return Array.isArray(e)?e:Object.keys(e).map((t=>(e[t].name=t,e[t])))}function Ir({enabled:e,enableEvents:t,placement:n,flip:r,offset:a,fixed:i,containerPadding:o,arrowElement:s,popperConfig:l={}}){var c,u,d,h,f;const p=function(e){const t={};return Array.isArray(e)?(null==e||e.forEach((e=>{t[e.name]=e})),t):e||t}(l.modifiers);return Object.assign({},l,{placement:n,enabled:e,strategy:i?"fixed":l.strategy,modifiers:qr(Object.assign({},p,{eventListeners:{enabled:t,options:null==(c=p.eventListeners)?void 0:c.options},preventOverflow:Object.assign({},p.preventOverflow,{options:o?Object.assign({padding:o},null==(u=p.preventOverflow)?void 0:u.options):null==(d=p.preventOverflow)?void 0:d.options}),offset:{options:Object.assign({offset:a},null==(h=p.offset)?void 0:h.options)},arrow:Object.assign({},p.arrow,{enabled:!!s,options:Object.assign({},null==(f=p.arrow)?void 0:f.options,{element:s})}),flip:Object.assign({enabled:!!r},p.flip)}))})}const Dr=["children"];const Br=()=>{};function $r(e={}){const t=i(Jt),[r,a]=Je(),o=n(!1),{flip:s,offset:l,rootCloseEvent:c,fixed:u=!1,placement:d,popperConfig:h={},enableEventListeners:f=!0,usePopper:p=!!t}=e,m=null==(null==t?void 0:t.show)?!!e.show:t.show;m&&!o.current&&(o.current=!0);const{placement:v,setMenu:g,menuElement:b,toggleElement:y}=t||{},E=Ar(y,b,Ir({placement:d||v||"bottom-start",enabled:p,enableEvents:null==f?m:f,offset:l,flip:s,fixed:u,arrowElement:r,popperConfig:h})),w=Object.assign({ref:g||Br,"aria-labelledby":null==y?void 0:y.id},E.attributes.popper,{style:E.styles.popper}),x={show:m,placement:v,hasShown:o.current,toggle:null==t?void 0:t.toggle,popper:p?E:null,arrowProps:p?Object.assign({ref:a},E.attributes.arrow,{style:E.styles.arrow}):{}};return Rr(b,(e=>{null==t||t.toggle(!1,e)}),{clickTrigger:c,disabled:!m}),[w,x]}function Hr(e){let{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,Dr);const[r,a]=$r(n);return m(v,{children:t(r,a)})}Hr.displayName="DropdownMenu",Hr.defaultProps={usePopper:!0};const Ur={prefix:String(Math.round(1e10*Math.random())),current:0},Fr=t.createContext(Ur),Vr=t.createContext(!1);let zr=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Wr=new WeakMap;const Kr="function"==typeof t.useId?function(e){let n=t.useId(),[a]=r("function"==typeof t.useSyncExternalStore?t.useSyncExternalStore(Yr,Zr,Gr):i(Vr)),o=a||"test"===process.env.NODE_ENV?"react-aria":`react-aria${Ur.prefix}`;return e||`${o}-${n}`}:function(e){let r=i(Fr);r!==Ur||zr||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let a=function(e=!1){let r=i(Fr),a=n(null);if(null===a.current&&!e){var o,s;let e=null===(s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===s||null===(o=s.ReactCurrentOwner)||void 0===o?void 0:o.current;if(e){let t=Wr.get(e);null==t?Wr.set(e,{id:r.current,state:e.memoizedState}):e.memoizedState!==t.state&&(r.current=t.id,Wr.delete(e))}a.current=++r.current}return a.current}(!!e),o=r===Ur&&"test"===process.env.NODE_ENV?"react-aria":`react-aria${r.prefix}`;return e||`${o}-${a}`};function Zr(){return!1}function Gr(){return!0}function Yr(e){return()=>{}}const Xr=e=>{var t;return"menu"===(null==(t=e.getAttribute("role"))?void 0:t.toLowerCase())},Jr=()=>{};function Qr(){const e=Kr(),{show:t=!1,toggle:n=Jr,setToggle:r,menuElement:o}=i(Jt)||{},s=a((e=>{n(!t,e)}),[t,n]),l={id:e,ref:r||Jr,onClick:s,"aria-expanded":!!t};return o&&Xr(o)&&(l["aria-haspopup"]=!0),[l,{show:t,toggle:n}]}function ea({children:e}){const[t,n]=Qr();return m(v,{children:e(t,n)})}ea.displayName="DropdownToggle";const ta=e.createContext(null),na=(e,t=null)=>null!=e?String(e):t||null,ra=e.createContext(null);ra.displayName="NavContext";var aa=ra;const ia="data-rr-ui-";function oa(e){return`${ia}${e}`}const sa=["eventKey","disabled","onClick","active","as"];function la({key:e,href:t,active:n,disabled:r,onClick:a}){const o=i(ta),s=i(aa),{activeKey:l}=s||{},c=na(e,t),u=null==n&&null!=e?na(l)===c:n;return[{onClick:Ye((e=>{r||(null==a||a(e),o&&!e.isPropagationStopped()&&o(c,e))})),"aria-disabled":r||void 0,"aria-selected":u,[oa("dropdown-item")]:""},{isActive:u}]}const ca=e.forwardRef(((e,t)=>{let{eventKey:n,disabled:r,onClick:a,active:i,as:o=it}=e,s=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,sa);const[l]=la({key:n,href:s.href,disabled:r,onClick:a,active:i});return m(o,Object.assign({},s,{ref:t},l))}));ca.displayName="DropdownItem";const ua=u(je?window:void 0);function da(){return i(ua)}function ha(){const e=Xt(),t=n(null),r=a((n=>{t.current=n,e()}),[e]);return[t,r]}function fa({defaultShow:e,show:t,onSelect:l,onToggle:c,itemSelector:u=`* [${oa("dropdown-item")}]`,focusFirstItemOnShow:d,placement:h="bottom-start",children:f}){const p=da(),[v,g]=function(e,t,i){const o=n(void 0!==e),[s,l]=r(t),c=void 0!==e,u=o.current;return o.current=c,!c&&u&&s!==t&&l(t),[c?e:s,a(((...e)=>{const[t,...n]=e;let r=null==i?void 0:i(t,...n);return l(t),r}),[i])]}(t,e,c),[b,y]=ha(),E=b.current,[w,x]=ha(),N=w.current,k=et(v),O=n(null),L=n(!1),A=i(ta),S=a(((e,t,n=(null==t?void 0:t.type))=>{g(e,{originalEvent:t,source:n})}),[g]),j=Ye(((e,t)=>{null==l||l(e,t),S(!1,t,"select"),t.isPropagationStopped()||null==A||A(e,t)})),M=o((()=>({toggle:S,placement:h,show:v,menuElement:E,toggleElement:N,setMenu:y,setToggle:x})),[S,h,v,E,N,y,x]);E&&k&&!v&&(L.current=E.contains(E.ownerDocument.activeElement));const C=Ye((()=>{N&&N.focus&&N.focus()})),T=Ye((()=>{const e=O.current;let t=d;if(null==t&&(t=!(!b.current||!Xr(b.current))&&"keyboard"),!1===t||"keyboard"===t&&!/^key.+$/.test(e))return;const n=Yt(b.current,u)[0];n&&n.focus&&n.focus()}));s((()=>{v?T():L.current&&(L.current=!1,C())}),[v,L,C,T]),s((()=>{O.current=null}));const _=(e,t)=>{if(!b.current)return null;const n=Yt(b.current,u);let r=n.indexOf(e)+t;return r=Math.max(0,Math.min(r,n.length)),n[r]};return function(e,t,n,r=!1){const a=Ye(n);s((()=>{const n="function"==typeof e?e():e;return n.addEventListener(t,a,r),()=>n.removeEventListener(t,a,r)}),[e])}(a((()=>p.document),[p]),"keydown",(e=>{var t,n;const{key:r}=e,a=e.target,i=null==(t=b.current)?void 0:t.contains(a),o=null==(n=w.current)?void 0:n.contains(a);if(/input|textarea/i.test(a.tagName)&&(" "===r||"Escape"!==r&&i||"Escape"===r&&"search"===a.type))return;if(!i&&!o)return;if(!("Tab"!==r||b.current&&v))return;O.current=e.type;const s={originalEvent:e,source:e.type};switch(r){case"ArrowUp":{const t=_(a,-1);return t&&t.focus&&t.focus(),void e.preventDefault()}case"ArrowDown":if(e.preventDefault(),v){const e=_(a,1);e&&e.focus&&e.focus()}else g(!0,s);return;case"Tab":_e(a.ownerDocument,"keyup",(e=>{var t;("Tab"!==e.key||e.target)&&null!=(t=b.current)&&t.contains(e.target)||g(!1,s)}),{once:!0});break;case"Escape":"Escape"===r&&(e.preventDefault(),e.stopPropagation()),g(!1,s)}})),m(ta.Provider,{value:j,children:m(Jt.Provider,{value:M,children:f})})}ua.Provider,fa.displayName="Dropdown",fa.Menu=Hr,fa.Toggle=ea,fa.Item=ca;const pa=e.createContext({});pa.displayName="DropdownContext";var ma=pa;const va=e.forwardRef((({className:e,bsPrefix:t,as:n="hr",role:r="separator",...a},i)=>(t=I(t,"dropdown-divider"),m(n,{ref:i,className:O(e,t),role:r,...a}))));va.displayName="DropdownDivider";var ga=va;const ba=e.forwardRef((({className:e,bsPrefix:t,as:n="div",role:r="heading",...a},i)=>(t=I(t,"dropdown-header"),m(n,{ref:i,className:O(e,t),role:r,...a}))));ba.displayName="DropdownHeader";var ya=ba;const Ea=e.forwardRef((({bsPrefix:e,className:t,eventKey:n,disabled:r=!1,onClick:a,active:i,as:o=lt,...s},l)=>{const c=I(e,"dropdown-item"),[u,d]=la({key:n,href:s.href,disabled:r,onClick:a,active:i});return m(o,{...s,...u,ref:l,className:O(t,c,d.isActive&&"active",r&&"disabled")})}));Ea.displayName="DropdownItem";var wa=Ea;const xa=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},a)=>(t=I(t,"dropdown-item-text"),m(n,{ref:a,className:O(e,t),...r}))));xa.displayName="DropdownItemText";var Na=xa;const ka=e.createContext(null);ka.displayName="InputGroupContext";var Oa=ka;const La=e.createContext(null);La.displayName="NavbarContext";var Aa=La;function Sa(e,t){if("production"===process.env.NODE_ENV)return e;return Ue(a((e=>{null!=e&&e.isReactComponent&&("production"!==process.env.NODE_ENV?M(!1,`${t} injected a ref to a provided \`as\` component that resolved to a component instance instead of a DOM element. Use \`React.forwardRef\` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element`):M(!1))}),[t]),e)}function ja(e,t,n){let r=e?n?"bottom-start":"bottom-end":n?"bottom-end":"bottom-start";return"up"===t?r=e?n?"top-start":"top-end":n?"top-end":"top-start":"end"===t?r=e?n?"left-end":"right-end":n?"left-start":"right-start":"start"===t?r=e?n?"right-end":"left-end":n?"right-start":"left-start":"down-centered"===t?r="bottom":"up-centered"===t&&(r="top"),r}const Ma=e.forwardRef((({bsPrefix:e,className:t,align:n,rootCloseEvent:r,flip:a=!0,show:o,renderOnMount:s,as:l="div",popperConfig:c,variant:u,...d},h)=>{let f=!1;const p=i(Aa),v=I(e,"dropdown-menu"),{align:g,drop:b,isRTL:y}=i(ma);n=n||g;const E=i(Oa),w=[];if(n)if("object"==typeof n){const e=Object.keys(n);if("production"!==process.env.NODE_ENV&&Cr(1===e.length,"There should only be 1 breakpoint when passing an object to `align`"),e.length){const t=e[0],r=n[t];f="start"===r,w.push(`${v}-${t}-${r}`)}}else"end"===n&&(f=!0);const x=ja(f,b,y),[N,{hasShown:k,popper:L,show:A,toggle:S}]=$r({flip:a,rootCloseEvent:r,show:o,usePopper:!p&&0===w.length,offset:[0,2],popperConfig:c,placement:x});if(N.ref=Ue(Sa(h,"DropdownMenu"),N.ref),nt((()=>{A&&(null==L||L.update())}),[A]),!k&&!s&&!E)return null;"string"!=typeof l&&(N.show=A,N.close=()=>null==S?void 0:S(!1),N.align=n);let j=d.style;return null!=L&&L.placement&&(j={...d.style,...N.style},d["x-placement"]=L.placement),m(l,{...d,...N,style:j,...(w.length||p)&&{"data-bs-popper":"static"},className:O(t,v,A&&"show",f&&`${v}-end`,u&&`${v}-${u}`,...w)})}));Ma.displayName="DropdownMenu";var Ca=Ma;const Ta=e.forwardRef((({bsPrefix:e,split:t,className:n,childBsPrefix:r,as:a=vt,...o},s)=>{const l=I(e,"dropdown-toggle"),c=i(Jt);void 0!==r&&(o.bsPrefix=r);const[u]=Qr();return u.ref=Ue(u.ref,Sa(s,"DropdownToggle")),m(a,{className:O(n,l,t&&`${l}-split`,(null==c?void 0:c.show)&&"show"),...u,...o})}));Ta.displayName="DropdownToggle";var _a=Ta;const Pa=e.forwardRef(((e,t)=>{const{bsPrefix:n,drop:r="down",show:a,className:s,align:l="start",onSelect:c,onToggle:u,focusFirstItemOnShow:d,as:h="div",navbar:f,autoClose:p=!0,...v}=P(e,{show:"onToggle"}),g=i(Oa),b=I(n,"dropdown"),y=$(),E=Ye(((e,t)=>{var n,r;var a;(null==(n=t.originalEvent)||null==(r=n.target)?void 0:r.classList.contains("dropdown-toggle"))&&"mousedown"===t.source||(t.originalEvent.currentTarget!==document||"keydown"===t.source&&"Escape"!==t.originalEvent.key||(t.source="rootClose"),a=t.source,(!1===p?"click"===a:"inside"===p?"rootClose"!==a:"outside"!==p||"select"!==a)&&(null==u||u(e,t)))})),w=ja("end"===l,r,y),x=o((()=>({align:l,drop:r,isRTL:y})),[l,r,y]),N={down:b,"down-centered":`${b}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return m(ma.Provider,{value:x,children:m(fa,{placement:w,show:a,onSelect:c,onToggle:E,focusFirstItemOnShow:d,itemSelector:`.${b}-item:not(.disabled):not(:disabled)`,children:g?v.children:m(h,{...v,ref:t,className:O(s,a&&"show",N[r])})})})}));Pa.displayName="Dropdown";var Ra=Object.assign(Pa,{Toggle:_a,Menu:Ca,Item:wa,ItemText:Na,Divider:ga,Header:ya});const qa={type:be.string,tooltip:be.bool,as:be.elementType},Ia=e.forwardRef((({as:e="div",className:t,type:n="valid",tooltip:r=!1,...a},i)=>m(e,{...a,ref:i,className:O(t,`${n}-${r?"tooltip":"feedback"}`)})));Ia.displayName="Feedback",Ia.propTypes=qa;var Da=Ia;var Ba=e.createContext({});const $a=e.forwardRef((({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:a=!1,isInvalid:o=!1,as:s="input",...l},c)=>{const{controlId:u}=i(Ba);return t=I(t,"form-check-input"),m(s,{...l,ref:c,type:r,id:e||u,className:O(n,t,a&&"is-valid",o&&"is-invalid")})}));$a.displayName="FormCheckInput";var Ha=$a;const Ua=e.forwardRef((({bsPrefix:e,className:t,htmlFor:n,...r},a)=>{const{controlId:o}=i(Ba);return e=I(e,"form-check-label"),m("label",{...r,ref:a,htmlFor:n||o,className:O(t,e)})}));Ua.displayName="FormCheckLabel";var Fa=Ua;const Va=e.forwardRef((({id:t,bsPrefix:n,bsSwitchPrefix:r,inline:a=!1,reverse:s=!1,disabled:l=!1,isValid:c=!1,isInvalid:u=!1,feedbackTooltip:d=!1,feedback:h,feedbackType:f,className:p,style:b,title:y="",type:E="checkbox",label:w,children:x,as:N="input",...k},L)=>{n=I(n,"form-check"),r=I(r,"form-switch");const{controlId:A}=i(Ba),S=o((()=>({controlId:t||A})),[A,t]),j=!x&&null!=w&&!1!==w||function(t,n){return e.Children.toArray(t).some((t=>e.isValidElement(t)&&t.type===n))}(x,Fa),M=m(Ha,{...k,type:"switch"===E?"checkbox":E,ref:L,isValid:c,isInvalid:u,disabled:l,as:N});return m(Ba.Provider,{value:S,children:m("div",{style:b,className:O(p,j&&n,a&&`${n}-inline`,s&&`${n}-reverse`,"switch"===E&&r),children:x||g(v,{children:[M,j&&m(Fa,{title:y,children:w}),h&&m(Da,{type:f,tooltip:d,children:h})]})})})}));Va.displayName="FormCheck";var za=Object.assign(Va,{Input:Ha,Label:Fa});const Wa=e.forwardRef((({bsPrefix:e,type:t,size:n,htmlSize:r,id:a,className:o,isValid:s=!1,isInvalid:l=!1,plaintext:c,readOnly:u,as:d="input",...h},f)=>{const{controlId:p}=i(Ba);return e=I(e,"form-control"),"production"!==process.env.NODE_ENV&&Cr(null==p||!a,"`controlId` is ignored on `` when `id` is specified."),m(d,{...h,type:t,size:r,ref:f,readOnly:u,id:a||p,className:O(o,c?`${e}-plaintext`:e,n&&`${e}-${n}`,"color"===t&&`${e}-color`,s&&"is-valid",l&&"is-invalid")})}));Wa.displayName="FormControl";var Ka=Object.assign(Wa,{Feedback:Da});const Za=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"form-floating"),m(n,{ref:a,className:O(e,t),...r}))));Za.displayName="FormFloating";var Ga=Za;const Ya=e.forwardRef((({controlId:e,as:t="div",...n},r)=>{const a=o((()=>({controlId:e})),[e]);return m(Ba.Provider,{value:a,children:m(t,{...n,ref:r})})}));Ya.displayName="FormGroup";var Xa=Ya;const Ja=e.forwardRef((({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:a,htmlFor:o,...s},l)=>{const{controlId:c}=i(Ba);t=I(t,"form-label");let u="col-form-label";"string"==typeof n&&(u=`${u} ${u}-${n}`);const d=O(a,t,r&&"visually-hidden",n&&u);return"production"!==process.env.NODE_ENV&&Cr(null==c||!o,"`controlId` is ignored on `` when `htmlFor` is specified."),o=o||c,n?m(Wt,{ref:l,as:"label",className:d,htmlFor:o,...s}):m(e,{ref:l,className:d,htmlFor:o,...s})}));Ja.displayName="FormLabel";var Qa=Ja;const ei=e.forwardRef((({bsPrefix:e,className:t,id:n,...r},a)=>{const{controlId:o}=i(Ba);return e=I(e,"form-range"),m("input",{...r,type:"range",ref:a,className:O(t,e),id:n||o})}));ei.displayName="FormRange";var ti=ei;const ni=e.forwardRef((({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:a=!1,isInvalid:o=!1,id:s,...l},c)=>{const{controlId:u}=i(Ba);return e=I(e,"form-select"),m("select",{...l,size:n,ref:c,className:O(r,e,t&&`${e}-${t}`,a&&"is-valid",o&&"is-invalid"),id:s||u})}));ni.displayName="FormSelect";var ri=ni;const ai=e.forwardRef((({bsPrefix:e,className:t,as:n="small",muted:r,...a},i)=>(e=I(e,"form-text"),m(n,{...a,ref:i,className:O(t,e,r&&"text-muted")}))));ai.displayName="FormText";var ii=ai;const oi=e.forwardRef(((e,t)=>m(za,{...e,ref:t,type:"switch"})));oi.displayName="Switch";var si=Object.assign(oi,{Input:za.Input,Label:za.Label});const li=e.forwardRef((({bsPrefix:e,className:t,children:n,controlId:r,label:a,...i},o)=>(e=I(e,"form-floating"),g(Xa,{ref:o,className:O(t,e),controlId:r,...i,children:[n,m("label",{htmlFor:r,children:a})]}))));li.displayName="FloatingLabel";var ci=li;const ui={_ref:be.any,validated:be.bool,as:be.elementType},di=e.forwardRef((({className:e,validated:t,as:n="form",...r},a)=>m(n,{...r,ref:a,className:O(e,t&&"was-validated")})));di.displayName="Form",di.propTypes=ui;var hi=Object.assign(di,{Group:Xa,Control:Ka,Floating:Ga,Check:za,Switch:si,Label:Qa,Text:ii,Range:ti,Select:ri,FloatingLabel:ci});const fi=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},a)=>(t=I(t,"input-group-text"),m(n,{ref:a,className:O(e,t),...r}))));fi.displayName="InputGroupText";var pi=fi;const mi=e.forwardRef((({bsPrefix:e,size:t,hasValidation:n,className:r,as:a="div",...i},s)=>{e=I(e,"input-group");const l=o((()=>({})),[]);return m(Oa.Provider,{value:l,children:m(a,{ref:s,...i,className:O(r,e,t&&`${e}-${t}`,n&&"has-validation")})})}));mi.displayName="InputGroup";var vi=Object.assign(mi,{Text:pi,Radio:e=>m(pi,{children:m(Ha,{type:"radio",...e})}),Checkbox:e=>m(pi,{children:m(Ha,{type:"checkbox",...e})})});var gi=e.createContext(null);const bi=["as","active","eventKey"];function yi({key:e,onClick:t,active:n,id:r,role:a,disabled:o}){const s=i(ta),l=i(aa),c=i(gi);let u=n;const d={role:a};if(l){a||"tablist"!==l.role||(d.role="tab");const t=l.getControllerId(null!=e?e:null),i=l.getControlledId(null!=e?e:null);d[oa("event-key")]=e,d.id=t||r,u=null==n&&null!=e?l.activeKey===e:n,!u&&(null!=c&&c.unmountOnExit||null!=c&&c.mountOnEnter)||(d["aria-controls"]=i)}return"tab"===d.role&&(d["aria-selected"]=u,u||(d.tabIndex=-1),o&&(d.tabIndex=-1,d["aria-disabled"]=!0)),d.onClick=Ye((n=>{o||(null==t||t(n),null!=e&&s&&!n.isPropagationStopped()&&s(e,n))})),[d,{isActive:u}]}const Ei=e.forwardRef(((e,t)=>{let{as:n=it,active:r,eventKey:a}=e,i=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,bi);const[o,s]=yi(Object.assign({key:na(a,i.href),active:r},i));return o[oa("active")]=s.isActive,m(n,Object.assign({},i,o,{ref:t}))}));Ei.displayName="NavItem";var wi=Ei;const xi=["as","onSelect","activeKey","role","onKeyDown"];const Ni=()=>{},ki=oa("event-key"),Oi=e.forwardRef(((e,t)=>{let{as:r="div",onSelect:a,activeKey:o,role:l,onKeyDown:c}=e,u=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,xi);const d=Xt(),h=n(!1),f=i(ta),p=i(gi);let v,g;p&&(l=l||"tablist",o=p.activeKey,v=p.getControlledId,g=p.getControllerId);const b=n(null),y=e=>{const t=b.current;if(!t)return null;const n=Yt(t,`[${ki}]:not([aria-disabled=true])`),r=t.querySelector("[aria-selected=true]");if(!r||r!==document.activeElement)return null;const a=n.indexOf(r);if(-1===a)return null;let i=a+e;return i>=n.length&&(i=0),i<0&&(i=n.length-1),n[i]},E=(e,t)=>{null!=e&&(null==a||a(e,t),null==f||f(e,t))};s((()=>{if(b.current&&h.current){const e=b.current.querySelector(`[${ki}][aria-selected=true]`);null==e||e.focus()}h.current=!1}));const w=Ue(t,b);return m(ta.Provider,{value:E,children:m(aa.Provider,{value:{role:l,activeKey:na(o),getControlledId:v||Ni,getControllerId:g||Ni},children:m(r,Object.assign({},u,{onKeyDown:e=>{if(null==c||c(e),!p)return;let t;switch(e.key){case"ArrowLeft":case"ArrowUp":t=y(-1);break;case"ArrowRight":case"ArrowDown":t=y(1);break;default:return}var n;t&&(e.preventDefault(),E(t.dataset[(n="EventKey",`rrUi${n}`)]||null,e),h.current=!0,d())},ref:w,role:l}))})})}));Oi.displayName="Nav";var Li=Object.assign(Oi,{Item:wi});function Ai(e){void 0===e&&(e=H());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}const Si=oa("modal-open");var ji=class{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt(K(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(Si,""),K(r,t)}reset(){[...this.modals].forEach((e=>this.remove(e)))}removeContainerStyle(e){const t=this.getElement();t.removeAttribute(Si),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return-1!==t?t:(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),t)}remove(e){const t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}};const Mi=(e,t)=>je?null==e?(t||H()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function Ci(e,t){const n=da(),[a,i]=r((()=>Mi(e,null==n?void 0:n.document)));if(!a){const t=Mi(e);t&&i(t)}return s((()=>{t&&a&&t(a)}),[t,a]),s((()=>{const t=Mi(e);t!==a&&i(t)}),[e,a]),a}function Ti({children:e,in:t,onExited:r,mountOnEnter:a,unmountOnExit:i}){const o=n(null),l=n(t),c=Ye(r);s((()=>{t?l.current=!0:c(o.current)}),[t,c]);const u=Ue(o,e.ref),h=d(e,{ref:u});return t?h:i||!l.current&&a?null:h}function _i({children:e,in:t,onExited:a,onEntered:i,transition:o}){const[s,l]=r(!t);t&&s&&l(!1);const c=function({in:e,onTransition:t}){const r=n(null),a=n(!0),i=Ye(t);return nt((()=>{if(!r.current)return;let t=!1;return i({in:e,element:r.current,initial:a.current,isStale:()=>t}),()=>{t=!0}}),[e,i]),nt((()=>(a.current=!1,()=>{a.current=!0})),[]),r}({in:!!t,onTransition:e=>{Promise.resolve(o(e)).then((()=>{e.isStale()||(e.in?null==i||i(e.element,e.initial):(l(!0),null==a||a(e.element)))}),(t=>{throw e.in||l(!0),t}))}}),u=Ue(c,e.ref);return s&&!t?null:d(e,{ref:u})}function Pi(e,t,n){return e?m(e,Object.assign({},n)):t?m(_i,Object.assign({},n,{transition:t})):m(Ti,Object.assign({},n))}function Ri(e){return"Escape"===e.code||27===e.keyCode}const qi=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];let Ii;function Di(e){const t=da(),r=e||function(e){return Ii||(Ii=new ji({ownerDocument:null==e?void 0:e.document})),Ii}(t),i=n({dialog:null,backdrop:null});return Object.assign(i.current,{add:()=>r.add(i.current),remove:()=>r.remove(i.current),isTopModal:()=>r.isTopModal(i.current),setDialogRef:a((e=>{i.current.dialog=e}),[]),setBackdropRef:a((e=>{i.current.backdrop=e}),[])})}const Bi=h(((t,a)=>{let{show:i=!1,role:o="dialog",className:l,style:c,children:u,backdrop:d=!0,keyboard:h=!0,onBackdropClick:p,onEscapeKeyDown:b,transition:E,runTransition:w,backdropTransition:x,runBackdropTransition:N,autoFocus:k=!0,enforceFocus:O=!0,restoreFocus:L=!0,restoreFocusOptions:A,renderDialog:S,renderBackdrop:j=(e=>m("div",Object.assign({},e))),manager:M,container:C,onShow:T,onHide:_=(()=>{}),onExit:P,onExited:R,onExiting:q,onEnter:I,onEntering:D,onEntered:B}=t,$=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(t,qi);const H=da(),U=Ci(C),F=Di(M),V=Qe(),z=et(i),[W,K]=r(!i),Z=n(null);f(a,(()=>F),[F]),je&&!z&&i&&(Z.current=Ai(null==H?void 0:H.document)),i&&W&&K(!1);const G=Ye((()=>{if(F.add(),te.current=Pe(document,"keydown",Q),ee.current=Pe(document,"focus",(()=>setTimeout(X)),!0),T&&T(),k){var e,t;const n=Ai(null!=(e=null==(t=F.dialog)?void 0:t.ownerDocument)?e:null==H?void 0:H.document);F.dialog&&n&&!Sr(F.dialog,n)&&(Z.current=n,F.dialog.focus())}})),Y=Ye((()=>{var e;(F.remove(),null==te.current||te.current(),null==ee.current||ee.current(),L)&&(null==(e=Z.current)||null==e.focus||e.focus(A),Z.current=null)}));s((()=>{i&&U&&G()}),[i,U,G]),s((()=>{W&&Y()}),[W,Y]),Ht((()=>{Y()}));const X=Ye((()=>{if(!O||!V()||!F.isTopModal())return;const e=Ai(null==H?void 0:H.document);F.dialog&&e&&!Sr(F.dialog,e)&&F.dialog.focus()})),J=Ye((e=>{e.target===e.currentTarget&&(null==p||p(e),!0===d&&_())})),Q=Ye((e=>{h&&Ri(e)&&F.isTopModal()&&(null==b||b(e),e.defaultPrevented||_())})),ee=n(),te=n();if(!U)return null;const ne=Object.assign({role:o,ref:F.setDialogRef,"aria-modal":"dialog"===o||void 0},$,{style:c,className:l,tabIndex:-1});let re=S?S(ne):m("div",Object.assign({},ne,{children:e.cloneElement(u,{role:"document"})}));re=Pi(E,w,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!i,onExit:P,onExiting:q,onExited:(...e)=>{K(!0),null==R||R(...e)},onEnter:I,onEntering:D,onEntered:B,children:re});let ae=null;return d&&(ae=j({ref:F.setBackdropRef,onClick:J}),ae=Pi(x,N,{in:!!i,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:ae})),m(v,{children:y.createPortal(g(v,{children:[ae,re]}),U)})}));Bi.displayName="Modal";var $i=Object.assign(Bi,{Manager:ji});function Hi(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function Ui(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Fi=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Vi=".sticky-top",zi=".navbar-toggler";class Wi extends ji{adjustAndStore(e,t,n){const r=t.style[e];t.dataset[e]=r,K(t,{[e]:`${parseFloat(K(t,e))+n}px`})}restore(e,t){const n=t.dataset[e];void 0!==n&&(delete t.dataset[e],K(t,{[e]:n}))}setContainerStyle(e){super.setContainerStyle(e);const t=this.getElement();var n,r;if(r="modal-open",(n=t).classList?n.classList.add(r):Hi(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)),!e.scrollBarWidth)return;const a=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";Yt(t,Fi).forEach((t=>this.adjustAndStore(a,t,e.scrollBarWidth))),Yt(t,Vi).forEach((t=>this.adjustAndStore(i,t,-e.scrollBarWidth))),Yt(t,zi).forEach((t=>this.adjustAndStore(i,t,e.scrollBarWidth)))}removeContainerStyle(e){super.removeContainerStyle(e);const t=this.getElement();var n,r;r="modal-open",(n=t).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Ui(n.className,r):n.setAttribute("class",Ui(n.className&&n.className.baseVal||"",r));const a=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";Yt(t,Fi).forEach((e=>this.restore(a,e))),Yt(t,Vi).forEach((e=>this.restore(i,e))),Yt(t,zi).forEach((e=>this.restore(i,e)))}}let Ki;var Zi=Wi;var Gi=e.createContext({onHide(){}});const Yi=e.forwardRef((({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:r,children:a,...o},s)=>{const l=i(Gi),c=Ye((()=>{null==l||l.onHide(),null==r||r()}));return g("div",{ref:s,...o,children:[a,n&&m(pt,{"aria-label":e,variant:t,onClick:c})]})}));var Xi=Yi,Ji={exports:{}},Qi={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,a,i,o){var s=a||"<>",l=o||r;if(null==n[r])return t?new Error("Required "+i+" `"+l+"` was not specified in `"+s+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),d=6;d(t=I(t,"nav-item"),m(n,{ref:a,className:O(e,t),...r}))));to.displayName="NavItem";var no=to;const ro=e.forwardRef((({bsPrefix:e,className:t,as:n=lt,active:r,eventKey:a,disabled:i=!1,...o},s)=>{e=I(e,"nav-link");const[l,c]=yi({key:na(a,o.href),active:r,disabled:i,...o});return m(n,{...o,...l,ref:s,disabled:i,className:O(t,e,i&&"disabled",c.isActive&&"active")})}));ro.displayName="NavLink";var ao=ro;const io=e.forwardRef(((e,t)=>{const{as:n="div",bsPrefix:r,variant:a,fill:o=!1,justify:s=!1,navbar:l,navbarScroll:c,className:u,activeKey:d,...h}=P(e,{activeKey:"onSelect"}),f=I(r,"nav");let p,v,g=!1;const b=i(Aa),y=i(xt);return b?(p=b.bsPrefix,g=null==l||l):y&&({cardHeaderBsPrefix:v}=y),m(Li,{as:n,ref:t,activeKey:d,className:O(u,{[f]:!g,[`${p}-nav`]:g,[`${p}-nav-scroll`]:g&&c,[`${v}-${a}`]:!!v,[`${f}-${a}`]:!!a,[`${f}-fill`]:o,[`${f}-justified`]:s}),...h})}));io.displayName="Nav";var oo=Object.assign(io,{Item:no,Link:ao});const so=e.forwardRef((({bsPrefix:e,className:t,as:n,...r},a)=>{e=I(e,"navbar-brand");const i=n||(r.href?"a":"span");return m(i,{...r,ref:a,className:O(t,e)})}));so.displayName="NavbarBrand";var lo=so;const co=e.forwardRef((({children:e,bsPrefix:t,...n},r)=>{t=I(t,"navbar-collapse");const a=i(Aa);return m(Ge,{in:!(!a||!a.expanded),...n,children:m("div",{ref:r,className:t,children:e})})}));co.displayName="NavbarCollapse";var uo=co;const ho=e.forwardRef((({bsPrefix:e,className:t,children:n,label:r="Toggle navigation",as:a="button",onClick:o,...s},l)=>{e=I(e,"navbar-toggler");const{onToggle:c,expanded:u}=i(Aa)||{},d=Ye((e=>{o&&o(e),c&&c()}));return"button"===a&&(s.type="button"),m(a,{...s,ref:l,onClick:d,"aria-label":r,className:O(t,e,!u&&"collapsed"),children:n||m("span",{className:`${e}-icon`})})}));ho.displayName="NavbarToggle";var fo=ho;const po=new WeakMap,mo=(e,t)=>{if(!e||!t)return;const n=po.get(t)||new Map;po.set(t,n);let r=n.get(e);return r||(r=t.matchMedia(e),r.refCount=0,n.set(r.media,r)),r};function vo(e,t=("undefined"==typeof window?void 0:window)){const n=mo(e,t),[a,i]=r((()=>!!n&&n.matches));return nt((()=>{let n=mo(e,t);if(!n)return i(!1);let r=po.get(t);const a=()=>{i(n.matches)};return n.refCount++,n.addListener(a),a(),()=>{n.removeListener(a),n.refCount--,n.refCount<=0&&(null==r||r.delete(n.media)),n=void 0}}),[e]),a}const go=function(e){const t=Object.keys(e);function n(e,t){return e===t?t:e?`${e} and ${t}`:t}function r(n){const r=function(e){return t[Math.min(t.indexOf(e)+1,t.length-1)]}(n);let a=e[r];return a="number"==typeof a?a-.2+"px":`calc(${a} - 0.2px)`,`(max-width: ${a})`}return function(t,a,i){let s;return"object"==typeof t?(s=t,i=a,a=!0):s={[t]:a=a||!0},vo(o((()=>Object.entries(s).reduce(((t,[a,i])=>("up"!==i&&!0!==i||(t=n(t,function(t){let n=e[t];return"number"==typeof n&&(n=`${n}px`),`(min-width: ${n})`}(a))),"down"!==i&&!0!==i||(t=n(t,r(a))),t)),"")),[JSON.stringify(s)]),i)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),bo=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"offcanvas-body"),m(n,{ref:a,className:O(e,t),...r}))));bo.displayName="OffcanvasBody";var yo=bo;const Eo={[ke]:"show",[Oe]:"show"},wo=e.forwardRef((({bsPrefix:t,className:n,children:r,in:a=!1,mountOnEnter:i=!1,unmountOnExit:o=!1,appear:s=!1,...l},c)=>(t=I(t,"offcanvas"),m(ze,{ref:c,addEndListener:De,in:a,mountOnEnter:i,unmountOnExit:o,appear:s,...l,childRef:r.ref,children:(a,i)=>e.cloneElement(r,{...i,className:O(n,r.props.className,(a===ke||a===Le)&&`${t}-toggling`,Eo[a])})}))));wo.displayName="OffcanvasToggling";var xo=wo;const No=e.forwardRef((({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...a},i)=>(e=I(e,"offcanvas-header"),m(Xi,{ref:i,...a,className:O(t,e),closeLabel:n,closeButton:r}))));No.displayName="OffcanvasHeader";var ko=No;const Oo=Xe("h5"),Lo=e.forwardRef((({className:e,bsPrefix:t,as:n=Oo,...r},a)=>(t=I(t,"offcanvas-title"),m(n,{ref:a,className:O(e,t),...r}))));Lo.displayName="OffcanvasTitle";var Ao=Lo;function So(e){return m(xo,{...e})}function jo(e){return m(dt,{...e})}const Mo=e.forwardRef((({bsPrefix:e,className:t,children:l,"aria-labelledby":c,placement:u="start",responsive:d,show:h=!1,backdrop:f=!0,keyboard:p=!0,scroll:b=!1,onEscapeKeyDown:y,onShow:E,onHide:w,container:x,autoFocus:N=!0,enforceFocus:k=!0,restoreFocus:L=!0,restoreFocusOptions:A,onEntered:S,onExit:j,onExiting:M,onEnter:C,onEntering:T,onExited:_,backdropClassName:P,manager:R,renderStaticNode:q=!1,...D},B)=>{const $=n();e=I(e,"offcanvas");const{onToggle:H}=i(Aa)||{},[U,F]=r(!1),V=go(d||"xs","up");s((()=>{F(d?h&&!V:h)}),[h,d,V]);const z=Ye((()=>{null==H||H(),null==w||w()})),W=o((()=>({onHide:z})),[z]);const K=a((t=>m("div",{...t,className:O(`${e}-backdrop`,P)})),[P,e]),Z=n=>m("div",{...n,...D,className:O(t,d?`${e}-${d}`:e,`${e}-${u}`),"aria-labelledby":c,children:l});return g(v,{children:[!U&&(d||q)&&Z({}),m(Gi.Provider,{value:W,children:m($i,{show:U,ref:B,backdrop:f,container:x,keyboard:p,autoFocus:N,enforceFocus:k&&!b,restoreFocus:L,restoreFocusOptions:A,onEscapeKeyDown:y,onShow:E,onHide:z,onEnter:(e,...t)=>{e&&(e.style.visibility="visible"),null==C||C(e,...t)},onEntering:T,onEntered:S,onExit:j,onExiting:M,onExited:(e,...t)=>{e&&(e.style.visibility=""),null==_||_(...t)},manager:R||(b?($.current||($.current=new Zi({handleContainerOverflow:!1})),$.current):function(e){return Ki||(Ki=new Wi(e)),Ki}()),transition:So,backdropTransition:jo,renderBackdrop:K,renderDialog:Z})})]})}));Mo.displayName="Offcanvas";var Co=Object.assign(Mo,{Body:yo,Header:ko,Title:Ao});const To=e.forwardRef(((e,t)=>{const n=i(Aa);return m(Co,{ref:t,show:!(null==n||!n.expanded),...e,renderStaticNode:!0})}));To.displayName="NavbarOffcanvas";var _o=To;const Po=e.forwardRef((({className:e,bsPrefix:t,as:n="span",...r},a)=>(t=I(t,"navbar-text"),m(n,{ref:a,className:O(e,t),...r}))));Po.displayName="NavbarText";var Ro=Po;const qo=e.forwardRef(((e,t)=>{const{bsPrefix:n,expand:r=!0,variant:i="light",bg:s,fixed:l,sticky:c,className:u,as:d="nav",expanded:h,onToggle:f,onSelect:p,collapseOnSelect:v=!1,...g}=P(e,{expanded:"onToggle"}),b=I(n,"navbar"),y=a(((...e)=>{null==p||p(...e),v&&h&&(null==f||f(!1))}),[p,v,h,f]);void 0===g.role&&"nav"!==d&&(g.role="navigation");let E=`${b}-expand`;"string"==typeof r&&(E=`${E}-${r}`);const w=o((()=>({onToggle:()=>null==f?void 0:f(!h),bsPrefix:b,expanded:!!h,expand:r})),[b,h,r,f]);return m(Aa.Provider,{value:w,children:m(ta.Provider,{value:y,children:m(d,{ref:t,...g,className:O(u,b,r&&E,i&&`${b}-${i}`,s&&`bg-${s}`,c&&`sticky-${c}`,l&&`fixed-${l}`)})})})}));qo.displayName="Navbar";var Io=Object.assign(qo,{Brand:lo,Collapse:uo,Offcanvas:_o,Text:Ro,Toggle:fo});const Do=()=>{};const Bo=e.forwardRef(((e,t)=>{const{flip:n,offset:a,placement:i,containerPadding:o,popperConfig:l={},transition:c,runTransition:u}=e,[d,h]=Je(),[f,p]=Je(),m=Ue(h,t),v=Ci(e.container),g=Ci(e.target),[b,E]=r(!e.show),w=Ar(g,d,Ir({placement:i,enableEvents:!!e.show,containerPadding:o||5,flip:n,offset:a,arrowElement:f,popperConfig:l}));e.show&&b&&E(!1);const x=e.show||!b;if(function(e,t,{disabled:n,clickTrigger:r}={}){const a=t||Do;Rr(e,a,{disabled:n,clickTrigger:r});const i=Ye((e=>{Ri(e)&&a(e)}));s((()=>{if(n||null==e)return;const t=H(_r(e));let r=(t.defaultView||window).event;const a=Pe(t,"keyup",(e=>{e!==r?i(e):r=void 0}));return()=>{a()}}),[e,n,i])}(d,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!x)return null;const{onExit:N,onExiting:k,onEnter:O,onEntering:L,onEntered:A}=e;let S=e.children(Object.assign({},w.attributes.popper,{style:w.styles.popper,ref:m}),{popper:w,placement:i,show:!!e.show,arrowProps:Object.assign({},w.attributes.arrow,{style:w.styles.arrow,ref:p})});return S=Pi(c,u,{in:!!e.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:S,onExit:N,onExiting:k,onExited:(...t)=>{E(!0),e.onExited&&e.onExited(...t)},onEnter:O,onEntering:L,onEntered:A}),v?y.createPortal(S,v):null}));Bo.displayName="Overlay";var $o=Bo;const Ho=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"popover-header"),m(n,{ref:a,className:O(e,t),...r}))));Ho.displayName="PopoverHeader";var Uo=Ho;const Fo=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},a)=>(t=I(t,"popover-body"),m(n,{ref:a,className:O(e,t),...r}))));Fo.displayName="PopoverBody";var Vo=Fo;function zo(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}function Wo(e="absolute"){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}const Ko=e.forwardRef((({bsPrefix:e,placement:t="right",className:n,style:r,children:a,body:i,arrowProps:o,hasDoneInitialMeasure:s,popper:l,show:c,...u},d)=>{const h=I(e,"popover"),f=$(),[p]=(null==t?void 0:t.split("-"))||[],v=zo(p,f);let b=r;return c&&!s&&(b={...r,...Wo(null==l?void 0:l.strategy)}),g("div",{ref:d,role:"tooltip",style:b,"x-placement":p,className:O(n,h,p&&`bs-popover-${v}`),...u,children:[m("div",{className:"popover-arrow",...o}),i?m(Vo,{children:a}):a]})}));var Zo=Object.assign(Ko,{Header:Uo,Body:Vo,POPPER_OFFSET:[0,8]});const Go=e.forwardRef((({bsPrefix:e,placement:t="right",className:n,style:r,children:a,arrowProps:i,hasDoneInitialMeasure:o,popper:s,show:l,...c},u)=>{e=I(e,"tooltip");const d=$(),[h]=(null==t?void 0:t.split("-"))||[],f=zo(h,d);let p=r;return l&&!o&&(p={...r,...Wo(null==s?void 0:s.strategy)}),g("div",{ref:u,style:p,role:"tooltip","x-placement":h,className:O(n,e,`bs-tooltip-${f}`),...c,children:[m("div",{className:"tooltip-arrow",...i}),m("div",{className:`${e}-inner`,children:a})]})}));Go.displayName="Tooltip";var Yo=Object.assign(Go,{TOOLTIP_OFFSET:[0,6]});const Xo=e.forwardRef((({children:t,transition:a=dt,popperConfig:i={},rootClose:l=!1,placement:c="top",show:u=!1,...d},h)=>{const f=n({}),[p,v]=r(null),[g,b]=function(e){const t=n(null),r=I(void 0,"popover"),a=I(void 0,"tooltip"),i=o((()=>({name:"offset",options:{offset:()=>{if(e)return e;if(t.current){if(Hi(t.current,r))return Zo.POPPER_OFFSET;if(Hi(t.current,a))return Yo.TOOLTIP_OFFSET}return[0,0]}}})),[e,r,a]);return[t,[i]]}(d.offset),y=Ue(h,g),E=!0===a?dt:a||void 0,w=Ye((e=>{v(e),null==i||null==i.onFirstUpdate||i.onFirstUpdate(e)}));return nt((()=>{p&&d.target&&(null==f.current.scheduleUpdate||f.current.scheduleUpdate())}),[p,d.target]),s((()=>{u||v(null)}),[u]),m($o,{...d,ref:y,popperConfig:{...i,modifiers:b.concat(i.modifiers||[]),onFirstUpdate:w},transition:E,rootClose:l,placement:c,show:u,children:(n,{arrowProps:r,popper:o,show:s})=>{var l,c;!function(e,t){const{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n(Fe(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r(Fe(e)))}(n,r);const u=null==o?void 0:o.placement,d=Object.assign(f.current,{state:null==o?void 0:o.state,scheduleUpdate:null==o?void 0:o.update,placement:u,outOfBoundaries:(null==o||null==(l=o.state)||null==(c=l.modifiersData.hide)?void 0:c.isReferenceHidden)||!1,strategy:i.strategy}),h=!!p;return"function"==typeof t?t({...n,placement:u,show:s,...!a&&s&&{className:"show"},popper:d,arrowProps:r,hasDoneInitialMeasure:h}):e.cloneElement(t,{...n,placement:u,arrowProps:r,popper:d,hasDoneInitialMeasure:h,className:O(t.props.className,!a&&s&&"show"),style:{...t.props.style,...n.style}})}})}));Xo.displayName="Overlay";var Jo=Xo;function Qo(e,t,n){const[r]=t,a=r.currentTarget,i=r.relatedTarget||r.nativeEvent[n];i&&i===a||Sr(a,i)||e(...t)}be.oneOf(["click","hover","focus"]);var es=({trigger:t=["hover","focus"],overlay:r,children:i,popperConfig:o={},show:s,defaultShow:l=!1,onToggle:c,delay:u,placement:h,flip:f=h&&-1!==h.indexOf("auto"),...p})=>{const b=n(null),y=Ue(b,i.ref),E=Vt(),w=n(""),[x,N]=_(s,l,c),k=function(e){return e&&"object"==typeof e?e:{show:e,hide:e}}(u),{onFocus:O,onBlur:L,onClick:A}="function"!=typeof i?e.Children.only(i).props:{},S=a((()=>{E.clear(),w.current="show",k.show?E.set((()=>{"show"===w.current&&N(!0)}),k.show):N(!0)}),[k.show,N,E]),j=a((()=>{E.clear(),w.current="hide",k.hide?E.set((()=>{"hide"===w.current&&N(!1)}),k.hide):N(!1)}),[k.hide,N,E]),M=a(((...e)=>{S(),null==O||O(...e)}),[S,O]),C=a(((...e)=>{j(),null==L||L(...e)}),[j,L]),T=a(((...e)=>{N(!x),null==A||A(...e)}),[A,N,x]),P=a(((...e)=>{Qo(S,e,"fromElement")}),[S]),R=a(((...e)=>{Qo(j,e,"toElement")}),[j]),q=null==t?[]:[].concat(t),I={ref:e=>{y(Fe(e))}};return-1!==q.indexOf("click")&&(I.onClick=T),-1!==q.indexOf("focus")&&(I.onFocus=M,I.onBlur=C),-1!==q.indexOf("hover")&&("production"!==process.env.NODE_ENV&&Cr(q.length>1,'[react-bootstrap] Specifying only the `"hover"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'),I.onMouseOver=P,I.onMouseOut=R),g(v,{children:["function"==typeof i?i(I):d(i,I),m(Jo,{...p,show:x,onHide:j,flip:f,placement:h,popperConfig:o,target:b.current,children:r})]})};const ts=e.forwardRef((({bsPrefix:e,className:t,as:n="div",...r},a)=>{const i=I(e,"row"),o=D(),s=B(),l=`${i}-cols`,c=[];return o.forEach((e=>{const t=r[e];let n;delete r[e],null!=t&&"object"==typeof t?({cols:n}=t):n=t;const a=e!==s?`-${e}`:"";null!=n&&c.push(`${l}${a}-${n}`)})),m(n,{ref:a,...r,className:O(t,i,...c)})}));ts.displayName="Row";var ns=ts;var rs,as=e.forwardRef((({bsPrefix:e,className:t,striped:n,bordered:r,borderless:a,hover:i,size:o,variant:s,responsive:l,...c},u)=>{const d=I(e,"table"),h=O(t,d,s&&`${d}-${s}`,o&&`${d}-${o}`,n&&`${d}-${"string"==typeof n?`striped-${n}`:"striped"}`,r&&`${d}-bordered`,a&&`${d}-borderless`,i&&`${d}-hover`),f=m("table",{...c,className:h,ref:u});if(l){let e=`${d}-responsive`;return"string"==typeof l&&(e=`${e}-${l}`),m("div",{className:e,children:f})}return f})),is=function(e){var n=e.label,r=e.icon,a=e.children,i=e.className,o=e.variant,s=w(e,["label","icon","children","className","variant"]);return t.createElement(vt,E({className:i,variant:o||"primary"},s),n||null,r?t.createElement("i",{className:"bi bi-".concat(r)}):null,a)};!function(e){e[e.NONE=0]="NONE",e[e.HEAD=1]="HEAD",e[e.BODY=2]="BODY"}(rs||(rs={}));var os=u(rs.NONE),ss=function(e){var n=e.className,r=e.children,a=w(e,["className","children"]);return t.createElement(as,E({className:O(n,"texmo-table")},a),r)};ss.Head=function(e){var n=e.children,r=w(e,["children"]);return t.createElement(os.Provider,{value:rs.HEAD},t.createElement("thead",E({},r),n))},ss.Row=function(e){var n=e.borderColour,r=e.className,a=e.style,i=e.children,o=w(e,["borderColour","className","style","children"]);return t.createElement("tr",E({className:O(r,"table-responsive text-center h-100 mt-3 mx-0"),style:E({border:"2px solid ".concat(n)},a)},o),i)},ss.Cell=function(e){var n=e.borderStart,r=e.className,a=e.children,o=w(e,["borderStart","className","children"]),s=n?"border-start":void 0;switch(i(os)){case rs.HEAD:return t.createElement("th",E({scope:"col list-cell",className:r},o),a);case rs.BODY:case rs.NONE:default:return t.createElement("td",E({className:"px-0 pt-0 pb-3 texmo-table"},o),t.createElement("div",E({className:O(r,"h-100 d-flex align-items-center list-cell")},o),t.createElement($t,{className:"h-100 w-100 py-3"},t.createElement($t.Body,{className:"d-flex justify-content-center align-items-center py-0 ".concat(s)},t.createElement("div",{className:"w-100 h-100"},a)))))}},ss.Body=function(e){var n=e.children,r=w(e,["children"]);return t.createElement("tbody",E({},r),t.createElement(os.Provider,{value:rs.BODY},n))};var ls=function(e){var n=e.className,r=w(e,["className"]);return t.createElement(Ka,E({as:"input",className:n},r))};ls.Feedback=Da;var cs=function(e){var n=e.label,r=e.children,a=e.className;return t.createElement(Qa,{className:a},n?t.createElement("small",{className:"text-muted"},n):null,r)},us=function(e){var n=e.className,r=e.children,a=w(e,["className","children"]);return t.createElement(ri,E({className:n},a),r)};us.Feedback=Da;var ds=function(e){var n=e.type,r=e.className,a=w(e,["type","className"]);return t.createElement(za,E({type:n},a,{className:r}))};ds.Feedback=Da;var hs="object"==typeof global&&global&&global.Object===Object&&global,fs="object"==typeof self&&self&&self.Object===Object&&self,ps=hs||fs||Function("return this")(),ms=ps.Symbol,vs=Object.prototype,gs=vs.hasOwnProperty,bs=vs.toString,ys=ms?ms.toStringTag:void 0;var Es=Object.prototype.toString;var ws="[object Null]",xs="[object Undefined]",Ns=ms?ms.toStringTag:void 0;function ks(e){return null==e?void 0===e?xs:ws:Ns&&Ns in Object(e)?function(e){var t=gs.call(e,ys),n=e[ys];try{e[ys]=void 0;var r=!0}catch(e){}var a=bs.call(e);return r&&(t?e[ys]=n:delete e[ys]),a}(e):function(e){return Es.call(e)}(e)}function Os(e){return null!=e&&"object"==typeof e}var Ls=Array.isArray;function As(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ss(e){return e}var js="[object AsyncFunction]",Ms="[object Function]",Cs="[object GeneratorFunction]",Ts="[object Proxy]";function _s(e){if(!As(e))return!1;var t=ks(e);return t==Ms||t==Cs||t==js||t==Ts}var Ps,Rs=ps["__core-js_shared__"],qs=(Ps=/[^.]+$/.exec(Rs&&Rs.keys&&Rs.keys.IE_PROTO||""))?"Symbol(src)_1."+Ps:"";var Is=Function.prototype.toString;function Ds(e){if(null!=e){try{return Is.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Bs=/^\[object .+?Constructor\]$/,$s=Function.prototype,Hs=Object.prototype,Us=$s.toString,Fs=Hs.hasOwnProperty,Vs=RegExp("^"+Us.call(Fs).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zs(e){return!(!As(e)||(t=e,qs&&qs in t))&&(_s(e)?Vs:Bs).test(Ds(e));var t}function Ws(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return zs(n)?n:void 0}var Ks=Ws(ps,"WeakMap"),Zs=Object.create,Gs=function(){function e(){}return function(t){if(!As(t))return{};if(Zs)return Zs(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Ys(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n0){if(++Qs>=800)return arguments[0]}else Qs=0;return Js.apply(void 0,arguments)});var il=9007199254740991,ol=/^(?:0|[1-9]\d*)$/;function sl(e,t){var n=typeof e;return!!(t=null==t?il:t)&&("number"==n||"symbol"!=n&&ol.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=ml}function gl(e){return null!=e&&vl(e.length)&&!_s(e)}var bl=Object.prototype;function yl(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||bl)}function El(e){return Os(e)&&"[object Arguments]"==ks(e)}var wl=Object.prototype,xl=wl.hasOwnProperty,Nl=wl.propertyIsEnumerable,kl=El(function(){return arguments}())?El:function(e){return Os(e)&&xl.call(e,"callee")&&!Nl.call(e,"callee")};var Ol="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ll=Ol&&"object"==typeof module&&module&&!module.nodeType&&module,Al=Ll&&Ll.exports===Ol?ps.Buffer:void 0,Sl=(Al?Al.isBuffer:void 0)||function(){return!1},jl={};function Ml(e){return function(t){return e(t)}}jl["[object Float32Array]"]=jl["[object Float64Array]"]=jl["[object Int8Array]"]=jl["[object Int16Array]"]=jl["[object Int32Array]"]=jl["[object Uint8Array]"]=jl["[object Uint8ClampedArray]"]=jl["[object Uint16Array]"]=jl["[object Uint32Array]"]=!0,jl["[object Arguments]"]=jl["[object Array]"]=jl["[object ArrayBuffer]"]=jl["[object Boolean]"]=jl["[object DataView]"]=jl["[object Date]"]=jl["[object Error]"]=jl["[object Function]"]=jl["[object Map]"]=jl["[object Number]"]=jl["[object Object]"]=jl["[object RegExp]"]=jl["[object Set]"]=jl["[object String]"]=jl["[object WeakMap]"]=!1;var Cl="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tl=Cl&&"object"==typeof module&&module&&!module.nodeType&&module,_l=Tl&&Tl.exports===Cl&&hs.process,Pl=function(){try{var e=Tl&&Tl.require&&Tl.require("util").types;return e||_l&&_l.binding&&_l.binding("util")}catch(e){}}(),Rl=Pl&&Pl.isTypedArray,ql=Rl?Ml(Rl):function(e){return Os(e)&&vl(e.length)&&!!jl[ks(e)]},Il=Object.prototype.hasOwnProperty;function Dl(e,t){var n=Ls(e),r=!n&&kl(e),a=!n&&!r&&Sl(e),i=!n&&!r&&!a&&ql(e),o=n||r||a||i,s=o?function(e,t){for(var n=-1,r=Array(e);++n-1},Jl.prototype.set=function(e,t){var n=this.__data__,r=Yl(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ql=Ws(ps,"Map");function ec(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function tc(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ts))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&Tu?new ju:void 0;for(i.set(e,t),i.set(t,e);++d1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(a=fd.length>3&&"function"==typeof a?(r--,a):void 0,i&&function(e,t,n){if(!As(n))return!1;var r=typeof t;return!!("number"==r?gl(n)&&sl(t,n.length):"string"==r&&t in n)&&cl(n[t],e)}(t[0],t[1],i)&&(a=r<3?void 0:a,r=1),e=Object(e);++n(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(md||{});class vd{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const r=md.TYPE&md.ATTRIBUTE;this.scope=null!=n.scope?n.scope&md.LEVEL|r:md.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map((e=>e.name))}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class gd extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const bd=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){const a=this.query(n);if(null==a)throw new gd(`Unable to create ${n} blot`);const i=a,o=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:i.create(r),s=new i(t,o,r);return e.blots.set(s.domNode,s),s}find(t,n=!1){return e.find(t,n)}query(e,t=md.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&md.LEVEL&md.BLOCK?n=this.types.block:e&md.LEVEL&md.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((e=>(n=this.classes[e],!!n))),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&md.LEVEL&n.scope&&t&md.TYPE&n.scope?n:null}register(...e){return e.map((e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new gd("Invalid definition");if(t&&"abstract"===e.blotName)throw new gd("Cannot register abstract class");const r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map((e=>e.toUpperCase())):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach((t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)})))),e}))}};bd.blots=new WeakMap;let yd=bd;function Ed(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((e=>0===e.indexOf(`${t}-`)))}const wd=class extends vd{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((e=>e.split("-").slice(0,-1).join("-")))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){Ed(e,this.keyName).forEach((t=>{e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(Ed(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function xd(e){const t=e.split("-"),n=t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("");return t[0]+n}const Nd=class extends vd{static keys(e){return(e.getAttribute("style")||"").split(";").map((e=>e.split(":")[0].trim()))}add(e,t){return!!this.canAdd(e,t)&&(e.style[xd(this.keyName)]=t,!0)}remove(e){e.style[xd(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[xd(this.keyName)];return this.canAdd(e,t)?t:""}};const kd=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=yd.find(this.domNode);if(null==e)return;const t=vd.keys(this.domNode),n=wd.keys(this.domNode),r=Nd.keys(this.domNode);t.concat(n).concat(r).forEach((t=>{const n=e.scroll.query(t,md.ATTRIBUTE);n instanceof vd&&(this.attributes[n.attrName]=n)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((e=>{this.attributes[e].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}},Od=class{constructor(e,t){this.scroll=e,this.domNode=t,yd.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new gd("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),yd.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const a=this.isolate(e,t);if(null!=this.scroll.query(n,md.BLOT)&&r)a.wrap(n,r);else if(null!=this.scroll.query(n,md.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);a.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),a=this.split(e);this.parent.insertBefore(r,a||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new gd(`Cannot wrap ${e}`);return n.appendChild(this),n}};Od.blotName="abstract";let Ld=Od;const Ad=class extends Ld{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Ad.scope=md.INLINE_BLOT;const Sd=Ad;class jd{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let r=n();for(;r;){const a=r.length();if(ei?n(s,e-i,Math.min(t,i+r-e)):n(s,0,Math.min(r,e+t-i)),i+=r,s=o()}}map(e){return this.reduce(((t,n)=>(t.push(e(n)),t)),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=n();return t}}function Md(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create(md.INLINE);return Array.from(e.childNodes).forEach((e=>{n.domNode.appendChild(e)})),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const Cd=class e extends Ld{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new jd,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=Md(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof gd)return;throw e}}))}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,((e,t,n)=>{e.deleteAt(t,n)}))}descendant(t,n=0){const[r,a]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,a]:r instanceof e?r.descendant(t,a):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let a=[],i=r;return this.children.forEachAt(n,r,((n,r,o)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&a.push(n),n instanceof e&&(a=a.concat(n.descendants(t,r,i))),i-=o})),a}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach((n=>{t||this.statics.allowedChildren.some((e=>n instanceof e))||(n.statics.scope===md.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())}))}formatAt(e,t,n,r){this.children.forEachAt(e,t,((e,t,a)=>{e.formatAt(t,a,n,r)}))}insertAt(e,t,n){const[r,a]=this.children.find(e);if(r)r.insertAt(a,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((n=>{e.insertBefore(n,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[r,a]=this.children.find(t,n),i=[[this,t]];return r instanceof e?i.concat(r.path(a,n)):(null!=r&&i.push([r,a]),i)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),((e,r,a)=>{const i=e.split(r,t);null!=i&&n.appendChild(i)})),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],r=[];e.forEach((e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))})),r.forEach((e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()})),n.filter((e=>e.parentNode===this.domNode&&e!==this.uiNode)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=Md(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))})),this.enforceAllowedChildren()}};Cd.uiClass="";const Td=Cd;const _d=class e extends Td{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kd(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,md.INLINE);if(null==e)return;e instanceof vd?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach((t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)})),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.formats()[n]||this.scroll.query(n,md.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}wrap(t,n){const r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};_d.allowedChildren=[_d,Sd],_d.blotName="inline",_d.scope=md.INLINE_BLOT,_d.tagName="SPAN";const Pd=_d,Rd=class e extends Td{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new kd(this.domNode)}format(t,n){const r=this.scroll.query(t,md.BLOCK);null!=r&&(r instanceof vd?this.attributes.attribute(r,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.scroll.query(n,md.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,md.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}};Rd.blotName="block",Rd.scope=md.BLOCK_BLOT,Rd.tagName="P",Rd.allowedChildren=[Pd,Rd,Sd];const qd=Rd,Id=class extends Td{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Id.blotName="container",Id.scope=md.BLOCK_BLOT;const Dd=Id;const Bd=class extends Sd{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},$d={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Hd=class extends Td{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((e=>{this.update(e)})),this.observer.observe(this.domNode,$d),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=md.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach((e=>{e.remove()})):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const a=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&a(e.parent))},i=e=>{n.has(e.domNode)&&(e instanceof Td&&e.children.forEach(i),n.delete(e.domNode),e.optimize(t))};let o=e;for(let t=0;o.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach((e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(a(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach((e=>{const t=this.find(e,!1);a(t,!1),t instanceof Td&&t.children.forEach((e=>{a(e,!1)}))}))):"attributes"===e.type&&a(t.prev)),a(t))})),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),r=o.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map((e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)})).forEach((e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)})),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Hd.blotName="scroll",Hd.defaultChild=qd,Hd.allowedChildren=[qd,Dd],Hd.scope=md.BLOCK_BLOT,Hd.tagName="DIV";const Ud=Hd,Fd=class e extends Sd{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some((e=>"characterData"===e.type&&e.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Fd.blotName="text",Fd.scope=md.INLINE_BLOT;const Vd=Fd;var zd=Object.freeze({__proto__:null,Attributor:vd,AttributorStore:kd,BlockBlot:qd,ClassAttributor:wd,ContainerBlot:Dd,EmbedBlot:Bd,InlineBlot:Pd,LeafBlot:Sd,ParentBlot:Td,Registry:yd,Scope:md,ScrollBlot:Ud,StyleAttributor:Nd,TextBlot:Vd}),Wd={exports:{}},Kd=-1,Zd=1,Gd=0;function Yd(e,t,n,r,a){if(e===t)return e?[[Gd,e]]:[];if(null!=n){var i=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,a="number"==typeof n?null:n.newRange,i=e.length,o=t.length;if(0===r.length&&(null===a||0===a.length)){var s=r.index,l=e.slice(0,s),c=e.slice(s),u=a?a.index:null,d=s+o-i;if((null===u||u===d)&&!(d<0||d>o)){var h=t.slice(0,d);if((m=t.slice(d))===c){var f=Math.min(s,d);if((g=l.slice(0,f))===(y=h.slice(0,f)))return dh(g,l.slice(f),h.slice(f),c)}}if(null===u||u===s){var p=s,m=(h=t.slice(0,p),t.slice(p));if(h===l){var v=Math.min(i-p,o-p);if((b=c.slice(c.length-v))===(E=m.slice(m.length-v)))return dh(l,c.slice(0,c.length-v),m.slice(0,m.length-v),b)}}}if(r.length>0&&a&&0===a.length){var g=e.slice(0,r.index),b=e.slice(r.index+r.length);if(!(o<(f=g.length)+(v=b.length))){var y=t.slice(0,f),E=t.slice(o-v);if(g===y&&b===E)return dh(g,e.slice(f,i-v),t.slice(f,o-v),b)}}return null}(e,t,n);if(i)return i}var o=Jd(e,t),s=e.substring(0,o);o=eh(e=e.substring(o),t=t.substring(o));var l=e.substring(e.length-o),c=function(e,t){var n;if(!e)return[[Zd,t]];if(!t)return[[Kd,e]];var r=e.length>t.length?e:t,a=e.length>t.length?t:e,i=r.indexOf(a);if(-1!==i)return n=[[Zd,r.substring(0,i)],[Gd,a],[Zd,r.substring(i+a.length)]],e.length>t.length&&(n[0][0]=n[2][0]=Kd),n;if(1===a.length)return[[Kd,e],[Zd,t]];var o=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,a,i,o,c]:null}var i,o,s,l,c,u=a(n,r,Math.ceil(n.length/4)),d=a(n,r,Math.ceil(n.length/2));if(!u&&!d)return null;i=d?u&&u[4].length>d[4].length?u:d:u;e.length>t.length?(o=i[0],s=i[1],l=i[2],c=i[3]):(l=i[0],c=i[1],o=i[2],s=i[3]);var h=i[4];return[o,s,l,c,h]}(e,t);if(o){var s=o[0],l=o[1],c=o[2],u=o[3],d=o[4],h=Yd(s,c),f=Yd(l,u);return h.concat([[Gd,d]],f)}return function(e,t){for(var n=e.length,r=t.length,a=Math.ceil((n+r)/2),i=a,o=2*a,s=new Array(o),l=new Array(o),c=0;cn)f+=2;else if(y>r)h+=2;else if(d){if((x=i+u-g)>=0&&x=(w=n-l[x]))return Xd(e,t,k,y)}}for(var E=-v+p;E<=v-m;E+=2){for(var w,x=i+E,N=(w=E===-v||E!==v&&l[x-1]n)m+=2;else if(N>r)p+=2;else if(!d){if((b=i+u-E)>=0&&b=(w=n-w))return Xd(e,t,k,y)}}}}return[[Kd,e],[Zd,t]]}(e,t)}(e=e.substring(0,e.length-o),t=t.substring(0,t.length-o));return s&&c.unshift([Gd,s]),l&&c.push([Gd,l]),oh(c,a),r&&function(e){var t=!1,n=[],r=0,a=null,i=0,o=0,s=0,l=0,c=0;for(;i0?n[r-1]:-1,o=0,s=0,l=0,c=0,a=null,t=!0)),i++;t&&oh(e);(function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),a=n.match(th),i=r.match(th),o=a&&n.match(nh),s=i&&r.match(nh),l=o&&n.match(rh),c=s&&r.match(rh),u=l&&e.match(ah),d=c&&t.match(ih);return u||d?5:l||c?4:a&&!o&&s?3:o||s?2:a||i?1:0}var n=1;for(;n=d&&(d=h,l=r,c=a,u=i)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=c,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}})(e),i=1;for(;i=f?(h>=u.length/2||h>=d.length/2)&&(e.splice(i,0,[Gd,d.substring(0,h)]),e[i-1][1]=u.substring(0,u.length-h),e[i+1][1]=d.substring(h),i++):(f>=u.length/2||f>=d.length/2)&&(e.splice(i,0,[Gd,u.substring(0,f)]),e[i-1][0]=Zd,e[i-1][1]=d.substring(0,d.length-f),e[i+1][0]=Kd,e[i+1][1]=u.substring(f),i++),i++}i++}}(c),c}function Xd(e,t,n,r){var a=e.substring(0,n),i=t.substring(0,r),o=e.substring(n),s=t.substring(r),l=Yd(a,i),c=Yd(o,s);return l.concat(c)}function Jd(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),a=r,i=0;nr?e=e.substring(n-r):n=0&&uh(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),o=c+o,s=c+s,!e[l][1]){e.splice(l,1),r--;var u=l-1;e[u]&&e[u][0]===Zd&&(i++,s=e[u][1]+s,u--),e[u]&&e[u][0]===Kd&&(a++,o=e[u][1]+o,u--),l=u}}if(ch(e[r][1])){c=e[r][1].charAt(0);e[r][1]=e[r][1].slice(1),o+=c,s+=c}}if(r0||s.length>0){o.length>0&&s.length>0&&(0!==(n=Jd(s,o))&&(l>=0?e[l][1]+=s.substring(0,n):(e.splice(0,0,[Gd,s.substring(0,n)]),r++),s=s.substring(n),o=o.substring(n)),0!==(n=eh(s,o))&&(e[r][1]=s.substring(s.length-n)+e[r][1],s=s.substring(0,s.length-n),o=o.substring(0,o.length-n)));var d=i+a;0===o.length&&0===s.length?(e.splice(r-d,d),r-=d):0===o.length?(e.splice(r-d,d,[Zd,s]),r=r-d+1):0===s.length?(e.splice(r-d,d,[Kd,o]),r=r-d+1):(e.splice(r-d,d,[Kd,o],[Zd,s]),r=r-d+2)}0!==r&&e[r-1][0]===Gd?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,i=0,a=0,o="",s=""}""===e[e.length-1][1]&&e.pop();var h=!1;for(r=1;r=55296&&e<=56319}function lh(e){return e>=56320&&e<=57343}function ch(e){return lh(e.charCodeAt(0))}function uh(e){return sh(e.charCodeAt(e.length-1))}function dh(e,t,n,r){return uh(e)||ch(r)?null:function(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}([[Gd,e],[Kd,t],[Zd,n],[Gd,r]])}function hh(e,t,n,r){return Yd(e,t,n,r,!0)}hh.INSERT=Zd,hh.DELETE=Kd,hh.EQUAL=Gd;var fh=hh,ph={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",i="[object Boolean]",o="[object Date]",s="[object Function]",l="[object GeneratorFunction]",c="[object Map]",u="[object Number]",d="[object Object]",h="[object Promise]",f="[object RegExp]",p="[object Set]",m="[object String]",v="[object Symbol]",g="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",E="[object Float32Array]",w="[object Float64Array]",N="[object Int8Array]",k="[object Int16Array]",O="[object Int32Array]",L="[object Uint8Array]",A="[object Uint8ClampedArray]",S="[object Uint16Array]",j="[object Uint32Array]",M=/\w*$/,C=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,_={};_[a]=_["[object Array]"]=_[b]=_[y]=_[i]=_[o]=_[E]=_[w]=_[N]=_[k]=_[O]=_[c]=_[u]=_[d]=_[f]=_[p]=_[m]=_[v]=_[L]=_[A]=_[S]=_[j]=!0,_["[object Error]"]=_[s]=_[g]=!1;var P="object"==typeof x&&x&&x.Object===Object&&x,R="object"==typeof self&&self&&self.Object===Object&&self,q=P||R||Function("return this")(),I=t&&!t.nodeType&&t,D=I&&e&&!e.nodeType&&e,B=D&&D.exports===I;function $(e,t){return e.set(t[0],t[1]),e}function H(e,t){return e.add(t),e}function U(e,t,n,r){var a=-1,i=e?e.length:0;for(r&&i&&(n=e[++a]);++a-1},Le.prototype.set=function(e,t){var n=this.__data__,r=Ce(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Oe,map:new(fe||Le),string:new Oe}},Ae.prototype.delete=function(e){return qe(this,e).delete(e)},Ae.prototype.get=function(e){return qe(this,e).get(e)},Ae.prototype.has=function(e){return qe(this,e).has(e)},Ae.prototype.set=function(e,t){return qe(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new Le},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Le){var r=n.__data__;if(!fe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ae(r)}return n.set(e,t),this};var De=ce?z(ce,Object):function(){return[]},Be=function(e){return ee.call(e)};function $e(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var We=ue||function(){return!1};function Ke(e){var t=Ze(e)?ee.call(e):"";return t==s||t==l}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ge(e){return ze(e)?je(e):function(e){if(!He(e))return de(e);var t=[];for(var n in Object(e))Q.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}(ph,ph.exports);var mh=ph.exports,vh={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=1,a=2,i=9007199254740991,o="[object Arguments]",s="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",f="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Null]",g="[object Object]",b="[object Promise]",y="[object Proxy]",E="[object RegExp]",w="[object Set]",N="[object String]",k="[object Symbol]",O="[object Undefined]",L="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",j=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[o]=C[s]=C[A]=C[c]=C[S]=C[u]=C[d]=C[h]=C[p]=C[m]=C[g]=C[E]=C[w]=C[N]=C[L]=!1;var T="object"==typeof x&&x&&x.Object===Object&&x,_="object"==typeof self&&self&&self.Object===Object&&self,P=T||_||Function("return this")(),R=t&&!t.nodeType&&t,q=R&&e&&!e.nodeType&&e,I=q&&q.exports===R,D=I&&T.process,B=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),$=B&&B.isTypedArray;function H(e,t){for(var n=-1,r=null==e?0:e.length;++nc))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var h=-1,f=!0,p=n&a?new ke:void 0;for(s.set(e,t),s.set(t,e);++h-1},xe.prototype.set=function(e,t){var n=this.__data__,r=Ae(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ne.prototype.clear=function(){this.size=0,this.__data__={hash:new we,map:new(ce||xe),string:new we}},Ne.prototype.delete=function(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t},Ne.prototype.get=function(e){return Re(this,e).get(e)},Ne.prototype.has=function(e){return Re(this,e).has(e)},Ne.prototype.set=function(e,t){var n=Re(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ke.prototype.add=ke.prototype.push=function(e){return this.__data__.set(e,n),this},ke.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.clear=function(){this.__data__=new xe,this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xe){var r=n.__data__;if(!ce||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ne(r)}return n.set(e,t),this.size=n.size,this};var Ie=ie?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,i=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=i}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ze(e){return null!=e&&"object"==typeof e}var Ge=$?function(e){return function(t){return e(t)}}($):function(e){return Ze(e)&&We(e.length)&&!!C[Se(e)]};function Ye(e){return null!=(t=e)&&We(t.length)&&!ze(t)?Le(e):Te(e);var t}e.exports=function(e,t){return Me(e,t)}}(vh,vh.exports);var gh=vh.exports,bh={};Object.defineProperty(bh,"__esModule",{value:!0});const yh=mh,Eh=gh;var wh;!function(e){e.compose=function(e={},t={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let r=yh(t);n||(r=Object.keys(r).reduce(((e,t)=>(null!=r[t]&&(e[t]=r[t]),e)),{}));for(const n in e)void 0!==e[n]&&void 0===t[n]&&(r[n]=e[n]);return Object.keys(r).length>0?r:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const n=Object.keys(e).concat(Object.keys(t)).reduce(((n,r)=>(Eh(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n)),{});return Object.keys(n).length>0?n:void 0},e.invert=function(e={},t={}){e=e||{};const n=Object.keys(t).reduce(((n,r)=>(t[r]!==e[r]&&void 0!==e[r]&&(n[r]=t[r]),n)),{});return Object.keys(e).reduce(((n,r)=>(e[r]!==t[r]&&void 0===t[r]&&(n[r]=null),n)),n)},e.transform=function(e,t,n=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!n)return t;const r=Object.keys(t).reduce(((n,r)=>(void 0===e[r]&&(n[r]=t[r]),n)),{});return Object.keys(r).length>0?r:void 0}}(wh||(wh={})),bh.default=wh;var xh,Nh={};Object.defineProperty(Nh,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(xh||(xh={})),Nh.default=xh;var kh={};Object.defineProperty(kh,"__esModule",{value:!0});const Oh=Nh;kh.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const n=this.offset,r=Oh.default.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"object"==typeof t.retain&&null!==t.retain?r.retain=t.retain:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Oh.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}return[]}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const n=fh,r=mh,a=gh,i=bh;t.AttributeMap=i.default;const o=Nh;t.Op=o.default;const s=kh;t.OpIterator=s.default;const l=String.fromCharCode(0),c=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class u{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(a(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach((r=>{(e(r)?t:n).push(r)})),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce(((e,t)=>t.insert?e+o.default.length(t):t.delete?e-t.delete:e),0)}length(){return this.reduce(((e,t)=>e+o.default.length(t)),0)}slice(e=0,t=1/0){const n=[],r=new s.default(this.ops);let a=0;for(;a0&&n.next(o.retain-e)}const l=new u(r);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===t.peekType())l.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),r=t.next(e),o=n.next(e);if(o.retain){const s={};if("number"==typeof r.retain)s.retain="number"==typeof o.retain?e:o.retain;else if("number"==typeof o.retain)null==r.retain?s.insert=r.insert:s.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,a]=c(r[e],o.retain),i=u.getHandler(t);s[e]={[t]:i.compose(n,a,"retain"===e)}}const d=i.default.compose(r.attributes,o.attributes,"number"==typeof r.retain);if(d&&(s.attributes=d),l.push(s),!n.hasNext()&&a(l.ops[l.ops.length-1],s)){const e=new u(t.rest());return l.concat(e).chop()}}else"number"==typeof o.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&l.push(o)}return l.chop()}concat(e){const t=new u(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new u;const r=[this,e].map((t=>t.map((n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join(""))),o=new u,c=n(r[0],r[1],t,!0),d=new s.default(this.ops),h=new s.default(e.ops);return c.forEach((e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(h.peekLength(),t),o.push(h.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),o.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),h.peekLength(),t);const e=d.next(r),s=h.next(r);a(e.insert,s.insert)?o.retain(r,i.default.diff(e.attributes,s.attributes)):o.push(s).delete(r)}t-=r}})),o.chop()}eachLine(e,t="\n"){const n=new s.default(this.ops);let r=new u,a=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const i=n.peek(),s=o.default.length(i)-n.peekLength(),l="string"==typeof i.insert?i.insert.indexOf(t,s)-s:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===e(r,n.next(1).attributes||{},a))return;a+=1,r=new u}}r.length()>0&&e(r,{},a)}invert(e){const t=new u;return this.reduce(((n,r)=>{if(r.insert)t.delete(o.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const a=r.delete||r.retain;return e.slice(n,n+a).forEach((e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(o.default.length(e),i.default.invert(r.attributes,e.attributes))})),n+a}if("object"==typeof r.retain&&null!==r.retain){const a=e.slice(n,n+1),o=new s.default(a.ops).next(),[l,d,h]=c(r.retain,o.insert),f=u.getHandler(l);return t.retain({[l]:f.invert(d,h)},i.default.invert(r.attributes,o.attributes)),n+1}}return n}),0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,r=new s.default(this.ops),a=new s.default(n.ops),l=new u;for(;r.hasNext()||a.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===a.peekType())if("insert"===a.peekType())l.push(a.next());else{const e=Math.min(r.peekLength(),a.peekLength()),n=r.next(e),o=a.next(e);if(n.delete)continue;if(o.delete)l.push(o);else{const r=n.retain,a=o.retain;let s="object"==typeof a&&null!==a?a:e;if("object"==typeof r&&null!==r&&"object"==typeof a&&null!==a){const e=Object.keys(r)[0];if(e===Object.keys(a)[0]){const n=u.getHandler(e);n&&(s={[e]:n.transform(r[e],a[e],t)})}}l.retain(s,i.default.transform(n.attributes,o.attributes,t))}}else l.retain(o.default.length(r.next()));return l.chop()}transformPosition(e,t=!1){t=!!t;const n=new s.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const a=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r"']/g,(e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e])))}class Ch extends Pd{static allowedChildren=[Ch,Sh,Bd,jh];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const n=Ch.order.indexOf(e),r=Ch.order.indexOf(t);return n>=0||r>=0?n-r:e===t?0:e0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}class Th extends qd{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=Ph(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,md.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(null!=n)return super.insertAt(e,t,n),void(this.cache={});if(0===t.length)return;const r=t.split("\n"),a=r.shift();a.length>0&&(e(i=i.split(e,!0),i.insertAt(0,t),t.length)),e+a.length)}insertBefore(e,t){const{head:n}=this.children;super.insertBefore(e,t),n instanceof Sh&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&(0===e||e>=this.length()-1)){const t=this.clone();return 0===e?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}const n=super.split(e,t);return this.cache={},n}}Th.blotName="block",Th.tagName="P",Th.defaultChild=Sh,Th.allowedChildren=[Sh,Ch,Bd,jh];class _h extends Bd{attach(){super.attach(),this.attributes=new kd(this.domNode)}delta(){return(new Ah).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,md.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(null!=n)return void super.insertAt(e,t,n);const r=t.split("\n"),a=r.pop(),i=r.map((e=>{const t=this.scroll.create(Th.blotName);return t.insertAt(0,e),t})),o=this.split(e);i.forEach((e=>{this.parent.insertBefore(e,o)})),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}function Ph(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(Sd).reduce(((e,n)=>0===n.length()?e:e.insert(n.value(),Rh(n,{},t))),new Ah).insert("\n",Rh(e))}function Rh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t={...t,...e.formats()},n&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:Rh(e.parent,t,n))}_h.scope=md.BLOCK_BLOT;class qh extends Bd{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(qh.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(e,t){if(0!==this.savedLength)return void super.format(e,t);let n=this,r=0;for(;null!=n&&n.statics.scope!==md.BLOCK_BLOT;)r+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=qh.CONTENTS.length,n.optimize(),n.formatAt(r,qh.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const e=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof jh?this.prev:null,n=t?t.length():0,r=this.next instanceof jh?this.next:null,a=r?r.text:"",{textNode:i}=this,o=i.data.split(qh.CONTENTS).join("");let s;if(i.data=qh.CONTENTS,t)s=t,(o||r)&&(t.insertAt(t.length(),o+a),r&&r.remove());else if(r)s=r,r.insertAt(0,o);else{const e=document.createTextNode(o);s=this.scroll.create(e),this.parent.insertBefore(s,this)}if(this.remove(),e){const a=(e,a)=>t&&e===t.domNode?a:e===i?n+a-1:r&&e===r.domNode?n+o.length+a:null,l=a(e.start.node,e.start.offset),c=a(e.end.node,e.end.offset);if(null!==l&&null!==c)return{startNode:s.domNode,startOffset:l,endNode:s.domNode,endOffset:c}}return null}update(e,t){if(e.some((e=>"characterData"===e.type&&e.target===this.textNode))){const e=this.restore();e&&(t.range=e)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if("A"===t.domNode.tagName){this.savedLength=qh.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Ih={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,i||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,i=r.length,o=new Array(i);a1?t-1:0),r=1;r(t[n]=Uh.bind(console,n,e),t)),{})}Fh.level=e=>{Hh=e},Uh.level=Fh.level;const Vh=Fh("quill:events");["selectionchange","mousedown","mouseup","click"].forEach((e=>{document.addEventListener(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n{const n=Bh.get(e);n&&n.emitter&&n.emitter.handleDOM(...t)}))}))}));class zh extends Dh{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Vh.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r{let{node:r,handler:a}=t;(e.target===r||r.contains(e.target))&&a(e,...n)}))}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}const Wh=Fh("quill:selection");class Kh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=e,this.length=t}}class Zh{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Kh(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,zh.sources.USER),1)})),this.emitter.on(zh.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const e=this.getNativeRange();null!=e&&e.start.node!==this.cursor.textNode&&this.emitter.once(zh.events.SCROLL_UPDATE,((t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);const r=n.some((e=>"characterData"===e.type||"childList"===e.type||"attributes"===e.type&&e.target===this.root));this.update(r?zh.sources.SILENT:t)}catch(e){}}))})),this.emitter.on(zh.events.SCROLL_OPTIMIZE,((e,t)=>{if(t.range){const{startNode:e,startOffset:n,endNode:r,endOffset:a}=t.range;this.setNativeRange(e,n,r,a),this.update(zh.sources.SILENT)}})),this.update(zh.sources.SILENT)}handleComposition(){this.emitter.on(zh.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(zh.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(zh.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(e,md.BLOCK)){if(n.start.node!==this.cursor.textNode){const e=this.scroll.find(n.start.node,!1);if(null==e)return;if(e instanceof Sd){const t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let r;e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let[a,i]=this.scroll.leaf(e);if(null==a)return null;if(t>0&&i===a.length()){const[t]=this.scroll.leaf(e+1);if(t){const[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(a=t,i=0)}}[r,i]=a.position(i,!0);const o=document.createRange();if(t>0)return o.setStart(r,i),[a,i]=this.scroll.leaf(e+t),null==a?null:([r,i]=a.position(i,!0),o.setEnd(r,i),o.getBoundingClientRect());let s,l="left";if(r instanceof Text){if(!r.data.length)return null;i0&&(l="right")}return{bottom:s.top+s.height,height:s.height,left:s[l],right:s[l],top:s.top,width:0}}getNativeRange(){const e=document.getSelection();if(null==e||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(null==t)return null;const n=this.normalizeNative(t);return Wh.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();if(null==t)return[null,null];return[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&Gh(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map((e=>{const[t,n]=e,r=this.scroll.find(t,!0),a=r.offset(this.scroll);return 0===n?a:r instanceof Sd?a+r.index(t,n):a+r.length()})),r=Math.min(Math.max(...n),this.scroll.length()-1),a=Math.min(r,...n);return new Kh(a,r-a)}normalizeNative(e){if(!Gh(this.root,e.startContainer)||!e.collapsed&&!Gh(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1}e.node=t,e.offset=n})),t}rangeToNative(e){const t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);const[r,a]=this.scroll.leaf(e);return r?r.position(a,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Wh.info("setNativeRange",e,t,n,r),null!=e&&(null==this.root.parentNode||null==e.parentNode||null==n.parentNode))return;const i=document.getSelection();if(null!=i)if(null!=e){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(null==o||a||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e instanceof Element&&"BR"===e.tagName&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&"BR"===n.tagName&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const a=document.createRange();a.setStart(e,t),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zh.sources.API;if("string"==typeof t&&(n=t,t=!1),Wh.info("setRange",e),null!=e){const n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zh.sources.USER;const t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!hd(t,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}const n=[zh.events.SELECTION_CHANGE,Su(this.lastRange),Su(t),e];this.emitter.emit(zh.events.EDITOR_CHANGE,...n),e!==zh.sources.SILENT&&this.emitter.emit(...n)}}}function Gh(e,t){try{t.parentNode}catch(e){return!1}return e.contains(t)}const Yh=/^[ -~]*$/;class Xh{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=nf(e),r=new Ah;return function(e){const t=[];return e.forEach((e=>{if("string"==typeof e.insert){e.insert.split("\n").forEach(((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}))}else t.push(e)})),t}(n.ops.slice()).reduce(((e,n)=>{const a=Lh.Op.length(n);let i=n.attributes||{},o=!1,s=!1;if(null!=n.insert){if(r.retain(a),"string"==typeof n.insert){const r=n.insert;s=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(_h,e)[0]),this.scroll.insertAt(e,r);const[a,o]=this.scroll.line(e);let l=pd({},Rh(a));if(a instanceof Th){const[e]=a.descendant(Sd,o);e&&(l=pd(l,Rh(e)))}i=Lh.AttributeMap.diff(l,i)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return e;const a=null!=this.scroll.query(r,md.INLINE);if(a)(t<=e||this.scroll.descendant(_h,e)[0])&&(s=!0);else if(e>0){const[t,n]=this.scroll.descendant(Sd,e-1);if(t instanceof jh){"\n"!==t.value()[n]&&(o=!0)}else t instanceof Bd&&t.statics.scope===md.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),a){const[t]=this.scroll.descendant(Sd,e);if(t){const e=pd({},Rh(t));i=Lh.AttributeMap.diff(e,i)||{}}}}t+=a}else if(r.push(n),null!==n.retain&&"object"==typeof n.retain){const t=Object.keys(n.retain)[0];if(null==t)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(i).forEach((t=>{this.scroll.formatAt(e,a,t,i[t])}));const l=o?1:0,c=s?1:0;return t+=l+c,r.retain(l),r.delete(c),e+a+l+c}),0),r.reduce(((e,t)=>"number"==typeof t.delete?(this.scroll.deleteAt(e,t.delete),e):e+Lh.Op.length(t)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new Ah).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach((r=>{this.scroll.lines(e,Math.max(t,1)).forEach((e=>{e.format(r,n[r])}))})),this.scroll.optimize();const r=(new Ah).retain(e).retain(t,Su(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t,r,n[r])}));const r=(new Ah).retain(e).retain(t,Su(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new Ah)}getFormat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach((e=>{const[t]=e;t instanceof Th?n.push(t):t instanceof Sd&&r.push(t)})):(n=this.scroll.lines(e,t),r=this.scroll.descendants(Sd,e,t));const[a,i]=[n,r].map((e=>{const t=e.shift();if(null==t)return{};let n=Rh(t);for(;Object.keys(n).length>0;){const t=e.shift();if(null==t)return n;n=ef(Rh(t),n)}return n}));return{...a,...i}}getHTML(e,t){const[n,r]=this.scroll.line(e);if(n){const a=n.length();return!(n.length()>=r+t)||0===r&&t===a?Qh(this.scroll,e,t,!0):Qh(n,r,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((e=>"string"==typeof e.insert)).map((e=>e.insert)).join("")}insertContents(e,t){const n=nf(t),r=(new Ah).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new Ah).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t.length,r,n[r])})),this.update((new Ah).retain(e).insert(t,Su(n)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==Th.blotName)return!1;const t=e;return!(t.children.length>1)&&t.children.head instanceof Sh}removeFormat(e,t){const n=this.getText(e,t),[r,a]=this.scroll.line(e+t);let i=0,o=new Ah;null!=r&&(i=r.length()-a,o=r.delta().slice(a,a+i-1).insert("\n"));const s=this.getContents(e,t+i).diff((new Ah).insert(n).concat(o)),l=(new Ah).retain(e).concat(s);return this.applyDelta(l)}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(Yh)&&this.scroll.find(t[0].target)){const a=this.scroll.find(t[0].target),i=Rh(a),o=a.offset(this.scroll),s=t[0].oldValue.replace(qh.CONTENTS,""),l=(new Ah).insert(s),c=(new Ah).insert(a.value()),u=n&&{oldRange:rf(n.oldRange,-o),newRange:rf(n.newRange,-o)};e=(new Ah).retain(o).concat(l.diff(c,u)).reduce(((e,t)=>t.insert?e.insert(t.insert,i):e.push(t)),new Ah),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&hd(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}function Jh(e,t,n){if(0===e.length){const[e]=tf(n.pop());return t<=0?``:`${Jh([],t-1,n)}`}const[{child:r,offset:a,length:i,indent:o,type:s},...l]=e,[c,u]=tf(s);if(o>t)return n.push(s),o===t+1?`<${c}>${Qh(r,a,i)}${Jh(l,o,n)}`:`<${c}>
  • ${Jh(e,t+1,n)}`;const d=n[n.length-1];if(o===t&&s===d)return`
  • ${Qh(r,a,i)}${Jh(l,o,n)}`;const[h]=tf(n.pop());return`${Jh(e,t-1,n)}`}function Qh(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in e&&"function"==typeof e.html)return e.html(t,n);if(e instanceof jh)return Mh(e.value().slice(t,t+n));if(e instanceof Td){if("list-container"===e.statics.blotName){const r=[];return e.children.forEachAt(t,n,((e,t,n)=>{const a="formats"in e&&"function"==typeof e.formats?e.formats():{};r.push({child:e,offset:t,length:n,indent:a.indent||0,type:a.list})})),Jh(r,-1,[])}const a=[];if(e.children.forEachAt(t,n,((e,t,n)=>{a.push(Qh(e,t,n))})),r||"list"===e.statics.blotName)return a.join("");const{outerHTML:i,innerHTML:o}=e.domNode,[s,l]=i.split(`>${o}<`);return"${a.join("")}<${l}`:`${s}>${a.join("")}<${l}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function ef(e,t){return Object.keys(t).reduce(((n,r)=>{if(null==e[r])return n;const a=t[r];return a===e[r]?n[r]=a:Array.isArray(a)?a.indexOf(e[r])<0?n[r]=a.concat([e[r]]):n[r]=a:n[r]=[a,e[r]],n}),{})}function tf(e){const t="ordered"===e?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function nf(e){return e.reduce(((e,t)=>{if("string"==typeof t.insert){const n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)}),new Ah)}function rf(e,t){let{index:n,length:r}=e;return new Kh(n+t,r)}class af{static DEFAULTS={};constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=e,this.options=t}}const of="\ufeff";class sf extends Bd{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((e=>{this.contentNode.appendChild(e)})),this.leftGuard=document.createTextNode(of),this.rightGuard=document.createTextNode(of),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t,n=null;const r=e.data.split(of).join("");if(e===this.leftGuard)if(this.prev instanceof jh){const e=this.prev.length();this.prev.insertAt(e,r),n={startNode:this.prev.domNode,startOffset:e+r.length}}else t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this),n={startNode:t,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof jh?(this.next.insertAt(0,r),n={startNode:this.next.domNode,startOffset:r.length}):(t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this.next),n={startNode:t,startOffset:r.length}));return e.data=of,n}update(e,t){e.forEach((e=>{if("characterData"===e.type&&(e.target===this.leftGuard||e.target===this.rightGuard)){const n=this.restore(e.target);n&&(t.range=n)}}))}}class lf{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;!t||t instanceof sf||(this.emitter.emit(zh.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(zh.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(zh.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(zh.events.COMPOSITION_END,e),this.isComposing=!1}}class cf{static DEFAULTS={modules:{}};static themes={default:cf};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{null==this.modules[e]&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const uf=e=>{const t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},df=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},hf=(e,t,n,r,a,i)=>er?0:er?t-e>r-n?e+a-n:t-r+i:0,ff=["block","break","cursor","inline","scroll","text"],pf=Fh("quill"),mf=new yd;Td.uiClass="ql-ui";class vf{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:mf,theme:"default"};static events=zh.events;static sources=zh.sources;static version="2.0.2";static imports={delta:Ah,parchment:zd,"core/module":af,"core/theme":cf};static debug(e){!0===e&&(e="log"),Fh.level(e)}static find(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Bh.get(e)||mf.find(e,t)}static import(e){return null==this.imports[e]&&pf.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const e=arguments.length<=0?void 0:arguments[0],t=!!(arguments.length<=1?void 0:arguments[1]),n="attrName"in e?e.attrName:e.blotName;"string"==typeof n?this.register(`formats/${n}`,e,t):Object.keys(e).forEach((n=>{this.register(n,e[n],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[e]||n||pf.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&"boolean"!=typeof t&&"abstract"!==t.blotName&&mf.register(t),"function"==typeof t.register&&t.register(mf)}}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(e,t){const n=gf(e);if(!n)throw new Error("Invalid Quill container");const r=!t.theme||t.theme===vf.DEFAULTS.theme,a=r?cf:vf.import(`themes/${t.theme}`);if(!a)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...o}=vf.DEFAULTS,{modules:s,...l}=a.DEFAULTS;let c=bf(t.modules);null!=c&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});const u=pd({},bf(i),bf(s),c),d={...o,...yf(l),...yf(t)};let h=t.registry;h?t.formats&&pf.warn('Ignoring "formats" option because "registry" is specified'):h=t.formats?((e,t,n)=>{const r=new yd;return ff.forEach((e=>{const n=t.query(e);n&&r.register(n)})),e.forEach((e=>{let a=t.query(e);a||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let i=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,i+=1,i>100){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}})),r})(t.formats,d.registry,pf):d.registry;return{...d,registry:h,container:n,theme:a,modules:Object.entries(u).reduce(((e,t)=>{let[n,r]=t;if(!r)return e;const a=vf.import(`modules/${n}`);return null==a?(pf.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:pd({},a.DEFAULTS||{},r)}}),{}),bounds:gf(d.bounds)}}(e,t),this.container=this.options.container,null==this.container)return void pf.error("Invalid Quill container",e);this.options.debug&&vf.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Bh.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new zh;const r=Ud.blotName,a=this.options.registry.query(r);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Xh(this.scroll),this.selection=new Zh(this.scroll,this.emitter),this.composition=new lf(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(zh.events.EDITOR_CHANGE,(e=>{e===zh.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(zh.events.SCROLL_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;Ef.call(this,(()=>this.editor.update(null,t,a)),e)})),this.emitter.on(zh.events.SCROLL_EMBED_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;Ef.call(this,(()=>{const n=(new Ah).retain(e.offset(this)).retain({[e.statics.blotName]:t});return this.editor.update(n,[],a)}),vf.sources.USER)})),n){const e=this.clipboard.convert({html:`${n}


    `,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){const t=e;(e=document.createElement("div")).classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=wf(e,t,n),Ef.call(this,(()=>this.editor.deleteText(e,t)),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zh.sources.API;return Ef.call(this,(()=>{const n=this.getSelection(!0);let r=new Ah;if(null==n)return r;if(this.scroll.query(e,md.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else{if(0===n.length)return this.selection.format(e,t),r;r=this.editor.formatText(n.index,n.length,{[e]:t})}return this.setSelection(n,zh.sources.SILENT),r}),n)}formatLine(e,t,n,r,a){let i;return[e,t,i,a]=wf(e,t,n,r,a),Ef.call(this,(()=>this.editor.formatLine(e,t,i)),a,e,0)}formatText(e,t,n,r,a){let i;return[e,t,i,a]=wf(e,t,n,r,a),Ef.call(this,(()=>this.editor.formatText(e,t,i)),a,e,0)}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;const r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;return[e,t]=wf(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=wf(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=wf(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vf.sources.API;return Ef.call(this,(()=>this.editor.insertEmbed(e,t,n)),r,e)}insertText(e,t,n,r,a){let i;return[e,,i,a]=wf(e,0,n,r,a),Ef.call(this,(()=>this.editor.insertText(e,t,i)),a,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=wf(e,t,n),Ef.call(this,(()=>this.editor.removeFormat(e,t)),n,e)}scrollRectIntoView(e){((e,t)=>{const n=e.ownerDocument;let r=t,a=e;for(;a;){const e=a===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:uf(a),o=getComputedStyle(a),s=hf(r.left,r.right,t.left,t.right,df(o.scrollPaddingLeft),df(o.scrollPaddingRight)),l=hf(r.top,r.bottom,t.top,t.bottom,df(o.scrollPaddingTop),df(o.scrollPaddingBottom));if(s||l)if(e)n.defaultView?.scrollBy(s,l);else{const{scrollLeft:e,scrollTop:t}=a;l&&(a.scrollTop+=l),s&&(a.scrollLeft+=s);const n=a.scrollLeft-e,i=a.scrollTop-t;r={left:r.left-n,top:r.top-i,right:r.right-n,bottom:r.bottom-i}}a=e||"fixed"===o.position?null:(i=a).parentElement||i.getRootNode().host||null}var i})(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh.sources.API;return Ef.call(this,(()=>{e=new Ah(e);const t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(a)}),t)}setSelection(e,t,n){null==e?this.selection.setRange(null,t||vf.sources.API):([e,t,,n]=wf(e,t,n),this.selection.setRange(new Kh(Math.max(0,e),t),n),n!==zh.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh.sources.API;const n=(new Ah).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zh.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh.sources.API;return Ef.call(this,(()=>(e=new Ah(e),this.editor.applyDelta(e))),t,!0)}}function gf(e){return"string"==typeof e?document.querySelector(e):e}function bf(e){return Object.entries(e??{}).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:!0===r?{}:r}}),{})}function yf(e){return Object.fromEntries(Object.entries(e).filter((e=>void 0!==e[1])))}function Ef(e,t,n,r){if(!this.isEnabled()&&t===zh.sources.USER&&!this.allowReadOnlyEdits)return new Ah;let a=null==n?null:this.getSelection();const i=this.editor.delta,o=e();if(null!=a&&(!0===n&&(n=a.index),null==r?a=xf(a,o,t):0!==r&&(a=xf(a,n,r,t)),this.setSelection(a,zh.sources.SILENT)),o.length()>0){const e=[zh.events.TEXT_CHANGE,o,i,t];this.emitter.emit(zh.events.EDITOR_CHANGE,...e),t!==zh.sources.SILENT&&this.emitter.emit(...e)}return o}function wf(e,t,n,r,a){let i={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(a=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(a=r,r=n,n=t,t=0),"object"==typeof n?(i=n,a=r):"string"==typeof n&&(null!=r?i[n]=r:a=n),[e,t,i,a=a||zh.sources.API]}function xf(e,t,n,r){const a="number"==typeof n?n:0;if(null==e)return null;let i,o;return t&&"function"==typeof t.transformPosition?[i,o]=[e.index,e.index+e.length].map((e=>t.transformPosition(e,r!==zh.sources.USER))):[i,o]=[e.index,e.index+e.length].map((e=>e=0?e+a:Math.max(t,e+a))),new Kh(i,o-i)}class Nf extends Dd{}function kf(e){return e instanceof Th||e instanceof _h}function Of(e){return"function"==typeof e.updateContent}function Lf(e,t,n){n.reduce(((t,n)=>{const r=Lh.Op.length(n);let a=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const r=n.insert;e.insertAt(t,r);const[i]=e.descendant(Sd,t),o=Rh(i);a=Lh.AttributeMap.diff(o,a)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return t;e.insertAt(t,r,n.insert[r]);if(null!=e.scroll.query(r,md.INLINE)){const[n]=e.descendant(Sd,t),r=Rh(n);a=Lh.AttributeMap.diff(r,a)||{}}}return Object.keys(a).forEach((n=>{e.formatAt(t,r,n,a[n])})),t+r}),t)}const Af={scope:md.BLOCK,whitelist:["right","center","justify"]},Sf=new vd("align","align",Af),jf=new wd("align","ql-align",Af),Mf=new Nd("align","text-align",Af);class Cf extends Nd{value(e){let t=super.value(e);if(!t.startsWith("rgb("))return t;t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");return`#${t.split(",").map((e=>`00${parseInt(e,10).toString(16)}`.slice(-2))).join("")}`}}const Tf=new wd("color","ql-color",{scope:md.INLINE}),_f=new Cf("color","color",{scope:md.INLINE}),Pf=new wd("background","ql-bg",{scope:md.INLINE}),Rf=new Cf("background","background-color",{scope:md.INLINE});class qf extends Nf{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((e=>e.length()<=1?"":e.domNode.innerText)).join("\n").slice(e,e+t)}html(e,t){return`
    \n${Mh(this.code(e,t))}\n
    `}}class If extends Th{static TAB=" ";static register(){vf.register(qf)}}class Df extends Ch{}Df.blotName="code",Df.tagName="CODE",If.blotName="code-block",If.className="ql-code-block",If.tagName="DIV",qf.blotName="code-block-container",qf.className="ql-code-block-container",qf.tagName="DIV",qf.allowedChildren=[If],If.allowedChildren=[jh,Sh,qh],If.requiredContainer=qf;const Bf={scope:md.BLOCK,whitelist:["rtl"]},$f=new vd("direction","dir",Bf),Hf=new wd("direction","ql-direction",Bf),Uf=new Nd("direction","direction",Bf),Ff={scope:md.INLINE,whitelist:["serif","monospace"]},Vf=new wd("font","ql-font",Ff);const zf=new class extends Nd{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",Ff),Wf=new wd("size","ql-size",{scope:md.INLINE,whitelist:["small","large","huge"]}),Kf=new Nd("size","font-size",{scope:md.INLINE,whitelist:["10px","18px","32px"]}),Zf=Fh("quill:keyboard"),Gf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Yf extends af{static match(e,t){return!["altKey","ctrlKey","metaKey","shiftKey"].some((n=>!!t[n]!==e[n]&&null!==t[n]))&&(t.key===e.key||t.key===e.which)}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){if("string"==typeof e||"number"==typeof e)e={key:e};else{if("object"!=typeof e)return null;e=Su(e)}e.shortKey&&(e[Gf]=e.shortKey,delete e.shortKey);return e}(e);if(null==r)return void Zf.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n});(Array.isArray(r.key)?r.key:[r.key]).forEach((e=>{const a={...r,key:e,...t,...n};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing)return;if(229===e.keyCode&&("Enter"===e.key||"Backspace"===e.key))return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((t=>Yf.match(e,t)));if(0===t.length)return;const n=vf.find(e.target,!0);if(n&&n.scroll!==this.quill.scroll)return;const r=this.quill.getSelection();if(null==r||!this.quill.hasFocus())return;const[a,i]=this.quill.getLine(r.index),[o,s]=this.quill.getLeaf(r.index),[l,c]=0===r.length?[o,s]:this.quill.getLeaf(r.index+r.length),u=o instanceof Vd?o.value().slice(0,s):"",d=l instanceof Vd?l.value().slice(c):"",h={collapsed:0===r.length,empty:0===r.length&&a.length()<=1,format:this.quill.getFormat(r),line:a,offset:i,prefix:u,suffix:d,event:e};t.some((e=>{if(null!=e.collapsed&&e.collapsed!==h.collapsed)return!1;if(null!=e.empty&&e.empty!==h.empty)return!1;if(null!=e.offset&&e.offset!==h.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((e=>null==h.format[e])))return!1}else if("object"==typeof e.format&&!Object.keys(e.format).every((t=>!0===e.format[t]?null!=h.format[t]:!1===e.format[t]?null==h.format[t]:hd(e.format[t],h.format[t]))))return!1;return!(null!=e.prefix&&!e.prefix.test(h.prefix))&&(!(null!=e.suffix&&!e.suffix.test(h.suffix))&&!0!==e.handler.call(this,r,h,e))}))&&e.preventDefault()}))}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(0===e.index||this.quill.getLength()<=1)return;let r={};const[a]=this.quill.getLine(e.index);let i=(new Ah).retain(e.index-n).delete(n);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(t){if(!("block"===t.statics.blotName&&t.length()<=1)){const t=a.formats(),n=this.quill.getFormat(e.index-1,1);if(r=Lh.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){const t=(new Ah).retain(e.index+a.length()-2).retain(1,r);i=i.compose(t)}}}}this.quill.updateContents(i,vf.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={};const[a]=this.quill.getLine(e.index);let i=(new Ah).retain(e.index).delete(n);if(t.offset>=a.length()-1){const[t]=this.quill.getLine(e.index+1);if(t){const n=a.formats(),o=this.quill.getFormat(e.index,1);r=Lh.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(i=i.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(i,vf.sources.USER),this.quill.focus()}handleDeleteRange(e){np({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce(((e,n)=>(this.quill.scroll.query(n,md.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e)),{}),r=(new Ah).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,vf.sources.USER),this.quill.setSelection(e.index+1,vf.sources.SILENT),this.quill.focus()}}const Xf={bindings:{bold:ep("bold"),italic:ep("italic"),underline:ep("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","+1",vf.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","-1",vf.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){null!=t.format.indent?this.quill.format("indent","-1",vf.sources.USER):null!=t.format.list&&this.quill.format("list",!1,vf.sources.USER)}},"indent code-block":Jf(!0),"outdent code-block":Jf(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,vf.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const n=(new Ah).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,vf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,vf.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,vf.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,vf.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},a=(new Ah).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(a,vf.sources.USER),this.quill.setSelection(e.index+1,vf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[n,r]=this.quill.getLine(e.index),a=(new Ah).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(a,vf.sources.USER),this.quill.setSelection(e.index+1,vf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[n,r,a,i]=t.getTable(e),o=function(e,t,n,r){if(null==t.prev&&null==t.next)return null==n.prev&&null==n.next?0===r?-1:1:null==n.prev?-1:1;if(null==t.prev)return-1;if(null==t.next)return 1;return null}(0,r,a,i);if(null==o)return;let s=n.offset();if(o<0){const t=(new Ah).retain(s).insert("\n");this.quill.updateContents(t,vf.sources.USER),this.quill.setSelection(e.index+1,e.length,vf.sources.SILENT)}else if(o>0){s+=n.length();const e=(new Ah).retain(s).insert("\n");this.quill.updateContents(e,vf.sources.USER),this.quill.setSelection(s,vf.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:n,line:r}=t,a=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(a-1,vf.sources.USER):this.quill.setSelection(a+r.length(),vf.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=t.prefix,[r,a]=this.quill.getLine(e.index);if(a>n)return!0;let i;switch(t.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(e.index," ",vf.sources.USER),this.quill.history.cutoff();const o=(new Ah).retain(e.index-a).delete(n+1).retain(r.length()-2-a).retain(1,{list:i});return this.quill.updateContents(o,vf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,vf.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,n]=this.quill.getLine(e.index);let r=2,a=t;for(;null!=a&&a.length()<=1&&a.formats()["code-block"];)if(a=a.prev,r-=1,r<=0){const r=(new Ah).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,vf.sources.USER),this.quill.setSelection(e.index-1,vf.sources.SILENT),!1}return!0}},"embed left":Qf("ArrowLeft",!1),"embed left shift":Qf("ArrowLeft",!0),"embed right":Qf("ArrowRight",!1),"embed right shift":Qf("ArrowRight",!0),"table down":tp(!1),"table up":tp(!0)}};function Jf(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n;const a=this.quill.scroll.query("code-block"),{TAB:i}=a;if(0===t.length&&!r.shiftKey)return this.quill.insertText(t.index,i,vf.sources.USER),void this.quill.setSelection(t.index+i.length,vf.sources.SILENT);const o=0===t.length?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:s,length:l}=t;o.forEach(((t,n)=>{e?(t.insertAt(0,i),0===n?s+=i.length:l+=i.length):t.domNode.textContent.startsWith(i)&&(t.deleteAt(0,i.length),0===n?s-=i.length:l-=i.length)})),this.quill.update(vf.sources.USER),this.quill.setSelection(s,l,vf.sources.SILENT)}}}function Qf(e,t){return{key:e,shiftKey:t,altKey:null,["ArrowLeft"===e?"prefix":"suffix"]:/^$/,handler(n){let{index:r}=n;"ArrowRight"===e&&(r+=n.length+1);const[a]=this.quill.getLeaf(r);return!(a instanceof Bd)||("ArrowLeft"===e?t?this.quill.setSelection(n.index-1,n.length+1,vf.sources.USER):this.quill.setSelection(n.index-1,vf.sources.USER):t?this.quill.setSelection(n.index,n.length+1,vf.sources.USER):this.quill.setSelection(n.index+n.length+1,vf.sources.USER),!1)}}}function ep(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],vf.sources.USER)}}}function tp(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){const r=e?"prev":"next",a=n.line,i=a.parent[r];if(null!=i){if("table-row"===i.statics.blotName){let e=i.children.head,t=a;for(;null!=t.prev;)t=t.prev,e=e.next;const r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,vf.sources.USER)}}else{const t=a.table()[r];null!=t&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,vf.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,vf.sources.USER))}return!1}}}function np(e){let{quill:t,range:n}=e;const r=t.getLines(n);let a={};if(r.length>1){const e=r[0].formats(),t=r[r.length-1].formats();a=Lh.AttributeMap.diff(t,e)||{}}t.deleteText(n,vf.sources.USER),Object.keys(a).length>0&&t.formatLine(n.index,1,a,vf.sources.USER),t.setSelection(n.index,vf.sources.SILENT)}Yf.DEFAULTS=Xf;const rp=/font-weight:\s*normal/,ap=["P","OL","UL"],ip=e=>e&&ap.includes(e.tagName);const op=/\bmso-list:[^;]*ignore/i,sp=/\bmso-list:[^;]*\bl(\d+)/i,lp=/\bmso-list:[^;]*\blevel(\d+)/i,cp=e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach((e=>{(e.getAttribute("style")||"").match(op)?n.push(e):r.push(e)})),n.forEach((e=>e.parentNode?.removeChild(e)));const a=e.documentElement.innerHTML,i=r.map((e=>((e,t)=>{const n=e.getAttribute("style"),r=n?.match(sp);if(!r)return null;const a=Number(r[1]),i=n?.match(lp),o=i?Number(i[1]):1,s=new RegExp(`@list l${a}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=t.match(s);return{id:a,indent:o,type:l&&"bullet"===l[1]?"bullet":"ordered",element:e}})(e,a))).filter((e=>e));for(;i.length;){const e=[];let t=i.shift();for(;t;)e.push(t),t=i.length&&i[0]?.element===t.element.nextElementSibling&&i[0].id===t.id?i.shift():null;const n=document.createElement("ul");e.forEach((e=>{const t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class","ql-indent-"+(e.indent-1)),t.innerHTML=e.element.innerHTML,n.appendChild(t)}));const r=e[0]?.element,{parentNode:a}=r??{};r&&a?.replaceChild(n,r),e.slice(1).forEach((e=>{let{element:t}=e;a?.removeChild(t)}))}};const up=[function(e){"urn:schemas-microsoft-com:office:word"===e.documentElement.getAttribute("xmlns:w")&&cp(e)},function(e){e.querySelector('[id^="docs-internal-guid-"]')&&((e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(rp))).forEach((t=>{const n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)}))})(e),(e=>{Array.from(e.querySelectorAll("br")).filter((e=>ip(e.previousElementSibling)&&ip(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))})(e))}],dp=Fh("quill:clipboard"),hp=[[Node.TEXT_NODE,function(e,t,n){let r=e.data;if("O:P"===e.parentElement?.tagName)return t.insert(r.trim());if(!yp(e)){if(0===r.trim().length&&r.includes("\n")&&!function(e,t){return e.previousElementSibling&&e.nextElementSibling&&!gp(e.previousElementSibling,t)&&!gp(e.nextElementSibling,t)}(e,n))return t;const a=(e,t)=>{const n=t.replace(/[^\u00a0]/g,"");return n.length<1&&e?" ":n};r=r.replace(/\r\n/g," ").replace(/\n/g," "),r=r.replace(/\s\s+/g,a.bind(a,!0)),(null==e.previousSibling&&null!=e.parentElement&&gp(e.parentElement,n)||e.previousSibling instanceof Element&&gp(e.previousSibling,n))&&(r=r.replace(/^\s+/,a.bind(a,!1))),(null==e.nextSibling&&null!=e.parentElement&&gp(e.parentElement,n)||e.nextSibling instanceof Element&&gp(e.nextSibling,n))&&(r=r.replace(/\s+$/,a.bind(a,!1)))}return t.insert(r)}],[Node.TEXT_NODE,xp],["br",function(e,t){vp(t,"\n")||t.insert("\n");return t}],[Node.ELEMENT_NODE,xp],[Node.ELEMENT_NODE,function(e,t,n){const r=n.query(e);if(null==r)return t;if(r.prototype instanceof Bd){const t={},a=r.value(e);if(null!=a)return t[r.blotName]=a,(new Ah).insert(t,r.formats(e,n))}else if(r.prototype instanceof qd&&!vp(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&"function"==typeof r.formats)return mp(t,r.blotName,r.formats(e,n),n);return t}],[Node.ELEMENT_NODE,function(e,t,n){const r=vd.keys(e),a=wd.keys(e),i=Nd.keys(e),o={};return r.concat(a).concat(i).forEach((t=>{let r=n.query(t,md.ATTRIBUTE);null!=r&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=fp[t],null==r||r.attrName!==t&&r.keyName!==t||(o[r.attrName]=r.value(e)||void 0),r=pp[t],null==r||r.attrName!==t&&r.keyName!==t||(r=pp[t],o[r.attrName]=r.value(e)||void 0))})),Object.entries(o).reduce(((e,t)=>{let[r,a]=t;return mp(e,r,a,n)}),t)}],[Node.ELEMENT_NODE,function(e,t,n){const r={},a=e.style||{};"italic"===a.fontStyle&&(r.italic=!0);"underline"===a.textDecoration&&(r.underline=!0);"line-through"===a.textDecoration&&(r.strike=!0);(a.fontWeight?.startsWith("bold")||parseInt(a.fontWeight,10)>=700)&&(r.bold=!0);if(t=Object.entries(r).reduce(((e,t)=>{let[r,a]=t;return mp(e,r,a,n)}),t),parseFloat(a.textIndent||0)>0)return(new Ah).insert("\t").concat(t);return t}],["li",function(e,t,n){const r=n.query(e);if(null==r||"list"!==r.blotName||!vp(t,"\n"))return t;let a=-1,i=e.parentNode;for(;null!=i;)["OL","UL"].includes(i.tagName)&&(a+=1),i=i.parentNode;return a<=0?t:t.reduce(((e,t)=>t.insert?t.attributes&&"number"==typeof t.attributes.indent?e.push(t):e.insert(t.insert,{indent:a,...t.attributes||{}}):e),new Ah)}],["ol, ul",function(e,t,n){const r=e;let a="OL"===r.tagName?"ordered":"bullet";const i=r.getAttribute("data-checked");i&&(a="true"===i?"checked":"unchecked");return mp(t,"list",a,n)}],["pre",function(e,t,n){const r=n.query("code-block"),a=!r||!("formats"in r)||"function"!=typeof r.formats||r.formats(e,n);return mp(t,"code-block",a,n)}],["tr",function(e,t,n){const r="TABLE"===e.parentElement?.tagName?e.parentElement:e.parentElement?.parentElement;if(null!=r){return mp(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n)}return t}],["b",wp("bold")],["i",wp("italic")],["strike",wp("strike")],["style",function(){return new Ah}]],fp=[Sf,$f].reduce(((e,t)=>(e[t.keyName]=t,e)),{}),pp=[Mf,Rf,_f,Uf,zf,Kf].reduce(((e,t)=>(e[t.keyName]=t,e)),{});function mp(e,t,n,r){return r.query(t)?e.reduce(((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);const a=n?{[t]:n}:{};return e.insert(r.insert,{...a,...r.attributes})}),new Ah):e}function vp(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.lengthr(t,n,e)),new Ah):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce(((i,o)=>{let s=Ep(e,o,n,r,a);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce(((t,n)=>n(o,t,e)),s),s=(a.get(o)||[]).reduce(((t,n)=>n(o,t,e)),s)),i.concat(s)}),new Ah):new Ah}function wp(e){return(t,n,r)=>mp(n,e,!0,r)}function xp(e,t,n){if(!vp(t,"\n")){if(gp(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;null!=r;){if(gp(r,n))return t.insert("\n");const e=n.query(r);if(e&&e.prototype instanceof _h)return t.insert("\n");r=r.firstChild}}}return t}function Np(e,t){let n=t;for(let t=e.length-1;t>=0;t-=1){const r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&kp(r.range,n)},n=r.delta.transform(n),0===e[t].delta.length()&&e.splice(t,1)}}function kp(e,t){if(!e)return e;const n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}class Op extends af{constructor(e,t){super(e,t),e.root.addEventListener("drop",(t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}const r=n&&e.selection.normalizeNative(n);if(r){const n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}}))}upload(e,t){const n=[];Array.from(t).forEach((e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)})),n.length>0&&this.options.handler.call(this,e,n)}}Op.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;const n=t.map((e=>new Promise((t=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}))));Promise.all(n).then((t=>{const n=t.reduce(((e,t)=>e.insert({image:t})),(new Ah).retain(e.index).delete(e.length));this.quill.updateContents(n,zh.sources.USER),this.quill.setSelection(e.index+t.length,zh.sources.SILENT)}))}};const Lp=["insertText","insertReplacementText"];const Ap=/Mac/i.test(navigator.platform);vf.register({"blots/block":Th,"blots/block/embed":_h,"blots/break":Sh,"blots/container":Nf,"blots/cursor":qh,"blots/embed":sf,"blots/inline":Ch,"blots/scroll":class extends Ud{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Th;static allowedChildren=[Th,_h,Nf];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(e=>this.handleDragStart(e)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(zh.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(zh.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(zh.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,r]=this.line(e),[a]=this.line(e+t);if(super.deleteAt(e,t),null!=a&&n!==a&&r>0){if(n instanceof _h||a instanceof _h)return void this.optimize();const e=a.children.head instanceof Sh?null:a.children.head;n.moveChildren(a,e),n.remove()}this.optimize()}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(null==n||null==this.scroll.query(t,md.BLOCK)){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),null==n&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{const e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===md.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat((new Ah).insert("\n"))),r=n.pop();if(null==r)return;this.batchStart();const a=n.shift();if(a){const t="block"===a.type&&(0===a.delta.length()||!this.descendant(_h,e)[0]&&e{this.formatAt(i-1,1,e,s[e])})),e=i}let[i,o]=this.children.find(e);if(n.length&&(i&&(i=i.split(o),o=0),n.forEach((e=>{if("block"===e.type){Lf(this.createBlock(e.attributes,i||void 0),0,e.delta)}else{const t=this.create(e.key,e.value);this.insertBefore(t,i||void 0),Object.keys(e.attributes).forEach((n=>{t.format(n,e.attributes[n])}))}}))),"block"===r.type&&r.delta.length()){Lf(this,i?i.offset(i.scroll)+o:this.length(),r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,r]=t;return n instanceof Sd?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(kf,e)}lines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(e,t,r)=>{let a=[],i=r;return e.children.forEachAt(t,r,((e,t,r)=>{kf(e)?a.push(e):e instanceof Dd&&(a=a.concat(n(e,t,i))),i-=r})),a};return n(this,e,t)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(zh.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch)return void(Array.isArray(e)&&(this.batch=this.batch.concat(e)));let t=zh.sources.USER;"string"==typeof e&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),(e=e.filter((e=>{let{target:t}=e;const n=this.find(t,!0);return n&&!Of(n)}))).length>0&&this.emitter.emit(zh.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(zh.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[r]=this.descendant((e=>e instanceof _h),e);r&&r.statics.blotName===t&&Of(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new Ah;return e.forEach((e=>{const r=e?.insert;if(r)if("string"==typeof r){const a=r.split("\n");a.slice(0,-1).forEach((r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new Ah}));const i=a[a.length-1];i&&n.insert(i,e.attributes)}else{const a=Object.keys(r)[0];if(!a)return;this.query(a,md.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new Ah,t.push({type:"blockEmbed",key:a,value:r[a],attributes:e.attributes??{}}))}})),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const r={};Object.entries(e).forEach((e=>{let[t,a]=e;null!=this.query(t,md.BLOCK&md.BLOT)?n=t:r[t]=a}));const a=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(a,t||void 0);const i=a.length();return Object.entries(r).forEach((e=>{let[t,n]=e;a.formatAt(0,i,t,n)})),a}},"blots/text":jh,"modules/clipboard":class extends af{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(e=>this.onCaptureCopy(e,!1))),this.quill.root.addEventListener("cut",(e=>this.onCaptureCopy(e,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],hp.concat(this.options.matchers??[]).forEach((e=>{let[t,n]=e;this.addMatcher(t,n)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r[If.blotName])return(new Ah).insert(n||"",{[If.blotName]:r[If.blotName]});if(!t)return(new Ah).insert(n||"",r);const a=this.convertHTML(t);return vp(a,"\n")&&(null==a.ops[a.ops.length-1].attributes||r.table)?a.compose((new Ah).retain(a.length()-1).delete(1)):a}normalizeHTML(e){(e=>{e.documentElement&&up.forEach((t=>{t(e)}))})(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,r=new WeakMap,[a,i]=this.prepareMatching(n,r);return Ep(this.quill.scroll,n,a,i,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vf.sources.API;if("string"==typeof e){const n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,vf.sources.SILENT)}else{const r=this.convert({html:t,text:""});this.quill.updateContents((new Ah).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),vf.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(null==n)return;const{html:r,text:a}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",a),e.clipboardData?.setData("text/html",r),t&&np({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((e=>"#"!==e[0])).join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(null==t)return;const n=e.clipboardData?.getData("text/html");let r=e.clipboardData?.getData("text/plain");if(!n&&!r){const t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}const a=Array.from(e.clipboardData?.files||[]);if(!n&&a.length>0)this.quill.uploader.upload(t,a);else{if(n&&a.length>0){const e=(new DOMParser).parseFromString(n,"text/html");if(1===e.body.childElementCount&&"IMG"===e.body.firstElementChild?.tagName)return void this.quill.uploader.upload(t,a)}this.onPaste(t,{html:n,text:r})}}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t;const a=this.quill.getFormat(e.index),i=this.convert({text:n,html:r},a);dp.log("onPaste",i,{text:n,html:r});const o=(new Ah).retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,vf.sources.USER),this.quill.setSelection(o.length()-e.length,vf.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],r=[];return this.matchers.forEach((a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach((e=>{if(t.has(e)){const n=t.get(e);n?.push(o)}else t.set(e,[o])}))}})),[n,r]}},"modules/history":class extends af{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(vf.events.EDITOR_CHANGE,((e,t,n,r)=>{e===vf.events.SELECTION_CHANGE?t&&r!==vf.sources.SILENT&&(this.currentRange=t):e===vf.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&r!==vf.sources.USER?this.transform(t):this.record(t,n)),this.currentRange=kp(this.currentRange,t))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(e=>{"historyUndo"===e.inputType?(this.undo(),e.preventDefault()):"historyRedo"===e.inputType&&(this.redo(),e.preventDefault())}))}change(e,t){if(0===this.stack[e].length)return;const n=this.stack[e].pop();if(!n)return;const r=this.quill.getContents(),a=n.delta.invert(r);this.stack[t].push({delta:a,range:kp(n.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,vf.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(0===e.ops.length)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=a;0!==n.length()&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Np(this.stack.undo,e),Np(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,vf.sources.USER);else{const t=function(e,t){const n=t.reduce(((e,t)=>e+(t.delete||0)),0);let r=t.length()-n;(function(e,t){const n=t.ops[t.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some((t=>null!=e.query(t,md.BLOCK)));return!1})(e,t)&&(r-=1);return r}(this.quill.scroll,e.delta);this.quill.setSelection(t,vf.sources.USER)}}},"modules/keyboard":Yf,"modules/uploader":Op,"modules/input":class extends af{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(e=>{this.handleBeforeInput(e)})),/Android/i.test(navigator.userAgent)||e.on(vf.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){np({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===e.length)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new Ah).retain(e.index).insert(t,n),vf.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,vf.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Lp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||!0===t.collapsed)return;const n=function(e){if("string"==typeof e.data)return e.data;if(e.dataTransfer?.types.includes("text/plain"))return e.dataTransfer.getData("text/plain");return null}(e);if(null==n)return;const r=this.quill.selection.normalizeNative(t),a=r?this.quill.selection.normalizedToRange(r):null;a&&this.replaceText(a,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}},"modules/uiNode":class extends af{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof Td&&n.uiNode))return!0;const a="rtl"===getComputedStyle(n.domNode).direction;return!!(a&&"ArrowRight"!==r.key||!a&&"ArrowLeft"!==r.key)||(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),vf.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&(e=>"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"Home"===e.key||!(!Ap||"a"!==e.key||!0!==e.ctrlKey))(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(!0!==t.collapsed||0!==t.startOffset)return;const n=this.quill.scroll.find(t.startContainer);if(!(n instanceof Td&&n.uiNode))return;const r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}}});const Sp=new class extends wd{add(e,t){let n=0;if("+1"===t||"-1"===t){const r=this.value(e)||0;n="+1"===t?r+1:r-1}else"number"==typeof t&&(n=t);return 0===n?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:md.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class jp extends Nf{}jp.blotName="list-container",jp.tagName="OL";class Mp extends Th{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){vf.register(jp)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;const r=this.statics.formats(t,e);"checked"===r?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===r&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Mp.blotName="list",Mp.tagName="LI",jp.allowedChildren=[Mp],Mp.requiredContainer=jp;class Cp extends Ch{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}let Tp=class extends Ch{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return _p(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("href",this.constructor.sanitize(t)):super.format(e,t)}};function _p(e,t){const n=document.createElement("a");n.href=e;const r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}const Pp=["alt","height","width"];const Rp=["height","width"];const qp=new wd("code-token","hljs",{scope:md.INLINE});class Ip extends Ch{static formats(e,t){for(;null!=e&&e!==t.domNode;){if(e.classList&&e.classList.contains(If.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),qp.add(this.domNode,n)}format(e,t){e!==Ip.blotName?super.format(e,t):t?qp.add(this.domNode,t):(qp.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),qp.value(this.domNode)||this.unwrap()}}Ip.blotName="code-token",Ip.className="ql-token";class Dp extends If{static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Ip.blotName,!1),super.replaceWith(e,t)}}class Bp extends qf{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Dp.blotName&&(this.forceNext=!0,this.children.forEach((n=>{n.format(e,t)})))}formatAt(e,t,n,r){n===Dp.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=`${Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).map((e=>e.textContent)).join("\n")}\n`,r=Dp.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||null==this.cachedText){const t=this.children.reduce(((e,t)=>e.concat(Ph(t,!1))),new Ah),a=e(n,r);t.diff(a).reduce(((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach((t=>{[Dp.blotName,Ip.blotName].includes(t)&&this.formatAt(e,n,t,r[t])})),e+n):e}),0)}this.cachedText=n,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`
    \n${Mh(this.code(e,t))}\n
    `}optimize(e){if(super.optimize(e),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const e=Dp.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Bp.allowedChildren=[Dp],Dp.requiredContainer=Bp,Dp.allowedChildren=[Ip,qh,jh,Sh];class $p extends af{static register(){vf.register(Ip,!0),vf.register(Dp,!0),vf.register(Bp,!0)}constructor(e,t){if(super(e,t),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((e,t)=>{let{key:n}=t;return e[n]=!0,e}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(vf.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Bp))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((e=>{let{key:n,label:r}=e;const a=t.ownerDocument.createElement("option");a.textContent=r,a.setAttribute("value",n),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(Dp.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),null==e.uiNode&&(e.attachUI(t),e.children.head&&(t.value=Dp.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(vf.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(vf.sources.USER);const n=this.quill.getSelection();(null==e?this.quill.scroll.descendants(Bp):[e]).forEach((e=>{e.highlight(this.highlightBlot,t)})),this.quill.update(vf.sources.SILENT),null!=n&&this.quill.setSelection(n,vf.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(t=this.languages[t]?t:"plain","plain"===t)return Mh(e).split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[If.blotName]:t}),e.insert(n))),new Ah);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(If.className),n.innerHTML=((e,t,n)=>{if("string"==typeof e.versionString){const r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value})(this.options.hljs,t,e),Ep(this.quill.scroll,n,[(e,t)=>{const n=qp.value(e);return n?t.compose((new Ah).retain(t.length(),{[Ip.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[If.blotName]:t}),e.insert(n))),n)],new WeakMap)}}$p.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class Hp extends Th{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",zp()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Hp.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Up extends Nf{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach((e=>{if(null==e.next)return;const t=e.formats(),n=e.next.formats();if(t.table!==n.table){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class Fp extends Nf{static blotName="table-body";static tagName="TBODY"}class Vp extends Nf{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Up),t=e.reduce(((e,t)=>Math.max(t.children.length,e)),0);e.forEach((e=>{new Array(t-e.children.length).fill(0).forEach((()=>{let t;null!=e.children.head&&(t=Hp.formats(e.children.head.domNode));const n=this.scroll.create(Hp.blotName,t);e.appendChild(n),n.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(Fp);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e);null!=n&&n.remove()}))}insertColumn(e){const[t]=this.descendant(Fp);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e),r=Hp.formats(t.children.head.domNode),a=this.scroll.create(Hp.blotName,r);t.insertBefore(a,n)}))}insertRow(e){const[t]=this.descendant(Fp);if(null==t||null==t.children.head)return;const n=zp(),r=this.scroll.create(Up.blotName);t.children.head.children.forEach((()=>{const e=this.scroll.create(Hp.blotName,n);r.appendChild(e)}));const a=t.children.at(e);t.insertBefore(r,a)}rows(){const e=this.children.head;return null==e?[]:e.children.map((e=>e))}}function zp(){return`row-${Math.random().toString(36).slice(2,6)}`}Vp.allowedChildren=[Fp],Fp.requiredContainer=Vp,Fp.allowedChildren=[Up],Up.requiredContainer=Fp,Up.allowedChildren=[Hp],Hp.requiredContainer=Up;const Wp=Fh("quill:toolbar");class Kp extends af{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const t=document.createElement("div");t.setAttribute("role","toolbar"),function(e,t){Array.isArray(t[0])||(t=[t]);t.forEach((t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach((e=>{if("string"==typeof e)Zp(n,e);else{const t=Object.keys(e)[0],r=e[t];Array.isArray(r)?function(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach((e=>{const t=document.createElement("option");!1!==e?t.setAttribute("value",String(e)):t.setAttribute("selected","selected"),r.appendChild(t)})),e.appendChild(r)}(n,t,r):Zp(n,t,r)}})),e.appendChild(n)}))}(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((e=>{const t=this.options.handlers?.[e];t&&this.addHandler(e,t)})),Array.from(this.container.querySelectorAll("button, select")).forEach((e=>{this.attach(e)})),this.quill.on(vf.events.EDITOR_CHANGE,(()=>{const[e]=this.quill.selection.getRange();this.update(e)}))):Wp.error("Container required for toolbar",this.options)}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void Wp.warn("ignoring attaching to nonexistent format",t,e);const n="SELECT"===e.tagName?"change":"click";e.addEventListener(n,(n=>{let r;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];r=!t.hasAttribute("selected")&&(t.value||!1)}else r=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),n.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(null!=this.handlers[t])this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof Bd){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new Ah).retain(a.index).delete(a.length).insert({[t]:r}),vf.sources.USER)}else this.quill.format(t,r,vf.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=null==e?{}:this.quill.getFormat(e);this.controls.forEach((n=>{const[r,a]=n;if("SELECT"===a.tagName){let n=null;if(null==e)n=null;else if(null==t[r])n=a.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];"string"==typeof e&&(e=e.replace(/"/g,'\\"')),n=a.querySelector(`option[value="${e}"]`)}null==n?(a.value="",a.selectedIndex=-1):n.selected=!0}else if(null==e)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const e=t[r],n=e===a.getAttribute("value")||null!=e&&e.toString()===a.getAttribute("value")||null==e&&!a.getAttribute("value");a.classList.toggle("ql-active",n),a.setAttribute("aria-pressed",n.toString())}else{const e=null!=t[r];a.classList.toggle("ql-active",e),a.setAttribute("aria-pressed",e.toString())}}))}}function Zp(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),null!=n?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}Kp.DEFAULTS={},Kp.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(null!=e)if(0===e.length){const e=this.quill.getFormat();Object.keys(e).forEach((e=>{null!=this.quill.scroll.query(e,md.INLINE)&&this.quill.format(e,!1,vf.sources.USER)}))}else this.quill.removeFormat(e.index,e.length,vf.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();"rtl"===e&&null==t?this.quill.format("align","right",vf.sources.USER):e||"right"!==t||this.quill.format("align",!1,vf.sources.USER),this.quill.format("direction",e,vf.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if("+1"===e||"-1"===e){let t="+1"===e?1:-1;"rtl"===n.direction&&(t*=-1),this.quill.format("indent",r+t,vf.sources.USER)}},link(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,vf.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,vf.sources.USER):this.quill.format("list","unchecked",vf.sources.USER):this.quill.format("list",e,vf.sources.USER)}}};const Gp='';var Yp={align:{"":'',center:'',right:'',justify:''},background:'',blockquote:'',bold:'',clean:'',code:Gp,"code-block":Gp,color:'',direction:{"":'',rtl:''},formula:'',header:{1:'',2:'',3:'',4:'',5:'',6:''},italic:'',image:'',indent:{"+1":'',"-1":''},link:'',list:{bullet:'',check:'',ordered:''},script:{sub:'',super:''},strike:'',table:'',underline:'',video:''};let Xp=0;function Jp(e,t){e.setAttribute(t,`${!("true"===e.getAttribute(t))}`)}class Qp{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(()=>{this.togglePicker()})),this.label.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Jp(this.label,"aria-expanded"),Jp(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault()}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML='',e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Xp}`,Xp+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const n=this.buildItem(t);e.appendChild(n),!0===t.selected&&this.selectItem(n)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);const t=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class em extends Qp{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((e=>{e.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=r:n.style.fill=r)}}class tm extends Qp{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((e=>{e.innerHTML=t[e.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}class nm{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(e=>{const{overflowY:t}=getComputedStyle(e,null);return"visible"!==t&&"clip"!==t})(this.quill.root)&&this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=-1*this.quill.root.scrollTop+"px"})),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>r.right&&(i=r.right-a.right,this.root.style.left=`${t+i}px`),a.leftr.bottom){const t=a.bottom-a.top,r=e.bottom-e.top+t;this.root.style.top=n-r+"px",this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const rm=[!1,"center","right","justify"],am=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],im=[!1,"serif","monospace"],om=["1","2","3",!1],sm=["small",!1,"large","huge"];class lm extends cf{constructor(e,t){super(e,t);const n=t=>{document.body.contains(e.root)?(null==this.tooltip||this.tooltip.root.contains(t.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((e=>{e.container.contains(t.target)||e.close()}))):document.body.removeEventListener("click",n)};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return"toolbar"===e&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((e=>{(e.getAttribute("class")||"").split(/\s+/).forEach((n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{const r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((e=>{if(e.classList.contains("ql-align")&&(null==e.querySelector("option")&&um(e,rm),"object"==typeof t.align))return new tm(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){const n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&um(e,am,"background"===n?"#ffffff":"#000000"),new em(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?um(e,im):e.classList.contains("ql-header")?um(e,om):e.classList.contains("ql-size")&&um(e,sm)),new Qp(e)}));this.quill.on(zh.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((e=>{e.update()}))}))}}lm.DEFAULTS=pd({},cf.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");null==e&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",(()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""})),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class cm extends nm{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{"Enter"===e.key?(this.save(),e.preventDefault()):"Escape"===e.key&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,zh.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,zh.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=function(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t)return`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`;if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`;return e}(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(null!=t){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,zh.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",zh.sources.USER),this.quill.setSelection(n+2,zh.sources.USER)}break}}this.textbox.value="",this.hide()}}function um(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((t=>{const r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)}))}const dm=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class hm extends cm{static TEMPLATE=['','
    ','','',"
    "].join("");constructor(e,t){super(e,t),this.quill.on(zh.events.EDITOR_CHANGE,((e,t,n,r)=>{if(e===zh.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===zh.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const e=this.quill.getLines(t.index,t.length);if(1===e.length){const e=this.quill.getBounds(t);null!=e&&this.position(e)}else{const n=e[e.length-1],r=this.quill.getIndex(n),a=Math.min(n.length()-1,t.index+t.length-r),i=this.quill.getBounds(new Kh(r,a));null!=i&&this.position(i)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(zh.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(null!=e){const t=this.quill.getBounds(e);null!=t&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==t&&(n.style.marginLeft=-1*t-n.offsetWidth/2+"px"),t}}class fm extends lm{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=dm),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new hm(this.quill,this.options.bounds),null!=e.container&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Yp),this.buildPickers(e.container.querySelectorAll("select"),Yp))}}fm.DEFAULTS=pd({},lm.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,vf.sources.USER)}}}}});const pm=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class mm extends cm{static TEMPLATE=['','','',''].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(null!=this.linkRange){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,zh.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(zh.events.SELECTION_CHANGE,((e,t,n)=>{if(null!=e){if(0===e.length&&n===zh.sources.USER){const[t,n]=this.quill.scroll.descendant(Tp,e.index);if(null!=t){this.linkRange=new Kh(e.index-n,t.length());const r=Tp.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();const a=this.quill.getBounds(this.linkRange);return void(null!=a&&this.position(a))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class vm extends lm{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=pm),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){null!=e.container&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Yp),this.buildPickers(e.container.querySelectorAll("select"),Yp),this.tooltip=new mm(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,n)=>{e.handlers.link.call(e,!n.format.link)})))}}vm.DEFAULTS=pd({},lm.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const e=this.quill.getSelection();if(null==e||0===e.length)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&0!==t.indexOf("mailto:")&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,vf.sources.USER)}}}}}),vf.register({"attributors/attribute/direction":$f,"attributors/class/align":jf,"attributors/class/background":Pf,"attributors/class/color":Tf,"attributors/class/direction":Hf,"attributors/class/font":Vf,"attributors/class/size":Wf,"attributors/style/align":Mf,"attributors/style/background":Rf,"attributors/style/color":_f,"attributors/style/direction":Uf,"attributors/style/font":zf,"attributors/style/size":Kf},!0),vf.register({"formats/align":jf,"formats/direction":Hf,"formats/indent":Sp,"formats/background":Rf,"formats/color":_f,"formats/font":Vf,"formats/size":Wf,"formats/blockquote":class extends Th{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":If,"formats/header":class extends Th{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},"formats/list":Mp,"formats/bold":Cp,"formats/code":Df,"formats/italic":class extends Cp{static blotName="italic";static tagName=["EM","I"]},"formats/link":Tp,"formats/script":class extends Ch{static blotName="script";static tagName=["SUB","SUP"];static create(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):super.create(e)}static formats(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}},"formats/strike":class extends Cp{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends Ch{static blotName="underline";static tagName="U"},"formats/formula":class extends sf{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return"string"==typeof e&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`${e}`}},"formats/image":class extends Bd{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Pp.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return _p(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Pp.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},"formats/video":class extends _h{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Rp.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static sanitize(e){return Tp.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Rp.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`${e}`}},"modules/syntax":$p,"modules/table":class extends af{static register(){vf.register(Hp),vf.register(Up),vf.register(Fp),vf.register(Vp)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Vp).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();null!=t&&(e.deleteColumn(t.cellOffset()),this.quill.update(vf.sources.USER))}deleteRow(){const[,e]=this.getTable();null!=e&&(e.remove(),this.quill.update(vf.sources.USER))}deleteTable(){const[e]=this.getTable();if(null==e)return;const t=e.offset();e.remove(),this.quill.update(vf.sources.USER),this.quill.setSelection(t,vf.sources.SILENT)}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==Hp.blotName)return[null,null,null,-1];const r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const i=a.cellOffset();n.insertColumn(i+e),this.quill.update(vf.sources.USER);let o=r.rowOffset();0===e&&(o+=1),this.quill.setSelection(t.index+o,t.length,vf.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const i=r.rowOffset();n.insertRow(i+e),this.quill.update(vf.sources.USER),e>0?this.quill.setSelection(t,vf.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,vf.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(null==n)return;const r=new Array(e).fill(0).reduce((e=>{const n=new Array(t).fill("\n").join("");return e.insert(n,{table:zp()})}),(new Ah).retain(n.index));this.quill.updateContents(r,vf.sources.USER),this.quill.setSelection(n.index,vf.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(vf.events.SCROLL_OPTIMIZE,(e=>{e.some((e=>!!["TD","TR","TBODY","TABLE"].includes(e.target.tagName)&&(this.quill.once(vf.events.TEXT_CHANGE,((e,t,n)=>{n===vf.sources.USER&&this.balanceTables()})),!0)))}))}},"modules/toolbar":Kp,"themes/bubble":fm,"themes/snow":vm,"ui/icons":Yp,"ui/picker":Qp,"ui/icon-picker":tm,"ui/color-picker":em,"ui/tooltip":nm},!0);var gm=function(e){var n=e.className,r=w(e,["className"]);return t.createElement(hi.Control,E({as:"input",type:"datetime-local",className:n},r))};function bm(e){return bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bm(e)}function ym(e){var t=function(e,t){if("object"!=bm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=bm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bm(t)?t:String(t)}function Em(e,t,n){return(t=ym(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wm(e,t){if(null==e)return{};var n,r,a=A(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}gm.Feedback=Da;var xm=NaN,Nm="[object Symbol]",km=/^\s+|\s+$/g,Om=/^[-+]0x[0-9a-f]+$/i,Lm=/^0b[01]+$/i,Am=/^0o[0-7]+$/i,Sm=parseInt,jm="object"==typeof x&&x&&x.Object===Object&&x,Mm="object"==typeof self&&self&&self.Object===Object&&self,Cm=jm||Mm||Function("return this")(),Tm=Object.prototype.toString,_m=Math.max,Pm=Math.min,Rm=function(){return Cm.Date.now()};function qm(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Im(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Tm.call(e)==Nm}(e))return xm;if(qm(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qm(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(km,"");var n=Lm.test(e);return n||Am.test(e)?Sm(e.slice(2),n?2:8):Om.test(e)?xm:+e}var Dm=function(e,t,n){var r,a,i,o,s,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=a;return r=a=void 0,c=t,o=e.apply(i,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function m(){var e=Rm();if(p(e))return v(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?Pm(n,i-(e-c)):n}(e))}function v(e){return s=void 0,h&&r?f(e):(r=a=void 0,o)}function g(){var e=Rm(),n=p(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?f(e):o}(l);if(d)return s=setTimeout(m,t),f(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=Im(t)||0,qm(n)&&(u=!!n.leading,i=(d="maxWait"in n)?_m(Im(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?o:v(Rm())},g},Bm=N(Dm),$m="label";function Hm(e){return"string"==typeof e?e:$m}function Um(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Fm=0;function Vm(e){return"function"==typeof e}function zm(e){return"string"==typeof e}function Wm(){}function Km(e,t){var n={};return t.forEach((function(t){n[t]=e[t]})),n}function Zm(e,t){return zm(e)||!Um(e,"paginationOption")&&!Um(e,"customOption")?(n=Vm(t)?t(e):zm(e)?e:e[t],zm(n)||("production"!==process.env.NODE_ENV?M(!1,"One or more options does not have a valid label string. Check the `labelKey` prop to ensure that it matches the correct option key and provides a string for filtering and display."):M(!1)),n):e[Hm(t)];var n}var Gm=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;0!=a--;){var o=i[a];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n},Ym=N(Gm);function Xm(e,t){if(!zm(e))return e[t]}var Jm=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹÐ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"ŒŒ"},{base:"oe",letters:"œœ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}].reduce((function(e,t){var n=t.base;return t.letters.split("").forEach((function(t){e[t]=n})),e}),{}),Qm="̀-ͯ",ev="゙゚";function tv(e){return e.normalize("NFD").replace(new RegExp("[".concat(Qm).concat(ev,"]"),"g"),"").replace(/[^\u0000-\u007E]/g,(function(e){return Jm[e]||e}))}var nv={};function rv(e,t){if(!e&&-1!==t.indexOf("deprecated")){if(nv[t])return;nv[t]=!0}for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a1?arguments[1]:void 0;return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","-item-").concat(e)}var dv=["activeIndex","id","isFocused","isMenuShown","multiple","onClick","onFocus","placeholder"];function hv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fv(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},d=Um(u,"className")?String(u.className):void 0;return fv(fv(fv(fv({autoComplete:"off",placeholder:l,type:"text"},u),c),{},{"aria-activedescendant":t>=0?uv(n,t):void 0,"aria-autocomplete":"both","aria-expanded":a,"aria-haspopup":"listbox","aria-multiselectable":i||void 0,"aria-owns":a?n:void 0,className:O((e={},Em(e,d||"",!i),Em(e,"focus",r),e))},i&&{inputClassName:d}),{},{onClick:o,onFocus:s,role:"combobox"})}};function mv(e){var t=e.activeItem,n=e.labelKey,r=e.multiple,a=e.selected,i=e.text;return t?Zm(t,n):!r&&a.length&&a[0]?Zm(a[0],n):i}function vv(e){var t=e.allowNew,n=e.highlightOnlyResult,r=e.results;return!(!n||t)&&(1===r.length&&!Xm(r[0],"disabled"))}function gv(e,t){var n=t[e];return!!n&&!!Xm(n,"disabled")}function bv(e,t,n){for(var r=e;gv(r,n);)r+="ArrowUp"===t?-1:1;return r}function yv(e){e.preventDefault()}function Ev(e){return"lg"===e}function wv(e){return"sm"===e}var xv=["className","isInvalid","isValid","size"];function Nv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kv(e){for(var t=1;t-1||s.length&&!o)return"";var c=Zm(n,i),u=cv(c.toLowerCase(),l.toLowerCase());return u&&0===u.start?l+c.slice(u.end,c.length):""}(e);s((function(){r||h.length||c()}));var m=n(!0);s((function(){m.current?m.current=!1:d(o)}),[o,d]);var v=Vv(Vv({},Km(e,Wv)),{},{getInputProps:pv(Vv(Vv({},Km(e,zv)),{},{onKeyDown:function(t){if(u(t),i){var n="Enter"===t.key&&vv(e),r=p&&function(e,t){var n=!1;return"ArrowRight"===e.key&&(n=!ov(e.currentTarget)||e.currentTarget.selectionStart===e.currentTarget.value.length),"Tab"===e.key&&(e.preventDefault(),n=!0),t?t(n,e):n}(t,f);(n||r)&&l(i)}},value:mv(e)}))}),g=Vv(Vv({},Km(e,Kv)),{},{hintText:p,isOnlyResult:vv(e)});return t.createElement(Hv.Provider,{value:g},Vm(a)?a(v):a)};function Gv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yv(e){for(var t=1;t1&&(o=o.slice(0,1))),{activeIndex:-1,activeItem:void 0,initialItem:void 0,isFocused:!1,selected:o,showMenu:n,shownResults:a,text:s}}function Jv(e,t){return Yv(Yv({},Xv(t)),{},{isFocused:e.isFocused,selected:[],text:""})}function Qv(e){return Yv(Yv({},e),{},{isFocused:!0,showMenu:!0})}function eg(e,t){var n=Xv(t),r=n.activeIndex,a=n.activeItem,i=n.initialItem,o=n.shownResults;return Yv(Yv({},e),{},{activeIndex:r,activeItem:a,initialItem:i,showMenu:!1,shownResults:o})}function tg(e,t){return e.showMenu?eg(e,t):Yv(Yv({},e),{},{showMenu:!0})}var ng=["onChange"];function rg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ag(e){for(var t=1;t=0?e.activeItem:void 0}}))})),Em(Iv(e),"_handleActiveItemChange",(function(t){Ym(t,e.state.activeItem)||e.setState({activeItem:t})})),Em(Iv(e),"_handleBlur",(function(t){t.persist(),e.setState({isFocused:!1},(function(){return e.props.onBlur(t)}))})),Em(Iv(e),"_handleChange",(function(t){e.props.onChange&&e.props.onChange(t)})),Em(Iv(e),"_handleClear",(function(){e.inputNode&&function(e,t){var n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value");n&&n.set&&n.set.call(e,t);var r=new Event("input",{bubbles:!0});e.dispatchEvent(r)}(e.inputNode,""),e.setState(Jv,(function(){e.props.multiple&&e._handleChange([])}))})),Em(Iv(e),"_handleClick",(function(t){var n;t.persist();var r=null===(n=e.props.inputProps)||void 0===n?void 0:n.onClick;e.setState(Qv,(function(){return Vm(r)&&r(t)}))})),Em(Iv(e),"_handleFocus",(function(t){t.persist(),e.setState(Qv,(function(){return e.props.onFocus(t)}))})),Em(Iv(e),"_handleInitialItemChange",(function(t){Ym(t,e.state.initialItem)||e.setState({initialItem:t})})),Em(Iv(e),"_handleInputChange",(function(t){t.persist();var n=t.currentTarget.value,r=e.props,a=r.multiple,i=r.onInputChange,o=e.state.selected.length&&!a;e.setState((function(e,t){var r=Xv(t),a=r.activeIndex,i=r.activeItem,s=r.shownResults;return{activeIndex:a,activeItem:i,selected:o?[]:e.selected,showMenu:!0,shownResults:s,text:n}}),(function(){i(n,t),o&&e._handleChange([])}))})),Em(Iv(e),"_handleKeyDown",(function(t){var n,r,a,i,o=e.state.activeItem;if(!e.isMenuShown)return"ArrowUp"!==t.key&&"ArrowDown"!==t.key||e.setState({showMenu:!0}),void e.props.onKeyDown(t);switch(t.key){case"ArrowUp":case"ArrowDown":t.preventDefault(),e._handleActiveIndexChange((n=e.state.activeIndex,r=t.key,a=e.items,i=n,(i=bv(i+="ArrowUp"===r?-1:1,r,a))===a.length?i=-1:-2===i&&(i=bv(i=a.length-1,r,a)),i));break;case"Enter":t.preventDefault(),o&&e._handleMenuItemSelect(o,t);break;case"Escape":case"Tab":e.hideMenu()}e.props.onKeyDown(t)})),Em(Iv(e),"_handleMenuItemSelect",(function(t,n){Xm(t,"paginationOption")?e._handlePaginate(n):e._handleSelectionAdd(t)})),Em(Iv(e),"_handlePaginate",(function(t){t.persist(),e.setState((function(e,t){return{shownResults:e.shownResults+t.maxResults}}),(function(){return e.props.onPaginate(t,e.state.shownResults)}))})),Em(Iv(e),"_handleSelectionAdd",(function(t){var n,r,a,i=e.props,o=i.multiple,s=i.labelKey,l=t;!zm(l)&&l.customOption&&(l=ag(ag({},l),{},{id:(a="new-id-",Fm+=1,(null==a?"":String(a))+Fm)})),o?(n=e.state.selected.concat(l),r=""):(n=[l],r=Zm(l,s)),e.setState((function(e,t){return ag(ag({},eg(e,t)),{},{initialItem:l,selected:n,text:r})}),(function(){return e._handleChange(n)}))})),Em(Iv(e),"_handleSelectionRemove",(function(t){var n=e.state.selected.filter((function(e){return!Ym(e,t)}));e.focus(),e.setState((function(e,t){return ag(ag({},eg(e,t)),{},{selected:n})}),(function(){return e._handleChange(n)}))})),e}return qv(r,[{key:"componentDidMount",value:function(){this.props.autoFocus&&this.focus()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.labelKey,a=n.multiple,i=n.selected;!function(e,t){var n,r,a,i=!e&&t;i?(n="uncontrolled",r="controlled",a="an"):(n="controlled",r="uncontrolled",a="a"),rv(!(i||e&&!t),"You are changing ".concat(a," ").concat(n," typeahead to be ").concat(r,". ")+"Input elements should not switch from ".concat(n," to ").concat(r," (or vice versa). ")+"Decide between using a controlled or uncontrolled element for the lifetime of the component.")}(i,e.selected),i&&!Ym(i,t.selected)&&(this.setState({selected:i}),a||this.setState({text:i.length?Zm(i[0],r):""}))}},{key:"render",value:function(){var e=this.props;e.onChange;var n=ag(ag({},wm(e,ng)),this.state),r=n.filterBy,a=n.labelKey,i=n.options,o=n.paginate,s=n.shownResults,l=n.text;this.isMenuShown=function(e){var t=e.open,n=e.minLength,r=e.showMenu,a=e.text;return t||!1===t?t:!(a.lengths;if(c=function(e,t){return!t||t>=e.length?e:e.slice(0,t)}(c,s),function(e,t){var n=t.allowNew,r=t.labelKey,a=t.text;return!(!n||!a.trim())&&(Vm(n)?n(e,t):!e.some((function(e){return Zm(e,r)===a})))}(c,n)&&c.push(Em({customOption:!0},Hm(a),l)),h)c.push((Em(d={},Hm(a),""),Em(d,"paginationOption",!0),d))}return t.createElement(Zv,L({},n,{hideMenu:this.hideMenu,inputNode:this.inputNode,inputRef:this.inputRef,isMenuShown:this.isMenuShown,onActiveItemChange:this._handleActiveItemChange,onAdd:this._handleSelectionAdd,onBlur:this._handleBlur,onChange:this._handleInputChange,onClear:this._handleClear,onClick:this._handleClick,onFocus:this._handleFocus,onHide:this.hideMenu,onInitialItemChange:this._handleInitialItemChange,onKeyDown:this._handleKeyDown,onMenuItemClick:this._handleMenuItemSelect,onRemove:this._handleSelectionRemove,results:c,setItem:this.setItem,toggleMenu:this.toggleMenu}))}}]),r}();Em(lg,"propTypes",og),Em(lg,"defaultProps",sg);var cg=["className","label","onClick","onKeyDown","size"],ug={label:be.string,onClick:be.func,onKeyDown:be.func,size:Av},dg=function(e){var n=e.className,r=e.label,a=void 0===r?"Clear":r,i=e.onClick,o=e.onKeyDown,s=e.size,l=wm(e,cg);return t.createElement("button",L({},l,{"aria-label":a,className:O("close","btn-close","rbt-close",{"rbt-close-lg":Ev(s),"rbt-close-sm":wv(s)},n),onClick:function(e){e.stopPropagation(),i&&i(e)},onKeyDown:function(e){"Backspace"===e.key&&e.preventDefault(),o&&o(e)},type:"button"}),t.createElement("span",{"aria-hidden":"true",className:"rbt-close-content"},"×"),t.createElement("span",{className:"sr-only visually-hidden"},a))};dg.propTypes=ug;var hg={label:be.string},fg=function(e){var n=e.label,r=void 0===n?"Loading...":n;return t.createElement("div",{className:"rbt-loader spinner-border spinner-border-sm",role:"status"},t.createElement("span",{className:"sr-only visually-hidden"},r))};function pg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"";return n&&(n=n.replace(n[0],n[0].toUpperCase())),["Top","Right","Bottom","Left"].map((function(r){return e["".concat(t).concat(r).concat(n)]})).join(" ")}var tb=function(){var e=Uv(),t=e.hintText,r=e.inputNode,a=n(null);return s((function(){r&&a.current&&function(e,t){var n=window.getComputedStyle(e);t.style.borderStyle=eb(n,"border","style"),t.style.borderWidth=eb(n,"border","width"),t.style.fontSize=n.fontSize,t.style.fontWeight=n.fontWeight,t.style.height=n.height,t.style.lineHeight=n.lineHeight,t.style.margin=eb(n,"margin"),t.style.padding=eb(n,"padding")}(r,a.current)})),{hintRef:a,hintText:t}},nb=function(e){var n=e.children,r=e.className,a=tb(),i=a.hintRef,o=a.hintText;return t.createElement("div",{className:r,style:{display:"flex",flex:1,height:"100%",position:"relative"}},n,t.createElement("input",{"aria-hidden":!0,className:"rbt-input-hint",ref:i,readOnly:!0,style:{backgroundColor:"transparent",borderColor:"transparent",boxShadow:"none",color:"rgba(0, 0, 0, 0.54)",left:0,pointerEvents:"none",position:"absolute",top:0,width:"100%"},tabIndex:-1,value:o}))},rb=h((function(e,n){return t.createElement("input",L({},e,{className:O("rbt-input-main",e.className),ref:n}))})),ab=["children","className","inputClassName","inputRef","referenceElementRef","selected"];function ib(e){var n=t.useRef(null),r=t.useRef(null),a=Ov(e),i=a.children,o=a.className,s=a.inputClassName;a.inputRef;var l=a.referenceElementRef,c=a.selected,u=wm(a,ab);function d(t){if(e.disabled)t.currentTarget.blur();else{var n=r.current;!n||t.currentTarget.contains(t.target)&&t.currentTarget!==t.target||(ov(n)&&(n.selectionStart=n.value.length),n.focus())}}return t.createElement("div",{className:O("rbt-input-multi",{disabled:e.disabled},o),onClick:d,onFocus:d,ref:l,tabIndex:-1},t.createElement("div",{className:"rbt-input-wrapper",ref:n},i,t.createElement(nb,null,t.createElement(rb,L({},u,{className:s,onKeyDown:function(t){if("Backspace"===t.key&&c.length&&!e.value){var r;t.preventDefault();var a=null===(r=n.current)||void 0===r?void 0:r.children;if(null!=a&&a.length){var i=a[a.length-2];null==i||i.focus()}}e.onKeyDown&&e.onKeyDown(t)},ref:function(t){r.current=t,e.inputRef(t)},style:{backgroundColor:"transparent",border:0,boxShadow:"none",cursor:"inherit",outline:"none",padding:0,width:"100%",zIndex:1}})))))}var ob=["inputRef","referenceElementRef"],sb=function(e){var n=e.inputRef,r=e.referenceElementRef,a=wm(e,ob);return t.createElement(nb,null,t.createElement(rb,L({},Ov(a),{ref:function(e){n(e),r(e)}})))},lb={children:be.string.isRequired,highlightClassName:be.string,search:be.string.isRequired},cb=function(e){var n=e.children,r=e.highlightClassName,a=void 0===r?"rbt-highlight-text":r,i=e.search;if(!i||!n)return t.createElement(t.Fragment,null,n);for(var o=0,s=n,l=[];s;){var c=cv(s,i);if(!c){l.push(s);break}var u=s.slice(0,c.start);u&&l.push(u);var d=s.slice(c.start,c.end);l.push(t.createElement("mark",{className:a,key:o},d)),o+=1,s=s.slice(c.end)}return t.createElement(t.Fragment,null,l)};cb.propTypes=lb;const ub=e=>"object"==typeof e&&null!=e&&1===e.nodeType,db=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,hb=(e,t)=>{if(e.clientHeight{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightit||i>e&&o=t&&s>=n?i-e-r:o>t&&sn?o-t+a:0,pb=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},mb=(e,t)=>{var n,r,a,i;if("undefined"==typeof document)return[];const{scrollMode:o,block:s,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,d="function"==typeof c?c:e=>e!==c;if(!ub(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let p=e;for(;ub(p)&&d(p);){if(p=pb(p),p===h){f.push(p);break}null!=p&&p===document.body&&hb(p)&&!hb(document.documentElement)||null!=p&&hb(p,u)&&f.push(p)}const m=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(a=window.visualViewport)?void 0:a.height)?i:innerHeight,{scrollX:g,scrollY:b}=window,{height:y,width:E,top:w,right:x,bottom:N,left:k}=e.getBoundingClientRect(),{top:O,right:L,bottom:A,left:S}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let j="start"===s||"nearest"===s?w-O:"end"===s?N+A:w+y/2-O+A,M="center"===l?k+E/2-S+L:"end"===l?x+L:k-S;const C=[];for(let e=0;e=0&&k>=0&&N<=v&&x<=m&&w>=a&&N<=c&&k>=u&&x<=i)return C;const d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),O=parseInt(d.borderTopWidth,10),L=parseInt(d.borderRightWidth,10),A=parseInt(d.borderBottomWidth,10);let S=0,T=0;const _="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-L:0,P="offsetHeight"in t?t.offsetHeight-t.clientHeight-O-A:0,R="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,q="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(h===t)S="start"===s?j:"end"===s?j-v:"nearest"===s?fb(b,b+v,v,O,A,b+j,b+j+y,y):j-v/2,T="start"===l?M:"center"===l?M-m/2:"end"===l?M-m:fb(g,g+m,m,p,L,g+M,g+M+E,E),S=Math.max(0,S+b),T=Math.max(0,T+g);else{S="start"===s?j-a-O:"end"===s?j-c+A+P:"nearest"===s?fb(a,c,n,O,A+P,j,j+y,y):j-(a+n/2)+P/2,T="start"===l?M-u-p:"center"===l?M-(u+r/2)+_/2:"end"===l?M-i+L+_:fb(u,i,r,p,L+_,M,M+E,E);const{scrollLeft:e,scrollTop:o}=t;S=0===q?0:Math.max(0,Math.min(o+S/q,t.scrollHeight-n/q+P)),T=0===R?0:Math.max(0,Math.min(e+T/R,t.scrollWidth-r/R+_)),j+=o-S,M+=e-T}C.push({el:t,top:S,left:T})}return C},vb=e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"};var gb=["label","onClick","option","position"];function bb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yb(e){for(var t=1;t{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(mb(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:a,top:i,left:o}of mb(e,vb(t))){const e=i-n.top+n.bottom,t=o-n.left+n.right;a.scroll({top:e,left:t,behavior:r})}}(e,{boundary:e.parentNode,scrollMode:"if-needed"})}}),[u,f,i,o]);var b=a((function(e){m(i,e),r&&r(e)}),[r,m,i]),y=h||u===o;return v(i,o),yb(yb({},l),{},{active:y,"aria-label":t,"aria-selected":y,id:uv(d,o),onClick:b,onMouseDown:yv,ref:g,role:"option"})}Mv.isRequired,be.number;var wb=["active","children","className","disabled","onClick"],xb=h((function(e,n){var r=e.active,a=e.children,i=e.className,o=e.disabled,s=e.onClick,l=wm(e,wb);return t.createElement("a",L({},l,{className:O("dropdown-item",{active:r,disabled:o},i),href:l.href||"#",onClick:function(e){e.preventDefault(),!o&&s&&s(e)},ref:n}),a)}));function Nb(e){return t.createElement(xb,Eb(e))}var kb=["emptyLabel","innerRef","maxHeight","style"];function Ob(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lb(e){for(var t=1;t1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),i)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var t=0;t0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(t,r,a,o,i){var s=t[r],l=y(s);if("object"!==l)return new p("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+a+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return g(a,o,i,c,E(u));var d=u(s,c,a,o,i+"."+c,n);if(d)return d}return null}))},exact:function(e){return m((function(a,o,i,s,l){var c=a[o],u=y(c);if("object"!==u)return new p("Invalid "+s+" `"+l+"` of type `"+u+"` supplied to `"+i+"`, expected `object`.");var d=t({},a[o],e);for(var h in d){var f=e[h];if(r(e,h)&&"function"!=typeof f)return g(i,s,l,h,E(f));if(!f)return new p("Invalid "+s+" `"+l+"` key `"+h+"` supplied to `"+i+"`.\nBad object: "+JSON.stringify(a[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(c,h,i,s,l+"."+h,n);if(m)return m}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function a(a,i,s,c,u,h,f){if(c=c||d,h=h||s,f!==n){if(l){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=c+":"+s;!t[v]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,r++)}}return null==i[s]?a?null===i[s]?new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(i,s,c,u,h)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function v(e){return m((function(t,n,r,a,o,i){var s=t[n];return y(s)!==e?new p("Invalid "+a+" `"+o+"` of type `"+E(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function g(e,t,n,r,a){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+a+"`.")}function b(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(b);if(null===e||s(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e[u]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!b(n.value))return!1}else for(;!(n=r.next()).done;){var a=n.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function y(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function E(e){if(null==e)return""+e;var t=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=E(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,h.checkPropTypes=a,h.resetWarningCache=a.resetWarningCache,h.PropTypes=h,h},Z}()(re.isElement,!0)}else P.exports=function(){if(X)return Y;X=1;var e=te();function t(){}function n(){}return n.resetWarningCache=t,Y=function(){function r(t,n,r,a,o,i){if(i!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function a(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}}()();var ae=c(P.exports),oe=!1,ie="production"!==process.env.NODE_ENV?ae.oneOfType([ae.number,ae.shape({enter:ae.number,exit:ae.number,appear:ae.number}).isRequired]):null;"production"!==process.env.NODE_ENV&&ae.oneOfType([ae.string,ae.shape({enter:ae.string,exit:ae.string,active:ae.string}),ae.shape({enter:ae.string,enterDone:ae.string,enterActive:ae.string,exit:ae.string,exitDone:ae.string,exitActive:ae.string})]);var se=e.createContext(null),le="unmounted",ce="exited",ue="entering",de="entered",he="exiting",fe=function(t){var r,a;function o(e,n){var r;r=t.call(this,e,n)||this;var a,o=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?o?(a=ce,r.appearStatus=ue):a=de:a=e.unmountOnExit||e.mountOnEnter?le:ce,r.state={status:a},r.nextCallback=null,r}a=t,(r=o).prototype=Object.create(a.prototype),r.prototype.constructor=r,x(r,a),o.getDerivedStateFromProps=function(e,t){return e.in&&t.status===le?{status:ce}:null};var i=o.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==ue&&n!==de&&(t=ue):n!==ue&&n!==de||(t=he)}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===ue){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:n.findDOMNode(this);r&&function(e){e.scrollTop}(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ce&&this.setState({status:le})},i.performEnter=function(e){var t=this,r=this.props.enter,a=this.context?this.context.isMounting:e,o=this.props.nodeRef?[a]:[n.findDOMNode(this),a],i=o[0],s=o[1],l=this.getTimeouts(),c=a?l.appear:l.enter;!e&&!r||oe?this.safeSetState({status:de},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,s),this.safeSetState({status:ue},(function(){t.props.onEntering(i,s),t.onTransitionEnd(c,(function(){t.safeSetState({status:de},(function(){t.props.onEntered(i,s)}))}))})))},i.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),a=this.props.nodeRef?void 0:n.findDOMNode(this);t&&!oe?(this.props.onExit(a),this.safeSetState({status:he},(function(){e.props.onExiting(a),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:ce},(function(){e.props.onExited(a)}))}))}))):this.safeSetState({status:ce},(function(){e.props.onExited(a)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:n.findDOMNode(this),a=null==e&&!this.props.addEndListener;if(r&&!a){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var t=this.state.status;if(t===le)return null;var n=this.props,r=n.children;n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef;var a=f(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return e.createElement(se.Provider,{value:null},"function"==typeof r?r(t,a):e.cloneElement(e.Children.only(r),a))},o}(e.Component);function pe(){}fe.contextType=se,fe.propTypes="production"!==process.env.NODE_ENV?{nodeRef:ae.shape({current:"undefined"==typeof Element?ae.any:function(e,t,n,r,a,o){var i=e[t];return ae.instanceOf(i&&"ownerDocument"in i?i.ownerDocument.defaultView.Element:Element)(e,t,n,r,a,o)}}),children:ae.oneOfType([ae.func.isRequired,ae.element.isRequired]).isRequired,in:ae.bool,mountOnEnter:ae.bool,unmountOnExit:ae.bool,appear:ae.bool,enter:ae.bool,exit:ae.bool,timeout:function(e){var t=ie;e.addEndListener||(t=t.isRequired);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a{n.target===e&&(a(),t(n))}),n+r)}function Oe(...e){return e.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}}),null)}function je(e){e.offsetHeight}const Le=e=>e&&"function"!=typeof e?t=>{e.current=t}:e;function Se(t,n){return e.useMemo((()=>function(e,t){const n=Le(e),r=Le(t);return e=>{n&&n(e),r&&r(e)}}(t,n)),[t,n])}function Ae(e){return e&&"setState"in e?n.findDOMNode(e):null!=e?e:null}const Ce=e.forwardRef((({onEnter:n,onEntering:r,onEntered:a,onExit:o,onExiting:i,onExited:s,addEndListener:l,children:c,childRef:u,...d},h)=>{const f=e.useRef(null),p=Se(f,u),m=e=>{p(Ae(e))},v=e=>t=>{e&&f.current&&e(f.current,t)},g=e.useCallback(v(n),[n]),b=e.useCallback(v(r),[r]),y=e.useCallback(v(a),[a]),E=e.useCallback(v(o),[o]),x=e.useCallback(v(i),[i]),w=e.useCallback(v(s),[s]),N=e.useCallback(v(l),[l]);return t.jsx(fe,{ref:h,...d,onEnter:g,onEntered:y,onEntering:b,onExit:E,onExited:w,onExiting:x,addEndListener:N,nodeRef:f,children:"function"==typeof c?(e,t)=>c(e,{...t,ref:m}):e.cloneElement(c,{ref:m})})}));var Me=Ce;const Te={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Re(e,t){const n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=Te[e];return n+parseInt(R(t,r[0]),10)+parseInt(R(t,r[1]),10)}const _e={[ce]:"collapse",[he]:"collapsing",[ue]:"collapsing",[de]:"collapse show"};var Pe=e.forwardRef((({onEnter:n,onEntering:r,onEntered:a,onExit:o,onExiting:i,className:s,children:l,dimension:c="height",in:u=!1,timeout:h=300,mountOnEnter:f=!1,unmountOnExit:p=!1,appear:m=!1,getDimensionValue:v=Re,...g},b)=>{const y="function"==typeof c?c():c,E=e.useMemo((()=>Oe((e=>{e.style[y]="0"}),n)),[y,n]),x=e.useMemo((()=>Oe((e=>{const t=`scroll${y[0].toUpperCase()}${y.slice(1)}`;e.style[y]=`${e[t]}px`}),r)),[y,r]),w=e.useMemo((()=>Oe((e=>{e.style[y]=null}),a)),[y,a]),N=e.useMemo((()=>Oe((e=>{e.style[y]=`${v(y,e)}px`,je(e)}),o)),[o,v,y]),k=e.useMemo((()=>Oe((e=>{e.style[y]=null}),i)),[y,i]);return t.jsx(Me,{ref:b,addEndListener:ke,...g,"aria-expanded":g.role?u:null,onEnter:E,onEntering:x,onEntered:w,onExit:N,onExiting:k,childRef:l.ref,in:u,timeout:h,mountOnEnter:f,unmountOnExit:p,appear:m,children:(t,n)=>e.cloneElement(l,{...n,className:d(s,l.props.className,_e[t],"width"===y&&"collapse-horizontal")})})}));function qe(t){const n=function(t){const n=e.useRef(t);return e.useEffect((()=>{n.current=t}),[t]),n}(t);return e.useCallback((function(...e){return n.current&&n.current(...e)}),[n])}var Ie=e=>a.forwardRef(((n,r)=>t.jsx("div",{...n,ref:r,className:d(n.className,e)})));function De(){return e.useState(null)}function Be(){const t=e.useRef(!0),n=e.useRef((()=>t.current));return e.useEffect((()=>(t.current=!0,()=>{t.current=!1})),[]),n.current}function $e(t){const n=e.useRef(null);return e.useEffect((()=>{n.current=t})),n.current}const Fe="undefined"!=typeof global&&global.navigator&&"ReactNative"===global.navigator.product;var He="undefined"!=typeof document||Fe?e.useLayoutEffect:e.useEffect;const Ue=["as","disabled"];function Ve({tagName:e,disabled:t,href:n,target:r,rel:a,role:o,onClick:i,tabIndex:s=0,type:l}){e||(e=null!=n||null!=r||null!=a?"a":"button");const c={tagName:e};if("button"===e)return[{type:l||"button",disabled:t},c];const u=r=>{(t||"a"===e&&function(e){return!e||"#"===e.trim()}(n))&&r.preventDefault(),t?r.stopPropagation():null==i||i(r)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=o?o:"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:"a"===e?r:void 0,"aria-disabled":t||void 0,rel:"a"===e?a:void 0,onClick:u,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),u(e))}},c]}const ze=a.forwardRef(((e,n)=>{let{as:r,disabled:a}=e,o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,Ue);const[i,{tagName:s}]=Ve(Object.assign({tagName:r,disabled:a},o));return t.jsx(s,Object.assign({},o,i,{ref:n}))}));ze.displayName="Button";const We=["onKeyDown"];const Ke=a.forwardRef(((e,n)=>{let{onKeyDown:r}=e,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,We);const[o]=Ve(Object.assign({tagName:"a"},a)),i=qe((e=>{o.onKeyDown(e),null==r||r(e)}));return(s=a.href)&&"#"!==s.trim()&&"button"!==a.role?t.jsx("a",Object.assign({ref:n},a,{onKeyDown:r})):t.jsx("a",Object.assign({ref:n},a,o,{onKeyDown:i}));var s}));Ke.displayName="Anchor";var Ze=Ke;const Ge={[ue]:"show",[de]:"show"},Ye=a.forwardRef((({className:n,children:r,transitionClasses:o={},onEnter:i,...s},l)=>{const c={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...s},u=e.useCallback(((e,t)=>{je(e),null==i||i(e,t)}),[i]);return t.jsx(Me,{ref:l,addEndListener:ke,...c,onEnter:u,childRef:r.ref,children:(e,t)=>a.cloneElement(r,{...t,className:d("fade",n,r.props.className,Ge[e],o[e])})})}));Ye.displayName="Fade";var Xe=Ye;const Je={"aria-label":ae.string,onClick:ae.func,variant:ae.oneOf(["white"])},Qe=a.forwardRef((({className:e,variant:n,"aria-label":r="Close",...a},o)=>t.jsx("button",{ref:o,type:"button",className:d("btn-close",n&&`btn-close-${n}`,e),"aria-label":r,...a})));Qe.displayName="CloseButton",Qe.propTypes=Je;var et=Qe;const tt=a.forwardRef((({as:e,bsPrefix:n,variant:r="primary",size:a,active:o=!1,disabled:i=!1,className:s,...l},c)=>{const u=N(n,"btn"),[h,{tagName:f}]=Ve({tagName:e,disabled:i,...l}),p=f;return t.jsx(p,{...h,...l,ref:c,disabled:i,className:d(s,u,o&&"active",r&&`${u}-${r}`,a&&`${u}-${a}`,l.href&&i&&"disabled")})}));tt.displayName="Button";var nt=tt;const rt=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"card-body"),t.jsx(r,{ref:o,className:d(e,n),...a}))));rt.displayName="CardBody";var at=rt;const ot=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"card-footer"),t.jsx(r,{ref:o,className:d(e,n),...a}))));ot.displayName="CardFooter";var it=ot;const st=a.createContext(null);st.displayName="CardHeaderContext";var lt=st;const ct=a.forwardRef((({bsPrefix:n,className:r,as:a="div",...o},i)=>{const s=N(n,"card-header"),l=e.useMemo((()=>({cardHeaderBsPrefix:s})),[s]);return t.jsx(lt.Provider,{value:l,children:t.jsx(a,{ref:i,...o,className:d(r,s)})})}));ct.displayName="CardHeader";var ut=ct;const dt=a.forwardRef((({bsPrefix:e,className:n,variant:r,as:a="img",...o},i)=>{const s=N(e,"card-img");return t.jsx(a,{ref:i,className:d(r?`${s}-${r}`:s,n),...o})}));dt.displayName="CardImg";var ht=dt;const ft=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"card-img-overlay"),t.jsx(r,{ref:o,className:d(e,n),...a}))));ft.displayName="CardImgOverlay";var pt=ft;const mt=a.forwardRef((({className:e,bsPrefix:n,as:r="a",...a},o)=>(n=N(n,"card-link"),t.jsx(r,{ref:o,className:d(e,n),...a}))));mt.displayName="CardLink";var vt=mt;const gt=Ie("h6"),bt=a.forwardRef((({className:e,bsPrefix:n,as:r=gt,...a},o)=>(n=N(n,"card-subtitle"),t.jsx(r,{ref:o,className:d(e,n),...a}))));bt.displayName="CardSubtitle";var yt=bt;const Et=a.forwardRef((({className:e,bsPrefix:n,as:r="p",...a},o)=>(n=N(n,"card-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Et.displayName="CardText";var xt=Et;const wt=Ie("h5"),Nt=a.forwardRef((({className:e,bsPrefix:n,as:r=wt,...a},o)=>(n=N(n,"card-title"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Nt.displayName="CardTitle";var kt=Nt;const Ot=a.forwardRef((({bsPrefix:e,className:n,bg:r,text:a,border:o,body:i=!1,children:s,as:l="div",...c},u)=>{const h=N(e,"card");return t.jsx(l,{ref:u,...c,className:d(n,h,r&&`bg-${r}`,a&&`text-${a}`,o&&`border-${o}`),children:i?t.jsx(at,{children:s}):s})}));Ot.displayName="Card";var jt=Object.assign(Ot,{Img:ht,Title:kt,Subtitle:yt,Body:at,Link:vt,Text:xt,Header:ut,Footer:it,ImgOverlay:pt});function Lt(t){const n=function(t){const n=e.useRef(t);return n.current=t,n}(t);e.useEffect((()=>()=>n.current()),[])}const St=2**31-1;function At(e,t,n){const r=n-Date.now();e.current=r<=St?setTimeout(t,r):setTimeout((()=>At(e,t,n)),St)}function Ct(){const t=Be(),n=e.useRef();return Lt((()=>clearTimeout(n.current))),e.useMemo((()=>{const e=()=>clearTimeout(n.current);return{set:function(r,a=0){t()&&(e(),a<=St?n.current=setTimeout(r,a):At(n,r,Date.now()+a))},clear:e,handleRef:n}}),[])}const Mt=a.forwardRef(((e,n)=>{const[{className:r,...a},{as:o="div",bsPrefix:i,spans:s}]=function({as:e,bsPrefix:t,className:n,...r}){t=N(t,"col");const a=k(),o=O(),i=[],s=[];return a.forEach((e=>{const n=r[e];let a,l,c;delete r[e],"object"==typeof n&&null!=n?({span:a,offset:l,order:c}=n):a=n;const u=e!==o?`-${e}`:"";a&&i.push(!0===a?`${t}${u}`:`${t}${u}-${a}`),null!=c&&s.push(`order${u}-${c}`),null!=l&&s.push(`offset${u}-${l}`)})),[{...r,className:d(n,...i,...s)},{as:e,bsPrefix:t,spans:i}]}(e);return t.jsx(o,{...a,ref:n,className:d(r,!s.length&&i)})}));Mt.displayName="Col";var Tt=Mt;const Rt=a.forwardRef((({bsPrefix:e,fluid:n=!1,as:r="div",className:a,...o},i)=>{const s=N(e,"container"),l="string"==typeof n?`-${n}`:"-fluid";return t.jsx(r,{ref:i,...o,className:d(a,n?`${s}${l}`:s)})}));Rt.displayName="Container";var _t=Rt,Pt=Function.prototype.bind.call(Function.prototype.call,[].slice);function qt(e,t){return Pt(e.querySelectorAll(t))}function It(){const[,t]=e.useReducer((e=>!e),!1);return t}var Dt=a.createContext(null),Bt=Object.prototype.hasOwnProperty;function $t(e,t,n){for(n of e.keys())if(Ft(n,t))return n}function Ft(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ft(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((a=r)&&"object"==typeof a&&!(a=$t(t,a)))return!1;if(!t.has(a))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((a=r[0])&&"object"==typeof a&&!(a=$t(t,a)))return!1;if(!Ft(r[1],t.get(a)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(Bt.call(e,n)&&++r&&!Bt.call(t,n))return!1;if(!(n in t)||!Ft(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}var Ht="top",Ut="bottom",Vt="right",zt="left",Wt="auto",Kt=[Ht,Ut,Vt,zt],Zt="start",Gt="end",Yt="clippingParents",Xt="viewport",Jt="popper",Qt="reference",en=Kt.reduce((function(e,t){return e.concat([t+"-"+Zt,t+"-"+Gt])}),[]),tn=[].concat(Kt,[Wt]).reduce((function(e,t){return e.concat([t,t+"-"+Zt,t+"-"+Gt])}),[]),nn=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function rn(e){return e.split("-")[0]}function an(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function on(e){return e instanceof an(e).Element||e instanceof Element}function sn(e){return e instanceof an(e).HTMLElement||e instanceof HTMLElement}function ln(e){return"undefined"!=typeof ShadowRoot&&(e instanceof an(e).ShadowRoot||e instanceof ShadowRoot)}var cn=Math.max,un=Math.min,dn=Math.round;function hn(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function fn(){return!/^((?!chrome|android).)*safari/i.test(hn())}function pn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),a=1,o=1;t&&sn(e)&&(a=e.offsetWidth>0&&dn(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&dn(r.height)/e.offsetHeight||1);var i=(on(e)?an(e):window).visualViewport,s=!fn()&&n,l=(r.left+(s&&i?i.offsetLeft:0))/a,c=(r.top+(s&&i?i.offsetTop:0))/o,u=r.width/a,d=r.height/o;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function mn(e){var t=pn(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function vn(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ln(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(e){return e?(e.nodeName||"").toLowerCase():null}function bn(e){return an(e).getComputedStyle(e)}function yn(e){return["table","td","th"].indexOf(gn(e))>=0}function En(e){return((on(e)?e.ownerDocument:e.document)||window.document).documentElement}function xn(e){return"html"===gn(e)?e:e.assignedSlot||e.parentNode||(ln(e)?e.host:null)||En(e)}function wn(e){return sn(e)&&"fixed"!==bn(e).position?e.offsetParent:null}function Nn(e){for(var t=an(e),n=wn(e);n&&yn(n)&&"static"===bn(n).position;)n=wn(n);return n&&("html"===gn(n)||"body"===gn(n)&&"static"===bn(n).position)?t:n||function(e){var t=/firefox/i.test(hn());if(/Trident/i.test(hn())&&sn(e)&&"fixed"===bn(e).position)return null;var n=xn(e);for(ln(n)&&(n=n.host);sn(n)&&["html","body"].indexOf(gn(n))<0;){var r=bn(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function kn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function On(e,t,n){return cn(e,un(t,n))}function jn(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Ln(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Sn={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,a=e.options,o=n.elements.arrow,i=n.modifiersData.popperOffsets,s=rn(n.placement),l=kn(s),c=[zt,Vt].indexOf(s)>=0?"height":"width";if(o&&i){var u=function(e,t){return jn("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Ln(e,Kt))}(a.padding,n),d=mn(o),h="y"===l?Ht:zt,f="y"===l?Ut:Vt,p=n.rects.reference[c]+n.rects.reference[l]-i[l]-n.rects.popper[c],m=i[l]-n.rects.reference[l],v=Nn(o),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=p/2-m/2,y=u[h],E=g-d[c]-u[f],x=g/2-d[c]/2+b,w=On(y,x,E),N=l;n.modifiersData[r]=((t={})[N]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&vn(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function An(e){return e.split("-")[1]}var Cn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mn(e){var t,n=e.popper,r=e.popperRect,a=e.placement,o=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=i.x,f=void 0===h?0:h,p=i.y,m=void 0===p?0:p,v="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var g=i.hasOwnProperty("x"),b=i.hasOwnProperty("y"),y=zt,E=Ht,x=window;if(c){var w=Nn(n),N="clientHeight",k="clientWidth";if(w===an(n)&&"static"!==bn(w=En(n)).position&&"absolute"===s&&(N="scrollHeight",k="scrollWidth"),a===Ht||(a===zt||a===Vt)&&o===Gt)E=Ut,m-=(d&&w===x&&x.visualViewport?x.visualViewport.height:w[N])-r.height,m*=l?1:-1;if(a===zt||(a===Ht||a===Ut)&&o===Gt)y=Vt,f-=(d&&w===x&&x.visualViewport?x.visualViewport.width:w[k])-r.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Cn),L=!0===u?function(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:dn(n*a)/a||0,y:dn(r*a)/a||0}}({x:f,y:m},an(n)):{x:f,y:m};return f=L.x,m=L.y,l?Object.assign({},j,((O={})[E]=b?"0":"",O[y]=g?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",O)):Object.assign({},j,((t={})[E]=b?m+"px":"",t[y]=g?f+"px":"",t.transform="",t))}var Tn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=void 0===r||r,o=n.adaptive,i=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:rn(t.placement),variation:An(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Mn(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Mn(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Rn={passive:!0};var _n={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,o=void 0===a||a,i=r.resize,s=void 0===i||i,l=an(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,Rn)})),s&&l.addEventListener("resize",n.update,Rn),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Rn)})),s&&l.removeEventListener("resize",n.update,Rn)}},data:{}},Pn={left:"right",right:"left",bottom:"top",top:"bottom"};function qn(e){return e.replace(/left|right|bottom|top/g,(function(e){return Pn[e]}))}var In={start:"end",end:"start"};function Dn(e){return e.replace(/start|end/g,(function(e){return In[e]}))}function Bn(e){var t=an(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $n(e){return pn(En(e)).left+Bn(e).scrollLeft}function Fn(e){var t=bn(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function Hn(e){return["html","body","#document"].indexOf(gn(e))>=0?e.ownerDocument.body:sn(e)&&Fn(e)?e:Hn(xn(e))}function Un(e,t){var n;void 0===t&&(t=[]);var r=Hn(e),a=r===(null==(n=e.ownerDocument)?void 0:n.body),o=an(r),i=a?[o].concat(o.visualViewport||[],Fn(r)?r:[]):r,s=t.concat(i);return a?s:s.concat(Un(xn(i)))}function Vn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function zn(e,t,n){return t===Xt?Vn(function(e,t){var n=an(e),r=En(e),a=n.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;var c=fn();(c||!c&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s+$n(e),y:l}}(e,n)):on(t)?function(e,t){var n=pn(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Vn(function(e){var t,n=En(e),r=Bn(e),a=null==(t=e.ownerDocument)?void 0:t.body,o=cn(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=cn(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),s=-r.scrollLeft+$n(e),l=-r.scrollTop;return"rtl"===bn(a||n).direction&&(s+=cn(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:i,x:s,y:l}}(En(e)))}function Wn(e,t,n,r){var a="clippingParents"===t?function(e){var t=Un(xn(e)),n=["absolute","fixed"].indexOf(bn(e).position)>=0&&sn(e)?Nn(e):e;return on(n)?t.filter((function(e){return on(e)&&vn(e,n)&&"body"!==gn(e)})):[]}(e):[].concat(t),o=[].concat(a,[n]),i=o[0],s=o.reduce((function(t,n){var a=zn(e,n,r);return t.top=cn(a.top,t.top),t.right=un(a.right,t.right),t.bottom=un(a.bottom,t.bottom),t.left=cn(a.left,t.left),t}),zn(e,i,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Kn(e){var t,n=e.reference,r=e.element,a=e.placement,o=a?rn(a):null,i=a?An(a):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Ht:t={x:s,y:n.y-r.height};break;case Ut:t={x:s,y:n.y+n.height};break;case Vt:t={x:n.x+n.width,y:l};break;case zt:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?kn(o):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case Zt:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Gt:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function Zn(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=void 0===r?e.placement:r,o=n.strategy,i=void 0===o?e.strategy:o,s=n.boundary,l=void 0===s?Yt:s,c=n.rootBoundary,u=void 0===c?Xt:c,d=n.elementContext,h=void 0===d?Jt:d,f=n.altBoundary,p=void 0!==f&&f,m=n.padding,v=void 0===m?0:m,g=jn("number"!=typeof v?v:Ln(v,Kt)),b=h===Jt?Qt:Jt,y=e.rects.popper,E=e.elements[p?b:h],x=Wn(on(E)?E:E.contextElement||En(e.elements.popper),l,u,i),w=pn(e.elements.reference),N=Kn({reference:w,element:y,strategy:"absolute",placement:a}),k=Vn(Object.assign({},y,N)),O=h===Jt?k:w,j={top:x.top-O.top+g.top,bottom:O.bottom-x.bottom+g.bottom,left:x.left-O.left+g.left,right:O.right-x.right+g.right},L=e.modifiersData.offset;if(h===Jt&&L){var S=L[a];Object.keys(j).forEach((function(e){var t=[Vt,Ut].indexOf(e)>=0?1:-1,n=[Ht,Ut].indexOf(e)>=0?"y":"x";j[e]+=S[n]*t}))}return j}function Gn(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=n.boundary,o=n.rootBoundary,i=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?tn:l,u=An(r),d=u?s?en:en.filter((function(e){return An(e)===u})):Kt,h=d.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=d);var f=h.reduce((function(t,n){return t[n]=Zn(e,{placement:n,boundary:a,rootBoundary:o,padding:i})[rn(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}var Yn={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,o=void 0===a||a,i=n.altAxis,s=void 0===i||i,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=rn(v),b=l||(g===v||!p?[qn(v)]:function(e){if(rn(e)===Wt)return[];var t=qn(e);return[Dn(e),t,Dn(t)]}(v)),y=[v].concat(b).reduce((function(e,n){return e.concat(rn(n)===Wt?Gn(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),E=t.rects.reference,x=t.rects.popper,w=new Map,N=!0,k=y[0],O=0;O=0,C=A?"width":"height",M=Zn(t,{placement:j,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),T=A?S?Vt:zt:S?Ut:Ht;E[C]>x[C]&&(T=qn(T));var R=qn(T),_=[];if(o&&_.push(M[L]<=0),s&&_.push(M[T]<=0,M[R]<=0),_.every((function(e){return e}))){k=j,N=!1;break}w.set(j,_)}if(N)for(var P=function(e){var t=y.find((function(t){var n=w.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},q=p?3:1;q>0;q--){if("break"===P(q))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Xn(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Jn(e){return[Ht,Vt,Ut,zt].some((function(t){return e[t]>=0}))}var Qn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,i=Zn(t,{elementContext:"reference"}),s=Zn(t,{altBoundary:!0}),l=Xn(i,r),c=Xn(s,a,o),u=Jn(l),d=Jn(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var er={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.offset,o=void 0===a?[0,0]:a,i=tn.reduce((function(e,n){return e[n]=function(e,t,n){var r=rn(e),a=[zt,Ht].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,i=o[0],s=o[1];return i=i||0,s=(s||0)*a,[zt,Vt].indexOf(r)>=0?{x:s,y:i}:{x:i,y:s}}(n,t.rects,o),e}),{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=i}};var tr={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Kn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var nr={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,o=void 0===a||a,i=n.altAxis,s=void 0!==i&&i,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=void 0===h||h,p=n.tetherOffset,m=void 0===p?0:p,v=Zn(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=rn(t.placement),b=An(t.placement),y=!b,E=kn(g),x="x"===E?"y":"x",w=t.modifiersData.popperOffsets,N=t.rects.reference,k=t.rects.popper,O="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(w){if(o){var A,C="y"===E?Ht:zt,M="y"===E?Ut:Vt,T="y"===E?"height":"width",R=w[E],_=R+v[C],P=R-v[M],q=f?-k[T]/2:0,I=b===Zt?N[T]:k[T],D=b===Zt?-k[T]:-N[T],B=t.elements.arrow,$=f&&B?mn(B):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=F[C],U=F[M],V=On(0,N[T],$[T]),z=y?N[T]/2-q-V-H-j.mainAxis:I-V-H-j.mainAxis,W=y?-N[T]/2+q+V+U+j.mainAxis:D+V+U+j.mainAxis,K=t.elements.arrow&&Nn(t.elements.arrow),Z=K?"y"===E?K.clientTop||0:K.clientLeft||0:0,G=null!=(A=null==L?void 0:L[E])?A:0,Y=R+W-G,X=On(f?un(_,R+z-G-Z):_,R,f?cn(P,Y):P);w[E]=X,S[E]=X-R}if(s){var J,Q="x"===E?Ht:zt,ee="x"===E?Ut:Vt,te=w[x],ne="y"===x?"height":"width",re=te+v[Q],ae=te-v[ee],oe=-1!==[Ht,zt].indexOf(g),ie=null!=(J=null==L?void 0:L[x])?J:0,se=oe?re:te-N[ne]-k[ne]-ie+j.altAxis,le=oe?te+N[ne]+k[ne]-ie-j.altAxis:ae,ce=f&&oe?function(e,t,n){var r=On(e,t,n);return r>n?n:r}(se,te,le):On(f?se:re,te,f?le:ae);w[x]=ce,S[x]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function rr(e,t,n){void 0===n&&(n=!1);var r,a,o=sn(t),i=sn(t)&&function(e){var t=e.getBoundingClientRect(),n=dn(t.width)/e.offsetWidth||1,r=dn(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=En(t),l=pn(e,i,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==gn(t)||Fn(s))&&(c=(r=t)!==an(r)&&sn(r)?{scrollLeft:(a=r).scrollLeft,scrollTop:a.scrollTop}:Bn(r)),sn(t)?((u=pn(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=$n(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ar(e){var t=new Map,n=new Set,r=[];function a(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&a(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||a(e)})),r}var or={placement:"bottom",modifiers:[],strategy:"absolute"};function ir(){for(var e=arguments.length,t=new Array(e),n=0;n{}},dr={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const e=(t.getAttribute("aria-describedby")||"").split(",").filter((e=>e.trim()!==n.id));e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,a=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===a&&"setAttribute"in r){const e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},hr=[];function fr(t,n,r={}){let{enabled:a=!0,placement:o="bottom",strategy:i="absolute",modifiers:s=hr}=r,l=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(r,cr);const c=e.useRef(s),u=e.useRef(),d=e.useCallback((()=>{var e;null==(e=u.current)||e.update()}),[]),h=e.useCallback((()=>{var e;null==(e=u.current)||e.forceUpdate()}),[]),[f,p]=function(t){const n=Be();return[t[0],e.useCallback((e=>{if(n())return t[1](e)}),[n,t[1]])]}(e.useState({placement:o,update:d,forceUpdate:h,attributes:{},styles:{popper:{},arrow:{}}})),m=e.useMemo((()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{const t={},n={};Object.keys(e.elements).forEach((r=>{t[r]=e.styles[r],n[r]=e.attributes[r]})),p({state:e,styles:t,attributes:n,update:d,forceUpdate:h,placement:e.placement})}})),[d,h,p]),v=e.useMemo((()=>(Ft(c.current,s)||(c.current=s),c.current)),[s]);return e.useEffect((()=>{u.current&&a&&u.current.setOptions({placement:o,strategy:i,modifiers:[...v,m,ur]})}),[i,o,m,a,v]),e.useEffect((()=>{if(a&&null!=t&&null!=n)return u.current=lr(t,n,Object.assign({},l,{placement:o,strategy:i,modifiers:[...v,dr,m]})),()=>{null!=u.current&&(u.current.destroy(),u.current=void 0,p((e=>Object.assign({},e,{attributes:{},styles:{popper:{}}}))))}}),[a,t,n]),f}function pr(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var mr=function(){};if("production"!==process.env.NODE_ENV){var vr=function(e,t){var n=arguments.length;t=new Array(n>1?n-1:0);for(var r=1;r2?r-2:0);for(var a=2;a{};const yr=e=>e&&("current"in e?e.current:e),Er={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function xr(t,n=br,{disabled:r,clickTrigger:a="click"}={}){const o=e.useRef(!1),i=e.useRef(!1),s=e.useCallback((e=>{const n=yr(t);var r;gr(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!n||!!((r=e).metaKey||r.altKey||r.ctrlKey||r.shiftKey)||!function(e){return 0===e.button}(e)||!!pr(n,e.target)||i.current,i.current=!1}),[t]),l=qe((e=>{const n=yr(t);n&&pr(n,e.target)&&(i.current=!0)})),c=qe((e=>{o.current||n(e)}));e.useEffect((()=>{var e,n;if(r||null==t)return;const o=L(yr(t)),i=o.defaultView||window;let u=null!=(e=i.event)?e:null==(n=i.parent)?void 0:n.event,d=null;Er[a]&&(d=Ee(o,Er[a],l,!0));const h=Ee(o,a,s,!0),f=Ee(o,a,(e=>{e!==u?c(e):u=void 0}));let p=[];return"ontouchstart"in o.documentElement&&(p=[].slice.call(o.body.children).map((e=>Ee(e,"mousemove",br)))),()=>{null==d||d(),h(),f(),p.forEach((e=>e()))}}),[t,r,a,s,l,c])}function wr(e={}){return Array.isArray(e)?e:Object.keys(e).map((t=>(e[t].name=t,e[t])))}function Nr({enabled:e,enableEvents:t,placement:n,flip:r,offset:a,fixed:o,containerPadding:i,arrowElement:s,popperConfig:l={}}){var c,u,d,h,f;const p=function(e){const t={};return Array.isArray(e)?(null==e||e.forEach((e=>{t[e.name]=e})),t):e||t}(l.modifiers);return Object.assign({},l,{placement:n,enabled:e,strategy:o?"fixed":l.strategy,modifiers:wr(Object.assign({},p,{eventListeners:{enabled:t,options:null==(c=p.eventListeners)?void 0:c.options},preventOverflow:Object.assign({},p.preventOverflow,{options:i?Object.assign({padding:i},null==(u=p.preventOverflow)?void 0:u.options):null==(d=p.preventOverflow)?void 0:d.options}),offset:{options:Object.assign({offset:a},null==(h=p.offset)?void 0:h.options)},arrow:Object.assign({},p.arrow,{enabled:!!s,options:Object.assign({},null==(f=p.arrow)?void 0:f.options,{element:s})}),flip:Object.assign({enabled:!!r},p.flip)}))})}const kr=["children"];const Or=()=>{};function jr(t={}){const n=e.useContext(Dt),[r,a]=De(),o=e.useRef(!1),{flip:i,offset:s,rootCloseEvent:l,fixed:c=!1,placement:u,popperConfig:d={},enableEventListeners:h=!0,usePopper:f=!!n}=t,p=null==(null==n?void 0:n.show)?!!t.show:n.show;p&&!o.current&&(o.current=!0);const{placement:m,setMenu:v,menuElement:g,toggleElement:b}=n||{},y=fr(b,g,Nr({placement:u||m||"bottom-start",enabled:f,enableEvents:null==h?p:h,offset:s,flip:i,fixed:c,arrowElement:r,popperConfig:d})),E=Object.assign({ref:v||Or,"aria-labelledby":null==b?void 0:b.id},y.attributes.popper,{style:y.styles.popper}),x={show:p,placement:m,hasShown:o.current,toggle:null==n?void 0:n.toggle,popper:f?y:null,arrowProps:f?Object.assign({ref:a},y.attributes.arrow,{style:y.styles.arrow}):{}};return xr(g,(e=>{null==n||n.toggle(!1,e)}),{clickTrigger:l,disabled:!p}),[E,x]}function Lr(e){let{children:n}=e,r=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,kr);const[a,o]=jr(r);return t.jsx(t.Fragment,{children:n(a,o)})}Lr.displayName="DropdownMenu",Lr.defaultProps={usePopper:!0};const Sr={prefix:String(Math.round(1e10*Math.random())),current:0},Ar=e.createContext(Sr),Cr=e.createContext(!1);let Mr=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Tr=new WeakMap;const Rr="function"==typeof e.useId?function(t){let n=e.useId(),[r]=e.useState("function"==typeof e.useSyncExternalStore?e.useSyncExternalStore(qr,_r,Pr):e.useContext(Cr)),a=r||"test"===process.env.NODE_ENV?"react-aria":`react-aria${Sr.prefix}`;return t||`${a}-${n}`}:function(t){let n=e.useContext(Ar);n!==Sr||Mr||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let r=function(t=!1){let n=e.useContext(Ar),r=e.useRef(null);if(null===r.current&&!t){var a,o;let t=null===(o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===o||null===(a=o.ReactCurrentOwner)||void 0===a?void 0:a.current;if(t){let e=Tr.get(t);null==e?Tr.set(t,{id:n.current,state:t.memoizedState}):t.memoizedState!==e.state&&(n.current=e.id,Tr.delete(t))}r.current=++n.current}return r.current}(!!t),a=n===Sr&&"test"===process.env.NODE_ENV?"react-aria":`react-aria${n.prefix}`;return t||`${a}-${r}`};function _r(){return!1}function Pr(){return!0}function qr(e){return()=>{}}const Ir=e=>{var t;return"menu"===(null==(t=e.getAttribute("role"))?void 0:t.toLowerCase())},Dr=()=>{};function Br(){const t=Rr(),{show:n=!1,toggle:r=Dr,setToggle:a,menuElement:o}=e.useContext(Dt)||{},i=e.useCallback((e=>{r(!n,e)}),[n,r]),s={id:t,ref:a||Dr,onClick:i,"aria-expanded":!!n};return o&&Ir(o)&&(s["aria-haspopup"]=!0),[s,{show:n,toggle:r}]}function $r({children:e}){const[n,r]=Br();return t.jsx(t.Fragment,{children:e(n,r)})}$r.displayName="DropdownToggle";const Fr=a.createContext(null),Hr=(e,t=null)=>null!=e?String(e):t||null,Ur=a.createContext(null);Ur.displayName="NavContext";var Vr=Ur;const zr="data-rr-ui-";function Wr(e){return`${zr}${e}`}const Kr=["eventKey","disabled","onClick","active","as"];function Zr({key:t,href:n,active:r,disabled:a,onClick:o}){const i=e.useContext(Fr),s=e.useContext(Vr),{activeKey:l}=s||{},c=Hr(t,n),u=null==r&&null!=t?Hr(l)===c:r;return[{onClick:qe((e=>{a||(null==o||o(e),i&&!e.isPropagationStopped()&&i(c,e))})),"aria-disabled":a||void 0,"aria-selected":u,[Wr("dropdown-item")]:""},{isActive:u}]}const Gr=a.forwardRef(((e,n)=>{let{eventKey:r,disabled:a,onClick:o,active:i,as:s=ze}=e,l=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,Kr);const[c]=Zr({key:r,href:l.href,disabled:a,onClick:o,active:i});return t.jsx(s,Object.assign({},l,{ref:n},c))}));Gr.displayName="DropdownItem";const Yr=e.createContext(me?window:void 0);function Xr(){return e.useContext(Yr)}function Jr(){const t=It(),n=e.useRef(null),r=e.useCallback((e=>{n.current=e,t()}),[t]);return[n,r]}function Qr({defaultShow:n,show:r,onSelect:a,onToggle:o,itemSelector:i=`* [${Wr("dropdown-item")}]`,focusFirstItemOnShow:s,placement:l="bottom-start",children:c}){const u=Xr(),[d,h]=function(t,n,r){const a=e.useRef(void 0!==t),[o,i]=e.useState(n),s=void 0!==t,l=a.current;return a.current=s,!s&&l&&o!==n&&i(n),[s?t:o,e.useCallback(((...e)=>{const[t,...n]=e;let a=null==r?void 0:r(t,...n);return i(t),a}),[r])]}(r,n,o),[f,p]=Jr(),m=f.current,[v,g]=Jr(),b=v.current,y=$e(d),E=e.useRef(null),x=e.useRef(!1),w=e.useContext(Fr),N=e.useCallback(((e,t,n=(null==t?void 0:t.type))=>{h(e,{originalEvent:t,source:n})}),[h]),k=qe(((e,t)=>{null==a||a(e,t),N(!1,t,"select"),t.isPropagationStopped()||null==w||w(e,t)})),O=e.useMemo((()=>({toggle:N,placement:l,show:d,menuElement:m,toggleElement:b,setMenu:p,setToggle:g})),[N,l,d,m,b,p,g]);m&&y&&!d&&(x.current=m.contains(m.ownerDocument.activeElement));const j=qe((()=>{b&&b.focus&&b.focus()})),L=qe((()=>{const e=E.current;let t=s;if(null==t&&(t=!(!f.current||!Ir(f.current))&&"keyboard"),!1===t||"keyboard"===t&&!/^key.+$/.test(e))return;const n=qt(f.current,i)[0];n&&n.focus&&n.focus()}));e.useEffect((()=>{d?L():x.current&&(x.current=!1,j())}),[d,x,j,L]),e.useEffect((()=>{E.current=null}));const S=(e,t)=>{if(!f.current)return null;const n=qt(f.current,i);let r=n.indexOf(e)+t;return r=Math.max(0,Math.min(r,n.length)),n[r]};return function(t,n,r,a=!1){const o=qe(r);e.useEffect((()=>{const e="function"==typeof t?t():t;return e.addEventListener(n,o,a),()=>e.removeEventListener(n,o,a)}),[t])}(e.useCallback((()=>u.document),[u]),"keydown",(e=>{var t,n;const{key:r}=e,a=e.target,o=null==(t=f.current)?void 0:t.contains(a),i=null==(n=v.current)?void 0:n.contains(a);if(/input|textarea/i.test(a.tagName)&&(" "===r||"Escape"!==r&&o||"Escape"===r&&"search"===a.type))return;if(!o&&!i)return;if(!("Tab"!==r||f.current&&d))return;E.current=e.type;const s={originalEvent:e,source:e.type};switch(r){case"ArrowUp":{const t=S(a,-1);return t&&t.focus&&t.focus(),void e.preventDefault()}case"ArrowDown":if(e.preventDefault(),d){const e=S(a,1);e&&e.focus&&e.focus()}else h(!0,s);return;case"Tab":ye(a.ownerDocument,"keyup",(e=>{var t;("Tab"!==e.key||e.target)&&null!=(t=f.current)&&t.contains(e.target)||h(!1,s)}),{once:!0});break;case"Escape":"Escape"===r&&(e.preventDefault(),e.stopPropagation()),h(!1,s)}})),t.jsx(Fr.Provider,{value:k,children:t.jsx(Dt.Provider,{value:O,children:c})})}Yr.Provider,Qr.displayName="Dropdown",Qr.Menu=Lr,Qr.Toggle=$r,Qr.Item=Gr;const ea=a.createContext({});ea.displayName="DropdownContext";var ta=ea;const na=a.forwardRef((({className:e,bsPrefix:n,as:r="hr",role:a="separator",...o},i)=>(n=N(n,"dropdown-divider"),t.jsx(r,{ref:i,className:d(e,n),role:a,...o}))));na.displayName="DropdownDivider";var ra=na;const aa=a.forwardRef((({className:e,bsPrefix:n,as:r="div",role:a="heading",...o},i)=>(n=N(n,"dropdown-header"),t.jsx(r,{ref:i,className:d(e,n),role:a,...o}))));aa.displayName="DropdownHeader";var oa=aa;const ia=a.forwardRef((({bsPrefix:e,className:n,eventKey:r,disabled:a=!1,onClick:o,active:i,as:s=Ze,...l},c)=>{const u=N(e,"dropdown-item"),[h,f]=Zr({key:r,href:l.href,disabled:a,onClick:o,active:i});return t.jsx(s,{...l,...h,ref:c,className:d(n,u,f.isActive&&"active",a&&"disabled")})}));ia.displayName="DropdownItem";var sa=ia;const la=a.forwardRef((({className:e,bsPrefix:n,as:r="span",...a},o)=>(n=N(n,"dropdown-item-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));la.displayName="DropdownItemText";var ca=la;const ua=a.createContext(null);ua.displayName="InputGroupContext";var da=ua;const ha=a.createContext(null);ha.displayName="NavbarContext";var fa=ha;function pa(t,n){if("production"===process.env.NODE_ENV)return t;return Se(e.useCallback((e=>{null!=e&&e.isReactComponent&&("production"!==process.env.NODE_ENV?v(!1,`${n} injected a ref to a provided \`as\` component that resolved to a component instance instead of a DOM element. Use \`React.forwardRef\` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element`):v(!1))}),[n]),t)}function ma(e,t,n){let r=e?n?"bottom-start":"bottom-end":n?"bottom-end":"bottom-start";return"up"===t?r=e?n?"top-start":"top-end":n?"top-end":"top-start":"end"===t?r=e?n?"left-end":"right-end":n?"left-start":"right-start":"start"===t?r=e?n?"right-end":"left-end":n?"right-start":"left-start":"down-centered"===t?r="bottom":"up-centered"===t&&(r="top"),r}const va=a.forwardRef((({bsPrefix:n,className:r,align:a,rootCloseEvent:o,flip:i=!0,show:s,renderOnMount:l,as:c="div",popperConfig:u,variant:h,...f},p)=>{let m=!1;const v=e.useContext(fa),g=N(n,"dropdown-menu"),{align:b,drop:y,isRTL:E}=e.useContext(ta);a=a||b;const x=e.useContext(da),w=[];if(a)if("object"==typeof a){const e=Object.keys(a);if("production"!==process.env.NODE_ENV&&gr(1===e.length,"There should only be 1 breakpoint when passing an object to `align`"),e.length){const t=e[0],n=a[t];m="start"===n,w.push(`${g}-${t}-${n}`)}}else"end"===a&&(m=!0);const k=ma(m,y,E),[O,{hasShown:j,popper:L,show:S,toggle:A}]=jr({flip:i,rootCloseEvent:o,show:s,usePopper:!v&&0===w.length,offset:[0,2],popperConfig:u,placement:k});if(O.ref=Se(pa(p,"DropdownMenu"),O.ref),He((()=>{S&&(null==L||L.update())}),[S]),!j&&!l&&!x)return null;"string"!=typeof c&&(O.show=S,O.close=()=>null==A?void 0:A(!1),O.align=a);let C=f.style;return null!=L&&L.placement&&(C={...f.style,...O.style},f["x-placement"]=L.placement),t.jsx(c,{...f,...O,style:C,...(w.length||v)&&{"data-bs-popper":"static"},className:d(r,g,S&&"show",m&&`${g}-end`,h&&`${g}-${h}`,...w)})}));va.displayName="DropdownMenu";var ga=va;const ba=a.forwardRef((({bsPrefix:n,split:r,className:a,childBsPrefix:o,as:i=nt,...s},l)=>{const c=N(n,"dropdown-toggle"),u=e.useContext(Dt);void 0!==o&&(s.bsPrefix=o);const[h]=Br();return h.ref=Se(h.ref,pa(l,"DropdownToggle")),t.jsx(i,{className:d(a,c,r&&`${c}-split`,(null==u?void 0:u.show)&&"show"),...h,...s})}));ba.displayName="DropdownToggle";var ya=ba;const Ea=a.forwardRef(((n,r)=>{const{bsPrefix:a,drop:o="down",show:i,className:s,align:l="start",onSelect:c,onToggle:u,focusFirstItemOnShow:h,as:f="div",navbar:p,autoClose:m=!0,...v}=E(n,{show:"onToggle"}),g=e.useContext(da),b=N(a,"dropdown"),y=j(),x=qe(((e,t)=>{var n,r;var a;(null==(n=t.originalEvent)||null==(r=n.target)?void 0:r.classList.contains("dropdown-toggle"))&&"mousedown"===t.source||(t.originalEvent.currentTarget!==document||"keydown"===t.source&&"Escape"!==t.originalEvent.key||(t.source="rootClose"),a=t.source,(!1===m?"click"===a:"inside"===m?"rootClose"!==a:"outside"!==m||"select"!==a)&&(null==u||u(e,t)))})),w=ma("end"===l,o,y),k=e.useMemo((()=>({align:l,drop:o,isRTL:y})),[l,o,y]),O={down:b,"down-centered":`${b}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return t.jsx(ta.Provider,{value:k,children:t.jsx(Qr,{placement:w,show:i,onSelect:c,onToggle:x,focusFirstItemOnShow:h,itemSelector:`.${b}-item:not(.disabled):not(:disabled)`,children:g?v.children:t.jsx(f,{...v,ref:r,className:d(s,i&&"show",O[o])})})})}));Ea.displayName="Dropdown";var xa=Object.assign(Ea,{Toggle:ya,Menu:ga,Item:sa,ItemText:ca,Divider:ra,Header:oa});const wa={type:ae.string,tooltip:ae.bool,as:ae.elementType},Na=a.forwardRef((({as:e="div",className:n,type:r="valid",tooltip:a=!1,...o},i)=>t.jsx(e,{...o,ref:i,className:d(n,`${r}-${a?"tooltip":"feedback"}`)})));Na.displayName="Feedback",Na.propTypes=wa;var ka=Na;var Oa=a.createContext({});const ja=a.forwardRef((({id:n,bsPrefix:r,className:a,type:o="checkbox",isValid:i=!1,isInvalid:s=!1,as:l="input",...c},u)=>{const{controlId:h}=e.useContext(Oa);return r=N(r,"form-check-input"),t.jsx(l,{...c,ref:u,type:o,id:n||h,className:d(a,r,i&&"is-valid",s&&"is-invalid")})}));ja.displayName="FormCheckInput";var La=ja;const Sa=a.forwardRef((({bsPrefix:n,className:r,htmlFor:a,...o},i)=>{const{controlId:s}=e.useContext(Oa);return n=N(n,"form-check-label"),t.jsx("label",{...o,ref:i,htmlFor:a||s,className:d(r,n)})}));Sa.displayName="FormCheckLabel";var Aa=Sa;const Ca=a.forwardRef((({id:n,bsPrefix:r,bsSwitchPrefix:o,inline:i=!1,reverse:s=!1,disabled:l=!1,isValid:c=!1,isInvalid:u=!1,feedbackTooltip:h=!1,feedback:f,feedbackType:p,className:m,style:v,title:g="",type:b="checkbox",label:y,children:E,as:x="input",...w},k)=>{r=N(r,"form-check"),o=N(o,"form-switch");const{controlId:O}=e.useContext(Oa),j=e.useMemo((()=>({controlId:n||O})),[O,n]),L=!E&&null!=y&&!1!==y||function(e,t){return a.Children.toArray(e).some((e=>a.isValidElement(e)&&e.type===t))}(E,Aa),S=t.jsx(La,{...w,type:"switch"===b?"checkbox":b,ref:k,isValid:c,isInvalid:u,disabled:l,as:x});return t.jsx(Oa.Provider,{value:j,children:t.jsx("div",{style:v,className:d(m,L&&r,i&&`${r}-inline`,s&&`${r}-reverse`,"switch"===b&&o),children:E||t.jsxs(t.Fragment,{children:[S,L&&t.jsx(Aa,{title:g,children:y}),f&&t.jsx(ka,{type:p,tooltip:h,children:f})]})})})}));Ca.displayName="FormCheck";var Ma=Object.assign(Ca,{Input:La,Label:Aa});const Ta=a.forwardRef((({bsPrefix:n,type:r,size:a,htmlSize:o,id:i,className:s,isValid:l=!1,isInvalid:c=!1,plaintext:u,readOnly:h,as:f="input",...p},m)=>{const{controlId:v}=e.useContext(Oa);return n=N(n,"form-control"),"production"!==process.env.NODE_ENV&&gr(null==v||!i,"`controlId` is ignored on `` when `id` is specified."),t.jsx(f,{...p,type:r,size:o,ref:m,readOnly:h,id:i||v,className:d(s,u?`${n}-plaintext`:n,a&&`${n}-${a}`,"color"===r&&`${n}-color`,l&&"is-valid",c&&"is-invalid")})}));Ta.displayName="FormControl";var Ra=Object.assign(Ta,{Feedback:ka});const _a=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"form-floating"),t.jsx(r,{ref:o,className:d(e,n),...a}))));_a.displayName="FormFloating";var Pa=_a;const qa=a.forwardRef((({controlId:n,as:r="div",...a},o)=>{const i=e.useMemo((()=>({controlId:n})),[n]);return t.jsx(Oa.Provider,{value:i,children:t.jsx(r,{...a,ref:o})})}));qa.displayName="FormGroup";var Ia=qa;const Da=a.forwardRef((({as:n="label",bsPrefix:r,column:a=!1,visuallyHidden:o=!1,className:i,htmlFor:s,...l},c)=>{const{controlId:u}=e.useContext(Oa);r=N(r,"form-label");let h="col-form-label";"string"==typeof a&&(h=`${h} ${h}-${a}`);const f=d(i,r,o&&"visually-hidden",a&&h);return"production"!==process.env.NODE_ENV&&gr(null==u||!s,"`controlId` is ignored on `` when `htmlFor` is specified."),s=s||u,a?t.jsx(Tt,{ref:c,as:"label",className:f,htmlFor:s,...l}):t.jsx(n,{ref:c,className:f,htmlFor:s,...l})}));Da.displayName="FormLabel";var Ba=Da;const $a=a.forwardRef((({bsPrefix:n,className:r,id:a,...o},i)=>{const{controlId:s}=e.useContext(Oa);return n=N(n,"form-range"),t.jsx("input",{...o,type:"range",ref:i,className:d(r,n),id:a||s})}));$a.displayName="FormRange";var Fa=$a;const Ha=a.forwardRef((({bsPrefix:n,size:r,htmlSize:a,className:o,isValid:i=!1,isInvalid:s=!1,id:l,...c},u)=>{const{controlId:h}=e.useContext(Oa);return n=N(n,"form-select"),t.jsx("select",{...c,size:a,ref:u,className:d(o,n,r&&`${n}-${r}`,i&&"is-valid",s&&"is-invalid"),id:l||h})}));Ha.displayName="FormSelect";var Ua=Ha;const Va=a.forwardRef((({bsPrefix:e,className:n,as:r="small",muted:a,...o},i)=>(e=N(e,"form-text"),t.jsx(r,{...o,ref:i,className:d(n,e,a&&"text-muted")}))));Va.displayName="FormText";var za=Va;const Wa=a.forwardRef(((e,n)=>t.jsx(Ma,{...e,ref:n,type:"switch"})));Wa.displayName="Switch";var Ka=Object.assign(Wa,{Input:Ma.Input,Label:Ma.Label});const Za=a.forwardRef((({bsPrefix:e,className:n,children:r,controlId:a,label:o,...i},s)=>(e=N(e,"form-floating"),t.jsxs(Ia,{ref:s,className:d(n,e),controlId:a,...i,children:[r,t.jsx("label",{htmlFor:a,children:o})]}))));Za.displayName="FloatingLabel";var Ga=Za;const Ya={_ref:ae.any,validated:ae.bool,as:ae.elementType},Xa=a.forwardRef((({className:e,validated:n,as:r="form",...a},o)=>t.jsx(r,{...a,ref:o,className:d(e,n&&"was-validated")})));Xa.displayName="Form",Xa.propTypes=Ya;var Ja=Object.assign(Xa,{Group:Ia,Control:Ra,Floating:Pa,Check:Ma,Switch:Ka,Label:Ba,Text:za,Range:Fa,Select:Ua,FloatingLabel:Ga});const Qa=a.forwardRef((({className:e,bsPrefix:n,as:r="span",...a},o)=>(n=N(n,"input-group-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Qa.displayName="InputGroupText";var eo=Qa;const to=a.forwardRef((({bsPrefix:n,size:r,hasValidation:a,className:o,as:i="div",...s},l)=>{n=N(n,"input-group");const c=e.useMemo((()=>({})),[]);return t.jsx(da.Provider,{value:c,children:t.jsx(i,{ref:l,...s,className:d(o,n,r&&`${n}-${r}`,a&&"has-validation")})})}));to.displayName="InputGroup";var no=Object.assign(to,{Text:eo,Radio:e=>t.jsx(eo,{children:t.jsx(La,{type:"radio",...e})}),Checkbox:e=>t.jsx(eo,{children:t.jsx(La,{type:"checkbox",...e})})});var ro=a.createContext(null);const ao=["as","active","eventKey"];function oo({key:t,onClick:n,active:r,id:a,role:o,disabled:i}){const s=e.useContext(Fr),l=e.useContext(Vr),c=e.useContext(ro);let u=r;const d={role:o};if(l){o||"tablist"!==l.role||(d.role="tab");const e=l.getControllerId(null!=t?t:null),n=l.getControlledId(null!=t?t:null);d[Wr("event-key")]=t,d.id=e||a,u=null==r&&null!=t?l.activeKey===t:r,!u&&(null!=c&&c.unmountOnExit||null!=c&&c.mountOnEnter)||(d["aria-controls"]=n)}return"tab"===d.role&&(d["aria-selected"]=u,u||(d.tabIndex=-1),i&&(d.tabIndex=-1,d["aria-disabled"]=!0)),d.onClick=qe((e=>{i||(null==n||n(e),null!=t&&s&&!e.isPropagationStopped()&&s(t,e))})),[d,{isActive:u}]}const io=a.forwardRef(((e,n)=>{let{as:r=ze,active:a,eventKey:o}=e,i=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,ao);const[s,l]=oo(Object.assign({key:Hr(o,i.href),active:a},i));return s[Wr("active")]=l.isActive,t.jsx(r,Object.assign({},i,s,{ref:n}))}));io.displayName="NavItem";var so=io;const lo=["as","onSelect","activeKey","role","onKeyDown"];const co=()=>{},uo=Wr("event-key"),ho=a.forwardRef(((n,r)=>{let{as:a="div",onSelect:o,activeKey:i,role:s,onKeyDown:l}=n,c=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(n,lo);const u=It(),d=e.useRef(!1),h=e.useContext(Fr),f=e.useContext(ro);let p,m;f&&(s=s||"tablist",i=f.activeKey,p=f.getControlledId,m=f.getControllerId);const v=e.useRef(null),g=e=>{const t=v.current;if(!t)return null;const n=qt(t,`[${uo}]:not([aria-disabled=true])`),r=t.querySelector("[aria-selected=true]");if(!r||r!==document.activeElement)return null;const a=n.indexOf(r);if(-1===a)return null;let o=a+e;return o>=n.length&&(o=0),o<0&&(o=n.length-1),n[o]},b=(e,t)=>{null!=e&&(null==o||o(e,t),null==h||h(e,t))};e.useEffect((()=>{if(v.current&&d.current){const e=v.current.querySelector(`[${uo}][aria-selected=true]`);null==e||e.focus()}d.current=!1}));const y=Se(r,v);return t.jsx(Fr.Provider,{value:b,children:t.jsx(Vr.Provider,{value:{role:s,activeKey:Hr(i),getControlledId:p||co,getControllerId:m||co},children:t.jsx(a,Object.assign({},c,{onKeyDown:e=>{if(null==l||l(e),!f)return;let t;switch(e.key){case"ArrowLeft":case"ArrowUp":t=g(-1);break;case"ArrowRight":case"ArrowDown":t=g(1);break;default:return}var n;t&&(e.preventDefault(),b(t.dataset[(n="EventKey",`rrUi${n}`)]||null,e),d.current=!0,u())},ref:y,role:s}))})})}));ho.displayName="Nav";var fo=Object.assign(ho,{Item:so});function po(e){void 0===e&&(e=L());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}const mo=Wr("modal-open");var vo=class{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt(R(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(mo,""),R(r,t)}reset(){[...this.modals].forEach((e=>this.remove(e)))}removeContainerStyle(e){const t=this.getElement();t.removeAttribute(mo),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return-1!==t?t:(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),t)}remove(e){const t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}};const go=(e,t)=>me?null==e?(t||L()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function bo(t,n){const r=Xr(),[a,o]=e.useState((()=>go(t,null==r?void 0:r.document)));if(!a){const e=go(t);e&&o(e)}return e.useEffect((()=>{n&&a&&n(a)}),[n,a]),e.useEffect((()=>{const e=go(t);e!==a&&o(e)}),[t,a]),a}function yo({children:t,in:n,onExited:r,mountOnEnter:a,unmountOnExit:o}){const i=e.useRef(null),s=e.useRef(n),l=qe(r);e.useEffect((()=>{n?s.current=!0:l(i.current)}),[n,l]);const c=Se(i,t.ref),u=e.cloneElement(t,{ref:c});return n?u:o||!s.current&&a?null:u}function Eo({children:t,in:n,onExited:r,onEntered:a,transition:o}){const[i,s]=e.useState(!n);n&&i&&s(!1);const l=function({in:t,onTransition:n}){const r=e.useRef(null),a=e.useRef(!0),o=qe(n);return He((()=>{if(!r.current)return;let e=!1;return o({in:t,element:r.current,initial:a.current,isStale:()=>e}),()=>{e=!0}}),[t,o]),He((()=>(a.current=!1,()=>{a.current=!0})),[]),r}({in:!!n,onTransition:e=>{Promise.resolve(o(e)).then((()=>{e.isStale()||(e.in?null==a||a(e.element,e.initial):(s(!0),null==r||r(e.element)))}),(t=>{throw e.in||s(!0),t}))}}),c=Se(l,t.ref);return i&&!n?null:e.cloneElement(t,{ref:c})}function xo(e,n,r){return e?t.jsx(e,Object.assign({},r)):n?t.jsx(Eo,Object.assign({},r,{transition:n})):t.jsx(yo,Object.assign({},r))}function wo(e){return"Escape"===e.code||27===e.keyCode}const No=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];let ko;function Oo(t){const n=Xr(),r=t||function(e){return ko||(ko=new vo({ownerDocument:null==e?void 0:e.document})),ko}(n),a=e.useRef({dialog:null,backdrop:null});return Object.assign(a.current,{add:()=>r.add(a.current),remove:()=>r.remove(a.current),isTopModal:()=>r.isTopModal(a.current),setDialogRef:e.useCallback((e=>{a.current.dialog=e}),[]),setBackdropRef:e.useCallback((e=>{a.current.backdrop=e}),[])})}const jo=e.forwardRef(((r,o)=>{let{show:i=!1,role:s="dialog",className:l,style:c,children:u,backdrop:d=!0,keyboard:h=!0,onBackdropClick:f,onEscapeKeyDown:p,transition:m,runTransition:v,backdropTransition:g,runBackdropTransition:b,autoFocus:y=!0,enforceFocus:E=!0,restoreFocus:x=!0,restoreFocusOptions:w,renderDialog:N,renderBackdrop:k=(e=>t.jsx("div",Object.assign({},e))),manager:O,container:j,onShow:L,onHide:S=(()=>{}),onExit:A,onExited:C,onExiting:M,onEnter:T,onEntering:R,onEntered:_}=r,P=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(r,No);const q=Xr(),I=bo(j),D=Oo(O),B=Be(),$=$e(i),[F,H]=e.useState(!i),U=e.useRef(null);e.useImperativeHandle(o,(()=>D),[D]),me&&!$&&i&&(U.current=po(null==q?void 0:q.document)),i&&F&&H(!1);const V=qe((()=>{if(D.add(),Y.current=Ee(document,"keydown",Z),G.current=Ee(document,"focus",(()=>setTimeout(W)),!0),L&&L(),y){var e,t;const n=po(null!=(e=null==(t=D.dialog)?void 0:t.ownerDocument)?e:null==q?void 0:q.document);D.dialog&&n&&!pr(D.dialog,n)&&(U.current=n,D.dialog.focus())}})),z=qe((()=>{var e;(D.remove(),null==Y.current||Y.current(),null==G.current||G.current(),x)&&(null==(e=U.current)||null==e.focus||e.focus(w),U.current=null)}));e.useEffect((()=>{i&&I&&V()}),[i,I,V]),e.useEffect((()=>{F&&z()}),[F,z]),Lt((()=>{z()}));const W=qe((()=>{if(!E||!B()||!D.isTopModal())return;const e=po(null==q?void 0:q.document);D.dialog&&e&&!pr(D.dialog,e)&&D.dialog.focus()})),K=qe((e=>{e.target===e.currentTarget&&(null==f||f(e),!0===d&&S())})),Z=qe((e=>{h&&wo(e)&&D.isTopModal()&&(null==p||p(e),e.defaultPrevented||S())})),G=e.useRef(),Y=e.useRef();if(!I)return null;const X=Object.assign({role:s,ref:D.setDialogRef,"aria-modal":"dialog"===s||void 0},P,{style:c,className:l,tabIndex:-1});let J=N?N(X):t.jsx("div",Object.assign({},X,{children:a.cloneElement(u,{role:"document"})}));J=xo(m,v,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!i,onExit:A,onExiting:M,onExited:(...e)=>{H(!0),null==C||C(...e)},onEnter:T,onEntering:R,onEntered:_,children:J});let Q=null;return d&&(Q=k({ref:D.setBackdropRef,onClick:K}),Q=xo(g,b,{in:!!i,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Q})),t.jsx(t.Fragment,{children:n.createPortal(t.jsxs(t.Fragment,{children:[Q,J]}),I)})}));jo.displayName="Modal";var Lo=Object.assign(jo,{Manager:vo});function So(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function Ao(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Co=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Mo=".sticky-top",To=".navbar-toggler";class Ro extends vo{adjustAndStore(e,t,n){const r=t.style[e];t.dataset[e]=r,R(t,{[e]:`${parseFloat(R(t,e))+n}px`})}restore(e,t){const n=t.dataset[e];void 0!==n&&(delete t.dataset[e],R(t,{[e]:n}))}setContainerStyle(e){super.setContainerStyle(e);const t=this.getElement();var n,r;if(r="modal-open",(n=t).classList?n.classList.add(r):So(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)),!e.scrollBarWidth)return;const a=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";qt(t,Co).forEach((t=>this.adjustAndStore(a,t,e.scrollBarWidth))),qt(t,Mo).forEach((t=>this.adjustAndStore(o,t,-e.scrollBarWidth))),qt(t,To).forEach((t=>this.adjustAndStore(o,t,e.scrollBarWidth)))}removeContainerStyle(e){super.removeContainerStyle(e);const t=this.getElement();var n,r;r="modal-open",(n=t).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Ao(n.className,r):n.setAttribute("class",Ao(n.className&&n.className.baseVal||"",r));const a=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";qt(t,Co).forEach((e=>this.restore(a,e))),qt(t,Mo).forEach((e=>this.restore(o,e))),qt(t,To).forEach((e=>this.restore(o,e)))}}let _o;var Po=Ro;var qo=a.createContext({onHide(){}});const Io=a.forwardRef((({closeLabel:n="Close",closeVariant:r,closeButton:a=!1,onHide:o,children:i,...s},l)=>{const c=e.useContext(qo),u=qe((()=>{null==c||c.onHide(),null==o||o()}));return t.jsxs("div",{ref:l,...s,children:[i,a&&t.jsx(et,{"aria-label":n,variant:r,onClick:u})]})}));var Do=Io,Bo={exports:{}},$o={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,a,o,i){var s=a||"<>",l=i||r;if(null==n[r])return t?new Error("Required "+o+" `"+l+"` was not specified in `"+s+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),d=6;d(n=N(n,"nav-item"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Ho.displayName="NavItem";var Uo=Ho;const Vo=a.forwardRef((({bsPrefix:e,className:n,as:r=Ze,active:a,eventKey:o,disabled:i=!1,...s},l)=>{e=N(e,"nav-link");const[c,u]=oo({key:Hr(o,s.href),active:a,disabled:i,...s});return t.jsx(r,{...s,...c,ref:l,disabled:i,className:d(n,e,i&&"disabled",u.isActive&&"active")})}));Vo.displayName="NavLink";var zo=Vo;const Wo=a.forwardRef(((n,r)=>{const{as:a="div",bsPrefix:o,variant:i,fill:s=!1,justify:l=!1,navbar:c,navbarScroll:u,className:h,activeKey:f,...p}=E(n,{activeKey:"onSelect"}),m=N(o,"nav");let v,g,b=!1;const y=e.useContext(fa),x=e.useContext(lt);return y?(v=y.bsPrefix,b=null==c||c):x&&({cardHeaderBsPrefix:g}=x),t.jsx(fo,{as:a,ref:r,activeKey:f,className:d(h,{[m]:!b,[`${v}-nav`]:b,[`${v}-nav-scroll`]:b&&u,[`${g}-${i}`]:!!g,[`${m}-${i}`]:!!i,[`${m}-fill`]:s,[`${m}-justified`]:l}),...p})}));Wo.displayName="Nav";var Ko=Object.assign(Wo,{Item:Uo,Link:zo});const Zo=a.forwardRef((({bsPrefix:e,className:n,as:r,...a},o)=>{e=N(e,"navbar-brand");const i=r||(a.href?"a":"span");return t.jsx(i,{...a,ref:o,className:d(n,e)})}));Zo.displayName="NavbarBrand";var Go=Zo;const Yo=a.forwardRef((({children:n,bsPrefix:r,...a},o)=>{r=N(r,"navbar-collapse");const i=e.useContext(fa);return t.jsx(Pe,{in:!(!i||!i.expanded),...a,children:t.jsx("div",{ref:o,className:r,children:n})})}));Yo.displayName="NavbarCollapse";var Xo=Yo;const Jo=a.forwardRef((({bsPrefix:n,className:r,children:a,label:o="Toggle navigation",as:i="button",onClick:s,...l},c)=>{n=N(n,"navbar-toggler");const{onToggle:u,expanded:h}=e.useContext(fa)||{},f=qe((e=>{s&&s(e),u&&u()}));return"button"===i&&(l.type="button"),t.jsx(i,{...l,ref:c,onClick:f,"aria-label":o,className:d(r,n,!h&&"collapsed"),children:a||t.jsx("span",{className:`${n}-icon`})})}));Jo.displayName="NavbarToggle";var Qo=Jo;const ei=new WeakMap,ti=(e,t)=>{if(!e||!t)return;const n=ei.get(t)||new Map;ei.set(t,n);let r=n.get(e);return r||(r=t.matchMedia(e),r.refCount=0,n.set(r.media,r)),r};function ni(t,n=("undefined"==typeof window?void 0:window)){const r=ti(t,n),[a,o]=e.useState((()=>!!r&&r.matches));return He((()=>{let e=ti(t,n);if(!e)return o(!1);let r=ei.get(n);const a=()=>{o(e.matches)};return e.refCount++,e.addListener(a),a(),()=>{e.removeListener(a),e.refCount--,e.refCount<=0&&(null==r||r.delete(e.media)),e=void 0}}),[t]),a}const ri=function(t){const n=Object.keys(t);function r(e,t){return e===t?t:e?`${e} and ${t}`:t}function a(e){const r=function(e){return n[Math.min(n.indexOf(e)+1,n.length-1)]}(e);let a=t[r];return a="number"==typeof a?a-.2+"px":`calc(${a} - 0.2px)`,`(max-width: ${a})`}return function(n,o,i){let s;return"object"==typeof n?(s=n,i=o,o=!0):s={[n]:o=o||!0},ni(e.useMemo((()=>Object.entries(s).reduce(((e,[n,o])=>("up"!==o&&!0!==o||(e=r(e,function(e){let n=t[e];return"number"==typeof n&&(n=`${n}px`),`(min-width: ${n})`}(n))),"down"!==o&&!0!==o||(e=r(e,a(n))),e)),"")),[JSON.stringify(s)]),i)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),ai=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"offcanvas-body"),t.jsx(r,{ref:o,className:d(e,n),...a}))));ai.displayName="OffcanvasBody";var oi=ai;const ii={[ue]:"show",[de]:"show"},si=a.forwardRef((({bsPrefix:e,className:n,children:r,in:o=!1,mountOnEnter:i=!1,unmountOnExit:s=!1,appear:l=!1,...c},u)=>(e=N(e,"offcanvas"),t.jsx(Me,{ref:u,addEndListener:ke,in:o,mountOnEnter:i,unmountOnExit:s,appear:l,...c,childRef:r.ref,children:(t,o)=>a.cloneElement(r,{...o,className:d(n,r.props.className,(t===ue||t===he)&&`${e}-toggling`,ii[t])})}))));si.displayName="OffcanvasToggling";var li=si;const ci=a.forwardRef((({bsPrefix:e,className:n,closeLabel:r="Close",closeButton:a=!1,...o},i)=>(e=N(e,"offcanvas-header"),t.jsx(Do,{ref:i,...o,className:d(n,e),closeLabel:r,closeButton:a}))));ci.displayName="OffcanvasHeader";var ui=ci;const di=Ie("h5"),hi=a.forwardRef((({className:e,bsPrefix:n,as:r=di,...a},o)=>(n=N(n,"offcanvas-title"),t.jsx(r,{ref:o,className:d(e,n),...a}))));hi.displayName="OffcanvasTitle";var fi=hi;function pi(e){return t.jsx(li,{...e})}function mi(e){return t.jsx(Xe,{...e})}const vi=a.forwardRef((({bsPrefix:n,className:r,children:a,"aria-labelledby":o,placement:i="start",responsive:s,show:l=!1,backdrop:c=!0,keyboard:u=!0,scroll:h=!1,onEscapeKeyDown:f,onShow:p,onHide:m,container:v,autoFocus:g=!0,enforceFocus:b=!0,restoreFocus:y=!0,restoreFocusOptions:E,onEntered:x,onExit:w,onExiting:k,onEnter:O,onEntering:j,onExited:L,backdropClassName:S,manager:A,renderStaticNode:C=!1,...M},T)=>{const R=e.useRef();n=N(n,"offcanvas");const{onToggle:_}=e.useContext(fa)||{},[P,q]=e.useState(!1),I=ri(s||"xs","up");e.useEffect((()=>{q(s?l&&!I:l)}),[l,s,I]);const D=qe((()=>{null==_||_(),null==m||m()})),B=e.useMemo((()=>({onHide:D})),[D]);const $=e.useCallback((e=>t.jsx("div",{...e,className:d(`${n}-backdrop`,S)})),[S,n]),F=e=>t.jsx("div",{...e,...M,className:d(r,s?`${n}-${s}`:n,`${n}-${i}`),"aria-labelledby":o,children:a});return t.jsxs(t.Fragment,{children:[!P&&(s||C)&&F({}),t.jsx(qo.Provider,{value:B,children:t.jsx(Lo,{show:P,ref:T,backdrop:c,container:v,keyboard:u,autoFocus:g,enforceFocus:b&&!h,restoreFocus:y,restoreFocusOptions:E,onEscapeKeyDown:f,onShow:p,onHide:D,onEnter:(e,...t)=>{e&&(e.style.visibility="visible"),null==O||O(e,...t)},onEntering:j,onEntered:x,onExit:w,onExiting:k,onExited:(e,...t)=>{e&&(e.style.visibility=""),null==L||L(...t)},manager:A||(h?(R.current||(R.current=new Po({handleContainerOverflow:!1})),R.current):function(e){return _o||(_o=new Ro(e)),_o}()),transition:pi,backdropTransition:mi,renderBackdrop:$,renderDialog:F})})]})}));vi.displayName="Offcanvas";var gi=Object.assign(vi,{Body:oi,Header:ui,Title:fi});const bi=a.forwardRef(((n,r)=>{const a=e.useContext(fa);return t.jsx(gi,{ref:r,show:!(null==a||!a.expanded),...n,renderStaticNode:!0})}));bi.displayName="NavbarOffcanvas";var yi=bi;const Ei=a.forwardRef((({className:e,bsPrefix:n,as:r="span",...a},o)=>(n=N(n,"navbar-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Ei.displayName="NavbarText";var xi=Ei;const wi=a.forwardRef(((n,r)=>{const{bsPrefix:a,expand:o=!0,variant:i="light",bg:s,fixed:l,sticky:c,className:u,as:h="nav",expanded:f,onToggle:p,onSelect:m,collapseOnSelect:v=!1,...g}=E(n,{expanded:"onToggle"}),b=N(a,"navbar"),y=e.useCallback(((...e)=>{null==m||m(...e),v&&f&&(null==p||p(!1))}),[m,v,f,p]);void 0===g.role&&"nav"!==h&&(g.role="navigation");let x=`${b}-expand`;"string"==typeof o&&(x=`${x}-${o}`);const w=e.useMemo((()=>({onToggle:()=>null==p?void 0:p(!f),bsPrefix:b,expanded:!!f,expand:o})),[b,f,o,p]);return t.jsx(fa.Provider,{value:w,children:t.jsx(Fr.Provider,{value:y,children:t.jsx(h,{ref:r,...g,className:d(u,b,o&&x,i&&`${b}-${i}`,s&&`bg-${s}`,c&&`sticky-${c}`,l&&`fixed-${l}`)})})})}));wi.displayName="Navbar";var Ni=Object.assign(wi,{Brand:Go,Collapse:Xo,Offcanvas:yi,Text:xi,Toggle:Qo});const ki=()=>{};const Oi=a.forwardRef(((t,r)=>{const{flip:a,offset:o,placement:i,containerPadding:s,popperConfig:l={},transition:c,runTransition:u}=t,[d,h]=De(),[f,p]=De(),m=Se(h,r),v=bo(t.container),g=bo(t.target),[b,y]=e.useState(!t.show),E=fr(g,d,Nr({placement:i,enableEvents:!!t.show,containerPadding:s||5,flip:a,offset:o,arrowElement:f,popperConfig:l}));t.show&&b&&y(!1);const x=t.show||!b;if(function(t,n,{disabled:r,clickTrigger:a}={}){const o=n||ki;xr(t,o,{disabled:r,clickTrigger:a});const i=qe((e=>{wo(e)&&o(e)}));e.useEffect((()=>{if(r||null==t)return;const e=L(yr(t));let n=(e.defaultView||window).event;const a=Ee(e,"keyup",(e=>{e!==n?i(e):n=void 0}));return()=>{a()}}),[t,r,i])}(d,t.onHide,{disabled:!t.rootClose||t.rootCloseDisabled,clickTrigger:t.rootCloseEvent}),!x)return null;const{onExit:w,onExiting:N,onEnter:k,onEntering:O,onEntered:j}=t;let S=t.children(Object.assign({},E.attributes.popper,{style:E.styles.popper,ref:m}),{popper:E,placement:i,show:!!t.show,arrowProps:Object.assign({},E.attributes.arrow,{style:E.styles.arrow,ref:p})});return S=xo(c,u,{in:!!t.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:S,onExit:w,onExiting:N,onExited:(...e)=>{y(!0),t.onExited&&t.onExited(...e)},onEnter:k,onEntering:O,onEntered:j}),v?n.createPortal(S,v):null}));Oi.displayName="Overlay";var ji=Oi;const Li=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"popover-header"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Li.displayName="PopoverHeader";var Si=Li;const Ai=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"popover-body"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Ai.displayName="PopoverBody";var Ci=Ai;function Mi(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}function Ti(e="absolute"){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}const Ri=a.forwardRef((({bsPrefix:e,placement:n="right",className:r,style:a,children:o,body:i,arrowProps:s,hasDoneInitialMeasure:l,popper:c,show:u,...h},f)=>{const p=N(e,"popover"),m=j(),[v]=(null==n?void 0:n.split("-"))||[],g=Mi(v,m);let b=a;return u&&!l&&(b={...a,...Ti(null==c?void 0:c.strategy)}),t.jsxs("div",{ref:f,role:"tooltip",style:b,"x-placement":v,className:d(r,p,v&&`bs-popover-${g}`),...h,children:[t.jsx("div",{className:"popover-arrow",...s}),i?t.jsx(Ci,{children:o}):o]})}));var _i=Object.assign(Ri,{Header:Si,Body:Ci,POPPER_OFFSET:[0,8]});const Pi=a.forwardRef((({bsPrefix:e,placement:n="right",className:r,style:a,children:o,arrowProps:i,hasDoneInitialMeasure:s,popper:l,show:c,...u},h)=>{e=N(e,"tooltip");const f=j(),[p]=(null==n?void 0:n.split("-"))||[],m=Mi(p,f);let v=a;return c&&!s&&(v={...a,...Ti(null==l?void 0:l.strategy)}),t.jsxs("div",{ref:h,style:v,role:"tooltip","x-placement":p,className:d(r,e,`bs-tooltip-${m}`),...u,children:[t.jsx("div",{className:"tooltip-arrow",...i}),t.jsx("div",{className:`${e}-inner`,children:o})]})}));Pi.displayName="Tooltip";var qi=Object.assign(Pi,{TOOLTIP_OFFSET:[0,6]});const Ii=a.forwardRef((({children:n,transition:r=Xe,popperConfig:o={},rootClose:i=!1,placement:s="top",show:l=!1,...c},u)=>{const h=e.useRef({}),[f,p]=e.useState(null),[m,v]=function(t){const n=e.useRef(null),r=N(void 0,"popover"),a=N(void 0,"tooltip"),o=e.useMemo((()=>({name:"offset",options:{offset:()=>{if(t)return t;if(n.current){if(So(n.current,r))return _i.POPPER_OFFSET;if(So(n.current,a))return qi.TOOLTIP_OFFSET}return[0,0]}}})),[t,r,a]);return[n,[o]]}(c.offset),g=Se(u,m),b=!0===r?Xe:r||void 0,y=qe((e=>{p(e),null==o||null==o.onFirstUpdate||o.onFirstUpdate(e)}));return He((()=>{f&&c.target&&(null==h.current.scheduleUpdate||h.current.scheduleUpdate())}),[f,c.target]),e.useEffect((()=>{l||p(null)}),[l]),t.jsx(ji,{...c,ref:g,popperConfig:{...o,modifiers:v.concat(o.modifiers||[]),onFirstUpdate:y},transition:b,rootClose:i,placement:s,show:l,children:(e,{arrowProps:t,popper:i,show:s})=>{var l,c;!function(e,t){const{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n(Ae(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r(Ae(e)))}(e,t);const u=null==i?void 0:i.placement,p=Object.assign(h.current,{state:null==i?void 0:i.state,scheduleUpdate:null==i?void 0:i.update,placement:u,outOfBoundaries:(null==i||null==(l=i.state)||null==(c=l.modifiersData.hide)?void 0:c.isReferenceHidden)||!1,strategy:o.strategy}),m=!!f;return"function"==typeof n?n({...e,placement:u,show:s,...!r&&s&&{className:"show"},popper:p,arrowProps:t,hasDoneInitialMeasure:m}):a.cloneElement(n,{...e,placement:u,arrowProps:t,popper:p,hasDoneInitialMeasure:m,className:d(n.props.className,!r&&s&&"show"),style:{...n.props.style,...e.style}})}})}));Ii.displayName="Overlay";var Di=Ii;function Bi(e,t,n){const[r]=t,a=r.currentTarget,o=r.relatedTarget||r.nativeEvent[n];o&&o===a||pr(a,o)||e(...t)}ae.oneOf(["click","hover","focus"]);var $i=({trigger:n=["hover","focus"],overlay:r,children:o,popperConfig:i={},show:s,defaultShow:l=!1,onToggle:c,delay:u,placement:d,flip:h=d&&-1!==d.indexOf("auto"),...f})=>{const p=e.useRef(null),m=Se(p,o.ref),v=Ct(),g=e.useRef(""),[b,E]=y(s,l,c),x=function(e){return e&&"object"==typeof e?e:{show:e,hide:e}}(u),{onFocus:w,onBlur:N,onClick:k}="function"!=typeof o?a.Children.only(o).props:{},O=e.useCallback((()=>{v.clear(),g.current="show",x.show?v.set((()=>{"show"===g.current&&E(!0)}),x.show):E(!0)}),[x.show,E,v]),j=e.useCallback((()=>{v.clear(),g.current="hide",x.hide?v.set((()=>{"hide"===g.current&&E(!1)}),x.hide):E(!1)}),[x.hide,E,v]),L=e.useCallback(((...e)=>{O(),null==w||w(...e)}),[O,w]),S=e.useCallback(((...e)=>{j(),null==N||N(...e)}),[j,N]),A=e.useCallback(((...e)=>{E(!b),null==k||k(...e)}),[k,E,b]),C=e.useCallback(((...e)=>{Bi(O,e,"fromElement")}),[O]),M=e.useCallback(((...e)=>{Bi(j,e,"toElement")}),[j]),T=null==n?[]:[].concat(n),R={ref:e=>{m(Ae(e))}};return-1!==T.indexOf("click")&&(R.onClick=A),-1!==T.indexOf("focus")&&(R.onFocus=L,R.onBlur=S),-1!==T.indexOf("hover")&&("production"!==process.env.NODE_ENV&&gr(T.length>1,'[react-bootstrap] Specifying only the `"hover"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'),R.onMouseOver=C,R.onMouseOut=M),t.jsxs(t.Fragment,{children:["function"==typeof o?o(R):e.cloneElement(o,R),t.jsx(Di,{...f,show:b,onHide:j,flip:h,placement:d,popperConfig:i,target:p.current,children:r})]})};const Fi=a.forwardRef((({bsPrefix:e,className:n,as:r="div",...a},o)=>{const i=N(e,"row"),s=k(),l=O(),c=`${i}-cols`,u=[];return s.forEach((e=>{const t=a[e];let n;delete a[e],null!=t&&"object"==typeof t?({cols:n}=t):n=t;const r=e!==l?`-${e}`:"";null!=n&&u.push(`${c}${r}-${n}`)})),t.jsx(r,{ref:o,...a,className:d(n,i,...u)})}));Fi.displayName="Row";var Hi=Fi;var Ui,Vi=a.forwardRef((({bsPrefix:e,className:n,striped:r,bordered:a,borderless:o,hover:i,size:s,variant:l,responsive:c,...u},h)=>{const f=N(e,"table"),p=d(n,f,l&&`${f}-${l}`,s&&`${f}-${s}`,r&&`${f}-${"string"==typeof r?`striped-${r}`:"striped"}`,a&&`${f}-bordered`,o&&`${f}-borderless`,i&&`${f}-hover`),m=t.jsx("table",{...u,className:p,ref:h});if(c){let e=`${f}-responsive`;return"string"==typeof c&&(e=`${e}-${c}`),t.jsx("div",{className:e,children:m})}return m})),zi=function(t){var n=t.label,r=t.icon,a=t.children,o=t.className,l=t.variant,c=s(t,["label","icon","children","className","variant"]);return e.createElement(nt,i({className:o,variant:l||"primary"},c),n||null,r?e.createElement("i",{className:"bi bi-".concat(r)}):null,a)};!function(e){e[e.NONE=0]="NONE",e[e.HEAD=1]="HEAD",e[e.BODY=2]="BODY"}(Ui||(Ui={}));var Wi=e.createContext(Ui.NONE),Ki=function(t){var n=t.className,r=t.children,a=s(t,["className","children"]);return e.createElement(Vi,i({className:d(n,"texmo-table")},a),r)};Ki.Head=function(t){var n=t.children,r=s(t,["children"]);return e.createElement(Wi.Provider,{value:Ui.HEAD},e.createElement("thead",i({},r),n))},Ki.Row=function(t){var n=t.borderColour,r=t.className,a=t.style,o=t.children,l=s(t,["borderColour","className","style","children"]);return e.createElement("tr",i({className:d(r,"table-responsive text-center h-100 mt-3 mx-0"),style:i({border:"2px solid ".concat(n)},a)},l),o)},Ki.Cell=function(t){var n=t.borderStart,r=t.className,a=t.children,o=s(t,["borderStart","className","children"]),l=n?"border-start":void 0;switch(e.useContext(Wi)){case Ui.HEAD:return e.createElement("th",i({scope:"col list-cell",className:r},o),a);case Ui.BODY:case Ui.NONE:default:return e.createElement("td",i({className:"px-0 pt-0 pb-3 texmo-table"},o),e.createElement("div",i({className:d(r,"h-100 d-flex align-items-center list-cell")},o),e.createElement(jt,{className:"h-100 w-100 py-3"},e.createElement(jt.Body,{className:"d-flex justify-content-center align-items-center py-0 ".concat(l)},e.createElement("div",{className:"w-100 h-100"},a)))))}},Ki.Body=function(t){var n=t.children,r=s(t,["children"]);return e.createElement("tbody",i({},r),e.createElement(Wi.Provider,{value:Ui.BODY},n))};var Zi=function(t){var n=t.className,r=s(t,["className"]);return e.createElement(Ra,i({as:"input",className:n},r))};Zi.Feedback=ka;var Gi=function(t){var n=t.label,r=t.children,a=t.className;return e.createElement(Ba,{className:a},n?e.createElement("small",{className:"text-muted"},n):null,r)},Yi=function(t){var n=t.className,r=t.children,a=s(t,["className","children"]);return e.createElement(Ua,i({className:n},a),r)};Yi.Feedback=ka;var Xi=function(t){var n=t.type,r=t.className,a=s(t,["type","className"]);return e.createElement(Ma,i({type:n},a,{className:r}))};Xi.Feedback=ka;var Ji="object"==typeof global&&global&&global.Object===Object&&global,Qi="object"==typeof self&&self&&self.Object===Object&&self,es=Ji||Qi||Function("return this")(),ts=es.Symbol,ns=Object.prototype,rs=ns.hasOwnProperty,as=ns.toString,os=ts?ts.toStringTag:void 0;var is=Object.prototype.toString;var ss="[object Null]",ls="[object Undefined]",cs=ts?ts.toStringTag:void 0;function us(e){return null==e?void 0===e?ls:ss:cs&&cs in Object(e)?function(e){var t=rs.call(e,os),n=e[os];try{e[os]=void 0;var r=!0}catch(e){}var a=as.call(e);return r&&(t?e[os]=n:delete e[os]),a}(e):function(e){return is.call(e)}(e)}function ds(e){return null!=e&&"object"==typeof e}var hs=Array.isArray;function fs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ps(e){return e}var ms="[object AsyncFunction]",vs="[object Function]",gs="[object GeneratorFunction]",bs="[object Proxy]";function ys(e){if(!fs(e))return!1;var t=us(e);return t==vs||t==gs||t==ms||t==bs}var Es,xs=es["__core-js_shared__"],ws=(Es=/[^.]+$/.exec(xs&&xs.keys&&xs.keys.IE_PROTO||""))?"Symbol(src)_1."+Es:"";var Ns=Function.prototype.toString;function ks(e){if(null!=e){try{return Ns.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Os=/^\[object .+?Constructor\]$/,js=Function.prototype,Ls=Object.prototype,Ss=js.toString,As=Ls.hasOwnProperty,Cs=RegExp("^"+Ss.call(As).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ms(e){return!(!fs(e)||(t=e,ws&&ws in t))&&(ys(e)?Cs:Os).test(ks(e));var t}function Ts(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ms(n)?n:void 0}var Rs=Ts(es,"WeakMap"),_s=Object.create,Ps=function(){function e(){}return function(t){if(!fs(t))return{};if(_s)return _s(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function qs(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n0){if(++Bs>=800)return arguments[0]}else Bs=0;return Ds.apply(void 0,arguments)});var zs=9007199254740991,Ws=/^(?:0|[1-9]\d*)$/;function Ks(e,t){var n=typeof e;return!!(t=null==t?zs:t)&&("number"==n||"symbol"!=n&&Ws.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=tl}function rl(e){return null!=e&&nl(e.length)&&!ys(e)}var al=Object.prototype;function ol(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||al)}function il(e){return ds(e)&&"[object Arguments]"==us(e)}var sl=Object.prototype,ll=sl.hasOwnProperty,cl=sl.propertyIsEnumerable,ul=il(function(){return arguments}())?il:function(e){return ds(e)&&ll.call(e,"callee")&&!cl.call(e,"callee")};var dl="object"==typeof exports&&exports&&!exports.nodeType&&exports,hl=dl&&"object"==typeof module&&module&&!module.nodeType&&module,fl=hl&&hl.exports===dl?es.Buffer:void 0,pl=(fl?fl.isBuffer:void 0)||function(){return!1},ml={};function vl(e){return function(t){return e(t)}}ml["[object Float32Array]"]=ml["[object Float64Array]"]=ml["[object Int8Array]"]=ml["[object Int16Array]"]=ml["[object Int32Array]"]=ml["[object Uint8Array]"]=ml["[object Uint8ClampedArray]"]=ml["[object Uint16Array]"]=ml["[object Uint32Array]"]=!0,ml["[object Arguments]"]=ml["[object Array]"]=ml["[object ArrayBuffer]"]=ml["[object Boolean]"]=ml["[object DataView]"]=ml["[object Date]"]=ml["[object Error]"]=ml["[object Function]"]=ml["[object Map]"]=ml["[object Number]"]=ml["[object Object]"]=ml["[object RegExp]"]=ml["[object Set]"]=ml["[object String]"]=ml["[object WeakMap]"]=!1;var gl="object"==typeof exports&&exports&&!exports.nodeType&&exports,bl=gl&&"object"==typeof module&&module&&!module.nodeType&&module,yl=bl&&bl.exports===gl&&Ji.process,El=function(){try{var e=bl&&bl.require&&bl.require("util").types;return e||yl&&yl.binding&&yl.binding("util")}catch(e){}}(),xl=El&&El.isTypedArray,wl=xl?vl(xl):function(e){return ds(e)&&nl(e.length)&&!!ml[us(e)]},Nl=Object.prototype.hasOwnProperty;function kl(e,t){var n=hs(e),r=!n&&ul(e),a=!n&&!r&&pl(e),o=!n&&!r&&!a&&wl(e),i=n||r||a||o,s=i?function(e,t){for(var n=-1,r=Array(e);++n-1},Dl.prototype.set=function(e,t){var n=this.__data__,r=ql(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Bl=Ts(es,"Map");function $l(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Fl(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ts))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&bu?new mu:void 0;for(o.set(e,t),o.set(t,e);++d1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(a=Qu.length>3&&"function"==typeof a?(r--,a):void 0,o&&function(e,t,n){if(!fs(n))return!1;var r=typeof t;return!!("number"==r?rl(n)&&Ks(t,n.length):"string"==r&&t in n)&&Gs(n[t],e)}(t[0],t[1],o)&&(a=r<3?void 0:a,r=1),e=Object(e);++n(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(td||{});class nd{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const r=td.TYPE&td.ATTRIBUTE;this.scope=null!=n.scope?n.scope&td.LEVEL|r:td.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map((e=>e.name))}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class rd extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const ad=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){const a=this.query(n);if(null==a)throw new rd(`Unable to create ${n} blot`);const o=a,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:o.create(r),s=new o(t,i,r);return e.blots.set(s.domNode,s),s}find(t,n=!1){return e.find(t,n)}query(e,t=td.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&td.LEVEL&td.BLOCK?n=this.types.block:e&td.LEVEL&td.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((e=>(n=this.classes[e],!!n))),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&td.LEVEL&n.scope&&t&td.TYPE&n.scope?n:null}register(...e){return e.map((e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new rd("Invalid definition");if(t&&"abstract"===e.blotName)throw new rd("Cannot register abstract class");const r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map((e=>e.toUpperCase())):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach((t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)})))),e}))}};ad.blots=new WeakMap;let od=ad;function id(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((e=>0===e.indexOf(`${t}-`)))}const sd=class extends nd{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((e=>e.split("-").slice(0,-1).join("-")))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){id(e,this.keyName).forEach((t=>{e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(id(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function ld(e){const t=e.split("-"),n=t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("");return t[0]+n}const cd=class extends nd{static keys(e){return(e.getAttribute("style")||"").split(";").map((e=>e.split(":")[0].trim()))}add(e,t){return!!this.canAdd(e,t)&&(e.style[ld(this.keyName)]=t,!0)}remove(e){e.style[ld(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[ld(this.keyName)];return this.canAdd(e,t)?t:""}};const ud=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=od.find(this.domNode);if(null==e)return;const t=nd.keys(this.domNode),n=sd.keys(this.domNode),r=cd.keys(this.domNode);t.concat(n).concat(r).forEach((t=>{const n=e.scroll.query(t,td.ATTRIBUTE);n instanceof nd&&(this.attributes[n.attrName]=n)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((e=>{this.attributes[e].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}},dd=class{constructor(e,t){this.scroll=e,this.domNode=t,od.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new rd("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),od.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const a=this.isolate(e,t);if(null!=this.scroll.query(n,td.BLOT)&&r)a.wrap(n,r);else if(null!=this.scroll.query(n,td.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);a.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),a=this.split(e);this.parent.insertBefore(r,a||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new rd(`Cannot wrap ${e}`);return n.appendChild(this),n}};dd.blotName="abstract";let hd=dd;const fd=class extends hd{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};fd.scope=td.INLINE_BLOT;const pd=fd;class md{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let r=n();for(;r;){const a=r.length();if(eo?n(s,e-o,Math.min(t,o+r-e)):n(s,0,Math.min(r,e+t-o)),o+=r,s=i()}}map(e){return this.reduce(((t,n)=>(t.push(e(n)),t)),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=n();return t}}function vd(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create(td.INLINE);return Array.from(e.childNodes).forEach((e=>{n.domNode.appendChild(e)})),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const gd=class e extends hd{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new md,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=vd(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof rd)return;throw e}}))}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,((e,t,n)=>{e.deleteAt(t,n)}))}descendant(t,n=0){const[r,a]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,a]:r instanceof e?r.descendant(t,a):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let a=[],o=r;return this.children.forEachAt(n,r,((n,r,i)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&a.push(n),n instanceof e&&(a=a.concat(n.descendants(t,r,o))),o-=i})),a}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach((n=>{t||this.statics.allowedChildren.some((e=>n instanceof e))||(n.statics.scope===td.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())}))}formatAt(e,t,n,r){this.children.forEachAt(e,t,((e,t,a)=>{e.formatAt(t,a,n,r)}))}insertAt(e,t,n){const[r,a]=this.children.find(e);if(r)r.insertAt(a,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((n=>{e.insertBefore(n,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[r,a]=this.children.find(t,n),o=[[this,t]];return r instanceof e?o.concat(r.path(a,n)):(null!=r&&o.push([r,a]),o)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),((e,r,a)=>{const o=e.split(r,t);null!=o&&n.appendChild(o)})),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],r=[];e.forEach((e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))})),r.forEach((e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()})),n.filter((e=>e.parentNode===this.domNode&&e!==this.uiNode)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=vd(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))})),this.enforceAllowedChildren()}};gd.uiClass="";const bd=gd;const yd=class e extends bd{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new ud(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,td.INLINE);if(null==e)return;e instanceof nd?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach((t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)})),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.formats()[n]||this.scroll.query(n,td.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}wrap(t,n){const r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};yd.allowedChildren=[yd,pd],yd.blotName="inline",yd.scope=td.INLINE_BLOT,yd.tagName="SPAN";const Ed=yd,xd=class e extends bd{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new ud(this.domNode)}format(t,n){const r=this.scroll.query(t,td.BLOCK);null!=r&&(r instanceof nd?this.attributes.attribute(r,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.scroll.query(n,td.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,td.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}};xd.blotName="block",xd.scope=td.BLOCK_BLOT,xd.tagName="P",xd.allowedChildren=[Ed,xd,pd];const wd=xd,Nd=class extends bd{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Nd.blotName="container",Nd.scope=td.BLOCK_BLOT;const kd=Nd;const Od=class extends pd{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},jd={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Ld=class extends bd{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((e=>{this.update(e)})),this.observer.observe(this.domNode,jd),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=td.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach((e=>{e.remove()})):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const a=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&a(e.parent))},o=e=>{n.has(e.domNode)&&(e instanceof bd&&e.children.forEach(o),n.delete(e.domNode),e.optimize(t))};let i=e;for(let t=0;i.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(i.forEach((e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(a(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach((e=>{const t=this.find(e,!1);a(t,!1),t instanceof bd&&t.children.forEach((e=>{a(e,!1)}))}))):"attributes"===e.type&&a(t.prev)),a(t))})),this.children.forEach(o),i=Array.from(this.observer.takeRecords()),r=i.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map((e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)})).forEach((e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)})),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Ld.blotName="scroll",Ld.defaultChild=wd,Ld.allowedChildren=[wd,kd],Ld.scope=td.BLOCK_BLOT,Ld.tagName="DIV";const Sd=Ld,Ad=class e extends pd{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some((e=>"characterData"===e.type&&e.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ad.blotName="text",Ad.scope=td.INLINE_BLOT;const Cd=Ad;var Md=Object.freeze({__proto__:null,Attributor:nd,AttributorStore:ud,BlockBlot:wd,ClassAttributor:sd,ContainerBlot:kd,EmbedBlot:Od,InlineBlot:Ed,LeafBlot:pd,ParentBlot:bd,Registry:od,Scope:td,ScrollBlot:Sd,StyleAttributor:cd,TextBlot:Cd}),Td={exports:{}},Rd=-1,_d=1,Pd=0;function qd(e,t,n,r,a){if(e===t)return e?[[Pd,e]]:[];if(null!=n){var o=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,a="number"==typeof n?null:n.newRange,o=e.length,i=t.length;if(0===r.length&&(null===a||0===a.length)){var s=r.index,l=e.slice(0,s),c=e.slice(s),u=a?a.index:null,d=s+i-o;if((null===u||u===d)&&!(d<0||d>i)){var h=t.slice(0,d);if((m=t.slice(d))===c){var f=Math.min(s,d);if((g=l.slice(0,f))===(y=h.slice(0,f)))return Xd(g,l.slice(f),h.slice(f),c)}}if(null===u||u===s){var p=s,m=(h=t.slice(0,p),t.slice(p));if(h===l){var v=Math.min(o-p,i-p);if((b=c.slice(c.length-v))===(E=m.slice(m.length-v)))return Xd(l,c.slice(0,c.length-v),m.slice(0,m.length-v),b)}}}if(r.length>0&&a&&0===a.length){var g=e.slice(0,r.index),b=e.slice(r.index+r.length);if(!(i<(f=g.length)+(v=b.length))){var y=t.slice(0,f),E=t.slice(i-v);if(g===y&&b===E)return Xd(g,e.slice(f,o-v),t.slice(f,i-v),b)}}return null}(e,t,n);if(o)return o}var i=Dd(e,t),s=e.substring(0,i);i=$d(e=e.substring(i),t=t.substring(i));var l=e.substring(e.length-i),c=function(e,t){var n;if(!e)return[[_d,t]];if(!t)return[[Rd,e]];var r=e.length>t.length?e:t,a=e.length>t.length?t:e,o=r.indexOf(a);if(-1!==o)return n=[[_d,r.substring(0,o)],[Pd,a],[_d,r.substring(o+a.length)]],e.length>t.length&&(n[0][0]=n[2][0]=Rd),n;if(1===a.length)return[[Rd,e],[_d,t]];var i=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,a,o,i,c]:null}var o,i,s,l,c,u=a(n,r,Math.ceil(n.length/4)),d=a(n,r,Math.ceil(n.length/2));if(!u&&!d)return null;o=d?u&&u[4].length>d[4].length?u:d:u;e.length>t.length?(i=o[0],s=o[1],l=o[2],c=o[3]):(l=o[0],c=o[1],i=o[2],s=o[3]);var h=o[4];return[i,s,l,c,h]}(e,t);if(i){var s=i[0],l=i[1],c=i[2],u=i[3],d=i[4],h=qd(s,c),f=qd(l,u);return h.concat([[Pd,d]],f)}return function(e,t){for(var n=e.length,r=t.length,a=Math.ceil((n+r)/2),o=a,i=2*a,s=new Array(i),l=new Array(i),c=0;cn)f+=2;else if(y>r)h+=2;else if(d){if((w=o+u-g)>=0&&w=(x=n-l[w]))return Id(e,t,k,y)}}for(var E=-v+p;E<=v-m;E+=2){for(var x,w=o+E,N=(x=E===-v||E!==v&&l[w-1]n)m+=2;else if(N>r)p+=2;else if(!d){if((b=o+u-E)>=0&&b=(x=n-x))return Id(e,t,k,y)}}}}return[[Rd,e],[_d,t]]}(e,t)}(e=e.substring(0,e.length-i),t=t.substring(0,t.length-i));return s&&c.unshift([Pd,s]),l&&c.push([Pd,l]),Wd(c,a),r&&function(e){var t=!1,n=[],r=0,a=null,o=0,i=0,s=0,l=0,c=0;for(;o0?n[r-1]:-1,i=0,s=0,l=0,c=0,a=null,t=!0)),o++;t&&Wd(e);(function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),a=n.match(Fd),o=r.match(Fd),i=a&&n.match(Hd),s=o&&r.match(Hd),l=i&&n.match(Ud),c=s&&r.match(Ud),u=l&&e.match(Vd),d=c&&t.match(zd);return u||d?5:l||c?4:a&&!i&&s?3:i||s?2:a||o?1:0}var n=1;for(;n=d&&(d=h,l=r,c=a,u=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=c,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}})(e),o=1;for(;o=f?(h>=u.length/2||h>=d.length/2)&&(e.splice(o,0,[Pd,d.substring(0,h)]),e[o-1][1]=u.substring(0,u.length-h),e[o+1][1]=d.substring(h),o++):(f>=u.length/2||f>=d.length/2)&&(e.splice(o,0,[Pd,u.substring(0,f)]),e[o-1][0]=_d,e[o-1][1]=d.substring(0,d.length-f),e[o+1][0]=Rd,e[o+1][1]=u.substring(f),o++),o++}o++}}(c),c}function Id(e,t,n,r){var a=e.substring(0,n),o=t.substring(0,r),i=e.substring(n),s=t.substring(r),l=qd(a,o),c=qd(i,s);return l.concat(c)}function Dd(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),a=r,o=0;nr?e=e.substring(n-r):n=0&&Yd(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),i=c+i,s=c+s,!e[l][1]){e.splice(l,1),r--;var u=l-1;e[u]&&e[u][0]===_d&&(o++,s=e[u][1]+s,u--),e[u]&&e[u][0]===Rd&&(a++,i=e[u][1]+i,u--),l=u}}if(Gd(e[r][1])){c=e[r][1].charAt(0);e[r][1]=e[r][1].slice(1),i+=c,s+=c}}if(r0||s.length>0){i.length>0&&s.length>0&&(0!==(n=Dd(s,i))&&(l>=0?e[l][1]+=s.substring(0,n):(e.splice(0,0,[Pd,s.substring(0,n)]),r++),s=s.substring(n),i=i.substring(n)),0!==(n=$d(s,i))&&(e[r][1]=s.substring(s.length-n)+e[r][1],s=s.substring(0,s.length-n),i=i.substring(0,i.length-n)));var d=o+a;0===i.length&&0===s.length?(e.splice(r-d,d),r-=d):0===i.length?(e.splice(r-d,d,[_d,s]),r=r-d+1):0===s.length?(e.splice(r-d,d,[Rd,i]),r=r-d+1):(e.splice(r-d,d,[Rd,i],[_d,s]),r=r-d+2)}0!==r&&e[r-1][0]===Pd?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,o=0,a=0,i="",s=""}""===e[e.length-1][1]&&e.pop();var h=!1;for(r=1;r=55296&&e<=56319}function Zd(e){return e>=56320&&e<=57343}function Gd(e){return Zd(e.charCodeAt(0))}function Yd(e){return Kd(e.charCodeAt(e.length-1))}function Xd(e,t,n,r){return Yd(e)||Gd(r)?null:function(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}([[Pd,e],[Rd,t],[_d,n],[Pd,r]])}function Jd(e,t,n,r){return qd(e,t,n,r,!0)}Jd.INSERT=_d,Jd.DELETE=Rd,Jd.EQUAL=Pd;var Qd=Jd,eh={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",o="[object Boolean]",i="[object Date]",s="[object Function]",c="[object GeneratorFunction]",u="[object Map]",d="[object Number]",h="[object Object]",f="[object Promise]",p="[object RegExp]",m="[object Set]",v="[object String]",g="[object Symbol]",b="[object WeakMap]",y="[object ArrayBuffer]",E="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",N="[object Int8Array]",k="[object Int16Array]",O="[object Int32Array]",j="[object Uint8Array]",L="[object Uint8ClampedArray]",S="[object Uint16Array]",A="[object Uint32Array]",C=/\w*$/,M=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,R={};R[a]=R["[object Array]"]=R[y]=R[E]=R[o]=R[i]=R[x]=R[w]=R[N]=R[k]=R[O]=R[u]=R[d]=R[h]=R[p]=R[m]=R[v]=R[g]=R[j]=R[L]=R[S]=R[A]=!0,R["[object Error]"]=R[s]=R[b]=!1;var _="object"==typeof l&&l&&l.Object===Object&&l,P="object"==typeof self&&self&&self.Object===Object&&self,q=_||P||Function("return this")(),I=t&&!t.nodeType&&t,D=I&&e&&!e.nodeType&&e,B=D&&D.exports===I;function $(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function H(e,t,n,r){var a=-1,o=e?e.length:0;for(r&&o&&(n=e[++a]);++a-1},je.prototype.set=function(e,t){var n=this.__data__,r=Me(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Le.prototype.clear=function(){this.__data__={hash:new Oe,map:new(fe||je),string:new Oe}},Le.prototype.delete=function(e){return qe(this,e).delete(e)},Le.prototype.get=function(e){return qe(this,e).get(e)},Le.prototype.has=function(e){return qe(this,e).has(e)},Le.prototype.set=function(e,t){return qe(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new je},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof je){var r=n.__data__;if(!fe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Le(r)}return n.set(e,t),this};var De=ce?z(ce,Object):function(){return[]},Be=function(e){return ee.call(e)};function $e(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var We=ue||function(){return!1};function Ke(e){var t=Ze(e)?ee.call(e):"";return t==s||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ge(e){return ze(e)?Ae(e):function(e){if(!Fe(e))return de(e);var t=[];for(var n in Object(e))Q.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}(eh,eh.exports);var th=eh.exports,nh={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=1,a=2,o=9007199254740991,i="[object Arguments]",s="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",v="[object Number]",g="[object Null]",b="[object Object]",y="[object Promise]",E="[object Proxy]",x="[object RegExp]",w="[object Set]",N="[object String]",k="[object Symbol]",O="[object Undefined]",j="[object WeakMap]",L="[object ArrayBuffer]",S="[object DataView]",A=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[i]=M[s]=M[L]=M[u]=M[S]=M[d]=M[h]=M[f]=M[m]=M[v]=M[b]=M[x]=M[w]=M[N]=M[j]=!1;var T="object"==typeof l&&l&&l.Object===Object&&l,R="object"==typeof self&&self&&self.Object===Object&&self,_=T||R||Function("return this")(),P=t&&!t.nodeType&&t,q=P&&e&&!e.nodeType&&e,I=q&&q.exports===P,D=I&&T.process,B=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),$=B&&B.isTypedArray;function F(e,t){for(var n=-1,r=null==e?0:e.length;++nc))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var h=-1,f=!0,p=n&a?new ke:void 0;for(s.set(e,t),s.set(t,e);++h-1},we.prototype.set=function(e,t){var n=this.__data__,r=Le(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ne.prototype.clear=function(){this.size=0,this.__data__={hash:new xe,map:new(ce||we),string:new xe}},Ne.prototype.delete=function(e){var t=Pe(this,e).delete(e);return this.size-=t?1:0,t},Ne.prototype.get=function(e){return Pe(this,e).get(e)},Ne.prototype.has=function(e){return Pe(this,e).has(e)},Ne.prototype.set=function(e,t){var n=Pe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ke.prototype.add=ke.prototype.push=function(e){return this.__data__.set(e,n),this},ke.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.clear=function(){this.__data__=new we,this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof we){var r=n.__data__;if(!ce||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ne(r)}return n.set(e,t),this.size=n.size,this};var Ie=oe?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ze(e){return null!=e&&"object"==typeof e}var Ge=$?function(e){return function(t){return e(t)}}($):function(e){return Ze(e)&&We(e.length)&&!!M[Se(e)]};function Ye(e){return null!=(t=e)&&We(t.length)&&!ze(t)?je(e):Te(e);var t}e.exports=function(e,t){return Ce(e,t)}}(nh,nh.exports);var rh=nh.exports,ah={};Object.defineProperty(ah,"__esModule",{value:!0});const oh=th,ih=rh;var sh;!function(e){e.compose=function(e={},t={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let r=oh(t);n||(r=Object.keys(r).reduce(((e,t)=>(null!=r[t]&&(e[t]=r[t]),e)),{}));for(const n in e)void 0!==e[n]&&void 0===t[n]&&(r[n]=e[n]);return Object.keys(r).length>0?r:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const n=Object.keys(e).concat(Object.keys(t)).reduce(((n,r)=>(ih(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n)),{});return Object.keys(n).length>0?n:void 0},e.invert=function(e={},t={}){e=e||{};const n=Object.keys(t).reduce(((n,r)=>(t[r]!==e[r]&&void 0!==e[r]&&(n[r]=t[r]),n)),{});return Object.keys(e).reduce(((n,r)=>(e[r]!==t[r]&&void 0===t[r]&&(n[r]=null),n)),n)},e.transform=function(e,t,n=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!n)return t;const r=Object.keys(t).reduce(((n,r)=>(void 0===e[r]&&(n[r]=t[r]),n)),{});return Object.keys(r).length>0?r:void 0}}(sh||(sh={})),ah.default=sh;var lh,ch={};Object.defineProperty(ch,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(lh||(lh={})),ch.default=lh;var uh={};Object.defineProperty(uh,"__esModule",{value:!0});const dh=ch;uh.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const n=this.offset,r=dh.default.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"object"==typeof t.retain&&null!==t.retain?r.retain=t.retain:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?dh.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}return[]}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const n=Qd,r=th,a=rh,o=ah;t.AttributeMap=o.default;const i=ch;t.Op=i.default;const s=uh;t.OpIterator=s.default;const l=String.fromCharCode(0),c=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class u{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(a(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach((r=>{(e(r)?t:n).push(r)})),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce(((e,t)=>t.insert?e+i.default.length(t):t.delete?e-t.delete:e),0)}length(){return this.reduce(((e,t)=>e+i.default.length(t)),0)}slice(e=0,t=1/0){const n=[],r=new s.default(this.ops);let a=0;for(;a0&&n.next(i.retain-e)}const l=new u(r);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===t.peekType())l.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),r=t.next(e),i=n.next(e);if(i.retain){const s={};if("number"==typeof r.retain)s.retain="number"==typeof i.retain?e:i.retain;else if("number"==typeof i.retain)null==r.retain?s.insert=r.insert:s.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,a]=c(r[e],i.retain),o=u.getHandler(t);s[e]={[t]:o.compose(n,a,"retain"===e)}}const d=o.default.compose(r.attributes,i.attributes,"number"==typeof r.retain);if(d&&(s.attributes=d),l.push(s),!n.hasNext()&&a(l.ops[l.ops.length-1],s)){const e=new u(t.rest());return l.concat(e).chop()}}else"number"==typeof i.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&l.push(i)}return l.chop()}concat(e){const t=new u(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new u;const r=[this,e].map((t=>t.map((n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join(""))),i=new u,c=n(r[0],r[1],t,!0),d=new s.default(this.ops),h=new s.default(e.ops);return c.forEach((e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(h.peekLength(),t),i.push(h.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),i.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),h.peekLength(),t);const e=d.next(r),s=h.next(r);a(e.insert,s.insert)?i.retain(r,o.default.diff(e.attributes,s.attributes)):i.push(s).delete(r)}t-=r}})),i.chop()}eachLine(e,t="\n"){const n=new s.default(this.ops);let r=new u,a=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const o=n.peek(),s=i.default.length(o)-n.peekLength(),l="string"==typeof o.insert?o.insert.indexOf(t,s)-s:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===e(r,n.next(1).attributes||{},a))return;a+=1,r=new u}}r.length()>0&&e(r,{},a)}invert(e){const t=new u;return this.reduce(((n,r)=>{if(r.insert)t.delete(i.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const a=r.delete||r.retain;return e.slice(n,n+a).forEach((e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(i.default.length(e),o.default.invert(r.attributes,e.attributes))})),n+a}if("object"==typeof r.retain&&null!==r.retain){const a=e.slice(n,n+1),i=new s.default(a.ops).next(),[l,d,h]=c(r.retain,i.insert),f=u.getHandler(l);return t.retain({[l]:f.invert(d,h)},o.default.invert(r.attributes,i.attributes)),n+1}}return n}),0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,r=new s.default(this.ops),a=new s.default(n.ops),l=new u;for(;r.hasNext()||a.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===a.peekType())if("insert"===a.peekType())l.push(a.next());else{const e=Math.min(r.peekLength(),a.peekLength()),n=r.next(e),i=a.next(e);if(n.delete)continue;if(i.delete)l.push(i);else{const r=n.retain,a=i.retain;let s="object"==typeof a&&null!==a?a:e;if("object"==typeof r&&null!==r&&"object"==typeof a&&null!==a){const e=Object.keys(r)[0];if(e===Object.keys(a)[0]){const n=u.getHandler(e);n&&(s={[e]:n.transform(r[e],a[e],t)})}}l.retain(s,o.default.transform(n.attributes,i.attributes,t))}}else l.retain(i.default.length(r.next()));return l.chop()}transformPosition(e,t=!1){t=!!t;const n=new s.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const a=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(r"']/g,(e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e])))}class gh extends Ed{static allowedChildren=[gh,ph,Od,mh];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const n=gh.order.indexOf(e),r=gh.order.indexOf(t);return n>=0||r>=0?n-r:e===t?0:e0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}class bh extends wd{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=Eh(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,td.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(null!=n)return super.insertAt(e,t,n),void(this.cache={});if(0===t.length)return;const r=t.split("\n"),a=r.shift();a.length>0&&(e(o=o.split(e,!0),o.insertAt(0,t),t.length)),e+a.length)}insertBefore(e,t){const{head:n}=this.children;super.insertBefore(e,t),n instanceof ph&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&(0===e||e>=this.length()-1)){const t=this.clone();return 0===e?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}const n=super.split(e,t);return this.cache={},n}}bh.blotName="block",bh.tagName="P",bh.defaultChild=ph,bh.allowedChildren=[ph,gh,Od,mh];class yh extends Od{attach(){super.attach(),this.attributes=new ud(this.domNode)}delta(){return(new fh).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,td.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(null!=n)return void super.insertAt(e,t,n);const r=t.split("\n"),a=r.pop(),o=r.map((e=>{const t=this.scroll.create(bh.blotName);return t.insertAt(0,e),t})),i=this.split(e);o.forEach((e=>{this.parent.insertBefore(e,i)})),a&&this.parent.insertBefore(this.scroll.create("text",a),i)}}function Eh(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(pd).reduce(((e,n)=>0===n.length()?e:e.insert(n.value(),xh(n,{},t))),new fh).insert("\n",xh(e))}function xh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t={...t,...e.formats()},n&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:xh(e.parent,t,n))}yh.scope=td.BLOCK_BLOT;class wh extends Od{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(wh.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(e,t){if(0!==this.savedLength)return void super.format(e,t);let n=this,r=0;for(;null!=n&&n.statics.scope!==td.BLOCK_BLOT;)r+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=wh.CONTENTS.length,n.optimize(),n.formatAt(r,wh.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const e=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof mh?this.prev:null,n=t?t.length():0,r=this.next instanceof mh?this.next:null,a=r?r.text:"",{textNode:o}=this,i=o.data.split(wh.CONTENTS).join("");let s;if(o.data=wh.CONTENTS,t)s=t,(i||r)&&(t.insertAt(t.length(),i+a),r&&r.remove());else if(r)s=r,r.insertAt(0,i);else{const e=document.createTextNode(i);s=this.scroll.create(e),this.parent.insertBefore(s,this)}if(this.remove(),e){const a=(e,a)=>t&&e===t.domNode?a:e===o?n+a-1:r&&e===r.domNode?n+i.length+a:null,l=a(e.start.node,e.start.offset),c=a(e.end.node,e.end.offset);if(null!==l&&null!==c)return{startNode:s.domNode,startOffset:l,endNode:s.domNode,endOffset:c}}return null}update(e,t){if(e.some((e=>"characterData"===e.type&&e.target===this.textNode))){const e=this.restore();e&&(t.range=e)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if("A"===t.domNode.tagName){this.savedLength=wh.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Nh={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,o||e,i),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,o=r.length,i=new Array(o);a1?t-1:0),r=1;r(t[n]=Sh.bind(console,n,e),t)),{})}Ah.level=e=>{Lh=e},Sh.level=Ah.level;const Ch=Ah("quill:events");["selectionchange","mousedown","mouseup","click"].forEach((e=>{document.addEventListener(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n{const n=Oh.get(e);n&&n.emitter&&n.emitter.handleDOM(...t)}))}))}));class Mh extends kh{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Ch.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r{let{node:r,handler:a}=t;(e.target===r||r.contains(e.target))&&a(e,...n)}))}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}const Th=Ah("quill:selection");class Rh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=e,this.length=t}}class _h{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Rh(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,Mh.sources.USER),1)})),this.emitter.on(Mh.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const e=this.getNativeRange();null!=e&&e.start.node!==this.cursor.textNode&&this.emitter.once(Mh.events.SCROLL_UPDATE,((t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);const r=n.some((e=>"characterData"===e.type||"childList"===e.type||"attributes"===e.type&&e.target===this.root));this.update(r?Mh.sources.SILENT:t)}catch(e){}}))})),this.emitter.on(Mh.events.SCROLL_OPTIMIZE,((e,t)=>{if(t.range){const{startNode:e,startOffset:n,endNode:r,endOffset:a}=t.range;this.setNativeRange(e,n,r,a),this.update(Mh.sources.SILENT)}})),this.update(Mh.sources.SILENT)}handleComposition(){this.emitter.on(Mh.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(Mh.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(Mh.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(e,td.BLOCK)){if(n.start.node!==this.cursor.textNode){const e=this.scroll.find(n.start.node,!1);if(null==e)return;if(e instanceof pd){const t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let r;e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let[a,o]=this.scroll.leaf(e);if(null==a)return null;if(t>0&&o===a.length()){const[t]=this.scroll.leaf(e+1);if(t){const[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(a=t,o=0)}}[r,o]=a.position(o,!0);const i=document.createRange();if(t>0)return i.setStart(r,o),[a,o]=this.scroll.leaf(e+t),null==a?null:([r,o]=a.position(o,!0),i.setEnd(r,o),i.getBoundingClientRect());let s,l="left";if(r instanceof Text){if(!r.data.length)return null;o0&&(l="right")}return{bottom:s.top+s.height,height:s.height,left:s[l],right:s[l],top:s.top,width:0}}getNativeRange(){const e=document.getSelection();if(null==e||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(null==t)return null;const n=this.normalizeNative(t);return Th.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();if(null==t)return[null,null];return[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&Ph(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map((e=>{const[t,n]=e,r=this.scroll.find(t,!0),a=r.offset(this.scroll);return 0===n?a:r instanceof pd?a+r.index(t,n):a+r.length()})),r=Math.min(Math.max(...n),this.scroll.length()-1),a=Math.min(r,...n);return new Rh(a,r-a)}normalizeNative(e){if(!Ph(this.root,e.startContainer)||!e.collapsed&&!Ph(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1}e.node=t,e.offset=n})),t}rangeToNative(e){const t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);const[r,a]=this.scroll.leaf(e);return r?r.position(a,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Th.info("setNativeRange",e,t,n,r),null!=e&&(null==this.root.parentNode||null==e.parentNode||null==n.parentNode))return;const o=document.getSelection();if(null!=o)if(null!=e){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:i}=this.getNativeRange()||{};if(null==i||a||e!==i.startContainer||t!==i.startOffset||n!==i.endContainer||r!==i.endOffset){e instanceof Element&&"BR"===e.tagName&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&"BR"===n.tagName&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const a=document.createRange();a.setStart(e,t),a.setEnd(n,r),o.removeAllRanges(),o.addRange(a)}}else o.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mh.sources.API;if("string"==typeof t&&(n=t,t=!1),Th.info("setRange",e),null!=e){const n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mh.sources.USER;const t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!Ju(t,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}const n=[Mh.events.SELECTION_CHANGE,pu(this.lastRange),pu(t),e];this.emitter.emit(Mh.events.EDITOR_CHANGE,...n),e!==Mh.sources.SILENT&&this.emitter.emit(...n)}}}function Ph(e,t){try{t.parentNode}catch(e){return!1}return e.contains(t)}const qh=/^[ -~]*$/;class Ih{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=Hh(e),r=new fh;return function(e){const t=[];return e.forEach((e=>{if("string"==typeof e.insert){e.insert.split("\n").forEach(((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}))}else t.push(e)})),t}(n.ops.slice()).reduce(((e,n)=>{const a=hh.Op.length(n);let o=n.attributes||{},i=!1,s=!1;if(null!=n.insert){if(r.retain(a),"string"==typeof n.insert){const r=n.insert;s=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(yh,e)[0]),this.scroll.insertAt(e,r);const[a,i]=this.scroll.line(e);let l=ed({},xh(a));if(a instanceof bh){const[e]=a.descendant(pd,i);e&&(l=ed(l,xh(e)))}o=hh.AttributeMap.diff(l,o)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return e;const a=null!=this.scroll.query(r,td.INLINE);if(a)(t<=e||this.scroll.descendant(yh,e)[0])&&(s=!0);else if(e>0){const[t,n]=this.scroll.descendant(pd,e-1);if(t instanceof mh){"\n"!==t.value()[n]&&(i=!0)}else t instanceof Od&&t.statics.scope===td.INLINE_BLOT&&(i=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),a){const[t]=this.scroll.descendant(pd,e);if(t){const e=ed({},xh(t));o=hh.AttributeMap.diff(e,o)||{}}}}t+=a}else if(r.push(n),null!==n.retain&&"object"==typeof n.retain){const t=Object.keys(n.retain)[0];if(null==t)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(o).forEach((t=>{this.scroll.formatAt(e,a,t,o[t])}));const l=i?1:0,c=s?1:0;return t+=l+c,r.retain(l),r.delete(c),e+a+l+c}),0),r.reduce(((e,t)=>"number"==typeof t.delete?(this.scroll.deleteAt(e,t.delete),e):e+hh.Op.length(t)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new fh).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach((r=>{this.scroll.lines(e,Math.max(t,1)).forEach((e=>{e.format(r,n[r])}))})),this.scroll.optimize();const r=(new fh).retain(e).retain(t,pu(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t,r,n[r])}));const r=(new fh).retain(e).retain(t,pu(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new fh)}getFormat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach((e=>{const[t]=e;t instanceof bh?n.push(t):t instanceof pd&&r.push(t)})):(n=this.scroll.lines(e,t),r=this.scroll.descendants(pd,e,t));const[a,o]=[n,r].map((e=>{const t=e.shift();if(null==t)return{};let n=xh(t);for(;Object.keys(n).length>0;){const t=e.shift();if(null==t)return n;n=$h(xh(t),n)}return n}));return{...a,...o}}getHTML(e,t){const[n,r]=this.scroll.line(e);if(n){const a=n.length();return!(n.length()>=r+t)||0===r&&t===a?Bh(this.scroll,e,t,!0):Bh(n,r,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((e=>"string"==typeof e.insert)).map((e=>e.insert)).join("")}insertContents(e,t){const n=Hh(t),r=(new fh).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new fh).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t.length,r,n[r])})),this.update((new fh).retain(e).insert(t,pu(n)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==bh.blotName)return!1;const t=e;return!(t.children.length>1)&&t.children.head instanceof ph}removeFormat(e,t){const n=this.getText(e,t),[r,a]=this.scroll.line(e+t);let o=0,i=new fh;null!=r&&(o=r.length()-a,i=r.delta().slice(a,a+o-1).insert("\n"));const s=this.getContents(e,t+o).diff((new fh).insert(n).concat(i)),l=(new fh).retain(e).concat(s);return this.applyDelta(l)}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(qh)&&this.scroll.find(t[0].target)){const a=this.scroll.find(t[0].target),o=xh(a),i=a.offset(this.scroll),s=t[0].oldValue.replace(wh.CONTENTS,""),l=(new fh).insert(s),c=(new fh).insert(a.value()),u=n&&{oldRange:Uh(n.oldRange,-i),newRange:Uh(n.newRange,-i)};e=(new fh).retain(i).concat(l.diff(c,u)).reduce(((e,t)=>t.insert?e.insert(t.insert,o):e.push(t)),new fh),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&Ju(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}function Dh(e,t,n){if(0===e.length){const[e]=Fh(n.pop());return t<=0?``:`${Dh([],t-1,n)}`}const[{child:r,offset:a,length:o,indent:i,type:s},...l]=e,[c,u]=Fh(s);if(i>t)return n.push(s),i===t+1?`<${c}>${Bh(r,a,o)}${Dh(l,i,n)}`:`<${c}>
  • ${Dh(e,t+1,n)}`;const d=n[n.length-1];if(i===t&&s===d)return`
  • ${Bh(r,a,o)}${Dh(l,i,n)}`;const[h]=Fh(n.pop());return`${Dh(e,t-1,n)}`}function Bh(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in e&&"function"==typeof e.html)return e.html(t,n);if(e instanceof mh)return vh(e.value().slice(t,t+n));if(e instanceof bd){if("list-container"===e.statics.blotName){const r=[];return e.children.forEachAt(t,n,((e,t,n)=>{const a="formats"in e&&"function"==typeof e.formats?e.formats():{};r.push({child:e,offset:t,length:n,indent:a.indent||0,type:a.list})})),Dh(r,-1,[])}const a=[];if(e.children.forEachAt(t,n,((e,t,n)=>{a.push(Bh(e,t,n))})),r||"list"===e.statics.blotName)return a.join("");const{outerHTML:o,innerHTML:i}=e.domNode,[s,l]=o.split(`>${i}<`);return"${a.join("")}<${l}`:`${s}>${a.join("")}<${l}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function $h(e,t){return Object.keys(t).reduce(((n,r)=>{if(null==e[r])return n;const a=t[r];return a===e[r]?n[r]=a:Array.isArray(a)?a.indexOf(e[r])<0?n[r]=a.concat([e[r]]):n[r]=a:n[r]=[a,e[r]],n}),{})}function Fh(e){const t="ordered"===e?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Hh(e){return e.reduce(((e,t)=>{if("string"==typeof t.insert){const n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)}),new fh)}function Uh(e,t){let{index:n,length:r}=e;return new Rh(n+t,r)}class Vh{static DEFAULTS={};constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=e,this.options=t}}const zh="\ufeff";class Wh extends Od{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((e=>{this.contentNode.appendChild(e)})),this.leftGuard=document.createTextNode(zh),this.rightGuard=document.createTextNode(zh),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t,n=null;const r=e.data.split(zh).join("");if(e===this.leftGuard)if(this.prev instanceof mh){const e=this.prev.length();this.prev.insertAt(e,r),n={startNode:this.prev.domNode,startOffset:e+r.length}}else t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this),n={startNode:t,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof mh?(this.next.insertAt(0,r),n={startNode:this.next.domNode,startOffset:r.length}):(t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this.next),n={startNode:t,startOffset:r.length}));return e.data=zh,n}update(e,t){e.forEach((e=>{if("characterData"===e.type&&(e.target===this.leftGuard||e.target===this.rightGuard)){const n=this.restore(e.target);n&&(t.range=n)}}))}}class Kh{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;!t||t instanceof Wh||(this.emitter.emit(Mh.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Mh.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Mh.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Mh.events.COMPOSITION_END,e),this.isComposing=!1}}class Zh{static DEFAULTS={modules:{}};static themes={default:Zh};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{null==this.modules[e]&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const Gh=e=>{const t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},Yh=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},Xh=(e,t,n,r,a,o)=>er?0:er?t-e>r-n?e+a-n:t-r+o:0,Jh=["block","break","cursor","inline","scroll","text"],Qh=Ah("quill"),ef=new od;bd.uiClass="ql-ui";class tf{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:ef,theme:"default"};static events=Mh.events;static sources=Mh.sources;static version="2.0.2";static imports={delta:fh,parchment:Md,"core/module":Vh,"core/theme":Zh};static debug(e){!0===e&&(e="log"),Ah.level(e)}static find(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Oh.get(e)||ef.find(e,t)}static import(e){return null==this.imports[e]&&Qh.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const e=arguments.length<=0?void 0:arguments[0],t=!!(arguments.length<=1?void 0:arguments[1]),n="attrName"in e?e.attrName:e.blotName;"string"==typeof n?this.register(`formats/${n}`,e,t):Object.keys(e).forEach((n=>{this.register(n,e[n],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[e]||n||Qh.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&"boolean"!=typeof t&&"abstract"!==t.blotName&&ef.register(t),"function"==typeof t.register&&t.register(ef)}}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(e,t){const n=nf(e);if(!n)throw new Error("Invalid Quill container");const r=!t.theme||t.theme===tf.DEFAULTS.theme,a=r?Zh:tf.import(`themes/${t.theme}`);if(!a)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:o,...i}=tf.DEFAULTS,{modules:s,...l}=a.DEFAULTS;let c=rf(t.modules);null!=c&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});const u=ed({},rf(o),rf(s),c),d={...i,...af(l),...af(t)};let h=t.registry;h?t.formats&&Qh.warn('Ignoring "formats" option because "registry" is specified'):h=t.formats?((e,t,n)=>{const r=new od;return Jh.forEach((e=>{const n=t.query(e);n&&r.register(n)})),e.forEach((e=>{let a=t.query(e);a||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,o+=1,o>100){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}})),r})(t.formats,d.registry,Qh):d.registry;return{...d,registry:h,container:n,theme:a,modules:Object.entries(u).reduce(((e,t)=>{let[n,r]=t;if(!r)return e;const a=tf.import(`modules/${n}`);return null==a?(Qh.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:ed({},a.DEFAULTS||{},r)}}),{}),bounds:nf(d.bounds)}}(e,t),this.container=this.options.container,null==this.container)return void Qh.error("Invalid Quill container",e);this.options.debug&&tf.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Oh.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Mh;const r=Sd.blotName,a=this.options.registry.query(r);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Ih(this.scroll),this.selection=new _h(this.scroll,this.emitter),this.composition=new Kh(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Mh.events.EDITOR_CHANGE,(e=>{e===Mh.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(Mh.events.SCROLL_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;of.call(this,(()=>this.editor.update(null,t,a)),e)})),this.emitter.on(Mh.events.SCROLL_EMBED_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;of.call(this,(()=>{const n=(new fh).retain(e.offset(this)).retain({[e.statics.blotName]:t});return this.editor.update(n,[],a)}),tf.sources.USER)})),n){const e=this.clipboard.convert({html:`${n}


    `,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){const t=e;(e=document.createElement("div")).classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=sf(e,t,n),of.call(this,(()=>this.editor.deleteText(e,t)),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mh.sources.API;return of.call(this,(()=>{const n=this.getSelection(!0);let r=new fh;if(null==n)return r;if(this.scroll.query(e,td.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else{if(0===n.length)return this.selection.format(e,t),r;r=this.editor.formatText(n.index,n.length,{[e]:t})}return this.setSelection(n,Mh.sources.SILENT),r}),n)}formatLine(e,t,n,r,a){let o;return[e,t,o,a]=sf(e,t,n,r,a),of.call(this,(()=>this.editor.formatLine(e,t,o)),a,e,0)}formatText(e,t,n,r,a){let o;return[e,t,o,a]=sf(e,t,n,r,a),of.call(this,(()=>this.editor.formatText(e,t,o)),a,e,0)}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;const r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;return[e,t]=sf(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=sf(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=sf(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:tf.sources.API;return of.call(this,(()=>this.editor.insertEmbed(e,t,n)),r,e)}insertText(e,t,n,r,a){let o;return[e,,o,a]=sf(e,0,n,r,a),of.call(this,(()=>this.editor.insertText(e,t,o)),a,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=sf(e,t,n),of.call(this,(()=>this.editor.removeFormat(e,t)),n,e)}scrollRectIntoView(e){((e,t)=>{const n=e.ownerDocument;let r=t,a=e;for(;a;){const e=a===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:Gh(a),i=getComputedStyle(a),s=Xh(r.left,r.right,t.left,t.right,Yh(i.scrollPaddingLeft),Yh(i.scrollPaddingRight)),l=Xh(r.top,r.bottom,t.top,t.bottom,Yh(i.scrollPaddingTop),Yh(i.scrollPaddingBottom));if(s||l)if(e)n.defaultView?.scrollBy(s,l);else{const{scrollLeft:e,scrollTop:t}=a;l&&(a.scrollTop+=l),s&&(a.scrollLeft+=s);const n=a.scrollLeft-e,o=a.scrollTop-t;r={left:r.left-n,top:r.top-o,right:r.right-n,bottom:r.bottom-o}}a=e||"fixed"===i.position?null:(o=a).parentElement||o.getRootNode().host||null}var o})(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mh.sources.API;return of.call(this,(()=>{e=new fh(e);const t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(a)}),t)}setSelection(e,t,n){null==e?this.selection.setRange(null,t||tf.sources.API):([e,t,,n]=sf(e,t,n),this.selection.setRange(new Rh(Math.max(0,e),t),n),n!==Mh.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mh.sources.API;const n=(new fh).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mh.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mh.sources.API;return of.call(this,(()=>(e=new fh(e),this.editor.applyDelta(e))),t,!0)}}function nf(e){return"string"==typeof e?document.querySelector(e):e}function rf(e){return Object.entries(e??{}).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:!0===r?{}:r}}),{})}function af(e){return Object.fromEntries(Object.entries(e).filter((e=>void 0!==e[1])))}function of(e,t,n,r){if(!this.isEnabled()&&t===Mh.sources.USER&&!this.allowReadOnlyEdits)return new fh;let a=null==n?null:this.getSelection();const o=this.editor.delta,i=e();if(null!=a&&(!0===n&&(n=a.index),null==r?a=lf(a,i,t):0!==r&&(a=lf(a,n,r,t)),this.setSelection(a,Mh.sources.SILENT)),i.length()>0){const e=[Mh.events.TEXT_CHANGE,i,o,t];this.emitter.emit(Mh.events.EDITOR_CHANGE,...e),t!==Mh.sources.SILENT&&this.emitter.emit(...e)}return i}function sf(e,t,n,r,a){let o={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(a=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(a=r,r=n,n=t,t=0),"object"==typeof n?(o=n,a=r):"string"==typeof n&&(null!=r?o[n]=r:a=n),[e,t,o,a=a||Mh.sources.API]}function lf(e,t,n,r){const a="number"==typeof n?n:0;if(null==e)return null;let o,i;return t&&"function"==typeof t.transformPosition?[o,i]=[e.index,e.index+e.length].map((e=>t.transformPosition(e,r!==Mh.sources.USER))):[o,i]=[e.index,e.index+e.length].map((e=>e=0?e+a:Math.max(t,e+a))),new Rh(o,i-o)}class cf extends kd{}function uf(e){return e instanceof bh||e instanceof yh}function df(e){return"function"==typeof e.updateContent}function hf(e,t,n){n.reduce(((t,n)=>{const r=hh.Op.length(n);let a=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const r=n.insert;e.insertAt(t,r);const[o]=e.descendant(pd,t),i=xh(o);a=hh.AttributeMap.diff(i,a)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return t;e.insertAt(t,r,n.insert[r]);if(null!=e.scroll.query(r,td.INLINE)){const[n]=e.descendant(pd,t),r=xh(n);a=hh.AttributeMap.diff(r,a)||{}}}return Object.keys(a).forEach((n=>{e.formatAt(t,r,n,a[n])})),t+r}),t)}const ff={scope:td.BLOCK,whitelist:["right","center","justify"]},pf=new nd("align","align",ff),mf=new sd("align","ql-align",ff),vf=new cd("align","text-align",ff);class gf extends cd{value(e){let t=super.value(e);if(!t.startsWith("rgb("))return t;t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");return`#${t.split(",").map((e=>`00${parseInt(e,10).toString(16)}`.slice(-2))).join("")}`}}const bf=new sd("color","ql-color",{scope:td.INLINE}),yf=new gf("color","color",{scope:td.INLINE}),Ef=new sd("background","ql-bg",{scope:td.INLINE}),xf=new gf("background","background-color",{scope:td.INLINE});class wf extends cf{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((e=>e.length()<=1?"":e.domNode.innerText)).join("\n").slice(e,e+t)}html(e,t){return`
    \n${vh(this.code(e,t))}\n
    `}}class Nf extends bh{static TAB=" ";static register(){tf.register(wf)}}class kf extends gh{}kf.blotName="code",kf.tagName="CODE",Nf.blotName="code-block",Nf.className="ql-code-block",Nf.tagName="DIV",wf.blotName="code-block-container",wf.className="ql-code-block-container",wf.tagName="DIV",wf.allowedChildren=[Nf],Nf.allowedChildren=[mh,ph,wh],Nf.requiredContainer=wf;const Of={scope:td.BLOCK,whitelist:["rtl"]},jf=new nd("direction","dir",Of),Lf=new sd("direction","ql-direction",Of),Sf=new cd("direction","direction",Of),Af={scope:td.INLINE,whitelist:["serif","monospace"]},Cf=new sd("font","ql-font",Af);const Mf=new class extends cd{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",Af),Tf=new sd("size","ql-size",{scope:td.INLINE,whitelist:["small","large","huge"]}),Rf=new cd("size","font-size",{scope:td.INLINE,whitelist:["10px","18px","32px"]}),_f=Ah("quill:keyboard"),Pf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class qf extends Vh{static match(e,t){return!["altKey","ctrlKey","metaKey","shiftKey"].some((n=>!!t[n]!==e[n]&&null!==t[n]))&&(t.key===e.key||t.key===e.which)}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){if("string"==typeof e||"number"==typeof e)e={key:e};else{if("object"!=typeof e)return null;e=pu(e)}e.shortKey&&(e[Pf]=e.shortKey,delete e.shortKey);return e}(e);if(null==r)return void _f.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n});(Array.isArray(r.key)?r.key:[r.key]).forEach((e=>{const a={...r,key:e,...t,...n};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing)return;if(229===e.keyCode&&("Enter"===e.key||"Backspace"===e.key))return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((t=>qf.match(e,t)));if(0===t.length)return;const n=tf.find(e.target,!0);if(n&&n.scroll!==this.quill.scroll)return;const r=this.quill.getSelection();if(null==r||!this.quill.hasFocus())return;const[a,o]=this.quill.getLine(r.index),[i,s]=this.quill.getLeaf(r.index),[l,c]=0===r.length?[i,s]:this.quill.getLeaf(r.index+r.length),u=i instanceof Cd?i.value().slice(0,s):"",d=l instanceof Cd?l.value().slice(c):"",h={collapsed:0===r.length,empty:0===r.length&&a.length()<=1,format:this.quill.getFormat(r),line:a,offset:o,prefix:u,suffix:d,event:e};t.some((e=>{if(null!=e.collapsed&&e.collapsed!==h.collapsed)return!1;if(null!=e.empty&&e.empty!==h.empty)return!1;if(null!=e.offset&&e.offset!==h.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((e=>null==h.format[e])))return!1}else if("object"==typeof e.format&&!Object.keys(e.format).every((t=>!0===e.format[t]?null!=h.format[t]:!1===e.format[t]?null==h.format[t]:Ju(e.format[t],h.format[t]))))return!1;return!(null!=e.prefix&&!e.prefix.test(h.prefix))&&(!(null!=e.suffix&&!e.suffix.test(h.suffix))&&!0!==e.handler.call(this,r,h,e))}))&&e.preventDefault()}))}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(0===e.index||this.quill.getLength()<=1)return;let r={};const[a]=this.quill.getLine(e.index);let o=(new fh).retain(e.index-n).delete(n);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(t){if(!("block"===t.statics.blotName&&t.length()<=1)){const t=a.formats(),n=this.quill.getFormat(e.index-1,1);if(r=hh.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){const t=(new fh).retain(e.index+a.length()-2).retain(1,r);o=o.compose(t)}}}}this.quill.updateContents(o,tf.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={};const[a]=this.quill.getLine(e.index);let o=(new fh).retain(e.index).delete(n);if(t.offset>=a.length()-1){const[t]=this.quill.getLine(e.index+1);if(t){const n=a.formats(),i=this.quill.getFormat(e.index,1);r=hh.AttributeMap.diff(n,i)||{},Object.keys(r).length>0&&(o=o.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(o,tf.sources.USER),this.quill.focus()}handleDeleteRange(e){Hf({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce(((e,n)=>(this.quill.scroll.query(n,td.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e)),{}),r=(new fh).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,tf.sources.USER),this.quill.setSelection(e.index+1,tf.sources.SILENT),this.quill.focus()}}const If={bindings:{bold:$f("bold"),italic:$f("italic"),underline:$f("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","+1",tf.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","-1",tf.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){null!=t.format.indent?this.quill.format("indent","-1",tf.sources.USER):null!=t.format.list&&this.quill.format("list",!1,tf.sources.USER)}},"indent code-block":Df(!0),"outdent code-block":Df(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,tf.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const n=(new fh).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,tf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,tf.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,tf.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,tf.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},a=(new fh).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(a,tf.sources.USER),this.quill.setSelection(e.index+1,tf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[n,r]=this.quill.getLine(e.index),a=(new fh).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(a,tf.sources.USER),this.quill.setSelection(e.index+1,tf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[n,r,a,o]=t.getTable(e),i=function(e,t,n,r){if(null==t.prev&&null==t.next)return null==n.prev&&null==n.next?0===r?-1:1:null==n.prev?-1:1;if(null==t.prev)return-1;if(null==t.next)return 1;return null}(0,r,a,o);if(null==i)return;let s=n.offset();if(i<0){const t=(new fh).retain(s).insert("\n");this.quill.updateContents(t,tf.sources.USER),this.quill.setSelection(e.index+1,e.length,tf.sources.SILENT)}else if(i>0){s+=n.length();const e=(new fh).retain(s).insert("\n");this.quill.updateContents(e,tf.sources.USER),this.quill.setSelection(s,tf.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:n,line:r}=t,a=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(a-1,tf.sources.USER):this.quill.setSelection(a+r.length(),tf.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=t.prefix,[r,a]=this.quill.getLine(e.index);if(a>n)return!0;let o;switch(t.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(e.index," ",tf.sources.USER),this.quill.history.cutoff();const i=(new fh).retain(e.index-a).delete(n+1).retain(r.length()-2-a).retain(1,{list:o});return this.quill.updateContents(i,tf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,tf.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,n]=this.quill.getLine(e.index);let r=2,a=t;for(;null!=a&&a.length()<=1&&a.formats()["code-block"];)if(a=a.prev,r-=1,r<=0){const r=(new fh).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,tf.sources.USER),this.quill.setSelection(e.index-1,tf.sources.SILENT),!1}return!0}},"embed left":Bf("ArrowLeft",!1),"embed left shift":Bf("ArrowLeft",!0),"embed right":Bf("ArrowRight",!1),"embed right shift":Bf("ArrowRight",!0),"table down":Ff(!1),"table up":Ff(!0)}};function Df(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n;const a=this.quill.scroll.query("code-block"),{TAB:o}=a;if(0===t.length&&!r.shiftKey)return this.quill.insertText(t.index,o,tf.sources.USER),void this.quill.setSelection(t.index+o.length,tf.sources.SILENT);const i=0===t.length?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:s,length:l}=t;i.forEach(((t,n)=>{e?(t.insertAt(0,o),0===n?s+=o.length:l+=o.length):t.domNode.textContent.startsWith(o)&&(t.deleteAt(0,o.length),0===n?s-=o.length:l-=o.length)})),this.quill.update(tf.sources.USER),this.quill.setSelection(s,l,tf.sources.SILENT)}}}function Bf(e,t){return{key:e,shiftKey:t,altKey:null,["ArrowLeft"===e?"prefix":"suffix"]:/^$/,handler(n){let{index:r}=n;"ArrowRight"===e&&(r+=n.length+1);const[a]=this.quill.getLeaf(r);return!(a instanceof Od)||("ArrowLeft"===e?t?this.quill.setSelection(n.index-1,n.length+1,tf.sources.USER):this.quill.setSelection(n.index-1,tf.sources.USER):t?this.quill.setSelection(n.index,n.length+1,tf.sources.USER):this.quill.setSelection(n.index+n.length+1,tf.sources.USER),!1)}}}function $f(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],tf.sources.USER)}}}function Ff(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){const r=e?"prev":"next",a=n.line,o=a.parent[r];if(null!=o){if("table-row"===o.statics.blotName){let e=o.children.head,t=a;for(;null!=t.prev;)t=t.prev,e=e.next;const r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,tf.sources.USER)}}else{const t=a.table()[r];null!=t&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,tf.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,tf.sources.USER))}return!1}}}function Hf(e){let{quill:t,range:n}=e;const r=t.getLines(n);let a={};if(r.length>1){const e=r[0].formats(),t=r[r.length-1].formats();a=hh.AttributeMap.diff(t,e)||{}}t.deleteText(n,tf.sources.USER),Object.keys(a).length>0&&t.formatLine(n.index,1,a,tf.sources.USER),t.setSelection(n.index,tf.sources.SILENT)}qf.DEFAULTS=If;const Uf=/font-weight:\s*normal/,Vf=["P","OL","UL"],zf=e=>e&&Vf.includes(e.tagName);const Wf=/\bmso-list:[^;]*ignore/i,Kf=/\bmso-list:[^;]*\bl(\d+)/i,Zf=/\bmso-list:[^;]*\blevel(\d+)/i,Gf=e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach((e=>{(e.getAttribute("style")||"").match(Wf)?n.push(e):r.push(e)})),n.forEach((e=>e.parentNode?.removeChild(e)));const a=e.documentElement.innerHTML,o=r.map((e=>((e,t)=>{const n=e.getAttribute("style"),r=n?.match(Kf);if(!r)return null;const a=Number(r[1]),o=n?.match(Zf),i=o?Number(o[1]):1,s=new RegExp(`@list l${a}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=t.match(s);return{id:a,indent:i,type:l&&"bullet"===l[1]?"bullet":"ordered",element:e}})(e,a))).filter((e=>e));for(;o.length;){const e=[];let t=o.shift();for(;t;)e.push(t),t=o.length&&o[0]?.element===t.element.nextElementSibling&&o[0].id===t.id?o.shift():null;const n=document.createElement("ul");e.forEach((e=>{const t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class","ql-indent-"+(e.indent-1)),t.innerHTML=e.element.innerHTML,n.appendChild(t)}));const r=e[0]?.element,{parentNode:a}=r??{};r&&a?.replaceChild(n,r),e.slice(1).forEach((e=>{let{element:t}=e;a?.removeChild(t)}))}};const Yf=[function(e){"urn:schemas-microsoft-com:office:word"===e.documentElement.getAttribute("xmlns:w")&&Gf(e)},function(e){e.querySelector('[id^="docs-internal-guid-"]')&&((e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Uf))).forEach((t=>{const n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)}))})(e),(e=>{Array.from(e.querySelectorAll("br")).filter((e=>zf(e.previousElementSibling)&&zf(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))})(e))}],Xf=Ah("quill:clipboard"),Jf=[[Node.TEXT_NODE,function(e,t,n){let r=e.data;if("O:P"===e.parentElement?.tagName)return t.insert(r.trim());if(!op(e)){if(0===r.trim().length&&r.includes("\n")&&!function(e,t){return e.previousElementSibling&&e.nextElementSibling&&!rp(e.previousElementSibling,t)&&!rp(e.nextElementSibling,t)}(e,n))return t;const a=(e,t)=>{const n=t.replace(/[^\u00a0]/g,"");return n.length<1&&e?" ":n};r=r.replace(/\r\n/g," ").replace(/\n/g," "),r=r.replace(/\s\s+/g,a.bind(a,!0)),(null==e.previousSibling&&null!=e.parentElement&&rp(e.parentElement,n)||e.previousSibling instanceof Element&&rp(e.previousSibling,n))&&(r=r.replace(/^\s+/,a.bind(a,!1))),(null==e.nextSibling&&null!=e.parentElement&&rp(e.parentElement,n)||e.nextSibling instanceof Element&&rp(e.nextSibling,n))&&(r=r.replace(/\s+$/,a.bind(a,!1)))}return t.insert(r)}],[Node.TEXT_NODE,lp],["br",function(e,t){np(t,"\n")||t.insert("\n");return t}],[Node.ELEMENT_NODE,lp],[Node.ELEMENT_NODE,function(e,t,n){const r=n.query(e);if(null==r)return t;if(r.prototype instanceof Od){const t={},a=r.value(e);if(null!=a)return t[r.blotName]=a,(new fh).insert(t,r.formats(e,n))}else if(r.prototype instanceof wd&&!np(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&"function"==typeof r.formats)return tp(t,r.blotName,r.formats(e,n),n);return t}],[Node.ELEMENT_NODE,function(e,t,n){const r=nd.keys(e),a=sd.keys(e),o=cd.keys(e),i={};return r.concat(a).concat(o).forEach((t=>{let r=n.query(t,td.ATTRIBUTE);null!=r&&(i[r.attrName]=r.value(e),i[r.attrName])||(r=Qf[t],null==r||r.attrName!==t&&r.keyName!==t||(i[r.attrName]=r.value(e)||void 0),r=ep[t],null==r||r.attrName!==t&&r.keyName!==t||(r=ep[t],i[r.attrName]=r.value(e)||void 0))})),Object.entries(i).reduce(((e,t)=>{let[r,a]=t;return tp(e,r,a,n)}),t)}],[Node.ELEMENT_NODE,function(e,t,n){const r={},a=e.style||{};"italic"===a.fontStyle&&(r.italic=!0);"underline"===a.textDecoration&&(r.underline=!0);"line-through"===a.textDecoration&&(r.strike=!0);(a.fontWeight?.startsWith("bold")||parseInt(a.fontWeight,10)>=700)&&(r.bold=!0);if(t=Object.entries(r).reduce(((e,t)=>{let[r,a]=t;return tp(e,r,a,n)}),t),parseFloat(a.textIndent||0)>0)return(new fh).insert("\t").concat(t);return t}],["li",function(e,t,n){const r=n.query(e);if(null==r||"list"!==r.blotName||!np(t,"\n"))return t;let a=-1,o=e.parentNode;for(;null!=o;)["OL","UL"].includes(o.tagName)&&(a+=1),o=o.parentNode;return a<=0?t:t.reduce(((e,t)=>t.insert?t.attributes&&"number"==typeof t.attributes.indent?e.push(t):e.insert(t.insert,{indent:a,...t.attributes||{}}):e),new fh)}],["ol, ul",function(e,t,n){const r=e;let a="OL"===r.tagName?"ordered":"bullet";const o=r.getAttribute("data-checked");o&&(a="true"===o?"checked":"unchecked");return tp(t,"list",a,n)}],["pre",function(e,t,n){const r=n.query("code-block"),a=!r||!("formats"in r)||"function"!=typeof r.formats||r.formats(e,n);return tp(t,"code-block",a,n)}],["tr",function(e,t,n){const r="TABLE"===e.parentElement?.tagName?e.parentElement:e.parentElement?.parentElement;if(null!=r){return tp(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n)}return t}],["b",sp("bold")],["i",sp("italic")],["strike",sp("strike")],["style",function(){return new fh}]],Qf=[pf,jf].reduce(((e,t)=>(e[t.keyName]=t,e)),{}),ep=[vf,xf,yf,Sf,Mf,Rf].reduce(((e,t)=>(e[t.keyName]=t,e)),{});function tp(e,t,n,r){return r.query(t)?e.reduce(((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);const a=n?{[t]:n}:{};return e.insert(r.insert,{...a,...r.attributes})}),new fh):e}function np(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.lengthr(t,n,e)),new fh):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce(((o,i)=>{let s=ip(e,i,n,r,a);return i.nodeType===t.ELEMENT_NODE&&(s=n.reduce(((t,n)=>n(i,t,e)),s),s=(a.get(i)||[]).reduce(((t,n)=>n(i,t,e)),s)),o.concat(s)}),new fh):new fh}function sp(e){return(t,n,r)=>tp(n,e,!0,r)}function lp(e,t,n){if(!np(t,"\n")){if(rp(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;null!=r;){if(rp(r,n))return t.insert("\n");const e=n.query(r);if(e&&e.prototype instanceof yh)return t.insert("\n");r=r.firstChild}}}return t}function cp(e,t){let n=t;for(let t=e.length-1;t>=0;t-=1){const r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&up(r.range,n)},n=r.delta.transform(n),0===e[t].delta.length()&&e.splice(t,1)}}function up(e,t){if(!e)return e;const n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}class dp extends Vh{constructor(e,t){super(e,t),e.root.addEventListener("drop",(t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}const r=n&&e.selection.normalizeNative(n);if(r){const n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}}))}upload(e,t){const n=[];Array.from(t).forEach((e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)})),n.length>0&&this.options.handler.call(this,e,n)}}dp.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;const n=t.map((e=>new Promise((t=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}))));Promise.all(n).then((t=>{const n=t.reduce(((e,t)=>e.insert({image:t})),(new fh).retain(e.index).delete(e.length));this.quill.updateContents(n,Mh.sources.USER),this.quill.setSelection(e.index+t.length,Mh.sources.SILENT)}))}};const hp=["insertText","insertReplacementText"];const fp=/Mac/i.test(navigator.platform);tf.register({"blots/block":bh,"blots/block/embed":yh,"blots/break":ph,"blots/container":cf,"blots/cursor":wh,"blots/embed":Wh,"blots/inline":gh,"blots/scroll":class extends Sd{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=bh;static allowedChildren=[bh,yh,cf];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(e=>this.handleDragStart(e)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Mh.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Mh.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Mh.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,r]=this.line(e),[a]=this.line(e+t);if(super.deleteAt(e,t),null!=a&&n!==a&&r>0){if(n instanceof yh||a instanceof yh)return void this.optimize();const e=a.children.head instanceof ph?null:a.children.head;n.moveChildren(a,e),n.remove()}this.optimize()}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(null==n||null==this.scroll.query(t,td.BLOCK)){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),null==n&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{const e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===td.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat((new fh).insert("\n"))),r=n.pop();if(null==r)return;this.batchStart();const a=n.shift();if(a){const t="block"===a.type&&(0===a.delta.length()||!this.descendant(yh,e)[0]&&e{this.formatAt(o-1,1,e,s[e])})),e=o}let[o,i]=this.children.find(e);if(n.length&&(o&&(o=o.split(i),i=0),n.forEach((e=>{if("block"===e.type){hf(this.createBlock(e.attributes,o||void 0),0,e.delta)}else{const t=this.create(e.key,e.value);this.insertBefore(t,o||void 0),Object.keys(e.attributes).forEach((n=>{t.format(n,e.attributes[n])}))}}))),"block"===r.type&&r.delta.length()){hf(this,o?o.offset(o.scroll)+i:this.length(),r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,r]=t;return n instanceof pd?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(uf,e)}lines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(e,t,r)=>{let a=[],o=r;return e.children.forEachAt(t,r,((e,t,r)=>{uf(e)?a.push(e):e instanceof kd&&(a=a.concat(n(e,t,o))),o-=r})),a};return n(this,e,t)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Mh.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch)return void(Array.isArray(e)&&(this.batch=this.batch.concat(e)));let t=Mh.sources.USER;"string"==typeof e&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),(e=e.filter((e=>{let{target:t}=e;const n=this.find(t,!0);return n&&!df(n)}))).length>0&&this.emitter.emit(Mh.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Mh.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[r]=this.descendant((e=>e instanceof yh),e);r&&r.statics.blotName===t&&df(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new fh;return e.forEach((e=>{const r=e?.insert;if(r)if("string"==typeof r){const a=r.split("\n");a.slice(0,-1).forEach((r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new fh}));const o=a[a.length-1];o&&n.insert(o,e.attributes)}else{const a=Object.keys(r)[0];if(!a)return;this.query(a,td.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new fh,t.push({type:"blockEmbed",key:a,value:r[a],attributes:e.attributes??{}}))}})),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const r={};Object.entries(e).forEach((e=>{let[t,a]=e;null!=this.query(t,td.BLOCK&td.BLOT)?n=t:r[t]=a}));const a=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(a,t||void 0);const o=a.length();return Object.entries(r).forEach((e=>{let[t,n]=e;a.formatAt(0,o,t,n)})),a}},"blots/text":mh,"modules/clipboard":class extends Vh{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(e=>this.onCaptureCopy(e,!1))),this.quill.root.addEventListener("cut",(e=>this.onCaptureCopy(e,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Jf.concat(this.options.matchers??[]).forEach((e=>{let[t,n]=e;this.addMatcher(t,n)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r[Nf.blotName])return(new fh).insert(n||"",{[Nf.blotName]:r[Nf.blotName]});if(!t)return(new fh).insert(n||"",r);const a=this.convertHTML(t);return np(a,"\n")&&(null==a.ops[a.ops.length-1].attributes||r.table)?a.compose((new fh).retain(a.length()-1).delete(1)):a}normalizeHTML(e){(e=>{e.documentElement&&Yf.forEach((t=>{t(e)}))})(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,r=new WeakMap,[a,o]=this.prepareMatching(n,r);return ip(this.quill.scroll,n,a,o,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tf.sources.API;if("string"==typeof e){const n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,tf.sources.SILENT)}else{const r=this.convert({html:t,text:""});this.quill.updateContents((new fh).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),tf.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(null==n)return;const{html:r,text:a}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",a),e.clipboardData?.setData("text/html",r),t&&Hf({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((e=>"#"!==e[0])).join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(null==t)return;const n=e.clipboardData?.getData("text/html");let r=e.clipboardData?.getData("text/plain");if(!n&&!r){const t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}const a=Array.from(e.clipboardData?.files||[]);if(!n&&a.length>0)this.quill.uploader.upload(t,a);else{if(n&&a.length>0){const e=(new DOMParser).parseFromString(n,"text/html");if(1===e.body.childElementCount&&"IMG"===e.body.firstElementChild?.tagName)return void this.quill.uploader.upload(t,a)}this.onPaste(t,{html:n,text:r})}}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t;const a=this.quill.getFormat(e.index),o=this.convert({text:n,html:r},a);Xf.log("onPaste",o,{text:n,html:r});const i=(new fh).retain(e.index).delete(e.length).concat(o);this.quill.updateContents(i,tf.sources.USER),this.quill.setSelection(i.length()-e.length,tf.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],r=[];return this.matchers.forEach((a=>{const[o,i]=a;switch(o){case Node.TEXT_NODE:r.push(i);break;case Node.ELEMENT_NODE:n.push(i);break;default:Array.from(e.querySelectorAll(o)).forEach((e=>{if(t.has(e)){const n=t.get(e);n?.push(i)}else t.set(e,[i])}))}})),[n,r]}},"modules/history":class extends Vh{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(tf.events.EDITOR_CHANGE,((e,t,n,r)=>{e===tf.events.SELECTION_CHANGE?t&&r!==tf.sources.SILENT&&(this.currentRange=t):e===tf.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&r!==tf.sources.USER?this.transform(t):this.record(t,n)),this.currentRange=up(this.currentRange,t))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(e=>{"historyUndo"===e.inputType?(this.undo(),e.preventDefault()):"historyRedo"===e.inputType&&(this.redo(),e.preventDefault())}))}change(e,t){if(0===this.stack[e].length)return;const n=this.stack[e].pop();if(!n)return;const r=this.quill.getContents(),a=n.delta.invert(r);this.stack[t].push({delta:a,range:up(n.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,tf.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(0===e.ops.length)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=a;0!==n.length()&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){cp(this.stack.undo,e),cp(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,tf.sources.USER);else{const t=function(e,t){const n=t.reduce(((e,t)=>e+(t.delete||0)),0);let r=t.length()-n;(function(e,t){const n=t.ops[t.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some((t=>null!=e.query(t,td.BLOCK)));return!1})(e,t)&&(r-=1);return r}(this.quill.scroll,e.delta);this.quill.setSelection(t,tf.sources.USER)}}},"modules/keyboard":qf,"modules/uploader":dp,"modules/input":class extends Vh{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(e=>{this.handleBeforeInput(e)})),/Android/i.test(navigator.userAgent)||e.on(tf.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){Hf({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===e.length)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new fh).retain(e.index).insert(t,n),tf.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,tf.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!hp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||!0===t.collapsed)return;const n=function(e){if("string"==typeof e.data)return e.data;if(e.dataTransfer?.types.includes("text/plain"))return e.dataTransfer.getData("text/plain");return null}(e);if(null==n)return;const r=this.quill.selection.normalizeNative(t),a=r?this.quill.selection.normalizedToRange(r):null;a&&this.replaceText(a,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}},"modules/uiNode":class extends Vh{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof bd&&n.uiNode))return!0;const a="rtl"===getComputedStyle(n.domNode).direction;return!!(a&&"ArrowRight"!==r.key||!a&&"ArrowLeft"!==r.key)||(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),tf.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&(e=>"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"Home"===e.key||!(!fp||"a"!==e.key||!0!==e.ctrlKey))(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(!0!==t.collapsed||0!==t.startOffset)return;const n=this.quill.scroll.find(t.startContainer);if(!(n instanceof bd&&n.uiNode))return;const r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}}});const pp=new class extends sd{add(e,t){let n=0;if("+1"===t||"-1"===t){const r=this.value(e)||0;n="+1"===t?r+1:r-1}else"number"==typeof t&&(n=t);return 0===n?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:td.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class mp extends cf{}mp.blotName="list-container",mp.tagName="OL";class vp extends bh{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){tf.register(mp)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;const r=this.statics.formats(t,e);"checked"===r?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===r&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}vp.blotName="list",vp.tagName="LI",mp.allowedChildren=[vp],vp.requiredContainer=mp;class gp extends gh{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}let bp=class extends gh{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return yp(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("href",this.constructor.sanitize(t)):super.format(e,t)}};function yp(e,t){const n=document.createElement("a");n.href=e;const r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}const Ep=["alt","height","width"];const xp=["height","width"];const wp=new sd("code-token","hljs",{scope:td.INLINE});class Np extends gh{static formats(e,t){for(;null!=e&&e!==t.domNode;){if(e.classList&&e.classList.contains(Nf.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),wp.add(this.domNode,n)}format(e,t){e!==Np.blotName?super.format(e,t):t?wp.add(this.domNode,t):(wp.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),wp.value(this.domNode)||this.unwrap()}}Np.blotName="code-token",Np.className="ql-token";class kp extends Nf{static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Np.blotName,!1),super.replaceWith(e,t)}}class Op extends wf{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===kp.blotName&&(this.forceNext=!0,this.children.forEach((n=>{n.format(e,t)})))}formatAt(e,t,n,r){n===kp.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=`${Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).map((e=>e.textContent)).join("\n")}\n`,r=kp.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||null==this.cachedText){const t=this.children.reduce(((e,t)=>e.concat(Eh(t,!1))),new fh),a=e(n,r);t.diff(a).reduce(((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach((t=>{[kp.blotName,Np.blotName].includes(t)&&this.formatAt(e,n,t,r[t])})),e+n):e}),0)}this.cachedText=n,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`
    \n${vh(this.code(e,t))}\n
    `}optimize(e){if(super.optimize(e),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const e=kp.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Op.allowedChildren=[kp],kp.requiredContainer=Op,kp.allowedChildren=[Np,wh,mh,ph];class jp extends Vh{static register(){tf.register(Np,!0),tf.register(kp,!0),tf.register(Op,!0)}constructor(e,t){if(super(e,t),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((e,t)=>{let{key:n}=t;return e[n]=!0,e}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(tf.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Op))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((e=>{let{key:n,label:r}=e;const a=t.ownerDocument.createElement("option");a.textContent=r,a.setAttribute("value",n),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(kp.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),null==e.uiNode&&(e.attachUI(t),e.children.head&&(t.value=kp.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(tf.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(tf.sources.USER);const n=this.quill.getSelection();(null==e?this.quill.scroll.descendants(Op):[e]).forEach((e=>{e.highlight(this.highlightBlot,t)})),this.quill.update(tf.sources.SILENT),null!=n&&this.quill.setSelection(n,tf.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(t=this.languages[t]?t:"plain","plain"===t)return vh(e).split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[Nf.blotName]:t}),e.insert(n))),new fh);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Nf.className),n.innerHTML=((e,t,n)=>{if("string"==typeof e.versionString){const r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value})(this.options.hljs,t,e),ip(this.quill.scroll,n,[(e,t)=>{const n=wp.value(e);return n?t.compose((new fh).retain(t.length(),{[Np.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[Nf.blotName]:t}),e.insert(n))),n)],new WeakMap)}}jp.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class Lp extends bh{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Mp()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Lp.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Sp extends cf{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach((e=>{if(null==e.next)return;const t=e.formats(),n=e.next.formats();if(t.table!==n.table){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class Ap extends cf{static blotName="table-body";static tagName="TBODY"}class Cp extends cf{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Sp),t=e.reduce(((e,t)=>Math.max(t.children.length,e)),0);e.forEach((e=>{new Array(t-e.children.length).fill(0).forEach((()=>{let t;null!=e.children.head&&(t=Lp.formats(e.children.head.domNode));const n=this.scroll.create(Lp.blotName,t);e.appendChild(n),n.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(Ap);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e);null!=n&&n.remove()}))}insertColumn(e){const[t]=this.descendant(Ap);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e),r=Lp.formats(t.children.head.domNode),a=this.scroll.create(Lp.blotName,r);t.insertBefore(a,n)}))}insertRow(e){const[t]=this.descendant(Ap);if(null==t||null==t.children.head)return;const n=Mp(),r=this.scroll.create(Sp.blotName);t.children.head.children.forEach((()=>{const e=this.scroll.create(Lp.blotName,n);r.appendChild(e)}));const a=t.children.at(e);t.insertBefore(r,a)}rows(){const e=this.children.head;return null==e?[]:e.children.map((e=>e))}}function Mp(){return`row-${Math.random().toString(36).slice(2,6)}`}Cp.allowedChildren=[Ap],Ap.requiredContainer=Cp,Ap.allowedChildren=[Sp],Sp.requiredContainer=Ap,Sp.allowedChildren=[Lp],Lp.requiredContainer=Sp;const Tp=Ah("quill:toolbar");class Rp extends Vh{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const t=document.createElement("div");t.setAttribute("role","toolbar"),function(e,t){Array.isArray(t[0])||(t=[t]);t.forEach((t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach((e=>{if("string"==typeof e)_p(n,e);else{const t=Object.keys(e)[0],r=e[t];Array.isArray(r)?function(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach((e=>{const t=document.createElement("option");!1!==e?t.setAttribute("value",String(e)):t.setAttribute("selected","selected"),r.appendChild(t)})),e.appendChild(r)}(n,t,r):_p(n,t,r)}})),e.appendChild(n)}))}(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((e=>{const t=this.options.handlers?.[e];t&&this.addHandler(e,t)})),Array.from(this.container.querySelectorAll("button, select")).forEach((e=>{this.attach(e)})),this.quill.on(tf.events.EDITOR_CHANGE,(()=>{const[e]=this.quill.selection.getRange();this.update(e)}))):Tp.error("Container required for toolbar",this.options)}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void Tp.warn("ignoring attaching to nonexistent format",t,e);const n="SELECT"===e.tagName?"change":"click";e.addEventListener(n,(n=>{let r;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];r=!t.hasAttribute("selected")&&(t.value||!1)}else r=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),n.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(null!=this.handlers[t])this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof Od){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new fh).retain(a.index).delete(a.length).insert({[t]:r}),tf.sources.USER)}else this.quill.format(t,r,tf.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=null==e?{}:this.quill.getFormat(e);this.controls.forEach((n=>{const[r,a]=n;if("SELECT"===a.tagName){let n=null;if(null==e)n=null;else if(null==t[r])n=a.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];"string"==typeof e&&(e=e.replace(/"/g,'\\"')),n=a.querySelector(`option[value="${e}"]`)}null==n?(a.value="",a.selectedIndex=-1):n.selected=!0}else if(null==e)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const e=t[r],n=e===a.getAttribute("value")||null!=e&&e.toString()===a.getAttribute("value")||null==e&&!a.getAttribute("value");a.classList.toggle("ql-active",n),a.setAttribute("aria-pressed",n.toString())}else{const e=null!=t[r];a.classList.toggle("ql-active",e),a.setAttribute("aria-pressed",e.toString())}}))}}function _p(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),null!=n?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}Rp.DEFAULTS={},Rp.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(null!=e)if(0===e.length){const e=this.quill.getFormat();Object.keys(e).forEach((e=>{null!=this.quill.scroll.query(e,td.INLINE)&&this.quill.format(e,!1,tf.sources.USER)}))}else this.quill.removeFormat(e.index,e.length,tf.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();"rtl"===e&&null==t?this.quill.format("align","right",tf.sources.USER):e||"right"!==t||this.quill.format("align",!1,tf.sources.USER),this.quill.format("direction",e,tf.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if("+1"===e||"-1"===e){let t="+1"===e?1:-1;"rtl"===n.direction&&(t*=-1),this.quill.format("indent",r+t,tf.sources.USER)}},link(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,tf.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,tf.sources.USER):this.quill.format("list","unchecked",tf.sources.USER):this.quill.format("list",e,tf.sources.USER)}}};const Pp='';var qp={align:{"":'',center:'',right:'',justify:''},background:'',blockquote:'',bold:'',clean:'',code:Pp,"code-block":Pp,color:'',direction:{"":'',rtl:''},formula:'',header:{1:'',2:'',3:'',4:'',5:'',6:''},italic:'',image:'',indent:{"+1":'',"-1":''},link:'',list:{bullet:'',check:'',ordered:''},script:{sub:'',super:''},strike:'',table:'',underline:'',video:''};let Ip=0;function Dp(e,t){e.setAttribute(t,`${!("true"===e.getAttribute(t))}`)}class Bp{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(()=>{this.togglePicker()})),this.label.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Dp(this.label,"aria-expanded"),Dp(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault()}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML='',e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Ip}`,Ip+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const n=this.buildItem(t);e.appendChild(n),!0===t.selected&&this.selectItem(n)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);const t=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class $p extends Bp{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((e=>{e.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=r:n.style.fill=r)}}class Fp extends Bp{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((e=>{e.innerHTML=t[e.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}class Hp{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(e=>{const{overflowY:t}=getComputedStyle(e,null);return"visible"!==t&&"clip"!==t})(this.quill.root)&&this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=-1*this.quill.root.scrollTop+"px"})),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let o=0;if(a.right>r.right&&(o=r.right-a.right,this.root.style.left=`${t+o}px`),a.leftr.bottom){const t=a.bottom-a.top,r=e.bottom-e.top+t;this.root.style.top=n-r+"px",this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Up=[!1,"center","right","justify"],Vp=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],zp=[!1,"serif","monospace"],Wp=["1","2","3",!1],Kp=["small",!1,"large","huge"];class Zp extends Zh{constructor(e,t){super(e,t);const n=t=>{document.body.contains(e.root)?(null==this.tooltip||this.tooltip.root.contains(t.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((e=>{e.container.contains(t.target)||e.close()}))):document.body.removeEventListener("click",n)};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return"toolbar"===e&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((e=>{(e.getAttribute("class")||"").split(/\s+/).forEach((n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{const r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((e=>{if(e.classList.contains("ql-align")&&(null==e.querySelector("option")&&Yp(e,Up),"object"==typeof t.align))return new Fp(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){const n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&Yp(e,Vp,"background"===n?"#ffffff":"#000000"),new $p(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?Yp(e,zp):e.classList.contains("ql-header")?Yp(e,Wp):e.classList.contains("ql-size")&&Yp(e,Kp)),new Bp(e)}));this.quill.on(Mh.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((e=>{e.update()}))}))}}Zp.DEFAULTS=ed({},Zh.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");null==e&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",(()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""})),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Gp extends Hp{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{"Enter"===e.key?(this.save(),e.preventDefault()):"Escape"===e.key&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Mh.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Mh.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=function(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t)return`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`;if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`;return e}(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(null!=t){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,Mh.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",Mh.sources.USER),this.quill.setSelection(n+2,Mh.sources.USER)}break}}this.textbox.value="",this.hide()}}function Yp(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((t=>{const r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)}))}const Xp=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Jp extends Gp{static TEMPLATE=['','
    ','','',"
    "].join("");constructor(e,t){super(e,t),this.quill.on(Mh.events.EDITOR_CHANGE,((e,t,n,r)=>{if(e===Mh.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===Mh.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const e=this.quill.getLines(t.index,t.length);if(1===e.length){const e=this.quill.getBounds(t);null!=e&&this.position(e)}else{const n=e[e.length-1],r=this.quill.getIndex(n),a=Math.min(n.length()-1,t.index+t.length-r),o=this.quill.getBounds(new Rh(r,a));null!=o&&this.position(o)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(Mh.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(null!=e){const t=this.quill.getBounds(e);null!=t&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==t&&(n.style.marginLeft=-1*t-n.offsetWidth/2+"px"),t}}class Qp extends Zp{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=Xp),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Jp(this.quill,this.options.bounds),null!=e.container&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),qp),this.buildPickers(e.container.querySelectorAll("select"),qp))}}Qp.DEFAULTS=ed({},Zp.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,tf.sources.USER)}}}}});const em=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class tm extends Gp{static TEMPLATE=['','','',''].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(null!=this.linkRange){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,Mh.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(Mh.events.SELECTION_CHANGE,((e,t,n)=>{if(null!=e){if(0===e.length&&n===Mh.sources.USER){const[t,n]=this.quill.scroll.descendant(bp,e.index);if(null!=t){this.linkRange=new Rh(e.index-n,t.length());const r=bp.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();const a=this.quill.getBounds(this.linkRange);return void(null!=a&&this.position(a))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class nm extends Zp{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=em),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){null!=e.container&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),qp),this.buildPickers(e.container.querySelectorAll("select"),qp),this.tooltip=new tm(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,n)=>{e.handlers.link.call(e,!n.format.link)})))}}nm.DEFAULTS=ed({},Zp.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const e=this.quill.getSelection();if(null==e||0===e.length)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&0!==t.indexOf("mailto:")&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,tf.sources.USER)}}}}}),tf.register({"attributors/attribute/direction":jf,"attributors/class/align":mf,"attributors/class/background":Ef,"attributors/class/color":bf,"attributors/class/direction":Lf,"attributors/class/font":Cf,"attributors/class/size":Tf,"attributors/style/align":vf,"attributors/style/background":xf,"attributors/style/color":yf,"attributors/style/direction":Sf,"attributors/style/font":Mf,"attributors/style/size":Rf},!0),tf.register({"formats/align":mf,"formats/direction":Lf,"formats/indent":pp,"formats/background":xf,"formats/color":yf,"formats/font":Cf,"formats/size":Tf,"formats/blockquote":class extends bh{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":Nf,"formats/header":class extends bh{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},"formats/list":vp,"formats/bold":gp,"formats/code":kf,"formats/italic":class extends gp{static blotName="italic";static tagName=["EM","I"]},"formats/link":bp,"formats/script":class extends gh{static blotName="script";static tagName=["SUB","SUP"];static create(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):super.create(e)}static formats(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}},"formats/strike":class extends gp{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends gh{static blotName="underline";static tagName="U"},"formats/formula":class extends Wh{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return"string"==typeof e&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`${e}`}},"formats/image":class extends Od{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Ep.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return yp(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Ep.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},"formats/video":class extends yh{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return xp.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static sanitize(e){return bp.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){xp.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`${e}`}},"modules/syntax":jp,"modules/table":class extends Vh{static register(){tf.register(Lp),tf.register(Sp),tf.register(Ap),tf.register(Cp)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Cp).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();null!=t&&(e.deleteColumn(t.cellOffset()),this.quill.update(tf.sources.USER))}deleteRow(){const[,e]=this.getTable();null!=e&&(e.remove(),this.quill.update(tf.sources.USER))}deleteTable(){const[e]=this.getTable();if(null==e)return;const t=e.offset();e.remove(),this.quill.update(tf.sources.USER),this.quill.setSelection(t,tf.sources.SILENT)}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==Lp.blotName)return[null,null,null,-1];const r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const o=a.cellOffset();n.insertColumn(o+e),this.quill.update(tf.sources.USER);let i=r.rowOffset();0===e&&(i+=1),this.quill.setSelection(t.index+i,t.length,tf.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const o=r.rowOffset();n.insertRow(o+e),this.quill.update(tf.sources.USER),e>0?this.quill.setSelection(t,tf.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,tf.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(null==n)return;const r=new Array(e).fill(0).reduce((e=>{const n=new Array(t).fill("\n").join("");return e.insert(n,{table:Mp()})}),(new fh).retain(n.index));this.quill.updateContents(r,tf.sources.USER),this.quill.setSelection(n.index,tf.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(tf.events.SCROLL_OPTIMIZE,(e=>{e.some((e=>!!["TD","TR","TBODY","TABLE"].includes(e.target.tagName)&&(this.quill.once(tf.events.TEXT_CHANGE,((e,t,n)=>{n===tf.sources.USER&&this.balanceTables()})),!0)))}))}},"modules/toolbar":Rp,"themes/bubble":Qp,"themes/snow":nm,"ui/icons":qp,"ui/picker":Bp,"ui/icon-picker":Fp,"ui/color-picker":$p,"ui/tooltip":Hp},!0);var rm=function(t){var n=t.className,r=s(t,["className"]);return e.createElement(Ja.Control,i({as:"input",type:"datetime-local",className:n},r))};function am(e){return am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(e)}function om(e){var t=function(e,t){if("object"!=am(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=am(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==am(t)?t:String(t)}function im(e,t,n){return(t=om(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sm(e,t){if(null==e)return{};var n,r,a=f(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}rm.Feedback=ka;var lm=NaN,cm="[object Symbol]",um=/^\s+|\s+$/g,dm=/^[-+]0x[0-9a-f]+$/i,hm=/^0b[01]+$/i,fm=/^0o[0-7]+$/i,pm=parseInt,mm="object"==typeof l&&l&&l.Object===Object&&l,vm="object"==typeof self&&self&&self.Object===Object&&self,gm=mm||vm||Function("return this")(),bm=Object.prototype.toString,ym=Math.max,Em=Math.min,xm=function(){return gm.Date.now()};function wm(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Nm(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&bm.call(e)==cm}(e))return lm;if(wm(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=wm(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(um,"");var n=hm.test(e);return n||fm.test(e)?pm(e.slice(2),n?2:8):dm.test(e)?lm:+e}var km=function(e,t,n){var r,a,o,i,s,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,o=a;return r=a=void 0,c=t,i=e.apply(o,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=o}function m(){var e=xm();if(p(e))return v(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?Em(n,o-(e-c)):n}(e))}function v(e){return s=void 0,h&&r?f(e):(r=a=void 0,i)}function g(){var e=xm(),n=p(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?f(e):i}(l);if(d)return s=setTimeout(m,t),f(l)}return void 0===s&&(s=setTimeout(m,t)),i}return t=Nm(t)||0,wm(n)&&(u=!!n.leading,o=(d="maxWait"in n)?ym(Nm(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?i:v(xm())},g},Om=c(km),jm="label";function Lm(e){return"string"==typeof e?e:jm}function Sm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Am=0;function Cm(e){return"function"==typeof e}function Mm(e){return"string"==typeof e}function Tm(){}function Rm(e,t){var n={};return t.forEach((function(t){n[t]=e[t]})),n}function _m(e,t){return Mm(e)||!Sm(e,"paginationOption")&&!Sm(e,"customOption")?(n=Cm(t)?t(e):Mm(e)?e:e[t],Mm(n)||("production"!==process.env.NODE_ENV?v(!1,"One or more options does not have a valid label string. Check the `labelKey` prop to ensure that it matches the correct option key and provides a string for filtering and display."):v(!1)),n):e[Lm(t)];var n}var Pm=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=r;0!=a--;){var i=o[a];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n},qm=c(Pm);function Im(e,t){if(!Mm(e))return e[t]}var Dm=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹÐ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"ŒŒ"},{base:"oe",letters:"œœ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}].reduce((function(e,t){var n=t.base;return t.letters.split("").forEach((function(t){e[t]=n})),e}),{}),Bm="̀-ͯ",$m="゙゚";function Fm(e){return e.normalize("NFD").replace(new RegExp("[".concat(Bm).concat($m,"]"),"g"),"").replace(/[^\u0000-\u007E]/g,(function(e){return Dm[e]||e}))}var Hm={};function Um(e,t){if(!e&&-1!==t.indexOf("deprecated")){if(Hm[t])return;Hm[t]=!0}for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a1?arguments[1]:void 0;return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","-item-").concat(e)}var Xm=["activeIndex","id","isFocused","isMenuShown","multiple","onClick","onFocus","placeholder"];function Jm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qm(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},h=Sm(u,"className")?String(u.className):void 0;return Qm(Qm(Qm(Qm({autoComplete:"off",placeholder:l,type:"text"},u),c),{},{"aria-activedescendant":t>=0?Ym(n,t):void 0,"aria-autocomplete":"both","aria-expanded":a,"aria-haspopup":"listbox","aria-multiselectable":o||void 0,"aria-owns":a?n:void 0,className:d((e={},im(e,h||"",!o),im(e,"focus",r),e))},o&&{inputClassName:h}),{},{onClick:i,onFocus:s,role:"combobox"})}};function tv(e){var t=e.activeItem,n=e.labelKey,r=e.multiple,a=e.selected,o=e.text;return t?_m(t,n):!r&&a.length&&a[0]?_m(a[0],n):o}function nv(e){var t=e.allowNew,n=e.highlightOnlyResult,r=e.results;return!(!n||t)&&(1===r.length&&!Im(r[0],"disabled"))}function rv(e,t){var n=t[e];return!!n&&!!Im(n,"disabled")}function av(e,t,n){for(var r=e;rv(r,n);)r+="ArrowUp"===t?-1:1;return r}function ov(e){e.preventDefault()}function iv(e){return"lg"===e}function sv(e){return"sm"===e}var lv=["className","isInvalid","isValid","size"];function cv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t-1||s.length&&!i)return"";var c=_m(n,o),u=Gm(c.toLowerCase(),l.toLowerCase());return u&&0===u.start?l+c.slice(u.end,c.length):""}(t);e.useEffect((function(){n||u.length||s()}));var f=e.useRef(!0);e.useEffect((function(){f.current?f.current=!1:c(o)}),[o,c]);var p=Mv(Mv({},Rm(t,Rv)),{},{getInputProps:ev(Mv(Mv({},Rm(t,Tv)),{},{onKeyDown:function(e){if(l(e),a){var n="Enter"===e.key&&nv(t),r=h&&function(e,t){var n=!1;return"ArrowRight"===e.key&&(n=!Wm(e.currentTarget)||e.currentTarget.selectionStart===e.currentTarget.value.length),"Tab"===e.key&&(e.preventDefault(),n=!0),t?t(n,e):n}(e,d);(n||r)&&i(a)}},value:tv(t)}))}),m=Mv(Mv({},Rm(t,_v)),{},{hintText:h,isOnlyResult:nv(t)});return e.createElement(Sv.Provider,{value:m},Cm(r)?r(p):r)};function qv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Iv(e){for(var t=1;t1&&(i=i.slice(0,1))),{activeIndex:-1,activeItem:void 0,initialItem:void 0,isFocused:!1,selected:i,showMenu:n,shownResults:a,text:s}}function Bv(e,t){return Iv(Iv({},Dv(t)),{},{isFocused:e.isFocused,selected:[],text:""})}function $v(e){return Iv(Iv({},e),{},{isFocused:!0,showMenu:!0})}function Fv(e,t){var n=Dv(t),r=n.activeIndex,a=n.activeItem,o=n.initialItem,i=n.shownResults;return Iv(Iv({},e),{},{activeIndex:r,activeItem:a,initialItem:o,showMenu:!1,shownResults:i})}function Hv(e,t){return e.showMenu?Fv(e,t):Iv(Iv({},e),{},{showMenu:!0})}var Uv=["onChange"];function Vv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zv(e){for(var t=1;t=0?e.activeItem:void 0}}))})),im(Nv(e),"_handleActiveItemChange",(function(t){qm(t,e.state.activeItem)||e.setState({activeItem:t})})),im(Nv(e),"_handleBlur",(function(t){t.persist(),e.setState({isFocused:!1},(function(){return e.props.onBlur(t)}))})),im(Nv(e),"_handleChange",(function(t){e.props.onChange&&e.props.onChange(t)})),im(Nv(e),"_handleClear",(function(){e.inputNode&&function(e,t){var n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value");n&&n.set&&n.set.call(e,t);var r=new Event("input",{bubbles:!0});e.dispatchEvent(r)}(e.inputNode,""),e.setState(Bv,(function(){e.props.multiple&&e._handleChange([])}))})),im(Nv(e),"_handleClick",(function(t){var n;t.persist();var r=null===(n=e.props.inputProps)||void 0===n?void 0:n.onClick;e.setState($v,(function(){return Cm(r)&&r(t)}))})),im(Nv(e),"_handleFocus",(function(t){t.persist(),e.setState($v,(function(){return e.props.onFocus(t)}))})),im(Nv(e),"_handleInitialItemChange",(function(t){qm(t,e.state.initialItem)||e.setState({initialItem:t})})),im(Nv(e),"_handleInputChange",(function(t){t.persist();var n=t.currentTarget.value,r=e.props,a=r.multiple,o=r.onInputChange,i=e.state.selected.length&&!a;e.setState((function(e,t){var r=Dv(t),a=r.activeIndex,o=r.activeItem,s=r.shownResults;return{activeIndex:a,activeItem:o,selected:i?[]:e.selected,showMenu:!0,shownResults:s,text:n}}),(function(){o(n,t),i&&e._handleChange([])}))})),im(Nv(e),"_handleKeyDown",(function(t){var n,r,a,o,i=e.state.activeItem;if(!e.isMenuShown)return"ArrowUp"!==t.key&&"ArrowDown"!==t.key||e.setState({showMenu:!0}),void e.props.onKeyDown(t);switch(t.key){case"ArrowUp":case"ArrowDown":t.preventDefault(),e._handleActiveIndexChange((n=e.state.activeIndex,r=t.key,a=e.items,o=n,(o=av(o+="ArrowUp"===r?-1:1,r,a))===a.length?o=-1:-2===o&&(o=av(o=a.length-1,r,a)),o));break;case"Enter":t.preventDefault(),i&&e._handleMenuItemSelect(i,t);break;case"Escape":case"Tab":e.hideMenu()}e.props.onKeyDown(t)})),im(Nv(e),"_handleMenuItemSelect",(function(t,n){Im(t,"paginationOption")?e._handlePaginate(n):e._handleSelectionAdd(t)})),im(Nv(e),"_handlePaginate",(function(t){t.persist(),e.setState((function(e,t){return{shownResults:e.shownResults+t.maxResults}}),(function(){return e.props.onPaginate(t,e.state.shownResults)}))})),im(Nv(e),"_handleSelectionAdd",(function(t){var n,r,a,o=e.props,i=o.multiple,s=o.labelKey,l=t;!Mm(l)&&l.customOption&&(l=zv(zv({},l),{},{id:(a="new-id-",Am+=1,(null==a?"":String(a))+Am)})),i?(n=e.state.selected.concat(l),r=""):(n=[l],r=_m(l,s)),e.setState((function(e,t){return zv(zv({},Fv(e,t)),{},{initialItem:l,selected:n,text:r})}),(function(){return e._handleChange(n)}))})),im(Nv(e),"_handleSelectionRemove",(function(t){var n=e.state.selected.filter((function(e){return!qm(e,t)}));e.focus(),e.setState((function(e,t){return zv(zv({},Fv(e,t)),{},{selected:n})}),(function(){return e._handleChange(n)}))})),e}return wv(r,[{key:"componentDidMount",value:function(){this.props.autoFocus&&this.focus()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.labelKey,a=n.multiple,o=n.selected;!function(e,t){var n,r,a,o=!e&&t;o?(n="uncontrolled",r="controlled",a="an"):(n="controlled",r="uncontrolled",a="a"),Um(!(o||e&&!t),"You are changing ".concat(a," ").concat(n," typeahead to be ").concat(r,". ")+"Input elements should not switch from ".concat(n," to ").concat(r," (or vice versa). ")+"Decide between using a controlled or uncontrolled element for the lifetime of the component.")}(o,e.selected),o&&!qm(o,t.selected)&&(this.setState({selected:o}),a||this.setState({text:o.length?_m(o[0],r):""}))}},{key:"render",value:function(){var t=this.props;t.onChange;var n=zv(zv({},sm(t,Uv)),this.state),r=n.filterBy,a=n.labelKey,o=n.options,i=n.paginate,s=n.shownResults,l=n.text;this.isMenuShown=function(e){var t=e.open,n=e.minLength,r=e.showMenu,a=e.text;return t||!1===t?t:!(a.lengths;if(c=function(e,t){return!t||t>=e.length?e:e.slice(0,t)}(c,s),function(e,t){var n=t.allowNew,r=t.labelKey,a=t.text;return!(!n||!a.trim())&&(Cm(n)?n(e,t):!e.some((function(e){return _m(e,r)===a})))}(c,n)&&c.push(im({customOption:!0},Lm(a),l)),f)c.push((im(d={},Lm(a),""),im(d,"paginationOption",!0),d))}return e.createElement(Pv,h({},n,{hideMenu:this.hideMenu,inputNode:this.inputNode,inputRef:this.inputRef,isMenuShown:this.isMenuShown,onActiveItemChange:this._handleActiveItemChange,onAdd:this._handleSelectionAdd,onBlur:this._handleBlur,onChange:this._handleInputChange,onClear:this._handleClear,onClick:this._handleClick,onFocus:this._handleFocus,onHide:this.hideMenu,onInitialItemChange:this._handleInitialItemChange,onKeyDown:this._handleKeyDown,onMenuItemClick:this._handleMenuItemSelect,onRemove:this._handleSelectionRemove,results:c,setItem:this.setItem,toggleMenu:this.toggleMenu}))}}]),r}();im(Gv,"propTypes",Kv),im(Gv,"defaultProps",Zv);var Yv=["className","label","onClick","onKeyDown","size"],Xv={label:ae.string,onClick:ae.func,onKeyDown:ae.func,size:fv},Jv=function(t){var n=t.className,r=t.label,a=void 0===r?"Clear":r,o=t.onClick,i=t.onKeyDown,s=t.size,l=sm(t,Yv);return e.createElement("button",h({},l,{"aria-label":a,className:d("close","btn-close","rbt-close",{"rbt-close-lg":iv(s),"rbt-close-sm":sv(s)},n),onClick:function(e){e.stopPropagation(),o&&o(e)},onKeyDown:function(e){"Backspace"===e.key&&e.preventDefault(),i&&i(e)},type:"button"}),e.createElement("span",{"aria-hidden":"true",className:"rbt-close-content"},"×"),e.createElement("span",{className:"sr-only visually-hidden"},a))};Jv.propTypes=Xv;var Qv={label:ae.string},eg=function(t){var n=t.label,r=void 0===n?"Loading...":n;return e.createElement("div",{className:"rbt-loader spinner-border spinner-border-sm",role:"status"},e.createElement("span",{className:"sr-only visually-hidden"},r))};function tg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"";return n&&(n=n.replace(n[0],n[0].toUpperCase())),["Top","Right","Bottom","Left"].map((function(r){return e["".concat(t).concat(r).concat(n)]})).join(" ")}var Hg=function(){var t=Av(),n=t.hintText,r=t.inputNode,a=e.useRef(null);return e.useEffect((function(){r&&a.current&&function(e,t){var n=window.getComputedStyle(e);t.style.borderStyle=Fg(n,"border","style"),t.style.borderWidth=Fg(n,"border","width"),t.style.fontSize=n.fontSize,t.style.fontWeight=n.fontWeight,t.style.height=n.height,t.style.lineHeight=n.lineHeight,t.style.margin=Fg(n,"margin"),t.style.padding=Fg(n,"padding")}(r,a.current)})),{hintRef:a,hintText:n}},Ug=function(t){var n=t.children,r=t.className,a=Hg(),o=a.hintRef,i=a.hintText;return e.createElement("div",{className:r,style:{display:"flex",flex:1,height:"100%",position:"relative"}},n,e.createElement("input",{"aria-hidden":!0,className:"rbt-input-hint",ref:o,readOnly:!0,style:{backgroundColor:"transparent",borderColor:"transparent",boxShadow:"none",color:"rgba(0, 0, 0, 0.54)",left:0,pointerEvents:"none",position:"absolute",top:0,width:"100%"},tabIndex:-1,value:i}))},Vg=e.forwardRef((function(t,n){return e.createElement("input",h({},t,{className:d("rbt-input-main",t.className),ref:n}))})),zg=["children","className","inputClassName","inputRef","referenceElementRef","selected"];function Wg(t){var n=e.useRef(null),r=e.useRef(null),a=dv(t),o=a.children,i=a.className,s=a.inputClassName;a.inputRef;var l=a.referenceElementRef,c=a.selected,u=sm(a,zg);function f(e){if(t.disabled)e.currentTarget.blur();else{var n=r.current;!n||e.currentTarget.contains(e.target)&&e.currentTarget!==e.target||(Wm(n)&&(n.selectionStart=n.value.length),n.focus())}}return e.createElement("div",{className:d("rbt-input-multi",{disabled:t.disabled},i),onClick:f,onFocus:f,ref:l,tabIndex:-1},e.createElement("div",{className:"rbt-input-wrapper",ref:n},o,e.createElement(Ug,null,e.createElement(Vg,h({},u,{className:s,onKeyDown:function(e){if("Backspace"===e.key&&c.length&&!t.value){var r;e.preventDefault();var a=null===(r=n.current)||void 0===r?void 0:r.children;if(null!=a&&a.length){var o=a[a.length-2];null==o||o.focus()}}t.onKeyDown&&t.onKeyDown(e)},ref:function(e){r.current=e,t.inputRef(e)},style:{backgroundColor:"transparent",border:0,boxShadow:"none",cursor:"inherit",outline:"none",padding:0,width:"100%",zIndex:1}})))))}var Kg=["inputRef","referenceElementRef"],Zg=function(t){var n=t.inputRef,r=t.referenceElementRef,a=sm(t,Kg);return e.createElement(Ug,null,e.createElement(Vg,h({},dv(a),{ref:function(e){n(e),r(e)}})))},Gg={children:ae.string.isRequired,highlightClassName:ae.string,search:ae.string.isRequired},Yg=function(t){var n=t.children,r=t.highlightClassName,a=void 0===r?"rbt-highlight-text":r,o=t.search;if(!o||!n)return e.createElement(e.Fragment,null,n);for(var i=0,s=n,l=[];s;){var c=Gm(s,o);if(!c){l.push(s);break}var u=s.slice(0,c.start);u&&l.push(u);var d=s.slice(c.start,c.end);l.push(e.createElement("mark",{className:a,key:i},d)),i+=1,s=s.slice(c.end)}return e.createElement(e.Fragment,null,l)};Yg.propTypes=Gg;const Xg=e=>"object"==typeof e&&null!=e&&1===e.nodeType,Jg=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,Qg=(e,t)=>{if(e.clientHeight{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightot||o>e&&i=t&&s>=n?o-e-r:i>t&&sn?i-t+a:0,tb=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},nb=(e,t)=>{var n,r,a,o;if("undefined"==typeof document)return[];const{scrollMode:i,block:s,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,d="function"==typeof c?c:e=>e!==c;if(!Xg(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let p=e;for(;Xg(p)&&d(p);){if(p=tb(p),p===h){f.push(p);break}null!=p&&p===document.body&&Qg(p)&&!Qg(document.documentElement)||null!=p&&Qg(p,u)&&f.push(p)}const m=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(o=null==(a=window.visualViewport)?void 0:a.height)?o:innerHeight,{scrollX:g,scrollY:b}=window,{height:y,width:E,top:x,right:w,bottom:N,left:k}=e.getBoundingClientRect(),{top:O,right:j,bottom:L,left:S}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let A="start"===s||"nearest"===s?x-O:"end"===s?N+L:x+y/2-O+L,C="center"===l?k+E/2-S+j:"end"===l?w+j:k-S;const M=[];for(let e=0;e=0&&k>=0&&N<=v&&w<=m&&x>=a&&N<=c&&k>=u&&w<=o)return M;const d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),O=parseInt(d.borderTopWidth,10),j=parseInt(d.borderRightWidth,10),L=parseInt(d.borderBottomWidth,10);let S=0,T=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-j:0,_="offsetHeight"in t?t.offsetHeight-t.clientHeight-O-L:0,P="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,q="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(h===t)S="start"===s?A:"end"===s?A-v:"nearest"===s?eb(b,b+v,v,O,L,b+A,b+A+y,y):A-v/2,T="start"===l?C:"center"===l?C-m/2:"end"===l?C-m:eb(g,g+m,m,p,j,g+C,g+C+E,E),S=Math.max(0,S+b),T=Math.max(0,T+g);else{S="start"===s?A-a-O:"end"===s?A-c+L+_:"nearest"===s?eb(a,c,n,O,L+_,A,A+y,y):A-(a+n/2)+_/2,T="start"===l?C-u-p:"center"===l?C-(u+r/2)+R/2:"end"===l?C-o+j+R:eb(u,o,r,p,j+R,C,C+E,E);const{scrollLeft:e,scrollTop:i}=t;S=0===q?0:Math.max(0,Math.min(i+S/q,t.scrollHeight-n/q+_)),T=0===P?0:Math.max(0,Math.min(e+T/P,t.scrollWidth-r/P+R)),A+=i-S,C+=e-T}M.push({el:t,top:S,left:T})}return M},rb=e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"};var ab=["label","onClick","option","position"];function ob(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ib(e){for(var t=1;t{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(nb(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:a,top:o,left:i}of nb(e,rb(t))){const e=o-n.top+n.bottom,t=i-n.left+n.right;a.scroll({top:e,left:t,behavior:r})}}(e,{boundary:e.parentNode,scrollMode:"if-needed"})}}),[l,d,a,o]);var v=e.useCallback((function(e){f(a,e),r&&r(e)}),[r,f,a]),g=u||l===o;return p(a,o),ib(ib({},i),{},{active:g,"aria-label":n,"aria-selected":g,id:Ym(c,o),onClick:v,onMouseDown:ov,ref:m,role:"option"})}vv.isRequired,ae.number;var lb=["active","children","className","disabled","onClick"],cb=e.forwardRef((function(t,n){var r=t.active,a=t.children,o=t.className,i=t.disabled,s=t.onClick,l=sm(t,lb);return e.createElement("a",h({},l,{className:d("dropdown-item",{active:r,disabled:i},o),href:l.href||"#",onClick:function(e){e.preventDefault(),!i&&s&&s(e)},ref:n}),a)}));function ub(t){return e.createElement(cb,sb(t))}var db=["emptyLabel","innerRef","maxHeight","style"];function hb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fb(e){for(var t=1;t1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),i)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var t=0;t0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(t,r,a,o,i){var s=t[r],l=y(s);if("object"!==l)return new p("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+a+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return g(a,o,i,c,E(u));var d=u(s,c,a,o,i+"."+c,n);if(d)return d}return null}))},exact:function(e){return m((function(a,o,i,s,l){var c=a[o],u=y(c);if("object"!==u)return new p("Invalid "+s+" `"+l+"` of type `"+u+"` supplied to `"+i+"`, expected `object`.");var d=t({},a[o],e);for(var h in d){var f=e[h];if(r(e,h)&&"function"!=typeof f)return g(i,s,l,h,E(f));if(!f)return new p("Invalid "+s+" `"+l+"` key `"+h+"` supplied to `"+i+"`.\nBad object: "+JSON.stringify(a[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(c,h,i,s,l+"."+h,n);if(m)return m}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function a(a,i,s,c,u,h,f){if(c=c||d,h=h||s,f!==n){if(l){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=c+":"+s;!t[v]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,r++)}}return null==i[s]?a?null===i[s]?new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(i,s,c,u,h)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function v(e){return m((function(t,n,r,a,o,i){var s=t[n];return y(s)!==e?new p("Invalid "+a+" `"+o+"` of type `"+E(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function g(e,t,n,r,a){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+a+"`.")}function b(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(b);if(null===e||s(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e[u]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!b(n.value))return!1}else for(;!(n=r.next()).done;){var a=n.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function y(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function E(e){if(null==e)return""+e;var t=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=E(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,h.checkPropTypes=a,h.resetWarningCache=a.resetWarningCache,h.PropTypes=h,h},Z}()(re.isElement,!0)}else P.exports=function(){if(X)return Y;X=1;var e=te();function t(){}function n(){}return n.resetWarningCache=t,Y=function(){function r(t,n,r,a,o,i){if(i!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function a(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}}()();var ae=c(P.exports),oe=!1,ie="production"!==process.env.NODE_ENV?ae.oneOfType([ae.number,ae.shape({enter:ae.number,exit:ae.number,appear:ae.number}).isRequired]):null;"production"!==process.env.NODE_ENV&&ae.oneOfType([ae.string,ae.shape({enter:ae.string,exit:ae.string,active:ae.string}),ae.shape({enter:ae.string,enterDone:ae.string,enterActive:ae.string,exit:ae.string,exitDone:ae.string,exitActive:ae.string})]);var se=e.createContext(null),le="unmounted",ce="exited",ue="entering",de="entered",he="exiting",fe=function(t){var r,a;function o(e,n){var r;r=t.call(this,e,n)||this;var a,o=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?o?(a=ce,r.appearStatus=ue):a=de:a=e.unmountOnExit||e.mountOnEnter?le:ce,r.state={status:a},r.nextCallback=null,r}a=t,(r=o).prototype=Object.create(a.prototype),r.prototype.constructor=r,x(r,a),o.getDerivedStateFromProps=function(e,t){return e.in&&t.status===le?{status:ce}:null};var i=o.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==ue&&n!==de&&(t=ue):n!==ue&&n!==de||(t=he)}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===ue){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:n.findDOMNode(this);r&&function(e){e.scrollTop}(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ce&&this.setState({status:le})},i.performEnter=function(e){var t=this,r=this.props.enter,a=this.context?this.context.isMounting:e,o=this.props.nodeRef?[a]:[n.findDOMNode(this),a],i=o[0],s=o[1],l=this.getTimeouts(),c=a?l.appear:l.enter;!e&&!r||oe?this.safeSetState({status:de},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,s),this.safeSetState({status:ue},(function(){t.props.onEntering(i,s),t.onTransitionEnd(c,(function(){t.safeSetState({status:de},(function(){t.props.onEntered(i,s)}))}))})))},i.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),a=this.props.nodeRef?void 0:n.findDOMNode(this);t&&!oe?(this.props.onExit(a),this.safeSetState({status:he},(function(){e.props.onExiting(a),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:ce},(function(){e.props.onExited(a)}))}))}))):this.safeSetState({status:ce},(function(){e.props.onExited(a)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:n.findDOMNode(this),a=null==e&&!this.props.addEndListener;if(r&&!a){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var t=this.state.status;if(t===le)return null;var n=this.props,r=n.children;n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef;var a=f(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return e.createElement(se.Provider,{value:null},"function"==typeof r?r(t,a):e.cloneElement(e.Children.only(r),a))},o}(e.Component);function pe(){}fe.contextType=se,fe.propTypes="production"!==process.env.NODE_ENV?{nodeRef:ae.shape({current:"undefined"==typeof Element?ae.any:function(e,t,n,r,a,o){var i=e[t];return ae.instanceOf(i&&"ownerDocument"in i?i.ownerDocument.defaultView.Element:Element)(e,t,n,r,a,o)}}),children:ae.oneOfType([ae.func.isRequired,ae.element.isRequired]).isRequired,in:ae.bool,mountOnEnter:ae.bool,unmountOnExit:ae.bool,appear:ae.bool,enter:ae.bool,exit:ae.bool,timeout:function(e){var t=ie;e.addEndListener||(t=t.isRequired);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a{n.target===e&&(a(),t(n))}),n+r)}function Oe(...e){return e.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}}),null)}function je(e){e.offsetHeight}const Le=e=>e&&"function"!=typeof e?t=>{e.current=t}:e;function Se(t,n){return e.useMemo((()=>function(e,t){const n=Le(e),r=Le(t);return e=>{n&&n(e),r&&r(e)}}(t,n)),[t,n])}function Ae(e){return e&&"setState"in e?n.findDOMNode(e):null!=e?e:null}const Ce=e.forwardRef((({onEnter:n,onEntering:r,onEntered:a,onExit:o,onExiting:i,onExited:s,addEndListener:l,children:c,childRef:u,...d},h)=>{const f=e.useRef(null),p=Se(f,u),m=e=>{p(Ae(e))},v=e=>t=>{e&&f.current&&e(f.current,t)},g=e.useCallback(v(n),[n]),b=e.useCallback(v(r),[r]),y=e.useCallback(v(a),[a]),E=e.useCallback(v(o),[o]),x=e.useCallback(v(i),[i]),w=e.useCallback(v(s),[s]),N=e.useCallback(v(l),[l]);return t.jsx(fe,{ref:h,...d,onEnter:g,onEntered:y,onEntering:b,onExit:E,onExited:w,onExiting:x,addEndListener:N,nodeRef:f,children:"function"==typeof c?(e,t)=>c(e,{...t,ref:m}):e.cloneElement(c,{ref:m})})}));var Me=Ce;const Te={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Re(e,t){const n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=Te[e];return n+parseInt(R(t,r[0]),10)+parseInt(R(t,r[1]),10)}const _e={[ce]:"collapse",[he]:"collapsing",[ue]:"collapsing",[de]:"collapse show"};var Pe=e.forwardRef((({onEnter:n,onEntering:r,onEntered:a,onExit:o,onExiting:i,className:s,children:l,dimension:c="height",in:u=!1,timeout:h=300,mountOnEnter:f=!1,unmountOnExit:p=!1,appear:m=!1,getDimensionValue:v=Re,...g},b)=>{const y="function"==typeof c?c():c,E=e.useMemo((()=>Oe((e=>{e.style[y]="0"}),n)),[y,n]),x=e.useMemo((()=>Oe((e=>{const t=`scroll${y[0].toUpperCase()}${y.slice(1)}`;e.style[y]=`${e[t]}px`}),r)),[y,r]),w=e.useMemo((()=>Oe((e=>{e.style[y]=null}),a)),[y,a]),N=e.useMemo((()=>Oe((e=>{e.style[y]=`${v(y,e)}px`,je(e)}),o)),[o,v,y]),k=e.useMemo((()=>Oe((e=>{e.style[y]=null}),i)),[y,i]);return t.jsx(Me,{ref:b,addEndListener:ke,...g,"aria-expanded":g.role?u:null,onEnter:E,onEntering:x,onEntered:w,onExit:N,onExiting:k,childRef:l.ref,in:u,timeout:h,mountOnEnter:f,unmountOnExit:p,appear:m,children:(t,n)=>e.cloneElement(l,{...n,className:d(s,l.props.className,_e[t],"width"===y&&"collapse-horizontal")})})}));function qe(t){const n=function(t){const n=e.useRef(t);return e.useEffect((()=>{n.current=t}),[t]),n}(t);return e.useCallback((function(...e){return n.current&&n.current(...e)}),[n])}var Ie=e=>a.forwardRef(((n,r)=>t.jsx("div",{...n,ref:r,className:d(n.className,e)})));function De(){return e.useState(null)}function Be(){const t=e.useRef(!0),n=e.useRef((()=>t.current));return e.useEffect((()=>(t.current=!0,()=>{t.current=!1})),[]),n.current}function $e(t){const n=e.useRef(null);return e.useEffect((()=>{n.current=t})),n.current}const Fe="undefined"!=typeof global&&global.navigator&&"ReactNative"===global.navigator.product;var He="undefined"!=typeof document||Fe?e.useLayoutEffect:e.useEffect;const Ue=["as","disabled"];function Ve({tagName:e,disabled:t,href:n,target:r,rel:a,role:o,onClick:i,tabIndex:s=0,type:l}){e||(e=null!=n||null!=r||null!=a?"a":"button");const c={tagName:e};if("button"===e)return[{type:l||"button",disabled:t},c];const u=r=>{(t||"a"===e&&function(e){return!e||"#"===e.trim()}(n))&&r.preventDefault(),t?r.stopPropagation():null==i||i(r)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=o?o:"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:"a"===e?r:void 0,"aria-disabled":t||void 0,rel:"a"===e?a:void 0,onClick:u,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),u(e))}},c]}const ze=a.forwardRef(((e,n)=>{let{as:r,disabled:a}=e,o=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,Ue);const[i,{tagName:s}]=Ve(Object.assign({tagName:r,disabled:a},o));return t.jsx(s,Object.assign({},o,i,{ref:n}))}));ze.displayName="Button";const We=["onKeyDown"];const Ke=a.forwardRef(((e,n)=>{let{onKeyDown:r}=e,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,We);const[o]=Ve(Object.assign({tagName:"a"},a)),i=qe((e=>{o.onKeyDown(e),null==r||r(e)}));return(s=a.href)&&"#"!==s.trim()&&"button"!==a.role?t.jsx("a",Object.assign({ref:n},a,{onKeyDown:r})):t.jsx("a",Object.assign({ref:n},a,o,{onKeyDown:i}));var s}));Ke.displayName="Anchor";var Ze=Ke;const Ge={[ue]:"show",[de]:"show"},Ye=a.forwardRef((({className:n,children:r,transitionClasses:o={},onEnter:i,...s},l)=>{const c={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...s},u=e.useCallback(((e,t)=>{je(e),null==i||i(e,t)}),[i]);return t.jsx(Me,{ref:l,addEndListener:ke,...c,onEnter:u,childRef:r.ref,children:(e,t)=>a.cloneElement(r,{...t,className:d("fade",n,r.props.className,Ge[e],o[e])})})}));Ye.displayName="Fade";var Xe=Ye;const Je={"aria-label":ae.string,onClick:ae.func,variant:ae.oneOf(["white"])},Qe=a.forwardRef((({className:e,variant:n,"aria-label":r="Close",...a},o)=>t.jsx("button",{ref:o,type:"button",className:d("btn-close",n&&`btn-close-${n}`,e),"aria-label":r,...a})));Qe.displayName="CloseButton",Qe.propTypes=Je;var et=Qe;const tt=a.forwardRef((({as:e,bsPrefix:n,variant:r="primary",size:a,active:o=!1,disabled:i=!1,className:s,...l},c)=>{const u=N(n,"btn"),[h,{tagName:f}]=Ve({tagName:e,disabled:i,...l}),p=f;return t.jsx(p,{...h,...l,ref:c,disabled:i,className:d(s,u,o&&"active",r&&`${u}-${r}`,a&&`${u}-${a}`,l.href&&i&&"disabled")})}));tt.displayName="Button";var nt=tt;const rt=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"card-body"),t.jsx(r,{ref:o,className:d(e,n),...a}))));rt.displayName="CardBody";var at=rt;const ot=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"card-footer"),t.jsx(r,{ref:o,className:d(e,n),...a}))));ot.displayName="CardFooter";var it=ot;const st=a.createContext(null);st.displayName="CardHeaderContext";var lt=st;const ct=a.forwardRef((({bsPrefix:n,className:r,as:a="div",...o},i)=>{const s=N(n,"card-header"),l=e.useMemo((()=>({cardHeaderBsPrefix:s})),[s]);return t.jsx(lt.Provider,{value:l,children:t.jsx(a,{ref:i,...o,className:d(r,s)})})}));ct.displayName="CardHeader";var ut=ct;const dt=a.forwardRef((({bsPrefix:e,className:n,variant:r,as:a="img",...o},i)=>{const s=N(e,"card-img");return t.jsx(a,{ref:i,className:d(r?`${s}-${r}`:s,n),...o})}));dt.displayName="CardImg";var ht=dt;const ft=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"card-img-overlay"),t.jsx(r,{ref:o,className:d(e,n),...a}))));ft.displayName="CardImgOverlay";var pt=ft;const mt=a.forwardRef((({className:e,bsPrefix:n,as:r="a",...a},o)=>(n=N(n,"card-link"),t.jsx(r,{ref:o,className:d(e,n),...a}))));mt.displayName="CardLink";var vt=mt;const gt=Ie("h6"),bt=a.forwardRef((({className:e,bsPrefix:n,as:r=gt,...a},o)=>(n=N(n,"card-subtitle"),t.jsx(r,{ref:o,className:d(e,n),...a}))));bt.displayName="CardSubtitle";var yt=bt;const Et=a.forwardRef((({className:e,bsPrefix:n,as:r="p",...a},o)=>(n=N(n,"card-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Et.displayName="CardText";var xt=Et;const wt=Ie("h5"),Nt=a.forwardRef((({className:e,bsPrefix:n,as:r=wt,...a},o)=>(n=N(n,"card-title"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Nt.displayName="CardTitle";var kt=Nt;const Ot=a.forwardRef((({bsPrefix:e,className:n,bg:r,text:a,border:o,body:i=!1,children:s,as:l="div",...c},u)=>{const h=N(e,"card");return t.jsx(l,{ref:u,...c,className:d(n,h,r&&`bg-${r}`,a&&`text-${a}`,o&&`border-${o}`),children:i?t.jsx(at,{children:s}):s})}));Ot.displayName="Card";var jt=Object.assign(Ot,{Img:ht,Title:kt,Subtitle:yt,Body:at,Link:vt,Text:xt,Header:ut,Footer:it,ImgOverlay:pt});function Lt(t){const n=function(t){const n=e.useRef(t);return n.current=t,n}(t);e.useEffect((()=>()=>n.current()),[])}const St=2**31-1;function At(e,t,n){const r=n-Date.now();e.current=r<=St?setTimeout(t,r):setTimeout((()=>At(e,t,n)),St)}function Ct(){const t=Be(),n=e.useRef();return Lt((()=>clearTimeout(n.current))),e.useMemo((()=>{const e=()=>clearTimeout(n.current);return{set:function(r,a=0){t()&&(e(),a<=St?n.current=setTimeout(r,a):At(n,r,Date.now()+a))},clear:e,handleRef:n}}),[])}const Mt=a.forwardRef(((e,n)=>{const[{className:r,...a},{as:o="div",bsPrefix:i,spans:s}]=function({as:e,bsPrefix:t,className:n,...r}){t=N(t,"col");const a=k(),o=O(),i=[],s=[];return a.forEach((e=>{const n=r[e];let a,l,c;delete r[e],"object"==typeof n&&null!=n?({span:a,offset:l,order:c}=n):a=n;const u=e!==o?`-${e}`:"";a&&i.push(!0===a?`${t}${u}`:`${t}${u}-${a}`),null!=c&&s.push(`order${u}-${c}`),null!=l&&s.push(`offset${u}-${l}`)})),[{...r,className:d(n,...i,...s)},{as:e,bsPrefix:t,spans:i}]}(e);return t.jsx(o,{...a,ref:n,className:d(r,!s.length&&i)})}));Mt.displayName="Col";var Tt=Mt;const Rt=a.forwardRef((({bsPrefix:e,fluid:n=!1,as:r="div",className:a,...o},i)=>{const s=N(e,"container"),l="string"==typeof n?`-${n}`:"-fluid";return t.jsx(r,{ref:i,...o,className:d(a,n?`${s}${l}`:s)})}));Rt.displayName="Container";var _t=Rt,Pt=Function.prototype.bind.call(Function.prototype.call,[].slice);function qt(e,t){return Pt(e.querySelectorAll(t))}function It(){const[,t]=e.useReducer((e=>!e),!1);return t}var Dt=a.createContext(null),Bt=Object.prototype.hasOwnProperty;function $t(e,t,n){for(n of e.keys())if(Ft(n,t))return n}function Ft(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ft(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((a=r)&&"object"==typeof a&&!(a=$t(t,a)))return!1;if(!t.has(a))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((a=r[0])&&"object"==typeof a&&!(a=$t(t,a)))return!1;if(!Ft(r[1],t.get(a)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(Bt.call(e,n)&&++r&&!Bt.call(t,n))return!1;if(!(n in t)||!Ft(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}var Ht="top",Ut="bottom",Vt="right",zt="left",Wt="auto",Kt=[Ht,Ut,Vt,zt],Zt="start",Gt="end",Yt="clippingParents",Xt="viewport",Jt="popper",Qt="reference",en=Kt.reduce((function(e,t){return e.concat([t+"-"+Zt,t+"-"+Gt])}),[]),tn=[].concat(Kt,[Wt]).reduce((function(e,t){return e.concat([t,t+"-"+Zt,t+"-"+Gt])}),[]),nn=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function rn(e){return e.split("-")[0]}function an(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function on(e){return e instanceof an(e).Element||e instanceof Element}function sn(e){return e instanceof an(e).HTMLElement||e instanceof HTMLElement}function ln(e){return"undefined"!=typeof ShadowRoot&&(e instanceof an(e).ShadowRoot||e instanceof ShadowRoot)}var cn=Math.max,un=Math.min,dn=Math.round;function hn(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function fn(){return!/^((?!chrome|android).)*safari/i.test(hn())}function pn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),a=1,o=1;t&&sn(e)&&(a=e.offsetWidth>0&&dn(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&dn(r.height)/e.offsetHeight||1);var i=(on(e)?an(e):window).visualViewport,s=!fn()&&n,l=(r.left+(s&&i?i.offsetLeft:0))/a,c=(r.top+(s&&i?i.offsetTop:0))/o,u=r.width/a,d=r.height/o;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function mn(e){var t=pn(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function vn(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ln(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(e){return e?(e.nodeName||"").toLowerCase():null}function bn(e){return an(e).getComputedStyle(e)}function yn(e){return["table","td","th"].indexOf(gn(e))>=0}function En(e){return((on(e)?e.ownerDocument:e.document)||window.document).documentElement}function xn(e){return"html"===gn(e)?e:e.assignedSlot||e.parentNode||(ln(e)?e.host:null)||En(e)}function wn(e){return sn(e)&&"fixed"!==bn(e).position?e.offsetParent:null}function Nn(e){for(var t=an(e),n=wn(e);n&&yn(n)&&"static"===bn(n).position;)n=wn(n);return n&&("html"===gn(n)||"body"===gn(n)&&"static"===bn(n).position)?t:n||function(e){var t=/firefox/i.test(hn());if(/Trident/i.test(hn())&&sn(e)&&"fixed"===bn(e).position)return null;var n=xn(e);for(ln(n)&&(n=n.host);sn(n)&&["html","body"].indexOf(gn(n))<0;){var r=bn(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function kn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function On(e,t,n){return cn(e,un(t,n))}function jn(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Ln(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Sn={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,a=e.options,o=n.elements.arrow,i=n.modifiersData.popperOffsets,s=rn(n.placement),l=kn(s),c=[zt,Vt].indexOf(s)>=0?"height":"width";if(o&&i){var u=function(e,t){return jn("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Ln(e,Kt))}(a.padding,n),d=mn(o),h="y"===l?Ht:zt,f="y"===l?Ut:Vt,p=n.rects.reference[c]+n.rects.reference[l]-i[l]-n.rects.popper[c],m=i[l]-n.rects.reference[l],v=Nn(o),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=p/2-m/2,y=u[h],E=g-d[c]-u[f],x=g/2-d[c]/2+b,w=On(y,x,E),N=l;n.modifiersData[r]=((t={})[N]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&vn(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function An(e){return e.split("-")[1]}var Cn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mn(e){var t,n=e.popper,r=e.popperRect,a=e.placement,o=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=i.x,f=void 0===h?0:h,p=i.y,m=void 0===p?0:p,v="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var g=i.hasOwnProperty("x"),b=i.hasOwnProperty("y"),y=zt,E=Ht,x=window;if(c){var w=Nn(n),N="clientHeight",k="clientWidth";if(w===an(n)&&"static"!==bn(w=En(n)).position&&"absolute"===s&&(N="scrollHeight",k="scrollWidth"),a===Ht||(a===zt||a===Vt)&&o===Gt)E=Ut,m-=(d&&w===x&&x.visualViewport?x.visualViewport.height:w[N])-r.height,m*=l?1:-1;if(a===zt||(a===Ht||a===Ut)&&o===Gt)y=Vt,f-=(d&&w===x&&x.visualViewport?x.visualViewport.width:w[k])-r.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Cn),L=!0===u?function(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:dn(n*a)/a||0,y:dn(r*a)/a||0}}({x:f,y:m},an(n)):{x:f,y:m};return f=L.x,m=L.y,l?Object.assign({},j,((O={})[E]=b?"0":"",O[y]=g?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",O)):Object.assign({},j,((t={})[E]=b?m+"px":"",t[y]=g?f+"px":"",t.transform="",t))}var Tn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=void 0===r||r,o=n.adaptive,i=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:rn(t.placement),variation:An(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Mn(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Mn(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Rn={passive:!0};var _n={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,o=void 0===a||a,i=r.resize,s=void 0===i||i,l=an(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,Rn)})),s&&l.addEventListener("resize",n.update,Rn),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Rn)})),s&&l.removeEventListener("resize",n.update,Rn)}},data:{}},Pn={left:"right",right:"left",bottom:"top",top:"bottom"};function qn(e){return e.replace(/left|right|bottom|top/g,(function(e){return Pn[e]}))}var In={start:"end",end:"start"};function Dn(e){return e.replace(/start|end/g,(function(e){return In[e]}))}function Bn(e){var t=an(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $n(e){return pn(En(e)).left+Bn(e).scrollLeft}function Fn(e){var t=bn(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function Hn(e){return["html","body","#document"].indexOf(gn(e))>=0?e.ownerDocument.body:sn(e)&&Fn(e)?e:Hn(xn(e))}function Un(e,t){var n;void 0===t&&(t=[]);var r=Hn(e),a=r===(null==(n=e.ownerDocument)?void 0:n.body),o=an(r),i=a?[o].concat(o.visualViewport||[],Fn(r)?r:[]):r,s=t.concat(i);return a?s:s.concat(Un(xn(i)))}function Vn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function zn(e,t,n){return t===Xt?Vn(function(e,t){var n=an(e),r=En(e),a=n.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;var c=fn();(c||!c&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s+$n(e),y:l}}(e,n)):on(t)?function(e,t){var n=pn(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Vn(function(e){var t,n=En(e),r=Bn(e),a=null==(t=e.ownerDocument)?void 0:t.body,o=cn(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=cn(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),s=-r.scrollLeft+$n(e),l=-r.scrollTop;return"rtl"===bn(a||n).direction&&(s+=cn(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:i,x:s,y:l}}(En(e)))}function Wn(e,t,n,r){var a="clippingParents"===t?function(e){var t=Un(xn(e)),n=["absolute","fixed"].indexOf(bn(e).position)>=0&&sn(e)?Nn(e):e;return on(n)?t.filter((function(e){return on(e)&&vn(e,n)&&"body"!==gn(e)})):[]}(e):[].concat(t),o=[].concat(a,[n]),i=o[0],s=o.reduce((function(t,n){var a=zn(e,n,r);return t.top=cn(a.top,t.top),t.right=un(a.right,t.right),t.bottom=un(a.bottom,t.bottom),t.left=cn(a.left,t.left),t}),zn(e,i,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Kn(e){var t,n=e.reference,r=e.element,a=e.placement,o=a?rn(a):null,i=a?An(a):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Ht:t={x:s,y:n.y-r.height};break;case Ut:t={x:s,y:n.y+n.height};break;case Vt:t={x:n.x+n.width,y:l};break;case zt:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?kn(o):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case Zt:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Gt:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function Zn(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=void 0===r?e.placement:r,o=n.strategy,i=void 0===o?e.strategy:o,s=n.boundary,l=void 0===s?Yt:s,c=n.rootBoundary,u=void 0===c?Xt:c,d=n.elementContext,h=void 0===d?Jt:d,f=n.altBoundary,p=void 0!==f&&f,m=n.padding,v=void 0===m?0:m,g=jn("number"!=typeof v?v:Ln(v,Kt)),b=h===Jt?Qt:Jt,y=e.rects.popper,E=e.elements[p?b:h],x=Wn(on(E)?E:E.contextElement||En(e.elements.popper),l,u,i),w=pn(e.elements.reference),N=Kn({reference:w,element:y,strategy:"absolute",placement:a}),k=Vn(Object.assign({},y,N)),O=h===Jt?k:w,j={top:x.top-O.top+g.top,bottom:O.bottom-x.bottom+g.bottom,left:x.left-O.left+g.left,right:O.right-x.right+g.right},L=e.modifiersData.offset;if(h===Jt&&L){var S=L[a];Object.keys(j).forEach((function(e){var t=[Vt,Ut].indexOf(e)>=0?1:-1,n=[Ht,Ut].indexOf(e)>=0?"y":"x";j[e]+=S[n]*t}))}return j}function Gn(e,t){void 0===t&&(t={});var n=t,r=n.placement,a=n.boundary,o=n.rootBoundary,i=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?tn:l,u=An(r),d=u?s?en:en.filter((function(e){return An(e)===u})):Kt,h=d.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=d);var f=h.reduce((function(t,n){return t[n]=Zn(e,{placement:n,boundary:a,rootBoundary:o,padding:i})[rn(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}var Yn={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,o=void 0===a||a,i=n.altAxis,s=void 0===i||i,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=rn(v),b=l||(g===v||!p?[qn(v)]:function(e){if(rn(e)===Wt)return[];var t=qn(e);return[Dn(e),t,Dn(t)]}(v)),y=[v].concat(b).reduce((function(e,n){return e.concat(rn(n)===Wt?Gn(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),E=t.rects.reference,x=t.rects.popper,w=new Map,N=!0,k=y[0],O=0;O=0,C=A?"width":"height",M=Zn(t,{placement:j,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),T=A?S?Vt:zt:S?Ut:Ht;E[C]>x[C]&&(T=qn(T));var R=qn(T),_=[];if(o&&_.push(M[L]<=0),s&&_.push(M[T]<=0,M[R]<=0),_.every((function(e){return e}))){k=j,N=!1;break}w.set(j,_)}if(N)for(var P=function(e){var t=y.find((function(t){var n=w.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},q=p?3:1;q>0;q--){if("break"===P(q))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Xn(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Jn(e){return[Ht,Vt,Ut,zt].some((function(t){return e[t]>=0}))}var Qn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,i=Zn(t,{elementContext:"reference"}),s=Zn(t,{altBoundary:!0}),l=Xn(i,r),c=Xn(s,a,o),u=Jn(l),d=Jn(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var er={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.offset,o=void 0===a?[0,0]:a,i=tn.reduce((function(e,n){return e[n]=function(e,t,n){var r=rn(e),a=[zt,Ht].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,i=o[0],s=o[1];return i=i||0,s=(s||0)*a,[zt,Vt].indexOf(r)>=0?{x:s,y:i}:{x:i,y:s}}(n,t.rects,o),e}),{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=i}};var tr={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Kn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var nr={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,o=void 0===a||a,i=n.altAxis,s=void 0!==i&&i,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=void 0===h||h,p=n.tetherOffset,m=void 0===p?0:p,v=Zn(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=rn(t.placement),b=An(t.placement),y=!b,E=kn(g),x="x"===E?"y":"x",w=t.modifiersData.popperOffsets,N=t.rects.reference,k=t.rects.popper,O="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(w){if(o){var A,C="y"===E?Ht:zt,M="y"===E?Ut:Vt,T="y"===E?"height":"width",R=w[E],_=R+v[C],P=R-v[M],q=f?-k[T]/2:0,I=b===Zt?N[T]:k[T],D=b===Zt?-k[T]:-N[T],B=t.elements.arrow,$=f&&B?mn(B):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=F[C],U=F[M],V=On(0,N[T],$[T]),z=y?N[T]/2-q-V-H-j.mainAxis:I-V-H-j.mainAxis,W=y?-N[T]/2+q+V+U+j.mainAxis:D+V+U+j.mainAxis,K=t.elements.arrow&&Nn(t.elements.arrow),Z=K?"y"===E?K.clientTop||0:K.clientLeft||0:0,G=null!=(A=null==L?void 0:L[E])?A:0,Y=R+W-G,X=On(f?un(_,R+z-G-Z):_,R,f?cn(P,Y):P);w[E]=X,S[E]=X-R}if(s){var J,Q="x"===E?Ht:zt,ee="x"===E?Ut:Vt,te=w[x],ne="y"===x?"height":"width",re=te+v[Q],ae=te-v[ee],oe=-1!==[Ht,zt].indexOf(g),ie=null!=(J=null==L?void 0:L[x])?J:0,se=oe?re:te-N[ne]-k[ne]-ie+j.altAxis,le=oe?te+N[ne]+k[ne]-ie-j.altAxis:ae,ce=f&&oe?function(e,t,n){var r=On(e,t,n);return r>n?n:r}(se,te,le):On(f?se:re,te,f?le:ae);w[x]=ce,S[x]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function rr(e,t,n){void 0===n&&(n=!1);var r,a,o=sn(t),i=sn(t)&&function(e){var t=e.getBoundingClientRect(),n=dn(t.width)/e.offsetWidth||1,r=dn(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=En(t),l=pn(e,i,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==gn(t)||Fn(s))&&(c=(r=t)!==an(r)&&sn(r)?{scrollLeft:(a=r).scrollLeft,scrollTop:a.scrollTop}:Bn(r)),sn(t)?((u=pn(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=$n(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ar(e){var t=new Map,n=new Set,r=[];function a(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&a(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||a(e)})),r}var or={placement:"bottom",modifiers:[],strategy:"absolute"};function ir(){for(var e=arguments.length,t=new Array(e),n=0;n{}},dr={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const e=(t.getAttribute("aria-describedby")||"").split(",").filter((e=>e.trim()!==n.id));e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,a=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===a&&"setAttribute"in r){const e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},hr=[];function fr(t,n,r={}){let{enabled:a=!0,placement:o="bottom",strategy:i="absolute",modifiers:s=hr}=r,l=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(r,cr);const c=e.useRef(s),u=e.useRef(),d=e.useCallback((()=>{var e;null==(e=u.current)||e.update()}),[]),h=e.useCallback((()=>{var e;null==(e=u.current)||e.forceUpdate()}),[]),[f,p]=function(t){const n=Be();return[t[0],e.useCallback((e=>{if(n())return t[1](e)}),[n,t[1]])]}(e.useState({placement:o,update:d,forceUpdate:h,attributes:{},styles:{popper:{},arrow:{}}})),m=e.useMemo((()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{const t={},n={};Object.keys(e.elements).forEach((r=>{t[r]=e.styles[r],n[r]=e.attributes[r]})),p({state:e,styles:t,attributes:n,update:d,forceUpdate:h,placement:e.placement})}})),[d,h,p]),v=e.useMemo((()=>(Ft(c.current,s)||(c.current=s),c.current)),[s]);return e.useEffect((()=>{u.current&&a&&u.current.setOptions({placement:o,strategy:i,modifiers:[...v,m,ur]})}),[i,o,m,a,v]),e.useEffect((()=>{if(a&&null!=t&&null!=n)return u.current=lr(t,n,Object.assign({},l,{placement:o,strategy:i,modifiers:[...v,dr,m]})),()=>{null!=u.current&&(u.current.destroy(),u.current=void 0,p((e=>Object.assign({},e,{attributes:{},styles:{popper:{}}}))))}}),[a,t,n]),f}function pr(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var mr=function(){};if("production"!==process.env.NODE_ENV){var vr=function(e,t){var n=arguments.length;t=new Array(n>1?n-1:0);for(var r=1;r2?r-2:0);for(var a=2;a{};const yr=e=>e&&("current"in e?e.current:e),Er={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function xr(t,n=br,{disabled:r,clickTrigger:a="click"}={}){const o=e.useRef(!1),i=e.useRef(!1),s=e.useCallback((e=>{const n=yr(t);var r;gr(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!n||!!((r=e).metaKey||r.altKey||r.ctrlKey||r.shiftKey)||!function(e){return 0===e.button}(e)||!!pr(n,e.target)||i.current,i.current=!1}),[t]),l=qe((e=>{const n=yr(t);n&&pr(n,e.target)&&(i.current=!0)})),c=qe((e=>{o.current||n(e)}));e.useEffect((()=>{var e,n;if(r||null==t)return;const o=L(yr(t)),i=o.defaultView||window;let u=null!=(e=i.event)?e:null==(n=i.parent)?void 0:n.event,d=null;Er[a]&&(d=Ee(o,Er[a],l,!0));const h=Ee(o,a,s,!0),f=Ee(o,a,(e=>{e!==u?c(e):u=void 0}));let p=[];return"ontouchstart"in o.documentElement&&(p=[].slice.call(o.body.children).map((e=>Ee(e,"mousemove",br)))),()=>{null==d||d(),h(),f(),p.forEach((e=>e()))}}),[t,r,a,s,l,c])}function wr(e={}){return Array.isArray(e)?e:Object.keys(e).map((t=>(e[t].name=t,e[t])))}function Nr({enabled:e,enableEvents:t,placement:n,flip:r,offset:a,fixed:o,containerPadding:i,arrowElement:s,popperConfig:l={}}){var c,u,d,h,f;const p=function(e){const t={};return Array.isArray(e)?(null==e||e.forEach((e=>{t[e.name]=e})),t):e||t}(l.modifiers);return Object.assign({},l,{placement:n,enabled:e,strategy:o?"fixed":l.strategy,modifiers:wr(Object.assign({},p,{eventListeners:{enabled:t,options:null==(c=p.eventListeners)?void 0:c.options},preventOverflow:Object.assign({},p.preventOverflow,{options:i?Object.assign({padding:i},null==(u=p.preventOverflow)?void 0:u.options):null==(d=p.preventOverflow)?void 0:d.options}),offset:{options:Object.assign({offset:a},null==(h=p.offset)?void 0:h.options)},arrow:Object.assign({},p.arrow,{enabled:!!s,options:Object.assign({},null==(f=p.arrow)?void 0:f.options,{element:s})}),flip:Object.assign({enabled:!!r},p.flip)}))})}const kr=["children"];const Or=()=>{};function jr(t={}){const n=e.useContext(Dt),[r,a]=De(),o=e.useRef(!1),{flip:i,offset:s,rootCloseEvent:l,fixed:c=!1,placement:u,popperConfig:d={},enableEventListeners:h=!0,usePopper:f=!!n}=t,p=null==(null==n?void 0:n.show)?!!t.show:n.show;p&&!o.current&&(o.current=!0);const{placement:m,setMenu:v,menuElement:g,toggleElement:b}=n||{},y=fr(b,g,Nr({placement:u||m||"bottom-start",enabled:f,enableEvents:null==h?p:h,offset:s,flip:i,fixed:c,arrowElement:r,popperConfig:d})),E=Object.assign({ref:v||Or,"aria-labelledby":null==b?void 0:b.id},y.attributes.popper,{style:y.styles.popper}),x={show:p,placement:m,hasShown:o.current,toggle:null==n?void 0:n.toggle,popper:f?y:null,arrowProps:f?Object.assign({ref:a},y.attributes.arrow,{style:y.styles.arrow}):{}};return xr(g,(e=>{null==n||n.toggle(!1,e)}),{clickTrigger:l,disabled:!p}),[E,x]}function Lr(e){let{children:n}=e,r=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,kr);const[a,o]=jr(r);return t.jsx(t.Fragment,{children:n(a,o)})}Lr.displayName="DropdownMenu",Lr.defaultProps={usePopper:!0};const Sr={prefix:String(Math.round(1e10*Math.random())),current:0},Ar=e.createContext(Sr),Cr=e.createContext(!1);let Mr=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Tr=new WeakMap;const Rr="function"==typeof e.useId?function(t){let n=e.useId(),[r]=e.useState("function"==typeof e.useSyncExternalStore?e.useSyncExternalStore(qr,_r,Pr):e.useContext(Cr)),a=r||"test"===process.env.NODE_ENV?"react-aria":`react-aria${Sr.prefix}`;return t||`${a}-${n}`}:function(t){let n=e.useContext(Ar);n!==Sr||Mr||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let r=function(t=!1){let n=e.useContext(Ar),r=e.useRef(null);if(null===r.current&&!t){var a,o;let t=null===(o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===o||null===(a=o.ReactCurrentOwner)||void 0===a?void 0:a.current;if(t){let e=Tr.get(t);null==e?Tr.set(t,{id:n.current,state:t.memoizedState}):t.memoizedState!==e.state&&(n.current=e.id,Tr.delete(t))}r.current=++n.current}return r.current}(!!t),a=n===Sr&&"test"===process.env.NODE_ENV?"react-aria":`react-aria${n.prefix}`;return t||`${a}-${r}`};function _r(){return!1}function Pr(){return!0}function qr(e){return()=>{}}const Ir=e=>{var t;return"menu"===(null==(t=e.getAttribute("role"))?void 0:t.toLowerCase())},Dr=()=>{};function Br(){const t=Rr(),{show:n=!1,toggle:r=Dr,setToggle:a,menuElement:o}=e.useContext(Dt)||{},i=e.useCallback((e=>{r(!n,e)}),[n,r]),s={id:t,ref:a||Dr,onClick:i,"aria-expanded":!!n};return o&&Ir(o)&&(s["aria-haspopup"]=!0),[s,{show:n,toggle:r}]}function $r({children:e}){const[n,r]=Br();return t.jsx(t.Fragment,{children:e(n,r)})}$r.displayName="DropdownToggle";const Fr=a.createContext(null),Hr=(e,t=null)=>null!=e?String(e):t||null,Ur=a.createContext(null);Ur.displayName="NavContext";var Vr=Ur;const zr="data-rr-ui-";function Wr(e){return`${zr}${e}`}const Kr=["eventKey","disabled","onClick","active","as"];function Zr({key:t,href:n,active:r,disabled:a,onClick:o}){const i=e.useContext(Fr),s=e.useContext(Vr),{activeKey:l}=s||{},c=Hr(t,n),u=null==r&&null!=t?Hr(l)===c:r;return[{onClick:qe((e=>{a||(null==o||o(e),i&&!e.isPropagationStopped()&&i(c,e))})),"aria-disabled":a||void 0,"aria-selected":u,[Wr("dropdown-item")]:""},{isActive:u}]}const Gr=a.forwardRef(((e,n)=>{let{eventKey:r,disabled:a,onClick:o,active:i,as:s=ze}=e,l=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,Kr);const[c]=Zr({key:r,href:l.href,disabled:a,onClick:o,active:i});return t.jsx(s,Object.assign({},l,{ref:n},c))}));Gr.displayName="DropdownItem";const Yr=e.createContext(me?window:void 0);function Xr(){return e.useContext(Yr)}function Jr(){const t=It(),n=e.useRef(null),r=e.useCallback((e=>{n.current=e,t()}),[t]);return[n,r]}function Qr({defaultShow:n,show:r,onSelect:a,onToggle:o,itemSelector:i=`* [${Wr("dropdown-item")}]`,focusFirstItemOnShow:s,placement:l="bottom-start",children:c}){const u=Xr(),[d,h]=function(t,n,r){const a=e.useRef(void 0!==t),[o,i]=e.useState(n),s=void 0!==t,l=a.current;return a.current=s,!s&&l&&o!==n&&i(n),[s?t:o,e.useCallback(((...e)=>{const[t,...n]=e;let a=null==r?void 0:r(t,...n);return i(t),a}),[r])]}(r,n,o),[f,p]=Jr(),m=f.current,[v,g]=Jr(),b=v.current,y=$e(d),E=e.useRef(null),x=e.useRef(!1),w=e.useContext(Fr),N=e.useCallback(((e,t,n=(null==t?void 0:t.type))=>{h(e,{originalEvent:t,source:n})}),[h]),k=qe(((e,t)=>{null==a||a(e,t),N(!1,t,"select"),t.isPropagationStopped()||null==w||w(e,t)})),O=e.useMemo((()=>({toggle:N,placement:l,show:d,menuElement:m,toggleElement:b,setMenu:p,setToggle:g})),[N,l,d,m,b,p,g]);m&&y&&!d&&(x.current=m.contains(m.ownerDocument.activeElement));const j=qe((()=>{b&&b.focus&&b.focus()})),L=qe((()=>{const e=E.current;let t=s;if(null==t&&(t=!(!f.current||!Ir(f.current))&&"keyboard"),!1===t||"keyboard"===t&&!/^key.+$/.test(e))return;const n=qt(f.current,i)[0];n&&n.focus&&n.focus()}));e.useEffect((()=>{d?L():x.current&&(x.current=!1,j())}),[d,x,j,L]),e.useEffect((()=>{E.current=null}));const S=(e,t)=>{if(!f.current)return null;const n=qt(f.current,i);let r=n.indexOf(e)+t;return r=Math.max(0,Math.min(r,n.length)),n[r]};return function(t,n,r,a=!1){const o=qe(r);e.useEffect((()=>{const e="function"==typeof t?t():t;return e.addEventListener(n,o,a),()=>e.removeEventListener(n,o,a)}),[t])}(e.useCallback((()=>u.document),[u]),"keydown",(e=>{var t,n;const{key:r}=e,a=e.target,o=null==(t=f.current)?void 0:t.contains(a),i=null==(n=v.current)?void 0:n.contains(a);if(/input|textarea/i.test(a.tagName)&&(" "===r||"Escape"!==r&&o||"Escape"===r&&"search"===a.type))return;if(!o&&!i)return;if(!("Tab"!==r||f.current&&d))return;E.current=e.type;const s={originalEvent:e,source:e.type};switch(r){case"ArrowUp":{const t=S(a,-1);return t&&t.focus&&t.focus(),void e.preventDefault()}case"ArrowDown":if(e.preventDefault(),d){const e=S(a,1);e&&e.focus&&e.focus()}else h(!0,s);return;case"Tab":ye(a.ownerDocument,"keyup",(e=>{var t;("Tab"!==e.key||e.target)&&null!=(t=f.current)&&t.contains(e.target)||h(!1,s)}),{once:!0});break;case"Escape":"Escape"===r&&(e.preventDefault(),e.stopPropagation()),h(!1,s)}})),t.jsx(Fr.Provider,{value:k,children:t.jsx(Dt.Provider,{value:O,children:c})})}Yr.Provider,Qr.displayName="Dropdown",Qr.Menu=Lr,Qr.Toggle=$r,Qr.Item=Gr;const ea=a.createContext({});ea.displayName="DropdownContext";var ta=ea;const na=a.forwardRef((({className:e,bsPrefix:n,as:r="hr",role:a="separator",...o},i)=>(n=N(n,"dropdown-divider"),t.jsx(r,{ref:i,className:d(e,n),role:a,...o}))));na.displayName="DropdownDivider";var ra=na;const aa=a.forwardRef((({className:e,bsPrefix:n,as:r="div",role:a="heading",...o},i)=>(n=N(n,"dropdown-header"),t.jsx(r,{ref:i,className:d(e,n),role:a,...o}))));aa.displayName="DropdownHeader";var oa=aa;const ia=a.forwardRef((({bsPrefix:e,className:n,eventKey:r,disabled:a=!1,onClick:o,active:i,as:s=Ze,...l},c)=>{const u=N(e,"dropdown-item"),[h,f]=Zr({key:r,href:l.href,disabled:a,onClick:o,active:i});return t.jsx(s,{...l,...h,ref:c,className:d(n,u,f.isActive&&"active",a&&"disabled")})}));ia.displayName="DropdownItem";var sa=ia;const la=a.forwardRef((({className:e,bsPrefix:n,as:r="span",...a},o)=>(n=N(n,"dropdown-item-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));la.displayName="DropdownItemText";var ca=la;const ua=a.createContext(null);ua.displayName="InputGroupContext";var da=ua;const ha=a.createContext(null);ha.displayName="NavbarContext";var fa=ha;function pa(t,n){if("production"===process.env.NODE_ENV)return t;return Se(e.useCallback((e=>{null!=e&&e.isReactComponent&&("production"!==process.env.NODE_ENV?v(!1,`${n} injected a ref to a provided \`as\` component that resolved to a component instance instead of a DOM element. Use \`React.forwardRef\` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element`):v(!1))}),[n]),t)}function ma(e,t,n){let r=e?n?"bottom-start":"bottom-end":n?"bottom-end":"bottom-start";return"up"===t?r=e?n?"top-start":"top-end":n?"top-end":"top-start":"end"===t?r=e?n?"left-end":"right-end":n?"left-start":"right-start":"start"===t?r=e?n?"right-end":"left-end":n?"right-start":"left-start":"down-centered"===t?r="bottom":"up-centered"===t&&(r="top"),r}const va=a.forwardRef((({bsPrefix:n,className:r,align:a,rootCloseEvent:o,flip:i=!0,show:s,renderOnMount:l,as:c="div",popperConfig:u,variant:h,...f},p)=>{let m=!1;const v=e.useContext(fa),g=N(n,"dropdown-menu"),{align:b,drop:y,isRTL:E}=e.useContext(ta);a=a||b;const x=e.useContext(da),w=[];if(a)if("object"==typeof a){const e=Object.keys(a);if("production"!==process.env.NODE_ENV&&gr(1===e.length,"There should only be 1 breakpoint when passing an object to `align`"),e.length){const t=e[0],n=a[t];m="start"===n,w.push(`${g}-${t}-${n}`)}}else"end"===a&&(m=!0);const k=ma(m,y,E),[O,{hasShown:j,popper:L,show:S,toggle:A}]=jr({flip:i,rootCloseEvent:o,show:s,usePopper:!v&&0===w.length,offset:[0,2],popperConfig:u,placement:k});if(O.ref=Se(pa(p,"DropdownMenu"),O.ref),He((()=>{S&&(null==L||L.update())}),[S]),!j&&!l&&!x)return null;"string"!=typeof c&&(O.show=S,O.close=()=>null==A?void 0:A(!1),O.align=a);let C=f.style;return null!=L&&L.placement&&(C={...f.style,...O.style},f["x-placement"]=L.placement),t.jsx(c,{...f,...O,style:C,...(w.length||v)&&{"data-bs-popper":"static"},className:d(r,g,S&&"show",m&&`${g}-end`,h&&`${g}-${h}`,...w)})}));va.displayName="DropdownMenu";var ga=va;const ba=a.forwardRef((({bsPrefix:n,split:r,className:a,childBsPrefix:o,as:i=nt,...s},l)=>{const c=N(n,"dropdown-toggle"),u=e.useContext(Dt);void 0!==o&&(s.bsPrefix=o);const[h]=Br();return h.ref=Se(h.ref,pa(l,"DropdownToggle")),t.jsx(i,{className:d(a,c,r&&`${c}-split`,(null==u?void 0:u.show)&&"show"),...h,...s})}));ba.displayName="DropdownToggle";var ya=ba;const Ea=a.forwardRef(((n,r)=>{const{bsPrefix:a,drop:o="down",show:i,className:s,align:l="start",onSelect:c,onToggle:u,focusFirstItemOnShow:h,as:f="div",navbar:p,autoClose:m=!0,...v}=E(n,{show:"onToggle"}),g=e.useContext(da),b=N(a,"dropdown"),y=j(),x=qe(((e,t)=>{var n,r;var a;(null==(n=t.originalEvent)||null==(r=n.target)?void 0:r.classList.contains("dropdown-toggle"))&&"mousedown"===t.source||(t.originalEvent.currentTarget!==document||"keydown"===t.source&&"Escape"!==t.originalEvent.key||(t.source="rootClose"),a=t.source,(!1===m?"click"===a:"inside"===m?"rootClose"!==a:"outside"!==m||"select"!==a)&&(null==u||u(e,t)))})),w=ma("end"===l,o,y),k=e.useMemo((()=>({align:l,drop:o,isRTL:y})),[l,o,y]),O={down:b,"down-centered":`${b}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return t.jsx(ta.Provider,{value:k,children:t.jsx(Qr,{placement:w,show:i,onSelect:c,onToggle:x,focusFirstItemOnShow:h,itemSelector:`.${b}-item:not(.disabled):not(:disabled)`,children:g?v.children:t.jsx(f,{...v,ref:r,className:d(s,i&&"show",O[o])})})})}));Ea.displayName="Dropdown";var xa=Object.assign(Ea,{Toggle:ya,Menu:ga,Item:sa,ItemText:ca,Divider:ra,Header:oa});const wa={type:ae.string,tooltip:ae.bool,as:ae.elementType},Na=a.forwardRef((({as:e="div",className:n,type:r="valid",tooltip:a=!1,...o},i)=>t.jsx(e,{...o,ref:i,className:d(n,`${r}-${a?"tooltip":"feedback"}`)})));Na.displayName="Feedback",Na.propTypes=wa;var ka=Na;var Oa=a.createContext({});const ja=a.forwardRef((({id:n,bsPrefix:r,className:a,type:o="checkbox",isValid:i=!1,isInvalid:s=!1,as:l="input",...c},u)=>{const{controlId:h}=e.useContext(Oa);return r=N(r,"form-check-input"),t.jsx(l,{...c,ref:u,type:o,id:n||h,className:d(a,r,i&&"is-valid",s&&"is-invalid")})}));ja.displayName="FormCheckInput";var La=ja;const Sa=a.forwardRef((({bsPrefix:n,className:r,htmlFor:a,...o},i)=>{const{controlId:s}=e.useContext(Oa);return n=N(n,"form-check-label"),t.jsx("label",{...o,ref:i,htmlFor:a||s,className:d(r,n)})}));Sa.displayName="FormCheckLabel";var Aa=Sa;const Ca=a.forwardRef((({id:n,bsPrefix:r,bsSwitchPrefix:o,inline:i=!1,reverse:s=!1,disabled:l=!1,isValid:c=!1,isInvalid:u=!1,feedbackTooltip:h=!1,feedback:f,feedbackType:p,className:m,style:v,title:g="",type:b="checkbox",label:y,children:E,as:x="input",...w},k)=>{r=N(r,"form-check"),o=N(o,"form-switch");const{controlId:O}=e.useContext(Oa),j=e.useMemo((()=>({controlId:n||O})),[O,n]),L=!E&&null!=y&&!1!==y||function(e,t){return a.Children.toArray(e).some((e=>a.isValidElement(e)&&e.type===t))}(E,Aa),S=t.jsx(La,{...w,type:"switch"===b?"checkbox":b,ref:k,isValid:c,isInvalid:u,disabled:l,as:x});return t.jsx(Oa.Provider,{value:j,children:t.jsx("div",{style:v,className:d(m,L&&r,i&&`${r}-inline`,s&&`${r}-reverse`,"switch"===b&&o),children:E||t.jsxs(t.Fragment,{children:[S,L&&t.jsx(Aa,{title:g,children:y}),f&&t.jsx(ka,{type:p,tooltip:h,children:f})]})})})}));Ca.displayName="FormCheck";var Ma=Object.assign(Ca,{Input:La,Label:Aa});const Ta=a.forwardRef((({bsPrefix:n,type:r,size:a,htmlSize:o,id:i,className:s,isValid:l=!1,isInvalid:c=!1,plaintext:u,readOnly:h,as:f="input",...p},m)=>{const{controlId:v}=e.useContext(Oa);return n=N(n,"form-control"),"production"!==process.env.NODE_ENV&&gr(null==v||!i,"`controlId` is ignored on `` when `id` is specified."),t.jsx(f,{...p,type:r,size:o,ref:m,readOnly:h,id:i||v,className:d(s,u?`${n}-plaintext`:n,a&&`${n}-${a}`,"color"===r&&`${n}-color`,l&&"is-valid",c&&"is-invalid")})}));Ta.displayName="FormControl";var Ra=Object.assign(Ta,{Feedback:ka});const _a=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"form-floating"),t.jsx(r,{ref:o,className:d(e,n),...a}))));_a.displayName="FormFloating";var Pa=_a;const qa=a.forwardRef((({controlId:n,as:r="div",...a},o)=>{const i=e.useMemo((()=>({controlId:n})),[n]);return t.jsx(Oa.Provider,{value:i,children:t.jsx(r,{...a,ref:o})})}));qa.displayName="FormGroup";var Ia=qa;const Da=a.forwardRef((({as:n="label",bsPrefix:r,column:a=!1,visuallyHidden:o=!1,className:i,htmlFor:s,...l},c)=>{const{controlId:u}=e.useContext(Oa);r=N(r,"form-label");let h="col-form-label";"string"==typeof a&&(h=`${h} ${h}-${a}`);const f=d(i,r,o&&"visually-hidden",a&&h);return"production"!==process.env.NODE_ENV&&gr(null==u||!s,"`controlId` is ignored on `` when `htmlFor` is specified."),s=s||u,a?t.jsx(Tt,{ref:c,as:"label",className:f,htmlFor:s,...l}):t.jsx(n,{ref:c,className:f,htmlFor:s,...l})}));Da.displayName="FormLabel";var Ba=Da;const $a=a.forwardRef((({bsPrefix:n,className:r,id:a,...o},i)=>{const{controlId:s}=e.useContext(Oa);return n=N(n,"form-range"),t.jsx("input",{...o,type:"range",ref:i,className:d(r,n),id:a||s})}));$a.displayName="FormRange";var Fa=$a;const Ha=a.forwardRef((({bsPrefix:n,size:r,htmlSize:a,className:o,isValid:i=!1,isInvalid:s=!1,id:l,...c},u)=>{const{controlId:h}=e.useContext(Oa);return n=N(n,"form-select"),t.jsx("select",{...c,size:a,ref:u,className:d(o,n,r&&`${n}-${r}`,i&&"is-valid",s&&"is-invalid"),id:l||h})}));Ha.displayName="FormSelect";var Ua=Ha;const Va=a.forwardRef((({bsPrefix:e,className:n,as:r="small",muted:a,...o},i)=>(e=N(e,"form-text"),t.jsx(r,{...o,ref:i,className:d(n,e,a&&"text-muted")}))));Va.displayName="FormText";var za=Va;const Wa=a.forwardRef(((e,n)=>t.jsx(Ma,{...e,ref:n,type:"switch"})));Wa.displayName="Switch";var Ka=Object.assign(Wa,{Input:Ma.Input,Label:Ma.Label});const Za=a.forwardRef((({bsPrefix:e,className:n,children:r,controlId:a,label:o,...i},s)=>(e=N(e,"form-floating"),t.jsxs(Ia,{ref:s,className:d(n,e),controlId:a,...i,children:[r,t.jsx("label",{htmlFor:a,children:o})]}))));Za.displayName="FloatingLabel";var Ga=Za;const Ya={_ref:ae.any,validated:ae.bool,as:ae.elementType},Xa=a.forwardRef((({className:e,validated:n,as:r="form",...a},o)=>t.jsx(r,{...a,ref:o,className:d(e,n&&"was-validated")})));Xa.displayName="Form",Xa.propTypes=Ya;var Ja=Object.assign(Xa,{Group:Ia,Control:Ra,Floating:Pa,Check:Ma,Switch:Ka,Label:Ba,Text:za,Range:Fa,Select:Ua,FloatingLabel:Ga});const Qa=a.forwardRef((({className:e,bsPrefix:n,as:r="span",...a},o)=>(n=N(n,"input-group-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Qa.displayName="InputGroupText";var eo=Qa;const to=a.forwardRef((({bsPrefix:n,size:r,hasValidation:a,className:o,as:i="div",...s},l)=>{n=N(n,"input-group");const c=e.useMemo((()=>({})),[]);return t.jsx(da.Provider,{value:c,children:t.jsx(i,{ref:l,...s,className:d(o,n,r&&`${n}-${r}`,a&&"has-validation")})})}));to.displayName="InputGroup";var no=Object.assign(to,{Text:eo,Radio:e=>t.jsx(eo,{children:t.jsx(La,{type:"radio",...e})}),Checkbox:e=>t.jsx(eo,{children:t.jsx(La,{type:"checkbox",...e})})});var ro=a.createContext(null);const ao=["as","active","eventKey"];function oo({key:t,onClick:n,active:r,id:a,role:o,disabled:i}){const s=e.useContext(Fr),l=e.useContext(Vr),c=e.useContext(ro);let u=r;const d={role:o};if(l){o||"tablist"!==l.role||(d.role="tab");const e=l.getControllerId(null!=t?t:null),n=l.getControlledId(null!=t?t:null);d[Wr("event-key")]=t,d.id=e||a,u=null==r&&null!=t?l.activeKey===t:r,!u&&(null!=c&&c.unmountOnExit||null!=c&&c.mountOnEnter)||(d["aria-controls"]=n)}return"tab"===d.role&&(d["aria-selected"]=u,u||(d.tabIndex=-1),i&&(d.tabIndex=-1,d["aria-disabled"]=!0)),d.onClick=qe((e=>{i||(null==n||n(e),null!=t&&s&&!e.isPropagationStopped()&&s(t,e))})),[d,{isActive:u}]}const io=a.forwardRef(((e,n)=>{let{as:r=ze,active:a,eventKey:o}=e,i=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,ao);const[s,l]=oo(Object.assign({key:Hr(o,i.href),active:a},i));return s[Wr("active")]=l.isActive,t.jsx(r,Object.assign({},i,s,{ref:n}))}));io.displayName="NavItem";var so=io;const lo=["as","onSelect","activeKey","role","onKeyDown"];const co=()=>{},uo=Wr("event-key"),ho=a.forwardRef(((n,r)=>{let{as:a="div",onSelect:o,activeKey:i,role:s,onKeyDown:l}=n,c=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(n,lo);const u=It(),d=e.useRef(!1),h=e.useContext(Fr),f=e.useContext(ro);let p,m;f&&(s=s||"tablist",i=f.activeKey,p=f.getControlledId,m=f.getControllerId);const v=e.useRef(null),g=e=>{const t=v.current;if(!t)return null;const n=qt(t,`[${uo}]:not([aria-disabled=true])`),r=t.querySelector("[aria-selected=true]");if(!r||r!==document.activeElement)return null;const a=n.indexOf(r);if(-1===a)return null;let o=a+e;return o>=n.length&&(o=0),o<0&&(o=n.length-1),n[o]},b=(e,t)=>{null!=e&&(null==o||o(e,t),null==h||h(e,t))};e.useEffect((()=>{if(v.current&&d.current){const e=v.current.querySelector(`[${uo}][aria-selected=true]`);null==e||e.focus()}d.current=!1}));const y=Se(r,v);return t.jsx(Fr.Provider,{value:b,children:t.jsx(Vr.Provider,{value:{role:s,activeKey:Hr(i),getControlledId:p||co,getControllerId:m||co},children:t.jsx(a,Object.assign({},c,{onKeyDown:e=>{if(null==l||l(e),!f)return;let t;switch(e.key){case"ArrowLeft":case"ArrowUp":t=g(-1);break;case"ArrowRight":case"ArrowDown":t=g(1);break;default:return}var n;t&&(e.preventDefault(),b(t.dataset[(n="EventKey",`rrUi${n}`)]||null,e),d.current=!0,u())},ref:y,role:s}))})})}));ho.displayName="Nav";var fo=Object.assign(ho,{Item:so});function po(e){void 0===e&&(e=L());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}const mo=Wr("modal-open");var vo=class{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt(R(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(mo,""),R(r,t)}reset(){[...this.modals].forEach((e=>this.remove(e)))}removeContainerStyle(e){const t=this.getElement();t.removeAttribute(mo),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return-1!==t?t:(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),t)}remove(e){const t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}};const go=(e,t)=>me?null==e?(t||L()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function bo(t,n){const r=Xr(),[a,o]=e.useState((()=>go(t,null==r?void 0:r.document)));if(!a){const e=go(t);e&&o(e)}return e.useEffect((()=>{n&&a&&n(a)}),[n,a]),e.useEffect((()=>{const e=go(t);e!==a&&o(e)}),[t,a]),a}function yo({children:t,in:n,onExited:r,mountOnEnter:a,unmountOnExit:o}){const i=e.useRef(null),s=e.useRef(n),l=qe(r);e.useEffect((()=>{n?s.current=!0:l(i.current)}),[n,l]);const c=Se(i,t.ref),u=e.cloneElement(t,{ref:c});return n?u:o||!s.current&&a?null:u}function Eo({children:t,in:n,onExited:r,onEntered:a,transition:o}){const[i,s]=e.useState(!n);n&&i&&s(!1);const l=function({in:t,onTransition:n}){const r=e.useRef(null),a=e.useRef(!0),o=qe(n);return He((()=>{if(!r.current)return;let e=!1;return o({in:t,element:r.current,initial:a.current,isStale:()=>e}),()=>{e=!0}}),[t,o]),He((()=>(a.current=!1,()=>{a.current=!0})),[]),r}({in:!!n,onTransition:e=>{Promise.resolve(o(e)).then((()=>{e.isStale()||(e.in?null==a||a(e.element,e.initial):(s(!0),null==r||r(e.element)))}),(t=>{throw e.in||s(!0),t}))}}),c=Se(l,t.ref);return i&&!n?null:e.cloneElement(t,{ref:c})}function xo(e,n,r){return e?t.jsx(e,Object.assign({},r)):n?t.jsx(Eo,Object.assign({},r,{transition:n})):t.jsx(yo,Object.assign({},r))}function wo(e){return"Escape"===e.code||27===e.keyCode}const No=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];let ko;function Oo(t){const n=Xr(),r=t||function(e){return ko||(ko=new vo({ownerDocument:null==e?void 0:e.document})),ko}(n),a=e.useRef({dialog:null,backdrop:null});return Object.assign(a.current,{add:()=>r.add(a.current),remove:()=>r.remove(a.current),isTopModal:()=>r.isTopModal(a.current),setDialogRef:e.useCallback((e=>{a.current.dialog=e}),[]),setBackdropRef:e.useCallback((e=>{a.current.backdrop=e}),[])})}const jo=e.forwardRef(((r,o)=>{let{show:i=!1,role:s="dialog",className:l,style:c,children:u,backdrop:d=!0,keyboard:h=!0,onBackdropClick:f,onEscapeKeyDown:p,transition:m,runTransition:v,backdropTransition:g,runBackdropTransition:b,autoFocus:y=!0,enforceFocus:E=!0,restoreFocus:x=!0,restoreFocusOptions:w,renderDialog:N,renderBackdrop:k=(e=>t.jsx("div",Object.assign({},e))),manager:O,container:j,onShow:L,onHide:S=(()=>{}),onExit:A,onExited:C,onExiting:M,onEnter:T,onEntering:R,onEntered:_}=r,P=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(r,No);const q=Xr(),I=bo(j),D=Oo(O),B=Be(),$=$e(i),[F,H]=e.useState(!i),U=e.useRef(null);e.useImperativeHandle(o,(()=>D),[D]),me&&!$&&i&&(U.current=po(null==q?void 0:q.document)),i&&F&&H(!1);const V=qe((()=>{if(D.add(),Y.current=Ee(document,"keydown",Z),G.current=Ee(document,"focus",(()=>setTimeout(W)),!0),L&&L(),y){var e,t;const n=po(null!=(e=null==(t=D.dialog)?void 0:t.ownerDocument)?e:null==q?void 0:q.document);D.dialog&&n&&!pr(D.dialog,n)&&(U.current=n,D.dialog.focus())}})),z=qe((()=>{var e;(D.remove(),null==Y.current||Y.current(),null==G.current||G.current(),x)&&(null==(e=U.current)||null==e.focus||e.focus(w),U.current=null)}));e.useEffect((()=>{i&&I&&V()}),[i,I,V]),e.useEffect((()=>{F&&z()}),[F,z]),Lt((()=>{z()}));const W=qe((()=>{if(!E||!B()||!D.isTopModal())return;const e=po(null==q?void 0:q.document);D.dialog&&e&&!pr(D.dialog,e)&&D.dialog.focus()})),K=qe((e=>{e.target===e.currentTarget&&(null==f||f(e),!0===d&&S())})),Z=qe((e=>{h&&wo(e)&&D.isTopModal()&&(null==p||p(e),e.defaultPrevented||S())})),G=e.useRef(),Y=e.useRef();if(!I)return null;const X=Object.assign({role:s,ref:D.setDialogRef,"aria-modal":"dialog"===s||void 0},P,{style:c,className:l,tabIndex:-1});let J=N?N(X):t.jsx("div",Object.assign({},X,{children:a.cloneElement(u,{role:"document"})}));J=xo(m,v,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!i,onExit:A,onExiting:M,onExited:(...e)=>{H(!0),null==C||C(...e)},onEnter:T,onEntering:R,onEntered:_,children:J});let Q=null;return d&&(Q=k({ref:D.setBackdropRef,onClick:K}),Q=xo(g,b,{in:!!i,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Q})),t.jsx(t.Fragment,{children:n.createPortal(t.jsxs(t.Fragment,{children:[Q,J]}),I)})}));jo.displayName="Modal";var Lo=Object.assign(jo,{Manager:vo});function So(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function Ao(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Co=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Mo=".sticky-top",To=".navbar-toggler";class Ro extends vo{adjustAndStore(e,t,n){const r=t.style[e];t.dataset[e]=r,R(t,{[e]:`${parseFloat(R(t,e))+n}px`})}restore(e,t){const n=t.dataset[e];void 0!==n&&(delete t.dataset[e],R(t,{[e]:n}))}setContainerStyle(e){super.setContainerStyle(e);const t=this.getElement();var n,r;if(r="modal-open",(n=t).classList?n.classList.add(r):So(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)),!e.scrollBarWidth)return;const a=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";qt(t,Co).forEach((t=>this.adjustAndStore(a,t,e.scrollBarWidth))),qt(t,Mo).forEach((t=>this.adjustAndStore(o,t,-e.scrollBarWidth))),qt(t,To).forEach((t=>this.adjustAndStore(o,t,e.scrollBarWidth)))}removeContainerStyle(e){super.removeContainerStyle(e);const t=this.getElement();var n,r;r="modal-open",(n=t).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Ao(n.className,r):n.setAttribute("class",Ao(n.className&&n.className.baseVal||"",r));const a=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";qt(t,Co).forEach((e=>this.restore(a,e))),qt(t,Mo).forEach((e=>this.restore(o,e))),qt(t,To).forEach((e=>this.restore(o,e)))}}let _o;var Po=Ro;var qo=a.createContext({onHide(){}});const Io=a.forwardRef((({closeLabel:n="Close",closeVariant:r,closeButton:a=!1,onHide:o,children:i,...s},l)=>{const c=e.useContext(qo),u=qe((()=>{null==c||c.onHide(),null==o||o()}));return t.jsxs("div",{ref:l,...s,children:[i,a&&t.jsx(et,{"aria-label":n,variant:r,onClick:u})]})}));var Do=Io,Bo={exports:{}},$o={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,a,o,i){var s=a||"<>",l=i||r;if(null==n[r])return t?new Error("Required "+o+" `"+l+"` was not specified in `"+s+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),d=6;d(n=N(n,"nav-item"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Ho.displayName="NavItem";var Uo=Ho;const Vo=a.forwardRef((({bsPrefix:e,className:n,as:r=Ze,active:a,eventKey:o,disabled:i=!1,...s},l)=>{e=N(e,"nav-link");const[c,u]=oo({key:Hr(o,s.href),active:a,disabled:i,...s});return t.jsx(r,{...s,...c,ref:l,disabled:i,className:d(n,e,i&&"disabled",u.isActive&&"active")})}));Vo.displayName="NavLink";var zo=Vo;const Wo=a.forwardRef(((n,r)=>{const{as:a="div",bsPrefix:o,variant:i,fill:s=!1,justify:l=!1,navbar:c,navbarScroll:u,className:h,activeKey:f,...p}=E(n,{activeKey:"onSelect"}),m=N(o,"nav");let v,g,b=!1;const y=e.useContext(fa),x=e.useContext(lt);return y?(v=y.bsPrefix,b=null==c||c):x&&({cardHeaderBsPrefix:g}=x),t.jsx(fo,{as:a,ref:r,activeKey:f,className:d(h,{[m]:!b,[`${v}-nav`]:b,[`${v}-nav-scroll`]:b&&u,[`${g}-${i}`]:!!g,[`${m}-${i}`]:!!i,[`${m}-fill`]:s,[`${m}-justified`]:l}),...p})}));Wo.displayName="Nav";var Ko=Object.assign(Wo,{Item:Uo,Link:zo});const Zo=a.forwardRef((({bsPrefix:e,className:n,as:r,...a},o)=>{e=N(e,"navbar-brand");const i=r||(a.href?"a":"span");return t.jsx(i,{...a,ref:o,className:d(n,e)})}));Zo.displayName="NavbarBrand";var Go=Zo;const Yo=a.forwardRef((({children:n,bsPrefix:r,...a},o)=>{r=N(r,"navbar-collapse");const i=e.useContext(fa);return t.jsx(Pe,{in:!(!i||!i.expanded),...a,children:t.jsx("div",{ref:o,className:r,children:n})})}));Yo.displayName="NavbarCollapse";var Xo=Yo;const Jo=a.forwardRef((({bsPrefix:n,className:r,children:a,label:o="Toggle navigation",as:i="button",onClick:s,...l},c)=>{n=N(n,"navbar-toggler");const{onToggle:u,expanded:h}=e.useContext(fa)||{},f=qe((e=>{s&&s(e),u&&u()}));return"button"===i&&(l.type="button"),t.jsx(i,{...l,ref:c,onClick:f,"aria-label":o,className:d(r,n,!h&&"collapsed"),children:a||t.jsx("span",{className:`${n}-icon`})})}));Jo.displayName="NavbarToggle";var Qo=Jo;const ei=new WeakMap,ti=(e,t)=>{if(!e||!t)return;const n=ei.get(t)||new Map;ei.set(t,n);let r=n.get(e);return r||(r=t.matchMedia(e),r.refCount=0,n.set(r.media,r)),r};function ni(t,n=("undefined"==typeof window?void 0:window)){const r=ti(t,n),[a,o]=e.useState((()=>!!r&&r.matches));return He((()=>{let e=ti(t,n);if(!e)return o(!1);let r=ei.get(n);const a=()=>{o(e.matches)};return e.refCount++,e.addListener(a),a(),()=>{e.removeListener(a),e.refCount--,e.refCount<=0&&(null==r||r.delete(e.media)),e=void 0}}),[t]),a}const ri=function(t){const n=Object.keys(t);function r(e,t){return e===t?t:e?`${e} and ${t}`:t}function a(e){const r=function(e){return n[Math.min(n.indexOf(e)+1,n.length-1)]}(e);let a=t[r];return a="number"==typeof a?a-.2+"px":`calc(${a} - 0.2px)`,`(max-width: ${a})`}return function(n,o,i){let s;return"object"==typeof n?(s=n,i=o,o=!0):s={[n]:o=o||!0},ni(e.useMemo((()=>Object.entries(s).reduce(((e,[n,o])=>("up"!==o&&!0!==o||(e=r(e,function(e){let n=t[e];return"number"==typeof n&&(n=`${n}px`),`(min-width: ${n})`}(n))),"down"!==o&&!0!==o||(e=r(e,a(n))),e)),"")),[JSON.stringify(s)]),i)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),ai=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"offcanvas-body"),t.jsx(r,{ref:o,className:d(e,n),...a}))));ai.displayName="OffcanvasBody";var oi=ai;const ii={[ue]:"show",[de]:"show"},si=a.forwardRef((({bsPrefix:e,className:n,children:r,in:o=!1,mountOnEnter:i=!1,unmountOnExit:s=!1,appear:l=!1,...c},u)=>(e=N(e,"offcanvas"),t.jsx(Me,{ref:u,addEndListener:ke,in:o,mountOnEnter:i,unmountOnExit:s,appear:l,...c,childRef:r.ref,children:(t,o)=>a.cloneElement(r,{...o,className:d(n,r.props.className,(t===ue||t===he)&&`${e}-toggling`,ii[t])})}))));si.displayName="OffcanvasToggling";var li=si;const ci=a.forwardRef((({bsPrefix:e,className:n,closeLabel:r="Close",closeButton:a=!1,...o},i)=>(e=N(e,"offcanvas-header"),t.jsx(Do,{ref:i,...o,className:d(n,e),closeLabel:r,closeButton:a}))));ci.displayName="OffcanvasHeader";var ui=ci;const di=Ie("h5"),hi=a.forwardRef((({className:e,bsPrefix:n,as:r=di,...a},o)=>(n=N(n,"offcanvas-title"),t.jsx(r,{ref:o,className:d(e,n),...a}))));hi.displayName="OffcanvasTitle";var fi=hi;function pi(e){return t.jsx(li,{...e})}function mi(e){return t.jsx(Xe,{...e})}const vi=a.forwardRef((({bsPrefix:n,className:r,children:a,"aria-labelledby":o,placement:i="start",responsive:s,show:l=!1,backdrop:c=!0,keyboard:u=!0,scroll:h=!1,onEscapeKeyDown:f,onShow:p,onHide:m,container:v,autoFocus:g=!0,enforceFocus:b=!0,restoreFocus:y=!0,restoreFocusOptions:E,onEntered:x,onExit:w,onExiting:k,onEnter:O,onEntering:j,onExited:L,backdropClassName:S,manager:A,renderStaticNode:C=!1,...M},T)=>{const R=e.useRef();n=N(n,"offcanvas");const{onToggle:_}=e.useContext(fa)||{},[P,q]=e.useState(!1),I=ri(s||"xs","up");e.useEffect((()=>{q(s?l&&!I:l)}),[l,s,I]);const D=qe((()=>{null==_||_(),null==m||m()})),B=e.useMemo((()=>({onHide:D})),[D]);const $=e.useCallback((e=>t.jsx("div",{...e,className:d(`${n}-backdrop`,S)})),[S,n]),F=e=>t.jsx("div",{...e,...M,className:d(r,s?`${n}-${s}`:n,`${n}-${i}`),"aria-labelledby":o,children:a});return t.jsxs(t.Fragment,{children:[!P&&(s||C)&&F({}),t.jsx(qo.Provider,{value:B,children:t.jsx(Lo,{show:P,ref:T,backdrop:c,container:v,keyboard:u,autoFocus:g,enforceFocus:b&&!h,restoreFocus:y,restoreFocusOptions:E,onEscapeKeyDown:f,onShow:p,onHide:D,onEnter:(e,...t)=>{e&&(e.style.visibility="visible"),null==O||O(e,...t)},onEntering:j,onEntered:x,onExit:w,onExiting:k,onExited:(e,...t)=>{e&&(e.style.visibility=""),null==L||L(...t)},manager:A||(h?(R.current||(R.current=new Po({handleContainerOverflow:!1})),R.current):function(e){return _o||(_o=new Ro(e)),_o}()),transition:pi,backdropTransition:mi,renderBackdrop:$,renderDialog:F})})]})}));vi.displayName="Offcanvas";var gi=Object.assign(vi,{Body:oi,Header:ui,Title:fi});const bi=a.forwardRef(((n,r)=>{const a=e.useContext(fa);return t.jsx(gi,{ref:r,show:!(null==a||!a.expanded),...n,renderStaticNode:!0})}));bi.displayName="NavbarOffcanvas";var yi=bi;const Ei=a.forwardRef((({className:e,bsPrefix:n,as:r="span",...a},o)=>(n=N(n,"navbar-text"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Ei.displayName="NavbarText";var xi=Ei;const wi=a.forwardRef(((n,r)=>{const{bsPrefix:a,expand:o=!0,variant:i="light",bg:s,fixed:l,sticky:c,className:u,as:h="nav",expanded:f,onToggle:p,onSelect:m,collapseOnSelect:v=!1,...g}=E(n,{expanded:"onToggle"}),b=N(a,"navbar"),y=e.useCallback(((...e)=>{null==m||m(...e),v&&f&&(null==p||p(!1))}),[m,v,f,p]);void 0===g.role&&"nav"!==h&&(g.role="navigation");let x=`${b}-expand`;"string"==typeof o&&(x=`${x}-${o}`);const w=e.useMemo((()=>({onToggle:()=>null==p?void 0:p(!f),bsPrefix:b,expanded:!!f,expand:o})),[b,f,o,p]);return t.jsx(fa.Provider,{value:w,children:t.jsx(Fr.Provider,{value:y,children:t.jsx(h,{ref:r,...g,className:d(u,b,o&&x,i&&`${b}-${i}`,s&&`bg-${s}`,c&&`sticky-${c}`,l&&`fixed-${l}`)})})})}));wi.displayName="Navbar";var Ni=Object.assign(wi,{Brand:Go,Collapse:Xo,Offcanvas:yi,Text:xi,Toggle:Qo});const ki=()=>{};const Oi=a.forwardRef(((t,r)=>{const{flip:a,offset:o,placement:i,containerPadding:s,popperConfig:l={},transition:c,runTransition:u}=t,[d,h]=De(),[f,p]=De(),m=Se(h,r),v=bo(t.container),g=bo(t.target),[b,y]=e.useState(!t.show),E=fr(g,d,Nr({placement:i,enableEvents:!!t.show,containerPadding:s||5,flip:a,offset:o,arrowElement:f,popperConfig:l}));t.show&&b&&y(!1);const x=t.show||!b;if(function(t,n,{disabled:r,clickTrigger:a}={}){const o=n||ki;xr(t,o,{disabled:r,clickTrigger:a});const i=qe((e=>{wo(e)&&o(e)}));e.useEffect((()=>{if(r||null==t)return;const e=L(yr(t));let n=(e.defaultView||window).event;const a=Ee(e,"keyup",(e=>{e!==n?i(e):n=void 0}));return()=>{a()}}),[t,r,i])}(d,t.onHide,{disabled:!t.rootClose||t.rootCloseDisabled,clickTrigger:t.rootCloseEvent}),!x)return null;const{onExit:w,onExiting:N,onEnter:k,onEntering:O,onEntered:j}=t;let S=t.children(Object.assign({},E.attributes.popper,{style:E.styles.popper,ref:m}),{popper:E,placement:i,show:!!t.show,arrowProps:Object.assign({},E.attributes.arrow,{style:E.styles.arrow,ref:p})});return S=xo(c,u,{in:!!t.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:S,onExit:w,onExiting:N,onExited:(...e)=>{y(!0),t.onExited&&t.onExited(...e)},onEnter:k,onEntering:O,onEntered:j}),v?n.createPortal(S,v):null}));Oi.displayName="Overlay";var ji=Oi;const Li=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"popover-header"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Li.displayName="PopoverHeader";var Si=Li;const Ai=a.forwardRef((({className:e,bsPrefix:n,as:r="div",...a},o)=>(n=N(n,"popover-body"),t.jsx(r,{ref:o,className:d(e,n),...a}))));Ai.displayName="PopoverBody";var Ci=Ai;function Mi(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}function Ti(e="absolute"){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}const Ri=a.forwardRef((({bsPrefix:e,placement:n="right",className:r,style:a,children:o,body:i,arrowProps:s,hasDoneInitialMeasure:l,popper:c,show:u,...h},f)=>{const p=N(e,"popover"),m=j(),[v]=(null==n?void 0:n.split("-"))||[],g=Mi(v,m);let b=a;return u&&!l&&(b={...a,...Ti(null==c?void 0:c.strategy)}),t.jsxs("div",{ref:f,role:"tooltip",style:b,"x-placement":v,className:d(r,p,v&&`bs-popover-${g}`),...h,children:[t.jsx("div",{className:"popover-arrow",...s}),i?t.jsx(Ci,{children:o}):o]})}));var _i=Object.assign(Ri,{Header:Si,Body:Ci,POPPER_OFFSET:[0,8]});const Pi=a.forwardRef((({bsPrefix:e,placement:n="right",className:r,style:a,children:o,arrowProps:i,hasDoneInitialMeasure:s,popper:l,show:c,...u},h)=>{e=N(e,"tooltip");const f=j(),[p]=(null==n?void 0:n.split("-"))||[],m=Mi(p,f);let v=a;return c&&!s&&(v={...a,...Ti(null==l?void 0:l.strategy)}),t.jsxs("div",{ref:h,style:v,role:"tooltip","x-placement":p,className:d(r,e,`bs-tooltip-${m}`),...u,children:[t.jsx("div",{className:"tooltip-arrow",...i}),t.jsx("div",{className:`${e}-inner`,children:o})]})}));Pi.displayName="Tooltip";var qi=Object.assign(Pi,{TOOLTIP_OFFSET:[0,6]});const Ii=a.forwardRef((({children:n,transition:r=Xe,popperConfig:o={},rootClose:i=!1,placement:s="top",show:l=!1,...c},u)=>{const h=e.useRef({}),[f,p]=e.useState(null),[m,v]=function(t){const n=e.useRef(null),r=N(void 0,"popover"),a=N(void 0,"tooltip"),o=e.useMemo((()=>({name:"offset",options:{offset:()=>{if(t)return t;if(n.current){if(So(n.current,r))return _i.POPPER_OFFSET;if(So(n.current,a))return qi.TOOLTIP_OFFSET}return[0,0]}}})),[t,r,a]);return[n,[o]]}(c.offset),g=Se(u,m),b=!0===r?Xe:r||void 0,y=qe((e=>{p(e),null==o||null==o.onFirstUpdate||o.onFirstUpdate(e)}));return He((()=>{f&&c.target&&(null==h.current.scheduleUpdate||h.current.scheduleUpdate())}),[f,c.target]),e.useEffect((()=>{l||p(null)}),[l]),t.jsx(ji,{...c,ref:g,popperConfig:{...o,modifiers:v.concat(o.modifiers||[]),onFirstUpdate:y},transition:b,rootClose:i,placement:s,show:l,children:(e,{arrowProps:t,popper:i,show:s})=>{var l,c;!function(e,t){const{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n(Ae(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r(Ae(e)))}(e,t);const u=null==i?void 0:i.placement,p=Object.assign(h.current,{state:null==i?void 0:i.state,scheduleUpdate:null==i?void 0:i.update,placement:u,outOfBoundaries:(null==i||null==(l=i.state)||null==(c=l.modifiersData.hide)?void 0:c.isReferenceHidden)||!1,strategy:o.strategy}),m=!!f;return"function"==typeof n?n({...e,placement:u,show:s,...!r&&s&&{className:"show"},popper:p,arrowProps:t,hasDoneInitialMeasure:m}):a.cloneElement(n,{...e,placement:u,arrowProps:t,popper:p,hasDoneInitialMeasure:m,className:d(n.props.className,!r&&s&&"show"),style:{...n.props.style,...e.style}})}})}));Ii.displayName="Overlay";var Di=Ii;function Bi(e,t,n){const[r]=t,a=r.currentTarget,o=r.relatedTarget||r.nativeEvent[n];o&&o===a||pr(a,o)||e(...t)}ae.oneOf(["click","hover","focus"]);var $i=({trigger:n=["hover","focus"],overlay:r,children:o,popperConfig:i={},show:s,defaultShow:l=!1,onToggle:c,delay:u,placement:d,flip:h=d&&-1!==d.indexOf("auto"),...f})=>{const p=e.useRef(null),m=Se(p,o.ref),v=Ct(),g=e.useRef(""),[b,E]=y(s,l,c),x=function(e){return e&&"object"==typeof e?e:{show:e,hide:e}}(u),{onFocus:w,onBlur:N,onClick:k}="function"!=typeof o?a.Children.only(o).props:{},O=e.useCallback((()=>{v.clear(),g.current="show",x.show?v.set((()=>{"show"===g.current&&E(!0)}),x.show):E(!0)}),[x.show,E,v]),j=e.useCallback((()=>{v.clear(),g.current="hide",x.hide?v.set((()=>{"hide"===g.current&&E(!1)}),x.hide):E(!1)}),[x.hide,E,v]),L=e.useCallback(((...e)=>{O(),null==w||w(...e)}),[O,w]),S=e.useCallback(((...e)=>{j(),null==N||N(...e)}),[j,N]),A=e.useCallback(((...e)=>{E(!b),null==k||k(...e)}),[k,E,b]),C=e.useCallback(((...e)=>{Bi(O,e,"fromElement")}),[O]),M=e.useCallback(((...e)=>{Bi(j,e,"toElement")}),[j]),T=null==n?[]:[].concat(n),R={ref:e=>{m(Ae(e))}};return-1!==T.indexOf("click")&&(R.onClick=A),-1!==T.indexOf("focus")&&(R.onFocus=L,R.onBlur=S),-1!==T.indexOf("hover")&&("production"!==process.env.NODE_ENV&&gr(T.length>1,'[react-bootstrap] Specifying only the `"hover"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'),R.onMouseOver=C,R.onMouseOut=M),t.jsxs(t.Fragment,{children:["function"==typeof o?o(R):e.cloneElement(o,R),t.jsx(Di,{...f,show:b,onHide:j,flip:h,placement:d,popperConfig:i,target:p.current,children:r})]})};const Fi=a.forwardRef((({bsPrefix:e,className:n,as:r="div",...a},o)=>{const i=N(e,"row"),s=k(),l=O(),c=`${i}-cols`,u=[];return s.forEach((e=>{const t=a[e];let n;delete a[e],null!=t&&"object"==typeof t?({cols:n}=t):n=t;const r=e!==l?`-${e}`:"";null!=n&&u.push(`${c}${r}-${n}`)})),t.jsx(r,{ref:o,...a,className:d(n,i,...u)})}));Fi.displayName="Row";var Hi=Fi;var Ui,Vi=a.forwardRef((({bsPrefix:e,className:n,striped:r,bordered:a,borderless:o,hover:i,size:s,variant:l,responsive:c,...u},h)=>{const f=N(e,"table"),p=d(n,f,l&&`${f}-${l}`,s&&`${f}-${s}`,r&&`${f}-${"string"==typeof r?`striped-${r}`:"striped"}`,a&&`${f}-bordered`,o&&`${f}-borderless`,i&&`${f}-hover`),m=t.jsx("table",{...u,className:p,ref:h});if(c){let e=`${f}-responsive`;return"string"==typeof c&&(e=`${e}-${c}`),t.jsx("div",{className:e,children:m})}return m})),zi=function(t){var n=t.label,r=t.icon,a=t.children,o=t.className,l=t.variant,c=s(t,["label","icon","children","className","variant"]);return e.createElement(nt,i({className:o,variant:l||"primary"},c),n||null,r?e.createElement("i",{className:"bi bi-".concat(r)}):null,a)};!function(e){e[e.NONE=0]="NONE",e[e.HEAD=1]="HEAD",e[e.BODY=2]="BODY"}(Ui||(Ui={}));var Wi=e.createContext(Ui.NONE),Ki=function(t){var n=t.className,r=t.children,a=s(t,["className","children"]);return e.createElement(Vi,i({className:d(n,"texmo-table")},a),r)};Ki.Head=function(t){var n=t.children,r=s(t,["children"]);return e.createElement(Wi.Provider,{value:Ui.HEAD},e.createElement("thead",i({},r),n))},Ki.Row=function(t){var n=t.borderColour,r=t.className,a=t.style,o=t.children,l=s(t,["borderColour","className","style","children"]);return e.createElement("tr",i({className:d(r,"table-responsive text-center h-100 mt-3 mx-0"),style:i({border:"2px solid ".concat(n)},a)},l),o)},Ki.Cell=function(t){var n=t.borderStart,r=t.className,a=t.children,o=s(t,["borderStart","className","children"]),l=n?"border-start":void 0;switch(e.useContext(Wi)){case Ui.HEAD:return e.createElement("th",i({scope:"col list-cell",className:r},o),a);case Ui.BODY:case Ui.NONE:default:return e.createElement("td",i({className:"px-0 pt-0 pb-3 texmo-table"},o),e.createElement("div",i({className:d(r,"h-100 d-flex align-items-center list-cell")},o),e.createElement(jt,{className:"h-100 w-100 py-3"},e.createElement(jt.Body,{className:"d-flex justify-content-center align-items-center py-0 ".concat(l)},e.createElement("div",{className:"w-100 h-100"},a)))))}},Ki.Body=function(t){var n=t.children,r=s(t,["children"]);return e.createElement("tbody",i({},r),e.createElement(Wi.Provider,{value:Ui.BODY},n))};var Zi=function(t){var n=t.className,r=s(t,["className"]);return e.createElement(Ra,i({as:"input",className:n},r))};Zi.Feedback=ka;var Gi=function(t){var n=t.label,r=t.children,a=t.className;return e.createElement(Ba,{className:a},n?e.createElement("small",{className:"text-muted"},n):null,r)},Yi=function(t){var n=t.className,r=t.children,a=s(t,["className","children"]);return e.createElement(Ua,i({className:n},a),r)};Yi.Feedback=ka;var Xi=function(t){var n=t.type,r=t.className,a=s(t,["type","className"]);return e.createElement(Ma,i({type:n},a,{className:r}))};Xi.Feedback=ka;var Ji="object"==typeof global&&global&&global.Object===Object&&global,Qi="object"==typeof self&&self&&self.Object===Object&&self,es=Ji||Qi||Function("return this")(),ts=es.Symbol,ns=Object.prototype,rs=ns.hasOwnProperty,as=ns.toString,os=ts?ts.toStringTag:void 0;var is=Object.prototype.toString;var ss="[object Null]",ls="[object Undefined]",cs=ts?ts.toStringTag:void 0;function us(e){return null==e?void 0===e?ls:ss:cs&&cs in Object(e)?function(e){var t=rs.call(e,os),n=e[os];try{e[os]=void 0;var r=!0}catch(e){}var a=as.call(e);return r&&(t?e[os]=n:delete e[os]),a}(e):function(e){return is.call(e)}(e)}function ds(e){return null!=e&&"object"==typeof e}var hs=Array.isArray;function fs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ps(e){return e}var ms="[object AsyncFunction]",vs="[object Function]",gs="[object GeneratorFunction]",bs="[object Proxy]";function ys(e){if(!fs(e))return!1;var t=us(e);return t==vs||t==gs||t==ms||t==bs}var Es,xs=es["__core-js_shared__"],ws=(Es=/[^.]+$/.exec(xs&&xs.keys&&xs.keys.IE_PROTO||""))?"Symbol(src)_1."+Es:"";var Ns=Function.prototype.toString;function ks(e){if(null!=e){try{return Ns.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Os=/^\[object .+?Constructor\]$/,js=Function.prototype,Ls=Object.prototype,Ss=js.toString,As=Ls.hasOwnProperty,Cs=RegExp("^"+Ss.call(As).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ms(e){return!(!fs(e)||(t=e,ws&&ws in t))&&(ys(e)?Cs:Os).test(ks(e));var t}function Ts(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ms(n)?n:void 0}var Rs=Ts(es,"WeakMap"),_s=Object.create,Ps=function(){function e(){}return function(t){if(!fs(t))return{};if(_s)return _s(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function qs(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n0){if(++Bs>=800)return arguments[0]}else Bs=0;return Ds.apply(void 0,arguments)});var zs=9007199254740991,Ws=/^(?:0|[1-9]\d*)$/;function Ks(e,t){var n=typeof e;return!!(t=null==t?zs:t)&&("number"==n||"symbol"!=n&&Ws.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=tl}function rl(e){return null!=e&&nl(e.length)&&!ys(e)}var al=Object.prototype;function ol(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||al)}function il(e){return ds(e)&&"[object Arguments]"==us(e)}var sl=Object.prototype,ll=sl.hasOwnProperty,cl=sl.propertyIsEnumerable,ul=il(function(){return arguments}())?il:function(e){return ds(e)&&ll.call(e,"callee")&&!cl.call(e,"callee")};var dl="object"==typeof exports&&exports&&!exports.nodeType&&exports,hl=dl&&"object"==typeof module&&module&&!module.nodeType&&module,fl=hl&&hl.exports===dl?es.Buffer:void 0,pl=(fl?fl.isBuffer:void 0)||function(){return!1},ml={};function vl(e){return function(t){return e(t)}}ml["[object Float32Array]"]=ml["[object Float64Array]"]=ml["[object Int8Array]"]=ml["[object Int16Array]"]=ml["[object Int32Array]"]=ml["[object Uint8Array]"]=ml["[object Uint8ClampedArray]"]=ml["[object Uint16Array]"]=ml["[object Uint32Array]"]=!0,ml["[object Arguments]"]=ml["[object Array]"]=ml["[object ArrayBuffer]"]=ml["[object Boolean]"]=ml["[object DataView]"]=ml["[object Date]"]=ml["[object Error]"]=ml["[object Function]"]=ml["[object Map]"]=ml["[object Number]"]=ml["[object Object]"]=ml["[object RegExp]"]=ml["[object Set]"]=ml["[object String]"]=ml["[object WeakMap]"]=!1;var gl="object"==typeof exports&&exports&&!exports.nodeType&&exports,bl=gl&&"object"==typeof module&&module&&!module.nodeType&&module,yl=bl&&bl.exports===gl&&Ji.process,El=function(){try{var e=bl&&bl.require&&bl.require("util").types;return e||yl&&yl.binding&&yl.binding("util")}catch(e){}}(),xl=El&&El.isTypedArray,wl=xl?vl(xl):function(e){return ds(e)&&nl(e.length)&&!!ml[us(e)]},Nl=Object.prototype.hasOwnProperty;function kl(e,t){var n=hs(e),r=!n&&ul(e),a=!n&&!r&&pl(e),o=!n&&!r&&!a&&wl(e),i=n||r||a||o,s=i?function(e,t){for(var n=-1,r=Array(e);++n-1},Dl.prototype.set=function(e,t){var n=this.__data__,r=ql(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Bl=Ts(es,"Map");function $l(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Fl(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ts))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&bu?new mu:void 0;for(o.set(e,t),o.set(t,e);++d1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(a=Qu.length>3&&"function"==typeof a?(r--,a):void 0,o&&function(e,t,n){if(!fs(n))return!1;var r=typeof t;return!!("number"==r?rl(n)&&Ks(t,n.length):"string"==r&&t in n)&&Gs(n[t],e)}(t[0],t[1],o)&&(a=r<3?void 0:a,r=1),e=Object(e);++n(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(td||{});class nd{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const r=td.TYPE&td.ATTRIBUTE;this.scope=null!=n.scope?n.scope&td.LEVEL|r:td.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map((e=>e.name))}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class rd extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const ad=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){const a=this.query(n);if(null==a)throw new rd(`Unable to create ${n} blot`);const o=a,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:o.create(r),s=new o(t,i,r);return e.blots.set(s.domNode,s),s}find(t,n=!1){return e.find(t,n)}query(e,t=td.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&td.LEVEL&td.BLOCK?n=this.types.block:e&td.LEVEL&td.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((e=>(n=this.classes[e],!!n))),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&td.LEVEL&n.scope&&t&td.TYPE&n.scope?n:null}register(...e){return e.map((e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new rd("Invalid definition");if(t&&"abstract"===e.blotName)throw new rd("Cannot register abstract class");const r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map((e=>e.toUpperCase())):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach((t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)})))),e}))}};ad.blots=new WeakMap;let od=ad;function id(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((e=>0===e.indexOf(`${t}-`)))}const sd=class extends nd{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((e=>e.split("-").slice(0,-1).join("-")))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){id(e,this.keyName).forEach((t=>{e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(id(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function ld(e){const t=e.split("-"),n=t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("");return t[0]+n}const cd=class extends nd{static keys(e){return(e.getAttribute("style")||"").split(";").map((e=>e.split(":")[0].trim()))}add(e,t){return!!this.canAdd(e,t)&&(e.style[ld(this.keyName)]=t,!0)}remove(e){e.style[ld(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[ld(this.keyName)];return this.canAdd(e,t)?t:""}};const ud=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=od.find(this.domNode);if(null==e)return;const t=nd.keys(this.domNode),n=sd.keys(this.domNode),r=cd.keys(this.domNode);t.concat(n).concat(r).forEach((t=>{const n=e.scroll.query(t,td.ATTRIBUTE);n instanceof nd&&(this.attributes[n.attrName]=n)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((e=>{this.attributes[e].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}},dd=class{constructor(e,t){this.scroll=e,this.domNode=t,od.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new rd("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),od.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const a=this.isolate(e,t);if(null!=this.scroll.query(n,td.BLOT)&&r)a.wrap(n,r);else if(null!=this.scroll.query(n,td.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);a.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),a=this.split(e);this.parent.insertBefore(r,a||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new rd(`Cannot wrap ${e}`);return n.appendChild(this),n}};dd.blotName="abstract";let hd=dd;const fd=class extends hd{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};fd.scope=td.INLINE_BLOT;const pd=fd;class md{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let r=n();for(;r;){const a=r.length();if(eo?n(s,e-o,Math.min(t,o+r-e)):n(s,0,Math.min(r,e+t-o)),o+=r,s=i()}}map(e){return this.reduce(((t,n)=>(t.push(e(n)),t)),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=n();return t}}function vd(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create(td.INLINE);return Array.from(e.childNodes).forEach((e=>{n.domNode.appendChild(e)})),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const gd=class e extends hd{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new md,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=vd(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof rd)return;throw e}}))}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,((e,t,n)=>{e.deleteAt(t,n)}))}descendant(t,n=0){const[r,a]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,a]:r instanceof e?r.descendant(t,a):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let a=[],o=r;return this.children.forEachAt(n,r,((n,r,i)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&a.push(n),n instanceof e&&(a=a.concat(n.descendants(t,r,o))),o-=i})),a}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach((n=>{t||this.statics.allowedChildren.some((e=>n instanceof e))||(n.statics.scope===td.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())}))}formatAt(e,t,n,r){this.children.forEachAt(e,t,((e,t,a)=>{e.formatAt(t,a,n,r)}))}insertAt(e,t,n){const[r,a]=this.children.find(e);if(r)r.insertAt(a,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((n=>{e.insertBefore(n,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[r,a]=this.children.find(t,n),o=[[this,t]];return r instanceof e?o.concat(r.path(a,n)):(null!=r&&o.push([r,a]),o)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),((e,r,a)=>{const o=e.split(r,t);null!=o&&n.appendChild(o)})),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],r=[];e.forEach((e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))})),r.forEach((e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()})),n.filter((e=>e.parentNode===this.domNode&&e!==this.uiNode)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=vd(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))})),this.enforceAllowedChildren()}};gd.uiClass="";const bd=gd;const yd=class e extends bd{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new ud(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,td.INLINE);if(null==e)return;e instanceof nd?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach((t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)})),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.formats()[n]||this.scroll.query(n,td.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}wrap(t,n){const r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};yd.allowedChildren=[yd,pd],yd.blotName="inline",yd.scope=td.INLINE_BLOT,yd.tagName="SPAN";const Ed=yd,xd=class e extends bd{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new ud(this.domNode)}format(t,n){const r=this.scroll.query(t,td.BLOCK);null!=r&&(r instanceof nd?this.attributes.attribute(r,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.scroll.query(n,td.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,td.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}};xd.blotName="block",xd.scope=td.BLOCK_BLOT,xd.tagName="P",xd.allowedChildren=[Ed,xd,pd];const wd=xd,Nd=class extends bd{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Nd.blotName="container",Nd.scope=td.BLOCK_BLOT;const kd=Nd;const Od=class extends pd{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},jd={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Ld=class extends bd{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((e=>{this.update(e)})),this.observer.observe(this.domNode,jd),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=td.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach((e=>{e.remove()})):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const a=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&a(e.parent))},o=e=>{n.has(e.domNode)&&(e instanceof bd&&e.children.forEach(o),n.delete(e.domNode),e.optimize(t))};let i=e;for(let t=0;i.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(i.forEach((e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(a(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach((e=>{const t=this.find(e,!1);a(t,!1),t instanceof bd&&t.children.forEach((e=>{a(e,!1)}))}))):"attributes"===e.type&&a(t.prev)),a(t))})),this.children.forEach(o),i=Array.from(this.observer.takeRecords()),r=i.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map((e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)})).forEach((e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)})),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Ld.blotName="scroll",Ld.defaultChild=wd,Ld.allowedChildren=[wd,kd],Ld.scope=td.BLOCK_BLOT,Ld.tagName="DIV";const Sd=Ld,Ad=class e extends pd{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some((e=>"characterData"===e.type&&e.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ad.blotName="text",Ad.scope=td.INLINE_BLOT;const Cd=Ad;var Md=Object.freeze({__proto__:null,Attributor:nd,AttributorStore:ud,BlockBlot:wd,ClassAttributor:sd,ContainerBlot:kd,EmbedBlot:Od,InlineBlot:Ed,LeafBlot:pd,ParentBlot:bd,Registry:od,Scope:td,ScrollBlot:Sd,StyleAttributor:cd,TextBlot:Cd}),Td={exports:{}},Rd=-1,_d=1,Pd=0;function qd(e,t,n,r,a){if(e===t)return e?[[Pd,e]]:[];if(null!=n){var o=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,a="number"==typeof n?null:n.newRange,o=e.length,i=t.length;if(0===r.length&&(null===a||0===a.length)){var s=r.index,l=e.slice(0,s),c=e.slice(s),u=a?a.index:null,d=s+i-o;if((null===u||u===d)&&!(d<0||d>i)){var h=t.slice(0,d);if((m=t.slice(d))===c){var f=Math.min(s,d);if((g=l.slice(0,f))===(y=h.slice(0,f)))return Xd(g,l.slice(f),h.slice(f),c)}}if(null===u||u===s){var p=s,m=(h=t.slice(0,p),t.slice(p));if(h===l){var v=Math.min(o-p,i-p);if((b=c.slice(c.length-v))===(E=m.slice(m.length-v)))return Xd(l,c.slice(0,c.length-v),m.slice(0,m.length-v),b)}}}if(r.length>0&&a&&0===a.length){var g=e.slice(0,r.index),b=e.slice(r.index+r.length);if(!(i<(f=g.length)+(v=b.length))){var y=t.slice(0,f),E=t.slice(i-v);if(g===y&&b===E)return Xd(g,e.slice(f,o-v),t.slice(f,i-v),b)}}return null}(e,t,n);if(o)return o}var i=Dd(e,t),s=e.substring(0,i);i=$d(e=e.substring(i),t=t.substring(i));var l=e.substring(e.length-i),c=function(e,t){var n;if(!e)return[[_d,t]];if(!t)return[[Rd,e]];var r=e.length>t.length?e:t,a=e.length>t.length?t:e,o=r.indexOf(a);if(-1!==o)return n=[[_d,r.substring(0,o)],[Pd,a],[_d,r.substring(o+a.length)]],e.length>t.length&&(n[0][0]=n[2][0]=Rd),n;if(1===a.length)return[[Rd,e],[_d,t]];var i=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,a,o,i,c]:null}var o,i,s,l,c,u=a(n,r,Math.ceil(n.length/4)),d=a(n,r,Math.ceil(n.length/2));if(!u&&!d)return null;o=d?u&&u[4].length>d[4].length?u:d:u;e.length>t.length?(i=o[0],s=o[1],l=o[2],c=o[3]):(l=o[0],c=o[1],i=o[2],s=o[3]);var h=o[4];return[i,s,l,c,h]}(e,t);if(i){var s=i[0],l=i[1],c=i[2],u=i[3],d=i[4],h=qd(s,c),f=qd(l,u);return h.concat([[Pd,d]],f)}return function(e,t){for(var n=e.length,r=t.length,a=Math.ceil((n+r)/2),o=a,i=2*a,s=new Array(i),l=new Array(i),c=0;cn)f+=2;else if(y>r)h+=2;else if(d){if((w=o+u-g)>=0&&w=(x=n-l[w]))return Id(e,t,k,y)}}for(var E=-v+p;E<=v-m;E+=2){for(var x,w=o+E,N=(x=E===-v||E!==v&&l[w-1]n)m+=2;else if(N>r)p+=2;else if(!d){if((b=o+u-E)>=0&&b=(x=n-x))return Id(e,t,k,y)}}}}return[[Rd,e],[_d,t]]}(e,t)}(e=e.substring(0,e.length-i),t=t.substring(0,t.length-i));return s&&c.unshift([Pd,s]),l&&c.push([Pd,l]),Wd(c,a),r&&function(e){var t=!1,n=[],r=0,a=null,o=0,i=0,s=0,l=0,c=0;for(;o0?n[r-1]:-1,i=0,s=0,l=0,c=0,a=null,t=!0)),o++;t&&Wd(e);(function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),a=n.match(Fd),o=r.match(Fd),i=a&&n.match(Hd),s=o&&r.match(Hd),l=i&&n.match(Ud),c=s&&r.match(Ud),u=l&&e.match(Vd),d=c&&t.match(zd);return u||d?5:l||c?4:a&&!i&&s?3:i||s?2:a||o?1:0}var n=1;for(;n=d&&(d=h,l=r,c=a,u=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=c,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}})(e),o=1;for(;o=f?(h>=u.length/2||h>=d.length/2)&&(e.splice(o,0,[Pd,d.substring(0,h)]),e[o-1][1]=u.substring(0,u.length-h),e[o+1][1]=d.substring(h),o++):(f>=u.length/2||f>=d.length/2)&&(e.splice(o,0,[Pd,u.substring(0,f)]),e[o-1][0]=_d,e[o-1][1]=d.substring(0,d.length-f),e[o+1][0]=Rd,e[o+1][1]=u.substring(f),o++),o++}o++}}(c),c}function Id(e,t,n,r){var a=e.substring(0,n),o=t.substring(0,r),i=e.substring(n),s=t.substring(r),l=qd(a,o),c=qd(i,s);return l.concat(c)}function Dd(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),a=r,o=0;nr?e=e.substring(n-r):n=0&&Yd(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),i=c+i,s=c+s,!e[l][1]){e.splice(l,1),r--;var u=l-1;e[u]&&e[u][0]===_d&&(o++,s=e[u][1]+s,u--),e[u]&&e[u][0]===Rd&&(a++,i=e[u][1]+i,u--),l=u}}if(Gd(e[r][1])){c=e[r][1].charAt(0);e[r][1]=e[r][1].slice(1),i+=c,s+=c}}if(r0||s.length>0){i.length>0&&s.length>0&&(0!==(n=Dd(s,i))&&(l>=0?e[l][1]+=s.substring(0,n):(e.splice(0,0,[Pd,s.substring(0,n)]),r++),s=s.substring(n),i=i.substring(n)),0!==(n=$d(s,i))&&(e[r][1]=s.substring(s.length-n)+e[r][1],s=s.substring(0,s.length-n),i=i.substring(0,i.length-n)));var d=o+a;0===i.length&&0===s.length?(e.splice(r-d,d),r-=d):0===i.length?(e.splice(r-d,d,[_d,s]),r=r-d+1):0===s.length?(e.splice(r-d,d,[Rd,i]),r=r-d+1):(e.splice(r-d,d,[Rd,i],[_d,s]),r=r-d+2)}0!==r&&e[r-1][0]===Pd?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,o=0,a=0,i="",s=""}""===e[e.length-1][1]&&e.pop();var h=!1;for(r=1;r=55296&&e<=56319}function Zd(e){return e>=56320&&e<=57343}function Gd(e){return Zd(e.charCodeAt(0))}function Yd(e){return Kd(e.charCodeAt(e.length-1))}function Xd(e,t,n,r){return Yd(e)||Gd(r)?null:function(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}([[Pd,e],[Rd,t],[_d,n],[Pd,r]])}function Jd(e,t,n,r){return qd(e,t,n,r,!0)}Jd.INSERT=_d,Jd.DELETE=Rd,Jd.EQUAL=Pd;var Qd=Jd,eh={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",o="[object Boolean]",i="[object Date]",s="[object Function]",c="[object GeneratorFunction]",u="[object Map]",d="[object Number]",h="[object Object]",f="[object Promise]",p="[object RegExp]",m="[object Set]",v="[object String]",g="[object Symbol]",b="[object WeakMap]",y="[object ArrayBuffer]",E="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",N="[object Int8Array]",k="[object Int16Array]",O="[object Int32Array]",j="[object Uint8Array]",L="[object Uint8ClampedArray]",S="[object Uint16Array]",A="[object Uint32Array]",C=/\w*$/,M=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,R={};R[a]=R["[object Array]"]=R[y]=R[E]=R[o]=R[i]=R[x]=R[w]=R[N]=R[k]=R[O]=R[u]=R[d]=R[h]=R[p]=R[m]=R[v]=R[g]=R[j]=R[L]=R[S]=R[A]=!0,R["[object Error]"]=R[s]=R[b]=!1;var _="object"==typeof l&&l&&l.Object===Object&&l,P="object"==typeof self&&self&&self.Object===Object&&self,q=_||P||Function("return this")(),I=t&&!t.nodeType&&t,D=I&&e&&!e.nodeType&&e,B=D&&D.exports===I;function $(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function H(e,t,n,r){var a=-1,o=e?e.length:0;for(r&&o&&(n=e[++a]);++a-1},je.prototype.set=function(e,t){var n=this.__data__,r=Me(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Le.prototype.clear=function(){this.__data__={hash:new Oe,map:new(fe||je),string:new Oe}},Le.prototype.delete=function(e){return qe(this,e).delete(e)},Le.prototype.get=function(e){return qe(this,e).get(e)},Le.prototype.has=function(e){return qe(this,e).has(e)},Le.prototype.set=function(e,t){return qe(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new je},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof je){var r=n.__data__;if(!fe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Le(r)}return n.set(e,t),this};var De=ce?z(ce,Object):function(){return[]},Be=function(e){return ee.call(e)};function $e(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var We=ue||function(){return!1};function Ke(e){var t=Ze(e)?ee.call(e):"";return t==s||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ge(e){return ze(e)?Ae(e):function(e){if(!Fe(e))return de(e);var t=[];for(var n in Object(e))Q.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}(eh,eh.exports);var th=eh.exports,nh={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=1,a=2,o=9007199254740991,i="[object Arguments]",s="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",v="[object Number]",g="[object Null]",b="[object Object]",y="[object Promise]",E="[object Proxy]",x="[object RegExp]",w="[object Set]",N="[object String]",k="[object Symbol]",O="[object Undefined]",j="[object WeakMap]",L="[object ArrayBuffer]",S="[object DataView]",A=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[i]=M[s]=M[L]=M[u]=M[S]=M[d]=M[h]=M[f]=M[m]=M[v]=M[b]=M[x]=M[w]=M[N]=M[j]=!1;var T="object"==typeof l&&l&&l.Object===Object&&l,R="object"==typeof self&&self&&self.Object===Object&&self,_=T||R||Function("return this")(),P=t&&!t.nodeType&&t,q=P&&e&&!e.nodeType&&e,I=q&&q.exports===P,D=I&&T.process,B=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),$=B&&B.isTypedArray;function F(e,t){for(var n=-1,r=null==e?0:e.length;++nc))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var h=-1,f=!0,p=n&a?new ke:void 0;for(s.set(e,t),s.set(t,e);++h-1},we.prototype.set=function(e,t){var n=this.__data__,r=Le(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ne.prototype.clear=function(){this.size=0,this.__data__={hash:new xe,map:new(ce||we),string:new xe}},Ne.prototype.delete=function(e){var t=Pe(this,e).delete(e);return this.size-=t?1:0,t},Ne.prototype.get=function(e){return Pe(this,e).get(e)},Ne.prototype.has=function(e){return Pe(this,e).has(e)},Ne.prototype.set=function(e,t){var n=Pe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ke.prototype.add=ke.prototype.push=function(e){return this.__data__.set(e,n),this},ke.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.clear=function(){this.__data__=new we,this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof we){var r=n.__data__;if(!ce||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ne(r)}return n.set(e,t),this.size=n.size,this};var Ie=oe?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ze(e){return null!=e&&"object"==typeof e}var Ge=$?function(e){return function(t){return e(t)}}($):function(e){return Ze(e)&&We(e.length)&&!!M[Se(e)]};function Ye(e){return null!=(t=e)&&We(t.length)&&!ze(t)?je(e):Te(e);var t}e.exports=function(e,t){return Ce(e,t)}}(nh,nh.exports);var rh=nh.exports,ah={};Object.defineProperty(ah,"__esModule",{value:!0});const oh=th,ih=rh;var sh;!function(e){e.compose=function(e={},t={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let r=oh(t);n||(r=Object.keys(r).reduce(((e,t)=>(null!=r[t]&&(e[t]=r[t]),e)),{}));for(const n in e)void 0!==e[n]&&void 0===t[n]&&(r[n]=e[n]);return Object.keys(r).length>0?r:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const n=Object.keys(e).concat(Object.keys(t)).reduce(((n,r)=>(ih(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n)),{});return Object.keys(n).length>0?n:void 0},e.invert=function(e={},t={}){e=e||{};const n=Object.keys(t).reduce(((n,r)=>(t[r]!==e[r]&&void 0!==e[r]&&(n[r]=t[r]),n)),{});return Object.keys(e).reduce(((n,r)=>(e[r]!==t[r]&&void 0===t[r]&&(n[r]=null),n)),n)},e.transform=function(e,t,n=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!n)return t;const r=Object.keys(t).reduce(((n,r)=>(void 0===e[r]&&(n[r]=t[r]),n)),{});return Object.keys(r).length>0?r:void 0}}(sh||(sh={})),ah.default=sh;var lh,ch={};Object.defineProperty(ch,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(lh||(lh={})),ch.default=lh;var uh={};Object.defineProperty(uh,"__esModule",{value:!0});const dh=ch;uh.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const n=this.offset,r=dh.default.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"object"==typeof t.retain&&null!==t.retain?r.retain=t.retain:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?dh.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}return[]}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const n=Qd,r=th,a=rh,o=ah;t.AttributeMap=o.default;const i=ch;t.Op=i.default;const s=uh;t.OpIterator=s.default;const l=String.fromCharCode(0),c=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class u{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(a(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach((r=>{(e(r)?t:n).push(r)})),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce(((e,t)=>t.insert?e+i.default.length(t):t.delete?e-t.delete:e),0)}length(){return this.reduce(((e,t)=>e+i.default.length(t)),0)}slice(e=0,t=1/0){const n=[],r=new s.default(this.ops);let a=0;for(;a0&&n.next(i.retain-e)}const l=new u(r);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===t.peekType())l.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),r=t.next(e),i=n.next(e);if(i.retain){const s={};if("number"==typeof r.retain)s.retain="number"==typeof i.retain?e:i.retain;else if("number"==typeof i.retain)null==r.retain?s.insert=r.insert:s.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,a]=c(r[e],i.retain),o=u.getHandler(t);s[e]={[t]:o.compose(n,a,"retain"===e)}}const d=o.default.compose(r.attributes,i.attributes,"number"==typeof r.retain);if(d&&(s.attributes=d),l.push(s),!n.hasNext()&&a(l.ops[l.ops.length-1],s)){const e=new u(t.rest());return l.concat(e).chop()}}else"number"==typeof i.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&l.push(i)}return l.chop()}concat(e){const t=new u(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new u;const r=[this,e].map((t=>t.map((n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join(""))),i=new u,c=n(r[0],r[1],t,!0),d=new s.default(this.ops),h=new s.default(e.ops);return c.forEach((e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(h.peekLength(),t),i.push(h.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),i.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),h.peekLength(),t);const e=d.next(r),s=h.next(r);a(e.insert,s.insert)?i.retain(r,o.default.diff(e.attributes,s.attributes)):i.push(s).delete(r)}t-=r}})),i.chop()}eachLine(e,t="\n"){const n=new s.default(this.ops);let r=new u,a=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const o=n.peek(),s=i.default.length(o)-n.peekLength(),l="string"==typeof o.insert?o.insert.indexOf(t,s)-s:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===e(r,n.next(1).attributes||{},a))return;a+=1,r=new u}}r.length()>0&&e(r,{},a)}invert(e){const t=new u;return this.reduce(((n,r)=>{if(r.insert)t.delete(i.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const a=r.delete||r.retain;return e.slice(n,n+a).forEach((e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(i.default.length(e),o.default.invert(r.attributes,e.attributes))})),n+a}if("object"==typeof r.retain&&null!==r.retain){const a=e.slice(n,n+1),i=new s.default(a.ops).next(),[l,d,h]=c(r.retain,i.insert),f=u.getHandler(l);return t.retain({[l]:f.invert(d,h)},o.default.invert(r.attributes,i.attributes)),n+1}}return n}),0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,r=new s.default(this.ops),a=new s.default(n.ops),l=new u;for(;r.hasNext()||a.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===a.peekType())if("insert"===a.peekType())l.push(a.next());else{const e=Math.min(r.peekLength(),a.peekLength()),n=r.next(e),i=a.next(e);if(n.delete)continue;if(i.delete)l.push(i);else{const r=n.retain,a=i.retain;let s="object"==typeof a&&null!==a?a:e;if("object"==typeof r&&null!==r&&"object"==typeof a&&null!==a){const e=Object.keys(r)[0];if(e===Object.keys(a)[0]){const n=u.getHandler(e);n&&(s={[e]:n.transform(r[e],a[e],t)})}}l.retain(s,o.default.transform(n.attributes,i.attributes,t))}}else l.retain(i.default.length(r.next()));return l.chop()}transformPosition(e,t=!1){t=!!t;const n=new s.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const a=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(r"']/g,(e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e])))}class gh extends Ed{static allowedChildren=[gh,ph,Od,mh];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const n=gh.order.indexOf(e),r=gh.order.indexOf(t);return n>=0||r>=0?n-r:e===t?0:e0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}class bh extends wd{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=Eh(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,td.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(null!=n)return super.insertAt(e,t,n),void(this.cache={});if(0===t.length)return;const r=t.split("\n"),a=r.shift();a.length>0&&(e(o=o.split(e,!0),o.insertAt(0,t),t.length)),e+a.length)}insertBefore(e,t){const{head:n}=this.children;super.insertBefore(e,t),n instanceof ph&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&(0===e||e>=this.length()-1)){const t=this.clone();return 0===e?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}const n=super.split(e,t);return this.cache={},n}}bh.blotName="block",bh.tagName="P",bh.defaultChild=ph,bh.allowedChildren=[ph,gh,Od,mh];class yh extends Od{attach(){super.attach(),this.attributes=new ud(this.domNode)}delta(){return(new fh).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,td.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(null!=n)return void super.insertAt(e,t,n);const r=t.split("\n"),a=r.pop(),o=r.map((e=>{const t=this.scroll.create(bh.blotName);return t.insertAt(0,e),t})),i=this.split(e);o.forEach((e=>{this.parent.insertBefore(e,i)})),a&&this.parent.insertBefore(this.scroll.create("text",a),i)}}function Eh(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(pd).reduce(((e,n)=>0===n.length()?e:e.insert(n.value(),xh(n,{},t))),new fh).insert("\n",xh(e))}function xh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t={...t,...e.formats()},n&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:xh(e.parent,t,n))}yh.scope=td.BLOCK_BLOT;class wh extends Od{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(wh.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(e,t){if(0!==this.savedLength)return void super.format(e,t);let n=this,r=0;for(;null!=n&&n.statics.scope!==td.BLOCK_BLOT;)r+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=wh.CONTENTS.length,n.optimize(),n.formatAt(r,wh.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const e=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof mh?this.prev:null,n=t?t.length():0,r=this.next instanceof mh?this.next:null,a=r?r.text:"",{textNode:o}=this,i=o.data.split(wh.CONTENTS).join("");let s;if(o.data=wh.CONTENTS,t)s=t,(i||r)&&(t.insertAt(t.length(),i+a),r&&r.remove());else if(r)s=r,r.insertAt(0,i);else{const e=document.createTextNode(i);s=this.scroll.create(e),this.parent.insertBefore(s,this)}if(this.remove(),e){const a=(e,a)=>t&&e===t.domNode?a:e===o?n+a-1:r&&e===r.domNode?n+i.length+a:null,l=a(e.start.node,e.start.offset),c=a(e.end.node,e.end.offset);if(null!==l&&null!==c)return{startNode:s.domNode,startOffset:l,endNode:s.domNode,endOffset:c}}return null}update(e,t){if(e.some((e=>"characterData"===e.type&&e.target===this.textNode))){const e=this.restore();e&&(t.range=e)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if("A"===t.domNode.tagName){this.savedLength=wh.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Nh={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,o||e,i),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,o=r.length,i=new Array(o);a1?t-1:0),r=1;r(t[n]=Sh.bind(console,n,e),t)),{})}Ah.level=e=>{Lh=e},Sh.level=Ah.level;const Ch=Ah("quill:events");["selectionchange","mousedown","mouseup","click"].forEach((e=>{document.addEventListener(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n{const n=Oh.get(e);n&&n.emitter&&n.emitter.handleDOM(...t)}))}))}));class Mh extends kh{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Ch.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r{let{node:r,handler:a}=t;(e.target===r||r.contains(e.target))&&a(e,...n)}))}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}const Th=Ah("quill:selection");class Rh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=e,this.length=t}}class _h{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Rh(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,Mh.sources.USER),1)})),this.emitter.on(Mh.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const e=this.getNativeRange();null!=e&&e.start.node!==this.cursor.textNode&&this.emitter.once(Mh.events.SCROLL_UPDATE,((t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);const r=n.some((e=>"characterData"===e.type||"childList"===e.type||"attributes"===e.type&&e.target===this.root));this.update(r?Mh.sources.SILENT:t)}catch(e){}}))})),this.emitter.on(Mh.events.SCROLL_OPTIMIZE,((e,t)=>{if(t.range){const{startNode:e,startOffset:n,endNode:r,endOffset:a}=t.range;this.setNativeRange(e,n,r,a),this.update(Mh.sources.SILENT)}})),this.update(Mh.sources.SILENT)}handleComposition(){this.emitter.on(Mh.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(Mh.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(Mh.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(e,td.BLOCK)){if(n.start.node!==this.cursor.textNode){const e=this.scroll.find(n.start.node,!1);if(null==e)return;if(e instanceof pd){const t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let r;e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let[a,o]=this.scroll.leaf(e);if(null==a)return null;if(t>0&&o===a.length()){const[t]=this.scroll.leaf(e+1);if(t){const[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(a=t,o=0)}}[r,o]=a.position(o,!0);const i=document.createRange();if(t>0)return i.setStart(r,o),[a,o]=this.scroll.leaf(e+t),null==a?null:([r,o]=a.position(o,!0),i.setEnd(r,o),i.getBoundingClientRect());let s,l="left";if(r instanceof Text){if(!r.data.length)return null;o0&&(l="right")}return{bottom:s.top+s.height,height:s.height,left:s[l],right:s[l],top:s.top,width:0}}getNativeRange(){const e=document.getSelection();if(null==e||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(null==t)return null;const n=this.normalizeNative(t);return Th.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();if(null==t)return[null,null];return[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&Ph(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map((e=>{const[t,n]=e,r=this.scroll.find(t,!0),a=r.offset(this.scroll);return 0===n?a:r instanceof pd?a+r.index(t,n):a+r.length()})),r=Math.min(Math.max(...n),this.scroll.length()-1),a=Math.min(r,...n);return new Rh(a,r-a)}normalizeNative(e){if(!Ph(this.root,e.startContainer)||!e.collapsed&&!Ph(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1}e.node=t,e.offset=n})),t}rangeToNative(e){const t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);const[r,a]=this.scroll.leaf(e);return r?r.position(a,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Th.info("setNativeRange",e,t,n,r),null!=e&&(null==this.root.parentNode||null==e.parentNode||null==n.parentNode))return;const o=document.getSelection();if(null!=o)if(null!=e){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:i}=this.getNativeRange()||{};if(null==i||a||e!==i.startContainer||t!==i.startOffset||n!==i.endContainer||r!==i.endOffset){e instanceof Element&&"BR"===e.tagName&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&"BR"===n.tagName&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const a=document.createRange();a.setStart(e,t),a.setEnd(n,r),o.removeAllRanges(),o.addRange(a)}}else o.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mh.sources.API;if("string"==typeof t&&(n=t,t=!1),Th.info("setRange",e),null!=e){const n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mh.sources.USER;const t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!Ju(t,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}const n=[Mh.events.SELECTION_CHANGE,pu(this.lastRange),pu(t),e];this.emitter.emit(Mh.events.EDITOR_CHANGE,...n),e!==Mh.sources.SILENT&&this.emitter.emit(...n)}}}function Ph(e,t){try{t.parentNode}catch(e){return!1}return e.contains(t)}const qh=/^[ -~]*$/;class Ih{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=Hh(e),r=new fh;return function(e){const t=[];return e.forEach((e=>{if("string"==typeof e.insert){e.insert.split("\n").forEach(((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}))}else t.push(e)})),t}(n.ops.slice()).reduce(((e,n)=>{const a=hh.Op.length(n);let o=n.attributes||{},i=!1,s=!1;if(null!=n.insert){if(r.retain(a),"string"==typeof n.insert){const r=n.insert;s=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(yh,e)[0]),this.scroll.insertAt(e,r);const[a,i]=this.scroll.line(e);let l=ed({},xh(a));if(a instanceof bh){const[e]=a.descendant(pd,i);e&&(l=ed(l,xh(e)))}o=hh.AttributeMap.diff(l,o)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return e;const a=null!=this.scroll.query(r,td.INLINE);if(a)(t<=e||this.scroll.descendant(yh,e)[0])&&(s=!0);else if(e>0){const[t,n]=this.scroll.descendant(pd,e-1);if(t instanceof mh){"\n"!==t.value()[n]&&(i=!0)}else t instanceof Od&&t.statics.scope===td.INLINE_BLOT&&(i=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),a){const[t]=this.scroll.descendant(pd,e);if(t){const e=ed({},xh(t));o=hh.AttributeMap.diff(e,o)||{}}}}t+=a}else if(r.push(n),null!==n.retain&&"object"==typeof n.retain){const t=Object.keys(n.retain)[0];if(null==t)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(o).forEach((t=>{this.scroll.formatAt(e,a,t,o[t])}));const l=i?1:0,c=s?1:0;return t+=l+c,r.retain(l),r.delete(c),e+a+l+c}),0),r.reduce(((e,t)=>"number"==typeof t.delete?(this.scroll.deleteAt(e,t.delete),e):e+hh.Op.length(t)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new fh).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach((r=>{this.scroll.lines(e,Math.max(t,1)).forEach((e=>{e.format(r,n[r])}))})),this.scroll.optimize();const r=(new fh).retain(e).retain(t,pu(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t,r,n[r])}));const r=(new fh).retain(e).retain(t,pu(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new fh)}getFormat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach((e=>{const[t]=e;t instanceof bh?n.push(t):t instanceof pd&&r.push(t)})):(n=this.scroll.lines(e,t),r=this.scroll.descendants(pd,e,t));const[a,o]=[n,r].map((e=>{const t=e.shift();if(null==t)return{};let n=xh(t);for(;Object.keys(n).length>0;){const t=e.shift();if(null==t)return n;n=$h(xh(t),n)}return n}));return{...a,...o}}getHTML(e,t){const[n,r]=this.scroll.line(e);if(n){const a=n.length();return!(n.length()>=r+t)||0===r&&t===a?Bh(this.scroll,e,t,!0):Bh(n,r,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((e=>"string"==typeof e.insert)).map((e=>e.insert)).join("")}insertContents(e,t){const n=Hh(t),r=(new fh).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new fh).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t.length,r,n[r])})),this.update((new fh).retain(e).insert(t,pu(n)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==bh.blotName)return!1;const t=e;return!(t.children.length>1)&&t.children.head instanceof ph}removeFormat(e,t){const n=this.getText(e,t),[r,a]=this.scroll.line(e+t);let o=0,i=new fh;null!=r&&(o=r.length()-a,i=r.delta().slice(a,a+o-1).insert("\n"));const s=this.getContents(e,t+o).diff((new fh).insert(n).concat(i)),l=(new fh).retain(e).concat(s);return this.applyDelta(l)}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(qh)&&this.scroll.find(t[0].target)){const a=this.scroll.find(t[0].target),o=xh(a),i=a.offset(this.scroll),s=t[0].oldValue.replace(wh.CONTENTS,""),l=(new fh).insert(s),c=(new fh).insert(a.value()),u=n&&{oldRange:Uh(n.oldRange,-i),newRange:Uh(n.newRange,-i)};e=(new fh).retain(i).concat(l.diff(c,u)).reduce(((e,t)=>t.insert?e.insert(t.insert,o):e.push(t)),new fh),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&Ju(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}function Dh(e,t,n){if(0===e.length){const[e]=Fh(n.pop());return t<=0?``:`${Dh([],t-1,n)}`}const[{child:r,offset:a,length:o,indent:i,type:s},...l]=e,[c,u]=Fh(s);if(i>t)return n.push(s),i===t+1?`<${c}>${Bh(r,a,o)}${Dh(l,i,n)}`:`<${c}>
  • ${Dh(e,t+1,n)}`;const d=n[n.length-1];if(i===t&&s===d)return`
  • ${Bh(r,a,o)}${Dh(l,i,n)}`;const[h]=Fh(n.pop());return`${Dh(e,t-1,n)}`}function Bh(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in e&&"function"==typeof e.html)return e.html(t,n);if(e instanceof mh)return vh(e.value().slice(t,t+n));if(e instanceof bd){if("list-container"===e.statics.blotName){const r=[];return e.children.forEachAt(t,n,((e,t,n)=>{const a="formats"in e&&"function"==typeof e.formats?e.formats():{};r.push({child:e,offset:t,length:n,indent:a.indent||0,type:a.list})})),Dh(r,-1,[])}const a=[];if(e.children.forEachAt(t,n,((e,t,n)=>{a.push(Bh(e,t,n))})),r||"list"===e.statics.blotName)return a.join("");const{outerHTML:o,innerHTML:i}=e.domNode,[s,l]=o.split(`>${i}<`);return"${a.join("")}<${l}`:`${s}>${a.join("")}<${l}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function $h(e,t){return Object.keys(t).reduce(((n,r)=>{if(null==e[r])return n;const a=t[r];return a===e[r]?n[r]=a:Array.isArray(a)?a.indexOf(e[r])<0?n[r]=a.concat([e[r]]):n[r]=a:n[r]=[a,e[r]],n}),{})}function Fh(e){const t="ordered"===e?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Hh(e){return e.reduce(((e,t)=>{if("string"==typeof t.insert){const n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)}),new fh)}function Uh(e,t){let{index:n,length:r}=e;return new Rh(n+t,r)}class Vh{static DEFAULTS={};constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=e,this.options=t}}const zh="\ufeff";class Wh extends Od{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((e=>{this.contentNode.appendChild(e)})),this.leftGuard=document.createTextNode(zh),this.rightGuard=document.createTextNode(zh),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t,n=null;const r=e.data.split(zh).join("");if(e===this.leftGuard)if(this.prev instanceof mh){const e=this.prev.length();this.prev.insertAt(e,r),n={startNode:this.prev.domNode,startOffset:e+r.length}}else t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this),n={startNode:t,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof mh?(this.next.insertAt(0,r),n={startNode:this.next.domNode,startOffset:r.length}):(t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this.next),n={startNode:t,startOffset:r.length}));return e.data=zh,n}update(e,t){e.forEach((e=>{if("characterData"===e.type&&(e.target===this.leftGuard||e.target===this.rightGuard)){const n=this.restore(e.target);n&&(t.range=n)}}))}}class Kh{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;!t||t instanceof Wh||(this.emitter.emit(Mh.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Mh.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Mh.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Mh.events.COMPOSITION_END,e),this.isComposing=!1}}class Zh{static DEFAULTS={modules:{}};static themes={default:Zh};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{null==this.modules[e]&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const Gh=e=>{const t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},Yh=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},Xh=(e,t,n,r,a,o)=>er?0:er?t-e>r-n?e+a-n:t-r+o:0,Jh=["block","break","cursor","inline","scroll","text"],Qh=Ah("quill"),ef=new od;bd.uiClass="ql-ui";class tf{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:ef,theme:"default"};static events=Mh.events;static sources=Mh.sources;static version="2.0.2";static imports={delta:fh,parchment:Md,"core/module":Vh,"core/theme":Zh};static debug(e){!0===e&&(e="log"),Ah.level(e)}static find(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Oh.get(e)||ef.find(e,t)}static import(e){return null==this.imports[e]&&Qh.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const e=arguments.length<=0?void 0:arguments[0],t=!!(arguments.length<=1?void 0:arguments[1]),n="attrName"in e?e.attrName:e.blotName;"string"==typeof n?this.register(`formats/${n}`,e,t):Object.keys(e).forEach((n=>{this.register(n,e[n],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[e]||n||Qh.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&"boolean"!=typeof t&&"abstract"!==t.blotName&&ef.register(t),"function"==typeof t.register&&t.register(ef)}}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(e,t){const n=nf(e);if(!n)throw new Error("Invalid Quill container");const r=!t.theme||t.theme===tf.DEFAULTS.theme,a=r?Zh:tf.import(`themes/${t.theme}`);if(!a)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:o,...i}=tf.DEFAULTS,{modules:s,...l}=a.DEFAULTS;let c=rf(t.modules);null!=c&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});const u=ed({},rf(o),rf(s),c),d={...i,...af(l),...af(t)};let h=t.registry;h?t.formats&&Qh.warn('Ignoring "formats" option because "registry" is specified'):h=t.formats?((e,t,n)=>{const r=new od;return Jh.forEach((e=>{const n=t.query(e);n&&r.register(n)})),e.forEach((e=>{let a=t.query(e);a||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,o+=1,o>100){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}})),r})(t.formats,d.registry,Qh):d.registry;return{...d,registry:h,container:n,theme:a,modules:Object.entries(u).reduce(((e,t)=>{let[n,r]=t;if(!r)return e;const a=tf.import(`modules/${n}`);return null==a?(Qh.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:ed({},a.DEFAULTS||{},r)}}),{}),bounds:nf(d.bounds)}}(e,t),this.container=this.options.container,null==this.container)return void Qh.error("Invalid Quill container",e);this.options.debug&&tf.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Oh.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Mh;const r=Sd.blotName,a=this.options.registry.query(r);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Ih(this.scroll),this.selection=new _h(this.scroll,this.emitter),this.composition=new Kh(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Mh.events.EDITOR_CHANGE,(e=>{e===Mh.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(Mh.events.SCROLL_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;of.call(this,(()=>this.editor.update(null,t,a)),e)})),this.emitter.on(Mh.events.SCROLL_EMBED_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),a=n&&r?{oldRange:n,newRange:r}:void 0;of.call(this,(()=>{const n=(new fh).retain(e.offset(this)).retain({[e.statics.blotName]:t});return this.editor.update(n,[],a)}),tf.sources.USER)})),n){const e=this.clipboard.convert({html:`${n}


    `,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){const t=e;(e=document.createElement("div")).classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=sf(e,t,n),of.call(this,(()=>this.editor.deleteText(e,t)),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mh.sources.API;return of.call(this,(()=>{const n=this.getSelection(!0);let r=new fh;if(null==n)return r;if(this.scroll.query(e,td.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else{if(0===n.length)return this.selection.format(e,t),r;r=this.editor.formatText(n.index,n.length,{[e]:t})}return this.setSelection(n,Mh.sources.SILENT),r}),n)}formatLine(e,t,n,r,a){let o;return[e,t,o,a]=sf(e,t,n,r,a),of.call(this,(()=>this.editor.formatLine(e,t,o)),a,e,0)}formatText(e,t,n,r,a){let o;return[e,t,o,a]=sf(e,t,n,r,a),of.call(this,(()=>this.editor.formatText(e,t,o)),a,e,0)}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;const r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;return[e,t]=sf(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=sf(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=sf(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:tf.sources.API;return of.call(this,(()=>this.editor.insertEmbed(e,t,n)),r,e)}insertText(e,t,n,r,a){let o;return[e,,o,a]=sf(e,0,n,r,a),of.call(this,(()=>this.editor.insertText(e,t,o)),a,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=sf(e,t,n),of.call(this,(()=>this.editor.removeFormat(e,t)),n,e)}scrollRectIntoView(e){((e,t)=>{const n=e.ownerDocument;let r=t,a=e;for(;a;){const e=a===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:Gh(a),i=getComputedStyle(a),s=Xh(r.left,r.right,t.left,t.right,Yh(i.scrollPaddingLeft),Yh(i.scrollPaddingRight)),l=Xh(r.top,r.bottom,t.top,t.bottom,Yh(i.scrollPaddingTop),Yh(i.scrollPaddingBottom));if(s||l)if(e)n.defaultView?.scrollBy(s,l);else{const{scrollLeft:e,scrollTop:t}=a;l&&(a.scrollTop+=l),s&&(a.scrollLeft+=s);const n=a.scrollLeft-e,o=a.scrollTop-t;r={left:r.left-n,top:r.top-o,right:r.right-n,bottom:r.bottom-o}}a=e||"fixed"===i.position?null:(o=a).parentElement||o.getRootNode().host||null}var o})(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mh.sources.API;return of.call(this,(()=>{e=new fh(e);const t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(a)}),t)}setSelection(e,t,n){null==e?this.selection.setRange(null,t||tf.sources.API):([e,t,,n]=sf(e,t,n),this.selection.setRange(new Rh(Math.max(0,e),t),n),n!==Mh.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mh.sources.API;const n=(new fh).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mh.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mh.sources.API;return of.call(this,(()=>(e=new fh(e),this.editor.applyDelta(e))),t,!0)}}function nf(e){return"string"==typeof e?document.querySelector(e):e}function rf(e){return Object.entries(e??{}).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:!0===r?{}:r}}),{})}function af(e){return Object.fromEntries(Object.entries(e).filter((e=>void 0!==e[1])))}function of(e,t,n,r){if(!this.isEnabled()&&t===Mh.sources.USER&&!this.allowReadOnlyEdits)return new fh;let a=null==n?null:this.getSelection();const o=this.editor.delta,i=e();if(null!=a&&(!0===n&&(n=a.index),null==r?a=lf(a,i,t):0!==r&&(a=lf(a,n,r,t)),this.setSelection(a,Mh.sources.SILENT)),i.length()>0){const e=[Mh.events.TEXT_CHANGE,i,o,t];this.emitter.emit(Mh.events.EDITOR_CHANGE,...e),t!==Mh.sources.SILENT&&this.emitter.emit(...e)}return i}function sf(e,t,n,r,a){let o={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(a=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(a=r,r=n,n=t,t=0),"object"==typeof n?(o=n,a=r):"string"==typeof n&&(null!=r?o[n]=r:a=n),[e,t,o,a=a||Mh.sources.API]}function lf(e,t,n,r){const a="number"==typeof n?n:0;if(null==e)return null;let o,i;return t&&"function"==typeof t.transformPosition?[o,i]=[e.index,e.index+e.length].map((e=>t.transformPosition(e,r!==Mh.sources.USER))):[o,i]=[e.index,e.index+e.length].map((e=>e=0?e+a:Math.max(t,e+a))),new Rh(o,i-o)}class cf extends kd{}function uf(e){return e instanceof bh||e instanceof yh}function df(e){return"function"==typeof e.updateContent}function hf(e,t,n){n.reduce(((t,n)=>{const r=hh.Op.length(n);let a=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const r=n.insert;e.insertAt(t,r);const[o]=e.descendant(pd,t),i=xh(o);a=hh.AttributeMap.diff(i,a)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return t;e.insertAt(t,r,n.insert[r]);if(null!=e.scroll.query(r,td.INLINE)){const[n]=e.descendant(pd,t),r=xh(n);a=hh.AttributeMap.diff(r,a)||{}}}return Object.keys(a).forEach((n=>{e.formatAt(t,r,n,a[n])})),t+r}),t)}const ff={scope:td.BLOCK,whitelist:["right","center","justify"]},pf=new nd("align","align",ff),mf=new sd("align","ql-align",ff),vf=new cd("align","text-align",ff);class gf extends cd{value(e){let t=super.value(e);if(!t.startsWith("rgb("))return t;t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");return`#${t.split(",").map((e=>`00${parseInt(e,10).toString(16)}`.slice(-2))).join("")}`}}const bf=new sd("color","ql-color",{scope:td.INLINE}),yf=new gf("color","color",{scope:td.INLINE}),Ef=new sd("background","ql-bg",{scope:td.INLINE}),xf=new gf("background","background-color",{scope:td.INLINE});class wf extends cf{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((e=>e.length()<=1?"":e.domNode.innerText)).join("\n").slice(e,e+t)}html(e,t){return`
    \n${vh(this.code(e,t))}\n
    `}}class Nf extends bh{static TAB=" ";static register(){tf.register(wf)}}class kf extends gh{}kf.blotName="code",kf.tagName="CODE",Nf.blotName="code-block",Nf.className="ql-code-block",Nf.tagName="DIV",wf.blotName="code-block-container",wf.className="ql-code-block-container",wf.tagName="DIV",wf.allowedChildren=[Nf],Nf.allowedChildren=[mh,ph,wh],Nf.requiredContainer=wf;const Of={scope:td.BLOCK,whitelist:["rtl"]},jf=new nd("direction","dir",Of),Lf=new sd("direction","ql-direction",Of),Sf=new cd("direction","direction",Of),Af={scope:td.INLINE,whitelist:["serif","monospace"]},Cf=new sd("font","ql-font",Af);const Mf=new class extends cd{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",Af),Tf=new sd("size","ql-size",{scope:td.INLINE,whitelist:["small","large","huge"]}),Rf=new cd("size","font-size",{scope:td.INLINE,whitelist:["10px","18px","32px"]}),_f=Ah("quill:keyboard"),Pf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class qf extends Vh{static match(e,t){return!["altKey","ctrlKey","metaKey","shiftKey"].some((n=>!!t[n]!==e[n]&&null!==t[n]))&&(t.key===e.key||t.key===e.which)}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){if("string"==typeof e||"number"==typeof e)e={key:e};else{if("object"!=typeof e)return null;e=pu(e)}e.shortKey&&(e[Pf]=e.shortKey,delete e.shortKey);return e}(e);if(null==r)return void _f.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n});(Array.isArray(r.key)?r.key:[r.key]).forEach((e=>{const a={...r,key:e,...t,...n};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing)return;if(229===e.keyCode&&("Enter"===e.key||"Backspace"===e.key))return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((t=>qf.match(e,t)));if(0===t.length)return;const n=tf.find(e.target,!0);if(n&&n.scroll!==this.quill.scroll)return;const r=this.quill.getSelection();if(null==r||!this.quill.hasFocus())return;const[a,o]=this.quill.getLine(r.index),[i,s]=this.quill.getLeaf(r.index),[l,c]=0===r.length?[i,s]:this.quill.getLeaf(r.index+r.length),u=i instanceof Cd?i.value().slice(0,s):"",d=l instanceof Cd?l.value().slice(c):"",h={collapsed:0===r.length,empty:0===r.length&&a.length()<=1,format:this.quill.getFormat(r),line:a,offset:o,prefix:u,suffix:d,event:e};t.some((e=>{if(null!=e.collapsed&&e.collapsed!==h.collapsed)return!1;if(null!=e.empty&&e.empty!==h.empty)return!1;if(null!=e.offset&&e.offset!==h.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((e=>null==h.format[e])))return!1}else if("object"==typeof e.format&&!Object.keys(e.format).every((t=>!0===e.format[t]?null!=h.format[t]:!1===e.format[t]?null==h.format[t]:Ju(e.format[t],h.format[t]))))return!1;return!(null!=e.prefix&&!e.prefix.test(h.prefix))&&(!(null!=e.suffix&&!e.suffix.test(h.suffix))&&!0!==e.handler.call(this,r,h,e))}))&&e.preventDefault()}))}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(0===e.index||this.quill.getLength()<=1)return;let r={};const[a]=this.quill.getLine(e.index);let o=(new fh).retain(e.index-n).delete(n);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(t){if(!("block"===t.statics.blotName&&t.length()<=1)){const t=a.formats(),n=this.quill.getFormat(e.index-1,1);if(r=hh.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){const t=(new fh).retain(e.index+a.length()-2).retain(1,r);o=o.compose(t)}}}}this.quill.updateContents(o,tf.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={};const[a]=this.quill.getLine(e.index);let o=(new fh).retain(e.index).delete(n);if(t.offset>=a.length()-1){const[t]=this.quill.getLine(e.index+1);if(t){const n=a.formats(),i=this.quill.getFormat(e.index,1);r=hh.AttributeMap.diff(n,i)||{},Object.keys(r).length>0&&(o=o.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(o,tf.sources.USER),this.quill.focus()}handleDeleteRange(e){Hf({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce(((e,n)=>(this.quill.scroll.query(n,td.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e)),{}),r=(new fh).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,tf.sources.USER),this.quill.setSelection(e.index+1,tf.sources.SILENT),this.quill.focus()}}const If={bindings:{bold:$f("bold"),italic:$f("italic"),underline:$f("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","+1",tf.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","-1",tf.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){null!=t.format.indent?this.quill.format("indent","-1",tf.sources.USER):null!=t.format.list&&this.quill.format("list",!1,tf.sources.USER)}},"indent code-block":Df(!0),"outdent code-block":Df(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,tf.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const n=(new fh).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,tf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,tf.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,tf.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,tf.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},a=(new fh).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(a,tf.sources.USER),this.quill.setSelection(e.index+1,tf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[n,r]=this.quill.getLine(e.index),a=(new fh).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(a,tf.sources.USER),this.quill.setSelection(e.index+1,tf.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[n,r,a,o]=t.getTable(e),i=function(e,t,n,r){if(null==t.prev&&null==t.next)return null==n.prev&&null==n.next?0===r?-1:1:null==n.prev?-1:1;if(null==t.prev)return-1;if(null==t.next)return 1;return null}(0,r,a,o);if(null==i)return;let s=n.offset();if(i<0){const t=(new fh).retain(s).insert("\n");this.quill.updateContents(t,tf.sources.USER),this.quill.setSelection(e.index+1,e.length,tf.sources.SILENT)}else if(i>0){s+=n.length();const e=(new fh).retain(s).insert("\n");this.quill.updateContents(e,tf.sources.USER),this.quill.setSelection(s,tf.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:n,line:r}=t,a=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(a-1,tf.sources.USER):this.quill.setSelection(a+r.length(),tf.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=t.prefix,[r,a]=this.quill.getLine(e.index);if(a>n)return!0;let o;switch(t.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(e.index," ",tf.sources.USER),this.quill.history.cutoff();const i=(new fh).retain(e.index-a).delete(n+1).retain(r.length()-2-a).retain(1,{list:o});return this.quill.updateContents(i,tf.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,tf.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,n]=this.quill.getLine(e.index);let r=2,a=t;for(;null!=a&&a.length()<=1&&a.formats()["code-block"];)if(a=a.prev,r-=1,r<=0){const r=(new fh).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,tf.sources.USER),this.quill.setSelection(e.index-1,tf.sources.SILENT),!1}return!0}},"embed left":Bf("ArrowLeft",!1),"embed left shift":Bf("ArrowLeft",!0),"embed right":Bf("ArrowRight",!1),"embed right shift":Bf("ArrowRight",!0),"table down":Ff(!1),"table up":Ff(!0)}};function Df(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n;const a=this.quill.scroll.query("code-block"),{TAB:o}=a;if(0===t.length&&!r.shiftKey)return this.quill.insertText(t.index,o,tf.sources.USER),void this.quill.setSelection(t.index+o.length,tf.sources.SILENT);const i=0===t.length?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:s,length:l}=t;i.forEach(((t,n)=>{e?(t.insertAt(0,o),0===n?s+=o.length:l+=o.length):t.domNode.textContent.startsWith(o)&&(t.deleteAt(0,o.length),0===n?s-=o.length:l-=o.length)})),this.quill.update(tf.sources.USER),this.quill.setSelection(s,l,tf.sources.SILENT)}}}function Bf(e,t){return{key:e,shiftKey:t,altKey:null,["ArrowLeft"===e?"prefix":"suffix"]:/^$/,handler(n){let{index:r}=n;"ArrowRight"===e&&(r+=n.length+1);const[a]=this.quill.getLeaf(r);return!(a instanceof Od)||("ArrowLeft"===e?t?this.quill.setSelection(n.index-1,n.length+1,tf.sources.USER):this.quill.setSelection(n.index-1,tf.sources.USER):t?this.quill.setSelection(n.index,n.length+1,tf.sources.USER):this.quill.setSelection(n.index+n.length+1,tf.sources.USER),!1)}}}function $f(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],tf.sources.USER)}}}function Ff(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){const r=e?"prev":"next",a=n.line,o=a.parent[r];if(null!=o){if("table-row"===o.statics.blotName){let e=o.children.head,t=a;for(;null!=t.prev;)t=t.prev,e=e.next;const r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,tf.sources.USER)}}else{const t=a.table()[r];null!=t&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,tf.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,tf.sources.USER))}return!1}}}function Hf(e){let{quill:t,range:n}=e;const r=t.getLines(n);let a={};if(r.length>1){const e=r[0].formats(),t=r[r.length-1].formats();a=hh.AttributeMap.diff(t,e)||{}}t.deleteText(n,tf.sources.USER),Object.keys(a).length>0&&t.formatLine(n.index,1,a,tf.sources.USER),t.setSelection(n.index,tf.sources.SILENT)}qf.DEFAULTS=If;const Uf=/font-weight:\s*normal/,Vf=["P","OL","UL"],zf=e=>e&&Vf.includes(e.tagName);const Wf=/\bmso-list:[^;]*ignore/i,Kf=/\bmso-list:[^;]*\bl(\d+)/i,Zf=/\bmso-list:[^;]*\blevel(\d+)/i,Gf=e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach((e=>{(e.getAttribute("style")||"").match(Wf)?n.push(e):r.push(e)})),n.forEach((e=>e.parentNode?.removeChild(e)));const a=e.documentElement.innerHTML,o=r.map((e=>((e,t)=>{const n=e.getAttribute("style"),r=n?.match(Kf);if(!r)return null;const a=Number(r[1]),o=n?.match(Zf),i=o?Number(o[1]):1,s=new RegExp(`@list l${a}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=t.match(s);return{id:a,indent:i,type:l&&"bullet"===l[1]?"bullet":"ordered",element:e}})(e,a))).filter((e=>e));for(;o.length;){const e=[];let t=o.shift();for(;t;)e.push(t),t=o.length&&o[0]?.element===t.element.nextElementSibling&&o[0].id===t.id?o.shift():null;const n=document.createElement("ul");e.forEach((e=>{const t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class","ql-indent-"+(e.indent-1)),t.innerHTML=e.element.innerHTML,n.appendChild(t)}));const r=e[0]?.element,{parentNode:a}=r??{};r&&a?.replaceChild(n,r),e.slice(1).forEach((e=>{let{element:t}=e;a?.removeChild(t)}))}};const Yf=[function(e){"urn:schemas-microsoft-com:office:word"===e.documentElement.getAttribute("xmlns:w")&&Gf(e)},function(e){e.querySelector('[id^="docs-internal-guid-"]')&&((e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Uf))).forEach((t=>{const n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)}))})(e),(e=>{Array.from(e.querySelectorAll("br")).filter((e=>zf(e.previousElementSibling)&&zf(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))})(e))}],Xf=Ah("quill:clipboard"),Jf=[[Node.TEXT_NODE,function(e,t,n){let r=e.data;if("O:P"===e.parentElement?.tagName)return t.insert(r.trim());if(!op(e)){if(0===r.trim().length&&r.includes("\n")&&!function(e,t){return e.previousElementSibling&&e.nextElementSibling&&!rp(e.previousElementSibling,t)&&!rp(e.nextElementSibling,t)}(e,n))return t;const a=(e,t)=>{const n=t.replace(/[^\u00a0]/g,"");return n.length<1&&e?" ":n};r=r.replace(/\r\n/g," ").replace(/\n/g," "),r=r.replace(/\s\s+/g,a.bind(a,!0)),(null==e.previousSibling&&null!=e.parentElement&&rp(e.parentElement,n)||e.previousSibling instanceof Element&&rp(e.previousSibling,n))&&(r=r.replace(/^\s+/,a.bind(a,!1))),(null==e.nextSibling&&null!=e.parentElement&&rp(e.parentElement,n)||e.nextSibling instanceof Element&&rp(e.nextSibling,n))&&(r=r.replace(/\s+$/,a.bind(a,!1)))}return t.insert(r)}],[Node.TEXT_NODE,lp],["br",function(e,t){np(t,"\n")||t.insert("\n");return t}],[Node.ELEMENT_NODE,lp],[Node.ELEMENT_NODE,function(e,t,n){const r=n.query(e);if(null==r)return t;if(r.prototype instanceof Od){const t={},a=r.value(e);if(null!=a)return t[r.blotName]=a,(new fh).insert(t,r.formats(e,n))}else if(r.prototype instanceof wd&&!np(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&"function"==typeof r.formats)return tp(t,r.blotName,r.formats(e,n),n);return t}],[Node.ELEMENT_NODE,function(e,t,n){const r=nd.keys(e),a=sd.keys(e),o=cd.keys(e),i={};return r.concat(a).concat(o).forEach((t=>{let r=n.query(t,td.ATTRIBUTE);null!=r&&(i[r.attrName]=r.value(e),i[r.attrName])||(r=Qf[t],null==r||r.attrName!==t&&r.keyName!==t||(i[r.attrName]=r.value(e)||void 0),r=ep[t],null==r||r.attrName!==t&&r.keyName!==t||(r=ep[t],i[r.attrName]=r.value(e)||void 0))})),Object.entries(i).reduce(((e,t)=>{let[r,a]=t;return tp(e,r,a,n)}),t)}],[Node.ELEMENT_NODE,function(e,t,n){const r={},a=e.style||{};"italic"===a.fontStyle&&(r.italic=!0);"underline"===a.textDecoration&&(r.underline=!0);"line-through"===a.textDecoration&&(r.strike=!0);(a.fontWeight?.startsWith("bold")||parseInt(a.fontWeight,10)>=700)&&(r.bold=!0);if(t=Object.entries(r).reduce(((e,t)=>{let[r,a]=t;return tp(e,r,a,n)}),t),parseFloat(a.textIndent||0)>0)return(new fh).insert("\t").concat(t);return t}],["li",function(e,t,n){const r=n.query(e);if(null==r||"list"!==r.blotName||!np(t,"\n"))return t;let a=-1,o=e.parentNode;for(;null!=o;)["OL","UL"].includes(o.tagName)&&(a+=1),o=o.parentNode;return a<=0?t:t.reduce(((e,t)=>t.insert?t.attributes&&"number"==typeof t.attributes.indent?e.push(t):e.insert(t.insert,{indent:a,...t.attributes||{}}):e),new fh)}],["ol, ul",function(e,t,n){const r=e;let a="OL"===r.tagName?"ordered":"bullet";const o=r.getAttribute("data-checked");o&&(a="true"===o?"checked":"unchecked");return tp(t,"list",a,n)}],["pre",function(e,t,n){const r=n.query("code-block"),a=!r||!("formats"in r)||"function"!=typeof r.formats||r.formats(e,n);return tp(t,"code-block",a,n)}],["tr",function(e,t,n){const r="TABLE"===e.parentElement?.tagName?e.parentElement:e.parentElement?.parentElement;if(null!=r){return tp(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n)}return t}],["b",sp("bold")],["i",sp("italic")],["strike",sp("strike")],["style",function(){return new fh}]],Qf=[pf,jf].reduce(((e,t)=>(e[t.keyName]=t,e)),{}),ep=[vf,xf,yf,Sf,Mf,Rf].reduce(((e,t)=>(e[t.keyName]=t,e)),{});function tp(e,t,n,r){return r.query(t)?e.reduce(((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);const a=n?{[t]:n}:{};return e.insert(r.insert,{...a,...r.attributes})}),new fh):e}function np(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.lengthr(t,n,e)),new fh):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce(((o,i)=>{let s=ip(e,i,n,r,a);return i.nodeType===t.ELEMENT_NODE&&(s=n.reduce(((t,n)=>n(i,t,e)),s),s=(a.get(i)||[]).reduce(((t,n)=>n(i,t,e)),s)),o.concat(s)}),new fh):new fh}function sp(e){return(t,n,r)=>tp(n,e,!0,r)}function lp(e,t,n){if(!np(t,"\n")){if(rp(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;null!=r;){if(rp(r,n))return t.insert("\n");const e=n.query(r);if(e&&e.prototype instanceof yh)return t.insert("\n");r=r.firstChild}}}return t}function cp(e,t){let n=t;for(let t=e.length-1;t>=0;t-=1){const r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&up(r.range,n)},n=r.delta.transform(n),0===e[t].delta.length()&&e.splice(t,1)}}function up(e,t){if(!e)return e;const n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}class dp extends Vh{constructor(e,t){super(e,t),e.root.addEventListener("drop",(t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}const r=n&&e.selection.normalizeNative(n);if(r){const n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}}))}upload(e,t){const n=[];Array.from(t).forEach((e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)})),n.length>0&&this.options.handler.call(this,e,n)}}dp.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;const n=t.map((e=>new Promise((t=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}))));Promise.all(n).then((t=>{const n=t.reduce(((e,t)=>e.insert({image:t})),(new fh).retain(e.index).delete(e.length));this.quill.updateContents(n,Mh.sources.USER),this.quill.setSelection(e.index+t.length,Mh.sources.SILENT)}))}};const hp=["insertText","insertReplacementText"];const fp=/Mac/i.test(navigator.platform);tf.register({"blots/block":bh,"blots/block/embed":yh,"blots/break":ph,"blots/container":cf,"blots/cursor":wh,"blots/embed":Wh,"blots/inline":gh,"blots/scroll":class extends Sd{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=bh;static allowedChildren=[bh,yh,cf];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(e=>this.handleDragStart(e)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Mh.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Mh.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Mh.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,r]=this.line(e),[a]=this.line(e+t);if(super.deleteAt(e,t),null!=a&&n!==a&&r>0){if(n instanceof yh||a instanceof yh)return void this.optimize();const e=a.children.head instanceof ph?null:a.children.head;n.moveChildren(a,e),n.remove()}this.optimize()}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(null==n||null==this.scroll.query(t,td.BLOCK)){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),null==n&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{const e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===td.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat((new fh).insert("\n"))),r=n.pop();if(null==r)return;this.batchStart();const a=n.shift();if(a){const t="block"===a.type&&(0===a.delta.length()||!this.descendant(yh,e)[0]&&e{this.formatAt(o-1,1,e,s[e])})),e=o}let[o,i]=this.children.find(e);if(n.length&&(o&&(o=o.split(i),i=0),n.forEach((e=>{if("block"===e.type){hf(this.createBlock(e.attributes,o||void 0),0,e.delta)}else{const t=this.create(e.key,e.value);this.insertBefore(t,o||void 0),Object.keys(e.attributes).forEach((n=>{t.format(n,e.attributes[n])}))}}))),"block"===r.type&&r.delta.length()){hf(this,o?o.offset(o.scroll)+i:this.length(),r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,r]=t;return n instanceof pd?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(uf,e)}lines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(e,t,r)=>{let a=[],o=r;return e.children.forEachAt(t,r,((e,t,r)=>{uf(e)?a.push(e):e instanceof kd&&(a=a.concat(n(e,t,o))),o-=r})),a};return n(this,e,t)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Mh.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch)return void(Array.isArray(e)&&(this.batch=this.batch.concat(e)));let t=Mh.sources.USER;"string"==typeof e&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),(e=e.filter((e=>{let{target:t}=e;const n=this.find(t,!0);return n&&!df(n)}))).length>0&&this.emitter.emit(Mh.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Mh.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[r]=this.descendant((e=>e instanceof yh),e);r&&r.statics.blotName===t&&df(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new fh;return e.forEach((e=>{const r=e?.insert;if(r)if("string"==typeof r){const a=r.split("\n");a.slice(0,-1).forEach((r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new fh}));const o=a[a.length-1];o&&n.insert(o,e.attributes)}else{const a=Object.keys(r)[0];if(!a)return;this.query(a,td.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new fh,t.push({type:"blockEmbed",key:a,value:r[a],attributes:e.attributes??{}}))}})),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const r={};Object.entries(e).forEach((e=>{let[t,a]=e;null!=this.query(t,td.BLOCK&td.BLOT)?n=t:r[t]=a}));const a=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(a,t||void 0);const o=a.length();return Object.entries(r).forEach((e=>{let[t,n]=e;a.formatAt(0,o,t,n)})),a}},"blots/text":mh,"modules/clipboard":class extends Vh{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(e=>this.onCaptureCopy(e,!1))),this.quill.root.addEventListener("cut",(e=>this.onCaptureCopy(e,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Jf.concat(this.options.matchers??[]).forEach((e=>{let[t,n]=e;this.addMatcher(t,n)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r[Nf.blotName])return(new fh).insert(n||"",{[Nf.blotName]:r[Nf.blotName]});if(!t)return(new fh).insert(n||"",r);const a=this.convertHTML(t);return np(a,"\n")&&(null==a.ops[a.ops.length-1].attributes||r.table)?a.compose((new fh).retain(a.length()-1).delete(1)):a}normalizeHTML(e){(e=>{e.documentElement&&Yf.forEach((t=>{t(e)}))})(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,r=new WeakMap,[a,o]=this.prepareMatching(n,r);return ip(this.quill.scroll,n,a,o,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tf.sources.API;if("string"==typeof e){const n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,tf.sources.SILENT)}else{const r=this.convert({html:t,text:""});this.quill.updateContents((new fh).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),tf.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(null==n)return;const{html:r,text:a}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",a),e.clipboardData?.setData("text/html",r),t&&Hf({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((e=>"#"!==e[0])).join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(null==t)return;const n=e.clipboardData?.getData("text/html");let r=e.clipboardData?.getData("text/plain");if(!n&&!r){const t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}const a=Array.from(e.clipboardData?.files||[]);if(!n&&a.length>0)this.quill.uploader.upload(t,a);else{if(n&&a.length>0){const e=(new DOMParser).parseFromString(n,"text/html");if(1===e.body.childElementCount&&"IMG"===e.body.firstElementChild?.tagName)return void this.quill.uploader.upload(t,a)}this.onPaste(t,{html:n,text:r})}}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t;const a=this.quill.getFormat(e.index),o=this.convert({text:n,html:r},a);Xf.log("onPaste",o,{text:n,html:r});const i=(new fh).retain(e.index).delete(e.length).concat(o);this.quill.updateContents(i,tf.sources.USER),this.quill.setSelection(i.length()-e.length,tf.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],r=[];return this.matchers.forEach((a=>{const[o,i]=a;switch(o){case Node.TEXT_NODE:r.push(i);break;case Node.ELEMENT_NODE:n.push(i);break;default:Array.from(e.querySelectorAll(o)).forEach((e=>{if(t.has(e)){const n=t.get(e);n?.push(i)}else t.set(e,[i])}))}})),[n,r]}},"modules/history":class extends Vh{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(tf.events.EDITOR_CHANGE,((e,t,n,r)=>{e===tf.events.SELECTION_CHANGE?t&&r!==tf.sources.SILENT&&(this.currentRange=t):e===tf.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&r!==tf.sources.USER?this.transform(t):this.record(t,n)),this.currentRange=up(this.currentRange,t))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(e=>{"historyUndo"===e.inputType?(this.undo(),e.preventDefault()):"historyRedo"===e.inputType&&(this.redo(),e.preventDefault())}))}change(e,t){if(0===this.stack[e].length)return;const n=this.stack[e].pop();if(!n)return;const r=this.quill.getContents(),a=n.delta.invert(r);this.stack[t].push({delta:a,range:up(n.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,tf.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(0===e.ops.length)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=a;0!==n.length()&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){cp(this.stack.undo,e),cp(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,tf.sources.USER);else{const t=function(e,t){const n=t.reduce(((e,t)=>e+(t.delete||0)),0);let r=t.length()-n;(function(e,t){const n=t.ops[t.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some((t=>null!=e.query(t,td.BLOCK)));return!1})(e,t)&&(r-=1);return r}(this.quill.scroll,e.delta);this.quill.setSelection(t,tf.sources.USER)}}},"modules/keyboard":qf,"modules/uploader":dp,"modules/input":class extends Vh{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(e=>{this.handleBeforeInput(e)})),/Android/i.test(navigator.userAgent)||e.on(tf.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){Hf({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===e.length)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new fh).retain(e.index).insert(t,n),tf.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,tf.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!hp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||!0===t.collapsed)return;const n=function(e){if("string"==typeof e.data)return e.data;if(e.dataTransfer?.types.includes("text/plain"))return e.dataTransfer.getData("text/plain");return null}(e);if(null==n)return;const r=this.quill.selection.normalizeNative(t),a=r?this.quill.selection.normalizedToRange(r):null;a&&this.replaceText(a,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}},"modules/uiNode":class extends Vh{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof bd&&n.uiNode))return!0;const a="rtl"===getComputedStyle(n.domNode).direction;return!!(a&&"ArrowRight"!==r.key||!a&&"ArrowLeft"!==r.key)||(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),tf.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&(e=>"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"Home"===e.key||!(!fp||"a"!==e.key||!0!==e.ctrlKey))(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(!0!==t.collapsed||0!==t.startOffset)return;const n=this.quill.scroll.find(t.startContainer);if(!(n instanceof bd&&n.uiNode))return;const r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}}});const pp=new class extends sd{add(e,t){let n=0;if("+1"===t||"-1"===t){const r=this.value(e)||0;n="+1"===t?r+1:r-1}else"number"==typeof t&&(n=t);return 0===n?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:td.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class mp extends cf{}mp.blotName="list-container",mp.tagName="OL";class vp extends bh{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){tf.register(mp)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;const r=this.statics.formats(t,e);"checked"===r?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===r&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}vp.blotName="list",vp.tagName="LI",mp.allowedChildren=[vp],vp.requiredContainer=mp;class gp extends gh{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}let bp=class extends gh{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return yp(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("href",this.constructor.sanitize(t)):super.format(e,t)}};function yp(e,t){const n=document.createElement("a");n.href=e;const r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}const Ep=["alt","height","width"];const xp=["height","width"];const wp=new sd("code-token","hljs",{scope:td.INLINE});class Np extends gh{static formats(e,t){for(;null!=e&&e!==t.domNode;){if(e.classList&&e.classList.contains(Nf.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),wp.add(this.domNode,n)}format(e,t){e!==Np.blotName?super.format(e,t):t?wp.add(this.domNode,t):(wp.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),wp.value(this.domNode)||this.unwrap()}}Np.blotName="code-token",Np.className="ql-token";class kp extends Nf{static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Np.blotName,!1),super.replaceWith(e,t)}}class Op extends wf{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===kp.blotName&&(this.forceNext=!0,this.children.forEach((n=>{n.format(e,t)})))}formatAt(e,t,n,r){n===kp.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=`${Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).map((e=>e.textContent)).join("\n")}\n`,r=kp.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||null==this.cachedText){const t=this.children.reduce(((e,t)=>e.concat(Eh(t,!1))),new fh),a=e(n,r);t.diff(a).reduce(((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach((t=>{[kp.blotName,Np.blotName].includes(t)&&this.formatAt(e,n,t,r[t])})),e+n):e}),0)}this.cachedText=n,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`
    \n${vh(this.code(e,t))}\n
    `}optimize(e){if(super.optimize(e),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const e=kp.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Op.allowedChildren=[kp],kp.requiredContainer=Op,kp.allowedChildren=[Np,wh,mh,ph];class jp extends Vh{static register(){tf.register(Np,!0),tf.register(kp,!0),tf.register(Op,!0)}constructor(e,t){if(super(e,t),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((e,t)=>{let{key:n}=t;return e[n]=!0,e}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(tf.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Op))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((e=>{let{key:n,label:r}=e;const a=t.ownerDocument.createElement("option");a.textContent=r,a.setAttribute("value",n),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(kp.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),null==e.uiNode&&(e.attachUI(t),e.children.head&&(t.value=kp.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(tf.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(tf.sources.USER);const n=this.quill.getSelection();(null==e?this.quill.scroll.descendants(Op):[e]).forEach((e=>{e.highlight(this.highlightBlot,t)})),this.quill.update(tf.sources.SILENT),null!=n&&this.quill.setSelection(n,tf.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(t=this.languages[t]?t:"plain","plain"===t)return vh(e).split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[Nf.blotName]:t}),e.insert(n))),new fh);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Nf.className),n.innerHTML=((e,t,n)=>{if("string"==typeof e.versionString){const r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value})(this.options.hljs,t,e),ip(this.quill.scroll,n,[(e,t)=>{const n=wp.value(e);return n?t.compose((new fh).retain(t.length(),{[Np.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[Nf.blotName]:t}),e.insert(n))),n)],new WeakMap)}}jp.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class Lp extends bh{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Mp()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Lp.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Sp extends cf{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach((e=>{if(null==e.next)return;const t=e.formats(),n=e.next.formats();if(t.table!==n.table){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class Ap extends cf{static blotName="table-body";static tagName="TBODY"}class Cp extends cf{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Sp),t=e.reduce(((e,t)=>Math.max(t.children.length,e)),0);e.forEach((e=>{new Array(t-e.children.length).fill(0).forEach((()=>{let t;null!=e.children.head&&(t=Lp.formats(e.children.head.domNode));const n=this.scroll.create(Lp.blotName,t);e.appendChild(n),n.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(Ap);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e);null!=n&&n.remove()}))}insertColumn(e){const[t]=this.descendant(Ap);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e),r=Lp.formats(t.children.head.domNode),a=this.scroll.create(Lp.blotName,r);t.insertBefore(a,n)}))}insertRow(e){const[t]=this.descendant(Ap);if(null==t||null==t.children.head)return;const n=Mp(),r=this.scroll.create(Sp.blotName);t.children.head.children.forEach((()=>{const e=this.scroll.create(Lp.blotName,n);r.appendChild(e)}));const a=t.children.at(e);t.insertBefore(r,a)}rows(){const e=this.children.head;return null==e?[]:e.children.map((e=>e))}}function Mp(){return`row-${Math.random().toString(36).slice(2,6)}`}Cp.allowedChildren=[Ap],Ap.requiredContainer=Cp,Ap.allowedChildren=[Sp],Sp.requiredContainer=Ap,Sp.allowedChildren=[Lp],Lp.requiredContainer=Sp;const Tp=Ah("quill:toolbar");class Rp extends Vh{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const t=document.createElement("div");t.setAttribute("role","toolbar"),function(e,t){Array.isArray(t[0])||(t=[t]);t.forEach((t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach((e=>{if("string"==typeof e)_p(n,e);else{const t=Object.keys(e)[0],r=e[t];Array.isArray(r)?function(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach((e=>{const t=document.createElement("option");!1!==e?t.setAttribute("value",String(e)):t.setAttribute("selected","selected"),r.appendChild(t)})),e.appendChild(r)}(n,t,r):_p(n,t,r)}})),e.appendChild(n)}))}(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((e=>{const t=this.options.handlers?.[e];t&&this.addHandler(e,t)})),Array.from(this.container.querySelectorAll("button, select")).forEach((e=>{this.attach(e)})),this.quill.on(tf.events.EDITOR_CHANGE,(()=>{const[e]=this.quill.selection.getRange();this.update(e)}))):Tp.error("Container required for toolbar",this.options)}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void Tp.warn("ignoring attaching to nonexistent format",t,e);const n="SELECT"===e.tagName?"change":"click";e.addEventListener(n,(n=>{let r;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];r=!t.hasAttribute("selected")&&(t.value||!1)}else r=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),n.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(null!=this.handlers[t])this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof Od){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new fh).retain(a.index).delete(a.length).insert({[t]:r}),tf.sources.USER)}else this.quill.format(t,r,tf.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=null==e?{}:this.quill.getFormat(e);this.controls.forEach((n=>{const[r,a]=n;if("SELECT"===a.tagName){let n=null;if(null==e)n=null;else if(null==t[r])n=a.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];"string"==typeof e&&(e=e.replace(/"/g,'\\"')),n=a.querySelector(`option[value="${e}"]`)}null==n?(a.value="",a.selectedIndex=-1):n.selected=!0}else if(null==e)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const e=t[r],n=e===a.getAttribute("value")||null!=e&&e.toString()===a.getAttribute("value")||null==e&&!a.getAttribute("value");a.classList.toggle("ql-active",n),a.setAttribute("aria-pressed",n.toString())}else{const e=null!=t[r];a.classList.toggle("ql-active",e),a.setAttribute("aria-pressed",e.toString())}}))}}function _p(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),null!=n?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}Rp.DEFAULTS={},Rp.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(null!=e)if(0===e.length){const e=this.quill.getFormat();Object.keys(e).forEach((e=>{null!=this.quill.scroll.query(e,td.INLINE)&&this.quill.format(e,!1,tf.sources.USER)}))}else this.quill.removeFormat(e.index,e.length,tf.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();"rtl"===e&&null==t?this.quill.format("align","right",tf.sources.USER):e||"right"!==t||this.quill.format("align",!1,tf.sources.USER),this.quill.format("direction",e,tf.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if("+1"===e||"-1"===e){let t="+1"===e?1:-1;"rtl"===n.direction&&(t*=-1),this.quill.format("indent",r+t,tf.sources.USER)}},link(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,tf.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,tf.sources.USER):this.quill.format("list","unchecked",tf.sources.USER):this.quill.format("list",e,tf.sources.USER)}}};const Pp='';var qp={align:{"":'',center:'',right:'',justify:''},background:'',blockquote:'',bold:'',clean:'',code:Pp,"code-block":Pp,color:'',direction:{"":'',rtl:''},formula:'',header:{1:'',2:'',3:'',4:'',5:'',6:''},italic:'',image:'',indent:{"+1":'',"-1":''},link:'',list:{bullet:'',check:'',ordered:''},script:{sub:'',super:''},strike:'',table:'',underline:'',video:''};let Ip=0;function Dp(e,t){e.setAttribute(t,`${!("true"===e.getAttribute(t))}`)}class Bp{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(()=>{this.togglePicker()})),this.label.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Dp(this.label,"aria-expanded"),Dp(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault()}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML='',e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Ip}`,Ip+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const n=this.buildItem(t);e.appendChild(n),!0===t.selected&&this.selectItem(n)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);const t=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class $p extends Bp{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((e=>{e.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=r:n.style.fill=r)}}class Fp extends Bp{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((e=>{e.innerHTML=t[e.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}class Hp{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(e=>{const{overflowY:t}=getComputedStyle(e,null);return"visible"!==t&&"clip"!==t})(this.quill.root)&&this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=-1*this.quill.root.scrollTop+"px"})),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let o=0;if(a.right>r.right&&(o=r.right-a.right,this.root.style.left=`${t+o}px`),a.leftr.bottom){const t=a.bottom-a.top,r=e.bottom-e.top+t;this.root.style.top=n-r+"px",this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Up=[!1,"center","right","justify"],Vp=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],zp=[!1,"serif","monospace"],Wp=["1","2","3",!1],Kp=["small",!1,"large","huge"];class Zp extends Zh{constructor(e,t){super(e,t);const n=t=>{document.body.contains(e.root)?(null==this.tooltip||this.tooltip.root.contains(t.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((e=>{e.container.contains(t.target)||e.close()}))):document.body.removeEventListener("click",n)};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return"toolbar"===e&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((e=>{(e.getAttribute("class")||"").split(/\s+/).forEach((n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{const r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((e=>{if(e.classList.contains("ql-align")&&(null==e.querySelector("option")&&Yp(e,Up),"object"==typeof t.align))return new Fp(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){const n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&Yp(e,Vp,"background"===n?"#ffffff":"#000000"),new $p(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?Yp(e,zp):e.classList.contains("ql-header")?Yp(e,Wp):e.classList.contains("ql-size")&&Yp(e,Kp)),new Bp(e)}));this.quill.on(Mh.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((e=>{e.update()}))}))}}Zp.DEFAULTS=ed({},Zh.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");null==e&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",(()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""})),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Gp extends Hp{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{"Enter"===e.key?(this.save(),e.preventDefault()):"Escape"===e.key&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Mh.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Mh.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=function(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t)return`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`;if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`;return e}(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(null!=t){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,Mh.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",Mh.sources.USER),this.quill.setSelection(n+2,Mh.sources.USER)}break}}this.textbox.value="",this.hide()}}function Yp(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((t=>{const r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)}))}const Xp=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Jp extends Gp{static TEMPLATE=['','
    ','','',"
    "].join("");constructor(e,t){super(e,t),this.quill.on(Mh.events.EDITOR_CHANGE,((e,t,n,r)=>{if(e===Mh.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===Mh.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const e=this.quill.getLines(t.index,t.length);if(1===e.length){const e=this.quill.getBounds(t);null!=e&&this.position(e)}else{const n=e[e.length-1],r=this.quill.getIndex(n),a=Math.min(n.length()-1,t.index+t.length-r),o=this.quill.getBounds(new Rh(r,a));null!=o&&this.position(o)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(Mh.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(null!=e){const t=this.quill.getBounds(e);null!=t&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==t&&(n.style.marginLeft=-1*t-n.offsetWidth/2+"px"),t}}class Qp extends Zp{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=Xp),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Jp(this.quill,this.options.bounds),null!=e.container&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),qp),this.buildPickers(e.container.querySelectorAll("select"),qp))}}Qp.DEFAULTS=ed({},Zp.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,tf.sources.USER)}}}}});const em=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class tm extends Gp{static TEMPLATE=['','','',''].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(null!=this.linkRange){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,Mh.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(Mh.events.SELECTION_CHANGE,((e,t,n)=>{if(null!=e){if(0===e.length&&n===Mh.sources.USER){const[t,n]=this.quill.scroll.descendant(bp,e.index);if(null!=t){this.linkRange=new Rh(e.index-n,t.length());const r=bp.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();const a=this.quill.getBounds(this.linkRange);return void(null!=a&&this.position(a))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class nm extends Zp{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=em),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){null!=e.container&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),qp),this.buildPickers(e.container.querySelectorAll("select"),qp),this.tooltip=new tm(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,n)=>{e.handlers.link.call(e,!n.format.link)})))}}nm.DEFAULTS=ed({},Zp.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const e=this.quill.getSelection();if(null==e||0===e.length)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&0!==t.indexOf("mailto:")&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,tf.sources.USER)}}}}}),tf.register({"attributors/attribute/direction":jf,"attributors/class/align":mf,"attributors/class/background":Ef,"attributors/class/color":bf,"attributors/class/direction":Lf,"attributors/class/font":Cf,"attributors/class/size":Tf,"attributors/style/align":vf,"attributors/style/background":xf,"attributors/style/color":yf,"attributors/style/direction":Sf,"attributors/style/font":Mf,"attributors/style/size":Rf},!0),tf.register({"formats/align":mf,"formats/direction":Lf,"formats/indent":pp,"formats/background":xf,"formats/color":yf,"formats/font":Cf,"formats/size":Tf,"formats/blockquote":class extends bh{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":Nf,"formats/header":class extends bh{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},"formats/list":vp,"formats/bold":gp,"formats/code":kf,"formats/italic":class extends gp{static blotName="italic";static tagName=["EM","I"]},"formats/link":bp,"formats/script":class extends gh{static blotName="script";static tagName=["SUB","SUP"];static create(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):super.create(e)}static formats(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}},"formats/strike":class extends gp{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends gh{static blotName="underline";static tagName="U"},"formats/formula":class extends Wh{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return"string"==typeof e&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`${e}`}},"formats/image":class extends Od{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Ep.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return yp(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Ep.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},"formats/video":class extends yh{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return xp.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static sanitize(e){return bp.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){xp.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`${e}`}},"modules/syntax":jp,"modules/table":class extends Vh{static register(){tf.register(Lp),tf.register(Sp),tf.register(Ap),tf.register(Cp)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Cp).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();null!=t&&(e.deleteColumn(t.cellOffset()),this.quill.update(tf.sources.USER))}deleteRow(){const[,e]=this.getTable();null!=e&&(e.remove(),this.quill.update(tf.sources.USER))}deleteTable(){const[e]=this.getTable();if(null==e)return;const t=e.offset();e.remove(),this.quill.update(tf.sources.USER),this.quill.setSelection(t,tf.sources.SILENT)}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==Lp.blotName)return[null,null,null,-1];const r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const o=a.cellOffset();n.insertColumn(o+e),this.quill.update(tf.sources.USER);let i=r.rowOffset();0===e&&(i+=1),this.quill.setSelection(t.index+i,t.length,tf.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,r,a]=this.getTable(t);if(null==a)return;const o=r.rowOffset();n.insertRow(o+e),this.quill.update(tf.sources.USER),e>0?this.quill.setSelection(t,tf.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,tf.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(null==n)return;const r=new Array(e).fill(0).reduce((e=>{const n=new Array(t).fill("\n").join("");return e.insert(n,{table:Mp()})}),(new fh).retain(n.index));this.quill.updateContents(r,tf.sources.USER),this.quill.setSelection(n.index,tf.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(tf.events.SCROLL_OPTIMIZE,(e=>{e.some((e=>!!["TD","TR","TBODY","TABLE"].includes(e.target.tagName)&&(this.quill.once(tf.events.TEXT_CHANGE,((e,t,n)=>{n===tf.sources.USER&&this.balanceTables()})),!0)))}))}},"modules/toolbar":Rp,"themes/bubble":Qp,"themes/snow":nm,"ui/icons":qp,"ui/picker":Bp,"ui/icon-picker":Fp,"ui/color-picker":$p,"ui/tooltip":Hp},!0);var rm=function(t){var n=t.className,r=s(t,["className"]);return e.createElement(Ja.Control,i({as:"input",type:"datetime-local",className:n},r))};function am(e){return am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(e)}function om(e){var t=function(e,t){if("object"!=am(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=am(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==am(t)?t:String(t)}function im(e,t,n){return(t=om(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sm(e,t){if(null==e)return{};var n,r,a=f(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}rm.Feedback=ka;var lm=NaN,cm="[object Symbol]",um=/^\s+|\s+$/g,dm=/^[-+]0x[0-9a-f]+$/i,hm=/^0b[01]+$/i,fm=/^0o[0-7]+$/i,pm=parseInt,mm="object"==typeof l&&l&&l.Object===Object&&l,vm="object"==typeof self&&self&&self.Object===Object&&self,gm=mm||vm||Function("return this")(),bm=Object.prototype.toString,ym=Math.max,Em=Math.min,xm=function(){return gm.Date.now()};function wm(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Nm(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&bm.call(e)==cm}(e))return lm;if(wm(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=wm(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(um,"");var n=hm.test(e);return n||fm.test(e)?pm(e.slice(2),n?2:8):dm.test(e)?lm:+e}var km=function(e,t,n){var r,a,o,i,s,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,o=a;return r=a=void 0,c=t,i=e.apply(o,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=o}function m(){var e=xm();if(p(e))return v(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?Em(n,o-(e-c)):n}(e))}function v(e){return s=void 0,h&&r?f(e):(r=a=void 0,i)}function g(){var e=xm(),n=p(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?f(e):i}(l);if(d)return s=setTimeout(m,t),f(l)}return void 0===s&&(s=setTimeout(m,t)),i}return t=Nm(t)||0,wm(n)&&(u=!!n.leading,o=(d="maxWait"in n)?ym(Nm(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?i:v(xm())},g},Om=c(km),jm="label";function Lm(e){return"string"==typeof e?e:jm}function Sm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Am=0;function Cm(e){return"function"==typeof e}function Mm(e){return"string"==typeof e}function Tm(){}function Rm(e,t){var n={};return t.forEach((function(t){n[t]=e[t]})),n}function _m(e,t){return Mm(e)||!Sm(e,"paginationOption")&&!Sm(e,"customOption")?(n=Cm(t)?t(e):Mm(e)?e:e[t],Mm(n)||("production"!==process.env.NODE_ENV?v(!1,"One or more options does not have a valid label string. Check the `labelKey` prop to ensure that it matches the correct option key and provides a string for filtering and display."):v(!1)),n):e[Lm(t)];var n}var Pm=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,a,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(a=r;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=r;0!=a--;){var i=o[a];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n},qm=c(Pm);function Im(e,t){if(!Mm(e))return e[t]}var Dm=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹÐ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"ŒŒ"},{base:"oe",letters:"œœ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}].reduce((function(e,t){var n=t.base;return t.letters.split("").forEach((function(t){e[t]=n})),e}),{}),Bm="̀-ͯ",$m="゙゚";function Fm(e){return e.normalize("NFD").replace(new RegExp("[".concat(Bm).concat($m,"]"),"g"),"").replace(/[^\u0000-\u007E]/g,(function(e){return Dm[e]||e}))}var Hm={};function Um(e,t){if(!e&&-1!==t.indexOf("deprecated")){if(Hm[t])return;Hm[t]=!0}for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a1?arguments[1]:void 0;return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","-item-").concat(e)}var Xm=["activeIndex","id","isFocused","isMenuShown","multiple","onClick","onFocus","placeholder"];function Jm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qm(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},h=Sm(u,"className")?String(u.className):void 0;return Qm(Qm(Qm(Qm({autoComplete:"off",placeholder:l,type:"text"},u),c),{},{"aria-activedescendant":t>=0?Ym(n,t):void 0,"aria-autocomplete":"both","aria-expanded":a,"aria-haspopup":"listbox","aria-multiselectable":o||void 0,"aria-owns":a?n:void 0,className:d((e={},im(e,h||"",!o),im(e,"focus",r),e))},o&&{inputClassName:h}),{},{onClick:i,onFocus:s,role:"combobox"})}};function tv(e){var t=e.activeItem,n=e.labelKey,r=e.multiple,a=e.selected,o=e.text;return t?_m(t,n):!r&&a.length&&a[0]?_m(a[0],n):o}function nv(e){var t=e.allowNew,n=e.highlightOnlyResult,r=e.results;return!(!n||t)&&(1===r.length&&!Im(r[0],"disabled"))}function rv(e,t){var n=t[e];return!!n&&!!Im(n,"disabled")}function av(e,t,n){for(var r=e;rv(r,n);)r+="ArrowUp"===t?-1:1;return r}function ov(e){e.preventDefault()}function iv(e){return"lg"===e}function sv(e){return"sm"===e}var lv=["className","isInvalid","isValid","size"];function cv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t-1||s.length&&!i)return"";var c=_m(n,o),u=Gm(c.toLowerCase(),l.toLowerCase());return u&&0===u.start?l+c.slice(u.end,c.length):""}(t);e.useEffect((function(){n||u.length||s()}));var f=e.useRef(!0);e.useEffect((function(){f.current?f.current=!1:c(o)}),[o,c]);var p=Mv(Mv({},Rm(t,Rv)),{},{getInputProps:ev(Mv(Mv({},Rm(t,Tv)),{},{onKeyDown:function(e){if(l(e),a){var n="Enter"===e.key&&nv(t),r=h&&function(e,t){var n=!1;return"ArrowRight"===e.key&&(n=!Wm(e.currentTarget)||e.currentTarget.selectionStart===e.currentTarget.value.length),"Tab"===e.key&&(e.preventDefault(),n=!0),t?t(n,e):n}(e,d);(n||r)&&i(a)}},value:tv(t)}))}),m=Mv(Mv({},Rm(t,_v)),{},{hintText:h,isOnlyResult:nv(t)});return e.createElement(Sv.Provider,{value:m},Cm(r)?r(p):r)};function qv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Iv(e){for(var t=1;t1&&(i=i.slice(0,1))),{activeIndex:-1,activeItem:void 0,initialItem:void 0,isFocused:!1,selected:i,showMenu:n,shownResults:a,text:s}}function Bv(e,t){return Iv(Iv({},Dv(t)),{},{isFocused:e.isFocused,selected:[],text:""})}function $v(e){return Iv(Iv({},e),{},{isFocused:!0,showMenu:!0})}function Fv(e,t){var n=Dv(t),r=n.activeIndex,a=n.activeItem,o=n.initialItem,i=n.shownResults;return Iv(Iv({},e),{},{activeIndex:r,activeItem:a,initialItem:o,showMenu:!1,shownResults:i})}function Hv(e,t){return e.showMenu?Fv(e,t):Iv(Iv({},e),{},{showMenu:!0})}var Uv=["onChange"];function Vv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zv(e){for(var t=1;t=0?e.activeItem:void 0}}))})),im(Nv(e),"_handleActiveItemChange",(function(t){qm(t,e.state.activeItem)||e.setState({activeItem:t})})),im(Nv(e),"_handleBlur",(function(t){t.persist(),e.setState({isFocused:!1},(function(){return e.props.onBlur(t)}))})),im(Nv(e),"_handleChange",(function(t){e.props.onChange&&e.props.onChange(t)})),im(Nv(e),"_handleClear",(function(){e.inputNode&&function(e,t){var n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value");n&&n.set&&n.set.call(e,t);var r=new Event("input",{bubbles:!0});e.dispatchEvent(r)}(e.inputNode,""),e.setState(Bv,(function(){e.props.multiple&&e._handleChange([])}))})),im(Nv(e),"_handleClick",(function(t){var n;t.persist();var r=null===(n=e.props.inputProps)||void 0===n?void 0:n.onClick;e.setState($v,(function(){return Cm(r)&&r(t)}))})),im(Nv(e),"_handleFocus",(function(t){t.persist(),e.setState($v,(function(){return e.props.onFocus(t)}))})),im(Nv(e),"_handleInitialItemChange",(function(t){qm(t,e.state.initialItem)||e.setState({initialItem:t})})),im(Nv(e),"_handleInputChange",(function(t){t.persist();var n=t.currentTarget.value,r=e.props,a=r.multiple,o=r.onInputChange,i=e.state.selected.length&&!a;e.setState((function(e,t){var r=Dv(t),a=r.activeIndex,o=r.activeItem,s=r.shownResults;return{activeIndex:a,activeItem:o,selected:i?[]:e.selected,showMenu:!0,shownResults:s,text:n}}),(function(){o(n,t),i&&e._handleChange([])}))})),im(Nv(e),"_handleKeyDown",(function(t){var n,r,a,o,i=e.state.activeItem;if(!e.isMenuShown)return"ArrowUp"!==t.key&&"ArrowDown"!==t.key||e.setState({showMenu:!0}),void e.props.onKeyDown(t);switch(t.key){case"ArrowUp":case"ArrowDown":t.preventDefault(),e._handleActiveIndexChange((n=e.state.activeIndex,r=t.key,a=e.items,o=n,(o=av(o+="ArrowUp"===r?-1:1,r,a))===a.length?o=-1:-2===o&&(o=av(o=a.length-1,r,a)),o));break;case"Enter":t.preventDefault(),i&&e._handleMenuItemSelect(i,t);break;case"Escape":case"Tab":e.hideMenu()}e.props.onKeyDown(t)})),im(Nv(e),"_handleMenuItemSelect",(function(t,n){Im(t,"paginationOption")?e._handlePaginate(n):e._handleSelectionAdd(t)})),im(Nv(e),"_handlePaginate",(function(t){t.persist(),e.setState((function(e,t){return{shownResults:e.shownResults+t.maxResults}}),(function(){return e.props.onPaginate(t,e.state.shownResults)}))})),im(Nv(e),"_handleSelectionAdd",(function(t){var n,r,a,o=e.props,i=o.multiple,s=o.labelKey,l=t;!Mm(l)&&l.customOption&&(l=zv(zv({},l),{},{id:(a="new-id-",Am+=1,(null==a?"":String(a))+Am)})),i?(n=e.state.selected.concat(l),r=""):(n=[l],r=_m(l,s)),e.setState((function(e,t){return zv(zv({},Fv(e,t)),{},{initialItem:l,selected:n,text:r})}),(function(){return e._handleChange(n)}))})),im(Nv(e),"_handleSelectionRemove",(function(t){var n=e.state.selected.filter((function(e){return!qm(e,t)}));e.focus(),e.setState((function(e,t){return zv(zv({},Fv(e,t)),{},{selected:n})}),(function(){return e._handleChange(n)}))})),e}return wv(r,[{key:"componentDidMount",value:function(){this.props.autoFocus&&this.focus()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.labelKey,a=n.multiple,o=n.selected;!function(e,t){var n,r,a,o=!e&&t;o?(n="uncontrolled",r="controlled",a="an"):(n="controlled",r="uncontrolled",a="a"),Um(!(o||e&&!t),"You are changing ".concat(a," ").concat(n," typeahead to be ").concat(r,". ")+"Input elements should not switch from ".concat(n," to ").concat(r," (or vice versa). ")+"Decide between using a controlled or uncontrolled element for the lifetime of the component.")}(o,e.selected),o&&!qm(o,t.selected)&&(this.setState({selected:o}),a||this.setState({text:o.length?_m(o[0],r):""}))}},{key:"render",value:function(){var t=this.props;t.onChange;var n=zv(zv({},sm(t,Uv)),this.state),r=n.filterBy,a=n.labelKey,o=n.options,i=n.paginate,s=n.shownResults,l=n.text;this.isMenuShown=function(e){var t=e.open,n=e.minLength,r=e.showMenu,a=e.text;return t||!1===t?t:!(a.lengths;if(c=function(e,t){return!t||t>=e.length?e:e.slice(0,t)}(c,s),function(e,t){var n=t.allowNew,r=t.labelKey,a=t.text;return!(!n||!a.trim())&&(Cm(n)?n(e,t):!e.some((function(e){return _m(e,r)===a})))}(c,n)&&c.push(im({customOption:!0},Lm(a),l)),f)c.push((im(d={},Lm(a),""),im(d,"paginationOption",!0),d))}return e.createElement(Pv,h({},n,{hideMenu:this.hideMenu,inputNode:this.inputNode,inputRef:this.inputRef,isMenuShown:this.isMenuShown,onActiveItemChange:this._handleActiveItemChange,onAdd:this._handleSelectionAdd,onBlur:this._handleBlur,onChange:this._handleInputChange,onClear:this._handleClear,onClick:this._handleClick,onFocus:this._handleFocus,onHide:this.hideMenu,onInitialItemChange:this._handleInitialItemChange,onKeyDown:this._handleKeyDown,onMenuItemClick:this._handleMenuItemSelect,onRemove:this._handleSelectionRemove,results:c,setItem:this.setItem,toggleMenu:this.toggleMenu}))}}]),r}();im(Gv,"propTypes",Kv),im(Gv,"defaultProps",Zv);var Yv=["className","label","onClick","onKeyDown","size"],Xv={label:ae.string,onClick:ae.func,onKeyDown:ae.func,size:fv},Jv=function(t){var n=t.className,r=t.label,a=void 0===r?"Clear":r,o=t.onClick,i=t.onKeyDown,s=t.size,l=sm(t,Yv);return e.createElement("button",h({},l,{"aria-label":a,className:d("close","btn-close","rbt-close",{"rbt-close-lg":iv(s),"rbt-close-sm":sv(s)},n),onClick:function(e){e.stopPropagation(),o&&o(e)},onKeyDown:function(e){"Backspace"===e.key&&e.preventDefault(),i&&i(e)},type:"button"}),e.createElement("span",{"aria-hidden":"true",className:"rbt-close-content"},"×"),e.createElement("span",{className:"sr-only visually-hidden"},a))};Jv.propTypes=Xv;var Qv={label:ae.string},eg=function(t){var n=t.label,r=void 0===n?"Loading...":n;return e.createElement("div",{className:"rbt-loader spinner-border spinner-border-sm",role:"status"},e.createElement("span",{className:"sr-only visually-hidden"},r))};function tg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"";return n&&(n=n.replace(n[0],n[0].toUpperCase())),["Top","Right","Bottom","Left"].map((function(r){return e["".concat(t).concat(r).concat(n)]})).join(" ")}var Hg=function(){var t=Av(),n=t.hintText,r=t.inputNode,a=e.useRef(null);return e.useEffect((function(){r&&a.current&&function(e,t){var n=window.getComputedStyle(e);t.style.borderStyle=Fg(n,"border","style"),t.style.borderWidth=Fg(n,"border","width"),t.style.fontSize=n.fontSize,t.style.fontWeight=n.fontWeight,t.style.height=n.height,t.style.lineHeight=n.lineHeight,t.style.margin=Fg(n,"margin"),t.style.padding=Fg(n,"padding")}(r,a.current)})),{hintRef:a,hintText:n}},Ug=function(t){var n=t.children,r=t.className,a=Hg(),o=a.hintRef,i=a.hintText;return e.createElement("div",{className:r,style:{display:"flex",flex:1,height:"100%",position:"relative"}},n,e.createElement("input",{"aria-hidden":!0,className:"rbt-input-hint",ref:o,readOnly:!0,style:{backgroundColor:"transparent",borderColor:"transparent",boxShadow:"none",color:"rgba(0, 0, 0, 0.54)",left:0,pointerEvents:"none",position:"absolute",top:0,width:"100%"},tabIndex:-1,value:i}))},Vg=e.forwardRef((function(t,n){return e.createElement("input",h({},t,{className:d("rbt-input-main",t.className),ref:n}))})),zg=["children","className","inputClassName","inputRef","referenceElementRef","selected"];function Wg(t){var n=e.useRef(null),r=e.useRef(null),a=dv(t),o=a.children,i=a.className,s=a.inputClassName;a.inputRef;var l=a.referenceElementRef,c=a.selected,u=sm(a,zg);function f(e){if(t.disabled)e.currentTarget.blur();else{var n=r.current;!n||e.currentTarget.contains(e.target)&&e.currentTarget!==e.target||(Wm(n)&&(n.selectionStart=n.value.length),n.focus())}}return e.createElement("div",{className:d("rbt-input-multi",{disabled:t.disabled},i),onClick:f,onFocus:f,ref:l,tabIndex:-1},e.createElement("div",{className:"rbt-input-wrapper",ref:n},o,e.createElement(Ug,null,e.createElement(Vg,h({},u,{className:s,onKeyDown:function(e){if("Backspace"===e.key&&c.length&&!t.value){var r;e.preventDefault();var a=null===(r=n.current)||void 0===r?void 0:r.children;if(null!=a&&a.length){var o=a[a.length-2];null==o||o.focus()}}t.onKeyDown&&t.onKeyDown(e)},ref:function(e){r.current=e,t.inputRef(e)},style:{backgroundColor:"transparent",border:0,boxShadow:"none",cursor:"inherit",outline:"none",padding:0,width:"100%",zIndex:1}})))))}var Kg=["inputRef","referenceElementRef"],Zg=function(t){var n=t.inputRef,r=t.referenceElementRef,a=sm(t,Kg);return e.createElement(Ug,null,e.createElement(Vg,h({},dv(a),{ref:function(e){n(e),r(e)}})))},Gg={children:ae.string.isRequired,highlightClassName:ae.string,search:ae.string.isRequired},Yg=function(t){var n=t.children,r=t.highlightClassName,a=void 0===r?"rbt-highlight-text":r,o=t.search;if(!o||!n)return e.createElement(e.Fragment,null,n);for(var i=0,s=n,l=[];s;){var c=Gm(s,o);if(!c){l.push(s);break}var u=s.slice(0,c.start);u&&l.push(u);var d=s.slice(c.start,c.end);l.push(e.createElement("mark",{className:a,key:i},d)),i+=1,s=s.slice(c.end)}return e.createElement(e.Fragment,null,l)};Yg.propTypes=Gg;const Xg=e=>"object"==typeof e&&null!=e&&1===e.nodeType,Jg=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,Qg=(e,t)=>{if(e.clientHeight{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightot||o>e&&i=t&&s>=n?o-e-r:i>t&&sn?i-t+a:0,tb=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},nb=(e,t)=>{var n,r,a,o;if("undefined"==typeof document)return[];const{scrollMode:i,block:s,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,d="function"==typeof c?c:e=>e!==c;if(!Xg(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let p=e;for(;Xg(p)&&d(p);){if(p=tb(p),p===h){f.push(p);break}null!=p&&p===document.body&&Qg(p)&&!Qg(document.documentElement)||null!=p&&Qg(p,u)&&f.push(p)}const m=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(o=null==(a=window.visualViewport)?void 0:a.height)?o:innerHeight,{scrollX:g,scrollY:b}=window,{height:y,width:E,top:x,right:w,bottom:N,left:k}=e.getBoundingClientRect(),{top:O,right:j,bottom:L,left:S}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let A="start"===s||"nearest"===s?x-O:"end"===s?N+L:x+y/2-O+L,C="center"===l?k+E/2-S+j:"end"===l?w+j:k-S;const M=[];for(let e=0;e=0&&k>=0&&N<=v&&w<=m&&x>=a&&N<=c&&k>=u&&w<=o)return M;const d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),O=parseInt(d.borderTopWidth,10),j=parseInt(d.borderRightWidth,10),L=parseInt(d.borderBottomWidth,10);let S=0,T=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-j:0,_="offsetHeight"in t?t.offsetHeight-t.clientHeight-O-L:0,P="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,q="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(h===t)S="start"===s?A:"end"===s?A-v:"nearest"===s?eb(b,b+v,v,O,L,b+A,b+A+y,y):A-v/2,T="start"===l?C:"center"===l?C-m/2:"end"===l?C-m:eb(g,g+m,m,p,j,g+C,g+C+E,E),S=Math.max(0,S+b),T=Math.max(0,T+g);else{S="start"===s?A-a-O:"end"===s?A-c+L+_:"nearest"===s?eb(a,c,n,O,L+_,A,A+y,y):A-(a+n/2)+_/2,T="start"===l?C-u-p:"center"===l?C-(u+r/2)+R/2:"end"===l?C-o+j+R:eb(u,o,r,p,j+R,C,C+E,E);const{scrollLeft:e,scrollTop:i}=t;S=0===q?0:Math.max(0,Math.min(i+S/q,t.scrollHeight-n/q+_)),T=0===P?0:Math.max(0,Math.min(e+T/P,t.scrollWidth-r/P+R)),A+=i-S,C+=e-T}M.push({el:t,top:S,left:T})}return M},rb=e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"};var ab=["label","onClick","option","position"];function ob(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ib(e){for(var t=1;t{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(nb(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:a,top:o,left:i}of nb(e,rb(t))){const e=o-n.top+n.bottom,t=i-n.left+n.right;a.scroll({top:e,left:t,behavior:r})}}(e,{boundary:e.parentNode,scrollMode:"if-needed"})}}),[l,d,a,o]);var v=e.useCallback((function(e){f(a,e),r&&r(e)}),[r,f,a]),g=u||l===o;return p(a,o),ib(ib({},i),{},{active:g,"aria-label":n,"aria-selected":g,id:Ym(c,o),onClick:v,onMouseDown:ov,ref:m,role:"option"})}vv.isRequired,ae.number;var lb=["active","children","className","disabled","onClick"],cb=e.forwardRef((function(t,n){var r=t.active,a=t.children,o=t.className,i=t.disabled,s=t.onClick,l=sm(t,lb);return e.createElement("a",h({},l,{className:d("dropdown-item",{active:r,disabled:i},o),href:l.href||"#",onClick:function(e){e.preventDefault(),!i&&s&&s(e)},ref:n}),a)}));function ub(t){return e.createElement(cb,sb(t))}var db=["emptyLabel","innerRef","maxHeight","style"];function hb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fb(e){for(var t=1;t { if (containerRef.current) { + console.log(importCallback); if (importCallback) { + console.log('import callback called'); // Callback to import new modules into quill, needs to be done within the same instance as the quill object. importCallback(); }