@rainte/ant 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.cjs
CHANGED
|
@@ -1,79 +1,71 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Q,pe){typeof exports=="object"&&typeof module<"u"?pe(exports,require("react"),require("@ant-design/pro-components"),require("antd"),require("react-router-dom"),require("@rainte/js")):typeof define=="function"&&define.amd?define(["exports","react","@ant-design/pro-components","antd","react-router-dom","@rainte/js"],pe):(Q=typeof globalThis<"u"?globalThis:Q||self,pe(Q["@rainte/react"]={},Q.React,Q.ProComponents,Q.antd,Q.ReactRouterDOM,Q.RainteJS))})(this,function(Q,pe,vt,_e,ms,mo){"use strict";var r1=Object.defineProperty;var s1=(Q,pe,vt)=>pe in Q?r1(Q,pe,{enumerable:!0,configurable:!0,writable:!0,value:vt}):Q[pe]=vt;var $=(Q,pe,vt)=>s1(Q,typeof pe!="symbol"?pe+"":pe,vt);function wu(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in r)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var gr={exports:{}},On={};/**
|
|
2
2
|
* @license React
|
|
3
|
-
* react-jsx-runtime.production.
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var bo;function Eu(){if(bo)return
|
|
9
|
+
*/var bo;function Eu(){if(bo)return On;bo=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,i){var o=null;if(i!==void 0&&(o=""+i),s.key!==void 0&&(o=""+s.key),"key"in s){i={};for(var a in s)a!=="key"&&(i[a]=s[a])}else i=s;return s=i.ref,{$$typeof:r,type:n,key:o,ref:s!==void 0?s:null,props:i}}return On.Fragment=e,On.jsx=t,On.jsxs=t,On}var Sn={},yo;function xu(){if(yo)return Sn;yo=1;var r={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
13
|
-
* Copyright (c)
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/return
|
|
18
|
-
`+Q+y}}var le=!1,ue;{var de=typeof WeakMap=="function"?WeakMap:Map;ue=new de}function ge(y,q){if(!y||le)return"";{var D=ue.get(y);if(D!==void 0)return D}var Z;le=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var pe;pe=ye.current,ye.current=null,G();try{if(q){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(qe){Z=qe}Reflect.construct(y,[],ne)}else{try{ne.call()}catch(qe){Z=qe}y.call(ne.prototype)}}else{try{throw Error()}catch(qe){Z=qe}y()}}catch(qe){if(qe&&Z&&typeof qe.stack=="string"){for(var re=qe.stack.split(`
|
|
19
|
-
`),Ce=Z.stack.split(`
|
|
20
|
-
`),Ae=re.length-1,ce=Ce.length-1;Ae>=1&&ce>=0&&re[Ae]!==Ce[ce];)ce--;for(;Ae>=1&&ce>=0;Ae--,ce--)if(re[Ae]!==Ce[ce]){if(Ae!==1||ce!==1)do if(Ae--,ce--,ce<0||re[Ae]!==Ce[ce]){var $e=`
|
|
21
|
-
`+re[Ae].replace(" at new "," at ");return y.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",y.displayName)),typeof y=="function"&&ue.set(y,$e),$e}while(Ae>=1&&ce>=0);break}}}finally{le=!1,ye.current=pe,ve(),Error.prepareStackTrace=X}var Nt=y?y.displayName||y.name:"",dt=Nt?ae(Nt):"";return typeof y=="function"&&ue.set(y,dt),dt}function Se(y,q,D){return ge(y,!1)}function Re(y){var q=y.prototype;return!!(q&&q.isReactComponent)}function At(y,q,D){if(y==null)return"";if(typeof y=="function")return ge(y,Re(y));if(typeof y=="string")return ae(y);switch(y){case d:return ae("Suspense");case g:return ae("SuspenseList")}if(typeof y=="object")switch(y.$$typeof){case c:return Se(y.render);case f:return At(y.type,q,D);case p:{var Z=y,X=Z._payload,pe=Z._init;try{return At(pe(X),q,D)}catch{}}}return""}var Tt=Object.prototype.hasOwnProperty,Gr={},Wr=k.ReactDebugCurrentFrame;function ut(y){if(y){var q=y._owner,D=At(y.type,y._source,q?q.type:null);Wr.setExtraStackFrame(D)}else Wr.setExtraStackFrame(null)}function mr(y,q,D,Z,X){{var pe=Function.call.bind(Tt);for(var ne in y)if(pe(y,ne)){var re=void 0;try{if(typeof y[ne]!="function"){var Ce=Error((Z||"React class")+": "+D+" type `"+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[ne]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ce.name="Invariant Violation",Ce}re=y[ne](q,ne,Z,D,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ae){re=Ae}re&&!(re instanceof Error)&&(ut(X),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Z||"React class",D,ne,typeof re),ut(null)),re instanceof Error&&!(re.message in Gr)&&(Gr[re.message]=!0,ut(X),j("Failed %s type: %s",D,re.message),ut(null))}}}var Zr=Array.isArray;function Jt(y){return Zr(y)}function Je(y){{var q=typeof Symbol=="function"&&Symbol.toStringTag,D=q&&y[Symbol.toStringTag]||y.constructor.name||"Object";return D}}function Qt(y){try{return Xr(y),!1}catch{return!0}}function Xr(y){return""+y}function Ot(y){if(Qt(y))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(y)),Xr(y)}var Dt=k.ReactCurrentOwner,br={key:!0,ref:!0,__self:!0,__source:!0},Ue,yr;function Yr(y){if(Tt.call(y,"ref")){var q=Object.getOwnPropertyDescriptor(y,"ref").get;if(q&&q.isReactWarning)return!1}return y.ref!==void 0}function jn(y){if(Tt.call(y,"key")){var q=Object.getOwnPropertyDescriptor(y,"key").get;if(q&&q.isReactWarning)return!1}return y.key!==void 0}function vr(y,q){typeof y.ref=="string"&&Dt.current}function er(y,q){{var D=function(){Ue||(Ue=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};D.isReactWarning=!0,Object.defineProperty(y,"key",{get:D,configurable:!0})}}function Jr(y,q){{var D=function(){yr||(yr=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};D.isReactWarning=!0,Object.defineProperty(y,"ref",{get:D,configurable:!0})}}var tr=function(y,q,D,Z,X,pe,ne){var re={$$typeof:t,type:y,key:q,ref:D,props:ne,_owner:pe};return re._store={},Object.defineProperty(re._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(re,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Z}),Object.defineProperty(re,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(re.props),Object.freeze(re)),re};function $t(y,q,D,Z,X){{var pe,ne={},re=null,Ce=null;D!==void 0&&(Ot(D),re=""+D),jn(q)&&(Ot(q.key),re=""+q.key),Yr(q)&&(Ce=q.ref,vr(q,X));for(pe in q)Tt.call(q,pe)&&!br.hasOwnProperty(pe)&&(ne[pe]=q[pe]);if(y&&y.defaultProps){var Ae=y.defaultProps;for(pe in Ae)ne[pe]===void 0&&(ne[pe]=Ae[pe])}if(re||Ce){var ce=typeof y=="function"?y.displayName||y.name||"Unknown":y;re&&er(ne,ce),Ce&&Jr(ne,ce)}return tr(y,re,Ce,X,Z,Dt.current,ne)}}var Fe=k.ReactCurrentOwner,Bt=k.ReactDebugCurrentFrame;function Qe(y){if(y){var q=y._owner,D=At(y.type,y._source,q?q.type:null);Bt.setExtraStackFrame(D)}else Bt.setExtraStackFrame(null)}var ct;ct=!1;function Mt(y){return typeof y=="object"&&y!==null&&y.$$typeof===t}function St(){{if(Fe.current){var y=R(Fe.current.type);if(y)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+y+"`."}return""}}function wr(y){return""}var rr={};function Er(y){{var q=St();if(!q){var D=typeof y=="string"?y:y.displayName||y.name;D&&(q=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+D+">.")}return q}}function ft(y,q){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var D=Er(q);if(rr[D])return;rr[D]=!0;var Z="";y&&y._owner&&y._owner!==Fe.current&&(Z=" It was passed a child from "+R(y._owner.type)+"."),Qe(y),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',D,Z),Qe(null)}}function xr(y,q){{if(typeof y!="object")return;if(Jt(y))for(var D=0;D<y.length;D++){var Z=y[D];Mt(Z)&&ft(Z,q)}else if(Mt(y))y._store&&(y._store.validated=!0);else if(y){var X=C(y);if(typeof X=="function"&&X!==y.entries)for(var pe=X.call(y),ne;!(ne=pe.next()).done;)Mt(ne.value)&&ft(ne.value,q)}}}function ht(y){{var q=y.type;if(q==null||typeof q=="string")return;var D;if(typeof q=="function")D=q.propTypes;else if(typeof q=="object"&&(q.$$typeof===c||q.$$typeof===f))D=q.propTypes;else return;if(D){var Z=R(q);mr(D,y.props,"prop",Z,y)}else if(q.PropTypes!==void 0&&!ct){ct=!0;var X=R(q);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof q.getDefaultProps=="function"&&!q.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Dn(y){{for(var q=Object.keys(y.props),D=0;D<q.length;D++){var Z=q[D];if(Z!=="children"&&Z!=="key"){Qe(y),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Z),Qe(null);break}}y.ref!==null&&(Qe(y),j("Invalid attribute `ref` supplied to `React.Fragment`."),Qe(null))}}var Qr={};function en(y,q,D,Z,X,pe){{var ne=b(y);if(!ne){var re="";(y===void 0||typeof y=="object"&&y!==null&&Object.keys(y).length===0)&&(re+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ce=wr();Ce?re+=Ce:re+=St();var Ae;y===null?Ae="null":Jt(y)?Ae="array":y!==void 0&&y.$$typeof===t?(Ae="<"+(R(y.type)||"Unknown")+" />",re=" Did you accidentally export a JSX literal instead of a component?"):Ae=typeof y,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ae,re)}var ce=$t(y,q,D,X,pe);if(ce==null)return ce;if(ne){var $e=q.children;if($e!==void 0)if(Z)if(Jt($e)){for(var Nt=0;Nt<$e.length;Nt++)xr($e[Nt],y);Object.freeze&&Object.freeze($e)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xr($e,y)}if(Tt.call(q,"key")){var dt=R(y),qe=Object.keys(q).filter(function(rn){return rn!=="key"}),Tr=qe.length>0?"{key: someKey, "+qe.join(": ..., ")+": ...}":"{key: someKey}";if(!Qr[dt+Tr]){var nr=qe.length>0?"{"+qe.join(": ..., ")+": ...}":"{}";j(`A props object containing a "key" prop is being spread into JSX:
|
|
17
|
+
*/return r.NODE_ENV!=="production"&&function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===b?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case A:return"Fragment";case I:return"Profiler";case C:return"StrictMode";case ee:return"Suspense";case Y:return"SuspenseList";case de:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case E:return"Portal";case V:return(T.displayName||"Context")+".Provider";case B:return(T._context.displayName||"Context")+".Consumer";case H:var P=T.render;return T=T.displayName,T||(T=P.displayName||P.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case ne:return P=T.displayName||null,P!==null?P:e(T.type)||"Memo";case ae:P=T._payload,T=T._init;try{return e(T(P))}catch{}}return null}function t(T){return""+T}function n(T){try{t(T);var P=!1}catch{P=!0}if(P){P=console;var j=P.error,z=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return j.call(P,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",z),t(T)}}function s(T){if(T===A)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===ae)return"<...>";try{var P=e(T);return P?"<"+P+">":"<...>"}catch{return"<...>"}}function i(){var T=N.A;return T===null?null:T.getOwner()}function o(){return Error("react-stack-top-frame")}function a(T){if(x.call(T,"key")){var P=Object.getOwnPropertyDescriptor(T,"key").get;if(P&&P.isReactWarning)return!1}return T.key!==void 0}function u(T,P){function j(){w||(w=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",P))}j.isReactWarning=!0,Object.defineProperty(T,"key",{get:j,configurable:!0})}function c(){var T=e(this.type);return O[T]||(O[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function d(T,P,j,z,D,te,ue,Z){return j=te.ref,T={$$typeof:y,type:T,key:P,props:te,_owner:D},(j!==void 0?j:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:c}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function g(T,P,j,z,D,te,ue,Z){var G=P.children;if(G!==void 0)if(z)if(q(G)){for(z=0;z<G.length;z++)h(G[z]);Object.freeze&&Object.freeze(G)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(G);if(x.call(P,"key")){G=e(T);var J=Object.keys(P).filter(function(oe){return oe!=="key"});z=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",_[G+z]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
26
18
|
let props = %s;
|
|
27
19
|
<%s {...props} />
|
|
28
20
|
React keys must be passed directly to JSX without using spread:
|
|
29
21
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Tr,dt,nr,dt),Qr[dt+Tr]=!0}}return y===s?Dn(ce):ht(ce),ce}}function tn(y,q,D){return en(y,q,D,!0)}function Ar(y,q,D){return en(y,q,D,!1)}var Le=Ar,$n=tn;cn.Fragment=s,cn.jsx=Le,cn.jsxs=$n}(),cn}var vo;function Au(){if(vo)return Vn.exports;vo=1;var n={};return n.NODE_ENV==="production"?Vn.exports=Eu():Vn.exports=xu(),Vn.exports}var Oe=Au(),wo=typeof global=="object"&&global&&global.Object===Object&&global,Tu=typeof self=="object"&&self&&self.Object===Object&&self,mt=wo||Tu||Function("return this")(),Vt=mt.Symbol,Eo=Object.prototype,Ou=Eo.hasOwnProperty,Su=Eo.toString,fn=Vt?Vt.toStringTag:void 0;function Nu(n){var e=Ou.call(n,fn),t=n[fn];try{n[fn]=void 0;var r=!0}catch{}var s=Su.call(n);return r&&(e?n[fn]=t:delete n[fn]),s}var Lu=Object.prototype,Cu=Lu.toString;function _u(n){return Cu.call(n)}var Ru="[object Null]",qu="[object Undefined]",xo=Vt?Vt.toStringTag:void 0;function Lr(n){return n==null?n===void 0?qu:Ru:xo&&xo in Object(n)?Nu(n):_u(n)}function Rt(n){return n!=null&&typeof n=="object"}var or=Array.isArray;function Kt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function Ao(n){return n}var Iu="[object AsyncFunction]",ku="[object Function]",Pu="[object GeneratorFunction]",ju="[object Proxy]";function Ms(n){if(!Kt(n))return!1;var e=Lr(n);return e==ku||e==Pu||e==Iu||e==ju}var Us=mt["__core-js_shared__"],To=function(){var n=/[^.]+$/.exec(Us&&Us.keys&&Us.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Du(n){return!!To&&To in n}var $u=Function.prototype,Bu=$u.toString;function ar(n){if(n!=null){try{return Bu.call(n)}catch{}try{return n+""}catch{}}return""}var Mu=/[\\^$.*+?()[\]{}|]/g,Uu=/^\[object .+?Constructor\]$/,Fu=Function.prototype,Hu=Object.prototype,zu=Fu.toString,Vu=Hu.hasOwnProperty,Ku=RegExp("^"+zu.call(Vu).replace(Mu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gu(n){if(!Kt(n)||Du(n))return!1;var e=Ms(n)?Ku:Uu;return e.test(ar(n))}function Wu(n,e){return n==null?void 0:n[e]}function lr(n,e){var t=Wu(n,e);return Gu(t)?t:void 0}var Fs=lr(mt,"WeakMap"),Oo=Object.create,Zu=function(){function n(){}return function(e){if(!Kt(e))return{};if(Oo)return Oo(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Xu(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Yu(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var Ju=800,Qu=16,ec=Date.now;function tc(n){var e=0,t=0;return function(){var r=ec(),s=Qu-(r-t);if(t=r,s>0){if(++e>=Ju)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function rc(n){return function(){return n}}var Kn=function(){try{var n=lr(Object,"defineProperty");return n({},"",{}),n}catch{}}(),nc=Kn?function(n,e){return Kn(n,"toString",{configurable:!0,enumerable:!1,value:rc(e),writable:!0})}:Ao,sc=tc(nc);function ic(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var oc=9007199254740991,ac=/^(?:0|[1-9]\d*)$/;function So(n,e){var t=typeof n;return e=e??oc,!!e&&(t=="number"||t!="symbol"&&ac.test(n))&&n>-1&&n%1==0&&n<e}function Hs(n,e,t){e=="__proto__"&&Kn?Kn(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function hn(n,e){return n===e||n!==n&&e!==e}var lc=Object.prototype,uc=lc.hasOwnProperty;function No(n,e,t){var r=n[e];(!(uc.call(n,e)&&hn(r,t))||t===void 0&&!(e in n))&&Hs(n,e,t)}function cc(n,e,t,r){var s=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],u=void 0;u===void 0&&(u=n[a]),s?Hs(t,a,u):No(t,a,u)}return t}var Lo=Math.max;function fc(n,e,t){return e=Lo(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=Lo(r.length-e,0),o=Array(i);++s<i;)o[s]=r[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=r[s];return a[e]=t(o),Xu(n,this,a)}}function hc(n,e){return sc(fc(n,e,Ao),n+"")}var dc=9007199254740991;function Co(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=dc}function Gn(n){return n!=null&&Co(n.length)&&!Ms(n)}function gc(n,e,t){if(!Kt(t))return!1;var r=typeof e;return(r=="number"?Gn(t)&&So(e,t.length):r=="string"&&e in t)?hn(t[e],n):!1}function pc(n){return hc(function(e,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,o=s>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,o&&gc(t[0],t[1],o)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var a=t[r];a&&n(e,a,r,i)}return e})}var mc=Object.prototype;function zs(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||mc;return n===t}function bc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var yc="[object Arguments]";function _o(n){return Rt(n)&&Lr(n)==yc}var Ro=Object.prototype,vc=Ro.hasOwnProperty,wc=Ro.propertyIsEnumerable,Vs=_o(function(){return arguments}())?_o:function(n){return Rt(n)&&vc.call(n,"callee")&&!wc.call(n,"callee")};function Ec(){return!1}var qo=typeof se=="object"&&se&&!se.nodeType&&se,Io=qo&&typeof module=="object"&&module&&!module.nodeType&&module,xc=Io&&Io.exports===qo,ko=xc?mt.Buffer:void 0,Ac=ko?ko.isBuffer:void 0,dn=Ac||Ec,Tc="[object Arguments]",Oc="[object Array]",Sc="[object Boolean]",Nc="[object Date]",Lc="[object Error]",Cc="[object Function]",_c="[object Map]",Rc="[object Number]",qc="[object Object]",Ic="[object RegExp]",kc="[object Set]",Pc="[object String]",jc="[object WeakMap]",Dc="[object ArrayBuffer]",$c="[object DataView]",Bc="[object Float32Array]",Mc="[object Float64Array]",Uc="[object Int8Array]",Fc="[object Int16Array]",Hc="[object Int32Array]",zc="[object Uint8Array]",Vc="[object Uint8ClampedArray]",Kc="[object Uint16Array]",Gc="[object Uint32Array]",Ee={};Ee[Bc]=Ee[Mc]=Ee[Uc]=Ee[Fc]=Ee[Hc]=Ee[zc]=Ee[Vc]=Ee[Kc]=Ee[Gc]=!0,Ee[Tc]=Ee[Oc]=Ee[Dc]=Ee[Sc]=Ee[$c]=Ee[Nc]=Ee[Lc]=Ee[Cc]=Ee[_c]=Ee[Rc]=Ee[qc]=Ee[Ic]=Ee[kc]=Ee[Pc]=Ee[jc]=!1;function Wc(n){return Rt(n)&&Co(n.length)&&!!Ee[Lr(n)]}function Ks(n){return function(e){return n(e)}}var Po=typeof se=="object"&&se&&!se.nodeType&&se,gn=Po&&typeof module=="object"&&module&&!module.nodeType&&module,Zc=gn&&gn.exports===Po,Gs=Zc&&wo.process,Cr=function(){try{var n=gn&&gn.require&&gn.require("util").types;return n||Gs&&Gs.binding&&Gs.binding("util")}catch{}}(),jo=Cr&&Cr.isTypedArray,Ws=jo?Ks(jo):Wc,Xc=Object.prototype,Yc=Xc.hasOwnProperty;function Do(n,e){var t=or(n),r=!t&&Vs(n),s=!t&&!r&&dn(n),i=!t&&!r&&!s&&Ws(n),o=t||r||s||i,a=o?bc(n.length,String):[],u=a.length;for(var c in n)(e||Yc.call(n,c))&&!(o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||So(c,u)))&&a.push(c);return a}function $o(n,e){return function(t){return n(e(t))}}var Jc=$o(Object.keys,Object),Qc=Object.prototype,ef=Qc.hasOwnProperty;function tf(n){if(!zs(n))return Jc(n);var e=[];for(var t in Object(n))ef.call(n,t)&&t!="constructor"&&e.push(t);return e}function rf(n){return Gn(n)?Do(n):tf(n)}function nf(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var sf=Object.prototype,of=sf.hasOwnProperty;function af(n){if(!Kt(n))return nf(n);var e=zs(n),t=[];for(var r in n)r=="constructor"&&(e||!of.call(n,r))||t.push(r);return t}function Bo(n){return Gn(n)?Do(n,!0):af(n)}var pn=lr(Object,"create");function lf(){this.__data__=pn?pn(null):{},this.size=0}function uf(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var cf="__lodash_hash_undefined__",ff=Object.prototype,hf=ff.hasOwnProperty;function df(n){var e=this.__data__;if(pn){var t=e[n];return t===cf?void 0:t}return hf.call(e,n)?e[n]:void 0}var gf=Object.prototype,pf=gf.hasOwnProperty;function mf(n){var e=this.__data__;return pn?e[n]!==void 0:pf.call(e,n)}var bf="__lodash_hash_undefined__";function yf(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=pn&&e===void 0?bf:e,this}function ur(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}ur.prototype.clear=lf,ur.prototype.delete=uf,ur.prototype.get=df,ur.prototype.has=mf,ur.prototype.set=yf;function vf(){this.__data__=[],this.size=0}function Wn(n,e){for(var t=n.length;t--;)if(hn(n[t][0],e))return t;return-1}var wf=Array.prototype,Ef=wf.splice;function xf(n){var e=this.__data__,t=Wn(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Ef.call(e,t,1),--this.size,!0}function Af(n){var e=this.__data__,t=Wn(e,n);return t<0?void 0:e[t][1]}function Tf(n){return Wn(this.__data__,n)>-1}function Of(n,e){var t=this.__data__,r=Wn(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function qt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}qt.prototype.clear=vf,qt.prototype.delete=xf,qt.prototype.get=Af,qt.prototype.has=Tf,qt.prototype.set=Of;var mn=lr(mt,"Map");function Sf(){this.size=0,this.__data__={hash:new ur,map:new(mn||qt),string:new ur}}function Nf(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Zn(n,e){var t=n.__data__;return Nf(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Lf(n){var e=Zn(this,n).delete(n);return this.size-=e?1:0,e}function Cf(n){return Zn(this,n).get(n)}function _f(n){return Zn(this,n).has(n)}function Rf(n,e){var t=Zn(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function cr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}cr.prototype.clear=Sf,cr.prototype.delete=Lf,cr.prototype.get=Cf,cr.prototype.has=_f,cr.prototype.set=Rf;function qf(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var Mo=$o(Object.getPrototypeOf,Object),If="[object Object]",kf=Function.prototype,Pf=Object.prototype,Uo=kf.toString,jf=Pf.hasOwnProperty,Df=Uo.call(Object);function $f(n){if(!Rt(n)||Lr(n)!=If)return!1;var e=Mo(n);if(e===null)return!0;var t=jf.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Uo.call(t)==Df}function Bf(){this.__data__=new qt,this.size=0}function Mf(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Uf(n){return this.__data__.get(n)}function Ff(n){return this.__data__.has(n)}var Hf=200;function zf(n,e){var t=this.__data__;if(t instanceof qt){var r=t.__data__;if(!mn||r.length<Hf-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new cr(r)}return t.set(n,e),this.size=t.size,this}function bt(n){var e=this.__data__=new qt(n);this.size=e.size}bt.prototype.clear=Bf,bt.prototype.delete=Mf,bt.prototype.get=Uf,bt.prototype.has=Ff,bt.prototype.set=zf;var Fo=typeof se=="object"&&se&&!se.nodeType&&se,Ho=Fo&&typeof module=="object"&&module&&!module.nodeType&&module,Vf=Ho&&Ho.exports===Fo,zo=Vf?mt.Buffer:void 0,Vo=zo?zo.allocUnsafe:void 0;function Ko(n,e){if(e)return n.slice();var t=n.length,r=Vo?Vo(t):new n.constructor(t);return n.copy(r),r}function Kf(n,e){for(var t=-1,r=n==null?0:n.length,s=0,i=[];++t<r;){var o=n[t];e(o,t,n)&&(i[s++]=o)}return i}function Gf(){return[]}var Wf=Object.prototype,Zf=Wf.propertyIsEnumerable,Go=Object.getOwnPropertySymbols,Xf=Go?function(n){return n==null?[]:(n=Object(n),Kf(Go(n),function(e){return Zf.call(n,e)}))}:Gf;function Yf(n,e,t){var r=e(n);return or(n)?r:qf(r,t(n))}function Zs(n){return Yf(n,rf,Xf)}var Xs=lr(mt,"DataView"),Ys=lr(mt,"Promise"),Js=lr(mt,"Set"),Wo="[object Map]",Jf="[object Object]",Zo="[object Promise]",Xo="[object Set]",Yo="[object WeakMap]",Jo="[object DataView]",Qf=ar(Xs),eh=ar(mn),th=ar(Ys),rh=ar(Js),nh=ar(Fs),et=Lr;(Xs&&et(new Xs(new ArrayBuffer(1)))!=Jo||mn&&et(new mn)!=Wo||Ys&&et(Ys.resolve())!=Zo||Js&&et(new Js)!=Xo||Fs&&et(new Fs)!=Yo)&&(et=function(n){var e=Lr(n),t=e==Jf?n.constructor:void 0,r=t?ar(t):"";if(r)switch(r){case Qf:return Jo;case eh:return Wo;case th:return Zo;case rh:return Xo;case nh:return Yo}return e});var sh=Object.prototype,ih=sh.hasOwnProperty;function oh(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&ih.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Xn=mt.Uint8Array;function Qs(n){var e=new n.constructor(n.byteLength);return new Xn(e).set(new Xn(n)),e}function ah(n,e){var t=Qs(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var lh=/\w*$/;function uh(n){var e=new n.constructor(n.source,lh.exec(n));return e.lastIndex=n.lastIndex,e}var Qo=Vt?Vt.prototype:void 0,ea=Qo?Qo.valueOf:void 0;function ch(n){return ea?Object(ea.call(n)):{}}function ta(n,e){var t=e?Qs(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var fh="[object Boolean]",hh="[object Date]",dh="[object Map]",gh="[object Number]",ph="[object RegExp]",mh="[object Set]",bh="[object String]",yh="[object Symbol]",vh="[object ArrayBuffer]",wh="[object DataView]",Eh="[object Float32Array]",xh="[object Float64Array]",Ah="[object Int8Array]",Th="[object Int16Array]",Oh="[object Int32Array]",Sh="[object Uint8Array]",Nh="[object Uint8ClampedArray]",Lh="[object Uint16Array]",Ch="[object Uint32Array]";function _h(n,e,t){var r=n.constructor;switch(e){case vh:return Qs(n);case fh:case hh:return new r(+n);case wh:return ah(n);case Eh:case xh:case Ah:case Th:case Oh:case Sh:case Nh:case Lh:case Ch:return ta(n,t);case dh:return new r;case gh:case bh:return new r(n);case ph:return uh(n);case mh:return new r;case yh:return ch(n)}}function ra(n){return typeof n.constructor=="function"&&!zs(n)?Zu(Mo(n)):{}}var Rh="[object Map]";function qh(n){return Rt(n)&&et(n)==Rh}var na=Cr&&Cr.isMap,Ih=na?Ks(na):qh,kh="[object Set]";function Ph(n){return Rt(n)&&et(n)==kh}var sa=Cr&&Cr.isSet,jh=sa?Ks(sa):Ph,Dh=1,ia="[object Arguments]",$h="[object Array]",Bh="[object Boolean]",Mh="[object Date]",Uh="[object Error]",oa="[object Function]",Fh="[object GeneratorFunction]",Hh="[object Map]",zh="[object Number]",aa="[object Object]",Vh="[object RegExp]",Kh="[object Set]",Gh="[object String]",Wh="[object Symbol]",Zh="[object WeakMap]",Xh="[object ArrayBuffer]",Yh="[object DataView]",Jh="[object Float32Array]",Qh="[object Float64Array]",ed="[object Int8Array]",td="[object Int16Array]",rd="[object Int32Array]",nd="[object Uint8Array]",sd="[object Uint8ClampedArray]",id="[object Uint16Array]",od="[object Uint32Array]",we={};we[ia]=we[$h]=we[Xh]=we[Yh]=we[Bh]=we[Mh]=we[Jh]=we[Qh]=we[ed]=we[td]=we[rd]=we[Hh]=we[zh]=we[aa]=we[Vh]=we[Kh]=we[Gh]=we[Wh]=we[nd]=we[sd]=we[id]=we[od]=!0,we[Uh]=we[oa]=we[Zh]=!1;function Yn(n,e,t,r,s,i){var o,a=e&Dh;if(o!==void 0)return o;if(!Kt(n))return n;var u=or(n);if(u)o=oh(n);else{var c=et(n),d=c==oa||c==Fh;if(dn(n))return Ko(n,a);if(c==aa||c==ia||d&&!s)o=d?{}:ra(n);else{if(!we[c])return s?n:{};o=_h(n,c,a)}}i||(i=new bt);var g=i.get(n);if(g)return g;i.set(n,o),jh(n)?n.forEach(function(w){o.add(Yn(w,e,t,w,n,i))}):Ih(n)&&n.forEach(function(w,x){o.set(x,Yn(w,e,t,x,n,i))});var f=Zs,p=u?void 0:f(n);return ic(p||n,function(w,x){p&&(x=w,w=n[x]),No(o,x,Yn(w,e,t,x,n,i))}),o}var ad=1,ld=4;function _r(n){return Yn(n,ad|ld)}var ud="__lodash_hash_undefined__";function cd(n){return this.__data__.set(n,ud),this}function fd(n){return this.__data__.has(n)}function Jn(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new cr;++e<t;)this.add(n[e])}Jn.prototype.add=Jn.prototype.push=cd,Jn.prototype.has=fd;function hd(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function dd(n,e){return n.has(e)}var gd=1,pd=2;function la(n,e,t,r,s,i){var o=t&gd,a=n.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=i.get(n),d=i.get(e);if(c&&d)return c==e&&d==n;var g=-1,f=!0,p=t&pd?new Jn:void 0;for(i.set(n,e),i.set(e,n);++g<a;){var w=n[g],x=e[g];if(r)var T=o?r(x,w,g,e,n,i):r(w,x,g,n,e,i);if(T!==void 0){if(T)continue;f=!1;break}if(p){if(!hd(e,function(C,k){if(!dd(p,k)&&(w===C||s(w,C,t,r,i)))return p.push(k)})){f=!1;break}}else if(!(w===x||s(w,x,t,r,i))){f=!1;break}}return i.delete(n),i.delete(e),f}function md(n){var e=-1,t=Array(n.size);return n.forEach(function(r,s){t[++e]=[s,r]}),t}function bd(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var yd=1,vd=2,wd="[object Boolean]",Ed="[object Date]",xd="[object Error]",Ad="[object Map]",Td="[object Number]",Od="[object RegExp]",Sd="[object Set]",Nd="[object String]",Ld="[object Symbol]",Cd="[object ArrayBuffer]",_d="[object DataView]",ua=Vt?Vt.prototype:void 0,ei=ua?ua.valueOf:void 0;function Rd(n,e,t,r,s,i,o){switch(t){case _d:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case Cd:return!(n.byteLength!=e.byteLength||!i(new Xn(n),new Xn(e)));case wd:case Ed:case Td:return hn(+n,+e);case xd:return n.name==e.name&&n.message==e.message;case Od:case Nd:return n==e+"";case Ad:var a=md;case Sd:var u=r&yd;if(a||(a=bd),n.size!=e.size&&!u)return!1;var c=o.get(n);if(c)return c==e;r|=vd,o.set(n,e);var d=la(a(n),a(e),r,s,i,o);return o.delete(n),d;case Ld:if(ei)return ei.call(n)==ei.call(e)}return!1}var qd=1,Id=Object.prototype,kd=Id.hasOwnProperty;function Pd(n,e,t,r,s,i){var o=t&qd,a=Zs(n),u=a.length,c=Zs(e),d=c.length;if(u!=d&&!o)return!1;for(var g=u;g--;){var f=a[g];if(!(o?f in e:kd.call(e,f)))return!1}var p=i.get(n),w=i.get(e);if(p&&w)return p==e&&w==n;var x=!0;i.set(n,e),i.set(e,n);for(var T=o;++g<u;){f=a[g];var C=n[f],k=e[f];if(r)var j=o?r(k,C,f,e,n,i):r(C,k,f,n,e,i);if(!(j===void 0?C===k||s(C,k,t,r,i):j)){x=!1;break}T||(T=f=="constructor")}if(x&&!T){var H=n.constructor,F=e.constructor;H!=F&&"constructor"in n&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof F=="function"&&F instanceof F)&&(x=!1)}return i.delete(n),i.delete(e),x}var jd=1,ca="[object Arguments]",fa="[object Array]",Qn="[object Object]",Dd=Object.prototype,ha=Dd.hasOwnProperty;function $d(n,e,t,r,s,i){var o=or(n),a=or(e),u=o?fa:et(n),c=a?fa:et(e);u=u==ca?Qn:u,c=c==ca?Qn:c;var d=u==Qn,g=c==Qn,f=u==c;if(f&&dn(n)){if(!dn(e))return!1;o=!0,d=!1}if(f&&!d)return i||(i=new bt),o||Ws(n)?la(n,e,t,r,s,i):Rd(n,e,u,t,r,s,i);if(!(t&jd)){var p=d&&ha.call(n,"__wrapped__"),w=g&&ha.call(e,"__wrapped__");if(p||w){var x=p?n.value():n,T=w?e.value():e;return i||(i=new bt),s(x,T,t,r,i)}}return f?(i||(i=new bt),Pd(n,e,t,r,s,i)):!1}function da(n,e,t,r,s){return n===e?!0:n==null||e==null||!Rt(n)&&!Rt(e)?n!==n&&e!==e:$d(n,e,t,r,da,s)}function Bd(n){return function(e,t,r){for(var s=-1,i=Object(e),o=r(e),a=o.length;a--;){var u=o[++s];if(t(i[u],u,i)===!1)break}return e}}var Md=Bd();function ti(n,e,t){(t!==void 0&&!hn(n[e],t)||t===void 0&&!(e in n))&&Hs(n,e,t)}function Ud(n){return Rt(n)&&Gn(n)}function ri(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Fd(n){return cc(n,Bo(n))}function Hd(n,e,t,r,s,i,o){var a=ri(n,t),u=ri(e,t),c=o.get(u);if(c){ti(n,t,c);return}var d=i?i(a,u,t+"",n,e,o):void 0,g=d===void 0;if(g){var f=or(u),p=!f&&dn(u),w=!f&&!p&&Ws(u);d=u,f||p||w?or(a)?d=a:Ud(a)?d=Yu(a):p?(g=!1,d=Ko(u,!0)):w?(g=!1,d=ta(u,!0)):d=[]:$f(u)||Vs(u)?(d=a,Vs(a)?d=Fd(a):(!Kt(a)||Ms(a))&&(d=ra(u))):g=!1}g&&(o.set(u,d),s(d,u,r,i,o),o.delete(u)),ti(n,t,d)}function ga(n,e,t,r,s){n!==e&&Md(e,function(i,o){if(s||(s=new bt),Kt(i))Hd(n,e,o,t,ga,r,s);else{var a=r?r(ri(n,o),i,o+"",n,e,s):void 0;a===void 0&&(a=i),ti(n,o,a)}},Bo)}function ni(n,e){return da(n,e)}var Gt=pc(function(n,e,t){ga(n,e,t)}),U=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(U||{});class yt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=U.TYPE&U.ATTRIBUTE;this.scope=r.scope!=null?r.scope&U.LEVEL|s:U.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?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 Rr extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const pa=class go{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new Rr(`Unable to create ${t} blot`);const i=s,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),a=new i(e,o,r);return go.blots.set(a.domNode,a),a}find(e,t=!1){return go.find(e,t)}query(e,t=U.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&U.LEVEL&U.BLOCK?r=this.types.block:e&U.LEVEL&U.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&U.LEVEL&r.scope&&t&U.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new Rr("Invalid definition");if(r&&t.blotName==="abstract")throw new Rr("Cannot register abstract class");const i=r?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(o=>o.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(o=>{(this.tags[o]==null||t.className==null)&&(this.tags[o]=t)}))),t})}};pa.blots=new WeakMap;let qr=pa;function ma(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class zd extends yt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){ma(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(ma(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const tt=zd;function si(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class Vd extends yt{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[si(this.keyName)]=t,!0):!1}remove(e){e.style[si(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[si(this.keyName)];return this.canAdd(e,t)?t:""}}const Wt=Vd;class Kd{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=qr.find(this.domNode);if(e==null)return;const t=yt.keys(this.domNode),r=tt.keys(this.domNode),s=Wt.keys(this.domNode);t.concat(r).concat(s).forEach(i=>{const o=e.scroll.query(i,U.ATTRIBUTE);o instanceof yt&&(this.attributes[o.attrName]=o)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const es=Kd,ba=class{constructor(e,t){this.scroll=e,this.domNode=t,qr.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Rr("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=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(){this.parent!=null&&this.parent.removeChild(this),qr.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const i=this.isolate(e,t);if(this.scroll.query(r,U.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,U.ATTRIBUTE)!=null){const o=this.scroll.create(this.statics.scope);i.wrap(o),o.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||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(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Rr(`Cannot wrap ${e}`);return r.appendChild(this),r}};ba.blotName="abstract";let ya=ba;const va=class extends ya{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 r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};va.scope=U.INLINE_BLOT;const Pe=va;class Gd{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 r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(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,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(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 e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let s=r();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,i]=this.find(e);let o=e-i;const a=this.iterator(s);let u=a();for(;u&&o<e+t;){const c=u.length();e>o?r(u,e-o,Math.min(t,o+c-e)):r(u,0,Math.min(c,e+t-o)),o+=c,u=a()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function wa(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(U.INLINE);return Array.from(n.childNodes).forEach(s=>{r.domNode.appendChild(s)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Ea=class ir extends ya{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(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,ir.uiClass&&this.uiNode.classList.add(ir.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Gd,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=wa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof Rr)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,s,i)=>{r.deleteAt(s,i)})}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof ir?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(t,r,(o,a,u)=>{(e.blotName==null&&e(o)||e.blotName!=null&&o instanceof e)&&s.push(o),o instanceof ir&&(s=s.concat(o.descendants(e,a,i))),i-=u}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===U.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof ir?t.unwrap():t.remove())})}formatAt(e,t,r,s){this.children.forEachAt(e,t,(i,o,a)=>{i.formatAt(o,a,r,s)})}insertAt(e,t,r){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,r);else{const o=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(o)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,s]=this.children.find(e,t),i=[[this,e]];return r instanceof ir?i.concat(r.path(s,t)):(r!=null&&i.push([r,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof ir&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,i,o)=>{const a=s.split(i,t);a!=null&&r.appendChild(a)}),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)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 r=[],s=[];e.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),r.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=wa(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};Ea.uiClass="";const rt=Ea;function Wd(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const Ir=class ln extends rt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(ln.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new es(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof ln||(r=r.wrap(ln.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,U.INLINE);if(r==null)return;r instanceof yt?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.formats()[r]!=null||this.scroll.query(r,U.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof ln&&r.prev===this&&Wd(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof ln&&this.attributes.move(r),r}};Ir.allowedChildren=[Ir,Pe],Ir.blotName="inline",Ir.scope=U.INLINE_BLOT,Ir.tagName="SPAN";const ii=Ir,kr=class po extends rt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(po.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new es(this.domNode)}format(e,t){const r=this.scroll.query(e,U.BLOCK);r!=null&&(r instanceof yt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(po.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.scroll.query(r,U.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,U.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};kr.blotName="block",kr.scope=U.BLOCK_BLOT,kr.tagName="P",kr.allowedChildren=[ii,kr,Pe];const bn=kr,oi=class extends rt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};oi.blotName="container",oi.scope=U.BLOCK_BLOT;const ts=oi;class Zd extends Pe{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Ke=Zd,Xd={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Yd=100,Pr=class extends rt{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,Xd),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=U.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(u,c=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(r.has(u.domNode)||r.set(u.domNode,[]),c&&i(u.parent))},o=u=>{r.has(u.domNode)&&(u instanceof rt&&u.children.forEach(o),r.delete(u.domNode),u.optimize(t))};let a=e;for(let u=0;a.length>0;u+=1){if(u>=Yd)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(c=>{const d=this.find(c.target,!0);d!=null&&(d.domNode===c.target&&(c.type==="childList"?(i(this.find(c.previousSibling,!1)),Array.from(c.addedNodes).forEach(g=>{const f=this.find(g,!1);i(f,!1),f instanceof rt&&f.children.forEach(p=>{i(p,!1)})})):c.type==="attributes"&&i(d.prev)),i(d))}),this.children.forEach(o),a=Array.from(this.observer.takeRecords()),s=a.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};Pr.blotName="scroll",Pr.defaultChild=bn,Pr.allowedChildren=[bn,ts],Pr.scope=U.BLOCK_BLOT,Pr.tagName="DIV";const ai=Pr,li=class vu extends Pe{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,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof vu&&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(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};li.blotName="text",li.scope=U.INLINE_BLOT;const rs=li,Jd=Object.freeze(Object.defineProperty({__proto__:null,Attributor:yt,AttributorStore:es,BlockBlot:bn,ClassAttributor:tt,ContainerBlot:ts,EmbedBlot:Ke,InlineBlot:ii,LeafBlot:Pe,ParentBlot:rt,Registry:qr,Scope:U,ScrollBlot:ai,StyleAttributor:Wt,TextBlot:rs},Symbol.toStringTag,{value:"Module"}));var ns={exports:{}},ui,xa;function Qd(){if(xa)return ui;xa=1;var n=-1,e=1,t=0;function r(b,N,A,R,m){if(b===N)return b?[[t,b]]:[];if(A!=null){var E=be(b,N,A);if(E)return E}var O=a(b,N),P=b.substring(0,O);b=b.substring(O),N=N.substring(O),O=c(b,N);var I=b.substring(b.length-O);b=b.substring(0,b.length-O),N=N.substring(0,N.length-O);var _=s(b,N);return P&&_.unshift([t,P]),I&&_.push([t,I]),k(_,m),R&&g(_),_}function s(b,N){var A;if(!b)return[[e,N]];if(!N)return[[n,b]];var R=b.length>N.length?b:N,m=b.length>N.length?N:b,E=R.indexOf(m);if(E!==-1)return A=[[e,R.substring(0,E)],[t,m],[e,R.substring(E+m.length)]],b.length>N.length&&(A[0][0]=A[2][0]=n),A;if(m.length===1)return[[n,b],[e,N]];var O=d(b,N);if(O){var P=O[0],I=O[1],_=O[2],K=O[3],W=O[4],z=r(P,_),J=r(I,K);return z.concat([[t,W]],J)}return i(b,N)}function i(b,N){for(var A=b.length,R=N.length,m=Math.ceil((A+R)/2),E=m,O=2*m,P=new Array(O),I=new Array(O),_=0;_<O;_++)P[_]=-1,I[_]=-1;P[E+1]=0,I[E+1]=0;for(var K=A-R,W=K%2!==0,z=0,J=0,G=0,ve=0,ye=0;ye<m;ye++){for(var Q=-ye+z;Q<=ye-J;Q+=2){var ae=E+Q,le;Q===-ye||Q!==ye&&P[ae-1]<P[ae+1]?le=P[ae+1]:le=P[ae-1]+1;for(var ue=le-Q;le<A&&ue<R&&b.charAt(le)===N.charAt(ue);)le++,ue++;if(P[ae]=le,le>A)J+=2;else if(ue>R)z+=2;else if(W){var de=E+K-Q;if(de>=0&&de<O&&I[de]!==-1){var ge=A-I[de];if(le>=ge)return o(b,N,le,ue)}}}for(var Se=-ye+G;Se<=ye-ve;Se+=2){var de=E+Se,ge;Se===-ye||Se!==ye&&I[de-1]<I[de+1]?ge=I[de+1]:ge=I[de-1]+1;for(var Re=ge-Se;ge<A&&Re<R&&b.charAt(A-ge-1)===N.charAt(R-Re-1);)ge++,Re++;if(I[de]=ge,ge>A)ve+=2;else if(Re>R)G+=2;else if(!W){var ae=E+K-Se;if(ae>=0&&ae<O&&P[ae]!==-1){var le=P[ae],ue=E+le-ae;if(ge=A-ge,le>=ge)return o(b,N,le,ue)}}}}return[[n,b],[e,N]]}function o(b,N,A,R){var m=b.substring(0,A),E=N.substring(0,R),O=b.substring(A),P=N.substring(R),I=r(m,E),_=r(O,P);return I.concat(_)}function a(b,N){if(!b||!N||b.charAt(0)!==N.charAt(0))return 0;for(var A=0,R=Math.min(b.length,N.length),m=R,E=0;A<m;)b.substring(E,m)==N.substring(E,m)?(A=m,E=A):R=m,m=Math.floor((R-A)/2+A);return j(b.charCodeAt(m-1))&&m--,m}function u(b,N){var A=b.length,R=N.length;if(A==0||R==0)return 0;A>R?b=b.substring(A-R):A<R&&(N=N.substring(0,A));var m=Math.min(A,R);if(b==N)return m;for(var E=0,O=1;;){var P=b.substring(m-O),I=N.indexOf(P);if(I==-1)return E;O+=I,(I==0||b.substring(m-O)==N.substring(0,O))&&(E=O,O++)}}function c(b,N){if(!b||!N||b.slice(-1)!==N.slice(-1))return 0;for(var A=0,R=Math.min(b.length,N.length),m=R,E=0;A<m;)b.substring(b.length-m,b.length-E)==N.substring(N.length-m,N.length-E)?(A=m,E=A):R=m,m=Math.floor((R-A)/2+A);return H(b.charCodeAt(b.length-m))&&m--,m}function d(b,N){var A=b.length>N.length?b:N,R=b.length>N.length?N:b;if(A.length<4||R.length*2<A.length)return null;function m(J,G,ve){for(var ye=J.substring(ve,ve+Math.floor(J.length/4)),Q=-1,ae="",le,ue,de,ge;(Q=G.indexOf(ye,Q+1))!==-1;){var Se=a(J.substring(ve),G.substring(Q)),Re=c(J.substring(0,ve),G.substring(0,Q));ae.length<Re+Se&&(ae=G.substring(Q-Re,Q)+G.substring(Q,Q+Se),le=J.substring(0,ve-Re),ue=J.substring(ve+Se),de=G.substring(0,Q-Re),ge=G.substring(Q+Se))}return ae.length*2>=J.length?[le,ue,de,ge,ae]:null}var E=m(A,R,Math.ceil(A.length/4)),O=m(A,R,Math.ceil(A.length/2)),P;if(!E&&!O)return null;O?E?P=E[4].length>O[4].length?E:O:P=O:P=E;var I,_,K,W;b.length>N.length?(I=P[0],_=P[1],K=P[2],W=P[3]):(K=P[0],W=P[1],I=P[2],_=P[3]);var z=P[4];return[I,_,K,W,z]}function g(b){for(var N=!1,A=[],R=0,m=null,E=0,O=0,P=0,I=0,_=0;E<b.length;)b[E][0]==t?(A[R++]=E,O=I,P=_,I=0,_=0,m=b[E][1]):(b[E][0]==e?I+=b[E][1].length:_+=b[E][1].length,m&&m.length<=Math.max(O,P)&&m.length<=Math.max(I,_)&&(b.splice(A[R-1],0,[n,m]),b[A[R-1]+1][0]=e,R--,R--,E=R>0?A[R-1]:-1,O=0,P=0,I=0,_=0,m=null,N=!0)),E++;for(N&&k(b),C(b),E=1;E<b.length;){if(b[E-1][0]==n&&b[E][0]==e){var K=b[E-1][1],W=b[E][1],z=u(K,W),J=u(W,K);z>=J?(z>=K.length/2||z>=W.length/2)&&(b.splice(E,0,[t,W.substring(0,z)]),b[E-1][1]=K.substring(0,K.length-z),b[E+1][1]=W.substring(z),E++):(J>=K.length/2||J>=W.length/2)&&(b.splice(E,0,[t,K.substring(0,J)]),b[E-1][0]=e,b[E-1][1]=W.substring(0,W.length-J),b[E+1][0]=n,b[E+1][1]=K.substring(J),E++),E++}E++}}var f=/[^a-zA-Z0-9]/,p=/\s/,w=/[\r\n]/,x=/\n\r?\n$/,T=/^\r?\n\r?\n/;function C(b){function N(J,G){if(!J||!G)return 6;var ve=J.charAt(J.length-1),ye=G.charAt(0),Q=ve.match(f),ae=ye.match(f),le=Q&&ve.match(p),ue=ae&&ye.match(p),de=le&&ve.match(w),ge=ue&&ye.match(w),Se=de&&J.match(x),Re=ge&&G.match(T);return Se||Re?5:de||ge?4:Q&&!le&&ue?3:le||ue?2:Q||ae?1:0}for(var A=1;A<b.length-1;){if(b[A-1][0]==t&&b[A+1][0]==t){var R=b[A-1][1],m=b[A][1],E=b[A+1][1],O=c(R,m);if(O){var P=m.substring(m.length-O);R=R.substring(0,R.length-O),m=P+m.substring(0,m.length-O),E=P+E}for(var I=R,_=m,K=E,W=N(R,m)+N(m,E);m.charAt(0)===E.charAt(0);){R+=m.charAt(0),m=m.substring(1)+E.charAt(0),E=E.substring(1);var z=N(R,m)+N(m,E);z>=W&&(W=z,I=R,_=m,K=E)}b[A-1][1]!=I&&(I?b[A-1][1]=I:(b.splice(A-1,1),A--),b[A][1]=_,K?b[A+1][1]=K:(b.splice(A+1,1),A--))}A++}}function k(b,N){b.push([t,""]);for(var A=0,R=0,m=0,E="",O="",P;A<b.length;){if(A<b.length-1&&!b[A][1]){b.splice(A,1);continue}switch(b[A][0]){case e:m++,O+=b[A][1],A++;break;case n:R++,E+=b[A][1],A++;break;case t:var I=A-m-R-1;if(N){if(I>=0&&ie(b[I][1])){var _=b[I][1].slice(-1);if(b[I][1]=b[I][1].slice(0,-1),E=_+E,O=_+O,!b[I][1]){b.splice(I,1),A--;var K=I-1;b[K]&&b[K][0]===e&&(m++,O=b[K][1]+O,K--),b[K]&&b[K][0]===n&&(R++,E=b[K][1]+E,K--),I=K}}if(F(b[A][1])){var _=b[A][1].charAt(0);b[A][1]=b[A][1].slice(1),E+=_,O+=_}}if(A<b.length-1&&!b[A][1]){b.splice(A,1);break}if(E.length>0||O.length>0){E.length>0&&O.length>0&&(P=a(O,E),P!==0&&(I>=0?b[I][1]+=O.substring(0,P):(b.splice(0,0,[t,O.substring(0,P)]),A++),O=O.substring(P),E=E.substring(P)),P=c(O,E),P!==0&&(b[A][1]=O.substring(O.length-P)+b[A][1],O=O.substring(0,O.length-P),E=E.substring(0,E.length-P)));var W=m+R;E.length===0&&O.length===0?(b.splice(A-W,W),A=A-W):E.length===0?(b.splice(A-W,W,[e,O]),A=A-W+1):O.length===0?(b.splice(A-W,W,[n,E]),A=A-W+1):(b.splice(A-W,W,[n,E],[e,O]),A=A-W+2)}A!==0&&b[A-1][0]===t?(b[A-1][1]+=b[A][1],b.splice(A,1)):A++,m=0,R=0,E="",O="";break}}b[b.length-1][1]===""&&b.pop();var z=!1;for(A=1;A<b.length-1;)b[A-1][0]===t&&b[A+1][0]===t&&(b[A][1].substring(b[A][1].length-b[A-1][1].length)===b[A-1][1]?(b[A][1]=b[A-1][1]+b[A][1].substring(0,b[A][1].length-b[A-1][1].length),b[A+1][1]=b[A-1][1]+b[A+1][1],b.splice(A-1,1),z=!0):b[A][1].substring(0,b[A+1][1].length)==b[A+1][1]&&(b[A-1][1]+=b[A+1][1],b[A][1]=b[A][1].substring(b[A+1][1].length)+b[A+1][1],b.splice(A+1,1),z=!0)),A++;z&&k(b,N)}function j(b){return b>=55296&&b<=56319}function H(b){return b>=56320&&b<=57343}function F(b){return H(b.charCodeAt(0))}function ie(b){return j(b.charCodeAt(b.length-1))}function te(b){for(var N=[],A=0;A<b.length;A++)b[A][1].length>0&&N.push(b[A]);return N}function oe(b,N,A,R){return ie(b)||F(R)?null:te([[t,b],[n,N],[e,A],[t,R]])}function be(b,N,A){var R=typeof A=="number"?{index:A,length:0}:A.oldRange,m=typeof A=="number"?null:A.newRange,E=b.length,O=N.length;if(R.length===0&&(m===null||m.length===0)){var P=R.index,I=b.slice(0,P),_=b.slice(P),K=m?m.index:null;e:{var W=P+O-E;if(K!==null&&K!==W||W<0||W>O)break e;var z=N.slice(0,W),J=N.slice(W);if(J!==_)break e;var G=Math.min(P,W),ve=I.slice(0,G),ye=z.slice(0,G);if(ve!==ye)break e;var Q=I.slice(G),ae=z.slice(G);return oe(ve,Q,ae,_)}e:{if(K!==null&&K!==P)break e;var le=P,z=N.slice(0,le),J=N.slice(le);if(z!==I)break e;var ue=Math.min(E-le,O-le),de=_.slice(_.length-ue),ge=J.slice(J.length-ue);if(de!==ge)break e;var Q=_.slice(0,_.length-ue),ae=J.slice(0,J.length-ue);return oe(I,Q,ae,de)}}if(R.length>0&&m&&m.length===0)e:{var ve=b.slice(0,R.index),de=b.slice(R.index+R.length),G=ve.length,ue=de.length;if(O<G+ue)break e;var ye=N.slice(0,G),ge=N.slice(O-ue);if(ve!==ye||de!==ge)break e;var Q=b.slice(G,E-ue),ae=N.slice(G,O-ue);return oe(ve,Q,ae,de)}return null}function xe(b,N,A,R){return r(b,N,A,R,!0)}return xe.INSERT=e,xe.DELETE=n,xe.EQUAL=t,ui=xe,ui}var yn={exports:{}};yn.exports;var Aa;function Ta(){return Aa||(Aa=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Function]",g="[object GeneratorFunction]",f="[object Map]",p="[object Number]",w="[object Object]",x="[object Promise]",T="[object RegExp]",C="[object Set]",k="[object String]",j="[object Symbol]",H="[object WeakMap]",F="[object ArrayBuffer]",ie="[object DataView]",te="[object Float32Array]",oe="[object Float64Array]",be="[object Int8Array]",xe="[object Int16Array]",b="[object Int32Array]",N="[object Uint8Array]",A="[object Uint8ClampedArray]",R="[object Uint16Array]",m="[object Uint32Array]",E=/[\\^$.*+?()[\]{}|]/g,O=/\w*$/,P=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,_={};_[i]=_[o]=_[F]=_[ie]=_[a]=_[u]=_[te]=_[oe]=_[be]=_[xe]=_[b]=_[f]=_[p]=_[w]=_[T]=_[C]=_[k]=_[j]=_[N]=_[A]=_[R]=_[m]=!0,_[c]=_[d]=_[H]=!1;var K=typeof pt=="object"&&pt&&pt.Object===Object&&pt,W=typeof self=="object"&&self&&self.Object===Object&&self,z=K||W||Function("return this")(),J=e&&!e.nodeType&&e,G=J&&!0&&n&&!n.nodeType&&n,ve=G&&G.exports===J;function ye(l,h){return l.set(h[0],h[1]),l}function Q(l,h){return l.add(h),l}function ae(l,h){for(var v=-1,S=l?l.length:0;++v<S&&h(l[v],v,l)!==!1;);return l}function le(l,h){for(var v=-1,S=h.length,ee=l.length;++v<S;)l[ee+v]=h[v];return l}function ue(l,h,v,S){for(var ee=-1,V=l?l.length:0;++ee<V;)v=h(v,l[ee],ee,l);return v}function de(l,h){for(var v=-1,S=Array(l);++v<l;)S[v]=h(v);return S}function ge(l,h){return l==null?void 0:l[h]}function Se(l){var h=!1;if(l!=null&&typeof l.toString!="function")try{h=!!(l+"")}catch{}return h}function Re(l){var h=-1,v=Array(l.size);return l.forEach(function(S,ee){v[++h]=[ee,S]}),v}function At(l,h){return function(v){return l(h(v))}}function Tt(l){var h=-1,v=Array(l.size);return l.forEach(function(S){v[++h]=S}),v}var Gr=Array.prototype,Wr=Function.prototype,ut=Object.prototype,mr=z["__core-js_shared__"],Zr=function(){var l=/[^.]+$/.exec(mr&&mr.keys&&mr.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Jt=Wr.toString,Je=ut.hasOwnProperty,Qt=ut.toString,Xr=RegExp("^"+Jt.call(Je).replace(E,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=ve?z.Buffer:void 0,Dt=z.Symbol,br=z.Uint8Array,Ue=At(Object.getPrototypeOf,Object),yr=Object.create,Yr=ut.propertyIsEnumerable,jn=Gr.splice,vr=Object.getOwnPropertySymbols,er=Ot?Ot.isBuffer:void 0,Jr=At(Object.keys,Object),tr=gt(z,"DataView"),$t=gt(z,"Map"),Fe=gt(z,"Promise"),Bt=gt(z,"Set"),Qe=gt(z,"WeakMap"),ct=gt(Object,"create"),Mt=He(tr),St=He($t),wr=He(Fe),rr=He(Bt),Er=He(Qe),ft=Dt?Dt.prototype:void 0,xr=ft?ft.valueOf:void 0;function ht(l){var h=-1,v=l?l.length:0;for(this.clear();++h<v;){var S=l[h];this.set(S[0],S[1])}}function Dn(){this.__data__=ct?ct(null):{}}function Qr(l){return this.has(l)&&delete this.__data__[l]}function en(l){var h=this.__data__;if(ct){var v=h[l];return v===r?void 0:v}return Je.call(h,l)?h[l]:void 0}function tn(l){var h=this.__data__;return ct?h[l]!==void 0:Je.call(h,l)}function Ar(l,h){var v=this.__data__;return v[l]=ct&&h===void 0?r:h,this}ht.prototype.clear=Dn,ht.prototype.delete=Qr,ht.prototype.get=en,ht.prototype.has=tn,ht.prototype.set=Ar;function Le(l){var h=-1,v=l?l.length:0;for(this.clear();++h<v;){var S=l[h];this.set(S[0],S[1])}}function $n(){this.__data__=[]}function y(l){var h=this.__data__,v=nn(h,l);if(v<0)return!1;var S=h.length-1;return v==S?h.pop():jn.call(h,v,1),!0}function q(l){var h=this.__data__,v=nn(h,l);return v<0?void 0:h[v][1]}function D(l){return nn(this.__data__,l)>-1}function Z(l,h){var v=this.__data__,S=nn(v,l);return S<0?v.push([l,h]):v[S][1]=h,this}Le.prototype.clear=$n,Le.prototype.delete=y,Le.prototype.get=q,Le.prototype.has=D,Le.prototype.set=Z;function X(l){var h=-1,v=l?l.length:0;for(this.clear();++h<v;){var S=l[h];this.set(S[0],S[1])}}function pe(){this.__data__={hash:new ht,map:new($t||Le),string:new ht}}function ne(l){return Sr(this,l).delete(l)}function re(l){return Sr(this,l).get(l)}function Ce(l){return Sr(this,l).has(l)}function Ae(l,h){return Sr(this,l).set(l,h),this}X.prototype.clear=pe,X.prototype.delete=ne,X.prototype.get=re,X.prototype.has=Ce,X.prototype.set=Ae;function ce(l){this.__data__=new Le(l)}function $e(){this.__data__=new Le}function Nt(l){return this.__data__.delete(l)}function dt(l){return this.__data__.get(l)}function qe(l){return this.__data__.has(l)}function Tr(l,h){var v=this.__data__;if(v instanceof Le){var S=v.__data__;if(!$t||S.length<t-1)return S.push([l,h]),this;v=this.__data__=new X(S)}return v.set(l,h),this}ce.prototype.clear=$e,ce.prototype.delete=Nt,ce.prototype.get=dt,ce.prototype.has=qe,ce.prototype.set=Tr;function nr(l,h){var v=Fn(l)||on(l)?de(l.length,String):[],S=v.length,ee=!!S;for(var V in l)Je.call(l,V)&&!(ee&&(V=="length"||ao(V,S)))&&v.push(V);return v}function rn(l,h,v){var S=l[h];(!(Je.call(l,h)&&qs(S,v))||v===void 0&&!(h in l))&&(l[h]=v)}function nn(l,h){for(var v=l.length;v--;)if(qs(l[v][0],h))return v;return-1}function Lt(l,h){return l&&Un(h,zn(h),l)}function Bn(l,h,v,S,ee,V,he){var fe;if(S&&(fe=V?S(l,ee,V,he):S(l)),fe!==void 0)return fe;if(!_t(l))return l;var Ne=Fn(l);if(Ne){if(fe=io(l),!h)return ro(l,fe)}else{var me=Ft(l),Be=me==d||me==g;if(Is(l))return sn(l,h);if(me==w||me==i||Be&&!V){if(Se(l))return V?l:{};if(fe=Ct(Be?{}:l),!h)return no(l,Lt(fe,l))}else{if(!_[me])return V?l:{};fe=oo(l,me,Bn,h)}}he||(he=new ce);var Ve=he.get(l);if(Ve)return Ve;if(he.set(l,fe),!Ne)var _e=v?so(l):zn(l);return ae(_e||l,function(Me,ke){_e&&(ke=Me,Me=l[ke]),rn(fe,ke,Bn(Me,h,v,S,ke,l,he))}),fe}function Wi(l){return _t(l)?yr(l):{}}function Zi(l,h,v){var S=h(l);return Fn(l)?S:le(S,v(l))}function Xi(l){return Qt.call(l)}function Yi(l){if(!_t(l)||uo(l))return!1;var h=Hn(l)||Se(l)?Xr:P;return h.test(He(l))}function Ji(l){if(!_s(l))return Jr(l);var h=[];for(var v in Object(l))Je.call(l,v)&&v!="constructor"&&h.push(v);return h}function sn(l,h){if(h)return l.slice();var v=new l.constructor(l.length);return l.copy(v),v}function Mn(l){var h=new l.constructor(l.byteLength);return new br(h).set(new br(l)),h}function Or(l,h){var v=h?Mn(l.buffer):l.buffer;return new l.constructor(v,l.byteOffset,l.byteLength)}function Ls(l,h,v){var S=h?v(Re(l),!0):Re(l);return ue(S,ye,new l.constructor)}function Cs(l){var h=new l.constructor(l.source,O.exec(l));return h.lastIndex=l.lastIndex,h}function Qi(l,h,v){var S=h?v(Tt(l),!0):Tt(l);return ue(S,Q,new l.constructor)}function eo(l){return xr?Object(xr.call(l)):{}}function to(l,h){var v=h?Mn(l.buffer):l.buffer;return new l.constructor(v,l.byteOffset,l.length)}function ro(l,h){var v=-1,S=l.length;for(h||(h=Array(S));++v<S;)h[v]=l[v];return h}function Un(l,h,v,S){v||(v={});for(var ee=-1,V=h.length;++ee<V;){var he=h[ee],fe=void 0;rn(v,he,fe===void 0?l[he]:fe)}return v}function no(l,h){return Un(l,Ut(l),h)}function so(l){return Zi(l,zn,Ut)}function Sr(l,h){var v=l.__data__;return lo(h)?v[typeof h=="string"?"string":"hash"]:v.map}function gt(l,h){var v=ge(l,h);return Yi(v)?v:void 0}var Ut=vr?At(vr,Object):fo,Ft=Xi;(tr&&Ft(new tr(new ArrayBuffer(1)))!=ie||$t&&Ft(new $t)!=f||Fe&&Ft(Fe.resolve())!=x||Bt&&Ft(new Bt)!=C||Qe&&Ft(new Qe)!=H)&&(Ft=function(l){var h=Qt.call(l),v=h==w?l.constructor:void 0,S=v?He(v):void 0;if(S)switch(S){case Mt:return ie;case St:return f;case wr:return x;case rr:return C;case Er:return H}return h});function io(l){var h=l.length,v=l.constructor(h);return h&&typeof l[0]=="string"&&Je.call(l,"index")&&(v.index=l.index,v.input=l.input),v}function Ct(l){return typeof l.constructor=="function"&&!_s(l)?Wi(Ue(l)):{}}function oo(l,h,v,S){var ee=l.constructor;switch(h){case F:return Mn(l);case a:case u:return new ee(+l);case ie:return Or(l,S);case te:case oe:case be:case xe:case b:case N:case A:case R:case m:return to(l,S);case f:return Ls(l,S,v);case p:case k:return new ee(l);case T:return Cs(l);case C:return Qi(l,S,v);case j:return eo(l)}}function ao(l,h){return h=h??s,!!h&&(typeof l=="number"||I.test(l))&&l>-1&&l%1==0&&l<h}function lo(l){var h=typeof l;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?l!=="__proto__":l===null}function uo(l){return!!Zr&&Zr in l}function _s(l){var h=l&&l.constructor,v=typeof h=="function"&&h.prototype||ut;return l===v}function He(l){if(l!=null){try{return Jt.call(l)}catch{}try{return l+""}catch{}}return""}function Rs(l){return Bn(l,!0,!0)}function qs(l,h){return l===h||l!==l&&h!==h}function on(l){return co(l)&&Je.call(l,"callee")&&(!Yr.call(l,"callee")||Qt.call(l)==i)}var Fn=Array.isArray;function an(l){return l!=null&&ks(l.length)&&!Hn(l)}function co(l){return Ps(l)&&an(l)}var Is=er||ho;function Hn(l){var h=_t(l)?Qt.call(l):"";return h==d||h==g}function ks(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=s}function _t(l){var h=typeof l;return!!l&&(h=="object"||h=="function")}function Ps(l){return!!l&&typeof l=="object"}function zn(l){return an(l)?nr(l):Ji(l)}function fo(){return[]}function ho(){return!1}n.exports=Rs}(yn,yn.exports)),yn.exports}var vn={exports:{}};vn.exports;var Oa;function Sa(){return Oa||(Oa=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,o=9007199254740991,a="[object Arguments]",u="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",g="[object Date]",f="[object Error]",p="[object Function]",w="[object GeneratorFunction]",x="[object Map]",T="[object Number]",C="[object Null]",k="[object Object]",j="[object Promise]",H="[object Proxy]",F="[object RegExp]",ie="[object Set]",te="[object String]",oe="[object Symbol]",be="[object Undefined]",xe="[object WeakMap]",b="[object ArrayBuffer]",N="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",m="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",P="[object Uint8Array]",I="[object Uint8ClampedArray]",_="[object Uint16Array]",K="[object Uint32Array]",W=/[\\^$.*+?()[\]{}|]/g,z=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,G={};G[A]=G[R]=G[m]=G[E]=G[O]=G[P]=G[I]=G[_]=G[K]=!0,G[a]=G[u]=G[b]=G[d]=G[N]=G[g]=G[f]=G[p]=G[x]=G[T]=G[k]=G[F]=G[ie]=G[te]=G[xe]=!1;var ve=typeof pt=="object"&&pt&&pt.Object===Object&&pt,ye=typeof self=="object"&&self&&self.Object===Object&&self,Q=ve||ye||Function("return this")(),ae=e&&!e.nodeType&&e,le=ae&&!0&&n&&!n.nodeType&&n,ue=le&&le.exports===ae,de=ue&&ve.process,ge=function(){try{return de&&de.binding&&de.binding("util")}catch{}}(),Se=ge&&ge.isTypedArray;function Re(l,h){for(var v=-1,S=l==null?0:l.length,ee=0,V=[];++v<S;){var he=l[v];h(he,v,l)&&(V[ee++]=he)}return V}function At(l,h){for(var v=-1,S=h.length,ee=l.length;++v<S;)l[ee+v]=h[v];return l}function Tt(l,h){for(var v=-1,S=l==null?0:l.length;++v<S;)if(h(l[v],v,l))return!0;return!1}function Gr(l,h){for(var v=-1,S=Array(l);++v<l;)S[v]=h(v);return S}function Wr(l){return function(h){return l(h)}}function ut(l,h){return l.has(h)}function mr(l,h){return l==null?void 0:l[h]}function Zr(l){var h=-1,v=Array(l.size);return l.forEach(function(S,ee){v[++h]=[ee,S]}),v}function Jt(l,h){return function(v){return l(h(v))}}function Je(l){var h=-1,v=Array(l.size);return l.forEach(function(S){v[++h]=S}),v}var Qt=Array.prototype,Xr=Function.prototype,Ot=Object.prototype,Dt=Q["__core-js_shared__"],br=Xr.toString,Ue=Ot.hasOwnProperty,yr=function(){var l=/[^.]+$/.exec(Dt&&Dt.keys&&Dt.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Yr=Ot.toString,jn=RegExp("^"+br.call(Ue).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vr=ue?Q.Buffer:void 0,er=Q.Symbol,Jr=Q.Uint8Array,tr=Ot.propertyIsEnumerable,$t=Qt.splice,Fe=er?er.toStringTag:void 0,Bt=Object.getOwnPropertySymbols,Qe=vr?vr.isBuffer:void 0,ct=Jt(Object.keys,Object),Mt=Ut(Q,"DataView"),St=Ut(Q,"Map"),wr=Ut(Q,"Promise"),rr=Ut(Q,"Set"),Er=Ut(Q,"WeakMap"),ft=Ut(Object,"create"),xr=He(Mt),ht=He(St),Dn=He(wr),Qr=He(rr),en=He(Er),tn=er?er.prototype:void 0,Ar=tn?tn.valueOf:void 0;function Le(l){var h=-1,v=l==null?0:l.length;for(this.clear();++h<v;){var S=l[h];this.set(S[0],S[1])}}function $n(){this.__data__=ft?ft(null):{},this.size=0}function y(l){var h=this.has(l)&&delete this.__data__[l];return this.size-=h?1:0,h}function q(l){var h=this.__data__;if(ft){var v=h[l];return v===r?void 0:v}return Ue.call(h,l)?h[l]:void 0}function D(l){var h=this.__data__;return ft?h[l]!==void 0:Ue.call(h,l)}function Z(l,h){var v=this.__data__;return this.size+=this.has(l)?0:1,v[l]=ft&&h===void 0?r:h,this}Le.prototype.clear=$n,Le.prototype.delete=y,Le.prototype.get=q,Le.prototype.has=D,Le.prototype.set=Z;function X(l){var h=-1,v=l==null?0:l.length;for(this.clear();++h<v;){var S=l[h];this.set(S[0],S[1])}}function pe(){this.__data__=[],this.size=0}function ne(l){var h=this.__data__,v=sn(h,l);if(v<0)return!1;var S=h.length-1;return v==S?h.pop():$t.call(h,v,1),--this.size,!0}function re(l){var h=this.__data__,v=sn(h,l);return v<0?void 0:h[v][1]}function Ce(l){return sn(this.__data__,l)>-1}function Ae(l,h){var v=this.__data__,S=sn(v,l);return S<0?(++this.size,v.push([l,h])):v[S][1]=h,this}X.prototype.clear=pe,X.prototype.delete=ne,X.prototype.get=re,X.prototype.has=Ce,X.prototype.set=Ae;function ce(l){var h=-1,v=l==null?0:l.length;for(this.clear();++h<v;){var S=l[h];this.set(S[0],S[1])}}function $e(){this.size=0,this.__data__={hash:new Le,map:new(St||X),string:new Le}}function Nt(l){var h=gt(this,l).delete(l);return this.size-=h?1:0,h}function dt(l){return gt(this,l).get(l)}function qe(l){return gt(this,l).has(l)}function Tr(l,h){var v=gt(this,l),S=v.size;return v.set(l,h),this.size+=v.size==S?0:1,this}ce.prototype.clear=$e,ce.prototype.delete=Nt,ce.prototype.get=dt,ce.prototype.has=qe,ce.prototype.set=Tr;function nr(l){var h=-1,v=l==null?0:l.length;for(this.__data__=new ce;++h<v;)this.add(l[h])}function rn(l){return this.__data__.set(l,r),this}function nn(l){return this.__data__.has(l)}nr.prototype.add=nr.prototype.push=rn,nr.prototype.has=nn;function Lt(l){var h=this.__data__=new X(l);this.size=h.size}function Bn(){this.__data__=new X,this.size=0}function Wi(l){var h=this.__data__,v=h.delete(l);return this.size=h.size,v}function Zi(l){return this.__data__.get(l)}function Xi(l){return this.__data__.has(l)}function Yi(l,h){var v=this.__data__;if(v instanceof X){var S=v.__data__;if(!St||S.length<t-1)return S.push([l,h]),this.size=++v.size,this;v=this.__data__=new ce(S)}return v.set(l,h),this.size=v.size,this}Lt.prototype.clear=Bn,Lt.prototype.delete=Wi,Lt.prototype.get=Zi,Lt.prototype.has=Xi,Lt.prototype.set=Yi;function Ji(l,h){var v=on(l),S=!v&&qs(l),ee=!v&&!S&&an(l),V=!v&&!S&&!ee&&Ps(l),he=v||S||ee||V,fe=he?Gr(l.length,String):[],Ne=fe.length;for(var me in l)Ue.call(l,me)&&!(he&&(me=="length"||ee&&(me=="offset"||me=="parent")||V&&(me=="buffer"||me=="byteLength"||me=="byteOffset")||oo(me,Ne)))&&fe.push(me);return fe}function sn(l,h){for(var v=l.length;v--;)if(Rs(l[v][0],h))return v;return-1}function Mn(l,h,v){var S=h(l);return on(l)?S:At(S,v(l))}function Or(l){return l==null?l===void 0?be:C:Fe&&Fe in Object(l)?Ft(l):_s(l)}function Ls(l){return _t(l)&&Or(l)==a}function Cs(l,h,v,S,ee){return l===h?!0:l==null||h==null||!_t(l)&&!_t(h)?l!==l&&h!==h:Qi(l,h,v,S,Cs,ee)}function Qi(l,h,v,S,ee,V){var he=on(l),fe=on(h),Ne=he?u:Ct(l),me=fe?u:Ct(h);Ne=Ne==a?k:Ne,me=me==a?k:me;var Be=Ne==k,Ve=me==k,_e=Ne==me;if(_e&&an(l)){if(!an(h))return!1;he=!0,Be=!1}if(_e&&!Be)return V||(V=new Lt),he||Ps(l)?Un(l,h,v,S,ee,V):no(l,h,Ne,v,S,ee,V);if(!(v&s)){var Me=Be&&Ue.call(l,"__wrapped__"),ke=Ve&&Ue.call(h,"__wrapped__");if(Me||ke){var sr=Me?l.value():l,Ht=ke?h.value():h;return V||(V=new Lt),ee(sr,Ht,v,S,V)}}return _e?(V||(V=new Lt),so(l,h,v,S,ee,V)):!1}function eo(l){if(!ks(l)||lo(l))return!1;var h=Is(l)?jn:z;return h.test(He(l))}function to(l){return _t(l)&&Hn(l.length)&&!!G[Or(l)]}function ro(l){if(!uo(l))return ct(l);var h=[];for(var v in Object(l))Ue.call(l,v)&&v!="constructor"&&h.push(v);return h}function Un(l,h,v,S,ee,V){var he=v&s,fe=l.length,Ne=h.length;if(fe!=Ne&&!(he&&Ne>fe))return!1;var me=V.get(l);if(me&&V.get(h))return me==h;var Be=-1,Ve=!0,_e=v&i?new nr:void 0;for(V.set(l,h),V.set(h,l);++Be<fe;){var Me=l[Be],ke=h[Be];if(S)var sr=he?S(ke,Me,Be,h,l,V):S(Me,ke,Be,l,h,V);if(sr!==void 0){if(sr)continue;Ve=!1;break}if(_e){if(!Tt(h,function(Ht,Nr){if(!ut(_e,Nr)&&(Me===Ht||ee(Me,Ht,v,S,V)))return _e.push(Nr)})){Ve=!1;break}}else if(!(Me===ke||ee(Me,ke,v,S,V))){Ve=!1;break}}return V.delete(l),V.delete(h),Ve}function no(l,h,v,S,ee,V,he){switch(v){case N:if(l.byteLength!=h.byteLength||l.byteOffset!=h.byteOffset)return!1;l=l.buffer,h=h.buffer;case b:return!(l.byteLength!=h.byteLength||!V(new Jr(l),new Jr(h)));case d:case g:case T:return Rs(+l,+h);case f:return l.name==h.name&&l.message==h.message;case F:case te:return l==h+"";case x:var fe=Zr;case ie:var Ne=S&s;if(fe||(fe=Je),l.size!=h.size&&!Ne)return!1;var me=he.get(l);if(me)return me==h;S|=i,he.set(l,h);var Be=Un(fe(l),fe(h),S,ee,V,he);return he.delete(l),Be;case oe:if(Ar)return Ar.call(l)==Ar.call(h)}return!1}function so(l,h,v,S,ee,V){var he=v&s,fe=Sr(l),Ne=fe.length,me=Sr(h),Be=me.length;if(Ne!=Be&&!he)return!1;for(var Ve=Ne;Ve--;){var _e=fe[Ve];if(!(he?_e in h:Ue.call(h,_e)))return!1}var Me=V.get(l);if(Me&&V.get(h))return Me==h;var ke=!0;V.set(l,h),V.set(h,l);for(var sr=he;++Ve<Ne;){_e=fe[Ve];var Ht=l[_e],Nr=h[_e];if(S)var yu=he?S(Nr,Ht,_e,h,l,V):S(Ht,Nr,_e,l,h,V);if(!(yu===void 0?Ht===Nr||ee(Ht,Nr,v,S,V):yu)){ke=!1;break}sr||(sr=_e=="constructor")}if(ke&&!sr){var js=l.constructor,Ds=h.constructor;js!=Ds&&"constructor"in l&&"constructor"in h&&!(typeof js=="function"&&js instanceof js&&typeof Ds=="function"&&Ds instanceof Ds)&&(ke=!1)}return V.delete(l),V.delete(h),ke}function Sr(l){return Mn(l,zn,io)}function gt(l,h){var v=l.__data__;return ao(h)?v[typeof h=="string"?"string":"hash"]:v.map}function Ut(l,h){var v=mr(l,h);return eo(v)?v:void 0}function Ft(l){var h=Ue.call(l,Fe),v=l[Fe];try{l[Fe]=void 0;var S=!0}catch{}var ee=Yr.call(l);return S&&(h?l[Fe]=v:delete l[Fe]),ee}var io=Bt?function(l){return l==null?[]:(l=Object(l),Re(Bt(l),function(h){return tr.call(l,h)}))}:fo,Ct=Or;(Mt&&Ct(new Mt(new ArrayBuffer(1)))!=N||St&&Ct(new St)!=x||wr&&Ct(wr.resolve())!=j||rr&&Ct(new rr)!=ie||Er&&Ct(new Er)!=xe)&&(Ct=function(l){var h=Or(l),v=h==k?l.constructor:void 0,S=v?He(v):"";if(S)switch(S){case xr:return N;case ht:return x;case Dn:return j;case Qr:return ie;case en:return xe}return h});function oo(l,h){return h=h??o,!!h&&(typeof l=="number"||J.test(l))&&l>-1&&l%1==0&&l<h}function ao(l){var h=typeof l;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?l!=="__proto__":l===null}function lo(l){return!!yr&&yr in l}function uo(l){var h=l&&l.constructor,v=typeof h=="function"&&h.prototype||Ot;return l===v}function _s(l){return Yr.call(l)}function He(l){if(l!=null){try{return br.call(l)}catch{}try{return l+""}catch{}}return""}function Rs(l,h){return l===h||l!==l&&h!==h}var qs=Ls(function(){return arguments}())?Ls:function(l){return _t(l)&&Ue.call(l,"callee")&&!tr.call(l,"callee")},on=Array.isArray;function Fn(l){return l!=null&&Hn(l.length)&&!Is(l)}var an=Qe||ho;function co(l,h){return Cs(l,h)}function Is(l){if(!ks(l))return!1;var h=Or(l);return h==p||h==w||h==c||h==H}function Hn(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=o}function ks(l){var h=typeof l;return l!=null&&(h=="object"||h=="function")}function _t(l){return l!=null&&typeof l=="object"}var Ps=Se?Wr(Se):to;function zn(l){return Fn(l)?Ji(l):ro(l)}function fo(){return[]}function ho(){return!1}n.exports=co}(vn,vn.exports)),vn.exports}var ss={},Na;function eg(){if(Na)return ss;Na=1,Object.defineProperty(ss,"__esModule",{value:!0});const n=Ta(),e=Sa();var t;return function(r){function s(u={},c={},d=!1){typeof u!="object"&&(u={}),typeof c!="object"&&(c={});let g=n(c);d||(g=Object.keys(g).reduce((f,p)=>(g[p]!=null&&(f[p]=g[p]),f),{}));for(const f in u)u[f]!==void 0&&c[f]===void 0&&(g[f]=u[f]);return Object.keys(g).length>0?g:void 0}r.compose=s;function i(u={},c={}){typeof u!="object"&&(u={}),typeof c!="object"&&(c={});const d=Object.keys(u).concat(Object.keys(c)).reduce((g,f)=>(e(u[f],c[f])||(g[f]=c[f]===void 0?null:c[f]),g),{});return Object.keys(d).length>0?d:void 0}r.diff=i;function o(u={},c={}){u=u||{};const d=Object.keys(c).reduce((g,f)=>(c[f]!==u[f]&&u[f]!==void 0&&(g[f]=c[f]),g),{});return Object.keys(u).reduce((g,f)=>(u[f]!==c[f]&&c[f]===void 0&&(g[f]=null),g),d)}r.invert=o;function a(u,c,d=!1){if(typeof u!="object")return c;if(typeof c!="object")return;if(!d)return c;const g=Object.keys(c).reduce((f,p)=>(u[p]===void 0&&(f[p]=c[p]),f),{});return Object.keys(g).length>0?g:void 0}r.transform=a}(t||(t={})),ss.default=t,ss}var is={},La;function Ca(){if(La)return is;La=1,Object.defineProperty(is,"__esModule",{value:!0});var n;return function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t}(n||(n={})),is.default=n,is}var os={},_a;function tg(){if(_a)return os;_a=1,Object.defineProperty(os,"__esModule",{value:!0});const n=Ca();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,o=n.default.length(s);if(r>=o-i?(r=o-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const a={};return s.attributes&&(a.attributes=s.attributes),typeof s.retain=="number"?a.retain=r:typeof s.retain=="object"&&s.retain!==null?a.retain=s.retain:typeof s.insert=="string"?a.insert=s.insert.substr(i,r):a.insert=s.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),o=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(o)}}else return[]}}return os.default=e,os}var Ra;function rg(){return Ra||(Ra=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=Qd(),r=Ta(),s=Sa(),i=eg();e.AttributeMap=i.default;const o=Ca();e.Op=o.default;const a=tg();e.OpIterator=a.default;const u="\0",c=(g,f)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(f)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(f)[0]}`);return[p,g[p],f[p]]};class d{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,p){this.handlers[f]=p}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const p=this.handlers[f];if(!p)throw new Error(`no handlers for embed type "${f}"`);return p}insert(f,p){const w={};return typeof f=="string"&&f.length===0?this:(w.insert=f,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(w.attributes=p),this.push(w))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,p){if(typeof f=="number"&&f<=0)return this;const w={retain:f};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(w.attributes=p),this.push(w)}push(f){let p=this.ops.length,w=this.ops[p-1];if(f=r(f),typeof w=="object"){if(typeof f.delete=="number"&&typeof w.delete=="number")return this.ops[p-1]={delete:w.delete+f.delete},this;if(typeof w.delete=="number"&&f.insert!=null&&(p-=1,w=this.ops[p-1],typeof w!="object"))return this.ops.unshift(f),this;if(s(f.attributes,w.attributes)){if(typeof f.insert=="string"&&typeof w.insert=="string")return this.ops[p-1]={insert:w.insert+f.insert},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof w.retain=="number")return this.ops[p-1]={retain:w.retain+f.retain},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this}}return p===this.ops.length?this.ops.push(f):this.ops.splice(p,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const p=[],w=[];return this.forEach(x=>{(f(x)?p:w).push(x)}),[p,w]}reduce(f,p){return this.ops.reduce(f,p)}changeLength(){return this.reduce((f,p)=>p.insert?f+o.default.length(p):p.delete?f-p.delete:f,0)}length(){return this.reduce((f,p)=>f+o.default.length(p),0)}slice(f=0,p=1/0){const w=[],x=new a.default(this.ops);let T=0;for(;T<p&&x.hasNext();){let C;T<f?C=x.next(f-T):(C=x.next(p-T),w.push(C)),T+=o.default.length(C)}return new d(w)}compose(f){const p=new a.default(this.ops),w=new a.default(f.ops),x=[],T=w.peek();if(T!=null&&typeof T.retain=="number"&&T.attributes==null){let k=T.retain;for(;p.peekType()==="insert"&&p.peekLength()<=k;)k-=p.peekLength(),x.push(p.next());T.retain-k>0&&w.next(T.retain-k)}const C=new d(x);for(;p.hasNext()||w.hasNext();)if(w.peekType()==="insert")C.push(w.next());else if(p.peekType()==="delete")C.push(p.next());else{const k=Math.min(p.peekLength(),w.peekLength()),j=p.next(k),H=w.next(k);if(H.retain){const F={};if(typeof j.retain=="number")F.retain=typeof H.retain=="number"?k:H.retain;else if(typeof H.retain=="number")j.retain==null?F.insert=j.insert:F.retain=j.retain;else{const te=j.retain==null?"insert":"retain",[oe,be,xe]=c(j[te],H.retain),b=d.getHandler(oe);F[te]={[oe]:b.compose(be,xe,te==="retain")}}const ie=i.default.compose(j.attributes,H.attributes,typeof j.retain=="number");if(ie&&(F.attributes=ie),C.push(F),!w.hasNext()&&s(C.ops[C.ops.length-1],F)){const te=new d(p.rest());return C.concat(te).chop()}}else typeof H.delete=="number"&&(typeof j.retain=="number"||typeof j.retain=="object"&&j.retain!==null)&&C.push(H)}return C.chop()}concat(f){const p=new d(this.ops.slice());return f.ops.length>0&&(p.push(f.ops[0]),p.ops=p.ops.concat(f.ops.slice(1))),p}diff(f,p){if(this.ops===f.ops)return new d;const w=[this,f].map(j=>j.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:u;const F=j===f?"on":"with";throw new Error("diff() called "+F+" non-document")}).join("")),x=new d,T=t(w[0],w[1],p,!0),C=new a.default(this.ops),k=new a.default(f.ops);return T.forEach(j=>{let H=j[1].length;for(;H>0;){let F=0;switch(j[0]){case t.INSERT:F=Math.min(k.peekLength(),H),x.push(k.next(F));break;case t.DELETE:F=Math.min(H,C.peekLength()),C.next(F),x.delete(F);break;case t.EQUAL:F=Math.min(C.peekLength(),k.peekLength(),H);const ie=C.next(F),te=k.next(F);s(ie.insert,te.insert)?x.retain(F,i.default.diff(ie.attributes,te.attributes)):x.push(te).delete(F);break}H-=F}}),x.chop()}eachLine(f,p=`
|
|
31
|
-
`){const
|
|
32
|
-
`),o=i.shift();o.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((u,c)=>(a=a.split(u,!0),a.insertAt(0,c),c.length),t+o.length)}insertBefore(t,
|
|
33
|
-
`),i=s.pop(),o=s.map(u=>{const c=this.scroll.create(
|
|
34
|
-
`,Ze(n))}function Ze(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:Ze(n.parent,e,t)}const Ye=class Ye extends Ke{static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(Ye.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==U.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Ye.CONTENTS.length,r.optimize(),r.formatAt(s,Ye.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||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof st?this.prev:null,r=t?t.length():0,s=this.next instanceof st?this.next:null,i=s?s.text:"",{textNode:o}=this,a=o.data.split(Ye.CONTENTS).join("");o.data=Ye.CONTENTS;let u;if(t)u=t,(a||s)&&(t.insertAt(t.length(),a+i),s&&s.remove());else if(s)u=s,s.insertAt(0,a);else{const c=document.createTextNode(a);u=this.scroll.create(c),this.parent.insertBefore(u,this)}if(this.remove(),e){const c=(f,p)=>t&&f===t.domNode?p:f===o?r+p-1:s&&f===s.domNode?r+a.length+p:null,d=c(e.start.node,e.start.offset),g=c(e.end.node,e.end.offset);if(d!==null&&g!==null)return{startNode:u.domNode,startOffset:d,endNode:u.domNode,endOffset:g}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=Ye.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};$(Ye,"blotName","cursor"),$(Ye,"className","ql-cursor"),$(Ye,"tagName","span"),$(Ye,"CONTENTS","\uFEFF");let jr=Ye;var ci={exports:{}},ka;function sg(){return ka||(ka=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(u,c,d){this.fn=u,this.context=c,this.once=d||!1}function i(u,c,d,g,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,g||u,f),w=t?t+c:c;return u._events[w]?u._events[w].fn?u._events[w]=[u._events[w],p]:u._events[w].push(p):(u._events[w]=p,u._eventsCount++),u}function o(u,c){--u._eventsCount===0?u._events=new r:delete u._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],d,g;if(this._eventsCount===0)return c;for(g in d=this._events)e.call(d,g)&&c.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(c){var d=t?t+c:c,g=this._events[d];if(!g)return[];if(g.fn)return[g.fn];for(var f=0,p=g.length,w=new Array(p);f<p;f++)w[f]=g[f].fn;return w},a.prototype.listenerCount=function(c){var d=t?t+c:c,g=this._events[d];return g?g.fn?1:g.length:0},a.prototype.emit=function(c,d,g,f,p,w){var x=t?t+c:c;if(!this._events[x])return!1;var T=this._events[x],C=arguments.length,k,j;if(T.fn){switch(T.once&&this.removeListener(c,T.fn,void 0,!0),C){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,d),!0;case 3:return T.fn.call(T.context,d,g),!0;case 4:return T.fn.call(T.context,d,g,f),!0;case 5:return T.fn.call(T.context,d,g,f,p),!0;case 6:return T.fn.call(T.context,d,g,f,p,w),!0}for(j=1,k=new Array(C-1);j<C;j++)k[j-1]=arguments[j];T.fn.apply(T.context,k)}else{var H=T.length,F;for(j=0;j<H;j++)switch(T[j].once&&this.removeListener(c,T[j].fn,void 0,!0),C){case 1:T[j].fn.call(T[j].context);break;case 2:T[j].fn.call(T[j].context,d);break;case 3:T[j].fn.call(T[j].context,d,g);break;case 4:T[j].fn.call(T[j].context,d,g,f);break;default:if(!k)for(F=1,k=new Array(C-1);F<C;F++)k[F-1]=arguments[F];T[j].fn.apply(T[j].context,k)}}return!0},a.prototype.on=function(c,d,g){return i(this,c,d,g,!1)},a.prototype.once=function(c,d,g){return i(this,c,d,g,!0)},a.prototype.removeListener=function(c,d,g,f){var p=t?t+c:c;if(!this._events[p])return this;if(!d)return o(this,p),this;var w=this._events[p];if(w.fn)w.fn===d&&(!f||w.once)&&(!g||w.context===g)&&o(this,p);else{for(var x=0,T=[],C=w.length;x<C;x++)(w[x].fn!==d||f&&!w[x].once||g&&w[x].context!==g)&&T.push(w[x]);T.length?this._events[p]=T.length===1?T[0]:T:o(this,p)}return this},a.prototype.removeAllListeners=function(c){var d;return c?(d=t?t+c:c,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a}(ci)),ci.exports}var ig=sg();const og=Bs(ig),fi=new WeakMap,hi=["error","warn","log","info"];let di="warn";function Pa(n){if(di&&hi.indexOf(n)<=hi.indexOf(di)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function It(n){return hi.reduce((e,t)=>(e[t]=Pa.bind(console,t,n),e),{})}It.level=n=>{di=n},Pa.level=It.level;const gi=It("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=fi.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)})})});class B extends og{constructor(){super(),this.domListeners={},this.on("error",gi.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return gi.log.call(gi,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(e.target===o||o.contains(e.target))&&a(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}$(B,"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"}),$(B,"sources",{API:"api",SILENT:"silent",USER:"user"});const pi=It("quill:selection");class fr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class ag{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 fr(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,B.sources.USER),1)}),this.emitter.on(B.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(B.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?B.sources.SILENT:s)}catch{}})}),this.emitter.on(B.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:i,startOffset:o,endNode:a,endOffset:u}=s.range;this.setNativeRange(i,o,a,u),this.update(B.sources.SILENT)}}),this.update(B.sources.SILENT)}handleComposition(){this.emitter.on(B.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(B.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(B.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,U.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Pe){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.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&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[i,o]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&o===i.length()){const[d]=this.scroll.leaf(e+1);if(d){const[g]=this.scroll.line(e),[f]=this.scroll.line(e+1);g===f&&(i=d,o=0)}}[s,o]=i.position(o,!0);const a=document.createRange();if(t>0)return a.setStart(s,o),[i,o]=this.scroll.leaf(e+t),i==null?null:([s,o]=i.position(o,!0),a.setEnd(s,o),a.getBoundingClientRect());let u="left",c;if(s instanceof Text){if(!s.data.length)return null;o<s.data.length?(a.setStart(s,o),a.setEnd(s,o+1)):(a.setStart(s,o-1),a.setEnd(s,o),u="right"),c=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;c=i.domNode.getBoundingClientRect(),o>0&&(u="right")}return{bottom:c.top+c.height,height:c.height,left:c[u],right:c[u],top:c.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return pi.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&mi(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 r=t.map(o=>{const[a,u]=o,c=this.scroll.find(a,!0),d=c.offset(this.scroll);return u===0?d:c instanceof Pe?d+c.index(a,u):d+c.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new fr(i,s-i)}normalizeNative(e){if(!mi(this.root,e.startContainer)||!e.collapsed&&!mi(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(r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i}),t}rangeToNative(e){const t=this.scroll.length(),r=(s,i)=>{s=Math.min(t-1,s);const[o,a]=this.scroll.leaf(s);return o?o.position(a,i):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(pi.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const o=document.getSelection();if(o!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||i||e!==a.startContainer||t!==a.startOffset||r!==a.endContainer||s!==a.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const u=document.createRange();u.setStart(e,t),u.setEnd(r,s),o.removeAllRanges(),o.addRange(u)}}else o.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.sources.API;if(typeof t=="string"&&(r=t,t=!1),pi.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!ni(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[B.events.SELECTION_CHANGE,_r(this.lastRange),_r(t),e];this.emitter.emit(B.events.EDITOR_CHANGE,...i),e!==B.sources.SILENT&&this.emitter.emit(...i)}}}function mi(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const lg=/^[ -~]*$/;let ug=class{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=ja(e),s=new M;return fg(r.ops.slice()).reduce((o,a)=>{const u=Ge.Op.length(a);let c=a.attributes||{},d=!1,g=!1;if(a.insert!=null){if(s.retain(u),typeof a.insert=="string"){const w=a.insert;g=!w.endsWith(`
|
|
35
|
-
`)&&(t<=o||!!this.scroll.descendant(
|
|
36
|
-
`&&(d=!0):
|
|
22
|
+
<%s key={someKey} {...props} />`,z,G,J,G),_[G+z]=!0)}if(G=null,j!==void 0&&(n(j),G=""+j),a(P)&&(n(P.key),G=""+P.key),"key"in P){j={};for(var re in P)re!=="key"&&(j[re]=P[re])}else j=P;return G&&u(j,typeof T=="function"?T.displayName||T.name||"Unknown":T),d(T,G,te,D,i(),j,ue,Z)}function h(T){typeof T=="object"&&T!==null&&T.$$typeof===y&&T._store&&(T._store.validated=1)}var p=pe,y=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),V=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),b=Symbol.for("react.client.reference"),N=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,x=Object.prototype.hasOwnProperty,q=Array.isArray,m=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(T){return T()}};var w,O={},k=p["react-stack-bottom-frame"].bind(p,o)(),R=m(s(o)),_={};Sn.Fragment=A,Sn.jsx=function(T,P,j,z,D){var te=1e4>N.recentlyCreatedOwnerStacks++;return g(T,P,j,!1,z,D,te?Error("react-stack-top-frame"):k,te?m(s(T)):R)},Sn.jsxs=function(T,P,j,z,D){var te=1e4>N.recentlyCreatedOwnerStacks++;return g(T,P,j,!0,z,D,te?Error("react-stack-top-frame"):k,te?m(s(T)):R)}}(),Sn}var vo;function Au(){if(vo)return gr.exports;vo=1;var r={};return r.NODE_ENV==="production"?gr.exports=Eu():gr.exports=xu(),gr.exports}var ge=Au(),wo=typeof global=="object"&&global&&global.Object===Object&&global,Tu=typeof self=="object"&&self&&self.Object===Object&&self,Je=wo||Tu||Function("return this")(),wt=Je.Symbol,Eo=Object.prototype,Ou=Eo.hasOwnProperty,Su=Eo.toString,Nn=wt?wt.toStringTag:void 0;function Nu(r){var e=Ou.call(r,Nn),t=r[Nn];try{r[Nn]=void 0;var n=!0}catch{}var s=Su.call(r);return n&&(e?r[Nn]=t:delete r[Nn]),s}var Lu=Object.prototype,Cu=Lu.toString;function _u(r){return Cu.call(r)}var Ru="[object Null]",qu="[object Undefined]",xo=wt?wt.toStringTag:void 0;function Gt(r){return r==null?r===void 0?qu:Ru:xo&&xo in Object(r)?Nu(r):_u(r)}function ut(r){return r!=null&&typeof r=="object"}var _t=Array.isArray;function Et(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function Ao(r){return r}var ku="[object AsyncFunction]",Iu="[object Function]",Pu="[object GeneratorFunction]",ju="[object Proxy]";function ys(r){if(!Et(r))return!1;var e=Gt(r);return e==Iu||e==Pu||e==ku||e==ju}var vs=Je["__core-js_shared__"],To=function(){var r=/[^.]+$/.exec(vs&&vs.keys&&vs.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Bu(r){return!!To&&To in r}var $u=Function.prototype,Mu=$u.toString;function Rt(r){if(r!=null){try{return Mu.call(r)}catch{}try{return r+""}catch{}}return""}var Du=/[\\^$.*+?()[\]{}|]/g,Uu=/^\[object .+?Constructor\]$/,Fu=Function.prototype,Hu=Object.prototype,zu=Fu.toString,Vu=Hu.hasOwnProperty,Ku=RegExp("^"+zu.call(Vu).replace(Du,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gu(r){if(!Et(r)||Bu(r))return!1;var e=ys(r)?Ku:Uu;return e.test(Rt(r))}function Wu(r,e){return r==null?void 0:r[e]}function qt(r,e){var t=Wu(r,e);return Gu(t)?t:void 0}var ws=qt(Je,"WeakMap"),Oo=Object.create,Zu=function(){function r(){}return function(e){if(!Et(e))return{};if(Oo)return Oo(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function Xu(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function Yu(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var Ju=800,Qu=16,ec=Date.now;function tc(r){var e=0,t=0;return function(){var n=ec(),s=Qu-(n-t);if(t=n,s>0){if(++e>=Ju)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}function nc(r){return function(){return r}}var pr=function(){try{var r=qt(Object,"defineProperty");return r({},"",{}),r}catch{}}(),rc=pr?function(r,e){return pr(r,"toString",{configurable:!0,enumerable:!1,value:nc(e),writable:!0})}:Ao,sc=tc(rc);function ic(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var oc=9007199254740991,ac=/^(?:0|[1-9]\d*)$/;function So(r,e){var t=typeof r;return e=e??oc,!!e&&(t=="number"||t!="symbol"&&ac.test(r))&&r>-1&&r%1==0&&r<e}function Es(r,e,t){e=="__proto__"&&pr?pr(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}function Ln(r,e){return r===e||r!==r&&e!==e}var lc=Object.prototype,uc=lc.hasOwnProperty;function No(r,e,t){var n=r[e];(!(uc.call(r,e)&&Ln(n,t))||t===void 0&&!(e in r))&&Es(r,e,t)}function cc(r,e,t,n){var s=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],u=void 0;u===void 0&&(u=r[a]),s?Es(t,a,u):No(t,a,u)}return t}var Lo=Math.max;function hc(r,e,t){return e=Lo(e===void 0?r.length-1:e,0),function(){for(var n=arguments,s=-1,i=Lo(n.length-e,0),o=Array(i);++s<i;)o[s]=n[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=n[s];return a[e]=t(o),Xu(r,this,a)}}function fc(r,e){return sc(hc(r,e,Ao),r+"")}var dc=9007199254740991;function Co(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=dc}function mr(r){return r!=null&&Co(r.length)&&!ys(r)}function gc(r,e,t){if(!Et(t))return!1;var n=typeof e;return(n=="number"?mr(t)&&So(e,t.length):n=="string"&&e in t)?Ln(t[e],r):!1}function pc(r){return fc(function(e,t){var n=-1,s=t.length,i=s>1?t[s-1]:void 0,o=s>2?t[2]:void 0;for(i=r.length>3&&typeof i=="function"?(s--,i):void 0,o&&gc(t[0],t[1],o)&&(i=s<3?void 0:i,s=1),e=Object(e);++n<s;){var a=t[n];a&&r(e,a,n,i)}return e})}var mc=Object.prototype;function xs(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||mc;return r===t}function bc(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var yc="[object Arguments]";function _o(r){return ut(r)&&Gt(r)==yc}var Ro=Object.prototype,vc=Ro.hasOwnProperty,wc=Ro.propertyIsEnumerable,As=_o(function(){return arguments}())?_o:function(r){return ut(r)&&vc.call(r,"callee")&&!wc.call(r,"callee")};function Ec(){return!1}var qo=typeof Q=="object"&&Q&&!Q.nodeType&&Q,ko=qo&&typeof module=="object"&&module&&!module.nodeType&&module,xc=ko&&ko.exports===qo,Io=xc?Je.Buffer:void 0,Ac=Io?Io.isBuffer:void 0,Cn=Ac||Ec,Tc="[object Arguments]",Oc="[object Array]",Sc="[object Boolean]",Nc="[object Date]",Lc="[object Error]",Cc="[object Function]",_c="[object Map]",Rc="[object Number]",qc="[object Object]",kc="[object RegExp]",Ic="[object Set]",Pc="[object String]",jc="[object WeakMap]",Bc="[object ArrayBuffer]",$c="[object DataView]",Mc="[object Float32Array]",Dc="[object Float64Array]",Uc="[object Int8Array]",Fc="[object Int16Array]",Hc="[object Int32Array]",zc="[object Uint8Array]",Vc="[object Uint8ClampedArray]",Kc="[object Uint16Array]",Gc="[object Uint32Array]",fe={};fe[Mc]=fe[Dc]=fe[Uc]=fe[Fc]=fe[Hc]=fe[zc]=fe[Vc]=fe[Kc]=fe[Gc]=!0,fe[Tc]=fe[Oc]=fe[Bc]=fe[Sc]=fe[$c]=fe[Nc]=fe[Lc]=fe[Cc]=fe[_c]=fe[Rc]=fe[qc]=fe[kc]=fe[Ic]=fe[Pc]=fe[jc]=!1;function Wc(r){return ut(r)&&Co(r.length)&&!!fe[Gt(r)]}function Ts(r){return function(e){return r(e)}}var Po=typeof Q=="object"&&Q&&!Q.nodeType&&Q,_n=Po&&typeof module=="object"&&module&&!module.nodeType&&module,Zc=_n&&_n.exports===Po,Os=Zc&&wo.process,Wt=function(){try{var r=_n&&_n.require&&_n.require("util").types;return r||Os&&Os.binding&&Os.binding("util")}catch{}}(),jo=Wt&&Wt.isTypedArray,Ss=jo?Ts(jo):Wc,Xc=Object.prototype,Yc=Xc.hasOwnProperty;function Bo(r,e){var t=_t(r),n=!t&&As(r),s=!t&&!n&&Cn(r),i=!t&&!n&&!s&&Ss(r),o=t||n||s||i,a=o?bc(r.length,String):[],u=a.length;for(var c in r)(e||Yc.call(r,c))&&!(o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||So(c,u)))&&a.push(c);return a}function $o(r,e){return function(t){return r(e(t))}}var Jc=$o(Object.keys,Object),Qc=Object.prototype,eh=Qc.hasOwnProperty;function th(r){if(!xs(r))return Jc(r);var e=[];for(var t in Object(r))eh.call(r,t)&&t!="constructor"&&e.push(t);return e}function nh(r){return mr(r)?Bo(r):th(r)}function rh(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var sh=Object.prototype,ih=sh.hasOwnProperty;function oh(r){if(!Et(r))return rh(r);var e=xs(r),t=[];for(var n in r)n=="constructor"&&(e||!ih.call(r,n))||t.push(n);return t}function Mo(r){return mr(r)?Bo(r,!0):oh(r)}var Rn=qt(Object,"create");function ah(){this.__data__=Rn?Rn(null):{},this.size=0}function lh(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var uh="__lodash_hash_undefined__",ch=Object.prototype,hh=ch.hasOwnProperty;function fh(r){var e=this.__data__;if(Rn){var t=e[r];return t===uh?void 0:t}return hh.call(e,r)?e[r]:void 0}var dh=Object.prototype,gh=dh.hasOwnProperty;function ph(r){var e=this.__data__;return Rn?e[r]!==void 0:gh.call(e,r)}var mh="__lodash_hash_undefined__";function bh(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Rn&&e===void 0?mh:e,this}function kt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}kt.prototype.clear=ah,kt.prototype.delete=lh,kt.prototype.get=fh,kt.prototype.has=ph,kt.prototype.set=bh;function yh(){this.__data__=[],this.size=0}function br(r,e){for(var t=r.length;t--;)if(Ln(r[t][0],e))return t;return-1}var vh=Array.prototype,wh=vh.splice;function Eh(r){var e=this.__data__,t=br(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():wh.call(e,t,1),--this.size,!0}function xh(r){var e=this.__data__,t=br(e,r);return t<0?void 0:e[t][1]}function Ah(r){return br(this.__data__,r)>-1}function Th(r,e){var t=this.__data__,n=br(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}function ct(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}ct.prototype.clear=yh,ct.prototype.delete=Eh,ct.prototype.get=xh,ct.prototype.has=Ah,ct.prototype.set=Th;var qn=qt(Je,"Map");function Oh(){this.size=0,this.__data__={hash:new kt,map:new(qn||ct),string:new kt}}function Sh(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function yr(r,e){var t=r.__data__;return Sh(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Nh(r){var e=yr(this,r).delete(r);return this.size-=e?1:0,e}function Lh(r){return yr(this,r).get(r)}function Ch(r){return yr(this,r).has(r)}function _h(r,e){var t=yr(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}function It(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}It.prototype.clear=Oh,It.prototype.delete=Nh,It.prototype.get=Lh,It.prototype.has=Ch,It.prototype.set=_h;function Rh(r,e){for(var t=-1,n=e.length,s=r.length;++t<n;)r[s+t]=e[t];return r}var Do=$o(Object.getPrototypeOf,Object),qh="[object Object]",kh=Function.prototype,Ih=Object.prototype,Uo=kh.toString,Ph=Ih.hasOwnProperty,jh=Uo.call(Object);function Bh(r){if(!ut(r)||Gt(r)!=qh)return!1;var e=Do(r);if(e===null)return!0;var t=Ph.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Uo.call(t)==jh}function $h(){this.__data__=new ct,this.size=0}function Mh(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function Dh(r){return this.__data__.get(r)}function Uh(r){return this.__data__.has(r)}var Fh=200;function Hh(r,e){var t=this.__data__;if(t instanceof ct){var n=t.__data__;if(!qn||n.length<Fh-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new It(n)}return t.set(r,e),this.size=t.size,this}function Qe(r){var e=this.__data__=new ct(r);this.size=e.size}Qe.prototype.clear=$h,Qe.prototype.delete=Mh,Qe.prototype.get=Dh,Qe.prototype.has=Uh,Qe.prototype.set=Hh;var Fo=typeof Q=="object"&&Q&&!Q.nodeType&&Q,Ho=Fo&&typeof module=="object"&&module&&!module.nodeType&&module,zh=Ho&&Ho.exports===Fo,zo=zh?Je.Buffer:void 0,Vo=zo?zo.allocUnsafe:void 0;function Ko(r,e){if(e)return r.slice();var t=r.length,n=Vo?Vo(t):new r.constructor(t);return r.copy(n),n}function Vh(r,e){for(var t=-1,n=r==null?0:r.length,s=0,i=[];++t<n;){var o=r[t];e(o,t,r)&&(i[s++]=o)}return i}function Kh(){return[]}var Gh=Object.prototype,Wh=Gh.propertyIsEnumerable,Go=Object.getOwnPropertySymbols,Zh=Go?function(r){return r==null?[]:(r=Object(r),Vh(Go(r),function(e){return Wh.call(r,e)}))}:Kh;function Xh(r,e,t){var n=e(r);return _t(r)?n:Rh(n,t(r))}function Ns(r){return Xh(r,nh,Zh)}var Ls=qt(Je,"DataView"),Cs=qt(Je,"Promise"),_s=qt(Je,"Set"),Wo="[object Map]",Yh="[object Object]",Zo="[object Promise]",Xo="[object Set]",Yo="[object WeakMap]",Jo="[object DataView]",Jh=Rt(Ls),Qh=Rt(qn),ef=Rt(Cs),tf=Rt(_s),nf=Rt(ws),De=Gt;(Ls&&De(new Ls(new ArrayBuffer(1)))!=Jo||qn&&De(new qn)!=Wo||Cs&&De(Cs.resolve())!=Zo||_s&&De(new _s)!=Xo||ws&&De(new ws)!=Yo)&&(De=function(r){var e=Gt(r),t=e==Yh?r.constructor:void 0,n=t?Rt(t):"";if(n)switch(n){case Jh:return Jo;case Qh:return Wo;case ef:return Zo;case tf:return Xo;case nf:return Yo}return e});var rf=Object.prototype,sf=rf.hasOwnProperty;function of(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&sf.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var vr=Je.Uint8Array;function Rs(r){var e=new r.constructor(r.byteLength);return new vr(e).set(new vr(r)),e}function af(r,e){var t=Rs(r.buffer);return new r.constructor(t,r.byteOffset,r.byteLength)}var lf=/\w*$/;function uf(r){var e=new r.constructor(r.source,lf.exec(r));return e.lastIndex=r.lastIndex,e}var Qo=wt?wt.prototype:void 0,ea=Qo?Qo.valueOf:void 0;function cf(r){return ea?Object(ea.call(r)):{}}function ta(r,e){var t=e?Rs(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var hf="[object Boolean]",ff="[object Date]",df="[object Map]",gf="[object Number]",pf="[object RegExp]",mf="[object Set]",bf="[object String]",yf="[object Symbol]",vf="[object ArrayBuffer]",wf="[object DataView]",Ef="[object Float32Array]",xf="[object Float64Array]",Af="[object Int8Array]",Tf="[object Int16Array]",Of="[object Int32Array]",Sf="[object Uint8Array]",Nf="[object Uint8ClampedArray]",Lf="[object Uint16Array]",Cf="[object Uint32Array]";function _f(r,e,t){var n=r.constructor;switch(e){case vf:return Rs(r);case hf:case ff:return new n(+r);case wf:return af(r);case Ef:case xf:case Af:case Tf:case Of:case Sf:case Nf:case Lf:case Cf:return ta(r,t);case df:return new n;case gf:case bf:return new n(r);case pf:return uf(r);case mf:return new n;case yf:return cf(r)}}function na(r){return typeof r.constructor=="function"&&!xs(r)?Zu(Do(r)):{}}var Rf="[object Map]";function qf(r){return ut(r)&&De(r)==Rf}var ra=Wt&&Wt.isMap,kf=ra?Ts(ra):qf,If="[object Set]";function Pf(r){return ut(r)&&De(r)==If}var sa=Wt&&Wt.isSet,jf=sa?Ts(sa):Pf,Bf=1,ia="[object Arguments]",$f="[object Array]",Mf="[object Boolean]",Df="[object Date]",Uf="[object Error]",oa="[object Function]",Ff="[object GeneratorFunction]",Hf="[object Map]",zf="[object Number]",aa="[object Object]",Vf="[object RegExp]",Kf="[object Set]",Gf="[object String]",Wf="[object Symbol]",Zf="[object WeakMap]",Xf="[object ArrayBuffer]",Yf="[object DataView]",Jf="[object Float32Array]",Qf="[object Float64Array]",ed="[object Int8Array]",td="[object Int16Array]",nd="[object Int32Array]",rd="[object Uint8Array]",sd="[object Uint8ClampedArray]",id="[object Uint16Array]",od="[object Uint32Array]",he={};he[ia]=he[$f]=he[Xf]=he[Yf]=he[Mf]=he[Df]=he[Jf]=he[Qf]=he[ed]=he[td]=he[nd]=he[Hf]=he[zf]=he[aa]=he[Vf]=he[Kf]=he[Gf]=he[Wf]=he[rd]=he[sd]=he[id]=he[od]=!0,he[Uf]=he[oa]=he[Zf]=!1;function wr(r,e,t,n,s,i){var o,a=e&Bf;if(o!==void 0)return o;if(!Et(r))return r;var u=_t(r);if(u)o=of(r);else{var c=De(r),d=c==oa||c==Ff;if(Cn(r))return Ko(r,a);if(c==aa||c==ia||d&&!s)o=d?{}:na(r);else{if(!he[c])return s?r:{};o=_f(r,c,a)}}i||(i=new Qe);var g=i.get(r);if(g)return g;i.set(r,o),jf(r)?r.forEach(function(y){o.add(wr(y,e,t,y,r,i))}):kf(r)&&r.forEach(function(y,E){o.set(E,wr(y,e,t,E,r,i))});var h=Ns,p=u?void 0:h(r);return ic(p||r,function(y,E){p&&(E=y,y=r[E]),No(o,E,wr(y,e,t,E,r,i))}),o}var ad=1,ld=4;function Zt(r){return wr(r,ad|ld)}var ud="__lodash_hash_undefined__";function cd(r){return this.__data__.set(r,ud),this}function hd(r){return this.__data__.has(r)}function Er(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new It;++e<t;)this.add(r[e])}Er.prototype.add=Er.prototype.push=cd,Er.prototype.has=hd;function fd(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}function dd(r,e){return r.has(e)}var gd=1,pd=2;function la(r,e,t,n,s,i){var o=t&gd,a=r.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=i.get(r),d=i.get(e);if(c&&d)return c==e&&d==r;var g=-1,h=!0,p=t&pd?new Er:void 0;for(i.set(r,e),i.set(e,r);++g<a;){var y=r[g],E=e[g];if(n)var A=o?n(E,y,g,e,r,i):n(y,E,g,r,e,i);if(A!==void 0){if(A)continue;h=!1;break}if(p){if(!fd(e,function(C,I){if(!dd(p,I)&&(y===C||s(y,C,t,n,i)))return p.push(I)})){h=!1;break}}else if(!(y===E||s(y,E,t,n,i))){h=!1;break}}return i.delete(r),i.delete(e),h}function md(r){var e=-1,t=Array(r.size);return r.forEach(function(n,s){t[++e]=[s,n]}),t}function bd(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var yd=1,vd=2,wd="[object Boolean]",Ed="[object Date]",xd="[object Error]",Ad="[object Map]",Td="[object Number]",Od="[object RegExp]",Sd="[object Set]",Nd="[object String]",Ld="[object Symbol]",Cd="[object ArrayBuffer]",_d="[object DataView]",ua=wt?wt.prototype:void 0,qs=ua?ua.valueOf:void 0;function Rd(r,e,t,n,s,i,o){switch(t){case _d:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Cd:return!(r.byteLength!=e.byteLength||!i(new vr(r),new vr(e)));case wd:case Ed:case Td:return Ln(+r,+e);case xd:return r.name==e.name&&r.message==e.message;case Od:case Nd:return r==e+"";case Ad:var a=md;case Sd:var u=n&yd;if(a||(a=bd),r.size!=e.size&&!u)return!1;var c=o.get(r);if(c)return c==e;n|=vd,o.set(r,e);var d=la(a(r),a(e),n,s,i,o);return o.delete(r),d;case Ld:if(qs)return qs.call(r)==qs.call(e)}return!1}var qd=1,kd=Object.prototype,Id=kd.hasOwnProperty;function Pd(r,e,t,n,s,i){var o=t&qd,a=Ns(r),u=a.length,c=Ns(e),d=c.length;if(u!=d&&!o)return!1;for(var g=u;g--;){var h=a[g];if(!(o?h in e:Id.call(e,h)))return!1}var p=i.get(r),y=i.get(e);if(p&&y)return p==e&&y==r;var E=!0;i.set(r,e),i.set(e,r);for(var A=o;++g<u;){h=a[g];var C=r[h],I=e[h];if(n)var B=o?n(I,C,h,e,r,i):n(C,I,h,r,e,i);if(!(B===void 0?C===I||s(C,I,t,n,i):B)){E=!1;break}A||(A=h=="constructor")}if(E&&!A){var V=r.constructor,H=e.constructor;V!=H&&"constructor"in r&&"constructor"in e&&!(typeof V=="function"&&V instanceof V&&typeof H=="function"&&H instanceof H)&&(E=!1)}return i.delete(r),i.delete(e),E}var jd=1,ca="[object Arguments]",ha="[object Array]",xr="[object Object]",Bd=Object.prototype,fa=Bd.hasOwnProperty;function $d(r,e,t,n,s,i){var o=_t(r),a=_t(e),u=o?ha:De(r),c=a?ha:De(e);u=u==ca?xr:u,c=c==ca?xr:c;var d=u==xr,g=c==xr,h=u==c;if(h&&Cn(r)){if(!Cn(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Qe),o||Ss(r)?la(r,e,t,n,s,i):Rd(r,e,u,t,n,s,i);if(!(t&jd)){var p=d&&fa.call(r,"__wrapped__"),y=g&&fa.call(e,"__wrapped__");if(p||y){var E=p?r.value():r,A=y?e.value():e;return i||(i=new Qe),s(E,A,t,n,i)}}return h?(i||(i=new Qe),Pd(r,e,t,n,s,i)):!1}function da(r,e,t,n,s){return r===e?!0:r==null||e==null||!ut(r)&&!ut(e)?r!==r&&e!==e:$d(r,e,t,n,da,s)}function Md(r){return function(e,t,n){for(var s=-1,i=Object(e),o=n(e),a=o.length;a--;){var u=o[++s];if(t(i[u],u,i)===!1)break}return e}}var Dd=Md();function ks(r,e,t){(t!==void 0&&!Ln(r[e],t)||t===void 0&&!(e in r))&&Es(r,e,t)}function Ud(r){return ut(r)&&mr(r)}function Is(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}function Fd(r){return cc(r,Mo(r))}function Hd(r,e,t,n,s,i,o){var a=Is(r,t),u=Is(e,t),c=o.get(u);if(c){ks(r,t,c);return}var d=i?i(a,u,t+"",r,e,o):void 0,g=d===void 0;if(g){var h=_t(u),p=!h&&Cn(u),y=!h&&!p&&Ss(u);d=u,h||p||y?_t(a)?d=a:Ud(a)?d=Yu(a):p?(g=!1,d=Ko(u,!0)):y?(g=!1,d=ta(u,!0)):d=[]:Bh(u)||As(u)?(d=a,As(a)?d=Fd(a):(!Et(a)||ys(a))&&(d=na(u))):g=!1}g&&(o.set(u,d),s(d,u,n,i,o),o.delete(u)),ks(r,t,d)}function ga(r,e,t,n,s){r!==e&&Dd(e,function(i,o){if(s||(s=new Qe),Et(i))Hd(r,e,o,t,ga,n,s);else{var a=n?n(Is(r,o),i,o+"",r,e,s):void 0;a===void 0&&(a=i),ks(r,o,a)}},Mo)}function Ps(r,e){return da(r,e)}var xt=pc(function(r,e,t){ga(r,e,t)}),F=(r=>(r[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",r))(F||{});class et{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const s=F.TYPE&F.ATTRIBUTE;this.scope=n.scope!=null?n.scope&F.LEVEL|s:F.ATTRIBUTE,n.whitelist!=null&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?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 Xt extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const pa=class go{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)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(e,t,n){const s=this.query(t);if(s==null)throw new Xt(`Unable to create ${t} blot`);const i=s,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(n),a=new i(e,o,n);return go.blots.set(a.domNode,a),a}find(e,t=!1){return go.find(e,t)}query(e,t=F.ANY){let n;return typeof e=="string"?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:typeof e=="number"?e&F.LEVEL&F.BLOCK?n=this.types.block:e&F.LEVEL&F.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(n=this.classes[s],!!n)),n=n||this.tags[e.tagName]),n==null?null:"scope"in n&&t&F.LEVEL&n.scope&&t&F.TYPE&n.scope?n:null}register(...e){return e.map(t=>{const n="blotName"in t,s="attrName"in t;if(!n&&!s)throw new Xt("Invalid definition");if(n&&t.blotName==="abstract")throw new Xt("Cannot register abstract class");const i=n?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):n&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(o=>o.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(o=>{(this.tags[o]==null||t.className==null)&&(this.tags[o]=t)}))),t})}};pa.blots=new WeakMap;let Yt=pa;function ma(r,e){return(r.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class zd extends et{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){ma(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(ma(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Ue=zd;function js(r){const e=r.split("-"),t=e.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("");return e[0]+t}class Vd extends et{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[js(this.keyName)]=t,!0):!1}remove(e){e.style[js(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[js(this.keyName)];return this.canAdd(e,t)?t:""}}const At=Vd;class Kd{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Yt.find(this.domNode);if(e==null)return;const t=et.keys(this.domNode),n=Ue.keys(this.domNode),s=At.keys(this.domNode);t.concat(n).concat(s).forEach(i=>{const o=e.scroll.query(i,F.ATTRIBUTE);o instanceof et&&(this.attributes[o.attrName]=o)})}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(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const Ar=Kd,ba=class{constructor(e,t){this.scroll=e,this.domNode=t,Yt.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Xt("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?(typeof e=="string"?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof e=="number"&&(n=e),typeof n=="number"?t=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?t=document.createElement(n):t=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(){this.parent!=null&&this.parent.removeChild(this),Yt.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,s){const i=this.isolate(e,t);if(this.scroll.query(n,F.BLOT)!=null&&s)i.wrap(n,s);else if(this.scroll.query(n,F.ATTRIBUTE)!=null){const o=this.scroll.create(this.statics.scope);i.wrap(o),o.format(n,s)}}insertAt(e,t,n){const s=n==null?this.scroll.create("text",t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const n=this.split(e);if(n==null)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return this.parent==null||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(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new Xt(`Cannot wrap ${e}`);return n.appendChild(this),n}};ba.blotName="abstract";let ya=ba;const va=class extends ya{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}}};va.scope=F.INLINE_BLOT;const xe=va;class Gd{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(),s=0;for(;n;){if(n===e)return s;s+=1,n=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(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(;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(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 e!=null&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let s=n();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=n()}return[null,0]}forEach(e){const t=this.iterator();let n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;const[s,i]=this.find(e);let o=e-i;const a=this.iterator(s);let u=a();for(;u&&o<e+t;){const c=u.length();e>o?n(u,e-o,Math.min(t,o+c-e)):n(u,0,Math.min(c,e+t-o)),o+=c,u=a()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let s=n();for(;s;)t=e(t,s),s=n();return t}}function wa(r,e){const t=e.find(r);if(t)return t;try{return e.create(r)}catch{const n=e.create(F.INLINE);return Array.from(r.childNodes).forEach(s=>{n.domNode.appendChild(s)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const Ea=class Ct extends ya{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(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Ct.uiClass&&this.uiNode.classList.add(Ct.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Gd,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=wa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof Xt)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(n,s,i)=>{n.deleteAt(s,i)})}descendant(e,t=0){const[n,s]=this.children.find(t);return e.blotName==null&&e(n)||e.blotName!=null&&n instanceof e?[n,s]:n instanceof Ct?n.descendant(e,s):[null,-1]}descendants(e,t=0,n=Number.MAX_VALUE){let s=[],i=n;return this.children.forEachAt(t,n,(o,a,u)=>{(e.blotName==null&&e(o)||e.blotName!=null&&o instanceof e)&&s.push(o),o instanceof Ct&&(s=s.concat(o.descendants(e,a,i))),i-=u}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(n=>t instanceof n)||(t.statics.scope===F.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof Ct?t.unwrap():t.remove())})}formatAt(e,t,n,s){this.children.forEachAt(e,t,(i,o,a)=>{i.formatAt(o,a,n,s)})}insertAt(e,t,n){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,n);else{const o=n==null?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(o)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(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(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[n,s]=this.children.find(e,t),i=[[this,e]];return n instanceof Ct?i.concat(n.path(s,t)):(n!=null&&i.push([n,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;return n instanceof Ct&&this.moveChildren(n),super.replaceWith(n)}split(e,t=!1){if(!t){if(e===0)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(),(s,i,o)=>{const a=s.split(i,t);a!=null&&n.appendChild(a)}),n}splitAfter(e){const t=this.clone();for(;e.next!=null;)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=[],s=[];e.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(n.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),n.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=wa(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};Ea.uiClass="";const Fe=Ea;function Wd(r,e){if(Object.keys(r).length!==Object.keys(e).length)return!1;for(const t in r)if(r[t]!==e[t])return!1;return!0}const Jt=class Tn extends Fe{static create(e){return super.create(e)}static formats(e,t){const n=t.query(Tn.blotName);if(!(n!=null&&e.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ar(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(n=>{n instanceof Tn||(n=n.wrap(Tn.blotName,!0)),this.attributes.copy(n)}),this.unwrap();else{const n=this.scroll.query(e,F.INLINE);if(n==null)return;n instanceof et?this.attributes.attribute(n,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,s){this.formats()[n]!=null||this.scroll.query(n,F.ATTRIBUTE)?this.isolate(e,t).format(n,s):super.formatAt(e,t,n,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const n=this.next;n instanceof Tn&&n.prev===this&&Wd(t,n.formats())&&(n.moveChildren(this),n.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(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}wrap(e,t){const n=super.wrap(e,t);return n instanceof Tn&&this.attributes.move(n),n}};Jt.allowedChildren=[Jt,xe],Jt.blotName="inline",Jt.scope=F.INLINE_BLOT,Jt.tagName="SPAN";const Bs=Jt,Qt=class po extends Fe{static create(e){return super.create(e)}static formats(e,t){const n=t.query(po.blotName);if(!(n!=null&&e.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ar(this.domNode)}format(e,t){const n=this.scroll.query(e,F.BLOCK);n!=null&&(n instanceof et?this.attributes.attribute(n,t):e===this.statics.blotName&&!t?this.replaceWith(po.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,s){this.scroll.query(n,F.BLOCK)!=null?this.format(n,s):super.formatAt(e,t,n,s)}insertAt(e,t,n){if(n==null||this.scroll.query(t,F.INLINE)!=null)super.insertAt(e,t,n);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,n);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}};Qt.blotName="block",Qt.scope=F.BLOCK_BLOT,Qt.tagName="P",Qt.allowedChildren=[Bs,Qt,xe];const kn=Qt,$s=class extends Fe{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,s){super.formatAt(e,t,n,s),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};$s.blotName="container",$s.scope=F.BLOCK_BLOT;const Tr=$s;class Zd extends xe{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,s){e===0&&t===this.length()?this.format(n,s):super.formatAt(e,t,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ke=Zd,Xd={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Yd=100,en=class extends Fe{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(n=>{this.update(n)}),this.observer.observe(this.domNode,Xd),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=F.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(n=>{n.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,s){this.update(),super.formatAt(e,t,n,s)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(u,c=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(n.has(u.domNode)||n.set(u.domNode,[]),c&&i(u.parent))},o=u=>{n.has(u.domNode)&&(u instanceof Fe&&u.children.forEach(o),n.delete(u.domNode),u.optimize(t))};let a=e;for(let u=0;a.length>0;u+=1){if(u>=Yd)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(c=>{const d=this.find(c.target,!0);d!=null&&(d.domNode===c.target&&(c.type==="childList"?(i(this.find(c.previousSibling,!1)),Array.from(c.addedNodes).forEach(g=>{const h=this.find(g,!1);i(h,!1),h instanceof Fe&&h.children.forEach(p=>{i(p,!1)})})):c.type==="attributes"&&i(d.prev)),i(d))}),this.children.forEach(o),a=Array.from(this.observer.takeRecords()),s=a.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map(s=>{const i=this.find(s.target,!0);return i==null?null:n.has(i.domNode)?(n.get(i.domNode).push(s),null):(n.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&n.has(s.domNode)&&s.update(n.get(s.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};en.blotName="scroll",en.defaultChild=kn,en.allowedChildren=[kn,Tr],en.scope=F.BLOCK_BLOT,en.tagName="DIV";const Ms=en,Ds=class vu extends xe{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){n==null?(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(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof vu&&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(e===0)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(n=>n.type==="characterData"&&n.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ds.blotName="text",Ds.scope=F.INLINE_BLOT;const Or=Ds,Jd=Object.freeze(Object.defineProperty({__proto__:null,Attributor:et,AttributorStore:Ar,BlockBlot:kn,ClassAttributor:Ue,ContainerBlot:Tr,EmbedBlot:ke,InlineBlot:Bs,LeafBlot:xe,ParentBlot:Fe,Registry:Yt,Scope:F,ScrollBlot:Ms,StyleAttributor:At,TextBlot:Or},Symbol.toStringTag,{value:"Module"}));var Sr={exports:{}},Us,xa;function Qd(){if(xa)return Us;xa=1;var r=-1,e=1,t=0;function n(b,N,x,q,m){if(b===N)return b?[[t,b]]:[];if(x!=null){var w=ae(b,N,x);if(w)return w}var O=a(b,N),k=b.substring(0,O);b=b.substring(O),N=N.substring(O),O=c(b,N);var R=b.substring(b.length-O);b=b.substring(0,b.length-O),N=N.substring(0,N.length-O);var _=s(b,N);return k&&_.unshift([t,k]),R&&_.push([t,R]),I(_,m),q&&g(_),_}function s(b,N){var x;if(!b)return[[e,N]];if(!N)return[[r,b]];var q=b.length>N.length?b:N,m=b.length>N.length?N:b,w=q.indexOf(m);if(w!==-1)return x=[[e,q.substring(0,w)],[t,m],[e,q.substring(w+m.length)]],b.length>N.length&&(x[0][0]=x[2][0]=r),x;if(m.length===1)return[[r,b],[e,N]];var O=d(b,N);if(O){var k=O[0],R=O[1],_=O[2],T=O[3],P=O[4],j=n(k,_),z=n(R,T);return j.concat([[t,P]],z)}return i(b,N)}function i(b,N){for(var x=b.length,q=N.length,m=Math.ceil((x+q)/2),w=m,O=2*m,k=new Array(O),R=new Array(O),_=0;_<O;_++)k[_]=-1,R[_]=-1;k[w+1]=0,R[w+1]=0;for(var T=x-q,P=T%2!==0,j=0,z=0,D=0,te=0,ue=0;ue<m;ue++){for(var Z=-ue+j;Z<=ue-z;Z+=2){var G=w+Z,J;Z===-ue||Z!==ue&&k[G-1]<k[G+1]?J=k[G+1]:J=k[G-1]+1;for(var re=J-Z;J<x&&re<q&&b.charAt(J)===N.charAt(re);)J++,re++;if(k[G]=J,J>x)z+=2;else if(re>q)j+=2;else if(P){var oe=w+T-Z;if(oe>=0&&oe<O&&R[oe]!==-1){var ce=x-R[oe];if(J>=ce)return o(b,N,J,re)}}}for(var me=-ue+D;me<=ue-te;me+=2){var oe=w+me,ce;me===-ue||me!==ue&&R[oe-1]<R[oe+1]?ce=R[oe+1]:ce=R[oe-1]+1;for(var Oe=ce-me;ce<x&&Oe<q&&b.charAt(x-ce-1)===N.charAt(q-Oe-1);)ce++,Oe++;if(R[oe]=ce,ce>x)te+=2;else if(Oe>q)D+=2;else if(!P){var G=w+T-me;if(G>=0&&G<O&&k[G]!==-1){var J=k[G],re=w+J-G;if(ce=x-ce,J>=ce)return o(b,N,J,re)}}}}return[[r,b],[e,N]]}function o(b,N,x,q){var m=b.substring(0,x),w=N.substring(0,q),O=b.substring(x),k=N.substring(q),R=n(m,w),_=n(O,k);return R.concat(_)}function a(b,N){if(!b||!N||b.charAt(0)!==N.charAt(0))return 0;for(var x=0,q=Math.min(b.length,N.length),m=q,w=0;x<m;)b.substring(w,m)==N.substring(w,m)?(x=m,w=x):q=m,m=Math.floor((q-x)/2+x);return B(b.charCodeAt(m-1))&&m--,m}function u(b,N){var x=b.length,q=N.length;if(x==0||q==0)return 0;x>q?b=b.substring(x-q):x<q&&(N=N.substring(0,x));var m=Math.min(x,q);if(b==N)return m;for(var w=0,O=1;;){var k=b.substring(m-O),R=N.indexOf(k);if(R==-1)return w;O+=R,(R==0||b.substring(m-O)==N.substring(0,O))&&(w=O,O++)}}function c(b,N){if(!b||!N||b.slice(-1)!==N.slice(-1))return 0;for(var x=0,q=Math.min(b.length,N.length),m=q,w=0;x<m;)b.substring(b.length-m,b.length-w)==N.substring(N.length-m,N.length-w)?(x=m,w=x):q=m,m=Math.floor((q-x)/2+x);return V(b.charCodeAt(b.length-m))&&m--,m}function d(b,N){var x=b.length>N.length?b:N,q=b.length>N.length?N:b;if(x.length<4||q.length*2<x.length)return null;function m(z,D,te){for(var ue=z.substring(te,te+Math.floor(z.length/4)),Z=-1,G="",J,re,oe,ce;(Z=D.indexOf(ue,Z+1))!==-1;){var me=a(z.substring(te),D.substring(Z)),Oe=c(z.substring(0,te),D.substring(0,Z));G.length<Oe+me&&(G=D.substring(Z-Oe,Z)+D.substring(Z,Z+me),J=z.substring(0,te-Oe),re=z.substring(te+me),oe=D.substring(0,Z-Oe),ce=D.substring(Z+me))}return G.length*2>=z.length?[J,re,oe,ce,G]:null}var w=m(x,q,Math.ceil(x.length/4)),O=m(x,q,Math.ceil(x.length/2)),k;if(!w&&!O)return null;O?w?k=w[4].length>O[4].length?w:O:k=O:k=w;var R,_,T,P;b.length>N.length?(R=k[0],_=k[1],T=k[2],P=k[3]):(T=k[0],P=k[1],R=k[2],_=k[3]);var j=k[4];return[R,_,T,P,j]}function g(b){for(var N=!1,x=[],q=0,m=null,w=0,O=0,k=0,R=0,_=0;w<b.length;)b[w][0]==t?(x[q++]=w,O=R,k=_,R=0,_=0,m=b[w][1]):(b[w][0]==e?R+=b[w][1].length:_+=b[w][1].length,m&&m.length<=Math.max(O,k)&&m.length<=Math.max(R,_)&&(b.splice(x[q-1],0,[r,m]),b[x[q-1]+1][0]=e,q--,q--,w=q>0?x[q-1]:-1,O=0,k=0,R=0,_=0,m=null,N=!0)),w++;for(N&&I(b),C(b),w=1;w<b.length;){if(b[w-1][0]==r&&b[w][0]==e){var T=b[w-1][1],P=b[w][1],j=u(T,P),z=u(P,T);j>=z?(j>=T.length/2||j>=P.length/2)&&(b.splice(w,0,[t,P.substring(0,j)]),b[w-1][1]=T.substring(0,T.length-j),b[w+1][1]=P.substring(j),w++):(z>=T.length/2||z>=P.length/2)&&(b.splice(w,0,[t,T.substring(0,z)]),b[w-1][0]=e,b[w-1][1]=P.substring(0,P.length-z),b[w+1][0]=r,b[w+1][1]=T.substring(z),w++),w++}w++}}var h=/[^a-zA-Z0-9]/,p=/\s/,y=/[\r\n]/,E=/\n\r?\n$/,A=/^\r?\n\r?\n/;function C(b){function N(z,D){if(!z||!D)return 6;var te=z.charAt(z.length-1),ue=D.charAt(0),Z=te.match(h),G=ue.match(h),J=Z&&te.match(p),re=G&&ue.match(p),oe=J&&te.match(y),ce=re&&ue.match(y),me=oe&&z.match(E),Oe=ce&&D.match(A);return me||Oe?5:oe||ce?4:Z&&!J&&re?3:J||re?2:Z||G?1:0}for(var x=1;x<b.length-1;){if(b[x-1][0]==t&&b[x+1][0]==t){var q=b[x-1][1],m=b[x][1],w=b[x+1][1],O=c(q,m);if(O){var k=m.substring(m.length-O);q=q.substring(0,q.length-O),m=k+m.substring(0,m.length-O),w=k+w}for(var R=q,_=m,T=w,P=N(q,m)+N(m,w);m.charAt(0)===w.charAt(0);){q+=m.charAt(0),m=m.substring(1)+w.charAt(0),w=w.substring(1);var j=N(q,m)+N(m,w);j>=P&&(P=j,R=q,_=m,T=w)}b[x-1][1]!=R&&(R?b[x-1][1]=R:(b.splice(x-1,1),x--),b[x][1]=_,T?b[x+1][1]=T:(b.splice(x+1,1),x--))}x++}}function I(b,N){b.push([t,""]);for(var x=0,q=0,m=0,w="",O="",k;x<b.length;){if(x<b.length-1&&!b[x][1]){b.splice(x,1);continue}switch(b[x][0]){case e:m++,O+=b[x][1],x++;break;case r:q++,w+=b[x][1],x++;break;case t:var R=x-m-q-1;if(N){if(R>=0&&ee(b[R][1])){var _=b[R][1].slice(-1);if(b[R][1]=b[R][1].slice(0,-1),w=_+w,O=_+O,!b[R][1]){b.splice(R,1),x--;var T=R-1;b[T]&&b[T][0]===e&&(m++,O=b[T][1]+O,T--),b[T]&&b[T][0]===r&&(q++,w=b[T][1]+w,T--),R=T}}if(H(b[x][1])){var _=b[x][1].charAt(0);b[x][1]=b[x][1].slice(1),w+=_,O+=_}}if(x<b.length-1&&!b[x][1]){b.splice(x,1);break}if(w.length>0||O.length>0){w.length>0&&O.length>0&&(k=a(O,w),k!==0&&(R>=0?b[R][1]+=O.substring(0,k):(b.splice(0,0,[t,O.substring(0,k)]),x++),O=O.substring(k),w=w.substring(k)),k=c(O,w),k!==0&&(b[x][1]=O.substring(O.length-k)+b[x][1],O=O.substring(0,O.length-k),w=w.substring(0,w.length-k)));var P=m+q;w.length===0&&O.length===0?(b.splice(x-P,P),x=x-P):w.length===0?(b.splice(x-P,P,[e,O]),x=x-P+1):O.length===0?(b.splice(x-P,P,[r,w]),x=x-P+1):(b.splice(x-P,P,[r,w],[e,O]),x=x-P+2)}x!==0&&b[x-1][0]===t?(b[x-1][1]+=b[x][1],b.splice(x,1)):x++,m=0,q=0,w="",O="";break}}b[b.length-1][1]===""&&b.pop();var j=!1;for(x=1;x<b.length-1;)b[x-1][0]===t&&b[x+1][0]===t&&(b[x][1].substring(b[x][1].length-b[x-1][1].length)===b[x-1][1]?(b[x][1]=b[x-1][1]+b[x][1].substring(0,b[x][1].length-b[x-1][1].length),b[x+1][1]=b[x-1][1]+b[x+1][1],b.splice(x-1,1),j=!0):b[x][1].substring(0,b[x+1][1].length)==b[x+1][1]&&(b[x-1][1]+=b[x+1][1],b[x][1]=b[x][1].substring(b[x+1][1].length)+b[x+1][1],b.splice(x+1,1),j=!0)),x++;j&&I(b,N)}function B(b){return b>=55296&&b<=56319}function V(b){return b>=56320&&b<=57343}function H(b){return V(b.charCodeAt(0))}function ee(b){return B(b.charCodeAt(b.length-1))}function Y(b){for(var N=[],x=0;x<b.length;x++)b[x][1].length>0&&N.push(b[x]);return N}function ne(b,N,x,q){return ee(b)||H(q)?null:Y([[t,b],[r,N],[e,x],[t,q]])}function ae(b,N,x){var q=typeof x=="number"?{index:x,length:0}:x.oldRange,m=typeof x=="number"?null:x.newRange,w=b.length,O=N.length;if(q.length===0&&(m===null||m.length===0)){var k=q.index,R=b.slice(0,k),_=b.slice(k),T=m?m.index:null;e:{var P=k+O-w;if(T!==null&&T!==P||P<0||P>O)break e;var j=N.slice(0,P),z=N.slice(P);if(z!==_)break e;var D=Math.min(k,P),te=R.slice(0,D),ue=j.slice(0,D);if(te!==ue)break e;var Z=R.slice(D),G=j.slice(D);return ne(te,Z,G,_)}e:{if(T!==null&&T!==k)break e;var J=k,j=N.slice(0,J),z=N.slice(J);if(j!==R)break e;var re=Math.min(w-J,O-J),oe=_.slice(_.length-re),ce=z.slice(z.length-re);if(oe!==ce)break e;var Z=_.slice(0,_.length-re),G=z.slice(0,z.length-re);return ne(R,Z,G,oe)}}if(q.length>0&&m&&m.length===0)e:{var te=b.slice(0,q.index),oe=b.slice(q.index+q.length),D=te.length,re=oe.length;if(O<D+re)break e;var ue=N.slice(0,D),ce=N.slice(O-re);if(te!==ue||oe!==ce)break e;var Z=b.slice(D,w-re),G=N.slice(D,O-re);return ne(te,Z,G,oe)}return null}function de(b,N,x,q){return n(b,N,x,q,!0)}return de.INSERT=e,de.DELETE=r,de.EQUAL=t,Us=de,Us}var In={exports:{}};In.exports;var Aa;function Ta(){return Aa||(Aa=1,function(r,e){var t=200,n="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Function]",g="[object GeneratorFunction]",h="[object Map]",p="[object Number]",y="[object Object]",E="[object Promise]",A="[object RegExp]",C="[object Set]",I="[object String]",B="[object Symbol]",V="[object WeakMap]",H="[object ArrayBuffer]",ee="[object DataView]",Y="[object Float32Array]",ne="[object Float64Array]",ae="[object Int8Array]",de="[object Int16Array]",b="[object Int32Array]",N="[object Uint8Array]",x="[object Uint8ClampedArray]",q="[object Uint16Array]",m="[object Uint32Array]",w=/[\\^$.*+?()[\]{}|]/g,O=/\w*$/,k=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,_={};_[i]=_[o]=_[H]=_[ee]=_[a]=_[u]=_[Y]=_[ne]=_[ae]=_[de]=_[b]=_[h]=_[p]=_[y]=_[A]=_[C]=_[I]=_[B]=_[N]=_[x]=_[q]=_[m]=!0,_[c]=_[d]=_[V]=!1;var T=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,P=typeof self=="object"&&self&&self.Object===Object&&self,j=T||P||Function("return this")(),z=e&&!e.nodeType&&e,D=z&&!0&&r&&!r.nodeType&&r,te=D&&D.exports===z;function ue(l,f){return l.set(f[0],f[1]),l}function Z(l,f){return l.add(f),l}function G(l,f){for(var v=-1,S=l?l.length:0;++v<S&&f(l[v],v,l)!==!1;);return l}function J(l,f){for(var v=-1,S=f.length,X=l.length;++v<S;)l[X+v]=f[v];return l}function re(l,f,v,S){for(var X=-1,K=l?l.length:0;++X<K;)v=f(v,l[X],X,l);return v}function oe(l,f){for(var v=-1,S=Array(l);++v<l;)S[v]=f(v);return S}function ce(l,f){return l==null?void 0:l[f]}function me(l){var f=!1;if(l!=null&&typeof l.toString!="function")try{f=!!(l+"")}catch{}return f}function Oe(l){var f=-1,v=Array(l.size);return l.forEach(function(S,X){v[++f]=[X,S]}),v}function Jn(l,f){return function(v){return l(f(v))}}function Yr(l){var f=-1,v=Array(l.size);return l.forEach(function(S){v[++f]=S}),v}var Si=Array.prototype,Ni=Function.prototype,dn=Object.prototype,Qn=j["__core-js_shared__"],Jr=function(){var l=/[^.]+$/.exec(Qn&&Qn.keys&&Qn.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Qr=Ni.toString,it=dn.hasOwnProperty,gn=dn.toString,Li=RegExp("^"+Qr.call(it).replace(w,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dt=te?j.Buffer:void 0,pn=j.Symbol,er=j.Uint8Array,Me=Jn(Object.getPrototypeOf,Object),es=Object.create,ts=dn.propertyIsEnumerable,Ci=Si.splice,tr=Object.getOwnPropertySymbols,mn=Dt?Dt.isBuffer:void 0,ns=Jn(Object.keys,Object),bn=Xe(j,"DataView"),Ut=Xe(j,"Map"),Ze=Xe(j,"Promise"),yn=Xe(j,"Set"),nr=Xe(j,"WeakMap"),Ft=Xe(Object,"create"),rr=Ce(bn),Ht=Ce(Ut),sr=Ce(Ze),ir=Ce(yn),or=Ce(nr),Nt=pn?pn.prototype:void 0,rs=Nt?Nt.valueOf:void 0;function pt(l){var f=-1,v=l?l.length:0;for(this.clear();++f<v;){var S=l[f];this.set(S[0],S[1])}}function _i(){this.__data__=Ft?Ft(null):{}}function Ri(l){return this.has(l)&&delete this.__data__[l]}function qi(l){var f=this.__data__;if(Ft){var v=f[l];return v===n?void 0:v}return it.call(f,l)?f[l]:void 0}function ss(l){var f=this.__data__;return Ft?f[l]!==void 0:it.call(f,l)}function ar(l,f){var v=this.__data__;return v[l]=Ft&&f===void 0?n:f,this}pt.prototype.clear=_i,pt.prototype.delete=Ri,pt.prototype.get=qi,pt.prototype.has=ss,pt.prototype.set=ar;function we(l){var f=-1,v=l?l.length:0;for(this.clear();++f<v;){var S=l[f];this.set(S[0],S[1])}}function ki(){this.__data__=[]}function Ii(l){var f=this.__data__,v=wn(f,l);if(v<0)return!1;var S=f.length-1;return v==S?f.pop():Ci.call(f,v,1),!0}function Pi(l){var f=this.__data__,v=wn(f,l);return v<0?void 0:f[v][1]}function ji(l){return wn(this.__data__,l)>-1}function Bi(l,f){var v=this.__data__,S=wn(v,l);return S<0?v.push([l,f]):v[S][1]=f,this}we.prototype.clear=ki,we.prototype.delete=Ii,we.prototype.get=Pi,we.prototype.has=ji,we.prototype.set=Bi;function Se(l){var f=-1,v=l?l.length:0;for(this.clear();++f<v;){var S=l[f];this.set(S[0],S[1])}}function $i(){this.__data__={hash:new pt,map:new(Ut||we),string:new pt}}function Mi(l){return Vt(this,l).delete(l)}function Di(l){return Vt(this,l).get(l)}function Ui(l){return Vt(this,l).has(l)}function Fi(l,f){return Vt(this,l).set(l,f),this}Se.prototype.clear=$i,Se.prototype.delete=Mi,Se.prototype.get=Di,Se.prototype.has=Ui,Se.prototype.set=Fi;function Re(l){this.__data__=new we(l)}function Hi(){this.__data__=new we}function zi(l){return this.__data__.delete(l)}function Vi(l){return this.__data__.get(l)}function Ki(l){return this.__data__.has(l)}function Gi(l,f){var v=this.__data__;if(v instanceof we){var S=v.__data__;if(!Ut||S.length<t-1)return S.push([l,f]),this;v=this.__data__=new Se(S)}return v.set(l,f),this}Re.prototype.clear=Hi,Re.prototype.delete=zi,Re.prototype.get=Vi,Re.prototype.has=Ki,Re.prototype.set=Gi;function vn(l,f){var v=hr(l)||xn(l)?oe(l.length,String):[],S=v.length,X=!!S;for(var K in l)it.call(l,K)&&!(X&&(K=="length"||ao(K,S)))&&v.push(K);return v}function is(l,f,v){var S=l[f];(!(it.call(l,f)&&cs(S,v))||v===void 0&&!(f in l))&&(l[f]=v)}function wn(l,f){for(var v=l.length;v--;)if(cs(l[v][0],f))return v;return-1}function ot(l,f){return l&&cr(f,dr(f),l)}function lr(l,f,v,S,X,K,ie){var se;if(S&&(se=K?S(l,X,K,ie):S(l)),se!==void 0)return se;if(!lt(l))return l;var be=hr(l);if(be){if(se=io(l),!f)return no(l,se)}else{var le=bt(l),Ne=le==d||le==g;if(hs(l))return En(l,f);if(le==y||le==i||Ne&&!K){if(me(l))return K?l:{};if(se=at(Ne?{}:l),!f)return ro(l,ot(se,l))}else{if(!_[le])return K?l:{};se=oo(l,le,lr,f)}}ie||(ie=new Re);var qe=ie.get(l);if(qe)return qe;if(ie.set(l,se),!be)var ye=v?so(l):dr(l);return G(ye||l,function(Le,Ee){ye&&(Ee=Le,Le=l[Ee]),is(se,Ee,lr(Le,f,v,S,Ee,l,ie))}),se}function Wi(l){return lt(l)?es(l):{}}function Zi(l,f,v){var S=f(l);return hr(l)?S:J(S,v(l))}function Xi(l){return gn.call(l)}function Yi(l){if(!lt(l)||uo(l))return!1;var f=fr(l)||me(l)?Li:k;return f.test(Ce(l))}function Ji(l){if(!ls(l))return ns(l);var f=[];for(var v in Object(l))it.call(l,v)&&v!="constructor"&&f.push(v);return f}function En(l,f){if(f)return l.slice();var v=new l.constructor(l.length);return l.copy(v),v}function ur(l){var f=new l.constructor(l.byteLength);return new er(f).set(new er(l)),f}function zt(l,f){var v=f?ur(l.buffer):l.buffer;return new l.constructor(v,l.byteOffset,l.byteLength)}function os(l,f,v){var S=f?v(Oe(l),!0):Oe(l);return re(S,ue,new l.constructor)}function as(l){var f=new l.constructor(l.source,O.exec(l));return f.lastIndex=l.lastIndex,f}function Qi(l,f,v){var S=f?v(Yr(l),!0):Yr(l);return re(S,Z,new l.constructor)}function eo(l){return rs?Object(rs.call(l)):{}}function to(l,f){var v=f?ur(l.buffer):l.buffer;return new l.constructor(v,l.byteOffset,l.length)}function no(l,f){var v=-1,S=l.length;for(f||(f=Array(S));++v<S;)f[v]=l[v];return f}function cr(l,f,v,S){v||(v={});for(var X=-1,K=f.length;++X<K;){var ie=f[X],se=void 0;is(v,ie,se===void 0?l[ie]:se)}return v}function ro(l,f){return cr(l,mt(l),f)}function so(l){return Zi(l,dr,mt)}function Vt(l,f){var v=l.__data__;return lo(f)?v[typeof f=="string"?"string":"hash"]:v.map}function Xe(l,f){var v=ce(l,f);return Yi(v)?v:void 0}var mt=tr?Jn(tr,Object):ho,bt=Xi;(bn&&bt(new bn(new ArrayBuffer(1)))!=ee||Ut&&bt(new Ut)!=h||Ze&&bt(Ze.resolve())!=E||yn&&bt(new yn)!=C||nr&&bt(new nr)!=V)&&(bt=function(l){var f=gn.call(l),v=f==y?l.constructor:void 0,S=v?Ce(v):void 0;if(S)switch(S){case rr:return ee;case Ht:return h;case sr:return E;case ir:return C;case or:return V}return f});function io(l){var f=l.length,v=l.constructor(f);return f&&typeof l[0]=="string"&&it.call(l,"index")&&(v.index=l.index,v.input=l.input),v}function at(l){return typeof l.constructor=="function"&&!ls(l)?Wi(Me(l)):{}}function oo(l,f,v,S){var X=l.constructor;switch(f){case H:return ur(l);case a:case u:return new X(+l);case ee:return zt(l,S);case Y:case ne:case ae:case de:case b:case N:case x:case q:case m:return to(l,S);case h:return os(l,S,v);case p:case I:return new X(l);case A:return as(l);case C:return Qi(l,S,v);case B:return eo(l)}}function ao(l,f){return f=f??s,!!f&&(typeof l=="number"||R.test(l))&&l>-1&&l%1==0&&l<f}function lo(l){var f=typeof l;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?l!=="__proto__":l===null}function uo(l){return!!Jr&&Jr in l}function ls(l){var f=l&&l.constructor,v=typeof f=="function"&&f.prototype||dn;return l===v}function Ce(l){if(l!=null){try{return Qr.call(l)}catch{}try{return l+""}catch{}}return""}function us(l){return lr(l,!0,!0)}function cs(l,f){return l===f||l!==l&&f!==f}function xn(l){return co(l)&&it.call(l,"callee")&&(!ts.call(l,"callee")||gn.call(l)==i)}var hr=Array.isArray;function An(l){return l!=null&&fs(l.length)&&!fr(l)}function co(l){return ds(l)&&An(l)}var hs=mn||fo;function fr(l){var f=lt(l)?gn.call(l):"";return f==d||f==g}function fs(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=s}function lt(l){var f=typeof l;return!!l&&(f=="object"||f=="function")}function ds(l){return!!l&&typeof l=="object"}function dr(l){return An(l)?vn(l):Ji(l)}function ho(){return[]}function fo(){return!1}r.exports=us}(In,In.exports)),In.exports}var Pn={exports:{}};Pn.exports;var Oa;function Sa(){return Oa||(Oa=1,function(r,e){var t=200,n="__lodash_hash_undefined__",s=1,i=2,o=9007199254740991,a="[object Arguments]",u="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",g="[object Date]",h="[object Error]",p="[object Function]",y="[object GeneratorFunction]",E="[object Map]",A="[object Number]",C="[object Null]",I="[object Object]",B="[object Promise]",V="[object Proxy]",H="[object RegExp]",ee="[object Set]",Y="[object String]",ne="[object Symbol]",ae="[object Undefined]",de="[object WeakMap]",b="[object ArrayBuffer]",N="[object DataView]",x="[object Float32Array]",q="[object Float64Array]",m="[object Int8Array]",w="[object Int16Array]",O="[object Int32Array]",k="[object Uint8Array]",R="[object Uint8ClampedArray]",_="[object Uint16Array]",T="[object Uint32Array]",P=/[\\^$.*+?()[\]{}|]/g,j=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,D={};D[x]=D[q]=D[m]=D[w]=D[O]=D[k]=D[R]=D[_]=D[T]=!0,D[a]=D[u]=D[b]=D[d]=D[N]=D[g]=D[h]=D[p]=D[E]=D[A]=D[I]=D[H]=D[ee]=D[Y]=D[de]=!1;var te=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,ue=typeof self=="object"&&self&&self.Object===Object&&self,Z=te||ue||Function("return this")(),G=e&&!e.nodeType&&e,J=G&&!0&&r&&!r.nodeType&&r,re=J&&J.exports===G,oe=re&&te.process,ce=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),me=ce&&ce.isTypedArray;function Oe(l,f){for(var v=-1,S=l==null?0:l.length,X=0,K=[];++v<S;){var ie=l[v];f(ie,v,l)&&(K[X++]=ie)}return K}function Jn(l,f){for(var v=-1,S=f.length,X=l.length;++v<S;)l[X+v]=f[v];return l}function Yr(l,f){for(var v=-1,S=l==null?0:l.length;++v<S;)if(f(l[v],v,l))return!0;return!1}function Si(l,f){for(var v=-1,S=Array(l);++v<l;)S[v]=f(v);return S}function Ni(l){return function(f){return l(f)}}function dn(l,f){return l.has(f)}function Qn(l,f){return l==null?void 0:l[f]}function Jr(l){var f=-1,v=Array(l.size);return l.forEach(function(S,X){v[++f]=[X,S]}),v}function Qr(l,f){return function(v){return l(f(v))}}function it(l){var f=-1,v=Array(l.size);return l.forEach(function(S){v[++f]=S}),v}var gn=Array.prototype,Li=Function.prototype,Dt=Object.prototype,pn=Z["__core-js_shared__"],er=Li.toString,Me=Dt.hasOwnProperty,es=function(){var l=/[^.]+$/.exec(pn&&pn.keys&&pn.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),ts=Dt.toString,Ci=RegExp("^"+er.call(Me).replace(P,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tr=re?Z.Buffer:void 0,mn=Z.Symbol,ns=Z.Uint8Array,bn=Dt.propertyIsEnumerable,Ut=gn.splice,Ze=mn?mn.toStringTag:void 0,yn=Object.getOwnPropertySymbols,nr=tr?tr.isBuffer:void 0,Ft=Qr(Object.keys,Object),rr=mt(Z,"DataView"),Ht=mt(Z,"Map"),sr=mt(Z,"Promise"),ir=mt(Z,"Set"),or=mt(Z,"WeakMap"),Nt=mt(Object,"create"),rs=Ce(rr),pt=Ce(Ht),_i=Ce(sr),Ri=Ce(ir),qi=Ce(or),ss=mn?mn.prototype:void 0,ar=ss?ss.valueOf:void 0;function we(l){var f=-1,v=l==null?0:l.length;for(this.clear();++f<v;){var S=l[f];this.set(S[0],S[1])}}function ki(){this.__data__=Nt?Nt(null):{},this.size=0}function Ii(l){var f=this.has(l)&&delete this.__data__[l];return this.size-=f?1:0,f}function Pi(l){var f=this.__data__;if(Nt){var v=f[l];return v===n?void 0:v}return Me.call(f,l)?f[l]:void 0}function ji(l){var f=this.__data__;return Nt?f[l]!==void 0:Me.call(f,l)}function Bi(l,f){var v=this.__data__;return this.size+=this.has(l)?0:1,v[l]=Nt&&f===void 0?n:f,this}we.prototype.clear=ki,we.prototype.delete=Ii,we.prototype.get=Pi,we.prototype.has=ji,we.prototype.set=Bi;function Se(l){var f=-1,v=l==null?0:l.length;for(this.clear();++f<v;){var S=l[f];this.set(S[0],S[1])}}function $i(){this.__data__=[],this.size=0}function Mi(l){var f=this.__data__,v=En(f,l);if(v<0)return!1;var S=f.length-1;return v==S?f.pop():Ut.call(f,v,1),--this.size,!0}function Di(l){var f=this.__data__,v=En(f,l);return v<0?void 0:f[v][1]}function Ui(l){return En(this.__data__,l)>-1}function Fi(l,f){var v=this.__data__,S=En(v,l);return S<0?(++this.size,v.push([l,f])):v[S][1]=f,this}Se.prototype.clear=$i,Se.prototype.delete=Mi,Se.prototype.get=Di,Se.prototype.has=Ui,Se.prototype.set=Fi;function Re(l){var f=-1,v=l==null?0:l.length;for(this.clear();++f<v;){var S=l[f];this.set(S[0],S[1])}}function Hi(){this.size=0,this.__data__={hash:new we,map:new(Ht||Se),string:new we}}function zi(l){var f=Xe(this,l).delete(l);return this.size-=f?1:0,f}function Vi(l){return Xe(this,l).get(l)}function Ki(l){return Xe(this,l).has(l)}function Gi(l,f){var v=Xe(this,l),S=v.size;return v.set(l,f),this.size+=v.size==S?0:1,this}Re.prototype.clear=Hi,Re.prototype.delete=zi,Re.prototype.get=Vi,Re.prototype.has=Ki,Re.prototype.set=Gi;function vn(l){var f=-1,v=l==null?0:l.length;for(this.__data__=new Re;++f<v;)this.add(l[f])}function is(l){return this.__data__.set(l,n),this}function wn(l){return this.__data__.has(l)}vn.prototype.add=vn.prototype.push=is,vn.prototype.has=wn;function ot(l){var f=this.__data__=new Se(l);this.size=f.size}function lr(){this.__data__=new Se,this.size=0}function Wi(l){var f=this.__data__,v=f.delete(l);return this.size=f.size,v}function Zi(l){return this.__data__.get(l)}function Xi(l){return this.__data__.has(l)}function Yi(l,f){var v=this.__data__;if(v instanceof Se){var S=v.__data__;if(!Ht||S.length<t-1)return S.push([l,f]),this.size=++v.size,this;v=this.__data__=new Re(S)}return v.set(l,f),this.size=v.size,this}ot.prototype.clear=lr,ot.prototype.delete=Wi,ot.prototype.get=Zi,ot.prototype.has=Xi,ot.prototype.set=Yi;function Ji(l,f){var v=xn(l),S=!v&&cs(l),X=!v&&!S&&An(l),K=!v&&!S&&!X&&ds(l),ie=v||S||X||K,se=ie?Si(l.length,String):[],be=se.length;for(var le in l)Me.call(l,le)&&!(ie&&(le=="length"||X&&(le=="offset"||le=="parent")||K&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||oo(le,be)))&&se.push(le);return se}function En(l,f){for(var v=l.length;v--;)if(us(l[v][0],f))return v;return-1}function ur(l,f,v){var S=f(l);return xn(l)?S:Jn(S,v(l))}function zt(l){return l==null?l===void 0?ae:C:Ze&&Ze in Object(l)?bt(l):ls(l)}function os(l){return lt(l)&&zt(l)==a}function as(l,f,v,S,X){return l===f?!0:l==null||f==null||!lt(l)&&!lt(f)?l!==l&&f!==f:Qi(l,f,v,S,as,X)}function Qi(l,f,v,S,X,K){var ie=xn(l),se=xn(f),be=ie?u:at(l),le=se?u:at(f);be=be==a?I:be,le=le==a?I:le;var Ne=be==I,qe=le==I,ye=be==le;if(ye&&An(l)){if(!An(f))return!1;ie=!0,Ne=!1}if(ye&&!Ne)return K||(K=new ot),ie||ds(l)?cr(l,f,v,S,X,K):ro(l,f,be,v,S,X,K);if(!(v&s)){var Le=Ne&&Me.call(l,"__wrapped__"),Ee=qe&&Me.call(f,"__wrapped__");if(Le||Ee){var Lt=Le?l.value():l,yt=Ee?f.value():f;return K||(K=new ot),X(Lt,yt,v,S,K)}}return ye?(K||(K=new ot),so(l,f,v,S,X,K)):!1}function eo(l){if(!fs(l)||lo(l))return!1;var f=hs(l)?Ci:j;return f.test(Ce(l))}function to(l){return lt(l)&&fr(l.length)&&!!D[zt(l)]}function no(l){if(!uo(l))return Ft(l);var f=[];for(var v in Object(l))Me.call(l,v)&&v!="constructor"&&f.push(v);return f}function cr(l,f,v,S,X,K){var ie=v&s,se=l.length,be=f.length;if(se!=be&&!(ie&&be>se))return!1;var le=K.get(l);if(le&&K.get(f))return le==f;var Ne=-1,qe=!0,ye=v&i?new vn:void 0;for(K.set(l,f),K.set(f,l);++Ne<se;){var Le=l[Ne],Ee=f[Ne];if(S)var Lt=ie?S(Ee,Le,Ne,f,l,K):S(Le,Ee,Ne,l,f,K);if(Lt!==void 0){if(Lt)continue;qe=!1;break}if(ye){if(!Yr(f,function(yt,Kt){if(!dn(ye,Kt)&&(Le===yt||X(Le,yt,v,S,K)))return ye.push(Kt)})){qe=!1;break}}else if(!(Le===Ee||X(Le,Ee,v,S,K))){qe=!1;break}}return K.delete(l),K.delete(f),qe}function ro(l,f,v,S,X,K,ie){switch(v){case N:if(l.byteLength!=f.byteLength||l.byteOffset!=f.byteOffset)return!1;l=l.buffer,f=f.buffer;case b:return!(l.byteLength!=f.byteLength||!K(new ns(l),new ns(f)));case d:case g:case A:return us(+l,+f);case h:return l.name==f.name&&l.message==f.message;case H:case Y:return l==f+"";case E:var se=Jr;case ee:var be=S&s;if(se||(se=it),l.size!=f.size&&!be)return!1;var le=ie.get(l);if(le)return le==f;S|=i,ie.set(l,f);var Ne=cr(se(l),se(f),S,X,K,ie);return ie.delete(l),Ne;case ne:if(ar)return ar.call(l)==ar.call(f)}return!1}function so(l,f,v,S,X,K){var ie=v&s,se=Vt(l),be=se.length,le=Vt(f),Ne=le.length;if(be!=Ne&&!ie)return!1;for(var qe=be;qe--;){var ye=se[qe];if(!(ie?ye in f:Me.call(f,ye)))return!1}var Le=K.get(l);if(Le&&K.get(f))return Le==f;var Ee=!0;K.set(l,f),K.set(f,l);for(var Lt=ie;++qe<be;){ye=se[qe];var yt=l[ye],Kt=f[ye];if(S)var yu=ie?S(Kt,yt,ye,f,l,K):S(yt,Kt,ye,l,f,K);if(!(yu===void 0?yt===Kt||X(yt,Kt,v,S,K):yu)){Ee=!1;break}Lt||(Lt=ye=="constructor")}if(Ee&&!Lt){var gs=l.constructor,ps=f.constructor;gs!=ps&&"constructor"in l&&"constructor"in f&&!(typeof gs=="function"&&gs instanceof gs&&typeof ps=="function"&&ps instanceof ps)&&(Ee=!1)}return K.delete(l),K.delete(f),Ee}function Vt(l){return ur(l,dr,io)}function Xe(l,f){var v=l.__data__;return ao(f)?v[typeof f=="string"?"string":"hash"]:v.map}function mt(l,f){var v=Qn(l,f);return eo(v)?v:void 0}function bt(l){var f=Me.call(l,Ze),v=l[Ze];try{l[Ze]=void 0;var S=!0}catch{}var X=ts.call(l);return S&&(f?l[Ze]=v:delete l[Ze]),X}var io=yn?function(l){return l==null?[]:(l=Object(l),Oe(yn(l),function(f){return bn.call(l,f)}))}:ho,at=zt;(rr&&at(new rr(new ArrayBuffer(1)))!=N||Ht&&at(new Ht)!=E||sr&&at(sr.resolve())!=B||ir&&at(new ir)!=ee||or&&at(new or)!=de)&&(at=function(l){var f=zt(l),v=f==I?l.constructor:void 0,S=v?Ce(v):"";if(S)switch(S){case rs:return N;case pt:return E;case _i:return B;case Ri:return ee;case qi:return de}return f});function oo(l,f){return f=f??o,!!f&&(typeof l=="number"||z.test(l))&&l>-1&&l%1==0&&l<f}function ao(l){var f=typeof l;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?l!=="__proto__":l===null}function lo(l){return!!es&&es in l}function uo(l){var f=l&&l.constructor,v=typeof f=="function"&&f.prototype||Dt;return l===v}function ls(l){return ts.call(l)}function Ce(l){if(l!=null){try{return er.call(l)}catch{}try{return l+""}catch{}}return""}function us(l,f){return l===f||l!==l&&f!==f}var cs=os(function(){return arguments}())?os:function(l){return lt(l)&&Me.call(l,"callee")&&!bn.call(l,"callee")},xn=Array.isArray;function hr(l){return l!=null&&fr(l.length)&&!hs(l)}var An=nr||fo;function co(l,f){return as(l,f)}function hs(l){if(!fs(l))return!1;var f=zt(l);return f==p||f==y||f==c||f==V}function fr(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=o}function fs(l){var f=typeof l;return l!=null&&(f=="object"||f=="function")}function lt(l){return l!=null&&typeof l=="object"}var ds=me?Ni(me):to;function dr(l){return hr(l)?Ji(l):no(l)}function ho(){return[]}function fo(){return!1}r.exports=co}(Pn,Pn.exports)),Pn.exports}var Nr={},Na;function eg(){if(Na)return Nr;Na=1,Object.defineProperty(Nr,"__esModule",{value:!0});const r=Ta(),e=Sa();var t;return function(n){function s(u={},c={},d=!1){typeof u!="object"&&(u={}),typeof c!="object"&&(c={});let g=r(c);d||(g=Object.keys(g).reduce((h,p)=>(g[p]!=null&&(h[p]=g[p]),h),{}));for(const h in u)u[h]!==void 0&&c[h]===void 0&&(g[h]=u[h]);return Object.keys(g).length>0?g:void 0}n.compose=s;function i(u={},c={}){typeof u!="object"&&(u={}),typeof c!="object"&&(c={});const d=Object.keys(u).concat(Object.keys(c)).reduce((g,h)=>(e(u[h],c[h])||(g[h]=c[h]===void 0?null:c[h]),g),{});return Object.keys(d).length>0?d:void 0}n.diff=i;function o(u={},c={}){u=u||{};const d=Object.keys(c).reduce((g,h)=>(c[h]!==u[h]&&u[h]!==void 0&&(g[h]=c[h]),g),{});return Object.keys(u).reduce((g,h)=>(u[h]!==c[h]&&c[h]===void 0&&(g[h]=null),g),d)}n.invert=o;function a(u,c,d=!1){if(typeof u!="object")return c;if(typeof c!="object")return;if(!d)return c;const g=Object.keys(c).reduce((h,p)=>(u[p]===void 0&&(h[p]=c[p]),h),{});return Object.keys(g).length>0?g:void 0}n.transform=a}(t||(t={})),Nr.default=t,Nr}var Lr={},La;function Ca(){if(La)return Lr;La=1,Object.defineProperty(Lr,"__esModule",{value:!0});var r;return function(e){function t(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}e.length=t}(r||(r={})),Lr.default=r,Lr}var Cr={},_a;function tg(){if(_a)return Cr;_a=1,Object.defineProperty(Cr,"__esModule",{value:!0});const r=Ca();class e{constructor(n){this.ops=n,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(n){n||(n=1/0);const s=this.ops[this.index];if(s){const i=this.offset,o=r.default.length(s);if(n>=o-i?(n=o-i,this.index+=1,this.offset=0):this.offset+=n,typeof s.delete=="number")return{delete:n};{const a={};return s.attributes&&(a.attributes=s.attributes),typeof s.retain=="number"?a.retain=n:typeof s.retain=="object"&&s.retain!==null?a.retain=s.retain:typeof s.insert=="string"?a.insert=s.insert.substr(i,n):a.insert=s.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?r.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const n=this.ops[this.index];return n?typeof n.delete=="number"?"delete":typeof n.retain=="number"||typeof n.retain=="object"&&n.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const n=this.offset,s=this.index,i=this.next(),o=this.ops.slice(this.index);return this.offset=n,this.index=s,[i].concat(o)}}else return[]}}return Cr.default=e,Cr}var Ra;function ng(){return Ra||(Ra=1,function(r,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=Qd(),n=Ta(),s=Sa(),i=eg();e.AttributeMap=i.default;const o=Ca();e.Op=o.default;const a=tg();e.OpIterator=a.default;const u="\0",c=(g,h)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(h)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(h)[0]}`);return[p,g[p],h[p]]};class d{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,p){this.handlers[h]=p}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const p=this.handlers[h];if(!p)throw new Error(`no handlers for embed type "${h}"`);return p}insert(h,p){const y={};return typeof h=="string"&&h.length===0?this:(y.insert=h,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(y.attributes=p),this.push(y))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,p){if(typeof h=="number"&&h<=0)return this;const y={retain:h};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(y.attributes=p),this.push(y)}push(h){let p=this.ops.length,y=this.ops[p-1];if(h=n(h),typeof y=="object"){if(typeof h.delete=="number"&&typeof y.delete=="number")return this.ops[p-1]={delete:y.delete+h.delete},this;if(typeof y.delete=="number"&&h.insert!=null&&(p-=1,y=this.ops[p-1],typeof y!="object"))return this.ops.unshift(h),this;if(s(h.attributes,y.attributes)){if(typeof h.insert=="string"&&typeof y.insert=="string")return this.ops[p-1]={insert:y.insert+h.insert},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof y.retain=="number")return this.ops[p-1]={retain:y.retain+h.retain},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this}}return p===this.ops.length?this.ops.push(h):this.ops.splice(p,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const p=[],y=[];return this.forEach(E=>{(h(E)?p:y).push(E)}),[p,y]}reduce(h,p){return this.ops.reduce(h,p)}changeLength(){return this.reduce((h,p)=>p.insert?h+o.default.length(p):p.delete?h-p.delete:h,0)}length(){return this.reduce((h,p)=>h+o.default.length(p),0)}slice(h=0,p=1/0){const y=[],E=new a.default(this.ops);let A=0;for(;A<p&&E.hasNext();){let C;A<h?C=E.next(h-A):(C=E.next(p-A),y.push(C)),A+=o.default.length(C)}return new d(y)}compose(h){const p=new a.default(this.ops),y=new a.default(h.ops),E=[],A=y.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let I=A.retain;for(;p.peekType()==="insert"&&p.peekLength()<=I;)I-=p.peekLength(),E.push(p.next());A.retain-I>0&&y.next(A.retain-I)}const C=new d(E);for(;p.hasNext()||y.hasNext();)if(y.peekType()==="insert")C.push(y.next());else if(p.peekType()==="delete")C.push(p.next());else{const I=Math.min(p.peekLength(),y.peekLength()),B=p.next(I),V=y.next(I);if(V.retain){const H={};if(typeof B.retain=="number")H.retain=typeof V.retain=="number"?I:V.retain;else if(typeof V.retain=="number")B.retain==null?H.insert=B.insert:H.retain=B.retain;else{const Y=B.retain==null?"insert":"retain",[ne,ae,de]=c(B[Y],V.retain),b=d.getHandler(ne);H[Y]={[ne]:b.compose(ae,de,Y==="retain")}}const ee=i.default.compose(B.attributes,V.attributes,typeof B.retain=="number");if(ee&&(H.attributes=ee),C.push(H),!y.hasNext()&&s(C.ops[C.ops.length-1],H)){const Y=new d(p.rest());return C.concat(Y).chop()}}else typeof V.delete=="number"&&(typeof B.retain=="number"||typeof B.retain=="object"&&B.retain!==null)&&C.push(V)}return C.chop()}concat(h){const p=new d(this.ops.slice());return h.ops.length>0&&(p.push(h.ops[0]),p.ops=p.ops.concat(h.ops.slice(1))),p}diff(h,p){if(this.ops===h.ops)return new d;const y=[this,h].map(B=>B.map(V=>{if(V.insert!=null)return typeof V.insert=="string"?V.insert:u;const H=B===h?"on":"with";throw new Error("diff() called "+H+" non-document")}).join("")),E=new d,A=t(y[0],y[1],p,!0),C=new a.default(this.ops),I=new a.default(h.ops);return A.forEach(B=>{let V=B[1].length;for(;V>0;){let H=0;switch(B[0]){case t.INSERT:H=Math.min(I.peekLength(),V),E.push(I.next(H));break;case t.DELETE:H=Math.min(V,C.peekLength()),C.next(H),E.delete(H);break;case t.EQUAL:H=Math.min(C.peekLength(),I.peekLength(),V);const ee=C.next(H),Y=I.next(H);s(ee.insert,Y.insert)?E.retain(H,i.default.diff(ee.attributes,Y.attributes)):E.push(Y).delete(H);break}V-=H}}),E.chop()}eachLine(h,p=`
|
|
23
|
+
`){const y=new a.default(this.ops);let E=new d,A=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const C=y.peek(),I=o.default.length(C)-y.peekLength(),B=typeof C.insert=="string"?C.insert.indexOf(p,I)-I:-1;if(B<0)E.push(y.next());else if(B>0)E.push(y.next(B));else{if(h(E,y.next(1).attributes||{},A)===!1)return;A+=1,E=new d}}E.length()>0&&h(E,{},A)}invert(h){const p=new d;return this.reduce((y,E)=>{if(E.insert)p.delete(o.default.length(E));else{if(typeof E.retain=="number"&&E.attributes==null)return p.retain(E.retain),y+E.retain;if(E.delete||typeof E.retain=="number"){const A=E.delete||E.retain;return h.slice(y,y+A).forEach(I=>{E.delete?p.push(I):E.retain&&E.attributes&&p.retain(o.default.length(I),i.default.invert(E.attributes,I.attributes))}),y+A}else if(typeof E.retain=="object"&&E.retain!==null){const A=h.slice(y,y+1),C=new a.default(A.ops).next(),[I,B,V]=c(E.retain,C.insert),H=d.getHandler(I);return p.retain({[I]:H.invert(B,V)},i.default.invert(E.attributes,C.attributes)),y+1}}return y},0),p.chop()}transform(h,p=!1){if(p=!!p,typeof h=="number")return this.transformPosition(h,p);const y=h,E=new a.default(this.ops),A=new a.default(y.ops),C=new d;for(;E.hasNext()||A.hasNext();)if(E.peekType()==="insert"&&(p||A.peekType()!=="insert"))C.retain(o.default.length(E.next()));else if(A.peekType()==="insert")C.push(A.next());else{const I=Math.min(E.peekLength(),A.peekLength()),B=E.next(I),V=A.next(I);if(B.delete)continue;if(V.delete)C.push(V);else{const H=B.retain,ee=V.retain;let Y=typeof ee=="object"&&ee!==null?ee:I;if(typeof H=="object"&&H!==null&&typeof ee=="object"&&ee!==null){const ne=Object.keys(H)[0];if(ne===Object.keys(ee)[0]){const ae=d.getHandler(ne);ae&&(Y={[ne]:ae.transform(H[ne],ee[ne],p)})}}C.retain(Y,i.default.transform(B.attributes,V.attributes,p))}}return C.chop()}transformPosition(h,p=!1){p=!!p;const y=new a.default(this.ops);let E=0;for(;y.hasNext()&&E<=h;){const A=y.peekLength(),C=y.peekType();if(y.next(),C==="delete"){h-=Math.min(A,h-E);continue}else C==="insert"&&(E<h||!p)&&(h+=A);E+=A}return h}}d.Op=o.default,d.OpIterator=a.default,d.AttributeMap=i.default,d.handlers={},e.default=d,r.exports=d,r.exports.default=d}(Sr,Sr.exports)),Sr.exports}var Ie=ng();const U=bs(Ie);class He extends ke{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}He.blotName="break",He.tagName="BR";let ze=class extends Or{};const rg={"&":"&","<":"<",">":">",'"':""","'":"'"};function _r(r){return r.replace(/[&<>"']/g,e=>rg[e])}const st=class st extends Bs{static compare(e,t){const n=st.order.indexOf(e),s=st.order.indexOf(t);return n>=0||s>=0?n-s:e===t?0:e<t?-1:1}formatAt(e,t,n,s){if(st.compare(this.statics.blotName,n)<0&&this.scroll.query(n,F.BLOT)){const i=this.isolate(e,t);s&&i.wrap(n,s)}else super.formatAt(e,t,n,s)}optimize(e){if(super.optimize(e),this.parent instanceof st&&st.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};$(st,"allowedChildren",[st,He,ke,ze]),$(st,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let tt=st;const qa=1;class ve extends kn{constructor(){super(...arguments);$(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=ka(this)),this.cache.delta}deleteAt(t,n){super.deleteAt(t,n),this.cache={}}formatAt(t,n,s,i){n<=0||(this.scroll.query(s,F.BLOCK)?t+n===this.length()&&this.format(s,i):super.formatAt(t,Math.min(n,this.length()-t-1),s,i),this.cache={})}insertAt(t,n,s){if(s!=null){super.insertAt(t,n,s),this.cache={};return}if(n.length===0)return;const i=n.split(`
|
|
24
|
+
`),o=i.shift();o.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((u,c)=>(a=a.split(u,!0),a.insertAt(0,c),c.length),t+o.length)}insertBefore(t,n){const{head:s}=this.children;super.insertBefore(t,n),s instanceof He&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+qa),this.cache.length}moveChildren(t,n){super.moveChildren(t,n),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(t===0||t>=this.length()-qa)){const i=this.clone();return t===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const s=super.split(t,n);return this.cache={},s}}ve.blotName="block",ve.tagName="P",ve.defaultChild=He,ve.allowedChildren=[He,tt,ke,ze];class Pe extends ke{attach(){super.attach(),this.attributes=new Ar(this.domNode)}delta(){return new U().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,F.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,s){this.format(n,s)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}const s=t.split(`
|
|
25
|
+
`),i=s.pop(),o=s.map(u=>{const c=this.scroll.create(ve.blotName);return c.insertAt(0,u),c}),a=this.split(e);o.forEach(u=>{this.parent.insertBefore(u,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}Pe.scope=F.BLOCK_BLOT;function ka(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(xe).reduce((t,n)=>n.length()===0?t:t.insert(n.value(),je(n,{},e)),new U).insert(`
|
|
26
|
+
`,je(r))}function je(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(e={...e,...r.formats()},t&&delete e["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?e:je(r.parent,e,t)}const $e=class $e extends ke{static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode($e.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let n=this,s=0;for(;n!=null&&n.statics.scope!==F.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=$e.CONTENTS.length,n.optimize(),n.formatAt(s,$e.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||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof ze?this.prev:null,n=t?t.length():0,s=this.next instanceof ze?this.next:null,i=s?s.text:"",{textNode:o}=this,a=o.data.split($e.CONTENTS).join("");o.data=$e.CONTENTS;let u;if(t)u=t,(a||s)&&(t.insertAt(t.length(),a+i),s&&s.remove());else if(s)u=s,s.insertAt(0,a);else{const c=document.createTextNode(a);u=this.scroll.create(c),this.parent.insertBefore(u,this)}if(this.remove(),e){const c=(h,p)=>t&&h===t.domNode?p:h===o?n+p-1:s&&h===s.domNode?n+a.length+p:null,d=c(e.start.node,e.start.offset),g=c(e.end.node,e.end.offset);if(d!==null&&g!==null)return{startNode:u.domNode,startOffset:d,endNode:u.domNode,endOffset:g}}return null}update(e,t){if(e.some(n=>n.type==="characterData"&&n.target===this.textNode)){const n=this.restore();n&&(t.range=n)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=$e.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};$($e,"blotName","cursor"),$($e,"className","ql-cursor"),$($e,"tagName","span"),$($e,"CONTENTS","\uFEFF");let tn=$e;var Fs={exports:{}},Ia;function sg(){return Ia||(Ia=1,function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function s(u,c,d){this.fn=u,this.context=c,this.once=d||!1}function i(u,c,d,g,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,g||u,h),y=t?t+c:c;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],p]:u._events[y].push(p):(u._events[y]=p,u._eventsCount++),u}function o(u,c){--u._eventsCount===0?u._events=new n:delete u._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],d,g;if(this._eventsCount===0)return c;for(g in d=this._events)e.call(d,g)&&c.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(c){var d=t?t+c:c,g=this._events[d];if(!g)return[];if(g.fn)return[g.fn];for(var h=0,p=g.length,y=new Array(p);h<p;h++)y[h]=g[h].fn;return y},a.prototype.listenerCount=function(c){var d=t?t+c:c,g=this._events[d];return g?g.fn?1:g.length:0},a.prototype.emit=function(c,d,g,h,p,y){var E=t?t+c:c;if(!this._events[E])return!1;var A=this._events[E],C=arguments.length,I,B;if(A.fn){switch(A.once&&this.removeListener(c,A.fn,void 0,!0),C){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,d),!0;case 3:return A.fn.call(A.context,d,g),!0;case 4:return A.fn.call(A.context,d,g,h),!0;case 5:return A.fn.call(A.context,d,g,h,p),!0;case 6:return A.fn.call(A.context,d,g,h,p,y),!0}for(B=1,I=new Array(C-1);B<C;B++)I[B-1]=arguments[B];A.fn.apply(A.context,I)}else{var V=A.length,H;for(B=0;B<V;B++)switch(A[B].once&&this.removeListener(c,A[B].fn,void 0,!0),C){case 1:A[B].fn.call(A[B].context);break;case 2:A[B].fn.call(A[B].context,d);break;case 3:A[B].fn.call(A[B].context,d,g);break;case 4:A[B].fn.call(A[B].context,d,g,h);break;default:if(!I)for(H=1,I=new Array(C-1);H<C;H++)I[H-1]=arguments[H];A[B].fn.apply(A[B].context,I)}}return!0},a.prototype.on=function(c,d,g){return i(this,c,d,g,!1)},a.prototype.once=function(c,d,g){return i(this,c,d,g,!0)},a.prototype.removeListener=function(c,d,g,h){var p=t?t+c:c;if(!this._events[p])return this;if(!d)return o(this,p),this;var y=this._events[p];if(y.fn)y.fn===d&&(!h||y.once)&&(!g||y.context===g)&&o(this,p);else{for(var E=0,A=[],C=y.length;E<C;E++)(y[E].fn!==d||h&&!y[E].once||g&&y[E].context!==g)&&A.push(y[E]);A.length?this._events[p]=A.length===1?A[0]:A:o(this,p)}return this},a.prototype.removeAllListeners=function(c){var d;return c?(d=t?t+c:c,this._events[d]&&o(this,d)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,r.exports=a}(Fs)),Fs.exports}var ig=sg();const og=bs(ig),Hs=new WeakMap,zs=["error","warn","log","info"];let Vs="warn";function Pa(r){if(Vs&&zs.indexOf(r)<=zs.indexOf(Vs)){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];console[r](...t)}}function ht(r){return zs.reduce((e,t)=>(e[t]=Pa.bind(console,t,r),e),{})}ht.level=r=>{Vs=r},Pa.level=ht.level;const Ks=ht("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(r=>{document.addEventListener(r,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=Hs.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)})})});class M extends og{constructor(){super(),this.domListeners={},this.on("error",Ks.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ks.log.call(Ks,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(e.target===o||o.contains(e.target))&&a(e,...n)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}$(M,"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"}),$(M,"sources",{API:"api",SILENT:"silent",USER:"user"});const Gs=ht("quill:selection");class Pt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class ag{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 Pt(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,M.sources.USER),1)}),this.emitter.on(M.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const n=this.getNativeRange();n!=null&&n.start.node!==this.cursor.textNode&&this.emitter.once(M.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(n.start.node)&&this.root.contains(n.end.node)&&this.setNativeRange(n.start.node,n.start.offset,n.end.node,n.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?M.sources.SILENT:s)}catch{}})}),this.emitter.on(M.events.SCROLL_OPTIMIZE,(n,s)=>{if(s.range){const{startNode:i,startOffset:o,endNode:a,endOffset:u}=s.range;this.setNativeRange(i,o,a,u),this.update(M.sources.SILENT)}}),this.update(M.sources.SILENT)}handleComposition(){this.emitter.on(M.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(M.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(M.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(!(n==null||!n.native.collapsed||this.scroll.query(e,F.BLOCK))){if(n.start.node!==this.cursor.textNode){const s=this.scroll.find(n.start.node,!1);if(s==null)return;if(s instanceof xe){const i=s.split(n.start.offset);s.parent.insertBefore(this.cursor,i)}else s.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&&arguments[1]!==void 0?arguments[1]:0;const n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let s,[i,o]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&o===i.length()){const[d]=this.scroll.leaf(e+1);if(d){const[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===h&&(i=d,o=0)}}[s,o]=i.position(o,!0);const a=document.createRange();if(t>0)return a.setStart(s,o),[i,o]=this.scroll.leaf(e+t),i==null?null:([s,o]=i.position(o,!0),a.setEnd(s,o),a.getBoundingClientRect());let u="left",c;if(s instanceof Text){if(!s.data.length)return null;o<s.data.length?(a.setStart(s,o),a.setEnd(s,o+1)):(a.setStart(s,o-1),a.setEnd(s,o),u="right"),c=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;c=i.domNode.getBoundingClientRect(),o>0&&(u="right")}return{bottom:c.top+c.height,height:c.height,left:c[u],right:c[u],top:c.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const n=this.normalizeNative(t);return Gs.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Ws(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(o=>{const[a,u]=o,c=this.scroll.find(a,!0),d=c.offset(this.scroll);return u===0?d:c instanceof xe?d+c.index(a,u):d+c.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new Pt(i,s-i)}normalizeNative(e){if(!Ws(this.root,e.startContainer)||!e.collapsed&&!Ws(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(n=>{let{node:s,offset:i}=n;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;n.node=s,n.offset=i}),t}rangeToNative(e){const t=this.scroll.length(),n=(s,i)=>{s=Math.min(t-1,s);const[o,a]=this.scroll.leaf(s);return o?o.position(a,i):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Gs.info("setNativeRange",e,t,n,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))return;const o=document.getSelection();if(o!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||i||e!==a.startContainer||t!==a.startOffset||n!==a.endContainer||s!==a.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&n.tagName==="BR"&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const u=document.createRange();u.setStart(e,t),u.setEnd(n,s),o.removeAllRanges(),o.addRange(u)}}else o.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;if(typeof t=="string"&&(n=t,t=!1),Gs.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const t=this.lastRange,[n,s]=this.getRange();if(this.lastRange=n,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ps(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[M.events.SELECTION_CHANGE,Zt(this.lastRange),Zt(t),e];this.emitter.emit(M.events.EDITOR_CHANGE,...i),e!==M.sources.SILENT&&this.emitter.emit(...i)}}}function Ws(r,e){try{e.parentNode}catch{return!1}return r.contains(e)}const lg=/^[ -~]*$/;let ug=class{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=ja(e),s=new U;return hg(n.ops.slice()).reduce((o,a)=>{const u=Ie.Op.length(a);let c=a.attributes||{},d=!1,g=!1;if(a.insert!=null){if(s.retain(u),typeof a.insert=="string"){const y=a.insert;g=!y.endsWith(`
|
|
27
|
+
`)&&(t<=o||!!this.scroll.descendant(Pe,o)[0]),this.scroll.insertAt(o,y);const[E,A]=this.scroll.line(o);let C=xt({},je(E));if(E instanceof ve){const[I]=E.descendant(xe,A);I&&(C=xt(C,je(I)))}c=Ie.AttributeMap.diff(C,c)||{}}else if(typeof a.insert=="object"){const y=Object.keys(a.insert)[0];if(y==null)return o;const E=this.scroll.query(y,F.INLINE)!=null;if(E)(t<=o||this.scroll.descendant(Pe,o)[0])&&(g=!0);else if(o>0){const[A,C]=this.scroll.descendant(xe,o-1);A instanceof ze?A.value()[C]!==`
|
|
28
|
+
`&&(d=!0):A instanceof ke&&A.statics.scope===F.INLINE_BLOT&&(d=!0)}if(this.scroll.insertAt(o,y,a.insert[y]),E){const[A]=this.scroll.descendant(xe,o);if(A){const C=xt({},je(A));c=Ie.AttributeMap.diff(C,c)||{}}}}t+=u}else if(s.push(a),a.retain!==null&&typeof a.retain=="object"){const y=Object.keys(a.retain)[0];if(y==null)return o;this.scroll.updateEmbedAt(o,y,a.retain[y])}Object.keys(c).forEach(y=>{this.scroll.formatAt(o,u,y,c[y])});const h=d?1:0,p=g?1:0;return t+=h+p,s.retain(h),s.delete(p),o+u+h+p},0),s.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+Ie.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new U().retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(i=>{this.scroll.lines(e,Math.max(t,1)).forEach(o=>{o.format(i,n[i])})}),this.scroll.optimize();const s=new U().retain(e).retain(t,Zt(n));return this.update(s)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(i=>{this.scroll.formatAt(e,t,i,n[i])});const s=new U().retain(e).retain(t,Zt(n));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new U)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],s=[];t===0?this.scroll.path(e).forEach(a=>{const[u]=a;u instanceof ve?n.push(u):u instanceof xe&&s.push(u)}):(n=this.scroll.lines(e,t),s=this.scroll.descendants(xe,e,t));const[i,o]=[n,s].map(a=>{const u=a.shift();if(u==null)return{};let c=je(u);for(;Object.keys(c).length>0;){const d=a.shift();if(d==null)return c;c=cg(je(d),c)}return c});return{...i,...o}}getHTML(e,t){const[n,s]=this.scroll.line(e);if(n){const i=n.length();return n.length()>=s+t&&!(s===0&&t===i)?jn(n,s,t,!0):jn(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(n=>typeof n.insert=="string").map(n=>n.insert).join("")}insertContents(e,t){const n=ja(t),s=new U().retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(s)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new U().retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
|
|
37
29
|
`).replace(/\r/g,`
|
|
38
|
-
`),this.scroll.insertAt(e,t),Object.keys(
|
|
39
|
-
`));const c=this.getContents(e,t+o).diff(new
|
|
30
|
+
`),this.scroll.insertAt(e,t),Object.keys(n).forEach(s=>{this.scroll.formatAt(e,t.length,s,n[s])}),this.update(new U().retain(e).insert(t,Zt(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==ve.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof He}removeFormat(e,t){const n=this.getText(e,t),[s,i]=this.scroll.line(e+t);let o=0,a=new U;s!=null&&(o=s.length()-i,a=s.delta().slice(i,i+o-1).insert(`
|
|
31
|
+
`));const c=this.getContents(e,t+o).diff(new U().insert(n).concat(a)),d=new U().retain(e).concat(c);return this.applyDelta(d)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(lg)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),o=je(i),a=i.offset(this.scroll),u=t[0].oldValue.replace(tn.CONTENTS,""),c=new U().insert(u),d=new U().insert(i.value()),g=n&&{oldRange:Ba(n.oldRange,-a),newRange:Ba(n.newRange,-a)};e=new U().retain(a).concat(c.diff(d,g)).reduce((p,y)=>y.insert?p.insert(y.insert,o):p.push(y),new U),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Ps(s.compose(e),this.delta))&&(e=s.diff(this.delta,n));return e}};function nn(r,e,t){if(r.length===0){const[p]=Zs(t.pop());return e<=0?`</li></${p}>`:`</li></${p}>${nn([],e-1,t)}`}const[{child:n,offset:s,length:i,indent:o,type:a},...u]=r,[c,d]=Zs(a);if(o>e)return t.push(a),o===e+1?`<${c}><li${d}>${jn(n,s,i)}${nn(u,o,t)}`:`<${c}><li>${nn(r,e+1,t)}`;const g=t[t.length-1];if(o===e&&a===g)return`</li><li${d}>${jn(n,s,i)}${nn(u,o,t)}`;const[h]=Zs(t.pop());return`</li></${h}>${nn(r,e-1,t)}`}function jn(r,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(e,t);if(r instanceof ze)return _r(r.value().slice(e,e+t)).replaceAll(" "," ");if(r instanceof Fe){if(r.statics.blotName==="list-container"){const c=[];return r.children.forEachAt(e,t,(d,g,h)=>{const p="formats"in d&&typeof d.formats=="function"?d.formats():{};c.push({child:d,offset:g,length:h,indent:p.indent||0,type:p.list})}),nn(c,-1,[])}const s=[];if(r.children.forEachAt(e,t,(c,d,g)=>{s.push(jn(c,d,g))}),n||r.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:o}=r.domNode,[a,u]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${a}>${s.join("")}<${u}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function cg(r,e){return Object.keys(e).reduce((t,n)=>{if(r[n]==null)return t;const s=e[n];return s===r[n]?t[n]=s:Array.isArray(s)?s.indexOf(r[n])<0?t[n]=s.concat([r[n]]):t[n]=s:t[n]=[s,r[n]],t},{})}function Zs(r){const e=r==="ordered"?"ol":"ul";switch(r){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function ja(r){return r.reduce((e,t)=>{if(typeof t.insert=="string"){const n=t.insert.replace(/\r\n/g,`
|
|
40
32
|
`).replace(/\r/g,`
|
|
41
|
-
`);return e.insert(
|
|
33
|
+
`);return e.insert(n,t.attributes)}return e.push(t)},new U)}function Ba(r,e){let{index:t,length:n}=r;return new Pt(t+e,n)}function hg(r){const e=[];return r.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
|
|
42
34
|
`).forEach((s,i)=>{i&&e.push({insert:`
|
|
43
|
-
`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class
|
|
44
|
-
`});this.setContents(o)}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&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const
|
|
45
|
-
`)?s.insertAt(0,t.slice(0,-1),
|
|
46
|
-
`))),s=
|
|
47
|
-
`);const
|
|
48
|
-
`);o.slice(0,-1).forEach(u=>{
|
|
35
|
+
`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class Ve{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}$(Ve,"DEFAULTS",{});const Rr="\uFEFF";class Xs extends ke{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(n=>{this.contentNode.appendChild(n)}),this.leftGuard=document.createTextNode(Rr),this.rightGuard=document.createTextNode(Rr),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=null,n;const s=e.data.split(Rr).join("");if(e===this.leftGuard)if(this.prev instanceof ze){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof ze?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:s.length}));return e.data=Rr,t}update(e,t){e.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const s=this.restore(n.target);s&&(t.range=s)}})}}class fg{constructor(e,t){$(this,"isComposing",!1);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 Xs)&&(this.emitter.emit(M.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(M.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(M.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(M.events.COMPOSITION_END,e),this.isComposing=!1}}const Xn=class Xn{constructor(e,t){$(this,"modules",{});this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&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]}};$(Xn,"DEFAULTS",{modules:{}}),$(Xn,"themes",{default:Xn});let rn=Xn;const dg=r=>r.parentElement||r.getRootNode().host||null,gg=r=>{const e=r.getBoundingClientRect(),t="offsetWidth"in r&&Math.abs(e.width)/r.offsetWidth||1,n="offsetHeight"in r&&Math.abs(e.height)/r.offsetHeight||1;return{top:e.top,right:e.left+r.clientWidth*t,bottom:e.top+r.clientHeight*n,left:e.left}},qr=r=>{const e=parseInt(r,10);return Number.isNaN(e)?0:e},$a=(r,e,t,n,s,i)=>r<t&&e>n?0:r<t?-(t-r+s):e>n?e-r>n-t?r+s-t:e-n+i:0,pg=(r,e)=>{var i,o,a;const t=r.ownerDocument;let n=e,s=r;for(;s;){const u=s===t.body,c=u?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??t.documentElement.clientWidth,bottom:((o=window.visualViewport)==null?void 0:o.height)??t.documentElement.clientHeight,left:0}:gg(s),d=getComputedStyle(s),g=$a(n.left,n.right,c.left,c.right,qr(d.scrollPaddingLeft),qr(d.scrollPaddingRight)),h=$a(n.top,n.bottom,c.top,c.bottom,qr(d.scrollPaddingTop),qr(d.scrollPaddingBottom));if(g||h)if(u)(a=t.defaultView)==null||a.scrollBy(g,h);else{const{scrollLeft:p,scrollTop:y}=s;h&&(s.scrollTop+=h),g&&(s.scrollLeft+=g);const E=s.scrollLeft-p,A=s.scrollTop-y;n={left:n.left-E,top:n.top-A,right:n.right-E,bottom:n.bottom-A}}s=u||d.position==="fixed"?null:dg(s)}},mg=100,bg=["block","break","cursor","inline","scroll","text"],yg=(r,e,t)=>{const n=new Yt;return bg.forEach(s=>{const i=e.query(s);i&&n.register(i)}),r.forEach(s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(n.register(i),i="blotName"in i?i.requiredContainer??null:null,o+=1,o>mg){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),n},sn=ht("quill"),kr=new Yt;Fe.uiClass="ql-ui";const We=class We{static debug(e){e===!0&&(e="log"),ht.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Hs.get(e)||kr.find(e,t)}static import(e){return this.imports[e]==null&&sn.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),n="attrName"in e?e.attrName:e.blotName;typeof n=="string"?this.register(`formats/${n}`,e,t):Object.keys(e).forEach(s=>{this.register(s,e[s],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!n&&sn.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&kr.register(t),typeof t.register=="function"&&t.register(kr)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=vg(e,t),this.container=this.options.container,this.container==null){sn.error("Invalid Quill container",e);return}this.options.debug&&We.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Hs.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new M;const s=Ms.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new ug(this.scroll),this.selection=new ag(this.scroll,this.emitter),this.composition=new fg(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(M.events.EDITOR_CHANGE,o=>{o===M.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(M.events.SCROLL_UPDATE,(o,a)=>{const u=this.selection.lastRange,[c]=this.selection.getRange(),d=u&&c?{oldRange:u,newRange:c}:void 0;Ke.call(this,()=>this.editor.update(null,a,d),o)}),this.emitter.on(M.events.SCROLL_EMBED_UPDATE,(o,a)=>{const u=this.selection.lastRange,[c]=this.selection.getRange(),d=u&&c?{oldRange:u,newRange:c}:void 0;Ke.call(this,()=>{const g=new U().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(g,[],d)},We.sources.USER)}),n){const o=this.clipboard.convert({html:`${n}<p><br></p>`,text:`
|
|
36
|
+
`});this.setContents(o)}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&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const n=e;e=document.createElement("div"),e.classList.add(n)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=ft(e,t,n),Ke.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&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;return Ke.call(this,()=>{const s=this.getSelection(!0);let i=new U;if(s==null)return i;if(this.scroll.query(e,F.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,M.sources.SILENT),i},n)}formatLine(e,t,n,s,i){let o;return[e,t,o,i]=ft(e,t,n,s,i),Ke.call(this,()=>this.editor.formatLine(e,t,o),i,e,0)}formatText(e,t,n,s,i){let o;return[e,t,o,i]=ft(e,t,n,s,i),Ke.call(this,()=>this.editor.formatText(e,t,o),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(typeof e=="number"?n=this.selection.getBounds(e,t):n=this.selection.getBounds(e.index,e.length),!n)return null;const s=this.container.getBoundingClientRect();return{bottom:n.bottom-s.top,height:n.height,left:n.left-s.left,right:n.right-s.left,top:n.top-s.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=ft(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?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&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=ft(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=ft(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:We.sources.API;return Ke.call(this,()=>this.editor.insertEmbed(e,t,n),s,e)}insertText(e,t,n,s,i){let o;return[e,,o,i]=ft(e,0,n,s,i),Ke.call(this,()=>this.editor.insertText(e,t,o),i,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]=ft(e,t,n),Ke.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){pg(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&&arguments[1]!==void 0?arguments[1]:M.sources.API;return Ke.call(this,()=>{e=new U(e);const n=this.getLength(),s=this.editor.deleteText(0,n),i=this.editor.insertContents(0,e),o=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(o)},t)}setSelection(e,t,n){e==null?this.selection.setRange(null,t||We.sources.API):([e,t,,n]=ft(e,t,n),this.selection.setRange(new Pt(Math.max(0,e),t),n),n!==M.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;const n=new U().insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;return Ke.call(this,()=>(e=new U(e),this.editor.applyDelta(e)),t,!0)}};$(We,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:kr,theme:"default"}),$(We,"events",M.events),$(We,"sources",M.sources),$(We,"version","2.0.3"),$(We,"imports",{delta:U,parchment:Jd,"core/module":Ve,"core/theme":rn});let L=We;function Ma(r){return typeof r=="string"?document.querySelector(r):r}function Ys(r){return Object.entries(r??{}).reduce((e,t)=>{let[n,s]=t;return{...e,[n]:s===!0?{}:s}},{})}function Da(r){return Object.fromEntries(Object.entries(r).filter(e=>e[1]!==void 0))}function vg(r,e){const t=Ma(r);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===L.DEFAULTS.theme?rn:L.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...o}=L.DEFAULTS,{modules:a,...u}=s.DEFAULTS;let c=Ys(e.modules);c!=null&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});const d=xt({},Ys(i),Ys(a),c),g={...o,...Da(u),...Da(e)};let h=e.registry;return h?e.formats&&sn.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?yg(e.formats,g.registry,sn):g.registry,{...g,registry:h,container:t,theme:s,modules:Object.entries(d).reduce((p,y)=>{let[E,A]=y;if(!A)return p;const C=L.import(`modules/${E}`);return C==null?(sn.error(`Cannot load ${E} module. Are you sure you registered it?`),p):{...p,[E]:xt({},C.DEFAULTS||{},A)}},{}),bounds:Ma(g.bounds)}}function Ke(r,e,t,n){if(!this.isEnabled()&&e===M.sources.USER&&!this.allowReadOnlyEdits)return new U;let s=t==null?null:this.getSelection();const i=this.editor.delta,o=r();if(s!=null&&(t===!0&&(t=s.index),n==null?s=Ua(s,o,e):n!==0&&(s=Ua(s,t,n,e)),this.setSelection(s,M.sources.SILENT)),o.length()>0){const a=[M.events.TEXT_CHANGE,o,i,e];this.emitter.emit(M.events.EDITOR_CHANGE,...a),e!==M.sources.SILENT&&this.emitter.emit(...a)}return o}function ft(r,e,t,n,s){let i={};return typeof r.index=="number"&&typeof r.length=="number"?typeof e!="number"?(s=n,n=t,t=e,e=r.length,r=r.index):(e=r.length,r=r.index):typeof e!="number"&&(s=n,n=t,t=e,e=0),typeof t=="object"?(i=t,s=n):typeof t=="string"&&(n!=null?i[t]=n:s=t),s=s||M.sources.API,[r,e,i,s]}function Ua(r,e,t,n){const s=typeof t=="number"?t:0;if(r==null)return null;let i,o;return e&&typeof e.transformPosition=="function"?[i,o]=[r.index,r.index+r.length].map(a=>e.transformPosition(a,n!==M.sources.USER)):[i,o]=[r.index,r.index+r.length].map(a=>a<e||a===e&&n===M.sources.USER?a:s>=0?a+s:Math.max(e,a+s)),new Pt(i,o-i)}class jt extends Tr{}function Fa(r){return r instanceof ve||r instanceof Pe}function Ha(r){return typeof r.updateContent=="function"}class on extends Ms{constructor(e,t,n){let{emitter:s}=n;super(e,t),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}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(M.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(M.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(M.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&n!==i&&s>0){if(n instanceof Pe||i instanceof Pe){this.optimize();return}const o=i.children.head instanceof He?null:i.children.head;n.moveChildren(i,o),n.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,s){super.formatAt(e,t,n,s),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(n==null||this.scroll.query(t,F.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),n==null&&t.endsWith(`
|
|
37
|
+
`)?s.insertAt(0,t.slice(0,-1),n):s.insertAt(0,t,n)}else{const s=this.scroll.create(t,n);this.appendChild(s)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===F.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 U().insert(`
|
|
38
|
+
`))),s=n.pop();if(s==null)return;this.batchStart();const i=n.shift();if(i){const u=i.type==="block"&&(i.delta.length()===0||!this.descendant(Pe,e)[0]&&e<this.length()),c=i.type==="block"?i.delta:new U().insert({[i.key]:i.value});Js(this,e,c);const d=i.type==="block"?1:0,g=e+c.length()+d;u&&this.insertAt(g-1,`
|
|
39
|
+
`);const h=je(this.line(e)[0]),p=Ie.AttributeMap.diff(h,i.attributes)||{};Object.keys(p).forEach(y=>{this.formatAt(g-1,1,y,p[y])}),e=g}let[o,a]=this.children.find(e);if(n.length&&(o&&(o=o.split(a),a=0),n.forEach(u=>{if(u.type==="block"){const c=this.createBlock(u.attributes,o||void 0);Js(c,0,u.delta)}else{const c=this.create(u.key,u.value);this.insertBefore(c,o||void 0),Object.keys(u.attributes).forEach(d=>{c.format(d,u.attributes[d])})}})),s.type==="block"&&s.delta.length()){const u=o?o.offset(o.scroll)+a:this.length();Js(this,u,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,s]=t;return n instanceof xe?[n,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Fa,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const n=(s,i,o)=>{let a=[],u=o;return s.children.forEachAt(i,o,(c,d,g)=>{Fa(c)?a.push(c):c instanceof Tr&&(a=a.concat(n(c,d,u))),u-=g}),a};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(M.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=M.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(n=>{let{target:s}=n;const i=this.find(s,!0);return i&&!Ha(i)}),e.length>0&&this.emitter.emit(M.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(M.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[s]=this.descendant(i=>i instanceof Pe,e);s&&s.statics.blotName===t&&Ha(s)&&s.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new U;return e.forEach(s=>{const i=s==null?void 0:s.insert;if(i)if(typeof i=="string"){const o=i.split(`
|
|
40
|
+
`);o.slice(0,-1).forEach(u=>{n.insert(u,s.attributes),t.push({type:"block",delta:n,attributes:s.attributes??{}}),n=new U});const a=o[o.length-1];a&&n.insert(a,s.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,F.INLINE)?n.push(s):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new U,t.push({type:"blockEmbed",key:o,value:i[o],attributes:s.attributes??{}}))}}),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const s={};Object.entries(e).forEach(a=>{let[u,c]=a;this.query(u,F.BLOCK&F.BLOT)!=null?n=u:s[u]=c});const i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);const o=i.length();return Object.entries(s).forEach(a=>{let[u,c]=a;i.formatAt(0,o,u,c)}),i}}$(on,"blotName","scroll"),$(on,"className","ql-editor"),$(on,"tagName","DIV"),$(on,"defaultChild",ve),$(on,"allowedChildren",[ve,Pe,jt]);function Js(r,e,t){t.reduce((n,s)=>{const i=Ie.Op.length(s);let o=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const a=s.insert;r.insertAt(n,a);const[u]=r.descendant(xe,n),c=je(u);o=Ie.AttributeMap.diff(c,o)||{}}else if(typeof s.insert=="object"){const a=Object.keys(s.insert)[0];if(a==null)return n;if(r.insertAt(n,a,s.insert[a]),r.scroll.query(a,F.INLINE)!=null){const[c]=r.descendant(xe,n),d=je(c);o=Ie.AttributeMap.diff(d,o)||{}}}}return Object.keys(o).forEach(a=>{r.formatAt(n,i,a,o[a])}),n+i},e)}const Qs={scope:F.BLOCK,whitelist:["right","center","justify"]},wg=new et("align","align",Qs),za=new Ue("align","ql-align",Qs),Va=new At("align","text-align",Qs);class Ka extends At{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):t}}const Eg=new Ue("color","ql-color",{scope:F.INLINE}),ei=new Ka("color","color",{scope:F.INLINE}),xg=new Ue("background","ql-bg",{scope:F.INLINE}),ti=new Ka("background","background-color",{scope:F.INLINE});class Bt extends jt{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(n=>n.length()<=1?"":n.domNode.innerText).join(`
|
|
49
41
|
`).slice(e,e+t)}html(e,t){return`<pre>
|
|
50
|
-
${
|
|
51
|
-
</pre>`}}class
|
|
52
|
-
`,
|
|
53
|
-
`,
|
|
54
|
-
`,e.format).retain(t.length()-
|
|
55
|
-
`);this.quill.updateContents(u,L.sources.USER),this.quill.setSelection(
|
|
56
|
-
`);this.quill.updateContents(u,L.sources.USER),this.quill.setSelection(a,L.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(
|
|
57
|
-
`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new
|
|
58
|
-
`)}onCapturePaste(e){var o,a,u,c,d;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const
|
|
42
|
+
${_r(this.code(e,t))}
|
|
43
|
+
</pre>`}}class Ae extends ve{static register(){L.register(Bt)}}$(Ae,"TAB"," ");class ni extends tt{}ni.blotName="code",ni.tagName="CODE",Ae.blotName="code-block",Ae.className="ql-code-block",Ae.tagName="DIV",Bt.blotName="code-block-container",Bt.className="ql-code-block-container",Bt.tagName="DIV",Bt.allowedChildren=[Ae],Ae.allowedChildren=[ze,He,tn],Ae.requiredContainer=Bt;const ri={scope:F.BLOCK,whitelist:["rtl"]},Ga=new et("direction","dir",ri),Wa=new Ue("direction","ql-direction",ri),Za=new At("direction","direction",ri),Xa={scope:F.INLINE,whitelist:["serif","monospace"]},Ya=new Ue("font","ql-font",Xa);class Ag extends At{value(e){return super.value(e).replace(/["']/g,"")}}const Ja=new Ag("font","font-family",Xa),Qa=new Ue("size","ql-size",{scope:F.INLINE,whitelist:["small","large","huge"]}),el=new At("size","font-size",{scope:F.INLINE,whitelist:["10px","18px","32px"]}),Tg=ht("quill:keyboard"),Og=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ir extends Ve{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(n=>{this.options.bindings[n]&&this.addBinding(this.options.bindings[n])}),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&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Ng(e);if(s==null){Tg.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof n=="function"&&(n={handler:n}),(Array.isArray(s.key)?s.key:[s.key]).forEach(o=>{const a={...s,key:o,...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||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(C=>Ir.match(e,C));if(s.length===0)return;const i=L.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const o=this.quill.getSelection();if(o==null||!this.quill.hasFocus())return;const[a,u]=this.quill.getLine(o.index),[c,d]=this.quill.getLeaf(o.index),[g,h]=o.length===0?[c,d]:this.quill.getLeaf(o.index+o.length),p=c instanceof Or?c.value().slice(0,d):"",y=g instanceof Or?g.value().slice(h):"",E={collapsed:o.length===0,empty:o.length===0&&a.length()<=1,format:this.quill.getFormat(o),line:a,offset:u,prefix:p,suffix:y,event:e};s.some(C=>{if(C.collapsed!=null&&C.collapsed!==E.collapsed||C.empty!=null&&C.empty!==E.empty||C.offset!=null&&C.offset!==E.offset)return!1;if(Array.isArray(C.format)){if(C.format.every(I=>E.format[I]==null))return!1}else if(typeof C.format=="object"&&!Object.keys(C.format).every(I=>C.format[I]===!0?E.format[I]!=null:C.format[I]===!1?E.format[I]==null:Ps(C.format[I],E.format[I])))return!1;return C.prefix!=null&&!C.prefix.test(E.prefix)||C.suffix!=null&&!C.suffix.test(E.suffix)?!1:C.handler.call(this,o,E,C)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let o=new U().retain(e.index-n).delete(n);if(t.offset===0){const[a]=this.quill.getLine(e.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const c=i.formats(),d=this.quill.getFormat(e.index-1,1);if(s=Ie.AttributeMap.diff(c,d)||{},Object.keys(s).length>0){const g=new U().retain(e.index+i.length()-2).retain(1,s);o=o.compose(g)}}}this.quill.updateContents(o,L.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 s={};const[i]=this.quill.getLine(e.index);let o=new U().retain(e.index).delete(n);if(t.offset>=i.length()-1){const[a]=this.quill.getLine(e.index+1);if(a){const u=i.formats(),c=this.quill.getFormat(e.index,1);s=Ie.AttributeMap.diff(u,c)||{},Object.keys(s).length>0&&(o=o.retain(a.length()-1).retain(1,s))}}this.quill.updateContents(o,L.sources.USER),this.quill.focus()}handleDeleteRange(e){ii({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce((i,o)=>(this.quill.scroll.query(o,F.BLOCK)&&!Array.isArray(t.format[o])&&(i[o]=t.format[o]),i),{}),s=new U().retain(e.index).delete(e.length).insert(`
|
|
44
|
+
`,n);this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(e.index+1,L.sources.SILENT),this.quill.focus()}}const Sg={bindings:{bold:si("bold"),italic:si("italic"),underline:si("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",L.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(r,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",L.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(r,e){e.format.indent!=null?this.quill.format("indent","-1",L.sources.USER):e.format.list!=null&&this.quill.format("list",!1,L.sources.USER)}},"indent code-block":tl(!0),"outdent code-block":tl(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,L.sources.USER)}},tab:{key:"Tab",handler(r,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new U().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(t,L.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,L.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,L.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(r,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(r.index,r.length,t,L.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[e,t]=this.quill.getLine(r.index),n={...e.formats(),list:"checked"},s=new U().retain(r.index).insert(`
|
|
45
|
+
`,n).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(r.index+1,L.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(r,e){const[t,n]=this.quill.getLine(r.index),s=new U().retain(r.index).insert(`
|
|
46
|
+
`,e.format).retain(t.length()-n-1).retain(1,{header:null});this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(r.index+1,L.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(r){const e=this.quill.getModule("table");if(e){const[t,n,s,i]=e.getTable(r),o=Lg(t,n,s,i);if(o==null)return;let a=t.offset();if(o<0){const u=new U().retain(a).insert(`
|
|
47
|
+
`);this.quill.updateContents(u,L.sources.USER),this.quill.setSelection(r.index+1,r.length,L.sources.SILENT)}else if(o>0){a+=t.length();const u=new U().retain(a).insert(`
|
|
48
|
+
`);this.quill.updateContents(u,L.sources.USER),this.quill.setSelection(a,L.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,e){const{event:t,line:n}=e,s=n.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,L.sources.USER):this.quill.setSelection(s+n.length(),L.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[n,s]=this.quill.getLine(r.index);if(s>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(r.index," ",L.sources.USER),this.quill.history.cutoff();const o=new U().retain(r.index-s).delete(t+1).retain(n.length()-2-s).retain(1,{list:i});return this.quill.updateContents(o,L.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-t,L.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[e,t]=this.quill.getLine(r.index);let n=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,n-=1,n<=0){const i=new U().retain(r.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,L.sources.USER),this.quill.setSelection(r.index-1,L.sources.SILENT),!1}return!0}},"embed left":Pr("ArrowLeft",!1),"embed left shift":Pr("ArrowLeft",!0),"embed right":Pr("ArrowRight",!1),"embed right shift":Pr("ArrowRight",!0),"table down":nl(!1),"table up":nl(!0)}};Ir.DEFAULTS=Sg;function tl(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(e,t){let{event:n}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!n.shiftKey){this.quill.insertText(e.index,i,L.sources.USER),this.quill.setSelection(e.index+i.length,L.sources.SILENT);return}const o=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:a,length:u}=e;o.forEach((c,d)=>{r?(c.insertAt(0,i),d===0?a+=i.length:u+=i.length):c.domNode.textContent.startsWith(i)&&(c.deleteAt(0,i.length),d===0?a-=i.length:u-=i.length)}),this.quill.update(L.sources.USER),this.quill.setSelection(a,u,L.sources.SILENT)}}}function Pr(r,e){return{key:r,shiftKey:e,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:s}=n;r==="ArrowRight"&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return i instanceof ke?(r==="ArrowLeft"?e?this.quill.setSelection(n.index-1,n.length+1,L.sources.USER):this.quill.setSelection(n.index-1,L.sources.USER):e?this.quill.setSelection(n.index,n.length+1,L.sources.USER):this.quill.setSelection(n.index+n.length+1,L.sources.USER),!1):!0}}}function si(r){return{key:r[0],shortKey:!0,handler(e,t){this.quill.format(r,!t.format[r],L.sources.USER)}}}function nl(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const n=r?"prev":"next",s=t.line,i=s.parent[n];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=s;for(;a.prev!=null;)a=a.prev,o=o.next;const u=o.offset(this.quill.scroll)+Math.min(t.offset,o.length()-1);this.quill.setSelection(u,0,L.sources.USER)}}else{const o=s.table()[n];o!=null&&(r?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,L.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,L.sources.USER))}return!1}}}function Ng(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=Zt(r);else return null;return r.shortKey&&(r[Og]=r.shortKey,delete r.shortKey),r}function ii(r){let{quill:e,range:t}=r;const n=e.getLines(t);let s={};if(n.length>1){const i=n[0].formats(),o=n[n.length-1].formats();s=Ie.AttributeMap.diff(o,i)||{}}e.deleteText(t,L.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,L.sources.USER),e.setSelection(t.index,L.sources.SILENT)}function Lg(r,e,t,n){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?n===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Cg=/font-weight:\s*normal/,_g=["P","OL","UL"],rl=r=>r&&_g.includes(r.tagName),Rg=r=>{Array.from(r.querySelectorAll("br")).filter(e=>rl(e.previousElementSibling)&&rl(e.nextElementSibling)).forEach(e=>{var t;(t=e.parentNode)==null||t.removeChild(e)})},qg=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var t;return(t=e.getAttribute("style"))==null?void 0:t.match(Cg)}).forEach(e=>{var n;const t=r.createDocumentFragment();t.append(...e.childNodes),(n=e.parentNode)==null||n.replaceChild(t,e)})};function kg(r){r.querySelector('[id^="docs-internal-guid-"]')&&(qg(r),Rg(r))}const Ig=/\bmso-list:[^;]*ignore/i,Pg=/\bmso-list:[^;]*\bl(\d+)/i,jg=/\bmso-list:[^;]*\blevel(\d+)/i,Bg=(r,e)=>{const t=r.getAttribute("style"),n=t==null?void 0:t.match(Pg);if(!n)return null;const s=Number(n[1]),i=t==null?void 0:t.match(jg),o=i?Number(i[1]):1,a=new RegExp(`@list l${s}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=e.match(a),c=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:o,type:c,element:r}},$g=r=>{var o,a;const e=Array.from(r.querySelectorAll("[style*=mso-list]")),t=[],n=[];e.forEach(u=>{(u.getAttribute("style")||"").match(Ig)?t.push(u):n.push(u)}),t.forEach(u=>{var c;return(c=u.parentNode)==null?void 0:c.removeChild(u)});const s=r.documentElement.innerHTML,i=n.map(u=>Bg(u,s)).filter(u=>u);for(;i.length;){const u=[];let c=i.shift();for(;c;)u.push(c),c=i.length&&((o=i[0])==null?void 0:o.element)===c.element.nextElementSibling&&i[0].id===c.id?i.shift():null;const d=document.createElement("ul");u.forEach(p=>{const y=document.createElement("li");y.setAttribute("data-list",p.type),p.indent>1&&y.setAttribute("class",`ql-indent-${p.indent-1}`),y.innerHTML=p.element.innerHTML,d.appendChild(y)});const g=(a=u[0])==null?void 0:a.element,{parentNode:h}=g??{};g&&(h==null||h.replaceChild(d,g)),u.slice(1).forEach(p=>{let{element:y}=p;h==null||h.removeChild(y)})}};function Mg(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&$g(r)}const Dg=[Mg,kg],Ug=r=>{r.documentElement&&Dg.forEach(e=>{e(r)})},Fg=ht("quill:clipboard"),Hg=[[Node.TEXT_NODE,tp],[Node.TEXT_NODE,al],["br",Wg],[Node.ELEMENT_NODE,al],[Node.ELEMENT_NODE,Gg],[Node.ELEMENT_NODE,Kg],[Node.ELEMENT_NODE,Qg],["li",Yg],["ol, ul",Jg],["pre",Zg],["tr",ep],["b",ai("bold")],["i",ai("italic")],["strike",ai("strike")],["style",Xg]],zg=[wg,Ga].reduce((r,e)=>(r[e.keyName]=e,r),{}),sl=[Va,ti,ei,Za,Ja,el].reduce((r,e)=>(r[e.keyName]=e,r),{});class il extends Ve{constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",n=>this.onCaptureCopy(n,!1)),this.quill.root.addEventListener("cut",n=>this.onCaptureCopy(n,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Hg.concat(this.options.matchers??[]).forEach(n=>{let[s,i]=n;this.addMatcher(s,i)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Ae.blotName])return new U().insert(n||"",{[Ae.blotName]:s[Ae.blotName]});if(!t)return new U().insert(n||"",s);const i=this.convertHTML(t);return Bn(i,`
|
|
49
|
+
`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new U().retain(i.length()-1).delete(1)):i}normalizeHTML(e){Ug(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,s=new WeakMap,[i,o]=this.prepareMatching(n,s);return oi(this.quill.scroll,n,i,o,s)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:L.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,L.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents(new U().retain(e).concat(s),n),this.quill.setSelection(e+s.length(),L.sources.SILENT)}}onCaptureCopy(e){var o,a;let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:s,text:i}=this.onCopy(n,t);(o=e.clipboardData)==null||o.setData("text/plain",i),(a=e.clipboardData)==null||a.setData("text/html",s),t&&ii({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
|
|
50
|
+
`)}onCapturePaste(e){var o,a,u,c,d;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const n=(o=e.clipboardData)==null?void 0:o.getData("text/html");let s=(a=e.clipboardData)==null?void 0:a.getData("text/plain");if(!n&&!s){const g=(u=e.clipboardData)==null?void 0:u.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const i=Array.from(((c=e.clipboardData)==null?void 0:c.files)||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){const g=new DOMParser().parseFromString(n,"text/html");if(g.body.childElementCount===1&&((d=g.body.firstElementChild)==null?void 0:d.tagName)==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:s}=t;const i=this.quill.getFormat(e.index),o=this.convert({text:n,html:s},i);Fg.log("onPaste",o,{text:n,html:s});const a=new U().retain(e.index).delete(e.length).concat(o);this.quill.updateContents(a,L.sources.USER),this.quill.setSelection(a.length()-e.length,L.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],s=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:s.push(a);break;case Node.ELEMENT_NODE:n.push(a);break;default:Array.from(e.querySelectorAll(o)).forEach(u=>{if(t.has(u)){const c=t.get(u);c==null||c.push(a)}else t.set(u,[a])});break}}),[n,s]}}$(il,"DEFAULTS",{matchers:[]});function $t(r,e,t,n){return n.query(e)?r.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const o=t?{[e]:t}:{};return s.insert(i.insert,{...o,...i.attributes})},new U):r}function Bn(r,e){let t="";for(let n=r.ops.length-1;n>=0&&t.length<e.length;--n){const s=r.ops[n];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function Tt(r,e){if(!(r instanceof Element))return!1;const t=e.query(r);return t&&t.prototype instanceof ke?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(r.tagName.toLowerCase())}function Vg(r,e){return r.previousElementSibling&&r.nextElementSibling&&!Tt(r.previousElementSibling,e)&&!Tt(r.nextElementSibling,e)}const jr=new WeakMap;function ol(r){return r==null?!1:(jr.has(r)||(r.tagName==="PRE"?jr.set(r,!0):jr.set(r,ol(r.parentNode))),jr.get(r))}function oi(r,e,t,n,s){return e.nodeType===e.TEXT_NODE?n.reduce((i,o)=>o(e,i,r),new U):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((i,o)=>{let a=oi(r,o,t,n,s);return o.nodeType===e.ELEMENT_NODE&&(a=t.reduce((u,c)=>c(o,u,r),a),a=(s.get(o)||[]).reduce((u,c)=>c(o,u,r),a)),i.concat(a)},new U):new U}function ai(r){return(e,t,n)=>$t(t,r,!0,n)}function Kg(r,e,t){const n=et.keys(r),s=Ue.keys(r),i=At.keys(r),o={};return n.concat(s).concat(i).forEach(a=>{let u=t.query(a,F.ATTRIBUTE);u!=null&&(o[u.attrName]=u.value(r),o[u.attrName])||(u=zg[a],u!=null&&(u.attrName===a||u.keyName===a)&&(o[u.attrName]=u.value(r)||void 0),u=sl[a],u!=null&&(u.attrName===a||u.keyName===a)&&(u=sl[a],o[u.attrName]=u.value(r)||void 0))}),Object.entries(o).reduce((a,u)=>{let[c,d]=u;return $t(a,c,d,t)},e)}function Gg(r,e,t){const n=t.query(r);if(n==null)return e;if(n.prototype instanceof ke){const s={},i=n.value(r);if(i!=null)return s[n.blotName]=i,new U().insert(s,n.formats(r,t))}else if(n.prototype instanceof kn&&!Bn(e,`
|
|
59
51
|
`)&&e.insert(`
|
|
60
|
-
`),"blotName"in
|
|
52
|
+
`),"blotName"in n&&"formats"in n&&typeof n.formats=="function")return $t(e,n.blotName,n.formats(r,t),t);return e}function Wg(r,e){return Bn(e,`
|
|
61
53
|
`)||e.insert(`
|
|
62
|
-
`),e}function Zg(
|
|
63
|
-
`))return e;let s=-1,i=
|
|
64
|
-
`)){if(
|
|
65
|
-
`);if(e.length()>0&&
|
|
66
|
-
`);const s=t.query(
|
|
67
|
-
`);
|
|
68
|
-
`)&&!Vg(
|
|
69
|
-
`):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,U.BLOCK)!=null):!1}function np(n,e){const t=e.reduce((s,i)=>s+(i.delete||0),0);let r=e.length()-t;return rp(n,e)&&(r-=1),r}function _i(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class cl extends it{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{var o;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);(o=r.dataTransfer)!=null&&o.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(s=>{var i;s&&((i=this.options.mimetypes)!=null&&i.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}cl.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}));Promise.all(t).then(r=>{const s=r.reduce((i,o)=>i.insert({image:o}),new M().retain(n.index).delete(n.length));this.quill.updateContents(s,B.sources.USER),this.quill.setSelection(n.index+r.length,B.sources.SILENT)})}};const sp=["insertText","insertReplacementText"];class ip extends it{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(L.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Ni({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new M().retain(e.index).insert(t,r),L.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,L.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!sp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=op(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function op(n){var e;return typeof n.data=="string"?n.data:(e=n.dataTransfer)!=null&&e.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const ap=/Mac/i.test(navigator.platform),lp=100,up=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||ap&&n.key==="a"&&n.ctrlKey===!0);class cp extends it{constructor(t,r){super(t,r);$(this,"isListening",!1);$(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,r){let{line:s,event:i}=r;if(!(s instanceof rt)||!s.uiNode)return!0;const o=getComputedStyle(s.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(i.shiftKey?1:0),L.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&up(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+lp,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const r=t.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const s=this.quill.scroll.find(r.startContainer);if(!(s instanceof rt)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),t.removeAllRanges(),t.addRange(i)}}L.register({"blots/block":Ie,"blots/block/embed":We,"blots/break":nt,"blots/container":hr,"blots/cursor":jr,"blots/embed":yi,"blots/inline":vt,"blots/scroll":Mr,"blots/text":st,"modules/clipboard":il,"modules/history":ll,"modules/keyboard":fs,"modules/uploader":cl,"modules/input":ip,"modules/uiNode":cp});class fp extends tt{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.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}}const hp=new fp("indent","ql-indent",{scope:U.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Ri extends Ie{}$(Ri,"blotName","blockquote"),$(Ri,"tagName","blockquote");class qi extends Ie{static formats(e){return this.tagName.indexOf(e.tagName)+1}}$(qi,"blotName","header"),$(qi,"tagName",["H1","H2","H3","H4","H5","H6"]);class xn extends hr{}xn.blotName="list-container",xn.tagName="OL";class An extends Ie{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(){L.register(xn)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const o=this.statics.formats(t,e);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}An.blotName="list",An.tagName="LI",xn.allowedChildren=[An],An.requiredContainer=xn;class Tn extends vt{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)}}$(Tn,"blotName","bold"),$(Tn,"tagName",["STRONG","B"]);class Ii extends Tn{}$(Ii,"blotName","italic"),$(Ii,"tagName",["EM","I"]);class Xt extends vt{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 fl(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}$(Xt,"blotName","link"),$(Xt,"tagName","A"),$(Xt,"SANITIZED_URL","about:blank"),$(Xt,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function fl(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class ki extends vt{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}$(ki,"blotName","script"),$(ki,"tagName",["SUB","SUP"]);class Pi extends Tn{}$(Pi,"blotName","strike"),$(Pi,"tagName",["S","STRIKE"]);class ji extends vt{}$(ji,"blotName","underline"),$(ji,"tagName","U");class gs extends yi{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(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`<span>${e}</span>`}}$(gs,"blotName","formula"),$(gs,"className","ql-formula"),$(gs,"tagName","SPAN");const hl=["alt","height","width"];class Di extends Ke{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return hl.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return fl(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){hl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}$(Di,"blotName","image"),$(Di,"tagName","IMG");const dl=["height","width"];class ps extends We{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 dl.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return Xt.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){dl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}$(ps,"blotName","video"),$(ps,"className","ql-video"),$(ps,"tagName","IFRAME");const On=new tt("code-token","hljs",{scope:U.INLINE});class Pt extends vt{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(je.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),On.add(this.domNode,r)}format(e,t){e!==Pt.blotName?super.format(e,t):t?On.add(this.domNode,t):(On.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),On.value(this.domNode)||this.unwrap()}}Pt.blotName="code-token",Pt.className="ql-token";class Xe extends je{static create(e){const t=super.create(e);return typeof e=="string"&&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(),Pt.blotName,!1),super.replaceWith(e,t)}}class Sn extends dr{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Xe.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,s){r===Xe.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(o=>o!==this.uiNode).map(o=>o.textContent).join(`
|
|
54
|
+
`),e}function Zg(r,e,t){const n=t.query("code-block"),s=n&&"formats"in n&&typeof n.formats=="function"?n.formats(r,t):!0;return $t(e,"code-block",s,t)}function Xg(){return new U}function Yg(r,e,t){const n=t.query(r);if(n==null||n.blotName!=="list"||!Bn(e,`
|
|
55
|
+
`))return e;let s=-1,i=r.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce((o,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?o.push(a):o.insert(a.insert,{indent:s,...a.attributes||{}}):o,new U)}function Jg(r,e,t){const n=r;let s=n.tagName==="OL"?"ordered":"bullet";const i=n.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),$t(e,"list",s,t)}function al(r,e,t){if(!Bn(e,`
|
|
56
|
+
`)){if(Tt(r,t)&&(r.childNodes.length>0||r instanceof HTMLParagraphElement))return e.insert(`
|
|
57
|
+
`);if(e.length()>0&&r.nextSibling){let n=r.nextSibling;for(;n!=null;){if(Tt(n,t))return e.insert(`
|
|
58
|
+
`);const s=t.query(n);if(s&&s.prototype instanceof Pe)return e.insert(`
|
|
59
|
+
`);n=n.firstChild}}}return e}function Qg(r,e,t){var i;const n={},s=r.style||{};return s.fontStyle==="italic"&&(n.italic=!0),s.textDecoration==="underline"&&(n.underline=!0),s.textDecoration==="line-through"&&(n.strike=!0),((i=s.fontWeight)!=null&&i.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(n.bold=!0),e=Object.entries(n).reduce((o,a)=>{let[u,c]=a;return $t(o,u,c,t)},e),parseFloat(s.textIndent||0)>0?new U().insert(" ").concat(e):e}function ep(r,e,t){var s,i;const n=((s=r.parentElement)==null?void 0:s.tagName)==="TABLE"?r.parentElement:(i=r.parentElement)==null?void 0:i.parentElement;if(n!=null){const a=Array.from(n.querySelectorAll("tr")).indexOf(r)+1;return $t(e,"table",a,t)}return e}function tp(r,e,t){var s;let n=r.data;if(((s=r.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(n.trim());if(!ol(r)){if(n.trim().length===0&&n.includes(`
|
|
60
|
+
`)&&!Vg(r,t))return e;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(r.previousSibling==null&&r.parentElement!=null&&Tt(r.parentElement,t)||r.previousSibling instanceof Element&&Tt(r.previousSibling,t))&&(n=n.replace(/^ /,"")),(r.nextSibling==null&&r.parentElement!=null&&Tt(r.parentElement,t)||r.nextSibling instanceof Element&&Tt(r.nextSibling,t))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return e.insert(n)}class ll extends Ve{constructor(t,n){super(t,n);$(this,"lastRecorded",0);$(this,"ignoreChange",!1);$(this,"stack",{undo:[],redo:[]});$(this,"currentRange",null);this.quill.on(L.events.EDITOR_CHANGE,(s,i,o,a)=>{s===L.events.SELECTION_CHANGE?i&&a!==L.sources.SILENT&&(this.currentRange=i):s===L.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===L.sources.USER?this.record(i,o):this.transform(i)),this.currentRange=li(this.currentRange,i))}),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",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(t,n){if(this.stack[t].length===0)return;const s=this.stack[t].pop();if(!s)return;const i=this.quill.getContents(),o=s.delta.invert(i);this.stack[n].push({delta:o,range:li(s.range,o)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,L.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,n){if(t.ops.length===0)return;this.stack.redo=[];let s=t.invert(n),i=this.currentRange;const o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(s=s.compose(a.delta),i=a.range)}else this.lastRecorded=o;s.length()!==0&&(this.stack.undo.push({delta:s,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){ul(this.stack.undo,t),ul(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,L.sources.USER);else{const n=rp(this.quill.scroll,t.delta);this.quill.setSelection(n,L.sources.USER)}}}$(ll,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function ul(r,e){let t=e;for(let n=r.length-1;n>=0;n-=1){const s=r[n];r[n]={delta:t.transform(s.delta,!0),range:s.range&&li(s.range,t)},t=s.delta.transform(t),r[n].delta.length()===0&&r.splice(n,1)}}function np(r,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
|
|
61
|
+
`):t.attributes!=null?Object.keys(t.attributes).some(n=>r.query(n,F.BLOCK)!=null):!1}function rp(r,e){const t=e.reduce((s,i)=>s+(i.delete||0),0);let n=e.length()-t;return np(r,e)&&(n-=1),n}function li(r,e){if(!r)return r;const t=e.transformPosition(r.index),n=e.transformPosition(r.index+r.length);return{index:t,length:n-t}}class cl extends Ve{constructor(e,t){super(e,t),e.root.addEventListener("drop",n=>{var o;n.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(n.clientX,n.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);(o=n.dataTransfer)!=null&&o.files&&this.upload(a,n.dataTransfer.files)}})}upload(e,t){const n=[];Array.from(t).forEach(s=>{var i;s&&((i=this.options.mimetypes)!=null&&i.includes(s.type))&&n.push(s)}),n.length>0&&this.options.handler.call(this,e,n)}}cl.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,e){if(!this.quill.scroll.query("image"))return;const t=e.map(n=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(n)}));Promise.all(t).then(n=>{const s=n.reduce((i,o)=>i.insert({image:o}),new U().retain(r.index).delete(r.length));this.quill.updateContents(s,M.sources.USER),this.quill.setSelection(r.index+n.length,M.sources.SILENT)})}};const sp=["insertText","insertReplacementText"];class ip extends Ve{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||e.on(L.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){ii({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new U().retain(e.index).insert(t,n),L.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,L.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!sp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const n=op(e);if(n==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function op(r){var e;return typeof r.data=="string"?r.data:(e=r.dataTransfer)!=null&&e.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const ap=/Mac/i.test(navigator.platform),lp=100,up=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||ap&&r.key==="a"&&r.ctrlKey===!0);class cp extends Ve{constructor(t,n){super(t,n);$(this,"isListening",!1);$(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,n){let{line:s,event:i}=n;if(!(s instanceof Fe)||!s.uiNode)return!0;const o=getComputedStyle(s.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(i.shiftKey?1:0),L.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&up(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+lp,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const n=t.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof Fe)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),t.removeAllRanges(),t.addRange(i)}}L.register({"blots/block":ve,"blots/block/embed":Pe,"blots/break":He,"blots/container":jt,"blots/cursor":tn,"blots/embed":Xs,"blots/inline":tt,"blots/scroll":on,"blots/text":ze,"modules/clipboard":il,"modules/history":ll,"modules/keyboard":Ir,"modules/uploader":cl,"modules/input":ip,"modules/uiNode":cp});class hp extends Ue{add(e,t){let n=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;n=t==="+1"?s+1:s-1}else typeof t=="number"&&(n=t);return n===0?(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}}const fp=new hp("indent","ql-indent",{scope:F.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class ui extends ve{}$(ui,"blotName","blockquote"),$(ui,"tagName","blockquote");class ci extends ve{static formats(e){return this.tagName.indexOf(e.tagName)+1}}$(ci,"blotName","header"),$(ci,"tagName",["H1","H2","H3","H4","H5","H6"]);class $n extends jt{}$n.blotName="list-container",$n.tagName="OL";class Mn extends ve{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(){L.register($n)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const o=this.statics.formats(t,e);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Mn.blotName="list",Mn.tagName="LI",$n.allowedChildren=[Mn],Mn.requiredContainer=$n;class Dn extends tt{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)}}$(Dn,"blotName","bold"),$(Dn,"tagName",["STRONG","B"]);class hi extends Dn{}$(hi,"blotName","italic"),$(hi,"tagName",["EM","I"]);class Ot extends tt{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 hl(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}$(Ot,"blotName","link"),$(Ot,"tagName","A"),$(Ot,"SANITIZED_URL","about:blank"),$(Ot,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function hl(r,e){const t=document.createElement("a");t.href=r;const n=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(n)>-1}class fi extends tt{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}$(fi,"blotName","script"),$(fi,"tagName",["SUB","SUP"]);class di extends Dn{}$(di,"blotName","strike"),$(di,"tagName",["S","STRIKE"]);class gi extends tt{}$(gi,"blotName","underline"),$(gi,"tagName","U");class Br extends Xs{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(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`<span>${e}</span>`}}$(Br,"blotName","formula"),$(Br,"className","ql-formula"),$(Br,"tagName","SPAN");const fl=["alt","height","width"];class pi extends ke{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return fl.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 hl(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){fl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}$(pi,"blotName","image"),$(pi,"tagName","IMG");const dl=["height","width"];class $r extends Pe{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 dl.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return Ot.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){dl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}$($r,"blotName","video"),$($r,"className","ql-video"),$($r,"tagName","IFRAME");const Un=new Ue("code-token","hljs",{scope:F.INLINE});class dt extends tt{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Ae.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),Un.add(this.domNode,n)}format(e,t){e!==dt.blotName?super.format(e,t):t?Un.add(this.domNode,t):(Un.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Un.value(this.domNode)||this.unwrap()}}dt.blotName="code-token",dt.className="ql-token";class Be extends Ae{static create(e){const t=super.create(e);return typeof e=="string"&&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(),dt.blotName,!1),super.replaceWith(e,t)}}class Fn extends Bt{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Be.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,s){n===Be.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(o=>o!==this.uiNode).map(o=>o.textContent).join(`
|
|
70
62
|
`)}
|
|
71
|
-
`,i=
|
|
72
|
-
${
|
|
73
|
-
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=
|
|
63
|
+
`,i=Be.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const o=this.children.reduce((u,c)=>u.concat(ka(c,!1)),new U),a=e(s,i);o.diff(a).reduce((u,c)=>{let{retain:d,attributes:g}=c;return d?(g&&Object.keys(g).forEach(h=>{[Be.blotName,dt.blotName].includes(h)&&this.formatAt(u,d,h,g[h])}),u+d):u},0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`<pre data-language="${n?Be.formats(n.domNode):"plain"}">
|
|
64
|
+
${_r(this.code(e,t))}
|
|
65
|
+
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=Be.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Fn.allowedChildren=[Be],Be.requiredContainer=Fn,Be.allowedChildren=[dt,tn,ze,He];const dp=(r,e,t)=>{if(typeof r.versionString=="string"){const n=r.versionString.split(".")[0];if(parseInt(n,10)>=11)return r.highlight(t,{language:e}).value}return r.highlight(e,t).value};class gl extends Ve{static register(){L.register(dt,!0),L.register(Be,!0),L.register(Fn,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((n,s)=>{let{key:i}=s;return n[i]=!0,n},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(L.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Fn))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(n=>{let{key:s,label:i}=n;const o=t.ownerDocument.createElement("option");o.textContent=i,o.setAttribute("value",s),t.appendChild(o)}),t.addEventListener("change",()=>{e.format(Be.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=Be.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(L.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(L.sources.USER);const n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Fn):[e]).forEach(i=>{i.highlight(this.highlightBlot,t)}),this.quill.update(L.sources.SILENT),n!=null&&this.quill.setSelection(n,L.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return _r(e).split(`
|
|
74
66
|
`).reduce((s,i,o)=>(o!==0&&s.insert(`
|
|
75
|
-
`,{[
|
|
67
|
+
`,{[Ae.blotName]:t}),s.insert(i)),new U);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Ae.className),n.innerHTML=dp(this.options.hljs,t,e),oi(this.quill.scroll,n,[(s,i)=>{const o=Un.value(s);return o?i.compose(new U().retain(i.length(),{[dt.blotName]:o})):i}],[(s,i)=>s.data.split(`
|
|
76
68
|
`).reduce((o,a,u)=>(u!==0&&o.insert(`
|
|
77
|
-
`,{[
|
|
78
|
-
`).join("");return i.insert(o,{table:$i()})},new M().retain(r.index));this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(r.index,L.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(L.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(L.events.TEXT_CHANGE,(r,s,i)=>{i===L.sources.USER&&this.balanceTables()}),!0):!1)})}};const pl=It("quill:toolbar");class Bi extends it{constructor(e,t){var r,s;if(super(e,t),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),pp(i,this.options.container),(s=(r=e.container)==null?void 0:r.parentNode)==null||s.insertBefore(i,e.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){pl.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(i=>{var a;const o=(a=this.options.handlers)==null?void 0:a[i];o&&this.addHandler(i,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(L.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){pl.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const a=e.options[e.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof Ke){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents(new M().retain(o.index).delete(o.length).insert({[t]:i}),L.sources.USER)}else this.quill.format(t,i,L.sources.USER);this.update(o)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,i]=r;if(i.tagName==="SELECT"){let o=null;if(e==null)o=null;else if(t[s]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let a=t[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=t[s],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=t[s]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}Bi.DEFAULTS={};function ml(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function pp(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(s=>{if(typeof s=="string")ml(r,s);else{const i=Object.keys(s)[0],o=s[i];Array.isArray(o)?mp(r,i,o):ml(r,i,o)}}),n.appendChild(r)})}function mp(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)}),n.appendChild(r)}Bi.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,U.INLINE)!=null&&this.quill.format(t,!1,L.sources.USER)})}else this.quill.removeFormat(n.index,n.length,L.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",L.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,L.sources.USER),this.quill.format("direction",n,L.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,L.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,L.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,L.sources.USER):this.quill.format("list","unchecked",L.sources.USER):this.quill.format("list",n,L.sources.USER)}}};const bp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',yp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',vp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',wp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Ep='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',xp='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Ap='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Tp='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',bl='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Nn={align:{"":bp,center:yp,right:vp,justify:wp},background:Ep,blockquote:xp,bold:Ap,clean:Tp,code:bl,"code-block":bl,color:'<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',direction:{"":'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',rtl:'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>'},formula:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',header:{1:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',2:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',3:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',4:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',5:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',6:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>'},italic:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',image:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indent:{"+1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',"-1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>'},link:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',list:{bullet:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',check:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',ordered:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>'},script:{sub:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',super:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>'},strike:'<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',table:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underline:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',video:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>'},Op='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let yl=0;function vl(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class ms{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",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),vl(this.label,"aria-expanded"),vl(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 r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Op,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-${yl}`,yl+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),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&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(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 r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class wl extends ms{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(r=>{r.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 r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class El extends ms{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const Sp=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class xl{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Sp(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,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>s.right&&(o=s.right-i.right,this.root.style.left=`${t+o}px`),i.left<s.left&&(o=s.left-i.left,this.root.style.left=`${t+o}px`),i.bottom>s.bottom){const a=i.bottom-i.top,u=e.bottom-e.top+a;this.root.style.top=`${r-u}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Np=[!1,"center","right","justify"],Lp=["#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"],Cp=[!1,"serif","monospace"],_p=["1","2","3",!1],Rp=["small",!1,"large","huge"];class Ln extends $r{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(s.target)||i.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")r.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")r.innerHTML=t[i];else{const o=r.value||"";o!=null&&t[i][o]&&(r.innerHTML=t[i][o])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Cn(s,Np),typeof t.align=="object"))return new El(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Cn(s,Lp,i==="background"?"#ffffff":"#000000"),new wl(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Cn(s,Cp):s.classList.contains("ql-header")?Cn(s,_p):s.classList.contains("ql-size")&&Cn(s,Rp)),new ms(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(B.events.EDITOR_CHANGE,r)}}Ln.DEFAULTS=Gt({},$r.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Al extends xl{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),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,B.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,B.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=qp(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,B.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",B.sources.USER),this.quill.setSelection(r+2,B.sources.USER)}break}}this.textbox.value="",this.hide()}}function qp(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Cn(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)})}const Ip=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Tl extends Al{constructor(e,t){super(e,t),this.quill.on(B.events.EDITOR_CHANGE,(r,s,i,o)=>{if(r===B.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&o===B.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(s.index,s.length);if(a.length===1){const u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=a[a.length-1],c=this.quill.getIndex(u),d=Math.min(u.length()-1,s.index+s.length-c),g=this.quill.getBounds(new fr(c,d));g!=null&&this.position(g)}}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(B.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}$(Tl,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class Ol extends Ln{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Ip),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Tl(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Nn),this.buildPickers(e.container.querySelectorAll("select"),Nn))}}Ol.DEFAULTS=Gt({},Ln.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,L.sources.USER)}}}}});const kp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Sl extends Al{constructor(){super(...arguments);$(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,B.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(B.events.SELECTION_CHANGE,(t,r,s)=>{if(t!=null){if(t.length===0&&s===B.sources.USER){const[i,o]=this.quill.scroll.descendant(Xt,t.index);if(i!=null){this.linkRange=new fr(t.index-o,i.length());const a=Xt.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}$(Sl,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class Nl extends Ln{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=kp),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Nn),this.buildPickers(e.container.querySelectorAll("select"),Nn),this.tooltip=new Sl(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}Nl.DEFAULTS=Gt({},Ln.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,L.sources.USER)}}}}}),L.register({"attributors/attribute/direction":Ga,"attributors/class/align":za,"attributors/class/background":xg,"attributors/class/color":Eg,"attributors/class/direction":Wa,"attributors/class/font":Ya,"attributors/class/size":Qa,"attributors/style/align":Va,"attributors/style/background":Ai,"attributors/style/color":xi,"attributors/style/direction":Za,"attributors/style/font":Ja,"attributors/style/size":el},!0),L.register({"formats/align":za,"formats/direction":Wa,"formats/indent":hp,"formats/background":Ai,"formats/color":xi,"formats/font":Ya,"formats/size":Qa,"formats/blockquote":Ri,"formats/code-block":je,"formats/header":qi,"formats/list":An,"formats/bold":Tn,"formats/code":Ti,"formats/italic":Ii,"formats/link":Xt,"formats/script":ki,"formats/strike":Pi,"formats/underline":ji,"formats/formula":gs,"formats/image":Di,"formats/video":ps,"modules/syntax":gl,"modules/table":gp,"modules/toolbar":Bi,"themes/bubble":Ol,"themes/snow":Nl,"ui/icons":Nn,"ui/picker":ms,"ui/icon-picker":El,"ui/color-picker":wl,"ui/tooltip":xl},!0);function Ll(n){const{value:e,style:t,...r}=n,s=Te.useRef(null);return Te.useEffect(()=>{const i=s.current,o=i.ownerDocument.createElement("div");Object.entries(t).forEach(([c,d])=>{o.style[c]=d});const a=i.appendChild(o),u=new L(a,{theme:"snow",...r});return e&&(u.root.innerHTML=e),u.on("text-change",()=>{var c;(c=r.onChange)==null||c.call(r,u.root.innerHTML||"")}),()=>{i.innerHTML=""}},[s]),Oe.jsx("div",{ref:s,style:{height:"100%"}})}var Cl={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_l=Te.createContext&&Te.createContext(Cl),Pp=["attr","size","title"];function jp(n,e){if(n==null)return{};var t=Dp(n,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Dp(n,e){if(n==null)return{};var t={};for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){if(e.indexOf(r)>=0)continue;t[r]=n[r]}return t}function bs(){return bs=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},bs.apply(this,arguments)}function Rl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ys(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rl(Object(t),!0).forEach(function(r){$p(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Rl(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $p(n,e,t){return e=Bp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bp(n){var e=Mp(n,"string");return typeof e=="symbol"?e:e+""}function Mp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ql(n){return n&&n.map((e,t)=>Te.createElement(e.tag,ys({key:t},e.attr),ql(e.child)))}function Up(n){return e=>Te.createElement(Fp,bs({attr:ys({},n.attr)},e),ql(n.child))}function Fp(n){var e=t=>{var{attr:r,size:s,title:i}=n,o=jp(n,Pp),a=s||t.size||"1em",u;return t.className&&(u=t.className),n.className&&(u=(u?u+" ":"")+n.className),Te.createElement("svg",bs({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,o,{className:u,style:ys(ys({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&Te.createElement("title",null,i),n.children)};return _l!==void 0?Te.createElement(_l.Consumer,null,t=>e(t)):e(Cl)}function Il(n){return Up({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 0 0-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"},child:[]}]})(n)}const Hp=n=>Array.isArray(n)?n:n&&n.fileList;function kl(n){var a;const{value:e,...t}=n,r=Hp(e),s=Array.isArray(r)?r.length:0,i=t.maxCount??1;let o;return s<i&&((a=t.listType)!=null&&a.startsWith("picture-")?o=Oe.jsx(Il,{}):o=Oe.jsx(ze.Button,{icon:Oe.jsx(Il,{}),children:" 上传"})),Oe.jsx(ze.Upload,{maxCount:1,multiple:!0,showUploadList:!0,...t,fileList:r,onChange:u=>{var c;return(c=t.onChange)==null?void 0:c.call(t,u.fileList)},children:s<i&&o})}const zp={upload:{renderFormItem:(n,e)=>Oe.jsx(kl,{...e.fieldProps})},editor:{renderFormItem:(n,e)=>Oe.jsx(Ll,{...e.fieldProps})}};function Mi({children:n}){return Oe.jsx(zt.ProConfigProvider,{valueTypeMap:zp,children:n})}const Vp=()=>ze.Form.useForm().pop(),Pl=n=>Oe.jsx(Mi,{children:Oe.jsx(zt.BetaSchemaForm,{layout:"horizontal",colon:!1,labelCol:{span:3},wrapperCol:{span:6},scrollToFirstError:!0,submitter:{render:(e,t)=>Oe.jsx(ze.Form.Item,{wrapperCol:{offset:4,span:8},children:Oe.jsx(ze.Space,{children:t})})},...n})});Pl.useForm=Vp;function Kp(n){const{items:e,...t}={...n},r=$s.useNavigate(),i=$s.useLocation().pathname.split("/").filter(Boolean).pop(),o=e==null?void 0:e.find(u=>(u==null?void 0:u.key)==i),a=[(o==null?void 0:o.key)??""];return Oe.jsxs(ze.Layout,{style:{height:"100vh"},children:[Oe.jsxs(ze.Layout.Sider,{children:[Oe.jsx(ze.Typography.Title,{style:{color:"white",textAlign:"center"},children:"Rainte"}),Oe.jsx(ze.Menu,{mode:"inline",theme:"dark",items:e,defaultSelectedKeys:a,onClick:u=>r(u.key),...t})]}),Oe.jsx(ze.Layout,{style:{overflow:"auto"},children:Oe.jsx(ze.Layout.Content,{style:{minHeight:"fit-content",padding:"1rem"},children:Oe.jsx(ze.Layout.Content,{style:{height:"100%",padding:"1rem",backgroundColor:"white"},children:Oe.jsx($s.Outlet,{})})})})]})}function Gp(n){return Oe.jsx(Mi,{children:Oe.jsx(zt.ProTable,{rowKey:"id",pagination:{pageSize:10},tableAlertRender:({selectedRowKeys:e})=>Oe.jsxs(ze.Space,{children:["已选 ",e.length," 项"]}),...n})})}let vs,jl,Ui;const Dl=()=>{const n=ze.App.useApp();return vs=n.message,Ui=n.modal,jl=n.notification,null},Wp=Object.freeze(Object.defineProperty({__proto__:null,default:Dl,get message(){return vs},get modal(){return Ui},get notification(){return jl},popup:{confirm:n=>Ui.confirm({title:"提示",content:"确认操作?",...n}),success:(n,e)=>(n=n||"操作成功",vs.success(n,e)),error:(n,e)=>{n=n||"操作失败",vs.error(n,e),mo.system.fail(n)},ask:function(n,e){return this.confirm({onOk:n,...e})}},useDialog:Dl},Symbol.toStringTag,{value:"Module"})),Y=n=>typeof n=="string",_n=()=>{let n,e;const t=new Promise((r,s)=>{n=r,e=s});return t.resolve=n,t.reject=e,t},$l=n=>n==null?"":""+n,Zp=(n,e,t)=>{n.forEach(r=>{e[r]&&(t[r]=e[r])})},Xp=/###/g,Bl=n=>n&&n.indexOf("###")>-1?n.replace(Xp,"."):n,Ml=n=>!n||Y(n),Rn=(n,e,t)=>{const r=Y(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(Ml(n))return{};const i=Bl(r[s]);!n[i]&&t&&(n[i]=new t),Object.prototype.hasOwnProperty.call(n,i)?n=n[i]:n={},++s}return Ml(n)?{}:{obj:n,k:Bl(r[s])}},Ul=(n,e,t)=>{const{obj:r,k:s}=Rn(n,e,Object);if(r!==void 0||e.length===1){r[s]=t;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=Rn(n,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=Rn(n,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=t},Yp=(n,e,t,r)=>{const{obj:s,k:i}=Rn(n,e,Object);s[i]=s[i]||[],s[i].push(t)},ws=(n,e)=>{const{obj:t,k:r}=Rn(n,e);if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r]},Jp=(n,e,t)=>{const r=ws(n,t);return r!==void 0?r:ws(e,t)},Fl=(n,e,t)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in n?Y(n[r])||n[r]instanceof String||Y(e[r])||e[r]instanceof String?t&&(n[r]=e[r]):Fl(n[r],e[r],t):n[r]=e[r]);return n},Fr=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Qp={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const em=n=>Y(n)?n.replace(/[&<>"'\/]/g,e=>Qp[e]):n;class tm{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const rm=[" ",",","?","!",";"],nm=new tm(20),sm=(n,e,t)=>{e=e||"",t=t||"";const r=rm.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(r.length===0)return!0;const s=nm.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(n);if(!i){const o=n.indexOf(t);o>0&&!s.test(n.substring(0,o))&&(i=!0)}return i},Fi=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[e])return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;const r=e.split(t);let s=n;for(let i=0;i<r.length;){if(!s||typeof s!="object")return;let o,a="";for(let u=i;u<r.length;++u)if(u!==i&&(a+=t),a+=r[u],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&u<r.length-1)continue;i+=u-i+1;break}s=o}return s},Es=n=>n==null?void 0:n.replace("_","-"),im={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){var t,r;(r=(t=console==null?void 0:console[n])==null?void 0:t.apply)==null||r.call(t,console,e)}};class xs{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||im,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,r,s){return s&&!this.debug?null:(Y(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new xs(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new xs(this.logger,e)}}var Et=new xs;class As{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(t)||0;this.observers[r].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[a,u]=o;for(let c=0;c<u;c++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,u]=o;for(let c=0;c<u;c++)a.apply(a,[e,...r])})}}class Hl extends As{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r){var c,d;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],r&&(Array.isArray(r)?a.push(...r):Y(r)&&i?a.push(...r.split(i)):a.push(r)));const u=ws(this.data,a);return!u&&!t&&!r&&e.indexOf(".")>-1&&(e=a[0],t=a[1],r=a.slice(2).join(".")),u||!o||!Y(r)?u:Fi((d=(c=this.data)==null?void 0:c[e])==null?void 0:d[t],r,i)}addResource(e,t,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),Ul(this.data,a,s),i.silent||this.emit("added",e,t,r,s)}addResources(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(Y(r[i])||Array.isArray(r[i]))&&this.addResource(e,t,i,r[i],{silent:!0});s.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=r,r=t,t=a[1]),this.addNamespaces(t);let u=ws(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?Fl(u,r,i):u={...u,...r},Ul(this.data,a,u),o.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var zl={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,r,s){return n.forEach(i=>{var o;e=((o=this.processors[i])==null?void 0:o.process(e,t,r,s))??e}),e}};const Vl={},Kl=n=>!Y(n)&&typeof n!="boolean"&&typeof n!="number";class Ts extends As{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Zp(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Et.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,t);return(r==null?void 0:r.res)!==void 0}extractFromKey(e,t){let r=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!sm(e,r,s);if(o&&!a){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:Y(i)?[i]:i};const c=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(s)}return{key:e,namespaces:Y(i)?[i]:i}}translate(e,t,r){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),u=a[a.length-1],c=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode"){if(d){const b=t.nsSeparator||this.options.nsSeparator;return s?{res:`${u}${b}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:`${u}${b}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:o}const g=this.resolve(e,t);let f=g==null?void 0:g.res;const p=(g==null?void 0:g.usedKey)||o,w=(g==null?void 0:g.exactUsedKey)||o,x=["[object Number]","[object Function]","[object RegExp]"],T=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,k=t.count!==void 0&&!Y(t.count),j=Ts.hasDefaultValue(t),H=k?this.pluralResolver.getSuffix(c,t.count,t):"",F=t.ordinal&&k?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",ie=k&&!t.ordinal&&t.count===0,te=ie&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${H}`]||t[`defaultValue${F}`]||t.defaultValue;let oe=f;C&&!f&&j&&(oe=te);const be=Kl(oe),xe=Object.prototype.toString.apply(oe);if(C&&oe&&be&&x.indexOf(xe)<0&&!(Y(T)&&Array.isArray(oe))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,oe,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(g.res=b,g.usedParams=this.getUsedParamsDetails(t),g):b}if(i){const b=Array.isArray(oe),N=b?[]:{},A=b?w:p;for(const R in oe)if(Object.prototype.hasOwnProperty.call(oe,R)){const m=`${A}${i}${R}`;j&&!f?N[R]=this.translate(m,{...t,defaultValue:Kl(te)?te[R]:void 0,joinArrays:!1,ns:a}):N[R]=this.translate(m,{...t,joinArrays:!1,ns:a}),N[R]===m&&(N[R]=oe[R])}f=N}}else if(C&&Y(T)&&Array.isArray(f))f=f.join(T),f&&(f=this.extendTranslation(f,e,t,r));else{let b=!1,N=!1;!this.isValidLookup(f)&&j&&(b=!0,f=te),this.isValidLookup(f)||(N=!0,f=o);const R=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:f,m=j&&te!==f&&this.options.updateMissing;if(N||b||m){if(this.logger.log(m?"updateKey":"missingKey",c,u,o,m?te:f),i){const I=this.resolve(o,{...t,keySeparator:!1});I&&I.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let E=[];const O=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&O&&O[0])for(let I=0;I<O.length;I++)E.push(O[I]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(t.lng||this.language):E.push(t.lng||this.language);const P=(I,_,K)=>{var z;const W=j&&K!==f?K:R;this.options.missingKeyHandler?this.options.missingKeyHandler(I,u,_,W,m,t):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(I,u,_,W,m,t),this.emit("missingKey",I,u,_,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?E.forEach(I=>{const _=this.pluralResolver.getSuffixes(I,t);ie&&t[`defaultValue${this.options.pluralSeparator}zero`]&&_.indexOf(`${this.options.pluralSeparator}zero`)<0&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(K=>{P([I],o+K,t[`defaultValue${K}`]||te)})}):P(E,o,te))}f=this.extendTranslation(f,e,t,g,r),N&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${u}:${o}`),(N||b)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${o}`:o,b?f:void 0))}return s?(g.res=f,g.usedParams=this.getUsedParamsDetails(t),g):f}extendTranslation(e,t,r,s,i){var c,d;var o=this;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const g=Y(e)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(g){const w=e.match(this.interpolator.nestingRegexp);f=w&&w.length}let p=r.replace&&!Y(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,r.lng||this.language||s.usedLng,r),g){const w=e.match(this.interpolator.nestingRegexp),x=w&&w.length;f<x&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var w=arguments.length,x=new Array(w),T=0;T<w;T++)x[T]=arguments[T];return(i==null?void 0:i[0])===x[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${t[0]}`),null):o.translate(...x,t)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,u=Y(a)?[a]:a;return e!=null&&(u!=null&&u.length)&&r.applyPostProcessor!==!1&&(e=zl.handle(u,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,o,a;return Y(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(u,t),d=c.key;s=d;let g=c.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const f=t.count!==void 0&&!Y(t.count),p=f&&!t.ordinal&&t.count===0,w=t.context!==void 0&&(Y(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);g.forEach(T=>{var C,k;this.isValidLookup(r)||(a=T,!Vl[`${x[0]}-${T}`]&&((C=this.utils)!=null&&C.hasLoadedNamespace)&&!((k=this.utils)!=null&&k.hasLoadedNamespace(a))&&(Vl[`${x[0]}-${T}`]=!0,this.logger.warn(`key "${s}" for languages "${x.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(j=>{var ie;if(this.isValidLookup(r))return;o=j;const H=[d];if((ie=this.i18nFormat)!=null&&ie.addLookupKeys)this.i18nFormat.addLookupKeys(H,d,j,T,t);else{let te;f&&(te=this.pluralResolver.getSuffix(j,t.count,t));const oe=`${this.options.pluralSeparator}zero`,be=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(H.push(d+te),t.ordinal&&te.indexOf(be)===0&&H.push(d+te.replace(be,this.options.pluralSeparator)),p&&H.push(d+oe)),w){const xe=`${d}${this.options.contextSeparator}${t.context}`;H.push(xe),f&&(H.push(xe+te),t.ordinal&&te.indexOf(be)===0&&H.push(xe+te.replace(be,this.options.pluralSeparator)),p&&H.push(xe+oe))}}let F;for(;F=H.pop();)this.isValidLookup(r)||(i=F,r=this.getResource(j,T,F,t))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,r){var i;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,t,r,s):this.resourceStore.getResource(e,t,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!Y(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of t)delete s[i]}return s}static hasDefaultValue(e){const t="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&e[r]!==void 0)return!0;return!1}}class Gl{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Et.create("languageUtils")}getScriptPartFromCode(e){if(e=Es(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Es(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Y(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(r=>{if(t)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(r=>{if(t)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),Y(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){const r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Y(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):Y(e)&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const Wl={zero:0,one:1,two:2,few:3,many:4,other:5},Zl={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class om{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Et.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Es(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Zl;if(!e.match(/-|_/))return Zl;const u=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(u,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${t}${s}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>Wl[s]-Wl[i]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}const Xl=function(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=Jp(n,e,t);return!i&&s&&Y(t)&&(i=Fi(n,t,r),i===void 0&&(i=Fi(e,t,r))),i},Hi=n=>n.replace(/\$/g,"$$$$");class am{constructor(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Et.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:u,formatSeparator:c,unescapeSuffix:d,unescapePrefix:g,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:w,nestingSuffixEscaped:x,nestingOptionsSeparator:T,maxReplaces:C,alwaysFormat:k}=e.interpolation;this.escape=t!==void 0?t:em,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Fr(i):o||"{{",this.suffix=a?Fr(a):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?Fr(f):p||Fr("$t("),this.nestingSuffix=w?Fr(w):x||Fr(")"),this.nestingOptionsSeparator=T||",",this.maxReplaces=C||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,r)=>(t==null?void 0:t.source)===r?(t.lastIndex=0,t):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,r,s){var p;let i,o,a;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=w=>{if(w.indexOf(this.formatSeparator)<0){const k=Xl(t,u,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...s,...t,interpolationkey:w}):k}const x=w.split(this.formatSeparator),T=x.shift().trim(),C=x.join(this.formatSeparator).trim();return this.format(Xl(t,u,T,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...s,...t,interpolationkey:T})};this.resetRegExp();const d=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,g=((p=s==null?void 0:s.interpolation)==null?void 0:p.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>Hi(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?Hi(this.escape(w)):Hi(w)}].forEach(w=>{for(a=0;i=w.regex.exec(e);){const x=i[1].trim();if(o=c(x),o===void 0)if(typeof d=="function"){const C=d(e,i,s);o=Y(C)?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,x))o="";else if(g){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${e}`),o="";else!Y(o)&&!this.useRawValueToEscape&&(o=$l(o));const T=w.safeValue(o);if(e=e.replace(i[0],T),g?(w.regex.lastIndex+=o.length,w.regex.lastIndex-=i[0].length):w.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;const a=(u,c)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const g=u.split(new RegExp(`${d}[ ]*{`));let f=`{${g[1]}`;u=g[0],f=this.interpolate(f,o);const p=f.match(/'/g),w=f.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!w||w.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),c&&(o={...c,...o})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,x),`${u}${d}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,u};for(;s=this.nestingRegexp.exec(e);){let u=[];o={...r},o=o.replace&&!Y(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(g=>g.trim());s[1]=d.shift(),u=d,c=!0}if(i=t(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&!Y(i))return i;Y(i)||(i=$l(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),c&&(i=u.reduce((d,g)=>this.format(d,g,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const lm=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const r=n.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...u]=o.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();t[d]||(t[d]=c),c==="false"&&(t[d]=!1),c==="true"&&(t[d]=!0),isNaN(c)||(t[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},Hr=n=>{const e={};return(t,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=e[o];return a||(a=n(Es(r),s),e[o]=a),a(t)}};class um{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Et.create("formatter"),this.options=e,this.formats={number:Hr((t,r)=>{const s=new Intl.NumberFormat(t,{...r});return i=>s.format(i)}),currency:Hr((t,r)=>{const s=new Intl.NumberFormat(t,{...r,style:"currency"});return i=>s.format(i)}),datetime:Hr((t,r)=>{const s=new Intl.DateTimeFormat(t,{...r});return i=>s.format(i)}),relativetime:Hr((t,r)=>{const s=new Intl.RelativeTimeFormat(t,{...r});return i=>s.format(i,r.range||"day")}),list:Hr((t,r)=>{const s=new Intl.ListFormat(t,{...r});return i=>s.format(i)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Hr(t)}format(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(u=>u.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,u)=>{var g;const{formatName:c,formatOptions:d}=lm(u);if(this.formats[c]){let f=a;try{const p=((g=s==null?void 0:s.formatParams)==null?void 0:g[s.interpolationkey])||{},w=p.locale||p.lng||s.locale||s.lng||r;f=this.formats[c](a,w,{...d,...s,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}const cm=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class fm extends As{constructor(e,t,r){var i,o;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Et.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,r,s.backend,s)}queueLoad(e,t,r,s){const i={},o={},a={},u={};return e.forEach(c=>{let d=!0;t.forEach(g=>{const f=`${c}|${g}`;!r.reload&&this.store.hasResourceBundle(c,g)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,d=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),u[g]===void 0&&(u[g]=!0)))}),d||(a[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(u)}}loaded(e,t,r){const s=e.split("|"),i=s[0],o=s[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);const a={};this.queue.forEach(u=>{Yp(u.loaded,[i],o),cm(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{a[c]||(a[c]={});const d=u.loaded[c];d.length&&d.forEach(g=>{a[c][g]===void 0&&(a[c][g]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(u=>!u.done)}read(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(c&&d&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,r,s+1,i*2,o)},i);return}o(c,d)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const c=u(e,t);c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}return}return u(e,t,a)}prepareLoading(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Y(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Y(t)&&(t=[t]);const i=this.queueLoad(e,t,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,t,r,s,i){var u,c,d,g,f;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((c=(u=this.services)==null?void 0:u.utils)!=null&&c.hasLoadedNamespace&&!((g=(d=this.services)==null?void 0:d.utils)!=null&&g.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((f=this.backend)!=null&&f.create){const p={...o,isUpdate:i},w=this.backend.create.bind(this.backend);if(w.length<6)try{let x;w.length===5?x=w(e,t,r,s,p):x=w(e,t,r,s),x&&typeof x.then=="function"?x.then(T=>a(null,T)).catch(a):a(null,x)}catch(x){a(x)}else w(e,t,r,s,a,p)}!e||!e[0]||this.store.addResource(e[0],t,r,s)}}}const Yl=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),Y(n[1])&&(e.defaultValue=n[1]),Y(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(r=>{e[r]=t[r]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Jl=n=>{var e,t;return Y(n.ns)&&(n.ns=[n.ns]),Y(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Y(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),((t=(e=n.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n},Os=()=>{},hm=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class qn extends As{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Jl(e),this.services={},this.logger=Et,this.modules={external:[]},hm(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Y(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=Yl();this.options={...s,...this.options,...Jl(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Et.init(i(this.modules.logger),this.options):Et.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=um;const g=new Gl(this.options);this.store=new Hl(this.options.resources,this.options);const f=this.services;f.logger=Et,f.resourceStore=this.store,f.languageUtils=g,f.pluralResolver=new om(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=i(d),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new am(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new fm(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var w=arguments.length,x=new Array(w>1?w-1:0),T=1;T<w;T++)x[T-1]=arguments[T];e.emit(p,...x)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Ts(this.services,this.options),this.translator.on("*",function(p){for(var w=arguments.length,x=new Array(w>1?w-1:0),T=1;T<w;T++)x[T-1]=arguments[T];e.emit(p,...x)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Os),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const u=_n(),c=()=>{const d=(g,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(f),r(g,f)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),u}loadResources(e){var i,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Os;const s=Y(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],u=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(g=>{g!=="cimode"&&a.indexOf(g)<0&&a.push(g)})};s?u(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>u(d)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,c=>u(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(e,t,r){const s=_n();return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=Os),this.services.backendConnector.reload(e,t,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&zl.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,t){var r=this;this.isLanguageChangingTo=e;const s=_n();this.emit("languageChanging",e);const i=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},o=(u,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),t&&t(u,function(){return r.t(...arguments)})},a=u=>{var d,g;!e&&!u&&this.services.languageDetector&&(u=[]);const c=Y(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),(g=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||g.call(d,c)),this.loadResources(c,f=>{o(f,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,r){var s=this;const i=function(o,a){let u;if(typeof a!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),g=2;g<c;g++)d[g-2]=arguments[g];u=s.options.overloadTranslationOptionHandler([o,a].concat(d))}else u={...a};u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||i.keyPrefix);const f=s.options.keySeparator||".";let p;return u.keyPrefix&&Array.isArray(o)?p=o.map(w=>`${u.keyPrefix}${f}${w}`):p=u.keyPrefix?`${u.keyPrefix}${f}${o}`:o,s.t(p,u)};return Y(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}t(){var s;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(s=this.translator)==null?void 0:s.translate(...t)}exists(){var s;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(s=this.translator)==null?void 0:s.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,u)=>{const c=this.services.backendConnector.state[`${a}|${u}`];return c===-1||c===0||c===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!s||o(i,e)))}loadNamespaces(e,t){const r=_n();return this.options.ns?(Y(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),t&&t(s)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){const r=_n();Y(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),t&&t(o)}),r):(t&&t(),Promise.resolve())}dir(e){var s,i;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new Gl(Yl());return t.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new qn(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Os;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new qn(s);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((u,c)=>(u[c]={...this.store.data[c]},Object.keys(u[c]).reduce((d,g)=>(d[g]={...u[c][g]},d),{})),{});i.store=new Hl(a,s),i.services.resourceStore=i.store}return i.translator=new Ts(i.services,s),i.translator.on("*",function(a){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];i.emit(a,...c)}),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const De=qn.createInstance();De.createInstance=qn.createInstance;const dm=De.createInstance,gm=De.dir,pm=De.init,mm=De.loadResources,bm=De.reloadResources,ym=De.use,vm=De.changeLanguage,wm=De.getFixedT,Em=De.t,xm=De.exists,Am=De.setDefaultNamespace,Tm=De.hasLoadedNamespace,Om=De.loadNamespaces,Sm=De.loadLanguages;function zi(n){"@babel/helpers - typeof";return zi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zi(n)}function Ql(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":zi(XMLHttpRequest))==="object"}function Nm(n){return!!n&&typeof n.then=="function"}function Lm(n){return Nm(n)?n:Promise.resolve(n)}function eu(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function tu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eu(Object(t),!0).forEach(function(r){Cm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):eu(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cm(n,e,t){return(e=_m(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _m(n){var e=Rm(n,"string");return pr(e)=="symbol"?e:e+""}function Rm(n,e){if(pr(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(pr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pr(n){"@babel/helpers - typeof";return pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pr(n)}var Yt=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Yt=global.fetch:typeof window<"u"&&window.fetch&&(Yt=window.fetch);var In;Ql()&&(typeof global<"u"&&global.XMLHttpRequest?In=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(In=window.XMLHttpRequest));var Ss;if(typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Ss=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Ss=window.ActiveXObject)),typeof Yt!="function"&&(Yt=void 0),!Yt&&!In&&!Ss)try{Promise.resolve().then(()=>r1).then(function(n){Yt=n.default}).catch(function(){})}catch{}var Vi=function(e,t){if(t&&pr(t)==="object"){var r="";for(var s in t)r+="&"+encodeURIComponent(s)+"="+encodeURIComponent(t[s]);if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},ru=function(e,t,r,s){var i=function(u){if(!u.ok)return r(u.statusText||"Error",{status:u.status});u.text().then(function(c){r(null,{status:u.status,data:c})}).catch(r)};if(s){var o=s(e,t);if(o instanceof Promise){o.then(i).catch(r);return}}typeof fetch=="function"?fetch(e,t).then(i).catch(r):Yt(e,t).then(i).catch(r)},nu=!1,qm=function(e,t,r,s){e.queryStringParams&&(t=Vi(t,e.queryStringParams));var i=tu({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var o=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,a=tu({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:i},nu?{}:o),u=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{ru(t,a,s,u)}catch(c){if(!o||Object.keys(o).length===0||!c.message||c.message.indexOf("not implemented")<0)return s(c);try{Object.keys(o).forEach(function(d){delete a[d]}),ru(t,a,s,u),nu=!0}catch(d){s(d)}}},Im=function(e,t,r,s){r&&pr(r)==="object"&&(r=Vi("",r).slice(1)),e.queryStringParams&&(t=Vi(t,e.queryStringParams));try{var i=In?new In:new Ss("MSXML2.XMLHTTP.3.0");i.open(r?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var o=e.customHeaders;if(o=typeof o=="function"?o():o,o)for(var a in o)i.setRequestHeader(a,o[a]);i.onreadystatechange=function(){i.readyState>3&&s(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(u){console&&console.log(u)}},km=function(e,t,r,s){if(typeof r=="function"&&(s=r,r=void 0),s=s||function(){},Yt&&t.indexOf("file:")!==0)return qm(e,t,r,s);if(Ql()||typeof ActiveXObject=="function")return Im(e,t,r,s);s(new Error("No fetch and no xhr implementation found!"))};function zr(n){"@babel/helpers - typeof";return zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zr(n)}function su(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Ki(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?su(Object(t),!0).forEach(function(r){iu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):su(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Pm(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function jm(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,ou(r.key),r)}}function Dm(n,e,t){return e&&jm(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function iu(n,e,t){return(e=ou(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ou(n){var e=$m(n,"string");return zr(e)=="symbol"?e:e+""}function $m(n,e){if(zr(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(zr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}var Bm=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,r,s){return iu({},r,s||"")},parseLoadPayload:function(t,r){},request:km,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},au=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Pm(this,n),this.services=e,this.options=t,this.allOptions=r,this.type="backend",this.init(e,t,r)}return Dm(n,[{key:"init",value:function(t){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=t,this.options=Ki(Ki(Ki({},Bm()),this.options||{}),s),this.allOptions=i,this.services&&this.options.reloadInterval){var o=setInterval(function(){return r.reload()},this.options.reloadInterval);zr(o)==="object"&&typeof o.unref=="function"&&o.unref()}}},{key:"readMulti",value:function(t,r,s){this._readAny(t,t,r,r,s)}},{key:"read",value:function(t,r,s){this._readAny([t],t,[r],r,s)}},{key:"_readAny",value:function(t,r,s,i,o){var a=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(t,s)),u=Lm(u),u.then(function(c){if(!c)return o(null,{});var d=a.services.interpolator.interpolate(c,{lng:t.join("+"),ns:s.join("+")});a.loadUrl(d,o,r,i)})}},{key:"loadUrl",value:function(t,r,s,i){var o=this,a=typeof s=="string"?[s]:s,u=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(a,u);this.options.request(this.options,t,c,function(d,g){if(g&&(g.status>=500&&g.status<600||!g.status))return r("failed loading "+t+"; status code: "+g.status,!0);if(g&&g.status>=400&&g.status<500)return r("failed loading "+t+"; status code: "+g.status,!1);if(!g&&d&&d.message){var f=d.message.toLowerCase(),p=["failed","fetch","network","load"].find(function(T){return f.indexOf(T)>-1});if(p)return r("failed loading "+t+": "+d.message,!0)}if(d)return r(d,!1);var w,x;try{typeof g.data=="string"?w=o.options.parse(g.data,s,i):w=g.data}catch{x="failed parsing "+t+" to json"}if(x)return r(x,!1);r(null,w)})}},{key:"create",value:function(t,r,s,i,o){var a=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var u=this.options.parsePayload(r,s,i),c=0,d=[],g=[];t.forEach(function(f){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(f,r));var w=a.services.interpolator.interpolate(p,{lng:f,ns:r});a.options.request(a.options,w,u,function(x,T){c+=1,d.push(x),g.push(T),c===t.length&&typeof o=="function"&&o(d,g)})})}}},{key:"reload",value:function(){var t=this,r=this.services,s=r.backendConnector,i=r.languageUtils,o=r.logger,a=s.language;if(!(a&&a.toLowerCase()==="cimode")){var u=[],c=function(g){var f=i.toResolveHierarchy(g);f.forEach(function(p){u.indexOf(p)<0&&u.push(p)})};c(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return c(d)}),u.forEach(function(d){t.allOptions.ns.forEach(function(g){s.read(d,g,"read",null,null,function(f,p){f&&o.warn("loading namespace ".concat(g," for language ").concat(d," failed"),f),!f&&p&&o.log("loaded namespace ".concat(g," for language ").concat(d),p),s.loaded("".concat(d,"|").concat(g),f,p)})})})}}}])}();au.type="backend";const{slice:Mm,forEach:Um}=[];function Fm(n){return Um.call(Mm.call(arguments,1),e=>{if(e)for(const t in e)n[t]===void 0&&(n[t]=e[t])}),n}const lu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Hm=function(n,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let i=`${n}=${s}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!lu.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!lu.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},uu={create(n,e,t,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+t*60*1e3)),r&&(s.domain=r),document.cookie=Hm(n,encodeURIComponent(e),s)},read(n){const e=`${n}=`,t=document.cookie.split(";");for(let r=0;r<t.length;r++){let s=t[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(n){this.create(n,"",-1)}};var zm={name:"cookie",lookup(n){let{lookupCookie:e}=n;if(e&&typeof document<"u")return uu.read(e)||void 0},cacheUserLanguage(n,e){let{lookupCookie:t,cookieMinutes:r,cookieDomain:s,cookieOptions:i}=e;t&&typeof document<"u"&&uu.create(t,n,r,s,i)}},Vm={name:"querystring",lookup(n){var r;let{lookupQuerystring:e}=n,t;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let a=0;a<o.length;a++){const u=o[a].indexOf("=");u>0&&o[a].substring(0,u)===e&&(t=o[a].substring(u+1))}}return t}};let Vr=null;const cu=()=>{if(Vr!==null)return Vr;try{if(Vr=typeof window<"u"&&window.localStorage!==null,!Vr)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Vr=!1}return Vr};var Km={name:"localStorage",lookup(n){let{lookupLocalStorage:e}=n;if(e&&cu())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(n,e){let{lookupLocalStorage:t}=e;t&&cu()&&window.localStorage.setItem(t,n)}};let Kr=null;const fu=()=>{if(Kr!==null)return Kr;try{if(Kr=typeof window<"u"&&window.sessionStorage!==null,!Kr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Kr=!1}return Kr};var Gm={name:"sessionStorage",lookup(n){let{lookupSessionStorage:e}=n;if(e&&fu())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(n,e){let{lookupSessionStorage:t}=e;t&&fu()&&window.sessionStorage.setItem(t,n)}},Wm={name:"navigator",lookup(n){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:r,language:s}=navigator;if(t)for(let i=0;i<t.length;i++)e.push(t[i]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},Zm={name:"htmlTag",lookup(n){let{htmlTag:e}=n,t;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(t=r.getAttribute("lang")),t}},Xm={name:"path",lookup(n){var s;let{lookupFromPathIndex:e}=n;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?(s=t[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},Ym={name:"subdomain",lookup(n){var s,i;let{lookupFromSubdomainIndex:e}=n;const t=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[t]}};let hu=!1;try{document.cookie,hu=!0}catch{}const du=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];hu||du.splice(1,1);const Jm=()=>({order:du,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class gu{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Fm(t,this.options||{},Jm()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(zm),this.addDetector(Vm),this.addDetector(Km),this.addDetector(Gm),this.addDetector(Wm),this.addDetector(Zm),this.addDetector(Xm),this.addDetector(Ym)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(t=t.concat(s))}}),t=t.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}gu.type="languageDetector";const pu="i18nextLng",Gi="zh";De.use(au).use(gu).init({lng:mo.storage.local.getRaw(pu,Gi),fallbackLng:Gi,backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1}});const Qm=Object.freeze(Object.defineProperty({__proto__:null,KEY:pu,LNG_ZH:Gi,changeLanguage:vm,createInstance:dm,dir:gm,exists:xm,getFixedT:wm,hasLoadedNamespace:Tm,init:pm,loadLanguages:Sm,loadNamespaces:Om,loadResources:mm,reloadResources:bm,setDefaultNamespace:Am,t:Em,use:ym},Symbol.toStringTag,{value:"Module"})),e1=Object.freeze(Object.defineProperty({__proto__:null,onUpload:async n=>{const{file:e,onProgress:t,onSuccess:r}=n;let s=0;const i=setInterval(()=>{s+=Math.floor(Math.random()*10),s>=100&&(s=99),t({percent:s})},100);e.url=URL.createObjectURL(e),r==null||r({url:e.url}),clearInterval(i)}},Symbol.toStringTag,{value:"Module"}));var Ns={exports:{}},mu;function t1(){return mu||(mu=1,function(n,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof pt<"u"&&pt,r=function(){function i(){this.fetch=!1,this.DOMException=t.DOMException}return i.prototype=t,new i}();(function(i){(function(o){var a=typeof i<"u"&&i||typeof self<"u"&&self||typeof a<"u"&&a,u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(m){return m&&DataView.prototype.isPrototypeOf(m)}if(u.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=ArrayBuffer.isView||function(m){return m&&d.indexOf(Object.prototype.toString.call(m))>-1};function f(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(m)||m==="")throw new TypeError('Invalid character in header field name: "'+m+'"');return m.toLowerCase()}function p(m){return typeof m!="string"&&(m=String(m)),m}function w(m){var E={next:function(){var O=m.shift();return{done:O===void 0,value:O}}};return u.iterable&&(E[Symbol.iterator]=function(){return E}),E}function x(m){this.map={},m instanceof x?m.forEach(function(E,O){this.append(O,E)},this):Array.isArray(m)?m.forEach(function(E){this.append(E[0],E[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(E){this.append(E,m[E])},this)}x.prototype.append=function(m,E){m=f(m),E=p(E);var O=this.map[m];this.map[m]=O?O+", "+E:E},x.prototype.delete=function(m){delete this.map[f(m)]},x.prototype.get=function(m){return m=f(m),this.has(m)?this.map[m]:null},x.prototype.has=function(m){return this.map.hasOwnProperty(f(m))},x.prototype.set=function(m,E){this.map[f(m)]=p(E)},x.prototype.forEach=function(m,E){for(var O in this.map)this.map.hasOwnProperty(O)&&m.call(E,this.map[O],O,this)},x.prototype.keys=function(){var m=[];return this.forEach(function(E,O){m.push(O)}),w(m)},x.prototype.values=function(){var m=[];return this.forEach(function(E){m.push(E)}),w(m)},x.prototype.entries=function(){var m=[];return this.forEach(function(E,O){m.push([O,E])}),w(m)},u.iterable&&(x.prototype[Symbol.iterator]=x.prototype.entries);function T(m){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}function C(m){return new Promise(function(E,O){m.onload=function(){E(m.result)},m.onerror=function(){O(m.error)}})}function k(m){var E=new FileReader,O=C(E);return E.readAsArrayBuffer(m),O}function j(m){var E=new FileReader,O=C(E);return E.readAsText(m),O}function H(m){for(var E=new Uint8Array(m),O=new Array(E.length),P=0;P<E.length;P++)O[P]=String.fromCharCode(E[P]);return O.join("")}function F(m){if(m.slice)return m.slice(0);var E=new Uint8Array(m.byteLength);return E.set(new Uint8Array(m)),E.buffer}function ie(){return this.bodyUsed=!1,this._initBody=function(m){this.bodyUsed=this.bodyUsed,this._bodyInit=m,m?typeof m=="string"?this._bodyText=m:u.blob&&Blob.prototype.isPrototypeOf(m)?this._bodyBlob=m:u.formData&&FormData.prototype.isPrototypeOf(m)?this._bodyFormData=m:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)?this._bodyText=m.toString():u.arrayBuffer&&u.blob&&c(m)?(this._bodyArrayBuffer=F(m.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(m)||g(m))?this._bodyArrayBuffer=F(m):this._bodyText=m=Object.prototype.toString.call(m):this._bodyText="",this.headers.get("content-type")||(typeof m=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var m=T(this);if(m)return m;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var m=T(this);return m||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(k)}),this.text=function(){var m=T(this);if(m)return m;if(this._bodyBlob)return j(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(xe)}),this.json=function(){return this.text().then(JSON.parse)},this}var te=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function oe(m){var E=m.toUpperCase();return te.indexOf(E)>-1?E:m}function be(m,E){if(!(this instanceof be))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');E=E||{};var O=E.body;if(m instanceof be){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,E.headers||(this.headers=new x(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!O&&m._bodyInit!=null&&(O=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new x(E.headers)),this.method=oe(E.method||this.method||"GET"),this.mode=E.mode||this.mode||null,this.signal=E.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(O),(this.method==="GET"||this.method==="HEAD")&&(E.cache==="no-store"||E.cache==="no-cache")){var P=/([?&])_=[^&]*/;if(P.test(this.url))this.url=this.url.replace(P,"$1_="+new Date().getTime());else{var I=/\?/;this.url+=(I.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}be.prototype.clone=function(){return new be(this,{body:this._bodyInit})};function xe(m){var E=new FormData;return m.trim().split("&").forEach(function(O){if(O){var P=O.split("="),I=P.shift().replace(/\+/g," "),_=P.join("=").replace(/\+/g," ");E.append(decodeURIComponent(I),decodeURIComponent(_))}}),E}function b(m){var E=new x,O=m.replace(/\r?\n[\t ]+/g," ");return O.split("\r").map(function(P){return P.indexOf(`
|
|
79
|
-
`)===0?
|
|
69
|
+
`,{[Ae.blotName]:t}),o.insert(a)),i)],new WeakMap)}}gl.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"}]};const Yn=class Yn extends ve{static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",mi()),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===Yn.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()}};$(Yn,"blotName","table"),$(Yn,"tagName","TD");let Ge=Yn;class gt extends jt{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const n=t.formats(),s=t.next.formats();if(n.table!==s.table){const i=this.splitAfter(t);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}$(gt,"blotName","table-row"),$(gt,"tagName","TR");class nt extends jt{}$(nt,"blotName","table-body"),$(nt,"tagName","TBODY");class an extends jt{balanceCells(){const e=this.descendants(gt),t=e.reduce((n,s)=>Math.max(s.children.length,n),0);e.forEach(n=>{new Array(t-n.children.length).fill(0).forEach(()=>{let s;n.children.head!=null&&(s=Ge.formats(n.children.head.domNode));const i=this.scroll.create(Ge.blotName,s);n.appendChild(i),i.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(nt);t==null||t.children.head==null||t.children.forEach(n=>{const s=n.children.at(e);s!=null&&s.remove()})}insertColumn(e){const[t]=this.descendant(nt);t==null||t.children.head==null||t.children.forEach(n=>{const s=n.children.at(e),i=Ge.formats(n.children.head.domNode),o=this.scroll.create(Ge.blotName,i);n.insertBefore(o,s)})}insertRow(e){const[t]=this.descendant(nt);if(t==null||t.children.head==null)return;const n=mi(),s=this.scroll.create(gt.blotName);t.children.head.children.forEach(()=>{const o=this.scroll.create(Ge.blotName,n);s.appendChild(o)});const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}$(an,"blotName","table-container"),$(an,"tagName","TABLE"),an.allowedChildren=[nt],nt.requiredContainer=an,nt.allowedChildren=[gt],gt.requiredContainer=nt,gt.allowedChildren=[Ge],Ge.requiredContainer=gt;function mi(){return`row-${Math.random().toString(36).slice(2,6)}`}let gp=class extends Ve{static register(){L.register(Ge),L.register(gt),L.register(nt),L.register(an)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(an).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(L.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(L.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(L.sources.USER),this.quill.setSelection(t,L.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==Ge.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,s,i]=this.getTable(t);if(i==null)return;const o=i.cellOffset();n.insertColumn(o+e),this.quill.update(L.sources.USER);let a=s.rowOffset();e===0&&(a+=1),this.quill.setSelection(t.index+a,t.length,L.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,s,i]=this.getTable(t);if(i==null)return;const o=s.rowOffset();n.insertRow(o+e),this.quill.update(L.sources.USER),e>0?this.quill.setSelection(t,L.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,L.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(n==null)return;const s=new Array(e).fill(0).reduce(i=>{const o=new Array(t).fill(`
|
|
70
|
+
`).join("");return i.insert(o,{table:mi()})},new U().retain(n.index));this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(n.index,L.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(L.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(L.events.TEXT_CHANGE,(n,s,i)=>{i===L.sources.USER&&this.balanceTables()}),!0):!1)})}};const pl=ht("quill:toolbar");class bi extends Ve{constructor(e,t){var n,s;if(super(e,t),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),pp(i,this.options.container),(s=(n=e.container)==null?void 0:n.parentNode)==null||s.insertBefore(i,e.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){pl.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(i=>{var a;const o=(a=this.options.handlers)==null?void 0:a[i];o&&this.addHandler(i,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(L.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){pl.warn("ignoring attaching to nonexistent format",t,e);return}const n=e.tagName==="SELECT"?"change":"click";e.addEventListener(n,s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const a=e.options[e.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof ke){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents(new U().retain(o.index).delete(o.length).insert({[t]:i}),L.sources.USER)}else this.quill.format(t,i,L.sources.USER);this.update(o)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{const[s,i]=n;if(i.tagName==="SELECT"){let o=null;if(e==null)o=null;else if(t[s]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let a=t[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=t[s],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=t[s]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}bi.DEFAULTS={};function ml(r,e,t){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${e}`),n.setAttribute("aria-pressed","false"),t!=null?(n.value=t,n.setAttribute("aria-label",`${e}: ${t}`)):n.setAttribute("aria-label",e),r.appendChild(n)}function pp(r,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(s=>{if(typeof s=="string")ml(n,s);else{const i=Object.keys(s)[0],o=s[i];Array.isArray(o)?mp(n,i,o):ml(n,i,o)}}),r.appendChild(n)})}function mp(r,e,t){const n=document.createElement("select");n.classList.add(`ql-${e}`),t.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),n.appendChild(i)}),r.appendChild(n)}bi.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,F.INLINE)!=null&&this.quill.format(t,!1,L.sources.USER)})}else this.quill.removeFormat(r.index,r.length,L.sources.USER)},direction(r){const{align:e}=this.quill.getFormat();r==="rtl"&&e==null?this.quill.format("align","right",L.sources.USER):!r&&e==="right"&&this.quill.format("align",!1,L.sources.USER),this.quill.format("direction",r,L.sources.USER)},indent(r){const e=this.quill.getSelection(),t=this.quill.getFormat(e),n=parseInt(t.indent||0,10);if(r==="+1"||r==="-1"){let s=r==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",n+s,L.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,L.sources.USER)},list(r){const e=this.quill.getSelection(),t=this.quill.getFormat(e);r==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,L.sources.USER):this.quill.format("list","unchecked",L.sources.USER):this.quill.format("list",r,L.sources.USER)}}};const bp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',yp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',vp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',wp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Ep='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',xp='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Ap='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Tp='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',bl='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Hn={align:{"":bp,center:yp,right:vp,justify:wp},background:Ep,blockquote:xp,bold:Ap,clean:Tp,code:bl,"code-block":bl,color:'<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',direction:{"":'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',rtl:'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>'},formula:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',header:{1:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',2:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',3:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',4:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',5:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',6:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>'},italic:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',image:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indent:{"+1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',"-1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>'},link:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',list:{bullet:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',check:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',ordered:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>'},script:{sub:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',super:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>'},strike:'<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',table:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underline:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',video:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>'},Op='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let yl=0;function vl(r,e){r.setAttribute(e,`${r.getAttribute(e)!=="true"}`)}class Mr{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",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),vl(this.label,"aria-expanded"),vl(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",s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Op,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-${yl}`,yl+=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),t.selected===!0&&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&&arguments[1]!==void 0?arguments[1]:!1;const n=this.container.querySelector(".ql-selected");e!==n&&(n!=null&&n.classList.remove("ql-selected"),e!=null&&(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 n=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(n)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class wl extends Mr{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(n=>{n.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"),s=e&&e.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=s:n.style.fill=s)}}class El extends Mr{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(n=>{n.innerHTML=t[n.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(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const Sp=r=>{const{overflowY:e}=getComputedStyle(r,null);return e!=="visible"&&e!=="clip"};class xl{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Sp(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 s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>s.right&&(o=s.right-i.right,this.root.style.left=`${t+o}px`),i.left<s.left&&(o=s.left-i.left,this.root.style.left=`${t+o}px`),i.bottom>s.bottom){const a=i.bottom-i.top,u=e.bottom-e.top+a;this.root.style.top=`${n-u}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Np=[!1,"center","right","justify"],Lp=["#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"],Cp=[!1,"serif","monospace"],_p=["1","2","3",!1],Rp=["small",!1,"large","huge"];class zn extends rn{constructor(e,t){super(e,t);const n=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",n);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(s.target)||i.close()})};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(n=>{(n.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")n.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")n.innerHTML=t[i];else{const o=n.value||"";o!=null&&t[i][o]&&(n.innerHTML=t[i][o])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Vn(s,Np),typeof t.align=="object"))return new El(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Vn(s,Lp,i==="background"?"#ffffff":"#000000"),new wl(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Vn(s,Cp):s.classList.contains("ql-header")?Vn(s,_p):s.classList.contains("ql-size")&&Vn(s,Rp)),new Mr(s)});const n=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(M.events.EDITOR_CHANGE,n)}}zn.DEFAULTS=xt({},rn.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let r=this.container.querySelector("input.ql-image[type=file]");r==null&&(r=document.createElement("input"),r.setAttribute("type","file"),r.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),r.classList.add("ql-image"),r.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,r.files),r.value=""}),this.container.appendChild(r)),r.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Al extends xl{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&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,M.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,M.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=qp(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,M.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",M.sources.USER),this.quill.setSelection(n+2,M.sources.USER)}break}}this.textbox.value="",this.hide()}}function qp(r){let e=r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:r}function Vn(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(n=>{const s=document.createElement("option");n===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(n)),r.appendChild(s)})}const kp=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Tl extends Al{constructor(e,t){super(e,t),this.quill.on(M.events.EDITOR_CHANGE,(n,s,i,o)=>{if(n===M.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&o===M.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(s.index,s.length);if(a.length===1){const u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=a[a.length-1],c=this.quill.getIndex(u),d=Math.min(u.length()-1,s.index+s.length-c),g=this.quill.getBounds(new Pt(c,d));g!=null&&this.position(g)}}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(M.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&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="",t!==0&&(n.style.marginLeft=`${-1*t-n.offsetWidth/2}px`),t}}$(Tl,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class Ol extends zn{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=kp),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Tl(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Hn),this.buildPickers(e.container.querySelectorAll("select"),Hn))}}Ol.DEFAULTS=xt({},zn.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,L.sources.USER)}}}}});const Ip=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Sl extends Al{constructor(){super(...arguments);$(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,M.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(M.events.SELECTION_CHANGE,(t,n,s)=>{if(t!=null){if(t.length===0&&s===M.sources.USER){const[i,o]=this.quill.scroll.descendant(Ot,t.index);if(i!=null){this.linkRange=new Pt(t.index-o,i.length());const a=Ot.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}$(Sl,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class Nl extends zn{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Ip),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Hn),this.buildPickers(e.container.querySelectorAll("select"),Hn),this.tooltip=new Sl(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)}))}}Nl.DEFAULTS=xt({},zn.DEFAULTS,{modules:{toolbar:{handlers:{link(r){if(r){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,L.sources.USER)}}}}}),L.register({"attributors/attribute/direction":Ga,"attributors/class/align":za,"attributors/class/background":xg,"attributors/class/color":Eg,"attributors/class/direction":Wa,"attributors/class/font":Ya,"attributors/class/size":Qa,"attributors/style/align":Va,"attributors/style/background":ti,"attributors/style/color":ei,"attributors/style/direction":Za,"attributors/style/font":Ja,"attributors/style/size":el},!0),L.register({"formats/align":za,"formats/direction":Wa,"formats/indent":fp,"formats/background":ti,"formats/color":ei,"formats/font":Ya,"formats/size":Qa,"formats/blockquote":ui,"formats/code-block":Ae,"formats/header":ci,"formats/list":Mn,"formats/bold":Dn,"formats/code":ni,"formats/italic":hi,"formats/link":Ot,"formats/script":fi,"formats/strike":di,"formats/underline":gi,"formats/formula":Br,"formats/image":pi,"formats/video":$r,"modules/syntax":gl,"modules/table":gp,"modules/toolbar":bi,"themes/bubble":Ol,"themes/snow":Nl,"ui/icons":Hn,"ui/picker":Mr,"ui/icon-picker":El,"ui/color-picker":wl,"ui/tooltip":xl},!0);function Ll(r){const{value:e,style:t,...n}=r,s=pe.useRef(null);return pe.useEffect(()=>{const i=s.current,o=i.ownerDocument.createElement("div");Object.entries(t).forEach(([c,d])=>{o.style[c]=d});const a=i.appendChild(o),u=new L(a,{theme:"snow",...n});return e&&(u.root.innerHTML=e),u.on("text-change",()=>{var c;(c=n.onChange)==null||c.call(n,u.root.innerHTML||"")}),()=>{i.innerHTML=""}},[s]),ge.jsx("div",{ref:s,style:{height:"100%"}})}var Cl={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_l=pe.createContext&&pe.createContext(Cl),Pp=["attr","size","title"];function jp(r,e){if(r==null)return{};var t=Bp(r,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Bp(r,e){if(r==null)return{};var t={};for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(e.indexOf(n)>=0)continue;t[n]=r[n]}return t}function Dr(){return Dr=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Dr.apply(this,arguments)}function Rl(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,n)}return t}function Ur(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rl(Object(t),!0).forEach(function(n){$p(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Rl(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function $p(r,e,t){return e=Mp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Mp(r){var e=Dp(r,"string");return typeof e=="symbol"?e:e+""}function Dp(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ql(r){return r&&r.map((e,t)=>pe.createElement(e.tag,Ur({key:t},e.attr),ql(e.child)))}function Up(r){return e=>pe.createElement(Fp,Dr({attr:Ur({},r.attr)},e),ql(r.child))}function Fp(r){var e=t=>{var{attr:n,size:s,title:i}=r,o=jp(r,Pp),a=s||t.size||"1em",u;return t.className&&(u=t.className),r.className&&(u=(u?u+" ":"")+r.className),pe.createElement("svg",Dr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,o,{className:u,style:Ur(Ur({color:r.color||t.color},t.style),r.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&pe.createElement("title",null,i),r.children)};return _l!==void 0?pe.createElement(_l.Consumer,null,t=>e(t)):e(Cl)}function kl(r){return Up({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 0 0-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"},child:[]}]})(r)}const Hp=r=>Array.isArray(r)?r:r&&r.fileList;function Il(r){var a;const{value:e,...t}=r,n=Hp(e),s=Array.isArray(n)?n.length:0,i=t.maxCount??1;let o;return s<i&&((a=t.listType)!=null&&a.startsWith("picture-")?o=ge.jsx(kl,{}):o=ge.jsx(_e.Button,{icon:ge.jsx(kl,{}),children:" 上传"})),ge.jsx(_e.Upload,{maxCount:1,multiple:!0,showUploadList:!0,...t,fileList:n,onChange:u=>{var c;return(c=t.onChange)==null?void 0:c.call(t,u.fileList)},children:s<i&&o})}const zp={upload:{renderFormItem:(r,e)=>ge.jsx(Il,{...e.fieldProps})},editor:{renderFormItem:(r,e)=>ge.jsx(Ll,{...e.fieldProps})}};function yi({children:r}){return ge.jsx(vt.ProConfigProvider,{valueTypeMap:zp,children:r})}const Vp=()=>_e.Form.useForm().pop(),Pl=r=>ge.jsx(yi,{children:ge.jsx(vt.BetaSchemaForm,{layout:"horizontal",colon:!1,labelCol:{span:3},wrapperCol:{span:6},scrollToFirstError:!0,submitter:{render:(e,t)=>ge.jsx(_e.Form.Item,{wrapperCol:{offset:4,span:8},children:ge.jsx(_e.Space,{children:t})})},...r})});Pl.useForm=Vp;function Kp(r){const{items:e,...t}={...r},n=ms.useNavigate(),i=ms.useLocation().pathname.split("/").filter(Boolean).pop(),o=e==null?void 0:e.find(u=>(u==null?void 0:u.key)==i),a=[(o==null?void 0:o.key)??""];return ge.jsxs(_e.Layout,{style:{height:"100vh"},children:[ge.jsxs(_e.Layout.Sider,{children:[ge.jsx(_e.Typography.Title,{style:{color:"white",textAlign:"center"},children:"Rainte"}),ge.jsx(_e.Menu,{mode:"inline",theme:"dark",items:e,defaultSelectedKeys:a,onClick:u=>n(u.key),...t})]}),ge.jsx(_e.Layout,{style:{overflow:"auto"},children:ge.jsx(_e.Layout.Content,{style:{minHeight:"fit-content",padding:"1rem"},children:ge.jsx(_e.Layout.Content,{style:{height:"100%",padding:"1rem",backgroundColor:"white"},children:ge.jsx(ms.Outlet,{})})})})]})}function Gp(r){return ge.jsx(yi,{children:ge.jsx(vt.ProTable,{rowKey:"id",pagination:{pageSize:10},tableAlertRender:({selectedRowKeys:e})=>ge.jsxs(_e.Space,{children:["已选 ",e.length," 项"]}),...r})})}let Fr,jl,vi;const Bl=()=>{const r=_e.App.useApp();return Fr=r.message,vi=r.modal,jl=r.notification,null},Wp=Object.freeze(Object.defineProperty({__proto__:null,default:Bl,get message(){return Fr},get modal(){return vi},get notification(){return jl},popup:{confirm:r=>vi.confirm({title:"提示",content:"确认操作?",...r}),success:(r,e)=>(r=r||"操作成功",Fr.success(r,e)),error:(r,e)=>{r=r||"操作失败",Fr.error(r,e),mo.system.fail(r)},ask:function(r,e){return this.confirm({onOk:r,...e})}},useDialog:Bl},Symbol.toStringTag,{value:"Module"})),W=r=>typeof r=="string",Kn=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},$l=r=>r==null?"":""+r,Zp=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},Xp=/###/g,Ml=r=>r&&r.indexOf("###")>-1?r.replace(Xp,"."):r,Dl=r=>!r||W(r),Gn=(r,e,t)=>{const n=W(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Dl(r))return{};const i=Ml(n[s]);!r[i]&&t&&(r[i]=new t),Object.prototype.hasOwnProperty.call(r,i)?r=r[i]:r={},++s}return Dl(r)?{}:{obj:r,k:Ml(n[s])}},Ul=(r,e,t)=>{const{obj:n,k:s}=Gn(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=Gn(r,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=Gn(r,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=t},Yp=(r,e,t,n)=>{const{obj:s,k:i}=Gn(r,e,Object);s[i]=s[i]||[],s[i].push(t)},Hr=(r,e)=>{const{obj:t,k:n}=Gn(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},Jp=(r,e,t)=>{const n=Hr(r,t);return n!==void 0?n:Hr(e,t)},Fl=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?W(r[n])||r[n]instanceof String||W(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Fl(r[n],e[n],t):r[n]=e[n]);return r},ln=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Qp={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const em=r=>W(r)?r.replace(/[&<>"'\/]/g,e=>Qp[e]):r;class tm{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const nm=[" ",",","?","!",";"],rm=new tm(20),sm=(r,e,t)=>{e=e||"",t=t||"";const n=nm.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(n.length===0)return!0;const s=rm.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(r);if(!i){const o=r.indexOf(t);o>0&&!s.test(r.substring(0,o))&&(i=!0)}return i},wi=function(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let i=0;i<n.length;){if(!s||typeof s!="object")return;let o,a="";for(let u=i;u<n.length;++u)if(u!==i&&(a+=t),a+=n[u],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&u<n.length-1)continue;i+=u-i+1;break}s=o}return s},zr=r=>r==null?void 0:r.replace("_","-"),im={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class Vr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||im,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(W(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Vr(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Vr(this.logger,e)}}var rt=new Vr;class Kr{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[a,u]=o;for(let c=0;c<u;c++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,u]=o;for(let c=0;c<u;c++)a.apply(a,[e,...n])})}}class Hl extends Kr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){var c,d;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):W(n)&&i?a.push(...n.split(i)):a.push(n)));const u=Hr(this.data,a);return!u&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),u||!o||!W(n)?u:wi((d=(c=this.data)==null?void 0:c[e])==null?void 0:d[t],n,i)}addResource(e,t,n,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),Ul(this.data,a,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in n)(W(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=n,n=t,t=a[1]),this.addNamespaces(t);let u=Hr(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Fl(u,n,i):u={...u,...n},Ul(this.data,a,u),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var zl={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(i=>{var o;e=((o=this.processors[i])==null?void 0:o.process(e,t,n,s))??e}),e}};const Vl={},Kl=r=>!W(r)&&typeof r!="boolean"&&typeof r!="number";class Gr extends Kr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Zp(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=rt.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const n=this.resolve(e,t);return(n==null?void 0:n.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!sm(e,n,s);if(o&&!a){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:W(i)?[i]:i};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(s)}return{key:e,namespaces:W(i)?[i]:i}}translate(e,t,n){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),u=a[a.length-1],c=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode"){if(d){const b=t.nsSeparator||this.options.nsSeparator;return s?{res:`${u}${b}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:`${u}${b}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:o}const g=this.resolve(e,t);let h=g==null?void 0:g.res;const p=(g==null?void 0:g.usedKey)||o,y=(g==null?void 0:g.exactUsedKey)||o,E=["[object Number]","[object Function]","[object RegExp]"],A=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,I=t.count!==void 0&&!W(t.count),B=Gr.hasDefaultValue(t),V=I?this.pluralResolver.getSuffix(c,t.count,t):"",H=t.ordinal&&I?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",ee=I&&!t.ordinal&&t.count===0,Y=ee&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${V}`]||t[`defaultValue${H}`]||t.defaultValue;let ne=h;C&&!h&&B&&(ne=Y);const ae=Kl(ne),de=Object.prototype.toString.apply(ne);if(C&&ne&&ae&&E.indexOf(de)<0&&!(W(A)&&Array.isArray(ne))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,ne,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(g.res=b,g.usedParams=this.getUsedParamsDetails(t),g):b}if(i){const b=Array.isArray(ne),N=b?[]:{},x=b?y:p;for(const q in ne)if(Object.prototype.hasOwnProperty.call(ne,q)){const m=`${x}${i}${q}`;B&&!h?N[q]=this.translate(m,{...t,defaultValue:Kl(Y)?Y[q]:void 0,joinArrays:!1,ns:a}):N[q]=this.translate(m,{...t,joinArrays:!1,ns:a}),N[q]===m&&(N[q]=ne[q])}h=N}}else if(C&&W(A)&&Array.isArray(h))h=h.join(A),h&&(h=this.extendTranslation(h,e,t,n));else{let b=!1,N=!1;!this.isValidLookup(h)&&B&&(b=!0,h=Y),this.isValidLookup(h)||(N=!0,h=o);const q=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:h,m=B&&Y!==h&&this.options.updateMissing;if(N||b||m){if(this.logger.log(m?"updateKey":"missingKey",c,u,o,m?Y:h),i){const R=this.resolve(o,{...t,keySeparator:!1});R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let w=[];const O=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&O&&O[0])for(let R=0;R<O.length;R++)w.push(O[R]);else this.options.saveMissingTo==="all"?w=this.languageUtils.toResolveHierarchy(t.lng||this.language):w.push(t.lng||this.language);const k=(R,_,T)=>{var j;const P=B&&T!==h?T:q;this.options.missingKeyHandler?this.options.missingKeyHandler(R,u,_,P,m,t):(j=this.backendConnector)!=null&&j.saveMissing&&this.backendConnector.saveMissing(R,u,_,P,m,t),this.emit("missingKey",R,u,_,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&I?w.forEach(R=>{const _=this.pluralResolver.getSuffixes(R,t);ee&&t[`defaultValue${this.options.pluralSeparator}zero`]&&_.indexOf(`${this.options.pluralSeparator}zero`)<0&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(T=>{k([R],o+T,t[`defaultValue${T}`]||Y)})}):k(w,o,Y))}h=this.extendTranslation(h,e,t,g,n),N&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${u}:${o}`),(N||b)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${o}`:o,b?h:void 0))}return s?(g.res=h,g.usedParams=this.getUsedParamsDetails(t),g):h}extendTranslation(e,t,n,s,i){var c,d;var o=this;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const g=W(e)&&(((d=n==null?void 0:n.interpolation)==null?void 0:d.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(g){const y=e.match(this.interpolator.nestingRegexp);h=y&&y.length}let p=n.replace&&!W(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,n.lng||this.language||s.usedLng,n),g){const y=e.match(this.interpolator.nestingRegexp),E=y&&y.length;h<E&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var y=arguments.length,E=new Array(y),A=0;A<y;A++)E[A]=arguments[A];return(i==null?void 0:i[0])===E[0]&&!n.context?(o.logger.warn(`It seems you are nesting recursively key: ${E[0]} in key: ${t[0]}`),null):o.translate(...E,t)},n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,u=W(a)?[a]:a;return e!=null&&(u!=null&&u.length)&&n.applyPostProcessor!==!1&&(e=zl.handle(u,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,s,i,o,a;return W(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(u,t),d=c.key;s=d;let g=c.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const h=t.count!==void 0&&!W(t.count),p=h&&!t.ordinal&&t.count===0,y=t.context!==void 0&&(W(t.context)||typeof t.context=="number")&&t.context!=="",E=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);g.forEach(A=>{var C,I;this.isValidLookup(n)||(a=A,!Vl[`${E[0]}-${A}`]&&((C=this.utils)!=null&&C.hasLoadedNamespace)&&!((I=this.utils)!=null&&I.hasLoadedNamespace(a))&&(Vl[`${E[0]}-${A}`]=!0,this.logger.warn(`key "${s}" for languages "${E.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(B=>{var ee;if(this.isValidLookup(n))return;o=B;const V=[d];if((ee=this.i18nFormat)!=null&&ee.addLookupKeys)this.i18nFormat.addLookupKeys(V,d,B,A,t);else{let Y;h&&(Y=this.pluralResolver.getSuffix(B,t.count,t));const ne=`${this.options.pluralSeparator}zero`,ae=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(V.push(d+Y),t.ordinal&&Y.indexOf(ae)===0&&V.push(d+Y.replace(ae,this.options.pluralSeparator)),p&&V.push(d+ne)),y){const de=`${d}${this.options.contextSeparator}${t.context}`;V.push(de),h&&(V.push(de+Y),t.ordinal&&Y.indexOf(ae)===0&&V.push(de+Y.replace(ae,this.options.pluralSeparator)),p&&V.push(de+ne))}}let H;for(;H=V.pop();)this.isValidLookup(n)||(i=H,n=this.getResource(B,A,H,t))}))})}),{res:n,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n){var i;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!W(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const i of t)delete s[i]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class Gl{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rt.create("languageUtils")}getScriptPartFromCode(e){if(e=zr(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=zr(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(W(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getLanguagePartFromCode(n);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),W(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return W(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):W(e)&&i(this.formatLanguageCode(e)),n.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const Wl={zero:0,one:1,two:2,few:3,many:4,other:5},Zl={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class om{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=rt.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=zr(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Zl;if(!e.match(/-|_/))return Zl;const u=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(u,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,i)=>Wl[s]-Wl[i]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Xl=function(r,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=Jp(r,e,t);return!i&&s&&W(t)&&(i=wi(r,t,n),i===void 0&&(i=wi(e,t,n))),i},Ei=r=>r.replace(/\$/g,"$$$$");class am{constructor(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=rt.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:u,formatSeparator:c,unescapeSuffix:d,unescapePrefix:g,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:y,nestingSuffixEscaped:E,nestingOptionsSeparator:A,maxReplaces:C,alwaysFormat:I}=e.interpolation;this.escape=t!==void 0?t:em,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?ln(i):o||"{{",this.suffix=a?ln(a):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?ln(h):p||ln("$t("),this.nestingSuffix=y?ln(y):E||ln(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=C||1e3,this.alwaysFormat=I!==void 0?I:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var p;let i,o,a;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=y=>{if(y.indexOf(this.formatSeparator)<0){const I=Xl(t,u,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(I,void 0,n,{...s,...t,interpolationkey:y}):I}const E=y.split(this.formatSeparator),A=E.shift().trim(),C=E.join(this.formatSeparator).trim();return this.format(Xl(t,u,A,this.options.keySeparator,this.options.ignoreJSONStructure),C,n,{...s,...t,interpolationkey:A})};this.resetRegExp();const d=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,g=((p=s==null?void 0:s.interpolation)==null?void 0:p.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>Ei(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?Ei(this.escape(y)):Ei(y)}].forEach(y=>{for(a=0;i=y.regex.exec(e);){const E=i[1].trim();if(o=c(E),o===void 0)if(typeof d=="function"){const C=d(e,i,s);o=W(C)?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,E))o="";else if(g){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${e}`),o="";else!W(o)&&!this.useRawValueToEscape&&(o=$l(o));const A=y.safeValue(o);if(e=e.replace(i[0],A),g?(y.regex.lastIndex+=o.length,y.regex.lastIndex-=i[0].length):y.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;const a=(u,c)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const g=u.split(new RegExp(`${d}[ ]*{`));let h=`{${g[1]}`;u=g[0],h=this.interpolate(h,o);const p=h.match(/'/g),y=h.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!y||y.length%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),c&&(o={...c,...o})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,E),`${u}${d}${h}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,u};for(;s=this.nestingRegexp.exec(e);){let u=[];o={...n},o=o.replace&&!W(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(g=>g.trim());s[1]=d.shift(),u=d,c=!0}if(i=t(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&!W(i))return i;W(i)||(i=$l(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),c&&(i=u.reduce((d,g)=>this.format(d,g,n.lng,{...n,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const lm=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...u]=o.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();t[d]||(t[d]=c),c==="false"&&(t[d]=!1),c==="true"&&(t[d]=!0),isNaN(c)||(t[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},un=r=>{const e={};return(t,n,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=n+JSON.stringify(i);let a=e[o];return a||(a=r(zr(n),s),e[o]=a),a(t)}};class um{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=rt.create("formatter"),this.options=e,this.formats={number:un((t,n)=>{const s=new Intl.NumberFormat(t,{...n});return i=>s.format(i)}),currency:un((t,n)=>{const s=new Intl.NumberFormat(t,{...n,style:"currency"});return i=>s.format(i)}),datetime:un((t,n)=>{const s=new Intl.DateTimeFormat(t,{...n});return i=>s.format(i)}),relativetime:un((t,n)=>{const s=new Intl.RelativeTimeFormat(t,{...n});return i=>s.format(i,n.range||"day")}),list:un((t,n)=>{const s=new Intl.ListFormat(t,{...n});return i=>s.format(i)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=un(t)}format(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(u=>u.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,u)=>{var g;const{formatName:c,formatOptions:d}=lm(u);if(this.formats[c]){let h=a;try{const p=((g=s==null?void 0:s.formatParams)==null?void 0:g[s.interpolationkey])||{},y=p.locale||p.lng||s.locale||s.lng||n;h=this.formats[c](a,y,{...d,...s,...p})}catch(p){this.logger.warn(p)}return h}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}const cm=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class hm extends Kr{constructor(e,t,n){var i,o;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=rt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,n,s.backend,s)}queueLoad(e,t,n,s){const i={},o={},a={},u={};return e.forEach(c=>{let d=!0;t.forEach(g=>{const h=`${c}|${g}`;!n.reload&&this.store.hasResourceBundle(c,g)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),i[h]===void 0&&(i[h]=!0),u[g]===void 0&&(u[g]=!0)))}),d||(a[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(u)}}loaded(e,t,n){const s=e.split("|"),i=s[0],o=s[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(u=>{Yp(u.loaded,[i],o),cm(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{a[c]||(a[c]={});const d=u.loaded[c];d.length&&d.forEach(g=>{a[c][g]===void 0&&(a[c][g]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(u=>!u.done)}read(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(c&&d&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,i*2,o)},i);return}o(c,d)},u=this.backend[n].bind(this.backend);if(u.length===2){try{const c=u(e,t);c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}return}return u(e,t,a)}prepareLoading(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();W(e)&&(e=this.languageUtils.toResolveHierarchy(e)),W(t)&&(t=[t]);const i=this.queueLoad(e,t,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=e.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,t,n,s,i){var u,c,d,g,h;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((c=(u=this.services)==null?void 0:u.utils)!=null&&c.hasLoadedNamespace&&!((g=(d=this.services)==null?void 0:d.utils)!=null&&g.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((h=this.backend)!=null&&h.create){const p={...o,isUpdate:i},y=this.backend.create.bind(this.backend);if(y.length<6)try{let E;y.length===5?E=y(e,t,n,s,p):E=y(e,t,n,s),E&&typeof E.then=="function"?E.then(A=>a(null,A)).catch(a):a(null,E)}catch(E){a(E)}else y(e,t,n,s,a,p)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const Yl=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),W(r[1])&&(e.defaultValue=r[1]),W(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Jl=r=>{var e,t;return W(r.ns)&&(r.ns=[r.ns]),W(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),W(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Wr=()=>{},fm=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Wn extends Kr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Jl(e),this.services={},this.logger=rt,this.modules={external:[]},fm(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(W(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=Yl();this.options={...s,...this.options,...Jl(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?rt.init(i(this.modules.logger),this.options):rt.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=um;const g=new Gl(this.options);this.store=new Hl(this.options.resources,this.options);const h=this.services;h.logger=rt,h.resourceStore=this.store,h.languageUtils=g,h.pluralResolver=new om(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=i(d),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new am(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new hm(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(p){for(var y=arguments.length,E=new Array(y>1?y-1:0),A=1;A<y;A++)E[A-1]=arguments[A];e.emit(p,...E)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new Gr(this.services,this.options),this.translator.on("*",function(p){for(var y=arguments.length,E=new Array(y>1?y-1:0),A=1;A<y;A++)E[A-1]=arguments[A];e.emit(p,...E)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Wr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const u=Kn(),c=()=>{const d=(g,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(h),n(g,h)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),u}loadResources(e){var i,o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wr;const s=W(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],u=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(g=>{g!=="cimode"&&a.indexOf(g)<0&&a.push(g)})};s?u(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>u(d)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,c=>u(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=Kn();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Wr),this.services.backendConnector.reload(e,t,i=>{s.resolve(),n(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&zl.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=Kn();this.emit("languageChanging",e);const i=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},o=(u,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve(function(){return n.t(...arguments)}),t&&t(u,function(){return n.t(...arguments)})},a=u=>{var d,g;!e&&!u&&this.services.languageDetector&&(u=[]);const c=W(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),(g=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||g.call(d,c)),this.loadResources(c,h=>{o(h,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,n){var s=this;const i=function(o,a){let u;if(typeof a!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),g=2;g<c;g++)d[g-2]=arguments[g];u=s.options.overloadTranslationOptionHandler([o,a].concat(d))}else u={...a};u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||n||i.keyPrefix);const h=s.options.keySeparator||".";let p;return u.keyPrefix&&Array.isArray(o)?p=o.map(y=>`${u.keyPrefix}${h}${y}`):p=u.keyPrefix?`${u.keyPrefix}${h}${o}`:o,s.t(p,u)};return W(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){var s;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(s=this.translator)==null?void 0:s.translate(...t)}exists(){var s;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(s=this.translator)==null?void 0:s.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(a,u)=>{const c=this.services.backendConnector.state[`${a}|${u}`];return c===-1||c===0||c===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!s||o(i,e)))}loadNamespaces(e,t){const n=Kn();return this.options.ns?(W(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Kn();W(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{n.resolve(),t&&t(o)}),n):(t&&t(),Promise.resolve())}dir(e){var s,i;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((i=this.services)==null?void 0:i.languageUtils)||new Gl(Yl());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Wn(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wr;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new Wn(s);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const a=Object.keys(this.store.data).reduce((u,c)=>(u[c]={...this.store.data[c]},Object.keys(u[c]).reduce((d,g)=>(d[g]={...u[c][g]},d),{})),{});i.store=new Hl(a,s),i.services.resourceStore=i.store}return i.translator=new Gr(i.services,s),i.translator.on("*",function(a){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];i.emit(a,...c)}),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Te=Wn.createInstance();Te.createInstance=Wn.createInstance;const dm=Te.createInstance,gm=Te.dir,pm=Te.init,mm=Te.loadResources,bm=Te.reloadResources,ym=Te.use,vm=Te.changeLanguage,wm=Te.getFixedT,Em=Te.t,xm=Te.exists,Am=Te.setDefaultNamespace,Tm=Te.hasLoadedNamespace,Om=Te.loadNamespaces,Sm=Te.loadLanguages;function xi(r){"@babel/helpers - typeof";return xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xi(r)}function Ql(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":xi(XMLHttpRequest))==="object"}function Nm(r){return!!r&&typeof r.then=="function"}function Lm(r){return Nm(r)?r:Promise.resolve(r)}function eu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,n)}return t}function tu(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eu(Object(t),!0).forEach(function(n){Cm(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):eu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Cm(r,e,t){return(e=_m(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _m(r){var e=Rm(r,"string");return Mt(e)=="symbol"?e:e+""}function Rm(r,e){if(Mt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Mt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Mt(r){"@babel/helpers - typeof";return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(r)}var St=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?St=global.fetch:typeof window<"u"&&window.fetch&&(St=window.fetch);var Zn;Ql()&&(typeof global<"u"&&global.XMLHttpRequest?Zn=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Zn=window.XMLHttpRequest));var Zr;if(typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Zr=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Zr=window.ActiveXObject)),typeof St!="function"&&(St=void 0),!St&&!Zn&&!Zr)try{Promise.resolve().then(()=>n1).then(function(r){St=r.default}).catch(function(){})}catch{}var Ai=function(e,t){if(t&&Mt(t)==="object"){var n="";for(var s in t)n+="&"+encodeURIComponent(s)+"="+encodeURIComponent(t[s]);if(!n)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+n.slice(1)}return e},nu=function(e,t,n,s){var i=function(u){if(!u.ok)return n(u.statusText||"Error",{status:u.status});u.text().then(function(c){n(null,{status:u.status,data:c})}).catch(n)};if(s){var o=s(e,t);if(o instanceof Promise){o.then(i).catch(n);return}}typeof fetch=="function"?fetch(e,t).then(i).catch(n):St(e,t).then(i).catch(n)},ru=!1,qm=function(e,t,n,s){e.queryStringParams&&(t=Ai(t,e.queryStringParams));var i=tu({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(i["Content-Type"]="application/json");var o=typeof e.requestOptions=="function"?e.requestOptions(n):e.requestOptions,a=tu({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:i},ru?{}:o),u=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{nu(t,a,s,u)}catch(c){if(!o||Object.keys(o).length===0||!c.message||c.message.indexOf("not implemented")<0)return s(c);try{Object.keys(o).forEach(function(d){delete a[d]}),nu(t,a,s,u),ru=!0}catch(d){s(d)}}},km=function(e,t,n,s){n&&Mt(n)==="object"&&(n=Ai("",n).slice(1)),e.queryStringParams&&(t=Ai(t,e.queryStringParams));try{var i=Zn?new Zn:new Zr("MSXML2.XMLHTTP.3.0");i.open(n?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var o=e.customHeaders;if(o=typeof o=="function"?o():o,o)for(var a in o)i.setRequestHeader(a,o[a]);i.onreadystatechange=function(){i.readyState>3&&s(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(u){console&&console.log(u)}},Im=function(e,t,n,s){if(typeof n=="function"&&(s=n,n=void 0),s=s||function(){},St&&t.indexOf("file:")!==0)return qm(e,t,n,s);if(Ql()||typeof ActiveXObject=="function")return km(e,t,n,s);s(new Error("No fetch and no xhr implementation found!"))};function cn(r){"@babel/helpers - typeof";return cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cn(r)}function su(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,n)}return t}function Ti(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?su(Object(t),!0).forEach(function(n){iu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):su(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Pm(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function jm(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,ou(n.key),n)}}function Bm(r,e,t){return e&&jm(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function iu(r,e,t){return(e=ou(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ou(r){var e=$m(r,"string");return cn(e)=="symbol"?e:e+""}function $m(r,e){if(cn(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(cn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var Mm=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,n,s){return iu({},n,s||"")},parseLoadPayload:function(t,n){},request:Im,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},au=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Pm(this,r),this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}return Bm(r,[{key:"init",value:function(t){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=t,this.options=Ti(Ti(Ti({},Mm()),this.options||{}),s),this.allOptions=i,this.services&&this.options.reloadInterval){var o=setInterval(function(){return n.reload()},this.options.reloadInterval);cn(o)==="object"&&typeof o.unref=="function"&&o.unref()}}},{key:"readMulti",value:function(t,n,s){this._readAny(t,t,n,n,s)}},{key:"read",value:function(t,n,s){this._readAny([t],t,[n],n,s)}},{key:"_readAny",value:function(t,n,s,i,o){var a=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(t,s)),u=Lm(u),u.then(function(c){if(!c)return o(null,{});var d=a.services.interpolator.interpolate(c,{lng:t.join("+"),ns:s.join("+")});a.loadUrl(d,o,n,i)})}},{key:"loadUrl",value:function(t,n,s,i){var o=this,a=typeof s=="string"?[s]:s,u=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(a,u);this.options.request(this.options,t,c,function(d,g){if(g&&(g.status>=500&&g.status<600||!g.status))return n("failed loading "+t+"; status code: "+g.status,!0);if(g&&g.status>=400&&g.status<500)return n("failed loading "+t+"; status code: "+g.status,!1);if(!g&&d&&d.message){var h=d.message.toLowerCase(),p=["failed","fetch","network","load"].find(function(A){return h.indexOf(A)>-1});if(p)return n("failed loading "+t+": "+d.message,!0)}if(d)return n(d,!1);var y,E;try{typeof g.data=="string"?y=o.options.parse(g.data,s,i):y=g.data}catch{E="failed parsing "+t+" to json"}if(E)return n(E,!1);n(null,y)})}},{key:"create",value:function(t,n,s,i,o){var a=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var u=this.options.parsePayload(n,s,i),c=0,d=[],g=[];t.forEach(function(h){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(h,n));var y=a.services.interpolator.interpolate(p,{lng:h,ns:n});a.options.request(a.options,y,u,function(E,A){c+=1,d.push(E),g.push(A),c===t.length&&typeof o=="function"&&o(d,g)})})}}},{key:"reload",value:function(){var t=this,n=this.services,s=n.backendConnector,i=n.languageUtils,o=n.logger,a=s.language;if(!(a&&a.toLowerCase()==="cimode")){var u=[],c=function(g){var h=i.toResolveHierarchy(g);h.forEach(function(p){u.indexOf(p)<0&&u.push(p)})};c(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return c(d)}),u.forEach(function(d){t.allOptions.ns.forEach(function(g){s.read(d,g,"read",null,null,function(h,p){h&&o.warn("loading namespace ".concat(g," for language ").concat(d," failed"),h),!h&&p&&o.log("loaded namespace ".concat(g," for language ").concat(d),p),s.loaded("".concat(d,"|").concat(g),h,p)})})})}}}])}();au.type="backend";const{slice:Dm,forEach:Um}=[];function Fm(r){return Um.call(Dm.call(arguments,1),e=>{if(e)for(const t in e)r[t]===void 0&&(r[t]=e[t])}),r}const lu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Hm=function(r,e){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let i=`${r}=${s}`;if(n.maxAge>0){const o=n.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(n.domain){if(!lu.test(n.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${n.domain}`}if(n.path){if(!lu.test(n.path))throw new TypeError("option path is invalid");i+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},uu={create(r,e,t,n){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+t*60*1e3)),n&&(s.domain=n),document.cookie=Hm(r,encodeURIComponent(e),s)},read(r){const e=`${r}=`,t=document.cookie.split(";");for(let n=0;n<t.length;n++){let s=t[n];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(r){this.create(r,"",-1)}};var zm={name:"cookie",lookup(r){let{lookupCookie:e}=r;if(e&&typeof document<"u")return uu.read(e)||void 0},cacheUserLanguage(r,e){let{lookupCookie:t,cookieMinutes:n,cookieDomain:s,cookieOptions:i}=e;t&&typeof document<"u"&&uu.create(t,r,n,s,i)}},Vm={name:"querystring",lookup(r){var n;let{lookupQuerystring:e}=r,t;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((n=window.location.hash)==null?void 0:n.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let a=0;a<o.length;a++){const u=o[a].indexOf("=");u>0&&o[a].substring(0,u)===e&&(t=o[a].substring(u+1))}}return t}};let hn=null;const cu=()=>{if(hn!==null)return hn;try{if(hn=typeof window<"u"&&window.localStorage!==null,!hn)return!1;const r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{hn=!1}return hn};var Km={name:"localStorage",lookup(r){let{lookupLocalStorage:e}=r;if(e&&cu())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(r,e){let{lookupLocalStorage:t}=e;t&&cu()&&window.localStorage.setItem(t,r)}};let fn=null;const hu=()=>{if(fn!==null)return fn;try{if(fn=typeof window<"u"&&window.sessionStorage!==null,!fn)return!1;const r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{fn=!1}return fn};var Gm={name:"sessionStorage",lookup(r){let{lookupSessionStorage:e}=r;if(e&&hu())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(r,e){let{lookupSessionStorage:t}=e;t&&hu()&&window.sessionStorage.setItem(t,r)}},Wm={name:"navigator",lookup(r){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:n,language:s}=navigator;if(t)for(let i=0;i<t.length;i++)e.push(t[i]);n&&e.push(n),s&&e.push(s)}return e.length>0?e:void 0}},Zm={name:"htmlTag",lookup(r){let{htmlTag:e}=r,t;const n=e||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(t=n.getAttribute("lang")),t}},Xm={name:"path",lookup(r){var s;let{lookupFromPathIndex:e}=r;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?(s=t[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},Ym={name:"subdomain",lookup(r){var s,i;let{lookupFromSubdomainIndex:e}=r;const t=typeof e=="number"?e+1:1,n=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[t]}};let fu=!1;try{document.cookie,fu=!0}catch{}const du=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];fu||du.splice(1,1);const Jm=()=>({order:du,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:r=>r});class gu{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Fm(t,this.options||{},Jm()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(zm),this.addDetector(Vm),this.addDetector(Km),this.addDetector(Gm),this.addDetector(Wm),this.addDetector(Zm),this.addDetector(Xm),this.addDetector(Ym)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(n=>{if(this.detectors[n]){let s=this.detectors[n].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(t=t.concat(s))}}),t=t.map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(e,this.options)}))}}gu.type="languageDetector";const pu="i18nextLng",Oi="zh";Te.use(au).use(gu).init({lng:mo.storage.local.getRaw(pu,Oi),fallbackLng:Oi,backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1}});const Qm=Object.freeze(Object.defineProperty({__proto__:null,KEY:pu,LNG_ZH:Oi,changeLanguage:vm,createInstance:dm,dir:gm,exists:xm,getFixedT:wm,hasLoadedNamespace:Tm,init:pm,loadLanguages:Sm,loadNamespaces:Om,loadResources:mm,reloadResources:bm,setDefaultNamespace:Am,t:Em,use:ym},Symbol.toStringTag,{value:"Module"})),e1=Object.freeze(Object.defineProperty({__proto__:null,onUpload:async r=>{const{file:e,onProgress:t,onSuccess:n}=r;let s=0;const i=setInterval(()=>{s+=Math.floor(Math.random()*10),s>=100&&(s=99),t({percent:s})},100);e.url=URL.createObjectURL(e),n==null||n({url:e.url}),clearInterval(i)}},Symbol.toStringTag,{value:"Module"}));var Xr={exports:{}},mu;function t1(){return mu||(mu=1,function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Ye<"u"&&Ye,n=function(){function i(){this.fetch=!1,this.DOMException=t.DOMException}return i.prototype=t,new i}();(function(i){(function(o){var a=typeof i<"u"&&i||typeof self<"u"&&self||typeof a<"u"&&a,u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(m){return m&&DataView.prototype.isPrototypeOf(m)}if(u.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=ArrayBuffer.isView||function(m){return m&&d.indexOf(Object.prototype.toString.call(m))>-1};function h(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(m)||m==="")throw new TypeError('Invalid character in header field name: "'+m+'"');return m.toLowerCase()}function p(m){return typeof m!="string"&&(m=String(m)),m}function y(m){var w={next:function(){var O=m.shift();return{done:O===void 0,value:O}}};return u.iterable&&(w[Symbol.iterator]=function(){return w}),w}function E(m){this.map={},m instanceof E?m.forEach(function(w,O){this.append(O,w)},this):Array.isArray(m)?m.forEach(function(w){this.append(w[0],w[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(w){this.append(w,m[w])},this)}E.prototype.append=function(m,w){m=h(m),w=p(w);var O=this.map[m];this.map[m]=O?O+", "+w:w},E.prototype.delete=function(m){delete this.map[h(m)]},E.prototype.get=function(m){return m=h(m),this.has(m)?this.map[m]:null},E.prototype.has=function(m){return this.map.hasOwnProperty(h(m))},E.prototype.set=function(m,w){this.map[h(m)]=p(w)},E.prototype.forEach=function(m,w){for(var O in this.map)this.map.hasOwnProperty(O)&&m.call(w,this.map[O],O,this)},E.prototype.keys=function(){var m=[];return this.forEach(function(w,O){m.push(O)}),y(m)},E.prototype.values=function(){var m=[];return this.forEach(function(w){m.push(w)}),y(m)},E.prototype.entries=function(){var m=[];return this.forEach(function(w,O){m.push([O,w])}),y(m)},u.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function A(m){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}function C(m){return new Promise(function(w,O){m.onload=function(){w(m.result)},m.onerror=function(){O(m.error)}})}function I(m){var w=new FileReader,O=C(w);return w.readAsArrayBuffer(m),O}function B(m){var w=new FileReader,O=C(w);return w.readAsText(m),O}function V(m){for(var w=new Uint8Array(m),O=new Array(w.length),k=0;k<w.length;k++)O[k]=String.fromCharCode(w[k]);return O.join("")}function H(m){if(m.slice)return m.slice(0);var w=new Uint8Array(m.byteLength);return w.set(new Uint8Array(m)),w.buffer}function ee(){return this.bodyUsed=!1,this._initBody=function(m){this.bodyUsed=this.bodyUsed,this._bodyInit=m,m?typeof m=="string"?this._bodyText=m:u.blob&&Blob.prototype.isPrototypeOf(m)?this._bodyBlob=m:u.formData&&FormData.prototype.isPrototypeOf(m)?this._bodyFormData=m:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)?this._bodyText=m.toString():u.arrayBuffer&&u.blob&&c(m)?(this._bodyArrayBuffer=H(m.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(m)||g(m))?this._bodyArrayBuffer=H(m):this._bodyText=m=Object.prototype.toString.call(m):this._bodyText="",this.headers.get("content-type")||(typeof m=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var m=A(this);if(m)return m;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var m=A(this);return m||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(I)}),this.text=function(){var m=A(this);if(m)return m;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(V(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(de)}),this.json=function(){return this.text().then(JSON.parse)},this}var Y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ne(m){var w=m.toUpperCase();return Y.indexOf(w)>-1?w:m}function ae(m,w){if(!(this instanceof ae))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');w=w||{};var O=w.body;if(m instanceof ae){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,w.headers||(this.headers=new E(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!O&&m._bodyInit!=null&&(O=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=w.credentials||this.credentials||"same-origin",(w.headers||!this.headers)&&(this.headers=new E(w.headers)),this.method=ne(w.method||this.method||"GET"),this.mode=w.mode||this.mode||null,this.signal=w.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(O),(this.method==="GET"||this.method==="HEAD")&&(w.cache==="no-store"||w.cache==="no-cache")){var k=/([?&])_=[^&]*/;if(k.test(this.url))this.url=this.url.replace(k,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}ae.prototype.clone=function(){return new ae(this,{body:this._bodyInit})};function de(m){var w=new FormData;return m.trim().split("&").forEach(function(O){if(O){var k=O.split("="),R=k.shift().replace(/\+/g," "),_=k.join("=").replace(/\+/g," ");w.append(decodeURIComponent(R),decodeURIComponent(_))}}),w}function b(m){var w=new E,O=m.replace(/\r?\n[\t ]+/g," ");return O.split("\r").map(function(k){return k.indexOf(`
|
|
71
|
+
`)===0?k.substr(1,k.length):k}).forEach(function(k){var R=k.split(":"),_=R.shift().trim();if(_){var T=R.join(":").trim();w.append(_,T)}}),w}ee.call(ae.prototype);function N(m,w){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');w||(w={}),this.type="default",this.status=w.status===void 0?200:w.status,this.ok=this.status>=200&&this.status<300,this.statusText=w.statusText===void 0?"":""+w.statusText,this.headers=new E(w.headers),this.url=w.url||"",this._initBody(m)}ee.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},N.error=function(){var m=new N(null,{status:0,statusText:""});return m.type="error",m};var x=[301,302,303,307,308];N.redirect=function(m,w){if(x.indexOf(w)===-1)throw new RangeError("Invalid status code");return new N(null,{status:w,headers:{location:m}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(w,O){this.message=w,this.name=O;var k=Error(w);this.stack=k.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function q(m,w){return new Promise(function(O,k){var R=new ae(m,w);if(R.signal&&R.signal.aborted)return k(new o.DOMException("Aborted","AbortError"));var _=new XMLHttpRequest;function T(){_.abort()}_.onload=function(){var j={status:_.status,statusText:_.statusText,headers:b(_.getAllResponseHeaders()||"")};j.url="responseURL"in _?_.responseURL:j.headers.get("X-Request-URL");var z="response"in _?_.response:_.responseText;setTimeout(function(){O(new N(z,j))},0)},_.onerror=function(){setTimeout(function(){k(new TypeError("Network request failed"))},0)},_.ontimeout=function(){setTimeout(function(){k(new TypeError("Network request failed"))},0)},_.onabort=function(){setTimeout(function(){k(new o.DOMException("Aborted","AbortError"))},0)};function P(j){try{return j===""&&a.location.href?a.location.href:j}catch{return j}}_.open(R.method,P(R.url),!0),R.credentials==="include"?_.withCredentials=!0:R.credentials==="omit"&&(_.withCredentials=!1),"responseType"in _&&(u.blob?_.responseType="blob":u.arrayBuffer&&R.headers.get("Content-Type")&&R.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(_.responseType="arraybuffer")),w&&typeof w.headers=="object"&&!(w.headers instanceof E)?Object.getOwnPropertyNames(w.headers).forEach(function(j){_.setRequestHeader(j,p(w.headers[j]))}):R.headers.forEach(function(j,z){_.setRequestHeader(z,j)}),R.signal&&(R.signal.addEventListener("abort",T),_.onreadystatechange=function(){_.readyState===4&&R.signal.removeEventListener("abort",T)}),_.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return q.polyfill=!0,a.fetch||(a.fetch=q,a.Headers=E,a.Request=ae,a.Response=N),o.Headers=E,o.Request=ae,o.Response=N,o.fetch=q,o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=t.fetch?t:n;e=s.fetch,e.default=s.fetch,e.fetch=s.fetch,e.Headers=s.Headers,e.Request=s.Request,e.Response=s.Response,r.exports=e}(Xr,Xr.exports)),Xr.exports}var bu=t1();const n1=wu({__proto__:null,default:bs(bu)},[bu]);Q.Editor=Ll,Q.Form=Pl,Q.Menu=Kp,Q.Provider=yi,Q.Table=Gp,Q.Upload=Il,Q.dialog=Wp,Q.i18n=Qm,Q.misc=e1,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
|