sykpcomposer 0.0.9 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,43 +1,58 @@
1
- (function(je,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],M):(je=typeof globalThis<"u"?globalThis:je||self,M(je.ViteButton={},je.React,je.ReactDOM))})(this,function(je,M,sn){"use strict";function Us(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const it=Us(M);var er={exports:{}},st={};/*
1
+ (function(it,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],A):(it=typeof globalThis<"u"?globalThis:it||self,A(it.ViteButton={},it.React,it.ReactDOM))})(this,function(it,A,Sn){"use strict";function Hl(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const St=Hl(A);function wn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Cr={exports:{}},wt={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var tr,xo;function vo(){if(xo)return tr;xo=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return tr=o()?Object.assign:function(i,s){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var h in l)e.call(l,h)&&(a[h]=l[h]);if(n){c=n(l);for(var d=0;d<c.length;d++)t.call(l,c[d])&&(a[c[d]]=l[c[d]])}}return a},tr}/** @license React v17.0.2
5
+ */var Er,ti;function kn(){if(ti)return Er;ti=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Er=o()?Object.assign:function(i,s){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var d in l)e.call(l,d)&&(a[d]=l[d]);if(n){c=n(l);for(var f=0;f<c.length;f++)t.call(l,c[f])&&(a[c[f]]=l[c[f]])}}return a},Er}/** @license React v17.0.2
6
6
  * react-jsx-runtime.production.min.js
7
7
  *
8
8
  * Copyright (c) Facebook, Inc. and its affiliates.
9
9
  *
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
- */var bo;function Vs(){if(bo)return st;bo=1,vo();var n=M,e=60103;if(st.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),st.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,h={},d=null,f=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(f=a.ref);for(u in a)o.call(a,u)&&!i.hasOwnProperty(u)&&(h[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)h[u]===void 0&&(h[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:f,props:h,_owner:r.current}}return st.jsx=s,st.jsxs=s,st}var nr={};/** @license React v17.0.2
12
+ */var ni;function Yl(){if(ni)return wt;ni=1,kn();var n=A,e=60103;if(wt.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),wt.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,d={},f=null,h=null;c!==void 0&&(f=""+c),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(u in a)o.call(a,u)&&!i.hasOwnProperty(u)&&(d[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)d[u]===void 0&&(d[u]=a[u]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:r.current}}return wt.jsx=s,wt.jsxs=s,wt}var Sr={};/** @license React v17.0.2
13
13
  * react-jsx-runtime.development.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var Co;function Js(){return Co||(Co=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=M,t=vo(),r=60103,o=60106;n.Fragment=60107;var i=60108,s=60114,l=60109,a=60110,c=60112,u=60113,h=60120,d=60115,f=60116,g=60121,m=60122,_=60117,v=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var x=Symbol.for;r=x("react.element"),o=x("react.portal"),n.Fragment=x("react.fragment"),i=x("react.strict_mode"),s=x("react.profiler"),l=x("react.provider"),a=x("react.context"),c=x("react.forward_ref"),u=x("react.suspense"),h=x("react.suspense_list"),d=x("react.memo"),f=x("react.lazy"),g=x("react.block"),m=x("react.server.block"),_=x("react.fundamental"),x("react.scope"),x("react.opaque.id"),v=x("react.debug_trace_mode"),x("react.offscreen"),y=x("react.legacy_hidden")}var S=typeof Symbol=="function"&&Symbol.iterator,w="@@iterator";function C(p){if(p===null||typeof p!="object")return null;var k=S&&p[S]||p[w];return typeof k=="function"?k:null}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(p){{for(var k=arguments.length,F=new Array(k>1?k-1:0),j=1;j<k;j++)F[j-1]=arguments[j];P("error",p,F)}}function P(p,k,F){{var j=N.ReactDebugCurrentFrame,V=j.getStackAddendum();V!==""&&(k+="%s",F=F.concat([V]));var J=F.map(function(z){return""+z});J.unshift("Warning: "+k),Function.prototype.apply.call(console[p],console,J)}}var $=!1;function B(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===i||p===u||p===h||p===y||$||typeof p=="object"&&p!==null&&(p.$$typeof===f||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===g||p[0]===m))}function ee(p,k,F){var j=k.displayName||k.name||"";return p.displayName||(j!==""?F+"("+j+")":F)}function q(p){return p.displayName||"Context"}function R(p){if(p==null)return null;if(typeof p.tag=="number"&&T("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case n.Fragment:return"Fragment";case o:return"Portal";case s:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case h:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var k=p;return q(k)+".Consumer";case l:var F=p;return q(F._context)+".Provider";case c:return ee(p,p.render,"ForwardRef");case d:return R(p.type);case g:return R(p._render);case f:{var j=p,V=j._payload,J=j._init;try{return R(J(V))}catch{return null}}}return null}var Y=0,ce,Me,Je,tn,nn,rn,Ct;function wt(){}wt.__reactDisabledLog=!0;function St(){{if(Y===0){ce=console.log,Me=console.info,Je=console.warn,tn=console.error,nn=console.group,rn=console.groupCollapsed,Ct=console.groupEnd;var p={configurable:!0,enumerable:!0,value:wt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}Y++}}function Et(){{if(Y--,Y===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:Me}),warn:t({},p,{value:Je}),error:t({},p,{value:tn}),group:t({},p,{value:nn}),groupCollapsed:t({},p,{value:rn}),groupEnd:t({},p,{value:Ct})})}Y<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=N.ReactCurrentDispatcher,rt;function Ne(p,k,F){{if(rt===void 0)try{throw Error()}catch(V){var j=V.stack.trim().match(/\n( *(at )?)/);rt=j&&j[1]||""}return`
20
- `+rt+p}}var Ye=!1,ot;{var Dc=typeof WeakMap=="function"?WeakMap:Map;ot=new Dc}function Ds(p,k){if(!p||Ye)return"";{var F=ot.get(p);if(F!==void 0)return F}var j;Ye=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=pe.current,pe.current=null,St();try{if(k){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(Ae){j=Ae}Reflect.construct(p,[],z)}else{try{z.call()}catch(Ae){j=Ae}p.call(z.prototype)}}else{try{throw Error()}catch(Ae){j=Ae}p()}}catch(Ae){if(Ae&&j&&typeof Ae.stack=="string"){for(var W=Ae.stack.split(`
21
- `),ue=j.stack.split(`
22
- `),X=W.length-1,Q=ue.length-1;X>=1&&Q>=0&&W[X]!==ue[Q];)Q--;for(;X>=1&&Q>=0;X--,Q--)if(W[X]!==ue[Q]){if(X!==1||Q!==1)do if(X--,Q--,Q<0||W[X]!==ue[Q]){var Le=`
23
- `+W[X].replace(" at new "," at ");return typeof p=="function"&&ot.set(p,Le),Le}while(X>=1&&Q>=0);break}}}finally{Ye=!1,pe.current=J,Et(),Error.prepareStackTrace=V}var kt=p?p.displayName||p.name:"",Ks=kt?Ne(kt):"";return typeof p=="function"&&ot.set(p,Ks),Ks}function Is(p,k,F){return Ds(p,!1)}function Ic(p){var k=p.prototype;return!!(k&&k.isReactComponent)}function Qn(p,k,F){if(p==null)return"";if(typeof p=="function")return Ds(p,Ic(p));if(typeof p=="string")return Ne(p);switch(p){case u:return Ne("Suspense");case h:return Ne("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Is(p.render);case d:return Qn(p.type,k,F);case g:return Is(p._render);case f:{var j=p,V=j._payload,J=j._init;try{return Qn(J(V),k,F)}catch{}}}return""}var Fs={},Ms=N.ReactDebugCurrentFrame;function Zn(p){if(p){var k=p._owner,F=Qn(p.type,p._source,k?k.type:null);Ms.setExtraStackFrame(F)}else Ms.setExtraStackFrame(null)}function Fc(p,k,F,j,V){{var J=Function.call.bind(Object.prototype.hasOwnProperty);for(var z in p)if(J(p,z)){var W=void 0;try{if(typeof p[z]!="function"){var ue=Error((j||"React class")+": "+F+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}W=p[z](k,z,j,F,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){W=X}W&&!(W instanceof Error)&&(Zn(V),T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",j||"React class",F,z,typeof W),Zn(null)),W instanceof Error&&!(W.message in Fs)&&(Fs[W.message]=!0,Zn(V),T("Failed %s type: %s",F,W.message),Zn(null))}}}var on=N.ReactCurrentOwner,go=Object.prototype.hasOwnProperty,Mc={key:!0,ref:!0,__self:!0,__source:!0},Ls,As,po;po={};function Lc(p){if(go.call(p,"ref")){var k=Object.getOwnPropertyDescriptor(p,"ref").get;if(k&&k.isReactWarning)return!1}return p.ref!==void 0}function Ac(p){if(go.call(p,"key")){var k=Object.getOwnPropertyDescriptor(p,"key").get;if(k&&k.isReactWarning)return!1}return p.key!==void 0}function jc(p,k){if(typeof p.ref=="string"&&on.current&&k&&on.current.stateNode!==k){var F=R(on.current.type);po[F]||(T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',R(on.current.type),p.ref),po[F]=!0)}}function $c(p,k){{var F=function(){Ls||(Ls=!0,T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",k))};F.isReactWarning=!0,Object.defineProperty(p,"key",{get:F,configurable:!0})}}function Rc(p,k){{var F=function(){As||(As=!0,T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",k))};F.isReactWarning=!0,Object.defineProperty(p,"ref",{get:F,configurable:!0})}}var Wc=function(p,k,F,j,V,J,z){var W={$$typeof:r,type:p,key:k,ref:F,props:z,_owner:J};return W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W,"_self",{configurable:!1,enumerable:!1,writable:!1,value:j}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function Bc(p,k,F,j,V){{var J,z={},W=null,ue=null;F!==void 0&&(W=""+F),Ac(k)&&(W=""+k.key),Lc(k)&&(ue=k.ref,jc(k,V));for(J in k)go.call(k,J)&&!Mc.hasOwnProperty(J)&&(z[J]=k[J]);if(p&&p.defaultProps){var X=p.defaultProps;for(J in X)z[J]===void 0&&(z[J]=X[J])}if(W||ue){var Q=typeof p=="function"?p.displayName||p.name||"Unknown":p;W&&$c(z,Q),ue&&Rc(z,Q)}return Wc(p,W,ue,V,j,on.current,z)}}var mo=N.ReactCurrentOwner,js=N.ReactDebugCurrentFrame;function Tt(p){if(p){var k=p._owner,F=Qn(p.type,p._source,k?k.type:null);js.setExtraStackFrame(F)}else js.setExtraStackFrame(null)}var _o;_o=!1;function yo(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function $s(){{if(mo.current){var p=R(mo.current.type);if(p)return`
19
+ */var ri;function Kl(){return ri||(ri=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=A,t=kn(),r=60103,o=60106;n.Fragment=60107;var i=60108,s=60114,l=60109,a=60110,c=60112,u=60113,d=60120,f=60115,h=60116,p=60121,g=60122,m=60117,T=60129,v=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;r=y("react.element"),o=y("react.portal"),n.Fragment=y("react.fragment"),i=y("react.strict_mode"),s=y("react.profiler"),l=y("react.provider"),a=y("react.context"),c=y("react.forward_ref"),u=y("react.suspense"),d=y("react.suspense_list"),f=y("react.memo"),h=y("react.lazy"),p=y("react.block"),g=y("react.server.block"),m=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),T=y("react.debug_trace_mode"),y("react.offscreen"),v=y("react.legacy_hidden")}var b=typeof Symbol=="function"&&Symbol.iterator,x="@@iterator";function C(_){if(_===null||typeof _!="object")return null;var P=b&&_[b]||_[x];return typeof P=="function"?P:null}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(_){{for(var P=arguments.length,L=new Array(P>1?P-1:0),U=1;U<P;U++)L[U-1]=arguments[U];O("error",_,L)}}function O(_,P,L){{var U=N.ReactDebugCurrentFrame,ae=U.getStackAddendum();ae!==""&&(P+="%s",L=L.concat([ae]));var ce=L.map(function(te){return""+te});ce.unshift("Warning: "+P),Function.prototype.apply.call(console[_],console,ce)}}var z=!1;function X(_){return!!(typeof _=="string"||typeof _=="function"||_===n.Fragment||_===s||_===T||_===i||_===u||_===d||_===v||z||typeof _=="object"&&_!==null&&(_.$$typeof===h||_.$$typeof===f||_.$$typeof===l||_.$$typeof===a||_.$$typeof===c||_.$$typeof===m||_.$$typeof===p||_[0]===g))}function he(_,P,L){var U=P.displayName||P.name||"";return _.displayName||(U!==""?L+"("+U+")":L)}function le(_){return _.displayName||"Context"}function H(_){if(_==null)return null;if(typeof _.tag=="number"&&w("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof _=="function")return _.displayName||_.name||null;if(typeof _=="string")return _;switch(_){case n.Fragment:return"Fragment";case o:return"Portal";case s:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof _=="object")switch(_.$$typeof){case a:var P=_;return le(P)+".Consumer";case l:var L=_;return le(L._context)+".Provider";case c:return he(_,_.render,"ForwardRef");case f:return H(_.type);case p:return H(_._render);case h:{var U=_,ae=U._payload,ce=U._init;try{return H(ce(ae))}catch{return null}}}return null}var ie=0,ue,be,De,nt,k,F,J;function q(){}q.__reactDisabledLog=!0;function $(){{if(ie===0){ue=console.log,be=console.info,De=console.warn,nt=console.error,k=console.group,F=console.groupCollapsed,J=console.groupEnd;var _={configurable:!0,enumerable:!0,value:q,writable:!0};Object.defineProperties(console,{info:_,log:_,warn:_,error:_,group:_,groupCollapsed:_,groupEnd:_})}ie++}}function Q(){{if(ie--,ie===0){var _={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},_,{value:ue}),info:t({},_,{value:be}),warn:t({},_,{value:De}),error:t({},_,{value:nt}),group:t({},_,{value:k}),groupCollapsed:t({},_,{value:F}),groupEnd:t({},_,{value:J})})}ie<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var W=N.ReactCurrentDispatcher,Y;function V(_,P,L){{if(Y===void 0)try{throw Error()}catch(ae){var U=ae.stack.trim().match(/\n( *(at )?)/);Y=U&&U[1]||""}return`
20
+ `+Y+_}}var Z=!1,G;{var Se=typeof WeakMap=="function"?WeakMap:Map;G=new Se}function M(_,P){if(!_||Z)return"";{var L=G.get(_);if(L!==void 0)return L}var U;Z=!0;var ae=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ce;ce=W.current,W.current=null,$();try{if(P){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(ot){U=ot}Reflect.construct(_,[],te)}else{try{te.call()}catch(ot){U=ot}_.call(te.prototype)}}else{try{throw Error()}catch(ot){U=ot}_()}}catch(ot){if(ot&&U&&typeof ot.stack=="string"){for(var ee=ot.stack.split(`
21
+ `),Ne=U.stack.split(`
22
+ `),me=ee.length-1,_e=Ne.length-1;me>=1&&_e>=0&&ee[me]!==Ne[_e];)_e--;for(;me>=1&&_e>=0;me--,_e--)if(ee[me]!==Ne[_e]){if(me!==1||_e!==1)do if(me--,_e--,_e<0||ee[me]!==Ne[_e]){var rt=`
23
+ `+ee[me].replace(" at new "," at ");return typeof _=="function"&&G.set(_,rt),rt}while(me>=1&&_e>=0);break}}}finally{Z=!1,W.current=ce,Q(),Error.prepareStackTrace=ae}var Kt=_?_.displayName||_.name:"",Ul=Kt?V(Kt):"";return typeof _=="function"&&G.set(_,Ul),Ul}function Me(_,P,L){return M(_,!1)}function Ht(_){var P=_.prototype;return!!(P&&P.isReactComponent)}function Et(_,P,L){if(_==null)return"";if(typeof _=="function")return M(_,Ht(_));if(typeof _=="string")return V(_);switch(_){case u:return V("Suspense");case d:return V("SuspenseList")}if(typeof _=="object")switch(_.$$typeof){case c:return Me(_.render);case f:return Et(_.type,P,L);case p:return Me(_._render);case h:{var U=_,ae=U._payload,ce=U._init;try{return Et(ce(ae),P,L)}catch{}}}return""}var Rl={},Dl=N.ReactDebugCurrentFrame;function br(_){if(_){var P=_._owner,L=Et(_.type,_._source,P?P.type:null);Dl.setExtraStackFrame(L)}else Dl.setExtraStackFrame(null)}function Sf(_,P,L,U,ae){{var ce=Function.call.bind(Object.prototype.hasOwnProperty);for(var te in _)if(ce(_,te)){var ee=void 0;try{if(typeof _[te]!="function"){var Ne=Error((U||"React class")+": "+L+" type `"+te+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof _[te]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ne.name="Invariant Violation",Ne}ee=_[te](P,te,U,L,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(me){ee=me}ee&&!(ee instanceof Error)&&(br(ae),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",U||"React class",L,te,typeof ee),br(null)),ee instanceof Error&&!(ee.message in Rl)&&(Rl[ee.message]=!0,br(ae),w("Failed %s type: %s",L,ee.message),br(null))}}}var En=N.ReactCurrentOwner,Go=Object.prototype.hasOwnProperty,wf={key:!0,ref:!0,__self:!0,__source:!0},Ml,Ll,Xo;Xo={};function kf(_){if(Go.call(_,"ref")){var P=Object.getOwnPropertyDescriptor(_,"ref").get;if(P&&P.isReactWarning)return!1}return _.ref!==void 0}function Pf(_){if(Go.call(_,"key")){var P=Object.getOwnPropertyDescriptor(_,"key").get;if(P&&P.isReactWarning)return!1}return _.key!==void 0}function Nf(_,P){if(typeof _.ref=="string"&&En.current&&P&&En.current.stateNode!==P){var L=H(En.current.type);Xo[L]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',H(En.current.type),_.ref),Xo[L]=!0)}}function Of(_,P){{var L=function(){Ml||(Ml=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",P))};L.isReactWarning=!0,Object.defineProperty(_,"key",{get:L,configurable:!0})}}function Af(_,P){{var L=function(){Ll||(Ll=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",P))};L.isReactWarning=!0,Object.defineProperty(_,"ref",{get:L,configurable:!0})}}var If=function(_,P,L,U,ae,ce,te){var ee={$$typeof:r,type:_,key:P,ref:L,props:te,_owner:ce};return ee._store={},Object.defineProperty(ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ee,"_self",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.defineProperty(ee,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ae}),Object.freeze&&(Object.freeze(ee.props),Object.freeze(ee)),ee};function Rf(_,P,L,U,ae){{var ce,te={},ee=null,Ne=null;L!==void 0&&(ee=""+L),Pf(P)&&(ee=""+P.key),kf(P)&&(Ne=P.ref,Nf(P,ae));for(ce in P)Go.call(P,ce)&&!wf.hasOwnProperty(ce)&&(te[ce]=P[ce]);if(_&&_.defaultProps){var me=_.defaultProps;for(ce in me)te[ce]===void 0&&(te[ce]=me[ce])}if(ee||Ne){var _e=typeof _=="function"?_.displayName||_.name||"Unknown":_;ee&&Of(te,_e),Ne&&Af(te,_e)}return If(_,ee,Ne,ae,U,En.current,te)}}var Qo=N.ReactCurrentOwner,jl=N.ReactDebugCurrentFrame;function Yt(_){if(_){var P=_._owner,L=Et(_.type,_._source,P?P.type:null);jl.setExtraStackFrame(L)}else jl.setExtraStackFrame(null)}var Zo;Zo=!1;function ei(_){return typeof _=="object"&&_!==null&&_.$$typeof===r}function Fl(){{if(Qo.current){var _=H(Qo.current.type);if(_)return`
24
24
 
25
- Check the render method of \``+p+"`."}return""}}function zc(p){{if(p!==void 0){var k=p.fileName.replace(/^.*[\\\/]/,""),F=p.lineNumber;return`
25
+ Check the render method of \``+_+"`."}return""}}function Df(_){{if(_!==void 0){var P=_.fileName.replace(/^.*[\\\/]/,""),L=_.lineNumber;return`
26
26
 
27
- Check your code at `+k+":"+F+"."}return""}}var Rs={};function Kc(p){{var k=$s();if(!k){var F=typeof p=="string"?p:p.displayName||p.name;F&&(k=`
27
+ Check your code at `+P+":"+L+"."}return""}}var Bl={};function Mf(_){{var P=Fl();if(!P){var L=typeof _=="string"?_:_.displayName||_.name;L&&(P=`
28
28
 
29
- Check the top-level render call using <`+F+">.")}return k}}function Ws(p,k){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var F=Kc(k);if(Rs[F])return;Rs[F]=!0;var j="";p&&p._owner&&p._owner!==mo.current&&(j=" It was passed a child from "+R(p._owner.type)+"."),Tt(p),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',F,j),Tt(null)}}function Bs(p,k){{if(typeof p!="object")return;if(Array.isArray(p))for(var F=0;F<p.length;F++){var j=p[F];yo(j)&&Ws(j,k)}else if(yo(p))p._store&&(p._store.validated=!0);else if(p){var V=C(p);if(typeof V=="function"&&V!==p.entries)for(var J=V.call(p),z;!(z=J.next()).done;)yo(z.value)&&Ws(z.value,k)}}}function Uc(p){{var k=p.type;if(k==null||typeof k=="string")return;var F;if(typeof k=="function")F=k.propTypes;else if(typeof k=="object"&&(k.$$typeof===c||k.$$typeof===d))F=k.propTypes;else return;if(F){var j=R(k);Fc(F,p.props,"prop",j,p)}else if(k.PropTypes!==void 0&&!_o){_o=!0;var V=R(k);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof k.getDefaultProps=="function"&&!k.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vc(p){{for(var k=Object.keys(p.props),F=0;F<k.length;F++){var j=k[F];if(j!=="children"&&j!=="key"){Tt(p),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",j),Tt(null);break}}p.ref!==null&&(Tt(p),T("Invalid attribute `ref` supplied to `React.Fragment`."),Tt(null))}}function zs(p,k,F,j,V,J){{var z=B(p);if(!z){var W="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(W+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ue=zc(V);ue?W+=ue:W+=$s();var X;p===null?X="null":Array.isArray(p)?X="array":p!==void 0&&p.$$typeof===r?(X="<"+(R(p.type)||"Unknown")+" />",W=" Did you accidentally export a JSX literal instead of a component?"):X=typeof p,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,W)}var Q=Bc(p,k,F,V,J);if(Q==null)return Q;if(z){var Le=k.children;if(Le!==void 0)if(j)if(Array.isArray(Le)){for(var kt=0;kt<Le.length;kt++)Bs(Le[kt],p);Object.freeze&&Object.freeze(Le)}else T("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 Bs(Le,p)}return p===n.Fragment?Vc(Q):Uc(Q),Q}}function Jc(p,k,F){return zs(p,k,F,!0)}function Yc(p,k,F){return zs(p,k,F,!1)}var qc=Yc,Hc=Jc;n.jsx=qc,n.jsxs=Hc}()}(nr)),nr}process.env.NODE_ENV==="production"?er.exports=Vs():er.exports=Js();var E=er.exports;function Ys(n){return{}}const ln={},qs={},wo={},qe={},lt={},an={},at={},rr={},or={},Nt={},Pt={},ge={},cn={},un={},Hs={},So={},Gs={},Eo={},Xs={},To={},ko={},dn={},Qs={},No={},Po={},Oo={},Zs={},el={},tl={},Do={},Io={},Ot={},Fo={},Mo={},nl={},fn={},ir={},sr={},rl={},ol={},Dt={},It={},il={},sl={},ll={},me=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,al=me&&"documentMode"in document?document.documentMode:null,_e=me&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$e=me&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),hn=!(!me||!("InputEvent"in window)||al)&&"getTargetRanges"in new window.InputEvent("input"),lr=me&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gn=me&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,cl=me&&/Android/.test(navigator.userAgent),Lo=me&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ul=me&&cl&&Lo,ar=me&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Lo,Ft=1,Re=3,He=0,Ao=1,ct=2,dl=0,fl=1,hl=2,pn=4,mn=8,cr=128,gl=112|(3|pn|mn)|cr,ur=1,dr=2,fr=3,hr=4,gr=5,pr=6,_n=lr||gn||ar?" ":"​",Pe=`
29
+ Check the top-level render call using <`+L+">.")}return P}}function Wl(_,P){{if(!_._store||_._store.validated||_.key!=null)return;_._store.validated=!0;var L=Mf(P);if(Bl[L])return;Bl[L]=!0;var U="";_&&_._owner&&_._owner!==Qo.current&&(U=" It was passed a child from "+H(_._owner.type)+"."),Yt(_),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',L,U),Yt(null)}}function $l(_,P){{if(typeof _!="object")return;if(Array.isArray(_))for(var L=0;L<_.length;L++){var U=_[L];ei(U)&&Wl(U,P)}else if(ei(_))_._store&&(_._store.validated=!0);else if(_){var ae=C(_);if(typeof ae=="function"&&ae!==_.entries)for(var ce=ae.call(_),te;!(te=ce.next()).done;)ei(te.value)&&Wl(te.value,P)}}}function Lf(_){{var P=_.type;if(P==null||typeof P=="string")return;var L;if(typeof P=="function")L=P.propTypes;else if(typeof P=="object"&&(P.$$typeof===c||P.$$typeof===f))L=P.propTypes;else return;if(L){var U=H(P);Sf(L,_.props,"prop",U,_)}else if(P.PropTypes!==void 0&&!Zo){Zo=!0;var ae=H(P);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ae||"Unknown")}typeof P.getDefaultProps=="function"&&!P.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jf(_){{for(var P=Object.keys(_.props),L=0;L<P.length;L++){var U=P[L];if(U!=="children"&&U!=="key"){Yt(_),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",U),Yt(null);break}}_.ref!==null&&(Yt(_),w("Invalid attribute `ref` supplied to `React.Fragment`."),Yt(null))}}function zl(_,P,L,U,ae,ce){{var te=X(_);if(!te){var ee="";(_===void 0||typeof _=="object"&&_!==null&&Object.keys(_).length===0)&&(ee+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ne=Df(ae);Ne?ee+=Ne:ee+=Fl();var me;_===null?me="null":Array.isArray(_)?me="array":_!==void 0&&_.$$typeof===r?(me="<"+(H(_.type)||"Unknown")+" />",ee=" Did you accidentally export a JSX literal instead of a component?"):me=typeof _,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",me,ee)}var _e=Rf(_,P,L,ae,ce);if(_e==null)return _e;if(te){var rt=P.children;if(rt!==void 0)if(U)if(Array.isArray(rt)){for(var Kt=0;Kt<rt.length;Kt++)$l(rt[Kt],_);Object.freeze&&Object.freeze(rt)}else w("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 $l(rt,_)}return _===n.Fragment?jf(_e):Lf(_e),_e}}function Ff(_,P,L){return zl(_,P,L,!0)}function Bf(_,P,L){return zl(_,P,L,!1)}var Wf=Bf,$f=Ff;n.jsx=Wf,n.jsxs=$f}()}(Sr)),Sr}process.env.NODE_ENV==="production"?Cr.exports=Yl():Cr.exports=Kl();var S=Cr.exports;function ql(n){return{}}const Pn={},Vl={},oi={},pt={},kt={},Nn={},Pt={},wr={},kr={},qt={},Vt={},Le={},On={},An={},Jl={},ii={},Gl={},si={},Xl={},li={},ai={},In={},Ql={},ci={},ui={},fi={},Zl={},ea={},ta={},di={},hi={},Jt={},pi={},gi={},na={},Rn={},Pr={},Nr={},ra={},oa={},Gt={},Xt={},ia={},sa={},la={},je=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,aa=je&&"documentMode"in document?document.documentMode:null,Fe=je&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),st=je&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Dn=!(!je||!("InputEvent"in window)||aa)&&"getTargetRanges"in new window.InputEvent("input"),Or=je&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Mn=je&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ca=je&&/Android/.test(navigator.userAgent),mi=je&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ua=je&&ca&&mi,Ar=je&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mi,Qt=1,lt=3,gt=0,_i=1,Nt=2,fa=0,da=1,ha=2,Ln=4,jn=8,Ir=128,pa=112|(3|Ln|jn)|Ir,Rr=1,Dr=2,Mr=3,Lr=4,jr=5,Fr=6,Fn=Or||Mn||Ar?" ":"​",Ge=`
30
30
 
31
- `,pl=$e?" ":_n,jo="֑-߿יִ-﷽ﹰ-ﻼ",$o="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ml=new RegExp("^[^"+$o+"]*["+jo+"]"),_l=new RegExp("^[^"+jo+"]*["+$o+"]"),Oe={bold:1,code:16,highlight:cr,italic:2,strikethrough:pn,subscript:32,superscript:64,underline:mn},yl={directionless:1,unmergeable:2},Ro={center:dr,end:pr,justify:hr,left:ur,right:fr,start:gr},xl={[dr]:"center",[pr]:"end",[hr]:"justify",[ur]:"left",[fr]:"right",[gr]:"start"},vl={normal:0,segmented:2,token:1},bl={[dl]:"normal",[hl]:"segmented",[fl]:"token"};function Cl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D=Cl(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function yn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const wl=100;let mr=!1,_r=0;function Sl(n){_r=n.timeStamp}function yr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function El(n,e,t){const r=we(t._window);let o=null,i=null;r!==null&&r.anchorNode===n&&(o=r.anchorOffset,i=r.focusOffset);const s=n.nodeValue;s!==null&&Sr(e,s,o,i,!1)}function Tl(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Re&&t.isAttached()}function Wo(n,e,t){mr=!0;const r=performance.now()-_r>wl;try{he(n,()=>{const o=A()||function(d){return d.getEditorState().read(()=>{const f=A();return f!==null?f.clone():null})}(n),i=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const f=e[d],g=f.type,m=f.target;let _=Xe(m,l);if(!(_===null&&m!==s||U(_))){if(g==="characterData")r&&I(_)&&Tl(o,m,_)&&El(m,_,n);else if(g==="childList"){c=!0;const v=f.addedNodes;for(let S=0;S<v.length;S++){const w=v[S],C=Ho(w),N=w.parentNode;if(N!=null&&w!==a&&C===null&&(w.nodeName!=="BR"||!yr(w,N,n))){if($e){const T=w.innerText||w.nodeValue;T&&(u+=T)}N.removeChild(w)}}const y=f.removedNodes,x=y.length;if(x>0){let S=0;for(let w=0;w<x;w++){const C=y[w];(C.nodeName==="BR"&&yr(C,m,n)||a===C)&&(m.appendChild(C),S++)}x!==S&&(m===s&&(_=Qo(l)),i.set(m,_))}}}}if(i.size>0)for(const[d,f]of i)if(b(f)){const g=f.getChildrenKeys();let m=d.firstChild;for(let _=0;_<g.length;_++){const v=g[_],y=n.getElementByKey(v);y!==null&&(m==null?(d.appendChild(y),m=y):m!==y&&d.replaceChild(y,m),m=m.nextSibling)}}else I(f)&&f.markDirty();const h=t.takeRecords();if(h.length>0){for(let d=0;d<h.length;d++){const f=h[d],g=f.addedNodes,m=f.target;for(let _=0;_<g.length;_++){const v=g[_],y=v.parentNode;y==null||v.nodeName!=="BR"||yr(v,m,n)||y.removeChild(v)}}t.takeRecords()}o!==null&&(c&&(o.dirty=!0,Ce(o)),$e&&ai(n)&&o.insertRawText(u))})}finally{mr=!1}}function Bo(n){const e=n._observer;e!==null&&Wo(n,e.takeRecords(),e)}function zo(n){(function(e){_r===0&&En(e).addEventListener("textInput",Sl,!0)})(n),n._observer=new MutationObserver((e,t)=>{Wo(n,e,t)})}function Ko(n,e){const t=n.__mode,r=n.__format,o=n.__style,i=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==i||r!==null&&r!==s||o!==null&&o!==l)}function Uo(n,e){const t=n.mergeWithSibling(e),r=H()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Vo(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&I(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ko(e,r)){r=Uo(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&I(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ko(r,t)){r=Uo(r,t);break}break}t.remove()}}else r.remove()}function Jo(n){return Yo(n.anchor),Yo(n.focus),n}function Yo(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),I(r)){n.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!b(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element")}}let kl=1;const Nl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function xr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(Xe(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&xn(e)==null)}function Mt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!xr(e)&&qo(e)===n}catch{return!1}}function vr(n){return n instanceof Kn}function qo(n){let e=n;for(;e!=null;){const t=xn(e);if(vr(t))return t;e=Sn(e)}return null}function xn(n){return n?n.__lexicalEditor:null}function ut(n){return n.isToken()||n.isSegmented()}function Pl(n){return n.nodeType===Re}function vn(n){let e=n;for(;e!=null;){if(Pl(e))return e;e=e.firstChild}return null}function br(n,e,t){const r=Oe[e];if(t!==null&&(n&r)==(t&r))return n;let o=n^r;return e==="subscript"?o&=~Oe.superscript:e==="superscript"&&(o&=~Oe.subscript),o}function Ol(n,e){if(e!=null)return void(n.__key=e);fe(),Ji();const t=H(),r=Fe(),o=""+kl++;r._nodeMap.set(o,n),b(n)?t._dirtyElements.set(o,!0):t._dirtyLeaves.add(o),t._cloneNotNeeded.add(o),t._dirtyType=Ao,n.__key=o}function Ge(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),o=n.getPreviousSibling(),i=n.getNextSibling();if(o===null)if(i!==null){const s=i.getWritable();r.__first=i.__key,s.__prev=null}else r.__first=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(i===null)if(o!==null){const s=o.getWritable();r.__last=o.__key,s.__next=null}else r.__last=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function bn(n){Ji();const e=n.getLatest(),t=e.__parent,r=Fe(),o=H(),i=r._nodeMap,s=o._dirtyElements;t!==null&&function(a,c,u){let h=a;for(;h!==null;){if(u.has(h))return;const d=c.get(h);if(d===void 0)break;u.set(h,!1),h=d.__parent}}(t,i,s);const l=e.__key;o._dirtyType=Ao,b(n)?s.set(l,!0):o._dirtyLeaves.add(l)}function re(n){fe();const e=H(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=se(t);r!==null&&r.getWritable()}if(n!==null){const r=se(n);r!==null&&r.getWritable()}}}function We(){return Xt()?null:H()._compositionKey}function se(n,e){const t=(e||Fe())._nodeMap.get(n);return t===void 0?null:t}function Ho(n,e){const t=n[`__lexicalKey_${H()._key}`];return t!==void 0?se(t,e):null}function Xe(n,e){let t=n;for(;t!=null;){const r=Ho(t,e);if(r!==null)return r;t=Sn(t)}return null}function Go(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Xo(n){return n.read(()=>G().getTextContent())}function G(){return Qo(Fe())}function Qo(n){return n._nodeMap.get("root")}function Ce(n){fe();const e=Fe();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function dt(n){const e=H(),t=function(r,o){let i=r;for(;i!=null;){const s=i[`__lexicalKey_${o._key}`];if(s!==void 0)return s;i=Sn(i)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Zo(n,e){return e?n.getTextContentSize():0}function ei(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Cr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function ti(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ni(n){return n.nodeType===Re?n.nodeValue:null}function wr(n,e,t){const r=we(e._window);if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let l=ni(o);const a=Xe(o);if(l!==null&&I(a)){if(l===_n&&t){const c=t.length;l=t,i=c,s=c}l!==null&&Sr(a,l,i,s,n)}}}function Sr(n,e,t,r,o){let i=n;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let l=e;(s||o)&&e[e.length-1]===_n&&(l=e.slice(0,-1));const a=i.getTextContent();if(o||l!==a){if(l===""){if(re(null),lr||gn||ar)i.remove();else{const m=H();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Gt(),h=i.getTextContentSize(),d=We(),f=i.getKey();if(i.isToken()||d!==null&&f===d&&!s||O(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===h&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=A();if(!O(g)||t===null||r===null)return void i.setTextContent(l);if(g.setTextNodeRange(i,t,i,r),i.isSegmented()){const m=oe(i.getTextContent());i.replace(m),i=m}i.setTextContent(l)}}}function Dl(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),o=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||o||function(i){const s=i.getPreviousSibling();return(I(s)||b(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||o)}function ri(n){return n==="ArrowLeft"}function oi(n){return n==="ArrowRight"}function Lt(n,e){return _e?n:e}function ii(n){return n==="Enter"}function At(n){return n==="Backspace"}function jt(n){return n==="Delete"}function si(n,e,t){return n.toLowerCase()==="a"&&Lt(e,t)}function Il(){const n=G();Ce(Jo(n.select(0,n.getChildrenSize())))}function $t(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const o=n[e];if(typeof o=="string"){const i=yn(o);return t[e]=i,i}return o}function Er(n,e,t,r,o){if(t.size===0)return;const i=r.__type,s=r.__key,l=e.get(i);l===void 0&&D(33,i);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),h=u==="destroyed"&&o==="created";(u===void 0||h)&&c.set(s,h?"updated":o)}function li(n,e,t){const r=n.getParent();let o=t,i=n;return r!==null&&(e&&t===0?(o=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?o-1:o)}function Rt(n,e){const t=n.offset;if(n.type==="element")return li(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const o=e?r.getPreviousSibling():r.getNextSibling();return o===null?li(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function ai(n){const e=En(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function L(n,e,t){return Xi(n,e,t)}function Cn(n){return!ie(n)&&!n.isLastChild()&&!n.isInline()}function wn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&D(75,e),t}function Sn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Tr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function En(n){const e=n._window;return e===null&&D(78),e}function Fl(n){let e=n.getParentOrThrow();for(;e!==null;){if(ft(e))return e;e=e.getParentOrThrow()}return e}function ft(n){return ie(n)||b(n)&&n.isShadowRoot()}function Tn(n){const e=H(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&D(97);const o=r.replace;if(o!==null){const i=o(n);return i instanceof n.constructor||D(98),i}return n}function kr(n,e){!ie(n.getParent())||b(e)||U(e)||D(99)}function Nr(n){return(U(n)||b(n)&&!n.canBeEmpty())&&!n.isInline()}function Pr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Ml(n,e,t){let r=n._blockCursorElement;if(O(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const o=t.anchor,i=o.getNode(),s=o.offset;let l=!1,a=null;if(s===i.getChildrenSize())Nr(i.getChildAtIndex(s-1))&&(l=!0);else{const c=i.getChildAtIndex(s);if(Nr(c)){const u=c.getPreviousSibling();(u===null||Nr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(i.__key);return r===null&&(n._blockCursorElement=r=function(u){const h=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let f=h.blockCursor;if(f!==void 0){if(typeof f=="string"){const g=yn(f);f=h.blockCursor=g}f!==void 0&&d.classList.add(...f)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Pr(r,n,e)}function we(n){return me?(n||window).getSelection():null}function Or(n){return n.nodeType===1}function Dr(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function kn(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function ht(n){if(ie(n)||U(n)&&!n.isInline())return!0;if(!b(n)||ft(n))return!1;const e=n.getFirstChild(),t=e===null||mt(e)||I(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Ir(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ll(){return H()}const ci=new WeakMap,Al=new Map;function jl(n){if(!n._readOnly&&n.isEmpty())return Al;n._readOnly||D(192);let e=ci.get(n);if(!e){e=new Map,ci.set(n,e);for(const[t,r]of n._nodeMap){const o=r.__type;let i=e.get(o);i||(i=new Map,e.set(o,i)),i.set(t,r)}}return e}function Fr(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ui(n,e,t,r,o,i){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(b(s)&&ui(s,l,t,r,o,i),t.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}let Be,le,Wt,Nn,Mr,Lr,Qe,ye,Ar,Bt,Z="",ae="",Se=null,xe="",De="",di=!1,zt=!1,Pn=null;function On(n,e){const t=Qe.get(n);if(e!==null){const r=Wr(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),b(t)){const r=In(t,Qe);jr(r,0,r.length-1,null)}t!==void 0&&Er(Bt,Wt,Nn,t,"destroyed")}function jr(n,e,t,r){let o=e;for(;o<=t;++o){const i=n[o];i!==void 0&&On(i,r)}}function Ze(n,e){n.setProperty("text-align",e)}const $l="40px";function fi(n,e){const t=Be.theme.indent;if(typeof t=="string"){const o=n.classList.contains(t);e>0&&!o?n.classList.add(t):e<1&&o&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||$l;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function hi(n,e){const t=n.style;e===0?Ze(t,""):e===ur?Ze(t,"left"):e===dr?Ze(t,"center"):e===fr?Ze(t,"right"):e===hr?Ze(t,"justify"):e===gr?Ze(t,"start"):e===pr&&Ze(t,"end")}function Dn(n,e,t){const r=ye.get(n);r===void 0&&D(60);const o=r.createDOM(Be,le);if(function(i,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=i,a.set(i,s)}(n,o,le),I(r)?o.setAttribute("data-lexical-text","true"):U(r)&&o.setAttribute("data-lexical-decorator","true"),b(r)){const i=r.__indent,s=r.__size;if(i!==0&&fi(o,i),s!==0){const a=s-1;(function(c,u,h,d){const f=ae;ae="",$r(c,h,0,u,d,null),mi(h,d),ae=f})(In(r,ye),a,r,o)}const l=r.__format;l!==0&&hi(o,l),r.isInline()||pi(null,r,o),Cn(r)&&(Z+=Pe,De+=Pe)}else{const i=r.getTextContent();if(U(r)){const s=r.decorate(le,Be);s!==null&&_i(n,s),o.contentEditable="false"}else I(r)&&(r.isDirectionless()||(ae+=i));Z+=i,De+=i}if(e!==null)if(t!=null)e.insertBefore(o,t);else{const i=e.__lexicalLineBreak;i!=null?e.insertBefore(o,i):e.appendChild(o)}return Er(Bt,Wt,Nn,r,"created"),o}function $r(n,e,t,r,o,i){const s=Z;Z="";let l=t;for(;l<=r;++l){Dn(n[l],o,i);const a=ye.get(n[l]);a!==null&&I(a)&&(Se===null&&(Se=a.getFormat()),xe===""&&(xe=a.getStyle()))}Cn(e)&&(Z+=Pe),o.__lexicalTextContent=Z,Z=s+Z}function gi(n,e){const t=e.get(n);return mt(t)||U(t)&&t.isInline()}function pi(n,e,t){const r=n!==null&&(n.__size===0||gi(n.__last,Qe)),o=e.__size===0||gi(e.__last,ye);if(r){if(!o){const i=t.__lexicalLineBreak;if(i!=null)try{t.removeChild(i)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${i.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(o){const i=document.createElement("br");t.__lexicalLineBreak=i,t.appendChild(i)}}function mi(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==Pn){const i=ae==="",s=i?Pn:(o=ae,ml.test(o)?"rtl":_l.test(o)?"ltr":null);if(s!==r){const l=e.classList,a=Be.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const h=yn(c);c=a[r]=h}l.remove(...c)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const h=yn(u);u=a[s]=h}u!==void 0&&l.add(...u)}e.dir=s}zt||(n.getWritable().__dir=s)}Pn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var o}function Rl(n,e,t){const r=ae;var o;ae="",Se=null,xe="",function(i,s,l){const a=Z,c=i.__size,u=s.__size;if(Z="",c===1&&u===1){const h=i.__first,d=s.__first;if(h===d)Kt(h,l);else{const g=Wr(h),m=Dn(d,null,null);try{l.replaceChild(m,g)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${h}}.`;throw new Error(v)}throw _}On(h,null)}const f=ye.get(d);I(f)&&(Se===null&&(Se=f.getFormat()),xe===""&&(xe=f.getStyle()))}else{const h=In(i,Qe),d=In(s,ye);if(c===0)u!==0&&$r(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const f=l.__lexicalLineBreak==null;jr(h,0,c-1,f?null:l),f&&(l.textContent="")}}else(function(f,g,m,_,v,y){const x=_-1,S=v-1;let w,C,N=($=y,$.firstChild),T=0,P=0;for(var $;T<=x&&P<=S;){const q=g[T],R=m[P];if(q===R)N=Rr(Kt(R,y)),T++,P++;else{w===void 0&&(w=new Set(g)),C===void 0&&(C=new Set(m));const ce=C.has(q),Me=w.has(R);if(ce)if(Me){const Je=wn(le,R);Je===N?N=Rr(Kt(R,y)):(N!=null?y.insertBefore(Je,N):y.appendChild(Je),Kt(R,y)),T++,P++}else Dn(R,y,N),P++;else N=Rr(Wr(q)),On(q,y),T++}const Y=ye.get(R);Y!==null&&I(Y)&&(Se===null&&(Se=Y.getFormat()),xe===""&&(xe=Y.getStyle()))}const B=T>x,ee=P>S;if(B&&!ee){const q=m[S+1];$r(m,f,P,S,y,q===void 0?null:le.getElementByKey(q))}else ee&&!B&&jr(g,T,x,y)})(s,h,d,c,u,l)}Cn(s)&&(Z+=Pe),l.__lexicalTextContent=Z,Z=a+Z}(n,e,t),mi(e,t),io(o=e)&&Se!=null&&Se!==o.__textFormat&&!zt&&(o.setTextFormat(Se),o.setTextStyle(xe)),function(i){io(i)&&xe!==""&&xe!==i.__textStyle&&!zt&&i.setTextStyle(xe)}(e),ae=r}function In(n,e){const t=[];let r=n.__first;for(;r!==null;){const o=e.get(r);o===void 0&&D(101),t.push(r),r=o.__next}return t}function Kt(n,e){const t=Qe.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||D(61);const o=di||Lr.has(n)||Mr.has(n),i=wn(le,n);if(t===r&&!o){if(b(t)){const s=i.__lexicalTextContent;s!==void 0&&(Z+=s,De+=s);const l=i.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();I(t)&&!t.isDirectionless()&&(ae+=s),De+=s,Z+=s}return i}if(t!==r&&o&&Er(Bt,Wt,Nn,r,"updated"),r.updateDOM(t,i,Be)){const s=Dn(n,null,null);return e===null&&D(62),e.replaceChild(s,i),On(n,null),s}if(b(t)&&b(r)){const s=r.__indent;s!==t.__indent&&fi(i,s);const l=r.__format;l!==t.__format&&hi(i,l),o&&(Rl(t,r,i),ie(r)||r.isInline()||pi(t,r,i)),Cn(r)&&(Z+=Pe,De+=Pe)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Be);l!==null&&_i(n,l)}else I(r)&&!r.isDirectionless()&&(ae+=s);Z+=s,De+=s}if(!zt&&ie(r)&&r.__cachedText!==De){const s=r.getWritable();s.__cachedText=De,r=s}return i}function _i(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=Go(le)}t[n]=e}function Rr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Wl(n,e,t,r,o,i){Z="",De="",ae="",di=r===ct,Pn=null,le=t,Be=t._config,Wt=t._nodes,Nn=le._listeners.mutation,Mr=o,Lr=i,Qe=n._nodeMap,ye=e._nodeMap,zt=e._readOnly,Ar=new Map(t._keyToDOMMap);const s=new Map;return Bt=s,Kt("root",null),le=void 0,Wt=void 0,Mr=void 0,Lr=void 0,Qe=void 0,ye=void 0,Be=void 0,Ar=void 0,Bt=void 0,s}function Wr(n){const e=Ar.get(n);return e===void 0&&D(75,n),e}const Ie=Object.freeze({}),Br=30,zr=[["keydown",function(n,e){if(Ut=n.timeStamp,yi=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=n;L(e,Hs,n)||t!=null&&(function(l,a,c,u){return oi(l)&&!a&&!u&&!c}(t,o,s,i)?L(e,So,n):function(l,a,c,u,h){return oi(l)&&!u&&!c&&(a||h)}(t,o,r,s,i)?L(e,Gs,n):function(l,a,c,u){return ri(l)&&!a&&!u&&!c}(t,o,s,i)?L(e,Eo,n):function(l,a,c,u,h){return ri(l)&&!u&&!c&&(a||h)}(t,o,r,s,i)?L(e,Xs,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,o,i)?L(e,To,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,o,i)?L(e,ko,n):function(l,a){return ii(l)&&a}(t,r)?(Vt=!0,L(e,dn,n)):function(l){return l===" "}(t)?L(e,Qs,n):function(l,a){return _e&&a&&l.toLowerCase()==="o"}(t,o)?(n.preventDefault(),Vt=!0,L(e,lt,!0)):function(l,a){return ii(l)&&!a}(t,r)?(Vt=!1,L(e,dn,n)):function(l,a,c,u){return _e?!a&&!c&&(At(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&At(l)}(t,s,i,o)?At(t)?L(e,No,n):(n.preventDefault(),L(e,qe,!0)):function(l){return l==="Escape"}(t)?L(e,Po,n):function(l,a,c,u,h){return _e?!(c||u||h)&&(jt(l)||l.toLowerCase()==="d"&&a):!(a||u||h)&&jt(l)}(t,o,r,s,i)?jt(t)?L(e,Oo,n):(n.preventDefault(),L(e,qe,!1)):function(l,a,c){return At(l)&&(_e?a:c)}(t,s,o)?(n.preventDefault(),L(e,Nt,!0)):function(l,a,c){return jt(l)&&(_e?a:c)}(t,s,o)?(n.preventDefault(),L(e,Nt,!1)):function(l,a){return _e&&a&&At(l)}(t,i)?(n.preventDefault(),L(e,Pt,!0)):function(l,a){return _e&&a&&jt(l)}(t,i)?(n.preventDefault(),L(e,Pt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&Lt(c,u)}(t,s,i,o)?(n.preventDefault(),L(e,ge,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&Lt(c,u)}(t,s,i,o)?(n.preventDefault(),L(e,ge,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&Lt(c,u)}(t,s,i,o)?(n.preventDefault(),L(e,ge,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,o,i)?L(e,Zs,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&Lt(c,u)}(t,r,i,o)?(n.preventDefault(),L(e,cn,void 0)):function(l,a,c,u){return _e?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,i,o)?(n.preventDefault(),L(e,un,void 0)):ve(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(_e?c:u)}(t,r,i,o)?(n.preventDefault(),L(e,fn,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(_e?c:u)}(t,r,i,o)?(n.preventDefault(),L(e,ir,n)):si(t,i,o)&&(n.preventDefault(),L(e,sr,n)):!$e&&si(t,i,o)&&(n.preventDefault(),L(e,sr,n)),function(l,a,c,u){return l||a||c||u}(o,r,s,i)&&L(e,ll,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{U(Xe(t))||(Ur=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=A();if(O(t)&&!e.isComposing()){const r=t.anchor,o=t.anchor.getNode();re(r.key),(n.timeStamp<Ut+Br||r.type==="element"||!t.isCollapsed()||o.getFormat()!==t.format||I(o)&&o.getStyle()!==t.style)&&L(e,at,pl)}})}],["compositionend",function(n,e){$e?Jt=!0:he(e,()=>{Vr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=A(),r=n.data,o=Si(n);if(r!=null&&O(t)&&bi(t,o,r,n.timeStamp,!1)){Jt&&(Vr(e,r),Jt=!1);const i=t.anchor.getNode(),s=we(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;hn&&!t.isCollapsed()&&I(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+c)===ni(s.anchorNode)||L(e,at,r);const u=r.length;$e&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),lr||gn||ar||!e.isComposing()||(Ut=0,re(null))}else wr(!1,e,r!==null?r:void 0),Jt&&(Vr(e,r||void 0),Jt=!1);fe(),Bo(H())}),gt=null}],["click",function(n,e){he(e,()=>{const t=A(),r=we(e._window),o=Gt();if(r){if(O(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!ie(s)&&G().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(b(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const i=r.anchorNode;if(i!==null){const s=i.nodeType;(s===Ft||s===Re)&&Ce(Zr(o,r,e,n))}}}L(e,wo,n)})}],["cut",Ie],["copy",Ie],["dragstart",Ie],["dragover",Ie],["dragend",Ie],["paste",Ie],["focus",Ie],["blur",Ie],["drop",Ie]];hn&&zr.push(["beforeinput",(n,e)=>function(t,r){const o=t.inputType,i=Si(t);o==="deleteCompositionText"||$e&&ai(r)||o!=="insertCompositionText"&&he(r,()=>{const s=A();if(o==="deleteContentBackward"){if(s===null){const f=Gt();if(!O(f))return;Ce(f.clone())}if(O(s)){const f=s.anchor.key===s.focus.key;if(l=t.timeStamp,yi==="MediaLast"&&l<Ut+Br&&r.isComposing()&&f){if(re(null),Ut=0,setTimeout(()=>{he(r,()=>{re(null)})},Br),O(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),I(g)||D(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===g.length;ul&&f&&!m||L(r,qe,!0)}return}}var l;if(!O(s))return;const a=t.data;gt!==null&&wr(!1,r,gt),s.dirty&&gt===null||!s.isCollapsed()||ie(s.anchor.getNode())||i===null||s.applyDOMRange(i),gt=null;const c=s.anchor,u=s.focus,h=c.getNode(),d=u.getNode();if(o!=="insertText"&&o!=="insertTranspose")switch(t.preventDefault(),o){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":L(r,at,t);break;case"insertFromComposition":re(null),L(r,at,t);break;case"insertLineBreak":re(null),L(r,lt,!1);break;case"insertParagraph":re(null),Vt&&!gn?(Vt=!1,L(r,lt,!1)):L(r,an,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":L(r,rr,t);break;case"deleteByComposition":(function(f,g){return f!==g||b(f)||b(g)||!f.isToken()||!g.isToken()})(h,d)&&L(r,or,t);break;case"deleteByDrag":case"deleteByCut":L(r,or,t);break;case"deleteContent":L(r,qe,!1);break;case"deleteWordBackward":L(r,Nt,!0);break;case"deleteWordForward":L(r,Nt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":L(r,Pt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":L(r,Pt,!1);break;case"formatStrikeThrough":L(r,ge,"strikethrough");break;case"formatBold":L(r,ge,"bold");break;case"formatItalic":L(r,ge,"italic");break;case"formatUnderline":L(r,ge,"underline");break;case"historyUndo":L(r,cn,void 0);break;case"historyRedo":L(r,un,void 0)}else{if(a===`
32
- `)t.preventDefault(),L(r,lt,!1);else if(a===Pe)t.preventDefault(),L(r,an,void 0);else if(a==null&&t.dataTransfer){const f=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(f)}else a!=null&&bi(s,i,a,t.timeStamp,!0)?(t.preventDefault(),L(r,at,a)):gt=a;xi=t.timeStamp}})}(n,e)]);let Ut=0,yi=null,xi=0,gt=null;const Fn=new WeakMap;let Kr=!1,Ur=!1,Vt=!1,Jt=!1,vi=[0,"",0,"root",0];function bi(n,e,t,r,o){const i=n.anchor,s=n.focus,l=i.getNode(),a=H(),c=we(a._window),u=c!==null?c.anchorNode:null,h=i.key,d=a.getElementByKey(h),f=t.length;return h!==s.key||!I(l)||(!o&&(!hn||xi<r+50)||l.isDirty()&&f<2||ei(t))&&i.offset!==s.offset&&!l.isComposing()||ut(l)||l.isDirty()&&f>1||(o||!hn)&&d!==null&&!l.isComposing()&&u!==vn(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Dl(n,l)}function Ci(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Re&&e!==0&&e!==n.nodeValue.length}function wi(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=n;Kr&&(Kr=!1,Ci(r,o)&&Ci(i,s))||he(e,()=>{if(!t)return void Ce(null);if(!Mt(e,r,i))return;const l=A();if(O(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=En(e).event,h=u?u.timeStamp:performance.now(),[d,f,g,m,_]=vi,v=G(),y=e.isComposing()===!1&&v.getTextContent()==="";if(h<_+200&&a.offset===g&&a.key===m)l.format=d,l.style=f;else if(a.type==="text")I(c)||D(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!y){const x=a.getNode();l.style="",x instanceof yt&&x.getChildrenSize()===0?(l.format=x.getTextFormat(),l.style=x.getTextStyle()):l.format=0}}else{const u=a.key,h=l.focus.key,d=l.getNodes(),f=d.length,g=l.isBackward(),m=g?s:o,_=g?o:s,v=g?h:u,y=g?u:h;let x=gl,S=!1;for(let w=0;w<f;w++){const C=d[w],N=C.getTextContentSize();if(I(C)&&N!==0&&!(w===0&&C.__key===v&&m===N||w===f-1&&C.__key===y&&_===0)&&(S=!0,x&=C.getFormat(),x===0))break}l.format=S?x:0}}L(e,ln,void 0)})}function Si(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Vr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),o=vn(n.getElementByKey(t));return void(o!==null&&o.nodeValue!==null&&I(r)&&Sr(r,o.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
- `){const r=A();if(O(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void L(n,dn,null)}}}wr(!0,n,e)}function Ei(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const pt=new Map;function Ti(n){const e=n.target,t=we(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=qo(t.anchorNode);if(r===null)return;Ur&&(Ur=!1,he(r,()=>{const c=Gt(),u=t.anchorNode;if(u===null)return;const h=u.nodeType;h!==Ft&&h!==Re||Ce(Zr(c,t,r,n))}));const o=Cr(r),i=o[o.length-1],s=i._key,l=pt.get(s),a=l||i;a!==r&&wi(t,a,!1),wi(t,r,!0),r!==i?pt.set(s,r):l&&pt.delete(s)}function ki(n){n._lexicalHandled=!0}function Ni(n){return n._lexicalHandled===!0}function Bl(n){const e=n.ownerDocument,t=Fn.get(e);t===void 0&&D(162);const r=t-1;r>=0||D(164),Fn.set(e,r),r===0&&e.removeEventListener("selectionchange",Ti);const o=xn(n);vr(o)?(function(s){if(s._parentEditor!==null){const l=Cr(s),a=l[l.length-1]._key;pt.get(a)===s&&pt.delete(a)}else pt.delete(s._key)}(o),n.__lexicalEditor=null):o&&D(198);const i=Ei(n);for(let s=0;s<i.length;s++)i[s]();n.__lexicalEventHandles=[]}function Jr(n,e,t){fe();const r=n.__key,o=n.getParent();if(o===null)return;const i=function(l){const a=A();if(!O(a)||!b(l))return a;const{anchor:c,focus:u}=a,h=c.getNode(),d=u.getNode();return Tr(h,l)&&c.set(l.__key,0,"element"),Tr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(O(i)&&e){const l=i.anchor,a=i.focus;l.key===r&&(Rn(l,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Rn(a,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else ve(i)&&e&&n.isSelected()&&n.selectPrevious();if(O(i)&&e&&!s){const l=n.getIndexWithinParent();Ge(n),$n(i,o,l,-1)}else Ge(n);t||ft(o)||o.canBeEmpty()||!o.isEmpty()||Jr(o,e),e&&ie(o)&&o.isEmpty()&&o.selectEnd()}class Mn{static getType(){D(64,this.name)}static clone(e){D(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Ol(this,e)}getType(){return this.__type}isInline(){D(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=se(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||A();if(t==null)return!1;const r=t.getNodes().some(o=>o.__key===this.__key);if(I(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const o=this.getParent();if(U(this)&&this.isInline()&&o){const i=t.isBackward()?t.focus:t.anchor,s=i.getNode();if(i.offset===s.getChildrenSize()&&s.is(o)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:se(e)}getParentOrThrow(){const e=this.getParent();return e===null&&D(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(ft(t))return b(e)||e===this&&U(e)||D(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&D(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:se(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:se(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();b(this)&&t.unshift(this),b(e)&&r.unshift(e);const o=t.length,i=r.length;if(o===0||i===0||t[o-1]!==r[i-1])return null;const s=new Set(r);for(let l=0;l<o;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,o=0,i=this;for(;;){const s=i.getParentOrThrow();if(s===t){r=i.getIndexWithinParent();break}i=s}for(i=e;;){const s=i.getParentOrThrow();if(s===t){o=i.getIndexWithinParent();break}i=s}return r<o}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===e)break;const l=b(i)?t?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(a!==null){i=a;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===e)break;let u=null,h=c;do{if(h===null&&D(68),u=t?h.getNextSibling():h.getPreviousSibling(),h=h.getParent(),h===null)break;u!==null||o.has(h.__key)||r.push(h)}while(u===null);i=u}return t||r.reverse(),r}isDirty(){const e=H()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&D(113),e}getWritable(){fe();const e=Fe(),t=H(),r=e._nodeMap,o=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,l=A();if(l!==null&&l.setCachedNodes(null),s.has(o))return bn(i),i;const a=Fr(i);return s.add(o),bn(a),r.set(o,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){D(70)}updateDOM(e,t,r){D(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){D(72)}static importJSON(e){D(18,this.name)}static transform(){return null}remove(e){Jr(this,!0,e)}replace(e,t){fe();let r=A();r!==null&&(r=r.clone()),kr(this,e);const o=this.getLatest(),i=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Ge(l);const u=o.getPreviousSibling(),h=o.getNextSibling(),d=o.__prev,f=o.__next,g=o.__parent;if(Jr(o,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,h===null?a.__last=s:h.getWritable().__prev=s,l.__next=f,l.__parent=g,a.__size=c,t&&(b(this)&&b(l)||D(139),this.getChildren().forEach(m=>{l.append(m)})),O(r)){Ce(r);const m=r.anchor,_=r.focus;m.key===i&&Mi(m,l),_.key===i&&Mi(_,l)}return We()===i&&re(s),l}insertAfter(e,t=!0){fe(),kr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.getParent(),s=A();let l=!1,a=!1;if(i!==null){const f=e.getIndexWithinParent();if(Ge(o),O(s)){const g=i.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===g&&m.offset===f+1,a=_.type==="element"&&_.key===g&&_.offset===f+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),h=o.__key,d=r.__next;if(c===null?u.__last=h:c.getWritable().__prev=h,u.__size++,r.__next=h,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,t&&O(s)){const f=this.getIndexWithinParent();$n(s,u,f+1);const g=u.__key;l&&s.anchor.set(g,f+2,"element"),a&&s.focus.set(g,f+2,"element")}return e}insertBefore(e,t=!0){fe(),kr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.__key;Ge(o);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=i:s.getWritable().__next=i,l.__size++,r.__prev=i,o.__prev=a,o.__next=r.__key,o.__parent=r.__parent;const u=A();return t&&O(u)&&$n(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Te()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){fe();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(b(r))return r.select();if(!I(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(e,t)}selectNext(e,t){fe();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(b(r))return r.select(0,0);if(!I(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(e,t)}markDirty(){this.getWritable()}}class Yt extends Mn{static getType(){return"linebreak"}static clone(e){return new Yt(e.__key)}constructor(e){super(e)}getTextContent(){return`
34
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&kn(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&Ln(o)){const i=r.lastChild;if(i===t||i.previousSibling===t&&Ln(i))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&kn(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&Ln(o))return!1;const i=r.lastChild;if(i===t||i.previousSibling===t&&Ln(i))return!0}return!1}(e)?null:{conversion:zl,priority:0}}}static importJSON(e){return et()}exportJSON(){return{type:"linebreak",version:1}}}function zl(n){return{node:et()}}function et(){return Tn(new Yt)}function mt(n){return n instanceof Yt}function Ln(n){return n.nodeType===Re&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Yr(n,e){return 16&e?"code":e&cr?"mark":32&e?"sub":64&e?"sup":null}function qr(n,e){return 1&e?"strong":2&e?"em":"span"}function Pi(n,e,t,r,o){const i=r.classList;let s=$t(o,"base");s!==void 0&&i.add(...s),s=$t(o,"underlineStrikethrough");let l=!1;const a=e&mn&&e&pn;s!==void 0&&(t&mn&&t&pn?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(const c in Oe){const u=Oe[c];if(s=$t(o,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&i.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||i.add(...s)}else e&u&&i.remove(...s)}}function Oi(n,e,t){const r=e.firstChild,o=t.isComposing(),i=n+(o?_n:"");if(r==null)e.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||$e){const[l,a,c]=function(u,h){const d=u.length,f=h.length;let g=0,m=0;for(;g<d&&g<f&&u[g]===h[g];)g++;for(;m+g<d&&m+g<f&&u[d-m-1]===h[f-m-1];)m++;return[g,d-g-m,h.slice(g,f-m)]}(s,i);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=i}}function Di(n,e,t,r,o,i){Oi(o,n,e);const s=i.theme.text;s!==void 0&&Pi(0,0,r,n,s)}function An(n,e){const t=document.createElement(e);return t.appendChild(n),t}class _t extends Mn{static getType(){return"text"}static clone(e){return new _t(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return bl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===We()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Oe[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return br(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,o=Yr(0,r),i=qr(0,r),s=o===null?i:o,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(a=document.createElement(i),l.appendChild(a)),Di(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const o=this.__text,i=e.__format,s=this.__format,l=Yr(0,i),a=Yr(0,s),c=qr(0,i),u=qr(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&D(48);const _=document.createElement(u);return Di(_,this,0,s,o,r),t.replaceChild(_,m),!1}let h=t;a!==null&&l!==null&&(h=t.firstChild,h==null&&D(49)),Oi(o,h,this);const d=r.theme.text;d!==void 0&&i!==s&&Pi(0,i,s,h,d);const f=e.__style,g=this.__style;return f!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Jl,priority:0}),b:()=>({conversion:Ul,priority:0}),code:()=>({conversion:ze,priority:0}),em:()=>({conversion:ze,priority:0}),i:()=>({conversion:ze,priority:0}),s:()=>({conversion:ze,priority:0}),span:()=>({conversion:Kl,priority:0}),strong:()=>({conversion:ze,priority:0}),sub:()=>({conversion:ze,priority:0}),sup:()=>({conversion:ze,priority:0}),u:()=>({conversion:ze,priority:0})}}static importJSON(e){const t=oe(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&Or(t)||D(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=An(t,"b")),this.hasFormat("italic")&&(t=An(t,"i")),this.hasFormat("strikethrough")&&(t=An(t,"s")),this.hasFormat("underline")&&(t=An(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?Oe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?yl[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=br(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=vl[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){fe();let r=e,o=t;const i=A(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),o===void 0&&(o=a)}else r=0,o=0;if(!O(i))return Bi(l,r,l,o,"text","text");{const a=We();a!==i.anchor.key&&a!==i.focus.key||re(l),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,o){const i=this.getWritable(),s=i.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=A();if(o&&O(c)){const h=e+l;c.setTextNodeRange(i,h,i,h)}const u=s.slice(0,a)+r+s.slice(a+t);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){fe();const t=this.getLatest(),r=t.getTextContent(),o=t.__key,i=We(),s=new Set(e),l=[],a=r.length;let c="";for(let w=0;w<a;w++)c!==""&&s.has(w)&&(l.push(c),c=""),c+=r[w];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const h=l[0],d=t.getParent();let f;const g=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(f=oe(h),f.__format=g,f.__style=m,f.__detail=_,v=!0):(f=t.getWritable(),f.__text=h);const y=A(),x=[f];let S=h.length;for(let w=1;w<u;w++){const C=l[w],N=C.length,T=oe(C).getWritable();T.__format=g,T.__style=m,T.__detail=_;const P=T.__key,$=S+N;if(O(y)){const B=y.anchor,ee=y.focus;B.key===o&&B.type==="text"&&B.offset>S&&B.offset<=$&&(B.key=P,B.offset-=S,y.dirty=!0),ee.key===o&&ee.type==="text"&&ee.offset>S&&ee.offset<=$&&(ee.key=P,ee.offset-=S,y.dirty=!0)}i===o&&re(P),S=$,x.push(T)}if(d!==null){(function(N){const T=N.getPreviousSibling(),P=N.getNextSibling();T!==null&&bn(T),P!==null&&bn(P)})(this);const w=d.getWritable(),C=this.getIndexWithinParent();v?(w.splice(C,0,x),this.remove()):w.splice(C,1,x),O(y)&&$n(y,d,C,u-1)}return x}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||D(50);const r=this.__key,o=e.__key,i=this.__text,s=i.length;We()===o&&re(r);const l=A();if(O(l)){const h=l.anchor,d=l.focus;h!==null&&h.key===o&&(Ui(h,t,r,e,s),l.dirty=!0),d!==null&&d.key===o&&(Ui(d,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+i:i+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Kl(n){return{forChild:Hr(n.style),node:null}}function Ul(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Hr(e.style,t?void 0:"bold"),node:null}}const Ii=new WeakMap;function Vl(n){return n.nodeName==="PRE"||n.nodeType===Ft&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function Jl(n){const e=n;n.parentElement===null&&D(129);let t=e.textContent||"";if(function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=Ii.get(i))===void 0&&!Vl(i);)s.push(i),i=i.parentNode;const l=o===void 0?i:o;for(let a=0;a<s.length;a++)Ii.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const l=r[s];l===`
31
+ `,ga=st?" ":Fn,yi="֑-߿יִ-﷽ﹰ-ﻼ",vi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ma=new RegExp("^[^"+vi+"]*["+yi+"]"),_a=new RegExp("^[^"+yi+"]*["+vi+"]"),Xe={bold:1,code:16,highlight:Ir,italic:2,strikethrough:Ln,subscript:32,superscript:64,underline:jn},ya={directionless:1,unmergeable:2},xi={center:Dr,end:Fr,justify:Lr,left:Rr,right:Mr,start:jr},va={[Dr]:"center",[Fr]:"end",[Lr]:"justify",[Rr]:"left",[Mr]:"right",[jr]:"start"},xa={normal:0,segmented:2,token:1},Ta={[fa]:"normal",[ha]:"segmented",[da]:"token"};function ba(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var R=ba(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Bn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Ca=100;let Br=!1,Wr=0;function Ea(n){Wr=n.timeStamp}function $r(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function Sa(n,e,t){const r=Ye(t._window);let o=null,i=null;r!==null&&r.anchorNode===n&&(o=r.anchorOffset,i=r.focusOffset);const s=n.nodeValue;s!==null&&qr(e,s,o,i,!1)}function wa(n,e,t){if(I(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===lt&&t.isAttached()}function Ti(n,e,t){Br=!0;const r=performance.now()-Wr>Ca;try{Re(n,()=>{const o=B()||function(f){return f.getEditorState().read(()=>{const h=B();return h!==null?h.clone():null})}(n),i=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],p=h.type,g=h.target;let m=_t(g,l);if(!(m===null&&g!==s||se(m))){if(p==="characterData")r&&D(m)&&wa(o,g,m)&&Sa(g,m,n);else if(p==="childList"){c=!0;const T=h.addedNodes;for(let b=0;b<T.length;b++){const x=T[b],C=Oi(x),N=x.parentNode;if(N!=null&&x!==a&&C===null&&(x.nodeName!=="BR"||!$r(x,N,n))){if(st){const w=x.innerText||x.nodeValue;w&&(u+=w)}N.removeChild(x)}}const v=h.removedNodes,y=v.length;if(y>0){let b=0;for(let x=0;x<y;x++){const C=v[x];(C.nodeName==="BR"&&$r(C,g,n)||a===C)&&(g.appendChild(C),b++)}y!==b&&(g===s&&(m=Ri(l)),i.set(g,m))}}}}if(i.size>0)for(const[f,h]of i)if(E(h)){const p=h.getChildrenKeys();let g=f.firstChild;for(let m=0;m<p.length;m++){const T=p[m],v=n.getElementByKey(T);v!==null&&(g==null?(f.appendChild(v),g=v):g!==v&&f.replaceChild(v,g),g=g.nextSibling)}}else D(h)&&h.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],p=h.addedNodes,g=h.target;for(let m=0;m<p.length;m++){const T=p[m],v=T.parentNode;v==null||T.nodeName!=="BR"||$r(T,g,n)||v.removeChild(T)}}t.takeRecords()}o!==null&&(c&&(o.dirty=!0,He(o)),st&&Ui(n)&&o.insertRawText(u))})}finally{Br=!1}}function bi(n){const e=n._observer;e!==null&&Ti(n,e.takeRecords(),e)}function Ci(n){(function(e){Wr===0&&Kn(e).addEventListener("textInput",Ea,!0)})(n),n._observer=new MutationObserver((e,t)=>{Ti(n,e,t)})}function Ei(n,e){const t=n.__mode,r=n.__format,o=n.__style,i=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==i||r!==null&&r!==s||o!==null&&o!==l)}function Si(n,e){const t=n.mergeWithSibling(e),r=pe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function wi(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ei(e,r)){r=Si(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ei(r,t)){r=Si(r,t);break}break}t.remove()}}else r.remove()}function ki(n){return Pi(n.anchor),Pi(n.focus),n}function Pi(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),D(r)){n.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!E(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element")}}let ka=1;const Pa=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function zr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return se(_t(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Wn(e)==null)}function Zt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!zr(e)&&Ni(e)===n}catch{return!1}}function Ur(n){return n instanceof ur}function Ni(n){let e=n;for(;e!=null;){const t=Wn(e);if(Ur(t))return t;e=Yn(e)}return null}function Wn(n){return n?n.__lexicalEditor:null}function Ot(n){return n.isToken()||n.isSegmented()}function Na(n){return n.nodeType===lt}function $n(n){let e=n;for(;e!=null;){if(Na(e))return e;e=e.firstChild}return null}function Hr(n,e,t){const r=Xe[e];if(t!==null&&(n&r)==(t&r))return n;let o=n^r;return e==="subscript"?o&=~Xe.superscript:e==="superscript"&&(o&=~Xe.subscript),o}function Oa(n,e){if(e!=null)return void(n.__key=e);Ae(),ks();const t=pe(),r=et(),o=""+ka++;r._nodeMap.set(o,n),E(n)?t._dirtyElements.set(o,!0):t._dirtyLeaves.add(o),t._cloneNotNeeded.add(o),t._dirtyType=_i,n.__key=o}function mt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),o=n.getPreviousSibling(),i=n.getNextSibling();if(o===null)if(i!==null){const s=i.getWritable();r.__first=i.__key,s.__prev=null}else r.__first=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(i===null)if(o!==null){const s=o.getWritable();r.__last=o.__key,s.__next=null}else r.__last=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function zn(n){ks();const e=n.getLatest(),t=e.__parent,r=et(),o=pe(),i=r._nodeMap,s=o._dirtyElements;t!==null&&function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(t,i,s);const l=e.__key;o._dirtyType=_i,E(n)?s.set(l,!0):o._dirtyLeaves.add(l)}function Te(n){Ae();const e=pe(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=we(t);r!==null&&r.getWritable()}if(n!==null){const r=we(n);r!==null&&r.getWritable()}}}function at(){return _n()?null:pe()._compositionKey}function we(n,e){const t=(e||et())._nodeMap.get(n);return t===void 0?null:t}function Oi(n,e){const t=n[`__lexicalKey_${pe()._key}`];return t!==void 0?we(t,e):null}function _t(n,e){let t=n;for(;t!=null;){const r=Oi(t,e);if(r!==null)return r;t=Yn(t)}return null}function Ai(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Ii(n){return n.read(()=>ge().getTextContent())}function ge(){return Ri(et())}function Ri(n){return n._nodeMap.get("root")}function He(n){Ae();const e=et();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function At(n){const e=pe(),t=function(r,o){let i=r;for(;i!=null;){const s=i[`__lexicalKey_${o._key}`];if(s!==void 0)return s;i=Yn(i)}return null}(n,e);return t===null?n===e.getRootElement()?we("root"):null:we(t)}function Di(n,e){return e?n.getTextContentSize():0}function Mi(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Yr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Li(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ji(n){return n.nodeType===lt?n.nodeValue:null}function Kr(n,e,t){const r=Ye(e._window);if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let l=ji(o);const a=_t(o);if(l!==null&&D(a)){if(l===Fn&&t){const c=t.length;l=t,i=c,s=c}l!==null&&qr(a,l,i,s,n)}}}function qr(n,e,t,r,o){let i=n;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let l=e;(s||o)&&e[e.length-1]===Fn&&(l=e.slice(0,-1));const a=i.getTextContent();if(o||l!==a){if(l===""){if(Te(null),Or||Mn||Ar)i.remove();else{const g=pe();setTimeout(()=>{g.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=mn(),d=i.getTextContentSize(),f=at(),h=i.getKey();if(i.isToken()||f!==null&&h===f&&!s||I(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===d&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const p=B();if(!I(p)||t===null||r===null)return void i.setTextContent(l);if(p.setTextNodeRange(i,t,i,r),i.isSegmented()){const g=Ce(i.getTextContent());i.replace(g),i=g}i.setTextContent(l)}}}function Aa(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),o=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||o||function(i){const s=i.getPreviousSibling();return(D(s)||E(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||o)}function Fi(n){return n==="ArrowLeft"}function Bi(n){return n==="ArrowRight"}function en(n,e){return Fe?n:e}function Wi(n){return n==="Enter"}function tn(n){return n==="Backspace"}function nn(n){return n==="Delete"}function $i(n,e,t){return n.toLowerCase()==="a"&&en(e,t)}function Ia(){const n=ge();He(ki(n.select(0,n.getChildrenSize())))}function rn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const o=n[e];if(typeof o=="string"){const i=Bn(o);return t[e]=i,i}return o}function Vr(n,e,t,r,o){if(t.size===0)return;const i=r.__type,s=r.__key,l=e.get(i);l===void 0&&R(33,i);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),d=u==="destroyed"&&o==="created";(u===void 0||d)&&c.set(s,d?"updated":o)}function zi(n,e,t){const r=n.getParent();let o=t,i=n;return r!==null&&(e&&t===0?(o=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?o-1:o)}function on(n,e){const t=n.offset;if(n.type==="element")return zi(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const o=e?r.getPreviousSibling():r.getNextSibling();return o===null?zi(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function Ui(n){const e=Kn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function j(n,e,t){return Is(n,e,t)}function Un(n){return!Ee(n)&&!n.isLastChild()&&!n.isInline()}function Hn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&R(75,e),t}function Yn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Jr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Kn(n){const e=n._window;return e===null&&R(78),e}function Ra(n){let e=n.getParentOrThrow();for(;e!==null;){if(It(e))return e;e=e.getParentOrThrow()}return e}function It(n){return Ee(n)||E(n)&&n.isShadowRoot()}function qn(n){const e=pe(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&R(97);const o=r.replace;if(o!==null){const i=o(n);return i instanceof n.constructor||R(98),i}return n}function Gr(n,e){!Ee(n.getParent())||E(e)||se(e)||R(99)}function Xr(n){return(se(n)||E(n)&&!n.canBeEmpty())&&!n.isInline()}function Qr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Da(n,e,t){let r=n._blockCursorElement;if(I(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const o=t.anchor,i=o.getNode(),s=o.offset;let l=!1,a=null;if(s===i.getChildrenSize())Xr(i.getChildAtIndex(s-1))&&(l=!0);else{const c=i.getChildAtIndex(s);if(Xr(c)){const u=c.getPreviousSibling();(u===null||Xr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(i.__key);return r===null&&(n._blockCursorElement=r=function(u){const d=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const p=Bn(h);h=d.blockCursor=p}h!==void 0&&f.classList.add(...h)}return f}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Qr(r,n,e)}function Ye(n){return je?(n||window).getSelection():null}function Zr(n){return n.nodeType===1}function eo(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Vn(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function Rt(n){if(Ee(n)||se(n)&&!n.isInline())return!0;if(!E(n)||It(n))return!1;const e=n.getFirstChild(),t=e===null||Lt(e)||D(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function to(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ma(){return pe()}const Hi=new WeakMap,La=new Map;function ja(n){if(!n._readOnly&&n.isEmpty())return La;n._readOnly||R(192);let e=Hi.get(n);if(!e){e=new Map,Hi.set(n,e);for(const[t,r]of n._nodeMap){const o=r.__type;let i=e.get(o);i||(i=new Map,e.set(o,i)),i.set(t,r)}}return e}function no(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Yi(n,e,t,r,o,i){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(E(s)&&Yi(s,l,t,r,o,i),t.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}let ct,ke,sn,Jn,ro,oo,yt,Be,io,ln,ye="",Pe="",Ke=null,We="",Qe="",Ki=!1,an=!1,Gn=null;function Xn(n,e){const t=yt.get(n);if(e!==null){const r=co(n);r.parentNode===e&&e.removeChild(r)}if(Be.has(n)||ke._keyToDOMMap.delete(n),E(t)){const r=Zn(t,yt);so(r,0,r.length-1,null)}t!==void 0&&Vr(ln,sn,Jn,t,"destroyed")}function so(n,e,t,r){let o=e;for(;o<=t;++o){const i=n[o];i!==void 0&&Xn(i,r)}}function vt(n,e){n.setProperty("text-align",e)}const Fa="40px";function qi(n,e){const t=ct.theme.indent;if(typeof t=="string"){const o=n.classList.contains(t);e>0&&!o?n.classList.add(t):e<1&&o&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Fa;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Vi(n,e){const t=n.style;e===0?vt(t,""):e===Rr?vt(t,"left"):e===Dr?vt(t,"center"):e===Mr?vt(t,"right"):e===Lr?vt(t,"justify"):e===jr?vt(t,"start"):e===Fr&&vt(t,"end")}function Qn(n,e,t){const r=Be.get(n);r===void 0&&R(60);const o=r.createDOM(ct,ke);if(function(i,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=i,a.set(i,s)}(n,o,ke),D(r)?o.setAttribute("data-lexical-text","true"):se(r)&&o.setAttribute("data-lexical-decorator","true"),E(r)){const i=r.__indent,s=r.__size;if(i!==0&&qi(o,i),s!==0){const a=s-1;(function(c,u,d,f){const h=Pe;Pe="",lo(c,d,0,u,f,null),Xi(d,f),Pe=h})(Zn(r,Be),a,r,o)}const l=r.__format;l!==0&&Vi(o,l),r.isInline()||Gi(null,r,o),Un(r)&&(ye+=Ge,Qe+=Ge)}else{const i=r.getTextContent();if(se(r)){const s=r.decorate(ke,ct);s!==null&&Qi(n,s),o.contentEditable="false"}else D(r)&&(r.isDirectionless()||(Pe+=i));ye+=i,Qe+=i}if(e!==null)if(t!=null)e.insertBefore(o,t);else{const i=e.__lexicalLineBreak;i!=null?e.insertBefore(o,i):e.appendChild(o)}return Vr(ln,sn,Jn,r,"created"),o}function lo(n,e,t,r,o,i){const s=ye;ye="";let l=t;for(;l<=r;++l){Qn(n[l],o,i);const a=Be.get(n[l]);a!==null&&D(a)&&(Ke===null&&(Ke=a.getFormat()),We===""&&(We=a.getStyle()))}Un(e)&&(ye+=Ge),o.__lexicalTextContent=ye,ye=s+ye}function Ji(n,e){const t=e.get(n);return Lt(t)||se(t)&&t.isInline()}function Gi(n,e,t){const r=n!==null&&(n.__size===0||Ji(n.__last,yt)),o=e.__size===0||Ji(e.__last,Be);if(r){if(!o){const i=t.__lexicalLineBreak;if(i!=null)try{t.removeChild(i)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${i.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(o){const i=document.createElement("br");t.__lexicalLineBreak=i,t.appendChild(i)}}function Xi(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==Pe||r!==Gn){const i=Pe==="",s=i?Gn:(o=Pe,ma.test(o)?"rtl":_a.test(o)?"ltr":null);if(s!==r){const l=e.classList,a=ct.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const d=Bn(c);c=a[r]=d}l.remove(...c)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const d=Bn(u);u=a[s]=d}u!==void 0&&l.add(...u)}e.dir=s}an||(n.getWritable().__dir=s)}Gn=s,e.__lexicalDirTextContent=Pe,e.__lexicalDir=s}var o}function Ba(n,e,t){const r=Pe;var o;Pe="",Ke=null,We="",function(i,s,l){const a=ye,c=i.__size,u=s.__size;if(ye="",c===1&&u===1){const d=i.__first,f=s.__first;if(d===f)cn(d,l);else{const p=co(d),g=Qn(f,null,null);try{l.replaceChild(g,p)}catch(m){if(typeof m=="object"&&m!=null){const T=`${m.toString()} Parent: ${l.tagName}, new child: {tag: ${g.tagName} key: ${f}}, old child: {tag: ${p.tagName}, key: ${d}}.`;throw new Error(T)}throw m}Xn(d,null)}const h=Be.get(f);D(h)&&(Ke===null&&(Ke=h.getFormat()),We===""&&(We=h.getStyle()))}else{const d=Zn(i,yt),f=Zn(s,Be);if(c===0)u!==0&&lo(f,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;so(d,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,p,g,m,T,v){const y=m-1,b=T-1;let x,C,N=(z=v,z.firstChild),w=0,O=0;for(var z;w<=y&&O<=b;){const le=p[w],H=g[O];if(le===H)N=ao(cn(H,v)),w++,O++;else{x===void 0&&(x=new Set(p)),C===void 0&&(C=new Set(g));const ue=C.has(le),be=x.has(H);if(ue)if(be){const De=Hn(ke,H);De===N?N=ao(cn(H,v)):(N!=null?v.insertBefore(De,N):v.appendChild(De),cn(H,v)),w++,O++}else Qn(H,v,N),O++;else N=ao(co(le)),Xn(le,v),w++}const ie=Be.get(H);ie!==null&&D(ie)&&(Ke===null&&(Ke=ie.getFormat()),We===""&&(We=ie.getStyle()))}const X=w>y,he=O>b;if(X&&!he){const le=g[b+1];lo(g,h,O,b,v,le===void 0?null:ke.getElementByKey(le))}else he&&!X&&so(p,w,y,v)})(s,d,f,c,u,l)}Un(s)&&(ye+=Ge),l.__lexicalTextContent=ye,ye=a+ye}(n,e,t),Xi(e,t),No(o=e)&&Ke!=null&&Ke!==o.__textFormat&&!an&&(o.setTextFormat(Ke),o.setTextStyle(We)),function(i){No(i)&&We!==""&&We!==i.__textStyle&&!an&&i.setTextStyle(We)}(e),Pe=r}function Zn(n,e){const t=[];let r=n.__first;for(;r!==null;){const o=e.get(r);o===void 0&&R(101),t.push(r),r=o.__next}return t}function cn(n,e){const t=yt.get(n);let r=Be.get(n);t!==void 0&&r!==void 0||R(61);const o=Ki||oo.has(n)||ro.has(n),i=Hn(ke,n);if(t===r&&!o){if(E(t)){const s=i.__lexicalTextContent;s!==void 0&&(ye+=s,Qe+=s);const l=i.__lexicalDirTextContent;l!==void 0&&(Pe+=l)}else{const s=t.getTextContent();D(t)&&!t.isDirectionless()&&(Pe+=s),Qe+=s,ye+=s}return i}if(t!==r&&o&&Vr(ln,sn,Jn,r,"updated"),r.updateDOM(t,i,ct)){const s=Qn(n,null,null);return e===null&&R(62),e.replaceChild(s,i),Xn(n,null),s}if(E(t)&&E(r)){const s=r.__indent;s!==t.__indent&&qi(i,s);const l=r.__format;l!==t.__format&&Vi(i,l),o&&(Ba(t,r,i),Ee(r)||r.isInline()||Gi(t,r,i)),Un(r)&&(ye+=Ge,Qe+=Ge)}else{const s=r.getTextContent();if(se(r)){const l=r.decorate(ke,ct);l!==null&&Qi(n,l)}else D(r)&&!r.isDirectionless()&&(Pe+=s);ye+=s,Qe+=s}if(!an&&Ee(r)&&r.__cachedText!==Qe){const s=r.getWritable();s.__cachedText=Qe,r=s}return i}function Qi(n,e){let t=ke._pendingDecorators;const r=ke._decorators;if(t===null){if(r[n]===e)return;t=Ai(ke)}t[n]=e}function ao(n){let e=n.nextSibling;return e!==null&&e===ke._blockCursorElement&&(e=e.nextSibling),e}function Wa(n,e,t,r,o,i){ye="",Qe="",Pe="",Ki=r===Nt,Gn=null,ke=t,ct=t._config,sn=t._nodes,Jn=ke._listeners.mutation,ro=o,oo=i,yt=n._nodeMap,Be=e._nodeMap,an=e._readOnly,io=new Map(t._keyToDOMMap);const s=new Map;return ln=s,cn("root",null),ke=void 0,sn=void 0,ro=void 0,oo=void 0,yt=void 0,Be=void 0,ct=void 0,io=void 0,ln=void 0,s}function co(n){const e=io.get(n);return e===void 0&&R(75,n),e}const Ze=Object.freeze({}),uo=30,fo=[["keydown",function(n,e){if(un=n.timeStamp,Zi=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=n;j(e,Jl,n)||t!=null&&(function(l,a,c,u){return Bi(l)&&!a&&!u&&!c}(t,o,s,i)?j(e,ii,n):function(l,a,c,u,d){return Bi(l)&&!u&&!c&&(a||d)}(t,o,r,s,i)?j(e,Gl,n):function(l,a,c,u){return Fi(l)&&!a&&!u&&!c}(t,o,s,i)?j(e,si,n):function(l,a,c,u,d){return Fi(l)&&!u&&!c&&(a||d)}(t,o,r,s,i)?j(e,Xl,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,o,i)?j(e,li,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,o,i)?j(e,ai,n):function(l,a){return Wi(l)&&a}(t,r)?(fn=!0,j(e,In,n)):function(l){return l===" "}(t)?j(e,Ql,n):function(l,a){return Fe&&a&&l.toLowerCase()==="o"}(t,o)?(n.preventDefault(),fn=!0,j(e,kt,!0)):function(l,a){return Wi(l)&&!a}(t,r)?(fn=!1,j(e,In,n)):function(l,a,c,u){return Fe?!a&&!c&&(tn(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&tn(l)}(t,s,i,o)?tn(t)?j(e,ci,n):(n.preventDefault(),j(e,pt,!0)):function(l){return l==="Escape"}(t)?j(e,ui,n):function(l,a,c,u,d){return Fe?!(c||u||d)&&(nn(l)||l.toLowerCase()==="d"&&a):!(a||u||d)&&nn(l)}(t,o,r,s,i)?nn(t)?j(e,fi,n):(n.preventDefault(),j(e,pt,!1)):function(l,a,c){return tn(l)&&(Fe?a:c)}(t,s,o)?(n.preventDefault(),j(e,qt,!0)):function(l,a,c){return nn(l)&&(Fe?a:c)}(t,s,o)?(n.preventDefault(),j(e,qt,!1)):function(l,a){return Fe&&a&&tn(l)}(t,i)?(n.preventDefault(),j(e,Vt,!0)):function(l,a){return Fe&&a&&nn(l)}(t,i)?(n.preventDefault(),j(e,Vt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&en(c,u)}(t,s,i,o)?(n.preventDefault(),j(e,Le,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&en(c,u)}(t,s,i,o)?(n.preventDefault(),j(e,Le,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&en(c,u)}(t,s,i,o)?(n.preventDefault(),j(e,Le,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,o,i)?j(e,Zl,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&en(c,u)}(t,r,i,o)?(n.preventDefault(),j(e,On,void 0)):function(l,a,c,u){return Fe?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,i,o)?(n.preventDefault(),j(e,An,void 0)):$e(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(Fe?c:u)}(t,r,i,o)?(n.preventDefault(),j(e,Rn,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(Fe?c:u)}(t,r,i,o)?(n.preventDefault(),j(e,Pr,n)):$i(t,i,o)&&(n.preventDefault(),j(e,Nr,n)):!st&&$i(t,i,o)&&(n.preventDefault(),j(e,Nr,n)),function(l,a,c,u){return l||a||c||u}(o,r,s,i)&&j(e,la,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&Re(e,()=>{se(_t(t))||(po=!0)})}],["compositionstart",function(n,e){Re(e,()=>{const t=B();if(I(t)&&!e.isComposing()){const r=t.anchor,o=t.anchor.getNode();Te(r.key),(n.timeStamp<un+uo||r.type==="element"||!t.isCollapsed()||o.getFormat()!==t.format||D(o)&&o.getStyle()!==t.style)&&j(e,Pt,ga)}})}],["compositionend",function(n,e){st?dn=!0:Re(e,()=>{go(e,n.data)})}],["input",function(n,e){n.stopPropagation(),Re(e,()=>{const t=B(),r=n.data,o=is(n);if(r!=null&&I(t)&&ns(t,o,r,n.timeStamp,!1)){dn&&(go(e,r),dn=!1);const i=t.anchor.getNode(),s=Ye(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;Dn&&!t.isCollapsed()&&D(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+c)===ji(s.anchorNode)||j(e,Pt,r);const u=r.length;st&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),Or||Mn||Ar||!e.isComposing()||(un=0,Te(null))}else Kr(!1,e,r!==null?r:void 0),dn&&(go(e,r||void 0),dn=!1);Ae(),bi(pe())}),Dt=null}],["click",function(n,e){Re(e,()=>{const t=B(),r=Ye(e._window),o=mn();if(r){if(I(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!Ee(s)&&ge().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(E(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const i=r.anchorNode;if(i!==null){const s=i.nodeType;(s===Qt||s===lt)&&He(Co(o,r,e,n))}}}j(e,oi,n)})}],["cut",Ze],["copy",Ze],["dragstart",Ze],["dragover",Ze],["dragend",Ze],["paste",Ze],["focus",Ze],["blur",Ze],["drop",Ze]];Dn&&fo.push(["beforeinput",(n,e)=>function(t,r){const o=t.inputType,i=is(t);o==="deleteCompositionText"||st&&Ui(r)||o!=="insertCompositionText"&&Re(r,()=>{const s=B();if(o==="deleteContentBackward"){if(s===null){const h=mn();if(!I(h))return;He(h.clone())}if(I(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,Zi==="MediaLast"&&l<un+uo&&r.isComposing()&&h){if(Te(null),un=0,setTimeout(()=>{Re(r,()=>{Te(null)})},uo),I(s)){const p=s.anchor.getNode();p.markDirty(),s.format=p.getFormat(),D(p)||R(142),s.style=p.getStyle()}}else{Te(null),t.preventDefault();const p=s.anchor.getNode().getTextContent(),g=s.anchor.offset===0&&s.focus.offset===p.length;ua&&h&&!g||j(r,pt,!0)}return}}var l;if(!I(s))return;const a=t.data;Dt!==null&&Kr(!1,r,Dt),s.dirty&&Dt===null||!s.isCollapsed()||Ee(s.anchor.getNode())||i===null||s.applyDOMRange(i),Dt=null;const c=s.anchor,u=s.focus,d=c.getNode(),f=u.getNode();if(o!=="insertText"&&o!=="insertTranspose")switch(t.preventDefault(),o){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":j(r,Pt,t);break;case"insertFromComposition":Te(null),j(r,Pt,t);break;case"insertLineBreak":Te(null),j(r,kt,!1);break;case"insertParagraph":Te(null),fn&&!Mn?(fn=!1,j(r,kt,!1)):j(r,Nn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":j(r,wr,t);break;case"deleteByComposition":(function(h,p){return h!==p||E(h)||E(p)||!h.isToken()||!p.isToken()})(d,f)&&j(r,kr,t);break;case"deleteByDrag":case"deleteByCut":j(r,kr,t);break;case"deleteContent":j(r,pt,!1);break;case"deleteWordBackward":j(r,qt,!0);break;case"deleteWordForward":j(r,qt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":j(r,Vt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":j(r,Vt,!1);break;case"formatStrikeThrough":j(r,Le,"strikethrough");break;case"formatBold":j(r,Le,"bold");break;case"formatItalic":j(r,Le,"italic");break;case"formatUnderline":j(r,Le,"underline");break;case"historyUndo":j(r,On,void 0);break;case"historyRedo":j(r,An,void 0)}else{if(a===`
32
+ `)t.preventDefault(),j(r,kt,!1);else if(a===Ge)t.preventDefault(),j(r,Nn,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(h)}else a!=null&&ns(s,i,a,t.timeStamp,!0)?(t.preventDefault(),j(r,Pt,a)):Dt=a;es=t.timeStamp}})}(n,e)]);let un=0,Zi=null,es=0,Dt=null;const er=new WeakMap;let ho=!1,po=!1,fn=!1,dn=!1,ts=[0,"",0,"root",0];function ns(n,e,t,r,o){const i=n.anchor,s=n.focus,l=i.getNode(),a=pe(),c=Ye(a._window),u=c!==null?c.anchorNode:null,d=i.key,f=a.getElementByKey(d),h=t.length;return d!==s.key||!D(l)||(!o&&(!Dn||es<r+50)||l.isDirty()&&h<2||Mi(t))&&i.offset!==s.offset&&!l.isComposing()||Ot(l)||l.isDirty()&&h>1||(o||!Dn)&&f!==null&&!l.isComposing()&&u!==$n(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Aa(n,l)}function rs(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===lt&&e!==0&&e!==n.nodeValue.length}function os(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=n;ho&&(ho=!1,rs(r,o)&&rs(i,s))||Re(e,()=>{if(!t)return void He(null);if(!Zt(e,r,i))return;const l=B();if(I(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Kn(e).event,d=u?u.timeStamp:performance.now(),[f,h,p,g,m]=ts,T=ge(),v=e.isComposing()===!1&&T.getTextContent()==="";if(d<m+200&&a.offset===p&&a.key===g)l.format=f,l.style=h;else if(a.type==="text")D(c)||R(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!v){const y=a.getNode();l.style="",y instanceof Ft&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,p=l.isBackward(),g=p?s:o,m=p?o:s,T=p?d:u,v=p?u:d;let y=pa,b=!1;for(let x=0;x<h;x++){const C=f[x],N=C.getTextContentSize();if(D(C)&&N!==0&&!(x===0&&C.__key===T&&g===N||x===h-1&&C.__key===v&&m===0)&&(b=!0,y&=C.getFormat(),y===0))break}l.format=b?y:0}}j(e,Pn,void 0)})}function is(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function go(n,e){const t=n._compositionKey;if(Te(null),t!==null&&e!=null){if(e===""){const r=we(t),o=$n(n.getElementByKey(t));return void(o!==null&&o.nodeValue!==null&&D(r)&&qr(r,o.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
+ `){const r=B();if(I(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void j(n,In,null)}}}Kr(!0,n,e)}function ss(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Mt=new Map;function ls(n){const e=n.target,t=Ye(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=Ni(t.anchorNode);if(r===null)return;po&&(po=!1,Re(r,()=>{const c=mn(),u=t.anchorNode;if(u===null)return;const d=u.nodeType;d!==Qt&&d!==lt||He(Co(c,t,r,n))}));const o=Yr(r),i=o[o.length-1],s=i._key,l=Mt.get(s),a=l||i;a!==r&&os(t,a,!1),os(t,r,!0),r!==i?Mt.set(s,r):l&&Mt.delete(s)}function as(n){n._lexicalHandled=!0}function cs(n){return n._lexicalHandled===!0}function $a(n){const e=n.ownerDocument,t=er.get(e);t===void 0&&R(162);const r=t-1;r>=0||R(164),er.set(e,r),r===0&&e.removeEventListener("selectionchange",ls);const o=Wn(n);Ur(o)?(function(s){if(s._parentEditor!==null){const l=Yr(s),a=l[l.length-1]._key;Mt.get(a)===s&&Mt.delete(a)}else Mt.delete(s._key)}(o),n.__lexicalEditor=null):o&&R(198);const i=ss(n);for(let s=0;s<i.length;s++)i[s]();n.__lexicalEventHandles=[]}function mo(n,e,t){Ae();const r=n.__key,o=n.getParent();if(o===null)return;const i=function(l){const a=B();if(!I(a)||!E(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return Jr(d,l)&&c.set(l.__key,0,"element"),Jr(f,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(I(i)&&e){const l=i.anchor,a=i.focus;l.key===r&&(sr(l,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(sr(a,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else $e(i)&&e&&n.isSelected()&&n.selectPrevious();if(I(i)&&e&&!s){const l=n.getIndexWithinParent();mt(n),ir(i,o,l,-1)}else mt(n);t||It(o)||o.canBeEmpty()||!o.isEmpty()||mo(o,e),e&&Ee(o)&&o.isEmpty()&&o.selectEnd()}class tr{static getType(){R(64,this.name)}static clone(e){R(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Oa(this,e)}getType(){return this.__type}isInline(){R(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=we(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||B();if(t==null)return!1;const r=t.getNodes().some(o=>o.__key===this.__key);if(D(this))return r;if(I(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const o=this.getParent();if(se(this)&&this.isInline()&&o){const i=t.isBackward()?t.focus:t.anchor,s=i.getNode();if(i.offset===s.getChildrenSize()&&s.is(o)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:we(e)}getParentOrThrow(){const e=this.getParent();return e===null&&R(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(It(t))return E(e)||e===this&&se(e)||R(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&R(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:we(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:we(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();E(this)&&t.unshift(this),E(e)&&r.unshift(e);const o=t.length,i=r.length;if(o===0||i===0||t[o-1]!==r[i-1])return null;const s=new Set(r);for(let l=0;l<o;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,o=0,i=this;for(;;){const s=i.getParentOrThrow();if(s===t){r=i.getIndexWithinParent();break}i=s}for(i=e;;){const s=i.getParentOrThrow();if(s===t){o=i.getIndexWithinParent();break}i=s}return r<o}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===e)break;const l=E(i)?t?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(a!==null){i=a;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&R(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||o.has(d.__key)||r.push(d)}while(u===null);i=u}return t||r.reverse(),r}isDirty(){const e=pe()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=we(this.__key);return e===null&&R(113),e}getWritable(){Ae();const e=et(),t=pe(),r=e._nodeMap,o=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,l=B();if(l!==null&&l.setCachedNodes(null),s.has(o))return zn(i),i;const a=no(i);return s.add(o),zn(a),r.set(o,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){R(70)}updateDOM(e,t,r){R(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){R(72)}static importJSON(e){R(18,this.name)}static transform(){return null}remove(e){mo(this,!0,e)}replace(e,t){Ae();let r=B();r!==null&&(r=r.clone()),Gr(this,e);const o=this.getLatest(),i=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;mt(l);const u=o.getPreviousSibling(),d=o.getNextSibling(),f=o.__prev,h=o.__next,p=o.__parent;if(mo(o,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=f,d===null?a.__last=s:d.getWritable().__prev=s,l.__next=h,l.__parent=p,a.__size=c,t&&(E(this)&&E(l)||R(139),this.getChildren().forEach(g=>{l.append(g)})),I(r)){He(r);const g=r.anchor,m=r.focus;g.key===i&&gs(g,l),m.key===i&&gs(m,l)}return at()===i&&Te(s),l}insertAfter(e,t=!0){Ae(),Gr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.getParent(),s=B();let l=!1,a=!1;if(i!==null){const h=e.getIndexWithinParent();if(mt(o),I(s)){const p=i.__key,g=s.anchor,m=s.focus;l=g.type==="element"&&g.key===p&&g.offset===h+1,a=m.type==="element"&&m.key===p&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=o.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,o.__next=f,o.__prev=r.__key,o.__parent=r.__parent,t&&I(s)){const h=this.getIndexWithinParent();ir(s,u,h+1);const p=u.__key;l&&s.anchor.set(p,h+2,"element"),a&&s.focus.set(p,h+2,"element")}return e}insertBefore(e,t=!0){Ae(),Gr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.__key;mt(o);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=i:s.getWritable().__next=i,l.__size++,r.__prev=i,o.__prev=a,o.__next=r.__key,o.__parent=r.__parent;const u=B();return t&&I(u)&&ir(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Ve()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Ae();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(E(r))return r.select();if(!D(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(e,t)}selectNext(e,t){Ae();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(E(r))return r.select(0,0);if(!D(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(e,t)}markDirty(){this.getWritable()}}class hn extends tr{static getType(){return"linebreak"}static clone(e){return new hn(e.__key)}constructor(e){super(e)}getTextContent(){return`
34
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&Vn(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&nr(o)){const i=r.lastChild;if(i===t||i.previousSibling===t&&nr(i))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Vn(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&nr(o))return!1;const i=r.lastChild;if(i===t||i.previousSibling===t&&nr(i))return!0}return!1}(e)?null:{conversion:za,priority:0}}}static importJSON(e){return xt()}exportJSON(){return{type:"linebreak",version:1}}}function za(n){return{node:xt()}}function xt(){return qn(new hn)}function Lt(n){return n instanceof hn}function nr(n){return n.nodeType===lt&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function _o(n,e){return 16&e?"code":e&Ir?"mark":32&e?"sub":64&e?"sup":null}function yo(n,e){return 1&e?"strong":2&e?"em":"span"}function us(n,e,t,r,o){const i=r.classList;let s=rn(o,"base");s!==void 0&&i.add(...s),s=rn(o,"underlineStrikethrough");let l=!1;const a=e&jn&&e&Ln;s!==void 0&&(t&jn&&t&Ln?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(const c in Xe){const u=Xe[c];if(s=rn(o,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&i.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||i.add(...s)}else e&u&&i.remove(...s)}}function fs(n,e,t){const r=e.firstChild,o=t.isComposing(),i=n+(o?Fn:"");if(r==null)e.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||st){const[l,a,c]=function(u,d){const f=u.length,h=d.length;let p=0,g=0;for(;p<f&&p<h&&u[p]===d[p];)p++;for(;g+p<f&&g+p<h&&u[f-g-1]===d[h-g-1];)g++;return[p,f-p-g,d.slice(p,h-g)]}(s,i);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=i}}function ds(n,e,t,r,o,i){fs(o,n,e);const s=i.theme.text;s!==void 0&&us(0,0,r,n,s)}function rr(n,e){const t=document.createElement(e);return t.appendChild(n),t}class jt extends tr{static getType(){return"text"}static clone(e){return new jt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Ta[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===at()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Xe[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Hr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,o=_o(0,r),i=yo(0,r),s=o===null?i:o,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(a=document.createElement(i),l.appendChild(a)),ds(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const o=this.__text,i=e.__format,s=this.__format,l=_o(0,i),a=_o(0,s),c=yo(0,i),u=yo(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const g=t.firstChild;g==null&&R(48);const m=document.createElement(u);return ds(m,this,0,s,o,r),t.replaceChild(m,g),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&R(49)),fs(o,d,this);const f=r.theme.text;f!==void 0&&i!==s&&us(0,i,s,d,f);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:Ka,priority:0}),b:()=>({conversion:Ha,priority:0}),code:()=>({conversion:ut,priority:0}),em:()=>({conversion:ut,priority:0}),i:()=>({conversion:ut,priority:0}),s:()=>({conversion:ut,priority:0}),span:()=>({conversion:Ua,priority:0}),strong:()=>({conversion:ut,priority:0}),sub:()=>({conversion:ut,priority:0}),sup:()=>({conversion:ut,priority:0}),u:()=>({conversion:ut,priority:0})}}static importJSON(e){const t=Ce(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&Zr(t)||R(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=rr(t,"b")),this.hasFormat("italic")&&(t=rr(t,"i")),this.hasFormat("strikethrough")&&(t=rr(t,"s")),this.hasFormat("underline")&&(t=rr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?Xe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?ya[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Hr(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=xa[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Ae();let r=e,o=t;const i=B(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),o===void 0&&(o=a)}else r=0,o=0;if(!I(i))return bs(l,r,l,o,"text","text");{const a=at();a!==i.anchor.key&&a!==i.focus.key||Te(l),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,o){const i=this.getWritable(),s=i.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=B();if(o&&I(c)){const d=e+l;c.setTextNodeRange(i,d,i,d)}const u=s.slice(0,a)+r+s.slice(a+t);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Ae();const t=this.getLatest(),r=t.getTextContent(),o=t.__key,i=at(),s=new Set(e),l=[],a=r.length;let c="";for(let x=0;x<a;x++)c!==""&&s.has(x)&&(l.push(c),c=""),c+=r[x];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const d=l[0],f=t.getParent();let h;const p=t.getFormat(),g=t.getStyle(),m=t.__detail;let T=!1;t.isSegmented()?(h=Ce(d),h.__format=p,h.__style=g,h.__detail=m,T=!0):(h=t.getWritable(),h.__text=d);const v=B(),y=[h];let b=d.length;for(let x=1;x<u;x++){const C=l[x],N=C.length,w=Ce(C).getWritable();w.__format=p,w.__style=g,w.__detail=m;const O=w.__key,z=b+N;if(I(v)){const X=v.anchor,he=v.focus;X.key===o&&X.type==="text"&&X.offset>b&&X.offset<=z&&(X.key=O,X.offset-=b,v.dirty=!0),he.key===o&&he.type==="text"&&he.offset>b&&he.offset<=z&&(he.key=O,he.offset-=b,v.dirty=!0)}i===o&&Te(O),b=z,y.push(w)}if(f!==null){(function(N){const w=N.getPreviousSibling(),O=N.getNextSibling();w!==null&&zn(w),O!==null&&zn(O)})(this);const x=f.getWritable(),C=this.getIndexWithinParent();T?(x.splice(C,0,y),this.remove()):x.splice(C,1,y),I(v)&&ir(v,f,C,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||R(50);const r=this.__key,o=e.__key,i=this.__text,s=i.length;at()===o&&Te(r);const l=B();if(I(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===o&&(Ss(d,t,r,e,s),l.dirty=!0),f!==null&&f.key===o&&(Ss(f,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+i:i+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Ua(n){return{forChild:vo(n.style),node:null}}function Ha(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:vo(e.style,t?void 0:"bold"),node:null}}const hs=new WeakMap;function Ya(n){return n.nodeName==="PRE"||n.nodeType===Qt&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function Ka(n){const e=n;n.parentElement===null&&R(129);let t=e.textContent||"";if(function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=hs.get(i))===void 0&&!Ya(i);)s.push(i),i=i.parentNode;const l=o===void 0?i:o;for(let a=0;a<s.length;a++)hs.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const l=r[s];l===`
35
35
  `||l===`\r
36
- `?o.push(et()):l===" "?o.push(Ht()):l!==""&&o.push(oe(l))}return{node:o}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,o=!0;for(;r!==null&&(r=Fi(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(t=t.slice(1)),o=!1;break}}o&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,o=!0;for(;r!==null&&(r=Fi(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:oe(t)}}function Fi(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const i=t.parentElement;if(i===null)return null;t=i}if(t=r,t.nodeType===Ft){const i=t.style.display;if(i===""&&!Dr(t)||i!==""&&!i.startsWith("inline"))return null}let o=t;for(;(o=e?t.firstChild:t.lastChild)!==null;)t=o;if(t.nodeType===Re)return t;if(t.nodeName==="BR")return null}}const Yl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ze(n){const e=Yl[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Hr(n.style,e),node:null}}function oe(n=""){return Tn(new _t(n))}function I(n){return n instanceof _t}function Hr(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),o=t==="700"||t==="bold",i=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(I(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class qt extends _t{static getType(){return"tab"}static clone(e){return new qt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Ht();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){D(126)}setDetail(e){D(127)}setMode(e){D(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Ht(){return Tn(new qt)}function ql(n){return n instanceof qt}class Hl{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const o=this.offset,i=e.offset;if(b(t)){const s=t.getDescendantByIndex(o);t=s??t}if(b(r)){const s=r.getDescendantByIndex(i);r=s??r}return t===r?o<i:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&D(20),e}set(e,t,r){const o=this._selection,i=this.key;this.key=e,this.offset=t,this.type=r,Xt()||(We()===i&&re(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0))}}function Ee(n,e,t){return new Hl(n,e,t)}function Gr(n,e){let t=e.__key,r=n.offset,o="element";if(I(e)){o="text";const i=e.getTextContentSize();r>i&&(r=i)}else if(!b(e)){const i=e.getNextSibling();if(I(i))t=i.__key,r=0,o="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,o)}function Mi(n,e){if(b(e)){const t=e.getLastDescendant();b(t)||I(t)?Gr(n,t):Gr(n,e)}else Gr(n,e)}function Ke(n,e,t,r){n.key=e,n.offset=t,n.type=r}class jn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ve(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new jn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,o=t[r-1];let i;if(I(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const o of t){const i=se(o);i!==null&&r.push(i)}return Xt()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function O(n){return n instanceof Ue}class Ue{constructor(e,t,r,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!O(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,o=t.isBefore(r),i=o?t:r,s=o?r:t;let l=i.getNode(),a=s.getNode();const c=i.offset,u=s.offset;if(b(l)){const d=l.getDescendantByIndex(c);l=d??l}if(b(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let h;return h=l.is(a)?b(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Xt()||(this._cachedNodes=h),h}setTextNodeRange(e,t,r,o){Ke(this.anchor,e.__key,t,"text"),Ke(this.focus,r.__key,o,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[l,a]=Xr(this);let c="",u=!0;for(let h=0;h<e.length;h++){const d=e[h];if(b(d)&&!d.isInline())u||(c+=`
37
- `),u=!d.isEmpty();else if(u=!1,I(d)){let f=d.getTextContent();d===t?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(f=l<a?f.slice(l,a):f.slice(a,l)):f=s?f.slice(l):f.slice(a):d===r&&(f=s?f.slice(0,a):f.slice(0,l)),c+=f}else!U(d)&&!mt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=H(),r=t.getEditorState()._selection,o=Wi(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(o===null)return;const[i,s]=o;Ke(this.anchor,i.key,i.offset,i.type),Ke(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Ue(Ee(e.key,e.offset,e.type),Ee(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=br(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Oe[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],o=t.length;for(let i=0;i<o;i++){const s=t[i];s===`
36
+ `?o.push(xt()):l===" "?o.push(gn()):l!==""&&o.push(Ce(l))}return{node:o}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,o=!0;for(;r!==null&&(r=ps(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(t=t.slice(1)),o=!1;break}}o&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,o=!0;for(;r!==null&&(r=ps(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:Ce(t)}}function ps(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const i=t.parentElement;if(i===null)return null;t=i}if(t=r,t.nodeType===Qt){const i=t.style.display;if(i===""&&!eo(t)||i!==""&&!i.startsWith("inline"))return null}let o=t;for(;(o=e?t.firstChild:t.lastChild)!==null;)t=o;if(t.nodeType===lt)return t;if(t.nodeName==="BR")return null}}const qa={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ut(n){const e=qa[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:vo(n.style,e),node:null}}function Ce(n=""){return qn(new jt(n))}function D(n){return n instanceof jt}function vo(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),o=t==="700"||t==="bold",i=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(D(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class pn extends jt{static getType(){return"tab"}static clone(e){return new pn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=gn();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){R(126)}setDetail(e){R(127)}setMode(e){R(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function gn(){return qn(new pn)}function Va(n){return n instanceof pn}class Ja{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const o=this.offset,i=e.offset;if(E(t)){const s=t.getDescendantByIndex(o);t=s??t}if(E(r)){const s=r.getDescendantByIndex(i);r=s??r}return t===r?o<i:t.isBefore(r)}getNode(){const e=we(this.key);return e===null&&R(20),e}set(e,t,r){const o=this._selection,i=this.key;this.key=e,this.offset=t,this.type=r,_n()||(at()===i&&Te(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0))}}function qe(n,e,t){return new Ja(n,e,t)}function xo(n,e){let t=e.__key,r=n.offset,o="element";if(D(e)){o="text";const i=e.getTextContentSize();r>i&&(r=i)}else if(!E(e)){const i=e.getNextSibling();if(D(i))t=i.__key,r=0,o="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,o)}function gs(n,e){if(E(e)){const t=e.getLastDescendant();E(t)||D(t)?xo(n,t):xo(n,e)}else xo(n,e)}function ft(n,e,t,r){n.key=e,n.offset=t,n.type=r}class or{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!$e(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new or(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,o=t[r-1];let i;if(D(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const o of t){const i=we(o);i!==null&&r.push(i)}return _n()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function I(n){return n instanceof dt}class dt{constructor(e,t,r,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!I(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,o=t.isBefore(r),i=o?t:r,s=o?r:t;let l=i.getNode(),a=s.getNode();const c=i.offset,u=s.offset;if(E(l)){const f=l.getDescendantByIndex(c);l=f??l}if(E(a)){let f=a.getDescendantByIndex(u);f!==null&&f!==l&&a.getChildAtIndex(u)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?E(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),_n()||(this._cachedNodes=d),d}setTextNodeRange(e,t,r,o){ft(this.anchor,e.__key,t,"text"),ft(this.focus,r.__key,o,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[l,a]=To(this);let c="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(E(f)&&!f.isInline())u||(c+=`
37
+ `),u=!f.isEmpty();else if(u=!1,D(f)){let h=f.getTextContent();f===t?f===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=s?h.slice(l):h.slice(a):f===r&&(h=s?h.slice(0,a):h.slice(0,l)),c+=h}else!se(f)&&!Lt(f)||f===r&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){const t=pe(),r=t.getEditorState()._selection,o=Ts(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(o===null)return;const[i,s]=o;ft(this.anchor,i.key,i.offset,i.type),ft(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new dt(qe(e.key,e.offset,e.type),qe(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Hr(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Xe[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],o=t.length;for(let i=0;i<o;i++){const s=t[i];s===`
38
38
  `||s===`\r
39
- `?r.push(et()):s===" "?r.push(Ht()):r.push(oe(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,o=this.format,i=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,v,y,x){const S=_.getNode(),w=S.getChildAtIndex(_.offset),C=oe(),N=ie(S)?Te().append(C):C;C.setFormat(y),C.setStyle(x),w===null?S.append(N):w.insertBefore(N),_.is(v)&&v.set(C.__key,0,"text"),_.set(C.__key,0,"text")}(s,l,o,i);const a=s.offset;let c=l.offset;const u=this.getNodes(),h=u.length;let d=u[0];I(d)||D(26);const f=d.getTextContent().length,g=d.getParentOrThrow();let m=u[h-1];if(h===1&&l.type==="element"&&(c=f,l.set(s.key,c,"text")),this.isCollapsed()&&a===f&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(I(_)&&_.canInsertTextBefore()&&!ut(_)||(_=oe(),_.setFormat(o),_.setStyle(i),g.canInsertTextAfter()?d.insertAfter(_):g.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(I(_)&&!ut(_)||(_=oe(),_.setFormat(o),g.canInsertTextBefore()?d.insertBefore(_):g.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==f){const _=oe(d.getTextContent());_.setFormat(o),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||b(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Ri(this.anchor,this.focus,null),void this.insertText(e)}if(h===1){if(d.isToken()){const x=oe(e);return x.select(),void d.replace(x)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===o&&v===i){if(ql(d)){const x=oe(e);return x.setFormat(o),x.setStyle(i),x.select(),void d.replace(x)}}else{if(d.getTextContent()!==""){const x=oe(e);if(x.setFormat(o),x.setStyle(i),x.select(),a===0)d.insertBefore(x,!1);else{const[S]=d.splitText(a);S.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(o),d.setStyle(i)}const y=c-a;d=d.spliceText(a,y,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=b(d)?d:d.getParentOrThrow();let y=b(m)?m:m.getParentOrThrow(),x=m;if(!v.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(I(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const T=oe(m.getTextContent());m.replace(T),m=T}ie(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const T=m.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?m.remove():T.remove()}else _.add(m.__key);const S=y.getChildren(),w=new Set(u),C=v.is(y),N=v.isInline()&&d.getNextSibling()===null?v:d;for(let T=S.length-1;T>=0;T--){const P=S[T];if(P.is(d)||b(P)&&P.isParentOf(d))break;P.isAttached()&&(!w.has(P)||P.is(x)?C||N.insertAfter(P,!1):P.remove())}if(!C){let T=y,P=null;for(;T!==null;){const $=T.getChildren(),B=$.length;(B===0||$[B-1].is(P))&&(_.delete(T.__key),P=T),T=T.getParent()}}if(d.isToken())if(a===f)d.select();else{const T=oe(e);T.select(),d.replace(T)}else d=d.spliceText(a,f-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let T=1;T<h;T++){const P=u[T],$=P.__key;_.has($)||P.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const y of t)I(y)&&r.push(y);const o=r.length;if(o===0)return this.toggleFormat(e),void re(null);const i=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:i,c=l?i:s;let u=0,h=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===h.getTextContentSize()&&(u=1,h=r[1],d=0),h==null)return;const f=h.getFormatFlags(e,null),g=o-1;let m=r[g];const _=c.type==="text"?c.offset:m.getTextContentSize();if(h.is(m)){if(d===_)return;if(ut(h)||d===0&&_===h.getTextContentSize())h.setFormat(f);else{const y=h.splitText(d,_),x=d===0?y[0]:y[1];x.setFormat(f),a.type==="text"&&a.set(x.__key,0,"text"),c.type==="text"&&c.set(x.__key,_-d,"text")}return void(this.format=f)}d===0||ut(h)||([,h]=h.splitText(d),d=0),h.setFormat(f);const v=m.getFormatFlags(e,f);_>0&&(_===m.getTextContentSize()||ut(m)||([m]=m.splitText(_)),m.setFormat(v));for(let y=u+1;y<g;y++){const x=r[y],S=x.getFormatFlags(e,v);x.setFormat(S)}a.type==="text"&&a.set(h.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=f|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const f=A();return O(f)||D(134),f.insertNodes(e)}const t=Ir((this.isBackward()?this.focus:this.anchor).getNode(),ht),r=e[e.length-1];if("__language"in t&&b(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const f=eo(this);t.splice(f,0,e),r.selectEnd()}return}if(!e.some(f=>(b(f)||U(f))&&!f.isInline())){b(t)||D(135);const f=eo(this);return t.splice(f,0,e),void r.selectEnd()}const o=function(f){const g=Te();let m=null;for(let _=0;_<f.length;_++){const v=f[_],y=mt(v);if(y||U(v)&&v.isInline()||b(v)&&v.isInline()||I(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),g.append(m),y))continue;m!==null&&m.append(v)}else g.append(v),m=null}return g}(e),i=o.getLastDescendant(),s=o.getChildren(),l=!b(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;b(u=c)&&ht(u)&&!u.isEmpty()&&b(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(b(t)||D(135),t.append(...c.getChildren()),c=s[1]),c&&function(f,g,m){const _=g.getParentOrThrow().getLastChild();let v=g;const y=[g];for(;v!==_;)v.getNextSibling()||D(140),v=v.getNextSibling(),y.push(v);let x=f;for(const S of y)x=x.insertAfter(S)}(t,c);const h=Ir(i,ht);l&&b(h)&&(l.canMergeWhenEmpty()||ht(a))&&(h.append(...l.getChildren()),l.remove()),b(t)&&t.isEmpty()&&t.remove(),i.selectEnd();const d=b(t)?t.getLastChild():null;mt(d)&&h!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Te();return G().splice(this.anchor.offset,0,[s]),s.select(),s}const e=eo(this),t=Ir(this.anchor.getNode(),ht);b(t)||D(136);const r=t.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(e){const t=et();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),o=t.getIndexWithinParent();r.select(o,o)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,o=this.anchor,i=this.focus;let s=e[0],l=e[r];const[a,c]=Xr(this);if(t===0)return[];if(t===1){if(I(s)&&!this.isCollapsed()){const h=a>c?c:a,d=a>c?a:c,f=s.splitText(h,d),g=h===0?f[0]:f[1];return g!=null?[g]:[]}return[s]}const u=o.isBefore(i);if(I(s)){const h=u?a:c;h===s.getTextContentSize()?e.shift():h!==0&&([,s]=s.splitText(h),e[0]=s)}if(I(l)){const h=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==h&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const o=this.focus,i=this.anchor,s=e==="move",l=Rt(o,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const f=zi();return f.add(l.__key),void Ce(f)}const d=t?l.getPreviousSibling():l.getNextSibling();if(I(d)){const f=d.__key,g=t?d.getTextContent().length:0;return o.set(f,g,"text"),void(s&&i.set(f,g,"text"))}{const f=l.getParentOrThrow();let g,m;return b(d)?(m=d.__key,g=t?d.getChildrenSize():0):(g=l.getIndexWithinParent(),m=f.__key,t||g++),o.set(m,g,"element"),void(s&&i.set(m,g,"element"))}}const a=H(),c=we(a._window);if(!c)return;const u=a._blockCursorElement,h=a._rootElement;if(h===null||u===null||!b(l)||l.isInline()||l.canBeEmpty()||Pr(u,a,h),function(d,f,g,m){d.modify(f,g,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),f=this.anchor.getNode(),g=ie(f)?f:Fl(f);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let y=0;y<m.length;y++){const x=m[y];Tr(x,g)?_.push(x):v=!0}if(v&&_.length>0)if(t){const y=_[0];b(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=_[_.length-1];b(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(y){const x=y.focus,S=y.anchor,w=S.key,C=S.offset,N=S.type;Ke(S,x.key,x.offset,x.type),Ke(x,w,C,N),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&b(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const o=t.getParent(),i=t.getNextSibling()||(o===null?null:o.getNextSibling());if(b(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,e))return;const i=this.focus,s=Rt(i,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&b(o)&&o.getChildrenSize()===0){o.remove();const l=zi();l.add(s.__key),Ce(l)}else s.remove(),H().dispatchCommand(ln,void 0);return}if(!e&&b(s)&&b(o)&&o.isEmpty())return o.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=i.type==="text"?i.getNode():null;if(o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=i.offset,c=l.getTextContentSize();if(l.is(o)||e&&a!==c||!e&&a!==0)return void Ai(l,e,a)}else if(o!==null&&o.isSegmented()){const a=r.offset,c=o.getTextContentSize();if(o.is(l)||e&&a!==0||!e&&a!==c)return void Ai(o,e,a)}(function(a,c){const u=a.anchor,h=a.focus,d=u.getNode(),f=h.getNode();if(d===f&&u.type==="text"&&h.type==="text"){const g=u.offset,m=h.offset,_=g<m,v=_?g:m,y=_?m:g,x=y-1;v!==x&&(ei(d.getTextContent().slice(v,y))||(c?h.offset=x:u.offset=x))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&ie(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ve(n){return n instanceof jn}function Li(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Xr(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Li(t),Li(r)]}function Ai(n,e,t){const r=n,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,l=0;for(let c=0;c<i;c++){const u=c===i-1;if(l=s,s+=o[c].length,e&&s===t||s>t||u){o.splice(c,1),u&&(l=void 0);break}}const a=o.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function ji(n,e,t,r){let o,i=e;if(n.nodeType===Ft){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;i===a&&(s=!0,i=a-1);let u=l[i],h=!1;if(u===c)u=l[i+1],h=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=dt(u),I(o))i=Zo(o,s);else{let d=dt(n);if(d===null)return null;if(b(d)){i=Math.min(d.getChildrenSize(),i);let f=d.getChildAtIndex(i);if(b(f)&&function(g,m,_){const v=g.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(f,0,t)){const g=s?f.getLastDescendant():f.getFirstDescendant();g===null?d=f:(f=g,d=b(f)?f:f.getParentOrThrow()),i=0}I(f)?(o=f,d=null,i=Zo(f,s)):f!==d&&s&&!h&&i++}else{const f=d.getIndexWithinParent();i=e===0&&U(d)&&dt(n)===d?f:f+1,d=d.getParentOrThrow()}if(b(d))return Ee(d.__key,i,"element")}}else o=dt(n);return I(o)?Ee(o.__key,i,"text"):null}function $i(n,e,t){const r=n.offset,o=n.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(e){if((t||!e)&&i===null&&b(s)&&s.isInline()){const l=s.getPreviousSibling();I(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else b(i)&&!t&&i.isInline()?(n.key=i.__key,n.offset=i.getChildrenSize(),n.type="element"):I(i)&&(n.key=i.__key,n.offset=i.getTextContent().length)}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(e&&b(i)&&i.isInline())n.key=i.__key,n.offset=0,n.type="element";else if((t||e)&&i===null&&b(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();I(l)&&(n.key=l.__key,n.offset=0)}}}function Ri(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),o=n.is(e);$i(n,r,o),$i(e,!r,o),o&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const i=H();if(i.isComposing()&&i._compositionKey!==n.key&&O(t)){const s=t.anchor,l=t.focus;Ke(n,s.key,s.offset,s.type),Ke(e,l.key,l.offset,l.type)}}}function Wi(n,e,t,r,o,i){if(n===null||t===null||!Mt(o,n,t))return null;const s=ji(n,e,O(i)?i.anchor:null,o);if(s===null)return null;const l=ji(t,r,O(i)?i.focus:null,o);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=dt(n),c=dt(t);if(U(a)&&U(c))return null}return Ri(s,l,i),[s,l]}function Qr(n){return b(n)&&!n.isInline()}function Bi(n,e,t,r,o,i){const s=Fe(),l=new Ue(Ee(n,e,o),Ee(t,r,i),0,"");return l.dirty=!0,s._selection=l,l}function Gl(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new Ue(n,e,0,"")}function zi(){return new jn(new Set)}function Zr(n,e,t,r){const o=t._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,l=s==="selectionchange",a=!mr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,h,d;if(O(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,h=e.anchorOffset,d=e.focusOffset,l&&O(n)&&!Mt(t,c,u))return n.clone();const f=Wi(c,h,u,d,t,n);if(f===null)return null;const[g,m]=f;return new Ue(g,m,O(n)?n.format:0,O(n)?n.style:"")}function A(){return Fe()._selection}function Gt(){return H()._editorState._selection}function $n(n,e,t,r=1){const o=n.anchor,i=n.focus,s=o.getNode(),l=i.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=o.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);o.set(a,u,"element"),i.set(a,u,"element"),Ki(n)}}else{const c=n.isBackward(),u=c?i:o,h=u.getNode(),d=c?o:i,f=d.getNode();if(e.is(h)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(f)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(a,Math.max(0,g+r),"element")}}Ki(n)}function Ki(n){const e=n.anchor,t=e.offset,r=n.focus,o=r.offset,i=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!b(i))return;const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(b(i)){const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(b(s)){const l=s.getChildrenSize(),a=o>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(o);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Rn(n,e,t,r,o){let i=null,s=0,l=null;r!==null?(i=r.__key,I(r)?(s=r.getTextContentSize(),l="text"):b(r)&&(s=r.getChildrenSize(),l="element")):o!==null&&(i=o.__key,I(o)?l="text":b(o)&&(l="element")),i!==null&&l!==null?n.set(i,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Ui(n,e,t,r,o){n.type==="text"?(n.key=t,e||(n.offset+=o)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function Xl(n,e,t,r,o,i,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,h=document.activeElement;if(o.has("collaboration")&&h!==i||h!==null&&xr(h))return;if(!O(e))return void(n!==null&&Mt(t,l,a)&&r.removeAllRanges());const d=e.anchor,f=e.focus,g=d.key,m=f.key,_=wn(t,g),v=wn(t,m),y=d.offset,x=f.offset,S=e.format,w=e.style,C=e.isCollapsed();let N=_,T=v,P=!1;if(d.type==="text"){N=vn(_);const Y=d.getNode();P=Y.getFormat()!==S||Y.getStyle()!==w}else O(n)&&n.anchor.type==="text"&&(P=!0);var $,B,ee,q,R;if(f.type==="text"&&(T=vn(v)),N!==null&&T!==null&&(C&&(n===null||P||O(n)&&(n.format!==S||n.style!==w))&&($=S,B=w,ee=y,q=g,R=performance.now(),vi=[$,B,ee,q,R]),c!==y||u!==x||l!==N||a!==T||r.type==="Range"&&C||(h!==null&&i.contains(h)||i.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(N,y,T,x)}catch{}if(!o.has("skip-scroll-into-view")&&e.isCollapsed()&&i!==null&&i===document.activeElement){const Y=e instanceof Ue&&e.anchor.type==="element"?N.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Y!==null){let ce;if(Y instanceof Text){const Me=document.createRange();Me.selectNode(Y),ce=Me.getBoundingClientRect()}else ce=Y.getBoundingClientRect();(function(Me,Je,tn){const nn=tn.ownerDocument,rn=nn.defaultView;if(rn===null)return;let{top:Ct,bottom:wt}=Je,St=0,Et=0,pe=tn;for(;pe!==null;){const rt=pe===nn.body;if(rt)St=0,Et=En(Me).innerHeight;else{const Ye=pe.getBoundingClientRect();St=Ye.top,Et=Ye.bottom}let Ne=0;if(Ct<St?Ne=-(St-Ct):wt>Et&&(Ne=wt-Et),Ne!==0)if(rt)rn.scrollBy(0,Ne);else{const Ye=pe.scrollTop;pe.scrollTop+=Ne;const ot=pe.scrollTop-Ye;Ct-=ot,wt-=ot}if(rt)break;pe=Sn(pe)}})(t,ce,i)}}Kr=!0}}function Ql(n){let e=A()||Gt();e===null&&(e=G().selectEnd()),e.insertNodes(n)}function eo(n){let e=n;n.isCollapsed()||e.removeText();const t=A();O(t)&&(e=t),O(e)||D(161);const r=e.anchor;let o=r.getNode(),i=r.offset;for(;!ht(o);)[o,i]=Zl(o,i);return i}function Zl(n,e){const t=n.getParent();if(!t){const o=Te();return G().append(o),o.select(),[G(),0]}if(I(n)){const o=n.splitText(e);if(o.length===0)return[t,n.getIndexWithinParent()];const i=e===0?0:1;return[t,o[0].getIndexWithinParent()+i]}if(!b(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const o=new Ue(Ee(n.__key,e,"element"),Ee(n.__key,e,"element"),0,""),i=n.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,de=!1,to=!1,Wn=0;const Vi={characterData:!0,childList:!0,subtree:!0};function Xt(){return de||te!==null&&te._readOnly}function fe(){de&&D(13)}function Ji(){Wn>99&&D(14)}function Fe(){return te===null&&D(195,Yi()),te}function H(){return ne===null&&D(196,Yi()),ne}function Yi(){let n=0;const e=new Set,t=Kn.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=xn(o);if(vr(i))n++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ea(){return ne}function qi(n,e,t){const r=e.__type,o=function(l,a){const c=l._nodes.get(a);return c===void 0&&D(30,a),c}(n,r);let i=t.get(r);i===void 0&&(i=Array.from(o.transforms),t.set(r,i));const s=i.length;for(let l=0;l<s&&(i[l](e),e.isAttached());l++);}function Hi(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function ta(n){return no(n,H()._nodes)}function no(n,e){const t=n.type,r=e.get(t);r===void 0&&D(17,t);const o=r.klass;n.type!==o.getType()&&D(18,o.name);const i=o.importJSON(n),s=n.children;if(b(i)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=no(s[l],e);i.append(a)}return i}function Gi(n,e,t){const r=te,o=de,i=ne;te=e,de=!0,ne=n;try{return t()}finally{te=r,de=o,ne=i}}function Ve(n,e){const t=n._pendingEditorState,r=n._rootElement,o=n._headless||r===null;if(t===null)return;const i=n._editorState,s=i._selection,l=t._selection,a=n._dirtyType!==He,c=te,u=de,h=ne,d=n._updating,f=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!o&&a&&f!==null){ne=n,te=t,de=!1,n._updating=!0;try{const C=n._dirtyType,N=n._dirtyElements,T=n._dirtyLeaves;f.disconnect(),g=Wl(i,t,n,C,N,T)}catch(C){if(C instanceof Error&&n._onError(C),to)throw C;return ns(n,null,r,t),zo(n),n._dirtyType=ct,to=!0,Ve(n,i),void(to=!1)}finally{f.observe(r,Vi),n._updating=d,te=c,de=u,ne=h}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,y=n._updateTags,x=n._deferred;a&&(n._dirtyType=He,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(C,N){const T=C._decorators;let P=C._pendingDecorators||T;const $=N._nodeMap;let B;for(B in P)$.has(B)||(P===T&&(P=Go(C)),delete P[B])}(n,t);const S=o?null:we(n._window);if(n._editable&&S!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(f!==null&&f.disconnect(),a||l===null||l.dirty){const C=n._blockCursorElement;C!==null&&Pr(C,n,r),Xl(s,l,n,S,y,r)}Ml(n,r,l),f!==null&&f.observe(r,Vi)}finally{ne=h,te=c}}g!==null&&function(C,N,T,P,$){const B=Array.from(C._listeners.mutation),ee=B.length;for(let q=0;q<ee;q++){const[R,Y]=B[q],ce=N.get(Y);ce!==void 0&&R(ce,{dirtyLeaves:P,prevEditorState:$,updateTags:T})}}(n,g,y,m,i),O(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(ln,void 0);const w=n._pendingDecorators;w!==null&&(n._decorators=w,n._pendingDecorators=null,Qt("decorator",n,!0,w)),function(C,N,T){const P=Xo(N),$=Xo(T);P!==$&&Qt("textcontent",C,!0,$)}(n,e||i,t),Qt("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||i,tags:y}),function(C,N){if(C._deferred=[],N.length!==0){const T=C._updating;C._updating=!0;try{for(let P=0;P<N.length;P++)N[P]()}finally{C._updating=T}}}(n,x),function(C){const N=C._updates;if(N.length!==0){const T=N.shift();if(T){const[P,$]=T;Zi(C,P,$)}}}(n)}function Qt(n,e,t,...r){const o=e._updating;e._updating=t;try{const i=Array.from(e._listeners[n]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{e._updating=o}}function Xi(n,e,t){if(n._updating===!1||ne!==n){let o=!1;return n.update(()=>{o=Xi(n,e,t)}),o}const r=Cr(n);for(let o=4;o>=0;o--)for(let i=0;i<r.length;i++){const s=r[i]._commands.get(e);if(s!==void 0){const l=s[o];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function Qi(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const o=t.shift();if(o){const[i,s]=o;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&D(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}i()}}return r}function Zi(n,e,t){const r=n._updateTags;let o,i,s=!1,l=!1;t!==void 0&&(o=t.onUpdate,i=t.tag,i!=null&&r.add(i),s=t.skipTransforms||!1,l=t.discrete||!1),o&&n._deferred.push(o);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new zn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const h=te,d=de,f=ne,g=n._updating;te=c,de=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(y){const x=y.getEditorState()._selection,S=we(y._window);return O(x)||x==null?Zr(x,S,y,null):x.clone()}(n));const _=n._compositionKey;e(),s=Qi(n,s),function(y,x){const S=x.getEditorState()._selection,w=y._selection;if(O(w)){const C=w.anchor,N=w.focus;let T;if(C.type==="text"&&(T=C.getNode(),T.selectionTransform(S,w)),N.type==="text"){const P=N.getNode();T!==P&&P.selectionTransform(S,w)}}}(c,n),n._dirtyType!==He&&(s?function(y,x){const S=x._dirtyLeaves,w=y._nodeMap;for(const C of S){const N=w.get(C);I(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&Vo(N)}}(c,n):function(y,x){const S=x._dirtyLeaves,w=x._dirtyElements,C=y._nodeMap,N=We(),T=new Map;let P=S,$=P.size,B=w,ee=B.size;for(;$>0||ee>0;){if($>0){x._dirtyLeaves=new Set;for(const q of P){const R=C.get(q);I(R)&&R.isAttached()&&R.isSimpleText()&&!R.isUnmergeable()&&Vo(R),R!==void 0&&Hi(R,N)&&qi(x,R,T),S.add(q)}if(P=x._dirtyLeaves,$=P.size,$>0){Wn++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map;for(const q of B){const R=q[0],Y=q[1];if(R!=="root"&&!Y)continue;const ce=C.get(R);ce!==void 0&&Hi(ce,N)&&qi(x,ce,T),w.set(R,Y)}P=x._dirtyLeaves,$=P.size,B=x._dirtyElements,ee=B.size,Wn++}x._dirtyLeaves=S,x._dirtyElements=w}(c,n),Qi(n),function(y,x,S,w){const C=y._nodeMap,N=x._nodeMap,T=[];for(const[P]of w){const $=N.get(P);$!==void 0&&($.isAttached()||(b($)&&ui($,P,C,N,T,w),C.has(P)||w.delete(P),T.push(P)))}for(const P of T)N.delete(P);for(const P of S){const $=N.get(P);$===void 0||$.isAttached()||(C.has(P)||S.delete(P),N.delete(P))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(O(v)){const y=c._nodeMap,x=v.anchor.key,S=v.focus.key;y.get(x)!==void 0&&y.get(S)!==void 0||D(19)}else ve(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=ct,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ve(n)}finally{te=h,de=d,ne=f,n._updating=g,Wn=0}n._dirtyType!==He||function(_,v){const y=v.getEditorState()._selection,x=_._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ve(n)):u&&Nl(()=>{Ve(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Zi(n,e,t)}class Bn extends Mn{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return xl[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=H()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(I(t)&&e.push(t),b(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;b(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;b(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const i=t[r-1];return b(i)&&i.getLastDescendant()||i||null}const o=t[e];return b(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&D(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&D(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,o;if(e<t/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=e;){if(o===e)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=t-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const i=t[o];e+=i.getTextContent(),b(i)&&o!==r-1&&!i.isInline()&&(e+=Pe)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const i=t[o];e+=i.getTextContentSize(),b(i)&&o!==r-1&&!i.isInline()&&(e+=Pe.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ro[e];return!!(this.getFormat()&t)}return!1}select(e,t){fe();const r=A();let o=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(I(a)||b(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(I(a)||b(a))return a.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const l=this.__key;return O(r)?(r.anchor.set(l,o,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):Bi(l,o,l,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ro[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const o=r.length,i=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let h=null,d=i-t+o;if(e!==0)if(e===i)h=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(h=g.getPreviousSibling())}if(t>0){let g=h===null?this.getFirstChild():h.getNextSibling();for(let m=0;m<t;m++){g===null&&D(100);const _=g.getNextSibling(),v=g.__key;Ge(g.getWritable()),c.push(v),g=_}}let f=h;for(let g=0;g<o;g++){const m=r[g];f!==null&&m.is(f)&&(h=f=f.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,Ge(_);const v=m.__key;if(f===null)s.__first=v,_.__prev=null;else{const y=f.getWritable();y.__next=v,_.__prev=y.__key}m.__key===l&&D(76),_.__parent=l,a.push(v),f=m}if(e+t===i)f!==null&&(f.getWritable().__next=null,s.__last=f.__key);else if(u!==null){const g=u.getWritable();if(f!==null){const m=f.getWritable();g.__prev=f.__key,m.__next=u.__key}else g.__prev=null}if(s.__size=d,c.length){const g=A();if(O(g)){const m=new Set(c),_=new Set(a),{anchor:v,focus:y}=g;es(v,m,_)&&Rn(v,v.getNode(),this,h,u),es(y,m,_)&&Rn(y,y.getNode(),this,h,u),d!==0||this.canBeEmpty()||ft(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}}function b(n){return n instanceof Bn}function es(n,e,t){let r=n.getNode();for(;r;){const o=r.__key;if(e.has(o)&&!t.has(o))return!0;r=r.getParent()}return!1}class na extends Mn{constructor(e){super(e)}decorate(e,t){D(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof na}class Zt extends Bn{static getType(){return"root"}static clone(){return new Zt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){D(51)}getTextContent(){const e=this.__cachedText;return!Xt()&&H()._dirtyType!==He||e===null?super.getTextContent():e}remove(){D(52)}replace(e){D(53)}insertBefore(e){D(54)}insertAfter(e){D(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];b(r)||U(r)||D(56)}return super.append(...e)}static importJSON(e){const t=G();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function ie(n){return n instanceof Zt}function ro(){return new zn(new Map([["root",new Zt]]))}function ts(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&D(130,t.name),b(n)){const r=e.children;Array.isArray(r)||D(59,t.name);const o=n.getChildren();for(let i=0;i<o.length;i++){const s=ts(o[i]);r.push(s)}}return e}class zn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Gi(t&&t.editor||null,this,e)}clone(e){const t=new zn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Gi(null,this,()=>({root:ts(G())}))}}class oo extends Bn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class yt extends Bn{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Oe[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new yt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=$t(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:ra,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Or(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o);const i=this.getIndent();i>0&&(t.style.textIndent=20*i+"px")}return{element:t}}static importJSON(e){const t=Te();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=Te();r.setTextFormat(e.format),r.setTextStyle(e.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||I(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function ra(n){const e=Te();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function Te(){return Tn(new yt)}function io(n){return n instanceof yt}const K=0,oa=4;function ns(n,e,t,r){const o=n._keyToDOMMap;o.clear(),n._editorState=ro(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=He,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const i=n._observer;i!==null&&(i.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",o.set("root",t))}function ia(n){const e=n||{},t=ea(),r=e.theme||{},o=n===void 0?t:e.parentEditor||null,i=e.disableEvents||!1,s=ro(),l=e.namespace||(o!==null?o._config.namespace:ti()),a=e.editorState,c=[Zt,_t,Yt,qt,yt,oo,...e.nodes||[]],{onError:u,html:h}=e,d=e.editable===void 0||e.editable;let f;if(n===void 0&&t!==null)f=t._nodes;else{f=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,y=null;if(typeof _!="function"){const C=_;_=C.replace,v=C.with,y=C.withKlass||null}const x=_.getType(),S=_.transform(),w=new Set;S!==null&&w.add(S),f.set(x,{exportDOM:h&&h.export?h.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:y,transforms:w})}}const g=new Kn(s,o,f,{disableEvents:i,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,y=new Set,x=S=>{Object.keys(S).forEach(w=>{let C=v.get(w);C===void 0&&(C=[],v.set(w,C)),C.push(S[w])})};return m.forEach(S=>{const w=S.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const C=w.call(S.klass);C!==null&&x(C)}),_&&x(_),v}(f,h?h.import:void 0),d);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=ct),g}class Kn{constructor(e,t,r,o,i,s,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=He,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=ti(),this._onError=i,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&D(35);const o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(e);i===void 0&&D(36,String(e));const s=i[r];return s.add(t),()=>{s.delete(t),i.every(l=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;i.set(t,o);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,o),()=>{i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&D(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,o=jl(r).get(t.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),o=[r],i=r.replaceWithKlass;if(i!=null){const a=this.registerNodeTransformToKlass(i,t);o.push(a)}var s,l;return s=this,l=e.getType(),he(s,()=>{const a=Fe();if(a.isEmpty())return;if(l==="root")return void G().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{o.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return L(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=$t(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,ns(this,t,e,o),t!==null&&(this._config.disableEvents||Bl(t),r!=null&&t.classList.remove(...r)),e!==null){const i=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=ct,zo(this),this._updateTags.add("history-merge"),Ve(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=Fn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",Ti),Fn.set(c,(u||0)+1),l.__lexicalEditor=a;const h=Ei(l);for(let d=0;d<zr.length;d++){const[f,g]=zr[d],m=typeof g=="function"?_=>{Ni(_)||(ki(_),(a.isEditable()||f==="click")&&g(_,a))}:_=>{if(Ni(_))return;ki(_);const v=a.isEditable();switch(f){case"cut":return v&&L(a,ir,_);case"copy":return L(a,fn,_);case"paste":return v&&L(a,rr,_);case"dragstart":return v&&L(a,Fo,_);case"dragover":return v&&L(a,Mo,_);case"dragend":return v&&L(a,nl,_);case"focus":return v&&L(a,il,_);case"blur":return v&&L(a,sl,_);case"drop":return v&&L(a,Io,_)}};l.addEventListener(f,m),h.push(()=>{l.removeEventListener(f,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=o,this._pendingEditorState=null,this._window=null;Qt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&D(38),Bo(this);const r=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;r===null||r.isEmpty()||(i!=null&&o.add(i),Ve(this)),this._pendingEditorState=e,this._dirtyType=ct,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),Ve(this)}parseEditorState(e,t){return function(r,o,i){const s=ro(),l=te,a=de,c=ne,u=o._dirtyElements,h=o._dirtyLeaves,d=o._cloneNotNeeded,f=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,te=s,de=!1,ne=o;try{const g=o._nodes;no(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=h,o._cloneNotNeeded=d,o._dirtyType=f,te=l,de=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ve(this),this.getEditorState().read(e,{editor:this})}update(e,t){he(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),he(this,()=>{const o=A(),i=G();o!==null?o.dirty=!0:i.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?i.selectStart():i.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=we(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Qt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Kn.version="0.17.1+prod.esm";const Gc="";function sa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var la=sa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const rs=M.createContext(null);function aa(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function tt(){const n=M.useContext(rs);return n==null&&la(8),n}const os=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ca=os?M.useLayoutEffect:M.useEffect,Un={tag:"history-merge"};function ua({initialConfig:n,children:e}){const t=M.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:l,html:a}=n,c=aa(null,r),u=ia({editable:n.editable,html:a,namespace:o,nodes:i,onError:h=>s(h,u),theme:r});return function(h,d){if(d!==null){if(d===void 0)h.update(()=>{const f=G();if(f.isEmpty()){const g=Te();f.append(g);const m=os?document.activeElement:null;(A()!==null||m!==null&&m===h.getRootElement())&&g.select()}},Un);else if(d!==null)switch(typeof d){case"string":{const f=h.parseEditorState(d);h.setEditorState(f,Un);break}case"object":h.setEditorState(d,Un);break;case"function":h.update(()=>{G().isEmpty()&&d(h)},Un)}}}(u,l),[u,c]},[]);return ca(()=>{const r=n.editable,[o]=t;o.setEditable(r===void 0||r)},[]),E.jsx(rs.Provider,{value:t,children:e})}function da({defaultSelection:n}){const[e]=tt();return M.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function fa(){return G().getTextContent()}function ha(n,e=!0){if(n)return!1;let t=fa();return e&&(t=t.trim()),t===""}function ga(n){if(!ha(n,!1))return!1;const e=G().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const o=e[r];if(U(o))return!1;if(b(o)){if(!io(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let l=0;l<s;l++){const a=i[r];if(!I(a))return!1}}}return!0}function is(n){return()=>ga(n)}function pa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}pa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function ma(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _a=ma(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ya=new Map;function xa(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(e[o.trim()]=i.trim())}return e}function ss(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,o]=t,i=n.isBackward(),s=r.getNode(),l=o.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,h]=Xr(n),d=s.is(l),f=e.is(i?l:s),g=e.is(i?s:l);let m,_=0;return d?(_=u>h?h:u,m=u>h?u:h):f?(_=i?h:u,m=void 0):g&&(_=0,m=i?u:h),e.__text=e.__text.slice(_,m),e}}return e}function ls(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return b(e)||_a(177),n.offset===e.getChildrenSize()}function va(n){const e=n.getStyle(),t=xa(e);ya.set(e,t)}function as(n,e){const t=Rt(n.focus,e);return U(t)&&!t.isIsolated()||b(t)&&!t.isInline()&&!t.canBeEmpty()}function ba(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Ca(n){const e=n.anchor.getNode();return(ie(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function cs(n,e,t){const r=Ca(n);ba(n,e,t?!r:r,"character")}function wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Sa=wa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const us=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ea=us&&"documentMode"in document?document.documentMode:null;!(!us||!("InputEvent"in window)||Ea)&&"getTargetRanges"in new window.InputEvent("input");function xt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Ta(n){const e=so(n,t=>b(t)&&!t.isInline());return b(e)||Sa(4,n.__key),e}const so=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function nt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const ds=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?M.useLayoutEffect:M.useEffect;function ka({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:o,ariaExpanded:i,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:h,className:d,id:f,role:g="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":y,...x},S){const[w,C]=M.useState(n.isEditable()),N=M.useCallback(P=>{P&&P.ownerDocument&&P.ownerDocument.defaultView?n.setRootElement(P):n.setRootElement(null)},[n]),T=M.useMemo(()=>function(...P){return $=>{P.forEach(B=>{typeof B=="function"?B($):B!=null&&(B.current=$)})}}(S,N),[N,S]);return ds(()=>(C(n.isEditable()),n.registerEditableListener(P=>{C(P)})),[n]),E.jsx("div",{...x,"aria-activedescendant":w?e:void 0,"aria-autocomplete":w?t:"none","aria-controls":w?r:void 0,"aria-describedby":o,"aria-expanded":w&&g==="combobox"?!!i:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":w?c:void 0,"aria-readonly":!w||void 0,"aria-required":u,autoCapitalize:h,className:d,contentEditable:w,"data-testid":y,id:f,ref:T,role:w?g:void 0,spellCheck:m,style:_,tabIndex:v})}const Na=M.forwardRef(ka);function fs(n){return n.getEditorState().read(is(n.isComposing()))}const Pa=M.forwardRef(Oa);function Oa(n,e){const{placeholder:t,...r}=n,[o]=tt();return E.jsxs(E.Fragment,{children:[E.jsx(Na,{editor:o,...r,ref:e}),t!=null&&E.jsx(Da,{editor:o,content:t})]})}function Da({content:n,editor:e}){const t=function(s){const[l,a]=M.useState(()=>fs(s));return ds(()=>{function c(){const u=fs(s);a(u)}return c(),xt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,o]=M.useState(e.isEditable());if(M.useLayoutEffect(()=>(o(e.isEditable()),e.registerEditableListener(s=>{o(s)})),[e]),!t)return null;let i=null;return typeof n=="function"?i=n(r):n!==null&&(i=n),i===null?null:E.jsx("div",{"aria-hidden":!0,children:i})}const Vn=0,lo=1,ao=2,be=0,Ia=1,hs=2,Fa=3,Ma=4;function La(n,e,t,r,o){if(n===null||t.size===0&&r.size===0&&!o)return be;const i=e._selection,s=n._selection;if(o)return Ia;if(!(O(i)&&O(s)&&s.isCollapsed()&&i.isCollapsed()))return be;const l=function(v,y,x){const S=v._nodeMap,w=[];for(const C of y){const N=S.get(C);N!==void 0&&w.push(N)}for(const[C,N]of x){if(!N)continue;const T=S.get(C);T===void 0||ie(T)||w.push(T)}return w}(e,t,r);if(l.length===0)return be;if(l.length>1){const v=e._nodeMap,y=v.get(i.anchor.key),x=v.get(s.anchor.key);return y&&x&&!n._nodeMap.has(y.__key)&&I(y)&&y.__text.length===1&&i.anchor.offset===1?hs:be}const a=l[0],c=n._nodeMap.get(a.__key);if(!I(c)||!I(a)||c.__mode!==a.__mode)return be;const u=c.__text,h=a.__text;if(u===h)return be;const d=i.anchor,f=s.anchor;if(d.key!==f.key||d.type!=="text")return be;const g=d.offset,m=f.offset,_=h.length-u.length;return _===1&&m===g-1?hs:_===-1&&m===g+1?Fa:_===-1&&m===g?Ma:be}function Aa(n,e){let t=Date.now(),r=be;return(o,i,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=be,t=u,ao;const h=La(o,i,l,a,n.isComposing()),d=(()=>{const f=s===null||s.editor===n,g=c.has("history-push");if(!g&&f&&c.has("history-merge"))return Vn;if(o===null)return lo;const m=i._selection;return l.size>0||a.size>0?g===!1&&h!==be&&h===r&&u<t+e&&f||l.size===1&&function(_,v,y){const x=v._nodeMap.get(_),S=y._nodeMap.get(_),w=v._selection,C=y._selection;return!(O(w)&&O(C)&&w.anchor.type==="element"&&w.focus.type==="element"&&C.anchor.type==="text"&&C.focus.type==="text"||!I(x)||!I(S)||x.__parent!==S.__parent)&&JSON.stringify(v.read(()=>x.exportJSON()))===JSON.stringify(y.read(()=>S.exportJSON()))}(Array.from(l)[0],o,i)?Vn:lo:m!==null?Vn:ao})();return t=u,r=h,d}}function gs(n){n.undoStack=[],n.redoStack=[],n.current=null}function ja(n,e,t){const r=Aa(n,t);return xt(n.registerCommand(cn,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),i.dispatchCommand(Dt,!0)),a.length===0&&i.dispatchCommand(It,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(un,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),i.dispatchCommand(It,!0));const u=l.pop();l.length===0&&i.dispatchCommand(Dt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(rl,()=>(gs(e),!1),K),n.registerCommand(ol,()=>(gs(e),n.dispatchCommand(Dt,!1),n.dispatchCommand(It,!1),!0),K),n.registerUpdateListener(({editorState:i,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,h=e.redoStack,d=e.undoStack,f=u===null?null:u.editorState;if(u!==null&&i===f)return;const g=r(s,i,u,l,a,c);if(g===lo)h.length!==0&&(e.redoStack=[],n.dispatchCommand(Dt,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(It,!0));else if(g===ao)return;e.current={editor:n,editorState:i}}))}function $a(){return{current:null,redoStack:[],undoStack:[]}}function Ra({delay:n,externalHistoryState:e}){const[t]=tt();return function(r,o,i=1e3){const s=M.useMemo(()=>o||$a(),[o]);M.useEffect(()=>ja(r,s,i),[i,r,s])}(t,e,n),null}const Wa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?M.useLayoutEffect:M.useEffect;function Ba(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function za(){return function(n){const[e]=tt(),t=M.useMemo(()=>n(e),[e,n]),r=M.useRef(t.initialValueFn()),[o,i]=M.useState(r.current);return Wa(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,i(a)),l(c=>{r.current=c,i(c)})},[t,n]),o}(Ba)}function Ka(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const o=n.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,h,d,f,g]=a;n.update(()=>{const m=A();if(O(m)){const _=m.anchor;let v=_.getNode(),y=0,x=0;if(I(v)&&c>=0&&u>=0&&(y=c,x=c+u,m.setTextNodeRange(v,y,v,x)),y===x&&h===""||(m.insertRawText(h),v=_.getNode()),I(v)){y=d,x=d+f;const S=v.getTextContentSize();y=y>S?S:y,x=x>S?S:x,m.setTextNodeRange(v,y,v,x)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Ua(n,e){const t=e.body?e.body.childNodes:[];let r=[];const o=[];for(let i=0;i<t.length;i++){const s=t[i];if(!ms.has(s.nodeName)){const l=_s(s,n,o,!1);l!==null&&(r=r.concat(l))}}return function(i){for(const s of i)s.getNextSibling()instanceof oo&&s.insertAfter(et());for(const s of i){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(o),r}function Va(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=G().getChildren();for(let o=0;o<r.length;o++)ps(n,r[o],t,e);return t.innerHTML}function ps(n,e,t,r=null){let o=r===null||e.isSelected(r);const i=b(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let f=Fr(e);f=I(f)&&r!==null?ss(r,f):f,s=f}const l=b(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:h}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let f=0;f<l.length;f++){const g=l[f],m=ps(n,g,d,r);!o&&b(e)&&m&&e.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if(Or(u)&&u.append(d),t.append(u),h){const f=h.call(s,u);f&&u.replaceWith(f)}}else t.append(d);return o}const ms=new Set(["STYLE","SCRIPT"]);function _s(n,e,t,r,o=new Map,i){let s=[];if(ms.has(n.nodeName))return s;let l=null;const a=function(g,m){const{nodeName:_}=g,v=m._htmlConversions.get(_.toLowerCase());let y=null;if(v!==void 0)for(const x of v){const S=x(g);S!==null&&(y===null||(y.priority||0)<(S.priority||0))&&(y=S)}return y!==null?y.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,m]of o)if(l=m(l,i),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&o.set(n.nodeName,c.forChild)}const h=n.childNodes;let d=[];const f=(l==null||!ft(l))&&(l!=null&&Qr(l)||r);for(let g=0;g<h.length;g++)d.push(..._s(h[g],e,t,f,new Map(o),l));return u!=null&&(d=u(d)),kn(n)&&(d=Ja(n,d,f?()=>{const g=new oo;return t.push(g),g}:Te)),l==null?d.length>0?s=s.concat(d):kn(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Dr(g.nextSibling)&&Dr(g.previousSibling)}(n)&&(s=s.concat(et())):b(l)&&l.append(...d),s}function Ja(n,e,t){const r=n.style.textAlign,o=[];let i=[];for(let s=0;s<e.length;s++){const l=e[s];if(Qr(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(i.push(l),s===e.length-1||s<e.length-1&&Qr(e[s+1])){const a=t();a.setFormat(r),a.append(...i),o.push(a),i=[]}}return o}function Ya(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Jn=Ya(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const qa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ys=n=>qa?(n||window).getSelection():null;function Ha(n,e=A()){return e==null&&Jn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":Va(n,e)}function Ga(n,e=A()){return e==null&&Jn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Xa(n,e))}function xs(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return vs(t,Qa(s.nodes),e)}catch{}const o=n.getData("text/html");if(o)try{const s=new DOMParser().parseFromString(o,"text/html");return vs(t,Ua(t,s),e)}catch{}const i=n.getData("text/plain")||n.getData("text/uri-list");if(i!=null)if(O(e)){const s=i.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=A();if(O(a)){const c=s[l];c===`
39
+ `?r.push(xt()):s===" "?r.push(gn()):r.push(Ce(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,o=this.format,i=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(m,T,v,y){const b=m.getNode(),x=b.getChildAtIndex(m.offset),C=Ce(),N=Ee(b)?Ve().append(C):C;C.setFormat(v),C.setStyle(y),x===null?b.append(N):x.insertBefore(N),m.is(T)&&T.set(C.__key,0,"text"),m.set(C.__key,0,"text")}(s,l,o,i);const a=s.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];D(f)||R(26);const h=f.getTextContent().length,p=f.getParentOrThrow();let g=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(s.key,c,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!p.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if(D(m)&&m.canInsertTextBefore()&&!Ot(m)||(m=Ce(),m.setFormat(o),m.setStyle(i),p.canInsertTextAfter()?f.insertAfter(m):p.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!p.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(D(m)&&!Ot(m)||(m=Ce(),m.setFormat(o),p.canInsertTextBefore()?f.insertBefore(m):p.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const m=Ce(f.getTextContent());m.setFormat(o),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){const m=g.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||E(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),xs(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const y=Ce(e);return y.select(),void f.replace(y)}const m=f.getFormat(),T=f.getStyle();if(a!==c||m===o&&T===i){if(Va(f)){const y=Ce(e);return y.setFormat(o),y.setStyle(i),y.select(),void f.replace(y)}}else{if(f.getTextContent()!==""){const y=Ce(e);if(y.setFormat(o),y.setStyle(i),y.select(),a===0)f.insertBefore(y,!1);else{const[b]=f.splitText(a);b.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(o),f.setStyle(i)}const v=c-a;f=f.spliceText(a,v,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=T))}else{const m=new Set([...f.getParentKeys(),...g.getParentKeys()]),T=E(f)?f:f.getParentOrThrow();let v=E(g)?g:g.getParentOrThrow(),y=g;if(!T.is(v)&&v.isInline())do y=v,v=v.getParentOrThrow();while(v.isInline());if(l.type==="text"&&(c!==0||g.getTextContent()==="")||l.type==="element"&&g.getIndexWithinParent()<c)if(D(g)&&!g.isToken()&&c!==g.getTextContentSize()){if(g.isSegmented()){const w=Ce(g.getTextContent());g.replace(w),g=w}Ee(l.getNode())||l.type!=="text"||(g=g.spliceText(0,c,"")),m.add(g.__key)}else{const w=g.getParentOrThrow();w.canBeEmpty()||w.getChildrenSize()!==1?g.remove():w.remove()}else m.add(g.__key);const b=v.getChildren(),x=new Set(u),C=T.is(v),N=T.isInline()&&f.getNextSibling()===null?T:f;for(let w=b.length-1;w>=0;w--){const O=b[w];if(O.is(f)||E(O)&&O.isParentOf(f))break;O.isAttached()&&(!x.has(O)||O.is(y)?C||N.insertAfter(O,!1):O.remove())}if(!C){let w=v,O=null;for(;w!==null;){const z=w.getChildren(),X=z.length;(X===0||z[X-1].is(O))&&(m.delete(w.__key),O=w),w=w.getParent()}}if(f.isToken())if(a===h)f.select();else{const w=Ce(e);w.select(),f.replace(w)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let w=1;w<d;w++){const O=u[w],z=O.__key;m.has(z)||O.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void Te(null);const t=this.getNodes(),r=[];for(const v of t)D(v)&&r.push(v);const o=r.length;if(o===0)return this.toggleFormat(e),void Te(null);const i=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:i,c=l?i:s;let u=0,d=r[0],f=a.type==="element"?0:a.offset;if(a.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=d.getFormatFlags(e,null),p=o-1;let g=r[p];const m=c.type==="text"?c.offset:g.getTextContentSize();if(d.is(g)){if(f===m)return;if(Ot(d)||f===0&&m===d.getTextContentSize())d.setFormat(h);else{const v=d.splitText(f,m),y=f===0?v[0]:v[1];y.setFormat(h),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,m-f,"text")}return void(this.format=h)}f===0||Ot(d)||([,d]=d.splitText(f),f=0),d.setFormat(h);const T=g.getFormatFlags(e,h);m>0&&(m===g.getTextContentSize()||Ot(g)||([g]=g.splitText(m)),g.setFormat(T));for(let v=u+1;v<p;v++){const y=r[v],b=y.getFormatFlags(e,T);y.setFormat(b)}a.type==="text"&&a.set(d.__key,f,"text"),c.type==="text"&&c.set(g.__key,m,"text"),this.format=h|T}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=B();return I(h)||R(134),h.insertNodes(e)}const t=to((this.isBackward()?this.focus:this.anchor).getNode(),Rt),r=e[e.length-1];if("__language"in t&&E(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=Eo(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(E(h)||se(h))&&!h.isInline())){E(t)||R(135);const h=Eo(this);return t.splice(h,0,e),void r.selectEnd()}const o=function(h){const p=Ve();let g=null;for(let m=0;m<h.length;m++){const T=h[m],v=Lt(T);if(v||se(T)&&T.isInline()||E(T)&&T.isInline()||D(T)||T.isParentRequired()){if(g===null&&(g=T.createParentElementNode(),p.append(g),v))continue;g!==null&&g.append(T)}else p.append(T),g=null}return p}(e),i=o.getLastDescendant(),s=o.getChildren(),l=!E(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;E(u=c)&&Rt(u)&&!u.isEmpty()&&E(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(E(t)||R(135),t.append(...c.getChildren()),c=s[1]),c&&function(h,p,g){const m=p.getParentOrThrow().getLastChild();let T=p;const v=[p];for(;T!==m;)T.getNextSibling()||R(140),T=T.getNextSibling(),v.push(T);let y=h;for(const b of v)y=y.insertAfter(b)}(t,c);const d=to(i,Rt);l&&E(d)&&(l.canMergeWhenEmpty()||Rt(a))&&(d.append(...l.getChildren()),l.remove()),E(t)&&t.isEmpty()&&t.remove(),i.selectEnd();const f=E(t)?t.getLastChild():null;Lt(f)&&d!==t&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Ve();return ge().splice(this.anchor.offset,0,[s]),s.select(),s}const e=Eo(this),t=to(this.anchor.getNode(),Rt);E(t)||R(136);const r=t.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(e){const t=xt();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),o=t.getIndexWithinParent();r.select(o,o)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,o=this.anchor,i=this.focus;let s=e[0],l=e[r];const[a,c]=To(this);if(t===0)return[];if(t===1){if(D(s)&&!this.isCollapsed()){const d=a>c?c:a,f=a>c?a:c,h=s.splitText(d,f),p=d===0?h[0]:h[1];return p!=null?[p]:[]}return[s]}const u=o.isBefore(i);if(D(s)){const d=u?a:c;d===s.getTextContentSize()?e.shift():d!==0&&([,s]=s.splitText(d),e[0]=s)}if(D(l)){const d=l.getTextContent().length,f=u?c:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[r]=l)}return e}modify(e,t,r){const o=this.focus,i=this.anchor,s=e==="move",l=on(o,t);if(se(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Cs();return h.add(l.__key),void He(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(D(f)){const h=f.__key,p=t?f.getTextContent().length:0;return o.set(h,p,"text"),void(s&&i.set(h,p,"text"))}{const h=l.getParentOrThrow();let p,g;return E(f)?(g=f.__key,p=t?f.getChildrenSize():0):(p=l.getIndexWithinParent(),g=h.__key,t||p++),o.set(g,p,"element"),void(s&&i.set(g,p,"element"))}}const a=pe(),c=Ye(a._window);if(!c)return;const u=a._blockCursorElement,d=a._rootElement;if(d===null||u===null||!E(l)||l.isInline()||l.canBeEmpty()||Qr(u,a,d),function(f,h,p,g){f.modify(h,p,g)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const f=c.getRangeAt(0),h=this.anchor.getNode(),p=Ee(h)?h:Ra(h);if(this.applyDOMRange(f),this.dirty=!0,!s){const g=this.getNodes(),m=[];let T=!1;for(let v=0;v<g.length;v++){const y=g[v];Jr(y,p)?m.push(y):T=!0}if(T&&m.length>0)if(t){const v=m[0];E(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{const v=m[m.length-1];E(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}c.anchorNode===f.startContainer&&c.anchorOffset===f.startOffset||function(v){const y=v.focus,b=v.anchor,x=b.key,C=b.offset,N=b.type;ft(b,y.key,y.offset,y.type),ft(y,x,C,N),v._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&E(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const o=t.getParent(),i=t.getNextSibling()||(o===null?null:o.getNextSibling());if(E(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,e))return;const i=this.focus,s=on(i,e);if(se(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&E(o)&&o.getChildrenSize()===0){o.remove();const l=Cs();l.add(s.__key),He(l)}else s.remove(),pe().dispatchCommand(Pn,void 0);return}if(!e&&E(s)&&E(o)&&o.isEmpty())return o.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=i.type==="text"?i.getNode():null;if(o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=i.offset,c=l.getTextContentSize();if(l.is(o)||e&&a!==c||!e&&a!==0)return void _s(l,e,a)}else if(o!==null&&o.isSegmented()){const a=r.offset,c=o.getTextContentSize();if(o.is(l)||e&&a!==0||!e&&a!==c)return void _s(o,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const p=u.offset,g=d.offset,m=p<g,T=m?p:g,v=m?g:p,y=v-1;T!==y&&(Mi(f.getTextContent().slice(T,v))||(c?d.offset=y:u.offset=y))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Ee(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function $e(n){return n instanceof or}function ms(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function To(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[ms(t),ms(r)]}function _s(n,e,t){const r=n,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,l=0;for(let c=0;c<i;c++){const u=c===i-1;if(l=s,s+=o[c].length,e&&s===t||s>t||u){o.splice(c,1),u&&(l=void 0);break}}const a=o.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function ys(n,e,t,r){let o,i=e;if(n.nodeType===Qt){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;i===a&&(s=!0,i=a-1);let u=l[i],d=!1;if(u===c)u=l[i+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&i--}if(o=At(u),D(o))i=Di(o,s);else{let f=At(n);if(f===null)return null;if(E(f)){i=Math.min(f.getChildrenSize(),i);let h=f.getChildAtIndex(i);if(E(h)&&function(p,g,m){const T=p.getParent();return m===null||T===null||!T.canBeEmpty()||T!==m.getNode()}(h,0,t)){const p=s?h.getLastDescendant():h.getFirstDescendant();p===null?f=h:(h=p,f=E(h)?h:h.getParentOrThrow()),i=0}D(h)?(o=h,f=null,i=Di(h,s)):h!==f&&s&&!d&&i++}else{const h=f.getIndexWithinParent();i=e===0&&se(f)&&At(n)===f?h:h+1,f=f.getParentOrThrow()}if(E(f))return qe(f.__key,i,"element")}}else o=At(n);return D(o)?qe(o.__key,i,"text"):null}function vs(n,e,t){const r=n.offset,o=n.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(e){if((t||!e)&&i===null&&E(s)&&s.isInline()){const l=s.getPreviousSibling();D(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else E(i)&&!t&&i.isInline()?(n.key=i.__key,n.offset=i.getChildrenSize(),n.type="element"):D(i)&&(n.key=i.__key,n.offset=i.getTextContent().length)}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(e&&E(i)&&i.isInline())n.key=i.__key,n.offset=0,n.type="element";else if((t||e)&&i===null&&E(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();D(l)&&(n.key=l.__key,n.offset=0)}}}function xs(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),o=n.is(e);vs(n,r,o),vs(e,!r,o),o&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const i=pe();if(i.isComposing()&&i._compositionKey!==n.key&&I(t)){const s=t.anchor,l=t.focus;ft(n,s.key,s.offset,s.type),ft(e,l.key,l.offset,l.type)}}}function Ts(n,e,t,r,o,i){if(n===null||t===null||!Zt(o,n,t))return null;const s=ys(n,e,I(i)?i.anchor:null,o);if(s===null)return null;const l=ys(t,r,I(i)?i.focus:null,o);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=At(n),c=At(t);if(se(a)&&se(c))return null}return xs(s,l,i),[s,l]}function bo(n){return E(n)&&!n.isInline()}function bs(n,e,t,r,o,i){const s=et(),l=new dt(qe(n,e,o),qe(t,r,i),0,"");return l.dirty=!0,s._selection=l,l}function Ga(){const n=qe("root",0,"element"),e=qe("root",0,"element");return new dt(n,e,0,"")}function Cs(){return new or(new Set)}function Co(n,e,t,r){const o=t._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,l=s==="selectionchange",a=!Br&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,d,f;if(I(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&I(n)&&!Zt(t,c,u))return n.clone();const h=Ts(c,d,u,f,t,n);if(h===null)return null;const[p,g]=h;return new dt(p,g,I(n)?n.format:0,I(n)?n.style:"")}function B(){return et()._selection}function mn(){return pe()._editorState._selection}function ir(n,e,t,r=1){const o=n.anchor,i=n.focus,s=o.getNode(),l=i.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=o.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);o.set(a,u,"element"),i.set(a,u,"element"),Es(n)}}else{const c=n.isBackward(),u=c?i:o,d=u.getNode(),f=c?o:i,h=f.getNode();if(e.is(d)){const p=u.offset;(t<=p&&r>0||t<p&&r<0)&&u.set(a,Math.max(0,p+r),"element")}if(e.is(h)){const p=f.offset;(t<=p&&r>0||t<p&&r<0)&&f.set(a,Math.max(0,p+r),"element")}}Es(n)}function Es(n){const e=n.anchor,t=e.offset,r=n.focus,o=r.offset,i=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!E(i))return;const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(E(i)){const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(E(s)){const l=s.getChildrenSize(),a=o>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(o);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function sr(n,e,t,r,o){let i=null,s=0,l=null;r!==null?(i=r.__key,D(r)?(s=r.getTextContentSize(),l="text"):E(r)&&(s=r.getChildrenSize(),l="element")):o!==null&&(i=o.__key,D(o)?l="text":E(o)&&(l="element")),i!==null&&l!==null?n.set(i,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Ss(n,e,t,r,o){n.type==="text"?(n.key=t,e||(n.offset+=o)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function Xa(n,e,t,r,o,i,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(o.has("collaboration")&&d!==i||d!==null&&zr(d))return;if(!I(e))return void(n!==null&&Zt(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,p=f.key,g=h.key,m=Hn(t,p),T=Hn(t,g),v=f.offset,y=h.offset,b=e.format,x=e.style,C=e.isCollapsed();let N=m,w=T,O=!1;if(f.type==="text"){N=$n(m);const ie=f.getNode();O=ie.getFormat()!==b||ie.getStyle()!==x}else I(n)&&n.anchor.type==="text"&&(O=!0);var z,X,he,le,H;if(h.type==="text"&&(w=$n(T)),N!==null&&w!==null&&(C&&(n===null||O||I(n)&&(n.format!==b||n.style!==x))&&(z=b,X=x,he=v,le=p,H=performance.now(),ts=[z,X,he,le,H]),c!==v||u!==y||l!==N||a!==w||r.type==="Range"&&C||(d!==null&&i.contains(d)||i.focus({preventScroll:!0}),f.type==="element"))){try{r.setBaseAndExtent(N,v,w,y)}catch{}if(!o.has("skip-scroll-into-view")&&e.isCollapsed()&&i!==null&&i===document.activeElement){const ie=e instanceof dt&&e.anchor.type==="element"?N.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(ie!==null){let ue;if(ie instanceof Text){const be=document.createRange();be.selectNode(ie),ue=be.getBoundingClientRect()}else ue=ie.getBoundingClientRect();(function(be,De,nt){const k=nt.ownerDocument,F=k.defaultView;if(F===null)return;let{top:J,bottom:q}=De,$=0,Q=0,W=nt;for(;W!==null;){const Y=W===k.body;if(Y)$=0,Q=Kn(be).innerHeight;else{const Z=W.getBoundingClientRect();$=Z.top,Q=Z.bottom}let V=0;if(J<$?V=-($-J):q>Q&&(V=q-Q),V!==0)if(Y)F.scrollBy(0,V);else{const Z=W.scrollTop;W.scrollTop+=V;const G=W.scrollTop-Z;J-=G,q-=G}if(Y)break;W=Yn(W)}})(t,ue,i)}}ho=!0}}function Qa(n){let e=B()||mn();e===null&&(e=ge().selectEnd()),e.insertNodes(n)}function Eo(n){let e=n;n.isCollapsed()||e.removeText();const t=B();I(t)&&(e=t),I(e)||R(161);const r=e.anchor;let o=r.getNode(),i=r.offset;for(;!Rt(o);)[o,i]=Za(o,i);return i}function Za(n,e){const t=n.getParent();if(!t){const o=Ve();return ge().append(o),o.select(),[ge(),0]}if(D(n)){const o=n.splitText(e);if(o.length===0)return[t,n.getIndexWithinParent()];const i=e===0?0:1;return[t,o[0].getIndexWithinParent()+i]}if(!E(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const o=new dt(qe(n.__key,e,"element"),qe(n.__key,e,"element"),0,""),i=n.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let ve=null,xe=null,Oe=!1,So=!1,lr=0;const ws={characterData:!0,childList:!0,subtree:!0};function _n(){return Oe||ve!==null&&ve._readOnly}function Ae(){Oe&&R(13)}function ks(){lr>99&&R(14)}function et(){return ve===null&&R(195,Ps()),ve}function pe(){return xe===null&&R(196,Ps()),xe}function Ps(){let n=0;const e=new Set,t=ur.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=Wn(o);if(Ur(i))n++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ec(){return xe}function Ns(n,e,t){const r=e.__type,o=function(l,a){const c=l._nodes.get(a);return c===void 0&&R(30,a),c}(n,r);let i=t.get(r);i===void 0&&(i=Array.from(o.transforms),t.set(r,i));const s=i.length;for(let l=0;l<s&&(i[l](e),e.isAttached());l++);}function Os(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function tc(n){return wo(n,pe()._nodes)}function wo(n,e){const t=n.type,r=e.get(t);r===void 0&&R(17,t);const o=r.klass;n.type!==o.getType()&&R(18,o.name);const i=o.importJSON(n),s=n.children;if(E(i)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=wo(s[l],e);i.append(a)}return i}function As(n,e,t){const r=ve,o=Oe,i=xe;ve=e,Oe=!0,xe=n;try{return t()}finally{ve=r,Oe=o,xe=i}}function ht(n,e){const t=n._pendingEditorState,r=n._rootElement,o=n._headless||r===null;if(t===null)return;const i=n._editorState,s=i._selection,l=t._selection,a=n._dirtyType!==gt,c=ve,u=Oe,d=xe,f=n._updating,h=n._observer;let p=null;if(n._pendingEditorState=null,n._editorState=t,!o&&a&&h!==null){xe=n,ve=t,Oe=!1,n._updating=!0;try{const C=n._dirtyType,N=n._dirtyElements,w=n._dirtyLeaves;h.disconnect(),p=Wa(i,t,n,C,N,w)}catch(C){if(C instanceof Error&&n._onError(C),So)throw C;return js(n,null,r,t),Ci(n),n._dirtyType=Nt,So=!0,ht(n,i),void(So=!1)}finally{h.observe(r,ws),n._updating=f,ve=c,Oe=u,xe=d}}t._readOnly||(t._readOnly=!0);const g=n._dirtyLeaves,m=n._dirtyElements,T=n._normalizedNodes,v=n._updateTags,y=n._deferred;a&&(n._dirtyType=gt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(C,N){const w=C._decorators;let O=C._pendingDecorators||w;const z=N._nodeMap;let X;for(X in O)z.has(X)||(O===w&&(O=Ai(C)),delete O[X])}(n,t);const b=o?null:Ye(n._window);if(n._editable&&b!==null&&(a||l===null||l.dirty)){xe=n,ve=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const C=n._blockCursorElement;C!==null&&Qr(C,n,r),Xa(s,l,n,b,v,r)}Da(n,r,l),h!==null&&h.observe(r,ws)}finally{xe=d,ve=c}}p!==null&&function(C,N,w,O,z){const X=Array.from(C._listeners.mutation),he=X.length;for(let le=0;le<he;le++){const[H,ie]=X[le],ue=N.get(ie);ue!==void 0&&H(ue,{dirtyLeaves:O,prevEditorState:z,updateTags:w})}}(n,p,v,g,i),I(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(Pn,void 0);const x=n._pendingDecorators;x!==null&&(n._decorators=x,n._pendingDecorators=null,yn("decorator",n,!0,x)),function(C,N,w){const O=Ii(N),z=Ii(w);O!==z&&yn("textcontent",C,!0,z)}(n,e||i,t),yn("update",n,!0,{dirtyElements:m,dirtyLeaves:g,editorState:t,normalizedNodes:T,prevEditorState:e||i,tags:v}),function(C,N){if(C._deferred=[],N.length!==0){const w=C._updating;C._updating=!0;try{for(let O=0;O<N.length;O++)N[O]()}finally{C._updating=w}}}(n,y),function(C){const N=C._updates;if(N.length!==0){const w=N.shift();if(w){const[O,z]=w;Ds(C,O,z)}}}(n)}function yn(n,e,t,...r){const o=e._updating;e._updating=t;try{const i=Array.from(e._listeners[n]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{e._updating=o}}function Is(n,e,t){if(n._updating===!1||xe!==n){let o=!1;return n.update(()=>{o=Is(n,e,t)}),o}const r=Yr(n);for(let o=4;o>=0;o--)for(let i=0;i<r.length;i++){const s=r[i]._commands.get(e);if(s!==void 0){const l=s[o];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function Rs(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const o=t.shift();if(o){const[i,s]=o;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&R(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}i()}}return r}function Ds(n,e,t){const r=n._updateTags;let o,i,s=!1,l=!1;t!==void 0&&(o=t.onUpdate,i=t.tag,i!=null&&r.add(i),s=t.skipTransforms||!1,l=t.discrete||!1),o&&n._deferred.push(o);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new cr(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const d=ve,f=Oe,h=xe,p=n._updating;ve=c,Oe=!1,n._updating=!0,xe=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(v){const y=v.getEditorState()._selection,b=Ye(v._window);return I(y)||y==null?Co(y,b,v,null):y.clone()}(n));const m=n._compositionKey;e(),s=Rs(n,s),function(v,y){const b=y.getEditorState()._selection,x=v._selection;if(I(x)){const C=x.anchor,N=x.focus;let w;if(C.type==="text"&&(w=C.getNode(),w.selectionTransform(b,x)),N.type==="text"){const O=N.getNode();w!==O&&O.selectionTransform(b,x)}}}(c,n),n._dirtyType!==gt&&(s?function(v,y){const b=y._dirtyLeaves,x=v._nodeMap;for(const C of b){const N=x.get(C);D(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&wi(N)}}(c,n):function(v,y){const b=y._dirtyLeaves,x=y._dirtyElements,C=v._nodeMap,N=at(),w=new Map;let O=b,z=O.size,X=x,he=X.size;for(;z>0||he>0;){if(z>0){y._dirtyLeaves=new Set;for(const le of O){const H=C.get(le);D(H)&&H.isAttached()&&H.isSimpleText()&&!H.isUnmergeable()&&wi(H),H!==void 0&&Os(H,N)&&Ns(y,H,w),b.add(le)}if(O=y._dirtyLeaves,z=O.size,z>0){lr++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const le of X){const H=le[0],ie=le[1];if(H!=="root"&&!ie)continue;const ue=C.get(H);ue!==void 0&&Os(ue,N)&&Ns(y,ue,w),x.set(H,ie)}O=y._dirtyLeaves,z=O.size,X=y._dirtyElements,he=X.size,lr++}y._dirtyLeaves=b,y._dirtyElements=x}(c,n),Rs(n),function(v,y,b,x){const C=v._nodeMap,N=y._nodeMap,w=[];for(const[O]of x){const z=N.get(O);z!==void 0&&(z.isAttached()||(E(z)&&Yi(z,O,C,N,w,x),C.has(O)||x.delete(O),w.push(O)))}for(const O of w)N.delete(O);for(const O of b){const z=N.get(O);z===void 0||z.isAttached()||(C.has(O)||b.delete(O),N.delete(O))}}(a,c,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(c._flushSync=!0);const T=c._selection;if(I(T)){const v=c._nodeMap,y=T.anchor.key,b=T.focus.key;v.get(y)!==void 0&&v.get(b)!==void 0||R(19)}else $e(T)&&T._nodes.size===0&&(c._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=a,n._dirtyType=Nt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void ht(n)}finally{ve=d,Oe=f,xe=h,n._updating=p,lr=0}n._dirtyType!==gt||function(m,T){const v=T.getEditorState()._selection,y=m._selection;if(y!==null){if(y.dirty||!y.is(v))return!0}else if(v!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,ht(n)):u&&Pa(()=>{ht(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Re(n,e,t){n._updating?n._updates.push([e,t]):Ds(n,e,t)}class ar extends tr{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return va[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=pe()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(D(t)&&e.push(t),E(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;E(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;E(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const i=t[r-1];return E(i)&&i.getLastDescendant()||i||null}const o=t[e];return E(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:we(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&R(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:we(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&R(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,o;if(e<t/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=e;){if(o===e)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=t-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const i=t[o];e+=i.getTextContent(),E(i)&&o!==r-1&&!i.isInline()&&(e+=Ge)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const i=t[o];e+=i.getTextContentSize(),E(i)&&o!==r-1&&!i.isInline()&&(e+=Ge.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=xi[e];return!!(this.getFormat()&t)}return!1}select(e,t){Ae();const r=B();let o=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(a)||E(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(D(a)||E(a))return a.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const l=this.__key;return I(r)?(r.anchor.set(l,o,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):bs(l,o,l,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?xi[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const o=r.length,i=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let d=null,f=i-t+o;if(e!==0)if(e===i)d=this.getLastChild();else{const p=this.getChildAtIndex(e);p!==null&&(d=p.getPreviousSibling())}if(t>0){let p=d===null?this.getFirstChild():d.getNextSibling();for(let g=0;g<t;g++){p===null&&R(100);const m=p.getNextSibling(),T=p.__key;mt(p.getWritable()),c.push(T),p=m}}let h=d;for(let p=0;p<o;p++){const g=r[p];h!==null&&g.is(h)&&(d=h=h.getPreviousSibling());const m=g.getWritable();m.__parent===l&&f--,mt(m);const T=g.__key;if(h===null)s.__first=T,m.__prev=null;else{const v=h.getWritable();v.__next=T,m.__prev=v.__key}g.__key===l&&R(76),m.__parent=l,a.push(T),h=g}if(e+t===i)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(u!==null){const p=u.getWritable();if(h!==null){const g=h.getWritable();p.__prev=h.__key,g.__next=u.__key}else p.__prev=null}if(s.__size=f,c.length){const p=B();if(I(p)){const g=new Set(c),m=new Set(a),{anchor:T,focus:v}=p;Ms(T,g,m)&&sr(T,T.getNode(),this,d,u),Ms(v,g,m)&&sr(v,v.getNode(),this,d,u),f!==0||this.canBeEmpty()||It(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}}function E(n){return n instanceof ar}function Ms(n,e,t){let r=n.getNode();for(;r;){const o=r.__key;if(e.has(o)&&!t.has(o))return!0;r=r.getParent()}return!1}class nc extends tr{constructor(e){super(e)}decorate(e,t){R(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function se(n){return n instanceof nc}class vn extends ar{static getType(){return"root"}static clone(){return new vn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){R(51)}getTextContent(){const e=this.__cachedText;return!_n()&&pe()._dirtyType!==gt||e===null?super.getTextContent():e}remove(){R(52)}replace(e){R(53)}insertBefore(e){R(54)}insertAfter(e){R(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];E(r)||se(r)||R(56)}return super.append(...e)}static importJSON(e){const t=ge();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Ee(n){return n instanceof vn}function ko(){return new cr(new Map([["root",new vn]]))}function Ls(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&R(130,t.name),E(n)){const r=e.children;Array.isArray(r)||R(59,t.name);const o=n.getChildren();for(let i=0;i<o.length;i++){const s=Ls(o[i]);r.push(s)}}return e}class cr{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return As(t&&t.editor||null,this,e)}clone(e){const t=new cr(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return As(null,this,()=>({root:Ls(ge())}))}}class Po extends ar{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Ft extends ar{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Xe[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Ft(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=rn(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:rc,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o);const i=this.getIndent();i>0&&(t.style.textIndent=20*i+"px")}return{element:t}}static importJSON(e){const t=Ve();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=Ve();r.setTextFormat(e.format),r.setTextStyle(e.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||D(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function rc(n){const e=Ve();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function Ve(){return qn(new Ft)}function No(n){return n instanceof Ft}const ne=0,oc=4;function js(n,e,t,r){const o=n._keyToDOMMap;o.clear(),n._editorState=ko(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=gt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const i=n._observer;i!==null&&(i.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",o.set("root",t))}function Fs(n){const e=n||{},t=ec(),r=e.theme||{},o=n===void 0?t:e.parentEditor||null,i=e.disableEvents||!1,s=ko(),l=e.namespace||(o!==null?o._config.namespace:Li()),a=e.editorState,c=[vn,jt,hn,pn,Ft,Po,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let g=0;g<c.length;g++){let m=c[g],T=null,v=null;if(typeof m!="function"){const C=m;m=C.replace,T=C.with,v=C.withKlass||null}const y=m.getType(),b=m.transform(),x=new Set;b!==null&&x.add(b),h.set(y,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:T,replaceWithKlass:v,transforms:x})}}const p=new ur(s,o,h,{disableEvents:i,namespace:l,theme:r},u||console.error,function(g,m){const T=new Map,v=new Set,y=b=>{Object.keys(b).forEach(x=>{let C=T.get(x);C===void 0&&(C=[],T.set(x,C)),C.push(b[x])})};return g.forEach(b=>{const x=b.klass.importDOM;if(x==null||v.has(x))return;v.add(x);const C=x.call(b.klass);C!==null&&y(C)}),m&&y(m),T}(h,d?d.import:void 0),f);return a!==void 0&&(p._pendingEditorState=a,p._dirtyType=Nt),p}class ur{constructor(e,t,r,o,i,s,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=gt,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Li(),this._onError=i,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&R(35);const o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(e);i===void 0&&R(36,String(e));const s=i[r];return s.add(t),()=>{s.delete(t),i.every(l=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;i.set(t,o);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,o),()=>{i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&R(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,o=ja(r).get(t.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),o=[r],i=r.replaceWithKlass;if(i!=null){const a=this.registerNodeTransformToKlass(i,t);o.push(a)}var s,l;return s=this,l=e.getType(),Re(s,()=>{const a=et();if(a.isEmpty())return;if(l==="root")return void ge().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{o.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return j(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=rn(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,js(this,t,e,o),t!==null&&(this._config.disableEvents||$a(t),r!=null&&t.classList.remove(...r)),e!==null){const i=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=Nt,Ci(this),this._updateTags.add("history-merge"),ht(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=er.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",ls),er.set(c,(u||0)+1),l.__lexicalEditor=a;const d=ss(l);for(let f=0;f<fo.length;f++){const[h,p]=fo[f],g=typeof p=="function"?m=>{cs(m)||(as(m),(a.isEditable()||h==="click")&&p(m,a))}:m=>{if(cs(m))return;as(m);const T=a.isEditable();switch(h){case"cut":return T&&j(a,Pr,m);case"copy":return j(a,Rn,m);case"paste":return T&&j(a,wr,m);case"dragstart":return T&&j(a,pi,m);case"dragover":return T&&j(a,gi,m);case"dragend":return T&&j(a,na,m);case"focus":return T&&j(a,ia,m);case"blur":return T&&j(a,sa,m);case"drop":return T&&j(a,hi,m)}};l.addEventListener(h,g),d.push(()=>{l.removeEventListener(h,g)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=o,this._pendingEditorState=null,this._window=null;yn("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&R(38),bi(this);const r=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;r===null||r.isEmpty()||(i!=null&&o.add(i),ht(this)),this._pendingEditorState=e,this._dirtyType=Nt,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),ht(this)}parseEditorState(e,t){return function(r,o,i){const s=ko(),l=ve,a=Oe,c=xe,u=o._dirtyElements,d=o._dirtyLeaves,f=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,ve=s,Oe=!1,xe=o;try{const p=o._nodes;wo(r.root,p),i&&i(),s._readOnly=!0}catch(p){p instanceof Error&&o._onError(p)}finally{o._dirtyElements=u,o._dirtyLeaves=d,o._cloneNotNeeded=f,o._dirtyType=h,ve=l,Oe=a,xe=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return ht(this),this.getEditorState().read(e,{editor:this})}update(e,t){Re(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Re(this,()=>{const o=B(),i=ge();o!==null?o.dirty=!0:i.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?i.selectStart():i.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Ye(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,yn("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}ur.version="0.17.1+prod.esm";const zf="";function ic(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sc=ic(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Bs=A.createContext(null);function lc(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function Tt(){const n=A.useContext(Bs);return n==null&&sc(8),n}const Ws=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ac=Ws?A.useLayoutEffect:A.useEffect,fr={tag:"history-merge"};function cc({initialConfig:n,children:e}){const t=A.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:l,html:a}=n,c=lc(null,r),u=Fs({editable:n.editable,html:a,namespace:o,nodes:i,onError:d=>s(d,u),theme:r});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=ge();if(h.isEmpty()){const p=Ve();h.append(p);const g=Ws?document.activeElement:null;(B()!==null||g!==null&&g===d.getRootElement())&&p.select()}},fr);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,fr);break}case"object":d.setEditorState(f,fr);break;case"function":d.update(()=>{ge().isEmpty()&&f(d)},fr)}}}(u,l),[u,c]},[]);return ac(()=>{const r=n.editable,[o]=t;o.setEditable(r===void 0||r)},[]),S.jsx(Bs.Provider,{value:t,children:e})}function uc({defaultSelection:n}){const[e]=Tt();return A.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function fc(){return ge().getTextContent()}function dc(n,e=!0){if(n)return!1;let t=fc();return e&&(t=t.trim()),t===""}function hc(n){if(!dc(n,!1))return!1;const e=ge().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const o=e[r];if(se(o))return!1;if(E(o)){if(!No(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let l=0;l<s;l++){const a=i[r];if(!D(a))return!1}}}return!0}function $s(n){return()=>hc(n)}function pc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}pc(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function gc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var mc=gc(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const _c=new Map;function yc(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(e[o.trim()]=i.trim())}return e}function zs(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,o]=t,i=n.isBackward(),s=r.getNode(),l=o.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,d]=To(n),f=s.is(l),h=e.is(i?l:s),p=e.is(i?s:l);let g,m=0;return f?(m=u>d?d:u,g=u>d?u:d):h?(m=i?d:u,g=void 0):p&&(m=0,g=i?u:d),e.__text=e.__text.slice(m,g),e}}return e}function Us(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return E(e)||mc(177),n.offset===e.getChildrenSize()}function vc(n){const e=n.getStyle(),t=yc(e);_c.set(e,t)}function Hs(n,e){const t=on(n.focus,e);return se(t)&&!t.isIsolated()||E(t)&&!t.isInline()&&!t.canBeEmpty()}function xc(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Tc(n){const e=n.anchor.getNode();return(Ee(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function Ys(n,e,t){const r=Tc(n);xc(n,e,t?!r:r,"character")}function bc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Cc=bc(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Ks=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ec=Ks&&"documentMode"in document?document.documentMode:null;!(!Ks||!("InputEvent"in window)||Ec)&&"getTargetRanges"in new window.InputEvent("input");function Bt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Sc(n){const e=Oo(n,t=>E(t)&&!t.isInline());return E(e)||Cc(4,n.__key),e}const Oo=(n,e)=>{let t=n;for(;t!==ge()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function bt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const qs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function wc({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:o,ariaExpanded:i,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:p="textbox",spellCheck:g=!0,style:m,tabIndex:T,"data-testid":v,...y},b){const[x,C]=A.useState(n.isEditable()),N=A.useCallback(O=>{O&&O.ownerDocument&&O.ownerDocument.defaultView?n.setRootElement(O):n.setRootElement(null)},[n]),w=A.useMemo(()=>function(...O){return z=>{O.forEach(X=>{typeof X=="function"?X(z):X!=null&&(X.current=z)})}}(b,N),[N,b]);return qs(()=>(C(n.isEditable()),n.registerEditableListener(O=>{C(O)})),[n]),S.jsx("div",{...y,"aria-activedescendant":x?e:void 0,"aria-autocomplete":x?t:"none","aria-controls":x?r:void 0,"aria-describedby":o,"aria-expanded":x&&p==="combobox"?!!i:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":x?c:void 0,"aria-readonly":!x||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:x,"data-testid":v,id:h,ref:w,role:x?p:void 0,spellCheck:g,style:m,tabIndex:T})}const kc=A.forwardRef(wc);function Vs(n){return n.getEditorState().read($s(n.isComposing()))}const Pc=A.forwardRef(Nc);function Nc(n,e){const{placeholder:t,...r}=n,[o]=Tt();return S.jsxs(S.Fragment,{children:[S.jsx(kc,{editor:o,...r,ref:e}),t!=null&&S.jsx(Oc,{editor:o,content:t})]})}function Oc({content:n,editor:e}){const t=function(s){const[l,a]=A.useState(()=>Vs(s));return qs(()=>{function c(){const u=Vs(s);a(u)}return c(),Bt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,o]=A.useState(e.isEditable());if(A.useLayoutEffect(()=>(o(e.isEditable()),e.registerEditableListener(s=>{o(s)})),[e]),!t)return null;let i=null;return typeof n=="function"?i=n(r):n!==null&&(i=n),i===null?null:S.jsx("div",{"aria-hidden":!0,children:i})}const dr=0,Ao=1,Io=2,ze=0,Ac=1,Js=2,Ic=3,Rc=4;function Dc(n,e,t,r,o){if(n===null||t.size===0&&r.size===0&&!o)return ze;const i=e._selection,s=n._selection;if(o)return Ac;if(!(I(i)&&I(s)&&s.isCollapsed()&&i.isCollapsed()))return ze;const l=function(T,v,y){const b=T._nodeMap,x=[];for(const C of v){const N=b.get(C);N!==void 0&&x.push(N)}for(const[C,N]of y){if(!N)continue;const w=b.get(C);w===void 0||Ee(w)||x.push(w)}return x}(e,t,r);if(l.length===0)return ze;if(l.length>1){const T=e._nodeMap,v=T.get(i.anchor.key),y=T.get(s.anchor.key);return v&&y&&!n._nodeMap.has(v.__key)&&D(v)&&v.__text.length===1&&i.anchor.offset===1?Js:ze}const a=l[0],c=n._nodeMap.get(a.__key);if(!D(c)||!D(a)||c.__mode!==a.__mode)return ze;const u=c.__text,d=a.__text;if(u===d)return ze;const f=i.anchor,h=s.anchor;if(f.key!==h.key||f.type!=="text")return ze;const p=f.offset,g=h.offset,m=d.length-u.length;return m===1&&g===p-1?Js:m===-1&&g===p+1?Ic:m===-1&&g===p?Rc:ze}function Mc(n,e){let t=Date.now(),r=ze;return(o,i,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=ze,t=u,Io;const d=Dc(o,i,l,a,n.isComposing()),f=(()=>{const h=s===null||s.editor===n,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return dr;if(o===null)return Ao;const g=i._selection;return l.size>0||a.size>0?p===!1&&d!==ze&&d===r&&u<t+e&&h||l.size===1&&function(m,T,v){const y=T._nodeMap.get(m),b=v._nodeMap.get(m),x=T._selection,C=v._selection;return!(I(x)&&I(C)&&x.anchor.type==="element"&&x.focus.type==="element"&&C.anchor.type==="text"&&C.focus.type==="text"||!D(y)||!D(b)||y.__parent!==b.__parent)&&JSON.stringify(T.read(()=>y.exportJSON()))===JSON.stringify(v.read(()=>b.exportJSON()))}(Array.from(l)[0],o,i)?dr:Ao:g!==null?dr:Io})();return t=u,r=d,f}}function Gs(n){n.undoStack=[],n.redoStack=[],n.current=null}function Lc(n,e,t){const r=Mc(n,t);return Bt(n.registerCommand(On,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),i.dispatchCommand(Gt,!0)),a.length===0&&i.dispatchCommand(Xt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),ne),n.registerCommand(An,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),i.dispatchCommand(Xt,!0));const u=l.pop();l.length===0&&i.dispatchCommand(Gt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),ne),n.registerCommand(ra,()=>(Gs(e),!1),ne),n.registerCommand(oa,()=>(Gs(e),n.dispatchCommand(Gt,!1),n.dispatchCommand(Xt,!1),!0),ne),n.registerUpdateListener(({editorState:i,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&i===h)return;const p=r(s,i,u,l,a,c);if(p===Ao)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Gt,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Xt,!0));else if(p===Io)return;e.current={editor:n,editorState:i}}))}function jc(){return{current:null,redoStack:[],undoStack:[]}}function Fc({delay:n,externalHistoryState:e}){const[t]=Tt();return function(r,o,i=1e3){const s=A.useMemo(()=>o||jc(),[o]);A.useEffect(()=>Lc(r,s,i),[i,r,s])}(t,e,n),null}const Bc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function Wc(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function $c(){return function(n){const[e]=Tt(),t=A.useMemo(()=>n(e),[e,n]),r=A.useRef(t.initialValueFn()),[o,i]=A.useState(r.current);return Bc(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,i(a)),l(c=>{r.current=c,i(c)})},[t,n]),o}(Wc)}function zc(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const o=n.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,d,f,h,p]=a;n.update(()=>{const g=B();if(I(g)){const m=g.anchor;let T=m.getNode(),v=0,y=0;if(D(T)&&c>=0&&u>=0&&(v=c,y=c+u,g.setTextNodeRange(T,v,T,y)),v===y&&d===""||(g.insertRawText(d),T=m.getNode()),D(T)){v=f,y=f+h;const b=T.getTextContentSize();v=v>b?b:v,y=y>b?b:y,g.setTextNodeRange(T,v,T,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Uc(n,e){const t=e.body?e.body.childNodes:[];let r=[];const o=[];for(let i=0;i<t.length;i++){const s=t[i];if(!Qs.has(s.nodeName)){const l=Zs(s,n,o,!1);l!==null&&(r=r.concat(l))}}return function(i){for(const s of i)s.getNextSibling()instanceof Po&&s.insertAfter(xt());for(const s of i){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(o),r}function Hc(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=ge().getChildren();for(let o=0;o<r.length;o++)Xs(n,r[o],t,e);return t.innerHTML}function Xs(n,e,t,r=null){let o=r===null||e.isSelected(r);const i=E(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let h=no(e);h=D(h)&&r!==null?zs(r,h):h,s=h}const l=E(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const p=l[h],g=Xs(n,p,f,r);!o&&E(e)&&g&&e.extractWithChild(p,r,"html")&&(o=!0)}if(o&&!i){if(Zr(u)&&u.append(f),t.append(u),d){const h=d.call(s,u);h&&u.replaceWith(h)}}else t.append(f);return o}const Qs=new Set(["STYLE","SCRIPT"]);function Zs(n,e,t,r,o=new Map,i){let s=[];if(Qs.has(n.nodeName))return s;let l=null;const a=function(p,g){const{nodeName:m}=p,T=g._htmlConversions.get(m.toLowerCase());let v=null;if(T!==void 0)for(const y of T){const b=y(p);b!==null&&(v===null||(v.priority||0)<(b.priority||0))&&(v=b)}return v!==null?v.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const p=c.node;if(l=Array.isArray(p)?p[p.length-1]:p,l!==null){for(const[,g]of o)if(l=g(l,i),!l)break;l&&s.push(...Array.isArray(p)?p:[l])}c.forChild!=null&&o.set(n.nodeName,c.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!It(l))&&(l!=null&&bo(l)||r);for(let p=0;p<d.length;p++)f.push(...Zs(d[p],e,t,h,new Map(o),l));return u!=null&&(f=u(f)),Vn(n)&&(f=Yc(n,f,h?()=>{const p=new Po;return t.push(p),p}:Ve)),l==null?f.length>0?s=s.concat(f):Vn(n)&&function(p){return p.nextSibling==null||p.previousSibling==null?!1:eo(p.nextSibling)&&eo(p.previousSibling)}(n)&&(s=s.concat(xt())):E(l)&&l.append(...f),s}function Yc(n,e,t){const r=n.style.textAlign,o=[];let i=[];for(let s=0;s<e.length;s++){const l=e[s];if(bo(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(i.push(l),s===e.length-1||s<e.length-1&&bo(e[s+1])){const a=t();a.setFormat(r),a.append(...i),o.push(a),i=[]}}return o}function Kc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hr=Kc(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const qc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,el=n=>qc?(n||window).getSelection():null;function Vc(n,e=B()){return e==null&&hr(166),I(e)&&e.isCollapsed()||e.getNodes().length===0?"":Hc(n,e)}function Jc(n,e=B()){return e==null&&hr(166),I(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Gc(n,e))}function tl(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return nl(t,Xc(s.nodes),e)}catch{}const o=n.getData("text/html");if(o)try{const s=new DOMParser().parseFromString(o,"text/html");return nl(t,Uc(t,s),e)}catch{}const i=n.getData("text/plain")||n.getData("text/uri-list");if(i!=null)if(I(e)){const s=i.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=B();if(I(a)){const c=s[l];c===`
40
40
  `||c===`\r
41
- `?a.insertParagraph():c===" "?a.insertNodes([Ht()]):a.insertText(c)}}}else e.insertRawText(i)}function vs(n,e,t){n.dispatchCommand(qs,{nodes:e,selection:t})||t.insertNodes(e)}function bs(n,e,t,r=[]){let o=e===null||t.isSelected(e);const i=b(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Fr(t);c=I(c)&&e!==null?ss(e,c):c,s=c}const l=b(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),h=c.constructor;if(u.type!==h.getType()&&Jn(58,h.name),b(c)){const d=u.children;Array.isArray(d)||Jn(59,h.name)}return u}(s);if(I(s)){const c=s.__text;c.length>0?a.text=c:o=!1}for(let c=0;c<l.length;c++){const u=l[c],h=bs(n,e,u,a.children);!o&&b(t)&&h&&t.extractWithChild(u,e,"clone")&&(o=!0)}if(o&&!i)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return o}function Xa(n,e){const t=[],r=G().getChildren();for(let o=0;o<r.length;o++)bs(n,e,r[o],t);return{namespace:n._config.namespace,nodes:t}}function Qa(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],o=ta(r);I(o)&&va(o),e.push(o)}return e}let vt=null;async function Cs(n,e,t){if(vt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(ws(n,e,t))})});const r=n.getRootElement(),o=n._window==null?window.document:n._window.document,i=ys(n._window);if(r===null||i===null)return!1;const s=o.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(o.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),i.removeAllRanges(),i.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(fn,h=>(nt(h,ClipboardEvent)&&(u(),vt!==null&&(window.clearTimeout(vt),vt=null),a(ws(n,h,t))),!0),oa);vt=window.setTimeout(()=>{u(),vt=null,a(!1)},50),o.execCommand("copy"),s.remove()})}function ws(n,e,t){if(t===void 0){const o=ys(n._window);if(!o)return!1;const i=o.anchorNode,s=o.focusNode;if(i!==null&&s!==null&&!Mt(n,i,s))return!1;const l=A();if(l===null)return!1;t=ec(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(tc(r,t),!0)}const Za=[["text/html",Ha],["application/x-lexical-editor",Ga]];function ec(n=A()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ll();for(const[r,o]of Za){const i=o(t,n);i!==null&&(e[r]=i)}}return e}function tc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ss(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const bt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,nc=bt&&"documentMode"in document?document.documentMode:null,rc=!(!bt||!("InputEvent"in window)||nc)&&"getTargetRanges"in new window.InputEvent("input"),oc=bt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ic=bt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,sc=bt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),lc=bt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!sc,Es=Ys();function Yn(n){let e=null;if(nt(n,DragEvent)?e=n.dataTransfer:nt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),o=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),o]}function Ts(n){const e=A();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(t.has(s))continue;const l=so(i,c=>b(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function qn(n){const e=Xe(n);return U(e)}function ac(n){return xt(n.registerCommand(wo,e=>{const t=A();return!!ve(t)&&(t.clear(),!0)},0),n.registerCommand(qe,e=>{const t=A();return!!O(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Nt,e=>{const t=A();return!!O(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(Pt,e=>{const t=A();return!!O(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(at,e=>{const t=A();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)xs(r,t,n);else if(O(t)){const o=e.data;return o&&t.insertText(o),!0}}return!0},K),n.registerCommand(or,()=>{const e=A();return!!O(e)&&(e.removeText(),!0)},K),n.registerCommand(ge,e=>{const t=A();return!!O(t)&&(t.formatText(e),!0)},K),n.registerCommand(Ot,e=>{const t=A();if(!O(t)&&!ve(t))return!1;const r=t.getNodes();for(const o of r){const i=so(o,s=>b(s)&&!s.isInline());i!==null&&i.setFormat(e)}return!0},K),n.registerCommand(lt,e=>{const t=A();return!!O(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(an,()=>{const e=A();return!!O(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(el,()=>(Ql([Ht()]),!0),K),n.registerCommand(tl,()=>Ts(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(Do,()=>Ts(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(To,e=>{const t=A();if(ve(t)&&!qn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(O(t)){const r=Rt(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(ko,e=>{const t=A();if(ve(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(O(t)){if(function(o){const i=o.focus;return i.key==="root"&&i.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Rt(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(Eo,e=>{const t=A();if(ve(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!O(t))return!1;if(as(t,!0)){const r=e.shiftKey;return e.preventDefault(),cs(t,r,!0),!0}return!1},K),n.registerCommand(So,e=>{const t=A();if(ve(t)&&!qn(e.target)){const o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!as(t,!1)&&(e.preventDefault(),cs(t,r,!1),!0)},K),n.registerCommand(No,e=>{if(qn(e.target))return!1;const t=A();if(!O(t))return!1;e.preventDefault();const{anchor:r}=t,o=r.getNode();return t.isCollapsed()&&r.offset===0&&!ie(o)&&Ta(o).getIndent()>0?n.dispatchCommand(Do,void 0):n.dispatchCommand(qe,!0)},K),n.registerCommand(Oo,e=>{if(qn(e.target))return!1;const t=A();return!!O(t)&&(e.preventDefault(),n.dispatchCommand(qe,!1))},K),n.registerCommand(dn,e=>{const t=A();if(!O(t))return!1;if(e!==null){if((ic||oc||lc)&&rc)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(lt,!1)}return n.dispatchCommand(an,void 0)},K),n.registerCommand(Po,()=>{const e=A();return!!O(e)&&(n.blur(),!0)},K),n.registerCommand(Io,e=>{const[,t]=Yn(e);if(t.length>0){const o=Ss(e.clientX,e.clientY);if(o!==null){const{offset:i,node:s}=o,l=Xe(s);if(l!==null){const a=Gl();if(I(l))a.anchor.set(l.getKey(),i,"text"),a.focus.set(l.getKey(),i,"text");else{const u=l.getParentOrThrow().getKey(),h=l.getIndexWithinParent()+1;a.anchor.set(u,h,"element"),a.focus.set(u,h,"element")}const c=Jo(a);Ce(c)}n.dispatchCommand(Es,t)}return e.preventDefault(),!0}const r=A();return!!O(r)},K),n.registerCommand(Fo,e=>{const[t]=Yn(e),r=A();return!(t&&!O(r))},K),n.registerCommand(Mo,e=>{const[t]=Yn(e),r=A();if(t&&!O(r))return!1;const o=Ss(e.clientX,e.clientY);if(o!==null){const i=Xe(o.node);U(i)&&e.preventDefault()}return!0},K),n.registerCommand(sr,()=>(Il(),!0),K),n.registerCommand(fn,e=>(Cs(n,nt(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(ir,e=>(async function(t,r){await Cs(r,nt(t,ClipboardEvent)?t:null),r.update(()=>{const o=A();O(o)?o.removeText():ve(o)&&o.getNodes().forEach(i=>i.remove())})}(e,n),!0),K),n.registerCommand(rr,e=>{const[,t,r]=Yn(e);return t.length>0&&!r?(n.dispatchCommand(Es,t),!0):xr(e.target)?!1:A()!==null&&(function(o,i){o.preventDefault(),i.update(()=>{const s=A(),l=nt(o,InputEvent)||nt(o,KeyboardEvent)?null:o.clipboardData;l!=null&&s!==null&&xs(l,s,i)},{tag:"paste"})}(e,n),!0)},K))}const co=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?M.useLayoutEffect:M.useEffect;function ks(n){return n.getEditorState().read(is(n.isComposing()))}function cc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=tt(),o=function(i,s){const[l,a]=M.useState(()=>i.getDecorators());return co(()=>i.registerDecoratorListener(c=>{sn.flushSync(()=>{a(c)})}),[i]),M.useEffect(()=>{a(i.getDecorators())},[i]),M.useMemo(()=>{const c=[],u=Object.keys(l);for(let h=0;h<u.length;h++){const d=u[h],f=E.jsx(s,{onError:m=>i._onError(m),children:E.jsx(M.Suspense,{fallback:null,children:l[d]})}),g=i.getElementByKey(d);g!==null&&c.push(sn.createPortal(f,g,d))}return c},[s,l,i])}(r,t);return function(i){co(()=>xt(ac(i),Ka(i)),[i])}(r),E.jsxs(E.Fragment,{children:[n,E.jsx(uc,{content:e}),o]})}function uc({content:n}){const[e]=tt(),t=function(o){const[i,s]=M.useState(()=>ks(o));return co(()=>{function l(){const a=ks(o);s(a)}return l(),xt(o.registerUpdateListener(()=>{l()}),o.registerEditableListener(()=>{l()}))},[o]),i}(e),r=za();return t?typeof n=="function"?n(r):n:null}function uo(n,e){return uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},uo(n,e)}var Ns={error:null},dc=function(n){var e,t;function r(){for(var i,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(i=n.call.apply(n,[this].concat(l))||this).state=Ns,i.resetErrorBoundary=function(){for(var c,u=arguments.length,h=new Array(u),d=0;d<u;d++)h[d]=arguments[d];i.props.onReset==null||(c=i.props).onReset.apply(c,h),i.reset()},i}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,uo(e,t),r.getDerivedStateFromError=function(i){return{error:i}};var o=r.prototype;return o.reset=function(){this.setState(Ns)},o.componentDidCatch=function(i,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,i,s)},o.componentDidUpdate=function(i,s){var l,a,c,u,h=this.state.error,d=this.props.resetKeys;h!==null&&s.error!==null&&((c=i.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(f,g){return!Object.is(f,u[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,i.resetKeys,d),this.reset())},o.render=function(){var i=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(i!==null){var u={error:i,resetErrorBoundary:this.resetErrorBoundary};if(it.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return it.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(it.Component);function fc({children:n,onError:e}){return E.jsx(dc,{fallback:E.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}var ke=(n=>(n.normal="96px",n.narrow="48px",n.moderate="96px 72px",n.wide="96px 192px",n))(ke||{});const hc=M.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),Hn=()=>M.useContext(hc),Xc="";function gc({onClose:n,children:e,title:t,closeOnClickOutside:r}){const o=M.useRef(null);return M.useEffect(()=>{o.current!==null&&o.current.focus()},[]),M.useEffect(()=>{let i=null;const s=c=>{c.key==="Escape"&&n()},l=c=>{const u=c.target;o.current!==null&&!o.current.contains(u)&&r&&n()},a=o.current;return a!==null&&(i=a.parentElement,i!==null&&i.addEventListener("click",l)),window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s),i!==null&&(i==null||i.removeEventListener("click",l))}},[r,n]),E.jsx("div",{className:"Modal__overlay",role:"dialog",children:E.jsxs("div",{className:"Modal__modal",tabIndex:-1,ref:o,children:[E.jsx("h2",{className:"Modal__title",children:t}),E.jsx("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:n,children:"X"}),E.jsx("div",{className:"Modal__content",children:e})]})})}function pc({onClose:n,children:e,title:t,closeOnClickOutside:r=!1}){return sn.createPortal(E.jsx(gc,{onClose:n,title:t,closeOnClickOutside:r,children:e}),document.body)}function mc(){const[n,e]=M.useState(null),t=M.useCallback(()=>{e(null)},[]),r=M.useMemo(()=>{if(n===null)return null;const{title:i,content:s,closeOnClickOutside:l}=n;return E.jsx(pc,{onClose:t,title:i,closeOnClickOutside:l,children:s})},[n,t]),o=M.useCallback((i,s,l=!1)=>{e({closeOnClickOutside:l,content:s(t),title:i})},[t]);return[r,o]}const Ps=it.createContext(null),Os=4;function en({children:n,className:e,onClick:t,title:r}){const o=M.useRef(null),i=it.useContext(Ps);if(i===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=i;return M.useEffect(()=>{o&&o.current&&s(o)},[o,s]),E.jsx("button",{className:e,onClick:t,ref:o,title:r,type:"button",children:n})}function _c({children:n,dropDownRef:e,onClose:t}){const[r,o]=M.useState(),[i,s]=M.useState(),l=M.useCallback(u=>{o(h=>h?[...h,u]:[u])},[o]),a=u=>{if(!r)return;const h=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(h)&&u.preventDefault(),h==="Escape"||h==="Tab"?t():h==="ArrowUp"?s(d=>{if(!d)return r[0];const f=r.indexOf(d)-1;return r[f===-1?r.length-1:f]}):h==="ArrowDown"&&s(d=>d?r[r.indexOf(d)+1]:r[0])},c=M.useMemo(()=>({registerItem:l}),[l]);return M.useEffect(()=>{r&&!i&&s(r[0]),i&&i.current&&i.current.focus()},[r,i]),E.jsx(Ps.Provider,{value:c,children:E.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function yc({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:o,children:i,stopCloseOnClickSelf:s}){const l=M.useRef(null),a=M.useRef(null),[c,u]=M.useState(!1),h=()=>{u(!1),a&&a.current&&a.current.focus()};return M.useEffect(()=>{const d=a.current,f=l.current;if(c&&d!==null&&f!==null){const{top:g,left:m}=d.getBoundingClientRect();f.style.top=`${g+d.offsetHeight+Os}px`,f.style.left=`${Math.min(m,window.innerWidth-f.offsetWidth-20)}px`}},[l,a,c]),M.useEffect(()=>{const d=a.current;if(d!==null&&c){const f=g=>{const m=g.target;s&&l.current&&l.current.contains(m)||d.contains(m)||u(!1)};return document.addEventListener("click",f),()=>{document.removeEventListener("click",f)}}},[l,a,c,s]),M.useEffect(()=>{const d=()=>{if(c){const f=a.current,g=l.current;if(f!==null&&g!==null){const{top:m}=f.getBoundingClientRect(),_=m+f.offsetHeight+Os;_!==g.getBoundingClientRect().top&&(g.style.top=`${_}px`)}}};return document.addEventListener("scroll",d),()=>{document.removeEventListener("scroll",d)}},[a,l,c]),E.jsxs(E.Fragment,{children:[E.jsxs("button",{type:"button",disabled:n,"aria-label":t||e,className:r,onClick:()=>u(!c),ref:a,children:[o&&E.jsx("span",{className:o}),e&&E.jsx("span",{className:"text dropdown-button-text",children:e}),E.jsx("i",{className:"chevron-down"})]}),c&&sn.createPortal(E.jsx(_c,{dropDownRef:l,onClose:h,children:i}),document.body)]})}const Qc="";function xc(...n){return n.filter(Boolean).join(" ")}function vc({"data-test-id":n,children:e,className:t,onClick:r,disabled:o,small:i,title:s}){return E.jsx("button",{disabled:o,className:xc("Button__root",o&&"Button__disabled",i&&"Button__small",t),onClick:r,title:s,"aria-label":s,...n&&{"data-test-id":n},children:e})}const Zc="";function bc({"data-test-id":n,children:e}){return E.jsx("div",{className:"DialogActions","data-test-id":n,children:e})}const eu="";function Gn({label:n,value:e,onChange:t,placeholder:r="","data-test-id":o,type:i="text",name:s=""}){return E.jsxs("div",{className:"Input__wrapper",children:[E.jsx("label",{className:"Input__label",children:n}),E.jsx("input",{type:i,className:"Input__input",placeholder:r,value:e,name:s,onChange:l=>{t(l.target.value,l.target.name)},"data-test-id":o})]})}const Cc=({onClose:n})=>{const{margin:e,updatePageMarginValue:t,updateCustomMargin:r}=Hn(),[o,i]=it.useState(""),s=()=>{const{top:h,right:d,bottom:f,left:g}=e,m=(816-100)/2,_=(1156-25)/2,v=[];if(+h*96>_&&v.push(`*Top margin is too large, maximum allowed is ${(_/96).toFixed(2)} inches.`),+d*96>m&&v.push(`*Right margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),+f*96>_&&v.push(`*Bottom margin is too large, maximum allowed is ${(_/96).toFixed(2)} inches.`),+g*96>m&&v.push(`*Left margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),v!=null&&v.length){i(v.join(`
42
- `));return}else{const y=`${+h*96}px ${+d*96}px ${+f*96}px ${+g*96}px`;t(y),n()}};return E.jsxs(E.Fragment,{children:[E.jsx(Gn,{label:"Top",onChange:r,value:e.top,"data-test-id":"custom-margin-top",type:"number",name:"top"}),E.jsx(Gn,{label:"Right",onChange:r,value:e.right,"data-test-id":"table-modal-right",type:"number",name:"right"}),E.jsx(Gn,{label:"Bottom",onChange:r,value:e.bottom,"data-test-id":"table-modal-bottom",type:"number",name:"bottom"}),E.jsx(Gn,{label:"Left",onChange:r,value:e.left,"data-test-id":"table-modal-left",type:"number",name:"left"}),E.jsx("div",{style:{color:"red",whiteSpace:"pre-line"},children:o}),E.jsx(bc,{"data-test-id":"table-model-confirm-insert",children:E.jsx(vc,{onClick:s,children:"Confirm"})})]})},Xn=n=>n?"active dropdown-item-active":"",wc=({isEditable:n})=>{const{pageMarginValue:e,updatePageMarginValue:t}=Hn(),[r,o]=mc();return E.jsxs(E.Fragment,{children:[E.jsxs(yc,{disabled:!n,buttonClassName:"toolbar-item spaced",buttonLabel:"Page Margin",buttonAriaLabel:"Page margin",buttonIconClassName:" plus",children:[E.jsx(en,{onClick:()=>t(ke.normal),className:"item "+Xn(e===ke.normal),children:E.jsx("span",{className:"text",children:"Normal"})}),E.jsx(en,{onClick:()=>t(ke.narrow),className:"item "+Xn(e===ke.narrow),children:E.jsx("span",{className:"text",children:"Narrow"})}),E.jsx(en,{onClick:()=>t(ke.moderate),className:"item "+Xn(e===ke.moderate),children:E.jsx("span",{className:"text",children:"Moderate"})}),E.jsx(en,{onClick:()=>t(ke.wide),className:"item "+Xn(e===ke.wide),children:E.jsx("span",{className:"text",children:"Wide"})}),E.jsx(en,{onClick:()=>{o("Custom Margin",i=>E.jsx(Cc,{onClose:i}))},className:"item ",children:E.jsx("span",{className:"text",children:"Custom"})})]}),r]})},Sc=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Ec(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),o=n.focus.getNode();return r===o?r:n.isBackward()?ls(t)?r:o:ls(e)?r:o}const fo=1;function ho(){return E.jsx("div",{className:"divider"})}function Tc(){const[n]=tt(),{updatePageMarginValue:e}=Hn(),t=M.useRef(null),[r,o]=M.useState(!1),[i,s]=M.useState(!1),[l,a]=M.useState(!1),[c,u]=M.useState(!1),[h,d]=M.useState(!1),[f,g]=M.useState(!1),[m,_]=M.useState(()=>n.isEditable());function v(x){}const y=M.useCallback(()=>{const x=A();if(O(x)){const S=Ec(x),w=S.getParent();a(x.hasFormat("bold")),u(x.hasFormat("italic")),d(x.hasFormat("underline")),g(x.hasFormat("strikethrough"));let C;mt(w)&&(C=Sc(S,N=>b(N)&&!N.isInline())),b(C)?C.getFormatType():b(S)?S.getFormatType():w!=null&&w.getFormatType(),e(ke)}},[]);return M.useEffect(()=>xt(n.registerUpdateListener(({editorState:x})=>{x.read(()=>{y()})}),n.registerCommand(ln,(x,S)=>(y(),!1),fo),n.registerCommand(It,x=>(o(x),!1),fo),n.registerCommand(Dt,x=>(s(x),!1),fo)),[n,y]),E.jsxs("div",{className:"toolbar",ref:t,children:[E.jsx("button",{disabled:!r,onClick:()=>{n.dispatchCommand(cn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:E.jsx("i",{className:"format undo"})}),E.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(un,void 0)},className:"toolbar-item","aria-label":"Redo",children:E.jsx("i",{className:"format redo"})}),E.jsx(ho,{}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"bold")},className:"toolbar-item spaced "+(l?"active":""),"aria-label":"Format Bold",children:E.jsx("i",{className:"format bold"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"italic")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Italics",children:E.jsx("i",{className:"format italic"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"underline")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Underline",children:E.jsx("i",{className:"format underline"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:E.jsx("i",{className:"format strikethrough"})}),E.jsx(ho,{}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:E.jsx("i",{className:"format left-align"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:E.jsx("i",{className:"format center-align"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:E.jsx("i",{className:"format right-align"})}),E.jsx("button",{onClick:()=>{n.dispatchCommand(Ot,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:E.jsx("i",{className:"format justify-align"})})," ",E.jsx(ho,{}),E.jsx(wc,{isEditable:m})]})}const kc={};function Nc(n){console.error(n)}function Pc(){return E.jsx("div",{className:"divider-horizontal"})}function Oc(){const{pageMarginValue:n}=Hn(),e={namespace:"MyEditor",theme:kc,onError:Nc};function t(){return E.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}return E.jsxs(ua,{initialConfig:e,children:[E.jsx("div",{className:"editor-container",children:E.jsx(Tc,{})}),E.jsxs("div",{className:"editor-container",children:[E.jsx(Pc,{}),E.jsxs("div",{className:"editor-inner",children:[E.jsx(cc,{contentEditable:E.jsx(Pa,{style:{margin:`${n}`},className:"editor-input"}),placeholder:E.jsx(t,{}),ErrorBoundary:fc}),E.jsx(Ra,{}),E.jsx(da,{})]})]})]})}je.Editor=Oc,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
41
+ `?a.insertParagraph():c===" "?a.insertNodes([gn()]):a.insertText(c)}}}else e.insertRawText(i)}function nl(n,e,t){n.dispatchCommand(Vl,{nodes:e,selection:t})||t.insertNodes(e)}function rl(n,e,t,r=[]){let o=e===null||t.isSelected(e);const i=E(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=no(t);c=D(c)&&e!==null?zs(e,c):c,s=c}const l=E(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&hr(58,d.name),E(c)){const f=u.children;Array.isArray(f)||hr(59,d.name)}return u}(s);if(D(s)){const c=s.__text;c.length>0?a.text=c:o=!1}for(let c=0;c<l.length;c++){const u=l[c],d=rl(n,e,u,a.children);!o&&E(t)&&d&&t.extractWithChild(u,e,"clone")&&(o=!0)}if(o&&!i)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return o}function Gc(n,e){const t=[],r=ge().getChildren();for(let o=0;o<r.length;o++)rl(n,e,r[o],t);return{namespace:n._config.namespace,nodes:t}}function Xc(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],o=tc(r);D(o)&&vc(o),e.push(o)}return e}let Wt=null;async function ol(n,e,t){if(Wt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(il(n,e,t))})});const r=n.getRootElement(),o=n._window==null?window.document:n._window.document,i=el(n._window);if(r===null||i===null)return!1;const s=o.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(o.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),i.removeAllRanges(),i.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(Rn,d=>(bt(d,ClipboardEvent)&&(u(),Wt!==null&&(window.clearTimeout(Wt),Wt=null),a(il(n,d,t))),!0),oc);Wt=window.setTimeout(()=>{u(),Wt=null,a(!1)},50),o.execCommand("copy"),s.remove()})}function il(n,e,t){if(t===void 0){const o=el(n._window);if(!o)return!1;const i=o.anchorNode,s=o.focusNode;if(i!==null&&s!==null&&!Zt(n,i,s))return!1;const l=B();if(l===null)return!1;t=Zc(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(eu(r,t),!0)}const Qc=[["text/html",Vc],["application/x-lexical-editor",Jc]];function Zc(n=B()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ma();for(const[r,o]of Qc){const i=o(t,n);i!==null&&(e[r]=i)}}return e}function eu(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function sl(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const $t=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,tu=$t&&"documentMode"in document?document.documentMode:null,nu=!(!$t||!("InputEvent"in window)||tu)&&"getTargetRanges"in new window.InputEvent("input"),ru=$t&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ou=$t&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,iu=$t&&/^(?=.*Chrome).*/i.test(navigator.userAgent),su=$t&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!iu,ll=ql();function pr(n){let e=null;if(bt(n,DragEvent)?e=n.dataTransfer:bt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),o=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),o]}function al(n){const e=B();if(!I(e))return!1;const t=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(t.has(s))continue;const l=Oo(i,c=>E(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function gr(n){const e=_t(n);return se(e)}function lu(n){return Bt(n.registerCommand(oi,e=>{const t=B();return!!$e(t)&&(t.clear(),!0)},0),n.registerCommand(pt,e=>{const t=B();return!!I(t)&&(t.deleteCharacter(e),!0)},ne),n.registerCommand(qt,e=>{const t=B();return!!I(t)&&(t.deleteWord(e),!0)},ne),n.registerCommand(Vt,e=>{const t=B();return!!I(t)&&(t.deleteLine(e),!0)},ne),n.registerCommand(Pt,e=>{const t=B();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)tl(r,t,n);else if(I(t)){const o=e.data;return o&&t.insertText(o),!0}}return!0},ne),n.registerCommand(kr,()=>{const e=B();return!!I(e)&&(e.removeText(),!0)},ne),n.registerCommand(Le,e=>{const t=B();return!!I(t)&&(t.formatText(e),!0)},ne),n.registerCommand(Jt,e=>{const t=B();if(!I(t)&&!$e(t))return!1;const r=t.getNodes();for(const o of r){const i=Oo(o,s=>E(s)&&!s.isInline());i!==null&&i.setFormat(e)}return!0},ne),n.registerCommand(kt,e=>{const t=B();return!!I(t)&&(t.insertLineBreak(e),!0)},ne),n.registerCommand(Nn,()=>{const e=B();return!!I(e)&&(e.insertParagraph(),!0)},ne),n.registerCommand(ea,()=>(Qa([gn()]),!0),ne),n.registerCommand(ta,()=>al(e=>{const t=e.getIndent();e.setIndent(t+1)}),ne),n.registerCommand(di,()=>al(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),ne),n.registerCommand(li,e=>{const t=B();if($e(t)&&!gr(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(I(t)){const r=on(t.focus,!0);if(!e.shiftKey&&se(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},ne),n.registerCommand(ai,e=>{const t=B();if($e(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(I(t)){if(function(o){const i=o.focus;return i.key==="root"&&i.offset===ge().getChildrenSize()}(t))return e.preventDefault(),!0;const r=on(t.focus,!1);if(!e.shiftKey&&se(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},ne),n.registerCommand(si,e=>{const t=B();if($e(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!I(t))return!1;if(Hs(t,!0)){const r=e.shiftKey;return e.preventDefault(),Ys(t,r,!0),!0}return!1},ne),n.registerCommand(ii,e=>{const t=B();if($e(t)&&!gr(e.target)){const o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}if(!I(t))return!1;const r=e.shiftKey;return!!Hs(t,!1)&&(e.preventDefault(),Ys(t,r,!1),!0)},ne),n.registerCommand(ci,e=>{if(gr(e.target))return!1;const t=B();if(!I(t))return!1;e.preventDefault();const{anchor:r}=t,o=r.getNode();return t.isCollapsed()&&r.offset===0&&!Ee(o)&&Sc(o).getIndent()>0?n.dispatchCommand(di,void 0):n.dispatchCommand(pt,!0)},ne),n.registerCommand(fi,e=>{if(gr(e.target))return!1;const t=B();return!!I(t)&&(e.preventDefault(),n.dispatchCommand(pt,!1))},ne),n.registerCommand(In,e=>{const t=B();if(!I(t))return!1;if(e!==null){if((ou||ru||su)&&nu)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(kt,!1)}return n.dispatchCommand(Nn,void 0)},ne),n.registerCommand(ui,()=>{const e=B();return!!I(e)&&(n.blur(),!0)},ne),n.registerCommand(hi,e=>{const[,t]=pr(e);if(t.length>0){const o=sl(e.clientX,e.clientY);if(o!==null){const{offset:i,node:s}=o,l=_t(s);if(l!==null){const a=Ga();if(D(l))a.anchor.set(l.getKey(),i,"text"),a.focus.set(l.getKey(),i,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=ki(a);He(c)}n.dispatchCommand(ll,t)}return e.preventDefault(),!0}const r=B();return!!I(r)},ne),n.registerCommand(pi,e=>{const[t]=pr(e),r=B();return!(t&&!I(r))},ne),n.registerCommand(gi,e=>{const[t]=pr(e),r=B();if(t&&!I(r))return!1;const o=sl(e.clientX,e.clientY);if(o!==null){const i=_t(o.node);se(i)&&e.preventDefault()}return!0},ne),n.registerCommand(Nr,()=>(Ia(),!0),ne),n.registerCommand(Rn,e=>(ol(n,bt(e,ClipboardEvent)?e:null),!0),ne),n.registerCommand(Pr,e=>(async function(t,r){await ol(r,bt(t,ClipboardEvent)?t:null),r.update(()=>{const o=B();I(o)?o.removeText():$e(o)&&o.getNodes().forEach(i=>i.remove())})}(e,n),!0),ne),n.registerCommand(wr,e=>{const[,t,r]=pr(e);return t.length>0&&!r?(n.dispatchCommand(ll,t),!0):zr(e.target)?!1:B()!==null&&(function(o,i){o.preventDefault(),i.update(()=>{const s=B(),l=bt(o,InputEvent)||bt(o,KeyboardEvent)?null:o.clipboardData;l!=null&&s!==null&&tl(l,s,i)},{tag:"paste"})}(e,n),!0)},ne))}const Ro=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function cl(n){return n.getEditorState().read($s(n.isComposing()))}function au({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=Tt(),o=function(i,s){const[l,a]=A.useState(()=>i.getDecorators());return Ro(()=>i.registerDecoratorListener(c=>{Sn.flushSync(()=>{a(c)})}),[i]),A.useEffect(()=>{a(i.getDecorators())},[i]),A.useMemo(()=>{const c=[],u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d],h=S.jsx(s,{onError:g=>i._onError(g),children:S.jsx(A.Suspense,{fallback:null,children:l[f]})}),p=i.getElementByKey(f);p!==null&&c.push(Sn.createPortal(h,p,f))}return c},[s,l,i])}(r,t);return function(i){Ro(()=>Bt(lu(i),zc(i)),[i])}(r),S.jsxs(S.Fragment,{children:[n,S.jsx(cu,{content:e}),o]})}function cu({content:n}){const[e]=Tt(),t=function(o){const[i,s]=A.useState(()=>cl(o));return Ro(()=>{function l(){const a=cl(o);s(a)}return l(),Bt(o.registerUpdateListener(()=>{l()}),o.registerEditableListener(()=>{l()}))},[o]),i}(e),r=$c();return t?typeof n=="function"?n(r):n:null}function Do(n,e){return Do=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Do(n,e)}var ul={error:null},uu=function(n){var e,t;function r(){for(var i,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(i=n.call.apply(n,[this].concat(l))||this).state=ul,i.resetErrorBoundary=function(){for(var c,u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];i.props.onReset==null||(c=i.props).onReset.apply(c,d),i.reset()},i}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,Do(e,t),r.getDerivedStateFromError=function(i){return{error:i}};var o=r.prototype;return o.reset=function(){this.setState(ul)},o.componentDidCatch=function(i,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,i,s)},o.componentDidUpdate=function(i,s){var l,a,c,u,d=this.state.error,f=this.props.resetKeys;d!==null&&s.error!==null&&((c=i.resetKeys)===void 0&&(c=[]),(u=f)===void 0&&(u=[]),c.length!==u.length||c.some(function(h,p){return!Object.is(h,u[p])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,i.resetKeys,f),this.reset())},o.render=function(){var i=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(i!==null){var u={error:i,resetErrorBoundary:this.resetErrorBoundary};if(St.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return St.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(St.Component);function fu({children:n,onError:e}){return S.jsx(uu,{fallback:S.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}var Je=(n=>(n.normal="96px",n.narrow="48px",n.moderate="96px 72px",n.wide="96px 192px",n))(Je||{});const du=A.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),mr=()=>A.useContext(du),Uf="";function hu({onClose:n,children:e,title:t,closeOnClickOutside:r}){const o=A.useRef(null);return A.useEffect(()=>{o.current!==null&&o.current.focus()},[]),A.useEffect(()=>{let i=null;const s=c=>{c.key==="Escape"&&n()},l=c=>{const u=c.target;o.current!==null&&!o.current.contains(u)&&r&&n()},a=o.current;return a!==null&&(i=a.parentElement,i!==null&&i.addEventListener("click",l)),window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s),i!==null&&(i==null||i.removeEventListener("click",l))}},[r,n]),S.jsx("div",{className:"Modal__overlay",role:"dialog",children:S.jsxs("div",{className:"Modal__modal",tabIndex:-1,ref:o,children:[S.jsx("h2",{className:"Modal__title",children:t}),S.jsx("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:n,children:"X"}),S.jsx("div",{className:"Modal__content",children:e})]})})}function pu({onClose:n,children:e,title:t,closeOnClickOutside:r=!1}){return Sn.createPortal(S.jsx(hu,{onClose:n,title:t,closeOnClickOutside:r,children:e}),document.body)}function gu(){const[n,e]=A.useState(null),t=A.useCallback(()=>{e(null)},[]),r=A.useMemo(()=>{if(n===null)return null;const{title:i,content:s,closeOnClickOutside:l}=n;return S.jsx(pu,{onClose:t,title:i,closeOnClickOutside:l,children:s})},[n,t]),o=A.useCallback((i,s,l=!1)=>{e({closeOnClickOutside:l,content:s(t),title:i})},[t]);return[r,o]}const fl=St.createContext(null),dl=4;function xn({children:n,className:e,onClick:t,title:r}){const o=A.useRef(null),i=St.useContext(fl);if(i===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=i;return A.useEffect(()=>{o&&o.current&&s(o)},[o,s]),S.jsx("button",{className:e,onClick:t,ref:o,title:r,type:"button",children:n})}function mu({children:n,dropDownRef:e,onClose:t}){const[r,o]=A.useState(),[i,s]=A.useState(),l=A.useCallback(u=>{o(d=>d?[...d,u]:[u])},[o]),a=u=>{if(!r)return;const d=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(d)&&u.preventDefault(),d==="Escape"||d==="Tab"?t():d==="ArrowUp"?s(f=>{if(!f)return r[0];const h=r.indexOf(f)-1;return r[h===-1?r.length-1:h]}):d==="ArrowDown"&&s(f=>f?r[r.indexOf(f)+1]:r[0])},c=A.useMemo(()=>({registerItem:l}),[l]);return A.useEffect(()=>{r&&!i&&s(r[0]),i&&i.current&&i.current.focus()},[r,i]),S.jsx(fl.Provider,{value:c,children:S.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function _u({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:o,children:i,stopCloseOnClickSelf:s}){const l=A.useRef(null),a=A.useRef(null),[c,u]=A.useState(!1),d=()=>{u(!1),a&&a.current&&a.current.focus()};return A.useEffect(()=>{const f=a.current,h=l.current;if(c&&f!==null&&h!==null){const{top:p,left:g}=f.getBoundingClientRect();h.style.top=`${p+f.offsetHeight+dl}px`,h.style.left=`${Math.min(g,window.innerWidth-h.offsetWidth-20)}px`}},[l,a,c]),A.useEffect(()=>{const f=a.current;if(f!==null&&c){const h=p=>{const g=p.target;s&&l.current&&l.current.contains(g)||f.contains(g)||u(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[l,a,c,s]),A.useEffect(()=>{const f=()=>{if(c){const h=a.current,p=l.current;if(h!==null&&p!==null){const{top:g}=h.getBoundingClientRect(),m=g+h.offsetHeight+dl;m!==p.getBoundingClientRect().top&&(p.style.top=`${m}px`)}}};return document.addEventListener("scroll",f),()=>{document.removeEventListener("scroll",f)}},[a,l,c]),S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",disabled:n,"aria-label":t||e,className:r,onClick:()=>u(!c),ref:a,children:[o&&S.jsx("span",{className:o}),e&&S.jsx("span",{className:"text dropdown-button-text",children:e}),S.jsx("i",{className:"chevron-down"})]}),c&&Sn.createPortal(S.jsx(mu,{dropDownRef:l,onClose:d,children:i}),document.body)]})}const Hf="";function yu(...n){return n.filter(Boolean).join(" ")}function vu({"data-test-id":n,children:e,className:t,onClick:r,disabled:o,small:i,title:s}){return S.jsx("button",{disabled:o,className:yu("Button__root",o&&"Button__disabled",i&&"Button__small",t),onClick:r,title:s,"aria-label":s,...n&&{"data-test-id":n},children:e})}const Yf="";function xu({"data-test-id":n,children:e}){return S.jsx("div",{className:"DialogActions","data-test-id":n,children:e})}const Kf="";function _r({label:n,value:e,onChange:t,placeholder:r="","data-test-id":o,type:i="text",name:s=""}){return S.jsxs("div",{className:"Input__wrapper",children:[S.jsx("label",{className:"Input__label",children:n}),S.jsx("input",{type:i,className:"Input__input",placeholder:r,value:e,name:s,onChange:l=>{t(l.target.value,l.target.name)},"data-test-id":o})]})}const Tu=({onClose:n})=>{const{margin:e,updatePageMarginValue:t,updateCustomMargin:r}=mr(),[o,i]=St.useState(""),s=()=>{const{top:d,right:f,bottom:h,left:p}=e,g=(816-100)/2,m=(1156-25)/2,T=[];if(+d*96>m&&T.push(`*Top margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),+f*96>g&&T.push(`*Right margin is too large, maximum allowed is ${(g/96).toFixed(2)} inches.`),+h*96>m&&T.push(`*Bottom margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),+p*96>g&&T.push(`*Left margin is too large, maximum allowed is ${(g/96).toFixed(2)} inches.`),T!=null&&T.length){i(T.join(`
42
+ `));return}else{const v=`${+d*96}px ${+f*96}px ${+h*96}px ${+p*96}px`;t(v),n()}};return S.jsxs(S.Fragment,{children:[S.jsx(_r,{label:"Top",onChange:r,value:e.top,"data-test-id":"custom-margin-top",type:"number",name:"top"}),S.jsx(_r,{label:"Right",onChange:r,value:e.right,"data-test-id":"table-modal-right",type:"number",name:"right"}),S.jsx(_r,{label:"Bottom",onChange:r,value:e.bottom,"data-test-id":"table-modal-bottom",type:"number",name:"bottom"}),S.jsx(_r,{label:"Left",onChange:r,value:e.left,"data-test-id":"table-modal-left",type:"number",name:"left"}),S.jsx("div",{style:{color:"red",whiteSpace:"pre-line"},children:o}),S.jsx(xu,{"data-test-id":"table-model-confirm-insert",children:S.jsx(vu,{onClick:s,children:"Confirm"})})]})},yr=n=>n?"active dropdown-item-active":"",bu=({isEditable:n})=>{const{pageMarginValue:e,updatePageMarginValue:t}=mr(),[r,o]=gu();return S.jsxs(S.Fragment,{children:[S.jsxs(_u,{disabled:!n,buttonClassName:"toolbar-item spaced",buttonLabel:"Page Margin",buttonAriaLabel:"Page margin",buttonIconClassName:" plus",children:[S.jsx(xn,{onClick:()=>t(Je.normal),className:"item "+yr(e===Je.normal),children:S.jsx("span",{className:"text",children:"Normal"})}),S.jsx(xn,{onClick:()=>t(Je.narrow),className:"item "+yr(e===Je.narrow),children:S.jsx("span",{className:"text",children:"Narrow"})}),S.jsx(xn,{onClick:()=>t(Je.moderate),className:"item "+yr(e===Je.moderate),children:S.jsx("span",{className:"text",children:"Moderate"})}),S.jsx(xn,{onClick:()=>t(Je.wide),className:"item "+yr(e===Je.wide),children:S.jsx("span",{className:"text",children:"Wide"})}),S.jsx(xn,{onClick:()=>{o("Custom Margin",i=>S.jsx(Tu,{onClose:i}))},className:"item ",children:S.jsx("span",{className:"text",children:"Custom"})})]}),r]})},Cu=(n,e)=>{let t=n;for(;t!==ge()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Eu(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),o=n.focus.getNode();return r===o?r:n.isBackward()?Us(t)?r:o:Us(e)?r:o}const Mo=1;function Lo(){return S.jsx("div",{className:"divider"})}function Su(){const[n]=Tt(),{updatePageMarginValue:e}=mr(),t=A.useRef(null),[r,o]=A.useState(!1),[i,s]=A.useState(!1),[l,a]=A.useState(!1),[c,u]=A.useState(!1),[d,f]=A.useState(!1),[h,p]=A.useState(!1),[g,m]=A.useState(()=>n.isEditable());function T(y){}const v=A.useCallback(()=>{const y=B();if(I(y)){const b=Eu(y),x=b.getParent();a(y.hasFormat("bold")),u(y.hasFormat("italic")),f(y.hasFormat("underline")),p(y.hasFormat("strikethrough"));let C;Lt(x)&&(C=Cu(b,N=>E(N)&&!N.isInline())),E(C)?C.getFormatType():E(b)?b.getFormatType():x!=null&&x.getFormatType(),e(Je)}},[]);return A.useEffect(()=>Bt(n.registerUpdateListener(({editorState:y})=>{y.read(()=>{v()})}),n.registerCommand(Pn,(y,b)=>(v(),!1),Mo),n.registerCommand(Xt,y=>(o(y),!1),Mo),n.registerCommand(Gt,y=>(s(y),!1),Mo)),[n,v]),S.jsxs("div",{className:"toolbar",ref:t,children:[S.jsx("button",{disabled:!r,onClick:()=>{n.dispatchCommand(On,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:S.jsx("i",{className:"format undo"})}),S.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(An,void 0)},className:"toolbar-item","aria-label":"Redo",children:S.jsx("i",{className:"format redo"})}),S.jsx(Lo,{}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Le,"bold")},className:"toolbar-item spaced "+(l?"active":""),"aria-label":"Format Bold",children:S.jsx("i",{className:"format bold"})}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Le,"italic")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Italics",children:S.jsx("i",{className:"format italic"})}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Le,"underline")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Underline",children:S.jsx("i",{className:"format underline"})}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Le,"strikethrough")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Strikethrough",children:S.jsx("i",{className:"format strikethrough"})}),S.jsx(Lo,{}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Jt,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:S.jsx("i",{className:"format left-align"})}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Jt,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:S.jsx("i",{className:"format center-align"})}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Jt,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:S.jsx("i",{className:"format right-align"})}),S.jsx("button",{onClick:()=>{n.dispatchCommand(Jt,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:S.jsx("i",{className:"format justify-align"})})," ",S.jsx(Lo,{}),S.jsx(bu,{isEditable:g})]})}var jo={exports:{}},vr={exports:{}},re={};/** @license React v16.13.1
43
+ * react-is.production.min.js
44
+ *
45
+ * Copyright (c) Facebook, Inc. and its affiliates.
46
+ *
47
+ * This source code is licensed under the MIT license found in the
48
+ * LICENSE file in the root directory of this source tree.
49
+ */var hl;function wu(){if(hl)return re;hl=1;var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,a=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,u=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,p=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,m=n?Symbol.for("react.fundamental"):60117,T=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function y(x){if(typeof x=="object"&&x!==null){var C=x.$$typeof;switch(C){case e:switch(x=x.type,x){case a:case c:case r:case i:case o:case d:return x;default:switch(x=x&&x.$$typeof,x){case l:case u:case p:case h:case s:return x;default:return C}}case t:return C}}}function b(x){return y(x)===c}return re.AsyncMode=a,re.ConcurrentMode=c,re.ContextConsumer=l,re.ContextProvider=s,re.Element=e,re.ForwardRef=u,re.Fragment=r,re.Lazy=p,re.Memo=h,re.Portal=t,re.Profiler=i,re.StrictMode=o,re.Suspense=d,re.isAsyncMode=function(x){return b(x)||y(x)===a},re.isConcurrentMode=b,re.isContextConsumer=function(x){return y(x)===l},re.isContextProvider=function(x){return y(x)===s},re.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},re.isForwardRef=function(x){return y(x)===u},re.isFragment=function(x){return y(x)===r},re.isLazy=function(x){return y(x)===p},re.isMemo=function(x){return y(x)===h},re.isPortal=function(x){return y(x)===t},re.isProfiler=function(x){return y(x)===i},re.isStrictMode=function(x){return y(x)===o},re.isSuspense=function(x){return y(x)===d},re.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===i||x===o||x===d||x===f||typeof x=="object"&&x!==null&&(x.$$typeof===p||x.$$typeof===h||x.$$typeof===s||x.$$typeof===l||x.$$typeof===u||x.$$typeof===m||x.$$typeof===T||x.$$typeof===v||x.$$typeof===g)},re.typeOf=y,re}var oe={};/** @license React v16.13.1
50
+ * react-is.development.js
51
+ *
52
+ * Copyright (c) Facebook, Inc. and its affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var pl;function ku(){return pl||(pl=1,process.env.NODE_ENV!=="production"&&function(){var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,a=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,u=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,p=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,m=n?Symbol.for("react.fundamental"):60117,T=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function y(M){return typeof M=="string"||typeof M=="function"||M===r||M===c||M===i||M===o||M===d||M===f||typeof M=="object"&&M!==null&&(M.$$typeof===p||M.$$typeof===h||M.$$typeof===s||M.$$typeof===l||M.$$typeof===u||M.$$typeof===m||M.$$typeof===T||M.$$typeof===v||M.$$typeof===g)}function b(M){if(typeof M=="object"&&M!==null){var Me=M.$$typeof;switch(Me){case e:var Ht=M.type;switch(Ht){case a:case c:case r:case i:case o:case d:return Ht;default:var Et=Ht&&Ht.$$typeof;switch(Et){case l:case u:case p:case h:case s:return Et;default:return Me}}case t:return Me}}}var x=a,C=c,N=l,w=s,O=e,z=u,X=r,he=p,le=h,H=t,ie=i,ue=o,be=d,De=!1;function nt(M){return De||(De=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),k(M)||b(M)===a}function k(M){return b(M)===c}function F(M){return b(M)===l}function J(M){return b(M)===s}function q(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function $(M){return b(M)===u}function Q(M){return b(M)===r}function W(M){return b(M)===p}function Y(M){return b(M)===h}function V(M){return b(M)===t}function Z(M){return b(M)===i}function G(M){return b(M)===o}function Se(M){return b(M)===d}oe.AsyncMode=x,oe.ConcurrentMode=C,oe.ContextConsumer=N,oe.ContextProvider=w,oe.Element=O,oe.ForwardRef=z,oe.Fragment=X,oe.Lazy=he,oe.Memo=le,oe.Portal=H,oe.Profiler=ie,oe.StrictMode=ue,oe.Suspense=be,oe.isAsyncMode=nt,oe.isConcurrentMode=k,oe.isContextConsumer=F,oe.isContextProvider=J,oe.isElement=q,oe.isForwardRef=$,oe.isFragment=Q,oe.isLazy=W,oe.isMemo=Y,oe.isPortal=V,oe.isProfiler=Z,oe.isStrictMode=G,oe.isSuspense=Se,oe.isValidElementType=y,oe.typeOf=b}()),oe}var gl;function ml(){return gl||(gl=1,process.env.NODE_ENV==="production"?vr.exports=wu():vr.exports=ku()),vr.exports}var Fo,_l;function Bo(){if(_l)return Fo;_l=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Fo=n,Fo}var Wo,yl;function vl(){return yl||(yl=1,Wo=Function.call.bind(Object.prototype.hasOwnProperty)),Wo}var $o,xl;function Pu(){if(xl)return $o;xl=1;var n=function(){};if(process.env.NODE_ENV!=="production"){var e=Bo(),t={},r=vl();n=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,l,a,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var f=Error((a||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=i[u](s,u,a,l,null,e)}catch(p){d=p}if(d&&!(d instanceof Error)&&n((a||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in t)){t[d.message]=!0;var h=c?c():"";n("Failed "+l+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},$o=o,$o}var zo,Tl;function Nu(){if(Tl)return zo;Tl=1;var n=ml(),e=kn(),t=Bo(),r=vl(),o=Pu(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function s(){return null}return zo=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(k){var F=k&&(c&&k[c]||k[u]);if(typeof F=="function")return F}var f="<<anonymous>>",h={array:T("array"),bigint:T("bigint"),bool:T("boolean"),func:T("function"),number:T("number"),object:T("object"),string:T("string"),symbol:T("symbol"),any:v(),arrayOf:y,element:b(),elementType:x(),instanceOf:C,node:z(),objectOf:w,oneOf:N,oneOfType:O,shape:he,exact:le};function p(k,F){return k===F?k!==0||1/k===1/F:k!==k&&F!==F}function g(k,F){this.message=k,this.data=F&&typeof F=="object"?F:{},this.stack=""}g.prototype=Error.prototype;function m(k){if(process.env.NODE_ENV!=="production")var F={},J=0;function q(Q,W,Y,V,Z,G,Se){if(V=V||f,G=G||Y,Se!==t){if(a){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Me=V+":"+Y;!F[Me]&&J<3&&(i("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+V+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),F[Me]=!0,J++)}}return W[Y]==null?Q?W[Y]===null?new g("The "+Z+" `"+G+"` is marked as required "+("in `"+V+"`, but its value is `null`.")):new g("The "+Z+" `"+G+"` is marked as required in "+("`"+V+"`, but its value is `undefined`.")):null:k(W,Y,V,Z,G)}var $=q.bind(null,!1);return $.isRequired=q.bind(null,!0),$}function T(k){function F(J,q,$,Q,W,Y){var V=J[q],Z=ue(V);if(Z!==k){var G=be(V);return new g("Invalid "+Q+" `"+W+"` of type "+("`"+G+"` supplied to `"+$+"`, expected ")+("`"+k+"`."),{expectedType:k})}return null}return m(F)}function v(){return m(s)}function y(k){function F(J,q,$,Q,W){if(typeof k!="function")return new g("Property `"+W+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var Y=J[q];if(!Array.isArray(Y)){var V=ue(Y);return new g("Invalid "+Q+" `"+W+"` of type "+("`"+V+"` supplied to `"+$+"`, expected an array."))}for(var Z=0;Z<Y.length;Z++){var G=k(Y,Z,$,Q,W+"["+Z+"]",t);if(G instanceof Error)return G}return null}return m(F)}function b(){function k(F,J,q,$,Q){var W=F[J];if(!l(W)){var Y=ue(W);return new g("Invalid "+$+" `"+Q+"` of type "+("`"+Y+"` supplied to `"+q+"`, expected a single ReactElement."))}return null}return m(k)}function x(){function k(F,J,q,$,Q){var W=F[J];if(!n.isValidElementType(W)){var Y=ue(W);return new g("Invalid "+$+" `"+Q+"` of type "+("`"+Y+"` supplied to `"+q+"`, expected a single ReactElement type."))}return null}return m(k)}function C(k){function F(J,q,$,Q,W){if(!(J[q]instanceof k)){var Y=k.name||f,V=nt(J[q]);return new g("Invalid "+Q+" `"+W+"` of type "+("`"+V+"` supplied to `"+$+"`, expected ")+("instance of `"+Y+"`."))}return null}return m(F)}function N(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function F(J,q,$,Q,W){for(var Y=J[q],V=0;V<k.length;V++)if(p(Y,k[V]))return null;var Z=JSON.stringify(k,function(Se,M){var Me=be(M);return Me==="symbol"?String(M):M});return new g("Invalid "+Q+" `"+W+"` of value `"+String(Y)+"` "+("supplied to `"+$+"`, expected one of "+Z+"."))}return m(F)}function w(k){function F(J,q,$,Q,W){if(typeof k!="function")return new g("Property `"+W+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var Y=J[q],V=ue(Y);if(V!=="object")return new g("Invalid "+Q+" `"+W+"` of type "+("`"+V+"` supplied to `"+$+"`, expected an object."));for(var Z in Y)if(r(Y,Z)){var G=k(Y,Z,$,Q,W+"."+Z,t);if(G instanceof Error)return G}return null}return m(F)}function O(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var F=0;F<k.length;F++){var J=k[F];if(typeof J!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+De(J)+" at index "+F+"."),s}function q($,Q,W,Y,V){for(var Z=[],G=0;G<k.length;G++){var Se=k[G],M=Se($,Q,W,Y,V,t);if(M==null)return null;M.data&&r(M.data,"expectedType")&&Z.push(M.data.expectedType)}var Me=Z.length>0?", expected one of type ["+Z.join(", ")+"]":"";return new g("Invalid "+Y+" `"+V+"` supplied to "+("`"+W+"`"+Me+"."))}return m(q)}function z(){function k(F,J,q,$,Q){return H(F[J])?null:new g("Invalid "+$+" `"+Q+"` supplied to "+("`"+q+"`, expected a ReactNode."))}return m(k)}function X(k,F,J,q,$){return new g((k||"React class")+": "+F+" type `"+J+"."+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function he(k){function F(J,q,$,Q,W){var Y=J[q],V=ue(Y);if(V!=="object")return new g("Invalid "+Q+" `"+W+"` of type `"+V+"` "+("supplied to `"+$+"`, expected `object`."));for(var Z in k){var G=k[Z];if(typeof G!="function")return X($,Q,W,Z,be(G));var Se=G(Y,Z,$,Q,W+"."+Z,t);if(Se)return Se}return null}return m(F)}function le(k){function F(J,q,$,Q,W){var Y=J[q],V=ue(Y);if(V!=="object")return new g("Invalid "+Q+" `"+W+"` of type `"+V+"` "+("supplied to `"+$+"`, expected `object`."));var Z=e({},J[q],k);for(var G in Z){var Se=k[G];if(r(k,G)&&typeof Se!="function")return X($,Q,W,G,be(Se));if(!Se)return new g("Invalid "+Q+" `"+W+"` key `"+G+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(J[q],null," ")+`
57
+ Valid keys: `+JSON.stringify(Object.keys(k),null," "));var M=Se(Y,G,$,Q,W+"."+G,t);if(M)return M}return null}return m(F)}function H(k){switch(typeof k){case"number":case"string":case"undefined":return!0;case"boolean":return!k;case"object":if(Array.isArray(k))return k.every(H);if(k===null||l(k))return!0;var F=d(k);if(F){var J=F.call(k),q;if(F!==k.entries){for(;!(q=J.next()).done;)if(!H(q.value))return!1}else for(;!(q=J.next()).done;){var $=q.value;if($&&!H($[1]))return!1}}else return!1;return!0;default:return!1}}function ie(k,F){return k==="symbol"?!0:F?F["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&F instanceof Symbol:!1}function ue(k){var F=typeof k;return Array.isArray(k)?"array":k instanceof RegExp?"object":ie(F,k)?"symbol":F}function be(k){if(typeof k>"u"||k===null)return""+k;var F=ue(k);if(F==="object"){if(k instanceof Date)return"date";if(k instanceof RegExp)return"regexp"}return F}function De(k){var F=be(k);switch(F){case"array":case"object":return"an "+F;case"boolean":case"date":case"regexp":return"a "+F;default:return F}}function nt(k){return!k.constructor||!k.constructor.name?f:k.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},zo}var Uo,bl;function Ou(){if(bl)return Uo;bl=1;var n=Bo();function e(){}function t(){}return t.resetWarningCache=e,Uo=function(){function r(s,l,a,c,u,d){if(d!==n){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:t,resetWarningCache:e};return i.PropTypes=i,i},Uo}if(process.env.NODE_ENV!=="production"){var Au=ml(),Iu=!0;jo.exports=Nu()(Au.isElement,Iu)}else jo.exports=Ou()();var Ru=jo.exports;const fe=wn(Ru);function Du(n){return n&&typeof n=="object"&&"default"in n?n.default:n}var Cl=A,Mu=Du(Cl);function El(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lu(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}var ju=!!(typeof window<"u"&&window.document&&window.document.createElement);function Fu(n,e,t){if(typeof n!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof e!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof t<"u"&&typeof t!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function r(o){return o.displayName||o.name||"Component"}return function(i){if(typeof i!="function")throw new Error("Expected WrappedComponent to be a React component.");var s=[],l;function a(){l=n(s.map(function(u){return u.props})),c.canUseDOM?e(l):t&&(l=t(l))}var c=function(u){Lu(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return l},d.rewind=function(){if(d.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var p=l;return l=void 0,s=[],p};var f=d.prototype;return f.UNSAFE_componentWillMount=function(){s.push(this),a()},f.componentDidUpdate=function(){a()},f.componentWillUnmount=function(){var p=s.indexOf(this);s.splice(p,1),a()},f.render=function(){return Mu.createElement(i,this.props)},d}(Cl.PureComponent);return El(c,"displayName","SideEffect("+r(i)+")"),El(c,"canUseDOM",ju),c}}var Bu=Fu;const Wu=wn(Bu);var $u=typeof Element<"u",zu=typeof Map=="function",Uu=typeof Set=="function",Hu=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function xr(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,r,o;if(Array.isArray(n)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(!xr(n[r],e[r]))return!1;return!0}var i;if(zu&&n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(i=n.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;for(i=n.entries();!(r=i.next()).done;)if(!xr(r.value[1],e.get(r.value[0])))return!1;return!0}if(Uu&&n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(i=n.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(Hu&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(n[r]!==e[r])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof e.valueOf=="function")return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof e.toString=="function")return n.toString()===e.toString();if(o=Object.keys(n),t=o.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;if($u&&n instanceof Element)return!1;for(r=t;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&n.$$typeof)&&!xr(n[o[r]],e[o[r]]))return!1;return!0}return n!==n&&e!==e}var Yu=function(e,t){try{return xr(e,t)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const Ku=wn(Yu);var qu=kn();const Vu=wn(qu);var Ct={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},K={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},Sl=Object.keys(K).map(function(n){return K[n]}),de={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},Tr={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Tn={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},Ju=Object.keys(Tr).reduce(function(n,e){return n[Tr[e]]=e,n},{}),Gu=[K.NOSCRIPT,K.SCRIPT,K.STYLE],Ue="data-react-helmet",Xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qu=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},Zu=function(){function n(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),Ie=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ef=function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)},wl=function(n,e){var t={};for(var r in n)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},tf=function(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n},Ho=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},nf=function(e){var t=zt(e,K.TITLE),r=zt(e,Tn.TITLE_TEMPLATE);if(r&&t)return r.replace(/%s/g,function(){return Array.isArray(t)?t.join(""):t});var o=zt(e,Tn.DEFAULT_TITLE);return t||o||void 0},rf=function(e){return zt(e,Tn.ON_CHANGE_CLIENT_STATE)||function(){}},Yo=function(e,t){return t.filter(function(r){return typeof r[e]<"u"}).map(function(r){return r[e]}).reduce(function(r,o){return Ie({},r,o)},{})},of=function(e,t){return t.filter(function(r){return typeof r[K.BASE]<"u"}).map(function(r){return r[K.BASE]}).reverse().reduce(function(r,o){if(!r.length)for(var i=Object.keys(o),s=0;s<i.length;s++){var l=i[s],a=l.toLowerCase();if(e.indexOf(a)!==-1&&o[a])return r.concat(o)}return r},[])},bn=function(e,t,r){var o={};return r.filter(function(i){return Array.isArray(i[e])?!0:(typeof i[e]<"u"&&qo("Helmet: "+e+' should be of type "Array". Instead found type "'+Xu(i[e])+'"'),!1)}).map(function(i){return i[e]}).reverse().reduce(function(i,s){var l={};s.filter(function(f){for(var h=void 0,p=Object.keys(f),g=0;g<p.length;g++){var m=p[g],T=m.toLowerCase();t.indexOf(T)!==-1&&!(h===de.REL&&f[h].toLowerCase()==="canonical")&&!(T===de.REL&&f[T].toLowerCase()==="stylesheet")&&(h=T),t.indexOf(m)!==-1&&(m===de.INNER_HTML||m===de.CSS_TEXT||m===de.ITEM_PROP)&&(h=m)}if(!h||!f[h])return!1;var v=f[h].toLowerCase();return o[h]||(o[h]={}),l[h]||(l[h]={}),o[h][v]?!1:(l[h][v]=!0,!0)}).reverse().forEach(function(f){return i.push(f)});for(var a=Object.keys(l),c=0;c<a.length;c++){var u=a[c],d=Vu({},o[u],l[u]);o[u]=d}return i},[]).reverse()},zt=function(e,t){for(var r=e.length-1;r>=0;r--){var o=e[r];if(o.hasOwnProperty(t))return o[t]}return null},sf=function(e){return{baseTag:of([de.HREF,de.TARGET],e),bodyAttributes:Yo(Ct.BODY,e),defer:zt(e,Tn.DEFER),encode:zt(e,Tn.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Yo(Ct.HTML,e),linkTags:bn(K.LINK,[de.REL,de.HREF],e),metaTags:bn(K.META,[de.NAME,de.CHARSET,de.HTTPEQUIV,de.PROPERTY,de.ITEM_PROP],e),noscriptTags:bn(K.NOSCRIPT,[de.INNER_HTML],e),onChangeClientState:rf(e),scriptTags:bn(K.SCRIPT,[de.SRC,de.INNER_HTML],e),styleTags:bn(K.STYLE,[de.CSS_TEXT],e),title:nf(e),titleAttributes:Yo(Ct.TITLE,e)}},Ko=function(){var n=Date.now();return function(e){var t=Date.now();t-n>16?(n=t,e(t)):setTimeout(function(){Ko(e)},0)}}(),kl=function(e){return clearTimeout(e)},lf=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Ko:global.requestAnimationFrame||Ko,af=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||kl:global.cancelAnimationFrame||kl,qo=function(e){return console&&typeof console.warn=="function"&&console.warn(e)},Cn=null,cf=function(e){Cn&&af(Cn),e.defer?Cn=lf(function(){Pl(e,function(){Cn=null})}):(Pl(e),Cn=null)},Pl=function(e,t){var r=e.baseTag,o=e.bodyAttributes,i=e.htmlAttributes,s=e.linkTags,l=e.metaTags,a=e.noscriptTags,c=e.onChangeClientState,u=e.scriptTags,d=e.styleTags,f=e.title,h=e.titleAttributes;Vo(K.BODY,o),Vo(K.HTML,i),uf(f,h);var p={baseTag:Ut(K.BASE,r),linkTags:Ut(K.LINK,s),metaTags:Ut(K.META,l),noscriptTags:Ut(K.NOSCRIPT,a),scriptTags:Ut(K.SCRIPT,u),styleTags:Ut(K.STYLE,d)},g={},m={};Object.keys(p).forEach(function(T){var v=p[T],y=v.newTags,b=v.oldTags;y.length&&(g[T]=y),b.length&&(m[T]=p[T].oldTags)}),t&&t(),c(e,g,m)},Nl=function(e){return Array.isArray(e)?e.join(""):e},uf=function(e,t){typeof e<"u"&&document.title!==e&&(document.title=Nl(e)),Vo(K.TITLE,t)},Vo=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var o=r.getAttribute(Ue),i=o?o.split(","):[],s=[].concat(i),l=Object.keys(t),a=0;a<l.length;a++){var c=l[a],u=t[c]||"";r.getAttribute(c)!==u&&r.setAttribute(c,u),i.indexOf(c)===-1&&i.push(c);var d=s.indexOf(c);d!==-1&&s.splice(d,1)}for(var f=s.length-1;f>=0;f--)r.removeAttribute(s[f]);i.length===s.length?r.removeAttribute(Ue):r.getAttribute(Ue)!==l.join(",")&&r.setAttribute(Ue,l.join(","))}},Ut=function(e,t){var r=document.head||document.querySelector(K.HEAD),o=r.querySelectorAll(e+"["+Ue+"]"),i=Array.prototype.slice.call(o),s=[],l=void 0;return t&&t.length&&t.forEach(function(a){var c=document.createElement(e);for(var u in a)if(a.hasOwnProperty(u))if(u===de.INNER_HTML)c.innerHTML=a.innerHTML;else if(u===de.CSS_TEXT)c.styleSheet?c.styleSheet.cssText=a.cssText:c.appendChild(document.createTextNode(a.cssText));else{var d=typeof a[u]>"u"?"":a[u];c.setAttribute(u,d)}c.setAttribute(Ue,"true"),i.some(function(f,h){return l=h,c.isEqualNode(f)})?i.splice(l,1):s.push(c)}),i.forEach(function(a){return a.parentNode.removeChild(a)}),s.forEach(function(a){return r.appendChild(a)}),{oldTags:i,newTags:s}},Ol=function(e){return Object.keys(e).reduce(function(t,r){var o=typeof e[r]<"u"?r+'="'+e[r]+'"':""+r;return t?t+" "+o:o},"")},ff=function(e,t,r,o){var i=Ol(r),s=Nl(t);return i?"<"+e+" "+Ue+'="true" '+i+">"+Ho(s,o)+"</"+e+">":"<"+e+" "+Ue+'="true">'+Ho(s,o)+"</"+e+">"},df=function(e,t,r){return t.reduce(function(o,i){var s=Object.keys(i).filter(function(c){return!(c===de.INNER_HTML||c===de.CSS_TEXT)}).reduce(function(c,u){var d=typeof i[u]>"u"?u:u+'="'+Ho(i[u],r)+'"';return c?c+" "+d:d},""),l=i.innerHTML||i.cssText||"",a=Gu.indexOf(e)===-1;return o+"<"+e+" "+Ue+'="true" '+s+(a?"/>":">"+l+"</"+e+">")},"")},Al=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(r,o){return r[Tr[o]||o]=e[o],r},t)},hf=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(r,o){return r[Ju[o]||o]=e[o],r},t)},pf=function(e,t,r){var o,i=(o={key:t},o[Ue]=!0,o),s=Al(r,i);return[A.createElement(K.TITLE,s,t)]},gf=function(e,t){return t.map(function(r,o){var i,s=(i={key:o},i[Ue]=!0,i);return Object.keys(r).forEach(function(l){var a=Tr[l]||l;if(a===de.INNER_HTML||a===de.CSS_TEXT){var c=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[a]=r[l]}),A.createElement(e,s)})},tt=function(e,t,r){switch(e){case K.TITLE:return{toComponent:function(){return pf(e,t.title,t.titleAttributes)},toString:function(){return ff(e,t.title,t.titleAttributes,r)}};case Ct.BODY:case Ct.HTML:return{toComponent:function(){return Al(t)},toString:function(){return Ol(t)}};default:return{toComponent:function(){return gf(e,t)},toString:function(){return df(e,t,r)}}}},Il=function(e){var t=e.baseTag,r=e.bodyAttributes,o=e.encode,i=e.htmlAttributes,s=e.linkTags,l=e.metaTags,a=e.noscriptTags,c=e.scriptTags,u=e.styleTags,d=e.title,f=d===void 0?"":d,h=e.titleAttributes;return{base:tt(K.BASE,t,o),bodyAttributes:tt(Ct.BODY,r,o),htmlAttributes:tt(Ct.HTML,i,o),link:tt(K.LINK,s,o),meta:tt(K.META,l,o),noscript:tt(K.NOSCRIPT,a,o),script:tt(K.SCRIPT,c,o),style:tt(K.STYLE,u,o),title:tt(K.TITLE,{title:f,titleAttributes:h},o)}},mf=function(e){var t,r;return r=t=function(o){ef(i,o);function i(){return Qu(this,i),tf(this,o.apply(this,arguments))}return i.prototype.shouldComponentUpdate=function(l){return!Ku(this.props,l)},i.prototype.mapNestedChildrenToProps=function(l,a){if(!a)return null;switch(l.type){case K.SCRIPT:case K.NOSCRIPT:return{innerHTML:a};case K.STYLE:return{cssText:a}}throw new Error("<"+l.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},i.prototype.flattenArrayTypeChildren=function(l){var a,c=l.child,u=l.arrayTypeChildren,d=l.newChildProps,f=l.nestedChildren;return Ie({},u,(a={},a[c.type]=[].concat(u[c.type]||[],[Ie({},d,this.mapNestedChildrenToProps(c,f))]),a))},i.prototype.mapObjectTypeChildren=function(l){var a,c,u=l.child,d=l.newProps,f=l.newChildProps,h=l.nestedChildren;switch(u.type){case K.TITLE:return Ie({},d,(a={},a[u.type]=h,a.titleAttributes=Ie({},f),a));case K.BODY:return Ie({},d,{bodyAttributes:Ie({},f)});case K.HTML:return Ie({},d,{htmlAttributes:Ie({},f)})}return Ie({},d,(c={},c[u.type]=Ie({},f),c))},i.prototype.mapArrayTypeChildrenToProps=function(l,a){var c=Ie({},a);return Object.keys(l).forEach(function(u){var d;c=Ie({},c,(d={},d[u]=l[u],d))}),c},i.prototype.warnOnInvalidChildren=function(l,a){if(process.env.NODE_ENV!=="production"){if(!Sl.some(function(c){return l.type===c}))return typeof l.type=="function"?qo("You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information."):qo("Only elements types "+Sl.join(", ")+" are allowed. Helmet does not support rendering <"+l.type+"> elements. Refer to our API for more information.");if(a&&typeof a!="string"&&(!Array.isArray(a)||a.some(function(c){return typeof c!="string"})))throw new Error("Helmet expects a string as a child of <"+l.type+">. Did you forget to wrap your children in braces? ( <"+l.type+">{``}</"+l.type+"> ) Refer to our API for more information.")}return!0},i.prototype.mapChildrenToProps=function(l,a){var c=this,u={};return A.Children.forEach(l,function(d){if(!(!d||!d.props)){var f=d.props,h=f.children,p=wl(f,["children"]),g=hf(p);switch(c.warnOnInvalidChildren(d,h),d.type){case K.LINK:case K.META:case K.NOSCRIPT:case K.SCRIPT:case K.STYLE:u=c.flattenArrayTypeChildren({child:d,arrayTypeChildren:u,newChildProps:g,nestedChildren:h});break;default:a=c.mapObjectTypeChildren({child:d,newProps:a,newChildProps:g,nestedChildren:h});break}}}),a=this.mapArrayTypeChildrenToProps(u,a),a},i.prototype.render=function(){var l=this.props,a=l.children,c=wl(l,["children"]),u=Ie({},c);return a&&(u=this.mapChildrenToProps(a,u)),A.createElement(e,u)},Zu(i,null,[{key:"canUseDOM",set:function(l){e.canUseDOM=l}}]),i}(A.Component),t.propTypes={base:fe.object,bodyAttributes:fe.object,children:fe.oneOfType([fe.arrayOf(fe.node),fe.node]),defaultTitle:fe.string,defer:fe.bool,encodeSpecialCharacters:fe.bool,htmlAttributes:fe.object,link:fe.arrayOf(fe.object),meta:fe.arrayOf(fe.object),noscript:fe.arrayOf(fe.object),onChangeClientState:fe.func,script:fe.arrayOf(fe.object),style:fe.arrayOf(fe.object),title:fe.string,titleAttributes:fe.object,titleTemplate:fe.string},t.defaultProps={defer:!0,encodeSpecialCharacters:!0},t.peek=e.peek,t.rewind=function(){var o=e.rewind();return o||(o=Il({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),o},r},_f=function(){return null},yf=Wu(sf,cf,Il)(_f),Jo=mf(yf);Jo.renderStatic=Jo.rewind;const vf=Fs({namespace:"MyEditor",theme:{}});function xf({ckey:n}){const e=A.useRef(null);return A.useEffect(()=>{const t=()=>{if(window.Codox){const r=new window.Codox,o={docId:"mydoc",app:"text",editor:e.current,apiKey:n,user:{name:`Tarun_${Math.floor(Math.random()*10)}`}};r.start(o)}else console.error("Codox library is not loaded")};setTimeout(()=>{t()},4e3)},[]),A.useEffect(()=>{const t=document.getElementById("editor");vf.setRootElement(t)},[]),S.jsxs("div",{className:"aa",children:[S.jsxs(Jo,{children:[S.jsx("script",{src:"https://cdn1.codox.io/lib/2.x/api/wave.client.js",type:"text/javascript"}),S.jsx("link",{href:"https://cdn1.codox.io/lib/2.x/css/wave.client.css",rel:"stylesheet"})]}),S.jsx("textarea",{id:"editor",rows:10,column:10,ref:e,children:S.jsx("div",{children:"sdsd"})})]})}const Tf={};function bf(n){console.error(n)}function Cf(){return S.jsx("div",{className:"divider-horizontal"})}function Ef({ckey:n,isCollab:e}){const{pageMarginValue:t}=mr(),r={namespace:"MyEditor",theme:Tf,onError:bf};function o(){return S.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}return S.jsxs(cc,{initialConfig:r,children:[S.jsx("div",{className:"editor-container",children:S.jsx(Su,{})}),S.jsxs("div",{className:"editor-container",children:[S.jsx(Cf,{}),S.jsxs("div",{className:"editor-inner",children:[S.jsx(au,{contentEditable:e==="yes"?S.jsx(xf,{ckey:n}):S.jsx(Pc,{style:{margin:`${t}`},className:"editor-input"}),placeholder:S.jsx(o,{}),ErrorBoundary:fu}),S.jsx(Fc,{}),S.jsx(uc,{})]})]})]})}it.Editor=Ef,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})});
43
58
  //# sourceMappingURL=index.umd.js.map