@rainte/ant 0.0.44 → 0.0.45

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.
@@ -1,4 +1,4 @@
1
- (function(We,st){typeof exports=="object"&&typeof module<"u"?st(exports,require("react"),require("@ant-design/pro-components"),require("antd"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","@ant-design/pro-components","antd","react-router-dom"],st):(We=typeof globalThis<"u"?globalThis:We||self,st(We["@rainte/react"]={},We.React,We.proComponents,We.antd,We.reactRouterDom))})(this,function(We,st,Or,Bt,$o){"use strict";var Dw=Object.defineProperty;var Mw=(We,st,Or)=>st in We?Dw(We,st,{enumerable:!0,configurable:!0,writable:!0,value:Or}):We[st]=Or;var Oe=(We,st,Or)=>Mw(We,typeof st!="symbol"?st+"":st,Or);function Bh(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Do(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ps={exports:{}},Ji={};/**
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
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
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 _l;function Uh(){if(_l)return Ji;_l=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var u in i)u!=="key"&&(s[u]=i[u])}else s=i;return i=s.ref,{$$typeof:r,type:n,key:a,ref:i!==void 0?i:null,props:s}}return Ji.Fragment=e,Ji.jsx=t,Ji.jsxs=t,Ji}var Zi={},Nl;function Fh(){if(Nl)return Zi;Nl=1;var r={};/**
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
  *
@@ -14,65 +14,58 @@
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 r.NODE_ENV!=="production"&&function(){function e($){if($==null)return null;if(typeof $=="function")return $.$$typeof===A?null:$.displayName||$.name||null;if(typeof $=="string")return $;switch($){case N:return"Fragment";case J:return"Profiler";case M:return"StrictMode";case ce:return"Suspense";case ne:return"SuspenseList";case Ee:return"Activity"}if(typeof $=="object")switch(typeof $.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),$.$$typeof){case O:return"Portal";case de:return($.displayName||"Context")+".Provider";case Q:return($._context.displayName||"Context")+".Consumer";case ue:var se=$.render;return $=$.displayName,$||($=se.displayName||se.name||"",$=$!==""?"ForwardRef("+$+")":"ForwardRef"),$;case re:return se=$.displayName||null,se!==null?se:e($.type)||"Memo";case we:se=$._payload,$=$._init;try{return e($(se))}catch{}}return null}function t($){return""+$}function n($){try{t($);var se=!1}catch{se=!0}if(se){se=console;var le=se.error,be=typeof Symbol=="function"&&Symbol.toStringTag&&$[Symbol.toStringTag]||$.constructor.name||"Object";return le.call(se,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",be),t($)}}function i($){if($===N)return"<>";if(typeof $=="object"&&$!==null&&$.$$typeof===we)return"<...>";try{var se=e($);return se?"<"+se+">":"<...>"}catch{return"<...>"}}function s(){var $=W.A;return $===null?null:$.getOwner()}function a(){return Error("react-stack-top-frame")}function u($){if(R.call($,"key")){var se=Object.getOwnPropertyDescriptor($,"key").get;if(se&&se.isReactWarning)return!1}return $.key!==void 0}function f($,se){function le(){T||(T=!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)",se))}le.isReactWarning=!0,Object.defineProperty($,"key",{get:le,configurable:!0})}function d(){var $=e(this.type);return j[$]||(j[$]=!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.")),$=this.props.ref,$!==void 0?$:null}function m($,se,le,be,ge,Pe,Be,Re){return le=Pe.ref,$={$$typeof:S,type:$,key:se,props:Pe,_owner:ge},(le!==void 0?le:null)!==null?Object.defineProperty($,"ref",{enumerable:!1,get:d}):Object.defineProperty($,"ref",{enumerable:!1,value:null}),$._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty($,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty($,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Be}),Object.defineProperty($,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Re}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$}function w($,se,le,be,ge,Pe,Be,Re){var ae=se.children;if(ae!==void 0)if(be)if(V(ae)){for(be=0;be<ae.length;be++)y(ae[be]);Object.freeze&&Object.freeze(ae)}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 y(ae);if(R.call(se,"key")){ae=e($);var ke=Object.keys(se).filter(function(Se){return Se!=="key"});be=0<ke.length?"{key: someKey, "+ke.join(": ..., ")+": ...}":"{key: someKey}",z[ae+be]||(ke=0<ke.length?"{"+ke.join(": ..., ")+": ...}":"{}",console.error(`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:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,be,ae,ke,ae),z[ae+be]=!0)}if(ae=null,le!==void 0&&(n(le),ae=""+le),u(se)&&(n(se.key),ae=""+se.key),"key"in se){le={};for(var qe in se)qe!=="key"&&(le[qe]=se[qe])}else le=se;return ae&&f(le,typeof $=="function"?$.displayName||$.name||"Unknown":$),m($,ae,Pe,ge,s(),le,Be,Re)}function y($){typeof $=="object"&&$!==null&&$.$$typeof===S&&$._store&&($._store.validated=1)}var x=st,S=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),de=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),Ee=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),W=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,V=Array.isArray,E=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function($){return $()}};var T,j={},U=x["react-stack-bottom-frame"].bind(x,a)(),Y=E(i(a)),z={};Zi.Fragment=N,Zi.jsx=function($,se,le,be,ge){var Pe=1e4>W.recentlyCreatedOwnerStacks++;return w($,se,le,!1,be,ge,Pe?Error("react-stack-top-frame"):U,Pe?E(i($)):Y)},Zi.jsxs=function($,se,le,be,ge){var Pe=1e4>W.recentlyCreatedOwnerStacks++;return w($,se,le,!0,be,ge,Pe?Error("react-stack-top-frame"):U,Pe?E(i($)):Y)}}(),Zi}var Cl;function Kh(){if(Cl)return Ps.exports;Cl=1;var r={};return r.NODE_ENV==="production"?Ps.exports=Uh():Ps.exports=Fh(),Ps.exports}var rt=Kh(),Ll=typeof global=="object"&&global&&global.Object===Object&&global,Hh=typeof self=="object"&&self&&self.Object===Object&&self,$n=Ll||Hh||Function("return this")(),Sr=$n.Symbol,kl=Object.prototype,zh=kl.hasOwnProperty,Vh=kl.toString,Xi=Sr?Sr.toStringTag:void 0;function Wh(r){var e=zh.call(r,Xi),t=r[Xi];try{r[Xi]=void 0;var n=!0}catch{}var i=Vh.call(r);return n&&(e?r[Xi]=t:delete r[Xi]),i}var Gh=Object.prototype,Yh=Gh.toString;function Jh(r){return Yh.call(r)}var Zh="[object Null]",Xh="[object Undefined]",Rl=Sr?Sr.toStringTag:void 0;function gi(r){return r==null?r===void 0?Xh:Zh:Rl&&Rl in Object(r)?Wh(r):Jh(r)}function or(r){return r!=null&&typeof r=="object"}var zr=Array.isArray;function Ar(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function Pl(r){return r}var Qh="[object AsyncFunction]",ed="[object Function]",td="[object GeneratorFunction]",nd="[object Proxy]";function Mo(r){if(!Ar(r))return!1;var e=gi(r);return e==ed||e==td||e==Qh||e==nd}var Bo=$n["__core-js_shared__"],ql=function(){var r=/[^.]+$/.exec(Bo&&Bo.keys&&Bo.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function rd(r){return!!ql&&ql in r}var id=Function.prototype,sd=id.toString;function Vr(r){if(r!=null){try{return sd.call(r)}catch{}try{return r+""}catch{}}return""}var od=/[\\^$.*+?()[\]{}|]/g,ad=/^\[object .+?Constructor\]$/,ld=Function.prototype,ud=Object.prototype,cd=ld.toString,fd=ud.hasOwnProperty,hd=RegExp("^"+cd.call(fd).replace(od,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dd(r){if(!Ar(r)||rd(r))return!1;var e=Mo(r)?hd:ad;return e.test(Vr(r))}function pd(r,e){return r==null?void 0:r[e]}function Wr(r,e){var t=pd(r,e);return dd(t)?t:void 0}var Uo=Wr($n,"WeakMap"),Il=Object.create,gd=function(){function r(){}return function(e){if(!Ar(e))return{};if(Il)return Il(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function md(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 yd(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var bd=800,vd=16,wd=Date.now;function xd(r){var e=0,t=0;return function(){var n=wd(),i=vd-(n-t);if(t=n,i>0){if(++e>=bd)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}function Ed(r){return function(){return r}}var qs=function(){try{var r=Wr(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Od=qs?function(r,e){return qs(r,"toString",{configurable:!0,enumerable:!1,value:Ed(e),writable:!0})}:Pl,Sd=xd(Od);function Ad(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Td=9007199254740991,_d=/^(?:0|[1-9]\d*)$/;function jl(r,e){var t=typeof r;return e=e??Td,!!e&&(t=="number"||t!="symbol"&&_d.test(r))&&r>-1&&r%1==0&&r<e}function Fo(r,e,t){e=="__proto__"&&qs?qs(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}function Qi(r,e){return r===e||r!==r&&e!==e}var Nd=Object.prototype,Cd=Nd.hasOwnProperty;function $l(r,e,t){var n=r[e];(!(Cd.call(r,e)&&Qi(n,t))||t===void 0&&!(e in r))&&Fo(r,e,t)}function Ld(r,e,t,n){var i=!t;t||(t={});for(var s=-1,a=e.length;++s<a;){var u=e[s],f=void 0;f===void 0&&(f=r[u]),i?Fo(t,u,f):$l(t,u,f)}return t}var Dl=Math.max;function kd(r,e,t){return e=Dl(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,s=Dl(n.length-e,0),a=Array(s);++i<s;)a[i]=n[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=n[i];return u[e]=t(a),md(r,this,u)}}function Rd(r,e){return Sd(kd(r,e,Pl),r+"")}var Pd=9007199254740991;function Ml(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Pd}function Is(r){return r!=null&&Ml(r.length)&&!Mo(r)}function qd(r,e,t){if(!Ar(t))return!1;var n=typeof e;return(n=="number"?Is(t)&&jl(e,t.length):n=="string"&&e in t)?Qi(t[e],r):!1}function Id(r){return Rd(function(e,t){var n=-1,i=t.length,s=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(s=r.length>3&&typeof s=="function"?(i--,s):void 0,a&&qd(t[0],t[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var u=t[n];u&&r(e,u,n,s)}return e})}var jd=Object.prototype;function Ko(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||jd;return r===t}function $d(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Dd="[object Arguments]";function Bl(r){return or(r)&&gi(r)==Dd}var Ul=Object.prototype,Md=Ul.hasOwnProperty,Bd=Ul.propertyIsEnumerable,Ho=Bl(function(){return arguments}())?Bl:function(r){return or(r)&&Md.call(r,"callee")&&!Bd.call(r,"callee")};function Ud(){return!1}var Fl=typeof We=="object"&&We&&!We.nodeType&&We,Kl=Fl&&typeof module=="object"&&module&&!module.nodeType&&module,Fd=Kl&&Kl.exports===Fl,Hl=Fd?$n.Buffer:void 0,Kd=Hl?Hl.isBuffer:void 0,es=Kd||Ud,Hd="[object Arguments]",zd="[object Array]",Vd="[object Boolean]",Wd="[object Date]",Gd="[object Error]",Yd="[object Function]",Jd="[object Map]",Zd="[object Number]",Xd="[object Object]",Qd="[object RegExp]",ep="[object Set]",tp="[object String]",np="[object WeakMap]",rp="[object ArrayBuffer]",ip="[object DataView]",sp="[object Float32Array]",op="[object Float64Array]",ap="[object Int8Array]",lp="[object Int16Array]",up="[object Int32Array]",cp="[object Uint8Array]",fp="[object Uint8ClampedArray]",hp="[object Uint16Array]",dp="[object Uint32Array]",tt={};tt[sp]=tt[op]=tt[ap]=tt[lp]=tt[up]=tt[cp]=tt[fp]=tt[hp]=tt[dp]=!0,tt[Hd]=tt[zd]=tt[rp]=tt[Vd]=tt[ip]=tt[Wd]=tt[Gd]=tt[Yd]=tt[Jd]=tt[Zd]=tt[Xd]=tt[Qd]=tt[ep]=tt[tp]=tt[np]=!1;function pp(r){return or(r)&&Ml(r.length)&&!!tt[gi(r)]}function zo(r){return function(e){return r(e)}}var zl=typeof We=="object"&&We&&!We.nodeType&&We,ts=zl&&typeof module=="object"&&module&&!module.nodeType&&module,gp=ts&&ts.exports===zl,Vo=gp&&Ll.process,mi=function(){try{var r=ts&&ts.require&&ts.require("util").types;return r||Vo&&Vo.binding&&Vo.binding("util")}catch{}}(),Vl=mi&&mi.isTypedArray,Wo=Vl?zo(Vl):pp,mp=Object.prototype,yp=mp.hasOwnProperty;function Wl(r,e){var t=zr(r),n=!t&&Ho(r),i=!t&&!n&&es(r),s=!t&&!n&&!i&&Wo(r),a=t||n||i||s,u=a?$d(r.length,String):[],f=u.length;for(var d in r)(e||yp.call(r,d))&&!(a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||jl(d,f)))&&u.push(d);return u}function Gl(r,e){return function(t){return r(e(t))}}var bp=Gl(Object.keys,Object),vp=Object.prototype,wp=vp.hasOwnProperty;function xp(r){if(!Ko(r))return bp(r);var e=[];for(var t in Object(r))wp.call(r,t)&&t!="constructor"&&e.push(t);return e}function Ep(r){return Is(r)?Wl(r):xp(r)}function Op(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Sp=Object.prototype,Ap=Sp.hasOwnProperty;function Tp(r){if(!Ar(r))return Op(r);var e=Ko(r),t=[];for(var n in r)n=="constructor"&&(e||!Ap.call(r,n))||t.push(n);return t}function Yl(r){return Is(r)?Wl(r,!0):Tp(r)}var ns=Wr(Object,"create");function _p(){this.__data__=ns?ns(null):{},this.size=0}function Np(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Cp="__lodash_hash_undefined__",Lp=Object.prototype,kp=Lp.hasOwnProperty;function Rp(r){var e=this.__data__;if(ns){var t=e[r];return t===Cp?void 0:t}return kp.call(e,r)?e[r]:void 0}var Pp=Object.prototype,qp=Pp.hasOwnProperty;function Ip(r){var e=this.__data__;return ns?e[r]!==void 0:qp.call(e,r)}var jp="__lodash_hash_undefined__";function $p(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=ns&&e===void 0?jp:e,this}function Gr(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])}}Gr.prototype.clear=_p,Gr.prototype.delete=Np,Gr.prototype.get=Rp,Gr.prototype.has=Ip,Gr.prototype.set=$p;function Dp(){this.__data__=[],this.size=0}function js(r,e){for(var t=r.length;t--;)if(Qi(r[t][0],e))return t;return-1}var Mp=Array.prototype,Bp=Mp.splice;function Up(r){var e=this.__data__,t=js(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Bp.call(e,t,1),--this.size,!0}function Fp(r){var e=this.__data__,t=js(e,r);return t<0?void 0:e[t][1]}function Kp(r){return js(this.__data__,r)>-1}function Hp(r,e){var t=this.__data__,n=js(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}function ar(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])}}ar.prototype.clear=Dp,ar.prototype.delete=Up,ar.prototype.get=Fp,ar.prototype.has=Kp,ar.prototype.set=Hp;var rs=Wr($n,"Map");function zp(){this.size=0,this.__data__={hash:new Gr,map:new(rs||ar),string:new Gr}}function Vp(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function $s(r,e){var t=r.__data__;return Vp(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Wp(r){var e=$s(this,r).delete(r);return this.size-=e?1:0,e}function Gp(r){return $s(this,r).get(r)}function Yp(r){return $s(this,r).has(r)}function Jp(r,e){var t=$s(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}function Yr(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])}}Yr.prototype.clear=zp,Yr.prototype.delete=Wp,Yr.prototype.get=Gp,Yr.prototype.has=Yp,Yr.prototype.set=Jp;function Zp(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Jl=Gl(Object.getPrototypeOf,Object),Xp="[object Object]",Qp=Function.prototype,eg=Object.prototype,Zl=Qp.toString,tg=eg.hasOwnProperty,ng=Zl.call(Object);function rg(r){if(!or(r)||gi(r)!=Xp)return!1;var e=Jl(r);if(e===null)return!0;var t=tg.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Zl.call(t)==ng}function ig(){this.__data__=new ar,this.size=0}function sg(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function og(r){return this.__data__.get(r)}function ag(r){return this.__data__.has(r)}var lg=200;function ug(r,e){var t=this.__data__;if(t instanceof ar){var n=t.__data__;if(!rs||n.length<lg-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Yr(n)}return t.set(r,e),this.size=t.size,this}function Dn(r){var e=this.__data__=new ar(r);this.size=e.size}Dn.prototype.clear=ig,Dn.prototype.delete=sg,Dn.prototype.get=og,Dn.prototype.has=ag,Dn.prototype.set=ug;var Xl=typeof We=="object"&&We&&!We.nodeType&&We,Ql=Xl&&typeof module=="object"&&module&&!module.nodeType&&module,cg=Ql&&Ql.exports===Xl,eu=cg?$n.Buffer:void 0,tu=eu?eu.allocUnsafe:void 0;function nu(r,e){if(e)return r.slice();var t=r.length,n=tu?tu(t):new r.constructor(t);return r.copy(n),n}function fg(r,e){for(var t=-1,n=r==null?0:r.length,i=0,s=[];++t<n;){var a=r[t];e(a,t,r)&&(s[i++]=a)}return s}function hg(){return[]}var dg=Object.prototype,pg=dg.propertyIsEnumerable,ru=Object.getOwnPropertySymbols,gg=ru?function(r){return r==null?[]:(r=Object(r),fg(ru(r),function(e){return pg.call(r,e)}))}:hg;function mg(r,e,t){var n=e(r);return zr(r)?n:Zp(n,t(r))}function Go(r){return mg(r,Ep,gg)}var Yo=Wr($n,"DataView"),Jo=Wr($n,"Promise"),Zo=Wr($n,"Set"),iu="[object Map]",yg="[object Object]",su="[object Promise]",ou="[object Set]",au="[object WeakMap]",lu="[object DataView]",bg=Vr(Yo),vg=Vr(rs),wg=Vr(Jo),xg=Vr(Zo),Eg=Vr(Uo),mn=gi;(Yo&&mn(new Yo(new ArrayBuffer(1)))!=lu||rs&&mn(new rs)!=iu||Jo&&mn(Jo.resolve())!=su||Zo&&mn(new Zo)!=ou||Uo&&mn(new Uo)!=au)&&(mn=function(r){var e=gi(r),t=e==yg?r.constructor:void 0,n=t?Vr(t):"";if(n)switch(n){case bg:return lu;case vg:return iu;case wg:return su;case xg:return ou;case Eg:return au}return e});var Og=Object.prototype,Sg=Og.hasOwnProperty;function Ag(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&Sg.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var Ds=$n.Uint8Array;function Xo(r){var e=new r.constructor(r.byteLength);return new Ds(e).set(new Ds(r)),e}function Tg(r,e){var t=Xo(r.buffer);return new r.constructor(t,r.byteOffset,r.byteLength)}var _g=/\w*$/;function Ng(r){var e=new r.constructor(r.source,_g.exec(r));return e.lastIndex=r.lastIndex,e}var uu=Sr?Sr.prototype:void 0,cu=uu?uu.valueOf:void 0;function Cg(r){return cu?Object(cu.call(r)):{}}function fu(r,e){var t=e?Xo(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var Lg="[object Boolean]",kg="[object Date]",Rg="[object Map]",Pg="[object Number]",qg="[object RegExp]",Ig="[object Set]",jg="[object String]",$g="[object Symbol]",Dg="[object ArrayBuffer]",Mg="[object DataView]",Bg="[object Float32Array]",Ug="[object Float64Array]",Fg="[object Int8Array]",Kg="[object Int16Array]",Hg="[object Int32Array]",zg="[object Uint8Array]",Vg="[object Uint8ClampedArray]",Wg="[object Uint16Array]",Gg="[object Uint32Array]";function Yg(r,e,t){var n=r.constructor;switch(e){case Dg:return Xo(r);case Lg:case kg:return new n(+r);case Mg:return Tg(r);case Bg:case Ug:case Fg:case Kg:case Hg:case zg:case Vg:case Wg:case Gg:return fu(r,t);case Rg:return new n;case Pg:case jg:return new n(r);case qg:return Ng(r);case Ig:return new n;case $g:return Cg(r)}}function hu(r){return typeof r.constructor=="function"&&!Ko(r)?gd(Jl(r)):{}}var Jg="[object Map]";function Zg(r){return or(r)&&mn(r)==Jg}var du=mi&&mi.isMap,Xg=du?zo(du):Zg,Qg="[object Set]";function em(r){return or(r)&&mn(r)==Qg}var pu=mi&&mi.isSet,tm=pu?zo(pu):em,nm=1,gu="[object Arguments]",rm="[object Array]",im="[object Boolean]",sm="[object Date]",om="[object Error]",mu="[object Function]",am="[object GeneratorFunction]",lm="[object Map]",um="[object Number]",yu="[object Object]",cm="[object RegExp]",fm="[object Set]",hm="[object String]",dm="[object Symbol]",pm="[object WeakMap]",gm="[object ArrayBuffer]",mm="[object DataView]",ym="[object Float32Array]",bm="[object Float64Array]",vm="[object Int8Array]",wm="[object Int16Array]",xm="[object Int32Array]",Em="[object Uint8Array]",Om="[object Uint8ClampedArray]",Sm="[object Uint16Array]",Am="[object Uint32Array]",et={};et[gu]=et[rm]=et[gm]=et[mm]=et[im]=et[sm]=et[ym]=et[bm]=et[vm]=et[wm]=et[xm]=et[lm]=et[um]=et[yu]=et[cm]=et[fm]=et[hm]=et[dm]=et[Em]=et[Om]=et[Sm]=et[Am]=!0,et[om]=et[mu]=et[pm]=!1;function Ms(r,e,t,n,i,s){var a,u=e&nm;if(a!==void 0)return a;if(!Ar(r))return r;var f=zr(r);if(f)a=Ag(r);else{var d=mn(r),m=d==mu||d==am;if(es(r))return nu(r,u);if(d==yu||d==gu||m&&!i)a=m?{}:hu(r);else{if(!et[d])return i?r:{};a=Yg(r,d,u)}}s||(s=new Dn);var w=s.get(r);if(w)return w;s.set(r,a),tm(r)?r.forEach(function(S){a.add(Ms(S,e,t,S,r,s))}):Xg(r)&&r.forEach(function(S,O){a.set(O,Ms(S,e,t,O,r,s))});var y=Go,x=f?void 0:y(r);return Ad(x||r,function(S,O){x&&(O=S,S=r[O]),$l(a,O,Ms(S,e,t,O,r,s))}),a}var Tm=1,_m=4;function yi(r){return Ms(r,Tm|_m)}var Nm="__lodash_hash_undefined__";function Cm(r){return this.__data__.set(r,Nm),this}function Lm(r){return this.__data__.has(r)}function Bs(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Yr;++e<t;)this.add(r[e])}Bs.prototype.add=Bs.prototype.push=Cm,Bs.prototype.has=Lm;function km(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 Rm(r,e){return r.has(e)}var Pm=1,qm=2;function bu(r,e,t,n,i,s){var a=t&Pm,u=r.length,f=e.length;if(u!=f&&!(a&&f>u))return!1;var d=s.get(r),m=s.get(e);if(d&&m)return d==e&&m==r;var w=-1,y=!0,x=t&qm?new Bs:void 0;for(s.set(r,e),s.set(e,r);++w<u;){var S=r[w],O=e[w];if(n)var N=a?n(O,S,w,e,r,s):n(S,O,w,r,e,s);if(N!==void 0){if(N)continue;y=!1;break}if(x){if(!km(e,function(M,J){if(!Rm(x,J)&&(S===M||i(S,M,t,n,s)))return x.push(J)})){y=!1;break}}else if(!(S===O||i(S,O,t,n,s))){y=!1;break}}return s.delete(r),s.delete(e),y}function Im(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}function jm(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var $m=1,Dm=2,Mm="[object Boolean]",Bm="[object Date]",Um="[object Error]",Fm="[object Map]",Km="[object Number]",Hm="[object RegExp]",zm="[object Set]",Vm="[object String]",Wm="[object Symbol]",Gm="[object ArrayBuffer]",Ym="[object DataView]",vu=Sr?Sr.prototype:void 0,Qo=vu?vu.valueOf:void 0;function Jm(r,e,t,n,i,s,a){switch(t){case Ym:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Gm:return!(r.byteLength!=e.byteLength||!s(new Ds(r),new Ds(e)));case Mm:case Bm:case Km:return Qi(+r,+e);case Um:return r.name==e.name&&r.message==e.message;case Hm:case Vm:return r==e+"";case Fm:var u=Im;case zm:var f=n&$m;if(u||(u=jm),r.size!=e.size&&!f)return!1;var d=a.get(r);if(d)return d==e;n|=Dm,a.set(r,e);var m=bu(u(r),u(e),n,i,s,a);return a.delete(r),m;case Wm:if(Qo)return Qo.call(r)==Qo.call(e)}return!1}var Zm=1,Xm=Object.prototype,Qm=Xm.hasOwnProperty;function ey(r,e,t,n,i,s){var a=t&Zm,u=Go(r),f=u.length,d=Go(e),m=d.length;if(f!=m&&!a)return!1;for(var w=f;w--;){var y=u[w];if(!(a?y in e:Qm.call(e,y)))return!1}var x=s.get(r),S=s.get(e);if(x&&S)return x==e&&S==r;var O=!0;s.set(r,e),s.set(e,r);for(var N=a;++w<f;){y=u[w];var M=r[y],J=e[y];if(n)var Q=a?n(J,M,y,e,r,s):n(M,J,y,r,e,s);if(!(Q===void 0?M===J||i(M,J,t,n,s):Q)){O=!1;break}N||(N=y=="constructor")}if(O&&!N){var de=r.constructor,ue=e.constructor;de!=ue&&"constructor"in r&&"constructor"in e&&!(typeof de=="function"&&de instanceof de&&typeof ue=="function"&&ue instanceof ue)&&(O=!1)}return s.delete(r),s.delete(e),O}var ty=1,wu="[object Arguments]",xu="[object Array]",Us="[object Object]",ny=Object.prototype,Eu=ny.hasOwnProperty;function ry(r,e,t,n,i,s){var a=zr(r),u=zr(e),f=a?xu:mn(r),d=u?xu:mn(e);f=f==wu?Us:f,d=d==wu?Us:d;var m=f==Us,w=d==Us,y=f==d;if(y&&es(r)){if(!es(e))return!1;a=!0,m=!1}if(y&&!m)return s||(s=new Dn),a||Wo(r)?bu(r,e,t,n,i,s):Jm(r,e,f,t,n,i,s);if(!(t&ty)){var x=m&&Eu.call(r,"__wrapped__"),S=w&&Eu.call(e,"__wrapped__");if(x||S){var O=x?r.value():r,N=S?e.value():e;return s||(s=new Dn),i(O,N,t,n,s)}}return y?(s||(s=new Dn),ey(r,e,t,n,i,s)):!1}function Ou(r,e,t,n,i){return r===e?!0:r==null||e==null||!or(r)&&!or(e)?r!==r&&e!==e:ry(r,e,t,n,Ou,i)}function iy(r){return function(e,t,n){for(var i=-1,s=Object(e),a=n(e),u=a.length;u--;){var f=a[++i];if(t(s[f],f,s)===!1)break}return e}}var sy=iy();function ea(r,e,t){(t!==void 0&&!Qi(r[e],t)||t===void 0&&!(e in r))&&Fo(r,e,t)}function oy(r){return or(r)&&Is(r)}function ta(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}function ay(r){return Ld(r,Yl(r))}function ly(r,e,t,n,i,s,a){var u=ta(r,t),f=ta(e,t),d=a.get(f);if(d){ea(r,t,d);return}var m=s?s(u,f,t+"",r,e,a):void 0,w=m===void 0;if(w){var y=zr(f),x=!y&&es(f),S=!y&&!x&&Wo(f);m=f,y||x||S?zr(u)?m=u:oy(u)?m=yd(u):x?(w=!1,m=nu(f,!0)):S?(w=!1,m=fu(f,!0)):m=[]:rg(f)||Ho(f)?(m=u,Ho(u)?m=ay(u):(!Ar(u)||Mo(u))&&(m=hu(f))):w=!1}w&&(a.set(f,m),i(m,f,n,s,a),a.delete(f)),ea(r,t,m)}function Su(r,e,t,n,i){r!==e&&sy(e,function(s,a){if(i||(i=new Dn),Ar(s))ly(r,e,a,t,Su,n,i);else{var u=n?n(ta(r,a),s,a+"",r,e,i):void 0;u===void 0&&(u=s),ea(r,a,u)}},Yl)}function na(r,e){return Ou(r,e)}var Tr=Id(function(r,e,t){Su(r,e,t)}),Le=(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))(Le||{});class Mn{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const i=Le.TYPE&Le.ATTRIBUTE;this.scope=n.scope!=null?n.scope&Le.LEVEL|i:Le.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 bi extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Au=class Al{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 i=this.query(t);if(i==null)throw new bi(`Unable to create ${t} blot`);const s=i,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:s.create(n),u=new s(e,a,n);return Al.blots.set(u.domNode,u),u}find(e,t=!1){return Al.find(e,t)}query(e,t=Le.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&Le.LEVEL&Le.BLOCK?n=this.types.block:e&Le.LEVEL&Le.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(n=this.classes[i],!!n)),n=n||this.tags[e.tagName]),n==null?null:"scope"in n&&t&Le.LEVEL&n.scope&&t&Le.TYPE&n.scope?n:null}register(...e){return e.map(t=>{const n="blotName"in t,i="attrName"in t;if(!n&&!i)throw new bi("Invalid definition");if(n&&t.blotName==="abstract")throw new bi("Cannot register abstract class");const s=n?t.blotName:i?t.attrName:void 0;return this.types[s]=t,i?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(a=>a.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)}))),t})}};Au.blots=new WeakMap;let vi=Au;function Tu(r,e){return(r.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class uy extends Mn{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){Tu(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(Tu(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const yn=uy;function ra(r){const e=r.split("-"),t=e.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("");return e[0]+t}class cy extends Mn{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[ra(this.keyName)]=t,!0):!1}remove(e){e.style[ra(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[ra(this.keyName)];return this.canAdd(e,t)?t:""}}const _r=cy;class fy{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=vi.find(this.domNode);if(e==null)return;const t=Mn.keys(this.domNode),n=yn.keys(this.domNode),i=_r.keys(this.domNode);t.concat(n).concat(i).forEach(s=>{const a=e.scroll.query(s,Le.ATTRIBUTE);a instanceof Mn&&(this.attributes[a.attrName]=a)})}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 Fs=fy,_u=class{constructor(e,t){this.scroll=e,this.domNode=t,vi.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new bi("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),vi.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,i){const s=this.isolate(e,t);if(this.scroll.query(n,Le.BLOT)!=null&&i)s.wrap(n,i);else if(this.scroll.query(n,Le.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);s.wrap(a),a.format(n,i)}}insertAt(e,t,n){const i=n==null?this.scroll.create("text",t):this.scroll.create(t,n),s=this.split(e);this.parent.insertBefore(i,s||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 bi(`Cannot wrap ${e}`);return n.appendChild(this),n}};_u.blotName="abstract";let Nu=_u;const Cu=class extends Nu{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}}};Cu.scope=Le.INLINE_BLOT;const Et=Cu;class hy{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(),i=0;for(;n;){if(n===e)return i;i+=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 i=n();for(;i;){const s=i.length();if(e<s||t&&e===s&&(i.next==null||i.next.length()!==0))return[i,e];e-=s,i=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[i,s]=this.find(e);let a=e-s;const u=this.iterator(i);let f=u();for(;f&&a<e+t;){const d=f.length();e>a?n(f,e-a,Math.min(t,a+d-e)):n(f,0,Math.min(d,e+t-a)),a+=d,f=u()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let i=n();for(;i;)t=e(t,i),i=n();return t}}function Lu(r,e){const t=e.find(r);if(t)return t;try{return e.create(r)}catch{const n=e.create(Le.INLINE);return Array.from(r.childNodes).forEach(i=>{n.domNode.appendChild(i)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const ku=class Hr extends Nu{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,Hr.uiClass&&this.uiNode.classList.add(Hr.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new hy,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Lu(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof bi)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(n,i,s)=>{n.deleteAt(i,s)})}descendant(e,t=0){const[n,i]=this.children.find(t);return e.blotName==null&&e(n)||e.blotName!=null&&n instanceof e?[n,i]:n instanceof Hr?n.descendant(e,i):[null,-1]}descendants(e,t=0,n=Number.MAX_VALUE){let i=[],s=n;return this.children.forEachAt(t,n,(a,u,f)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&i.push(a),a instanceof Hr&&(i=i.concat(a.descendants(e,u,s))),s-=f}),i}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===Le.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof Hr?t.unwrap():t.remove())})}formatAt(e,t,n,i){this.children.forEachAt(e,t,(s,a,u)=>{s.formatAt(a,u,n,i)})}insertAt(e,t,n){const[i,s]=this.children.find(e);if(i)i.insertAt(s,t,n);else{const a=n==null?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(a)}}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,i]=this.children.find(e,t),s=[[this,e]];return n instanceof Hr?s.concat(n.path(i,t)):(n!=null&&s.push([n,i]),s)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;return n instanceof Hr&&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(),(i,s,a)=>{const u=i.split(s,t);u!=null&&n.appendChild(u)}),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=[],i=[];e.forEach(s=>{s.target===this.domNode&&s.type==="childList"&&(n.push(...s.addedNodes),i.push(...s.removedNodes))}),i.forEach(s=>{if(s.parentNode!=null&&s.tagName!=="IFRAME"&&document.body.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(s);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),n.filter(s=>s.parentNode===this.domNode&&s!==this.uiNode).sort((s,a)=>s===a?0:s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(s=>{let a=null;s.nextSibling!=null&&(a=this.scroll.find(s.nextSibling));const u=Lu(s,this.scroll);(u.next!==a||u.next==null)&&(u.parent!=null&&u.parent.removeChild(this),this.insertBefore(u,a||void 0))}),this.enforceAllowedChildren()}};ku.uiClass="";const bn=ku;function dy(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 wi=class Yi extends bn{static create(e){return super.create(e)}static formats(e,t){const n=t.query(Yi.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 Fs(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(n=>{n instanceof Yi||(n=n.wrap(Yi.blotName,!0)),this.attributes.copy(n)}),this.unwrap();else{const n=this.scroll.query(e,Le.INLINE);if(n==null)return;n instanceof Mn?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,i){this.formats()[n]!=null||this.scroll.query(n,Le.ATTRIBUTE)?this.isolate(e,t).format(n,i):super.formatAt(e,t,n,i)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const n=this.next;n instanceof Yi&&n.prev===this&&dy(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 Yi&&this.attributes.move(n),n}};wi.allowedChildren=[wi,Et],wi.blotName="inline",wi.scope=Le.INLINE_BLOT,wi.tagName="SPAN";const ia=wi,xi=class Tl extends bn{static create(e){return super.create(e)}static formats(e,t){const n=t.query(Tl.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 Fs(this.domNode)}format(e,t){const n=this.scroll.query(e,Le.BLOCK);n!=null&&(n instanceof Mn?this.attributes.attribute(n,t):e===this.statics.blotName&&!t?this.replaceWith(Tl.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,i){this.scroll.query(n,Le.BLOCK)!=null?this.format(n,i):super.formatAt(e,t,n,i)}insertAt(e,t,n){if(n==null||this.scroll.query(t,Le.INLINE)!=null)super.insertAt(e,t,n);else{const i=this.split(e);if(i!=null){const s=this.scroll.create(t,n);i.parent.insertBefore(s,i)}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()}};xi.blotName="block",xi.scope=Le.BLOCK_BLOT,xi.tagName="P",xi.allowedChildren=[ia,xi,Et];const is=xi,sa=class extends bn{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,i){super.formatAt(e,t,n,i),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())}};sa.blotName="container",sa.scope=Le.BLOCK_BLOT;const Ks=sa;class py extends Et{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,i){e===0&&t===this.length()?this.format(n,i):super.formatAt(e,t,n,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Ut=py,gy={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},my=100,Ei=class extends bn{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,gy),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=Le.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,i){this.update(),super.formatAt(e,t,n,i)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const s=(f,d=!0)=>{f==null||f===this||f.domNode.parentNode!=null&&(n.has(f.domNode)||n.set(f.domNode,[]),d&&s(f.parent))},a=f=>{n.has(f.domNode)&&(f instanceof bn&&f.children.forEach(a),n.delete(f.domNode),f.optimize(t))};let u=e;for(let f=0;u.length>0;f+=1){if(f>=my)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(d=>{const m=this.find(d.target,!0);m!=null&&(m.domNode===d.target&&(d.type==="childList"?(s(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(w=>{const y=this.find(w,!1);s(y,!1),y instanceof bn&&y.children.forEach(x=>{s(x,!1)})})):d.type==="attributes"&&s(m.prev)),s(m))}),this.children.forEach(a),u=Array.from(this.observer.takeRecords()),i=u.slice();i.length>0;)e.push(i.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map(i=>{const s=this.find(i.target,!0);return s==null?null:n.has(s.domNode)?(n.get(s.domNode).push(i),null):(n.set(s.domNode,[i]),s)}).forEach(i=>{i!=null&&i!==this&&n.has(i.domNode)&&i.update(n.get(i.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Ei.blotName="scroll",Ei.defaultChild=is,Ei.allowedChildren=[is,Ks],Ei.scope=Le.BLOCK_BLOT,Ei.tagName="DIV";const oa=Ei,aa=class Dh extends Et{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 Dh&&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}};aa.blotName="text",aa.scope=Le.INLINE_BLOT;const Hs=aa,yy=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Mn,AttributorStore:Fs,BlockBlot:is,ClassAttributor:yn,ContainerBlot:Ks,EmbedBlot:Ut,InlineBlot:ia,LeafBlot:Et,ParentBlot:bn,Registry:vi,Scope:Le,ScrollBlot:oa,StyleAttributor:_r,TextBlot:Hs},Symbol.toStringTag,{value:"Module"}));var zs={exports:{}},la,Ru;function by(){if(Ru)return la;Ru=1;var r=-1,e=1,t=0;function n(A,W,R,V,E){if(A===W)return A?[[t,A]]:[];if(R!=null){var T=we(A,W,R);if(T)return T}var j=u(A,W),U=A.substring(0,j);A=A.substring(j),W=W.substring(j),j=d(A,W);var Y=A.substring(A.length-j);A=A.substring(0,A.length-j),W=W.substring(0,W.length-j);var z=i(A,W);return U&&z.unshift([t,U]),Y&&z.push([t,Y]),J(z,E),V&&w(z),z}function i(A,W){var R;if(!A)return[[e,W]];if(!W)return[[r,A]];var V=A.length>W.length?A:W,E=A.length>W.length?W:A,T=V.indexOf(E);if(T!==-1)return R=[[e,V.substring(0,T)],[t,E],[e,V.substring(T+E.length)]],A.length>W.length&&(R[0][0]=R[2][0]=r),R;if(E.length===1)return[[r,A],[e,W]];var j=m(A,W);if(j){var U=j[0],Y=j[1],z=j[2],$=j[3],se=j[4],le=n(U,z),be=n(Y,$);return le.concat([[t,se]],be)}return s(A,W)}function s(A,W){for(var R=A.length,V=W.length,E=Math.ceil((R+V)/2),T=E,j=2*E,U=new Array(j),Y=new Array(j),z=0;z<j;z++)U[z]=-1,Y[z]=-1;U[T+1]=0,Y[T+1]=0;for(var $=R-V,se=$%2!==0,le=0,be=0,ge=0,Pe=0,Be=0;Be<E;Be++){for(var Re=-Be+le;Re<=Be-be;Re+=2){var ae=T+Re,ke;Re===-Be||Re!==Be&&U[ae-1]<U[ae+1]?ke=U[ae+1]:ke=U[ae-1]+1;for(var qe=ke-Re;ke<R&&qe<V&&A.charAt(ke)===W.charAt(qe);)ke++,qe++;if(U[ae]=ke,ke>R)be+=2;else if(qe>V)le+=2;else if(se){var Se=T+$-Re;if(Se>=0&&Se<j&&Y[Se]!==-1){var $e=R-Y[Se];if(ke>=$e)return a(A,W,ke,qe)}}}for(var Qe=-Be+ge;Qe<=Be-Pe;Qe+=2){var Se=T+Qe,$e;Qe===-Be||Qe!==Be&&Y[Se-1]<Y[Se+1]?$e=Y[Se+1]:$e=Y[Se-1]+1;for(var Ze=$e-Qe;$e<R&&Ze<V&&A.charAt(R-$e-1)===W.charAt(V-Ze-1);)$e++,Ze++;if(Y[Se]=$e,$e>R)Pe+=2;else if(Ze>V)ge+=2;else if(!se){var ae=T+$-Qe;if(ae>=0&&ae<j&&U[ae]!==-1){var ke=U[ae],qe=T+ke-ae;if($e=R-$e,ke>=$e)return a(A,W,ke,qe)}}}}return[[r,A],[e,W]]}function a(A,W,R,V){var E=A.substring(0,R),T=W.substring(0,V),j=A.substring(R),U=W.substring(V),Y=n(E,T),z=n(j,U);return Y.concat(z)}function u(A,W){if(!A||!W||A.charAt(0)!==W.charAt(0))return 0;for(var R=0,V=Math.min(A.length,W.length),E=V,T=0;R<E;)A.substring(T,E)==W.substring(T,E)?(R=E,T=R):V=E,E=Math.floor((V-R)/2+R);return Q(A.charCodeAt(E-1))&&E--,E}function f(A,W){var R=A.length,V=W.length;if(R==0||V==0)return 0;R>V?A=A.substring(R-V):R<V&&(W=W.substring(0,R));var E=Math.min(R,V);if(A==W)return E;for(var T=0,j=1;;){var U=A.substring(E-j),Y=W.indexOf(U);if(Y==-1)return T;j+=Y,(Y==0||A.substring(E-j)==W.substring(0,j))&&(T=j,j++)}}function d(A,W){if(!A||!W||A.slice(-1)!==W.slice(-1))return 0;for(var R=0,V=Math.min(A.length,W.length),E=V,T=0;R<E;)A.substring(A.length-E,A.length-T)==W.substring(W.length-E,W.length-T)?(R=E,T=R):V=E,E=Math.floor((V-R)/2+R);return de(A.charCodeAt(A.length-E))&&E--,E}function m(A,W){var R=A.length>W.length?A:W,V=A.length>W.length?W:A;if(R.length<4||V.length*2<R.length)return null;function E(be,ge,Pe){for(var Be=be.substring(Pe,Pe+Math.floor(be.length/4)),Re=-1,ae="",ke,qe,Se,$e;(Re=ge.indexOf(Be,Re+1))!==-1;){var Qe=u(be.substring(Pe),ge.substring(Re)),Ze=d(be.substring(0,Pe),ge.substring(0,Re));ae.length<Ze+Qe&&(ae=ge.substring(Re-Ze,Re)+ge.substring(Re,Re+Qe),ke=be.substring(0,Pe-Ze),qe=be.substring(Pe+Qe),Se=ge.substring(0,Re-Ze),$e=ge.substring(Re+Qe))}return ae.length*2>=be.length?[ke,qe,Se,$e,ae]:null}var T=E(R,V,Math.ceil(R.length/4)),j=E(R,V,Math.ceil(R.length/2)),U;if(!T&&!j)return null;j?T?U=T[4].length>j[4].length?T:j:U=j:U=T;var Y,z,$,se;A.length>W.length?(Y=U[0],z=U[1],$=U[2],se=U[3]):($=U[0],se=U[1],Y=U[2],z=U[3]);var le=U[4];return[Y,z,$,se,le]}function w(A){for(var W=!1,R=[],V=0,E=null,T=0,j=0,U=0,Y=0,z=0;T<A.length;)A[T][0]==t?(R[V++]=T,j=Y,U=z,Y=0,z=0,E=A[T][1]):(A[T][0]==e?Y+=A[T][1].length:z+=A[T][1].length,E&&E.length<=Math.max(j,U)&&E.length<=Math.max(Y,z)&&(A.splice(R[V-1],0,[r,E]),A[R[V-1]+1][0]=e,V--,V--,T=V>0?R[V-1]:-1,j=0,U=0,Y=0,z=0,E=null,W=!0)),T++;for(W&&J(A),M(A),T=1;T<A.length;){if(A[T-1][0]==r&&A[T][0]==e){var $=A[T-1][1],se=A[T][1],le=f($,se),be=f(se,$);le>=be?(le>=$.length/2||le>=se.length/2)&&(A.splice(T,0,[t,se.substring(0,le)]),A[T-1][1]=$.substring(0,$.length-le),A[T+1][1]=se.substring(le),T++):(be>=$.length/2||be>=se.length/2)&&(A.splice(T,0,[t,$.substring(0,be)]),A[T-1][0]=e,A[T-1][1]=se.substring(0,se.length-be),A[T+1][0]=r,A[T+1][1]=$.substring(be),T++),T++}T++}}var y=/[^a-zA-Z0-9]/,x=/\s/,S=/[\r\n]/,O=/\n\r?\n$/,N=/^\r?\n\r?\n/;function M(A){function W(be,ge){if(!be||!ge)return 6;var Pe=be.charAt(be.length-1),Be=ge.charAt(0),Re=Pe.match(y),ae=Be.match(y),ke=Re&&Pe.match(x),qe=ae&&Be.match(x),Se=ke&&Pe.match(S),$e=qe&&Be.match(S),Qe=Se&&be.match(O),Ze=$e&&ge.match(N);return Qe||Ze?5:Se||$e?4:Re&&!ke&&qe?3:ke||qe?2:Re||ae?1:0}for(var R=1;R<A.length-1;){if(A[R-1][0]==t&&A[R+1][0]==t){var V=A[R-1][1],E=A[R][1],T=A[R+1][1],j=d(V,E);if(j){var U=E.substring(E.length-j);V=V.substring(0,V.length-j),E=U+E.substring(0,E.length-j),T=U+T}for(var Y=V,z=E,$=T,se=W(V,E)+W(E,T);E.charAt(0)===T.charAt(0);){V+=E.charAt(0),E=E.substring(1)+T.charAt(0),T=T.substring(1);var le=W(V,E)+W(E,T);le>=se&&(se=le,Y=V,z=E,$=T)}A[R-1][1]!=Y&&(Y?A[R-1][1]=Y:(A.splice(R-1,1),R--),A[R][1]=z,$?A[R+1][1]=$:(A.splice(R+1,1),R--))}R++}}function J(A,W){A.push([t,""]);for(var R=0,V=0,E=0,T="",j="",U;R<A.length;){if(R<A.length-1&&!A[R][1]){A.splice(R,1);continue}switch(A[R][0]){case e:E++,j+=A[R][1],R++;break;case r:V++,T+=A[R][1],R++;break;case t:var Y=R-E-V-1;if(W){if(Y>=0&&ce(A[Y][1])){var z=A[Y][1].slice(-1);if(A[Y][1]=A[Y][1].slice(0,-1),T=z+T,j=z+j,!A[Y][1]){A.splice(Y,1),R--;var $=Y-1;A[$]&&A[$][0]===e&&(E++,j=A[$][1]+j,$--),A[$]&&A[$][0]===r&&(V++,T=A[$][1]+T,$--),Y=$}}if(ue(A[R][1])){var z=A[R][1].charAt(0);A[R][1]=A[R][1].slice(1),T+=z,j+=z}}if(R<A.length-1&&!A[R][1]){A.splice(R,1);break}if(T.length>0||j.length>0){T.length>0&&j.length>0&&(U=u(j,T),U!==0&&(Y>=0?A[Y][1]+=j.substring(0,U):(A.splice(0,0,[t,j.substring(0,U)]),R++),j=j.substring(U),T=T.substring(U)),U=d(j,T),U!==0&&(A[R][1]=j.substring(j.length-U)+A[R][1],j=j.substring(0,j.length-U),T=T.substring(0,T.length-U)));var se=E+V;T.length===0&&j.length===0?(A.splice(R-se,se),R=R-se):T.length===0?(A.splice(R-se,se,[e,j]),R=R-se+1):j.length===0?(A.splice(R-se,se,[r,T]),R=R-se+1):(A.splice(R-se,se,[r,T],[e,j]),R=R-se+2)}R!==0&&A[R-1][0]===t?(A[R-1][1]+=A[R][1],A.splice(R,1)):R++,E=0,V=0,T="",j="";break}}A[A.length-1][1]===""&&A.pop();var le=!1;for(R=1;R<A.length-1;)A[R-1][0]===t&&A[R+1][0]===t&&(A[R][1].substring(A[R][1].length-A[R-1][1].length)===A[R-1][1]?(A[R][1]=A[R-1][1]+A[R][1].substring(0,A[R][1].length-A[R-1][1].length),A[R+1][1]=A[R-1][1]+A[R+1][1],A.splice(R-1,1),le=!0):A[R][1].substring(0,A[R+1][1].length)==A[R+1][1]&&(A[R-1][1]+=A[R+1][1],A[R][1]=A[R][1].substring(A[R+1][1].length)+A[R+1][1],A.splice(R+1,1),le=!0)),R++;le&&J(A,W)}function Q(A){return A>=55296&&A<=56319}function de(A){return A>=56320&&A<=57343}function ue(A){return de(A.charCodeAt(0))}function ce(A){return Q(A.charCodeAt(A.length-1))}function ne(A){for(var W=[],R=0;R<A.length;R++)A[R][1].length>0&&W.push(A[R]);return W}function re(A,W,R,V){return ce(A)||ue(V)?null:ne([[t,A],[r,W],[e,R],[t,V]])}function we(A,W,R){var V=typeof R=="number"?{index:R,length:0}:R.oldRange,E=typeof R=="number"?null:R.newRange,T=A.length,j=W.length;if(V.length===0&&(E===null||E.length===0)){var U=V.index,Y=A.slice(0,U),z=A.slice(U),$=E?E.index:null;e:{var se=U+j-T;if($!==null&&$!==se||se<0||se>j)break e;var le=W.slice(0,se),be=W.slice(se);if(be!==z)break e;var ge=Math.min(U,se),Pe=Y.slice(0,ge),Be=le.slice(0,ge);if(Pe!==Be)break e;var Re=Y.slice(ge),ae=le.slice(ge);return re(Pe,Re,ae,z)}e:{if($!==null&&$!==U)break e;var ke=U,le=W.slice(0,ke),be=W.slice(ke);if(le!==Y)break e;var qe=Math.min(T-ke,j-ke),Se=z.slice(z.length-qe),$e=be.slice(be.length-qe);if(Se!==$e)break e;var Re=z.slice(0,z.length-qe),ae=be.slice(0,be.length-qe);return re(Y,Re,ae,Se)}}if(V.length>0&&E&&E.length===0)e:{var Pe=A.slice(0,V.index),Se=A.slice(V.index+V.length),ge=Pe.length,qe=Se.length;if(j<ge+qe)break e;var Be=W.slice(0,ge),$e=W.slice(j-qe);if(Pe!==Be||Se!==$e)break e;var Re=A.slice(ge,T-qe),ae=W.slice(ge,j-qe);return re(Pe,Re,ae,Se)}return null}function Ee(A,W,R,V){return n(A,W,R,V,!0)}return Ee.INSERT=e,Ee.DELETE=r,Ee.EQUAL=t,la=Ee,la}var ss={exports:{}};ss.exports;var Pu;function qu(){return Pu||(Pu=1,function(r,e){var t=200,n="__lodash_hash_undefined__",i=9007199254740991,s="[object Arguments]",a="[object Array]",u="[object Boolean]",f="[object Date]",d="[object Error]",m="[object Function]",w="[object GeneratorFunction]",y="[object Map]",x="[object Number]",S="[object Object]",O="[object Promise]",N="[object RegExp]",M="[object Set]",J="[object String]",Q="[object Symbol]",de="[object WeakMap]",ue="[object ArrayBuffer]",ce="[object DataView]",ne="[object Float32Array]",re="[object Float64Array]",we="[object Int8Array]",Ee="[object Int16Array]",A="[object Int32Array]",W="[object Uint8Array]",R="[object Uint8ClampedArray]",V="[object Uint16Array]",E="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,j=/\w*$/,U=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,z={};z[s]=z[a]=z[ue]=z[ce]=z[u]=z[f]=z[ne]=z[re]=z[we]=z[Ee]=z[A]=z[y]=z[x]=z[S]=z[N]=z[M]=z[J]=z[Q]=z[W]=z[R]=z[V]=z[E]=!0,z[d]=z[m]=z[de]=!1;var $=typeof jn=="object"&&jn&&jn.Object===Object&&jn,se=typeof self=="object"&&self&&self.Object===Object&&self,le=$||se||Function("return this")(),be=e&&!e.nodeType&&e,ge=be&&!0&&r&&!r.nodeType&&r,Pe=ge&&ge.exports===be;function Be(h,v){return h.set(v[0],v[1]),h}function Re(h,v){return h.add(v),h}function ae(h,v){for(var k=-1,te=h?h.length:0;++k<te&&v(h[k],k,h)!==!1;);return h}function ke(h,v){for(var k=-1,te=v.length,Ie=h.length;++k<te;)h[Ie+k]=v[k];return h}function qe(h,v,k,te){for(var Ie=-1,Ce=h?h.length:0;++Ie<Ce;)k=v(k,h[Ie],Ie,h);return k}function Se(h,v){for(var k=-1,te=Array(h);++k<h;)te[k]=v(k);return te}function $e(h,v){return h==null?void 0:h[v]}function Qe(h){var v=!1;if(h!=null&&typeof h.toString!="function")try{v=!!(h+"")}catch{}return v}function Ze(h){var v=-1,k=Array(h.size);return h.forEach(function(te,Ie){k[++v]=[Ie,te]}),k}function Tn(h,v){return function(k){return h(v(k))}}function zn(h){var v=-1,k=Array(h.size);return h.forEach(function(te){k[++v]=te}),k}var hr=Array.prototype,dr=Function.prototype,Vn=Object.prototype,Tt=le["__core-js_shared__"],ii=function(){var h=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),Wn=dr.toString,Kt=Vn.hasOwnProperty,rn=Vn.toString,_n=RegExp("^"+Wn.call(Kt).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pt=Pe?le.Buffer:void 0,Gn=le.Symbol,Nn=le.Uint8Array,_t=Tn(Object.getPrototypeOf,Object),pr=Object.create,sn=Vn.propertyIsEnumerable,kr=hr.splice,gr=Object.getOwnPropertySymbols,qt=Pt?Pt.isBuffer:void 0,_e=Tn(Object.keys,Object),on=Wt(le,"DataView"),It=Wt(le,"Map"),Nt=Wt(le,"Promise"),ve=Wt(le,"Set"),mr=Wt(le,"WeakMap"),Yn=Wt(Object,"create"),yr=bt(on),Jn=bt(It),br=bt(Nt),si=bt(ve),oi=bt(mr),jt=Gn?Gn.prototype:void 0,Cn=jt?jt.valueOf:void 0;function Ht(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var te=h[v];this.set(te[0],te[1])}}function Rr(){this.__data__=Yn?Yn(null):{}}function Xe(h){return this.has(h)&&delete this.__data__[h]}function ot(h){var v=this.__data__;if(Yn){var k=v[h];return k===n?void 0:k}return Kt.call(v,h)?v[h]:void 0}function $i(h){var v=this.__data__;return Yn?v[h]!==void 0:Kt.call(v,h)}function Zn(h,v){var k=this.__data__;return k[h]=Yn&&v===void 0?n:v,this}Ht.prototype.clear=Rr,Ht.prototype.delete=Xe,Ht.prototype.get=ot,Ht.prototype.has=$i,Ht.prototype.set=Zn;function at(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var te=h[v];this.set(te[0],te[1])}}function Pr(){this.__data__=[]}function Ns(h){var v=this.__data__,k=er(v,h);if(k<0)return!1;var te=v.length-1;return k==te?v.pop():kr.call(v,k,1),!0}function an(h){var v=this.__data__,k=er(v,h);return k<0?void 0:v[k][1]}function Xn(h){return er(this.__data__,h)>-1}function ln(h,v){var k=this.__data__,te=er(k,h);return te<0?k.push([h,v]):k[te][1]=v,this}at.prototype.clear=Pr,at.prototype.delete=Ns,at.prototype.get=an,at.prototype.has=Xn,at.prototype.set=ln;function ht(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var te=h[v];this.set(te[0],te[1])}}function Cs(){this.__data__={hash:new Ht,map:new(It||at),string:new Ht}}function un(h){return rr(this,h).delete(h)}function Di(h){return rr(this,h).get(h)}function Ln(h){return rr(this,h).has(h)}function Mi(h,v){return rr(this,h).set(h,v),this}ht.prototype.clear=Cs,ht.prototype.delete=un,ht.prototype.get=Di,ht.prototype.has=Ln,ht.prototype.set=Mi;function mt(h){this.__data__=new at(h)}function nt(){this.__data__=new at}function kn(h){return this.__data__.delete(h)}function zt(h){return this.__data__.get(h)}function Bi(h){return this.__data__.has(h)}function Qn(h,v){var k=this.__data__;if(k instanceof at){var te=k.__data__;if(!It||te.length<t-1)return te.push([h,v]),this;k=this.__data__=new ht(te)}return k.set(h,v),this}mt.prototype.clear=nt,mt.prototype.delete=kn,mt.prototype.get=zt,mt.prototype.has=Bi,mt.prototype.set=Qn;function Rn(h,v){var k=qn(h)||hn(h)?Se(h.length,String):[],te=k.length,Ie=!!te;for(var Ce in h)Kt.call(h,Ce)&&!(Ie&&(Ce=="length"||ir(Ce,te)))&&k.push(Ce);return k}function qr(h,v,k){var te=h[v];(!(Kt.call(h,v)&&$t(te,k))||k===void 0&&!(v in h))&&(h[v]=k)}function er(h,v){for(var k=h.length;k--;)if($t(h[k][0],v))return k;return-1}function yt(h,v){return h&&nr(v,In(v),h)}function Ir(h,v,k,te,Ie,Ce,Ve){var Ge;if(te&&(Ge=Ce?te(h,Ie,Ce,Ve):te(h)),Ge!==void 0)return Ge;if(!Yt(h))return h;var lt=qn(h);if(lt){if(Ge=Ls(h),!v)return Hi(h,Ge)}else{var Ye=Gt(h),gt=Ye==m||Ye==w;if(Vi(h))return vr(h,v);if(Ye==S||Ye==s||gt&&!Ce){if(Qe(h))return Ce?h:{};if(Ge=cn(gt?{}:h),!v)return zi(h,yt(Ge,h))}else{if(!z[Ye])return Ce?h:{};Ge=xt(h,Ye,Ir,v)}}Ve||(Ve=new mt);var vt=Ve.get(h);if(vt)return vt;if(Ve.set(h,Ge),!lt)var ut=k?wr(h):In(h);return ae(ut||h,function(dt,ct){ut&&(ct=dt,dt=h[ct]),qr(Ge,ct,Ir(dt,v,k,te,ct,h,Ve))}),Ge}function jr(h){return Yt(h)?pr(h):{}}function Ui(h,v,k){var te=v(h);return qn(h)?te:ke(te,k(h))}function Ke(h){return rn.call(h)}function Fi(h){if(!Yt(h)||fn(h))return!1;var v=Ct(h)||Qe(h)?_n:U;return v.test(bt(h))}function Ki(h){if(!ui(h))return _e(h);var v=[];for(var k in Object(h))Kt.call(h,k)&&k!="constructor"&&v.push(k);return v}function vr(h,v){if(v)return h.slice();var k=new h.constructor(h.length);return h.copy(k),k}function Je(h){var v=new h.constructor(h.byteLength);return new Nn(v).set(new Nn(h)),v}function Vt(h,v){var k=v?Je(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.byteLength)}function tr(h,v,k){var te=v?k(Ze(h),!0):Ze(h);return qe(te,Be,new h.constructor)}function Pn(h){var v=new h.constructor(h.source,j.exec(h));return v.lastIndex=h.lastIndex,v}function ai(h,v,k){var te=v?k(zn(h),!0):zn(h);return qe(te,Re,new h.constructor)}function li(h){return Cn?Object(Cn.call(h)):{}}function $r(h,v){var k=v?Je(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.length)}function Hi(h,v){var k=-1,te=h.length;for(v||(v=Array(te));++k<te;)v[k]=h[k];return v}function nr(h,v,k,te){k||(k={});for(var Ie=-1,Ce=v.length;++Ie<Ce;){var Ve=v[Ie],Ge=void 0;qr(k,Ve,Ge===void 0?h[Ve]:Ge)}return k}function zi(h,v){return nr(h,Ue(h),v)}function wr(h){return Ui(h,In,Ue)}function rr(h,v){var k=h.__data__;return Dr(v)?k[typeof v=="string"?"string":"hash"]:k.map}function Wt(h,v){var k=$e(h,v);return Fi(k)?k:void 0}var Ue=gr?Tn(gr,Object):ci,Gt=Ke;(on&&Gt(new on(new ArrayBuffer(1)))!=ce||It&&Gt(new It)!=y||Nt&&Gt(Nt.resolve())!=O||ve&&Gt(new ve)!=M||mr&&Gt(new mr)!=de)&&(Gt=function(h){var v=rn.call(h),k=v==S?h.constructor:void 0,te=k?bt(k):void 0;if(te)switch(te){case yr:return ce;case Jn:return y;case br:return O;case si:return M;case oi:return de}return v});function Ls(h){var v=h.length,k=h.constructor(v);return v&&typeof h[0]=="string"&&Kt.call(h,"index")&&(k.index=h.index,k.input=h.input),k}function cn(h){return typeof h.constructor=="function"&&!ui(h)?jr(_t(h)):{}}function xt(h,v,k,te){var Ie=h.constructor;switch(v){case ue:return Je(h);case u:case f:return new Ie(+h);case ce:return Vt(h,te);case ne:case re:case we:case Ee:case A:case W:case R:case V:case E:return $r(h,te);case y:return tr(h,te,k);case x:case J:return new Ie(h);case N:return Pn(h);case M:return ai(h,te,k);case Q:return li(h)}}function ir(h,v){return v=v??i,!!v&&(typeof h=="number"||Y.test(h))&&h>-1&&h%1==0&&h<v}function Dr(h){var v=typeof h;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?h!=="__proto__":h===null}function fn(h){return!!ii&&ii in h}function ui(h){var v=h&&h.constructor,k=typeof v=="function"&&v.prototype||Vn;return h===k}function bt(h){if(h!=null){try{return Wn.call(h)}catch{}try{return h+""}catch{}}return""}function it(h){return Ir(h,!0,!0)}function $t(h,v){return h===v||h!==h&&v!==v}function hn(h){return dn(h)&&Kt.call(h,"callee")&&(!sn.call(h,"callee")||rn.call(h)==s)}var qn=Array.isArray;function sr(h){return h!=null&&Mr(h.length)&&!Ct(h)}function dn(h){return Br(h)&&sr(h)}var Vi=qt||Wi;function Ct(h){var v=Yt(h)?rn.call(h):"";return v==m||v==w}function Mr(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=i}function Yt(h){var v=typeof h;return!!h&&(v=="object"||v=="function")}function Br(h){return!!h&&typeof h=="object"}function In(h){return sr(h)?Rn(h):Ki(h)}function ci(){return[]}function Wi(){return!1}r.exports=it}(ss,ss.exports)),ss.exports}var os={exports:{}};os.exports;var Iu;function ju(){return Iu||(Iu=1,function(r,e){var t=200,n="__lodash_hash_undefined__",i=1,s=2,a=9007199254740991,u="[object Arguments]",f="[object Array]",d="[object AsyncFunction]",m="[object Boolean]",w="[object Date]",y="[object Error]",x="[object Function]",S="[object GeneratorFunction]",O="[object Map]",N="[object Number]",M="[object Null]",J="[object Object]",Q="[object Promise]",de="[object Proxy]",ue="[object RegExp]",ce="[object Set]",ne="[object String]",re="[object Symbol]",we="[object Undefined]",Ee="[object WeakMap]",A="[object ArrayBuffer]",W="[object DataView]",R="[object Float32Array]",V="[object Float64Array]",E="[object Int8Array]",T="[object Int16Array]",j="[object Int32Array]",U="[object Uint8Array]",Y="[object Uint8ClampedArray]",z="[object Uint16Array]",$="[object Uint32Array]",se=/[\\^$.*+?()[\]{}|]/g,le=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,ge={};ge[R]=ge[V]=ge[E]=ge[T]=ge[j]=ge[U]=ge[Y]=ge[z]=ge[$]=!0,ge[u]=ge[f]=ge[A]=ge[m]=ge[W]=ge[w]=ge[y]=ge[x]=ge[O]=ge[N]=ge[J]=ge[ue]=ge[ce]=ge[ne]=ge[Ee]=!1;var Pe=typeof jn=="object"&&jn&&jn.Object===Object&&jn,Be=typeof self=="object"&&self&&self.Object===Object&&self,Re=Pe||Be||Function("return this")(),ae=e&&!e.nodeType&&e,ke=ae&&!0&&r&&!r.nodeType&&r,qe=ke&&ke.exports===ae,Se=qe&&Pe.process,$e=function(){try{return Se&&Se.binding&&Se.binding("util")}catch{}}(),Qe=$e&&$e.isTypedArray;function Ze(h,v){for(var k=-1,te=h==null?0:h.length,Ie=0,Ce=[];++k<te;){var Ve=h[k];v(Ve,k,h)&&(Ce[Ie++]=Ve)}return Ce}function Tn(h,v){for(var k=-1,te=v.length,Ie=h.length;++k<te;)h[Ie+k]=v[k];return h}function zn(h,v){for(var k=-1,te=h==null?0:h.length;++k<te;)if(v(h[k],k,h))return!0;return!1}function hr(h,v){for(var k=-1,te=Array(h);++k<h;)te[k]=v(k);return te}function dr(h){return function(v){return h(v)}}function Vn(h,v){return h.has(v)}function Tt(h,v){return h==null?void 0:h[v]}function ii(h){var v=-1,k=Array(h.size);return h.forEach(function(te,Ie){k[++v]=[Ie,te]}),k}function Wn(h,v){return function(k){return h(v(k))}}function Kt(h){var v=-1,k=Array(h.size);return h.forEach(function(te){k[++v]=te}),k}var rn=Array.prototype,_n=Function.prototype,Pt=Object.prototype,Gn=Re["__core-js_shared__"],Nn=_n.toString,_t=Pt.hasOwnProperty,pr=function(){var h=/[^.]+$/.exec(Gn&&Gn.keys&&Gn.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),sn=Pt.toString,kr=RegExp("^"+Nn.call(_t).replace(se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=qe?Re.Buffer:void 0,qt=Re.Symbol,_e=Re.Uint8Array,on=Pt.propertyIsEnumerable,It=rn.splice,Nt=qt?qt.toStringTag:void 0,ve=Object.getOwnPropertySymbols,mr=gr?gr.isBuffer:void 0,Yn=Wn(Object.keys,Object),yr=Ue(Re,"DataView"),Jn=Ue(Re,"Map"),br=Ue(Re,"Promise"),si=Ue(Re,"Set"),oi=Ue(Re,"WeakMap"),jt=Ue(Object,"create"),Cn=bt(yr),Ht=bt(Jn),Rr=bt(br),Xe=bt(si),ot=bt(oi),$i=qt?qt.prototype:void 0,Zn=$i?$i.valueOf:void 0;function at(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var te=h[v];this.set(te[0],te[1])}}function Pr(){this.__data__=jt?jt(null):{},this.size=0}function Ns(h){var v=this.has(h)&&delete this.__data__[h];return this.size-=v?1:0,v}function an(h){var v=this.__data__;if(jt){var k=v[h];return k===n?void 0:k}return _t.call(v,h)?v[h]:void 0}function Xn(h){var v=this.__data__;return jt?v[h]!==void 0:_t.call(v,h)}function ln(h,v){var k=this.__data__;return this.size+=this.has(h)?0:1,k[h]=jt&&v===void 0?n:v,this}at.prototype.clear=Pr,at.prototype.delete=Ns,at.prototype.get=an,at.prototype.has=Xn,at.prototype.set=ln;function ht(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var te=h[v];this.set(te[0],te[1])}}function Cs(){this.__data__=[],this.size=0}function un(h){var v=this.__data__,k=vr(v,h);if(k<0)return!1;var te=v.length-1;return k==te?v.pop():It.call(v,k,1),--this.size,!0}function Di(h){var v=this.__data__,k=vr(v,h);return k<0?void 0:v[k][1]}function Ln(h){return vr(this.__data__,h)>-1}function Mi(h,v){var k=this.__data__,te=vr(k,h);return te<0?(++this.size,k.push([h,v])):k[te][1]=v,this}ht.prototype.clear=Cs,ht.prototype.delete=un,ht.prototype.get=Di,ht.prototype.has=Ln,ht.prototype.set=Mi;function mt(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var te=h[v];this.set(te[0],te[1])}}function nt(){this.size=0,this.__data__={hash:new at,map:new(Jn||ht),string:new at}}function kn(h){var v=Wt(this,h).delete(h);return this.size-=v?1:0,v}function zt(h){return Wt(this,h).get(h)}function Bi(h){return Wt(this,h).has(h)}function Qn(h,v){var k=Wt(this,h),te=k.size;return k.set(h,v),this.size+=k.size==te?0:1,this}mt.prototype.clear=nt,mt.prototype.delete=kn,mt.prototype.get=zt,mt.prototype.has=Bi,mt.prototype.set=Qn;function Rn(h){var v=-1,k=h==null?0:h.length;for(this.__data__=new mt;++v<k;)this.add(h[v])}function qr(h){return this.__data__.set(h,n),this}function er(h){return this.__data__.has(h)}Rn.prototype.add=Rn.prototype.push=qr,Rn.prototype.has=er;function yt(h){var v=this.__data__=new ht(h);this.size=v.size}function Ir(){this.__data__=new ht,this.size=0}function jr(h){var v=this.__data__,k=v.delete(h);return this.size=v.size,k}function Ui(h){return this.__data__.get(h)}function Ke(h){return this.__data__.has(h)}function Fi(h,v){var k=this.__data__;if(k instanceof ht){var te=k.__data__;if(!Jn||te.length<t-1)return te.push([h,v]),this.size=++k.size,this;k=this.__data__=new mt(te)}return k.set(h,v),this.size=k.size,this}yt.prototype.clear=Ir,yt.prototype.delete=jr,yt.prototype.get=Ui,yt.prototype.has=Ke,yt.prototype.set=Fi;function Ki(h,v){var k=hn(h),te=!k&&$t(h),Ie=!k&&!te&&sr(h),Ce=!k&&!te&&!Ie&&Br(h),Ve=k||te||Ie||Ce,Ge=Ve?hr(h.length,String):[],lt=Ge.length;for(var Ye in h)_t.call(h,Ye)&&!(Ve&&(Ye=="length"||Ie&&(Ye=="offset"||Ye=="parent")||Ce&&(Ye=="buffer"||Ye=="byteLength"||Ye=="byteOffset")||xt(Ye,lt)))&&Ge.push(Ye);return Ge}function vr(h,v){for(var k=h.length;k--;)if(it(h[k][0],v))return k;return-1}function Je(h,v,k){var te=v(h);return hn(h)?te:Tn(te,k(h))}function Vt(h){return h==null?h===void 0?we:M:Nt&&Nt in Object(h)?Gt(h):ui(h)}function tr(h){return Yt(h)&&Vt(h)==u}function Pn(h,v,k,te,Ie){return h===v?!0:h==null||v==null||!Yt(h)&&!Yt(v)?h!==h&&v!==v:ai(h,v,k,te,Pn,Ie)}function ai(h,v,k,te,Ie,Ce){var Ve=hn(h),Ge=hn(v),lt=Ve?f:cn(h),Ye=Ge?f:cn(v);lt=lt==u?J:lt,Ye=Ye==u?J:Ye;var gt=lt==J,vt=Ye==J,ut=lt==Ye;if(ut&&sr(h)){if(!sr(v))return!1;Ve=!0,gt=!1}if(ut&&!gt)return Ce||(Ce=new yt),Ve||Br(h)?nr(h,v,k,te,Ie,Ce):zi(h,v,lt,k,te,Ie,Ce);if(!(k&i)){var dt=gt&&_t.call(h,"__wrapped__"),ct=vt&&_t.call(v,"__wrapped__");if(dt||ct){var Jt=dt?h.value():h,pn=ct?v.value():v;return Ce||(Ce=new yt),Ie(Jt,pn,k,te,Ce)}}return ut?(Ce||(Ce=new yt),wr(h,v,k,te,Ie,Ce)):!1}function li(h){if(!Mr(h)||Dr(h))return!1;var v=Vi(h)?kr:le;return v.test(bt(h))}function $r(h){return Yt(h)&&Ct(h.length)&&!!ge[Vt(h)]}function Hi(h){if(!fn(h))return Yn(h);var v=[];for(var k in Object(h))_t.call(h,k)&&k!="constructor"&&v.push(k);return v}function nr(h,v,k,te,Ie,Ce){var Ve=k&i,Ge=h.length,lt=v.length;if(Ge!=lt&&!(Ve&&lt>Ge))return!1;var Ye=Ce.get(h);if(Ye&&Ce.get(v))return Ye==v;var gt=-1,vt=!0,ut=k&s?new Rn:void 0;for(Ce.set(h,v),Ce.set(v,h);++gt<Ge;){var dt=h[gt],ct=v[gt];if(te)var Jt=Ve?te(ct,dt,gt,v,h,Ce):te(dt,ct,gt,h,v,Ce);if(Jt!==void 0){if(Jt)continue;vt=!1;break}if(ut){if(!zn(v,function(pn,xr){if(!Vn(ut,xr)&&(dt===pn||Ie(dt,pn,k,te,Ce)))return ut.push(xr)})){vt=!1;break}}else if(!(dt===ct||Ie(dt,ct,k,te,Ce))){vt=!1;break}}return Ce.delete(h),Ce.delete(v),vt}function zi(h,v,k,te,Ie,Ce,Ve){switch(k){case W:if(h.byteLength!=v.byteLength||h.byteOffset!=v.byteOffset)return!1;h=h.buffer,v=v.buffer;case A:return!(h.byteLength!=v.byteLength||!Ce(new _e(h),new _e(v)));case m:case w:case N:return it(+h,+v);case y:return h.name==v.name&&h.message==v.message;case ue:case ne:return h==v+"";case O:var Ge=ii;case ce:var lt=te&i;if(Ge||(Ge=Kt),h.size!=v.size&&!lt)return!1;var Ye=Ve.get(h);if(Ye)return Ye==v;te|=s,Ve.set(h,v);var gt=nr(Ge(h),Ge(v),te,Ie,Ce,Ve);return Ve.delete(h),gt;case re:if(Zn)return Zn.call(h)==Zn.call(v)}return!1}function wr(h,v,k,te,Ie,Ce){var Ve=k&i,Ge=rr(h),lt=Ge.length,Ye=rr(v),gt=Ye.length;if(lt!=gt&&!Ve)return!1;for(var vt=lt;vt--;){var ut=Ge[vt];if(!(Ve?ut in v:_t.call(v,ut)))return!1}var dt=Ce.get(h);if(dt&&Ce.get(v))return dt==v;var ct=!0;Ce.set(h,v),Ce.set(v,h);for(var Jt=Ve;++vt<lt;){ut=Ge[vt];var pn=h[ut],xr=v[ut];if(te)var fi=Ve?te(xr,pn,ut,v,h,Ce):te(pn,xr,ut,h,v,Ce);if(!(fi===void 0?pn===xr||Ie(pn,xr,k,te,Ce):fi)){ct=!1;break}Jt||(Jt=ut=="constructor")}if(ct&&!Jt){var Ur=h.constructor,Fr=v.constructor;Ur!=Fr&&"constructor"in h&&"constructor"in v&&!(typeof Ur=="function"&&Ur instanceof Ur&&typeof Fr=="function"&&Fr instanceof Fr)&&(ct=!1)}return Ce.delete(h),Ce.delete(v),ct}function rr(h){return Je(h,In,Ls)}function Wt(h,v){var k=h.__data__;return ir(v)?k[typeof v=="string"?"string":"hash"]:k.map}function Ue(h,v){var k=Tt(h,v);return li(k)?k:void 0}function Gt(h){var v=_t.call(h,Nt),k=h[Nt];try{h[Nt]=void 0;var te=!0}catch{}var Ie=sn.call(h);return te&&(v?h[Nt]=k:delete h[Nt]),Ie}var Ls=ve?function(h){return h==null?[]:(h=Object(h),Ze(ve(h),function(v){return on.call(h,v)}))}:ci,cn=Vt;(yr&&cn(new yr(new ArrayBuffer(1)))!=W||Jn&&cn(new Jn)!=O||br&&cn(br.resolve())!=Q||si&&cn(new si)!=ce||oi&&cn(new oi)!=Ee)&&(cn=function(h){var v=Vt(h),k=v==J?h.constructor:void 0,te=k?bt(k):"";if(te)switch(te){case Cn:return W;case Ht:return O;case Rr:return Q;case Xe:return ce;case ot:return Ee}return v});function xt(h,v){return v=v??a,!!v&&(typeof h=="number"||be.test(h))&&h>-1&&h%1==0&&h<v}function ir(h){var v=typeof h;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?h!=="__proto__":h===null}function Dr(h){return!!pr&&pr in h}function fn(h){var v=h&&h.constructor,k=typeof v=="function"&&v.prototype||Pt;return h===k}function ui(h){return sn.call(h)}function bt(h){if(h!=null){try{return Nn.call(h)}catch{}try{return h+""}catch{}}return""}function it(h,v){return h===v||h!==h&&v!==v}var $t=tr(function(){return arguments}())?tr:function(h){return Yt(h)&&_t.call(h,"callee")&&!on.call(h,"callee")},hn=Array.isArray;function qn(h){return h!=null&&Ct(h.length)&&!Vi(h)}var sr=mr||Wi;function dn(h,v){return Pn(h,v)}function Vi(h){if(!Mr(h))return!1;var v=Vt(h);return v==x||v==S||v==d||v==de}function Ct(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=a}function Mr(h){var v=typeof h;return h!=null&&(v=="object"||v=="function")}function Yt(h){return h!=null&&typeof h=="object"}var Br=Qe?dr(Qe):$r;function In(h){return qn(h)?Ki(h):Hi(h)}function ci(){return[]}function Wi(){return!1}r.exports=dn}(os,os.exports)),os.exports}var Vs={},$u;function vy(){if($u)return Vs;$u=1,Object.defineProperty(Vs,"__esModule",{value:!0});const r=qu(),e=ju();var t;return function(n){function i(f={},d={},m=!1){typeof f!="object"&&(f={}),typeof d!="object"&&(d={});let w=r(d);m||(w=Object.keys(w).reduce((y,x)=>(w[x]!=null&&(y[x]=w[x]),y),{}));for(const y in f)f[y]!==void 0&&d[y]===void 0&&(w[y]=f[y]);return Object.keys(w).length>0?w:void 0}n.compose=i;function s(f={},d={}){typeof f!="object"&&(f={}),typeof d!="object"&&(d={});const m=Object.keys(f).concat(Object.keys(d)).reduce((w,y)=>(e(f[y],d[y])||(w[y]=d[y]===void 0?null:d[y]),w),{});return Object.keys(m).length>0?m:void 0}n.diff=s;function a(f={},d={}){f=f||{};const m=Object.keys(d).reduce((w,y)=>(d[y]!==f[y]&&f[y]!==void 0&&(w[y]=d[y]),w),{});return Object.keys(f).reduce((w,y)=>(f[y]!==d[y]&&d[y]===void 0&&(w[y]=null),w),m)}n.invert=a;function u(f,d,m=!1){if(typeof f!="object")return d;if(typeof d!="object")return;if(!m)return d;const w=Object.keys(d).reduce((y,x)=>(f[x]===void 0&&(y[x]=d[x]),y),{});return Object.keys(w).length>0?w:void 0}n.transform=u}(t||(t={})),Vs.default=t,Vs}var Ws={},Du;function Mu(){if(Du)return Ws;Du=1,Object.defineProperty(Ws,"__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={})),Ws.default=r,Ws}var Gs={},Bu;function wy(){if(Bu)return Gs;Bu=1,Object.defineProperty(Gs,"__esModule",{value:!0});const r=Mu();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 i=this.ops[this.index];if(i){const s=this.offset,a=r.default.length(i);if(n>=a-s?(n=a-s,this.index+=1,this.offset=0):this.offset+=n,typeof i.delete=="number")return{delete:n};{const u={};return i.attributes&&(u.attributes=i.attributes),typeof i.retain=="number"?u.retain=n:typeof i.retain=="object"&&i.retain!==null?u.retain=i.retain:typeof i.insert=="string"?u.insert=i.insert.substr(s,n):u.insert=i.insert,u}}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,i=this.index,s=this.next(),a=this.ops.slice(this.index);return this.offset=n,this.index=i,[s].concat(a)}}else return[]}}return Gs.default=e,Gs}var Uu;function xy(){return Uu||(Uu=1,function(r,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=by(),n=qu(),i=ju(),s=vy();e.AttributeMap=s.default;const a=Mu();e.Op=a.default;const u=wy();e.OpIterator=u.default;const f="\0",d=(w,y)=>{if(typeof w!="object"||w===null)throw new Error(`cannot retain a ${typeof w}`);if(typeof y!="object"||y===null)throw new Error(`cannot retain a ${typeof y}`);const x=Object.keys(w)[0];if(!x||x!==Object.keys(y)[0])throw new Error(`embed types not matched: ${x} != ${Object.keys(y)[0]}`);return[x,w[x],y[x]]};class m{constructor(y){Array.isArray(y)?this.ops=y:y!=null&&Array.isArray(y.ops)?this.ops=y.ops:this.ops=[]}static registerEmbed(y,x){this.handlers[y]=x}static unregisterEmbed(y){delete this.handlers[y]}static getHandler(y){const x=this.handlers[y];if(!x)throw new Error(`no handlers for embed type "${y}"`);return x}insert(y,x){const S={};return typeof y=="string"&&y.length===0?this:(S.insert=y,x!=null&&typeof x=="object"&&Object.keys(x).length>0&&(S.attributes=x),this.push(S))}delete(y){return y<=0?this:this.push({delete:y})}retain(y,x){if(typeof y=="number"&&y<=0)return this;const S={retain:y};return x!=null&&typeof x=="object"&&Object.keys(x).length>0&&(S.attributes=x),this.push(S)}push(y){let x=this.ops.length,S=this.ops[x-1];if(y=n(y),typeof S=="object"){if(typeof y.delete=="number"&&typeof S.delete=="number")return this.ops[x-1]={delete:S.delete+y.delete},this;if(typeof S.delete=="number"&&y.insert!=null&&(x-=1,S=this.ops[x-1],typeof S!="object"))return this.ops.unshift(y),this;if(i(y.attributes,S.attributes)){if(typeof y.insert=="string"&&typeof S.insert=="string")return this.ops[x-1]={insert:S.insert+y.insert},typeof y.attributes=="object"&&(this.ops[x-1].attributes=y.attributes),this;if(typeof y.retain=="number"&&typeof S.retain=="number")return this.ops[x-1]={retain:S.retain+y.retain},typeof y.attributes=="object"&&(this.ops[x-1].attributes=y.attributes),this}}return x===this.ops.length?this.ops.push(y):this.ops.splice(x,0,y),this}chop(){const y=this.ops[this.ops.length-1];return y&&typeof y.retain=="number"&&!y.attributes&&this.ops.pop(),this}filter(y){return this.ops.filter(y)}forEach(y){this.ops.forEach(y)}map(y){return this.ops.map(y)}partition(y){const x=[],S=[];return this.forEach(O=>{(y(O)?x:S).push(O)}),[x,S]}reduce(y,x){return this.ops.reduce(y,x)}changeLength(){return this.reduce((y,x)=>x.insert?y+a.default.length(x):x.delete?y-x.delete:y,0)}length(){return this.reduce((y,x)=>y+a.default.length(x),0)}slice(y=0,x=1/0){const S=[],O=new u.default(this.ops);let N=0;for(;N<x&&O.hasNext();){let M;N<y?M=O.next(y-N):(M=O.next(x-N),S.push(M)),N+=a.default.length(M)}return new m(S)}compose(y){const x=new u.default(this.ops),S=new u.default(y.ops),O=[],N=S.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let J=N.retain;for(;x.peekType()==="insert"&&x.peekLength()<=J;)J-=x.peekLength(),O.push(x.next());N.retain-J>0&&S.next(N.retain-J)}const M=new m(O);for(;x.hasNext()||S.hasNext();)if(S.peekType()==="insert")M.push(S.next());else if(x.peekType()==="delete")M.push(x.next());else{const J=Math.min(x.peekLength(),S.peekLength()),Q=x.next(J),de=S.next(J);if(de.retain){const ue={};if(typeof Q.retain=="number")ue.retain=typeof de.retain=="number"?J:de.retain;else if(typeof de.retain=="number")Q.retain==null?ue.insert=Q.insert:ue.retain=Q.retain;else{const ne=Q.retain==null?"insert":"retain",[re,we,Ee]=d(Q[ne],de.retain),A=m.getHandler(re);ue[ne]={[re]:A.compose(we,Ee,ne==="retain")}}const ce=s.default.compose(Q.attributes,de.attributes,typeof Q.retain=="number");if(ce&&(ue.attributes=ce),M.push(ue),!S.hasNext()&&i(M.ops[M.ops.length-1],ue)){const ne=new m(x.rest());return M.concat(ne).chop()}}else typeof de.delete=="number"&&(typeof Q.retain=="number"||typeof Q.retain=="object"&&Q.retain!==null)&&M.push(de)}return M.chop()}concat(y){const x=new m(this.ops.slice());return y.ops.length>0&&(x.push(y.ops[0]),x.ops=x.ops.concat(y.ops.slice(1))),x}diff(y,x){if(this.ops===y.ops)return new m;const S=[this,y].map(Q=>Q.map(de=>{if(de.insert!=null)return typeof de.insert=="string"?de.insert:f;const ue=Q===y?"on":"with";throw new Error("diff() called "+ue+" non-document")}).join("")),O=new m,N=t(S[0],S[1],x,!0),M=new u.default(this.ops),J=new u.default(y.ops);return N.forEach(Q=>{let de=Q[1].length;for(;de>0;){let ue=0;switch(Q[0]){case t.INSERT:ue=Math.min(J.peekLength(),de),O.push(J.next(ue));break;case t.DELETE:ue=Math.min(de,M.peekLength()),M.next(ue),O.delete(ue);break;case t.EQUAL:ue=Math.min(M.peekLength(),J.peekLength(),de);const ce=M.next(ue),ne=J.next(ue);i(ce.insert,ne.insert)?O.retain(ue,s.default.diff(ce.attributes,ne.attributes)):O.push(ne).delete(ue);break}de-=ue}}),O.chop()}eachLine(y,x=`
23
- `){const S=new u.default(this.ops);let O=new m,N=0;for(;S.hasNext();){if(S.peekType()!=="insert")return;const M=S.peek(),J=a.default.length(M)-S.peekLength(),Q=typeof M.insert=="string"?M.insert.indexOf(x,J)-J:-1;if(Q<0)O.push(S.next());else if(Q>0)O.push(S.next(Q));else{if(y(O,S.next(1).attributes||{},N)===!1)return;N+=1,O=new m}}O.length()>0&&y(O,{},N)}invert(y){const x=new m;return this.reduce((S,O)=>{if(O.insert)x.delete(a.default.length(O));else{if(typeof O.retain=="number"&&O.attributes==null)return x.retain(O.retain),S+O.retain;if(O.delete||typeof O.retain=="number"){const N=O.delete||O.retain;return y.slice(S,S+N).forEach(J=>{O.delete?x.push(J):O.retain&&O.attributes&&x.retain(a.default.length(J),s.default.invert(O.attributes,J.attributes))}),S+N}else if(typeof O.retain=="object"&&O.retain!==null){const N=y.slice(S,S+1),M=new u.default(N.ops).next(),[J,Q,de]=d(O.retain,M.insert),ue=m.getHandler(J);return x.retain({[J]:ue.invert(Q,de)},s.default.invert(O.attributes,M.attributes)),S+1}}return S},0),x.chop()}transform(y,x=!1){if(x=!!x,typeof y=="number")return this.transformPosition(y,x);const S=y,O=new u.default(this.ops),N=new u.default(S.ops),M=new m;for(;O.hasNext()||N.hasNext();)if(O.peekType()==="insert"&&(x||N.peekType()!=="insert"))M.retain(a.default.length(O.next()));else if(N.peekType()==="insert")M.push(N.next());else{const J=Math.min(O.peekLength(),N.peekLength()),Q=O.next(J),de=N.next(J);if(Q.delete)continue;if(de.delete)M.push(de);else{const ue=Q.retain,ce=de.retain;let ne=typeof ce=="object"&&ce!==null?ce:J;if(typeof ue=="object"&&ue!==null&&typeof ce=="object"&&ce!==null){const re=Object.keys(ue)[0];if(re===Object.keys(ce)[0]){const we=m.getHandler(re);we&&(ne={[re]:we.transform(ue[re],ce[re],x)})}}M.retain(ne,s.default.transform(Q.attributes,de.attributes,x))}}return M.chop()}transformPosition(y,x=!1){x=!!x;const S=new u.default(this.ops);let O=0;for(;S.hasNext()&&O<=y;){const N=S.peekLength(),M=S.peekType();if(S.next(),M==="delete"){y-=Math.min(N,y-O);continue}else M==="insert"&&(O<y||!x)&&(y+=N);O+=N}return y}}m.Op=a.default,m.OpIterator=u.default,m.AttributeMap=s.default,m.handlers={},e.default=m,r.exports=m,r.exports.default=m}(zs,zs.exports)),zs.exports}var Xt=xy();const Ne=Do(Xt);class vn extends Ut{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}vn.blotName="break",vn.tagName="BR";let wn=class extends Hs{};const Ey={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ys(r){return r.replace(/[&<>"']/g,e=>Ey[e])}const Hn=class Hn extends ia{static compare(e,t){const n=Hn.order.indexOf(e),i=Hn.order.indexOf(t);return n>=0||i>=0?n-i:e===t?0:e<t?-1:1}formatAt(e,t,n,i){if(Hn.compare(this.statics.blotName,n)<0&&this.scroll.query(n,Le.BLOT)){const s=this.isolate(e,t);i&&s.wrap(n,i)}else super.formatAt(e,t,n,i)}optimize(e){if(super.optimize(e),this.parent instanceof Hn&&Hn.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};Oe(Hn,"allowedChildren",[Hn,vn,Ut,wn]),Oe(Hn,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Bn=Hn;const Fu=1;class wt extends is{constructor(){super(...arguments);Oe(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Ku(this)),this.cache.delta}deleteAt(t,n){super.deleteAt(t,n),this.cache={}}formatAt(t,n,i,s){n<=0||(this.scroll.query(i,Le.BLOCK)?t+n===this.length()&&this.format(i,s):super.formatAt(t,Math.min(n,this.length()-t-1),i,s),this.cache={})}insertAt(t,n,i){if(i!=null){super.insertAt(t,n,i),this.cache={};return}if(n.length===0)return;const s=n.split(`
24
- `),a=s.shift();a.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});let u=this;s.reduce((f,d)=>(u=u.split(f,!0),u.insertAt(0,d),d.length),t+a.length)}insertBefore(t,n){const{head:i}=this.children;super.insertBefore(t,n),i instanceof vn&&i.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Fu),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()-Fu)){const s=this.clone();return t===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const i=super.split(t,n);return this.cache={},i}}wt.blotName="block",wt.tagName="P",wt.defaultChild=vn,wt.allowedChildren=[vn,Bn,Ut,wn];class Qt extends Ut{attach(){super.attach(),this.attributes=new Fs(this.domNode)}delta(){return new Ne().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,Le.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,i){this.format(n,i)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}const i=t.split(`
25
- `),s=i.pop(),a=i.map(f=>{const d=this.scroll.create(wt.blotName);return d.insertAt(0,f),d}),u=this.split(e);a.forEach(f=>{this.parent.insertBefore(f,u)}),s&&this.parent.insertBefore(this.scroll.create("text",s),u)}}Qt.scope=Le.BLOCK_BLOT;function Ku(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(Et).reduce((t,n)=>n.length()===0?t:t.insert(n.value(),en(n,{},e)),new Ne).insert(`
26
- `,en(r))}function en(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:en(r.parent,e,t)}const nn=class nn extends Ut{static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(nn.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,i=0;for(;n!=null&&n.statics.scope!==Le.BLOCK_BLOT;)i+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=nn.CONTENTS.length,n.optimize(),n.formatAt(i,nn.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 wn?this.prev:null,n=t?t.length():0,i=this.next instanceof wn?this.next:null,s=i?i.text:"",{textNode:a}=this,u=a.data.split(nn.CONTENTS).join("");a.data=nn.CONTENTS;let f;if(t)f=t,(u||i)&&(t.insertAt(t.length(),u+s),i&&i.remove());else if(i)f=i,i.insertAt(0,u);else{const d=document.createTextNode(u);f=this.scroll.create(d),this.parent.insertBefore(f,this)}if(this.remove(),e){const d=(y,x)=>t&&y===t.domNode?x:y===a?n+x-1:i&&y===i.domNode?n+u.length+x:null,m=d(e.start.node,e.start.offset),w=d(e.end.node,e.end.offset);if(m!==null&&w!==null)return{startNode:f.domNode,startOffset:m,endNode:f.domNode,endOffset:w}}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=nn.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};Oe(nn,"blotName","cursor"),Oe(nn,"className","ql-cursor"),Oe(nn,"tagName","span"),Oe(nn,"CONTENTS","\uFEFF");let Oi=nn;var ua={exports:{}},Hu;function Oy(){return Hu||(Hu=1,function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(f,d,m){this.fn=f,this.context=d,this.once=m||!1}function s(f,d,m,w,y){if(typeof m!="function")throw new TypeError("The listener must be a function");var x=new i(m,w||f,y),S=t?t+d:d;return f._events[S]?f._events[S].fn?f._events[S]=[f._events[S],x]:f._events[S].push(x):(f._events[S]=x,f._eventsCount++),f}function a(f,d){--f._eventsCount===0?f._events=new n:delete f._events[d]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var d=[],m,w;if(this._eventsCount===0)return d;for(w in m=this._events)e.call(m,w)&&d.push(t?w.slice(1):w);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},u.prototype.listeners=function(d){var m=t?t+d:d,w=this._events[m];if(!w)return[];if(w.fn)return[w.fn];for(var y=0,x=w.length,S=new Array(x);y<x;y++)S[y]=w[y].fn;return S},u.prototype.listenerCount=function(d){var m=t?t+d:d,w=this._events[m];return w?w.fn?1:w.length:0},u.prototype.emit=function(d,m,w,y,x,S){var O=t?t+d:d;if(!this._events[O])return!1;var N=this._events[O],M=arguments.length,J,Q;if(N.fn){switch(N.once&&this.removeListener(d,N.fn,void 0,!0),M){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,m),!0;case 3:return N.fn.call(N.context,m,w),!0;case 4:return N.fn.call(N.context,m,w,y),!0;case 5:return N.fn.call(N.context,m,w,y,x),!0;case 6:return N.fn.call(N.context,m,w,y,x,S),!0}for(Q=1,J=new Array(M-1);Q<M;Q++)J[Q-1]=arguments[Q];N.fn.apply(N.context,J)}else{var de=N.length,ue;for(Q=0;Q<de;Q++)switch(N[Q].once&&this.removeListener(d,N[Q].fn,void 0,!0),M){case 1:N[Q].fn.call(N[Q].context);break;case 2:N[Q].fn.call(N[Q].context,m);break;case 3:N[Q].fn.call(N[Q].context,m,w);break;case 4:N[Q].fn.call(N[Q].context,m,w,y);break;default:if(!J)for(ue=1,J=new Array(M-1);ue<M;ue++)J[ue-1]=arguments[ue];N[Q].fn.apply(N[Q].context,J)}}return!0},u.prototype.on=function(d,m,w){return s(this,d,m,w,!1)},u.prototype.once=function(d,m,w){return s(this,d,m,w,!0)},u.prototype.removeListener=function(d,m,w,y){var x=t?t+d:d;if(!this._events[x])return this;if(!m)return a(this,x),this;var S=this._events[x];if(S.fn)S.fn===m&&(!y||S.once)&&(!w||S.context===w)&&a(this,x);else{for(var O=0,N=[],M=S.length;O<M;O++)(S[O].fn!==m||y&&!S[O].once||w&&S[O].context!==w)&&N.push(S[O]);N.length?this._events[x]=N.length===1?N[0]:N:a(this,x)}return this},u.prototype.removeAllListeners=function(d){var m;return d?(m=t?t+d:d,this._events[m]&&a(this,m)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=t,u.EventEmitter=u,r.exports=u}(ua)),ua.exports}var Sy=Oy();const Ay=Do(Sy),ca=new WeakMap,fa=["error","warn","log","info"];let ha="warn";function zu(r){if(ha&&fa.indexOf(r)<=fa.indexOf(ha)){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 lr(r){return fa.reduce((e,t)=>(e[t]=zu.bind(console,t,r),e),{})}lr.level=r=>{ha=r},zu.level=lr.level;const da=lr("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(i=>{const s=ca.get(i);s&&s.emitter&&s.emitter.handleDOM(...t)})})});class Te extends Ay{constructor(){super(),this.domListeners={},this.on("error",da.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return da.log.call(da,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];(this.domListeners[e.type]||[]).forEach(s=>{let{node:a,handler:u}=s;(e.target===a||a.contains(e.target))&&u(e,...n)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}Oe(Te,"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"}),Oe(Te,"sources",{API:"api",SILENT:"silent",USER:"user"});const pa=lr("quill:selection");class Jr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class Ty{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 Jr(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,Te.sources.USER),1)}),this.emitter.on(Te.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const n=this.getNativeRange();n!=null&&n.start.node!==this.cursor.textNode&&this.emitter.once(Te.events.SCROLL_UPDATE,(i,s)=>{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 a=s.some(u=>u.type==="characterData"||u.type==="childList"||u.type==="attributes"&&u.target===this.root);this.update(a?Te.sources.SILENT:i)}catch{}})}),this.emitter.on(Te.events.SCROLL_OPTIMIZE,(n,i)=>{if(i.range){const{startNode:s,startOffset:a,endNode:u,endOffset:f}=i.range;this.setNativeRange(s,a,u,f),this.update(Te.sources.SILENT)}}),this.update(Te.sources.SILENT)}handleComposition(){this.emitter.on(Te.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Te.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(Te.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,Le.BLOCK))){if(n.start.node!==this.cursor.textNode){const i=this.scroll.find(n.start.node,!1);if(i==null)return;if(i instanceof Et){const s=i.split(n.start.offset);i.parent.insertBefore(this.cursor,s)}else i.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 i,[s,a]=this.scroll.leaf(e);if(s==null)return null;if(t>0&&a===s.length()){const[m]=this.scroll.leaf(e+1);if(m){const[w]=this.scroll.line(e),[y]=this.scroll.line(e+1);w===y&&(s=m,a=0)}}[i,a]=s.position(a,!0);const u=document.createRange();if(t>0)return u.setStart(i,a),[s,a]=this.scroll.leaf(e+t),s==null?null:([i,a]=s.position(a,!0),u.setEnd(i,a),u.getBoundingClientRect());let f="left",d;if(i instanceof Text){if(!i.data.length)return null;a<i.data.length?(u.setStart(i,a),u.setEnd(i,a+1)):(u.setStart(i,a-1),u.setEnd(i,a),f="right"),d=u.getBoundingClientRect()}else{if(!(s.domNode instanceof Element))return null;d=s.domNode.getBoundingClientRect(),a>0&&(f="right")}return{bottom:d.top+d.height,height:d.height,left:d[f],right:d[f],top:d.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 pa.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&&ga(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(a=>{const[u,f]=a,d=this.scroll.find(u,!0),m=d.offset(this.scroll);return f===0?m:d instanceof Et?m+d.index(u,f):m+d.length()}),i=Math.min(Math.max(...n),this.scroll.length()-1),s=Math.min(i,...n);return new Jr(s,i-s)}normalizeNative(e){if(!ga(this.root,e.startContainer)||!e.collapsed&&!ga(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:i,offset:s}=n;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>s)i=i.childNodes[s],s=0;else if(i.childNodes.length===s)i=i.lastChild,i instanceof Text?s=i.data.length:i.childNodes.length>0?s=i.childNodes.length:s=i.childNodes.length+1;else break;n.node=i,n.offset=s}),t}rangeToNative(e){const t=this.scroll.length(),n=(i,s)=>{i=Math.min(t-1,i);const[a,u]=this.scroll.leaf(i);return a?a.position(u,s):[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,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(pa.info("setNativeRange",e,t,n,i),e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:u}=this.getNativeRange()||{};if(u==null||s||e!==u.startContainer||t!==u.startOffset||n!==u.endContainer||i!==u.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&n.tagName==="BR"&&(i=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const f=document.createRange();f.setStart(e,t),f.setEnd(n,i),a.removeAllRanges(),a.addRange(f)}}else a.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]:Te.sources.API;if(typeof t=="string"&&(n=t,t=!1),pa.info("setRange",e),e!=null){const i=this.rangeToNative(e);this.setNativeRange(...i,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Te.sources.USER;const t=this.lastRange,[n,i]=this.getRange();if(this.lastRange=n,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!na(t,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const s=[Te.events.SELECTION_CHANGE,yi(this.lastRange),yi(t),e];this.emitter.emit(Te.events.EDITOR_CHANGE,...s),e!==Te.sources.SILENT&&this.emitter.emit(...s)}}}function ga(r,e){try{e.parentNode}catch{return!1}return r.contains(e)}const _y=/^[ -~]*$/;let Ny=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=Vu(e),i=new Ne;return Ly(n.ops.slice()).reduce((a,u)=>{const f=Xt.Op.length(u);let d=u.attributes||{},m=!1,w=!1;if(u.insert!=null){if(i.retain(f),typeof u.insert=="string"){const S=u.insert;w=!S.endsWith(`
27
- `)&&(t<=a||!!this.scroll.descendant(Qt,a)[0]),this.scroll.insertAt(a,S);const[O,N]=this.scroll.line(a);let M=Tr({},en(O));if(O instanceof wt){const[J]=O.descendant(Et,N);J&&(M=Tr(M,en(J)))}d=Xt.AttributeMap.diff(M,d)||{}}else if(typeof u.insert=="object"){const S=Object.keys(u.insert)[0];if(S==null)return a;const O=this.scroll.query(S,Le.INLINE)!=null;if(O)(t<=a||this.scroll.descendant(Qt,a)[0])&&(w=!0);else if(a>0){const[N,M]=this.scroll.descendant(Et,a-1);N instanceof wn?N.value()[M]!==`
28
- `&&(m=!0):N instanceof Ut&&N.statics.scope===Le.INLINE_BLOT&&(m=!0)}if(this.scroll.insertAt(a,S,u.insert[S]),O){const[N]=this.scroll.descendant(Et,a);if(N){const M=Tr({},en(N));d=Xt.AttributeMap.diff(M,d)||{}}}}t+=f}else if(i.push(u),u.retain!==null&&typeof u.retain=="object"){const S=Object.keys(u.retain)[0];if(S==null)return a;this.scroll.updateEmbedAt(a,S,u.retain[S])}Object.keys(d).forEach(S=>{this.scroll.formatAt(a,f,S,d[S])});const y=m?1:0,x=w?1:0;return t+=y+x,i.retain(y),i.delete(x),a+f+y+x},0),i.reduce((a,u)=>typeof u.delete=="number"?(this.scroll.deleteAt(a,u.delete),a):a+Xt.Op.length(u),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new Ne().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(s=>{this.scroll.lines(e,Math.max(t,1)).forEach(a=>{a.format(s,n[s])})}),this.scroll.optimize();const i=new Ne().retain(e).retain(t,yi(n));return this.update(i)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(s=>{this.scroll.formatAt(e,t,s,n[s])});const i=new Ne().retain(e).retain(t,yi(n));return this.update(i)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new Ne)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],i=[];t===0?this.scroll.path(e).forEach(u=>{const[f]=u;f instanceof wt?n.push(f):f instanceof Et&&i.push(f)}):(n=this.scroll.lines(e,t),i=this.scroll.descendants(Et,e,t));const[s,a]=[n,i].map(u=>{const f=u.shift();if(f==null)return{};let d=en(f);for(;Object.keys(d).length>0;){const m=u.shift();if(m==null)return d;d=Cy(en(m),d)}return d});return{...s,...a}}getHTML(e,t){const[n,i]=this.scroll.line(e);if(n){const s=n.length();return n.length()>=i+t&&!(i===0&&t===s)?as(n,i,t,!0):as(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=Vu(t),i=new Ne().retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(i)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new Ne().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,`
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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};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,`
29
29
  `).replace(/\r/g,`
30
- `),this.scroll.insertAt(e,t),Object.keys(n).forEach(i=>{this.scroll.formatAt(e,t.length,i,n[i])}),this.update(new Ne().retain(e).insert(t,yi(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)!==wt.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof vn}removeFormat(e,t){const n=this.getText(e,t),[i,s]=this.scroll.line(e+t);let a=0,u=new Ne;i!=null&&(a=i.length()-s,u=i.delta().slice(s,s+a-1).insert(`
31
- `));const d=this.getContents(e,t+a).diff(new Ne().insert(n).concat(u)),m=new Ne().retain(e).concat(d);return this.applyDelta(m)}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 i=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(_y)&&this.scroll.find(t[0].target)){const s=this.scroll.find(t[0].target),a=en(s),u=s.offset(this.scroll),f=t[0].oldValue.replace(Oi.CONTENTS,""),d=new Ne().insert(f),m=new Ne().insert(s.value()),w=n&&{oldRange:Wu(n.oldRange,-u),newRange:Wu(n.newRange,-u)};e=new Ne().retain(u).concat(d.diff(m,w)).reduce((x,S)=>S.insert?x.insert(S.insert,a):x.push(S),new Ne),this.delta=i.compose(e)}else this.delta=this.getDelta(),(!e||!na(i.compose(e),this.delta))&&(e=i.diff(this.delta,n));return e}};function Si(r,e,t){if(r.length===0){const[x]=ma(t.pop());return e<=0?`</li></${x}>`:`</li></${x}>${Si([],e-1,t)}`}const[{child:n,offset:i,length:s,indent:a,type:u},...f]=r,[d,m]=ma(u);if(a>e)return t.push(u),a===e+1?`<${d}><li${m}>${as(n,i,s)}${Si(f,a,t)}`:`<${d}><li>${Si(r,e+1,t)}`;const w=t[t.length-1];if(a===e&&u===w)return`</li><li${m}>${as(n,i,s)}${Si(f,a,t)}`;const[y]=ma(t.pop());return`</li></${y}>${Si(r,e-1,t)}`}function as(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 wn)return Ys(r.value().slice(e,e+t)).replaceAll(" ","&nbsp;");if(r instanceof bn){if(r.statics.blotName==="list-container"){const d=[];return r.children.forEachAt(e,t,(m,w,y)=>{const x="formats"in m&&typeof m.formats=="function"?m.formats():{};d.push({child:m,offset:w,length:y,indent:x.indent||0,type:x.list})}),Si(d,-1,[])}const i=[];if(r.children.forEachAt(e,t,(d,m,w)=>{i.push(as(d,m,w))}),n||r.statics.blotName==="list")return i.join("");const{outerHTML:s,innerHTML:a}=r.domNode,[u,f]=s.split(`>${a}<`);return u==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${f}`:`${u}>${i.join("")}<${f}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function Cy(r,e){return Object.keys(e).reduce((t,n)=>{if(r[n]==null)return t;const i=e[n];return i===r[n]?t[n]=i:Array.isArray(i)?i.indexOf(r[n])<0?t[n]=i.concat([r[n]]):t[n]=i:t[n]=[i,r[n]],t},{})}function ma(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 Vu(r){return r.reduce((e,t)=>{if(typeof t.insert=="string"){const n=t.insert.replace(/\r\n/g,`
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(" ","&nbsp;");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,`
32
32
  `).replace(/\r/g,`
33
- `);return e.insert(n,t.attributes)}return e.push(t)},new Ne)}function Wu(r,e){let{index:t,length:n}=r;return new Jr(t+e,n)}function Ly(r){const e=[];return r.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
34
- `).forEach((i,s)=>{s&&e.push({insert:`
35
- `,attributes:t.attributes}),i&&e.push({insert:i,attributes:t.attributes})}):e.push(t)}),e}class xn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}Oe(xn,"DEFAULTS",{});const Js="\uFEFF";class ya extends Ut{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(Js),this.rightGuard=document.createTextNode(Js),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 i=e.data.split(Js).join("");if(e===this.leftGuard)if(this.prev instanceof wn){const s=this.prev.length();this.prev.insertAt(s,i),t={startNode:this.prev.domNode,startOffset:s+i.length}}else n=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:i.length};else e===this.rightGuard&&(this.next instanceof wn?(this.next.insertAt(0,i),t={startNode:this.next.domNode,startOffset:i.length}):(n=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:i.length}));return e.data=Js,t}update(e,t){e.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const i=this.restore(n.target);i&&(t.range=i)}})}}class ky{constructor(e,t){Oe(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 ya)&&(this.emitter.emit(Te.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Te.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Te.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Te.events.COMPOSITION_END,e),this.isComposing=!1}}const Ts=class Ts{constructor(e,t){Oe(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]}};Oe(Ts,"DEFAULTS",{modules:{}}),Oe(Ts,"themes",{default:Ts});let Ai=Ts;const Ry=r=>r.parentElement||r.getRootNode().host||null,Py=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}},Zs=r=>{const e=parseInt(r,10);return Number.isNaN(e)?0:e},Gu=(r,e,t,n,i,s)=>r<t&&e>n?0:r<t?-(t-r+i):e>n?e-r>n-t?r+i-t:e-n+s:0,qy=(r,e)=>{var s,a,u;const t=r.ownerDocument;let n=e,i=r;for(;i;){const f=i===t.body,d=f?{top:0,right:((s=window.visualViewport)==null?void 0:s.width)??t.documentElement.clientWidth,bottom:((a=window.visualViewport)==null?void 0:a.height)??t.documentElement.clientHeight,left:0}:Py(i),m=getComputedStyle(i),w=Gu(n.left,n.right,d.left,d.right,Zs(m.scrollPaddingLeft),Zs(m.scrollPaddingRight)),y=Gu(n.top,n.bottom,d.top,d.bottom,Zs(m.scrollPaddingTop),Zs(m.scrollPaddingBottom));if(w||y)if(f)(u=t.defaultView)==null||u.scrollBy(w,y);else{const{scrollLeft:x,scrollTop:S}=i;y&&(i.scrollTop+=y),w&&(i.scrollLeft+=w);const O=i.scrollLeft-x,N=i.scrollTop-S;n={left:n.left-O,top:n.top-N,right:n.right-O,bottom:n.bottom-N}}i=f||m.position==="fixed"?null:Ry(i)}},Iy=100,jy=["block","break","cursor","inline","scroll","text"],$y=(r,e,t)=>{const n=new vi;return jy.forEach(i=>{const s=e.query(i);s&&n.register(s)}),r.forEach(i=>{let s=e.query(i);s||t.error(`Cannot register "${i}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;s;)if(n.register(s),s="blotName"in s?s.requiredContainer??null:null,a+=1,a>Iy){t.error(`Cycle detected in registering blot requiredContainer: "${i}"`);break}}),n},Ti=lr("quill"),Xs=new vi;bn.uiClass="ql-ui";const An=class An{static debug(e){e===!0&&(e="log"),lr.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ca.get(e)||Xs.find(e,t)}static import(e){return this.imports[e]==null&&Ti.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(i=>{this.register(i,e[i],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&&Ti.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&Xs.register(t),typeof t.register=="function"&&t.register(Xs)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Dy(e,t),this.container=this.options.container,this.container==null){Ti.error("Invalid Quill container",e);return}this.options.debug&&An.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",ca.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Te;const i=oa.blotName,s=this.options.registry.query(i);if(!s||!("blotName"in s))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new s(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Ny(this.scroll),this.selection=new Ty(this.scroll,this.emitter),this.composition=new ky(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(Te.events.EDITOR_CHANGE,a=>{a===Te.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Te.events.SCROLL_UPDATE,(a,u)=>{const f=this.selection.lastRange,[d]=this.selection.getRange(),m=f&&d?{oldRange:f,newRange:d}:void 0;En.call(this,()=>this.editor.update(null,u,m),a)}),this.emitter.on(Te.events.SCROLL_EMBED_UPDATE,(a,u)=>{const f=this.selection.lastRange,[d]=this.selection.getRange(),m=f&&d?{oldRange:f,newRange:d}:void 0;En.call(this,()=>{const w=new Ne().retain(a.offset(this)).retain({[a.statics.blotName]:u});return this.editor.update(w,[],m)},An.sources.USER)}),n){const a=this.clipboard.convert({html:`${n}<p><br></p>`,text:`
36
- `});this.setContents(a)}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]=ur(e,t,n),En.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]:Te.sources.API;return En.call(this,()=>{const i=this.getSelection(!0);let s=new Ne;if(i==null)return s;if(this.scroll.query(e,Le.BLOCK))s=this.editor.formatLine(i.index,i.length,{[e]:t});else{if(i.length===0)return this.selection.format(e,t),s;s=this.editor.formatText(i.index,i.length,{[e]:t})}return this.setSelection(i,Te.sources.SILENT),s},n)}formatLine(e,t,n,i,s){let a;return[e,t,a,s]=ur(e,t,n,i,s),En.call(this,()=>this.editor.formatLine(e,t,a),s,e,0)}formatText(e,t,n,i,s){let a;return[e,t,a,s]=ur(e,t,n,i,s),En.call(this,()=>this.editor.formatText(e,t,a),s,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 i=this.container.getBoundingClientRect();return{bottom:n.bottom-i.top,height:n.height,left:n.left-i.left,right:n.right-i.left,top:n.top-i.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]=ur(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]=ur(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]=ur(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:An.sources.API;return En.call(this,()=>this.editor.insertEmbed(e,t,n),i,e)}insertText(e,t,n,i,s){let a;return[e,,a,s]=ur(e,0,n,i,s),En.call(this,()=>this.editor.insertText(e,t,a),s,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]=ur(e,t,n),En.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){qy(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]:Te.sources.API;return En.call(this,()=>{e=new Ne(e);const n=this.getLength(),i=this.editor.deleteText(0,n),s=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return i.compose(s).compose(a)},t)}setSelection(e,t,n){e==null?this.selection.setRange(null,t||An.sources.API):([e,t,,n]=ur(e,t,n),this.selection.setRange(new Jr(Math.max(0,e),t),n),n!==Te.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te.sources.API;const n=new Ne().insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Te.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]:Te.sources.API;return En.call(this,()=>(e=new Ne(e),this.editor.applyDelta(e)),t,!0)}};Oe(An,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Xs,theme:"default"}),Oe(An,"events",Te.events),Oe(An,"sources",Te.sources),Oe(An,"version","2.0.3"),Oe(An,"imports",{delta:Ne,parchment:yy,"core/module":xn,"core/theme":Ai});let oe=An;function Yu(r){return typeof r=="string"?document.querySelector(r):r}function ba(r){return Object.entries(r??{}).reduce((e,t)=>{let[n,i]=t;return{...e,[n]:i===!0?{}:i}},{})}function Ju(r){return Object.fromEntries(Object.entries(r).filter(e=>e[1]!==void 0))}function Dy(r,e){const t=Yu(r);if(!t)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===oe.DEFAULTS.theme?Ai:oe.import(`themes/${e.theme}`);if(!i)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:s,...a}=oe.DEFAULTS,{modules:u,...f}=i.DEFAULTS;let d=ba(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const m=Tr({},ba(s),ba(u),d),w={...a,...Ju(f),...Ju(e)};let y=e.registry;return y?e.formats&&Ti.warn('Ignoring "formats" option because "registry" is specified'):y=e.formats?$y(e.formats,w.registry,Ti):w.registry,{...w,registry:y,container:t,theme:i,modules:Object.entries(m).reduce((x,S)=>{let[O,N]=S;if(!N)return x;const M=oe.import(`modules/${O}`);return M==null?(Ti.error(`Cannot load ${O} module. Are you sure you registered it?`),x):{...x,[O]:Tr({},M.DEFAULTS||{},N)}},{}),bounds:Yu(w.bounds)}}function En(r,e,t,n){if(!this.isEnabled()&&e===Te.sources.USER&&!this.allowReadOnlyEdits)return new Ne;let i=t==null?null:this.getSelection();const s=this.editor.delta,a=r();if(i!=null&&(t===!0&&(t=i.index),n==null?i=Zu(i,a,e):n!==0&&(i=Zu(i,t,n,e)),this.setSelection(i,Te.sources.SILENT)),a.length()>0){const u=[Te.events.TEXT_CHANGE,a,s,e];this.emitter.emit(Te.events.EDITOR_CHANGE,...u),e!==Te.sources.SILENT&&this.emitter.emit(...u)}return a}function ur(r,e,t,n,i){let s={};return typeof r.index=="number"&&typeof r.length=="number"?typeof e!="number"?(i=n,n=t,t=e,e=r.length,r=r.index):(e=r.length,r=r.index):typeof e!="number"&&(i=n,n=t,t=e,e=0),typeof t=="object"?(s=t,i=n):typeof t=="string"&&(n!=null?s[t]=n:i=t),i=i||Te.sources.API,[r,e,s,i]}function Zu(r,e,t,n){const i=typeof t=="number"?t:0;if(r==null)return null;let s,a;return e&&typeof e.transformPosition=="function"?[s,a]=[r.index,r.index+r.length].map(u=>e.transformPosition(u,n!==Te.sources.USER)):[s,a]=[r.index,r.index+r.length].map(u=>u<e||u===e&&n===Te.sources.USER?u:i>=0?u+i:Math.max(e,u+i)),new Jr(s,a-s)}class Zr extends Ks{}function Xu(r){return r instanceof wt||r instanceof Qt}function Qu(r){return typeof r.updateContent=="function"}class _i extends oa{constructor(e,t,n){let{emitter:i}=n;super(e,t),this.emitter=i,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",s=>this.handleDragStart(s))}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(Te.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Te.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Te.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,i]=this.line(e),[s]=this.line(e+t);if(super.deleteAt(e,t),s!=null&&n!==s&&i>0){if(n instanceof Qt||s instanceof Qt){this.optimize();return}const a=s.children.head instanceof vn?null:s.children.head;n.moveChildren(s,a),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,i){super.formatAt(e,t,n,i),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(n==null||this.scroll.query(t,Le.BLOCK)==null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i),n==null&&t.endsWith(`
37
- `)?i.insertAt(0,t.slice(0,-1),n):i.insertAt(0,t,n)}else{const i=this.scroll.create(t,n);this.appendChild(i)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===Le.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 Ne().insert(`
38
- `))),i=n.pop();if(i==null)return;this.batchStart();const s=n.shift();if(s){const f=s.type==="block"&&(s.delta.length()===0||!this.descendant(Qt,e)[0]&&e<this.length()),d=s.type==="block"?s.delta:new Ne().insert({[s.key]:s.value});va(this,e,d);const m=s.type==="block"?1:0,w=e+d.length()+m;f&&this.insertAt(w-1,`
39
- `);const y=en(this.line(e)[0]),x=Xt.AttributeMap.diff(y,s.attributes)||{};Object.keys(x).forEach(S=>{this.formatAt(w-1,1,S,x[S])}),e=w}let[a,u]=this.children.find(e);if(n.length&&(a&&(a=a.split(u),u=0),n.forEach(f=>{if(f.type==="block"){const d=this.createBlock(f.attributes,a||void 0);va(d,0,f.delta)}else{const d=this.create(f.key,f.value);this.insertBefore(d,a||void 0),Object.keys(f.attributes).forEach(m=>{d.format(m,f.attributes[m])})}})),i.type==="block"&&i.delta.length()){const f=a?a.offset(a.scroll)+u:this.length();va(this,f,i.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,i]=t;return n instanceof Et?[n,i]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Xu,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=(i,s,a)=>{let u=[],f=a;return i.children.forEachAt(s,a,(d,m,w)=>{Xu(d)?u.push(d):d instanceof Ks&&(u=u.concat(n(d,m,f))),f-=w}),u};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(Te.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=Te.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(n=>{let{target:i}=n;const s=this.find(i,!0);return s&&!Qu(s)}),e.length>0&&this.emitter.emit(Te.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Te.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[i]=this.descendant(s=>s instanceof Qt,e);i&&i.statics.blotName===t&&Qu(i)&&i.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new Ne;return e.forEach(i=>{const s=i==null?void 0:i.insert;if(s)if(typeof s=="string"){const a=s.split(`
40
- `);a.slice(0,-1).forEach(f=>{n.insert(f,i.attributes),t.push({type:"block",delta:n,attributes:i.attributes??{}}),n=new Ne});const u=a[a.length-1];u&&n.insert(u,i.attributes)}else{const a=Object.keys(s)[0];if(!a)return;this.query(a,Le.INLINE)?n.push(i):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new Ne,t.push({type:"blockEmbed",key:a,value:s[a],attributes:i.attributes??{}}))}}),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const i={};Object.entries(e).forEach(u=>{let[f,d]=u;this.query(f,Le.BLOCK&Le.BLOT)!=null?n=f:i[f]=d});const s=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(s,t||void 0);const a=s.length();return Object.entries(i).forEach(u=>{let[f,d]=u;s.formatAt(0,a,f,d)}),s}}Oe(_i,"blotName","scroll"),Oe(_i,"className","ql-editor"),Oe(_i,"tagName","DIV"),Oe(_i,"defaultChild",wt),Oe(_i,"allowedChildren",[wt,Qt,Zr]);function va(r,e,t){t.reduce((n,i)=>{const s=Xt.Op.length(i);let a=i.attributes||{};if(i.insert!=null){if(typeof i.insert=="string"){const u=i.insert;r.insertAt(n,u);const[f]=r.descendant(Et,n),d=en(f);a=Xt.AttributeMap.diff(d,a)||{}}else if(typeof i.insert=="object"){const u=Object.keys(i.insert)[0];if(u==null)return n;if(r.insertAt(n,u,i.insert[u]),r.scroll.query(u,Le.INLINE)!=null){const[d]=r.descendant(Et,n),m=en(d);a=Xt.AttributeMap.diff(m,a)||{}}}}return Object.keys(a).forEach(u=>{r.formatAt(n,s,u,a[u])}),n+s},e)}const wa={scope:Le.BLOCK,whitelist:["right","center","justify"]},My=new Mn("align","align",wa),ec=new yn("align","ql-align",wa),tc=new _r("align","text-align",wa);class nc extends _r{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(i=>`00${parseInt(i,10).toString(16)}`.slice(-2)).join("")}`):t}}const By=new yn("color","ql-color",{scope:Le.INLINE}),xa=new nc("color","color",{scope:Le.INLINE}),Uy=new yn("background","ql-bg",{scope:Le.INLINE}),Ea=new nc("background","background-color",{scope:Le.INLINE});class Xr extends Zr{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(`
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(`
34
+ `).forEach((s,i)=>{i&&e.push({insert:`
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(`
41
41
  `).slice(e,e+t)}html(e,t){return`<pre>
42
- ${Ys(this.code(e,t))}
43
- </pre>`}}class Ot extends wt{static register(){oe.register(Xr)}}Oe(Ot,"TAB"," ");class Oa extends Bn{}Oa.blotName="code",Oa.tagName="CODE",Ot.blotName="code-block",Ot.className="ql-code-block",Ot.tagName="DIV",Xr.blotName="code-block-container",Xr.className="ql-code-block-container",Xr.tagName="DIV",Xr.allowedChildren=[Ot],Ot.allowedChildren=[wn,vn,Oi],Ot.requiredContainer=Xr;const Sa={scope:Le.BLOCK,whitelist:["rtl"]},rc=new Mn("direction","dir",Sa),ic=new yn("direction","ql-direction",Sa),sc=new _r("direction","direction",Sa),oc={scope:Le.INLINE,whitelist:["serif","monospace"]},ac=new yn("font","ql-font",oc);class Fy extends _r{value(e){return super.value(e).replace(/["']/g,"")}}const lc=new Fy("font","font-family",oc),uc=new yn("size","ql-size",{scope:Le.INLINE,whitelist:["small","large","huge"]}),cc=new _r("size","font-size",{scope:Le.INLINE,whitelist:["10px","18px","32px"]}),Ky=lr("quill:keyboard"),Hy=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Qs extends xn{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 i=Vy(e);if(i==null){Ky.warn("Attempted to add invalid keyboard binding",i);return}typeof t=="function"&&(t={handler:t}),typeof n=="function"&&(n={handler:n}),(Array.isArray(i.key)?i.key:[i.key]).forEach(a=>{const u={...i,key:a,...t,...n};this.bindings[u.key]=this.bindings[u.key]||[],this.bindings[u.key].push(u)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const i=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(M=>Qs.match(e,M));if(i.length===0)return;const s=oe.find(e.target,!0);if(s&&s.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[u,f]=this.quill.getLine(a.index),[d,m]=this.quill.getLeaf(a.index),[w,y]=a.length===0?[d,m]:this.quill.getLeaf(a.index+a.length),x=d instanceof Hs?d.value().slice(0,m):"",S=w instanceof Hs?w.value().slice(y):"",O={collapsed:a.length===0,empty:a.length===0&&u.length()<=1,format:this.quill.getFormat(a),line:u,offset:f,prefix:x,suffix:S,event:e};i.some(M=>{if(M.collapsed!=null&&M.collapsed!==O.collapsed||M.empty!=null&&M.empty!==O.empty||M.offset!=null&&M.offset!==O.offset)return!1;if(Array.isArray(M.format)){if(M.format.every(J=>O.format[J]==null))return!1}else if(typeof M.format=="object"&&!Object.keys(M.format).every(J=>M.format[J]===!0?O.format[J]!=null:M.format[J]===!1?O.format[J]==null:na(M.format[J],O.format[J])))return!1;return M.prefix!=null&&!M.prefix.test(O.prefix)||M.suffix!=null&&!M.suffix.test(O.suffix)?!1:M.handler.call(this,a,O,M)!==!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 i={};const[s]=this.quill.getLine(e.index);let a=new Ne().retain(e.index-n).delete(n);if(t.offset===0){const[u]=this.quill.getLine(e.index-1);if(u&&!(u.statics.blotName==="block"&&u.length()<=1)){const d=s.formats(),m=this.quill.getFormat(e.index-1,1);if(i=Xt.AttributeMap.diff(d,m)||{},Object.keys(i).length>0){const w=new Ne().retain(e.index+s.length()-2).retain(1,i);a=a.compose(w)}}}this.quill.updateContents(a,oe.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 i={};const[s]=this.quill.getLine(e.index);let a=new Ne().retain(e.index).delete(n);if(t.offset>=s.length()-1){const[u]=this.quill.getLine(e.index+1);if(u){const f=s.formats(),d=this.quill.getFormat(e.index,1);i=Xt.AttributeMap.diff(f,d)||{},Object.keys(i).length>0&&(a=a.retain(u.length()-1).retain(1,i))}}this.quill.updateContents(a,oe.sources.USER),this.quill.focus()}handleDeleteRange(e){Ta({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce((s,a)=>(this.quill.scroll.query(a,Le.BLOCK)&&!Array.isArray(t.format[a])&&(s[a]=t.format[a]),s),{}),i=new Ne().retain(e.index).delete(e.length).insert(`
44
- `,n);this.quill.updateContents(i,oe.sources.USER),this.quill.setSelection(e.index+1,oe.sources.SILENT),this.quill.focus()}}const zy={bindings:{bold:Aa("bold"),italic:Aa("italic"),underline:Aa("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",oe.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",oe.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",oe.sources.USER):e.format.list!=null&&this.quill.format("list",!1,oe.sources.USER)}},"indent code-block":fc(!0),"outdent code-block":fc(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,oe.sources.USER)}},tab:{key:"Tab",handler(r,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new Ne().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(t,oe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,oe.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,oe.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,oe.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"},i=new Ne().retain(r.index).insert(`
45
- `,n).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,oe.sources.USER),this.quill.setSelection(r.index+1,oe.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),i=new Ne().retain(r.index).insert(`
46
- `,e.format).retain(t.length()-n-1).retain(1,{header:null});this.quill.updateContents(i,oe.sources.USER),this.quill.setSelection(r.index+1,oe.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,i,s]=e.getTable(r),a=Wy(t,n,i,s);if(a==null)return;let u=t.offset();if(a<0){const f=new Ne().retain(u).insert(`
47
- `);this.quill.updateContents(f,oe.sources.USER),this.quill.setSelection(r.index+1,r.length,oe.sources.SILENT)}else if(a>0){u+=t.length();const f=new Ne().retain(u).insert(`
48
- `);this.quill.updateContents(f,oe.sources.USER),this.quill.setSelection(u,oe.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,e){const{event:t,line:n}=e,i=n.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(i-1,oe.sources.USER):this.quill.setSelection(i+n.length(),oe.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,i]=this.quill.getLine(r.index);if(i>t)return!0;let s;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(r.index," ",oe.sources.USER),this.quill.history.cutoff();const a=new Ne().retain(r.index-i).delete(t+1).retain(n.length()-2-i).retain(1,{list:s});return this.quill.updateContents(a,oe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-t,oe.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,i=e;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,n-=1,n<=0){const s=new Ne().retain(r.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(s,oe.sources.USER),this.quill.setSelection(r.index-1,oe.sources.SILENT),!1}return!0}},"embed left":eo("ArrowLeft",!1),"embed left shift":eo("ArrowLeft",!0),"embed right":eo("ArrowRight",!1),"embed right shift":eo("ArrowRight",!0),"table down":hc(!1),"table up":hc(!0)}};Qs.DEFAULTS=zy;function fc(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(e,t){let{event:n}=t;const i=this.quill.scroll.query("code-block"),{TAB:s}=i;if(e.length===0&&!n.shiftKey){this.quill.insertText(e.index,s,oe.sources.USER),this.quill.setSelection(e.index+s.length,oe.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:u,length:f}=e;a.forEach((d,m)=>{r?(d.insertAt(0,s),m===0?u+=s.length:f+=s.length):d.domNode.textContent.startsWith(s)&&(d.deleteAt(0,s.length),m===0?u-=s.length:f-=s.length)}),this.quill.update(oe.sources.USER),this.quill.setSelection(u,f,oe.sources.SILENT)}}}function eo(r,e){return{key:r,shiftKey:e,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:i}=n;r==="ArrowRight"&&(i+=n.length+1);const[s]=this.quill.getLeaf(i);return s instanceof Ut?(r==="ArrowLeft"?e?this.quill.setSelection(n.index-1,n.length+1,oe.sources.USER):this.quill.setSelection(n.index-1,oe.sources.USER):e?this.quill.setSelection(n.index,n.length+1,oe.sources.USER):this.quill.setSelection(n.index+n.length+1,oe.sources.USER),!1):!0}}}function Aa(r){return{key:r[0],shortKey:!0,handler(e,t){this.quill.format(r,!t.format[r],oe.sources.USER)}}}function hc(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const n=r?"prev":"next",i=t.line,s=i.parent[n];if(s!=null){if(s.statics.blotName==="table-row"){let a=s.children.head,u=i;for(;u.prev!=null;)u=u.prev,a=a.next;const f=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(f,0,oe.sources.USER)}}else{const a=i.table()[n];a!=null&&(r?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,oe.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,oe.sources.USER))}return!1}}}function Vy(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=yi(r);else return null;return r.shortKey&&(r[Hy]=r.shortKey,delete r.shortKey),r}function Ta(r){let{quill:e,range:t}=r;const n=e.getLines(t);let i={};if(n.length>1){const s=n[0].formats(),a=n[n.length-1].formats();i=Xt.AttributeMap.diff(a,s)||{}}e.deleteText(t,oe.sources.USER),Object.keys(i).length>0&&e.formatLine(t.index,1,i,oe.sources.USER),e.setSelection(t.index,oe.sources.SILENT)}function Wy(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 Gy=/font-weight:\s*normal/,Yy=["P","OL","UL"],dc=r=>r&&Yy.includes(r.tagName),Jy=r=>{Array.from(r.querySelectorAll("br")).filter(e=>dc(e.previousElementSibling)&&dc(e.nextElementSibling)).forEach(e=>{var t;(t=e.parentNode)==null||t.removeChild(e)})},Zy=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var t;return(t=e.getAttribute("style"))==null?void 0:t.match(Gy)}).forEach(e=>{var n;const t=r.createDocumentFragment();t.append(...e.childNodes),(n=e.parentNode)==null||n.replaceChild(t,e)})};function Xy(r){r.querySelector('[id^="docs-internal-guid-"]')&&(Zy(r),Jy(r))}const Qy=/\bmso-list:[^;]*ignore/i,eb=/\bmso-list:[^;]*\bl(\d+)/i,tb=/\bmso-list:[^;]*\blevel(\d+)/i,nb=(r,e)=>{const t=r.getAttribute("style"),n=t==null?void 0:t.match(eb);if(!n)return null;const i=Number(n[1]),s=t==null?void 0:t.match(tb),a=s?Number(s[1]):1,u=new RegExp(`@list l${i}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),f=e.match(u),d=f&&f[1]==="bullet"?"bullet":"ordered";return{id:i,indent:a,type:d,element:r}},rb=r=>{var a,u;const e=Array.from(r.querySelectorAll("[style*=mso-list]")),t=[],n=[];e.forEach(f=>{(f.getAttribute("style")||"").match(Qy)?t.push(f):n.push(f)}),t.forEach(f=>{var d;return(d=f.parentNode)==null?void 0:d.removeChild(f)});const i=r.documentElement.innerHTML,s=n.map(f=>nb(f,i)).filter(f=>f);for(;s.length;){const f=[];let d=s.shift();for(;d;)f.push(d),d=s.length&&((a=s[0])==null?void 0:a.element)===d.element.nextElementSibling&&s[0].id===d.id?s.shift():null;const m=document.createElement("ul");f.forEach(x=>{const S=document.createElement("li");S.setAttribute("data-list",x.type),x.indent>1&&S.setAttribute("class",`ql-indent-${x.indent-1}`),S.innerHTML=x.element.innerHTML,m.appendChild(S)});const w=(u=f[0])==null?void 0:u.element,{parentNode:y}=w??{};w&&(y==null||y.replaceChild(m,w)),f.slice(1).forEach(x=>{let{element:S}=x;y==null||y.removeChild(S)})}};function ib(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&rb(r)}const sb=[ib,Xy],ob=r=>{r.documentElement&&sb.forEach(e=>{e(r)})},ab=lr("quill:clipboard"),lb=[[Node.TEXT_NODE,wb],[Node.TEXT_NODE,yc],["br",db],[Node.ELEMENT_NODE,yc],[Node.ELEMENT_NODE,hb],[Node.ELEMENT_NODE,fb],[Node.ELEMENT_NODE,bb],["li",mb],["ol, ul",yb],["pre",pb],["tr",vb],["b",Na("bold")],["i",Na("italic")],["strike",Na("strike")],["style",gb]],ub=[My,rc].reduce((r,e)=>(r[e.keyName]=e,r),{}),pc=[tc,Ea,xa,sc,lc,cc].reduce((r,e)=>(r[e.keyName]=e,r),{});class gc extends xn{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=[],lb.concat(this.options.matchers??[]).forEach(n=>{let[i,s]=n;this.addMatcher(i,s)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i[Ot.blotName])return new Ne().insert(n||"",{[Ot.blotName]:i[Ot.blotName]});if(!t)return new Ne().insert(n||"",i);const s=this.convertHTML(t);return ls(s,`
49
- `)&&(s.ops[s.ops.length-1].attributes==null||i.table)?s.compose(new Ne().retain(s.length()-1).delete(1)):s}normalizeHTML(e){ob(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,i=new WeakMap,[s,a]=this.prepareMatching(n,i);return _a(this.quill.scroll,n,s,a,i)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oe.sources.API;if(typeof e=="string"){const i=this.convert({html:e,text:""});this.quill.setContents(i,t),this.quill.setSelection(0,oe.sources.SILENT)}else{const i=this.convert({html:t,text:""});this.quill.updateContents(new Ne().retain(e).concat(i),n),this.quill.setSelection(e+i.length(),oe.sources.SILENT)}}onCaptureCopy(e){var a,u;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:i,text:s}=this.onCopy(n,t);(a=e.clipboardData)==null||a.setData("text/plain",s),(u=e.clipboardData)==null||u.setData("text/html",i),t&&Ta({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
50
- `)}onCapturePaste(e){var a,u,f,d,m;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const n=(a=e.clipboardData)==null?void 0:a.getData("text/html");let i=(u=e.clipboardData)==null?void 0:u.getData("text/plain");if(!n&&!i){const w=(f=e.clipboardData)==null?void 0:f.getData("text/uri-list");w&&(i=this.normalizeURIList(w))}const s=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!n&&s.length>0){this.quill.uploader.upload(t,s);return}if(n&&s.length>0){const w=new DOMParser().parseFromString(n,"text/html");if(w.body.childElementCount===1&&((m=w.body.firstElementChild)==null?void 0:m.tagName)==="IMG"){this.quill.uploader.upload(t,s);return}}this.onPaste(t,{html:n,text:i})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:i}=t;const s=this.quill.getFormat(e.index),a=this.convert({text:n,html:i},s);ab.log("onPaste",a,{text:n,html:i});const u=new Ne().retain(e.index).delete(e.length).concat(a);this.quill.updateContents(u,oe.sources.USER),this.quill.setSelection(u.length()-e.length,oe.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],i=[];return this.matchers.forEach(s=>{const[a,u]=s;switch(a){case Node.TEXT_NODE:i.push(u);break;case Node.ELEMENT_NODE:n.push(u);break;default:Array.from(e.querySelectorAll(a)).forEach(f=>{if(t.has(f)){const d=t.get(f);d==null||d.push(u)}else t.set(f,[u])});break}}),[n,i]}}Oe(gc,"DEFAULTS",{matchers:[]});function Qr(r,e,t,n){return n.query(e)?r.reduce((i,s)=>{if(!s.insert)return i;if(s.attributes&&s.attributes[e])return i.push(s);const a=t?{[e]:t}:{};return i.insert(s.insert,{...a,...s.attributes})},new Ne):r}function ls(r,e){let t="";for(let n=r.ops.length-1;n>=0&&t.length<e.length;--n){const i=r.ops[n];if(typeof i.insert!="string")break;t=i.insert+t}return t.slice(-1*e.length)===e}function Nr(r,e){if(!(r instanceof Element))return!1;const t=e.query(r);return t&&t.prototype instanceof Ut?!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 cb(r,e){return r.previousElementSibling&&r.nextElementSibling&&!Nr(r.previousElementSibling,e)&&!Nr(r.nextElementSibling,e)}const to=new WeakMap;function mc(r){return r==null?!1:(to.has(r)||(r.tagName==="PRE"?to.set(r,!0):to.set(r,mc(r.parentNode))),to.get(r))}function _a(r,e,t,n,i){return e.nodeType===e.TEXT_NODE?n.reduce((s,a)=>a(e,s,r),new Ne):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((s,a)=>{let u=_a(r,a,t,n,i);return a.nodeType===e.ELEMENT_NODE&&(u=t.reduce((f,d)=>d(a,f,r),u),u=(i.get(a)||[]).reduce((f,d)=>d(a,f,r),u)),s.concat(u)},new Ne):new Ne}function Na(r){return(e,t,n)=>Qr(t,r,!0,n)}function fb(r,e,t){const n=Mn.keys(r),i=yn.keys(r),s=_r.keys(r),a={};return n.concat(i).concat(s).forEach(u=>{let f=t.query(u,Le.ATTRIBUTE);f!=null&&(a[f.attrName]=f.value(r),a[f.attrName])||(f=ub[u],f!=null&&(f.attrName===u||f.keyName===u)&&(a[f.attrName]=f.value(r)||void 0),f=pc[u],f!=null&&(f.attrName===u||f.keyName===u)&&(f=pc[u],a[f.attrName]=f.value(r)||void 0))}),Object.entries(a).reduce((u,f)=>{let[d,m]=f;return Qr(u,d,m,t)},e)}function hb(r,e,t){const n=t.query(r);if(n==null)return e;if(n.prototype instanceof Ut){const i={},s=n.value(r);if(s!=null)return i[n.blotName]=s,new Ne().insert(i,n.formats(r,t))}else if(n.prototype instanceof is&&!ls(e,`
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,`
51
51
  `)&&e.insert(`
52
- `),"blotName"in n&&"formats"in n&&typeof n.formats=="function")return Qr(e,n.blotName,n.formats(r,t),t);return e}function db(r,e){return ls(e,`
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,`
53
53
  `)||e.insert(`
54
- `),e}function pb(r,e,t){const n=t.query("code-block"),i=n&&"formats"in n&&typeof n.formats=="function"?n.formats(r,t):!0;return Qr(e,"code-block",i,t)}function gb(){return new Ne}function mb(r,e,t){const n=t.query(r);if(n==null||n.blotName!=="list"||!ls(e,`
55
- `))return e;let i=-1,s=r.parentNode;for(;s!=null;)["OL","UL"].includes(s.tagName)&&(i+=1),s=s.parentNode;return i<=0?e:e.reduce((a,u)=>u.insert?u.attributes&&typeof u.attributes.indent=="number"?a.push(u):a.insert(u.insert,{indent:i,...u.attributes||{}}):a,new Ne)}function yb(r,e,t){const n=r;let i=n.tagName==="OL"?"ordered":"bullet";const s=n.getAttribute("data-checked");return s&&(i=s==="true"?"checked":"unchecked"),Qr(e,"list",i,t)}function yc(r,e,t){if(!ls(e,`
56
- `)){if(Nr(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(Nr(n,t))return e.insert(`
58
- `);const i=t.query(n);if(i&&i.prototype instanceof Qt)return e.insert(`
59
- `);n=n.firstChild}}}return e}function bb(r,e,t){var s;const n={},i=r.style||{};return i.fontStyle==="italic"&&(n.italic=!0),i.textDecoration==="underline"&&(n.underline=!0),i.textDecoration==="line-through"&&(n.strike=!0),((s=i.fontWeight)!=null&&s.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(n.bold=!0),e=Object.entries(n).reduce((a,u)=>{let[f,d]=u;return Qr(a,f,d,t)},e),parseFloat(i.textIndent||0)>0?new Ne().insert(" ").concat(e):e}function vb(r,e,t){var i,s;const n=((i=r.parentElement)==null?void 0:i.tagName)==="TABLE"?r.parentElement:(s=r.parentElement)==null?void 0:s.parentElement;if(n!=null){const u=Array.from(n.querySelectorAll("tr")).indexOf(r)+1;return Qr(e,"table",u,t)}return e}function wb(r,e,t){var i;let n=r.data;if(((i=r.parentElement)==null?void 0:i.tagName)==="O:P")return e.insert(n.trim());if(!mc(r)){if(n.trim().length===0&&n.includes(`
60
- `)&&!cb(r,t))return e;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(r.previousSibling==null&&r.parentElement!=null&&Nr(r.parentElement,t)||r.previousSibling instanceof Element&&Nr(r.previousSibling,t))&&(n=n.replace(/^ /,"")),(r.nextSibling==null&&r.parentElement!=null&&Nr(r.parentElement,t)||r.nextSibling instanceof Element&&Nr(r.nextSibling,t))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return e.insert(n)}class bc extends xn{constructor(t,n){super(t,n);Oe(this,"lastRecorded",0);Oe(this,"ignoreChange",!1);Oe(this,"stack",{undo:[],redo:[]});Oe(this,"currentRange",null);this.quill.on(oe.events.EDITOR_CHANGE,(i,s,a,u)=>{i===oe.events.SELECTION_CHANGE?s&&u!==oe.sources.SILENT&&(this.currentRange=s):i===oe.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||u===oe.sources.USER?this.record(s,a):this.transform(s)),this.currentRange=Ca(this.currentRange,s))}),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",i=>{i.inputType==="historyUndo"?(this.undo(),i.preventDefault()):i.inputType==="historyRedo"&&(this.redo(),i.preventDefault())})}change(t,n){if(this.stack[t].length===0)return;const i=this.stack[t].pop();if(!i)return;const s=this.quill.getContents(),a=i.delta.invert(s);this.stack[n].push({delta:a,range:Ca(i.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i.delta,oe.sources.USER),this.ignoreChange=!1,this.restoreSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,n){if(t.ops.length===0)return;this.stack.redo=[];let i=t.invert(n),s=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const u=this.stack.undo.pop();u&&(i=i.compose(u.delta),s=u.range)}else this.lastRecorded=a;i.length()!==0&&(this.stack.undo.push({delta:i,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){vc(this.stack.undo,t),vc(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,oe.sources.USER);else{const n=Eb(this.quill.scroll,t.delta);this.quill.setSelection(n,oe.sources.USER)}}}Oe(bc,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function vc(r,e){let t=e;for(let n=r.length-1;n>=0;n-=1){const i=r[n];r[n]={delta:t.transform(i.delta,!0),range:i.range&&Ca(i.range,t)},t=i.delta.transform(t),r[n].delta.length()===0&&r.splice(n,1)}}function xb(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,Le.BLOCK)!=null):!1}function Eb(r,e){const t=e.reduce((i,s)=>i+(s.delete||0),0);let n=e.length()-t;return xb(r,e)&&(n-=1),n}function Ca(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 wc extends xn{constructor(e,t){super(e,t),e.root.addEventListener("drop",n=>{var a;n.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const u=document.caretPositionFromPoint(n.clientX,n.clientY);i=document.createRange(),i.setStart(u.offsetNode,u.offset),i.setEnd(u.offsetNode,u.offset)}const s=i&&e.selection.normalizeNative(i);if(s){const u=e.selection.normalizedToRange(s);(a=n.dataTransfer)!=null&&a.files&&this.upload(u,n.dataTransfer.files)}})}upload(e,t){const n=[];Array.from(t).forEach(i=>{var s;i&&((s=this.options.mimetypes)!=null&&s.includes(i.type))&&n.push(i)}),n.length>0&&this.options.handler.call(this,e,n)}}wc.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,e){if(!this.quill.scroll.query("image"))return;const t=e.map(n=>new Promise(i=>{const s=new FileReader;s.onload=()=>{i(s.result)},s.readAsDataURL(n)}));Promise.all(t).then(n=>{const i=n.reduce((s,a)=>s.insert({image:a}),new Ne().retain(r.index).delete(r.length));this.quill.updateContents(i,Te.sources.USER),this.quill.setSelection(r.index+n.length,Te.sources.SILENT)})}};const Ob=["insertText","insertReplacementText"];class Sb extends xn{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||e.on(oe.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Ta({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 Ne().retain(e.index).insert(t,n),oe.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,oe.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Ob.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const n=Ab(e);if(n==null)return;const i=this.quill.selection.normalizeNative(t),s=i?this.quill.selection.normalizedToRange(i):null;s&&this.replaceText(s,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function Ab(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 Tb=/Mac/i.test(navigator.platform),_b=100,Nb=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||Tb&&r.key==="a"&&r.ctrlKey===!0);class Cb extends xn{constructor(t,n){super(t,n);Oe(this,"isListening",!1);Oe(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,n){let{line:i,event:s}=n;if(!(i instanceof bn)||!i.uiNode)return!0;const a=getComputedStyle(i.domNode).direction==="rtl";return a&&s.key!=="ArrowRight"||!a&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(s.shiftKey?1:0),oe.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&Nb(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+_b,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 i=this.quill.scroll.find(n.startContainer);if(!(i instanceof bn)||!i.uiNode)return;const s=document.createRange();s.setStartAfter(i.uiNode),s.setEndAfter(i.uiNode),t.removeAllRanges(),t.addRange(s)}}oe.register({"blots/block":wt,"blots/block/embed":Qt,"blots/break":vn,"blots/container":Zr,"blots/cursor":Oi,"blots/embed":ya,"blots/inline":Bn,"blots/scroll":_i,"blots/text":wn,"modules/clipboard":gc,"modules/history":bc,"modules/keyboard":Qs,"modules/uploader":wc,"modules/input":Sb,"modules/uiNode":Cb});class Lb extends yn{add(e,t){let n=0;if(t==="+1"||t==="-1"){const i=this.value(e)||0;n=t==="+1"?i+1:i-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 kb=new Lb("indent","ql-indent",{scope:Le.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class La extends wt{}Oe(La,"blotName","blockquote"),Oe(La,"tagName","blockquote");class ka extends wt{static formats(e){return this.tagName.indexOf(e.tagName)+1}}Oe(ka,"blotName","header"),Oe(ka,"tagName",["H1","H2","H3","H4","H5","H6"]);class us extends Zr{}us.blotName="list-container",us.tagName="OL";class cs extends wt{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(){oe.register(us)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),i=s=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),s.preventDefault()):a==="unchecked"&&(this.format("list","checked"),s.preventDefault())};n.addEventListener("mousedown",i),n.addEventListener("touchstart",i),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}cs.blotName="list",cs.tagName="LI",us.allowedChildren=[cs],cs.requiredContainer=us;class fs extends Bn{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)}}Oe(fs,"blotName","bold"),Oe(fs,"tagName",["STRONG","B"]);class Ra extends fs{}Oe(Ra,"blotName","italic"),Oe(Ra,"tagName",["EM","I"]);class Cr extends Bn{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 xc(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))}}Oe(Cr,"blotName","link"),Oe(Cr,"tagName","A"),Oe(Cr,"SANITIZED_URL","about:blank"),Oe(Cr,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function xc(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 Pa extends Bn{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"}}Oe(Pa,"blotName","script"),Oe(Pa,"tagName",["SUB","SUP"]);class qa extends fs{}Oe(qa,"blotName","strike"),Oe(qa,"tagName",["S","STRIKE"]);class Ia extends Bn{}Oe(Ia,"blotName","underline"),Oe(Ia,"tagName","U");class no extends ya{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>`}}Oe(no,"blotName","formula"),Oe(no,"className","ql-formula"),Oe(no,"tagName","SPAN");const Ec=["alt","height","width"];class ja extends Ut{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Ec.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 xc(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Ec.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}Oe(ja,"blotName","image"),Oe(ja,"tagName","IMG");const Oc=["height","width"];class ro extends Qt{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 Oc.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return Cr.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Oc.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>`}}Oe(ro,"blotName","video"),Oe(ro,"className","ql-video"),Oe(ro,"tagName","IFRAME");const hs=new yn("code-token","hljs",{scope:Le.INLINE});class cr extends Bn{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Ot.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),hs.add(this.domNode,n)}format(e,t){e!==cr.blotName?super.format(e,t):t?hs.add(this.domNode,t):(hs.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),hs.value(this.domNode)||this.unwrap()}}cr.blotName="code-token",cr.className="ql-token";class tn extends Ot{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(),cr.blotName,!1),super.replaceWith(e,t)}}class ds extends Xr{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===tn.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,i){n===tn.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,i)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(a=>a!==this.uiNode).map(a=>a.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(`
62
62
  `)}
63
- `,s=tn.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==i){if(i.trim().length>0||this.cachedText==null){const a=this.children.reduce((f,d)=>f.concat(Ku(d,!1)),new Ne),u=e(i,s);a.diff(u).reduce((f,d)=>{let{retain:m,attributes:w}=d;return m?(w&&Object.keys(w).forEach(y=>{[tn.blotName,cr.blotName].includes(y)&&this.formatAt(f,m,y,w[y])}),f+m):f},0)}this.cachedText=i,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`<pre data-language="${n?tn.formats(n.domNode):"plain"}">
64
- ${Ys(this.code(e,t))}
65
- </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=tn.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}ds.allowedChildren=[tn],tn.requiredContainer=ds,tn.allowedChildren=[cr,Oi,wn,vn];const Rb=(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 Sc extends xn{static register(){oe.register(cr,!0),oe.register(tn,!0),oe.register(ds,!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,i)=>{let{key:s}=i;return n[s]=!0,n},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(oe.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof ds))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(n=>{let{key:i,label:s}=n;const a=t.ownerDocument.createElement("option");a.textContent=s,a.setAttribute("value",i),t.appendChild(a)}),t.addEventListener("change",()=>{e.format(tn.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=tn.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(oe.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(oe.sources.USER);const n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(ds):[e]).forEach(s=>{s.highlight(this.highlightBlot,t)}),this.quill.update(oe.sources.SILENT),n!=null&&this.quill.setSelection(n,oe.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 Ys(e).split(`
66
- `).reduce((i,s,a)=>(a!==0&&i.insert(`
67
- `,{[Ot.blotName]:t}),i.insert(s)),new Ne);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Ot.className),n.innerHTML=Rb(this.options.hljs,t,e),_a(this.quill.scroll,n,[(i,s)=>{const a=hs.value(i);return a?s.compose(new Ne().retain(s.length(),{[cr.blotName]:a})):s}],[(i,s)=>i.data.split(`
68
- `).reduce((a,u,f)=>(f!==0&&a.insert(`
69
- `,{[Ot.blotName]:t}),a.insert(u)),s)],new WeakMap)}}Sc.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 _s=class _s extends wt{static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",$a()),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===_s.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()}};Oe(_s,"blotName","table"),Oe(_s,"tagName","TD");let On=_s;class fr extends Zr{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(),i=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===i.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const n=t.formats(),i=t.next.formats();if(n.table!==i.table){const s=this.splitAfter(t);s&&s.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}Oe(fr,"blotName","table-row"),Oe(fr,"tagName","TR");class Un extends Zr{}Oe(Un,"blotName","table-body"),Oe(Un,"tagName","TBODY");class Ni extends Zr{balanceCells(){const e=this.descendants(fr),t=e.reduce((n,i)=>Math.max(i.children.length,n),0);e.forEach(n=>{new Array(t-n.children.length).fill(0).forEach(()=>{let i;n.children.head!=null&&(i=On.formats(n.children.head.domNode));const s=this.scroll.create(On.blotName,i);n.appendChild(s),s.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(Un);t==null||t.children.head==null||t.children.forEach(n=>{const i=n.children.at(e);i!=null&&i.remove()})}insertColumn(e){const[t]=this.descendant(Un);t==null||t.children.head==null||t.children.forEach(n=>{const i=n.children.at(e),s=On.formats(n.children.head.domNode),a=this.scroll.create(On.blotName,s);n.insertBefore(a,i)})}insertRow(e){const[t]=this.descendant(Un);if(t==null||t.children.head==null)return;const n=$a(),i=this.scroll.create(fr.blotName);t.children.head.children.forEach(()=>{const a=this.scroll.create(On.blotName,n);i.appendChild(a)});const s=t.children.at(e);t.insertBefore(i,s)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}Oe(Ni,"blotName","table-container"),Oe(Ni,"tagName","TABLE"),Ni.allowedChildren=[Un],Un.requiredContainer=Ni,Un.allowedChildren=[fr],fr.requiredContainer=Un,fr.allowedChildren=[On],On.requiredContainer=fr;function $a(){return`row-${Math.random().toString(36).slice(2,6)}`}let Pb=class extends xn{static register(){oe.register(On),oe.register(fr),oe.register(Un),oe.register(Ni)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ni).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(oe.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(oe.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(oe.sources.USER),this.quill.setSelection(t,oe.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!==On.blotName)return[null,null,null,-1];const i=t.parent;return[i.parent.parent,i,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,i,s]=this.getTable(t);if(s==null)return;const a=s.cellOffset();n.insertColumn(a+e),this.quill.update(oe.sources.USER);let u=i.rowOffset();e===0&&(u+=1),this.quill.setSelection(t.index+u,t.length,oe.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,i,s]=this.getTable(t);if(s==null)return;const a=i.rowOffset();n.insertRow(a+e),this.quill.update(oe.sources.USER),e>0?this.quill.setSelection(t,oe.sources.SILENT):this.quill.setSelection(t.index+i.children.length,t.length,oe.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(n==null)return;const i=new Array(e).fill(0).reduce(s=>{const a=new Array(t).fill(`
70
- `).join("");return s.insert(a,{table:$a()})},new Ne().retain(n.index));this.quill.updateContents(i,oe.sources.USER),this.quill.setSelection(n.index,oe.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(oe.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(oe.events.TEXT_CHANGE,(n,i,s)=>{s===oe.sources.USER&&this.balanceTables()}),!0):!1)})}};const Ac=lr("quill:toolbar");class Da extends xn{constructor(e,t){var n,i;if(super(e,t),Array.isArray(this.options.container)){const s=document.createElement("div");s.setAttribute("role","toolbar"),qb(s,this.options.container),(i=(n=e.container)==null?void 0:n.parentNode)==null||i.insertBefore(s,e.container),this.container=s}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Ac.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(s=>{var u;const a=(u=this.options.handlers)==null?void 0:u[s];a&&this.addHandler(s,a)}),Array.from(this.container.querySelectorAll("button, select")).forEach(s=>{this.attach(s)}),this.quill.on(oe.events.EDITOR_CHANGE,()=>{const[s]=this.quill.selection.getRange();this.update(s)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(i=>i.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){Ac.warn("ignoring attaching to nonexistent format",t,e);return}const n=e.tagName==="SELECT"?"change":"click";e.addEventListener(n,i=>{let s;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const u=e.options[e.selectedIndex];u.hasAttribute("selected")?s=!1:s=u.value||!1}else e.classList.contains("ql-active")?s=!1:s=e.value||!e.hasAttribute("value"),i.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,s);else if(this.quill.scroll.query(t).prototype instanceof Ut){if(s=prompt(`Enter ${t}`),!s)return;this.quill.updateContents(new Ne().retain(a.index).delete(a.length).insert({[t]:s}),oe.sources.USER)}else this.quill.format(t,s,oe.sources.USER);this.update(a)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{const[i,s]=n;if(s.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[i]==null)a=s.querySelector("option[selected]");else if(!Array.isArray(t[i])){let u=t[i];typeof u=="string"&&(u=u.replace(/"/g,'\\"')),a=s.querySelector(`option[value="${u}"]`)}a==null?(s.value="",s.selectedIndex=-1):a.selected=!0}else if(e==null)s.classList.remove("ql-active"),s.setAttribute("aria-pressed","false");else if(s.hasAttribute("value")){const a=t[i],u=a===s.getAttribute("value")||a!=null&&a.toString()===s.getAttribute("value")||a==null&&!s.getAttribute("value");s.classList.toggle("ql-active",u),s.setAttribute("aria-pressed",u.toString())}else{const a=t[i]!=null;s.classList.toggle("ql-active",a),s.setAttribute("aria-pressed",a.toString())}})}}Da.DEFAULTS={};function Tc(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 qb(r,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(i=>{if(typeof i=="string")Tc(n,i);else{const s=Object.keys(i)[0],a=i[s];Array.isArray(a)?Ib(n,s,a):Tc(n,s,a)}}),r.appendChild(n)})}function Ib(r,e,t){const n=document.createElement("select");n.classList.add(`ql-${e}`),t.forEach(i=>{const s=document.createElement("option");i!==!1?s.setAttribute("value",String(i)):s.setAttribute("selected","selected"),n.appendChild(s)}),r.appendChild(n)}Da.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,Le.INLINE)!=null&&this.quill.format(t,!1,oe.sources.USER)})}else this.quill.removeFormat(r.index,r.length,oe.sources.USER)},direction(r){const{align:e}=this.quill.getFormat();r==="rtl"&&e==null?this.quill.format("align","right",oe.sources.USER):!r&&e==="right"&&this.quill.format("align",!1,oe.sources.USER),this.quill.format("direction",r,oe.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 i=r==="+1"?1:-1;t.direction==="rtl"&&(i*=-1),this.quill.format("indent",n+i,oe.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,oe.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,oe.sources.USER):this.quill.format("list","unchecked",oe.sources.USER):this.quill.format("list",r,oe.sources.USER)}}};const jb='<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>',$b='<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>',Db='<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>',Mb='<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>',Bb='<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>',Ub='<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>',Fb='<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>',Kb='<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>',_c='<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>',ps={align:{"":jb,center:$b,right:Db,justify:Mb},background:Bb,blockquote:Ub,bold:Fb,clean:Kb,code:_c,"code-block":_c,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>'},Hb='<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 Nc=0;function Cc(r,e){r.setAttribute(e,`${r.getAttribute(e)!=="true"}`)}class io{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"),Cc(this.label,"aria-expanded"),Cc(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",i=>{switch(i.key){case"Enter":this.selectItem(t,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Hb,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-${Nc}`,Nc+=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 Lc extends io{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"),i=e&&e.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=i:n.style.fill=i)}}class kc extends io{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 zb=r=>{const{overflowY:e}=getComputedStyle(r,null);return e!=="visible"&&e!=="clip"};class Rc{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,zb(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 i=this.boundsContainer.getBoundingClientRect(),s=this.root.getBoundingClientRect();let a=0;if(s.right>i.right&&(a=i.right-s.right,this.root.style.left=`${t+a}px`),s.left<i.left&&(a=i.left-s.left,this.root.style.left=`${t+a}px`),s.bottom>i.bottom){const u=s.bottom-s.top,f=e.bottom-e.top+u;this.root.style.top=`${n-f}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Vb=[!1,"center","right","justify"],Wb=["#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"],Gb=[!1,"serif","monospace"],Yb=["1","2","3",!1],Jb=["small",!1,"large","huge"];class gs extends Ai{constructor(e,t){super(e,t);const n=i=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",n);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(s=>{s.container.contains(i.target)||s.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(s=>{if(s.startsWith("ql-")&&(s=s.slice(3),t[s]!=null))if(s==="direction")n.innerHTML=t[s][""]+t[s].rtl;else if(typeof t[s]=="string")n.innerHTML=t[s];else{const a=n.value||"";a!=null&&t[s][a]&&(n.innerHTML=t[s][a])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&ms(i,Vb),typeof t.align=="object"))return new kc(i,t.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const s=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&ms(i,Wb,s==="background"?"#ffffff":"#000000"),new Lc(i,t[s])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?ms(i,Gb):i.classList.contains("ql-header")?ms(i,Yb):i.classList.contains("ql-size")&&ms(i,Jb)),new io(i)});const n=()=>{this.pickers.forEach(i=>{i.update()})};this.quill.on(Te.events.EDITOR_CHANGE,n)}}gs.DEFAULTS=Tr({},Ai.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 Pc extends Rc{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,Te.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Te.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=Zb(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,Te.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",Te.sources.USER),this.quill.setSelection(n+2,Te.sources.USER)}break}}this.textbox.value="",this.hide()}}function Zb(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 ms(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(n=>{const i=document.createElement("option");n===t?i.setAttribute("selected","selected"):i.setAttribute("value",String(n)),r.appendChild(i)})}const Xb=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class qc extends Pc{constructor(e,t){super(e,t),this.quill.on(Te.events.EDITOR_CHANGE,(n,i,s,a)=>{if(n===Te.events.SELECTION_CHANGE)if(i!=null&&i.length>0&&a===Te.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const u=this.quill.getLines(i.index,i.length);if(u.length===1){const f=this.quill.getBounds(i);f!=null&&this.position(f)}else{const f=u[u.length-1],d=this.quill.getIndex(f),m=Math.min(f.length()-1,i.index+i.length-d),w=this.quill.getBounds(new Jr(d,m));w!=null&&this.position(w)}}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(Te.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}}Oe(qc,"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 Ic extends gs{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Xb),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new qc(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),ps),this.buildPickers(e.container.querySelectorAll("select"),ps))}}Ic.DEFAULTS=Tr({},gs.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,oe.sources.USER)}}}}});const Qb=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class jc extends Pc{constructor(){super(...arguments);Oe(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,Te.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(Te.events.SELECTION_CHANGE,(t,n,i)=>{if(t!=null){if(t.length===0&&i===Te.sources.USER){const[s,a]=this.quill.scroll.descendant(Cr,t.index);if(s!=null){this.linkRange=new Jr(t.index-a,s.length());const u=Cr.formats(s.domNode);this.preview.textContent=u,this.preview.setAttribute("href",u),this.show();const f=this.quill.getBounds(this.linkRange);f!=null&&this.position(f);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}Oe(jc,"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 $c extends gs{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Qb),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"),ps),this.buildPickers(e.container.querySelectorAll("select"),ps),this.tooltip=new jc(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)}))}}$c.DEFAULTS=Tr({},gs.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,oe.sources.USER)}}}}}),oe.register({"attributors/attribute/direction":rc,"attributors/class/align":ec,"attributors/class/background":Uy,"attributors/class/color":By,"attributors/class/direction":ic,"attributors/class/font":ac,"attributors/class/size":uc,"attributors/style/align":tc,"attributors/style/background":Ea,"attributors/style/color":xa,"attributors/style/direction":sc,"attributors/style/font":lc,"attributors/style/size":cc},!0),oe.register({"formats/align":ec,"formats/direction":ic,"formats/indent":kb,"formats/background":Ea,"formats/color":xa,"formats/font":ac,"formats/size":uc,"formats/blockquote":La,"formats/code-block":Ot,"formats/header":ka,"formats/list":cs,"formats/bold":fs,"formats/code":Oa,"formats/italic":Ra,"formats/link":Cr,"formats/script":Pa,"formats/strike":qa,"formats/underline":Ia,"formats/formula":no,"formats/image":ja,"formats/video":ro,"modules/syntax":Sc,"modules/table":Pb,"modules/toolbar":Da,"themes/bubble":Ic,"themes/snow":$c,"ui/icons":ps,"ui/picker":io,"ui/icon-picker":kc,"ui/color-picker":Lc,"ui/tooltip":Rc},!0);function Dc(r){const{value:e,style:t,...n}=r,i=st.useRef(null);return st.useEffect(()=>{const s=i.current,a=s.ownerDocument.createElement("div");Object.entries(t).forEach(([d,m])=>{a.style[d]=m});const u=s.appendChild(a),f=new oe(u,{theme:"snow",...n});return e&&(f.root.innerHTML=e),f.on("text-change",()=>{var d;(d=n.onChange)==null||d.call(n,f.root.innerHTML||"")}),()=>{s.innerHTML=""}},[i]),rt.jsx("div",{ref:i,style:{height:"100%"}})}var Mc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Bc=st.createContext&&st.createContext(Mc),e1=["attr","size","title"];function t1(r,e){if(r==null)return{};var t=n1(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function n1(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 so(){return so=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},so.apply(this,arguments)}function Uc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function oo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Uc(Object(t),!0).forEach(function(n){r1(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Uc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function r1(r,e,t){return e=i1(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function i1(r){var e=s1(r,"string");return typeof e=="symbol"?e:e+""}function s1(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 Fc(r){return r&&r.map((e,t)=>st.createElement(e.tag,oo({key:t},e.attr),Fc(e.child)))}function o1(r){return e=>st.createElement(a1,so({attr:oo({},r.attr)},e),Fc(r.child))}function a1(r){var e=t=>{var{attr:n,size:i,title:s}=r,a=t1(r,e1),u=i||t.size||"1em",f;return t.className&&(f=t.className),r.className&&(f=(f?f+" ":"")+r.className),st.createElement("svg",so({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,a,{className:f,style:oo(oo({color:r.color||t.color},t.style),r.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),s&&st.createElement("title",null,s),r.children)};return Bc!==void 0?st.createElement(Bc.Consumer,null,t=>e(t)):e(Mc)}function Kc(r){return o1({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 l1=r=>Array.isArray(r)?r:r&&r.fileList;function Hc(r){var u;const{value:e,...t}=r,n=l1(e),i=Array.isArray(n)?n.length:0,s=t.maxCount??1;let a;return i<s&&((u=t.listType)!=null&&u.startsWith("picture-")?a=rt.jsx(Kc,{}):a=rt.jsx(Bt.Button,{icon:rt.jsx(Kc,{}),children:" 上传"})),rt.jsx(Bt.Upload,{maxCount:1,multiple:!0,showUploadList:!0,...t,fileList:n,onChange:f=>{var d;return(d=t.onChange)==null?void 0:d.call(t,f.fileList)},children:i<s&&a})}const u1={upload:{renderFormItem:(r,e)=>rt.jsx(Hc,{...e.fieldProps})},editor:{renderFormItem:(r,e)=>rt.jsx(Dc,{...e.fieldProps})}};function Ma({children:r}){return rt.jsx(Or.ProConfigProvider,{valueTypeMap:u1,children:r})}const c1=()=>Bt.Form.useForm().pop(),zc=r=>rt.jsx(Ma,{children:rt.jsx(Or.BetaSchemaForm,{layout:"horizontal",colon:!1,labelCol:{span:3},wrapperCol:{span:6},scrollToFirstError:!0,submitter:{render:(e,t)=>rt.jsx(Bt.Form.Item,{wrapperCol:{offset:4,span:8},children:rt.jsx(Bt.Space,{children:t})})},...r})});zc.useForm=c1;function f1(r){const{items:e,...t}={...r},n=$o.useNavigate(),s=$o.useLocation().pathname.split("/").filter(Boolean).pop(),a=e==null?void 0:e.find(f=>(f==null?void 0:f.key)==s),u=[(a==null?void 0:a.key)??""];return rt.jsxs(Bt.Layout,{style:{height:"100vh"},children:[rt.jsxs(Bt.Layout.Sider,{children:[rt.jsx(Bt.Typography.Title,{style:{color:"white",textAlign:"center"},children:"Rainte"}),rt.jsx(Bt.Menu,{mode:"inline",theme:"dark",items:e,defaultSelectedKeys:u,onClick:f=>n(f.key),...t})]}),rt.jsx(Bt.Layout,{style:{overflow:"auto"},children:rt.jsx(Bt.Layout.Content,{style:{minHeight:"fit-content",padding:"1rem"},children:rt.jsx(Bt.Layout.Content,{style:{height:"100%",padding:"1rem",backgroundColor:"white"},children:rt.jsx($o.Outlet,{})})})})]})}function h1(r){return rt.jsx(Ma,{children:rt.jsx(Or.ProTable,{rowKey:"id",pagination:{pageSize:10},tableAlertRender:({selectedRowKeys:e})=>rt.jsxs(Bt.Space,{children:["已选 ",e.length," 项"]}),...r})})}const je=r=>typeof r=="string",ys=()=>{let r,e;const t=new Promise((n,i)=>{r=n,e=i});return t.resolve=r,t.reject=e,t},Vc=r=>r==null?"":""+r,d1=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},p1=/###/g,Wc=r=>r&&r.indexOf("###")>-1?r.replace(p1,"."):r,Gc=r=>!r||je(r),bs=(r,e,t)=>{const n=je(e)?e.split("."):e;let i=0;for(;i<n.length-1;){if(Gc(r))return{};const s=Wc(n[i]);!r[s]&&t&&(r[s]=new t),Object.prototype.hasOwnProperty.call(r,s)?r=r[s]:r={},++i}return Gc(r)?{}:{obj:r,k:Wc(n[i])}},Yc=(r,e,t)=>{const{obj:n,k:i}=bs(r,e,Object);if(n!==void 0||e.length===1){n[i]=t;return}let s=e[e.length-1],a=e.slice(0,e.length-1),u=bs(r,a,Object);for(;u.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),u=bs(r,a,Object),u!=null&&u.obj&&typeof u.obj[`${u.k}.${s}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=t},g1=(r,e,t,n)=>{const{obj:i,k:s}=bs(r,e,Object);i[s]=i[s]||[],i[s].push(t)},ao=(r,e)=>{const{obj:t,k:n}=bs(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},m1=(r,e,t)=>{const n=ao(r,t);return n!==void 0?n:ao(e,t)},Jc=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?je(r[n])||r[n]instanceof String||je(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Jc(r[n],e[n],t):r[n]=e[n]);return r},Ci=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var y1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const b1=r=>je(r)?r.replace(/[&<>"'\/]/g,e=>y1[e]):r;class v1{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 w1=[" ",",","?","!",";"],x1=new v1(20),E1=(r,e,t)=>{e=e||"",t=t||"";const n=w1.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(n.length===0)return!0;const i=x1.getRegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!i.test(r);if(!s){const a=r.indexOf(t);a>0&&!i.test(r.substring(0,a))&&(s=!0)}return s},Ba=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 i=r;for(let s=0;s<n.length;){if(!i||typeof i!="object")return;let a,u="";for(let f=s;f<n.length;++f)if(f!==s&&(u+=t),u+=n[f],a=i[u],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&f<n.length-1)continue;s+=f-s+1;break}i=a}return i},lo=r=>r==null?void 0:r.replace("_","-"),O1={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 uo{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||O1,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,i){return i&&!this.debug?null:(je(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new uo(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new uo(this.logger,e)}}var Fn=new uo;class co{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(t)||0;this.observers[n].set(t,i+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),i=1;i<t;i++)n[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[u,f]=a;for(let d=0;d<f;d++)u(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[u,f]=a;for(let d=0;d<f;d++)u.apply(u,[e,...n])})}}class Zc extends co{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 d,m;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.indexOf(".")>-1?u=e.split("."):(u=[e,t],n&&(Array.isArray(n)?u.push(...n):je(n)&&s?u.push(...n.split(s)):u.push(n)));const f=ao(this.data,u);return!f&&!t&&!n&&e.indexOf(".")>-1&&(e=u[0],t=u[1],n=u.slice(2).join(".")),f||!a||!je(n)?f:Ba((m=(d=this.data)==null?void 0:d[e])==null?void 0:m[t],n,s)}addResource(e,t,n,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=[e,t];n&&(u=u.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(u=e.split("."),i=t,t=u[1]),this.addNamespaces(t),Yc(this.data,u,i),s.silent||this.emit("added",e,t,n,i)}addResources(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in n)(je(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});i.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,i,s){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[e,t];e.indexOf(".")>-1&&(u=e.split("."),i=n,n=t,t=u[1]),this.addNamespaces(t);let f=ao(this.data,u)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?Jc(f,n,s):f={...f,...n},Yc(this.data,u,f),a.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(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var Xc={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,i){return r.forEach(s=>{var a;e=((a=this.processors[s])==null?void 0:a.process(e,t,n,i))??e}),e}};const Qc={},ef=r=>!je(r)&&typeof r!="boolean"&&typeof r!="number";class fo extends co{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),d1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Fn.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 i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let s=t.ns||this.options.defaultNS||[];const a=n&&e.indexOf(n)>-1,u=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!E1(e,n,i);if(a&&!u){const f=e.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:e,namespaces:je(s)?[s]:s};const d=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(d[0])>-1)&&(s=d.shift()),e=d.join(i)}return{key:e,namespaces:je(s)?[s]:s}}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 i=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(e[e.length-1],t),f=u[u.length-1],d=t.lng||this.language,m=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode"){if(m){const A=t.nsSeparator||this.options.nsSeparator;return i?{res:`${f}${A}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:f,usedParams:this.getUsedParamsDetails(t)}:`${f}${A}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:f,usedParams:this.getUsedParamsDetails(t)}:a}const w=this.resolve(e,t);let y=w==null?void 0:w.res;const x=(w==null?void 0:w.usedKey)||a,S=(w==null?void 0:w.exactUsedKey)||a,O=["[object Number]","[object Function]","[object RegExp]"],N=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,J=t.count!==void 0&&!je(t.count),Q=fo.hasDefaultValue(t),de=J?this.pluralResolver.getSuffix(d,t.count,t):"",ue=t.ordinal&&J?this.pluralResolver.getSuffix(d,t.count,{ordinal:!1}):"",ce=J&&!t.ordinal&&t.count===0,ne=ce&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${de}`]||t[`defaultValue${ue}`]||t.defaultValue;let re=y;M&&!y&&Q&&(re=ne);const we=ef(re),Ee=Object.prototype.toString.apply(re);if(M&&re&&we&&O.indexOf(Ee)<0&&!(je(N)&&Array.isArray(re))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,re,{...t,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(w.res=A,w.usedParams=this.getUsedParamsDetails(t),w):A}if(s){const A=Array.isArray(re),W=A?[]:{},R=A?S:x;for(const V in re)if(Object.prototype.hasOwnProperty.call(re,V)){const E=`${R}${s}${V}`;Q&&!y?W[V]=this.translate(E,{...t,defaultValue:ef(ne)?ne[V]:void 0,joinArrays:!1,ns:u}):W[V]=this.translate(E,{...t,joinArrays:!1,ns:u}),W[V]===E&&(W[V]=re[V])}y=W}}else if(M&&je(N)&&Array.isArray(y))y=y.join(N),y&&(y=this.extendTranslation(y,e,t,n));else{let A=!1,W=!1;!this.isValidLookup(y)&&Q&&(A=!0,y=ne),this.isValidLookup(y)||(W=!0,y=a);const V=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&W?void 0:y,E=Q&&ne!==y&&this.options.updateMissing;if(W||A||E){if(this.logger.log(E?"updateKey":"missingKey",d,f,a,E?ne:y),s){const Y=this.resolve(a,{...t,keySeparator:!1});Y&&Y.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 T=[];const j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&j&&j[0])for(let Y=0;Y<j.length;Y++)T.push(j[Y]);else this.options.saveMissingTo==="all"?T=this.languageUtils.toResolveHierarchy(t.lng||this.language):T.push(t.lng||this.language);const U=(Y,z,$)=>{var le;const se=Q&&$!==y?$:V;this.options.missingKeyHandler?this.options.missingKeyHandler(Y,f,z,se,E,t):(le=this.backendConnector)!=null&&le.saveMissing&&this.backendConnector.saveMissing(Y,f,z,se,E,t),this.emit("missingKey",Y,f,z,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&J?T.forEach(Y=>{const z=this.pluralResolver.getSuffixes(Y,t);ce&&t[`defaultValue${this.options.pluralSeparator}zero`]&&z.indexOf(`${this.options.pluralSeparator}zero`)<0&&z.push(`${this.options.pluralSeparator}zero`),z.forEach($=>{U([Y],a+$,t[`defaultValue${$}`]||ne)})}):U(T,a,ne))}y=this.extendTranslation(y,e,t,w,n),W&&y===a&&this.options.appendNamespaceToMissingKey&&(y=`${f}:${a}`),(W||A)&&this.options.parseMissingKeyHandler&&(y=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}:${a}`:a,A?y:void 0))}return i?(w.res=y,w.usedParams=this.getUsedParamsDetails(t),w):y}extendTranslation(e,t,n,i,s){var d,m;var a=this;if((d=this.i18nFormat)!=null&&d.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const w=je(e)&&(((m=n==null?void 0:n.interpolation)==null?void 0:m.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let y;if(w){const S=e.match(this.interpolator.nestingRegexp);y=S&&S.length}let x=n.replace&&!je(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),e=this.interpolator.interpolate(e,x,n.lng||this.language||i.usedLng,n),w){const S=e.match(this.interpolator.nestingRegexp),O=S&&S.length;y<O&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var S=arguments.length,O=new Array(S),N=0;N<S;N++)O[N]=arguments[N];return(s==null?void 0:s[0])===O[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${O[0]} in key: ${t[0]}`),null):a.translate(...O,t)},n)),n.interpolation&&this.interpolator.reset()}const u=n.postProcess||this.options.postProcess,f=je(u)?[u]:u;return e!=null&&(f!=null&&f.length)&&n.applyPostProcessor!==!1&&(e=Xc.handle(f,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,s,a,u;return je(e)&&(e=[e]),e.forEach(f=>{if(this.isValidLookup(n))return;const d=this.extractFromKey(f,t),m=d.key;i=m;let w=d.namespaces;this.options.fallbackNS&&(w=w.concat(this.options.fallbackNS));const y=t.count!==void 0&&!je(t.count),x=y&&!t.ordinal&&t.count===0,S=t.context!==void 0&&(je(t.context)||typeof t.context=="number")&&t.context!=="",O=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);w.forEach(N=>{var M,J;this.isValidLookup(n)||(u=N,!Qc[`${O[0]}-${N}`]&&((M=this.utils)!=null&&M.hasLoadedNamespace)&&!((J=this.utils)!=null&&J.hasLoadedNamespace(u))&&(Qc[`${O[0]}-${N}`]=!0,this.logger.warn(`key "${i}" for languages "${O.join(", ")}" won't get resolved as namespace "${u}" 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!!!")),O.forEach(Q=>{var ce;if(this.isValidLookup(n))return;a=Q;const de=[m];if((ce=this.i18nFormat)!=null&&ce.addLookupKeys)this.i18nFormat.addLookupKeys(de,m,Q,N,t);else{let ne;y&&(ne=this.pluralResolver.getSuffix(Q,t.count,t));const re=`${this.options.pluralSeparator}zero`,we=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(de.push(m+ne),t.ordinal&&ne.indexOf(we)===0&&de.push(m+ne.replace(we,this.options.pluralSeparator)),x&&de.push(m+re)),S){const Ee=`${m}${this.options.contextSeparator}${t.context}`;de.push(Ee),y&&(de.push(Ee+ne),t.ordinal&&ne.indexOf(we)===0&&de.push(Ee+ne.replace(we,this.options.pluralSeparator)),x&&de.push(Ee+re))}}let ue;for(;ue=de.pop();)this.isValidLookup(n)||(s=ue,n=this.getResource(Q,N,ue,t))}))})}),{res:n,usedKey:i,exactUsedKey:s,usedLng:a,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n){var s;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}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&&!je(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const s of t)delete i[s]}return i}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 tf{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fn.create("languageUtils")}getScriptPartFromCode(e){if(e=lo(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=lo(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(je(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 i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),je(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),i=[],s=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return je(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):je(e)&&s(this.formatLanguageCode(e)),n.forEach(a=>{i.indexOf(a)<0&&s(this.formatLanguageCode(a))}),i}}const nf={zero:0,one:1,two:2,few:3,many:4,other:5},rf={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class S1{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Fn.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=lo(e==="dev"?"en":e),i=t.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:n,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(n,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),rf;if(!e.match(/-|_/))return rf;const f=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(f,t)}return this.pluralRulesCache[s]=a,a}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(i=>`${t}${i}`)}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((i,s)=>nf[i]-nf[s]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const sf=function(r,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=m1(r,e,t);return!s&&i&&je(t)&&(s=Ba(r,t,n),s===void 0&&(s=Ba(e,t,n))),s},Ua=r=>r.replace(/\$/g,"$$$$");class A1{constructor(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fn.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:i,prefix:s,prefixEscaped:a,suffix:u,suffixEscaped:f,formatSeparator:d,unescapeSuffix:m,unescapePrefix:w,nestingPrefix:y,nestingPrefixEscaped:x,nestingSuffix:S,nestingSuffixEscaped:O,nestingOptionsSeparator:N,maxReplaces:M,alwaysFormat:J}=e.interpolation;this.escape=t!==void 0?t:b1,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Ci(s):a||"{{",this.suffix=u?Ci(u):f||"}}",this.formatSeparator=d||",",this.unescapePrefix=m?"":w||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?Ci(y):x||Ci("$t("),this.nestingSuffix=S?Ci(S):O||Ci(")"),this.nestingOptionsSeparator=N||",",this.maxReplaces=M||1e3,this.alwaysFormat=J!==void 0?J:!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,i){var x;let s,a,u;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=S=>{if(S.indexOf(this.formatSeparator)<0){const J=sf(t,f,S,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(J,void 0,n,{...i,...t,interpolationkey:S}):J}const O=S.split(this.formatSeparator),N=O.shift().trim(),M=O.join(this.formatSeparator).trim();return this.format(sf(t,f,N,this.options.keySeparator,this.options.ignoreJSONStructure),M,n,{...i,...t,interpolationkey:N})};this.resetRegExp();const m=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,w=((x=i==null?void 0:i.interpolation)==null?void 0:x.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:S=>Ua(S)},{regex:this.regexp,safeValue:S=>this.escapeValue?Ua(this.escape(S)):Ua(S)}].forEach(S=>{for(u=0;s=S.regex.exec(e);){const O=s[1].trim();if(a=d(O),a===void 0)if(typeof m=="function"){const M=m(e,s,i);a=je(M)?M:""}else if(i&&Object.prototype.hasOwnProperty.call(i,O))a="";else if(w){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${e}`),a="";else!je(a)&&!this.useRawValueToEscape&&(a=Vc(a));const N=S.safeValue(a);if(e=e.replace(s[0],N),w?(S.regex.lastIndex+=a.length,S.regex.lastIndex-=s[0].length):S.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,s,a;const u=(f,d)=>{const m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;const w=f.split(new RegExp(`${m}[ ]*{`));let y=`{${w[1]}`;f=w[0],y=this.interpolate(y,a);const x=y.match(/'/g),S=y.match(/"/g);(((x==null?void 0:x.length)??0)%2===0&&!S||S.length%2!==0)&&(y=y.replace(/'/g,'"'));try{a=JSON.parse(y),d&&(a={...d,...a})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,O),`${f}${m}${y}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,f};for(;i=this.nestingRegexp.exec(e);){let f=[];a={...n},a=a.replace&&!je(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let d=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const m=i[1].split(this.formatSeparator).map(w=>w.trim());i[1]=m.shift(),f=m,d=!0}if(s=t(u.call(this,i[1].trim(),a),a),s&&i[0]===e&&!je(s))return s;je(s)||(s=Vc(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),d&&(s=f.reduce((m,w)=>this.format(m,w,n.lng,{...n,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const T1=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);e==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(a=>{if(a){const[u,...f]=a.split(":"),d=f.join(":").trim().replace(/^'+|'+$/g,""),m=u.trim();t[m]||(t[m]=d),d==="false"&&(t[m]=!1),d==="true"&&(t[m]=!0),isNaN(d)||(t[m]=parseInt(d,10))}})}return{formatName:e,formatOptions:t}},Li=r=>{const e={};return(t,n,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const a=n+JSON.stringify(s);let u=e[a];return u||(u=r(lo(n),i),e[a]=u),u(t)}};class _1{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fn.create("formatter"),this.options=e,this.formats={number:Li((t,n)=>{const i=new Intl.NumberFormat(t,{...n});return s=>i.format(s)}),currency:Li((t,n)=>{const i=new Intl.NumberFormat(t,{...n,style:"currency"});return s=>i.format(s)}),datetime:Li((t,n)=>{const i=new Intl.DateTimeFormat(t,{...n});return s=>i.format(s)}),relativetime:Li((t,n)=>{const i=new Intl.RelativeTimeFormat(t,{...n});return s=>i.format(s,n.range||"day")}),list:Li((t,n)=>{const i=new Intl.ListFormat(t,{...n});return s=>i.format(s)})},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()]=Li(t)}format(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=t.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(u=>u.indexOf(")")>-1)){const u=s.findIndex(f=>f.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,u)].join(this.formatSeparator)}return s.reduce((u,f)=>{var w;const{formatName:d,formatOptions:m}=T1(f);if(this.formats[d]){let y=u;try{const x=((w=i==null?void 0:i.formatParams)==null?void 0:w[i.interpolationkey])||{},S=x.locale||x.lng||i.locale||i.lng||n;y=this.formats[d](u,S,{...m,...i,...x})}catch(x){this.logger.warn(x)}return y}else this.logger.warn(`there was no format function for ${d}`);return u},e)}}const N1=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class C1 extends co{constructor(e,t,n){var s,a;let i=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=i,this.logger=Fn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,n,i.backend,i)}queueLoad(e,t,n,i){const s={},a={},u={},f={};return e.forEach(d=>{let m=!0;t.forEach(w=>{const y=`${d}|${w}`;!n.reload&&this.store.hasResourceBundle(d,w)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?a[y]===void 0&&(a[y]=!0):(this.state[y]=1,m=!1,a[y]===void 0&&(a[y]=!0),s[y]===void 0&&(s[y]=!0),f[w]===void 0&&(f[w]=!0)))}),m||(u[d]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(f)}}loaded(e,t,n){const i=e.split("|"),s=i[0],a=i[1];t&&this.emit("failedLoading",s,a,t),!t&&n&&this.store.addResourceBundle(s,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const u={};this.queue.forEach(f=>{g1(f.loaded,[s],a),N1(f,e),t&&f.errors.push(t),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(d=>{u[d]||(u[d]={});const m=f.loaded[d];m.length&&m.forEach(w=>{u[d][w]===void 0&&(u[d][w]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(f=>!f.done)}read(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:s,callback:a});return}this.readingCalls++;const u=(d,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const w=this.waitingReads.shift();this.read(w.lng,w.ns,w.fcName,w.tried,w.wait,w.callback)}if(d&&m&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,i+1,s*2,a)},s);return}a(d,m)},f=this.backend[n].bind(this.backend);if(f.length===2){try{const d=f(e,t);d&&typeof d.then=="function"?d.then(m=>u(null,m)).catch(u):u(null,d)}catch(d){u(d)}return}return f(e,t,u)}prepareLoading(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();je(e)&&(e=this.languageUtils.toResolveHierarchy(e)),je(t)&&(t=[t]);const s=this.queueLoad(e,t,n,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}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("|"),i=n[0],s=n[1];this.read(i,s,"read",void 0,void 0,(a,u)=>{a&&this.logger.warn(`${t}loading namespace ${s} for language ${i} failed`,a),!a&&u&&this.logger.log(`${t}loaded namespace ${s} for language ${i}`,u),this.loaded(e,a,u)})}saveMissing(e,t,n,i,s){var f,d,m,w,y;let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((d=(f=this.services)==null?void 0:f.utils)!=null&&d.hasLoadedNamespace&&!((w=(m=this.services)==null?void 0:m.utils)!=null&&w.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((y=this.backend)!=null&&y.create){const x={...a,isUpdate:s},S=this.backend.create.bind(this.backend);if(S.length<6)try{let O;S.length===5?O=S(e,t,n,i,x):O=S(e,t,n,i),O&&typeof O.then=="function"?O.then(N=>u(null,N)).catch(u):u(null,O)}catch(O){u(O)}else S(e,t,n,i,u,x)}!e||!e[0]||this.store.addResource(e[0],t,n,i)}}}const of=()=>({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]),je(r[1])&&(e.defaultValue=r[1]),je(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}}),af=r=>{var e,t;return je(r.ns)&&(r.ns=[r.ns]),je(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),je(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},ho=()=>{},L1=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class vs extends co{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=af(e),this.services={},this.logger=Fn,this.modules={external:[]},L1(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&&(je(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=of();this.options={...i,...this.options,...af(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const s=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?Fn.init(s(this.modules.logger),this.options):Fn.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=_1;const w=new tf(this.options);this.store=new Zc(this.options.resources,this.options);const y=this.services;y.logger=Fn,y.resourceStore=this.store,y.languageUtils=w,y.pluralResolver=new S1(w,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),m&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(y.formatter=s(m),y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new A1(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new C1(s(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",function(x){for(var S=arguments.length,O=new Array(S>1?S-1:0),N=1;N<S;N++)O[N-1]=arguments[N];e.emit(x,...O)}),this.modules.languageDetector&&(y.languageDetector=s(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=s(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new fo(this.services,this.options),this.translator.on("*",function(x){for(var S=arguments.length,O=new Array(S>1?S-1:0),N=1;N<S;N++)O[N-1]=arguments[N];e.emit(x,...O)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,n||(n=ho),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=function(){return e.store[m](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=function(){return e.store[m](...arguments),e}});const f=ys(),d=()=>{const m=(w,y)=>{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),f.resolve(y),n(w,y)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),f}loadResources(e){var s,a;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ho;const i=je(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const u=[],f=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(w=>{w!=="cimode"&&u.indexOf(w)<0&&u.push(w)})};i?f(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>f(m)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,d=>f(d)),this.services.backendConnector.load(u,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(d)})}else n(null)}reloadResources(e,t,n){const i=ys();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=ho),this.services.backendConnector.reload(e,t,s=>{i.resolve(),n(s)}),i}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"&&Xc.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 i=ys();this.emit("languageChanging",e);const s=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},a=(f,d)=>{d?(s(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),t&&t(f,function(){return n.t(...arguments)})},u=f=>{var m,w;!e&&!f&&this.services.languageDetector&&(f=[]);const d=je(f)?f:this.services.languageUtils.getBestMatchFromCodes(f);d&&(this.language||s(d),this.translator.language||this.translator.changeLanguage(d),(w=(m=this.services.languageDetector)==null?void 0:m.cacheUserLanguage)==null||w.call(m,d)),this.loadResources(d,y=>{a(y,d)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(e),i}getFixedT(e,t,n){var i=this;const s=function(a,u){let f;if(typeof u!="object"){for(var d=arguments.length,m=new Array(d>2?d-2:0),w=2;w<d;w++)m[w-2]=arguments[w];f=i.options.overloadTranslationOptionHandler([a,u].concat(m))}else f={...u};f.lng=f.lng||s.lng,f.lngs=f.lngs||s.lngs,f.ns=f.ns||s.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||n||s.keyPrefix);const y=i.options.keySeparator||".";let x;return f.keyPrefix&&Array.isArray(a)?x=a.map(S=>`${f.keyPrefix}${y}${S}`):x=f.keyPrefix?`${f.keyPrefix}${y}${a}`:a,i.t(x,f)};return je(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(){var i;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(i=this.translator)==null?void 0:i.translate(...t)}exists(){var i;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(i=this.translator)==null?void 0:i.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],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(u,f)=>{const d=this.services.backendConnector.state[`${u}|${f}`];return d===-1||d===0||d===2};if(t.precheck){const u=t.precheck(this,a);if(u!==void 0)return u}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!i||a(s,e)))}loadNamespaces(e,t){const n=ys();return this.options.ns?(je(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=ys();je(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=i.concat(s),this.loadResources(a=>{n.resolve(),t&&t(a)}),n):(t&&t(),Promise.resolve())}dir(e){var i,s;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.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=((s=this.services)==null?void 0:s.languageUtils)||new tf(of());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 vs(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ho;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new vs(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(u=>{s[u]=this[u]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},n){const u=Object.keys(this.store.data).reduce((f,d)=>(f[d]={...this.store.data[d]},Object.keys(f[d]).reduce((m,w)=>(m[w]={...f[d][w]},m),{})),{});s.store=new Zc(u,i),s.services.resourceStore=s.store}return s.translator=new fo(s.services,i),s.translator.on("*",function(u){for(var f=arguments.length,d=new Array(f>1?f-1:0),m=1;m<f;m++)d[m-1]=arguments[m];s.emit(u,...d)}),s.init(i,t),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const St=vs.createInstance();St.createInstance=vs.createInstance;const k1=St.createInstance,R1=St.dir,P1=St.init,q1=St.loadResources,I1=St.reloadResources,j1=St.use,$1=St.changeLanguage,D1=St.getFixedT,M1=St.t,B1=St.exists,U1=St.setDefaultNamespace,F1=St.hasLoadedNamespace,K1=St.loadNamespaces,H1=St.loadLanguages;function Fa(r){"@babel/helpers - typeof";return Fa=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},Fa(r)}function lf(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Fa(XMLHttpRequest))==="object"}function z1(r){return!!r&&typeof r.then=="function"}function V1(r){return z1(r)?r:Promise.resolve(r)}function uf(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function cf(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uf(Object(t),!0).forEach(function(n){W1(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):uf(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function W1(r,e,t){return(e=G1(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function G1(r){var e=Y1(r,"string");return ei(e)=="symbol"?e:e+""}function Y1(r,e){if(ei(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ei(r){"@babel/helpers - typeof";return ei=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},ei(r)}var Lr=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Lr=global.fetch:typeof window<"u"&&window.fetch&&(Lr=window.fetch);var ws;lf()&&(typeof global<"u"&&global.XMLHttpRequest?ws=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ws=window.XMLHttpRequest));var po;if(typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?po=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(po=window.ActiveXObject)),typeof Lr!="function"&&(Lr=void 0),!Lr&&!ws&&!po)try{Promise.resolve().then(()=>Nw).then(function(r){Lr=r.default}).catch(function(){})}catch{}var Ka=function(e,t){if(t&&ei(t)==="object"){var n="";for(var i in t)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);if(!n)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+n.slice(1)}return e},ff=function(e,t,n,i){var s=function(f){if(!f.ok)return n(f.statusText||"Error",{status:f.status});f.text().then(function(d){n(null,{status:f.status,data:d})}).catch(n)};if(i){var a=i(e,t);if(a instanceof Promise){a.then(s).catch(n);return}}typeof fetch=="function"?fetch(e,t).then(s).catch(n):Lr(e,t).then(s).catch(n)},hf=!1,J1=function(e,t,n,i){e.queryStringParams&&(t=Ka(t,e.queryStringParams));var s=cf({},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&&(s["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(s["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(n):e.requestOptions,u=cf({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:s},hf?{}:a),f=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{ff(t,u,i,f)}catch(d){if(!a||Object.keys(a).length===0||!d.message||d.message.indexOf("not implemented")<0)return i(d);try{Object.keys(a).forEach(function(m){delete u[m]}),ff(t,u,i,f),hf=!0}catch(m){i(m)}}},Z1=function(e,t,n,i){n&&ei(n)==="object"&&(n=Ka("",n).slice(1)),e.queryStringParams&&(t=Ka(t,e.queryStringParams));try{var s=ws?new ws:new po("MSXML2.XMLHTTP.3.0");s.open(n?"POST":"GET",t,1),e.crossDomain||s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.withCredentials=!!e.withCredentials,n&&s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.overrideMimeType&&s.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var u in a)s.setRequestHeader(u,a[u]);s.onreadystatechange=function(){s.readyState>3&&i(s.status>=400?s.statusText:null,{status:s.status,data:s.responseText})},s.send(n)}catch(f){console&&console.log(f)}},X1=function(e,t,n,i){if(typeof n=="function"&&(i=n,n=void 0),i=i||function(){},Lr&&t.indexOf("file:")!==0)return J1(e,t,n,i);if(lf()||typeof ActiveXObject=="function")return Z1(e,t,n,i);i(new Error("No fetch and no xhr implementation found!"))};function ki(r){"@babel/helpers - typeof";return ki=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},ki(r)}function df(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ha(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?df(Object(t),!0).forEach(function(n){pf(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):df(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Q1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function e0(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,gf(n.key),n)}}function t0(r,e,t){return e&&e0(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function pf(r,e,t){return(e=gf(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gf(r){var e=n0(r,"string");return ki(e)=="symbol"?e:e+""}function n0(r,e){if(ki(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(ki(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var r0=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,i){return pf({},n,i||"")},parseLoadPayload:function(t,n){},request:X1,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},mf=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]:{};Q1(this,r),this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}return t0(r,[{key:"init",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=t,this.options=Ha(Ha(Ha({},r0()),this.options||{}),i),this.allOptions=s,this.services&&this.options.reloadInterval){var a=setInterval(function(){return n.reload()},this.options.reloadInterval);ki(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(t,n,i){this._readAny(t,t,n,n,i)}},{key:"read",value:function(t,n,i){this._readAny([t],t,[n],n,i)}},{key:"_readAny",value:function(t,n,i,s,a){var u=this,f=this.options.loadPath;typeof this.options.loadPath=="function"&&(f=this.options.loadPath(t,i)),f=V1(f),f.then(function(d){if(!d)return a(null,{});var m=u.services.interpolator.interpolate(d,{lng:t.join("+"),ns:i.join("+")});u.loadUrl(m,a,n,s)})}},{key:"loadUrl",value:function(t,n,i,s){var a=this,u=typeof i=="string"?[i]:i,f=typeof s=="string"?[s]:s,d=this.options.parseLoadPayload(u,f);this.options.request(this.options,t,d,function(m,w){if(w&&(w.status>=500&&w.status<600||!w.status))return n("failed loading "+t+"; status code: "+w.status,!0);if(w&&w.status>=400&&w.status<500)return n("failed loading "+t+"; status code: "+w.status,!1);if(!w&&m&&m.message){var y=m.message.toLowerCase(),x=["failed","fetch","network","load"].find(function(N){return y.indexOf(N)>-1});if(x)return n("failed loading "+t+": "+m.message,!0)}if(m)return n(m,!1);var S,O;try{typeof w.data=="string"?S=a.options.parse(w.data,i,s):S=w.data}catch{O="failed parsing "+t+" to json"}if(O)return n(O,!1);n(null,S)})}},{key:"create",value:function(t,n,i,s,a){var u=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var f=this.options.parsePayload(n,i,s),d=0,m=[],w=[];t.forEach(function(y){var x=u.options.addPath;typeof u.options.addPath=="function"&&(x=u.options.addPath(y,n));var S=u.services.interpolator.interpolate(x,{lng:y,ns:n});u.options.request(u.options,S,f,function(O,N){d+=1,m.push(O),w.push(N),d===t.length&&typeof a=="function"&&a(m,w)})})}}},{key:"reload",value:function(){var t=this,n=this.services,i=n.backendConnector,s=n.languageUtils,a=n.logger,u=i.language;if(!(u&&u.toLowerCase()==="cimode")){var f=[],d=function(w){var y=s.toResolveHierarchy(w);y.forEach(function(x){f.indexOf(x)<0&&f.push(x)})};d(u),this.allOptions.preload&&this.allOptions.preload.forEach(function(m){return d(m)}),f.forEach(function(m){t.allOptions.ns.forEach(function(w){i.read(m,w,"read",null,null,function(y,x){y&&a.warn("loading namespace ".concat(w," for language ").concat(m," failed"),y),!y&&x&&a.log("loaded namespace ".concat(w," for language ").concat(m),x),i.loaded("".concat(m,"|").concat(w),y,x)})})})}}}])}();mf.type="backend";const{slice:i0,forEach:s0}=[];function o0(r){return s0.call(i0.call(arguments,1),e=>{if(e)for(const t in e)r[t]===void 0&&(r[t]=e[t])}),r}const yf=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,a0=function(r,e){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${r}=${i}`;if(n.maxAge>0){const a=n.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(a)}`}if(n.domain){if(!yf.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!yf.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s},bf={create(r,e,t,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+t*60*1e3)),n&&(i.domain=n),document.cookie=a0(r,encodeURIComponent(e),i)},read(r){const e=`${r}=`,t=document.cookie.split(";");for(let n=0;n<t.length;n++){let i=t[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(r){this.create(r,"",-1)}};var l0={name:"cookie",lookup(r){let{lookupCookie:e}=r;if(e&&typeof document<"u")return bf.read(e)||void 0},cacheUserLanguage(r,e){let{lookupCookie:t,cookieMinutes:n,cookieDomain:i,cookieOptions:s}=e;t&&typeof document<"u"&&bf.create(t,r,n,i,s)}},u0={name:"querystring",lookup(r){var n;let{lookupQuerystring:e}=r,t;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((n=window.location.hash)==null?void 0:n.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const a=i.substring(1).split("&");for(let u=0;u<a.length;u++){const f=a[u].indexOf("=");f>0&&a[u].substring(0,f)===e&&(t=a[u].substring(f+1))}}return t}};let Ri=null;const vf=()=>{if(Ri!==null)return Ri;try{if(Ri=typeof window<"u"&&window.localStorage!==null,!Ri)return!1;const r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{Ri=!1}return Ri};var c0={name:"localStorage",lookup(r){let{lookupLocalStorage:e}=r;if(e&&vf())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(r,e){let{lookupLocalStorage:t}=e;t&&vf()&&window.localStorage.setItem(t,r)}};let Pi=null;const wf=()=>{if(Pi!==null)return Pi;try{if(Pi=typeof window<"u"&&window.sessionStorage!==null,!Pi)return!1;const r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{Pi=!1}return Pi};var f0={name:"sessionStorage",lookup(r){let{lookupSessionStorage:e}=r;if(e&&wf())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(r,e){let{lookupSessionStorage:t}=e;t&&wf()&&window.sessionStorage.setItem(t,r)}},h0={name:"navigator",lookup(r){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:n,language:i}=navigator;if(t)for(let s=0;s<t.length;s++)e.push(t[s]);n&&e.push(n),i&&e.push(i)}return e.length>0?e:void 0}},d0={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}},p0={name:"path",lookup(r){var i;let{lookupFromPathIndex:e}=r;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?(i=t[typeof e=="number"?e:0])==null?void 0:i.replace("/",""):void 0}},g0={name:"subdomain",lookup(r){var i,s;let{lookupFromSubdomainIndex:e}=r;const t=typeof e=="number"?e+1:1,n=typeof window<"u"&&((s=(i=window.location)==null?void 0:i.hostname)==null?void 0:s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[t]}};let xf=!1;try{document.cookie,xf=!0}catch{}const Ef=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];xf||Ef.splice(1,1);const m0=()=>({order:Ef,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:r=>r});class Of{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=o0(t,this.options||{},m0()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(l0),this.addDetector(u0),this.addDetector(c0),this.addDetector(f0),this.addDetector(h0),this.addDetector(d0),this.addDetector(p0),this.addDetector(g0)}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 i=this.detectors[n].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(t=t.concat(i))}}),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)}))}}Of.type="languageDetector";var y0=Object.defineProperty,b0=(r,e,t)=>e in r?y0(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Sf=(r,e,t)=>b0(r,typeof e!="symbol"?e+"":e,t),v0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var za={exports:{}},w0=za.exports,Af;function x0(){return Af||(Af=1,function(r,e){(function(t,n){r.exports=n()})(w0,function(){var t=function(o,l){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,p){c.__proto__=p}||function(c,p){for(var g in p)Object.prototype.hasOwnProperty.call(p,g)&&(c[g]=p[g])})(o,l)},n=function(){return(n=Object.assign||function(o){for(var l,c=1,p=arguments.length;c<p;c++)for(var g in l=arguments[c])Object.prototype.hasOwnProperty.call(l,g)&&(o[g]=l[g]);return o}).apply(this,arguments)};function i(o,l,c){for(var p,g=0,b=l.length;g<b;g++)!p&&g in l||((p=p||Array.prototype.slice.call(l,0,g))[g]=l[g]);return o.concat(p||Array.prototype.slice.call(l))}var s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:v0,a=Object.keys,u=Array.isArray;function f(o,l){return typeof l!="object"||a(l).forEach(function(c){o[c]=l[c]}),o}typeof Promise>"u"||s.Promise||(s.Promise=Promise);var d=Object.getPrototypeOf,m={}.hasOwnProperty;function w(o,l){return m.call(o,l)}function y(o,l){typeof l=="function"&&(l=l(d(o))),(typeof Reflect>"u"?a:Reflect.ownKeys)(l).forEach(function(c){S(o,c,l[c])})}var x=Object.defineProperty;function S(o,l,c,p){x(o,l,f(c&&w(c,"get")&&typeof c.get=="function"?{get:c.get,set:c.set,configurable:!0}:{value:c,configurable:!0,writable:!0},p))}function O(o){return{from:function(l){return o.prototype=Object.create(l.prototype),S(o.prototype,"constructor",o),{extend:y.bind(null,o.prototype)}}}}var N=Object.getOwnPropertyDescriptor,M=[].slice;function J(o,l,c){return M.call(o,l,c)}function Q(o,l){return l(o)}function de(o){if(!o)throw new Error("Assertion Failed")}function ue(o){s.setImmediate?setImmediate(o):setTimeout(o,0)}function ce(o,l){if(typeof l=="string"&&w(o,l))return o[l];if(!l)return o;if(typeof l!="string"){for(var c=[],p=0,g=l.length;p<g;++p){var b=ce(o,l[p]);c.push(b)}return c}var _=l.indexOf(".");if(_!==-1){var C=o[l.substr(0,_)];return C==null?void 0:ce(C,l.substr(_+1))}}function ne(o,l,c){if(o&&l!==void 0&&!("isFrozen"in Object&&Object.isFrozen(o)))if(typeof l!="string"&&"length"in l){de(typeof c!="string"&&"length"in c);for(var p=0,g=l.length;p<g;++p)ne(o,l[p],c[p])}else{var b,_,C=l.indexOf(".");C!==-1?(b=l.substr(0,C),(_=l.substr(C+1))===""?c===void 0?u(o)&&!isNaN(parseInt(b))?o.splice(b,1):delete o[b]:o[b]=c:ne(C=!(C=o[b])||!w(o,b)?o[b]={}:C,_,c)):c===void 0?u(o)&&!isNaN(parseInt(l))?o.splice(l,1):delete o[l]:o[l]=c}}function re(o){var l,c={};for(l in o)w(o,l)&&(c[l]=o[l]);return c}var we=[].concat;function Ee(o){return we.apply([],o)}var _n="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Ee([8,16,32,64].map(function(o){return["Int","Uint","Float"].map(function(l){return l+o+"Array"})}))).filter(function(o){return s[o]}),A=new Set(_n.map(function(o){return s[o]})),W=null;function R(o){return W=new WeakMap,o=function l(c){if(!c||typeof c!="object")return c;var p=W.get(c);if(p)return p;if(u(c)){p=[],W.set(c,p);for(var g=0,b=c.length;g<b;++g)p.push(l(c[g]))}else if(A.has(c.constructor))p=c;else{var _,C=d(c);for(_ in p=C===Object.prototype?{}:Object.create(C),W.set(c,p),c)w(c,_)&&(p[_]=l(c[_]))}return p}(o),W=null,o}var V={}.toString;function E(o){return V.call(o).slice(8,-1)}var T=typeof Symbol<"u"?Symbol.iterator:"@@iterator",j=typeof T=="symbol"?function(o){var l;return o!=null&&(l=o[T])&&l.apply(o)}:function(){return null};function U(o,l){return l=o.indexOf(l),0<=l&&o.splice(l,1),0<=l}var Y={};function z(o){var l,c,p,g;if(arguments.length===1){if(u(o))return o.slice();if(this===Y&&typeof o=="string")return[o];if(g=j(o)){for(c=[];!(p=g.next()).done;)c.push(p.value);return c}if(o==null)return[o];if(typeof(l=o.length)!="number")return[o];for(c=new Array(l);l--;)c[l]=o[l];return c}for(l=arguments.length,c=new Array(l);l--;)c[l]=arguments[l];return c}var $=typeof Symbol<"u"?function(o){return o[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},rn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],gn=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(rn),se={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function le(o,l){this.name=o,this.message=l}function be(o,l){return o+". Errors: "+Object.keys(l).map(function(c){return l[c].toString()}).filter(function(c,p,g){return g.indexOf(c)===p}).join(`
71
- `)}function ge(o,l,c,p){this.failures=l,this.failedKeys=p,this.successCount=c,this.message=be(o,l)}function Pe(o,l){this.name="BulkError",this.failures=Object.keys(l).map(function(c){return l[c]}),this.failuresByPos=l,this.message=be(o,this.failures)}O(le).from(Error).extend({toString:function(){return this.name+": "+this.message}}),O(ge).from(le),O(Pe).from(le);var Be=gn.reduce(function(o,l){return o[l]=l+"Error",o},{}),Re=le,ae=gn.reduce(function(o,l){var c=l+"Error";function p(g,b){this.name=c,g?typeof g=="string"?(this.message="".concat(g).concat(b?`
72
- `+b:""),this.inner=b||null):typeof g=="object"&&(this.message="".concat(g.name," ").concat(g.message),this.inner=g):(this.message=se[l]||c,this.inner=null)}return O(p).from(Re),o[l]=p,o},{});ae.Syntax=SyntaxError,ae.Type=TypeError,ae.Range=RangeError;var ke=rn.reduce(function(o,l){return o[l+"Error"]=ae[l],o},{}),qe=gn.reduce(function(o,l){return["Syntax","Type","Range"].indexOf(l)===-1&&(o[l+"Error"]=ae[l]),o},{});function Se(){}function $e(o){return o}function Qe(o,l){return o==null||o===$e?l:function(c){return l(o(c))}}function Ze(o,l){return function(){o.apply(this,arguments),l.apply(this,arguments)}}function Tn(o,l){return o===Se?l:function(){var c=o.apply(this,arguments);c!==void 0&&(arguments[0]=c);var p=this.onsuccess,g=this.onerror;this.onsuccess=null,this.onerror=null;var b=l.apply(this,arguments);return p&&(this.onsuccess=this.onsuccess?Ze(p,this.onsuccess):p),g&&(this.onerror=this.onerror?Ze(g,this.onerror):g),b!==void 0?b:c}}function zn(o,l){return o===Se?l:function(){o.apply(this,arguments);var c=this.onsuccess,p=this.onerror;this.onsuccess=this.onerror=null,l.apply(this,arguments),c&&(this.onsuccess=this.onsuccess?Ze(c,this.onsuccess):c),p&&(this.onerror=this.onerror?Ze(p,this.onerror):p)}}function hr(o,l){return o===Se?l:function(c){var p=o.apply(this,arguments);f(c,p);var g=this.onsuccess,b=this.onerror;return this.onsuccess=null,this.onerror=null,c=l.apply(this,arguments),g&&(this.onsuccess=this.onsuccess?Ze(g,this.onsuccess):g),b&&(this.onerror=this.onerror?Ze(b,this.onerror):b),p===void 0?c===void 0?void 0:c:f(p,c)}}function dr(o,l){return o===Se?l:function(){return l.apply(this,arguments)!==!1&&o.apply(this,arguments)}}function Vn(o,l){return o===Se?l:function(){var c=o.apply(this,arguments);if(c&&typeof c.then=="function"){for(var p=this,g=arguments.length,b=new Array(g);g--;)b[g]=arguments[g];return c.then(function(){return l.apply(p,b)})}return l.apply(this,arguments)}}qe.ModifyError=ge,qe.DexieError=le,qe.BulkError=Pe;var Tt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ii(o){Tt=o}var Wn={},Kt=100,_n=typeof Promise>"u"?[]:function(){var o=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[o,d(o),o];var l=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[l,d(l),o]}(),rn=_n[0],gn=_n[1],_n=_n[2],gn=gn&&gn.then,Pt=rn&&rn.constructor,Gn=!!_n,Nn=function(o,l){on.push([o,l]),pr&&(queueMicrotask(oi),pr=!1)},_t=!0,pr=!0,sn=[],kr=[],gr=$e,qt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Se,pgp:!1,env:{},finalize:Se},_e=qt,on=[],It=0,Nt=[];function ve(o){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var l=this._PSD=_e;if(typeof o!="function"){if(o!==Wn)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&yr(this,this._value))}this._state=null,this._value=null,++l.ref,function c(p,g){try{g(function(b){if(p._state===null){if(b===p)throw new TypeError("A promise cannot be resolved with itself.");var _=p._lib&&jt();b&&typeof b.then=="function"?c(p,function(C,P){b instanceof ve?b._then(C,P):b.then(C,P)}):(p._state=!0,p._value=b,Jn(p)),_&&Cn()}},yr.bind(null,p))}catch(b){yr(p,b)}}(this,o)}var mr={get:function(){var o=_e,l=Pr;function c(p,g){var b=this,_=!o.global&&(o!==_e||l!==Pr),C=_&&!ln(),P=new ve(function(I,F){br(b,new Yn(Mi(p,o,_,C),Mi(g,o,_,C),I,F,o))});return this._consoleTask&&(P._consoleTask=this._consoleTask),P}return c.prototype=Wn,c},set:function(o){S(this,"then",o&&o.prototype===Wn?mr:{get:function(){return o},set:mr.set})}};function Yn(o,l,c,p,g){this.onFulfilled=typeof o=="function"?o:null,this.onRejected=typeof l=="function"?l:null,this.resolve=c,this.reject=p,this.psd=g}function yr(o,l){var c,p;kr.push(l),o._state===null&&(c=o._lib&&jt(),l=gr(l),o._state=!1,o._value=l,p=o,sn.some(function(g){return g._value===p._value})||sn.push(p),Jn(o),c&&Cn())}function Jn(o){var l=o._listeners;o._listeners=[];for(var c=0,p=l.length;c<p;++c)br(o,l[c]);var g=o._PSD;--g.ref||g.finalize(),It===0&&(++It,Nn(function(){--It==0&&Ht()},[]))}function br(o,l){if(o._state!==null){var c=o._state?l.onFulfilled:l.onRejected;if(c===null)return(o._state?l.resolve:l.reject)(o._value);++l.psd.ref,++It,Nn(si,[c,o,l])}else o._listeners.push(l)}function si(o,l,c){try{var p,g=l._value;!l._state&&kr.length&&(kr=[]),p=Tt&&l._consoleTask?l._consoleTask.run(function(){return o(g)}):o(g),l._state||kr.indexOf(g)!==-1||function(b){for(var _=sn.length;_;)if(sn[--_]._value===b._value)return sn.splice(_,1)}(l),c.resolve(p)}catch(b){c.reject(b)}finally{--It==0&&Ht(),--c.psd.ref||c.psd.finalize()}}function oi(){Ln(qt,function(){jt()&&Cn()})}function jt(){var o=_t;return pr=_t=!1,o}function Cn(){var o,l,c;do for(;0<on.length;)for(o=on,on=[],c=o.length,l=0;l<c;++l){var p=o[l];p[0].apply(null,p[1])}while(0<on.length);pr=_t=!0}function Ht(){var o=sn;sn=[],o.forEach(function(p){p._PSD.onunhandled.call(null,p._value,p)});for(var l=Nt.slice(0),c=l.length;c;)l[--c]()}function Rr(o){return new ve(Wn,!1,o)}function Xe(o,l){var c=_e;return function(){var p=jt(),g=_e;try{return un(c,!0),o.apply(this,arguments)}catch(b){l&&l(b)}finally{un(g,!1),p&&Cn()}}}y(ve.prototype,{then:mr,_then:function(o,l){br(this,new Yn(null,null,o,l,_e))},catch:function(o){if(arguments.length===1)return this.then(null,o);var l=o,c=arguments[1];return typeof l=="function"?this.then(null,function(p){return(p instanceof l?c:Rr)(p)}):this.then(null,function(p){return(p&&p.name===l?c:Rr)(p)})},finally:function(o){return this.then(function(l){return ve.resolve(o()).then(function(){return l})},function(l){return ve.resolve(o()).then(function(){return Rr(l)})})},timeout:function(o,l){var c=this;return o<1/0?new ve(function(p,g){var b=setTimeout(function(){return g(new ae.Timeout(l))},o);c.then(p,g).finally(clearTimeout.bind(null,b))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&S(ve.prototype,Symbol.toStringTag,"Dexie.Promise"),qt.env=Di(),y(ve,{all:function(){var o=z.apply(null,arguments).map(ht);return new ve(function(l,c){o.length===0&&l([]);var p=o.length;o.forEach(function(g,b){return ve.resolve(g).then(function(_){o[b]=_,--p||l(o)},c)})})},resolve:function(o){return o instanceof ve?o:o&&typeof o.then=="function"?new ve(function(l,c){o.then(l,c)}):new ve(Wn,!0,o)},reject:Rr,race:function(){var o=z.apply(null,arguments).map(ht);return new ve(function(l,c){o.map(function(p){return ve.resolve(p).then(l,c)})})},PSD:{get:function(){return _e},set:function(o){return _e=o}},totalEchoes:{get:function(){return Pr}},newPSD:an,usePSD:Ln,scheduler:{get:function(){return Nn},set:function(o){Nn=o}},rejectionMapper:{get:function(){return gr},set:function(o){gr=o}},follow:function(o,l){return new ve(function(c,p){return an(function(g,b){var _=_e;_.unhandleds=[],_.onunhandled=b,_.finalize=Ze(function(){var C,P=this;C=function(){P.unhandleds.length===0?g():b(P.unhandleds[0])},Nt.push(function I(){C(),Nt.splice(Nt.indexOf(I),1)}),++It,Nn(function(){--It==0&&Ht()},[])},_.finalize),o()},l,c,p)})}}),Pt&&(Pt.allSettled&&S(ve,"allSettled",function(){var o=z.apply(null,arguments).map(ht);return new ve(function(l){o.length===0&&l([]);var c=o.length,p=new Array(c);o.forEach(function(g,b){return ve.resolve(g).then(function(_){return p[b]={status:"fulfilled",value:_}},function(_){return p[b]={status:"rejected",reason:_}}).then(function(){return--c||l(p)})})})}),Pt.any&&typeof AggregateError<"u"&&S(ve,"any",function(){var o=z.apply(null,arguments).map(ht);return new ve(function(l,c){o.length===0&&c(new AggregateError([]));var p=o.length,g=new Array(p);o.forEach(function(b,_){return ve.resolve(b).then(function(C){return l(C)},function(C){g[_]=C,--p||c(new AggregateError(g))})})})}),Pt.withResolvers&&(ve.withResolvers=Pt.withResolvers));var ot={awaits:0,echoes:0,id:0},$i=0,Zn=[],at=0,Pr=0,Ns=0;function an(o,l,c,p){var g=_e,b=Object.create(g);return b.parent=g,b.ref=0,b.global=!1,b.id=++Ns,qt.env,b.env=Gn?{Promise:ve,PromiseProp:{value:ve,configurable:!0,writable:!0},all:ve.all,race:ve.race,allSettled:ve.allSettled,any:ve.any,resolve:ve.resolve,reject:ve.reject}:{},l&&f(b,l),++g.ref,b.finalize=function(){--this.parent.ref||this.parent.finalize()},p=Ln(b,o,c,p),b.ref===0&&b.finalize(),p}function Xn(){return ot.id||(ot.id=++$i),++ot.awaits,ot.echoes+=Kt,ot.id}function ln(){return!!ot.awaits&&(--ot.awaits==0&&(ot.id=0),ot.echoes=ot.awaits*Kt,!0)}function ht(o){return ot.echoes&&o&&o.constructor===Pt?(Xn(),o.then(function(l){return ln(),l},function(l){return ln(),nt(l)})):o}function Cs(){var o=Zn[Zn.length-1];Zn.pop(),un(o,!1)}function un(o,l){var c,p=_e;(l?!ot.echoes||at++&&o===_e:!at||--at&&o===_e)||queueMicrotask(l?(function(g){++Pr,ot.echoes&&--ot.echoes!=0||(ot.echoes=ot.awaits=ot.id=0),Zn.push(_e),un(g,!0)}).bind(null,o):Cs),o!==_e&&(_e=o,p===qt&&(qt.env=Di()),Gn&&(c=qt.env.Promise,l=o.env,(p.global||o.global)&&(Object.defineProperty(s,"Promise",l.PromiseProp),c.all=l.all,c.race=l.race,c.resolve=l.resolve,c.reject=l.reject,l.allSettled&&(c.allSettled=l.allSettled),l.any&&(c.any=l.any))))}function Di(){var o=s.Promise;return Gn?{Promise:o,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:o.all,race:o.race,allSettled:o.allSettled,any:o.any,resolve:o.resolve,reject:o.reject}:{}}function Ln(o,l,c,p,g){var b=_e;try{return un(o,!0),l(c,p,g)}finally{un(b,!1)}}function Mi(o,l,c,p){return typeof o!="function"?o:function(){var g=_e;c&&Xn(),un(l,!0);try{return o.apply(this,arguments)}finally{un(g,!1),p&&queueMicrotask(ln)}}}function mt(o){Promise===Pt&&ot.echoes===0?at===0?o():enqueueNativeMicroTask(o):setTimeout(o,0)}(""+gn).indexOf("[native code]")===-1&&(Xn=ln=Se);var nt=ve.reject,kn="￿",zt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",Qn=[],Rn="__dbnames",qr="readonly",er="readwrite";function yt(o,l){return o?l?function(){return o.apply(this,arguments)&&l.apply(this,arguments)}:o:l}var Ir={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function jr(o){return typeof o!="string"||/\./.test(o)?function(l){return l}:function(l){return l[o]===void 0&&o in l&&delete(l=R(l))[o],l}}function Ui(){throw ae.Type()}function Ke(o,l){try{var c=Fi(o),p=Fi(l);if(c!==p)return c==="Array"?1:p==="Array"?-1:c==="binary"?1:p==="binary"?-1:c==="string"?1:p==="string"?-1:c==="Date"?1:p!=="Date"?NaN:-1;switch(c){case"number":case"Date":case"string":return l<o?1:o<l?-1:0;case"binary":return function(g,b){for(var _=g.length,C=b.length,P=_<C?_:C,I=0;I<P;++I)if(g[I]!==b[I])return g[I]<b[I]?-1:1;return _===C?0:_<C?-1:1}(Ki(o),Ki(l));case"Array":return function(g,b){for(var _=g.length,C=b.length,P=_<C?_:C,I=0;I<P;++I){var F=Ke(g[I],b[I]);if(F!==0)return F}return _===C?0:_<C?-1:1}(o,l)}}catch{}return NaN}function Fi(o){var l=typeof o;return l!="object"?l:ArrayBuffer.isView(o)?"binary":(o=E(o),o==="ArrayBuffer"?"binary":o)}function Ki(o){return o instanceof Uint8Array?o:ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o)}var vr=(Je.prototype._trans=function(o,l,c){var p=this._tx||_e.trans,g=this.name,b=Tt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(o==="readonly"?"read":"write"," ").concat(this.name));function _(I,F,L){if(!L.schema[g])throw new ae.NotFound("Table "+g+" not part of transaction");return l(L.idbtrans,L)}var C=jt();try{var P=p&&p.db._novip===this.db._novip?p===_e.trans?p._promise(o,_,c):an(function(){return p._promise(o,_,c)},{trans:p,transless:_e.transless||_e}):function I(F,L,H,q){if(F.idbdb&&(F._state.openComplete||_e.letThrough||F._vip)){var B=F._createTransaction(L,H,F._dbSchema);try{B.create(),F._state.PR1398_maxLoop=3}catch(K){return K.name===Be.InvalidState&&F.isOpen()&&0<--F._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),F.close({disableAutoOpen:!1}),F.open().then(function(){return I(F,L,H,q)})):nt(K)}return B._promise(L,function(K,D){return an(function(){return _e.trans=B,q(K,D,B)})}).then(function(K){if(L==="readwrite")try{B.idbtrans.commit()}catch{}return L==="readonly"?K:B._completion.then(function(){return K})})}if(F._state.openComplete)return nt(new ae.DatabaseClosed(F._state.dbOpenError));if(!F._state.isBeingOpened){if(!F._state.autoOpen)return nt(new ae.DatabaseClosed);F.open().catch(Se)}return F._state.dbReadyPromise.then(function(){return I(F,L,H,q)})}(this.db,o,[this.name],_);return b&&(P._consoleTask=b,P=P.catch(function(I){return console.trace(I),nt(I)})),P}finally{C&&Cn()}},Je.prototype.get=function(o,l){var c=this;return o&&o.constructor===Object?this.where(o).first(l):o==null?nt(new ae.Type("Invalid argument to Table.get()")):this._trans("readonly",function(p){return c.core.get({trans:p,key:o}).then(function(g){return c.hook.reading.fire(g)})}).then(l)},Je.prototype.where=function(o){if(typeof o=="string")return new this.db.WhereClause(this,o);if(u(o))return new this.db.WhereClause(this,"[".concat(o.join("+"),"]"));var l=a(o);if(l.length===1)return this.where(l[0]).equals(o[l[0]]);var c=this.schema.indexes.concat(this.schema.primKey).filter(function(C){if(C.compound&&l.every(function(I){return 0<=C.keyPath.indexOf(I)})){for(var P=0;P<l.length;++P)if(l.indexOf(C.keyPath[P])===-1)return!1;return!0}return!1}).sort(function(C,P){return C.keyPath.length-P.keyPath.length})[0];if(c&&this.db._maxKey!==kn){var b=c.keyPath.slice(0,l.length);return this.where(b).equals(b.map(function(P){return o[P]}))}!c&&Tt&&console.warn("The query ".concat(JSON.stringify(o)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(l.join("+"),"]"));var p=this.schema.idxByName;function g(C,P){return Ke(C,P)===0}var _=l.reduce(function(L,P){var I=L[0],F=L[1],L=p[P],H=o[P];return[I||L,I||!L?yt(F,L&&L.multi?function(q){return q=ce(q,P),u(q)&&q.some(function(B){return g(H,B)})}:function(q){return g(H,ce(q,P))}):F]},[null,null]),b=_[0],_=_[1];return b?this.where(b.name).equals(o[b.keyPath]).filter(_):c?this.filter(_):this.where(l).equals("")},Je.prototype.filter=function(o){return this.toCollection().and(o)},Je.prototype.count=function(o){return this.toCollection().count(o)},Je.prototype.offset=function(o){return this.toCollection().offset(o)},Je.prototype.limit=function(o){return this.toCollection().limit(o)},Je.prototype.each=function(o){return this.toCollection().each(o)},Je.prototype.toArray=function(o){return this.toCollection().toArray(o)},Je.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Je.prototype.orderBy=function(o){return new this.db.Collection(new this.db.WhereClause(this,u(o)?"[".concat(o.join("+"),"]"):o))},Je.prototype.reverse=function(){return this.toCollection().reverse()},Je.prototype.mapToClass=function(o){var l,c=this.db,p=this.name;function g(){return l!==null&&l.apply(this,arguments)||this}(this.schema.mappedClass=o).prototype instanceof Ui&&(function(P,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function F(){this.constructor=P}t(P,I),P.prototype=I===null?Object.create(I):(F.prototype=I.prototype,new F)}(g,l=o),Object.defineProperty(g.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),g.prototype.table=function(){return p},o=g);for(var b=new Set,_=o.prototype;_;_=d(_))Object.getOwnPropertyNames(_).forEach(function(P){return b.add(P)});function C(P){if(!P)return P;var I,F=Object.create(o.prototype);for(I in P)if(!b.has(I))try{F[I]=P[I]}catch{}return F}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=C,this.hook("reading",C),o},Je.prototype.defineClass=function(){return this.mapToClass(function(o){f(this,o)})},Je.prototype.add=function(o,l){var c=this,p=this.schema.primKey,g=p.auto,b=p.keyPath,_=o;return b&&g&&(_=jr(b)(o)),this._trans("readwrite",function(C){return c.core.mutate({trans:C,type:"add",keys:l!=null?[l]:null,values:[_]})}).then(function(C){return C.numFailures?ve.reject(C.failures[0]):C.lastResult}).then(function(C){if(b)try{ne(o,b,C)}catch{}return C})},Je.prototype.update=function(o,l){return typeof o!="object"||u(o)?this.where(":id").equals(o).modify(l):(o=ce(o,this.schema.primKey.keyPath),o===void 0?nt(new ae.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(o).modify(l))},Je.prototype.put=function(o,l){var c=this,p=this.schema.primKey,g=p.auto,b=p.keyPath,_=o;return b&&g&&(_=jr(b)(o)),this._trans("readwrite",function(C){return c.core.mutate({trans:C,type:"put",values:[_],keys:l!=null?[l]:null})}).then(function(C){return C.numFailures?ve.reject(C.failures[0]):C.lastResult}).then(function(C){if(b)try{ne(o,b,C)}catch{}return C})},Je.prototype.delete=function(o){var l=this;return this._trans("readwrite",function(c){return l.core.mutate({trans:c,type:"delete",keys:[o]})}).then(function(c){return c.numFailures?ve.reject(c.failures[0]):void 0})},Je.prototype.clear=function(){var o=this;return this._trans("readwrite",function(l){return o.core.mutate({trans:l,type:"deleteRange",range:Ir})}).then(function(l){return l.numFailures?ve.reject(l.failures[0]):void 0})},Je.prototype.bulkGet=function(o){var l=this;return this._trans("readonly",function(c){return l.core.getMany({keys:o,trans:c}).then(function(p){return p.map(function(g){return l.hook.reading.fire(g)})})})},Je.prototype.bulkAdd=function(o,l,c){var p=this,g=Array.isArray(l)?l:void 0,b=(c=c||(g?void 0:l))?c.allKeys:void 0;return this._trans("readwrite",function(_){var I=p.schema.primKey,C=I.auto,I=I.keyPath;if(I&&g)throw new ae.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(g&&g.length!==o.length)throw new ae.InvalidArgument("Arguments objects and keys must have the same length");var P=o.length,I=I&&C?o.map(jr(I)):o;return p.core.mutate({trans:_,type:"add",keys:g,values:I,wantResults:b}).then(function(B){var L=B.numFailures,H=B.results,q=B.lastResult,B=B.failures;if(L===0)return b?H:q;throw new Pe("".concat(p.name,".bulkAdd(): ").concat(L," of ").concat(P," operations failed"),B)})})},Je.prototype.bulkPut=function(o,l,c){var p=this,g=Array.isArray(l)?l:void 0,b=(c=c||(g?void 0:l))?c.allKeys:void 0;return this._trans("readwrite",function(_){var I=p.schema.primKey,C=I.auto,I=I.keyPath;if(I&&g)throw new ae.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(g&&g.length!==o.length)throw new ae.InvalidArgument("Arguments objects and keys must have the same length");var P=o.length,I=I&&C?o.map(jr(I)):o;return p.core.mutate({trans:_,type:"put",keys:g,values:I,wantResults:b}).then(function(B){var L=B.numFailures,H=B.results,q=B.lastResult,B=B.failures;if(L===0)return b?H:q;throw new Pe("".concat(p.name,".bulkPut(): ").concat(L," of ").concat(P," operations failed"),B)})})},Je.prototype.bulkUpdate=function(o){var l=this,c=this.core,p=o.map(function(_){return _.key}),g=o.map(function(_){return _.changes}),b=[];return this._trans("readwrite",function(_){return c.getMany({trans:_,keys:p,cache:"clone"}).then(function(C){var P=[],I=[];o.forEach(function(L,H){var q=L.key,B=L.changes,K=C[H];if(K){for(var D=0,G=Object.keys(B);D<G.length;D++){var Z=G[D],X=B[Z];if(Z===l.schema.primKey.keyPath){if(Ke(X,q)!==0)throw new ae.Constraint("Cannot update primary key in bulkUpdate()")}else ne(K,Z,X)}b.push(H),P.push(q),I.push(K)}});var F=P.length;return c.mutate({trans:_,type:"put",keys:P,values:I,updates:{keys:p,changeSpecs:g}}).then(function(L){var H=L.numFailures,q=L.failures;if(H===0)return F;for(var B=0,K=Object.keys(q);B<K.length;B++){var D,G=K[B],Z=b[Number(G)];Z!=null&&(D=q[G],delete q[G],q[Z]=D)}throw new Pe("".concat(l.name,".bulkUpdate(): ").concat(H," of ").concat(F," operations failed"),q)})})})},Je.prototype.bulkDelete=function(o){var l=this,c=o.length;return this._trans("readwrite",function(p){return l.core.mutate({trans:p,type:"delete",keys:o})}).then(function(_){var g=_.numFailures,b=_.lastResult,_=_.failures;if(g===0)return b;throw new Pe("".concat(l.name,".bulkDelete(): ").concat(g," of ").concat(c," operations failed"),_)})},Je);function Je(){}function Vt(o){function l(_,C){if(C){for(var P=arguments.length,I=new Array(P-1);--P;)I[P-1]=arguments[P];return c[_].subscribe.apply(null,I),o}if(typeof _=="string")return c[_]}var c={};l.addEventType=b;for(var p=1,g=arguments.length;p<g;++p)b(arguments[p]);return l;function b(_,C,P){if(typeof _!="object"){var I;C=C||dr;var F={subscribers:[],fire:P=P||Se,subscribe:function(L){F.subscribers.indexOf(L)===-1&&(F.subscribers.push(L),F.fire=C(F.fire,L))},unsubscribe:function(L){F.subscribers=F.subscribers.filter(function(H){return H!==L}),F.fire=F.subscribers.reduce(C,P)}};return c[_]=l[_]=F}a(I=_).forEach(function(L){var H=I[L];if(u(H))b(L,I[L][0],I[L][1]);else{if(H!=="asap")throw new ae.InvalidArgument("Invalid event config");var q=b(L,$e,function(){for(var B=arguments.length,K=new Array(B);B--;)K[B]=arguments[B];q.subscribers.forEach(function(D){ue(function(){D.apply(null,K)})})})}})}}function tr(o,l){return O(l).from({prototype:o}),l}function Pn(o,l){return!(o.filter||o.algorithm||o.or)&&(l?o.justLimit:!o.replayFilter)}function ai(o,l){o.filter=yt(o.filter,l)}function li(o,l,c){var p=o.replayFilter;o.replayFilter=p?function(){return yt(p(),l())}:l,o.justLimit=c&&!p}function $r(o,l){if(o.isPrimKey)return l.primaryKey;var c=l.getIndexByKeyPath(o.index);if(!c)throw new ae.Schema("KeyPath "+o.index+" on object store "+l.name+" is not indexed");return c}function Hi(o,l,c){var p=$r(o,l.schema);return l.openCursor({trans:c,values:!o.keysOnly,reverse:o.dir==="prev",unique:!!o.unique,query:{index:p,range:o.range}})}function nr(o,l,c,p){var g=o.replayFilter?yt(o.filter,o.replayFilter()):o.filter;if(o.or){var b={},_=function(C,P,I){var F,L;g&&!g(P,I,function(H){return P.stop(H)},function(H){return P.fail(H)})||((L=""+(F=P.primaryKey))=="[object ArrayBuffer]"&&(L=""+new Uint8Array(F)),w(b,L)||(b[L]=!0,l(C,P,I)))};return Promise.all([o.or._iterate(_,c),zi(Hi(o,p,c),o.algorithm,_,!o.keysOnly&&o.valueMapper)])}return zi(Hi(o,p,c),yt(o.algorithm,g),l,!o.keysOnly&&o.valueMapper)}function zi(o,l,c,p){var g=Xe(p?function(b,_,C){return c(p(b),_,C)}:c);return o.then(function(b){if(b)return b.start(function(){var _=function(){return b.continue()};l&&!l(b,function(C){return _=C},function(C){b.stop(C),_=Se},function(C){b.fail(C),_=Se})||g(b.value,b,function(C){return _=C}),_()})})}var wr=(rr.prototype.execute=function(o){var l=this["@@propmod"];if(l.add!==void 0){var c=l.add;if(u(c))return i(i([],u(o)?o:[],!0),c).sort();if(typeof c=="number")return(Number(o)||0)+c;if(typeof c=="bigint")try{return BigInt(o)+c}catch{return BigInt(0)+c}throw new TypeError("Invalid term ".concat(c))}if(l.remove!==void 0){var p=l.remove;if(u(p))return u(o)?o.filter(function(g){return!p.includes(g)}).sort():[];if(typeof p=="number")return Number(o)-p;if(typeof p=="bigint")try{return BigInt(o)-p}catch{return BigInt(0)-p}throw new TypeError("Invalid subtrahend ".concat(p))}return c=(c=l.replacePrefix)===null||c===void 0?void 0:c[0],c&&typeof o=="string"&&o.startsWith(c)?l.replacePrefix[1]+o.substring(c.length):o},rr);function rr(o){this["@@propmod"]=o}var Wt=(Ue.prototype._read=function(o,l){var c=this._ctx;return c.error?c.table._trans(null,nt.bind(null,c.error)):c.table._trans("readonly",o).then(l)},Ue.prototype._write=function(o){var l=this._ctx;return l.error?l.table._trans(null,nt.bind(null,l.error)):l.table._trans("readwrite",o,"locked")},Ue.prototype._addAlgorithm=function(o){var l=this._ctx;l.algorithm=yt(l.algorithm,o)},Ue.prototype._iterate=function(o,l){return nr(this._ctx,o,l,this._ctx.table.core)},Ue.prototype.clone=function(o){var l=Object.create(this.constructor.prototype),c=Object.create(this._ctx);return o&&f(c,o),l._ctx=c,l},Ue.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ue.prototype.each=function(o){var l=this._ctx;return this._read(function(c){return nr(l,o,c,l.table.core)})},Ue.prototype.count=function(o){var l=this;return this._read(function(c){var p=l._ctx,g=p.table.core;if(Pn(p,!0))return g.count({trans:c,query:{index:$r(p,g.schema),range:p.range}}).then(function(_){return Math.min(_,p.limit)});var b=0;return nr(p,function(){return++b,!1},c,g).then(function(){return b})}).then(o)},Ue.prototype.sortBy=function(o,l){var c=o.split(".").reverse(),p=c[0],g=c.length-1;function b(P,I){return I?b(P[c[I]],I-1):P[p]}var _=this._ctx.dir==="next"?1:-1;function C(P,I){return Ke(b(P,g),b(I,g))*_}return this.toArray(function(P){return P.sort(C)}).then(l)},Ue.prototype.toArray=function(o){var l=this;return this._read(function(c){var p=l._ctx;if(p.dir==="next"&&Pn(p,!0)&&0<p.limit){var g=p.valueMapper,b=$r(p,p.table.core.schema);return p.table.core.query({trans:c,limit:p.limit,values:!0,query:{index:b,range:p.range}}).then(function(C){return C=C.result,g?C.map(g):C})}var _=[];return nr(p,function(C){return _.push(C)},c,p.table.core).then(function(){return _})},o)},Ue.prototype.offset=function(o){var l=this._ctx;return o<=0||(l.offset+=o,Pn(l)?li(l,function(){var c=o;return function(p,g){return c===0||(c===1?--c:g(function(){p.advance(c),c=0}),!1)}}):li(l,function(){var c=o;return function(){return--c<0}})),this},Ue.prototype.limit=function(o){return this._ctx.limit=Math.min(this._ctx.limit,o),li(this._ctx,function(){var l=o;return function(c,p,g){return--l<=0&&p(g),0<=l}},!0),this},Ue.prototype.until=function(o,l){return ai(this._ctx,function(c,p,g){return!o(c.value)||(p(g),l)}),this},Ue.prototype.first=function(o){return this.limit(1).toArray(function(l){return l[0]}).then(o)},Ue.prototype.last=function(o){return this.reverse().first(o)},Ue.prototype.filter=function(o){var l;return ai(this._ctx,function(c){return o(c.value)}),(l=this._ctx).isMatch=yt(l.isMatch,o),this},Ue.prototype.and=function(o){return this.filter(o)},Ue.prototype.or=function(o){return new this.db.WhereClause(this._ctx.table,o,this)},Ue.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ue.prototype.desc=function(){return this.reverse()},Ue.prototype.eachKey=function(o){var l=this._ctx;return l.keysOnly=!l.isMatch,this.each(function(c,p){o(p.key,p)})},Ue.prototype.eachUniqueKey=function(o){return this._ctx.unique="unique",this.eachKey(o)},Ue.prototype.eachPrimaryKey=function(o){var l=this._ctx;return l.keysOnly=!l.isMatch,this.each(function(c,p){o(p.primaryKey,p)})},Ue.prototype.keys=function(o){var l=this._ctx;l.keysOnly=!l.isMatch;var c=[];return this.each(function(p,g){c.push(g.key)}).then(function(){return c}).then(o)},Ue.prototype.primaryKeys=function(o){var l=this._ctx;if(l.dir==="next"&&Pn(l,!0)&&0<l.limit)return this._read(function(p){var g=$r(l,l.table.core.schema);return l.table.core.query({trans:p,values:!1,limit:l.limit,query:{index:g,range:l.range}})}).then(function(p){return p.result}).then(o);l.keysOnly=!l.isMatch;var c=[];return this.each(function(p,g){c.push(g.primaryKey)}).then(function(){return c}).then(o)},Ue.prototype.uniqueKeys=function(o){return this._ctx.unique="unique",this.keys(o)},Ue.prototype.firstKey=function(o){return this.limit(1).keys(function(l){return l[0]}).then(o)},Ue.prototype.lastKey=function(o){return this.reverse().firstKey(o)},Ue.prototype.distinct=function(){var o=this._ctx,o=o.index&&o.table.schema.idxByName[o.index];if(!o||!o.multi)return this;var l={};return ai(this._ctx,function(g){var p=g.primaryKey.toString(),g=w(l,p);return l[p]=!0,!g}),this},Ue.prototype.modify=function(o){var l=this,c=this._ctx;return this._write(function(p){var g,b,_;_=typeof o=="function"?o:(g=a(o),b=g.length,function(D){for(var G=!1,Z=0;Z<b;++Z){var X=g[Z],ie=o[X],fe=ce(D,X);ie instanceof wr?(ne(D,X,ie.execute(fe)),G=!0):fe!==ie&&(ne(D,X,ie),G=!0)}return G});var C=c.table.core,L=C.schema.primaryKey,P=L.outbound,I=L.extractKey,F=200,L=l.db._options.modifyChunkSize;L&&(F=typeof L=="object"?L[C.name]||L["*"]||200:L);function H(D,X){var Z=X.failures,X=X.numFailures;B+=D-X;for(var ie=0,fe=a(Z);ie<fe.length;ie++){var ye=fe[ie];q.push(Z[ye])}}var q=[],B=0,K=[];return l.clone().primaryKeys().then(function(D){function G(X){var ie=Math.min(F,D.length-X);return C.getMany({trans:p,keys:D.slice(X,X+ie),cache:"immutable"}).then(function(fe){for(var ye=[],he=[],pe=P?[]:null,xe=[],me=0;me<ie;++me){var Ae=fe[me],Fe={value:R(Ae),primKey:D[X+me]};_.call(Fe,Fe.value,Fe)!==!1&&(Fe.value==null?xe.push(D[X+me]):P||Ke(I(Ae),I(Fe.value))===0?(he.push(Fe.value),P&&pe.push(D[X+me])):(xe.push(D[X+me]),ye.push(Fe.value)))}return Promise.resolve(0<ye.length&&C.mutate({trans:p,type:"add",values:ye}).then(function(He){for(var ze in He.failures)xe.splice(parseInt(ze),1);H(ye.length,He)})).then(function(){return(0<he.length||Z&&typeof o=="object")&&C.mutate({trans:p,type:"put",keys:pe,values:he,criteria:Z,changeSpec:typeof o!="function"&&o,isAdditionalChunk:0<X}).then(function(He){return H(he.length,He)})}).then(function(){return(0<xe.length||Z&&o===Gt)&&C.mutate({trans:p,type:"delete",keys:xe,criteria:Z,isAdditionalChunk:0<X}).then(function(He){return H(xe.length,He)})}).then(function(){return D.length>X+ie&&G(X+F)})})}var Z=Pn(c)&&c.limit===1/0&&(typeof o!="function"||o===Gt)&&{index:c.index,range:c.range};return G(0).then(function(){if(0<q.length)throw new ge("Error modifying one or more objects",q,B,K);return D.length})})})},Ue.prototype.delete=function(){var o=this._ctx,l=o.range;return Pn(o)&&(o.isPrimKey||l.type===3)?this._write(function(c){var p=o.table.core.schema.primaryKey,g=l;return o.table.core.count({trans:c,query:{index:p,range:g}}).then(function(b){return o.table.core.mutate({trans:c,type:"deleteRange",range:g}).then(function(_){var C=_.failures;if(_.lastResult,_.results,_=_.numFailures,_)throw new ge("Could not delete some values",Object.keys(C).map(function(P){return C[P]}),b-_);return b-_})})}):this.modify(Gt)},Ue);function Ue(){}var Gt=function(o,l){return l.value=null};function Ls(o,l){return o<l?-1:o===l?0:1}function cn(o,l){return l<o?-1:o===l?0:1}function xt(o,l,c){return o=o instanceof bt?new o.Collection(o):o,o._ctx.error=new(c||TypeError)(l),o}function ir(o){return new o.Collection(o,function(){return ui("")}).limit(0)}function Dr(o,l,c,p){var g,b,_,C,P,I,F,L=c.length;if(!c.every(function(B){return typeof B=="string"}))return xt(o,Bi);function H(B){g=B==="next"?function(D){return D.toUpperCase()}:function(D){return D.toLowerCase()},b=B==="next"?function(D){return D.toLowerCase()}:function(D){return D.toUpperCase()},_=B==="next"?Ls:cn;var K=c.map(function(D){return{lower:b(D),upper:g(D)}}).sort(function(D,G){return _(D.lower,G.lower)});C=K.map(function(D){return D.upper}),P=K.map(function(D){return D.lower}),F=(I=B)==="next"?"":p}H("next"),o=new o.Collection(o,function(){return fn(C[0],P[L-1]+p)}),o._ondirectionchange=function(B){H(B)};var q=0;return o._addAlgorithm(function(B,K,D){var G=B.key;if(typeof G!="string")return!1;var Z=b(G);if(l(Z,P,q))return!0;for(var X=null,ie=q;ie<L;++ie){var fe=function(ye,he,pe,xe,me,Ae){for(var Fe=Math.min(ye.length,xe.length),He=-1,ze=0;ze<Fe;++ze){var Zt=he[ze];if(Zt!==xe[ze])return me(ye[ze],pe[ze])<0?ye.substr(0,ze)+pe[ze]+pe.substr(ze+1):me(ye[ze],xe[ze])<0?ye.substr(0,ze)+xe[ze]+pe.substr(ze+1):0<=He?ye.substr(0,He)+he[He]+pe.substr(He+1):null;me(ye[ze],Zt)<0&&(He=ze)}return Fe<xe.length&&Ae==="next"?ye+pe.substr(ye.length):Fe<ye.length&&Ae==="prev"?ye.substr(0,pe.length):He<0?null:ye.substr(0,He)+xe[He]+pe.substr(He+1)}(G,Z,C[ie],P[ie],_,I);fe===null&&X===null?q=ie+1:(X===null||0<_(X,fe))&&(X=fe)}return K(X!==null?function(){B.continue(X+F)}:D),!1}),o}function fn(o,l,c,p){return{type:2,lower:o,upper:l,lowerOpen:c,upperOpen:p}}function ui(o){return{type:1,lower:o,upper:o}}var bt=(Object.defineProperty(it.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),it.prototype.between=function(o,l,c,p){c=c!==!1,p=p===!0;try{return 0<this._cmp(o,l)||this._cmp(o,l)===0&&(c||p)&&(!c||!p)?ir(this):new this.Collection(this,function(){return fn(o,l,!c,!p)})}catch{return xt(this,zt)}},it.prototype.equals=function(o){return o==null?xt(this,zt):new this.Collection(this,function(){return ui(o)})},it.prototype.above=function(o){return o==null?xt(this,zt):new this.Collection(this,function(){return fn(o,void 0,!0)})},it.prototype.aboveOrEqual=function(o){return o==null?xt(this,zt):new this.Collection(this,function(){return fn(o,void 0,!1)})},it.prototype.below=function(o){return o==null?xt(this,zt):new this.Collection(this,function(){return fn(void 0,o,!1,!0)})},it.prototype.belowOrEqual=function(o){return o==null?xt(this,zt):new this.Collection(this,function(){return fn(void 0,o)})},it.prototype.startsWith=function(o){return typeof o!="string"?xt(this,Bi):this.between(o,o+kn,!0,!0)},it.prototype.startsWithIgnoreCase=function(o){return o===""?this.startsWith(o):Dr(this,function(l,c){return l.indexOf(c[0])===0},[o],kn)},it.prototype.equalsIgnoreCase=function(o){return Dr(this,function(l,c){return l===c[0]},[o],"")},it.prototype.anyOfIgnoreCase=function(){var o=z.apply(Y,arguments);return o.length===0?ir(this):Dr(this,function(l,c){return c.indexOf(l)!==-1},o,"")},it.prototype.startsWithAnyOfIgnoreCase=function(){var o=z.apply(Y,arguments);return o.length===0?ir(this):Dr(this,function(l,c){return c.some(function(p){return l.indexOf(p)===0})},o,kn)},it.prototype.anyOf=function(){var o=this,l=z.apply(Y,arguments),c=this._cmp;try{l.sort(c)}catch{return xt(this,zt)}if(l.length===0)return ir(this);var p=new this.Collection(this,function(){return fn(l[0],l[l.length-1])});p._ondirectionchange=function(b){c=b==="next"?o._ascending:o._descending,l.sort(c)};var g=0;return p._addAlgorithm(function(b,_,C){for(var P=b.key;0<c(P,l[g]);)if(++g===l.length)return _(C),!1;return c(P,l[g])===0||(_(function(){b.continue(l[g])}),!1)}),p},it.prototype.notEqual=function(o){return this.inAnyRange([[-1/0,o],[o,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},it.prototype.noneOf=function(){var o=z.apply(Y,arguments);if(o.length===0)return new this.Collection(this);try{o.sort(this._ascending)}catch{return xt(this,zt)}var l=o.reduce(function(c,p){return c?c.concat([[c[c.length-1][1],p]]):[[-1/0,p]]},null);return l.push([o[o.length-1],this.db._maxKey]),this.inAnyRange(l,{includeLowers:!1,includeUppers:!1})},it.prototype.inAnyRange=function(G,l){var c=this,p=this._cmp,g=this._ascending,b=this._descending,_=this._min,C=this._max;if(G.length===0)return ir(this);if(!G.every(function(Z){return Z[0]!==void 0&&Z[1]!==void 0&&g(Z[0],Z[1])<=0}))return xt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ae.InvalidArgument);var P=!l||l.includeLowers!==!1,I=l&&l.includeUppers===!0,F,L=g;function H(Z,X){return L(Z[0],X[0])}try{(F=G.reduce(function(Z,X){for(var ie=0,fe=Z.length;ie<fe;++ie){var ye=Z[ie];if(p(X[0],ye[1])<0&&0<p(X[1],ye[0])){ye[0]=_(ye[0],X[0]),ye[1]=C(ye[1],X[1]);break}}return ie===fe&&Z.push(X),Z},[])).sort(H)}catch{return xt(this,zt)}var q=0,B=I?function(Z){return 0<g(Z,F[q][1])}:function(Z){return 0<=g(Z,F[q][1])},K=P?function(Z){return 0<b(Z,F[q][0])}:function(Z){return 0<=b(Z,F[q][0])},D=B,G=new this.Collection(this,function(){return fn(F[0][0],F[F.length-1][1],!P,!I)});return G._ondirectionchange=function(Z){L=Z==="next"?(D=B,g):(D=K,b),F.sort(H)},G._addAlgorithm(function(Z,X,ie){for(var fe,ye=Z.key;D(ye);)if(++q===F.length)return X(ie),!1;return!B(fe=ye)&&!K(fe)||(c._cmp(ye,F[q][1])===0||c._cmp(ye,F[q][0])===0||X(function(){L===g?Z.continue(F[q][0]):Z.continue(F[q][1])}),!1)}),G},it.prototype.startsWithAnyOf=function(){var o=z.apply(Y,arguments);return o.every(function(l){return typeof l=="string"})?o.length===0?ir(this):this.inAnyRange(o.map(function(l){return[l,l+kn]})):xt(this,"startsWithAnyOf() only works with strings")},it);function it(){}function $t(o){return Xe(function(l){return hn(l),o(l.target.error),!1})}function hn(o){o.stopPropagation&&o.stopPropagation(),o.preventDefault&&o.preventDefault()}var qn="storagemutated",sr="x-storagemutated-1",dn=Vt(null,qn),Vi=(Ct.prototype._lock=function(){return de(!_e.global),++this._reculock,this._reculock!==1||_e.global||(_e.lockOwnerFor=this),this},Ct.prototype._unlock=function(){if(de(!_e.global),--this._reculock==0)for(_e.global||(_e.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var o=this._blockedFuncs.shift();try{Ln(o[1],o[0])}catch{}}return this},Ct.prototype._locked=function(){return this._reculock&&_e.lockOwnerFor!==this},Ct.prototype.create=function(o){var l=this;if(!this.mode)return this;var c=this.db.idbdb,p=this.db._state.dbOpenError;if(de(!this.idbtrans),!o&&!c)switch(p&&p.name){case"DatabaseClosedError":throw new ae.DatabaseClosed(p);case"MissingAPIError":throw new ae.MissingAPI(p.message,p);default:throw new ae.OpenFailed(p)}if(!this.active)throw new ae.TransactionInactive;return de(this._completion._state===null),(o=this.idbtrans=o||(this.db.core||c).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Xe(function(g){hn(g),l._reject(o.error)}),o.onabort=Xe(function(g){hn(g),l.active&&l._reject(new ae.Abort(o.error)),l.active=!1,l.on("abort").fire(g)}),o.oncomplete=Xe(function(){l.active=!1,l._resolve(),"mutatedParts"in o&&dn.storagemutated.fire(o.mutatedParts)}),this},Ct.prototype._promise=function(o,l,c){var p=this;if(o==="readwrite"&&this.mode!=="readwrite")return nt(new ae.ReadOnly("Transaction is readonly"));if(!this.active)return nt(new ae.TransactionInactive);if(this._locked())return new ve(function(b,_){p._blockedFuncs.push([function(){p._promise(o,l,c).then(b,_)},_e])});if(c)return an(function(){var b=new ve(function(_,C){p._lock();var P=l(_,C,p);P&&P.then&&P.then(_,C)});return b.finally(function(){return p._unlock()}),b._lib=!0,b});var g=new ve(function(b,_){var C=l(b,_,p);C&&C.then&&C.then(b,_)});return g._lib=!0,g},Ct.prototype._root=function(){return this.parent?this.parent._root():this},Ct.prototype.waitFor=function(o){var l,c=this._root(),p=ve.resolve(o);c._waitingFor?c._waitingFor=c._waitingFor.then(function(){return p}):(c._waitingFor=p,c._waitingQueue=[],l=c.idbtrans.objectStore(c.storeNames[0]),function b(){for(++c._spinCount;c._waitingQueue.length;)c._waitingQueue.shift()();c._waitingFor&&(l.get(-1/0).onsuccess=b)}());var g=c._waitingFor;return new ve(function(b,_){p.then(function(C){return c._waitingQueue.push(Xe(b.bind(null,C)))},function(C){return c._waitingQueue.push(Xe(_.bind(null,C)))}).finally(function(){c._waitingFor===g&&(c._waitingFor=null)})})},Ct.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ae.Abort))},Ct.prototype.table=function(o){var l=this._memoizedTables||(this._memoizedTables={});if(w(l,o))return l[o];var c=this.schema[o];if(!c)throw new ae.NotFound("Table "+o+" not part of transaction");return c=new this.db.Table(o,c,this),c.core=this.db.core.table(o),l[o]=c},Ct);function Ct(){}function Mr(o,l,c,p,g,b,_){return{name:o,keyPath:l,unique:c,multi:p,auto:g,compound:b,src:(c&&!_?"&":"")+(p?"*":"")+(g?"++":"")+Yt(l)}}function Yt(o){return typeof o=="string"?o:o?"["+[].join.call(o,"+")+"]":""}function Br(o,l,c){return{name:o,primKey:l,indexes:c,mappedClass:null,idxByName:(p=function(g){return[g.name,g]},c.reduce(function(g,b,_){return _=p(b,_),_&&(g[_[0]]=_[1]),g},{}))};var p}var In=function(o){try{return o.only([[]]),In=function(){return[[]]},[[]]}catch{return In=function(){return kn},kn}};function ci(o){return o==null?function(){}:typeof o=="string"?(l=o).split(".").length===1?function(c){return c[l]}:function(c){return ce(c,l)}:function(c){return ce(c,o)};var l}function Wi(o){return[].slice.call(o)}var h=0;function v(o){return o==null?":id":typeof o=="string"?o:"[".concat(o.join("+"),"]")}function k(o,l,P){function p(D){if(D.type===3)return null;if(D.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var q=D.lower,B=D.upper,K=D.lowerOpen,D=D.upperOpen;return q===void 0?B===void 0?null:l.upperBound(B,!!D):B===void 0?l.lowerBound(q,!!K):l.bound(q,B,!!K,!!D)}function g(H){var q,B=H.name;return{name:B,schema:H,mutate:function(K){var D=K.trans,G=K.type,Z=K.keys,X=K.values,ie=K.range;return new Promise(function(fe,ye){fe=Xe(fe);var he=D.objectStore(B),pe=he.keyPath==null,xe=G==="put"||G==="add";if(!xe&&G!=="delete"&&G!=="deleteRange")throw new Error("Invalid operation type: "+G);var me,Ae=(Z||X||{length:1}).length;if(Z&&X&&Z.length!==X.length)throw new Error("Given keys array must have same length as given values array.");if(Ae===0)return fe({numFailures:0,failures:{},results:[],lastResult:void 0});function Fe(Dt){++Zt,hn(Dt)}var He=[],ze=[],Zt=0;if(G==="deleteRange"){if(ie.type===4)return fe({numFailures:Zt,failures:ze,results:[],lastResult:void 0});ie.type===3?He.push(me=he.clear()):He.push(me=he.delete(p(ie)))}else{var pe=xe?pe?[X,Z]:[X,null]:[Z,null],De=pe[0],kt=pe[1];if(xe)for(var Rt=0;Rt<Ae;++Rt)He.push(me=kt&&kt[Rt]!==void 0?he[G](De[Rt],kt[Rt]):he[G](De[Rt])),me.onerror=Fe;else for(Rt=0;Rt<Ae;++Rt)He.push(me=he[G](De[Rt])),me.onerror=Fe}function jo(Dt){Dt=Dt.target.result,He.forEach(function(pi,Sl){return pi.error!=null&&(ze[Sl]=pi.error)}),fe({numFailures:Zt,failures:ze,results:G==="delete"?Z:He.map(function(pi){return pi.result}),lastResult:Dt})}me.onerror=function(Dt){Fe(Dt),jo(Dt)},me.onsuccess=jo})},getMany:function(K){var D=K.trans,G=K.keys;return new Promise(function(Z,X){Z=Xe(Z);for(var ie,fe=D.objectStore(B),ye=G.length,he=new Array(ye),pe=0,xe=0,me=function(He){He=He.target,he[He._pos]=He.result,++xe===pe&&Z(he)},Ae=$t(X),Fe=0;Fe<ye;++Fe)G[Fe]!=null&&((ie=fe.get(G[Fe]))._pos=Fe,ie.onsuccess=me,ie.onerror=Ae,++pe);pe===0&&Z(he)})},get:function(K){var D=K.trans,G=K.key;return new Promise(function(Z,X){Z=Xe(Z);var ie=D.objectStore(B).get(G);ie.onsuccess=function(fe){return Z(fe.target.result)},ie.onerror=$t(X)})},query:(q=I,function(K){return new Promise(function(D,G){D=Xe(D);var Z,X,ie,pe=K.trans,fe=K.values,ye=K.limit,me=K.query,he=ye===1/0?void 0:ye,xe=me.index,me=me.range,pe=pe.objectStore(B),xe=xe.isPrimaryKey?pe:pe.index(xe.name),me=p(me);if(ye===0)return D({result:[]});q?((he=fe?xe.getAll(me,he):xe.getAllKeys(me,he)).onsuccess=function(Ae){return D({result:Ae.target.result})},he.onerror=$t(G)):(Z=0,X=!fe&&"openKeyCursor"in xe?xe.openKeyCursor(me):xe.openCursor(me),ie=[],X.onsuccess=function(Ae){var Fe=X.result;return Fe?(ie.push(fe?Fe.value:Fe.primaryKey),++Z===ye?D({result:ie}):void Fe.continue()):D({result:ie})},X.onerror=$t(G))})}),openCursor:function(K){var D=K.trans,G=K.values,Z=K.query,X=K.reverse,ie=K.unique;return new Promise(function(fe,ye){fe=Xe(fe);var xe=Z.index,he=Z.range,pe=D.objectStore(B),pe=xe.isPrimaryKey?pe:pe.index(xe.name),xe=X?ie?"prevunique":"prev":ie?"nextunique":"next",me=!G&&"openKeyCursor"in pe?pe.openKeyCursor(p(he),xe):pe.openCursor(p(he),xe);me.onerror=$t(ye),me.onsuccess=Xe(function(Ae){var Fe,He,ze,Zt,De=me.result;De?(De.___id=++h,De.done=!1,Fe=De.continue.bind(De),He=(He=De.continuePrimaryKey)&&He.bind(De),ze=De.advance.bind(De),Zt=function(){throw new Error("Cursor not stopped")},De.trans=D,De.stop=De.continue=De.continuePrimaryKey=De.advance=function(){throw new Error("Cursor not started")},De.fail=Xe(ye),De.next=function(){var kt=this,Rt=1;return this.start(function(){return Rt--?kt.continue():kt.stop()}).then(function(){return kt})},De.start=function(kt){function Rt(){if(me.result)try{kt()}catch(Dt){De.fail(Dt)}else De.done=!0,De.start=function(){throw new Error("Cursor behind last entry")},De.stop()}var jo=new Promise(function(Dt,pi){Dt=Xe(Dt),me.onerror=$t(pi),De.fail=pi,De.stop=function(Sl){De.stop=De.continue=De.continuePrimaryKey=De.advance=Zt,Dt(Sl)}});return me.onsuccess=Xe(function(Dt){me.onsuccess=Rt,Rt()}),De.continue=Fe,De.continuePrimaryKey=He,De.advance=ze,Rt(),jo},fe(De)):fe(null)},ye)})},count:function(K){var D=K.query,G=K.trans,Z=D.index,X=D.range;return new Promise(function(ie,fe){var ye=G.objectStore(B),he=Z.isPrimaryKey?ye:ye.index(Z.name),ye=p(X),he=ye?he.count(ye):he.count();he.onsuccess=Xe(function(pe){return ie(pe.target.result)}),he.onerror=$t(fe)})}}}var b,_,C,F=(_=P,C=Wi((b=o).objectStoreNames),{schema:{name:b.name,tables:C.map(function(H){return _.objectStore(H)}).map(function(H){var q=H.keyPath,D=H.autoIncrement,B=u(q),K={},D={name:H.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:q==null,compound:B,keyPath:q,autoIncrement:D,unique:!0,extractKey:ci(q)},indexes:Wi(H.indexNames).map(function(G){return H.index(G)}).map(function(ie){var Z=ie.name,X=ie.unique,fe=ie.multiEntry,ie=ie.keyPath,fe={name:Z,compound:u(ie),keyPath:ie,unique:X,multiEntry:fe,extractKey:ci(ie)};return K[v(ie)]=fe}),getIndexByKeyPath:function(G){return K[v(G)]}};return K[":id"]=D.primaryKey,q!=null&&(K[v(q)]=D.primaryKey),D})},hasGetAll:0<C.length&&"getAll"in _.objectStore(C[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),P=F.schema,I=F.hasGetAll,F=P.tables.map(g),L={};return F.forEach(function(H){return L[H.name]=H}),{stack:"dbcore",transaction:o.transaction.bind(o),table:function(H){if(!L[H])throw new Error("Table '".concat(H,"' not found"));return L[H]},MIN_KEY:-1/0,MAX_KEY:In(l),schema:P}}function te(o,l,c,p){var g=c.IDBKeyRange;return c.indexedDB,{dbcore:(p=k(l,g,p),o.dbcore.reduce(function(b,_){return _=_.create,n(n({},b),_(b))},p))}}function Ie(o,p){var c=p.db,p=te(o._middlewares,c,o._deps,p);o.core=p.dbcore,o.tables.forEach(function(g){var b=g.name;o.core.schema.tables.some(function(_){return _.name===b})&&(g.core=o.core.table(b),o[b]instanceof o.Table&&(o[b].core=g.core))})}function Ce(o,l,c,p){c.forEach(function(g){var b=p[g];l.forEach(function(_){var C=function P(I,F){return N(I,F)||(I=d(I))&&P(I,F)}(_,g);(!C||"value"in C&&C.value===void 0)&&(_===o.Transaction.prototype||_ instanceof o.Transaction?S(_,g,{get:function(){return this.table(g)},set:function(P){x(this,g,{value:P,writable:!0,configurable:!0,enumerable:!0})}}):_[g]=new o.Table(g,b))})})}function Ve(o,l){l.forEach(function(c){for(var p in c)c[p]instanceof o.Table&&delete c[p]})}function Ge(o,l){return o._cfg.version-l._cfg.version}function lt(o,l,c,p){var g=o._dbSchema;c.objectStoreNames.contains("$meta")&&!g.$meta&&(g.$meta=Br("$meta",pn("")[0],[]),o._storeNames.push("$meta"));var b=o._createTransaction("readwrite",o._storeNames,g);b.create(c),b._completion.catch(p);var _=b._reject.bind(b),C=_e.transless||_e;an(function(){return _e.trans=b,_e.transless=C,l!==0?(Ie(o,c),I=l,((P=b).storeNames.includes("$meta")?P.table("$meta").get("version").then(function(F){return F??I}):ve.resolve(I)).then(function(F){return H=F,q=b,B=c,K=[],F=(L=o)._versions,D=L._dbSchema=ct(0,L.idbdb,B),(F=F.filter(function(G){return G._cfg.version>=H})).length!==0?(F.forEach(function(G){K.push(function(){var Z=D,X=G._cfg.dbschema;Jt(L,Z,B),Jt(L,X,B),D=L._dbSchema=X;var ie=gt(Z,X);ie.add.forEach(function(xe){vt(B,xe[0],xe[1].primKey,xe[1].indexes)}),ie.change.forEach(function(xe){if(xe.recreate)throw new ae.Upgrade("Not yet support for changing primary key");var me=B.objectStore(xe.name);xe.add.forEach(function(Ae){return dt(me,Ae)}),xe.change.forEach(function(Ae){me.deleteIndex(Ae.name),dt(me,Ae)}),xe.del.forEach(function(Ae){return me.deleteIndex(Ae)})});var fe=G._cfg.contentUpgrade;if(fe&&G._cfg.version>H){Ie(L,B),q._memoizedTables={};var ye=re(X);ie.del.forEach(function(xe){ye[xe]=Z[xe]}),Ve(L,[L.Transaction.prototype]),Ce(L,[L.Transaction.prototype],a(ye),ye),q.schema=ye;var he,pe=$(fe);return pe&&Xn(),ie=ve.follow(function(){var xe;(he=fe(q))&&pe&&(xe=ln.bind(null,null),he.then(xe,xe))}),he&&typeof he.then=="function"?ve.resolve(he):ie.then(function(){return he})}}),K.push(function(Z){var X,ie,fe=G._cfg.dbschema;X=fe,ie=Z,[].slice.call(ie.db.objectStoreNames).forEach(function(ye){return X[ye]==null&&ie.db.deleteObjectStore(ye)}),Ve(L,[L.Transaction.prototype]),Ce(L,[L.Transaction.prototype],L._storeNames,L._dbSchema),q.schema=L._dbSchema}),K.push(function(Z){L.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(L.idbdb.version/10)===G._cfg.version?(L.idbdb.deleteObjectStore("$meta"),delete L._dbSchema.$meta,L._storeNames=L._storeNames.filter(function(X){return X!=="$meta"})):Z.objectStore("$meta").put(G._cfg.version,"version"))})}),function G(){return K.length?ve.resolve(K.shift()(q.idbtrans)).then(G):ve.resolve()}().then(function(){ut(D,B)})):ve.resolve();var L,H,q,B,K,D}).catch(_)):(a(g).forEach(function(F){vt(c,F,g[F].primKey,g[F].indexes)}),Ie(o,c),void ve.follow(function(){return o.on.populate.fire(b)}).catch(_));var P,I})}function Ye(o,l){ut(o._dbSchema,l),l.db.version%10!=0||l.objectStoreNames.contains("$meta")||l.db.createObjectStore("$meta").add(Math.ceil(l.db.version/10-1),"version");var c=ct(0,o.idbdb,l);Jt(o,o._dbSchema,l);for(var p=0,g=gt(c,o._dbSchema).change;p<g.length;p++){var b=function(_){if(_.change.length||_.recreate)return console.warn("Unable to patch indexes of table ".concat(_.name," because it has changes on the type of index or primary key.")),{value:void 0};var C=l.objectStore(_.name);_.add.forEach(function(P){Tt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(_.name,".").concat(P.src)),dt(C,P)})}(g[p]);if(typeof b=="object")return b.value}}function gt(o,l){var c,p={del:[],add:[],change:[]};for(c in o)l[c]||p.del.push(c);for(c in l){var g=o[c],b=l[c];if(g){var _={name:c,def:b,recreate:!1,del:[],add:[],change:[]};if(""+(g.primKey.keyPath||"")!=""+(b.primKey.keyPath||"")||g.primKey.auto!==b.primKey.auto)_.recreate=!0,p.change.push(_);else{var C=g.idxByName,P=b.idxByName,I=void 0;for(I in C)P[I]||_.del.push(I);for(I in P){var F=C[I],L=P[I];F?F.src!==L.src&&_.change.push(L):_.add.push(L)}(0<_.del.length||0<_.add.length||0<_.change.length)&&p.change.push(_)}}else p.add.push([c,b])}return p}function vt(o,l,c,p){var g=o.db.createObjectStore(l,c.keyPath?{keyPath:c.keyPath,autoIncrement:c.auto}:{autoIncrement:c.auto});return p.forEach(function(b){return dt(g,b)}),g}function ut(o,l){a(o).forEach(function(c){l.db.objectStoreNames.contains(c)||(Tt&&console.debug("Dexie: Creating missing table",c),vt(l,c,o[c].primKey,o[c].indexes))})}function dt(o,l){o.createIndex(l.name,l.keyPath,{unique:l.unique,multiEntry:l.multi})}function ct(o,l,c){var p={};return J(l.objectStoreNames,0).forEach(function(g){for(var b=c.objectStore(g),_=Mr(Yt(I=b.keyPath),I||"",!0,!1,!!b.autoIncrement,I&&typeof I!="string",!0),C=[],P=0;P<b.indexNames.length;++P){var F=b.index(b.indexNames[P]),I=F.keyPath,F=Mr(F.name,I,!!F.unique,!!F.multiEntry,!1,I&&typeof I!="string",!1);C.push(F)}p[g]=Br(g,_,C)}),p}function Jt(o,l,c){for(var p=c.db.objectStoreNames,g=0;g<p.length;++g){var b=p[g],_=c.objectStore(b);o._hasGetAll="getAll"in _;for(var C=0;C<_.indexNames.length;++C){var P=_.indexNames[C],I=_.index(P).keyPath,F=typeof I=="string"?I:"["+J(I).join("+")+"]";!l[b]||(I=l[b].idxByName[F])&&(I.name=P,delete l[b].idxByName[F],l[b].idxByName[P]=I)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(o._hasGetAll=!1)}function pn(o){return o.split(",").map(function(l,c){var p=(l=l.trim()).replace(/([&*]|\+\+)/g,""),g=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Mr(p,g||null,/\&/.test(l),/\*/.test(l),/\+\+/.test(l),u(g),c===0)})}var xr=(fi.prototype._parseStoresSpec=function(o,l){a(o).forEach(function(c){if(o[c]!==null){var p=pn(o[c]),g=p.shift();if(g.unique=!0,g.multi)throw new ae.Schema("Primary key cannot be multi-valued");p.forEach(function(b){if(b.auto)throw new ae.Schema("Only primary key can be marked as autoIncrement (++)");if(!b.keyPath)throw new ae.Schema("Index must have a name and cannot be an empty string")}),l[c]=Br(c,g,p)}})},fi.prototype.stores=function(c){var l=this.db;this._cfg.storesSource=this._cfg.storesSource?f(this._cfg.storesSource,c):c;var c=l._versions,p={},g={};return c.forEach(function(b){f(p,b._cfg.storesSource),g=b._cfg.dbschema={},b._parseStoresSpec(p,g)}),l._dbSchema=g,Ve(l,[l._allTables,l,l.Transaction.prototype]),Ce(l,[l._allTables,l,l.Transaction.prototype,this._cfg.tables],a(g),g),l._storeNames=a(g),this},fi.prototype.upgrade=function(o){return this._cfg.contentUpgrade=Vn(this._cfg.contentUpgrade||Se,o),this},fi);function fi(){}function Ur(o,l){var c=o._dbNamesDB;return c||(c=o._dbNamesDB=new Er(Rn,{addons:[],indexedDB:o,IDBKeyRange:l})).version(1).stores({dbnames:"name"}),c.table("dbnames")}function Fr(o){return o&&typeof o.databases=="function"}function hl(o){return an(function(){return _e.letThrough=!0,o()})}function dl(o){return!("from"in o)}var Lt=function(o,l){if(!this){var c=new Lt;return o&&"d"in o&&f(c,o),c}f(this,arguments.length?{d:1,from:o,to:1<arguments.length?l:o}:{d:0})};function ks(o,l,c){var p=Ke(l,c);if(!isNaN(p)){if(0<p)throw RangeError();if(dl(o))return f(o,{from:l,to:c,d:1});var g=o.l,p=o.r;if(Ke(c,o.from)<0)return g?ks(g,l,c):o.l={from:l,to:c,d:1,l:null,r:null},_h(o);if(0<Ke(l,o.to))return p?ks(p,l,c):o.r={from:l,to:c,d:1,l:null,r:null},_h(o);Ke(l,o.from)<0&&(o.from=l,o.l=null,o.d=p?p.d+1:1),0<Ke(c,o.to)&&(o.to=c,o.r=null,o.d=o.l?o.l.d+1:1),c=!o.r,g&&!o.l&&Rs(o,g),p&&c&&Rs(o,p)}}function Rs(o,l){dl(l)||function c(p,P){var b=P.from,_=P.to,C=P.l,P=P.r;ks(p,b,_),C&&c(p,C),P&&c(p,P)}(o,l)}function Th(o,l){var c=Lo(l),p=c.next();if(p.done)return!1;for(var g=p.value,b=Lo(o),_=b.next(g.from),C=_.value;!p.done&&!_.done;){if(Ke(C.from,g.to)<=0&&0<=Ke(C.to,g.from))return!0;Ke(g.from,C.from)<0?g=(p=c.next(C.from)).value:C=(_=b.next(g.from)).value}return!1}function Lo(o){var l=dl(o)?null:{s:0,n:o};return{next:function(c){for(var p=0<arguments.length;l;)switch(l.s){case 0:if(l.s=1,p)for(;l.n.l&&Ke(c,l.n.from)<0;)l={up:l,n:l.n.l,s:1};else for(;l.n.l;)l={up:l,n:l.n.l,s:1};case 1:if(l.s=2,!p||Ke(c,l.n.to)<=0)return{value:l.n,done:!1};case 2:if(l.n.r){l.s=3,l={up:l,n:l.n.r,s:0};continue}case 3:l=l.up}return{done:!0}}}}function _h(o){var l,c,p=(((l=o.r)===null||l===void 0?void 0:l.d)||0)-(((c=o.l)===null||c===void 0?void 0:c.d)||0),g=1<p?"r":p<-1?"l":"";g&&(l=g=="r"?"l":"r",c=n({},o),p=o[g],o.from=p.from,o.to=p.to,o[g]=p[g],c[g]=p[l],(o[l]=c).d=Nh(c)),o.d=Nh(o)}function Nh(c){var l=c.r,c=c.l;return(l?c?Math.max(l.d,c.d):l.d:c?c.d:0)+1}function ko(o,l){return a(l).forEach(function(c){o[c]?Rs(o[c],l[c]):o[c]=function p(g){var b,_,C={};for(b in g)w(g,b)&&(_=g[b],C[b]=!_||typeof _!="object"||A.has(_.constructor)?_:p(_));return C}(l[c])}),o}function pl(o,l){return o.all||l.all||Object.keys(o).some(function(c){return l[c]&&Th(l[c],o[c])})}y(Lt.prototype,((gn={add:function(o){return Rs(this,o),this},addKey:function(o){return ks(this,o,o),this},addKeys:function(o){var l=this;return o.forEach(function(c){return ks(l,c,c)}),this},hasKey:function(o){var l=Lo(this).next(o).value;return l&&Ke(l.from,o)<=0&&0<=Ke(l.to,o)}})[T]=function(){return Lo(this)},gn));var hi={},gl={},ml=!1;function Ro(o){ko(gl,o),ml||(ml=!0,setTimeout(function(){ml=!1,yl(gl,!(gl={}))},0))}function yl(o,l){l===void 0&&(l=!1);var c=new Set;if(o.all)for(var p=0,g=Object.values(hi);p<g.length;p++)Ch(_=g[p],o,c,l);else for(var b in o){var _,C=/^idb\:\/\/(.*)\/(.*)\//.exec(b);C&&(b=C[1],C=C[2],(_=hi["idb://".concat(b,"/").concat(C)])&&Ch(_,o,c,l))}c.forEach(function(P){return P()})}function Ch(o,l,c,p){for(var g=[],b=0,_=Object.entries(o.queries.query);b<_.length;b++){for(var C=_[b],P=C[0],I=[],F=0,L=C[1];F<L.length;F++){var H=L[F];pl(l,H.obsSet)?H.subscribers.forEach(function(D){return c.add(D)}):p&&I.push(H)}p&&g.push([P,I])}if(p)for(var q=0,B=g;q<B.length;q++){var K=B[q],P=K[0],I=K[1];o.queries.query[P]=I}}function Cw(o){var l=o._state,c=o._deps.indexedDB;if(l.isBeingOpened||o.idbdb)return l.dbReadyPromise.then(function(){return l.dbOpenError?nt(l.dbOpenError):o});l.isBeingOpened=!0,l.dbOpenError=null,l.openComplete=!1;var p=l.openCanceller,g=Math.round(10*o.verno),b=!1;function _(){if(l.openCanceller!==p)throw new ae.DatabaseClosed("db.open() was cancelled")}function C(){return new ve(function(H,q){if(_(),!c)throw new ae.MissingAPI;var B=o.name,K=l.autoSchema||!g?c.open(B):c.open(B,g);if(!K)throw new ae.MissingAPI;K.onerror=$t(q),K.onblocked=Xe(o._fireOnBlocked),K.onupgradeneeded=Xe(function(D){var G;F=K.transaction,l.autoSchema&&!o._options.allowEmptyDB?(K.onerror=hn,F.abort(),K.result.close(),(G=c.deleteDatabase(B)).onsuccess=G.onerror=Xe(function(){q(new ae.NoSuchDatabase("Database ".concat(B," doesnt exist")))})):(F.onerror=$t(q),D=D.oldVersion>Math.pow(2,62)?0:D.oldVersion,L=D<1,o.idbdb=K.result,b&&Ye(o,F),lt(o,D/10,F,q))},q),K.onsuccess=Xe(function(){F=null;var D,G,Z,X,ie,fe=o.idbdb=K.result,ye=J(fe.objectStoreNames);if(0<ye.length)try{var he=fe.transaction((X=ye).length===1?X[0]:X,"readonly");if(l.autoSchema)G=fe,Z=he,(D=o).verno=G.version/10,Z=D._dbSchema=ct(0,G,Z),D._storeNames=J(G.objectStoreNames,0),Ce(D,[D._allTables],a(Z),Z);else if(Jt(o,o._dbSchema,he),((ie=gt(ct(0,(ie=o).idbdb,he),ie._dbSchema)).add.length||ie.change.some(function(pe){return pe.add.length||pe.change.length}))&&!b)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),fe.close(),g=fe.version+1,b=!0,H(C());Ie(o,he)}catch{}Qn.push(o),fe.onversionchange=Xe(function(pe){l.vcFired=!0,o.on("versionchange").fire(pe)}),fe.onclose=Xe(function(pe){o.on("close").fire(pe)}),L&&(ie=o._deps,he=B,fe=ie.indexedDB,ie=ie.IDBKeyRange,Fr(fe)||he===Rn||Ur(fe,ie).put({name:he}).catch(Se)),H()},q)}).catch(function(H){switch(H==null?void 0:H.name){case"UnknownError":if(0<l.PR1398_maxLoop)return l.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),C();break;case"VersionError":if(0<g)return g=0,C()}return ve.reject(H)})}var P,I=l.dbReadyResolve,F=null,L=!1;return ve.race([p,(typeof navigator>"u"?ve.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(H){function q(){return indexedDB.databases().finally(H)}P=setInterval(q,100),q()}).finally(function(){return clearInterval(P)}):Promise.resolve()).then(C)]).then(function(){return _(),l.onReadyBeingFired=[],ve.resolve(hl(function(){return o.on.ready.fire(o.vip)})).then(function H(){if(0<l.onReadyBeingFired.length){var q=l.onReadyBeingFired.reduce(Vn,Se);return l.onReadyBeingFired=[],ve.resolve(hl(function(){return q(o.vip)})).then(H)}})}).finally(function(){l.openCanceller===p&&(l.onReadyBeingFired=null,l.isBeingOpened=!1)}).catch(function(H){l.dbOpenError=H;try{F&&F.abort()}catch{}return p===l.openCanceller&&o._close(),nt(H)}).finally(function(){l.openComplete=!0,I()}).then(function(){var H;return L&&(H={},o.tables.forEach(function(q){q.schema.indexes.forEach(function(B){B.name&&(H["idb://".concat(o.name,"/").concat(q.name,"/").concat(B.name)]=new Lt(-1/0,[[[]]]))}),H["idb://".concat(o.name,"/").concat(q.name,"/")]=H["idb://".concat(o.name,"/").concat(q.name,"/:dels")]=new Lt(-1/0,[[[]]])}),dn(qn).fire(H),yl(H,!0)),o})}function bl(o){function l(b){return o.next(b)}var c=g(l),p=g(function(b){return o.throw(b)});function g(b){return function(P){var C=b(P),P=C.value;return C.done?P:P&&typeof P.then=="function"?P.then(c,p):u(P)?Promise.all(P).then(c,p):c(P)}}return g(l)()}function Po(o,l,c){for(var p=u(o)?o.slice():[o],g=0;g<c;++g)p.push(l);return p}var Lw={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(o){return n(n({},o),{table:function(l){var c=o.table(l),p=c.schema,g={},b=[];function _(L,H,q){var B=v(L),K=g[B]=g[B]||[],D=L==null?0:typeof L=="string"?1:L.length,G=0<H,G=n(n({},q),{name:G?"".concat(B,"(virtual-from:").concat(q.name,")"):q.name,lowLevelIndex:q,isVirtual:G,keyTail:H,keyLength:D,extractKey:ci(L),unique:!G&&q.unique});return K.push(G),G.isPrimaryKey||b.push(G),1<D&&_(D===2?L[0]:L.slice(0,D-1),H+1,q),K.sort(function(Z,X){return Z.keyTail-X.keyTail}),G}l=_(p.primaryKey.keyPath,0,p.primaryKey),g[":id"]=[l];for(var C=0,P=p.indexes;C<P.length;C++){var I=P[C];_(I.keyPath,0,I)}function F(L){var H,q=L.query.index;return q.isVirtual?n(n({},L),{query:{index:q.lowLevelIndex,range:(H=L.query.range,q=q.keyTail,{type:H.type===1?2:H.type,lower:Po(H.lower,H.lowerOpen?o.MAX_KEY:o.MIN_KEY,q),lowerOpen:!0,upper:Po(H.upper,H.upperOpen?o.MIN_KEY:o.MAX_KEY,q),upperOpen:!0})}}):L}return n(n({},c),{schema:n(n({},p),{primaryKey:l,indexes:b,getIndexByKeyPath:function(L){return(L=g[v(L)])&&L[0]}}),count:function(L){return c.count(F(L))},query:function(L){return c.query(F(L))},openCursor:function(L){var H=L.query.index,q=H.keyTail,B=H.isVirtual,K=H.keyLength;return B?c.openCursor(F(L)).then(function(G){return G&&D(G)}):c.openCursor(L);function D(G){return Object.create(G,{continue:{value:function(Z){Z!=null?G.continue(Po(Z,L.reverse?o.MAX_KEY:o.MIN_KEY,q)):L.unique?G.continue(G.key.slice(0,K).concat(L.reverse?o.MIN_KEY:o.MAX_KEY,q)):G.continue()}},continuePrimaryKey:{value:function(Z,X){G.continuePrimaryKey(Po(Z,o.MAX_KEY,q),X)}},primaryKey:{get:function(){return G.primaryKey}},key:{get:function(){var Z=G.key;return K===1?Z[0]:Z.slice(0,K)}},value:{get:function(){return G.value}}})}}})}})}};function vl(o,l,c,p){return c=c||{},p=p||"",a(o).forEach(function(g){var b,_,C;w(l,g)?(b=o[g],_=l[g],typeof b=="object"&&typeof _=="object"&&b&&_?(C=E(b))!==E(_)?c[p+g]=l[g]:C==="Object"?vl(b,_,c,p+g+"."):b!==_&&(c[p+g]=l[g]):b!==_&&(c[p+g]=l[g])):c[p+g]=void 0}),a(l).forEach(function(g){w(o,g)||(c[p+g]=l[g])}),c}function wl(o,l){return l.type==="delete"?l.keys:l.keys||l.values.map(o.extractKey)}var kw={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(o){return n(n({},o),{table:function(l){var c=o.table(l),p=c.schema.primaryKey;return n(n({},c),{mutate:function(g){var b=_e.trans,_=b.table(l).hook,C=_.deleting,P=_.creating,I=_.updating;switch(g.type){case"add":if(P.fire===Se)break;return b._promise("readwrite",function(){return F(g)},!0);case"put":if(P.fire===Se&&I.fire===Se)break;return b._promise("readwrite",function(){return F(g)},!0);case"delete":if(C.fire===Se)break;return b._promise("readwrite",function(){return F(g)},!0);case"deleteRange":if(C.fire===Se)break;return b._promise("readwrite",function(){return function L(H,q,B){return c.query({trans:H,values:!1,query:{index:p,range:q},limit:B}).then(function(K){var D=K.result;return F({type:"delete",keys:D,trans:H}).then(function(G){return 0<G.numFailures?Promise.reject(G.failures[0]):D.length<B?{failures:[],numFailures:0,lastResult:void 0}:L(H,n(n({},q),{lower:D[D.length-1],lowerOpen:!0}),B)})})}(g.trans,g.range,1e4)},!0)}return c.mutate(g);function F(L){var H,q,B,K=_e.trans,D=L.keys||wl(p,L);if(!D)throw new Error("Keys missing");return(L=L.type==="add"||L.type==="put"?n(n({},L),{keys:D}):n({},L)).type!=="delete"&&(L.values=i([],L.values)),L.keys&&(L.keys=i([],L.keys)),H=c,B=D,((q=L).type==="add"?Promise.resolve([]):H.getMany({trans:q.trans,keys:B,cache:"immutable"})).then(function(G){var Z=D.map(function(X,ie){var fe,ye,he,pe=G[ie],xe={onerror:null,onsuccess:null};return L.type==="delete"?C.fire.call(xe,X,pe,K):L.type==="add"||pe===void 0?(fe=P.fire.call(xe,X,L.values[ie],K),X==null&&fe!=null&&(L.keys[ie]=X=fe,p.outbound||ne(L.values[ie],p.keyPath,X))):(fe=vl(pe,L.values[ie]),(ye=I.fire.call(xe,fe,X,pe,K))&&(he=L.values[ie],Object.keys(ye).forEach(function(me){w(he,me)?he[me]=ye[me]:ne(he,me,ye[me])}))),xe});return c.mutate(L).then(function(X){for(var ie=X.failures,fe=X.results,ye=X.numFailures,X=X.lastResult,he=0;he<D.length;++he){var pe=(fe||D)[he],xe=Z[he];pe==null?xe.onerror&&xe.onerror(ie[he]):xe.onsuccess&&xe.onsuccess(L.type==="put"&&G[he]?L.values[he]:pe)}return{failures:ie,results:fe,numFailures:ye,lastResult:X}}).catch(function(X){return Z.forEach(function(ie){return ie.onerror&&ie.onerror(X)}),Promise.reject(X)})})}}})}})}};function Lh(o,l,c){try{if(!l||l.keys.length<o.length)return null;for(var p=[],g=0,b=0;g<l.keys.length&&b<o.length;++g)Ke(l.keys[g],o[b])===0&&(p.push(c?R(l.values[g]):l.values[g]),++b);return p.length===o.length?p:null}catch{return null}}var Rw={stack:"dbcore",level:-1,create:function(o){return{table:function(l){var c=o.table(l);return n(n({},c),{getMany:function(p){if(!p.cache)return c.getMany(p);var g=Lh(p.keys,p.trans._cache,p.cache==="clone");return g?ve.resolve(g):c.getMany(p).then(function(b){return p.trans._cache={keys:p.keys,values:p.cache==="clone"?R(b):b},b})},mutate:function(p){return p.type!=="add"&&(p.trans._cache=null),c.mutate(p)}})}}}};function kh(o,l){return o.trans.mode==="readonly"&&!!o.subscr&&!o.trans.explicit&&o.trans.db._options.cache!=="disabled"&&!l.schema.primaryKey.outbound}function Rh(o,l){switch(o){case"query":return l.values&&!l.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Pw={stack:"dbcore",level:0,name:"Observability",create:function(o){var l=o.schema.name,c=new Lt(o.MIN_KEY,o.MAX_KEY);return n(n({},o),{transaction:function(p,g,b){if(_e.subscr&&g!=="readonly")throw new ae.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(_e.querier));return o.transaction(p,g,b)},table:function(p){var g=o.table(p),b=g.schema,_=b.primaryKey,L=b.indexes,C=_.extractKey,P=_.outbound,I=_.autoIncrement&&L.filter(function(q){return q.compound&&q.keyPath.includes(_.keyPath)}),F=n(n({},g),{mutate:function(q){function B(me){return me="idb://".concat(l,"/").concat(p,"/").concat(me),X[me]||(X[me]=new Lt)}var K,D,G,Z=q.trans,X=q.mutatedParts||(q.mutatedParts={}),ie=B(""),fe=B(":dels"),ye=q.type,xe=q.type==="deleteRange"?[q.range]:q.type==="delete"?[q.keys]:q.values.length<50?[wl(_,q).filter(function(me){return me}),q.values]:[],he=xe[0],pe=xe[1],xe=q.trans._cache;return u(he)?(ie.addKeys(he),(xe=ye==="delete"||he.length===pe.length?Lh(he,xe):null)||fe.addKeys(he),(xe||pe)&&(K=B,D=xe,G=pe,b.indexes.forEach(function(me){var Ae=K(me.name||"");function Fe(ze){return ze!=null?me.extractKey(ze):null}function He(ze){return me.multiEntry&&u(ze)?ze.forEach(function(Zt){return Ae.addKey(Zt)}):Ae.addKey(ze)}(D||G).forEach(function(ze,kt){var De=D&&Fe(D[kt]),kt=G&&Fe(G[kt]);Ke(De,kt)!==0&&(De!=null&&He(De),kt!=null&&He(kt))})}))):he?(pe={from:(pe=he.lower)!==null&&pe!==void 0?pe:o.MIN_KEY,to:(pe=he.upper)!==null&&pe!==void 0?pe:o.MAX_KEY},fe.add(pe),ie.add(pe)):(ie.add(c),fe.add(c),b.indexes.forEach(function(me){return B(me.name).add(c)})),g.mutate(q).then(function(me){return!he||q.type!=="add"&&q.type!=="put"||(ie.addKeys(me.results),I&&I.forEach(function(Ae){for(var Fe=q.values.map(function(De){return Ae.extractKey(De)}),He=Ae.keyPath.findIndex(function(De){return De===_.keyPath}),ze=0,Zt=me.results.length;ze<Zt;++ze)Fe[ze][He]=me.results[ze];B(Ae.name).addKeys(Fe)})),Z.mutatedParts=ko(Z.mutatedParts||{},X),me})}}),L=function(B){var K=B.query,B=K.index,K=K.range;return[B,new Lt((B=K.lower)!==null&&B!==void 0?B:o.MIN_KEY,(K=K.upper)!==null&&K!==void 0?K:o.MAX_KEY)]},H={get:function(q){return[_,new Lt(q.key)]},getMany:function(q){return[_,new Lt().addKeys(q.keys)]},count:L,query:L,openCursor:L};return a(H).forEach(function(q){F[q]=function(B){var K=_e.subscr,D=!!K,G=kh(_e,g)&&Rh(q,B)?B.obsSet={}:K;if(D){var Z=function(pe){return pe="idb://".concat(l,"/").concat(p,"/").concat(pe),G[pe]||(G[pe]=new Lt)},X=Z(""),ie=Z(":dels"),K=H[q](B),D=K[0],K=K[1];if((q==="query"&&D.isPrimaryKey&&!B.values?ie:Z(D.name||"")).add(K),!D.isPrimaryKey){if(q!=="count"){var fe=q==="query"&&P&&B.values&&g.query(n(n({},B),{values:!1}));return g[q].apply(this,arguments).then(function(pe){if(q==="query"){if(P&&B.values)return fe.then(function(Fe){return Fe=Fe.result,X.addKeys(Fe),pe});var xe=B.values?pe.result.map(C):pe.result;(B.values?X:ie).addKeys(xe)}else if(q==="openCursor"){var me=pe,Ae=B.values;return me&&Object.create(me,{key:{get:function(){return ie.addKey(me.primaryKey),me.key}},primaryKey:{get:function(){var Fe=me.primaryKey;return ie.addKey(Fe),Fe}},value:{get:function(){return Ae&&X.addKey(me.primaryKey),me.value}}})}return pe})}ie.add(c)}}return g[q].apply(this,arguments)}}),F}})}};function Ph(o,l,c){if(c.numFailures===0)return l;if(l.type==="deleteRange")return null;var p=l.keys?l.keys.length:"values"in l&&l.values?l.values.length:1;return c.numFailures===p?null:(l=n({},l),u(l.keys)&&(l.keys=l.keys.filter(function(g,b){return!(b in c.failures)})),"values"in l&&u(l.values)&&(l.values=l.values.filter(function(g,b){return!(b in c.failures)})),l)}function xl(o,l){return c=o,((p=l).lower===void 0||(p.lowerOpen?0<Ke(c,p.lower):0<=Ke(c,p.lower)))&&(o=o,(l=l).upper===void 0||(l.upperOpen?Ke(o,l.upper)<0:Ke(o,l.upper)<=0));var c,p}function qh(o,l,H,p,g,b){if(!H||H.length===0)return o;var _=l.query.index,C=_.multiEntry,P=l.query.range,I=p.schema.primaryKey.extractKey,F=_.extractKey,L=(_.lowLevelIndex||_).extractKey,H=H.reduce(function(q,B){var K=q,D=[];if(B.type==="add"||B.type==="put")for(var G=new Lt,Z=B.values.length-1;0<=Z;--Z){var X,ie=B.values[Z],fe=I(ie);G.hasKey(fe)||(X=F(ie),(C&&u(X)?X.some(function(me){return xl(me,P)}):xl(X,P))&&(G.addKey(fe),D.push(ie)))}switch(B.type){case"add":var ye=new Lt().addKeys(l.values?q.map(function(Ae){return I(Ae)}):q),K=q.concat(l.values?D.filter(function(Ae){return Ae=I(Ae),!ye.hasKey(Ae)&&(ye.addKey(Ae),!0)}):D.map(function(Ae){return I(Ae)}).filter(function(Ae){return!ye.hasKey(Ae)&&(ye.addKey(Ae),!0)}));break;case"put":var he=new Lt().addKeys(B.values.map(function(Ae){return I(Ae)}));K=q.filter(function(Ae){return!he.hasKey(l.values?I(Ae):Ae)}).concat(l.values?D:D.map(function(Ae){return I(Ae)}));break;case"delete":var pe=new Lt().addKeys(B.keys);K=q.filter(function(Ae){return!pe.hasKey(l.values?I(Ae):Ae)});break;case"deleteRange":var xe=B.range;K=q.filter(function(Ae){return!xl(I(Ae),xe)})}return K},o);return H===o?o:(H.sort(function(q,B){return Ke(L(q),L(B))||Ke(I(q),I(B))}),l.limit&&l.limit<1/0&&(H.length>l.limit?H.length=l.limit:o.length===l.limit&&H.length<l.limit&&(g.dirty=!0)),b?Object.freeze(H):H)}function Ih(o,l){return Ke(o.lower,l.lower)===0&&Ke(o.upper,l.upper)===0&&!!o.lowerOpen==!!l.lowerOpen&&!!o.upperOpen==!!l.upperOpen}function qw(o,l){return function(c,p,g,b){if(c===void 0)return p!==void 0?-1:0;if(p===void 0)return 1;if((p=Ke(c,p))===0){if(g&&b)return 0;if(g)return 1;if(b)return-1}return p}(o.lower,l.lower,o.lowerOpen,l.lowerOpen)<=0&&0<=function(c,p,g,b){if(c===void 0)return p!==void 0?1:0;if(p===void 0)return-1;if((p=Ke(c,p))===0){if(g&&b)return 0;if(g)return-1;if(b)return 1}return p}(o.upper,l.upper,o.upperOpen,l.upperOpen)}function Iw(o,l,c,p){o.subscribers.add(c),p.addEventListener("abort",function(){var g,b;o.subscribers.delete(c),o.subscribers.size===0&&(g=o,b=l,setTimeout(function(){g.subscribers.size===0&&U(b,g)},3e3))})}var jw={stack:"dbcore",level:0,name:"Cache",create:function(o){var l=o.schema.name;return n(n({},o),{transaction:function(c,p,g){var b,_,C=o.transaction(c,p,g);return p==="readwrite"&&(_=(b=new AbortController).signal,g=function(P){return function(){if(b.abort(),p==="readwrite"){for(var I=new Set,F=0,L=c;F<L.length;F++){var H=L[F],q=hi["idb://".concat(l,"/").concat(H)];if(q){var B=o.table(H),K=q.optimisticOps.filter(function(Ae){return Ae.trans===C});if(C._explicit&&P&&C.mutatedParts)for(var D=0,G=Object.values(q.queries.query);D<G.length;D++)for(var Z=0,X=(ye=G[D]).slice();Z<X.length;Z++)pl((he=X[Z]).obsSet,C.mutatedParts)&&(U(ye,he),he.subscribers.forEach(function(Ae){return I.add(Ae)}));else if(0<K.length){q.optimisticOps=q.optimisticOps.filter(function(Ae){return Ae.trans!==C});for(var ie=0,fe=Object.values(q.queries.query);ie<fe.length;ie++)for(var ye,he,pe,xe=0,me=(ye=fe[ie]).slice();xe<me.length;xe++)(he=me[xe]).res!=null&&C.mutatedParts&&(P&&!he.dirty?(pe=Object.isFrozen(he.res),pe=qh(he.res,he.req,K,B,he,pe),he.dirty?(U(ye,he),he.subscribers.forEach(function(Ae){return I.add(Ae)})):pe!==he.res&&(he.res=pe,he.promise=ve.resolve({result:pe}))):(he.dirty&&U(ye,he),he.subscribers.forEach(function(Ae){return I.add(Ae)})))}}}I.forEach(function(Ae){return Ae()})}}},C.addEventListener("abort",g(!1),{signal:_}),C.addEventListener("error",g(!1),{signal:_}),C.addEventListener("complete",g(!0),{signal:_})),C},table:function(c){var p=o.table(c),g=p.schema.primaryKey;return n(n({},p),{mutate:function(b){var _=_e.trans;if(g.outbound||_.db._options.cache==="disabled"||_.explicit||_.idbtrans.mode!=="readwrite")return p.mutate(b);var C=hi["idb://".concat(l,"/").concat(c)];return C?(_=p.mutate(b),b.type!=="add"&&b.type!=="put"||!(50<=b.values.length||wl(g,b).some(function(P){return P==null}))?(C.optimisticOps.push(b),b.mutatedParts&&Ro(b.mutatedParts),_.then(function(P){0<P.numFailures&&(U(C.optimisticOps,b),(P=Ph(0,b,P))&&C.optimisticOps.push(P),b.mutatedParts&&Ro(b.mutatedParts))}),_.catch(function(){U(C.optimisticOps,b),b.mutatedParts&&Ro(b.mutatedParts)})):_.then(function(P){var I=Ph(0,n(n({},b),{values:b.values.map(function(F,L){var H;return P.failures[L]||(F=(H=g.keyPath)!==null&&H!==void 0&&H.includes(".")?R(F):n({},F),ne(F,g.keyPath,P.results[L])),F})}),P);C.optimisticOps.push(I),queueMicrotask(function(){return b.mutatedParts&&Ro(b.mutatedParts)})}),_):p.mutate(b)},query:function(b){if(!kh(_e,p)||!Rh("query",b))return p.query(b);var _=((I=_e.trans)===null||I===void 0?void 0:I.db._options.cache)==="immutable",L=_e,C=L.requery,P=L.signal,I=function(B,K,D,G){var Z=hi["idb://".concat(B,"/").concat(K)];if(!Z)return[];if(!(K=Z.queries[D]))return[null,!1,Z,null];var X=K[(G.query?G.query.index.name:null)||""];if(!X)return[null,!1,Z,null];switch(D){case"query":var ie=X.find(function(fe){return fe.req.limit===G.limit&&fe.req.values===G.values&&Ih(fe.req.query.range,G.query.range)});return ie?[ie,!0,Z,X]:[X.find(function(fe){return("limit"in fe.req?fe.req.limit:1/0)>=G.limit&&(!G.values||fe.req.values)&&qw(fe.req.query.range,G.query.range)}),!1,Z,X];case"count":return ie=X.find(function(fe){return Ih(fe.req.query.range,G.query.range)}),[ie,!!ie,Z,X]}}(l,c,"query",b),F=I[0],L=I[1],H=I[2],q=I[3];return F&&L?F.obsSet=b.obsSet:(L=p.query(b).then(function(B){var K=B.result;if(F&&(F.res=K),_){for(var D=0,G=K.length;D<G;++D)Object.freeze(K[D]);Object.freeze(K)}else B.result=R(K);return B}).catch(function(B){return q&&F&&U(q,F),Promise.reject(B)}),F={obsSet:b.obsSet,promise:L,subscribers:new Set,type:"query",req:b,dirty:!1},q?q.push(F):(q=[F],(H=H||(hi["idb://".concat(l,"/").concat(c)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[b.query.index.name||""]=q)),Iw(F,q,C,P),F.promise.then(function(B){return{result:qh(B.result,b,H==null?void 0:H.optimisticOps,p,F,_)}})}})}})}};function qo(o,l){return new Proxy(o,{get:function(c,p,g){return p==="db"?l:Reflect.get(c,p,g)}})}var Er=(pt.prototype.version=function(o){if(isNaN(o)||o<.1)throw new ae.Type("Given version is not a positive number");if(o=Math.round(10*o)/10,this.idbdb||this._state.isBeingOpened)throw new ae.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,o);var l=this._versions,c=l.filter(function(p){return p._cfg.version===o})[0];return c||(c=new this.Version(o),l.push(c),l.sort(Ge),c.stores({}),this._state.autoSchema=!1,c)},pt.prototype._whenReady=function(o){var l=this;return this.idbdb&&(this._state.openComplete||_e.letThrough||this._vip)?o():new ve(function(c,p){if(l._state.openComplete)return p(new ae.DatabaseClosed(l._state.dbOpenError));if(!l._state.isBeingOpened){if(!l._state.autoOpen)return void p(new ae.DatabaseClosed);l.open().catch(Se)}l._state.dbReadyPromise.then(c,p)}).then(o)},pt.prototype.use=function(o){var l=o.stack,c=o.create,p=o.level,g=o.name;return g&&this.unuse({stack:l,name:g}),o=this._middlewares[l]||(this._middlewares[l]=[]),o.push({stack:l,create:c,level:p??10,name:g}),o.sort(function(b,_){return b.level-_.level}),this},pt.prototype.unuse=function(o){var l=o.stack,c=o.name,p=o.create;return l&&this._middlewares[l]&&(this._middlewares[l]=this._middlewares[l].filter(function(g){return p?g.create!==p:!!c&&g.name!==c})),this},pt.prototype.open=function(){var o=this;return Ln(qt,function(){return Cw(o)})},pt.prototype._close=function(){var o=this._state,l=Qn.indexOf(this);if(0<=l&&Qn.splice(l,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}o.isBeingOpened||(o.dbReadyPromise=new ve(function(c){o.dbReadyResolve=c}),o.openCanceller=new ve(function(c,p){o.cancelOpen=p}))},pt.prototype.close=function(c){var l=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,c=this._state;l?(c.isBeingOpened&&c.cancelOpen(new ae.DatabaseClosed),this._close(),c.autoOpen=!1,c.dbOpenError=new ae.DatabaseClosed):(this._close(),c.autoOpen=this._options.autoOpen||c.isBeingOpened,c.openComplete=!1,c.dbOpenError=null)},pt.prototype.delete=function(o){var l=this;o===void 0&&(o={disableAutoOpen:!0});var c=0<arguments.length&&typeof arguments[0]!="object",p=this._state;return new ve(function(g,b){function _(){l.close(o);var C=l._deps.indexedDB.deleteDatabase(l.name);C.onsuccess=Xe(function(){var P,I,F;P=l._deps,I=l.name,F=P.indexedDB,P=P.IDBKeyRange,Fr(F)||I===Rn||Ur(F,P).delete(I).catch(Se),g()}),C.onerror=$t(b),C.onblocked=l._fireOnBlocked}if(c)throw new ae.InvalidArgument("Invalid closeOptions argument to db.delete()");p.isBeingOpened?p.dbReadyPromise.then(_):_()})},pt.prototype.backendDB=function(){return this.idbdb},pt.prototype.isOpen=function(){return this.idbdb!==null},pt.prototype.hasBeenClosed=function(){var o=this._state.dbOpenError;return o&&o.name==="DatabaseClosed"},pt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},pt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(pt.prototype,"tables",{get:function(){var o=this;return a(this._allTables).map(function(l){return o._allTables[l]})},enumerable:!1,configurable:!0}),pt.prototype.transaction=function(){var o=(function(l,c,p){var g=arguments.length;if(g<2)throw new ae.InvalidArgument("Too few arguments");for(var b=new Array(g-1);--g;)b[g-1]=arguments[g];return p=b.pop(),[l,Ee(b),p]}).apply(this,arguments);return this._transaction.apply(this,o)},pt.prototype._transaction=function(o,l,c){var p=this,g=_e.trans;g&&g.db===this&&o.indexOf("!")===-1||(g=null);var b,_,C=o.indexOf("?")!==-1;o=o.replace("!","").replace("?","");try{if(_=l.map(function(I){if(I=I instanceof p.Table?I.name:I,typeof I!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return I}),o=="r"||o===qr)b=qr;else{if(o!="rw"&&o!=er)throw new ae.InvalidArgument("Invalid transaction mode: "+o);b=er}if(g){if(g.mode===qr&&b===er){if(!C)throw new ae.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");g=null}g&&_.forEach(function(I){if(g&&g.storeNames.indexOf(I)===-1){if(!C)throw new ae.SubTransaction("Table "+I+" not included in parent transaction.");g=null}}),C&&g&&!g.active&&(g=null)}}catch(I){return g?g._promise(null,function(F,L){L(I)}):nt(I)}var P=(function I(F,L,H,q,B){return ve.resolve().then(function(){var K=_e.transless||_e,D=F._createTransaction(L,H,F._dbSchema,q);if(D.explicit=!0,K={trans:D,transless:K},q)D.idbtrans=q.idbtrans;else try{D.create(),D.idbtrans._explicit=!0,F._state.PR1398_maxLoop=3}catch(X){return X.name===Be.InvalidState&&F.isOpen()&&0<--F._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),F.close({disableAutoOpen:!1}),F.open().then(function(){return I(F,L,H,null,B)})):nt(X)}var G,Z=$(B);return Z&&Xn(),K=ve.follow(function(){var X;(G=B.call(D,D))&&(Z?(X=ln.bind(null,null),G.then(X,X)):typeof G.next=="function"&&typeof G.throw=="function"&&(G=bl(G)))},K),(G&&typeof G.then=="function"?ve.resolve(G).then(function(X){return D.active?X:nt(new ae.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):K.then(function(){return G})).then(function(X){return q&&D._resolve(),D._completion.then(function(){return X})}).catch(function(X){return D._reject(X),nt(X)})})}).bind(null,this,b,_,g,c);return g?g._promise(b,P,"lock"):_e.trans?Ln(_e.transless,function(){return p._whenReady(P)}):this._whenReady(P)},pt.prototype.table=function(o){if(!w(this._allTables,o))throw new ae.InvalidTable("Table ".concat(o," does not exist"));return this._allTables[o]},pt);function pt(o,l){var c=this;this._middlewares={},this.verno=0;var p=pt.dependencies;this._options=l=n({addons:pt.addons,autoOpen:!0,indexedDB:p.indexedDB,IDBKeyRange:p.IDBKeyRange,cache:"cloned"},l),this._deps={indexedDB:l.indexedDB,IDBKeyRange:l.IDBKeyRange},p=l.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var g,b,_,C,P,I={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Se,dbReadyPromise:null,cancelOpen:Se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:l.autoOpen};I.dbReadyPromise=new ve(function(L){I.dbReadyResolve=L}),I.openCanceller=new ve(function(L,H){I.cancelOpen=H}),this._state=I,this.name=o,this.on=Vt(this,"populate","blocked","versionchange","close",{ready:[Vn,Se]}),this.on.ready.subscribe=Q(this.on.ready.subscribe,function(L){return function(H,q){pt.vip(function(){var B,K=c._state;K.openComplete?(K.dbOpenError||ve.resolve().then(H),q&&L(H)):K.onReadyBeingFired?(K.onReadyBeingFired.push(H),q&&L(H)):(L(H),B=c,q||L(function D(){B.on.ready.unsubscribe(H),B.on.ready.unsubscribe(D)}))})}}),this.Collection=(g=this,tr(Wt.prototype,function(G,D){this.db=g;var q=Ir,B=null;if(D)try{q=D()}catch(Z){B=Z}var K=G._ctx,D=K.table,G=D.hook.reading.fire;this._ctx={table:D,index:K.index,isPrimKey:!K.index||D.schema.primKey.keyPath&&K.index===D.schema.primKey.name,range:q,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:B,or:K.or,valueMapper:G!==$e?G:null}})),this.Table=(b=this,tr(vr.prototype,function(L,H,q){this.db=b,this._tx=q,this.name=L,this.schema=H,this.hook=b._allTables[L]?b._allTables[L].hook:Vt(null,{creating:[Tn,Se],reading:[Qe,$e],updating:[hr,Se],deleting:[zn,Se]})})),this.Transaction=(_=this,tr(Vi.prototype,function(L,H,q,B,K){var D=this;this.db=_,this.mode=L,this.storeNames=H,this.schema=q,this.chromeTransactionDurability=B,this.idbtrans=null,this.on=Vt(this,"complete","error","abort"),this.parent=K||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ve(function(G,Z){D._resolve=G,D._reject=Z}),this._completion.then(function(){D.active=!1,D.on.complete.fire()},function(G){var Z=D.active;return D.active=!1,D.on.error.fire(G),D.parent?D.parent._reject(G):Z&&D.idbtrans&&D.idbtrans.abort(),nt(G)})})),this.Version=(C=this,tr(xr.prototype,function(L){this.db=C,this._cfg={version:L,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(P=this,tr(bt.prototype,function(L,H,q){if(this.db=P,this._ctx={table:L,index:H===":id"?null:H,or:q},this._cmp=this._ascending=Ke,this._descending=function(B,K){return Ke(K,B)},this._max=function(B,K){return 0<Ke(B,K)?B:K},this._min=function(B,K){return Ke(B,K)<0?B:K},this._IDBKeyRange=P._deps.IDBKeyRange,!this._IDBKeyRange)throw new ae.MissingAPI})),this.on("versionchange",function(L){0<L.newVersion?console.warn("Another connection wants to upgrade database '".concat(c.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(c.name,"'. Closing db now to resume the delete request.")),c.close({disableAutoOpen:!1})}),this.on("blocked",function(L){!L.newVersion||L.newVersion<L.oldVersion?console.warn("Dexie.delete('".concat(c.name,"') was blocked")):console.warn("Upgrade '".concat(c.name,"' blocked by other connection holding version ").concat(L.oldVersion/10))}),this._maxKey=In(l.IDBKeyRange),this._createTransaction=function(L,H,q,B){return new c.Transaction(L,H,q,c._options.chromeTransactionDurability,B)},this._fireOnBlocked=function(L){c.on("blocked").fire(L),Qn.filter(function(H){return H.name===c.name&&H!==c&&!H._state.vcFired}).map(function(H){return H.on("versionchange").fire(L)})},this.use(Rw),this.use(jw),this.use(Pw),this.use(Lw),this.use(kw);var F=new Proxy(this,{get:function(L,H,q){if(H==="_vip")return!0;if(H==="table")return function(K){return qo(c.table(K),F)};var B=Reflect.get(L,H,q);return B instanceof vr?qo(B,F):H==="tables"?B.map(function(K){return qo(K,F)}):H==="_createTransaction"?function(){return qo(B.apply(this,arguments),F)}:B}});this.vip=F,p.forEach(function(L){return L(c)})}var Io,gn=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",$w=(El.prototype.subscribe=function(o,l,c){return this._subscribe(o&&typeof o!="function"?o:{next:o,error:l,complete:c})},El.prototype[gn]=function(){return this},El);function El(o){this._subscribe=o}try{Io={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{Io={indexedDB:null,IDBKeyRange:null}}function jh(o){var l,c=!1,p=new $w(function(g){var b=$(o),_,C=!1,P={},I={},F={get closed(){return C},unsubscribe:function(){C||(C=!0,_&&_.abort(),L&&dn.storagemutated.unsubscribe(q))}};g.start&&g.start(F);var L=!1,H=function(){return mt(B)},q=function(K){ko(P,K),pl(I,P)&&H()},B=function(){var K,D,G;!C&&Io.indexedDB&&(P={},K={},_&&_.abort(),_=new AbortController,G=function(Z){var X=jt();try{b&&Xn();var ie=an(o,Z);return ie=b?ie.finally(ln):ie}finally{X&&Cn()}}(D={subscr:K,signal:_.signal,requery:H,querier:o,trans:null}),Promise.resolve(G).then(function(Z){c=!0,l=Z,C||D.signal.aborted||(P={},function(X){for(var ie in X)if(w(X,ie))return;return 1}(I=K)||L||(dn(qn,q),L=!0),mt(function(){return!C&&g.next&&g.next(Z)}))},function(Z){c=!1,["DatabaseClosedError","AbortError"].includes(Z==null?void 0:Z.name)||C||mt(function(){C||g.error&&g.error(Z)})}))};return setTimeout(H,0),F});return p.hasValue=function(){return c},p.getValue=function(){return l},p}var di=Er;function Ol(o){var l=Kr;try{Kr=!0,dn.storagemutated.fire(o),yl(o,!0)}finally{Kr=l}}y(di,n(n({},qe),{delete:function(o){return new di(o,{addons:[]}).delete()},exists:function(o){return new di(o,{addons:[]}).open().then(function(l){return l.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(o){try{return l=di.dependencies,c=l.indexedDB,l=l.IDBKeyRange,(Fr(c)?Promise.resolve(c.databases()).then(function(p){return p.map(function(g){return g.name}).filter(function(g){return g!==Rn})}):Ur(c,l).toCollection().primaryKeys()).then(o)}catch{return nt(new ae.MissingAPI)}var l,c},defineClass:function(){return function(o){f(this,o)}},ignoreTransaction:function(o){return _e.trans?Ln(_e.transless,o):o()},vip:hl,async:function(o){return function(){try{var l=bl(o.apply(this,arguments));return l&&typeof l.then=="function"?l:ve.resolve(l)}catch(c){return nt(c)}}},spawn:function(o,l,c){try{var p=bl(o.apply(c,l||[]));return p&&typeof p.then=="function"?p:ve.resolve(p)}catch(g){return nt(g)}},currentTransaction:{get:function(){return _e.trans||null}},waitFor:function(o,l){return l=ve.resolve(typeof o=="function"?di.ignoreTransaction(o):o).timeout(l||6e4),_e.trans?_e.trans.waitFor(l):l},Promise:ve,debug:{get:function(){return Tt},set:function(o){ii(o)}},derive:O,extend:f,props:y,override:Q,Events:Vt,on:dn,liveQuery:jh,extendObservabilitySet:ko,getByKeyPath:ce,setByKeyPath:ne,delByKeyPath:function(o,l){typeof l=="string"?ne(o,l,void 0):"length"in l&&[].map.call(l,function(c){ne(o,c,void 0)})},shallowClone:re,deepClone:R,getObjectDiff:vl,cmp:Ke,asap:ue,minKey:-1/0,addons:[],connections:Qn,errnames:Be,dependencies:Io,cache:hi,semVer:"4.0.11",version:"4.0.11".split(".").map(function(o){return parseInt(o)}).reduce(function(o,l,c){return o+l/Math.pow(10,2*c)})})),di.maxKey=In(di.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(dn(qn,function(o){Kr||(o=new CustomEvent(sr,{detail:o}),Kr=!0,dispatchEvent(o),Kr=!1)}),addEventListener(sr,function(o){o=o.detail,Kr||Ol(o)}));var Gi,Kr=!1,$h=function(){};return typeof BroadcastChannel<"u"&&(($h=function(){(Gi=new BroadcastChannel(sr)).onmessage=function(o){return o.data&&Ol(o.data)}})(),typeof Gi.unref=="function"&&Gi.unref(),dn(qn,function(o){Kr||Gi.postMessage(o)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(o){if(!Er.disableBfCache&&o.persisted){Tt&&console.debug("Dexie: handling persisted pagehide"),Gi!=null&&Gi.close();for(var l=0,c=Qn;l<c.length;l++)c[l].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(o){!Er.disableBfCache&&o.persisted&&(Tt&&console.debug("Dexie: handling persisted pageshow"),$h(),Ol({all:new Lt(-1/0,[[]])}))})),ve.rejectionMapper=function(o,l){return!o||o instanceof le||o instanceof TypeError||o instanceof SyntaxError||!o.name||!ke[o.name]?o:(l=new ke[o.name](l||o.message,o),"stack"in o&&S(l,"stack",{get:function(){return this.inner.stack}}),l)},ii(Tt),n(Er,Object.freeze({__proto__:null,Dexie:Er,liveQuery:jh,Entity:Ui,cmp:Ke,PropModification:wr,replacePrefix:function(o,l){return new wr({replacePrefix:[o,l]})},add:function(o){return new wr({add:o})},remove:function(o){return new wr({remove:o})},default:Er,RangeSet:Lt,mergeRanges:Rs,rangesOverlap:Th}),{default:Er}),Er})}(za)),za.exports}var E0=x0();const Va=qi(E0),Tf=Symbol.for("Dexie"),go=globalThis[Tf]||(globalThis[Tf]=Va);if(Va.semVer!==go.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Va.semVer} and ${go.semVer}`);const{liveQuery:wx,mergeRanges:xx,rangesOverlap:Ex,RangeSet:Ox,cmp:Sx,Entity:Ax,PropModification:Tx,replacePrefix:_x,add:Nx,remove:Cx}=go;class O0 extends go{constructor(){super("db"),Sf(this,"rows"),this.version(1).stores({rows:"++id, key"})}}new O0;var Wa={exports:{}},S0=Wa.exports,_f;function A0(){return _f||(_f=1,function(r,e){(function(t,n){r.exports=n()})(S0,function(){var t=1e3,n=6e4,i=36e5,s="millisecond",a="second",u="minute",f="hour",d="day",m="week",w="month",y="quarter",x="year",S="date",O="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,J={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(V){var E=["th","st","nd","rd"],T=V%100;return"["+V+(E[(T-20)%10]||E[T]||E[0])+"]"}},Q=function(V,E,T){var j=String(V);return!j||j.length>=E?V:""+Array(E+1-j.length).join(T)+V},de={s:Q,z:function(V){var E=-V.utcOffset(),T=Math.abs(E),j=Math.floor(T/60),U=T%60;return(E<=0?"+":"-")+Q(j,2,"0")+":"+Q(U,2,"0")},m:function V(E,T){if(E.date()<T.date())return-V(T,E);var j=12*(T.year()-E.year())+(T.month()-E.month()),U=E.clone().add(j,w),Y=T-U<0,z=E.clone().add(j+(Y?-1:1),w);return+(-(j+(T-U)/(Y?U-z:z-U))||0)},a:function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},p:function(V){return{M:w,y:x,w:m,d,D:S,h:f,m:u,s:a,ms:s,Q:y}[V]||String(V||"").toLowerCase().replace(/s$/,"")},u:function(V){return V===void 0}},ue="en",ce={};ce[ue]=J;var ne="$isDayjsObject",re=function(V){return V instanceof W||!(!V||!V[ne])},we=function V(E,T,j){var U;if(!E)return ue;if(typeof E=="string"){var Y=E.toLowerCase();ce[Y]&&(U=Y),T&&(ce[Y]=T,U=Y);var z=E.split("-");if(!U&&z.length>1)return V(z[0])}else{var $=E.name;ce[$]=E,U=$}return!j&&U&&(ue=U),U||!j&&ue},Ee=function(V,E){if(re(V))return V.clone();var T=typeof E=="object"?E:{};return T.date=V,T.args=arguments,new W(T)},A=de;A.l=we,A.i=re,A.w=function(V,E){return Ee(V,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var W=function(){function V(T){this.$L=we(T.locale,null,!0),this.parse(T),this.$x=this.$x||T.x||{},this[ne]=!0}var E=V.prototype;return E.parse=function(T){this.$d=function(j){var U=j.date,Y=j.utc;if(U===null)return new Date(NaN);if(A.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var z=U.match(N);if(z){var $=z[2]-1||0,se=(z[7]||"0").substring(0,3);return Y?new Date(Date.UTC(z[1],$,z[3]||1,z[4]||0,z[5]||0,z[6]||0,se)):new Date(z[1],$,z[3]||1,z[4]||0,z[5]||0,z[6]||0,se)}}return new Date(U)}(T),this.init()},E.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},E.$utils=function(){return A},E.isValid=function(){return this.$d.toString()!==O},E.isSame=function(T,j){var U=Ee(T);return this.startOf(j)<=U&&U<=this.endOf(j)},E.isAfter=function(T,j){return Ee(T)<this.startOf(j)},E.isBefore=function(T,j){return this.endOf(j)<Ee(T)},E.$g=function(T,j,U){return A.u(T)?this[j]:this.set(U,T)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(T,j){var U=this,Y=!!A.u(j)||j,z=A.p(T),$=function(ae,ke){var qe=A.w(U.$u?Date.UTC(U.$y,ke,ae):new Date(U.$y,ke,ae),U);return Y?qe:qe.endOf(d)},se=function(ae,ke){return A.w(U.toDate()[ae].apply(U.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(ke)),U)},le=this.$W,be=this.$M,ge=this.$D,Pe="set"+(this.$u?"UTC":"");switch(z){case x:return Y?$(1,0):$(31,11);case w:return Y?$(1,be):$(0,be+1);case m:var Be=this.$locale().weekStart||0,Re=(le<Be?le+7:le)-Be;return $(Y?ge-Re:ge+(6-Re),be);case d:case S:return se(Pe+"Hours",0);case f:return se(Pe+"Minutes",1);case u:return se(Pe+"Seconds",2);case a:return se(Pe+"Milliseconds",3);default:return this.clone()}},E.endOf=function(T){return this.startOf(T,!1)},E.$set=function(T,j){var U,Y=A.p(T),z="set"+(this.$u?"UTC":""),$=(U={},U[d]=z+"Date",U[S]=z+"Date",U[w]=z+"Month",U[x]=z+"FullYear",U[f]=z+"Hours",U[u]=z+"Minutes",U[a]=z+"Seconds",U[s]=z+"Milliseconds",U)[Y],se=Y===d?this.$D+(j-this.$W):j;if(Y===w||Y===x){var le=this.clone().set(S,1);le.$d[$](se),le.init(),this.$d=le.set(S,Math.min(this.$D,le.daysInMonth())).$d}else $&&this.$d[$](se);return this.init(),this},E.set=function(T,j){return this.clone().$set(T,j)},E.get=function(T){return this[A.p(T)]()},E.add=function(T,j){var U,Y=this;T=Number(T);var z=A.p(j),$=function(be){var ge=Ee(Y);return A.w(ge.date(ge.date()+Math.round(be*T)),Y)};if(z===w)return this.set(w,this.$M+T);if(z===x)return this.set(x,this.$y+T);if(z===d)return $(1);if(z===m)return $(7);var se=(U={},U[u]=n,U[f]=i,U[a]=t,U)[z]||1,le=this.$d.getTime()+T*se;return A.w(le,this)},E.subtract=function(T,j){return this.add(-1*T,j)},E.format=function(T){var j=this,U=this.$locale();if(!this.isValid())return U.invalidDate||O;var Y=T||"YYYY-MM-DDTHH:mm:ssZ",z=A.z(this),$=this.$H,se=this.$m,le=this.$M,be=U.weekdays,ge=U.months,Pe=U.meridiem,Be=function(ke,qe,Se,$e){return ke&&(ke[qe]||ke(j,Y))||Se[qe].slice(0,$e)},Re=function(ke){return A.s($%12||12,ke,"0")},ae=Pe||function(ke,qe,Se){var $e=ke<12?"AM":"PM";return Se?$e.toLowerCase():$e};return Y.replace(M,function(ke,qe){return qe||function(Se){switch(Se){case"YY":return String(j.$y).slice(-2);case"YYYY":return A.s(j.$y,4,"0");case"M":return le+1;case"MM":return A.s(le+1,2,"0");case"MMM":return Be(U.monthsShort,le,ge,3);case"MMMM":return Be(ge,le);case"D":return j.$D;case"DD":return A.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return Be(U.weekdaysMin,j.$W,be,2);case"ddd":return Be(U.weekdaysShort,j.$W,be,3);case"dddd":return be[j.$W];case"H":return String($);case"HH":return A.s($,2,"0");case"h":return Re(1);case"hh":return Re(2);case"a":return ae($,se,!0);case"A":return ae($,se,!1);case"m":return String(se);case"mm":return A.s(se,2,"0");case"s":return String(j.$s);case"ss":return A.s(j.$s,2,"0");case"SSS":return A.s(j.$ms,3,"0");case"Z":return z}return null}(ke)||z.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(T,j,U){var Y,z=this,$=A.p(j),se=Ee(T),le=(se.utcOffset()-this.utcOffset())*n,be=this-se,ge=function(){return A.m(z,se)};switch($){case x:Y=ge()/12;break;case w:Y=ge();break;case y:Y=ge()/3;break;case m:Y=(be-le)/6048e5;break;case d:Y=(be-le)/864e5;break;case f:Y=be/i;break;case u:Y=be/n;break;case a:Y=be/t;break;default:Y=be}return U?Y:A.a(Y)},E.daysInMonth=function(){return this.endOf(w).$D},E.$locale=function(){return ce[this.$L]},E.locale=function(T,j){if(!T)return this.$L;var U=this.clone(),Y=we(T,j,!0);return Y&&(U.$L=Y),U},E.clone=function(){return A.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},V}(),R=W.prototype;return Ee.prototype=R,[["$ms",s],["$s",a],["$m",u],["$H",f],["$W",d],["$M",w],["$y",x],["$D",S]].forEach(function(V){R[V[1]]=function(E){return this.$g(E,V[0],V[1])}}),Ee.extend=function(V,E){return V.$i||(V(E,W,Ee),V.$i=!0),Ee},Ee.locale=we,Ee.isDayjs=re,Ee.unix=function(V){return Ee(1e3*V)},Ee.en=ce[ue],Ee.Ls=ce,Ee.p={},Ee})}(Wa)),Wa.exports}var T0=A0();const Ga=qi(T0);var Ya={exports:{}},_0=Ya.exports,Nf;function N0(){return Nf||(Nf=1,function(r,e){(function(t,n){r.exports=n()})(_0,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,f={},d=function(N){return(N=+N)+(N>68?1900:2e3)},m=function(N){return function(M){this[N]=+M}},w=[/[+-]\d\d:?(\d\d)?|Z/,function(N){(this.zone||(this.zone={})).offset=function(M){if(!M||M==="Z")return 0;var J=M.match(/([+-]|\d\d)/g),Q=60*J[1]+(+J[2]||0);return Q===0?0:J[0]==="+"?-Q:Q}(N)}],y=function(N){var M=f[N];return M&&(M.indexOf?M:M.s.concat(M.f))},x=function(N,M){var J,Q=f.meridiem;if(Q){for(var de=1;de<=24;de+=1)if(N.indexOf(Q(de,0,M))>-1){J=de>12;break}}else J=N===(M?"pm":"PM");return J},S={A:[u,function(N){this.afternoon=x(N,!1)}],a:[u,function(N){this.afternoon=x(N,!0)}],Q:[i,function(N){this.month=3*(N-1)+1}],S:[i,function(N){this.milliseconds=100*+N}],SS:[s,function(N){this.milliseconds=10*+N}],SSS:[/\d{3}/,function(N){this.milliseconds=+N}],s:[a,m("seconds")],ss:[a,m("seconds")],m:[a,m("minutes")],mm:[a,m("minutes")],H:[a,m("hours")],h:[a,m("hours")],HH:[a,m("hours")],hh:[a,m("hours")],D:[a,m("day")],DD:[s,m("day")],Do:[u,function(N){var M=f.ordinal,J=N.match(/\d+/);if(this.day=J[0],M)for(var Q=1;Q<=31;Q+=1)M(Q).replace(/\[|\]/g,"")===N&&(this.day=Q)}],w:[a,m("week")],ww:[s,m("week")],M:[a,m("month")],MM:[s,m("month")],MMM:[u,function(N){var M=y("months"),J=(y("monthsShort")||M.map(function(Q){return Q.slice(0,3)})).indexOf(N)+1;if(J<1)throw new Error;this.month=J%12||J}],MMMM:[u,function(N){var M=y("months").indexOf(N)+1;if(M<1)throw new Error;this.month=M%12||M}],Y:[/[+-]?\d+/,m("year")],YY:[s,function(N){this.year=d(N)}],YYYY:[/\d{4}/,m("year")],Z:w,ZZ:w};function O(N){var M,J;M=N,J=f&&f.formats;for(var Q=(N=M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Ee,A,W){var R=W&&W.toUpperCase();return A||J[W]||t[W]||J[R].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(V,E,T){return E||T.slice(1)})})).match(n),de=Q.length,ue=0;ue<de;ue+=1){var ce=Q[ue],ne=S[ce],re=ne&&ne[0],we=ne&&ne[1];Q[ue]=we?{regex:re,parser:we}:ce.replace(/^\[|\]$/g,"")}return function(Ee){for(var A={},W=0,R=0;W<de;W+=1){var V=Q[W];if(typeof V=="string")R+=V.length;else{var E=V.regex,T=V.parser,j=Ee.slice(R),U=E.exec(j)[0];T.call(A,U),Ee=Ee.replace(U,"")}}return function(Y){var z=Y.afternoon;if(z!==void 0){var $=Y.hours;z?$<12&&(Y.hours+=12):$===12&&(Y.hours=0),delete Y.afternoon}}(A),A}}return function(N,M,J){J.p.customParseFormat=!0,N&&N.parseTwoDigitYear&&(d=N.parseTwoDigitYear);var Q=M.prototype,de=Q.parse;Q.parse=function(ue){var ce=ue.date,ne=ue.utc,re=ue.args;this.$u=ne;var we=re[1];if(typeof we=="string"){var Ee=re[2]===!0,A=re[3]===!0,W=Ee||A,R=re[2];A&&(R=re[2]),f=this.$locale(),!Ee&&R&&(f=J.Ls[R]),this.$d=function(j,U,Y,z){try{if(["x","X"].indexOf(U)>-1)return new Date((U==="X"?1e3:1)*j);var $=O(U)(j),se=$.year,le=$.month,be=$.day,ge=$.hours,Pe=$.minutes,Be=$.seconds,Re=$.milliseconds,ae=$.zone,ke=$.week,qe=new Date,Se=be||(se||le?1:qe.getDate()),$e=se||qe.getFullYear(),Qe=0;se&&!le||(Qe=le>0?le-1:qe.getMonth());var Ze,Tn=ge||0,zn=Pe||0,hr=Be||0,dr=Re||0;return ae?new Date(Date.UTC($e,Qe,Se,Tn,zn,hr,dr+60*ae.offset*1e3)):Y?new Date(Date.UTC($e,Qe,Se,Tn,zn,hr,dr)):(Ze=new Date($e,Qe,Se,Tn,zn,hr,dr),ke&&(Ze=z(Ze).week(ke).toDate()),Ze)}catch{return new Date("")}}(ce,we,ne,J),this.init(),R&&R!==!0&&(this.$L=this.locale(R).$L),W&&ce!=this.format(we)&&(this.$d=new Date("")),f={}}else if(we instanceof Array)for(var V=we.length,E=1;E<=V;E+=1){re[1]=we[E-1];var T=J.apply(this,re);if(T.isValid()){this.$d=T.$d,this.$L=T.$L,this.init();break}E===V&&(this.$d=new Date(""))}else de.call(this,ue)}}})}(Ya)),Ya.exports}var C0=N0();const L0=qi(C0);var Ja={exports:{}},k0=Ja.exports,Cf;function R0(){return Cf||(Cf=1,function(r,e){(function(t,n){r.exports=n()})(k0,function(){var t,n,i=1e3,s=6e4,a=36e5,u=864e5,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=31536e6,m=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,y={years:d,months:m,days:u,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},x=function(ce){return ce instanceof de},S=function(ce,ne,re){return new de(ce,re,ne.$l)},O=function(ce){return n.p(ce)+"s"},N=function(ce){return ce<0},M=function(ce){return N(ce)?Math.ceil(ce):Math.floor(ce)},J=function(ce){return Math.abs(ce)},Q=function(ce,ne){return ce?N(ce)?{negative:!0,format:""+J(ce)+ne}:{negative:!1,format:""+ce+ne}:{negative:!1,format:""}},de=function(){function ce(re,we,Ee){var A=this;if(this.$d={},this.$l=Ee,re===void 0&&(this.$ms=0,this.parseFromMilliseconds()),we)return S(re*y[O(we)],this);if(typeof re=="number")return this.$ms=re,this.parseFromMilliseconds(),this;if(typeof re=="object")return Object.keys(re).forEach(function(V){A.$d[O(V)]=re[V]}),this.calMilliseconds(),this;if(typeof re=="string"){var W=re.match(w);if(W){var R=W.slice(2).map(function(V){return V!=null?Number(V):0});return this.$d.years=R[0],this.$d.months=R[1],this.$d.weeks=R[2],this.$d.days=R[3],this.$d.hours=R[4],this.$d.minutes=R[5],this.$d.seconds=R[6],this.calMilliseconds(),this}}return this}var ne=ce.prototype;return ne.calMilliseconds=function(){var re=this;this.$ms=Object.keys(this.$d).reduce(function(we,Ee){return we+(re.$d[Ee]||0)*y[Ee]},0)},ne.parseFromMilliseconds=function(){var re=this.$ms;this.$d.years=M(re/d),re%=d,this.$d.months=M(re/m),re%=m,this.$d.days=M(re/u),re%=u,this.$d.hours=M(re/a),re%=a,this.$d.minutes=M(re/s),re%=s,this.$d.seconds=M(re/i),re%=i,this.$d.milliseconds=re},ne.toISOString=function(){var re=Q(this.$d.years,"Y"),we=Q(this.$d.months,"M"),Ee=+this.$d.days||0;this.$d.weeks&&(Ee+=7*this.$d.weeks);var A=Q(Ee,"D"),W=Q(this.$d.hours,"H"),R=Q(this.$d.minutes,"M"),V=this.$d.seconds||0;this.$d.milliseconds&&(V+=this.$d.milliseconds/1e3,V=Math.round(1e3*V)/1e3);var E=Q(V,"S"),T=re.negative||we.negative||A.negative||W.negative||R.negative||E.negative,j=W.format||R.format||E.format?"T":"",U=(T?"-":"")+"P"+re.format+we.format+A.format+j+W.format+R.format+E.format;return U==="P"||U==="-P"?"P0D":U},ne.toJSON=function(){return this.toISOString()},ne.format=function(re){var we=re||"YYYY-MM-DDTHH:mm:ss",Ee={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return we.replace(f,function(A,W){return W||String(Ee[A])})},ne.as=function(re){return this.$ms/y[O(re)]},ne.get=function(re){var we=this.$ms,Ee=O(re);return Ee==="milliseconds"?we%=1e3:we=Ee==="weeks"?M(we/y[Ee]):this.$d[Ee],we||0},ne.add=function(re,we,Ee){var A;return A=we?re*y[O(we)]:x(re)?re.$ms:S(re,this).$ms,S(this.$ms+A*(Ee?-1:1),this)},ne.subtract=function(re,we){return this.add(re,we,!0)},ne.locale=function(re){var we=this.clone();return we.$l=re,we},ne.clone=function(){return S(this.$ms,this)},ne.humanize=function(re){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!re)},ne.valueOf=function(){return this.asMilliseconds()},ne.milliseconds=function(){return this.get("milliseconds")},ne.asMilliseconds=function(){return this.as("milliseconds")},ne.seconds=function(){return this.get("seconds")},ne.asSeconds=function(){return this.as("seconds")},ne.minutes=function(){return this.get("minutes")},ne.asMinutes=function(){return this.as("minutes")},ne.hours=function(){return this.get("hours")},ne.asHours=function(){return this.as("hours")},ne.days=function(){return this.get("days")},ne.asDays=function(){return this.as("days")},ne.weeks=function(){return this.get("weeks")},ne.asWeeks=function(){return this.as("weeks")},ne.months=function(){return this.get("months")},ne.asMonths=function(){return this.as("months")},ne.years=function(){return this.get("years")},ne.asYears=function(){return this.as("years")},ce}(),ue=function(ce,ne,re){return ce.add(ne.years()*re,"y").add(ne.months()*re,"M").add(ne.days()*re,"d").add(ne.hours()*re,"h").add(ne.minutes()*re,"m").add(ne.seconds()*re,"s").add(ne.milliseconds()*re,"ms")};return function(ce,ne,re){t=re,n=re().$utils(),re.duration=function(A,W){var R=re.locale();return S(A,{$l:R},W)},re.isDuration=x;var we=ne.prototype.add,Ee=ne.prototype.subtract;ne.prototype.add=function(A,W){return x(A)?ue(this,A,1):we.bind(this)(A,W)},ne.prototype.subtract=function(A,W){return x(A)?ue(this,A,-1):Ee.bind(this)(A,W)}}})}(Ja)),Ja.exports}var P0=R0();const q0=qi(P0);var Za={exports:{}},I0=Za.exports,Lf;function j0(){return Lf||(Lf=1,function(r,e){(function(t,n){r.exports=n()})(I0,function(){var t="minute",n=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,a,u){var f=a.prototype;u.utc=function(O){var N={date:O,utc:!0,args:arguments};return new a(N)},f.utc=function(O){var N=u(this.toDate(),{locale:this.$L,utc:!0});return O?N.add(this.utcOffset(),t):N},f.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var d=f.parse;f.parse=function(O){O.utc&&(this.$u=!0),this.$utils().u(O.$offset)||(this.$offset=O.$offset),d.call(this,O)};var m=f.init;f.init=function(){if(this.$u){var O=this.$d;this.$y=O.getUTCFullYear(),this.$M=O.getUTCMonth(),this.$D=O.getUTCDate(),this.$W=O.getUTCDay(),this.$H=O.getUTCHours(),this.$m=O.getUTCMinutes(),this.$s=O.getUTCSeconds(),this.$ms=O.getUTCMilliseconds()}else m.call(this)};var w=f.utcOffset;f.utcOffset=function(O,N){var M=this.$utils().u;if(M(O))return this.$u?0:M(this.$offset)?w.call(this):this.$offset;if(typeof O=="string"&&(O=function(ue){ue===void 0&&(ue="");var ce=ue.match(n);if(!ce)return null;var ne=(""+ce[0]).match(i)||["-",0,0],re=ne[0],we=60*+ne[1]+ +ne[2];return we===0?0:re==="+"?we:-we}(O),O===null))return this;var J=Math.abs(O)<=16?60*O:O,Q=this;if(N)return Q.$offset=J,Q.$u=O===0,Q;if(O!==0){var de=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(Q=this.local().add(J+de,t)).$offset=J,Q.$x.$localOffset=de}else Q=this.utc();return Q};var y=f.format;f.format=function(O){var N=O||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,N)},f.valueOf=function(){var O=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*O},f.isUTC=function(){return!!this.$u},f.toISOString=function(){return this.toDate().toISOString()},f.toString=function(){return this.toDate().toUTCString()};var x=f.toDate;f.toDate=function(O){return O==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():x.call(this)};var S=f.diff;f.diff=function(O,N,M){if(O&&this.$u===O.$u)return S.call(this,O,N,M);var J=this.local(),Q=u(O).local();return S.call(J,Q,N,M)}}})}(Za)),Za.exports}var $0=j0();const D0=qi($0);Ga.extend(L0),Ga.extend(q0),Ga.extend(D0);var mo={},yo={},Xa,kf;function Rf(){if(kf)return Xa;kf=1,Xa=r;function r(t,n){if(n!=="$")for(var i=e(n),s=0;s<i.length;s++)n=i[s].toString().replace(/\\"/g,'"'),!(typeof t[n]>"u"&&s!==i.length-1)&&(t=t[n]);return t}function e(t){for(var n=/(?:\.(\w+))|(?:\[(\d+)\])|(?:\["((?:[^\\"]|\\.)*)"\])/g,i=[],s;s=n.exec(t);)i.push(s[1]||s[2]||s[3]);return i}return Xa}var xs={},Pf;function M0(){if(Pf)return xs;Pf=1;var r=Rf(),e=jf();return xs.getRegexFlags=function(t){var n="";return t.ignoreCase&&(n+="i"),t.global&&(n+="g"),t.multiline&&(n+="m"),n},xs.stringifyFunction=function(t,n){if(typeof n=="function")return n(t);var i=t.toString(),s=i.match(/^[^{]*{|^[^=]*=>/),a=s?s[0]:"<function> ",u=i[i.length-1]==="}"?"}":"";return a.replace(/\r\n|\n/g," ").replace(/\s+/g," ")+" /* ... */ "+u},xs.restore=function(t,n){var i=t[0],s=t.slice(1);switch(i){case"$":return r(n,t);case"r":var a=s.indexOf(","),u=s.slice(0,a),f=s.slice(a+1);return RegExp(f,u);case"d":return new Date(+s);case"f":var d=function(){throw new Error("can't run jsan parsed function")};return d.toString=function(){return s},d;case"u":return;case"e":var m=new Error(s);return m.stack="Stack is unavailable for jsan parsed errors",m;case"s":return Symbol(s);case"g":return Symbol.for(s);case"m":return new Map(e.parse(s));case"l":return new Set(e.parse(s));case"n":return NaN;case"i":return 1/0;case"y":return-1/0;default:return console.warn("unknown type",t),t}},xs}var qf;function B0(){if(qf)return yo;qf=1,Rf();var r=M0(),e=typeof WeakMap<"u"?WeakMap:function(){var t=[],n=[];return{set:function(i,s){t.push(i),n.push(s)},get:function(i){for(var s=0;s<t.length;s++)if(t[s]===i)return n[s]}}};return yo.decycle=function t(n,i,s,a){a=a||new e;var u=!Object.prototype.hasOwnProperty.call(i,"circular"),f=i.refs!==!1;return function d(m,w,y){var x,S,O,N=typeof s=="function"?s(y||"",m):m;if(i.date&&N instanceof Date)return{$jsan:"d"+N.getTime()};if(i.regex&&N instanceof RegExp)return{$jsan:"r"+r.getRegexFlags(N)+","+N.source};if(i.function&&typeof N=="function")return{$jsan:"f"+r.stringifyFunction(N,i.function)};if(i.nan&&typeof N=="number"&&isNaN(N))return{$jsan:"n"};if(i.infinity){if(Number.POSITIVE_INFINITY===N)return{$jsan:"i"};if(Number.NEGATIVE_INFINITY===N)return{$jsan:"y"}}if(i.undefined&&N===void 0)return{$jsan:"u"};if(i.error&&N instanceof Error)return{$jsan:"e"+N.message};if(i.symbol&&typeof N=="symbol"){var M=Symbol.keyFor(N);return M!==void 0?{$jsan:"g"+M}:{$jsan:"s"+N.toString().slice(7,-1)}}if(i.map&&typeof Map=="function"&&N instanceof Map&&typeof Array.from=="function")return{$jsan:"m"+JSON.stringify(t(Array.from(N),i,s,a))};if(i.set&&typeof Set=="function"&&N instanceof Set&&typeof Array.from=="function")return{$jsan:"l"+JSON.stringify(t(Array.from(N),i,s,a))};if(N&&typeof N.toJSON=="function")try{N=N.toJSON(y)}catch{var J=y||"$";return"toJSON failed for '"+(a.get(N)||J)+"'"}if(typeof N=="object"&&N!==null&&!(N instanceof Boolean)&&!(N instanceof Date)&&!(N instanceof Number)&&!(N instanceof RegExp)&&!(N instanceof String)&&typeof N!="symbol"&&!(N instanceof Error)){if(typeof N=="object"){var Q=a.get(N);if(Q){if(u&&f)return{$jsan:Q};var de=w.split(".").slice(0,-1).join(".");if(de.indexOf(Q)===0)return u?{$jsan:Q}:typeof i.circular=="function"?i.circular(N,w,Q):i.circular;if(f)return{$jsan:Q}}a.set(N,w)}if(Object.prototype.toString.apply(N)==="[object Array]")for(O=[],x=0;x<N.length;x+=1)O[x]=d(N[x],w+"["+x+"]",x);else{O={};for(S in N)if(Object.prototype.hasOwnProperty.call(N,S)){var ue=/^\w+$/.test(S)?"."+S:"["+JSON.stringify(S)+"]";O[S]=S==="$jsan"?[d(N[S],w+ue)]:d(N[S],w+ue,S)}}return O}return N}(n,"$")},yo.retrocycle=function(t){return function n(i){var s,a,u;if(i&&typeof i=="object")if(Object.prototype.toString.apply(i)==="[object Array]")for(s=0;s<i.length;s+=1)a=i[s],a&&typeof a=="object"&&(a.$jsan?i[s]=r.restore(a.$jsan,t):n(a));else for(u in i){if(typeof i[u]=="string"&&u==="$jsan")return r.restore(i.$jsan,t);u==="$jsan"&&(i[u]=i[u][0]),typeof i[u]=="object"&&(a=i[u],a&&typeof a=="object"&&(a.$jsan?i[u]=r.restore(a.$jsan,t):n(a)))}return i}(t)},yo}var If;function jf(){if(If)return mo;If=1;var r=B0();return mo.stringify=function(e,t,n,i){if(arguments.length<4)try{return arguments.length===1?JSON.stringify(e):JSON.stringify.apply(JSON,arguments)}catch{}var s=i||!1;typeof s=="boolean"&&(s={date:s,function:s,regex:s,undefined:s,error:s,symbol:s,map:s,set:s,nan:s,infinity:s});var a=r.decycle(e,s,t);return arguments.length===1?JSON.stringify(a):JSON.stringify(a,Array.isArray(t)?t:null,n)},mo.parse=function(e,t){var n=/"\$jsan"/.test(e),i;return arguments.length===1?i=JSON.parse(e):i=JSON.parse(e,t),n&&(i=r.retrocycle(i)),i},mo}var $f,Df;function U0(){return Df||(Df=1,$f=jf()),$f}var F0=U0();const Mf=qi(F0),K0=(r=null,e,t,n=!0)=>Mf.stringify(r,e,t,n),H0=(r,e)=>Mf.parse(r,e);function Bf(r,e){return function(){return r.apply(e,arguments)}}const{toString:z0}=Object.prototype,{getPrototypeOf:Qa}=Object,bo=(r=>e=>{const t=z0.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Sn=r=>(r=r.toLowerCase(),e=>bo(e)===r),vo=r=>e=>typeof e===r,{isArray:Ii}=Array,Es=vo("undefined");function V0(r){return r!==null&&!Es(r)&&r.constructor!==null&&!Es(r.constructor)&&Ft(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Uf=Sn("ArrayBuffer");function W0(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Uf(r.buffer),e}const G0=vo("string"),Ft=vo("function"),Ff=vo("number"),wo=r=>r!==null&&typeof r=="object",Y0=r=>r===!0||r===!1,xo=r=>{if(bo(r)!=="object")return!1;const e=Qa(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},J0=Sn("Date"),Z0=Sn("File"),X0=Sn("Blob"),Q0=Sn("FileList"),ev=r=>wo(r)&&Ft(r.pipe),tv=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Ft(r.append)&&((e=bo(r))==="formdata"||e==="object"&&Ft(r.toString)&&r.toString()==="[object FormData]"))},nv=Sn("URLSearchParams"),[rv,iv,sv,ov]=["ReadableStream","Request","Response","Headers"].map(Sn),av=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Os(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),Ii(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{const s=t?Object.getOwnPropertyNames(r):Object.keys(r),a=s.length;let u;for(n=0;n<a;n++)u=s[n],e.call(null,r[u],u,r)}}function Kf(r,e){e=e.toLowerCase();const t=Object.keys(r);let n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}const ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Hf=r=>!Es(r)&&r!==ti;function el(){const{caseless:r}=Hf(this)&&this||{},e={},t=(n,i)=>{const s=r&&Kf(e,i)||i;xo(e[s])&&xo(n)?e[s]=el(e[s],n):xo(n)?e[s]=el({},n):Ii(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Os(arguments[n],t);return e}const lv=(r,e,t,{allOwnKeys:n}={})=>(Os(e,(i,s)=>{t&&Ft(i)?r[s]=Bf(i,t):r[s]=i},{allOwnKeys:n}),r),uv=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),cv=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},fv=(r,e,t,n)=>{let i,s,a;const u={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)a=i[s],(!n||n(a,r,e))&&!u[a]&&(e[a]=r[a],u[a]=!0);r=t!==!1&&Qa(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},hv=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},dv=r=>{if(!r)return null;if(Ii(r))return r;let e=r.length;if(!Ff(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},pv=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Qa(Uint8Array)),gv=(r,e)=>{const t=(r&&r[Symbol.iterator]).call(r);let n;for(;(n=t.next())&&!n.done;){const i=n.value;e.call(r,i[0],i[1])}},mv=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},yv=Sn("HTMLFormElement"),bv=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),zf=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),vv=Sn("RegExp"),Vf=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};Os(t,(i,s)=>{let a;(a=e(i,s,r))!==!1&&(n[s]=a||i)}),Object.defineProperties(r,n)},wv=r=>{Vf(r,(e,t)=>{if(Ft(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(Ft(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},xv=(r,e)=>{const t={},n=i=>{i.forEach(s=>{t[s]=!0})};return Ii(r)?n(r):n(String(r).split(e)),t},Ev=()=>{},Ov=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function Sv(r){return!!(r&&Ft(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const Av=r=>{const e=new Array(10),t=(n,i)=>{if(wo(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const s=Ii(n)?[]:{};return Os(n,(a,u)=>{const f=t(a,i+1);!Es(f)&&(s[u]=f)}),e[i]=void 0,s}}return n};return t(r,0)},Tv=Sn("AsyncFunction"),_v=r=>r&&(wo(r)||Ft(r))&&Ft(r.then)&&Ft(r.catch),Wf=((r,e)=>r?setImmediate:e?((t,n)=>(ti.addEventListener("message",({source:i,data:s})=>{i===ti&&s===t&&n.length&&n.shift()()},!1),i=>{n.push(i),ti.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Ft(ti.postMessage)),Nv=typeof queueMicrotask<"u"?queueMicrotask.bind(ti):typeof process<"u"&&process.nextTick||Wf,ee={isArray:Ii,isArrayBuffer:Uf,isBuffer:V0,isFormData:tv,isArrayBufferView:W0,isString:G0,isNumber:Ff,isBoolean:Y0,isObject:wo,isPlainObject:xo,isReadableStream:rv,isRequest:iv,isResponse:sv,isHeaders:ov,isUndefined:Es,isDate:J0,isFile:Z0,isBlob:X0,isRegExp:vv,isFunction:Ft,isStream:ev,isURLSearchParams:nv,isTypedArray:pv,isFileList:Q0,forEach:Os,merge:el,extend:lv,trim:av,stripBOM:uv,inherits:cv,toFlatObject:fv,kindOf:bo,kindOfTest:Sn,endsWith:hv,toArray:dv,forEachEntry:gv,matchAll:mv,isHTMLForm:yv,hasOwnProperty:zf,hasOwnProp:zf,reduceDescriptors:Vf,freezeMethods:wv,toObjectSet:xv,toCamelCase:bv,noop:Ev,toFiniteNumber:Ov,findKey:Kf,global:ti,isContextDefined:Hf,isSpecCompliantForm:Sv,toJSONObject:Av,isAsyncFn:Tv,isThenable:_v,setImmediate:Wf,asap:Nv};function Me(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}ee.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ee.toJSONObject(this.config),code:this.code,status:this.status}}});const Gf=Me.prototype,Yf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Yf[r]={value:r}}),Object.defineProperties(Me,Yf),Object.defineProperty(Gf,"isAxiosError",{value:!0}),Me.from=(r,e,t,n,i,s)=>{const a=Object.create(Gf);return ee.toFlatObject(r,a,function(u){return u!==Error.prototype},u=>u!=="isAxiosError"),Me.call(a,r.message,e,t,n,i),a.cause=r,a.name=r.name,s&&Object.assign(a,s),a};const Cv=null;function tl(r){return ee.isPlainObject(r)||ee.isArray(r)}function Jf(r){return ee.endsWith(r,"[]")?r.slice(0,-2):r}function Zf(r,e,t){return r?r.concat(e).map(function(n,i){return n=Jf(n),!t&&i?"["+n+"]":n}).join(t?".":""):e}function Lv(r){return ee.isArray(r)&&!r.some(tl)}const kv=ee.toFlatObject(ee,{},null,function(r){return/^is[A-Z]/.test(r)});function Eo(r,e,t){if(!ee.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=ee.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,S){return!ee.isUndefined(S[x])});const n=t.metaTokens,i=t.visitor||d,s=t.dots,a=t.indexes,u=(t.Blob||typeof Blob<"u"&&Blob)&&ee.isSpecCompliantForm(e);if(!ee.isFunction(i))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(ee.isDate(x))return x.toISOString();if(!u&&ee.isBlob(x))throw new Me("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(x)||ee.isTypedArray(x)?u&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function d(x,S,O){let N=x;if(x&&!O&&typeof x=="object"){if(ee.endsWith(S,"{}"))S=n?S:S.slice(0,-2),x=JSON.stringify(x);else if(ee.isArray(x)&&Lv(x)||(ee.isFileList(x)||ee.endsWith(S,"[]"))&&(N=ee.toArray(x)))return S=Jf(S),N.forEach(function(M,J){!(ee.isUndefined(M)||M===null)&&e.append(a===!0?Zf([S],J,s):a===null?S:S+"[]",f(M))}),!1}return tl(x)?!0:(e.append(Zf(O,S,s),f(x)),!1)}const m=[],w=Object.assign(kv,{defaultVisitor:d,convertValue:f,isVisitable:tl});function y(x,S){if(!ee.isUndefined(x)){if(m.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));m.push(x),ee.forEach(x,function(O,N){(!(ee.isUndefined(O)||O===null)&&i.call(e,O,ee.isString(N)?N.trim():N,S,w))===!0&&y(O,S?S.concat(N):[N])}),m.pop()}}if(!ee.isObject(r))throw new TypeError("data must be an object");return y(r),e}function Xf(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function nl(r,e){this._pairs=[],r&&Eo(r,this,e)}const Qf=nl.prototype;Qf.append=function(r,e){this._pairs.push([r,e])},Qf.toString=function(r){const e=r?function(t){return r.call(this,t,Xf)}:Xf;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};function Rv(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function eh(r,e,t){if(!e)return r;const n=t&&t.encode||Rv;ee.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let s;if(i?s=i(e,t):s=ee.isURLSearchParams(e)?e.toString():new nl(e,t).toString(n),s){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}class th{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ee.forEach(this.handlers,function(t){t!==null&&e(t)})}}const nh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pv=typeof URLSearchParams<"u"?URLSearchParams:nl,qv=typeof FormData<"u"?FormData:null,Iv=typeof Blob<"u"?Blob:null,jv={isBrowser:!0,classes:{URLSearchParams:Pv,FormData:qv,Blob:Iv},protocols:["http","https","file","blob","url","data"]},rl=typeof window<"u"&&typeof document<"u",il=typeof navigator=="object"&&navigator||void 0,$v=rl&&(!il||["ReactNative","NativeScript","NS"].indexOf(il.product)<0),Dv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Mv=rl&&window.location.href||"http://localhost",Bv=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:rl,hasStandardBrowserEnv:$v,hasStandardBrowserWebWorkerEnv:Dv,navigator:il,origin:Mv},Symbol.toStringTag,{value:"Module"})),At={...Bv,...jv};function Uv(r,e){return Eo(r,new At.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,s){return At.isNode&&ee.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Fv(r){return ee.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Kv(r){const e={},t=Object.keys(r);let n;const i=t.length;let s;for(n=0;n<i;n++)s=t[n],e[s]=r[s];return e}function rh(r){function e(t,n,i,s){let a=t[s++];if(a==="__proto__")return!0;const u=Number.isFinite(+a),f=s>=t.length;return a=!a&&ee.isArray(i)?i.length:a,f?(ee.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!u):((!i[a]||!ee.isObject(i[a]))&&(i[a]=[]),e(t,n,i[a],s)&&ee.isArray(i[a])&&(i[a]=Kv(i[a])),!u)}if(ee.isFormData(r)&&ee.isFunction(r.entries)){const t={};return ee.forEachEntry(r,(n,i)=>{e(Fv(n),i,t,0)}),t}return null}function Hv(r,e,t){if(ee.isString(r))try{return(e||JSON.parse)(r),ee.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const Ss={transitional:nh,adapter:["xhr","http","fetch"],transformRequest:[function(r,e){const t=e.getContentType()||"",n=t.indexOf("application/json")>-1,i=ee.isObject(r);if(i&&ee.isHTMLForm(r)&&(r=new FormData(r)),ee.isFormData(r))return n?JSON.stringify(rh(r)):r;if(ee.isArrayBuffer(r)||ee.isBuffer(r)||ee.isStream(r)||ee.isFile(r)||ee.isBlob(r)||ee.isReadableStream(r))return r;if(ee.isArrayBufferView(r))return r.buffer;if(ee.isURLSearchParams(r))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let s;if(i){if(t.indexOf("application/x-www-form-urlencoded")>-1)return Uv(r,this.formSerializer).toString();if((s=ee.isFileList(r))||t.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return Eo(s?{"files[]":r}:r,a&&new a,this.formSerializer)}}return i||n?(e.setContentType("application/json",!1),Hv(r)):r}],transformResponse:[function(r){const e=this.transitional||Ss.transitional,t=e&&e.forcedJSONParsing,n=this.responseType==="json";if(ee.isResponse(r)||ee.isReadableStream(r))return r;if(r&&ee.isString(r)&&(t&&!this.responseType||n)){const i=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(r)}catch(s){if(i)throw s.name==="SyntaxError"?Me.from(s,Me.ERR_BAD_RESPONSE,this,null,this.response):s}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:At.classes.FormData,Blob:At.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],r=>{Ss.headers[r]={}});const zv=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vv=r=>{const e={};let t,n,i;return r&&r.split(`
73
- `).forEach(function(s){i=s.indexOf(":"),t=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!t||e[t]&&zv[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},ih=Symbol("internals");function As(r){return r&&String(r).trim().toLowerCase()}function Oo(r){return r===!1||r==null?r:ee.isArray(r)?r.map(Oo):String(r)}function Wv(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}const Gv=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function sl(r,e,t,n,i){if(ee.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!ee.isString(e)){if(ee.isString(n))return e.indexOf(n)!==-1;if(ee.isRegExp(n))return n.test(e)}}function Yv(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Jv(r,e){const t=ee.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(i,s,a){return this[n].call(this,e,i,s,a)},configurable:!0})})}let Mt=class{constructor(r){r&&this.set(r)}set(r,e,t){const n=this;function i(a,u,f){const d=As(u);if(!d)throw new Error("header name must be a non-empty string");const m=ee.findKey(n,d);(!m||n[m]===void 0||f===!0||f===void 0&&n[m]!==!1)&&(n[m||u]=Oo(a))}const s=(a,u)=>ee.forEach(a,(f,d)=>i(f,d,u));if(ee.isPlainObject(r)||r instanceof this.constructor)s(r,e);else if(ee.isString(r)&&(r=r.trim())&&!Gv(r))s(Vv(r),e);else if(ee.isHeaders(r))for(const[a,u]of r.entries())i(u,a,t);else r!=null&&i(e,r,t);return this}get(r,e){if(r=As(r),r){const t=ee.findKey(this,r);if(t){const n=this[t];if(!e)return n;if(e===!0)return Wv(n);if(ee.isFunction(e))return e.call(this,n,t);if(ee.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,e){if(r=As(r),r){const t=ee.findKey(this,r);return!!(t&&this[t]!==void 0&&(!e||sl(this,this[t],t,e)))}return!1}delete(r,e){const t=this;let n=!1;function i(s){if(s=As(s),s){const a=ee.findKey(t,s);a&&(!e||sl(t,t[a],a,e))&&(delete t[a],n=!0)}}return ee.isArray(r)?r.forEach(i):i(r),n}clear(r){const e=Object.keys(this);let t=e.length,n=!1;for(;t--;){const i=e[t];(!r||sl(this,this[i],i,r,!0))&&(delete this[i],n=!0)}return n}normalize(r){const e=this,t={};return ee.forEach(this,(n,i)=>{const s=ee.findKey(t,i);if(s){e[s]=Oo(n),delete e[i];return}const a=r?Yv(i):String(i).trim();a!==i&&delete e[i],e[a]=Oo(n),t[a]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const e=Object.create(null);return ee.forEach(this,(t,n)=>{t!=null&&t!==!1&&(e[n]=r&&ee.isArray(t)?t.join(", "):t)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,e])=>r+": "+e).join(`
74
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...e){const t=new this(r);return e.forEach(n=>t.set(n)),t}static accessor(r){const e=(this[ih]=this[ih]={accessors:{}}).accessors,t=this.prototype;function n(i){const s=As(i);e[s]||(Jv(t,i),e[s]=!0)}return ee.isArray(r)?r.forEach(n):n(r),this}};Mt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ee.reduceDescriptors(Mt.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}}),ee.freezeMethods(Mt);function ol(r,e){const t=this||Ss,n=e||t,i=Mt.from(n.headers);let s=n.data;return ee.forEach(r,function(a){s=a.call(t,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function sh(r){return!!(r&&r.__CANCEL__)}function ji(r,e,t){Me.call(this,r??"canceled",Me.ERR_CANCELED,e,t),this.name="CanceledError"}ee.inherits(ji,Me,{__CANCEL__:!0});function oh(r,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new Me("Request failed with status code "+t.status,[Me.ERR_BAD_REQUEST,Me.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Zv(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function Xv(r,e){r=r||10;const t=new Array(r),n=new Array(r);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(u){const f=Date.now(),d=n[s];a||(a=f),t[i]=u,n[i]=f;let m=s,w=0;for(;m!==i;)w+=t[m++],m=m%r;if(i=(i+1)%r,i===s&&(s=(s+1)%r),f-a<e)return;const y=d&&f-d;return y?Math.round(w*1e3/y):void 0}}function Qv(r,e){let t=0,n=1e3/e,i,s;const a=(u,f=Date.now())=>{t=f,i=null,s&&(clearTimeout(s),s=null),r.apply(null,u)};return[(...u)=>{const f=Date.now(),d=f-t;d>=n?a(u,f):(i=u,s||(s=setTimeout(()=>{s=null,a(i)},n-d)))},()=>i&&a(i)]}const So=(r,e,t=3)=>{let n=0;const i=Xv(50,250);return Qv(s=>{const a=s.loaded,u=s.lengthComputable?s.total:void 0,f=a-n,d=i(f),m=a<=u;n=a;const w={loaded:a,total:u,progress:u?a/u:void 0,bytes:f,rate:d||void 0,estimated:d&&u&&m?(u-a)/d:void 0,event:s,lengthComputable:u!=null,[e?"download":"upload"]:!0};r(w)},t)},ah=(r,e)=>{const t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},lh=r=>(...e)=>ee.asap(()=>r(...e)),ew=At.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,At.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(At.origin),At.navigator&&/(msie|trident)/i.test(At.navigator.userAgent)):()=>!0,tw=At.hasStandardBrowserEnv?{write(r,e,t,n,i,s){const a=[r+"="+encodeURIComponent(e)];ee.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),ee.isString(n)&&a.push("path="+n),ee.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function nw(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function rw(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function uh(r,e,t){let n=!nw(e);return r&&(n||t==!1)?rw(r,e):e}const ch=r=>r instanceof Mt?{...r}:r;function ni(r,e){e=e||{};const t={};function n(d,m,w,y){return ee.isPlainObject(d)&&ee.isPlainObject(m)?ee.merge.call({caseless:y},d,m):ee.isPlainObject(m)?ee.merge({},m):ee.isArray(m)?m.slice():m}function i(d,m,w,y){if(ee.isUndefined(m)){if(!ee.isUndefined(d))return n(void 0,d,w,y)}else return n(d,m,w,y)}function s(d,m){if(!ee.isUndefined(m))return n(void 0,m)}function a(d,m){if(ee.isUndefined(m)){if(!ee.isUndefined(d))return n(void 0,d)}else return n(void 0,m)}function u(d,m,w){if(w in e)return n(d,m);if(w in r)return n(void 0,d)}const f={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:(d,m,w)=>i(ch(d),ch(m),w,!0)};return ee.forEach(Object.keys(Object.assign({},r,e)),function(d){const m=f[d]||i,w=m(r[d],e[d],d);ee.isUndefined(w)&&m!==u||(t[d]=w)}),t}const fh=r=>{const e=ni({},r);let{data:t,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:u}=e;e.headers=a=Mt.from(a),e.url=eh(uh(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(ee.isFormData(t)){if(At.hasStandardBrowserEnv||At.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[d,...m]=f?f.split(";").map(w=>w.trim()).filter(Boolean):[];a.setContentType([d||"multipart/form-data",...m].join("; "))}}if(At.hasStandardBrowserEnv&&(n&&ee.isFunction(n)&&(n=n(e)),n||n!==!1&&ew(e.url))){const d=i&&s&&tw.read(s);d&&a.set(i,d)}return e},iw=typeof XMLHttpRequest<"u",sw=iw&&function(r){return new Promise(function(e,t){const n=fh(r);let i=n.data;const s=Mt.from(n.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:f}=n,d,m,w,y,x;function S(){y&&y(),x&&x(),n.cancelToken&&n.cancelToken.unsubscribe(d),n.signal&&n.signal.removeEventListener("abort",d)}let O=new XMLHttpRequest;O.open(n.method.toUpperCase(),n.url,!0),O.timeout=n.timeout;function N(){if(!O)return;const J=Mt.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),Q={data:!a||a==="text"||a==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:J,config:r,request:O};oh(function(de){e(de),S()},function(de){t(de),S()},Q),O=null}"onloadend"in O?O.onloadend=N:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(N)},O.onabort=function(){O&&(t(new Me("Request aborted",Me.ECONNABORTED,r,O)),O=null)},O.onerror=function(){t(new Me("Network Error",Me.ERR_NETWORK,r,O)),O=null},O.ontimeout=function(){let J=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const Q=n.transitional||nh;n.timeoutErrorMessage&&(J=n.timeoutErrorMessage),t(new Me(J,Q.clarifyTimeoutError?Me.ETIMEDOUT:Me.ECONNABORTED,r,O)),O=null},i===void 0&&s.setContentType(null),"setRequestHeader"in O&&ee.forEach(s.toJSON(),function(J,Q){O.setRequestHeader(Q,J)}),ee.isUndefined(n.withCredentials)||(O.withCredentials=!!n.withCredentials),a&&a!=="json"&&(O.responseType=n.responseType),f&&([w,x]=So(f,!0),O.addEventListener("progress",w)),u&&O.upload&&([m,y]=So(u),O.upload.addEventListener("progress",m),O.upload.addEventListener("loadend",y)),(n.cancelToken||n.signal)&&(d=J=>{O&&(t(!J||J.type?new ji(null,r,O):J),O.abort(),O=null)},n.cancelToken&&n.cancelToken.subscribe(d),n.signal&&(n.signal.aborted?d():n.signal.addEventListener("abort",d)));const M=Zv(n.url);if(M&&At.protocols.indexOf(M)===-1){t(new Me("Unsupported protocol "+M+":",Me.ERR_BAD_REQUEST,r));return}O.send(i||null)})},ow=(r,e)=>{const{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,i;const s=function(d){if(!i){i=!0,u();const m=d instanceof Error?d:this.reason;n.abort(m instanceof Me?m:new ji(m instanceof Error?m.message:m))}};let a=e&&setTimeout(()=>{a=null,s(new Me(`timeout ${e} of ms exceeded`,Me.ETIMEDOUT))},e);const u=()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),r=null)};r.forEach(d=>d.addEventListener("abort",s));const{signal:f}=n;return f.unsubscribe=()=>ee.asap(u),f}},aw=function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let n=0,i;for(;n<t;)i=n+e,yield r.slice(n,i),n=i},lw=async function*(r,e){for await(const t of uw(r))yield*aw(t,e)},uw=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},hh=(r,e,t,n)=>{const i=lw(r,e);let s=0,a,u=f=>{a||(a=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:d,value:m}=await i.next();if(d){u(),f.close();return}let w=m.byteLength;if(t){let y=s+=w;t(y)}f.enqueue(new Uint8Array(m))}catch(d){throw u(d),d}},cancel(f){return u(f),i.return()}},{highWaterMark:2})},Ao=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",dh=Ao&&typeof ReadableStream=="function",cw=Ao&&(typeof TextEncoder=="function"?(r=>e=>r.encode(e))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),ph=(r,...e)=>{try{return!!r(...e)}catch{return!1}},fw=dh&&ph(()=>{let r=!1;const e=new Request(At.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!e}),gh=64*1024,al=dh&&ph(()=>ee.isReadableStream(new Response("").body)),To={stream:al&&(r=>r.body)};Ao&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!To[e]&&(To[e]=ee.isFunction(r[e])?t=>t[e]():(t,n)=>{throw new Me(`Response type '${e}' is not supported`,Me.ERR_NOT_SUPPORT,n)})})})(new Response);const hw=async r=>{if(r==null)return 0;if(ee.isBlob(r))return r.size;if(ee.isSpecCompliantForm(r))return(await new Request(At.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(ee.isArrayBufferView(r)||ee.isArrayBuffer(r))return r.byteLength;if(ee.isURLSearchParams(r)&&(r=r+""),ee.isString(r))return(await cw(r)).byteLength},dw=async(r,e)=>ee.toFiniteNumber(r.getContentLength())??hw(e),pw=Ao&&(async r=>{let{url:e,method:t,data:n,signal:i,cancelToken:s,timeout:a,onDownloadProgress:u,onUploadProgress:f,responseType:d,headers:m,withCredentials:w="same-origin",fetchOptions:y}=fh(r);d=d?(d+"").toLowerCase():"text";let x=ow([i,s&&s.toAbortSignal()],a),S;const O=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let N;try{if(f&&fw&&t!=="get"&&t!=="head"&&(N=await dw(m,n))!==0){let ue=new Request(e,{method:"POST",body:n,duplex:"half"}),ce;if(ee.isFormData(n)&&(ce=ue.headers.get("content-type"))&&m.setContentType(ce),ue.body){const[ne,re]=ah(N,So(lh(f)));n=hh(ue.body,gh,ne,re)}}ee.isString(w)||(w=w?"include":"omit");const M="credentials"in Request.prototype;S=new Request(e,{...y,signal:x,method:t.toUpperCase(),headers:m.normalize().toJSON(),body:n,duplex:"half",credentials:M?w:void 0});let J=await fetch(S);const Q=al&&(d==="stream"||d==="response");if(al&&(u||Q&&O)){const ue={};["status","statusText","headers"].forEach(we=>{ue[we]=J[we]});const ce=ee.toFiniteNumber(J.headers.get("content-length")),[ne,re]=u&&ah(ce,So(lh(u),!0))||[];J=new Response(hh(J.body,gh,ne,()=>{re&&re(),O&&O()}),ue)}d=d||"text";let de=await To[ee.findKey(To,d)||"text"](J,r);return!Q&&O&&O(),await new Promise((ue,ce)=>{oh(ue,ce,{data:de,headers:Mt.from(J.headers),status:J.status,statusText:J.statusText,config:r,request:S})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/fetch/i.test(M.message)?Object.assign(new Me("Network Error",Me.ERR_NETWORK,r,S),{cause:M.cause||M}):Me.from(M,M&&M.code,r,S)}}),ll={http:Cv,xhr:sw,fetch:pw};ee.forEach(ll,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const mh=r=>`- ${r}`,gw=r=>ee.isFunction(r)||r===null||r===!1,yh={getAdapter:r=>{r=ee.isArray(r)?r:[r];const{length:e}=r;let t,n;const i={};for(let s=0;s<e;s++){t=r[s];let a;if(n=t,!gw(t)&&(n=ll[(a=String(t)).toLowerCase()],n===void 0))throw new Me(`Unknown adapter '${a}'`);if(n)break;i[a||"#"+s]=n}if(!n){const s=Object.entries(i).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
75
- `+s.map(mh).join(`
76
- `):" "+mh(s[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:ll};function ul(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new ji(null,r)}function bh(r){return ul(r),r.headers=Mt.from(r.headers),r.data=ol.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),yh.getAdapter(r.adapter||Ss.adapter)(r).then(function(e){return ul(r),e.data=ol.call(r,r.transformResponse,e),e.headers=Mt.from(e.headers),e},function(e){return sh(e)||(ul(r),e&&e.response&&(e.response.data=ol.call(r,r.transformResponse,e.response),e.response.headers=Mt.from(e.response.headers))),Promise.reject(e)})}const vh="1.8.4",_o={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{_o[r]=function(t){return typeof t===r||"a"+(e<1?"n ":" ")+r}});const wh={};_o.transitional=function(r,e,t){function n(i,s){return"[Axios v"+vh+"] Transitional option '"+i+"'"+s+(t?". "+t:"")}return(i,s,a)=>{if(r===!1)throw new Me(n(s," has been removed"+(e?" in "+e:"")),Me.ERR_DEPRECATED);return e&&!wh[s]&&(wh[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),r?r(i,s,a):!0}},_o.spelling=function(r){return(e,t)=>(console.warn(`${t} is likely a misspelling of ${r}`),!0)};function mw(r,e,t){if(typeof r!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);const n=Object.keys(r);let i=n.length;for(;i-- >0;){const s=n[i],a=e[s];if(a){const u=r[s],f=u===void 0||a(u,s,r);if(f!==!0)throw new Me("option "+s+" must be "+f,Me.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Me("Unknown option "+s,Me.ERR_BAD_OPTION)}}const No={assertOptions:mw,validators:_o},Kn=No.validators;let ri=class{constructor(r){this.defaults=r,this.interceptors={request:new th,response:new th}}async request(r,e){try{return await this._request(r,e)}catch(t){if(t instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const i=n.stack?n.stack.replace(/^.+\n/,""):"";try{t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+=`
77
- `+i):t.stack=i}catch{}}throw t}}_request(r,e){typeof r=="string"?(e=e||{},e.url=r):e=r||{},e=ni(this.defaults,e);const{transitional:t,paramsSerializer:n,headers:i}=e;t!==void 0&&No.assertOptions(t,{silentJSONParsing:Kn.transitional(Kn.boolean),forcedJSONParsing:Kn.transitional(Kn.boolean),clarifyTimeoutError:Kn.transitional(Kn.boolean)},!1),n!=null&&(ee.isFunction(n)?e.paramsSerializer={serialize:n}:No.assertOptions(n,{encode:Kn.function,serialize:Kn.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),No.assertOptions(e,{baseUrl:Kn.spelling("baseURL"),withXsrfToken:Kn.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&ee.merge(i.common,i[e.method]);i&&ee.forEach(["delete","get","head","post","put","patch","common"],x=>{delete i[x]}),e.headers=Mt.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(e)===!1||(u=u&&x.synchronous,a.unshift(x.fulfilled,x.rejected))});const f=[];this.interceptors.response.forEach(function(x){f.push(x.fulfilled,x.rejected)});let d,m=0,w;if(!u){const x=[bh.bind(this),void 0];for(x.unshift.apply(x,a),x.push.apply(x,f),w=x.length,d=Promise.resolve(e);m<w;)d=d.then(x[m++],x[m++]);return d}w=a.length;let y=e;for(m=0;m<w;){const x=a[m++],S=a[m++];try{y=x(y)}catch(O){S.call(this,O);break}}try{d=bh.call(this,y)}catch(x){return Promise.reject(x)}for(m=0,w=f.length;m<w;)d=d.then(f[m++],f[m++]);return d}getUri(r){r=ni(this.defaults,r);const e=uh(r.baseURL,r.url,r.allowAbsoluteUrls);return eh(e,r.params,r.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(r){ri.prototype[r]=function(e,t){return this.request(ni(t||{},{method:r,url:e,data:(t||{}).data}))}}),ee.forEach(["post","put","patch"],function(r){function e(t){return function(n,i,s){return this.request(ni(s||{},{method:r,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}ri.prototype[r]=e(),ri.prototype[r+"Form"]=e(!0)});let yw=class Mh{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(u=>{n.subscribe(u),s=u}).then(i);return a.cancel=function(){n.unsubscribe(s)},a},e(function(i,s,a){n.reason||(n.reason=new ji(i,s,a),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Mh(function(t){e=t}),cancel:e}}};function bw(r){return function(e){return r.apply(null,e)}}function vw(r){return ee.isObject(r)&&r.isAxiosError===!0}const cl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cl).forEach(([r,e])=>{cl[e]=r});function xh(r){const e=new ri(r),t=Bf(ri.prototype.request,e);return ee.extend(t,ri.prototype,e,{allOwnKeys:!0}),ee.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return xh(ni(r,n))},t}const ft=xh(Ss);ft.Axios=ri,ft.CanceledError=ji,ft.CancelToken=yw,ft.isCancel=sh,ft.VERSION=vh,ft.toFormData=Eo,ft.AxiosError=Me,ft.Cancel=ft.CanceledError,ft.all=function(r){return Promise.all(r)},ft.spread=bw,ft.isAxiosError=vw,ft.mergeConfig=ni,ft.AxiosHeaders=Mt,ft.formToJSON=r=>rh(ee.isHTMLForm(r)?new FormData(r):r),ft.getAdapter=yh.getAdapter,ft.HttpStatusCode=cl,ft.default=ft;const{Axios:Lx,AxiosError:kx,CanceledError:Rx,isCancel:Px,CancelToken:qx,VERSION:Ix,all:jx,Cancel:$x,isAxiosError:Dx,spread:Mx,toFormData:Bx,AxiosHeaders:Ux,HttpStatusCode:Fx,formToJSON:Kx,getAdapter:Hx,mergeConfig:zx}=ft;class Eh{constructor(e){Sf(this,"storage"),this.storage=e}getRaw(e,t=null){var n;return((n=this.storage)==null?void 0:n.getItem(e))??t}setRaw(e,t){var n;(n=this.storage)==null||n.setItem(e,t)}get(e,t=null){const n=this.getRaw(e);return n?H0(n):t}set(e,t){this.setRaw(e,K0(t))}del(e){var t;(t=this.storage)==null||t.removeItem(e)}clear(){var e;(e=this.storage)==null||e.clear()}}const ww=typeof localStorage>"u"?void 0:localStorage,xw=typeof sessionStorage>"u"?void 0:sessionStorage,Ew=new Eh(ww),Ow=new Eh(xw),Sw=Object.freeze(Object.defineProperty({__proto__:null,local:Ew,session:Ow},Symbol.toStringTag,{value:"Module"}));ft.create({baseURL:"",timeout:3e3});const Oh="i18nextLng",fl="zh";St.use(mf).use(Of).init({lng:Sw.local.getRaw(Oh,fl),fallbackLng:fl,backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1}});const Aw=Object.freeze(Object.defineProperty({__proto__:null,KEY:Oh,LNG_ZH:fl,changeLanguage:$1,createInstance:k1,dir:R1,exists:B1,getFixedT:D1,hasLoadedNamespace:F1,init:P1,loadLanguages:H1,loadNamespaces:K1,loadResources:q1,reloadResources:I1,setDefaultNamespace:U1,t:M1,use:j1},Symbol.toStringTag,{value:"Module"})),Tw=Object.freeze(Object.defineProperty({__proto__:null,onUpload:async r=>{const{file:e,onProgress:t,onSuccess:n}=r;let i=0;const s=setInterval(()=>{i+=Math.floor(Math.random()*10),i>=100&&(i=99),t({percent:i})},100);e.url=URL.createObjectURL(e),n==null||n({url:e.url}),clearInterval(s)}},Symbol.toStringTag,{value:"Module"}));var Co={exports:{}},Sh;function _w(){return Sh||(Sh=1,function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof jn<"u"&&jn,n=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(a){var u=typeof s<"u"&&s||typeof self<"u"&&self||typeof u<"u"&&u,f={searchParams:"URLSearchParams"in u,iterable:"Symbol"in u&&"iterator"in Symbol,blob:"FileReader"in u&&"Blob"in u&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in u,arrayBuffer:"ArrayBuffer"in u};function d(E){return E&&DataView.prototype.isPrototypeOf(E)}if(f.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=ArrayBuffer.isView||function(E){return E&&m.indexOf(Object.prototype.toString.call(E))>-1};function y(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(E)||E==="")throw new TypeError('Invalid character in header field name: "'+E+'"');return E.toLowerCase()}function x(E){return typeof E!="string"&&(E=String(E)),E}function S(E){var T={next:function(){var j=E.shift();return{done:j===void 0,value:j}}};return f.iterable&&(T[Symbol.iterator]=function(){return T}),T}function O(E){this.map={},E instanceof O?E.forEach(function(T,j){this.append(j,T)},this):Array.isArray(E)?E.forEach(function(T){this.append(T[0],T[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(T){this.append(T,E[T])},this)}O.prototype.append=function(E,T){E=y(E),T=x(T);var j=this.map[E];this.map[E]=j?j+", "+T:T},O.prototype.delete=function(E){delete this.map[y(E)]},O.prototype.get=function(E){return E=y(E),this.has(E)?this.map[E]:null},O.prototype.has=function(E){return this.map.hasOwnProperty(y(E))},O.prototype.set=function(E,T){this.map[y(E)]=x(T)},O.prototype.forEach=function(E,T){for(var j in this.map)this.map.hasOwnProperty(j)&&E.call(T,this.map[j],j,this)},O.prototype.keys=function(){var E=[];return this.forEach(function(T,j){E.push(j)}),S(E)},O.prototype.values=function(){var E=[];return this.forEach(function(T){E.push(T)}),S(E)},O.prototype.entries=function(){var E=[];return this.forEach(function(T,j){E.push([j,T])}),S(E)},f.iterable&&(O.prototype[Symbol.iterator]=O.prototype.entries);function N(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function M(E){return new Promise(function(T,j){E.onload=function(){T(E.result)},E.onerror=function(){j(E.error)}})}function J(E){var T=new FileReader,j=M(T);return T.readAsArrayBuffer(E),j}function Q(E){var T=new FileReader,j=M(T);return T.readAsText(E),j}function de(E){for(var T=new Uint8Array(E),j=new Array(T.length),U=0;U<T.length;U++)j[U]=String.fromCharCode(T[U]);return j.join("")}function ue(E){if(E.slice)return E.slice(0);var T=new Uint8Array(E.byteLength);return T.set(new Uint8Array(E)),T.buffer}function ce(){return this.bodyUsed=!1,this._initBody=function(E){this.bodyUsed=this.bodyUsed,this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:f.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:f.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():f.arrayBuffer&&f.blob&&d(E)?(this._bodyArrayBuffer=ue(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||w(E))?this._bodyArrayBuffer=ue(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var E=N(this);if(E)return E;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 E=N(this);return E||(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(J)}),this.text=function(){var E=N(this);if(E)return E;if(this._bodyBlob)return Q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(de(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(Ee)}),this.json=function(){return this.text().then(JSON.parse)},this}var ne=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function re(E){var T=E.toUpperCase();return ne.indexOf(T)>-1?T:E}function we(E,T){if(!(this instanceof we))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');T=T||{};var j=T.body;if(E instanceof we){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,T.headers||(this.headers=new O(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!j&&E._bodyInit!=null&&(j=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=T.credentials||this.credentials||"same-origin",(T.headers||!this.headers)&&(this.headers=new O(T.headers)),this.method=re(T.method||this.method||"GET"),this.mode=T.mode||this.mode||null,this.signal=T.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&j)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(j),(this.method==="GET"||this.method==="HEAD")&&(T.cache==="no-store"||T.cache==="no-cache")){var U=/([?&])_=[^&]*/;if(U.test(this.url))this.url=this.url.replace(U,"$1_="+new Date().getTime());else{var Y=/\?/;this.url+=(Y.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}we.prototype.clone=function(){return new we(this,{body:this._bodyInit})};function Ee(E){var T=new FormData;return E.trim().split("&").forEach(function(j){if(j){var U=j.split("="),Y=U.shift().replace(/\+/g," "),z=U.join("=").replace(/\+/g," ");T.append(decodeURIComponent(Y),decodeURIComponent(z))}}),T}function A(E){var T=new O,j=E.replace(/\r?\n[\t ]+/g," ");return j.split("\r").map(function(U){return U.indexOf(`
78
- `)===0?U.substr(1,U.length):U}).forEach(function(U){var Y=U.split(":"),z=Y.shift().trim();if(z){var $=Y.join(":").trim();T.append(z,$)}}),T}ce.call(we.prototype);function W(E,T){if(!(this instanceof W))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');T||(T={}),this.type="default",this.status=T.status===void 0?200:T.status,this.ok=this.status>=200&&this.status<300,this.statusText=T.statusText===void 0?"":""+T.statusText,this.headers=new O(T.headers),this.url=T.url||"",this._initBody(E)}ce.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new O(this.headers),url:this.url})},W.error=function(){var E=new W(null,{status:0,statusText:""});return E.type="error",E};var R=[301,302,303,307,308];W.redirect=function(E,T){if(R.indexOf(T)===-1)throw new RangeError("Invalid status code");return new W(null,{status:T,headers:{location:E}})},a.DOMException=u.DOMException;try{new a.DOMException}catch{a.DOMException=function(T,j){this.message=T,this.name=j;var U=Error(T);this.stack=U.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function V(E,T){return new Promise(function(j,U){var Y=new we(E,T);if(Y.signal&&Y.signal.aborted)return U(new a.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function $(){z.abort()}z.onload=function(){var le={status:z.status,statusText:z.statusText,headers:A(z.getAllResponseHeaders()||"")};le.url="responseURL"in z?z.responseURL:le.headers.get("X-Request-URL");var be="response"in z?z.response:z.responseText;setTimeout(function(){j(new W(be,le))},0)},z.onerror=function(){setTimeout(function(){U(new TypeError("Network request failed"))},0)},z.ontimeout=function(){setTimeout(function(){U(new TypeError("Network request failed"))},0)},z.onabort=function(){setTimeout(function(){U(new a.DOMException("Aborted","AbortError"))},0)};function se(le){try{return le===""&&u.location.href?u.location.href:le}catch{return le}}z.open(Y.method,se(Y.url),!0),Y.credentials==="include"?z.withCredentials=!0:Y.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&(f.blob?z.responseType="blob":f.arrayBuffer&&Y.headers.get("Content-Type")&&Y.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(z.responseType="arraybuffer")),T&&typeof T.headers=="object"&&!(T.headers instanceof O)?Object.getOwnPropertyNames(T.headers).forEach(function(le){z.setRequestHeader(le,x(T.headers[le]))}):Y.headers.forEach(function(le,be){z.setRequestHeader(be,le)}),Y.signal&&(Y.signal.addEventListener("abort",$),z.onreadystatechange=function(){z.readyState===4&&Y.signal.removeEventListener("abort",$)}),z.send(typeof Y._bodyInit>"u"?null:Y._bodyInit)})}return V.polyfill=!0,u.fetch||(u.fetch=V,u.Headers=O,u.Request=we,u.Response=W),a.Headers=O,a.Request=we,a.Response=W,a.fetch=V,a})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=t.fetch?t:n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,r.exports=e}(Co,Co.exports)),Co.exports}var Ah=_w();const Nw=Bh({__proto__:null,default:Do(Ah)},[Ah]);We.Editor=Dc,We.Form=zc,We.Menu=f1,We.Provider=Ma,We.Table=h1,We.Upload=Hc,We.ant=Tw,We.i18n=Aw,Object.defineProperty(We,Symbol.toStringTag,{value:"Module"})});
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(`
66
+ `).reduce((s,i,o)=>(o!==0&&s.insert(`
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(`
68
+ `).reduce((o,a,u)=>(u!==0&&o.insert(`
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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};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"})});