@yext/pages-components 1.1.5 → 1.1.6
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/{debugger-rlNxnZtt.js → debugger-7xORzT5W.js} +1 -1
- package/dist/{debugger-C8RcTf7G.cjs → debugger-fEUqg7Sy.cjs} +1 -1
- package/dist/{index-BsYy4LPR.cjs → index-BbVj7quu.cjs} +41 -41
- package/dist/{index-BsTia22i.js → index-C8IsJIMm.js} +528 -523
- package/dist/{index-BqwUybQE.js → index-Ck_jvPcD.js} +1 -1
- package/dist/{index-DmzJWbSH.cjs → index-dVLsHsji.cjs} +1 -1
- package/dist/pages-components.cjs +1 -1
- package/dist/pages-components.js +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var hf;function ny(){if(hf)return Yl;hf=1;var e=nt,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function f(p,_,T){var E,S={},w=null,M=null;T!==void 0&&(w=""+T),_.key!==void 0&&(w=""+_.key),_.ref!==void 0&&(M=_.ref);for(E in _)r.call(_,E)&&!d.hasOwnProperty(E)&&(S[E]=_[E]);if(p&&p.defaultProps)for(E in _=p.defaultProps,_)S[E]===void 0&&(S[E]=_[E]);return{$$typeof:t,type:p,key:w,ref:M,props:S,_owner:l.current}}return Yl.Fragment=n,Yl.jsx=f,Yl.jsxs=f,Yl}var
|
|
9
|
+
*/var hf;function ny(){if(hf)return Yl;hf=1;var e=nt,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function f(p,_,T){var E,S={},w=null,M=null;T!==void 0&&(w=""+T),_.key!==void 0&&(w=""+_.key),_.ref!==void 0&&(M=_.ref);for(E in _)r.call(_,E)&&!d.hasOwnProperty(E)&&(S[E]=_[E]);if(p&&p.defaultProps)for(E in _=p.defaultProps,_)S[E]===void 0&&(S[E]=_[E]);return{$$typeof:t,type:p,key:w,ref:M,props:S,_owner:l.current}}return Yl.Fragment=n,Yl.jsx=f,Yl.jsxs=f,Yl}var jl={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,98 +14,98 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var gf;function ry(){return gf||(gf=1,process.env.NODE_ENV!=="production"&&function(){var e=nt,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function k(pe){if(pe===null||typeof pe!="object")return null;var Ze=m&&pe[m]||pe[v];return typeof Ze=="function"?Ze:null}var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function I(pe){{for(var Ze=arguments.length,ot=new Array(Ze>1?Ze-1:0),St=1;St<Ze;St++)ot[St-1]=arguments[St];P("error",pe,ot)}}function P(pe,Ze,ot){{var St=G.ReactDebugCurrentFrame,Gt=St.getStackAddendum();Gt!==""&&(Ze+="%s",ot=ot.concat([Gt]));var Bt=ot.map(function(Pt){return String(Pt)});Bt.unshift("Warning: "+Ze),Function.prototype.apply.call(console[pe],console,Bt)}}var H=!1,
|
|
17
|
+
*/var gf;function ry(){return gf||(gf=1,process.env.NODE_ENV!=="production"&&function(){var e=nt,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function k(pe){if(pe===null||typeof pe!="object")return null;var Ze=m&&pe[m]||pe[v];return typeof Ze=="function"?Ze:null}var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function I(pe){{for(var Ze=arguments.length,ot=new Array(Ze>1?Ze-1:0),St=1;St<Ze;St++)ot[St-1]=arguments[St];P("error",pe,ot)}}function P(pe,Ze,ot){{var St=G.ReactDebugCurrentFrame,Gt=St.getStackAddendum();Gt!==""&&(Ze+="%s",ot=ot.concat([Gt]));var Bt=ot.map(function(Pt){return String(Pt)});Bt.unshift("Warning: "+Ze),Function.prototype.apply.call(console[pe],console,Bt)}}var H=!1,j=!1,re=!1,te=!1,ce=!1,V;V=Symbol.for("react.module.reference");function z(pe){return!!(typeof pe=="string"||typeof pe=="function"||pe===r||pe===d||ce||pe===l||pe===T||pe===E||te||pe===M||H||j||re||typeof pe=="object"&&pe!==null&&(pe.$$typeof===w||pe.$$typeof===S||pe.$$typeof===f||pe.$$typeof===p||pe.$$typeof===_||pe.$$typeof===V||pe.getModuleId!==void 0))}function q(pe,Ze,ot){var St=pe.displayName;if(St)return St;var Gt=Ze.displayName||Ze.name||"";return Gt!==""?ot+"("+Gt+")":ot}function Te(pe){return pe.displayName||"Context"}function Se(pe){if(pe==null)return null;if(typeof pe.tag=="number"&&I("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof pe=="function")return pe.displayName||pe.name||null;if(typeof pe=="string")return pe;switch(pe){case r:return"Fragment";case n:return"Portal";case d:return"Profiler";case l:return"StrictMode";case T:return"Suspense";case E:return"SuspenseList"}if(typeof pe=="object")switch(pe.$$typeof){case p:var Ze=pe;return Te(Ze)+".Consumer";case f:var ot=pe;return Te(ot._context)+".Provider";case _:return q(pe,pe.render,"ForwardRef");case S:var St=pe.displayName||null;return St!==null?St:Se(pe.type)||"Memo";case w:{var Gt=pe,Bt=Gt._payload,Pt=Gt._init;try{return Se(Pt(Bt))}catch{return null}}}return null}var Ee=Object.assign,de=0,K,O,Z,oe,Y,W,J;function R(){}R.__reactDisabledLog=!0;function U(){{if(de===0){K=console.log,O=console.info,Z=console.warn,oe=console.error,Y=console.group,W=console.groupCollapsed,J=console.groupEnd;var pe={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:pe,log:pe,warn:pe,error:pe,group:pe,groupCollapsed:pe,groupEnd:pe})}de++}}function X(){{if(de--,de===0){var pe={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ee({},pe,{value:K}),info:Ee({},pe,{value:O}),warn:Ee({},pe,{value:Z}),error:Ee({},pe,{value:oe}),group:Ee({},pe,{value:Y}),groupCollapsed:Ee({},pe,{value:W}),groupEnd:Ee({},pe,{value:J})})}de<0&&I("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=G.ReactCurrentDispatcher,_e;function B(pe,Ze,ot){{if(_e===void 0)try{throw Error()}catch(Gt){var St=Gt.stack.trim().match(/\n( *(at )?)/);_e=St&&St[1]||""}return`
|
|
18
18
|
`+_e+pe}}var A=!1,F;{var se=typeof WeakMap=="function"?WeakMap:Map;F=new se}function ye(pe,Ze){if(!pe||A)return"";{var ot=F.get(pe);if(ot!==void 0)return ot}var St;A=!0;var Gt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Bt;Bt=fe.current,fe.current=null,U();try{if(Ze){var Pt=function(){throw Error()};if(Object.defineProperty(Pt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Pt,[])}catch(fn){St=fn}Reflect.construct(pe,[],Pt)}else{try{Pt.call()}catch(fn){St=fn}pe.call(Pt.prototype)}}else{try{throw Error()}catch(fn){St=fn}pe()}}catch(fn){if(fn&&St&&typeof fn.stack=="string"){for(var kt=fn.stack.split(`
|
|
19
19
|
`),Ht=St.stack.split(`
|
|
20
20
|
`),sn=kt.length-1,an=Ht.length-1;sn>=1&&an>=0&&kt[sn]!==Ht[an];)an--;for(;sn>=1&&an>=0;sn--,an--)if(kt[sn]!==Ht[an]){if(sn!==1||an!==1)do if(sn--,an--,an<0||kt[sn]!==Ht[an]){var bn=`
|
|
21
|
-
`+kt[sn].replace(" at new "," at ");return pe.displayName&&bn.includes("<anonymous>")&&(bn=bn.replace("<anonymous>",pe.displayName)),typeof pe=="function"&&F.set(pe,bn),bn}while(sn>=1&&an>=0);break}}}finally{A=!1,fe.current=Bt,X(),Error.prepareStackTrace=Gt}var yr=pe?pe.displayName||pe.name:"",Zn=yr?B(yr):"";return typeof pe=="function"&&F.set(pe,Zn),Zn}function De(pe,Ze,ot){return ye(pe,!1)}function ee(pe){var Ze=pe.prototype;return!!(Ze&&Ze.isReactComponent)}function ne(pe,Ze,ot){if(pe==null)return"";if(typeof pe=="function")return ye(pe,ee(pe));if(typeof pe=="string")return B(pe);switch(pe){case T:return B("Suspense");case E:return B("SuspenseList")}if(typeof pe=="object")switch(pe.$$typeof){case _:return De(pe.render);case S:return ne(pe.type,Ze,ot);case w:{var St=pe,Gt=St._payload,Bt=St._init;try{return ne(Bt(Gt),Ze,ot)}catch{}}}return""}var ue=Object.prototype.hasOwnProperty,be={},Ne=G.ReactDebugCurrentFrame;function Re(pe){if(pe){var Ze=pe._owner,ot=ne(pe.type,pe._source,Ze?Ze.type:null);Ne.setExtraStackFrame(ot)}else Ne.setExtraStackFrame(null)}function ke(pe,Ze,ot,St,Gt){{var Bt=Function.call.bind(ue);for(var Pt in pe)if(Bt(pe,Pt)){var kt=void 0;try{if(typeof pe[Pt]!="function"){var Ht=Error((St||"React class")+": "+ot+" type `"+Pt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof pe[Pt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ht.name="Invariant Violation",Ht}kt=pe[Pt](Ze,Pt,St,ot,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(sn){kt=sn}kt&&!(kt instanceof Error)&&(Re(Gt),I("%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).",St||"React class",ot,Pt,typeof kt),Re(null)),kt instanceof Error&&!(kt.message in be)&&(be[kt.message]=!0,Re(Gt),I("Failed %s type: %s",ot,kt.message),Re(null))}}}var Fe=Array.isArray;function qe(pe){return Fe(pe)}function Be(pe){{var Ze=typeof Symbol=="function"&&Symbol.toStringTag,ot=Ze&&pe[Symbol.toStringTag]||pe.constructor.name||"Object";return ot}}function
|
|
21
|
+
`+kt[sn].replace(" at new "," at ");return pe.displayName&&bn.includes("<anonymous>")&&(bn=bn.replace("<anonymous>",pe.displayName)),typeof pe=="function"&&F.set(pe,bn),bn}while(sn>=1&&an>=0);break}}}finally{A=!1,fe.current=Bt,X(),Error.prepareStackTrace=Gt}var yr=pe?pe.displayName||pe.name:"",Zn=yr?B(yr):"";return typeof pe=="function"&&F.set(pe,Zn),Zn}function De(pe,Ze,ot){return ye(pe,!1)}function ee(pe){var Ze=pe.prototype;return!!(Ze&&Ze.isReactComponent)}function ne(pe,Ze,ot){if(pe==null)return"";if(typeof pe=="function")return ye(pe,ee(pe));if(typeof pe=="string")return B(pe);switch(pe){case T:return B("Suspense");case E:return B("SuspenseList")}if(typeof pe=="object")switch(pe.$$typeof){case _:return De(pe.render);case S:return ne(pe.type,Ze,ot);case w:{var St=pe,Gt=St._payload,Bt=St._init;try{return ne(Bt(Gt),Ze,ot)}catch{}}}return""}var ue=Object.prototype.hasOwnProperty,be={},Ne=G.ReactDebugCurrentFrame;function Re(pe){if(pe){var Ze=pe._owner,ot=ne(pe.type,pe._source,Ze?Ze.type:null);Ne.setExtraStackFrame(ot)}else Ne.setExtraStackFrame(null)}function ke(pe,Ze,ot,St,Gt){{var Bt=Function.call.bind(ue);for(var Pt in pe)if(Bt(pe,Pt)){var kt=void 0;try{if(typeof pe[Pt]!="function"){var Ht=Error((St||"React class")+": "+ot+" type `"+Pt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof pe[Pt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ht.name="Invariant Violation",Ht}kt=pe[Pt](Ze,Pt,St,ot,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(sn){kt=sn}kt&&!(kt instanceof Error)&&(Re(Gt),I("%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).",St||"React class",ot,Pt,typeof kt),Re(null)),kt instanceof Error&&!(kt.message in be)&&(be[kt.message]=!0,Re(Gt),I("Failed %s type: %s",ot,kt.message),Re(null))}}}var Fe=Array.isArray;function qe(pe){return Fe(pe)}function Be(pe){{var Ze=typeof Symbol=="function"&&Symbol.toStringTag,ot=Ze&&pe[Symbol.toStringTag]||pe.constructor.name||"Object";return ot}}function ut(pe){try{return At(pe),!1}catch{return!0}}function At(pe){return""+pe}function Ut(pe){if(ut(pe))return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Be(pe)),At(pe)}var en=G.ReactCurrentOwner,Oe={key:!0,ref:!0,__self:!0,__source:!0},ie,le;function ve(pe){if(ue.call(pe,"ref")){var Ze=Object.getOwnPropertyDescriptor(pe,"ref").get;if(Ze&&Ze.isReactWarning)return!1}return pe.ref!==void 0}function Le(pe){if(ue.call(pe,"key")){var Ze=Object.getOwnPropertyDescriptor(pe,"key").get;if(Ze&&Ze.isReactWarning)return!1}return pe.key!==void 0}function Me(pe,Ze){typeof pe.ref=="string"&&en.current}function je(pe,Ze){{var ot=function(){ie||(ie=!0,I("%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)",Ze))};ot.isReactWarning=!0,Object.defineProperty(pe,"key",{get:ot,configurable:!0})}}function rt(pe,Ze){{var ot=function(){le||(le=!0,I("%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)",Ze))};ot.isReactWarning=!0,Object.defineProperty(pe,"ref",{get:ot,configurable:!0})}}var it=function(pe,Ze,ot,St,Gt,Bt,Pt){var kt={$$typeof:t,type:pe,key:Ze,ref:ot,props:Pt,_owner:Bt};return kt._store={},Object.defineProperty(kt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(kt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:St}),Object.defineProperty(kt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Gt}),Object.freeze&&(Object.freeze(kt.props),Object.freeze(kt)),kt};function st(pe,Ze,ot,St,Gt){{var Bt,Pt={},kt=null,Ht=null;ot!==void 0&&(Ut(ot),kt=""+ot),Le(Ze)&&(Ut(Ze.key),kt=""+Ze.key),ve(Ze)&&(Ht=Ze.ref,Me(Ze,Gt));for(Bt in Ze)ue.call(Ze,Bt)&&!Oe.hasOwnProperty(Bt)&&(Pt[Bt]=Ze[Bt]);if(pe&&pe.defaultProps){var sn=pe.defaultProps;for(Bt in sn)Pt[Bt]===void 0&&(Pt[Bt]=sn[Bt])}if(kt||Ht){var an=typeof pe=="function"?pe.displayName||pe.name||"Unknown":pe;kt&&je(Pt,an),Ht&&rt(Pt,an)}return it(pe,kt,Ht,Gt,St,en.current,Pt)}}var vt=G.ReactCurrentOwner,Ge=G.ReactDebugCurrentFrame;function ze(pe){if(pe){var Ze=pe._owner,ot=ne(pe.type,pe._source,Ze?Ze.type:null);Ge.setExtraStackFrame(ot)}else Ge.setExtraStackFrame(null)}var tt;tt=!1;function yt(pe){return typeof pe=="object"&&pe!==null&&pe.$$typeof===t}function Nt(){{if(vt.current){var pe=Se(vt.current.type);if(pe)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+pe+"`."}return""}}function Et(pe){return""}var gt={};function xt(pe){{var Ze=Nt();if(!Ze){var ot=typeof pe=="string"?pe:pe.displayName||pe.name;ot&&(Ze=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+ot+">.")}return Ze}}function mt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var ot=xt(Ze);if(gt[ot])return;gt[ot]=!0;var St="";pe&&pe._owner&&pe._owner!==vt.current&&(St=" It was passed a child from "+Se(pe._owner.type)+"."),ze(pe),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ot,St),ze(null)}}function $t(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var ot=0;ot<pe.length;ot++){var St=pe[ot];yt(St)&&mt(St,Ze)}else if(yt(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Gt=k(pe);if(typeof Gt=="function"&&Gt!==pe.entries)for(var Bt=Gt.call(pe),Pt;!(Pt=Bt.next()).done;)yt(Pt.value)&&mt(Pt.value,Ze)}}}function Kt(pe){{var Ze=pe.type;if(Ze==null||typeof Ze=="string")return;var ot;if(typeof Ze=="function")ot=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===_||Ze.$$typeof===S))ot=Ze.propTypes;else return;if(ot){var St=Se(Ze);ke(ot,pe.props,"prop",St,pe)}else if(Ze.PropTypes!==void 0&&!tt){tt=!0;var Gt=Se(Ze);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Gt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function tn(pe){{for(var Ze=Object.keys(pe.props),ot=0;ot<Ze.length;ot++){var St=Ze[ot];if(St!=="children"&&St!=="key"){ze(pe),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",St),ze(null);break}}pe.ref!==null&&(ze(pe),I("Invalid attribute `ref` supplied to `React.Fragment`."),ze(null))}}var It={};function
|
|
25
|
+
Check the top-level render call using <`+ot+">.")}return Ze}}function mt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var ot=xt(Ze);if(gt[ot])return;gt[ot]=!0;var St="";pe&&pe._owner&&pe._owner!==vt.current&&(St=" It was passed a child from "+Se(pe._owner.type)+"."),ze(pe),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ot,St),ze(null)}}function $t(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var ot=0;ot<pe.length;ot++){var St=pe[ot];yt(St)&&mt(St,Ze)}else if(yt(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Gt=k(pe);if(typeof Gt=="function"&&Gt!==pe.entries)for(var Bt=Gt.call(pe),Pt;!(Pt=Bt.next()).done;)yt(Pt.value)&&mt(Pt.value,Ze)}}}function Kt(pe){{var Ze=pe.type;if(Ze==null||typeof Ze=="string")return;var ot;if(typeof Ze=="function")ot=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===_||Ze.$$typeof===S))ot=Ze.propTypes;else return;if(ot){var St=Se(Ze);ke(ot,pe.props,"prop",St,pe)}else if(Ze.PropTypes!==void 0&&!tt){tt=!0;var Gt=Se(Ze);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Gt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function tn(pe){{for(var Ze=Object.keys(pe.props),ot=0;ot<Ze.length;ot++){var St=Ze[ot];if(St!=="children"&&St!=="key"){ze(pe),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",St),ze(null);break}}pe.ref!==null&&(ze(pe),I("Invalid attribute `ref` supplied to `React.Fragment`."),ze(null))}}var It={};function jt(pe,Ze,ot,St,Gt,Bt){{var Pt=z(pe);if(!Pt){var kt="";(pe===void 0||typeof pe=="object"&&pe!==null&&Object.keys(pe).length===0)&&(kt+=" 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 Ht=Et();Ht?kt+=Ht:kt+=Nt();var sn;pe===null?sn="null":qe(pe)?sn="array":pe!==void 0&&pe.$$typeof===t?(sn="<"+(Se(pe.type)||"Unknown")+" />",kt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof pe,I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,kt)}var an=st(pe,Ze,ot,Gt,Bt);if(an==null)return an;if(Pt){var bn=Ze.children;if(bn!==void 0)if(St)if(qe(bn)){for(var yr=0;yr<bn.length;yr++)$t(bn[yr],pe);Object.freeze&&Object.freeze(bn)}else I("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 $t(bn,pe)}if(ue.call(Ze,"key")){var Zn=Se(pe),fn=Object.keys(Ze).filter(function(Mi){return Mi!=="key"}),sr=fn.length>0?"{key: someKey, "+fn.join(": ..., ")+": ...}":"{key: someKey}";if(!It[Zn+sr]){var or=fn.length>0?"{"+fn.join(": ..., ")+": ...}":"{}";I(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,sr,Zn,or,Zn),It[Zn+sr]=!0}}return pe===r?tn(an):Kt(an),an}}function bt(pe,Ze,ot){return Vt(pe,Ze,ot,!0)}function nn(pe,Ze,ot){return Vt(pe,Ze,ot,!1)}var Or=nn,_i=bt;Vl.Fragment=r,Vl.jsx=Or,Vl.jsxs=_i}()),Vl}process.env.NODE_ENV==="production"?Hu.exports=ny():Hu.exports=ry();var ft=Hu.exports;function iy(e){switch(e){case"AD":case"AM":case"AT":case"AX":case"AZ":case"BA":case"BY":case"CY":case"CZ":case"DK":case"DZ":case"EC":case"EH":case"ET":case"FI":case"FR":case"GE":case"GF":case"GI":case"GP":case"GW":case"HT":case"KE":case"KV":case"KW":case"LA":case"LU":case"MC":case"MD":case"ME":case"MG":case"MK":case"MQ":case"MZ":case"NC":case"NL":case"NO":case"PL":case"PT":case"PY":case"RE":case"RS":case"SA":case"SE":case"SJ":case"SM":case"SN":case"TC":case"TJ":case"TM":case"TN":case"TZ":case"UY":case"VG":case"ZM":return[["line1"],["line2"],["postalCode","city"],["countryCode"]];case"AF":case"IR":return[["line1"],["line2"],["city"],["region"],["postalCode"],["countryCode"]];case"AG":case"AO":case"AW":case"BJ":case"BO":case"BS":case"BZ":case"CI":case"CW":case"DJ":case"FJ":case"GA":case"GH":case"GM":case"GY":case"JM":case"KI":case"LY":case"MW":case"NA":case"NR":case"PS":case"QA":case"RW":case"SC":case"SR":case"SX":case"TG":case"TT":case"UG":case"VU":return[["line1"],["line2"],["city"],["countryCode"]];case"AL":case"EE":case"IS":return[["line1"],["line2"],["postalCode","city"]];case"AR":return[["line1"],["line2"],["postalCode","city",",","region"],["countryCode"]];case"AS":case"BB":case"BD":case"BM":case"BN":case"BT":case"CR":case"DO":case"FK":case"FM":case"GR":case"GU":case"JO":case"KZ":case"LB":case"LK":case"LS":case"MA":case"MH":case"MM":case"MR":case"MT":case"MV":case"NG":case"PG":case"PK":case"PR":case"RO":case"SG":case"VC":case"WS":return[["line1"],["line2"],["city","postalCode"],["countryCode"]];case"AU":case"CA":case"SZ":case"US":case"VI":return[["line1"],["line2"],["city",",","region","postalCode"],["countryCode"]];case"BE":case"PE":return[["line1"],["line2"],["postalCode","sublocality","city"],["countryCode"]];case"BF":case"BI":case"BQ":case"BW":case"CF":case"CG":case"CM":case"DM":case"ER":case"GQ":case"KM":case"ML":case"SY":case"TD":case"ZW":return[["line1"],["line2"],["city"],["region"],["countryCode"]];case"BG":return[["line1"],["postalCode","region"],["countryCode"]];case"BH":return[["line1"],["line2"],["sublocality","city"],["countryCode"]];case"BR":return[["line1"],["line2"],["sublocality"],["city","region"],["postalCode"],["countryCode"]];case"CH":case"DE":case"GT":case"IT":case"LI":case"MY":case"NI":case"OM":case"SK":case"VA":return[["line1"],["line2"],["postalCode","city","region"],["countryCode"]];case"CL":case"PF":return[["line1"],["line2"],["city","postalCode","region"],["countryCode"]];case"CN":return[["region","city","sublocality"],["line1"],["line2"],["countryCode"]];case"CO":case"ID":case"IQ":case"KH":case"MP":case"NP":case"PW":case"UA":return[["line1"],["line2"],["city","region","postalCode"],["countryCode"]];case"EG":return[["line1"],["line2"],["sublocality","city","region","postalCode"],["countryCode"]];case"ES":case"IL":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"GB":case"MN":case"ZA":return[["line1"],["line2"],["sublocality","city","postalCode"],["countryCode"]];case"GG":case"IM":case"JE":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"GN":return[["line1","line2","city"],["countryCode"]];case"HK":return[["line1"],["line2"],["sublocality"],["city"],["region"],["countryCode"]];case"HR":return[["line1"],["postalCode","city","region"],["countryCode"]];case"HU":case"SI":return[["postalCode","city"],["line1"],["line2"],["countryCode"]];case"IE":return[["line1"],["line2"],["sublocality"],["city","region","postalCode"],["countryCode"]];case"IN":case"VE":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"JP":return[["line2"],["line1","sublocality"],["city","region"],["postalCode"],["countryCode"]];case"KR":return[["countryCode"],["region","city","sublocality","line1"],["line2"],["postalCode"]];case"KY":return[["line1"],["line2"],["postalCode"],["countryCode"]];case"LT":return[["line1"],["postalCode","city","sublocality","region"],["countryCode"]];case"LV":return[["line1"],["city",",","postalCode"],["countryCode"]];case"MO":return[["line1"],["line2"],["sublocality"],["city"],["countryCode"]];case"MU":return[["line1"],["line2"],["city"],["region","postalCode"],["countryCode"]];case"MX":return[["line1"],["line2"],["sublocality"],["postalCode","city",",","region"],["countryCode"]];case"NE":case"SD":return[["line1"],["line2"],["postalCode"],["city"],["region"],["countryCode"]];case"NZ":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"PH":case"TW":case"VN":return[["line1"],["line2"],["sublocality","city"],["region","postalCode"],["countryCode"]];case"RU":return[["line1"],["line2"],["city"],["postalCode"],["countryCode"]];case"SB":case"SL":case"ST":case"TL":case"TO":case"TV":return[["line1"],["line2"],["city",",","region"],["countryCode"]];case"TH":case"TR":return[["line1"],["line2"],["sublocality"],["postalCode","city"],["countryCode"]];case"UZ":return[["line1"],["line2"],["region","postalCode"],["countryCode"]]}return[["line1","line2"],["city","region","postalCode"],["countryCode"]]}const sp={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Wu={GOOGLE:"google",APPLE:"apple",BING:"bing"},sy=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},oy=(e,t=[],n,r={route:!1},l)=>{const d="Failed to construct query for maps service.";let f=e&&yf([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case Wu.APPLE:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return pf(`${l.latitude},${l.longitude}`,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return pf(f,r.route)}case Wu.BING:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return mf(`${l.latitude},${l.longitude}`,r.route);if(f=e&&yf([e.line1,e.city,e.region,e.postalCode]),!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return mf(f,r.route)}default:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return _f(`${l.latitude},${l.longitude}`,r.route);const p=t.find(_=>{var T;return((T=_==null?void 0:_.publisher)==null?void 0:T.toUpperCase())===sp.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return ly(n,f,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return _f(f,r.route)}}},pf=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,mf=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,ly=(e,t,n)=>{const r=t?`&query=${t}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${e}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${e}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${e}&destination=direct`},_f=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,yf=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},ay=({address:e,lines:t,separator:n=",",...r})=>{const l=(t||iy(e.countryCode)).map(d=>ft.jsx(cy,{address:e,line:d,separator:n},d.toString()));return nt.createElement("div",{...r,key:e.toString()},l)},cy=({address:e,line:t,separator:n})=>{const r=[];let l=0;for(const d of t){if(d===","){r.push(ft.jsx("span",{children:n},`separator-${l++}`));continue}const f=e[d];if(!f)continue;const p=sy(d,e);if(p){r.push(ft.jsxs(ty.Fragment,{children:[" ",ft.jsx("abbr",{title:p,children:f})]},d));continue}r.push(ft.jsx("span",{children:" "+f},d))}return ft.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dy=typeof window<"u"&&typeof window.document<"u",fy=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,hy=(typeof self>"u"?"undefined":uy(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",gy=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),py=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Nf=tl.isBrowser=dy;tl.isWebWorker=hy;var my=tl.isNode=fy;tl.isJsDom=gy;var _y=tl.isDeno=py;class yy{constructor(){Ie(this,"name");Ie(this,"isServerSide");Ie(this,"version");var t;_y?(this.name="deno",this.version="",Nf&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):my?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):Nf?(this.name="browser",this.version=navigator.userAgent,this.isServerSide=!1):(this.name="unknown",this.version="",this.isServerSide=!1)}getNodeMajorVersion(){if(this.name!=="node")throw new Error("Not running in Node.");return+this.version.split(".")[0]}}const Xo=()=>new yy,Ny=(...e)=>{var t;if(typeof window<"u"){if(window.IS_PRODUCTION)return!0;const n=(t=window.location)==null?void 0:t.hostname;return e==null?void 0:e.some(r=>r==null?void 0:r.includes(n))}return!1};function Yc(e){if(!cd(e))throw new Error("Parameter was not an error")}function cd(e){return!!e&&typeof e=="object"&&Cy(e)==="[object Error]"||e instanceof Error}function Cy(e){return Object.prototype.toString.call(e)}const Ey="Layerr";let Ty=Ey;function xy(){return Ty}function vy(e){let t,n="";if(e.length===0)t={};else if(cd(e[0]))t={cause:e[0]},n=e.slice(1).join(" ")||"";else if(e[0]&&typeof e[0]=="object")t=Object.assign({},e[0]),n=e.slice(1).join(" ")||"";else if(typeof e[0]=="string")t={},n=n=e.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:t,shortMessage:n}}class Ai extends Error{constructor(t,n){const r=[...arguments],{options:l,shortMessage:d}=vy(r);let f=d;if(l.cause&&(f=`${f}: ${l.cause.message}`),super(f),this.message=f,l.name&&typeof l.name=="string"?this.name=l.name:this.name=xy(),l.cause&&Object.defineProperty(this,"_cause",{value:l.cause}),Object.defineProperty(this,"_info",{value:{}}),l.info&&typeof l.info=="object"&&Object.assign(this._info,l.info),Error.captureStackTrace){const p=l.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(t){return Yc(t),t._cause&&cd(t._cause)?t._cause:null}static fullStack(t){Yc(t);const n=Ai.cause(t);return n?`${t.stack}
|
|
30
|
+
<%s key={someKey} {...props} />`,sr,Zn,or,Zn),It[Zn+sr]=!0}}return pe===r?tn(an):Kt(an),an}}function bt(pe,Ze,ot){return jt(pe,Ze,ot,!0)}function nn(pe,Ze,ot){return jt(pe,Ze,ot,!1)}var Or=nn,_i=bt;jl.Fragment=r,jl.jsx=Or,jl.jsxs=_i}()),jl}process.env.NODE_ENV==="production"?Hu.exports=ny():Hu.exports=ry();var at=Hu.exports;function iy(e){switch(e){case"AD":case"AM":case"AT":case"AX":case"AZ":case"BA":case"BY":case"CY":case"CZ":case"DK":case"DZ":case"EC":case"EH":case"ET":case"FI":case"FR":case"GE":case"GF":case"GI":case"GP":case"GW":case"HT":case"KE":case"KV":case"KW":case"LA":case"LU":case"MC":case"MD":case"ME":case"MG":case"MK":case"MQ":case"MZ":case"NC":case"NL":case"NO":case"PL":case"PT":case"PY":case"RE":case"RS":case"SA":case"SE":case"SJ":case"SM":case"SN":case"TC":case"TJ":case"TM":case"TN":case"TZ":case"UY":case"VG":case"ZM":return[["line1"],["line2"],["postalCode","city"],["countryCode"]];case"AF":case"IR":return[["line1"],["line2"],["city"],["region"],["postalCode"],["countryCode"]];case"AG":case"AO":case"AW":case"BJ":case"BO":case"BS":case"BZ":case"CI":case"CW":case"DJ":case"FJ":case"GA":case"GH":case"GM":case"GY":case"JM":case"KI":case"LY":case"MW":case"NA":case"NR":case"PS":case"QA":case"RW":case"SC":case"SR":case"SX":case"TG":case"TT":case"UG":case"VU":return[["line1"],["line2"],["city"],["countryCode"]];case"AL":case"EE":case"IS":return[["line1"],["line2"],["postalCode","city"]];case"AR":return[["line1"],["line2"],["postalCode","city",",","region"],["countryCode"]];case"AS":case"BB":case"BD":case"BM":case"BN":case"BT":case"CR":case"DO":case"FK":case"FM":case"GR":case"GU":case"JO":case"KZ":case"LB":case"LK":case"LS":case"MA":case"MH":case"MM":case"MR":case"MT":case"MV":case"NG":case"PG":case"PK":case"PR":case"RO":case"SG":case"VC":case"WS":return[["line1"],["line2"],["city","postalCode"],["countryCode"]];case"AU":case"CA":case"SZ":case"US":case"VI":return[["line1"],["line2"],["city",",","region","postalCode"],["countryCode"]];case"BE":case"PE":return[["line1"],["line2"],["postalCode","sublocality","city"],["countryCode"]];case"BF":case"BI":case"BQ":case"BW":case"CF":case"CG":case"CM":case"DM":case"ER":case"GQ":case"KM":case"ML":case"SY":case"TD":case"ZW":return[["line1"],["line2"],["city"],["region"],["countryCode"]];case"BG":return[["line1"],["postalCode","region"],["countryCode"]];case"BH":return[["line1"],["line2"],["sublocality","city"],["countryCode"]];case"BR":return[["line1"],["line2"],["sublocality"],["city","region"],["postalCode"],["countryCode"]];case"CH":case"DE":case"GT":case"IT":case"LI":case"MY":case"NI":case"OM":case"SK":case"VA":return[["line1"],["line2"],["postalCode","city","region"],["countryCode"]];case"CL":case"PF":return[["line1"],["line2"],["city","postalCode","region"],["countryCode"]];case"CN":return[["region","city","sublocality"],["line1"],["line2"],["countryCode"]];case"CO":case"ID":case"IQ":case"KH":case"MP":case"NP":case"PW":case"UA":return[["line1"],["line2"],["city","region","postalCode"],["countryCode"]];case"EG":return[["line1"],["line2"],["sublocality","city","region","postalCode"],["countryCode"]];case"ES":case"IL":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"GB":case"MN":case"ZA":return[["line1"],["line2"],["sublocality","city","postalCode"],["countryCode"]];case"GG":case"IM":case"JE":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"GN":return[["line1","line2","city"],["countryCode"]];case"HK":return[["line1"],["line2"],["sublocality"],["city"],["region"],["countryCode"]];case"HR":return[["line1"],["postalCode","city","region"],["countryCode"]];case"HU":case"SI":return[["postalCode","city"],["line1"],["line2"],["countryCode"]];case"IE":return[["line1"],["line2"],["sublocality"],["city","region","postalCode"],["countryCode"]];case"IN":case"VE":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"JP":return[["line2"],["line1","sublocality"],["city","region"],["postalCode"],["countryCode"]];case"KR":return[["countryCode"],["region","city","sublocality","line1"],["line2"],["postalCode"]];case"KY":return[["line1"],["line2"],["postalCode"],["countryCode"]];case"LT":return[["line1"],["postalCode","city","sublocality","region"],["countryCode"]];case"LV":return[["line1"],["city",",","postalCode"],["countryCode"]];case"MO":return[["line1"],["line2"],["sublocality"],["city"],["countryCode"]];case"MU":return[["line1"],["line2"],["city"],["region","postalCode"],["countryCode"]];case"MX":return[["line1"],["line2"],["sublocality"],["postalCode","city",",","region"],["countryCode"]];case"NE":case"SD":return[["line1"],["line2"],["postalCode"],["city"],["region"],["countryCode"]];case"NZ":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"PH":case"TW":case"VN":return[["line1"],["line2"],["sublocality","city"],["region","postalCode"],["countryCode"]];case"RU":return[["line1"],["line2"],["city"],["postalCode"],["countryCode"]];case"SB":case"SL":case"ST":case"TL":case"TO":case"TV":return[["line1"],["line2"],["city",",","region"],["countryCode"]];case"TH":case"TR":return[["line1"],["line2"],["sublocality"],["postalCode","city"],["countryCode"]];case"UZ":return[["line1"],["line2"],["region","postalCode"],["countryCode"]]}return[["line1","line2"],["city","region","postalCode"],["countryCode"]]}const sp={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Wu={GOOGLE:"google",APPLE:"apple",BING:"bing"},sy=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},oy=(e,t=[],n,r={route:!1},l)=>{const d="Failed to construct query for maps service.";let f=e&&yf([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case Wu.APPLE:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return pf(`${l.latitude},${l.longitude}`,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return pf(f,r.route)}case Wu.BING:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return mf(`${l.latitude},${l.longitude}`,r.route);if(f=e&&yf([e.line1,e.city,e.region,e.postalCode]),!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return mf(f,r.route)}default:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return _f(`${l.latitude},${l.longitude}`,r.route);const p=t.find(_=>{var T;return((T=_==null?void 0:_.publisher)==null?void 0:T.toUpperCase())===sp.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return ly(n,f,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return _f(f,r.route)}}},pf=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,mf=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,ly=(e,t,n)=>{const r=t?`&query=${t}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${e}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${e}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${e}&destination=direct`},_f=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,yf=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},ay=({address:e,lines:t,separator:n=",",...r})=>{const l=(t||iy(e.countryCode)).map(d=>at.jsx(cy,{address:e,line:d,separator:n},d.toString()));return nt.createElement("div",{...r,key:e.toString()},l)},cy=({address:e,line:t,separator:n})=>{const r=[];let l=0;for(const d of t){if(d===","){r.push(at.jsx("span",{children:n},`separator-${l++}`));continue}const f=e[d];if(!f)continue;const p=sy(d,e);if(p){r.push(at.jsxs(ty.Fragment,{children:[" ",at.jsx("abbr",{title:p,children:f})]},d));continue}r.push(at.jsx("span",{children:" "+f},d))}return at.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dy=typeof window<"u"&&typeof window.document<"u",fy=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,hy=(typeof self>"u"?"undefined":uy(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",gy=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),py=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Nf=tl.isBrowser=dy;tl.isWebWorker=hy;var my=tl.isNode=fy;tl.isJsDom=gy;var _y=tl.isDeno=py;class yy{constructor(){Ie(this,"name");Ie(this,"isServerSide");Ie(this,"version");var t;_y?(this.name="deno",this.version="",Nf&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):my?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):Nf?(this.name="browser",this.version=navigator.userAgent,this.isServerSide=!1):(this.name="unknown",this.version="",this.isServerSide=!1)}getNodeMajorVersion(){if(this.name!=="node")throw new Error("Not running in Node.");return+this.version.split(".")[0]}}const Xo=()=>new yy,Ny=(...e)=>{var t;if(typeof window<"u"){if(window.IS_PRODUCTION)return!0;const n=(t=window.location)==null?void 0:t.hostname;return e==null?void 0:e.some(r=>r==null?void 0:r.includes(n))}return!1};function Yc(e){if(!cd(e))throw new Error("Parameter was not an error")}function cd(e){return!!e&&typeof e=="object"&&Cy(e)==="[object Error]"||e instanceof Error}function Cy(e){return Object.prototype.toString.call(e)}const Ey="Layerr";let Ty=Ey;function xy(){return Ty}function vy(e){let t,n="";if(e.length===0)t={};else if(cd(e[0]))t={cause:e[0]},n=e.slice(1).join(" ")||"";else if(e[0]&&typeof e[0]=="object")t=Object.assign({},e[0]),n=e.slice(1).join(" ")||"";else if(typeof e[0]=="string")t={},n=n=e.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:t,shortMessage:n}}class Ai extends Error{constructor(t,n){const r=[...arguments],{options:l,shortMessage:d}=vy(r);let f=d;if(l.cause&&(f=`${f}: ${l.cause.message}`),super(f),this.message=f,l.name&&typeof l.name=="string"?this.name=l.name:this.name=xy(),l.cause&&Object.defineProperty(this,"_cause",{value:l.cause}),Object.defineProperty(this,"_info",{value:{}}),l.info&&typeof l.info=="object"&&Object.assign(this._info,l.info),Error.captureStackTrace){const p=l.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(t){return Yc(t),t._cause&&cd(t._cause)?t._cause:null}static fullStack(t){Yc(t);const n=Ai.cause(t);return n?`${t.stack}
|
|
31
31
|
caused by: ${Ai.fullStack(n)}`:t.stack??""}static info(t){Yc(t);const n={},r=Ai.cause(t);return r&&Object.assign(n,Ai.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}const op="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ra=32,Cf=0xffffffffffff,Sy=10,wy=16,ea=Object.freeze({source:"ulid"});function Oy(e){const t=Dy(),n=t&&(t.crypto||t.msCrypto)||null;if(typeof(n==null?void 0:n.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return n.getRandomValues(r),r[0]/255};if(typeof(n==null?void 0:n.randomBytes)=="function")return()=>n.randomBytes(1).readUInt8()/255;throw new Ai({info:{code:"PRNG_DETECT",...ea}},"Failed to find a reliable PRNG")}function Dy(){return Ry()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Ay(e,t){let n="";for(;e>0;e--)n=by(t)+n;return n}function My(e,t){if(isNaN(e))throw new Ai({info:{code:"ENC_TIME_NAN",...ea}},`Time must be a number: ${e}`);if(e>Cf)throw new Ai({info:{code:"ENC_TIME_SIZE_EXCEED",...ea}},`Cannot encode a time larger than ${Cf}: ${e}`);if(e<0)throw new Ai({info:{code:"ENC_TIME_NEG",...ea}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Ai({info:{code:"ENC_TIME_TYPE",...ea}},`Time must be an integer: ${e}`);let n,r="";for(let l=t;l>0;l--)n=e%ra,r=op.charAt(n)+r,e=(e-n)/ra;return r}function Ry(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function by(e){let t=Math.floor(e()*ra);return t===ra&&(t=ra-1),op.charAt(t)}function Ly(e,t){const n=Oy(),r=isNaN(e)?Date.now():e;return My(r,Sy)+Ay(wy,n)}var Ef="yext_analytics_session_id";function Iy(){if(typeof window>"u")return null;try{var e=window.sessionStorage.getItem(Ef);return e||(e=Ly(),window.sessionStorage.setItem(Ef,e)),e}catch(t){return console.warn(`Unable to use browser sessionStorage for sessionId.
|
|
32
|
-
`,t),null}}const ky="1.0.0",Tf={version:ky};function Py(e,t,n){return n.debug?(lp(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function $y(e,t,n){return n.debug?(lp(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Fy(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function lp(e,t,n){var r=e?"Beacon":"fetch()";console.log("[DEBUG] AnalyticsConfig object at time of call to report():",n),console.log("[DEBUG] The following EventPayload would be sent to the Yext Events API using ".concat(r,":"),t)}var Ku=function(){return Ku=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},Ku.apply(this,arguments)},zu=function(e,t){if(!t||Object.keys(t).length===0)return e;if(!e||Object.keys(e).length===0)return t;var n=JSON.parse(JSON.stringify(e));for(var r in t)if(t.hasOwnProperty(r)){var l=t[r];l==null?delete n[r]:typeof l!="object"?n[r]=l:n[r]=zu(n[r],l)}return Ku({},n)},By="yextevents.com/accounts/me/events";function Hy(e,t){var n=e==="SANDBOX",r=t==null?void 0:t.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+By}var Wy=function(e,t,n,r){function l(d){return d instanceof n?d:new n(function(f){f(d)})}return new(n||(n=Promise))(function(d,f){function p(E){try{T(r.next(E))}catch(S){f(S)}}function _(E){try{T(r.throw(E))}catch(S){f(S)}}function T(E){E.done?d(E.value):l(E.value).then(p,_)}T((r=r.apply(e,t||[])).next())})},Ky=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,l,d,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(T){return function(E){return _([T,E])}}function _(T){if(r)throw new TypeError("Generator is already executing.");for(;f&&(f=0,T[0]&&(n=0)),n;)try{if(r=1,l&&(d=T[0]&2?l.return:T[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,T[1])).done)return d;switch(l=0,d&&(T=[T[0]&2,d.value]),T[0]){case 0:case 1:d=T;break;case 4:return n.label++,{value:T[1],done:!1};case 5:n.label++,l=T[1],T=[0];continue;case 7:T=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){n=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){n.label=T[1];break}if(T[0]===6&&n.label<d[1]){n.label=d[1],d=T;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(T);break}d[2]&&n.ops.pop(),n.trys.pop();continue}T=t.call(e,n)}catch(E){T=[6,E],l=0}finally{r=d=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},zy=function(){function e(t,n){if(t.authorizationType!=="apiKey"&&t.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!t.authorization)throw new Error("Authorization must be provided.");this.config=t,this.payload=n}return e.prototype.with=function(t){var n=this.payload===void 0?t:zu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return Wy(this,void 0,void 0,function(){var r,l,d,f,p=this;return Ky(this,function(_){return r=zu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Iy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Tf.version:r.clientSdk=(f={},f.ANALYTICS=Tf.version,f),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,l=Fy(r,this.config.forceFetch),d=Hy(this.config.env,this.config.region),l?[2,new Promise(function(T,E){Py(d,r,p.config)?T(""):E("Failed Beacon Call")})]:[2,$y(d,r,this.config).then(function(T){return T}).catch(function(T){return T})]})})},e}();function Uy(e){return new zy(e)}function Uu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function ap(e,t){return[e,t].filter(n=>!!n).map(n=>Uu(n)).join("_")}const Gy=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},ud=nt.createContext(null),Yy=nt.lazy(()=>Promise.resolve().then(()=>require("./debugger-C8RcTf7G.cjs")));function Vy(e){const{children:t,apiKey:n,currency:r,templateData:l,requireOptIn:d,disableSessionTracking:f,enableDebugging:p,productionDomains:_}=e;if(!n)throw new Error("API Key is required for AnalyticsProvider");const T=nt.useRef(null),[E,S]=nt.useState(!1);nt.useEffect(()=>{S(!0)},[]),T.current===null&&(T.current=new cp(n,r,l,d,f,_,p??cc()));const w=T.current;return nt.useEffect(()=>(window.enableYextAnalytics=()=>{w.optIn()},()=>{delete window.enableYextAnalytics}),[w]),ft.jsxs(ft.Fragment,{children:[ft.jsx(ud.Provider,{value:w,children:t}),E&&(p||cc())&&Xo().name==="browser"?ft.jsx(nt.Suspense,{fallback:ft.jsx(ft.Fragment,{}),children:ft.jsx(Yy,{})}):null]})}function cc(){return Xo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class cp{constructor(t,n,r,l,d,f,p=!1){Ie(this,"_optedIn");Ie(this,"_sessionTrackingEnabled");Ie(this,"_analyticsEventService");Ie(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.productionDomains=f,this.enableDebugging=p,this._optedIn=!l,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Xo().name!=="browser"||!this._optedIn)return;if(!Ny(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=Gy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:t||"US",sessionTrackingEnabled:this._sessionTrackingEnabled,debug:this.getDebugEnabled()},r={pages:{siteUid:this.templateData.document.siteId,template:this.templateData.document.__.name},entity:this.templateData.document.uid||void 0,pageUrl:document.URL,referrerUrl:document.referrer!==""?document.referrer:void 0};this._analyticsEventService=Uy(n).with(r)}canTrack(){return Xo().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(t){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:t}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var t;if(!this.canTrack())return Promise.resolve(void 0);await((t=this._analyticsEventService)==null?void 0:t.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(t){var S;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:l,currency:d,amount:f,destinationUrl:p,customTags:_,customValues:T}=t;let E;f&&(E={amount:f,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:Uu(r)||void 0,originalEventName:ap(r||"",Uu(l)||"")},value:E,destinationUrl:p,customTags:_,customValues:T}))}getDebugEnabled(){return this.enableDebugging||cc()}}const Gu=nt.createContext({name:""}),dd=()=>nt.useContext(Gu).name;function jy(e){var f;const t=dd(),[n]=nt.useState({name:ap(t,e.name)}),r=(f=nl())==null?void 0:f.getDebugEnabled(),[l,d]=nt.useState(!1);return nt.useEffect(()=>{d(!0)},[]),r&&l?ft.jsx("section",{"data-ya-scope":n.name,children:ft.jsx(Gu.Provider,{value:n,children:e.children})}):ft.jsx(Gu.Provider,{value:n,children:e.children})}function nl(){const e=nt.useContext(ud);if(!e)return e;Xo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=dd();return{getDebugEnabled(){return e.getDebugEnabled()},identify(n){return e.identify(n)},optIn(){return e.optIn()},pageView(){return e.pageView()},track(n){return e.track({...n,scope:n.scope??t})}}}const qy=()=>{var e;return(e=nl())==null?void 0:e.track},Zy=()=>{var e;return(e=nl())==null?void 0:e.pageView},Jy=()=>{var e;return(e=nl())==null?void 0:e.identify},Ts={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},Xy=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}const n=e.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${e}`);return}r="eu"}if(!e.pathname.startsWith("/f")){console.error(`Invalid path: ${e}`);return}const l=e.pathname.replace(/^\//,"").split("/");if(l.length<2||l.length>3){console.error(`Invalid path: ${e}`);return}let d;if(l[0]==="f")d="prod";else switch(l[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${e}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${e}`);return}let f;if(l.length===3&&(f=parseInt(l[1]),Number.isNaN(f))){console.error(`Invalid account id: ${e}`);return}const p=l[l.length-1].split("."),_=p.length===2?`.${p[1]}`:"",T=p[0];return{scheme:t,partition:r,env:d,accountId:f,contentHash:T,extension:_}},Qy=(e,t,n)=>{const r=`https://dyn${e.partition==="us"?"":`.${e.partition}`}.mktgcdn.com`;let l="f";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}const d=e.accountId!==void 0?`${e.accountId}/`:"";return`${r}/${l}/${d}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}`},eN=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}if(e.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${e}`);return}if(!e.pathname.startsWith("/p")){console.error(`Invalid path: ${e}`);return}const n=e.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${e}`);return}let r;if(n[0]==="p")r="prod";else switch(n[0].replace("p-","")){case"sandbox":{r="sbx";break}case"qa":{r="qa";break}case"dev":{r="dev";break}default:{console.error(`Invalid path: ${e}`);return}}const l=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${e}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${e}`);return}}const f=n[n.length-1].split("."),p=f.length===2?`.${f[1]}`:"",_=f[0];return{scheme:t,env:r,contentHash:l,aspectRatio:d,name:_,extension:p}},tN=(e,t,n)=>{const r="https://dyn.mktgcdn.com";let l="p";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}return`${r}/${l}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}`},Yu=(e,t,n)=>{if(!up(e)){console.error(`Invalid image url: ${e}.`);return}const r=new URL(e);if(r.pathname.startsWith("/p")){const l=eN(r);if(l)return tN(l,t,n)}else if(r.pathname.startsWith("/f")){const l=Xy(r);if(l)return Qy(l,t,n)}return e},up=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},nN=({image:e,className:t,width:n,height:r,aspectRatio:l,layout:d=Ts.INTRINSIC,placeholder:f,imgOverrides:p,style:_={},loading:T="lazy"})=>{const E=nt.useRef(null),[S,w]=nt.useState(!1),M="image"in e?e.image:e;nt.useEffect(()=>{var ce;(ce=E.current)!=null&&ce.complete&&w(!0)},[]),rN(d,M.width,M.height,n,r,l);const m=Math.abs(M.width);m||console.warn("Invalid image width.");const v=Math.abs(M.height);if(v||console.warn("Invalid image height."),!up(M.url))return console.error(`Invalid image url: ${M.url}`),ft.jsx(ft.Fragment,{children:f!=null&&f});const k=n&&n>0?n:void 0,G=r&&r>0?r:void 0,{src:I,imgStyle:P,widths:H}=iN(d,m,v,_,M.url,k,G,l),V=H.map(ce=>`${Yu(M.url,ce,v/m*ce)} ${ce}w`).join(", "),re=[640,768,1024,1280,1536],te=H.map((ce,j)=>j===H.length-1?`${ce}px`:`(max-width: ${re[j]}px) ${ce}px`).join(", ");return ft.jsxs(ft.Fragment,{children:[!S&&f!=null&&f,ft.jsx("img",{ref:E,style:P,src:I,className:t,width:k,height:G,srcSet:V,sizes:te,loading:T,alt:M.alternateText||"",...p})]})},rN=(e,t,n,r,l,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Ts.FIXED){if(!r&&!l){console.warn("Using fixed layout but neither width nor height is passed as props.");return}r&&r<0&&console.warn(`Using fixed layout but width is invalid: ${r}.`),l&&l<0&&console.warn(`Using fixed layout but height is invalid: ${l}.`);return}(r||l)&&console.warn("Width or height is passed in but layout is not fixed. These will have no impact. If you want to have a fixed height or width then set layout to fixed."),e===Ts.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},iN=(e,t,n,r,l,d,f,p)=>{let _=[100,320,640,960,1280,1920],T=Yu(l,500,500);const E={...r};switch(E.objectFit=E.objectFit||"cover",E.objectPosition=E.objectPosition||"center",e){case Ts.INTRINSIC:E.maxWidth=t,E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Ts.FIXED:{const{fixedWidth:S,fixedHeight:w,fixedWidths:M}=sN(t,n,_,d,f);E.width=S,E.height=w,_=M,T=Yu(l,S,w);break}case Ts.ASPECT:E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Ts.FILL:E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:T,imgStyle:E,widths:_}},sN=(e,t,n,r,l)=>r&&l?{fixedWidth:r,fixedHeight:l,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:l?{fixedWidth:l/t*e,fixedHeight:l,fixedWidths:[l/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var dp={exports:{}};/*!
|
|
32
|
+
`,t),null}}const ky="1.0.0",Tf={version:ky};function Py(e,t,n){return n.debug?(lp(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function $y(e,t,n){return n.debug?(lp(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Fy(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function lp(e,t,n){var r=e?"Beacon":"fetch()";console.log("[DEBUG] AnalyticsConfig object at time of call to report():",n),console.log("[DEBUG] The following EventPayload would be sent to the Yext Events API using ".concat(r,":"),t)}var Ku=function(){return Ku=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},Ku.apply(this,arguments)},zu=function(e,t){if(!t||Object.keys(t).length===0)return e;if(!e||Object.keys(e).length===0)return t;var n=JSON.parse(JSON.stringify(e));for(var r in t)if(t.hasOwnProperty(r)){var l=t[r];l==null?delete n[r]:typeof l!="object"?n[r]=l:n[r]=zu(n[r],l)}return Ku({},n)},By="yextevents.com/accounts/me/events";function Hy(e,t){var n=e==="SANDBOX",r=t==null?void 0:t.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+By}var Wy=function(e,t,n,r){function l(d){return d instanceof n?d:new n(function(f){f(d)})}return new(n||(n=Promise))(function(d,f){function p(E){try{T(r.next(E))}catch(S){f(S)}}function _(E){try{T(r.throw(E))}catch(S){f(S)}}function T(E){E.done?d(E.value):l(E.value).then(p,_)}T((r=r.apply(e,t||[])).next())})},Ky=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,l,d,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(T){return function(E){return _([T,E])}}function _(T){if(r)throw new TypeError("Generator is already executing.");for(;f&&(f=0,T[0]&&(n=0)),n;)try{if(r=1,l&&(d=T[0]&2?l.return:T[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,T[1])).done)return d;switch(l=0,d&&(T=[T[0]&2,d.value]),T[0]){case 0:case 1:d=T;break;case 4:return n.label++,{value:T[1],done:!1};case 5:n.label++,l=T[1],T=[0];continue;case 7:T=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){n=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){n.label=T[1];break}if(T[0]===6&&n.label<d[1]){n.label=d[1],d=T;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(T);break}d[2]&&n.ops.pop(),n.trys.pop();continue}T=t.call(e,n)}catch(E){T=[6,E],l=0}finally{r=d=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},zy=function(){function e(t,n){if(t.authorizationType!=="apiKey"&&t.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!t.authorization)throw new Error("Authorization must be provided.");this.config=t,this.payload=n}return e.prototype.with=function(t){var n=this.payload===void 0?t:zu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return Wy(this,void 0,void 0,function(){var r,l,d,f,p=this;return Ky(this,function(_){return r=zu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Iy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Tf.version:r.clientSdk=(f={},f.ANALYTICS=Tf.version,f),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,l=Fy(r,this.config.forceFetch),d=Hy(this.config.env,this.config.region),l?[2,new Promise(function(T,E){Py(d,r,p.config)?T(""):E("Failed Beacon Call")})]:[2,$y(d,r,this.config).then(function(T){return T}).catch(function(T){return T})]})})},e}();function Uy(e){return new zy(e)}function Uu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function ap(e,t){return[e,t].filter(n=>!!n).map(n=>Uu(n)).join("_")}const Gy=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},ud=nt.createContext(null),Yy=nt.lazy(()=>Promise.resolve().then(()=>require("./debugger-fEUqg7Sy.cjs")));function jy(e){const{children:t,apiKey:n,currency:r,templateData:l,requireOptIn:d,disableSessionTracking:f,enableDebugging:p,productionDomains:_}=e;if(!n)throw new Error("API Key is required for AnalyticsProvider");const T=nt.useRef(null),[E,S]=nt.useState(!1);nt.useEffect(()=>{S(!0)},[]),T.current===null&&(T.current=new cp(n,r,l,d,f,_,p??cc()));const w=T.current;return nt.useEffect(()=>(window.enableYextAnalytics=()=>{w.optIn()},()=>{delete window.enableYextAnalytics}),[w]),at.jsxs(at.Fragment,{children:[at.jsx(ud.Provider,{value:w,children:t}),E&&(p||cc())&&Xo().name==="browser"?at.jsx(nt.Suspense,{fallback:at.jsx(at.Fragment,{}),children:at.jsx(Yy,{})}):null]})}function cc(){return Xo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class cp{constructor(t,n,r,l,d,f,p=!1){Ie(this,"_optedIn");Ie(this,"_sessionTrackingEnabled");Ie(this,"_analyticsEventService");Ie(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.productionDomains=f,this.enableDebugging=p,this._optedIn=!l,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Xo().name!=="browser"||!this._optedIn)return;if(!Ny(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=Gy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:t||"US",sessionTrackingEnabled:this._sessionTrackingEnabled,debug:this.getDebugEnabled()},r={pages:{siteUid:this.templateData.document.siteId,template:this.templateData.document.__.name},entity:this.templateData.document.uid||void 0,pageUrl:document.URL,referrerUrl:document.referrer!==""?document.referrer:void 0};this._analyticsEventService=Uy(n).with(r)}canTrack(){return Xo().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(t){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:t}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var t;if(!this.canTrack())return Promise.resolve(void 0);await((t=this._analyticsEventService)==null?void 0:t.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(t){var S;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:l,currency:d,amount:f,destinationUrl:p,customTags:_,customValues:T}=t;let E;f&&(E={amount:f,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:Uu(r)||void 0,originalEventName:ap(r||"",Uu(l)||"")},value:E,destinationUrl:p,customTags:_,customValues:T}))}getDebugEnabled(){return this.enableDebugging||cc()}}const Gu=nt.createContext({name:""}),dd=()=>nt.useContext(Gu).name;function Vy(e){var f;const t=dd(),[n]=nt.useState({name:ap(t,e.name)}),r=(f=nl())==null?void 0:f.getDebugEnabled(),[l,d]=nt.useState(!1);return nt.useEffect(()=>{d(!0)},[]),r&&l?at.jsx("section",{"data-ya-scope":n.name,children:at.jsx(Gu.Provider,{value:n,children:e.children})}):at.jsx(Gu.Provider,{value:n,children:e.children})}function nl(){const e=nt.useContext(ud);if(!e)return e;Xo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=dd();return{getDebugEnabled(){return e.getDebugEnabled()},identify(n){return e.identify(n)},optIn(){return e.optIn()},pageView(){return e.pageView()},track(n){return e.track({...n,scope:n.scope??t})}}}const qy=()=>{var e;return(e=nl())==null?void 0:e.track},Zy=()=>{var e;return(e=nl())==null?void 0:e.pageView},Jy=()=>{var e;return(e=nl())==null?void 0:e.identify},Ts={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},Xy=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}const n=e.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${e}`);return}r="eu"}if(!e.pathname.startsWith("/f")){console.error(`Invalid path: ${e}`);return}const l=e.pathname.replace(/^\//,"").split("/");if(l.length<2||l.length>3){console.error(`Invalid path: ${e}`);return}let d;if(l[0]==="f")d="prod";else switch(l[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${e}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${e}`);return}let f;if(l.length===3&&(f=parseInt(l[1]),Number.isNaN(f))){console.error(`Invalid account id: ${e}`);return}const p=l[l.length-1].split("."),_=p.length===2?`.${p[1]}`:"",T=p[0];return{scheme:t,partition:r,env:d,accountId:f,contentHash:T,extension:_}},Qy=(e,t,n)=>{const r=`https://dyn${e.partition==="us"?"":`.${e.partition}`}.mktgcdn.com`;let l="f";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}const d=e.accountId!==void 0?`${e.accountId}/`:"";return`${r}/${l}/${d}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}`},eN=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}if(e.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${e}`);return}if(!e.pathname.startsWith("/p")){console.error(`Invalid path: ${e}`);return}const n=e.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${e}`);return}let r;if(n[0]==="p")r="prod";else switch(n[0].replace("p-","")){case"sandbox":{r="sbx";break}case"qa":{r="qa";break}case"dev":{r="dev";break}default:{console.error(`Invalid path: ${e}`);return}}const l=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${e}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${e}`);return}}const f=n[n.length-1].split("."),p=f.length===2?`.${f[1]}`:"",_=f[0];return{scheme:t,env:r,contentHash:l,aspectRatio:d,name:_,extension:p}},tN=(e,t,n)=>{const r="https://dyn.mktgcdn.com";let l="p";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}return`${r}/${l}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}`},Yu=(e,t,n)=>{if(!up(e)){console.error(`Invalid image url: ${e}.`);return}const r=new URL(e);if(r.pathname.startsWith("/p")){const l=eN(r);if(l)return tN(l,t,n)}else if(r.pathname.startsWith("/f")){const l=Xy(r);if(l)return Qy(l,t,n)}return e},up=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},nN=({image:e,className:t,width:n,height:r,aspectRatio:l,layout:d=Ts.INTRINSIC,placeholder:f,imgOverrides:p,style:_={},loading:T="lazy"})=>{const E=nt.useRef(null),[S,w]=nt.useState(!1),M="image"in e?e.image:e;nt.useEffect(()=>{var ce;(ce=E.current)!=null&&ce.complete&&w(!0)},[]),rN(d,M.width,M.height,n,r,l);const m=Math.abs(M.width);m||console.warn("Invalid image width.");const v=Math.abs(M.height);if(v||console.warn("Invalid image height."),!up(M.url))return console.error(`Invalid image url: ${M.url}`),at.jsx(at.Fragment,{children:f!=null&&f});const k=n&&n>0?n:void 0,G=r&&r>0?r:void 0,{src:I,imgStyle:P,widths:H}=iN(d,m,v,_,M.url,k,G,l),j=H.map(ce=>`${Yu(M.url,ce,v/m*ce)} ${ce}w`).join(", "),re=[640,768,1024,1280,1536],te=H.map((ce,V)=>V===H.length-1?`${ce}px`:`(max-width: ${re[V]}px) ${ce}px`).join(", ");return at.jsxs(at.Fragment,{children:[!S&&f!=null&&f,at.jsx("img",{ref:E,style:P,src:I,className:t,width:k,height:G,srcSet:j,sizes:te,loading:T,alt:M.alternateText||"",...p})]})},rN=(e,t,n,r,l,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Ts.FIXED){if(!r&&!l){console.warn("Using fixed layout but neither width nor height is passed as props.");return}r&&r<0&&console.warn(`Using fixed layout but width is invalid: ${r}.`),l&&l<0&&console.warn(`Using fixed layout but height is invalid: ${l}.`);return}(r||l)&&console.warn("Width or height is passed in but layout is not fixed. These will have no impact. If you want to have a fixed height or width then set layout to fixed."),e===Ts.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},iN=(e,t,n,r,l,d,f,p)=>{let _=[100,320,640,960,1280,1920],T=Yu(l,500,500);const E={...r};switch(E.objectFit=E.objectFit||"cover",E.objectPosition=E.objectPosition||"center",e){case Ts.INTRINSIC:E.maxWidth=t,E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Ts.FIXED:{const{fixedWidth:S,fixedHeight:w,fixedWidths:M}=sN(t,n,_,d,f);E.width=S,E.height=w,_=M,T=Yu(l,S,w);break}case Ts.ASPECT:E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Ts.FILL:E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:T,imgStyle:E,widths:_}},sN=(e,t,n,r,l)=>r&&l?{fixedWidth:r,fixedHeight:l,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:l?{fixedWidth:l/t*e,fixedHeight:l,fixedWidths:[l/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var dp={exports:{}};/*!
|
|
33
33
|
Copyright (c) 2018 Jed Watson.
|
|
34
34
|
Licensed under the MIT License (MIT), see
|
|
35
35
|
http://jedwatson.github.io/classnames
|
|
36
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var d="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(d=l(d,r(p)))}return d}function r(d){if(typeof d=="string"||typeof d=="number")return d;if(typeof d!="object")return"";if(Array.isArray(d))return n.apply(null,d);if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]"))return d.toString();var f="";for(var p in d)t.call(d,p)&&d[p]&&(f=l(f,p));return f}function l(d,f){return f?d?d+" "+f:d+f:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(dp);var oN=dp.exports;const Qo=ad(oN),lN="phonecall",aN="drivingdirection",xf="calltoactionclick",cN="clicktowebsite",uN="other",vf="link",dN="cta",fN=e=>{const t=e.cta??{link:e.href};if(!t.link)throw e.cta?new Error("CTA's link is undefined"):new Error("Link's href is undefined");return t.linkType||(t.linkType=pN(t.link)),t.link=mN(t),t},hN=(e,t)=>{switch(e.linkType){case"EMAIL":return"CTA_CLICK";case"PHONE":return"TAP_TO_CALL";case"CLICK_TO_WEBSITE":return"WEBSITE";case"DRIVING_DIRECTIONS":return"DRIVING_DIRECTIONS";case"OTHER":return"CTA_CLICK";case"URL":return"LINK";default:return t?"CTA_CLICK":"LINK"}},gN=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return lN;case"EMAIL":return xf;case"URL":return vf;case"DRIVING_DIRECTIONS":return aN;case"CLICK_TO_WEBSITE":return cN;case"OTHER":return uN;default:return n?xf:vf}return dN},pN=e=>_N(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",mN=e=>e.linkType==="EMAIL"?e.link.startsWith("mailto:")?e.link:`mailto:${e.link}`:e.linkType==="PHONE"?e.link.startsWith("tel:")?e.link:`tel:${e.link}`:e.link,_N=e=>e.startsWith("mailto:")?!0:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e),fp=nt.forwardRef(function(t,n){const{children:r,onClick:l,className:d,eventName:f,scope:p,currency:_,amount:T,cta:E,obfuscate:S,customTags:w,customValues:M,...m}=t,v=fN(t),k=hN(v,!!E),G=gN(f,v.linkType,!!E),I=nl(),P=S||S!==!1&&v.linkType==="EMAIL",H=async te=>{const ce=te.currentTarget;let j="";if(P){te.preventDefault();const z=ce.href.split("/").at(-1);z&&(j=atob(z))}if(I!==null)try{await I.track({action:k,scope:p,eventName:G,currency:_,amount:T,destinationUrl:j||ce.href,customTags:w,customValues:M})}catch{console.error("Failed to report click Analytics Event")}l&&l(te),j&&(window.location.href=j)},V=P?"Obfuscated, set a label or child":v.link,re={className:Qo("Link",d),href:P?btoa(v.link):v.link,onClick:H,rel:t.target&&!t.rel?"noopener":void 0,ref:n};return I!=null&&I.getDebugEnabled()&&(re["data-ya-action"]=k,re["data-ya-scopeoverride"]=p,re["data-ya-eventname"]=G),ft.jsx("a",{...m,...re,suppressHydrationWarning:!0,children:r||v.label||V})});var Nn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(Nn||{}),Gr=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Gr||{});const Vc=3959,jc=6371,yN=["latitude","lat"],NN=["longitude","lon","lng","long"];function Sf(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function wf(e){switch(typeof e){case"string":case"number":const t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error(`'${e}' must be convertible to a Number'`);return t;default:throw new Error(`typeof '${e}' must be a number or a string that can be converted to a number, is '${typeof e}'`)}}function io(e){return e*Math.PI/180}function Ji(e){return e/Math.PI*180}function CN(e,t){const n=io(e.latitude),r=io(t.latitude),l=r-n,d=io(t.longitude-e.longitude),f=Math.pow(Math.sin(l/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))}function EN(e,t){const n=Math.tan(Math.PI/360*(e+90)),r=Math.tan(Math.PI/360*(t+90));return Math.log(r/n)}function TN(e,t){const r=Math.tan(Math.PI/360*(e+90))*Math.pow(Math.E,t);return Math.atan(r)*360/Math.PI-90}class dn{constructor(t,n){Ie(this,"_lat");Ie(this,"_lon");let r=t,l=n;this._lat=0,this._lon=0,typeof t=="object"?(r=Sf(t,yN)??0,l=Sf(t,NN)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof l=="function"?l():l):typeof r=="number"&&typeof l=="number"&&(this.latitude=r,this.longitude=l)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(wf(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=wf(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=Nn.DEGREE,l=Gr.SPHERICAL){if(l===Gr.MERCATOR&&(r===Nn.DEGREE||r===Nn.RADIAN)){const d=r===Nn.DEGREE?io(t):t,f=r===Nn.DEGREE?n:Ji(n);this.latitude=TN(this.latitude,d),this.longitude+=f}else switch(r){case Nn.DEGREE:this.latitude+=t,this.longitude+=n;break;case Nn.KILOMETER:this.latitude+=Ji(t)*jc,this.longitude+=Ji(n)*jc*Math.cos(io(this.latitude));break;case Nn.MILE:this.latitude+=Ji(t)*Vc,this.longitude+=Ji(n)*Vc*Math.cos(io(this.latitude));break;case Nn.RADIAN:this.latitude+=Ji(t),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=Nn.MILE,r=Gr.SPHERICAL){if(r===Gr.MERCATOR&&(n===Nn.DEGREE||n===Nn.RADIAN)){const l=EN(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),f=io(Math.min(d,360-d)),p=Math.sqrt(Math.pow(l,2)+Math.pow(f,2));switch(n){case Nn.DEGREE:return Ji(p);case Nn.RADIAN:return p;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const l=CN(this,t);switch(n){case Nn.DEGREE:return Ji(l);case Nn.KILOMETER:return l*jc;case Nn.MILE:return l*Vc;case Nn.RADIAN:return l;default:throw new Error(`unit unhandled: ${String(n)}`)}}}equals(t){return t&&t.latitude===this.latitude&&t.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function hp(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var Sr=(e=>(e.UNDEFINED="undefined",e.NULL="object",e.BOOLEAN="boolean",e.NUMBER="number",e.BIGINT="bigint",e.STRING="string",e.SYMBOL="symbol",e.FUNCTION="function",e.OBJECT="object",e))(Sr||{});function kr(e,t){if(typeof t!="string")throw new Error("Assertion error: 'type' must be a string");if(typeof e!==t)throw new Error(`Expected an object of type '${t}' but received '${typeof e}'`)}function wr(e,t){let n;try{n=e instanceof t}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${t.name}' but received '${e.constructor.name}'`)}class gp{constructor(t,n){Ie(this,"providerMapClass");Ie(this,"wrapper");Ie(this,"controlEnabled");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"providerOptions");wr(t,ao),n&&wr(n,HTMLElement),this.providerMapClass=t.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(t){return this.controlEnabled=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProviderOptions(t){return this.providerOptions=t,this}build(){const t=this.providerMapClass;return new t(this)}}class rl{constructor(t){Ie(this,"_panHandler");Ie(this,"_panStartHandler");wr(t,gp),this._panHandler=t.panHandler,this._panStartHandler=t.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(t,n){throw new Error("not implemented")}setZoom(t,n){throw new Error("not implemented")}setZoomCenter(t,n,r){this.setZoom(t,r),this.setCenter(n,r)}}class pp{constructor(t){Ie(this,"providerPinClass");Ie(this,"clickHandler");Ie(this,"focusHandler");Ie(this,"hoverHandler");Ie(this,"icons");Ie(this,"hasPinUrl");wr(t,ao),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return kr(t,Sr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return kr(t,Sr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return kr(t,Sr.FUNCTION),this.hoverHandler=t,this}withIcons(t){return this.icons=t,this}withHasPinUrl(t){return this.hasPinUrl=t,this}build(){const t=this.providerPinClass;return new t(this)}}class fd{constructor(t){Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_icons");wr(t,pp),this._clickHandler=t.clickHandler,this._focusHandler=t.focusHandler,this._hoverHandler=t.hoverHandler,this._icons=t.icons}setCoordinate(t){throw new Error("not implemented")}setMap(t,n){throw new Error("not implemented")}setProperties(t){throw new Error("not implemented")}}const xN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class il extends fd{constructor(n){super(n);Ie(this,"_pinEl");Ie(this,"_pinAlt");Ie(this,"_wrapper");this._pinEl=n.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,il.baseStyle),this._pinAlt=document.createElement("span"),this._pinAlt.classList.add("sr-only"),this._pinEl.appendChild(this._pinAlt),this._wrapper=document.createElement("div"),this._wrapper.style.pointerEvents="none",this._wrapper.appendChild(this._pinEl),this.addListeners()}static get baseStyle(){return xN}addListeners(){this._wrapper&&(this._wrapper.addEventListener("click",()=>this._clickHandler()),this._wrapper.addEventListener("focusin",()=>this._focusHandler(!0)),this._wrapper.addEventListener("focusout",()=>this._focusHandler(!1)),this._wrapper.addEventListener("mouseover",()=>this._hoverHandler(!0)),this._wrapper.addEventListener("mouseout",()=>this._hoverHandler(!1)))}getPinElement(){return this._pinEl}getWrapperElement(){return this._wrapper}setProperties(n){this.setElementProperties(n);const r=n.getClass(),l=n.getElement()||this._pinEl,d=n.getZIndex();l.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),l!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(l)))}setElementProperties(n){const r=n.getAnchorX(),l=n.getAnchorY(),d=n.getHeight(),f=this._icons[n.getIcon()],p=n.getSRText(),_=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:f?`url("${f}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*l}%)`,width:_+"px"}),this._pinAlt.innerText=p}}class lo{constructor(){Ie(this,"loadFunction");Ie(this,"mapClass");Ie(this,"pinClass");Ie(this,"providerName");this.loadFunction=(t,n,r,l)=>t(),this.mapClass=rl,this.pinClass=fd,this.providerName=""}withLoadFunction(t){return kr(t,Sr.FUNCTION),this.loadFunction=t,this}withMapClass(t){return this.mapClass=t,this}withPinClass(t){return this.pinClass=t,this}withProviderName(t){return this.providerName=t,this}build(){return new ao(this)}}class ao{constructor(t){Ie(this,"_loadFunction");Ie(this,"_mapClass");Ie(this,"_pinClass");Ie(this,"_providerName");Ie(this,"_loadPromise");Ie(this,"_resolveLoad");Ie(this,"_rejectLoad");Ie(this,"_apiKey");Ie(this,"_loadInvoked");Ie(this,"_loaded");Ie(this,"_options");wr(t,lo),this._loadFunction=t.loadFunction,this._mapClass=t.mapClass,this._pinClass=t.pinClass,this._providerName=t.providerName,this._loadPromise=new Promise((n,r)=>{this._resolveLoad=n,this._rejectLoad=r}),this._apiKey="",this._loadInvoked=!1,this._loaded=!1,this._options={}}get loaded(){return this._loaded}getMapClass(){return this._mapClass}getPinClass(){return this._pinClass}getProviderName(){return this._providerName}async load(t=this._apiKey,n=this._options){!this._loadInvoked&&this._resolveLoad&&this._rejectLoad&&(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,t,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(t,n=null){this._loadInvoked||(this._apiKey=t,this._options=n||this._options)}}class vN extends rl{constructor(n){super(n);Ie(this,"map");Ie(this,"_moving");n.wrapper&&(this.map=new google.maps.Map(n.wrapper,{disableDefaultUI:!n.controlEnabled,fullscreenControl:!1,gestureHandling:n.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:n.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...n.providerOptions}),this._moving=!1,google.maps.event.addListener(this.map,"bounds_changed",()=>{this._moving||(this._moving=!0,this._panStartHandler())}),google.maps.event.addListener(this.map,"idle",()=>{this._moving=!1,this._panHandler()}))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d,f;const l=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(l):(f=this.map)==null||f.setCenter(l)}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(Math.floor(n))}setZoomCenter(n,r,l){this.setCenter(r,l),this.setZoom(n,l)}}class SN extends il{constructor(n){super(n);Ie(this,"_latLng");Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(f){super();Ie(this,"pin");this.pin=f}draw(){var p;const f=(p=this.getProjection())==null?void 0:p.fromLatLngToDivPixel(this.pin._latLng??null);f&&this.pin._wrapper&&(this.pin._wrapper.style.left=f.x+"px",this.pin._wrapper.style.top=f.y+"px")}onAdd(){var f;this.pin._wrapper&&((f=this.getPanes())==null||f.floatPane.appendChild(this.pin._wrapper))}onRemove(){var f,p;(p=(f=this.pin._wrapper)==null?void 0:f.parentNode)==null||p.removeChild(this.pin._wrapper)}}this.pin=new r(this)}setCoordinate(n){this._latLng=new google.maps.LatLng(n.latitude,n.longitude),this.pin.draw()}setMap(n,r){var d;const l=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(l??null)}}const Of="GoogleMapsCallback_b7d77ff2",wN="https://maps.googleapis.com/maps/api/js";function ON(e,t,n,{autocomplete:r=!1,channel:l=window.location.hostname,client:d,language:f,region:p,libraries:_=[],loading:T="async",params:E={}}={}){window[Of]=e,r&&_.push("geocoder","places");const S={callback:Of,channel:l,libraries:_.join(","),...E};n&&(S.key=n),d&&(S.client=d),f&&(S.language=f),p&&(S.region=p),T&&(S.loading=T),hp(wN+"?"+Object.entries(S).map(([w,M])=>w+"="+M).join("&"))}const mp=new lo().withLoadFunction(ON).withMapClass(vN).withPinClass(SN).withProviderName("Google").build();class no{constructor(t,n){Ie(this,"_ne");Ie(this,"_sw");this._ne=new dn(n),this._sw=new dn(t)}static fit(t){const n=t.map(T=>T.latitude),r=Math.max(...n),l=Math.min(...n),d=t.map(T=>T.normalLon).sort((T,E)=>T-E),f=d.map((T,E)=>({distance:(E<d.length-1?d[E+1]:d[0]+360)-T,index:E})).reduce((T,E)=>E.distance>T.distance?E:T).index,p=d[f],_=d[(f+1)%d.length];return new this(new dn(l,_),new dn(r,p))}get ne(){return this._ne}set ne(t){this._ne=new dn(t)}get sw(){return this._sw}set sw(t){this._sw=new dn(t)}contains(t){const n=this._sw.latitude<=t.latitude&&t.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,l=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=t.normalLon&&t.normalLon<=this._ne.normalLon:this._sw.normalLon<=t.normalLon||t.normalLon<=this._ne.normalLon;return n&&(r||l)}extend(t){if(this._ne.latitude=Math.max(this._ne.latitude,t.latitude),this._sw.latitude=Math.min(this._sw.latitude,t.latitude),!this.contains(t)){const n=((t.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-t.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(t=Gr.SPHERICAL){const n=new dn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,Nn.DEGREE,t),l=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,Nn.DEGREE,t),n.longitude=l,n}}class DN{constructor(){Ie(this,"_anchorX");Ie(this,"_anchorY");Ie(this,"_height");Ie(this,"_icon");Ie(this,"_srText");Ie(this,"_width");Ie(this,"_zIndex");Ie(this,"_class");Ie(this,"_element");this._anchorX=.5,this._anchorY=1,this._height=39,this._icon="default",this._srText="map pin",this._width=33,this._zIndex=0,this._class="",this._element=null}getAnchorX(){return this._anchorX}getAnchorY(){return this._anchorY}getClass(){return this._class}getElement(){return this._element}getHeight(){return this._height}getIcon(){return this._icon}getSRText(){return this._srText}getWidth(){return this._width}getZIndex(){return this._zIndex}setAnchorX(t){return this._anchorX=t,this}setAnchorY(t){return this._anchorY=t,this}setClass(t){return this._class=t,this}setElement(t){return this._element=t,this}setHeight(t){return this._height=t,this}setIcon(t){return this._icon=t,this}setSRText(t){return this._srText=t,this}setWidth(t){return this._width=t,this}setZIndex(t){return this._zIndex=t,this}}class hd{constructor(){Ie(this,"coordinate");Ie(this,"hideOffscreen");Ie(this,"icons");Ie(this,"propertiesForStatus");Ie(this,"provider");Ie(this,"type");Ie(this,"hasPinUrl");this.coordinate=new dn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new DN,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(t){return this.coordinate=new dn(t),this}withHideOffscreen(t){return this.hideOffscreen=t,this}withIcon(t,n){return this.icons[t]=n,this}withPropertiesForStatus(t){return kr(t,Sr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(wr(t,ao),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new AN(this)}}class AN{constructor(t){Ie(this,"_coordinate");Ie(this,"_hideOffscreen");Ie(this,"_icons");Ie(this,"_propertiesForStatus");Ie(this,"_type");Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_hidden");Ie(this,"_cancelHiddenUpdater");Ie(this,"_map");Ie(this,"_pin");Ie(this,"_status");var n,r;if(wr(t,hd),t.provider&&wr(t.provider,ao),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=t.coordinate,this._hideOffscreen=t.hideOffscreen,this._icons={...t.icons},this._propertiesForStatus=t.propertiesForStatus,this._type=t.type,this._clickHandler=()=>null,this._focusHandler=l=>this._hoverHandler(l),this._hoverHandler=l=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new pp(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(l=>this._focusHandler(l)).withHoverHandler(l=>this._hoverHandler(l)).withHasPinUrl(t.hasPinUrl).build(),this._pin.setCoordinate(t.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(t){return this._icons[t]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(t){kr(t,Sr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new dn(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){kr(t,Sr.FUNCTION),this._focusHandler=t}setHoverHandler(t){kr(t,Sr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&wr(t,yp),this._pin.setMap(t,this._hidden?null:this._map),this._map=t,this._hidden=!1,this._cancelHiddenUpdater(),t&&this._hideOffscreen)){let n=!1;const r=new Promise(l=>{this._cancelHiddenUpdater=()=>{n=!0,l()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,t.moving()]),await Promise.race([r,t.idle()])})()}}setStatus(t){Object.assign(this._status,t),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const t=this._map.getBounds().contains(this._coordinate);this._hidden&&t?this._pin.setMap(this._map,null):!this._hidden&&!t&&this._pin.setMap(null,this._map),this._hidden=!t}}}const _s=.98;function ja(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class _p{constructor(){Ie(this,"controlEnabled");Ie(this,"defaultCenter");Ie(this,"defaultZoom");Ie(this,"legendPins");Ie(this,"padding");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"provider");Ie(this,"providerOptions");Ie(this,"singlePinZoom");Ie(this,"wrapper");this.controlEnabled=!0,this.defaultCenter=new dn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(t,n)=>null,this.panStartHandler=t=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(t){return this.controlEnabled=t,this}withDefaultCenter(t){return this.defaultCenter=new dn(t),this}withDefaultZoom(t){return this.defaultZoom=t,this}withLegendPins(t){return this.legendPins=Array.from(t),this}withPadding(t){return this.padding=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return wr(t,ao),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(wr(t,HTMLElement),this.wrapper=t,this):this}build(){return new yp(this)}}let yp=class{constructor(t){Ie(this,"_defaultCenter");Ie(this,"_defaultZoom");Ie(this,"_legendPins");Ie(this,"_padding");Ie(this,"_provider");Ie(this,"_singlePinZoom");Ie(this,"_wrapper");Ie(this,"_cachedBounds");Ie(this,"_resolveIdle");Ie(this,"_resolveMoving");Ie(this,"_idlePromise");Ie(this,"_panHandlerRunning");Ie(this,"_panStartHandlerRunning");Ie(this,"_currentBounds");Ie(this,"_movingPromise");Ie(this,"_panHandler");Ie(this,"_panStartHandler");Ie(this,"_map");var n,r,l;if(wr(t,_p),t.provider&&wr(t.provider,ao),t.wrapper&&wr(t.wrapper,HTMLElement),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=t.defaultCenter,this._defaultZoom=t.defaultZoom,this._legendPins=t.legendPins,this._provider=t.provider,this._singlePinZoom=t.singlePinZoom,this._wrapper=t.wrapper,this._padding={},this.setPadding(t.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(t.panHandler),this.setPanStartHandler(t.panStartHandler);(l=this._wrapper)!=null&&l.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new gp(t.provider,this._wrapper).withControlEnabled(t.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(t.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(t,n=!1,r=this._singlePinZoom){t.length?this.setBounds(no.fit(t),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){var t,n;if(!this._cachedBounds){const r=((t=this._wrapper)==null?void 0:t.offsetHeight)??0,l=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),f=this.getCenter(),p=360/Math.pow(2,d+8),_=l*p,T=r*p;this._cachedBounds=new no(f,f),this._cachedBounds.ne.add(T/2,_/2,Nn.DEGREE,Gr.MERCATOR),this._cachedBounds.sw.add(-T/2,-_/2,Nn.DEGREE,Gr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new no(this._cachedBounds.sw,this._cachedBounds.ne)}getCenter(){return this._map.getCenter()}getProviderMap(){return this._map}getZoom(){return this._map.getZoom()}async idle(){await this._idlePromise}async moving(){await this._movingPromise}newPinOptions(){return new hd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new no(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler&&this._panStartHandler(new no(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,l={},d=1/0){var z,q;const f=(z=this._wrapper)==null?void 0:z.offsetHeight,p=(q=this._wrapper)==null?void 0:q.offsetWidth;if(!f||!p)return;let _=ja(l.bottom,f),T=ja(l.left,p),E=ja(l.right,p),S=ja(l.top,f),w=T+E,M=_+S;w>_s&&(T*=_s/w,E*=_s/w,w=_s),M>_s&&(_*=_s/M,S*=_s/M,M=_s);const m=f*(1-M),v=p*(1-w),k=new no(n,t),G=new dn(k.ne.latitude,k.sw.longitude),I=k.sw.distanceTo(G,Nn.DEGREE,Gr.MERCATOR),P=(k.ne.longitude-G.longitude+360)%360;let H=Math.max(I,P*m/v)/(1-M),V=Math.max(P,I*v/m)/(1-w),re=Math.log2(p*360/V)-8;re>d&&(re=d,V=p*360/2**(re+8),H=V*f/p);const te=k.getCenter(Gr.MERCATOR),ce=(S-_)/2*H,j=(E-T)/2*V;te.add(ce,j,Nn.DEGREE,Gr.MERCATOR),this.setZoomCenter(re,te,r)}setCenter(t,n=!1){this._map.setCenter(new dn(t),n)}setPadding({bottom:t=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:l=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:l},this}setPanHandler(t){kr(t,Sr.FUNCTION),this._panHandler=t}setPanStartHandler(t){kr(t,Sr.FUNCTION),this._panStartHandler=t}setZoom(t,n=!1){this._map.setZoom(t,n)}setZoomCenter(t,n,r=!1){this._map.setZoomCenter(t,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(t=>this._resolveMoving=t),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(t=>this._resolveIdle=t),this._resolveMoving()}};const _c=nt.createContext(null);function MN(){const e=nt.useContext(_c);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Np=({apiKey:e,bounds:t,children:n,className:r,clientKey:l,controls:d=!0,defaultCenter:f={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:_,padding:T={bottom:50,left:50,right:50,top:50},panHandler:E=()=>null,panStartHandler:S=()=>null,provider:w=mp,providerOptions:M={},singleZoom:m=14})=>{const v=nt.useRef(null),[k,G]=nt.useState(new dn(f)),[I,P]=nt.useState(!1),[H,V]=nt.useState(),[re,te]=nt.useState(p),ce=(j,z)=>{E(j,z),z&&G(z.getCenter())};return nt.useEffect(()=>{!I||!H||te(H.getZoom())},[k]),nt.useEffect(()=>{if(!t||!I||!H)return;const j=t.map(z=>new dn(z));H.fitCoordinates(j)},[JSON.stringify(t),H]),nt.useEffect(()=>{if(!I||H)return;const j=new _p().withControlEnabled(d).withDefaultCenter(k).withDefaultZoom(re).withPadding(T).withPanHandler(ce).withPanStartHandler(S).withProvider(w).withProviderOptions(M).withSinglePinZoom(m).withWrapper(v.current).build();V(j),_&&(_.current=j)},[I]),nt.useEffect(()=>{I||H||!v.current||w.load(e,{...M,...l&&{client:l}}).then(()=>P(!0))},[]),ft.jsx("div",{className:Qo({"is-loaded":I},r),id:"map",ref:v,"data-testid":"map",children:H&&ft.jsx(_c.Provider,{value:{map:H,provider:w},children:n})})},RN=({count:e})=>ft.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:ft.jsxs("g",{fill:"none",fillRule:"evenodd",children:[ft.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),ft.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:ft.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),gd=nt.createContext(null);function bN(){const e=nt.useContext(gd);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const LN=({clusterRadius:e=50,children:t,ClusterTemplate:n=RN})=>{const{map:r}=nt.useContext(_c),[l,d]=nt.useState([]),[f,p]=nt.useState(),[_,T]=nt.useState([]),[E,S]=nt.useState([]);return nt.useEffect(()=>{p(IN(l,r.getZoom(),e))},[l,r.getZoom()]),nt.useEffect(()=>{S(()=>[]),T(()=>[]),(f==null?void 0:f.length)!==0&&(f==null||f.forEach(w=>{if(w.length===1){w[0].pin.setMap(r);return}if(w.length>1){const M=no.fit(w.map(v=>v.pin.getCoordinate())).getCenter(Gr.MERCATOR),m=`cluster-{${M._lat},${M._lon}}`;w.forEach(v=>v.pin.setMap(null)),T(v=>[...v,m]),S(v=>[...v,ft.jsx(pd,{coordinate:M,id:m,onClick:()=>r.fitCoordinates(w.map(k=>k.pin.getCoordinate()),!0,1/0),children:ft.jsx(n,{count:w.length})},m)])}}))},[f]),ft.jsx(gd.Provider,{value:{clusters:f??[],clusterIds:_,setPinStore:d},children:ft.jsxs(ft.Fragment,{children:[E.map((w,M)=>ft.jsx(nt.Fragment,{children:w},M)),t]})})},IN=(e,t,n)=>{const r=n*Math.PI/2**(t+7),l=e.map((p,_)=>[_]),d=[];e.forEach((p,_)=>{for(let T=_;T<e.length;T++)T!==_&&new dn(p.pin.getCoordinate()).distanceTo(new dn(e[T].pin.getCoordinate()),Nn.RADIAN,Gr.MERCATOR)<=r&&(l[_].push(T),l[T].push(_))});let f=1;for(;f;){f=0;let p;if(l.forEach((E,S)=>{E.length>f&&(f=E.length,p=S)}),!f)break;const _=l[p??0],T=[];l[p??0]=[];for(const E of _){const S=l[E];T.push(e[E]),l[E]=[],S.forEach(w=>l[w].splice(l[w].indexOf(E),1))}d.push(T)}return d},kN=ft.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ft.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),pd=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:l=kN,onClick:d=()=>null,onFocus:f=()=>null,onHover:p=()=>null,zIndex:_,hasPinUrl:T=!1})=>{const{map:E,provider:S}=nt.useContext(_c),w=nt.useContext(gd),M=nt.useMemo(()=>new hd().withCoordinate(t).withHideOffscreen(n).withProvider(S).withHasPinUrl(T).build(),[]);nt.useEffect(()=>{if(_!==0&&!_)return;const v=M.getProviderPin().getWrapperElement();v&&(v.style.zIndex=_.toString())},[_]),nt.useEffect(()=>{M.setMap(E),M.setClickHandler(()=>d(r)),M.setFocusHandler(k=>f(k,r)),M.setHoverHandler(k=>p(k,r));const v=w==null?void 0:w.clusterIds.includes(r);return w&&!v&&w.setPinStore(k=>[...k,{pin:M,id:r}]),()=>{M.setMap(null),w&&w.setPinStore(k=>k.filter(G=>G.id!==r))}},[]);const m=e||l;if(m){const v=M.getProviderPin().getPinElement();return Object.assign(v.style,{height:"auto",width:"auto"}),ld.createPortal(m,v)}return null},PN=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:l=()=>null,onHover:d=()=>null,onFocus:f=()=>null,...p})=>{var _;return ft.jsx(Np,{bounds:[t],...p,children:ft.jsx(pd,{coordinate:t,id:"location-map-marker",onClick:l,onHover:d,onFocus:f,hasPinUrl:((_=r||"")==null?void 0:_.length)>0,children:r?ft.jsx(fp,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var qc={},jl={},Df;function $N(){if(Df)return jl;Df=1;var e=nt;const t=e.createContext(null);function n(l,d){let f=null;l!=null&&(f=l[1]);function p(){return d??(f!=null?f.getTheme():null)}return{getTheme:p}}function r(){const l=e.useContext(t);if(l==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return l}return jl.LexicalComposerContext=t,jl.createLexicalComposerContext=n,jl.useLexicalComposerContext=r,jl}var ql={},Af;function FN(){if(Af)return ql;Af=1;var e=nt;function t(r){let l=new URLSearchParams;l.append("code",r);for(let d=1;d<arguments.length;d++)l.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${l} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return ql.LexicalComposerContext=n,ql.createLexicalComposerContext=function(r,l){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return l??(d!=null?d.getTheme():null)}}},ql.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},ql}var Zc,Mf;function qn(){return Mf||(Mf=1,Zc=process.env.NODE_ENV==="development"?$N():FN()),Zc}var He={},Rf;function BN(){if(Rf)return He;Rf=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),l=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),f=e("INSERT_PARAGRAPH_COMMAND"),p=e("CONTROLLED_TEXT_INSERTION_COMMAND"),_=e("PASTE_COMMAND"),T=e("REMOVE_TEXT_COMMAND"),E=e("DELETE_WORD_COMMAND"),S=e("DELETE_LINE_COMMAND"),w=e("FORMAT_TEXT_COMMAND"),M=e("UNDO_COMMAND"),m=e("REDO_COMMAND"),v=e("KEYDOWN_COMMAND"),k=e("KEY_ARROW_RIGHT_COMMAND"),G=e("MOVE_TO_END"),I=e("KEY_ARROW_LEFT_COMMAND"),P=e("MOVE_TO_START"),H=e("KEY_ARROW_UP_COMMAND"),V=e("KEY_ARROW_DOWN_COMMAND"),re=e("KEY_ENTER_COMMAND"),te=e("KEY_SPACE_COMMAND"),ce=e("KEY_BACKSPACE_COMMAND"),j=e("KEY_ESCAPE_COMMAND"),z=e("KEY_DELETE_COMMAND"),q=e("KEY_TAB_COMMAND"),Te=e("INSERT_TAB_COMMAND"),Se=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),de=e("DROP_COMMAND"),K=e("FORMAT_ELEMENT_COMMAND"),O=e("DRAGSTART_COMMAND"),Z=e("DRAGOVER_COMMAND"),oe=e("DRAGEND_COMMAND"),Y=e("COPY_COMMAND"),W=e("CUT_COMMAND"),J=e("SELECT_ALL_COMMAND"),R=e("CLEAR_EDITOR_COMMAND"),U=e("CLEAR_HISTORY_COMMAND"),X=e("CAN_REDO_COMMAND"),fe=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),B=e("BLUR_COMMAND"),A=e("KEY_MODIFIER_COMMAND"),F=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=F&&"documentMode"in document?document.documentMode:null,ye=F&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),De=F&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=F&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,ne=F&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ue=F&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=F&&/Android/.test(navigator.userAgent),Ne=F&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=F&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,ke=1,Fe=3,qe=0,Be=1,ct=2,At=0,Ut=1,en=2,Oe=1,ie=2,le=4,ve=8,Le=16,Me=32,Ve=64,rt=128,it=Oe|ie|le|ve|Le|Me|Ve|rt,st=1,vt=2,Ge=1,ze=2,tt=3,yt=4,Nt=5,Et=6,gt=" ",mt=ne||ue||Re?gt:"",$t=`
|
|
36
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var d="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(d=l(d,r(p)))}return d}function r(d){if(typeof d=="string"||typeof d=="number")return d;if(typeof d!="object")return"";if(Array.isArray(d))return n.apply(null,d);if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]"))return d.toString();var f="";for(var p in d)t.call(d,p)&&d[p]&&(f=l(f,p));return f}function l(d,f){return f?d?d+" "+f:d+f:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(dp);var oN=dp.exports;const Qo=ad(oN),lN="phonecall",aN="drivingdirection",xf="calltoactionclick",cN="clicktowebsite",uN="other",vf="link",dN="cta",fN=e=>{const t=e.cta??{link:e.href};if(!t.link)throw e.cta?new Error("CTA's link is undefined"):new Error("Link's href is undefined");return t.linkType||(t.linkType=pN(t.link)),t.link=mN(t),t},hN=(e,t)=>{switch(e.linkType){case"EMAIL":return"CTA_CLICK";case"PHONE":return"TAP_TO_CALL";case"CLICK_TO_WEBSITE":return"WEBSITE";case"DRIVING_DIRECTIONS":return"DRIVING_DIRECTIONS";case"OTHER":return"CTA_CLICK";case"URL":return"LINK";default:return t?"CTA_CLICK":"LINK"}},gN=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return lN;case"EMAIL":return xf;case"URL":return vf;case"DRIVING_DIRECTIONS":return aN;case"CLICK_TO_WEBSITE":return cN;case"OTHER":return uN;default:return n?xf:vf}return dN},pN=e=>_N(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",mN=e=>e.linkType==="EMAIL"?e.link.startsWith("mailto:")?e.link:`mailto:${e.link}`:e.linkType==="PHONE"?e.link.startsWith("tel:")?e.link:`tel:${e.link}`:e.link,_N=e=>e.startsWith("mailto:")?!0:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e),fp=nt.forwardRef(function(t,n){const{children:r,onClick:l,className:d,eventName:f,scope:p,currency:_,amount:T,cta:E,obfuscate:S,customTags:w,customValues:M,...m}=t,v=fN(t),k=hN(v,!!E),G=gN(f,v.linkType,!!E),I=nl(),P=S||S!==!1&&v.linkType==="EMAIL",H=async te=>{const ce=te.currentTarget;let V="";if(P){te.preventDefault();const z=ce.href.split("/").at(-1);z&&(V=atob(z))}if(I!==null)try{await I.track({action:k,scope:p,eventName:G,currency:_,amount:T,destinationUrl:V||ce.href,customTags:w,customValues:M})}catch{console.error("Failed to report click Analytics Event")}l&&l(te),V&&(window.location.href=V)},j=P?"Obfuscated, set a label or child":v.link,re={className:Qo("Link",d),href:P?btoa(v.link):v.link,onClick:H,rel:t.target&&!t.rel?"noopener":void 0,ref:n};return I!=null&&I.getDebugEnabled()&&(re["data-ya-action"]=k,re["data-ya-scopeoverride"]=p,re["data-ya-eventname"]=G),at.jsx("a",{...m,...re,suppressHydrationWarning:!0,children:r||v.label||j})});var Nn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(Nn||{}),Gr=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Gr||{});const jc=3959,Vc=6371,yN=["latitude","lat"],NN=["longitude","lon","lng","long"];function Sf(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function wf(e){switch(typeof e){case"string":case"number":const t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error(`'${e}' must be convertible to a Number'`);return t;default:throw new Error(`typeof '${e}' must be a number or a string that can be converted to a number, is '${typeof e}'`)}}function io(e){return e*Math.PI/180}function Ji(e){return e/Math.PI*180}function CN(e,t){const n=io(e.latitude),r=io(t.latitude),l=r-n,d=io(t.longitude-e.longitude),f=Math.pow(Math.sin(l/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))}function EN(e,t){const n=Math.tan(Math.PI/360*(e+90)),r=Math.tan(Math.PI/360*(t+90));return Math.log(r/n)}function TN(e,t){const r=Math.tan(Math.PI/360*(e+90))*Math.pow(Math.E,t);return Math.atan(r)*360/Math.PI-90}class dn{constructor(t,n){Ie(this,"_lat");Ie(this,"_lon");let r=t,l=n;this._lat=0,this._lon=0,typeof t=="object"?(r=Sf(t,yN)??0,l=Sf(t,NN)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof l=="function"?l():l):typeof r=="number"&&typeof l=="number"&&(this.latitude=r,this.longitude=l)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(wf(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=wf(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=Nn.DEGREE,l=Gr.SPHERICAL){if(l===Gr.MERCATOR&&(r===Nn.DEGREE||r===Nn.RADIAN)){const d=r===Nn.DEGREE?io(t):t,f=r===Nn.DEGREE?n:Ji(n);this.latitude=TN(this.latitude,d),this.longitude+=f}else switch(r){case Nn.DEGREE:this.latitude+=t,this.longitude+=n;break;case Nn.KILOMETER:this.latitude+=Ji(t)*Vc,this.longitude+=Ji(n)*Vc*Math.cos(io(this.latitude));break;case Nn.MILE:this.latitude+=Ji(t)*jc,this.longitude+=Ji(n)*jc*Math.cos(io(this.latitude));break;case Nn.RADIAN:this.latitude+=Ji(t),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=Nn.MILE,r=Gr.SPHERICAL){if(r===Gr.MERCATOR&&(n===Nn.DEGREE||n===Nn.RADIAN)){const l=EN(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),f=io(Math.min(d,360-d)),p=Math.sqrt(Math.pow(l,2)+Math.pow(f,2));switch(n){case Nn.DEGREE:return Ji(p);case Nn.RADIAN:return p;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const l=CN(this,t);switch(n){case Nn.DEGREE:return Ji(l);case Nn.KILOMETER:return l*Vc;case Nn.MILE:return l*jc;case Nn.RADIAN:return l;default:throw new Error(`unit unhandled: ${String(n)}`)}}}equals(t){return t&&t.latitude===this.latitude&&t.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function hp(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var Sr=(e=>(e.UNDEFINED="undefined",e.NULL="object",e.BOOLEAN="boolean",e.NUMBER="number",e.BIGINT="bigint",e.STRING="string",e.SYMBOL="symbol",e.FUNCTION="function",e.OBJECT="object",e))(Sr||{});function kr(e,t){if(typeof t!="string")throw new Error("Assertion error: 'type' must be a string");if(typeof e!==t)throw new Error(`Expected an object of type '${t}' but received '${typeof e}'`)}function wr(e,t){let n;try{n=e instanceof t}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${t.name}' but received '${e.constructor.name}'`)}class gp{constructor(t,n){Ie(this,"providerMapClass");Ie(this,"wrapper");Ie(this,"controlEnabled");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"providerOptions");wr(t,ao),n&&wr(n,HTMLElement),this.providerMapClass=t.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(t){return this.controlEnabled=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProviderOptions(t){return this.providerOptions=t,this}build(){const t=this.providerMapClass;return new t(this)}}class rl{constructor(t){Ie(this,"_panHandler");Ie(this,"_panStartHandler");wr(t,gp),this._panHandler=t.panHandler,this._panStartHandler=t.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(t,n){throw new Error("not implemented")}setZoom(t,n){throw new Error("not implemented")}setZoomCenter(t,n,r){this.setZoom(t,r),this.setCenter(n,r)}}class pp{constructor(t){Ie(this,"providerPinClass");Ie(this,"clickHandler");Ie(this,"focusHandler");Ie(this,"hoverHandler");Ie(this,"icons");Ie(this,"hasPinUrl");wr(t,ao),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return kr(t,Sr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return kr(t,Sr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return kr(t,Sr.FUNCTION),this.hoverHandler=t,this}withIcons(t){return this.icons=t,this}withHasPinUrl(t){return this.hasPinUrl=t,this}build(){const t=this.providerPinClass;return new t(this)}}class fd{constructor(t){Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_icons");wr(t,pp),this._clickHandler=t.clickHandler,this._focusHandler=t.focusHandler,this._hoverHandler=t.hoverHandler,this._icons=t.icons}setCoordinate(t){throw new Error("not implemented")}setMap(t,n){throw new Error("not implemented")}setProperties(t){throw new Error("not implemented")}}const xN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class il extends fd{constructor(n){super(n);Ie(this,"_pinEl");Ie(this,"_pinAlt");Ie(this,"_wrapper");this._pinEl=n.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,il.baseStyle),this._pinAlt=document.createElement("span"),this._pinAlt.classList.add("sr-only"),this._pinEl.appendChild(this._pinAlt),this._wrapper=document.createElement("div"),this._wrapper.style.pointerEvents="none",this._wrapper.appendChild(this._pinEl),this.addListeners()}static get baseStyle(){return xN}addListeners(){this._wrapper&&(this._wrapper.addEventListener("click",()=>this._clickHandler()),this._wrapper.addEventListener("focusin",()=>this._focusHandler(!0)),this._wrapper.addEventListener("focusout",()=>this._focusHandler(!1)),this._wrapper.addEventListener("mouseover",()=>this._hoverHandler(!0)),this._wrapper.addEventListener("mouseout",()=>this._hoverHandler(!1)))}getPinElement(){return this._pinEl}getWrapperElement(){return this._wrapper}setProperties(n){this.setElementProperties(n);const r=n.getClass(),l=n.getElement()||this._pinEl,d=n.getZIndex();l.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),l!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(l)))}setElementProperties(n){const r=n.getAnchorX(),l=n.getAnchorY(),d=n.getHeight(),f=this._icons[n.getIcon()],p=n.getSRText(),_=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:f?`url("${f}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*l}%)`,width:_+"px"}),this._pinAlt.innerText=p}}class lo{constructor(){Ie(this,"loadFunction");Ie(this,"mapClass");Ie(this,"pinClass");Ie(this,"providerName");this.loadFunction=(t,n,r,l)=>t(),this.mapClass=rl,this.pinClass=fd,this.providerName=""}withLoadFunction(t){return kr(t,Sr.FUNCTION),this.loadFunction=t,this}withMapClass(t){return this.mapClass=t,this}withPinClass(t){return this.pinClass=t,this}withProviderName(t){return this.providerName=t,this}build(){return new ao(this)}}class ao{constructor(t){Ie(this,"_loadFunction");Ie(this,"_mapClass");Ie(this,"_pinClass");Ie(this,"_providerName");Ie(this,"_loadPromise");Ie(this,"_resolveLoad");Ie(this,"_rejectLoad");Ie(this,"_apiKey");Ie(this,"_loadInvoked");Ie(this,"_loaded");Ie(this,"_options");wr(t,lo),this._loadFunction=t.loadFunction,this._mapClass=t.mapClass,this._pinClass=t.pinClass,this._providerName=t.providerName,this._loadPromise=new Promise((n,r)=>{this._resolveLoad=n,this._rejectLoad=r}),this._apiKey="",this._loadInvoked=!1,this._loaded=!1,this._options={}}get loaded(){return this._loaded}getMapClass(){return this._mapClass}getPinClass(){return this._pinClass}getProviderName(){return this._providerName}async load(t=this._apiKey,n=this._options){!this._loadInvoked&&this._resolveLoad&&this._rejectLoad&&(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,t,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(t,n=null){this._loadInvoked||(this._apiKey=t,this._options=n||this._options)}}class vN extends rl{constructor(n){super(n);Ie(this,"map");Ie(this,"_moving");n.wrapper&&(this.map=new google.maps.Map(n.wrapper,{disableDefaultUI:!n.controlEnabled,fullscreenControl:!1,gestureHandling:n.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:n.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...n.providerOptions}),this._moving=!1,google.maps.event.addListener(this.map,"bounds_changed",()=>{this._moving||(this._moving=!0,this._panStartHandler())}),google.maps.event.addListener(this.map,"idle",()=>{this._moving=!1,this._panHandler()}))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d,f;const l=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(l):(f=this.map)==null||f.setCenter(l)}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(Math.floor(n))}setZoomCenter(n,r,l){this.setCenter(r,l),this.setZoom(n,l)}}class SN extends il{constructor(n){super(n);Ie(this,"_latLng");Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(f){super();Ie(this,"pin");this.pin=f}draw(){var p;const f=(p=this.getProjection())==null?void 0:p.fromLatLngToDivPixel(this.pin._latLng??null);f&&this.pin._wrapper&&(this.pin._wrapper.style.left=f.x+"px",this.pin._wrapper.style.top=f.y+"px")}onAdd(){var f;this.pin._wrapper&&((f=this.getPanes())==null||f.floatPane.appendChild(this.pin._wrapper))}onRemove(){var f,p;(p=(f=this.pin._wrapper)==null?void 0:f.parentNode)==null||p.removeChild(this.pin._wrapper)}}this.pin=new r(this)}setCoordinate(n){this._latLng=new google.maps.LatLng(n.latitude,n.longitude),this.pin.draw()}setMap(n,r){var d;const l=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(l??null)}}const Of="GoogleMapsCallback_b7d77ff2",wN="https://maps.googleapis.com/maps/api/js";function ON(e,t,n,{autocomplete:r=!1,channel:l=window.location.hostname,client:d,language:f,region:p,libraries:_=[],loading:T="async",params:E={}}={}){window[Of]=e,r&&_.push("geocoder","places");const S={callback:Of,channel:l,libraries:_.join(","),...E};n&&(S.key=n),d&&(S.client=d),f&&(S.language=f),p&&(S.region=p),T&&(S.loading=T),hp(wN+"?"+Object.entries(S).map(([w,M])=>w+"="+M).join("&"))}const mp=new lo().withLoadFunction(ON).withMapClass(vN).withPinClass(SN).withProviderName("Google").build();class no{constructor(t,n){Ie(this,"_ne");Ie(this,"_sw");this._ne=new dn(n),this._sw=new dn(t)}static fit(t){const n=t.map(T=>T.latitude),r=Math.max(...n),l=Math.min(...n),d=t.map(T=>T.normalLon).sort((T,E)=>T-E),f=d.map((T,E)=>({distance:(E<d.length-1?d[E+1]:d[0]+360)-T,index:E})).reduce((T,E)=>E.distance>T.distance?E:T).index,p=d[f],_=d[(f+1)%d.length];return new this(new dn(l,_),new dn(r,p))}get ne(){return this._ne}set ne(t){this._ne=new dn(t)}get sw(){return this._sw}set sw(t){this._sw=new dn(t)}contains(t){const n=this._sw.latitude<=t.latitude&&t.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,l=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=t.normalLon&&t.normalLon<=this._ne.normalLon:this._sw.normalLon<=t.normalLon||t.normalLon<=this._ne.normalLon;return n&&(r||l)}extend(t){if(this._ne.latitude=Math.max(this._ne.latitude,t.latitude),this._sw.latitude=Math.min(this._sw.latitude,t.latitude),!this.contains(t)){const n=((t.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-t.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(t=Gr.SPHERICAL){const n=new dn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,Nn.DEGREE,t),l=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,Nn.DEGREE,t),n.longitude=l,n}}class DN{constructor(){Ie(this,"_anchorX");Ie(this,"_anchorY");Ie(this,"_height");Ie(this,"_icon");Ie(this,"_srText");Ie(this,"_width");Ie(this,"_zIndex");Ie(this,"_class");Ie(this,"_element");this._anchorX=.5,this._anchorY=1,this._height=39,this._icon="default",this._srText="map pin",this._width=33,this._zIndex=0,this._class="",this._element=null}getAnchorX(){return this._anchorX}getAnchorY(){return this._anchorY}getClass(){return this._class}getElement(){return this._element}getHeight(){return this._height}getIcon(){return this._icon}getSRText(){return this._srText}getWidth(){return this._width}getZIndex(){return this._zIndex}setAnchorX(t){return this._anchorX=t,this}setAnchorY(t){return this._anchorY=t,this}setClass(t){return this._class=t,this}setElement(t){return this._element=t,this}setHeight(t){return this._height=t,this}setIcon(t){return this._icon=t,this}setSRText(t){return this._srText=t,this}setWidth(t){return this._width=t,this}setZIndex(t){return this._zIndex=t,this}}class hd{constructor(){Ie(this,"coordinate");Ie(this,"hideOffscreen");Ie(this,"icons");Ie(this,"propertiesForStatus");Ie(this,"provider");Ie(this,"type");Ie(this,"hasPinUrl");this.coordinate=new dn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new DN,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(t){return this.coordinate=new dn(t),this}withHideOffscreen(t){return this.hideOffscreen=t,this}withIcon(t,n){return this.icons[t]=n,this}withPropertiesForStatus(t){return kr(t,Sr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(wr(t,ao),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new AN(this)}}class AN{constructor(t){Ie(this,"_coordinate");Ie(this,"_hideOffscreen");Ie(this,"_icons");Ie(this,"_propertiesForStatus");Ie(this,"_type");Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_hidden");Ie(this,"_cancelHiddenUpdater");Ie(this,"_map");Ie(this,"_pin");Ie(this,"_status");var n,r;if(wr(t,hd),t.provider&&wr(t.provider,ao),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=t.coordinate,this._hideOffscreen=t.hideOffscreen,this._icons={...t.icons},this._propertiesForStatus=t.propertiesForStatus,this._type=t.type,this._clickHandler=()=>null,this._focusHandler=l=>this._hoverHandler(l),this._hoverHandler=l=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new pp(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(l=>this._focusHandler(l)).withHoverHandler(l=>this._hoverHandler(l)).withHasPinUrl(t.hasPinUrl).build(),this._pin.setCoordinate(t.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(t){return this._icons[t]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(t){kr(t,Sr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new dn(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){kr(t,Sr.FUNCTION),this._focusHandler=t}setHoverHandler(t){kr(t,Sr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&wr(t,yp),this._pin.setMap(t,this._hidden?null:this._map),this._map=t,this._hidden=!1,this._cancelHiddenUpdater(),t&&this._hideOffscreen)){let n=!1;const r=new Promise(l=>{this._cancelHiddenUpdater=()=>{n=!0,l()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,t.moving()]),await Promise.race([r,t.idle()])})()}}setStatus(t){Object.assign(this._status,t),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const t=this._map.getBounds().contains(this._coordinate);this._hidden&&t?this._pin.setMap(this._map,null):!this._hidden&&!t&&this._pin.setMap(null,this._map),this._hidden=!t}}}const _s=.98;function Va(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class _p{constructor(){Ie(this,"controlEnabled");Ie(this,"defaultCenter");Ie(this,"defaultZoom");Ie(this,"legendPins");Ie(this,"padding");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"provider");Ie(this,"providerOptions");Ie(this,"singlePinZoom");Ie(this,"wrapper");this.controlEnabled=!0,this.defaultCenter=new dn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(t,n)=>null,this.panStartHandler=t=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(t){return this.controlEnabled=t,this}withDefaultCenter(t){return this.defaultCenter=new dn(t),this}withDefaultZoom(t){return this.defaultZoom=t,this}withLegendPins(t){return this.legendPins=Array.from(t),this}withPadding(t){return this.padding=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return wr(t,ao),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(wr(t,HTMLElement),this.wrapper=t,this):this}build(){return new yp(this)}}let yp=class{constructor(t){Ie(this,"_defaultCenter");Ie(this,"_defaultZoom");Ie(this,"_legendPins");Ie(this,"_padding");Ie(this,"_provider");Ie(this,"_singlePinZoom");Ie(this,"_wrapper");Ie(this,"_cachedBounds");Ie(this,"_resolveIdle");Ie(this,"_resolveMoving");Ie(this,"_idlePromise");Ie(this,"_panHandlerRunning");Ie(this,"_panStartHandlerRunning");Ie(this,"_currentBounds");Ie(this,"_movingPromise");Ie(this,"_panHandler");Ie(this,"_panStartHandler");Ie(this,"_map");var n,r,l;if(wr(t,_p),t.provider&&wr(t.provider,ao),t.wrapper&&wr(t.wrapper,HTMLElement),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=t.defaultCenter,this._defaultZoom=t.defaultZoom,this._legendPins=t.legendPins,this._provider=t.provider,this._singlePinZoom=t.singlePinZoom,this._wrapper=t.wrapper,this._padding={},this.setPadding(t.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(t.panHandler),this.setPanStartHandler(t.panStartHandler);(l=this._wrapper)!=null&&l.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new gp(t.provider,this._wrapper).withControlEnabled(t.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(t.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(t,n=!1,r=this._singlePinZoom){t.length?this.setBounds(no.fit(t),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){var t,n;if(!this._cachedBounds){const r=((t=this._wrapper)==null?void 0:t.offsetHeight)??0,l=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),f=this.getCenter(),p=360/Math.pow(2,d+8),_=l*p,T=r*p;this._cachedBounds=new no(f,f),this._cachedBounds.ne.add(T/2,_/2,Nn.DEGREE,Gr.MERCATOR),this._cachedBounds.sw.add(-T/2,-_/2,Nn.DEGREE,Gr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new no(this._cachedBounds.sw,this._cachedBounds.ne)}getCenter(){return this._map.getCenter()}getProviderMap(){return this._map}getZoom(){return this._map.getZoom()}async idle(){await this._idlePromise}async moving(){await this._movingPromise}newPinOptions(){return new hd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new no(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler&&this._panStartHandler(new no(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,l={},d=1/0){var z,q;const f=(z=this._wrapper)==null?void 0:z.offsetHeight,p=(q=this._wrapper)==null?void 0:q.offsetWidth;if(!f||!p)return;let _=Va(l.bottom,f),T=Va(l.left,p),E=Va(l.right,p),S=Va(l.top,f),w=T+E,M=_+S;w>_s&&(T*=_s/w,E*=_s/w,w=_s),M>_s&&(_*=_s/M,S*=_s/M,M=_s);const m=f*(1-M),v=p*(1-w),k=new no(n,t),G=new dn(k.ne.latitude,k.sw.longitude),I=k.sw.distanceTo(G,Nn.DEGREE,Gr.MERCATOR),P=(k.ne.longitude-G.longitude+360)%360;let H=Math.max(I,P*m/v)/(1-M),j=Math.max(P,I*v/m)/(1-w),re=Math.log2(p*360/j)-8;re>d&&(re=d,j=p*360/2**(re+8),H=j*f/p);const te=k.getCenter(Gr.MERCATOR),ce=(S-_)/2*H,V=(E-T)/2*j;te.add(ce,V,Nn.DEGREE,Gr.MERCATOR),this.setZoomCenter(re,te,r)}setCenter(t,n=!1){this._map.setCenter(new dn(t),n)}setPadding({bottom:t=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:l=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:l},this}setPanHandler(t){kr(t,Sr.FUNCTION),this._panHandler=t}setPanStartHandler(t){kr(t,Sr.FUNCTION),this._panStartHandler=t}setZoom(t,n=!1){this._map.setZoom(t,n)}setZoomCenter(t,n,r=!1){this._map.setZoomCenter(t,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(t=>this._resolveMoving=t),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(t=>this._resolveIdle=t),this._resolveMoving()}};const _c=nt.createContext(null);function MN(){const e=nt.useContext(_c);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Np=({apiKey:e,bounds:t,children:n,className:r,clientKey:l,controls:d=!0,defaultCenter:f={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:_,padding:T={bottom:50,left:50,right:50,top:50},panHandler:E=()=>null,panStartHandler:S=()=>null,provider:w=mp,providerOptions:M={},singleZoom:m=14})=>{const v=nt.useRef(null),[k,G]=nt.useState(new dn(f)),[I,P]=nt.useState(!1),[H,j]=nt.useState(),[re,te]=nt.useState(p),ce=(V,z)=>{E(V,z),z&&G(z.getCenter())};return nt.useEffect(()=>{!I||!H||te(H.getZoom())},[k]),nt.useEffect(()=>{if(!t||!I||!H)return;const V=t.map(z=>new dn(z));H.fitCoordinates(V)},[JSON.stringify(t),H]),nt.useEffect(()=>{if(!I||H)return;const V=new _p().withControlEnabled(d).withDefaultCenter(k).withDefaultZoom(re).withPadding(T).withPanHandler(ce).withPanStartHandler(S).withProvider(w).withProviderOptions(M).withSinglePinZoom(m).withWrapper(v.current).build();j(V),_&&(_.current=V)},[I]),nt.useEffect(()=>{I||H||!v.current||w.load(e,{...M,...l&&{client:l}}).then(()=>P(!0))},[]),at.jsx("div",{className:Qo({"is-loaded":I},r),id:"map",ref:v,"data-testid":"map",children:H&&at.jsx(_c.Provider,{value:{map:H,provider:w},children:n})})},RN=({count:e})=>at.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:at.jsxs("g",{fill:"none",fillRule:"evenodd",children:[at.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),at.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:at.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),gd=nt.createContext(null);function bN(){const e=nt.useContext(gd);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const LN=({clusterRadius:e=50,children:t,ClusterTemplate:n=RN})=>{const{map:r}=nt.useContext(_c),[l,d]=nt.useState([]),[f,p]=nt.useState(),[_,T]=nt.useState([]),[E,S]=nt.useState([]);return nt.useEffect(()=>{p(IN(l,r.getZoom(),e))},[l,r.getZoom()]),nt.useEffect(()=>{S(()=>[]),T(()=>[]),(f==null?void 0:f.length)!==0&&(f==null||f.forEach(w=>{if(w.length===1){w[0].pin.setMap(r);return}if(w.length>1){const M=no.fit(w.map(v=>v.pin.getCoordinate())).getCenter(Gr.MERCATOR),m=`cluster-{${M._lat},${M._lon}}`;w.forEach(v=>v.pin.setMap(null)),T(v=>[...v,m]),S(v=>[...v,at.jsx(pd,{coordinate:M,id:m,onClick:()=>r.fitCoordinates(w.map(k=>k.pin.getCoordinate()),!0,1/0),children:at.jsx(n,{count:w.length})},m)])}}))},[f]),at.jsx(gd.Provider,{value:{clusters:f??[],clusterIds:_,setPinStore:d},children:at.jsxs(at.Fragment,{children:[E.map((w,M)=>at.jsx(nt.Fragment,{children:w},M)),t]})})},IN=(e,t,n)=>{const r=n*Math.PI/2**(t+7),l=e.map((p,_)=>[_]),d=[];e.forEach((p,_)=>{for(let T=_;T<e.length;T++)T!==_&&new dn(p.pin.getCoordinate()).distanceTo(new dn(e[T].pin.getCoordinate()),Nn.RADIAN,Gr.MERCATOR)<=r&&(l[_].push(T),l[T].push(_))});let f=1;for(;f;){f=0;let p;if(l.forEach((E,S)=>{E.length>f&&(f=E.length,p=S)}),!f)break;const _=l[p??0],T=[];l[p??0]=[];for(const E of _){const S=l[E];T.push(e[E]),l[E]=[],S.forEach(w=>l[w].splice(l[w].indexOf(E),1))}d.push(T)}return d},kN=at.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),pd=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:l=kN,onClick:d=()=>null,onFocus:f=()=>null,onHover:p=()=>null,zIndex:_,hasPinUrl:T=!1})=>{const{map:E,provider:S}=nt.useContext(_c),w=nt.useContext(gd),M=nt.useMemo(()=>new hd().withCoordinate(t).withHideOffscreen(n).withProvider(S).withHasPinUrl(T).build(),[]);nt.useEffect(()=>{if(_!==0&&!_)return;const v=M.getProviderPin().getWrapperElement();v&&(v.style.zIndex=_.toString())},[_]),nt.useEffect(()=>{M.setMap(E),M.setClickHandler(()=>d(r)),M.setFocusHandler(k=>f(k,r)),M.setHoverHandler(k=>p(k,r));const v=w==null?void 0:w.clusterIds.includes(r);return w&&!v&&w.setPinStore(k=>[...k,{pin:M,id:r}]),()=>{M.setMap(null),w&&w.setPinStore(k=>k.filter(G=>G.id!==r))}},[]);const m=e||l;if(m){const v=M.getProviderPin().getPinElement();return Object.assign(v.style,{height:"auto",width:"auto"}),ld.createPortal(m,v)}return null},PN=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:l=()=>null,onHover:d=()=>null,onFocus:f=()=>null,...p})=>{var _;return at.jsx(Np,{bounds:[t],...p,children:at.jsx(pd,{coordinate:t,id:"location-map-marker",onClick:l,onHover:d,onFocus:f,hasPinUrl:((_=r||"")==null?void 0:_.length)>0,children:r?at.jsx(fp,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var qc={},Vl={},Df;function $N(){if(Df)return Vl;Df=1;var e=nt;const t=e.createContext(null);function n(l,d){let f=null;l!=null&&(f=l[1]);function p(){return d??(f!=null?f.getTheme():null)}return{getTheme:p}}function r(){const l=e.useContext(t);if(l==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return l}return Vl.LexicalComposerContext=t,Vl.createLexicalComposerContext=n,Vl.useLexicalComposerContext=r,Vl}var ql={},Af;function FN(){if(Af)return ql;Af=1;var e=nt;function t(r){let l=new URLSearchParams;l.append("code",r);for(let d=1;d<arguments.length;d++)l.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${l} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return ql.LexicalComposerContext=n,ql.createLexicalComposerContext=function(r,l){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return l??(d!=null?d.getTheme():null)}}},ql.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},ql}var Zc,Mf;function qn(){return Mf||(Mf=1,Zc=process.env.NODE_ENV==="development"?$N():FN()),Zc}var He={},Rf;function BN(){if(Rf)return He;Rf=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),l=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),f=e("INSERT_PARAGRAPH_COMMAND"),p=e("CONTROLLED_TEXT_INSERTION_COMMAND"),_=e("PASTE_COMMAND"),T=e("REMOVE_TEXT_COMMAND"),E=e("DELETE_WORD_COMMAND"),S=e("DELETE_LINE_COMMAND"),w=e("FORMAT_TEXT_COMMAND"),M=e("UNDO_COMMAND"),m=e("REDO_COMMAND"),v=e("KEYDOWN_COMMAND"),k=e("KEY_ARROW_RIGHT_COMMAND"),G=e("MOVE_TO_END"),I=e("KEY_ARROW_LEFT_COMMAND"),P=e("MOVE_TO_START"),H=e("KEY_ARROW_UP_COMMAND"),j=e("KEY_ARROW_DOWN_COMMAND"),re=e("KEY_ENTER_COMMAND"),te=e("KEY_SPACE_COMMAND"),ce=e("KEY_BACKSPACE_COMMAND"),V=e("KEY_ESCAPE_COMMAND"),z=e("KEY_DELETE_COMMAND"),q=e("KEY_TAB_COMMAND"),Te=e("INSERT_TAB_COMMAND"),Se=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),de=e("DROP_COMMAND"),K=e("FORMAT_ELEMENT_COMMAND"),O=e("DRAGSTART_COMMAND"),Z=e("DRAGOVER_COMMAND"),oe=e("DRAGEND_COMMAND"),Y=e("COPY_COMMAND"),W=e("CUT_COMMAND"),J=e("SELECT_ALL_COMMAND"),R=e("CLEAR_EDITOR_COMMAND"),U=e("CLEAR_HISTORY_COMMAND"),X=e("CAN_REDO_COMMAND"),fe=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),B=e("BLUR_COMMAND"),A=e("KEY_MODIFIER_COMMAND"),F=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=F&&"documentMode"in document?document.documentMode:null,ye=F&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),De=F&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=F&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,ne=F&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ue=F&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=F&&/Android/.test(navigator.userAgent),Ne=F&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=F&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,ke=1,Fe=3,qe=0,Be=1,ut=2,At=0,Ut=1,en=2,Oe=1,ie=2,le=4,ve=8,Le=16,Me=32,je=64,rt=128,it=Oe|ie|le|ve|Le|Me|je|rt,st=1,vt=2,Ge=1,ze=2,tt=3,yt=4,Nt=5,Et=6,gt=" ",mt=ne||ue||Re?gt:"",$t=`
|
|
37
37
|
|
|
38
|
-
`,Kt=De?gt:mt,tn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Vt=new RegExp("^[^"+It+"]*["+tn+"]"),bt=new RegExp("^[^"+tn+"]*["+It+"]"),nn={bold:Oe,code:Le,highlight:rt,italic:ie,strikethrough:le,subscript:Me,superscript:Ve,underline:ve},Or={directionless:st,unmergeable:vt},_i={center:ze,end:Et,justify:yt,left:Ge,right:tt,start:Nt},pe={[ze]:"center",[Et]:"end",[yt]:"justify",[Ge]:"left",[tt]:"right",[Nt]:"start"},Ze={normal:At,segmented:en,token:Ut},ot={[At]:"normal",[en]:"segmented",[Ut]:"token"},St=100;let Gt=!1,Bt=0;function Pt(){return Gt}function kt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&No(u).addEventListener("textInput",kt,!0)}function sn(u,s,c){return s.__lexicalLineBreak===u||u[`__lexicalKey_${c._key}`]!==void 0}function an(u){return u.getEditorState().read(()=>{const s=_n();return s!==null?s.clone():null})}function bn(u,s,c){const h=ar(c._window);let y=null,N=null;h!==null&&h.anchorNode===u&&(y=h.anchorOffset,N=h.focusOffset);const b=u.nodeValue;b!==null&&$r(s,b,y,N,!1)}function yr(u,s,c){if(Tt(u)){const h=u.anchor.getNode();if(h.is(c)&&u.format!==h.getFormat())return!1}return s.nodeType===Fe&&c.isAttached()}function Zn(u,s,c){Gt=!0;const h=performance.now()-Bt>St;try{zr(u,()=>{const y=_n()||an(u),N=new Map,b=u.getRootElement(),$=u._editorState,ae=u._blockCursorElement;let he=!1,me="";for(let we=0;we<s.length;we++){const Ce=s[we],je=Ce.type,Ue=Ce.target;let $e=ii(Ue,$);if(!($e===null&&Ue!==b||An($e))){if(je==="characterData")h&&_t($e)&&yr(y,Ue,$e)&&bn(Ue,$e,u);else if(je==="childList"){he=!0;const Rt=Ce.addedNodes;for(let qt=0;qt<Rt.length;qt++){const Wt=Rt[qt],Dt=ho(Wt),cn=Wt.parentNode;if(cn!=null&&Wt!==ae&&Dt===null&&(Wt.nodeName!=="BR"||!sn(Wt,cn,u))){if(De){const ir=Wt.innerText||Wt.nodeValue;ir&&(me+=ir)}cn.removeChild(Wt)}}const Qe=Ce.removedNodes,ht=Qe.length;if(ht>0){let qt=0;for(let Wt=0;Wt<ht;Wt++){const Dt=Qe[Wt];(Dt.nodeName==="BR"&&sn(Dt,Ue,u)||ae===Dt)&&(Ue.appendChild(Dt),qt++)}ht!==qt&&(Ue===b&&($e=ml($)),N.set(Ue,$e))}}}}if(N.size>0)for(const[we,Ce]of N)if(et(Ce)){const je=Ce.getChildrenKeys();let Ue=we.firstChild;for(let $e=0;$e<je.length;$e++){const Rt=je[$e],Qe=u.getElementByKey(Rt);Qe!==null&&(Ue==null?(we.appendChild(Qe),Ue=Qe):Ue!==Qe&&we.replaceChild(Qe,Ue),Ue=Ue.nextSibling)}}else _t(Ce)&&Ce.markDirty();const xe=c.takeRecords();if(xe.length>0){for(let we=0;we<xe.length;we++){const Ce=xe[we],je=Ce.addedNodes,Ue=Ce.target;for(let $e=0;$e<je.length;$e++){const Rt=je[$e],Qe=Rt.parentNode;Qe!=null&&Rt.nodeName==="BR"&&!sn(Rt,Ue,u)&&Qe.removeChild(Rt)}}c.takeRecords()}y!==null&&(he&&(y.dirty=!0,Cr(y)),De&&Ol(u)&&y.insertRawText(me))})}finally{Gt=!1}}function fn(u){const s=u._observer;if(s!==null){const c=s.takeRecords();Zn(u,c,s)}}function sr(u){Ht(u),u._observer=new MutationObserver((s,c)=>{Zn(u,s,c)})}function or(u,s){const c=u.__mode,h=u.__format,y=u.__style,N=s.__mode,b=s.__format,$=s.__style;return(c===null||c===N)&&(h===null||h===b)&&(y===null||y===$)}function Mi(u,s){const c=u.mergeWithSibling(s),h=xn()._normalizedNodes;return h.add(u.__key),h.add(s.__key),c}function Nr(u){let s=u;if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable()){s.remove();return}let c;for(;(c=s.getPreviousSibling())!==null&&_t(c)&&c.isSimpleText()&&!c.isUnmergeable();)if(c.__text==="")c.remove();else if(or(c,s)){s=Mi(c,s);break}else break;let h;for(;(h=s.getNextSibling())!==null&&_t(h)&&h.isSimpleText()&&!h.isUnmergeable();)if(h.__text==="")h.remove();else if(or(s,h)){s=Mi(s,h);break}else break}function Os(u){return uo(u.anchor),uo(u.focus),u}function uo(u){for(;u.type==="element";){const s=u.getNode(),c=u.offset;let h,y;if(c===s.getChildrenSize()?(h=s.getChildAtIndex(c-1),y=!0):(h=s.getChildAtIndex(c),y=!1),_t(h)){u.set(h.__key,y?h.getTextContentSize():0,"text");break}else if(!et(h))break;u.set(h.__key,y?h.getChildrenSize():0,"element")}}let dl=1;function Vr(){return""+dl++}function pa(u,s){const c=u._nodes.get(s);if(c===void 0)throw Error(`registeredNode: Type ${s} not found`);return c}const fo=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function is(u){return An(ii(u))}function Ds(u){const s=document.activeElement;if(s===null)return!1;const c=s.nodeName;return An(ii(u))&&(c==="INPUT"||c==="TEXTAREA"||s.contentEditable==="true"&&s.__lexicalEditor==null)}function ss(u,s,c){const h=u.getRootElement();try{return h!==null&&h.contains(s)&&h.contains(c)&&s!==null&&!Ds(s)&&fl(s)===u}catch{return!1}}function fl(u){let s=u;for(;s!=null;){const c=s.__lexicalEditor;if(c!=null)return c;s=yo(s)}return null}function Ln(u){return Vt.test(u)?"rtl":bt.test(u)?"ltr":null}function zn(u){return u.isToken()||u.isSegmented()}function ri(u){return u.nodeType===Fe}function Pr(u){let s=u;for(;s!=null;){if(ri(s))return s;s=s.firstChild}return null}function Bn(u,s,c){const h=nn[s];if(c!==null&&(u&h)===(c&h))return u;let y=u^h;return s==="subscript"?y&=-65:s==="superscript"&&(y&=-33),y}function As(u){return _t(u)||ai(u)||An(u)}function hl(u,s){if(s!=null){u.__key=s;return}fr(),Jd();const c=xn(),h=xi(),y=Vr();h._nodeMap.set(y,u),et(u)?c._dirtyElements.set(y,!0):c._dirtyLeaves.add(y),c._cloneNotNeeded.add(y),c._dirtyType=Be,u.__key=y}function gl(u,s,c){let h=u;for(;h!==null;){if(c.has(h))return;const y=s.get(h);if(y===void 0)break;c.set(h,!1),h=y.__parent}}function jr(u){const s=u.getParent();if(s!==null){const c=u.getWritable(),h=s.getWritable(),y=u.getPreviousSibling(),N=u.getNextSibling();if(y===null)if(N!==null){const b=N.getWritable();h.__first=N.__key,b.__prev=null}else h.__first=null;else{const b=y.getWritable();if(N!==null){const $=N.getWritable();$.__prev=b.__key,b.__next=$.__key}else b.__next=null;c.__prev=null}if(N===null)if(y!==null){const b=y.getWritable();h.__last=y.__key,b.__next=null}else h.__last=null;else{const b=N.getWritable();if(y!==null){const $=y.getWritable();$.__next=b.__key,b.__prev=$.__key}else b.__prev=null;c.__next=null}h.__size--,c.__parent=null}}function Ri(u){Jd();const s=u.getLatest(),c=s.__parent,h=xi(),y=xn(),N=h._nodeMap,b=y._dirtyElements;c!==null&&gl(c,N,b);const $=s.__key;y._dirtyType=Be,et(u)?b.set($,!0):y._dirtyLeaves.add($)}function pl(u){const s=u.getPreviousSibling(),c=u.getNextSibling();s!==null&&Ri(s),c!==null&&Ri(c)}function vn(u){fr();const s=xn(),c=s._compositionKey;if(u!==c){if(s._compositionKey=u,c!==null){const h=Cn(c);h!==null&&h.getWritable()}if(u!==null){const h=Cn(u);h!==null&&h.getWritable()}}}function lr(){return Fo()?null:xn()._compositionKey}function Cn(u,s){const h=(s||xi())._nodeMap.get(u);return h===void 0?null:h}function ho(u,s){const c=xn(),h=u[`__lexicalKey_${c._key}`];return h!==void 0?Cn(h,s):null}function ii(u,s){let c=u;for(;c!=null;){const h=ho(c,s);if(h!==null)return h;c=yo(c)}return null}function Ms(u){const s=u._decorators,c=Object.assign({},s);return u._pendingDecorators=c,c}function go(u){return u.read(()=>tr().getTextContent())}function bi(u,s){zr(u,()=>{const c=xi();if(c.isEmpty())return;if(s==="root"){tr().markDirty();return}const h=c._nodeMap;for(const[,y]of h)y.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function tr(){return ml(xi())}function ml(u){return u._nodeMap.get("root")}function Cr(u){fr();const s=xi();if(u!==null){if(Object.isFrozen(u))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");u.dirty=!0,u.setCachedNodes(null)}s._selection=u}function _l(){fr();const u=xn();fn(u)}function Li(u){const s=xn(),c=ma(u,s);if(c===null){const h=s.getRootElement();return u===h?Cn("root"):null}return Cn(c)}function yl(u,s){return s?u.getTextContentSize():0}function ma(u,s){let c=u;for(;c!=null;){const h=c[`__lexicalKey_${s._key}`];if(h!==void 0)return h;c=yo(c)}return null}function Rs(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Ii(u){const s=[];let c=u;for(;c!==null;)s.push(c),c=c._parentEditor;return s}function Nl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function po(u){return u.nodeType===Fe?u.nodeValue:null}function bs(u,s,c){const h=ar(s._window);if(h===null)return;const y=h.anchorNode;let{anchorOffset:N,focusOffset:b}=h;if(y!==null){let $=po(y);const ae=ii(y);if($!==null&&_t(ae)){if($===mt&&c){const he=c.length;$=c,N=he,b=he}$!==null&&$r(ae,$,N,b,u)}}}function $r(u,s,c,h,y){let N=u;if(N.isAttached()&&(y||!N.isDirty())){const b=N.isComposing();let $=s;(b||y)&&s[s.length-1]===mt&&($=s.slice(0,-1));const ae=N.getTextContent();if(y||$!==ae){if($===""){if(vn(null),!ne&&!ue&&!Re){const Ue=xn();setTimeout(()=>{Ue.update(()=>{N.isAttached()&&N.remove()})},20)}else N.remove();return}const he=N.getParent(),me=$o(),xe=N.getTextContentSize(),we=lr(),Ce=N.getKey();if(N.isToken()||we!==null&&Ce===we&&!b||Tt(me)&&(he!==null&&!he.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!N.canInsertTextBefore()&&!b||me.focus.key===u.__key&&me.focus.offset===xe&&!N.canInsertTextAfter()&&!b)){N.markDirty();return}const je=_n();if(!Tt(je)||c===null||h===null){N.setTextContent($);return}if(je.setTextNodeRange(N,c,N,h),N.isSegmented()){const Ue=N.getTextContent(),$e=Dn(Ue);N.replace($e),N=$e}N.setTextContent($)}}}function Cl(u){const s=u.getPreviousSibling();return(_t(s)||et(s)&&s.isInline())&&!s.canInsertTextAfter()}function Ls(u,s){if(s.isSegmented())return!0;if(!u.isCollapsed())return!1;const c=u.anchor.offset,h=s.getParentOrThrow(),y=s.isToken();return c===0?!s.canInsertTextBefore()||!h.canInsertTextBefore()||y||Cl(s):c===s.getTextContentSize()?!s.canInsertTextAfter()||!h.canInsertTextAfter()||y:!1}function _a(u,s,c,h){return u===9&&!s&&!c&&!h}function ya(u,s,c,h){return u===66&&!s&&qr(c,h)}function os(u,s,c,h){return u===73&&!s&&qr(c,h)}function Is(u,s,c,h){return u===85&&!s&&qr(c,h)}function El(u,s){return Da(u)&&!s}function Tl(u,s){return Da(u)&&s}function ks(u,s){return ye&&s&&u===79}function Ps(u,s,c){return Zr(u)&&(ye?s:c)}function Na(u,s,c){return Pi(u)&&(ye?s:c)}function Ca(u,s){return ye&&s&&Zr(u)}function Ea(u,s){return ye&&s&&Pi(u)}function Ta(u,s,c,h){return ye?s||c?!1:Zr(u)||u===72&&h:h||s||c?!1:Zr(u)}function Dc(u,s,c,h,y){return ye?c||h||y?!1:Pi(u)||u===68&&s:s||h||y?!1:Pi(u)}function Ac(u,s,c,h){return u===90&&!s&&qr(c,h)}function xa(u,s,c,h){return ye?u===90&&c&&s:u===89&&h||u===90&&h&&s}function Mc(u,s,c,h){return s?!1:u===67?ye?c:h:!1}function Rc(u,s,c,h){return s?!1:u===88?ye?c:h:!1}function va(u){return u===37}function Sa(u){return u===39}function xl(u){return u===38}function bc(u){return u===40}function Lc(u,s,c,h){return va(u)&&!s&&!h&&!c}function wa(u,s,c,h,y){return va(u)&&!h&&!c&&(s||y)}function ls(u,s,c,h){return Sa(u)&&!s&&!h&&!c}function Oa(u,s,c,h,y){return Sa(u)&&!h&&!c&&(s||y)}function Ic(u,s,c){return xl(u)&&!s&&!c}function vl(u,s,c){return bc(u)&&!s&&!c}function $s(u,s,c,h){return u||s||c||h}function kc(u){return u===32}function qr(u,s){return ye?u:s}function Da(u){return u===13}function Zr(u){return u===8}function ki(u){return u===27}function Pi(u){return u===46}function mo(u,s,c){return u===65&&qr(s,c)}function Sl(){const u=tr(),s=u.select(0,u.getChildrenSize());Cr(Os(s))}function $i(u,s){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const c=u.__lexicalClassNameCache,h=c[s];if(h!==void 0)return h;const y=u[s];if(typeof y=="string"){const N=y.split(" ");return c[s]=N,N}return y}function as(u,s,c,h,y){if(c.size===0)return;const N=h.__type,b=h.__key,$=s.get(N);if($===void 0)throw Error(`Type ${N} not in registeredNodes`);const ae=$.klass;let he=u.get(ae);he===void 0&&(he=new Map,u.set(ae,he));const me=he.get(b),xe=me==="destroyed"&&y==="created";(me===void 0||xe)&&he.set(b,xe?"updated":y)}function Fi(u){const s=xi(),c=s._readOnly,h=u.getType(),y=s._nodeMap,N=[];for(const[,b]of y)b instanceof u&&b.__type===h&&(c||b.isAttached())&&N.push(b);return N}function Aa(u,s,c){const h=u.getParent();let y=c,N=u;return h!==null&&(s&&c===0?(y=N.getIndexWithinParent(),N=h):!s&&c===N.getChildrenSize()&&(y=N.getIndexWithinParent()+1,N=h)),N.getChildAtIndex(s?y-1:y)}function wl(u,s){const c=u.offset;if(u.type==="element"){const h=u.getNode();return Aa(h,s,c)}else{const h=u.getNode();if(s&&c===0||!s&&c===h.getTextContentSize()){const y=s?h.getPreviousSibling():h.getNextSibling();return y===null?Aa(h.getParentOrThrow(),s,h.getIndexWithinParent()+(s?0:1)):y}}return null}function Ol(u){const s=No(u).event,c=s&&s.inputType;return c==="insertFromPaste"||c==="insertFromPasteAsQuotation"}function ut(u,s,c){return nf(u,s,c)}function _o(u){return!Ur(u)&&!u.isLastChild()&&!u.isInline()}function Fs(u,s){const c=u._keyToDOMMap.get(s);if(c===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${s}`);return c}function yo(u){const s=u.assignedSlot||u.parentElement;return s!==null&&s.nodeType===11?s.host:s}function yi(u,s,c){const h=c.ownerDocument,y=h.defaultView;if(y===null)return;let{top:N,bottom:b}=s,$=0,ae=0,he=c;for(;he!==null;){const me=he===h.body;if(me)$=0,ae=No(u).innerHeight;else{const we=he.getBoundingClientRect();$=we.top,ae=we.bottom}let xe=0;if(N<$?xe=-($-N):b>ae&&(xe=b-ae),xe!==0)if(me)y.scrollBy(0,xe);else{const we=he.scrollTop;he.scrollTop+=xe;const Ce=he.scrollTop-we;N-=Ce,b-=Ce}if(me)break;he=yo(he)}}function Un(u){return xn()._updateTags.has(u)}function Ct(u){fr(),xn()._updateTags.add(u)}function cs(u){const s=_n();if(!Tt(s)||!et(u))return s;const{anchor:c,focus:h}=s,y=c.getNode(),N=h.getNode();return Bi(y,u)&&c.set(u.__key,0,"element"),Bi(N,u)&&h.set(u.__key,0,"element"),s}function Bi(u,s){let c=u.getParent();for(;c!==null;){if(c.is(s))return!0;c=c.getParent()}return!1}function Ma(u){const s=u.ownerDocument;return s&&s.defaultView||null}function No(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function Fr(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function Co(u){let s=u.getParentOrThrow();for(;s!==null;){if(si(s))return s;s=s.getParentOrThrow()}return s}function si(u){return Ur(u)||et(u)&&u.isShadowRoot()}function Dl(u){const s=u.constructor.clone(u);return hl(s,null),s}function Dr(u){const s=xn(),c=u.constructor.getType(),h=s._nodes.get(c);if(h===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const y=h.replace;if(y!==null){const N=y(u);if(!(N instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return N}return u}function Bs(u,s){const c=u.getParent();if(Ur(c)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Eo(u){const s=u.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let h=s.blockCursor;if(h!==void 0){if(typeof h=="string"){const y=h.split(" ");h=s.blockCursor=y}h!==void 0&&c.classList.add(...h)}return c}function Mt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function Hs(u,s,c){c.style.removeProperty("caret-color"),s._blockCursorElement=null;const h=u.parentElement;h!==null&&h.removeChild(u)}function Ni(u,s,c){let h=u._blockCursorElement;if(Tt(c)&&c.isCollapsed()&&c.anchor.type==="element"&&s.contains(document.activeElement)){const y=c.anchor,N=y.getNode(),b=y.offset,$=N.getChildrenSize();let ae=!1,he=null;if(b===$){const me=N.getChildAtIndex(b-1);Mt(me)&&(ae=!0)}else{const me=N.getChildAtIndex(b);if(Mt(me)){const xe=me.getPreviousSibling();(xe===null||Mt(xe))&&(ae=!0,he=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(N.__key);h===null&&(u._blockCursorElement=h=Eo(u._config)),s.style.caretColor="transparent",he===null?me.appendChild(h):me.insertBefore(h,he);return}}h!==null&&Hs(h,u,s)}function ar(u){return F?(u||window).getSelection():null}function Ra(u,s){let c=u.getChildAtIndex(s);if(c==null&&(c=u),si(u))throw Error("Can not call $splitNode() on root element");const h=b=>{const $=b.getParentOrThrow(),ae=si($),he=b===c&&!ae?b:Dl(b);if(ae){if(!(et(b)&&et(he)))throw Error("Children of a root must be ElementNode");return b.insertAfter(he),[b,he,he]}else{const[me,xe,we]=h($),Ce=b.getNextSiblings();return we.append(he,...Ce),[me,xe,he]}},[y,N]=h(c);return[y,N]}function To(u,s){let c=u;for(;c!==tr()&&c!=null;){if(s(c))return c;c=c.getParent()}return null}function ba(u){return Ws(u)&&u.tagName==="A"}function Ws(u){return u.nodeType===1}function Hi(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||si(u))return!1;const s=u.getFirstChild(),c=s===null||ai(s)||_t(s)||s.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&c}function xo(u,s){let c=u;for(;c!==null&&c.getParent()!==null&&!s(c);)c=c.getParentOrThrow();return s(c)?c:null}function La(u,s){const c=u._decorators;let y=u._pendingDecorators||c;const N=s._nodeMap;let b;for(b in y)N.has(b)||(y===c&&(y=Ms(u)),delete y[b])}function Al(u,s,c,h,y,N){let b=u.getFirstChild();for(;b!==null;){const $=b.__key;b.__parent===s&&(et(b)&&Al(b,$,c,h,y,N),c.has($)||N.delete($),y.push($)),b=b.getNextSibling()}}function Ml(u,s,c,h){const y=u._nodeMap,N=s._nodeMap,b=[];for(const[$]of h){const ae=N.get($);ae!==void 0&&(ae.isAttached()||(et(ae)&&Al(ae,$,y,N,b,h),y.has($)||h.delete($),b.push($)))}for(const $ of b)N.delete($);for(const $ of c){const ae=N.get($);ae!==void 0&&!ae.isAttached()&&(y.has($)||c.delete($),N.delete($))}}let In="",Gn="",jt="",Er,Hn,us,Ia=!1,ds=!1,Ks,zs=null,Us,Rl,Wi,gn,On,Wn;function fs(u,s){const c=Wi.get(u);if(s!==null){const h=wo(u);h.parentNode===s&&s.removeChild(h)}if(gn.has(u)||Hn._keyToDOMMap.delete(u),et(c)){const h=Ei(c,Wi);Ki(h,0,h.length-1,null)}c!==void 0&&as(Wn,us,Ks,c,"destroyed")}function Ki(u,s,c,h){let y=s;for(;y<=c;++y){const N=u[y];N!==void 0&&fs(N,h)}}function Ci(u,s){u.setProperty("text-align",s)}const hs="40px";function Jn(u,s){const c=Er.theme.indent;if(typeof c=="string"){const y=u.classList.contains(c);s>0&&!y?u.classList.add(c):s<1&&y&&u.classList.remove(c)}const h=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||hs;u.style.setProperty("padding-inline-start",s===0?"":`calc(${s} * ${h})`)}function Br(u,s){const c=u.style;s===0?Ci(c,""):s===Ge?Ci(c,"left"):s===ze?Ci(c,"center"):s===tt?Ci(c,"right"):s===yt?Ci(c,"justify"):s===Nt?Ci(c,"start"):s===Et&&Ci(c,"end")}function hn(u,s,c){const h=gn.get(u);if(h===void 0)throw Error("createNode: node does not exist in nodeMap");const y=h.createDOM(Er,Hn);if(Je(u,y,Hn),_t(h)?y.setAttribute("data-lexical-text","true"):An(h)&&y.setAttribute("data-lexical-decorator","true"),et(h)){const N=h.__indent,b=h.__size;if(N!==0&&Jn(y,N),b!==0){const ae=b-1,he=Ei(h,gn);ka(he,ae,h,y)}const $=h.__format;$!==0&&Br(y,$),h.isInline()||vo(null,h,y),_o(h)&&(In+=$t,jt+=$t)}else{const N=h.getTextContent();if(An(h)){const b=h.decorate(Hn,Er);b!==null&&Il(u,b),y.contentEditable="false"}else _t(h)&&(h.isDirectionless()||(Gn+=N));In+=N,jt+=N}if(s!==null)if(c!=null)s.insertBefore(y,c);else{const N=s.__lexicalLineBreak;N!=null?s.insertBefore(y,N):s.appendChild(y)}return Object.freeze(h),as(Wn,us,Ks,h,"created"),y}function ka(u,s,c,h){const y=Gn;Gn="",bl(u,c,0,s,h,null),Ll(c,h),Gn=y}function bl(u,s,c,h,y,N){const b=In;In="";let $=c;for(;$<=h;++$)hn(u[$],y,N);_o(s)&&(In+=$t),y.__lexicalTextContent=In,In=b+In}function Pa(u,s){const c=s.get(u);return ai(c)||An(c)&&c.isInline()}function vo(u,s,c){const h=u!==null&&(u.__size===0||Pa(u.__last,Wi)),y=s.__size===0||Pa(s.__last,gn);if(h){if(!y){const N=c.__lexicalLineBreak;N!=null&&c.removeChild(N),c.__lexicalLineBreak=null}}else if(y){const N=document.createElement("br");c.__lexicalLineBreak=N,c.appendChild(N)}}function Ll(u,s){const c=s.__lexicalDirTextContent,h=s.__lexicalDir;if(c!==Gn||h!==zs){const y=Gn==="",N=y?zs:Ln(Gn);if(N!==h){const b=s.classList,$=Er.theme;let ae=h!==null?$[h]:void 0,he=N!==null?$[N]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=$[h]=me}b.remove(...ae)}if(N===null||y&&N==="ltr")s.removeAttribute("dir");else{if(he!==void 0){if(typeof he=="string"){const me=he.split(" ");he=$[N]=me}he!==void 0&&b.add(...he)}s.dir=N}if(!ds){const me=u.getWritable();me.__dir=N}}zs=N,s.__lexicalDirTextContent=Gn,s.__lexicalDir=N}}function zi(u,s,c){const h=Gn;Gn="",at(u,s,c),Ll(s,c),Gn=h}function Ei(u,s){const c=[];let h=u.__first;for(;h!==null;){const y=s.get(h);if(y===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");c.push(h),h=y.__next}return c}function at(u,s,c){const h=In,y=u.__size,N=s.__size;if(In="",y===1&&N===1){const b=u.__first,$=s.__first;if(b===$)gs(b,c);else{const ae=wo(b),he=hn($,null,null);c.replaceChild(he,ae),fs(b,null)}}else{const b=Ei(u,Wi),$=Ei(s,gn);if(y===0)N!==0&&bl($,s,0,N-1,c,null);else if(N===0){if(y!==0){const he=c.__lexicalLineBreak==null;Ki(b,0,y-1,he?null:c),he&&(c.textContent="")}}else En(s,b,$,y,N,c)}_o(s)&&(In+=$t),c.__lexicalTextContent=In,In=h+In}function gs(u,s){const c=Wi.get(u);let h=gn.get(u);if(c===void 0||h===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const y=Ia||Rl.has(u)||Us.has(u),N=Fs(Hn,u);if(c===h&&!y){if(et(c)){const b=N.__lexicalTextContent;b!==void 0&&(In+=b,jt+=b);const $=N.__lexicalDirTextContent;$!==void 0&&(Gn+=$)}else{const b=c.getTextContent();_t(c)&&!c.isDirectionless()&&(Gn+=b),jt+=b,In+=b}return N}if(c!==h&&y&&as(Wn,us,Ks,h,"updated"),h.updateDOM(c,N,Er)){const b=hn(u,null,null);if(s===null)throw Error("reconcileNode: parentDOM is null");return s.replaceChild(b,N),fs(u,null),b}if(et(c)&&et(h)){const b=h.__indent;b!==c.__indent&&Jn(N,b);const $=h.__format;$!==c.__format&&Br(N,$),y&&(zi(c,h,N),!Ur(h)&&!h.isInline()&&vo(c,h,N)),_o(h)&&(In+=$t,jt+=$t)}else{const b=h.getTextContent();if(An(h)){const $=h.decorate(Hn,Er);$!==null&&Il(u,$)}else _t(h)&&!h.isDirectionless()&&(Gn+=b);In+=b,jt+=b}if(!ds&&Ur(h)&&h.__cachedText!==jt){const b=h.getWritable();b.__cachedText=jt,h=b}return Object.freeze(h),N}function Il(u,s){let c=Hn._pendingDecorators;const h=Hn._decorators;if(c===null){if(h[u]===s)return;c=Ms(Hn)}c[u]=s}function Tr(u){return u.firstChild}function So(u){let s=u.nextSibling;return s!==null&&s===Hn._blockCursorElement&&(s=s.nextSibling),s}function En(u,s,c,h,y,N){const b=h-1,$=y-1;let ae,he,me=Tr(N),xe=0,we=0;for(;xe<=b&&we<=$;){const Ue=s[xe],$e=c[we];if(Ue===$e)me=So(gs($e,N)),xe++,we++;else{ae===void 0&&(ae=new Set(s)),he===void 0&&(he=new Set(c));const Rt=he.has(Ue),Qe=ae.has($e);if(!Rt)me=So(wo(Ue)),fs(Ue,N),xe++;else if(!Qe)hn($e,N,me),we++;else{const ht=Fs(Hn,$e);ht===me?me=So(gs($e,N)):(me!=null?N.insertBefore(ht,me):N.appendChild(ht),gs($e,N)),xe++,we++}}}const Ce=xe>b,je=we>$;if(Ce&&!je){const Ue=c[$+1],$e=Ue===void 0?null:Hn.getElementByKey(Ue);bl(c,u,we,$,N,$e)}else je&&!Ce&&Ki(s,xe,b,N)}function Ui(u,s,c,h,y,N){In="",jt="",Gn="",Ia=h===ct,zs=null,Hn=c,Er=c._config,us=c._nodes,Ks=Hn._listeners.mutation,Us=y,Rl=N,Wi=u._nodeMap,gn=s._nodeMap,ds=s._readOnly,On=new Map(c._keyToDOMMap);const b=new Map;return Wn=b,gs("root",null),Hn=void 0,us=void 0,Us=void 0,Rl=void 0,Wi=void 0,gn=void 0,Er=void 0,On=void 0,Wn=void 0,b}function Je(u,s,c){const h=c._keyToDOMMap;s["__lexicalKey_"+c._key]=u,h.set(u,s)}function wo(u){const s=On.get(u);if(s===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return s}const cr=Object.freeze({}),nr=30,kl=[["keydown",ge],["pointerdown",Bl],["compositionstart",x],["compositionend",Q],["input",C],["click",$a],["cut",cr],["copy",cr],["dragstart",cr],["dragover",cr],["dragend",cr],["paste",cr],["focus",cr],["blur",cr],["drop",cr]];ee&&kl.push(["beforeinput",(u,s)=>g(u,s)]);let Gi=0,Pl=0,Gs=0,Hr=null,Ys=0,Wr=!1,Oo=!1,Vs=!1,js=!1,Do=[0,"",0,"root",0];function Yi(u,s,c,h,y){const N=u.anchor,b=u.focus,$=N.getNode(),ae=xn(),he=ar(ae._window),me=he!==null?he.anchorNode:null,xe=N.key,we=ae.getElementByKey(xe),Ce=c.length;return xe!==b.key||!_t($)||(!y&&(!ee||Gs<h+50)||$.isDirty()&&Ce<2||Rs(c))&&N.offset!==b.offset&&!$.isComposing()||zn($)||$.isDirty()&&Ce>1||(y||!ee)&&we!==null&&!$.isComposing()&&me!==Pr(we)||he!==null&&s!==null&&(!s.collapsed||s.startContainer!==he.anchorNode||s.startOffset!==he.anchorOffset)||$.getFormat()!==u.format||$.getStyle()!==u.style||Ls(u,$)}function $l(u,s){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&s!==0&&s!==u.nodeValue.length}function Fl(u,s,c){const{anchorNode:h,anchorOffset:y,focusNode:N,focusOffset:b}=u;Wr&&(Wr=!1,$l(h,y)&&$l(N,b))||zr(s,()=>{if(!c){Cr(null);return}if(!ss(s,h,N))return;const $=_n();if(Tt($)){const ae=$.anchor,he=ae.getNode();if($.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&($.dirty=!0);const me=No(s).event,xe=me?me.timeStamp:performance.now(),[we,Ce,je,Ue,$e]=Do,Rt=tr(),Qe=s.isComposing()===!1&&Rt.getTextContent()==="";if(xe<$e+200&&ae.offset===je&&ae.key===Ue)$.format=we,$.style=Ce;else if(ae.type==="text"){if(!_t(he))throw Error("Point.getNode() must return TextNode when type is text");$.format=he.getFormat(),$.style=he.getStyle()}else ae.type==="element"&&!Qe&&($.format=0,$.style="")}else{let me=it,xe=!1;const we=$.getNodes(),Ce=we.length;for(let je=0;je<Ce;je++){const Ue=we[je];if(_t(Ue)&&(xe=!0,me&=Ue.getFormat(),me===0))break}$.format=xe?me:0}}ut(s,t,void 0)})}function $a(u,s){zr(s,()=>{const c=_n(),h=ar(s._window),y=$o();if(h){if(Tt(c)){const N=c.anchor,b=N.getNode();if(N.type==="element"&&N.offset===0&&c.isCollapsed()&&!Ur(b)&&tr().getChildrenSize()===1&&b.getTopLevelElementOrThrow().isEmpty()&&y!==null&&c.is(y))h.removeAllRanges(),c.dirty=!0;else if(u.detail===3&&!c.isCollapsed()){const ae=c.focus.getNode();b!==ae&&(et(b)?b.select(0):b.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const N=h.anchorNode;if(N!==null){const b=N.nodeType;if(b===ke||b===Fe){const $=Fc(y,h,s,u);Cr($)}}}}ut(s,r,u)})}function Bl(u,s){const c=u.target,h=u.pointerType;c instanceof Node&&h!=="touch"&&zr(s,()=>{is(c)||(Oo=!0)})}function o(u){if(!u.getTargetRanges)return null;const s=u.getTargetRanges();return s.length===0?null:s[0]}function i(u,s){return u!==s||et(u)||et(s)||!u.isToken()||!s.isToken()}function a(u){return Pl===229&&u<Gi+nr}function g(u,s){const c=u.inputType,h=o(u);c==="deleteCompositionText"||De&&Ol(s)||c!=="insertCompositionText"&&zr(s,()=>{const y=_n();if(c==="deleteContentBackward"){if(y===null){const me=$o();if(!Tt(me))return;Cr(me.clone())}if(Tt(y)){if(be&&vn(y.anchor.key),a(u.timeStamp)&&s.isComposing()&&y.anchor.key===y.focus.key){if(vn(null),Gi=0,setTimeout(()=>{zr(s,()=>{vn(null)})},nr),Tt(y)){const xe=y.anchor.getNode();if(xe.markDirty(),y.format=xe.getFormat(),!_t(xe))throw Error("Anchor node must be a TextNode");y.style=xe.getStyle()}y.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),ut(s,l,!0))}else vn(null),u.preventDefault(),ut(s,l,!0);return}}if(!Tt(y))return;const N=u.data;Hr!==null&&bs(!1,s,Hr),(!y.dirty||Hr!==null)&&y.isCollapsed()&&!Ur(y.anchor.getNode())&&h!==null&&y.applyDOMRange(h),Hr=null;const b=y.anchor,$=y.focus,ae=b.getNode(),he=$.getNode();if(c==="insertText"||c==="insertTranspose"){if(N===`
|
|
39
|
-
`)u.preventDefault(),
|
|
40
|
-
`){const h=_n();if(Tt(h)){const y=h.focus;h.anchor.set(y.key,y.offset,y.type),ut(u,re,null);return}}}bs(!0,u,s)}function Q(u,s){De?js=!0:zr(s,()=>{D(s,u.data)})}function ge(u,s){if(Gi=u.timeStamp,Pl=u.keyCode,s.isComposing())return;const{keyCode:c,shiftKey:h,ctrlKey:y,metaKey:N,altKey:b}=u;if(!ut(s,v,u)){if(ls(c,y,b,N))ut(s,k,u);else if(Oa(c,y,h,b,N))ut(s,G,u);else if(Lc(c,y,b,N))ut(s,I,u);else if(wa(c,y,h,b,N))ut(s,P,u);else if(Ic(c,y,N))ut(s,H,u);else if(vl(c,y,N))ut(s,V,u);else if(Tl(c,h))Vs=!0,ut(s,re,u);else if(kc(c))ut(s,te,u);else if(ks(c,y))u.preventDefault(),Vs=!0,ut(s,d,!0);else if(El(c,h))Vs=!1,ut(s,re,u);else if(Ta(c,b,N,y))Zr(c)?ut(s,ce,u):(u.preventDefault(),ut(s,l,!0));else if(ki(c))ut(s,j,u);else if(Dc(c,y,h,b,N))Pi(c)?ut(s,z,u):(u.preventDefault(),ut(s,l,!1));else if(Ps(c,b,y))u.preventDefault(),ut(s,E,!0);else if(Na(c,b,y))u.preventDefault(),ut(s,E,!1);else if(Ca(c,N))u.preventDefault(),ut(s,S,!0);else if(Ea(c,N))u.preventDefault(),ut(s,S,!1);else if(ya(c,b,N,y))u.preventDefault(),ut(s,w,"bold");else if(Is(c,b,N,y))u.preventDefault(),ut(s,w,"underline");else if(os(c,b,N,y))u.preventDefault(),ut(s,w,"italic");else if(_a(c,b,y,N))ut(s,q,u);else if(Ac(c,h,N,y))u.preventDefault(),ut(s,M,void 0);else if(xa(c,h,N,y))u.preventDefault(),ut(s,m,void 0);else{const $=s._editorState._selection;Kr($)?Mc(c,h,N,y)?(u.preventDefault(),ut(s,Y,u)):Rc(c,h,N,y)?(u.preventDefault(),ut(s,W,u)):mo(c,N,y)&&(u.preventDefault(),ut(s,J,u)):!De&&mo(c,N,y)&&(u.preventDefault(),ut(s,J,u))}$s(y,h,b,N)&&ut(s,A,u)}}function Ae(u){let s=u.__lexicalEventHandles;return s===void 0&&(s=[],u.__lexicalEventHandles=s),s}const Ye=new Map;function Xe(u){const s=u.target,c=s==null?null:s.nodeType===9?s.defaultView:s.ownerDocument.defaultView,h=ar(c);if(h===null)return;const y=fl(h.anchorNode);if(y===null)return;Oo&&(Oo=!1,zr(y,()=>{const me=$o(),xe=h.anchorNode;if(xe===null)return;const we=xe.nodeType;if(we!==ke&&we!==Fe)return;const Ce=Fc(me,h,y,u);Cr(Ce)}));const N=Ii(y),b=N[N.length-1],$=b._key,ae=Ye.get($),he=ae||b;he!==y&&Fl(h,he,!1),Fl(h,y,!0),y!==b?Ye.set($,y):ae&&Ye.delete($)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function pt(u,s){Ys===0&&u.ownerDocument.addEventListener("selectionchange",Xe),Ys++,u.__lexicalEditor=s;const c=Ae(u);for(let h=0;h<kl.length;h++){const[y,N]=kl[h],b=typeof N=="function"?$=>{Pe($)||(Ke($),s.isEditable()&&N($,s))}:$=>{if(!Pe($)&&(Ke($),s.isEditable()))switch(y){case"cut":return ut(s,W,$);case"copy":return ut(s,Y,$);case"paste":return ut(s,_,$);case"dragstart":return ut(s,O,$);case"dragover":return ut(s,Z,$);case"dragend":return ut(s,oe,$);case"focus":return ut(s,_e,$);case"blur":return ut(s,B,$);case"drop":return ut(s,de,$)}};u.addEventListener(y,b),c.push(()=>{u.removeEventListener(y,b)})}}function wt(u){Ys!==0&&(Ys--,Ys===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const s=u.__lexicalEditor;s!=null&&(Ft(s),u.__lexicalEditor=null);const c=Ae(u);for(let h=0;h<c.length;h++)c[h]();u.__lexicalEventHandles=[]}function Ft(u){if(u._parentEditor!==null){const s=Ii(u),h=s[s.length-1]._key;Ye.get(h)===u&&Ye.delete(h)}else Ye.delete(u._key)}function zt(){Wr=!0}function Yn(u,s,c,h,y){Do=[u,s,c,h,y]}function Ar(u,s,c){fr();const h=u.__key,y=u.getParent();if(y===null)return;const N=cs(u);let b=!1;if(Tt(N)&&s){const $=N.anchor,ae=N.focus;$.key===h&&(Ga($,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0),ae.key===h&&(Ga(ae,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0)}else Kr(N)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(N)&&s&&!b){const $=u.getIndexWithinParent();jr(u),Ua(N,y,$,-1)}else jr(u);!c&&!si(y)&&!y.canBeEmpty()&&y.isEmpty()&&Ar(y,s),s&&Ur(y)&&y.isEmpty()&&y.selectEnd()}class oi{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(s){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(s){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,hl(this,s),this.__type!=="root"&&(fr(),li(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let s=this.__key;for(;s!==null;){if(s==="root")return!0;const c=Cn(s);if(c===null)break;s=c.__parent}return!1}isSelected(s){const c=s||_n();if(c==null)return!1;const h=c.getNodes().some(y=>y.__key===this.__key);return _t(this)?h:Tt(c)&&c.anchor.type==="element"&&c.focus.type==="element"&&c.anchor.key===c.focus.key&&c.anchor.offset===c.focus.offset?!1:h}getKey(){return this.__key}getIndexWithinParent(){const s=this.getParent();if(s===null)return-1;let c=s.getFirstChild(),h=0;for(;c!==null;){if(this.is(c))return h;h++,c=c.getNextSibling()}return-1}getParent(){const s=this.getLatest().__parent;return s===null?null:Cn(s)}getParentOrThrow(){const s=this.getParent();if(s===null)throw Error(`Expected node ${this.__key} to have a parent.`);return s}getTopLevelElement(){let s=this;for(;s!==null;){const c=s.getParent();if(si(c)){if(!et(s))throw Error("Children of root nodes must be elements");return s}s=c}return null}getTopLevelElementOrThrow(){const s=this.getTopLevelElement();if(s===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return s}getParents(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c),c=c.getParent();return s}getParentKeys(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c.__key),c=c.getParent();return s}getPreviousSibling(){const c=this.getLatest().__prev;return c===null?null:Cn(c)}getPreviousSiblings(){const s=[],c=this.getParent();if(c===null)return s;let h=c.getFirstChild();for(;h!==null&&!h.is(this);)s.push(h),h=h.getNextSibling();return s}getNextSibling(){const c=this.getLatest().__next;return c===null?null:Cn(c)}getNextSiblings(){const s=[];let c=this.getNextSibling();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getCommonAncestor(s){const c=this.getParents(),h=s.getParents();et(this)&&c.unshift(this),et(s)&&h.unshift(s);const y=c.length,N=h.length;if(y===0||N===0||c[y-1]!==h[N-1])return null;const b=new Set(h);for(let $=0;$<y;$++){const ae=c[$];if(b.has(ae))return ae}return null}is(s){return s==null?!1:this.__key===s.__key}isBefore(s){if(this===s)return!1;if(s.isParentOf(this))return!0;if(this.isParentOf(s))return!1;const c=this.getCommonAncestor(s);let h=0,y=0,N=this;for(;;){const b=N.getParentOrThrow();if(b===c){h=N.getIndexWithinParent();break}N=b}for(N=s;;){const b=N.getParentOrThrow();if(b===c){y=N.getIndexWithinParent();break}N=b}return h<y}isParentOf(s){const c=this.__key;if(c===s.__key)return!1;let h=s;for(;h!==null;){if(h.__key===c)return!0;h=h.getParent()}return!1}getNodesBetween(s){const c=this.isBefore(s),h=[],y=new Set;let N=this;for(;;){const b=N.__key;if(y.has(b)||(y.add(b),h.push(N)),N===s)break;const $=et(N)?c?N.getFirstChild():N.getLastChild():null;if($!==null){N=$;continue}const ae=c?N.getNextSibling():N.getPreviousSibling();if(ae!==null){N=ae;continue}const he=N.getParentOrThrow();if(y.has(he.__key)||h.push(he),he===s)break;let me=null,xe=he;do{if(xe===null)throw Error("getNodesBetween: ancestor is null");me=c?xe.getNextSibling():xe.getPreviousSibling(),xe=xe.getParent(),xe!==null&&me===null&&!y.has(xe.__key)&&h.push(xe)}while(me===null);N=me}return c||h.reverse(),h}isDirty(){const c=xn()._dirtyLeaves;return c!==null&&c.has(this.__key)}getLatest(){const s=Cn(this.__key);if(s===null)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return s}getWritable(){fr();const s=xi(),c=xn(),h=s._nodeMap,y=this.__key,N=this.getLatest(),b=N.__parent,$=c._cloneNotNeeded,ae=_n();if(ur(ae)&&ae.setCachedNodes(null),$.has(y))return Ri(N),N;const me=N.constructor.clone(N);return me.__parent=b,me.__next=N.__next,me.__prev=N.__prev,et(N)&&et(me)?(me.__first=N.__first,me.__last=N.__last,me.__size=N.__size,me.__indent=N.__indent,me.__format=N.__format,me.__dir=N.__dir):_t(N)&&_t(me)&&(me.__format=N.__format,me.__style=N.__style,me.__mode=N.__mode,me.__detail=N.__detail),$.add(y),me.__key=y,Ri(me),h.set(y,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(s,c){throw Error("createDOM: base method not extended")}updateDOM(s,c,h){throw Error("updateDOM: base method not extended")}exportDOM(s){return{element:this.createDOM(s._config,s)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(s){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(s){Ar(this,!0,s)}replace(s,c){fr();let h=_n();h!==null&&(h=h.clone()),Bs(this,s);const y=this.getLatest(),N=this.__key,b=s.__key,$=s.getWritable(),ae=this.getParentOrThrow().getWritable(),he=ae.__size;jr($);const me=y.getPreviousSibling(),xe=y.getNextSibling(),we=y.__prev,Ce=y.__next,je=y.__parent;if(Ar(y,!1,!0),me===null)ae.__first=b;else{const Ue=me.getWritable();Ue.__next=b}if($.__prev=we,xe===null)ae.__last=b;else{const Ue=xe.getWritable();Ue.__prev=b}if($.__next=Ce,$.__parent=je,ae.__size=he,c){if(!(et(this)&&et($)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Ue=>{$.append(Ue)})}if(Tt(h)){Cr(h);const Ue=h.anchor,$e=h.focus;Ue.key===N&&mn(Ue,$),$e.key===N&&mn($e,$)}return lr()===N&&vn(b),$}insertAfter(s,c=!0){fr(),Bs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.getParent(),b=_n();let $=!1,ae=!1;if(N!==null){const Ce=s.getIndexWithinParent();if(jr(y),Tt(b)){const je=N.__key,Ue=b.anchor,$e=b.focus;$=Ue.type==="element"&&Ue.key===je&&Ue.offset===Ce+1,ae=$e.type==="element"&&$e.key===je&&$e.offset===Ce+1}}const he=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),xe=y.__key,we=h.__next;if(he===null)me.__last=xe;else{const Ce=he.getWritable();Ce.__prev=xe}if(me.__size++,h.__next=xe,y.__next=we,y.__prev=h.__key,y.__parent=h.__parent,c&&Tt(b)){const Ce=this.getIndexWithinParent();Ua(b,me,Ce+1);const je=me.__key;$&&b.anchor.set(je,Ce+2,"element"),ae&&b.focus.set(je,Ce+2,"element")}return s}insertBefore(s,c=!0){fr(),Bs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.__key;jr(y);const b=this.getPreviousSibling(),$=this.getParentOrThrow().getWritable(),ae=h.__prev,he=this.getIndexWithinParent();if(b===null)$.__first=N;else{const xe=b.getWritable();xe.__next=N}$.__size++,h.__prev=N,y.__prev=ae,y.__next=h.__key,y.__parent=h.__parent;const me=_n();if(c&&Tt(me)){const xe=this.getParentOrThrow();Ua(me,xe,he)}return s}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(s,c){fr();const h=this.getPreviousSibling(),y=this.getParentOrThrow();if(h===null)return y.select(0,0);if(et(h))return h.select();if(!_t(h)){const N=h.getIndexWithinParent()+1;return y.select(N,N)}return h.select(s,c)}selectNext(s,c){fr();const h=this.getNextSibling(),y=this.getParentOrThrow();if(h===null)return y.select();if(et(h))return h.select(0,0);if(!_t(h)){const N=h.getIndexWithinParent();return y.select(N,N)}return h.select(s,c)}markDirty(){this.getWritable()}}function li(u,s){const c=xn()._nodes.get(u);if(c===void 0)throw Error(`Create node: Attempted to create node ${s.name} that was not configured to be used on the editor.`);const h=c.klass;if(h!==s)throw Error(`Create node: Type ${u} in node ${s.name} does not match registered node ${h.name} with the same type`)}function Hl(u,s,c){const h=s.getParentOrThrow().getLastChild();let y=s;const N=[s];for(;y!==h;){if(!y.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");y=y.getNextSibling(),N.push(y)}let b=u;for(const $ of N)b=b.insertAfter($)}class Vi extends oi{static getType(){return"linebreak"}static clone(s){return new Vi(s.__key)}constructor(s){super(s)}getTextContent(){return`
|
|
41
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:s=>{const c=s.parentElement;let h,y;return c!==null&&((h=c.firstChild)===s||h.nextSibling===s&&h.nodeType===Fe&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((y=c.lastChild)===s||y.previousSibling===s&&y.nodeType===Fe&&(y.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Ao,priority:0}}}}static importJSON(s){return ps()}exportJSON(){return{type:"linebreak",version:1}}}function Ao(u){return{node:ps()}}function ps(){return Dr(new
|
|
38
|
+
`,Kt=De?gt:mt,tn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",jt=new RegExp("^[^"+It+"]*["+tn+"]"),bt=new RegExp("^[^"+tn+"]*["+It+"]"),nn={bold:Oe,code:Le,highlight:rt,italic:ie,strikethrough:le,subscript:Me,superscript:je,underline:ve},Or={directionless:st,unmergeable:vt},_i={center:ze,end:Et,justify:yt,left:Ge,right:tt,start:Nt},pe={[ze]:"center",[Et]:"end",[yt]:"justify",[Ge]:"left",[tt]:"right",[Nt]:"start"},Ze={normal:At,segmented:en,token:Ut},ot={[At]:"normal",[en]:"segmented",[Ut]:"token"},St=100;let Gt=!1,Bt=0;function Pt(){return Gt}function kt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&No(u).addEventListener("textInput",kt,!0)}function sn(u,s,c){return s.__lexicalLineBreak===u||u[`__lexicalKey_${c._key}`]!==void 0}function an(u){return u.getEditorState().read(()=>{const s=_n();return s!==null?s.clone():null})}function bn(u,s,c){const h=ar(c._window);let y=null,N=null;h!==null&&h.anchorNode===u&&(y=h.anchorOffset,N=h.focusOffset);const b=u.nodeValue;b!==null&&$r(s,b,y,N,!1)}function yr(u,s,c){if(Tt(u)){const h=u.anchor.getNode();if(h.is(c)&&u.format!==h.getFormat())return!1}return s.nodeType===Fe&&c.isAttached()}function Zn(u,s,c){Gt=!0;const h=performance.now()-Bt>St;try{zr(u,()=>{const y=_n()||an(u),N=new Map,b=u.getRootElement(),$=u._editorState,ae=u._blockCursorElement;let he=!1,me="";for(let we=0;we<s.length;we++){const Ce=s[we],Ve=Ce.type,Ue=Ce.target;let $e=ii(Ue,$);if(!($e===null&&Ue!==b||An($e))){if(Ve==="characterData")h&&_t($e)&&yr(y,Ue,$e)&&bn(Ue,$e,u);else if(Ve==="childList"){he=!0;const Rt=Ce.addedNodes;for(let qt=0;qt<Rt.length;qt++){const Wt=Rt[qt],Dt=ho(Wt),cn=Wt.parentNode;if(cn!=null&&Wt!==ae&&Dt===null&&(Wt.nodeName!=="BR"||!sn(Wt,cn,u))){if(De){const ir=Wt.innerText||Wt.nodeValue;ir&&(me+=ir)}cn.removeChild(Wt)}}const Qe=Ce.removedNodes,ht=Qe.length;if(ht>0){let qt=0;for(let Wt=0;Wt<ht;Wt++){const Dt=Qe[Wt];(Dt.nodeName==="BR"&&sn(Dt,Ue,u)||ae===Dt)&&(Ue.appendChild(Dt),qt++)}ht!==qt&&(Ue===b&&($e=ml($)),N.set(Ue,$e))}}}}if(N.size>0)for(const[we,Ce]of N)if(et(Ce)){const Ve=Ce.getChildrenKeys();let Ue=we.firstChild;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=u.getElementByKey(Rt);Qe!==null&&(Ue==null?(we.appendChild(Qe),Ue=Qe):Ue!==Qe&&we.replaceChild(Qe,Ue),Ue=Ue.nextSibling)}}else _t(Ce)&&Ce.markDirty();const xe=c.takeRecords();if(xe.length>0){for(let we=0;we<xe.length;we++){const Ce=xe[we],Ve=Ce.addedNodes,Ue=Ce.target;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=Rt.parentNode;Qe!=null&&Rt.nodeName==="BR"&&!sn(Rt,Ue,u)&&Qe.removeChild(Rt)}}c.takeRecords()}y!==null&&(he&&(y.dirty=!0,Cr(y)),De&&Ol(u)&&y.insertRawText(me))})}finally{Gt=!1}}function fn(u){const s=u._observer;if(s!==null){const c=s.takeRecords();Zn(u,c,s)}}function sr(u){Ht(u),u._observer=new MutationObserver((s,c)=>{Zn(u,s,c)})}function or(u,s){const c=u.__mode,h=u.__format,y=u.__style,N=s.__mode,b=s.__format,$=s.__style;return(c===null||c===N)&&(h===null||h===b)&&(y===null||y===$)}function Mi(u,s){const c=u.mergeWithSibling(s),h=xn()._normalizedNodes;return h.add(u.__key),h.add(s.__key),c}function Nr(u){let s=u;if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable()){s.remove();return}let c;for(;(c=s.getPreviousSibling())!==null&&_t(c)&&c.isSimpleText()&&!c.isUnmergeable();)if(c.__text==="")c.remove();else if(or(c,s)){s=Mi(c,s);break}else break;let h;for(;(h=s.getNextSibling())!==null&&_t(h)&&h.isSimpleText()&&!h.isUnmergeable();)if(h.__text==="")h.remove();else if(or(s,h)){s=Mi(s,h);break}else break}function Os(u){return uo(u.anchor),uo(u.focus),u}function uo(u){for(;u.type==="element";){const s=u.getNode(),c=u.offset;let h,y;if(c===s.getChildrenSize()?(h=s.getChildAtIndex(c-1),y=!0):(h=s.getChildAtIndex(c),y=!1),_t(h)){u.set(h.__key,y?h.getTextContentSize():0,"text");break}else if(!et(h))break;u.set(h.__key,y?h.getChildrenSize():0,"element")}}let dl=1;function jr(){return""+dl++}function pa(u,s){const c=u._nodes.get(s);if(c===void 0)throw Error(`registeredNode: Type ${s} not found`);return c}const fo=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function is(u){return An(ii(u))}function Ds(u){const s=document.activeElement;if(s===null)return!1;const c=s.nodeName;return An(ii(u))&&(c==="INPUT"||c==="TEXTAREA"||s.contentEditable==="true"&&s.__lexicalEditor==null)}function ss(u,s,c){const h=u.getRootElement();try{return h!==null&&h.contains(s)&&h.contains(c)&&s!==null&&!Ds(s)&&fl(s)===u}catch{return!1}}function fl(u){let s=u;for(;s!=null;){const c=s.__lexicalEditor;if(c!=null)return c;s=yo(s)}return null}function Ln(u){return jt.test(u)?"rtl":bt.test(u)?"ltr":null}function zn(u){return u.isToken()||u.isSegmented()}function ri(u){return u.nodeType===Fe}function Pr(u){let s=u;for(;s!=null;){if(ri(s))return s;s=s.firstChild}return null}function Bn(u,s,c){const h=nn[s];if(c!==null&&(u&h)===(c&h))return u;let y=u^h;return s==="subscript"?y&=-65:s==="superscript"&&(y&=-33),y}function As(u){return _t(u)||ai(u)||An(u)}function hl(u,s){if(s!=null){u.__key=s;return}fr(),Jd();const c=xn(),h=xi(),y=jr();h._nodeMap.set(y,u),et(u)?c._dirtyElements.set(y,!0):c._dirtyLeaves.add(y),c._cloneNotNeeded.add(y),c._dirtyType=Be,u.__key=y}function gl(u,s,c){let h=u;for(;h!==null;){if(c.has(h))return;const y=s.get(h);if(y===void 0)break;c.set(h,!1),h=y.__parent}}function Vr(u){const s=u.getParent();if(s!==null){const c=u.getWritable(),h=s.getWritable(),y=u.getPreviousSibling(),N=u.getNextSibling();if(y===null)if(N!==null){const b=N.getWritable();h.__first=N.__key,b.__prev=null}else h.__first=null;else{const b=y.getWritable();if(N!==null){const $=N.getWritable();$.__prev=b.__key,b.__next=$.__key}else b.__next=null;c.__prev=null}if(N===null)if(y!==null){const b=y.getWritable();h.__last=y.__key,b.__next=null}else h.__last=null;else{const b=N.getWritable();if(y!==null){const $=y.getWritable();$.__next=b.__key,b.__prev=$.__key}else b.__prev=null;c.__next=null}h.__size--,c.__parent=null}}function Ri(u){Jd();const s=u.getLatest(),c=s.__parent,h=xi(),y=xn(),N=h._nodeMap,b=y._dirtyElements;c!==null&&gl(c,N,b);const $=s.__key;y._dirtyType=Be,et(u)?b.set($,!0):y._dirtyLeaves.add($)}function pl(u){const s=u.getPreviousSibling(),c=u.getNextSibling();s!==null&&Ri(s),c!==null&&Ri(c)}function vn(u){fr();const s=xn(),c=s._compositionKey;if(u!==c){if(s._compositionKey=u,c!==null){const h=Cn(c);h!==null&&h.getWritable()}if(u!==null){const h=Cn(u);h!==null&&h.getWritable()}}}function lr(){return Fo()?null:xn()._compositionKey}function Cn(u,s){const h=(s||xi())._nodeMap.get(u);return h===void 0?null:h}function ho(u,s){const c=xn(),h=u[`__lexicalKey_${c._key}`];return h!==void 0?Cn(h,s):null}function ii(u,s){let c=u;for(;c!=null;){const h=ho(c,s);if(h!==null)return h;c=yo(c)}return null}function Ms(u){const s=u._decorators,c=Object.assign({},s);return u._pendingDecorators=c,c}function go(u){return u.read(()=>tr().getTextContent())}function bi(u,s){zr(u,()=>{const c=xi();if(c.isEmpty())return;if(s==="root"){tr().markDirty();return}const h=c._nodeMap;for(const[,y]of h)y.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function tr(){return ml(xi())}function ml(u){return u._nodeMap.get("root")}function Cr(u){fr();const s=xi();if(u!==null){if(Object.isFrozen(u))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");u.dirty=!0,u.setCachedNodes(null)}s._selection=u}function _l(){fr();const u=xn();fn(u)}function Li(u){const s=xn(),c=ma(u,s);if(c===null){const h=s.getRootElement();return u===h?Cn("root"):null}return Cn(c)}function yl(u,s){return s?u.getTextContentSize():0}function ma(u,s){let c=u;for(;c!=null;){const h=c[`__lexicalKey_${s._key}`];if(h!==void 0)return h;c=yo(c)}return null}function Rs(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Ii(u){const s=[];let c=u;for(;c!==null;)s.push(c),c=c._parentEditor;return s}function Nl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function po(u){return u.nodeType===Fe?u.nodeValue:null}function bs(u,s,c){const h=ar(s._window);if(h===null)return;const y=h.anchorNode;let{anchorOffset:N,focusOffset:b}=h;if(y!==null){let $=po(y);const ae=ii(y);if($!==null&&_t(ae)){if($===mt&&c){const he=c.length;$=c,N=he,b=he}$!==null&&$r(ae,$,N,b,u)}}}function $r(u,s,c,h,y){let N=u;if(N.isAttached()&&(y||!N.isDirty())){const b=N.isComposing();let $=s;(b||y)&&s[s.length-1]===mt&&($=s.slice(0,-1));const ae=N.getTextContent();if(y||$!==ae){if($===""){if(vn(null),!ne&&!ue&&!Re){const Ue=xn();setTimeout(()=>{Ue.update(()=>{N.isAttached()&&N.remove()})},20)}else N.remove();return}const he=N.getParent(),me=$o(),xe=N.getTextContentSize(),we=lr(),Ce=N.getKey();if(N.isToken()||we!==null&&Ce===we&&!b||Tt(me)&&(he!==null&&!he.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!N.canInsertTextBefore()&&!b||me.focus.key===u.__key&&me.focus.offset===xe&&!N.canInsertTextAfter()&&!b)){N.markDirty();return}const Ve=_n();if(!Tt(Ve)||c===null||h===null){N.setTextContent($);return}if(Ve.setTextNodeRange(N,c,N,h),N.isSegmented()){const Ue=N.getTextContent(),$e=Dn(Ue);N.replace($e),N=$e}N.setTextContent($)}}}function Cl(u){const s=u.getPreviousSibling();return(_t(s)||et(s)&&s.isInline())&&!s.canInsertTextAfter()}function Ls(u,s){if(s.isSegmented())return!0;if(!u.isCollapsed())return!1;const c=u.anchor.offset,h=s.getParentOrThrow(),y=s.isToken();return c===0?!s.canInsertTextBefore()||!h.canInsertTextBefore()||y||Cl(s):c===s.getTextContentSize()?!s.canInsertTextAfter()||!h.canInsertTextAfter()||y:!1}function _a(u,s,c,h){return u===9&&!s&&!c&&!h}function ya(u,s,c,h){return u===66&&!s&&qr(c,h)}function os(u,s,c,h){return u===73&&!s&&qr(c,h)}function Is(u,s,c,h){return u===85&&!s&&qr(c,h)}function El(u,s){return Da(u)&&!s}function Tl(u,s){return Da(u)&&s}function ks(u,s){return ye&&s&&u===79}function Ps(u,s,c){return Zr(u)&&(ye?s:c)}function Na(u,s,c){return Pi(u)&&(ye?s:c)}function Ca(u,s){return ye&&s&&Zr(u)}function Ea(u,s){return ye&&s&&Pi(u)}function Ta(u,s,c,h){return ye?s||c?!1:Zr(u)||u===72&&h:h||s||c?!1:Zr(u)}function Dc(u,s,c,h,y){return ye?c||h||y?!1:Pi(u)||u===68&&s:s||h||y?!1:Pi(u)}function Ac(u,s,c,h){return u===90&&!s&&qr(c,h)}function xa(u,s,c,h){return ye?u===90&&c&&s:u===89&&h||u===90&&h&&s}function Mc(u,s,c,h){return s?!1:u===67?ye?c:h:!1}function Rc(u,s,c,h){return s?!1:u===88?ye?c:h:!1}function va(u){return u===37}function Sa(u){return u===39}function xl(u){return u===38}function bc(u){return u===40}function Lc(u,s,c,h){return va(u)&&!s&&!h&&!c}function wa(u,s,c,h,y){return va(u)&&!h&&!c&&(s||y)}function ls(u,s,c,h){return Sa(u)&&!s&&!h&&!c}function Oa(u,s,c,h,y){return Sa(u)&&!h&&!c&&(s||y)}function Ic(u,s,c){return xl(u)&&!s&&!c}function vl(u,s,c){return bc(u)&&!s&&!c}function $s(u,s,c,h){return u||s||c||h}function kc(u){return u===32}function qr(u,s){return ye?u:s}function Da(u){return u===13}function Zr(u){return u===8}function ki(u){return u===27}function Pi(u){return u===46}function mo(u,s,c){return u===65&&qr(s,c)}function Sl(){const u=tr(),s=u.select(0,u.getChildrenSize());Cr(Os(s))}function $i(u,s){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const c=u.__lexicalClassNameCache,h=c[s];if(h!==void 0)return h;const y=u[s];if(typeof y=="string"){const N=y.split(" ");return c[s]=N,N}return y}function as(u,s,c,h,y){if(c.size===0)return;const N=h.__type,b=h.__key,$=s.get(N);if($===void 0)throw Error(`Type ${N} not in registeredNodes`);const ae=$.klass;let he=u.get(ae);he===void 0&&(he=new Map,u.set(ae,he));const me=he.get(b),xe=me==="destroyed"&&y==="created";(me===void 0||xe)&&he.set(b,xe?"updated":y)}function Fi(u){const s=xi(),c=s._readOnly,h=u.getType(),y=s._nodeMap,N=[];for(const[,b]of y)b instanceof u&&b.__type===h&&(c||b.isAttached())&&N.push(b);return N}function Aa(u,s,c){const h=u.getParent();let y=c,N=u;return h!==null&&(s&&c===0?(y=N.getIndexWithinParent(),N=h):!s&&c===N.getChildrenSize()&&(y=N.getIndexWithinParent()+1,N=h)),N.getChildAtIndex(s?y-1:y)}function wl(u,s){const c=u.offset;if(u.type==="element"){const h=u.getNode();return Aa(h,s,c)}else{const h=u.getNode();if(s&&c===0||!s&&c===h.getTextContentSize()){const y=s?h.getPreviousSibling():h.getNextSibling();return y===null?Aa(h.getParentOrThrow(),s,h.getIndexWithinParent()+(s?0:1)):y}}return null}function Ol(u){const s=No(u).event,c=s&&s.inputType;return c==="insertFromPaste"||c==="insertFromPasteAsQuotation"}function dt(u,s,c){return nf(u,s,c)}function _o(u){return!Ur(u)&&!u.isLastChild()&&!u.isInline()}function Fs(u,s){const c=u._keyToDOMMap.get(s);if(c===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${s}`);return c}function yo(u){const s=u.assignedSlot||u.parentElement;return s!==null&&s.nodeType===11?s.host:s}function yi(u,s,c){const h=c.ownerDocument,y=h.defaultView;if(y===null)return;let{top:N,bottom:b}=s,$=0,ae=0,he=c;for(;he!==null;){const me=he===h.body;if(me)$=0,ae=No(u).innerHeight;else{const we=he.getBoundingClientRect();$=we.top,ae=we.bottom}let xe=0;if(N<$?xe=-($-N):b>ae&&(xe=b-ae),xe!==0)if(me)y.scrollBy(0,xe);else{const we=he.scrollTop;he.scrollTop+=xe;const Ce=he.scrollTop-we;N-=Ce,b-=Ce}if(me)break;he=yo(he)}}function Un(u){return xn()._updateTags.has(u)}function Ct(u){fr(),xn()._updateTags.add(u)}function cs(u){const s=_n();if(!Tt(s)||!et(u))return s;const{anchor:c,focus:h}=s,y=c.getNode(),N=h.getNode();return Bi(y,u)&&c.set(u.__key,0,"element"),Bi(N,u)&&h.set(u.__key,0,"element"),s}function Bi(u,s){let c=u.getParent();for(;c!==null;){if(c.is(s))return!0;c=c.getParent()}return!1}function Ma(u){const s=u.ownerDocument;return s&&s.defaultView||null}function No(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function Fr(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function Co(u){let s=u.getParentOrThrow();for(;s!==null;){if(si(s))return s;s=s.getParentOrThrow()}return s}function si(u){return Ur(u)||et(u)&&u.isShadowRoot()}function Dl(u){const s=u.constructor.clone(u);return hl(s,null),s}function Dr(u){const s=xn(),c=u.constructor.getType(),h=s._nodes.get(c);if(h===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const y=h.replace;if(y!==null){const N=y(u);if(!(N instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return N}return u}function Bs(u,s){const c=u.getParent();if(Ur(c)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Eo(u){const s=u.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let h=s.blockCursor;if(h!==void 0){if(typeof h=="string"){const y=h.split(" ");h=s.blockCursor=y}h!==void 0&&c.classList.add(...h)}return c}function Mt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function Hs(u,s,c){c.style.removeProperty("caret-color"),s._blockCursorElement=null;const h=u.parentElement;h!==null&&h.removeChild(u)}function Ni(u,s,c){let h=u._blockCursorElement;if(Tt(c)&&c.isCollapsed()&&c.anchor.type==="element"&&s.contains(document.activeElement)){const y=c.anchor,N=y.getNode(),b=y.offset,$=N.getChildrenSize();let ae=!1,he=null;if(b===$){const me=N.getChildAtIndex(b-1);Mt(me)&&(ae=!0)}else{const me=N.getChildAtIndex(b);if(Mt(me)){const xe=me.getPreviousSibling();(xe===null||Mt(xe))&&(ae=!0,he=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(N.__key);h===null&&(u._blockCursorElement=h=Eo(u._config)),s.style.caretColor="transparent",he===null?me.appendChild(h):me.insertBefore(h,he);return}}h!==null&&Hs(h,u,s)}function ar(u){return F?(u||window).getSelection():null}function Ra(u,s){let c=u.getChildAtIndex(s);if(c==null&&(c=u),si(u))throw Error("Can not call $splitNode() on root element");const h=b=>{const $=b.getParentOrThrow(),ae=si($),he=b===c&&!ae?b:Dl(b);if(ae){if(!(et(b)&&et(he)))throw Error("Children of a root must be ElementNode");return b.insertAfter(he),[b,he,he]}else{const[me,xe,we]=h($),Ce=b.getNextSiblings();return we.append(he,...Ce),[me,xe,he]}},[y,N]=h(c);return[y,N]}function To(u,s){let c=u;for(;c!==tr()&&c!=null;){if(s(c))return c;c=c.getParent()}return null}function ba(u){return Ws(u)&&u.tagName==="A"}function Ws(u){return u.nodeType===1}function Hi(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||si(u))return!1;const s=u.getFirstChild(),c=s===null||ai(s)||_t(s)||s.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&c}function xo(u,s){let c=u;for(;c!==null&&c.getParent()!==null&&!s(c);)c=c.getParentOrThrow();return s(c)?c:null}function La(u,s){const c=u._decorators;let y=u._pendingDecorators||c;const N=s._nodeMap;let b;for(b in y)N.has(b)||(y===c&&(y=Ms(u)),delete y[b])}function Al(u,s,c,h,y,N){let b=u.getFirstChild();for(;b!==null;){const $=b.__key;b.__parent===s&&(et(b)&&Al(b,$,c,h,y,N),c.has($)||N.delete($),y.push($)),b=b.getNextSibling()}}function Ml(u,s,c,h){const y=u._nodeMap,N=s._nodeMap,b=[];for(const[$]of h){const ae=N.get($);ae!==void 0&&(ae.isAttached()||(et(ae)&&Al(ae,$,y,N,b,h),y.has($)||h.delete($),b.push($)))}for(const $ of b)N.delete($);for(const $ of c){const ae=N.get($);ae!==void 0&&!ae.isAttached()&&(y.has($)||c.delete($),N.delete($))}}let In="",Gn="",Vt="",Er,Hn,us,Ia=!1,ds=!1,Ks,zs=null,Us,Rl,Wi,gn,On,Wn;function fs(u,s){const c=Wi.get(u);if(s!==null){const h=wo(u);h.parentNode===s&&s.removeChild(h)}if(gn.has(u)||Hn._keyToDOMMap.delete(u),et(c)){const h=Ei(c,Wi);Ki(h,0,h.length-1,null)}c!==void 0&&as(Wn,us,Ks,c,"destroyed")}function Ki(u,s,c,h){let y=s;for(;y<=c;++y){const N=u[y];N!==void 0&&fs(N,h)}}function Ci(u,s){u.setProperty("text-align",s)}const hs="40px";function Jn(u,s){const c=Er.theme.indent;if(typeof c=="string"){const y=u.classList.contains(c);s>0&&!y?u.classList.add(c):s<1&&y&&u.classList.remove(c)}const h=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||hs;u.style.setProperty("padding-inline-start",s===0?"":`calc(${s} * ${h})`)}function Br(u,s){const c=u.style;s===0?Ci(c,""):s===Ge?Ci(c,"left"):s===ze?Ci(c,"center"):s===tt?Ci(c,"right"):s===yt?Ci(c,"justify"):s===Nt?Ci(c,"start"):s===Et&&Ci(c,"end")}function hn(u,s,c){const h=gn.get(u);if(h===void 0)throw Error("createNode: node does not exist in nodeMap");const y=h.createDOM(Er,Hn);if(Je(u,y,Hn),_t(h)?y.setAttribute("data-lexical-text","true"):An(h)&&y.setAttribute("data-lexical-decorator","true"),et(h)){const N=h.__indent,b=h.__size;if(N!==0&&Jn(y,N),b!==0){const ae=b-1,he=Ei(h,gn);ka(he,ae,h,y)}const $=h.__format;$!==0&&Br(y,$),h.isInline()||vo(null,h,y),_o(h)&&(In+=$t,Vt+=$t)}else{const N=h.getTextContent();if(An(h)){const b=h.decorate(Hn,Er);b!==null&&Il(u,b),y.contentEditable="false"}else _t(h)&&(h.isDirectionless()||(Gn+=N));In+=N,Vt+=N}if(s!==null)if(c!=null)s.insertBefore(y,c);else{const N=s.__lexicalLineBreak;N!=null?s.insertBefore(y,N):s.appendChild(y)}return Object.freeze(h),as(Wn,us,Ks,h,"created"),y}function ka(u,s,c,h){const y=Gn;Gn="",bl(u,c,0,s,h,null),Ll(c,h),Gn=y}function bl(u,s,c,h,y,N){const b=In;In="";let $=c;for(;$<=h;++$)hn(u[$],y,N);_o(s)&&(In+=$t),y.__lexicalTextContent=In,In=b+In}function Pa(u,s){const c=s.get(u);return ai(c)||An(c)&&c.isInline()}function vo(u,s,c){const h=u!==null&&(u.__size===0||Pa(u.__last,Wi)),y=s.__size===0||Pa(s.__last,gn);if(h){if(!y){const N=c.__lexicalLineBreak;N!=null&&c.removeChild(N),c.__lexicalLineBreak=null}}else if(y){const N=document.createElement("br");c.__lexicalLineBreak=N,c.appendChild(N)}}function Ll(u,s){const c=s.__lexicalDirTextContent,h=s.__lexicalDir;if(c!==Gn||h!==zs){const y=Gn==="",N=y?zs:Ln(Gn);if(N!==h){const b=s.classList,$=Er.theme;let ae=h!==null?$[h]:void 0,he=N!==null?$[N]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=$[h]=me}b.remove(...ae)}if(N===null||y&&N==="ltr")s.removeAttribute("dir");else{if(he!==void 0){if(typeof he=="string"){const me=he.split(" ");he=$[N]=me}he!==void 0&&b.add(...he)}s.dir=N}if(!ds){const me=u.getWritable();me.__dir=N}}zs=N,s.__lexicalDirTextContent=Gn,s.__lexicalDir=N}}function zi(u,s,c){const h=Gn;Gn="",ct(u,s,c),Ll(s,c),Gn=h}function Ei(u,s){const c=[];let h=u.__first;for(;h!==null;){const y=s.get(h);if(y===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");c.push(h),h=y.__next}return c}function ct(u,s,c){const h=In,y=u.__size,N=s.__size;if(In="",y===1&&N===1){const b=u.__first,$=s.__first;if(b===$)gs(b,c);else{const ae=wo(b),he=hn($,null,null);c.replaceChild(he,ae),fs(b,null)}}else{const b=Ei(u,Wi),$=Ei(s,gn);if(y===0)N!==0&&bl($,s,0,N-1,c,null);else if(N===0){if(y!==0){const he=c.__lexicalLineBreak==null;Ki(b,0,y-1,he?null:c),he&&(c.textContent="")}}else En(s,b,$,y,N,c)}_o(s)&&(In+=$t),c.__lexicalTextContent=In,In=h+In}function gs(u,s){const c=Wi.get(u);let h=gn.get(u);if(c===void 0||h===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const y=Ia||Rl.has(u)||Us.has(u),N=Fs(Hn,u);if(c===h&&!y){if(et(c)){const b=N.__lexicalTextContent;b!==void 0&&(In+=b,Vt+=b);const $=N.__lexicalDirTextContent;$!==void 0&&(Gn+=$)}else{const b=c.getTextContent();_t(c)&&!c.isDirectionless()&&(Gn+=b),Vt+=b,In+=b}return N}if(c!==h&&y&&as(Wn,us,Ks,h,"updated"),h.updateDOM(c,N,Er)){const b=hn(u,null,null);if(s===null)throw Error("reconcileNode: parentDOM is null");return s.replaceChild(b,N),fs(u,null),b}if(et(c)&&et(h)){const b=h.__indent;b!==c.__indent&&Jn(N,b);const $=h.__format;$!==c.__format&&Br(N,$),y&&(zi(c,h,N),!Ur(h)&&!h.isInline()&&vo(c,h,N)),_o(h)&&(In+=$t,Vt+=$t)}else{const b=h.getTextContent();if(An(h)){const $=h.decorate(Hn,Er);$!==null&&Il(u,$)}else _t(h)&&!h.isDirectionless()&&(Gn+=b);In+=b,Vt+=b}if(!ds&&Ur(h)&&h.__cachedText!==Vt){const b=h.getWritable();b.__cachedText=Vt,h=b}return Object.freeze(h),N}function Il(u,s){let c=Hn._pendingDecorators;const h=Hn._decorators;if(c===null){if(h[u]===s)return;c=Ms(Hn)}c[u]=s}function Tr(u){return u.firstChild}function So(u){let s=u.nextSibling;return s!==null&&s===Hn._blockCursorElement&&(s=s.nextSibling),s}function En(u,s,c,h,y,N){const b=h-1,$=y-1;let ae,he,me=Tr(N),xe=0,we=0;for(;xe<=b&&we<=$;){const Ue=s[xe],$e=c[we];if(Ue===$e)me=So(gs($e,N)),xe++,we++;else{ae===void 0&&(ae=new Set(s)),he===void 0&&(he=new Set(c));const Rt=he.has(Ue),Qe=ae.has($e);if(!Rt)me=So(wo(Ue)),fs(Ue,N),xe++;else if(!Qe)hn($e,N,me),we++;else{const ht=Fs(Hn,$e);ht===me?me=So(gs($e,N)):(me!=null?N.insertBefore(ht,me):N.appendChild(ht),gs($e,N)),xe++,we++}}}const Ce=xe>b,Ve=we>$;if(Ce&&!Ve){const Ue=c[$+1],$e=Ue===void 0?null:Hn.getElementByKey(Ue);bl(c,u,we,$,N,$e)}else Ve&&!Ce&&Ki(s,xe,b,N)}function Ui(u,s,c,h,y,N){In="",Vt="",Gn="",Ia=h===ut,zs=null,Hn=c,Er=c._config,us=c._nodes,Ks=Hn._listeners.mutation,Us=y,Rl=N,Wi=u._nodeMap,gn=s._nodeMap,ds=s._readOnly,On=new Map(c._keyToDOMMap);const b=new Map;return Wn=b,gs("root",null),Hn=void 0,us=void 0,Us=void 0,Rl=void 0,Wi=void 0,gn=void 0,Er=void 0,On=void 0,Wn=void 0,b}function Je(u,s,c){const h=c._keyToDOMMap;s["__lexicalKey_"+c._key]=u,h.set(u,s)}function wo(u){const s=On.get(u);if(s===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return s}const cr=Object.freeze({}),nr=30,kl=[["keydown",ge],["pointerdown",Bl],["compositionstart",x],["compositionend",Q],["input",C],["click",$a],["cut",cr],["copy",cr],["dragstart",cr],["dragover",cr],["dragend",cr],["paste",cr],["focus",cr],["blur",cr],["drop",cr]];ee&&kl.push(["beforeinput",(u,s)=>g(u,s)]);let Gi=0,Pl=0,Gs=0,Hr=null,Ys=0,Wr=!1,Oo=!1,js=!1,Vs=!1,Do=[0,"",0,"root",0];function Yi(u,s,c,h,y){const N=u.anchor,b=u.focus,$=N.getNode(),ae=xn(),he=ar(ae._window),me=he!==null?he.anchorNode:null,xe=N.key,we=ae.getElementByKey(xe),Ce=c.length;return xe!==b.key||!_t($)||(!y&&(!ee||Gs<h+50)||$.isDirty()&&Ce<2||Rs(c))&&N.offset!==b.offset&&!$.isComposing()||zn($)||$.isDirty()&&Ce>1||(y||!ee)&&we!==null&&!$.isComposing()&&me!==Pr(we)||he!==null&&s!==null&&(!s.collapsed||s.startContainer!==he.anchorNode||s.startOffset!==he.anchorOffset)||$.getFormat()!==u.format||$.getStyle()!==u.style||Ls(u,$)}function $l(u,s){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&s!==0&&s!==u.nodeValue.length}function Fl(u,s,c){const{anchorNode:h,anchorOffset:y,focusNode:N,focusOffset:b}=u;Wr&&(Wr=!1,$l(h,y)&&$l(N,b))||zr(s,()=>{if(!c){Cr(null);return}if(!ss(s,h,N))return;const $=_n();if(Tt($)){const ae=$.anchor,he=ae.getNode();if($.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&($.dirty=!0);const me=No(s).event,xe=me?me.timeStamp:performance.now(),[we,Ce,Ve,Ue,$e]=Do,Rt=tr(),Qe=s.isComposing()===!1&&Rt.getTextContent()==="";if(xe<$e+200&&ae.offset===Ve&&ae.key===Ue)$.format=we,$.style=Ce;else if(ae.type==="text"){if(!_t(he))throw Error("Point.getNode() must return TextNode when type is text");$.format=he.getFormat(),$.style=he.getStyle()}else ae.type==="element"&&!Qe&&($.format=0,$.style="")}else{let me=it,xe=!1;const we=$.getNodes(),Ce=we.length;for(let Ve=0;Ve<Ce;Ve++){const Ue=we[Ve];if(_t(Ue)&&(xe=!0,me&=Ue.getFormat(),me===0))break}$.format=xe?me:0}}dt(s,t,void 0)})}function $a(u,s){zr(s,()=>{const c=_n(),h=ar(s._window),y=$o();if(h){if(Tt(c)){const N=c.anchor,b=N.getNode();if(N.type==="element"&&N.offset===0&&c.isCollapsed()&&!Ur(b)&&tr().getChildrenSize()===1&&b.getTopLevelElementOrThrow().isEmpty()&&y!==null&&c.is(y))h.removeAllRanges(),c.dirty=!0;else if(u.detail===3&&!c.isCollapsed()){const ae=c.focus.getNode();b!==ae&&(et(b)?b.select(0):b.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const N=h.anchorNode;if(N!==null){const b=N.nodeType;if(b===ke||b===Fe){const $=Fc(y,h,s,u);Cr($)}}}}dt(s,r,u)})}function Bl(u,s){const c=u.target,h=u.pointerType;c instanceof Node&&h!=="touch"&&zr(s,()=>{is(c)||(Oo=!0)})}function o(u){if(!u.getTargetRanges)return null;const s=u.getTargetRanges();return s.length===0?null:s[0]}function i(u,s){return u!==s||et(u)||et(s)||!u.isToken()||!s.isToken()}function a(u){return Pl===229&&u<Gi+nr}function g(u,s){const c=u.inputType,h=o(u);c==="deleteCompositionText"||De&&Ol(s)||c!=="insertCompositionText"&&zr(s,()=>{const y=_n();if(c==="deleteContentBackward"){if(y===null){const me=$o();if(!Tt(me))return;Cr(me.clone())}if(Tt(y)){if(be&&vn(y.anchor.key),a(u.timeStamp)&&s.isComposing()&&y.anchor.key===y.focus.key){if(vn(null),Gi=0,setTimeout(()=>{zr(s,()=>{vn(null)})},nr),Tt(y)){const xe=y.anchor.getNode();if(xe.markDirty(),y.format=xe.getFormat(),!_t(xe))throw Error("Anchor node must be a TextNode");y.style=xe.getStyle()}y.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),dt(s,l,!0))}else vn(null),u.preventDefault(),dt(s,l,!0);return}}if(!Tt(y))return;const N=u.data;Hr!==null&&bs(!1,s,Hr),(!y.dirty||Hr!==null)&&y.isCollapsed()&&!Ur(y.anchor.getNode())&&h!==null&&y.applyDOMRange(h),Hr=null;const b=y.anchor,$=y.focus,ae=b.getNode(),he=$.getNode();if(c==="insertText"||c==="insertTranspose"){if(N===`
|
|
39
|
+
`)u.preventDefault(),dt(s,d,!1);else if(N===$t)u.preventDefault(),dt(s,f,void 0);else if(N==null&&u.dataTransfer){const me=u.dataTransfer.getData("text/plain");u.preventDefault(),y.insertRawText(me)}else N!=null&&Yi(y,h,N,u.timeStamp,!0)?(u.preventDefault(),dt(s,p,N)):Hr=N;Gs=u.timeStamp;return}switch(u.preventDefault(),c){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{dt(s,p,u);break}case"insertFromComposition":{vn(null),dt(s,p,u);break}case"insertLineBreak":{vn(null),dt(s,d,!1);break}case"insertParagraph":{vn(null),js&&!ue?(js=!1,dt(s,d,!1)):dt(s,f,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{dt(s,_,u);break}case"deleteByComposition":{i(ae,he)&&dt(s,T,u);break}case"deleteByDrag":case"deleteByCut":{dt(s,T,u);break}case"deleteContent":{dt(s,l,!1);break}case"deleteWordBackward":{dt(s,E,!0);break}case"deleteWordForward":{dt(s,E,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{dt(s,S,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{dt(s,S,!1);break}case"formatStrikeThrough":{dt(s,w,"strikethrough");break}case"formatBold":{dt(s,w,"bold");break}case"formatItalic":{dt(s,w,"italic");break}case"formatUnderline":{dt(s,w,"underline");break}case"historyUndo":{dt(s,M,void 0);break}case"historyRedo":{dt(s,m,void 0);break}}})}function C(u,s){u.stopPropagation(),zr(s,()=>{const c=_n(),h=u.data,y=o(u);if(h!=null&&Tt(c)&&Yi(c,y,h,u.timeStamp,!1)){Vs&&(D(s,h),Vs=!1);const N=c.anchor,b=N.getNode(),$=ar(s._window);if($===null)return;const ae=N.offset;(!ee||c.isCollapsed()||!_t(b)||$.anchorNode===null||b.getTextContent().slice(0,ae)+h+b.getTextContent().slice(ae+c.focus.offset)!==po($.anchorNode))&&dt(s,p,h);const he=h.length;De&&he>1&&u.inputType==="insertCompositionText"&&!s.isComposing()&&(c.anchor.offset-=he),!ne&&!ue&&!Re&&s.isComposing()&&(Gi=0,vn(null))}else bs(!1,s,h!==null?h:void 0),Vs&&(D(s,h||void 0),Vs=!1);_l()}),Hr=null}function x(u,s){zr(s,()=>{const c=_n();if(Tt(c)&&!s.isComposing()){const h=c.anchor,y=c.anchor.getNode();vn(h.key),(u.timeStamp<Gi+nr||h.type==="element"||!c.isCollapsed()||y.getFormat()!==c.format||_t(y)&&y.getStyle()!==c.style)&&dt(s,p,Kt)}})}function D(u,s){const c=u._compositionKey;if(vn(null),c!==null&&s!=null){if(s===""){const h=Cn(c),y=Pr(u.getElementByKey(c));y!==null&&y.nodeValue!==null&&_t(h)&&$r(h,y.nodeValue,null,null,!0);return}if(s[s.length-1]===`
|
|
40
|
+
`){const h=_n();if(Tt(h)){const y=h.focus;h.anchor.set(y.key,y.offset,y.type),dt(u,re,null);return}}}bs(!0,u,s)}function Q(u,s){De?Vs=!0:zr(s,()=>{D(s,u.data)})}function ge(u,s){if(Gi=u.timeStamp,Pl=u.keyCode,s.isComposing())return;const{keyCode:c,shiftKey:h,ctrlKey:y,metaKey:N,altKey:b}=u;if(!dt(s,v,u)){if(ls(c,y,b,N))dt(s,k,u);else if(Oa(c,y,h,b,N))dt(s,G,u);else if(Lc(c,y,b,N))dt(s,I,u);else if(wa(c,y,h,b,N))dt(s,P,u);else if(Ic(c,y,N))dt(s,H,u);else if(vl(c,y,N))dt(s,j,u);else if(Tl(c,h))js=!0,dt(s,re,u);else if(kc(c))dt(s,te,u);else if(ks(c,y))u.preventDefault(),js=!0,dt(s,d,!0);else if(El(c,h))js=!1,dt(s,re,u);else if(Ta(c,b,N,y))Zr(c)?dt(s,ce,u):(u.preventDefault(),dt(s,l,!0));else if(ki(c))dt(s,V,u);else if(Dc(c,y,h,b,N))Pi(c)?dt(s,z,u):(u.preventDefault(),dt(s,l,!1));else if(Ps(c,b,y))u.preventDefault(),dt(s,E,!0);else if(Na(c,b,y))u.preventDefault(),dt(s,E,!1);else if(Ca(c,N))u.preventDefault(),dt(s,S,!0);else if(Ea(c,N))u.preventDefault(),dt(s,S,!1);else if(ya(c,b,N,y))u.preventDefault(),dt(s,w,"bold");else if(Is(c,b,N,y))u.preventDefault(),dt(s,w,"underline");else if(os(c,b,N,y))u.preventDefault(),dt(s,w,"italic");else if(_a(c,b,y,N))dt(s,q,u);else if(Ac(c,h,N,y))u.preventDefault(),dt(s,M,void 0);else if(xa(c,h,N,y))u.preventDefault(),dt(s,m,void 0);else{const $=s._editorState._selection;Kr($)?Mc(c,h,N,y)?(u.preventDefault(),dt(s,Y,u)):Rc(c,h,N,y)?(u.preventDefault(),dt(s,W,u)):mo(c,N,y)&&(u.preventDefault(),dt(s,J,u)):!De&&mo(c,N,y)&&(u.preventDefault(),dt(s,J,u))}$s(y,h,b,N)&&dt(s,A,u)}}function Ae(u){let s=u.__lexicalEventHandles;return s===void 0&&(s=[],u.__lexicalEventHandles=s),s}const Ye=new Map;function Xe(u){const s=u.target,c=s==null?null:s.nodeType===9?s.defaultView:s.ownerDocument.defaultView,h=ar(c);if(h===null)return;const y=fl(h.anchorNode);if(y===null)return;Oo&&(Oo=!1,zr(y,()=>{const me=$o(),xe=h.anchorNode;if(xe===null)return;const we=xe.nodeType;if(we!==ke&&we!==Fe)return;const Ce=Fc(me,h,y,u);Cr(Ce)}));const N=Ii(y),b=N[N.length-1],$=b._key,ae=Ye.get($),he=ae||b;he!==y&&Fl(h,he,!1),Fl(h,y,!0),y!==b?Ye.set($,y):ae&&Ye.delete($)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function pt(u,s){Ys===0&&u.ownerDocument.addEventListener("selectionchange",Xe),Ys++,u.__lexicalEditor=s;const c=Ae(u);for(let h=0;h<kl.length;h++){const[y,N]=kl[h],b=typeof N=="function"?$=>{Pe($)||(Ke($),s.isEditable()&&N($,s))}:$=>{if(!Pe($)&&(Ke($),s.isEditable()))switch(y){case"cut":return dt(s,W,$);case"copy":return dt(s,Y,$);case"paste":return dt(s,_,$);case"dragstart":return dt(s,O,$);case"dragover":return dt(s,Z,$);case"dragend":return dt(s,oe,$);case"focus":return dt(s,_e,$);case"blur":return dt(s,B,$);case"drop":return dt(s,de,$)}};u.addEventListener(y,b),c.push(()=>{u.removeEventListener(y,b)})}}function wt(u){Ys!==0&&(Ys--,Ys===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const s=u.__lexicalEditor;s!=null&&(Ft(s),u.__lexicalEditor=null);const c=Ae(u);for(let h=0;h<c.length;h++)c[h]();u.__lexicalEventHandles=[]}function Ft(u){if(u._parentEditor!==null){const s=Ii(u),h=s[s.length-1]._key;Ye.get(h)===u&&Ye.delete(h)}else Ye.delete(u._key)}function zt(){Wr=!0}function Yn(u,s,c,h,y){Do=[u,s,c,h,y]}function Ar(u,s,c){fr();const h=u.__key,y=u.getParent();if(y===null)return;const N=cs(u);let b=!1;if(Tt(N)&&s){const $=N.anchor,ae=N.focus;$.key===h&&(Ga($,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0),ae.key===h&&(Ga(ae,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0)}else Kr(N)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(N)&&s&&!b){const $=u.getIndexWithinParent();Vr(u),Ua(N,y,$,-1)}else Vr(u);!c&&!si(y)&&!y.canBeEmpty()&&y.isEmpty()&&Ar(y,s),s&&Ur(y)&&y.isEmpty()&&y.selectEnd()}class oi{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(s){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(s){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,hl(this,s),this.__type!=="root"&&(fr(),li(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let s=this.__key;for(;s!==null;){if(s==="root")return!0;const c=Cn(s);if(c===null)break;s=c.__parent}return!1}isSelected(s){const c=s||_n();if(c==null)return!1;const h=c.getNodes().some(y=>y.__key===this.__key);return _t(this)?h:Tt(c)&&c.anchor.type==="element"&&c.focus.type==="element"&&c.anchor.key===c.focus.key&&c.anchor.offset===c.focus.offset?!1:h}getKey(){return this.__key}getIndexWithinParent(){const s=this.getParent();if(s===null)return-1;let c=s.getFirstChild(),h=0;for(;c!==null;){if(this.is(c))return h;h++,c=c.getNextSibling()}return-1}getParent(){const s=this.getLatest().__parent;return s===null?null:Cn(s)}getParentOrThrow(){const s=this.getParent();if(s===null)throw Error(`Expected node ${this.__key} to have a parent.`);return s}getTopLevelElement(){let s=this;for(;s!==null;){const c=s.getParent();if(si(c)){if(!et(s))throw Error("Children of root nodes must be elements");return s}s=c}return null}getTopLevelElementOrThrow(){const s=this.getTopLevelElement();if(s===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return s}getParents(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c),c=c.getParent();return s}getParentKeys(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c.__key),c=c.getParent();return s}getPreviousSibling(){const c=this.getLatest().__prev;return c===null?null:Cn(c)}getPreviousSiblings(){const s=[],c=this.getParent();if(c===null)return s;let h=c.getFirstChild();for(;h!==null&&!h.is(this);)s.push(h),h=h.getNextSibling();return s}getNextSibling(){const c=this.getLatest().__next;return c===null?null:Cn(c)}getNextSiblings(){const s=[];let c=this.getNextSibling();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getCommonAncestor(s){const c=this.getParents(),h=s.getParents();et(this)&&c.unshift(this),et(s)&&h.unshift(s);const y=c.length,N=h.length;if(y===0||N===0||c[y-1]!==h[N-1])return null;const b=new Set(h);for(let $=0;$<y;$++){const ae=c[$];if(b.has(ae))return ae}return null}is(s){return s==null?!1:this.__key===s.__key}isBefore(s){if(this===s)return!1;if(s.isParentOf(this))return!0;if(this.isParentOf(s))return!1;const c=this.getCommonAncestor(s);let h=0,y=0,N=this;for(;;){const b=N.getParentOrThrow();if(b===c){h=N.getIndexWithinParent();break}N=b}for(N=s;;){const b=N.getParentOrThrow();if(b===c){y=N.getIndexWithinParent();break}N=b}return h<y}isParentOf(s){const c=this.__key;if(c===s.__key)return!1;let h=s;for(;h!==null;){if(h.__key===c)return!0;h=h.getParent()}return!1}getNodesBetween(s){const c=this.isBefore(s),h=[],y=new Set;let N=this;for(;;){const b=N.__key;if(y.has(b)||(y.add(b),h.push(N)),N===s)break;const $=et(N)?c?N.getFirstChild():N.getLastChild():null;if($!==null){N=$;continue}const ae=c?N.getNextSibling():N.getPreviousSibling();if(ae!==null){N=ae;continue}const he=N.getParentOrThrow();if(y.has(he.__key)||h.push(he),he===s)break;let me=null,xe=he;do{if(xe===null)throw Error("getNodesBetween: ancestor is null");me=c?xe.getNextSibling():xe.getPreviousSibling(),xe=xe.getParent(),xe!==null&&me===null&&!y.has(xe.__key)&&h.push(xe)}while(me===null);N=me}return c||h.reverse(),h}isDirty(){const c=xn()._dirtyLeaves;return c!==null&&c.has(this.__key)}getLatest(){const s=Cn(this.__key);if(s===null)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return s}getWritable(){fr();const s=xi(),c=xn(),h=s._nodeMap,y=this.__key,N=this.getLatest(),b=N.__parent,$=c._cloneNotNeeded,ae=_n();if(ur(ae)&&ae.setCachedNodes(null),$.has(y))return Ri(N),N;const me=N.constructor.clone(N);return me.__parent=b,me.__next=N.__next,me.__prev=N.__prev,et(N)&&et(me)?(me.__first=N.__first,me.__last=N.__last,me.__size=N.__size,me.__indent=N.__indent,me.__format=N.__format,me.__dir=N.__dir):_t(N)&&_t(me)&&(me.__format=N.__format,me.__style=N.__style,me.__mode=N.__mode,me.__detail=N.__detail),$.add(y),me.__key=y,Ri(me),h.set(y,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(s,c){throw Error("createDOM: base method not extended")}updateDOM(s,c,h){throw Error("updateDOM: base method not extended")}exportDOM(s){return{element:this.createDOM(s._config,s)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(s){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(s){Ar(this,!0,s)}replace(s,c){fr();let h=_n();h!==null&&(h=h.clone()),Bs(this,s);const y=this.getLatest(),N=this.__key,b=s.__key,$=s.getWritable(),ae=this.getParentOrThrow().getWritable(),he=ae.__size;Vr($);const me=y.getPreviousSibling(),xe=y.getNextSibling(),we=y.__prev,Ce=y.__next,Ve=y.__parent;if(Ar(y,!1,!0),me===null)ae.__first=b;else{const Ue=me.getWritable();Ue.__next=b}if($.__prev=we,xe===null)ae.__last=b;else{const Ue=xe.getWritable();Ue.__prev=b}if($.__next=Ce,$.__parent=Ve,ae.__size=he,c){if(!(et(this)&&et($)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Ue=>{$.append(Ue)})}if(Tt(h)){Cr(h);const Ue=h.anchor,$e=h.focus;Ue.key===N&&mn(Ue,$),$e.key===N&&mn($e,$)}return lr()===N&&vn(b),$}insertAfter(s,c=!0){fr(),Bs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.getParent(),b=_n();let $=!1,ae=!1;if(N!==null){const Ce=s.getIndexWithinParent();if(Vr(y),Tt(b)){const Ve=N.__key,Ue=b.anchor,$e=b.focus;$=Ue.type==="element"&&Ue.key===Ve&&Ue.offset===Ce+1,ae=$e.type==="element"&&$e.key===Ve&&$e.offset===Ce+1}}const he=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),xe=y.__key,we=h.__next;if(he===null)me.__last=xe;else{const Ce=he.getWritable();Ce.__prev=xe}if(me.__size++,h.__next=xe,y.__next=we,y.__prev=h.__key,y.__parent=h.__parent,c&&Tt(b)){const Ce=this.getIndexWithinParent();Ua(b,me,Ce+1);const Ve=me.__key;$&&b.anchor.set(Ve,Ce+2,"element"),ae&&b.focus.set(Ve,Ce+2,"element")}return s}insertBefore(s,c=!0){fr(),Bs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.__key;Vr(y);const b=this.getPreviousSibling(),$=this.getParentOrThrow().getWritable(),ae=h.__prev,he=this.getIndexWithinParent();if(b===null)$.__first=N;else{const xe=b.getWritable();xe.__next=N}$.__size++,h.__prev=N,y.__prev=ae,y.__next=h.__key,y.__parent=h.__parent;const me=_n();if(c&&Tt(me)){const xe=this.getParentOrThrow();Ua(me,xe,he)}return s}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(s,c){fr();const h=this.getPreviousSibling(),y=this.getParentOrThrow();if(h===null)return y.select(0,0);if(et(h))return h.select();if(!_t(h)){const N=h.getIndexWithinParent()+1;return y.select(N,N)}return h.select(s,c)}selectNext(s,c){fr();const h=this.getNextSibling(),y=this.getParentOrThrow();if(h===null)return y.select();if(et(h))return h.select(0,0);if(!_t(h)){const N=h.getIndexWithinParent();return y.select(N,N)}return h.select(s,c)}markDirty(){this.getWritable()}}function li(u,s){const c=xn()._nodes.get(u);if(c===void 0)throw Error(`Create node: Attempted to create node ${s.name} that was not configured to be used on the editor.`);const h=c.klass;if(h!==s)throw Error(`Create node: Type ${u} in node ${s.name} does not match registered node ${h.name} with the same type`)}function Hl(u,s,c){const h=s.getParentOrThrow().getLastChild();let y=s;const N=[s];for(;y!==h;){if(!y.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");y=y.getNextSibling(),N.push(y)}let b=u;for(const $ of N)b=b.insertAfter($)}class ji extends oi{static getType(){return"linebreak"}static clone(s){return new ji(s.__key)}constructor(s){super(s)}getTextContent(){return`
|
|
41
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:s=>{const c=s.parentElement;let h,y;return c!==null&&((h=c.firstChild)===s||h.nextSibling===s&&h.nodeType===Fe&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((y=c.lastChild)===s||y.previousSibling===s&&y.nodeType===Fe&&(y.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Ao,priority:0}}}}static importJSON(s){return ps()}exportJSON(){return{type:"linebreak",version:1}}}function Ao(u){return{node:ps()}}function ps(){return Dr(new ji)}function ai(u){return u instanceof ji}function Mr(u,s){return s&Le?"code":s&rt?"mark":s&Me?"sub":s&je?"sup":null}function Vi(u,s){return s&Oe?"strong":s&ie?"em":"span"}function Mo(u,s,c,h,y){const N=h.classList;let b=$i(y,"base");b!==void 0&&N.add(...b),b=$i(y,"underlineStrikethrough");let $=!1;const ae=s&ve&&s&le,he=c&ve&&c≤b!==void 0&&(he?($=!0,ae||N.add(...b)):ae&&N.remove(...b));for(const me in nn){const we=nn[me];if(b=$i(y,me),b!==void 0)if(c&we){if($&&(me==="underline"||me==="strikethrough")){s&we&&N.remove(...b);continue}(!(s&we)||ae&&me==="underline"||me==="strikethrough")&&N.add(...b)}else s&we&&N.remove(...b)}}function Fa(u,s){const c=u.length,h=s.length;let y=0,N=0;for(;y<c&&y<h&&u[y]===s[y];)y++;for(;N+y<c&&N+y<h&&u[c-N-1]===s[h-N-1];)N++;return[y,c-y-N,s.slice(y,h-N)]}function Ba(u,s,c){const h=s.firstChild,y=c.isComposing(),b=u+(y?mt:"");if(h==null)s.textContent=b;else{const $=h.nodeValue;if($!==b)if(y||De){const[ae,he,me]=Fa($,b);he!==0&&h.deleteData(ae,he),h.insertData(ae,me)}else h.nodeValue=b}}function Wl(u,s,c,h,y,N){Ba(y,u,s);const $=N.theme.text;$!==void 0&&Mo(c,0,h,u,$)}function qs(u,s){const c=document.createElement(s);return c.appendChild(u),c}class Jr extends oi{static getType(){return"text"}static clone(s){return new Jr(s.__text,s.__key)}constructor(s,c){super(c),this.__text=s,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const s=this.getLatest();return ot[s.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===Ut}isComposing(){return this.__key===lr()}isSegmented(){return this.getLatest().__mode===en}isDirectionless(){return(this.getLatest().__detail&st)!==0}isUnmergeable(){return(this.getLatest().__detail&vt)!==0}hasFormat(s){const c=nn[s];return(this.getFormat()&c)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(s,c){const y=this.getLatest().__format;return Bn(y,s,c)}createDOM(s,c){const h=this.__format,y=Mr(this,h),N=Vi(this,h),b=y===null?N:y,$=document.createElement(b);let ae=$;this.hasFormat("code")&&$.setAttribute("spellcheck","false"),y!==null&&(ae=document.createElement(N),$.appendChild(ae));const he=this.__text;Wl(ae,this,N,h,he,s);const me=this.__style;return me!==""&&($.style.cssText=me),$}updateDOM(s,c,h){const y=this.__text,N=s.__format,b=this.__format,$=Mr(this,N),ae=Mr(this,b),he=Vi(this,N),me=Vi(this,b);if(($===null?he:$)!==(ae===null?me:ae))return!0;if($===ae&&he!==me){const Qe=c.firstChild;if(Qe==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const ht=document.createElement(me);return Wl(ht,this,me,b,y,h),c.replaceChild(ht,Qe),!1}let Ce=c;if(ae!==null&&$!==null&&(Ce=c.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");Ba(y,Ce,this);const Ue=h.theme.text;Ue!==void 0&&N!==b&&Mo(me,N,b,Ce,Ue);const $e=s.__style,Rt=this.__style;return $e!==Rt&&(c.style.cssText=Rt),!1}static importDOM(){return{"#text":()=>({conversion:bo,priority:0}),b:()=>({conversion:Kl,priority:0}),code:()=>({conversion:Xr,priority:0}),em:()=>({conversion:Xr,priority:0}),i:()=>({conversion:Xr,priority:0}),s:()=>({conversion:Xr,priority:0}),span:()=>({conversion:Ha,priority:0}),strong:()=>({conversion:Xr,priority:0}),sub:()=>({conversion:Xr,priority:0}),sup:()=>({conversion:Xr,priority:0}),u:()=>({conversion:Xr,priority:0})}}static importJSON(s){const c=Dn(s.text);return c.setFormat(s.format),c.setDetail(s.detail),c.setMode(s.mode),c.setStyle(s.style),c}exportDOM(s){let{element:c}=super.exportDOM(s);if(!(c!==null&&Ws(c)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return c.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(c=qs(c,"b")),this.hasFormat("italic")&&(c=qs(c,"i")),this.hasFormat("strikethrough")&&(c=qs(c,"s")),this.hasFormat("underline")&&(c=qs(c,"u")),{element:c}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(s,c){}setFormat(s){const c=this.getWritable();return c.__format=typeof s=="string"?nn[s]:s,c}setDetail(s){const c=this.getWritable();return c.__detail=typeof s=="string"?Or[s]:s,c}setStyle(s){const c=this.getWritable();return c.__style=s,c}toggleFormat(s){const c=this.getFormat(),h=Bn(c,s,null);return this.setFormat(h)}toggleDirectionless(){const s=this.getWritable();return s.__detail^=st,s}toggleUnmergeable(){const s=this.getWritable();return s.__detail^=vt,s}setMode(s){const c=Ze[s];if(this.__mode===c)return this;const h=this.getWritable();return h.__mode=c,h}setTextContent(s){if(this.__text===s)return this;const c=this.getWritable();return c.__text=s,c}select(s,c){fr();let h=s,y=c;const N=_n(),b=this.getTextContent(),$=this.__key;if(typeof b=="string"){const ae=b.length;h===void 0&&(h=ae),y===void 0&&(y=ae)}else h=0,y=0;if(Tt(N)){const ae=lr();(ae===N.anchor.key||ae===N.focus.key)&&vn($),N.setTextNodeRange(this,h,this,y)}else return Yd($,h,$,y,"text","text");return N}selectStart(){return this.select(0,0)}selectEnd(){const s=this.getTextContentSize();return this.select(s,s)}spliceText(s,c,h,y){const N=this.getWritable(),b=N.__text,$=h.length;let ae=s;ae<0&&(ae=$+ae,ae<0&&(ae=0));const he=_n();if(y&&Tt(he)){const xe=s+$;he.setTextNodeRange(N,xe,N,xe)}const me=b.slice(0,ae)+h+b.slice(ae+c);return N.__text=me,N}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...s){fr();const c=this.getLatest(),h=c.getTextContent(),y=c.__key,N=lr(),b=new Set(s),$=[],ae=h.length;let he="";for(let cn=0;cn<ae;cn++)he!==""&&b.has(cn)&&($.push(he),he=""),he+=h[cn];he!==""&&$.push(he);const me=$.length;if(me===0)return[];if($[0]===h)return[c];const xe=$[0],we=c.getParentOrThrow();let Ce;const Ve=c.getFormat(),Ue=c.getStyle(),$e=c.__detail;let Rt=!1;c.isSegmented()?(Ce=Dn(xe),Ce.__format=Ve,Ce.__style=Ue,Ce.__detail=$e,Rt=!0):(Ce=c.getWritable(),Ce.__text=xe);const Qe=_n(),ht=[Ce];let qt=xe.length;for(let cn=1;cn<me;cn++){const ir=$[cn],ms=ir.length,hr=Dn(ir).getWritable();hr.__format=Ve,hr.__style=Ue,hr.__detail=$e;const rn=hr.__key,kn=qt+ms;if(Tt(Qe)){const ui=Qe.anchor,Zi=Qe.focus;ui.key===y&&ui.type==="text"&&ui.offset>qt&&ui.offset<=kn&&(ui.key=rn,ui.offset-=qt,Qe.dirty=!0),Zi.key===y&&Zi.type==="text"&&Zi.offset>qt&&Zi.offset<=kn&&(Zi.key=rn,Zi.offset-=qt,Qe.dirty=!0)}N===y&&vn(rn),qt=kn,ht.push(hr)}pl(this);const Wt=we.getWritable(),Dt=this.getIndexWithinParent();return Rt?(Wt.splice(Dt,0,ht),this.remove()):Wt.splice(Dt,1,ht),Tt(Qe)&&Ua(Qe,we,Dt,me-1),ht}mergeWithSibling(s){const c=s===this.getPreviousSibling();if(!c&&s!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const h=this.__key,y=s.__key,N=this.__text,b=N.length;lr()===y&&vn(h);const ae=_n();if(Tt(ae)){const we=ae.anchor,Ce=ae.focus;we!==null&&we.key===y&&(Vd(we,c,h,s,b),ae.dirty=!0),Ce!==null&&Ce.key===y&&(Vd(Ce,c,h,s,b),ae.dirty=!0)}const he=s.__text,me=c?he+N:N+he;this.setTextContent(me);const xe=this.getWritable();return s.remove(),xe}isTextEntity(){return!1}}function Ha(u){const s=u,c=s.style.fontWeight==="700",h=s.style.textDecoration==="line-through",y=s.style.fontStyle==="italic",N=s.style.textDecoration==="underline",b=s.style.verticalAlign;return{forChild:$=>(_t($)&&(c&&$.toggleFormat("bold"),h&&$.toggleFormat("strikethrough"),y&&$.toggleFormat("italic"),N&&$.toggleFormat("underline"),b==="sub"&&$.toggleFormat("subscript"),b==="super"&&$.toggleFormat("superscript")),$),node:null}}function Kl(u){const c=u.style.fontWeight==="normal";return{forChild:h=>(_t(h)&&!c&&h.toggleFormat("bold"),h),node:null}}const Ro=new WeakMap;function Wa(u){return u.nodeName==="PRE"||u.nodeType===ke&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function Zs(u){let s,c=u.parentNode;const h=[u];for(;c!==null&&(s=Ro.get(c))===void 0&&!Wa(c);)h.push(c),c=c.parentNode;const y=s===void 0?c:s;for(let N=0;N<h.length;N++)Ro.set(h[N],y);return y}function bo(u){const s=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let h=s.textContent||"";if(Zs(s)!==null){const y=h.split(/(\r?\n|\t)/),N=[],b=y.length;for(let $=0;$<b;$++){const ae=y[$];ae===`
|
|
42
42
|
`||ae===`\r
|
|
43
|
-
`?N.push(ps()):ae===" "?N.push(Lo()):ae!==""&&N.push(Dn(ae))}return{node:N}}if(h=h.replace(/\r/g,"").replace(/[ \t\n]+/g," "),h==="")return{node:null};if(h[0]===" "){let y=s,N=!0;for(;y!==null&&(y=Ka(y,!1))!==null;){const b=y.textContent||"";if(b.length>0){/[ \t\n]$/.test(b)&&(h=h.slice(1)),N=!1;break}}N&&(h=h.slice(1))}if(h[h.length-1]===" "){let y=s,N=!0;for(;y!==null&&(y=Ka(y,!0))!==null;)if((y.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){N=!1;break}N&&(h=h.slice(0,h.length-1))}return h===""?{node:null}:{node:Dn(h)}}const zl=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)$/,"i");function Ka(u,s){let c=u;for(;;){let h;for(;(h=s?c.nextSibling:c.previousSibling)===null;){const N=c.parentElement;if(N===null)return null;c=N}if(c=h,c.nodeType===ke){const N=c.style.display;if(N===""&&c.nodeName.match(zl)===null||N!==""&&!N.startsWith("inline"))return null}let y=c;for(;(y=s?c.firstChild:c.lastChild)!==null;)c=y;if(c.nodeType===Fe)return c;if(c.nodeName==="BR")return null}}const Ul={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Xr(u){const s=Ul[u.nodeName.toLowerCase()];return s===void 0?{node:null}:{forChild:c=>(_t(c)&&!c.hasFormat(s)&&c.toggleFormat(s),c),node:null}}function Dn(u=""){return Dr(new Jr(u))}function _t(u){return u instanceof Jr}class xr extends Jr{static getType(){return"tab"}static clone(s){const c=new xr(s.__key);return c.__text=s.__text,c.__format=s.__format,c.__style=s.__style,c}constructor(s){super(" ",s),this.__detail=vt}static importDOM(){return null}static importJSON(s){const c=Lo();return c.setFormat(s.format),c.setStyle(s.style),c}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(s){throw Error("TabNode does not support setTextContent")}setDetail(s){throw Error("TabNode does not support setDetail")}setMode(s){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Lo(){return Dr(new xr)}function Io(u){return u instanceof xr}class Pc{constructor(s,c,h){this._selection=null,this.key=s,this.offset=c,this.type=h}is(s){return this.key===s.key&&this.offset===s.offset&&this.type===s.type}isBefore(s){let c=this.getNode(),h=s.getNode();const y=this.offset,N=s.offset;if(et(c)){const b=c.getDescendantByIndex(y);c=b??c}if(et(h)){const b=h.getDescendantByIndex(N);h=b??h}return c===h?y<N:c.isBefore(h)}getNode(){const s=this.key,c=Cn(s);if(c===null)throw Error("Point.getNode: node not found");return c}set(s,c,h){const y=this._selection,N=this.key;this.key=s,this.offset=c,this.type=h,Fo()||(lr()===N&&vn(s),y!==null&&(y.setCachedNodes(null),y.dirty=!0))}}function Rr(u,s,c){return new Pc(u,s,c)}function ko(u,s){let c=s.__key,h=u.offset,y="element";if(_t(s)){y="text";const N=s.getTextContentSize();h>N&&(h=N)}else if(!et(s)){const N=s.getNextSibling();if(_t(N))c=N.__key,h=0,y="text";else{const b=s.getParent();b&&(c=b.__key,h=s.getIndexWithinParent()+1)}}u.set(c,h,y)}function mn(u,s){if(et(s)){const c=s.getLastDescendant();et(c)||_t(c)?ko(u,c):ko(u,s)}else ko(u,s)}function Xn(u,s,c,h){const y=u.getNode(),N=y.getChildAtIndex(u.offset),b=Dn(),$=Ur(y)?qi().append(b):b;b.setFormat(c),b.setStyle(h),N===null?y.append($):N.insertBefore($),u.is(s)&&s.set(b.__key,0,"text"),u.set(b.__key,0,"text")}function Tn(u,s,c,h){u.key=s,u.offset=c,u.type=h}class br{constructor(s,c){this.anchor=s,this.focus=c,s._selection=this,c._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){return ur(s)?this.anchor.is(s.anchor)&&this.focus.is(s.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return ci(this)}}class Ti{constructor(s){this.dirty=!1,this._nodes=s,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){if(!Kr(s))return!1;const c=this._nodes,h=s._nodes;return c.size===h.size&&Array.from(c).every(y=>h.has(y))}add(s){this.dirty=!0,this._nodes.add(s),this._cachedNodes=null}delete(s){this.dirty=!0,this._nodes.delete(s),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(s){return this._nodes.has(s)}clone(){return new Ti(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(s){}insertText(){}insertNodes(s){const c=this.getNodes(),h=c.length,y=c[h-1];let N;if(_t(y))N=y.select();else{const b=y.getIndexWithinParent()+1;N=y.getParentOrThrow().select(b,b)}N.insertNodes(s);for(let b=0;b<h;b++)c[b].remove()}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const c=this._nodes,h=[];for(const y of c){const N=Cn(y);N!==null&&h.push(N)}return Fo()||(this._cachedNodes=h),h}getTextContent(){const s=this.getNodes();let c="";for(let h=0;h<s.length;h++)c+=s[h].getTextContent();return c}}function Tt(u){return u instanceof rr}function ur(u){return u instanceof br}function Lr(u){const[s,,c]=qd(u),h=c.getChildren(),y=h.length,N=h[0].getChildren().length,b=new Array(y);for(let $=0;$<y;$++)b[$]=new Array(N);for(let $=0;$<y;$++){const he=h[$].getChildren();let me=0;for(let xe=0;xe<he.length;xe++){for(;b[$][me];)me++;const we=he[xe],Ce=we.__rowSpan||1,
|
|
43
|
+
`?N.push(ps()):ae===" "?N.push(Lo()):ae!==""&&N.push(Dn(ae))}return{node:N}}if(h=h.replace(/\r/g,"").replace(/[ \t\n]+/g," "),h==="")return{node:null};if(h[0]===" "){let y=s,N=!0;for(;y!==null&&(y=Ka(y,!1))!==null;){const b=y.textContent||"";if(b.length>0){/[ \t\n]$/.test(b)&&(h=h.slice(1)),N=!1;break}}N&&(h=h.slice(1))}if(h[h.length-1]===" "){let y=s,N=!0;for(;y!==null&&(y=Ka(y,!0))!==null;)if((y.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){N=!1;break}N&&(h=h.slice(0,h.length-1))}return h===""?{node:null}:{node:Dn(h)}}const zl=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)$/,"i");function Ka(u,s){let c=u;for(;;){let h;for(;(h=s?c.nextSibling:c.previousSibling)===null;){const N=c.parentElement;if(N===null)return null;c=N}if(c=h,c.nodeType===ke){const N=c.style.display;if(N===""&&c.nodeName.match(zl)===null||N!==""&&!N.startsWith("inline"))return null}let y=c;for(;(y=s?c.firstChild:c.lastChild)!==null;)c=y;if(c.nodeType===Fe)return c;if(c.nodeName==="BR")return null}}const Ul={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Xr(u){const s=Ul[u.nodeName.toLowerCase()];return s===void 0?{node:null}:{forChild:c=>(_t(c)&&!c.hasFormat(s)&&c.toggleFormat(s),c),node:null}}function Dn(u=""){return Dr(new Jr(u))}function _t(u){return u instanceof Jr}class xr extends Jr{static getType(){return"tab"}static clone(s){const c=new xr(s.__key);return c.__text=s.__text,c.__format=s.__format,c.__style=s.__style,c}constructor(s){super(" ",s),this.__detail=vt}static importDOM(){return null}static importJSON(s){const c=Lo();return c.setFormat(s.format),c.setStyle(s.style),c}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(s){throw Error("TabNode does not support setTextContent")}setDetail(s){throw Error("TabNode does not support setDetail")}setMode(s){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Lo(){return Dr(new xr)}function Io(u){return u instanceof xr}class Pc{constructor(s,c,h){this._selection=null,this.key=s,this.offset=c,this.type=h}is(s){return this.key===s.key&&this.offset===s.offset&&this.type===s.type}isBefore(s){let c=this.getNode(),h=s.getNode();const y=this.offset,N=s.offset;if(et(c)){const b=c.getDescendantByIndex(y);c=b??c}if(et(h)){const b=h.getDescendantByIndex(N);h=b??h}return c===h?y<N:c.isBefore(h)}getNode(){const s=this.key,c=Cn(s);if(c===null)throw Error("Point.getNode: node not found");return c}set(s,c,h){const y=this._selection,N=this.key;this.key=s,this.offset=c,this.type=h,Fo()||(lr()===N&&vn(s),y!==null&&(y.setCachedNodes(null),y.dirty=!0))}}function Rr(u,s,c){return new Pc(u,s,c)}function ko(u,s){let c=s.__key,h=u.offset,y="element";if(_t(s)){y="text";const N=s.getTextContentSize();h>N&&(h=N)}else if(!et(s)){const N=s.getNextSibling();if(_t(N))c=N.__key,h=0,y="text";else{const b=s.getParent();b&&(c=b.__key,h=s.getIndexWithinParent()+1)}}u.set(c,h,y)}function mn(u,s){if(et(s)){const c=s.getLastDescendant();et(c)||_t(c)?ko(u,c):ko(u,s)}else ko(u,s)}function Xn(u,s,c,h){const y=u.getNode(),N=y.getChildAtIndex(u.offset),b=Dn(),$=Ur(y)?qi().append(b):b;b.setFormat(c),b.setStyle(h),N===null?y.append($):N.insertBefore($),u.is(s)&&s.set(b.__key,0,"text"),u.set(b.__key,0,"text")}function Tn(u,s,c,h){u.key=s,u.offset=c,u.type=h}class br{constructor(s,c){this.anchor=s,this.focus=c,s._selection=this,c._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){return ur(s)?this.anchor.is(s.anchor)&&this.focus.is(s.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return ci(this)}}class Ti{constructor(s){this.dirty=!1,this._nodes=s,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){if(!Kr(s))return!1;const c=this._nodes,h=s._nodes;return c.size===h.size&&Array.from(c).every(y=>h.has(y))}add(s){this.dirty=!0,this._nodes.add(s),this._cachedNodes=null}delete(s){this.dirty=!0,this._nodes.delete(s),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(s){return this._nodes.has(s)}clone(){return new Ti(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(s){}insertText(){}insertNodes(s){const c=this.getNodes(),h=c.length,y=c[h-1];let N;if(_t(y))N=y.select();else{const b=y.getIndexWithinParent()+1;N=y.getParentOrThrow().select(b,b)}N.insertNodes(s);for(let b=0;b<h;b++)c[b].remove()}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const c=this._nodes,h=[];for(const y of c){const N=Cn(y);N!==null&&h.push(N)}return Fo()||(this._cachedNodes=h),h}getTextContent(){const s=this.getNodes();let c="";for(let h=0;h<s.length;h++)c+=s[h].getTextContent();return c}}function Tt(u){return u instanceof rr}function ur(u){return u instanceof br}function Lr(u){const[s,,c]=qd(u),h=c.getChildren(),y=h.length,N=h[0].getChildren().length,b=new Array(y);for(let $=0;$<y;$++)b[$]=new Array(N);for(let $=0;$<y;$++){const he=h[$].getChildren();let me=0;for(let xe=0;xe<he.length;xe++){for(;b[$][me];)me++;const we=he[xe],Ce=we.__rowSpan||1,Ve=we.__colSpan||1;for(let Ue=0;Ue<Ce;Ue++)for(let $e=0;$e<Ve;$e++)b[$+Ue][me+$e]=we;if(s===we)return{colSpan:Ve,columnIndex:me,rowIndex:$,rowSpan:Ce};me+=Ve}}return null}class rr extends br{constructor(s,c,h,y){super(s,c),this.format=h,this.style=y}is(s){return Tt(s)?this.anchor.is(s.anchor)&&this.focus.is(s.focus)&&this.format===s.format&&this.style===s.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const c=this.anchor,h=this.focus,y=c.isBefore(h),N=y?c:h,b=y?h:c;let $=N.getNode(),ae=b.getNode();const he=N.offset,me=b.offset;if(et($)){const we=$.getDescendantByIndex(he);$=we??$}if(et(ae)){let we=ae.getDescendantByIndex(me);we!==null&&we!==$&&ae.getChildAtIndex(me)===we&&(we=we.getPreviousSibling()),ae=we??ae}let xe;return $.is(ae)?et($)&&$.getChildrenSize()>0?xe=[]:xe=[$]:xe=$.getNodesBetween(ae),Fo()||(this._cachedNodes=xe),xe}setTextNodeRange(s,c,h,y){Tn(this.anchor,s.__key,c,"text"),Tn(this.focus,h.__key,y,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const s=this.getNodes();if(s.length===0)return"";const c=s[0],h=s[s.length-1],y=this.anchor,N=this.focus,b=y.isBefore(N),[$,ae]=ci(this);let he="",me=!0;for(let xe=0;xe<s.length;xe++){const we=s[xe];if(et(we)&&!we.isInline())me||(he+=`
|
|
44
44
|
`),we.isEmpty()?me=!1:me=!0;else if(me=!1,_t(we)){let Ce=we.getTextContent();we===c?we===h?(y.type!=="element"||N.type!=="element"||N.offset===y.offset)&&(Ce=$<ae?Ce.slice($,ae):Ce.slice(ae,$)):Ce=b?Ce.slice($):Ce.slice(ae):we===h&&(Ce=b?Ce.slice(0,ae):Ce.slice(0,$)),he+=Ce}else(An(we)||ai(we))&&(we!==h||!this.isCollapsed())&&(he+=we.getTextContent())}return he}applyDOMRange(s){const c=xn(),y=c.getEditorState()._selection,N=Gd(s.startContainer,s.startOffset,s.endContainer,s.endOffset,c,y);if(N===null)return;const[b,$]=N;Tn(this.anchor,b.key,b.offset,b.type),Tn(this.focus,$.key,$.offset,$.type),this._cachedNodes=null}clone(){const s=this.anchor,c=this.focus;return new rr(Rr(s.key,s.offset,s.type),Rr(c.key,c.offset,c.type),this.format,this.style)}toggleFormat(s){this.format=Bn(this.format,s,null),this.dirty=!0}setStyle(s){this.style=s,this.dirty=!0}hasFormat(s){const c=nn[s];return(this.format&c)!==0}insertRawText(s){const c=s.split(/(\r?\n|\t)/),h=[],y=c.length;for(let N=0;N<y;N++){const b=c[N];b===`
|
|
45
45
|
`||b===`\r
|
|
46
|
-
`?h.push(ps()):b===" "?h.push(Lo()):h.push(Dn(b))}this.insertNodes(h)}insertText(s){const c=this.anchor,h=this.focus,y=this.isCollapsed()||c.isBefore(h),N=this.format,b=this.style;y&&c.type==="element"?Xn(c,h,N,b):!y&&h.type==="element"&&Xn(h,c,N,b);const $=this.getNodes(),ae=$.length,he=y?c:h,me=y?h:c,xe=he.offset,we=me.offset;let Ce=$[0];if(!_t(Ce))throw Error("insertText: first node is not a text node");const Ue=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Rt=ae-1;let Qe=$[Rt];if(this.isCollapsed()&&xe===Ue&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ht=Ce.getNextSibling();if((!_t(ht)||!ht.canInsertTextBefore()||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextAfter()?Ce.insertAfter(ht):$e.insertAfter(ht)),ht.select(0,0),Ce=ht,s!==""){this.insertText(s);return}}else if(this.isCollapsed()&&xe===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ht=Ce.getPreviousSibling();if((!_t(ht)||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextBefore()?Ce.insertBefore(ht):$e.insertBefore(ht)),ht.select(),Ce=ht,s!==""){this.insertText(s);return}}else if(Ce.isSegmented()&&xe!==Ue){const ht=Dn(Ce.getTextContent());ht.setFormat(N),Ce.replace(ht),Ce=ht}else if(!this.isCollapsed()&&s!==""){const ht=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ht)&&(!ht.canInsertTextBefore()||!ht.canInsertTextAfter())){this.insertText(""),Ud(this.anchor,this.focus,null),this.insertText(s);return}}if(ae===1){if(Ce.isToken()){const Dt=Dn(s);Dt.select(),Ce.replace(Dt);return}const ht=Ce.getFormat(),qt=Ce.getStyle();if(xe===we&&(ht!==N||qt!==b))if(Ce.getTextContent()==="")Ce.setFormat(N),Ce.setStyle(b);else{const Dt=Dn(s);if(Dt.setFormat(N),Dt.setStyle(b),Dt.select(),xe===0)Ce.insertBefore(Dt,!1);else{const[cn]=Ce.splitText(xe);cn.insertAfter(Dt,!1)}Dt.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);return}else if(Io(Ce)){const Dt=Dn(s);Dt.setFormat(N),Dt.setStyle(b),Dt.select(),Ce.replace(Dt);return}const Wt=we-xe;Ce=Ce.spliceText(xe,Wt,s,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=s.length:(this.format=ht,this.style=qt))}else{const ht=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),qt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),Dt=Qe;if(!qt.is(Wt)&&Wt.isInline())do Dt=Wt,Wt=Wt.getParentOrThrow();while(Wt.isInline());if(me.type==="text"&&(we!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<we)if(_t(Qe)&&!Qe.isToken()&&we!==Qe.getTextContentSize()){if(Qe.isSegmented()){const rn=Dn(Qe.getTextContent());Qe.replace(rn),Qe=rn}!Ur(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,we,"")),ht.add(Qe.__key)}else{const rn=Qe.getParentOrThrow();!rn.canBeEmpty()&&rn.getChildrenSize()===1?rn.remove():Qe.remove()}else ht.add(Qe.__key);const cn=Wt.getChildren(),ir=new Set($),ms=qt.is(Wt),hr=qt.isInline()&&Ce.getNextSibling()===null?qt:Ce;for(let rn=cn.length-1;rn>=0;rn--){const kn=cn[rn];if(kn.is(Ce)||et(kn)&&kn.isParentOf(Ce))break;kn.isAttached()&&(!ir.has(kn)||kn.is(Dt)?ms||hr.insertAfter(kn,!1):kn.remove())}if(!ms){let rn=Wt,kn=null;for(;rn!==null;){const ui=rn.getChildren(),Zi=ui.length;(Zi===0||ui[Zi-1].is(kn))&&(ht.delete(rn.__key),kn=rn),rn=rn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(xe,Ue-xe,s,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);else if(xe===Ue)Ce.select();else{const rn=Dn(s);rn.select(),Ce.replace(rn)}for(let rn=1;rn<ae;rn++){const kn=$[rn],ui=kn.__key;ht.has(ui)||kn.remove()}}}removeText(){this.insertText("")}formatText(s){if(this.isCollapsed()){this.toggleFormat(s),vn(null);return}const c=this.getNodes(),h=[];for(const Qe of c)_t(Qe)&&h.push(Qe);const y=h.length;if(y===0){this.toggleFormat(s),vn(null);return}const N=this.anchor,b=this.focus,$=this.isBackward(),ae=$?b:N,he=$?N:b;let me=0,xe=h[0],we=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&we===xe.getTextContentSize()&&(me=1,xe=h[1],we=0),xe==null)return;const Ce=xe.getFormatFlags(s,null),je=y-1;let Ue=h[je];const $e=he.type==="text"?he.offset:Ue.getTextContentSize();if(xe.is(Ue)){if(we===$e)return;if(we===0&&$e===xe.getTextContentSize())xe.setFormat(Ce);else{const Qe=xe.splitText(we,$e),ht=we===0?Qe[0]:Qe[1];ht.setFormat(Ce),ae.type==="text"&&ae.set(ht.__key,0,"text"),he.type==="text"&&he.set(ht.__key,$e-we,"text")}this.format=Ce;return}we!==0&&([,xe]=xe.splitText(we),we=0),xe.setFormat(Ce);const Rt=Ue.getFormatFlags(s,Ce);$e>0&&($e!==Ue.getTextContentSize()&&([Ue]=Ue.splitText($e)),Ue.setFormat(Rt));for(let Qe=me+1;Qe<je;Qe++){const ht=h[Qe];if(!ht.isToken()){const qt=ht.getFormatFlags(s,Rt);ht.setFormat(qt)}}ae.type==="text"&&ae.set(xe.__key,we,"text"),he.type==="text"&&he.set(Ue.__key,$e,"text"),this.format=Ce|Rt}insertNodes(s){if(s.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const $e=_n();if(!Tt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(s)}const c=xo(this.anchor.getNode(),Hi),h=s[s.length-1];if("__language"in c&&et(c)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Bc(this);c.splice($e,0,s),h.selectEnd()}return}const y=$e=>(et($e)||An($e))&&!$e.isInline();if(!s.some(y)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Bc(this);c.splice($e,0,s),h.selectEnd();return}const N=A_(s),b=N.getLastDescendant(),$=N.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,he=$e=>et($e)&&Hi($e)&&!$e.isEmpty()&&et(c)&&(!c.isEmpty()||ae(c)),xe=!et(c)||!c.isEmpty()?this.insertParagraph():null,we=$[$.length-1];let Ce=$[0];if(he(Ce)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");c.append(...Ce.getChildren()),Ce=$[1]}Ce&&Hl(c,Ce);const je=xo(b,Hi);xe&&et(je)&&(ae(xe)||Hi(we))&&(je.append(...xe.getChildren()),xe.remove()),et(c)&&c.isEmpty()&&c.remove(),b.selectEnd();const Ue=et(c)?c.getLastChild():null;ai(Ue)&&je!==c&&Ue.remove()}insertParagraph(){if(this.anchor.key==="root"){const b=qi();return tr().splice(this.anchor.offset,0,[b]),b.select(),b}const s=Bc(this),c=xo(this.anchor.getNode(),Hi);if(!et(c))throw Error("Expected ancestor to be an ElementNode");const h=c.getChildAtIndex(s),y=h?[h,...h.getNextSiblings()]:[],N=c.insertNewAfter(this,!1);return N?(N.append(...y),N.selectStart(),N):null}insertLineBreak(s){const c=ps();if(this.insertNodes([c]),s){const h=c.getParentOrThrow(),y=c.getIndexWithinParent();h.select(y,y)}}extract(){const s=this.getNodes(),c=s.length,h=c-1,y=this.anchor,N=this.focus;let b=s[0],$=s[h];const[ae,he]=ci(this);if(c===0)return[];if(c===1){if(_t(b)&&!this.isCollapsed()){const xe=ae>he?he:ae,we=ae>he?ae:he,Ce=b.splitText(xe,we),je=xe===0?Ce[0]:Ce[1];return je!=null?[je]:[]}return[b]}const me=y.isBefore(N);if(_t(b)){const xe=me?ae:he;xe===b.getTextContentSize()?s.shift():xe!==0&&([,b]=b.splitText(xe),s[0]=b)}if(_t($)){const we=$.getTextContent().length,Ce=me?he:ae;Ce===0?s.pop():Ce!==we&&([$]=$.splitText(Ce),s[h]=$)}return s}modify(s,c,h){const y=this.focus,N=this.anchor,b=s==="move",$=wl(y,c);if(An($)&&!$.isIsolated()){if(b&&$.isKeyboardSelectable()){const Ce=$c();Ce.add($.__key),Cr(Ce);return}const we=c?$.getPreviousSibling():$.getNextSibling();if(_t(we)){const Ce=we.__key,je=c?we.getTextContent().length:0;y.set(Ce,je,"text"),b&&N.set(Ce,je,"text");return}else{const Ce=$.getParentOrThrow();let je,Ue;et(we)?(Ue=we.__key,je=c?we.getChildrenSize():0):(je=$.getIndexWithinParent(),Ue=Ce.__key,c||je++),y.set(Ue,je,"element"),b&&N.set(Ue,je,"element");return}}const ae=xn(),he=ar(ae._window);if(!he)return;const me=ae._blockCursorElement,xe=ae._rootElement;if(xe!==null&&me!==null&&et($)&&!$.isInline()&&!$.canBeEmpty()&&Hs(me,ae,xe),za(he,s,c?"backward":"forward",h),he.rangeCount>0){const we=he.getRangeAt(0),Ce=this.anchor.getNode(),je=Ur(Ce)?Ce:Co(Ce);if(this.applyDOMRange(we),this.dirty=!0,!b){const Ue=this.getNodes(),$e=[];let Rt=!1;for(let Qe=0;Qe<Ue.length;Qe++){const ht=Ue[Qe];Bi(ht,je)?$e.push(ht):Rt=!0}if(Rt&&$e.length>0)if(c){const Qe=$e[0];et(Qe)?Qe.selectStart():Qe.getParentOrThrow().selectStart()}else{const Qe=$e[$e.length-1];et(Qe)?Qe.selectEnd():Qe.getParentOrThrow().selectEnd()}(he.anchorNode!==we.startContainer||he.anchorOffset!==we.startOffset)&&Po(this)}}}deleteCharacter(s){const c=this.isCollapsed();if(this.isCollapsed()){const h=this.anchor,y=this.focus;let N=h.getNode();if(!s&&(h.type==="element"&&et(N)&&h.offset===N.getChildrenSize()||h.type==="text"&&h.offset===N.getTextContentSize())){const $=N.getParent(),ae=N.getNextSibling()||($===null?null:$.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const b=wl(y,s);if(An(b)&&!b.isIsolated()){if(b.isKeyboardSelectable()&&et(N)&&N.getChildrenSize()===0){N.remove();const $=$c();$.add(b.__key),Cr($)}else b.remove(),xn().dispatchCommand(t,void 0);return}else if(!s&&et(b)&&et(N)&&N.isEmpty()){N.remove(),b.selectStart();return}if(this.modify("extend",s,"character"),this.isCollapsed()){if(s&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const $=y.type==="text"?y.getNode():null;if(N=h.type==="text"?h.getNode():null,$!==null&&$.isSegmented()){const ae=y.offset,he=$.getTextContentSize();if($.is(N)||s&&ae!==he||!s&&ae!==0){Wd($,s,ae);return}}else if(N!==null&&N.isSegmented()){const ae=h.offset,he=N.getTextContentSize();if(N.is($)||s&&ae!==0||!s&&ae!==he){Wd(N,s,ae);return}}y_(this,s)}}if(this.removeText(),s&&!c&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const h=this.anchor.getNode();h.isEmpty()&&Ur(h.getParent())&&h.getIndexWithinParent()===0&&h.collapseAtStart(this)}}deleteLine(s){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",s,"lineboundary"),(s?this.focus:this.anchor).offset===0&&this.modify("extend",s,"character")),this.removeText()}deleteWord(s){this.isCollapsed()&&this.modify("extend",s,"word"),this.removeText()}}function Kr(u){return u instanceof Ti}function dr(u){const s=u.offset;if(u.type==="text")return s;const c=u.getNode();return s===c.getChildrenSize()?c.getTextContent().length:0}function ci(u){const s=u.anchor,c=u.focus;return s.type==="element"&&c.type==="element"&&s.key===c.key&&s.offset===c.offset?[0,0]:[dr(s),dr(c)]}function Po(u){const s=u.focus,c=u.anchor,h=c.key,y=c.offset,N=c.type;Tn(c,s.key,s.offset,s.type),Tn(s,h,y,N),u._cachedNodes=null}function za(u,s,c,h){u.modify(s,c,h)}function y_(u,s){const c=u.anchor,h=u.focus,y=c.getNode(),N=h.getNode();if(y===N&&c.type==="text"&&h.type==="text"){const b=c.offset,$=h.offset,ae=b<$,he=ae?b:$,me=ae?$:b,xe=me-1;if(he!==xe){const we=y.getTextContent().slice(he,me);Rs(we)||(s?h.offset=xe:c.offset=xe)}}}function Wd(u,s,c){const h=u,N=h.getTextContent().split(/(?=\s)/g),b=N.length;let $=0,ae=0;for(let me=0;me<b;me++){const xe=N[me],we=me===b-1;if(ae=$,$+=xe.length,s&&$===c||$>c||we){N.splice(me,1),we&&(ae=void 0);break}}const he=N.join("").trim();he===""?h.remove():(h.setTextContent(he),h.select(ae,ae))}function N_(u,s,c){const h=u.getParent();return c===null||h===null||!h.canBeEmpty()||h!==c.getNode()}function Kd(u,s,c,h){let y=s,N;if(u.nodeType===ke){let b=!1;const $=u.childNodes,ae=$.length;y===ae&&(b=!0,y=ae-1);let he=$[y],me=!1;if(he===h._blockCursorElement?(he=$[y+1],me=!0):h._blockCursorElement!==null&&y--,N=Li(he),_t(N))y=yl(N,b);else{let xe=Li(u);if(xe===null)return null;if(et(xe)){let we=xe.getChildAtIndex(y);if(et(we)&&N_(we,y,c)){const Ce=b?we.getLastDescendant():we.getFirstDescendant();Ce===null?(xe=we,y=0):(we=Ce,xe=et(we)?we:we.getParentOrThrow())}_t(we)?(N=we,xe=null,y=yl(we,b)):we!==xe&&b&&!me&&y++}else{const we=xe.getIndexWithinParent();s===0&&An(xe)&&Li(u)===xe?y=we:y=we+1,xe=xe.getParentOrThrow()}if(et(xe))return Rr(xe.__key,y,"element")}}else N=Li(u);return _t(N)?Rr(N.__key,y,"text"):null}function zd(u,s,c){const h=u.offset,y=u.getNode();if(h===0){const N=y.getPreviousSibling(),b=y.getParent();if(!s)et(N)&&!c&&N.isInline()?(u.key=N.__key,u.offset=N.getChildrenSize(),u.type="element"):_t(N)&&(u.key=N.__key,u.offset=N.getTextContent().length);else if((c||!s)&&N===null&&et(b)&&b.isInline()){const $=b.getPreviousSibling();_t($)&&(u.key=$.__key,u.offset=$.getTextContent().length)}}else if(h===y.getTextContent().length){const N=y.getNextSibling(),b=y.getParent();if(s&&et(N)&&N.isInline())u.key=N.__key,u.offset=0,u.type="element";else if((c||s)&&N===null&&et(b)&&b.isInline()&&!b.canInsertTextAfter()){const $=b.getNextSibling();_t($)&&(u.key=$.__key,u.offset=0)}}}function Ud(u,s,c){if(u.type==="text"&&s.type==="text"){const h=u.isBefore(s),y=u.is(s);zd(u,h,y),zd(s,!h,y),y&&(s.key=u.key,s.offset=u.offset,s.type=u.type);const N=xn();if(N.isComposing()&&N._compositionKey!==u.key&&Tt(c)){const b=c.anchor,$=c.focus;Tn(u,b.key,b.offset,b.type),Tn(s,$.key,$.offset,$.type)}}}function Gd(u,s,c,h,y,N){if(u===null||c===null||!ss(y,u,c))return null;const b=Kd(u,s,Tt(N)?N.anchor:null,y);if(b===null)return null;const $=Kd(c,h,Tt(N)?N.focus:null,y);if($===null)return null;if(b.type==="element"&&$.type==="element"){const ae=Li(u),he=Li(c);if(An(ae)&&An(he))return null}return Ud(b,$,N),[b,$]}function C_(u){return et(u)&&!u.isInline()}function Yd(u,s,c,h,y,N){const b=xi(),$=new rr(Rr(u,s,y),Rr(c,h,N),0,"");return $.dirty=!0,b._selection=$,$}function E_(){const u=Rr("root",0,"element"),s=Rr("root",0,"element");return new rr(u,s,0,"")}function $c(){return new Ti(new Set)}function T_(u){const c=u.getEditorState()._selection,h=ar(u._window);return Tt(c)||c==null?Fc(c,h,u,null):c.clone()}function Fc(u,s,c,h){const y=c._window;if(y===null)return null;const N=h||y.event,b=N?N.type:void 0,$=b==="selectionchange",ae=!Pt()&&($||b==="beforeinput"||b==="compositionstart"||b==="compositionend"||b==="click"&&N&&N.detail===3||b==="drop"||b===void 0);let he,me,xe,we;if(!Tt(u)||ae){if(s===null)return null;if(he=s.anchorNode,me=s.focusNode,xe=s.anchorOffset,we=s.focusOffset,$&&Tt(u)&&!ss(c,he,me))return u.clone()}else return u.clone();const Ce=Gd(he,xe,me,we,c,u);if(Ce===null)return null;const[je,Ue]=Ce;return new rr(je,Ue,Tt(u)?u.format:0,Tt(u)?u.style:"")}function _n(){return xi()._selection}function $o(){return xn()._editorState._selection}function Ua(u,s,c,h=1){const y=u.anchor,N=u.focus,b=y.getNode(),$=N.getNode();if(!s.is(b)&&!s.is($))return;const ae=s.__key;if(u.isCollapsed()){const he=y.offset;if(c<=he&&h>0||c<he&&h<0){const me=Math.max(0,he+h);y.set(ae,me,"element"),N.set(ae,me,"element"),Vd(u)}}else{const he=u.isBackward(),me=he?N:y,xe=me.getNode(),we=he?y:N,Ce=we.getNode();if(s.is(xe)){const je=me.offset;(c<=je&&h>0||c<je&&h<0)&&me.set(ae,Math.max(0,je+h),"element")}if(s.is(Ce)){const je=we.offset;(c<=je&&h>0||c<je&&h<0)&&we.set(ae,Math.max(0,je+h),"element")}}Vd(u)}function Vd(u){const s=u.anchor,c=s.offset,h=u.focus,y=h.offset,N=s.getNode(),b=h.getNode();if(u.isCollapsed()){if(!et(N))return;const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text"),h.set(he.__key,me,"text")}return}if(et(N)){const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text")}}if(et(b)){const $=b.getChildrenSize(),ae=y>=$,he=ae?b.getChildAtIndex($-1):b.getChildAtIndex(y);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),h.set(he.__key,me,"text")}}}function x_(u,s){const h=s.getEditorState()._selection,y=u._selection;if(Tt(y)){const N=y.anchor,b=y.focus;let $;if(N.type==="text"&&($=N.getNode(),$.selectionTransform(h,y)),b.type==="text"){const ae=b.getNode();$!==ae&&ae.selectionTransform(h,y)}}}function Ga(u,s,c,h,y){let N=null,b=0,$=null;h!==null?(N=h.__key,_t(h)?(b=h.getTextContentSize(),$="text"):et(h)&&(b=h.getChildrenSize(),$="element")):y!==null&&(N=y.__key,_t(y)?$="text":et(y)&&($="element")),N!==null&&$!==null?u.set(N,b,$):(b=s.getIndexWithinParent(),b===-1&&(b=c.getChildrenSize()),u.set(c.__key,b,"element"))}function jd(u,s,c,h,y){u.type==="text"?(u.key=c,s||(u.offset+=y)):u.offset>h.getIndexWithinParent()&&(u.offset-=1)}function v_(u,s,c,h,y,N,b){const $=h.anchorNode,ae=h.focusNode,he=h.anchorOffset,me=h.focusOffset,xe=document.activeElement;if(y.has("collaboration")&&xe!==N||xe!==null&&Ds(xe))return;if(!Tt(s)){u!==null&&ss(c,$,ae)&&h.removeAllRanges();return}const we=s.anchor,Ce=s.focus,je=we.key,Ue=Ce.key,$e=Fs(c,je),Rt=Fs(c,Ue),Qe=we.offset,ht=Ce.offset,qt=s.format,Wt=s.style,Dt=s.isCollapsed();let cn=$e,ir=Rt,ms=!1;if(we.type==="text"){cn=Pr($e);const hr=we.getNode();ms=hr.getFormat()!==qt||hr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(ms=!0);if(Ce.type==="text"&&(ir=Pr(Rt)),!(cn===null||ir===null)&&(Dt&&(u===null||ms||Tt(u)&&(u.format!==qt||u.style!==Wt))&&Yn(qt,Wt,Qe,je,performance.now()),!(he===Qe&&me===ht&&$===cn&&ae===ir&&!(h.type==="Range"&&Dt)&&((xe===null||!N.contains(xe))&&N.focus({preventScroll:!0}),we.type!=="element")))){try{h.setBaseAndExtent(cn,Qe,ir,ht)}catch{}if(!y.has("skip-scroll-into-view")&&s.isCollapsed()&&N!==null&&N===document.activeElement){const hr=s instanceof rr&&s.anchor.type==="element"?cn.childNodes[Qe]||null:h.rangeCount>0?h.getRangeAt(0):null;if(hr!==null){let rn;if(hr instanceof Text){const kn=document.createRange();kn.selectNode(hr),rn=kn.getBoundingClientRect()}else rn=hr.getBoundingClientRect();yi(c,rn,N)}}zt()}}function S_(u){let s=_n()||$o();s===null&&(s=tr().selectEnd()),s.insertNodes(u)}function w_(){const u=_n();return u===null?"":u.getTextContent()}function O_(u,s,c){const h=[];let y=null,N=null;function b(he,me,xe){const we={cell:xe,startColumn:me,startRow:he},Ce=xe.__rowSpan,je=xe.__colSpan;for(let Ue=0;Ue<Ce;Ue++){h[he+Ue]===void 0&&(h[he+Ue]=[]);for(let $e=0;$e<je;$e++)h[he+Ue][me+$e]=we}s.is(xe)&&(y=we),c.is(xe)&&(N=we)}function $(he,me){return h[he]===void 0||h[he][me]===void 0}const ae=u.getChildren();for(let he=0;he<ae.length;he++){const me=ae[he];if(!Gc(me))throw Error("Expected GridNode children to be GridRowNode");const xe=me.getChildren();let we=0;for(const Ce of xe){if(!Wo(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!$(he,we);)we++;b(he,we,Ce),we+=Ce.__colSpan}}if(y===null)throw Error("Anchor not found in Grid");if(N===null)throw Error("Focus not found in Grid");return[h,y,N]}function qd(u){let s;if(u instanceof Uc)s=u;else if(u instanceof oi){const y=To(u,Wo);if(!Wo(y))throw Error("Expected to find a parent GridCellNode");s=y}else{const y=To(u.getNode(),Wo);if(!Wo(y))throw Error("Expected to find a parent GridCellNode");s=y}const c=s.getParent();if(!Gc(c))throw Error("Expected GridCellNode to have a parent GridRowNode");const h=c.getParent();if(!uf(h))throw Error("Expected GridRowNode to have a parent GridNode");return[s,c,h]}function Bc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let c=s.getNode(),h=s.offset;for(;!Hi(c);)[c,h]=D_(c,h);return h}function D_(u,s){const c=u.getParent();if(!c){const y=qi();return tr().append(y),y.select(),[tr(),0]}if(_t(u)){const y=u.splitText(s);if(y.length===0)return[c,u.getIndexWithinParent()];const N=s===0?0:1,b=y[0].getIndexWithinParent()+N;return[c,b]}if(!et(u)||s===0)return[c,u.getIndexWithinParent()];const h=u.getChildAtIndex(s);if(h){const y=new rr(Rr(u.__key,s,"element"),Rr(u.__key,s,"element"),0,""),N=u.insertNewAfter(y);N&&N.append(h,...h.getNextSiblings())}return[c,u.getIndexWithinParent()+1]}function A_(u){const s=qi();let c=null;for(let h=0;h<u.length;h++){const y=u[h],N=ai(y);if(N||An(y)&&y.isInline()||et(y)&&y.isInline()||_t(y)||y.isParentRequired()){if(c===null&&(c=y.createParentElementNode(),s.append(c),N))continue;c!==null&&c.append(y)}else s.append(y),c=null}return s}let Qn=null,er=null,Ir=!1,Hc=!1,Ya=0;const Zd={characterData:!0,childList:!0,subtree:!0};function Fo(){return Ir||Qn!==null&&Qn._readOnly}function fr(){if(Ir)throw Error("Cannot use method in read-only mode.")}function Jd(){if(Ya>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function xi(){if(Qn===null)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return Qn}function xn(){if(er===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return er}function M_(){return er}function Xd(u,s,c){const h=s.__type,y=pa(u,h);let N=c.get(h);N===void 0&&(N=Array.from(y.transforms),c.set(h,N));const b=N.length;for(let $=0;$<b&&(N[$](s),!!s.isAttached());$++);}function Qd(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function R_(u,s){const c=s._dirtyLeaves,h=u._nodeMap;for(const y of c){const N=h.get(y);_t(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&Nr(N)}}function b_(u,s){const c=s._dirtyLeaves,h=s._dirtyElements,y=u._nodeMap,N=lr(),b=new Map;let $=c,ae=$.size,he=h,me=he.size;for(;ae>0||me>0;){if(ae>0){s._dirtyLeaves=new Set;for(const xe of $){const we=y.get(xe);_t(we)&&we.isAttached()&&we.isSimpleText()&&!we.isUnmergeable()&&Nr(we),we!==void 0&&Qd(we,N)&&Xd(s,we,b),c.add(xe)}if($=s._dirtyLeaves,ae=$.size,ae>0){Ya++;continue}}s._dirtyLeaves=new Set,s._dirtyElements=new Map;for(const xe of he){const we=xe[0],Ce=xe[1];if(we!=="root"&&!Ce)continue;const je=y.get(we);je!==void 0&&Qd(je,N)&&Xd(s,je,b),h.set(we,Ce)}$=s._dirtyLeaves,ae=$.size,he=s._dirtyElements,me=he.size,Ya++}s._dirtyLeaves=c,s._dirtyElements=h}function L_(u){return Wc(u,xn()._nodes)}function Wc(u,s){const c=u.type,h=s.get(c);if(h===void 0)throw Error(`parseEditorState: type "${c}" + not found`);const y=h.klass;if(u.type!==y.getType())throw Error(`LexicalNode: Node ${y.name} does not implement .importJSON().`);const N=y.importJSON(u),b=u.children;if(et(N)&&Array.isArray(b))for(let $=0;$<b.length;$++){const ae=b[$],he=Wc(ae,s);N.append(he)}return N}function I_(u,s,c){const h=zc(),y=Qn,N=Ir,b=er,$=s._dirtyElements,ae=s._dirtyLeaves,he=s._cloneNotNeeded,me=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Qn=h,Ir=!1,er=s;try{const xe=s._nodes,we=u.root;Wc(we,xe),c&&c(),h._readOnly=!0,tf(h)}catch(xe){xe instanceof Error&&s._onError(xe)}finally{s._dirtyElements=$,s._dirtyLeaves=ae,s._cloneNotNeeded=he,s._dirtyType=me,Qn=y,Ir=N,er=b}return h}function ef(u,s){const c=Qn,h=Ir,y=er;Qn=u,Ir=!0,er=null;try{return s()}finally{Qn=c,Ir=h,er=y}}function tf(u){const s=u._nodeMap;s.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},s.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},s.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function Js(u,s){const c=u._pendingEditorState,h=u._rootElement,y=u._headless||h===null;if(c===null)return;const N=u._editorState,b=N._selection,$=c._selection,ae=u._dirtyType!==qe,he=Qn,me=Ir,xe=er,we=u._updating,Ce=u._observer;let je=null;if(u._pendingEditorState=null,u._editorState=c,!y&&ae&&Ce!==null){er=u,Qn=c,Ir=!1,u._updating=!0;try{const Dt=u._dirtyType,cn=u._dirtyElements,ir=u._dirtyLeaves;Ce.disconnect(),je=Ui(N,c,u,Dt,cn,ir)}catch(Dt){if(Dt instanceof Error&&u._onError(Dt),!Hc)af(u,null,h,c),sr(u),u._dirtyType=ct,Hc=!0,Js(u,N),Hc=!1;else throw Dt;return}finally{Ce.observe(h,Zd),u._updating=we,Qn=he,Ir=me,er=xe}}c._readOnly||(c._readOnly=!0,tf(c),Tt($)&&(Object.freeze($.anchor),Object.freeze($.focus)),Object.freeze($));const Ue=u._dirtyLeaves,$e=u._dirtyElements,Rt=u._normalizedNodes,Qe=u._updateTags,ht=u._deferred;ae&&(u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),La(u,c);const qt=y?null:ar(u._window);if(u._editable&&qt!==null&&(ae||$===null||$.dirty)){er=u,Qn=c;try{if(Ce!==null&&Ce.disconnect(),ae||$===null||$.dirty){const Dt=u._blockCursorElement;Dt!==null&&Hs(Dt,u,h),v_(b,$,u,qt,Qe,h)}Ni(u,h,$),Ce!==null&&Ce.observe(h,Zd)}finally{er=xe,Qn=he}}je!==null&&P_(u,je,Qe,Ue,N),!Tt($)&&$!==null&&(b===null||!b.is($))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Gl("decorator",u,!0,Wt)),k_(u,s||N,c),Gl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:c,normalizedNodes:Rt,prevEditorState:s||N,tags:Qe}),F_(u,ht),$_(u)}function k_(u,s,c){const h=go(s),y=go(c);h!==y&&Gl("textcontent",u,!0,y)}function P_(u,s,c,h,y){const N=Array.from(u._listeners.mutation),b=N.length;for(let $=0;$<b;$++){const[ae,he]=N[$],me=s.get(he);me!==void 0&&ae(me,{dirtyLeaves:h,prevEditorState:y,updateTags:c})}}function Gl(u,s,c,...h){const y=s._updating;s._updating=c;try{const N=Array.from(s._listeners[u]);for(let b=0;b<N.length;b++)N[b].apply(null,h)}finally{s._updating=y}}function nf(u,s,c){if(u._updating===!1||er!==u){let y=!1;return u.update(()=>{y=nf(u,s,c)}),y}const h=Ii(u);for(let y=4;y>=0;y--)for(let N=0;N<h.length;N++){const ae=h[N]._commands.get(s);if(ae!==void 0){const he=ae[y];if(he!==void 0){const me=Array.from(he),xe=me.length;for(let we=0;we<xe;we++)if(me[we](c,u)===!0)return!0}}}return!1}function $_(u){const s=u._updates;if(s.length!==0){const c=s.shift();if(c){const[h,y]=c;sf(u,h,y)}}}function F_(u,s){if(u._deferred=[],s.length!==0){const c=u._updating;u._updating=!0;try{for(let h=0;h<s.length;h++)s[h]()}finally{u._updating=c}}}function rf(u,s){const c=u._updates;let h=s||!1;for(;c.length!==0;){const y=c.shift();if(y){const[N,b]=y;let $,ae;b!==void 0&&($=b.onUpdate,ae=b.tag,b.skipTransforms&&(h=!0),$&&u._deferred.push($),ae&&u._updateTags.add(ae)),N()}}return h}function sf(u,s,c){const h=u._updateTags;let y,N,b=!1,$=!1;c!==void 0&&(y=c.onUpdate,N=c.tag,N!=null&&h.add(N),b=c.skipTransforms||!1,$=c.discrete||!1),y&&u._deferred.push(y);const ae=u._editorState;let he=u._pendingEditorState,me=!1;(he===null||he._readOnly)&&(he=u._pendingEditorState=W_(he||ae),me=!0),he._flushSync=$;const xe=Qn,we=Ir,Ce=er,je=u._updating;Qn=he,Ir=!1,u._updating=!0,er=u;try{me&&(u._headless?ae._selection!=null&&(he._selection=ae._selection.clone()):he._selection=T_(u));const $e=u._compositionKey;s(),b=rf(u,b),x_(he,u),u._dirtyType!==qe&&(b?R_(he,u):b_(he,u),rf(u),Ml(ae,he,u._dirtyLeaves,u._dirtyElements));const Rt=u._compositionKey;$e!==Rt&&(he._flushSync=!0);const Qe=he._selection;if(Tt(Qe)){const ht=he._nodeMap,qt=Qe.anchor.key,Wt=Qe.focus.key;if(ht.get(qt)===void 0||ht.get(Wt)===void 0)throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Kr(Qe)&&Qe._nodes.size===0&&(he._selection=null)}catch($e){$e instanceof Error&&u._onError($e),u._pendingEditorState=ae,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),Js(u);return}finally{Qn=xe,Ir=we,er=Ce,u._updating=je,Ya=0}u._dirtyType!==qe||H_(he,u)?he._flushSync?(he._flushSync=!1,Js(u)):me&&fo(()=>{Js(u)}):(he._flushSync=!1,me&&(h.clear(),u._deferred=[],u._pendingEditorState=null))}function zr(u,s,c){u._updating?u._updates.push([s,c]):sf(u,s,c)}class Kc extends oi{constructor(s){super(s)}decorate(s,c){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof Kc}class Xs extends oi{constructor(s){super(s),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const s=this.getFormat();return pe[s]||""}getIndent(){return this.getLatest().__indent}getChildren(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getChildrenKeys(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c.__key),c=c.getNextSibling();return s}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const c=xn()._dirtyElements;return c!==null&&c.has(this.__key)}isLastChild(){const s=this.getLatest(),c=this.getParentOrThrow().getLastChild();return c!==null&&c.is(s)}getAllTextNodes(){const s=[];let c=this.getFirstChild();for(;c!==null;){if(_t(c)&&s.push(c),et(c)){const h=c.getAllTextNodes();s.push(...h)}c=c.getNextSibling()}return s}getFirstDescendant(){let s=this.getFirstChild();for(;s!==null;){if(et(s)){const c=s.getFirstChild();if(c!==null){s=c;continue}}break}return s}getLastDescendant(){let s=this.getLastChild();for(;s!==null;){if(et(s)){const c=s.getLastChild();if(c!==null){s=c;continue}}break}return s}getDescendantByIndex(s){const c=this.getChildren(),h=c.length;if(s>=h){const N=c[h-1];return et(N)&&N.getLastDescendant()||N||null}const y=c[s];return et(y)&&y.getFirstDescendant()||y||null}getFirstChild(){const c=this.getLatest().__first;return c===null?null:Cn(c)}getFirstChildOrThrow(){const s=this.getFirstChild();if(s===null)throw Error(`Expected node ${this.__key} to have a first child.`);return s}getLastChild(){const c=this.getLatest().__last;return c===null?null:Cn(c)}getLastChildOrThrow(){const s=this.getLastChild();if(s===null)throw Error(`Expected node ${this.__key} to have a last child.`);return s}getChildAtIndex(s){const c=this.getChildrenSize();let h,y;if(s<c/2){for(h=this.getFirstChild(),y=0;h!==null&&y<=s;){if(y===s)return h;h=h.getNextSibling(),y++}return null}for(h=this.getLastChild(),y=c-1;h!==null&&y>=s;){if(y===s)return h;h=h.getPreviousSibling(),y--}return null}getTextContent(){let s="";const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContent(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t)}return s}getTextContentSize(){let s=0;const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContentSize(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t.length)}return s}getDirection(){return this.getLatest().__dir}hasFormat(s){if(s!==""){const c=_i[s];return(this.getFormat()&c)!==0}return!1}select(s,c){fr();const h=_n();let y=s,N=c;const b=this.getChildrenSize();if(!this.canBeEmpty()){if(s===0&&c===0){const ae=this.getFirstChild();if(_t(ae)||et(ae))return ae.select(0,0)}else if((s===void 0||s===b)&&(c===void 0||c===b)){const ae=this.getLastChild();if(_t(ae)||et(ae))return ae.select()}}y===void 0&&(y=b),N===void 0&&(N=b);const $=this.__key;if(Tt(h))h.anchor.set($,y,"element"),h.focus.set($,N,"element"),h.dirty=!0;else return Yd($,y,$,N,"element","element");return h}selectStart(){const s=this.getFirstDescendant();return s?s.selectStart():this.select()}selectEnd(){const s=this.getLastDescendant();return s?s.selectEnd():this.select()}clear(){const s=this.getWritable();return this.getChildren().forEach(h=>h.remove()),s}append(...s){return this.splice(this.getChildrenSize(),0,s)}setDirection(s){const c=this.getWritable();return c.__dir=s,c}setFormat(s){const c=this.getWritable();return c.__format=s!==""?_i[s]:0,this}setIndent(s){const c=this.getWritable();return c.__indent=s,this}splice(s,c,h){const y=h.length,N=this.getChildrenSize(),b=this.getWritable(),$=b.__key,ae=[],he=[],me=this.getChildAtIndex(s+c);let xe=null,we=N-c+y;if(s!==0)if(s===N)xe=this.getLastChild();else{const je=this.getChildAtIndex(s);je!==null&&(xe=je.getPreviousSibling())}if(c>0){let je=xe===null?this.getFirstChild():xe.getNextSibling();for(let Ue=0;Ue<c;Ue++){if(je===null)throw Error("splice: sibling not found");const $e=je.getNextSibling(),Rt=je.__key,Qe=je.getWritable();jr(Qe),he.push(Rt),je=$e}}let Ce=xe;for(let je=0;je<y;je++){const Ue=h[je];Ce!==null&&Ue.is(Ce)&&(xe=Ce=Ce.getPreviousSibling());const $e=Ue.getWritable();$e.__parent===$&&we--,jr($e);const Rt=Ue.__key;if(Ce===null)b.__first=Rt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Rt,$e.__prev=Qe.__key}if(Ue.__key===$)throw Error("append: attempting to append self");$e.__parent=$,ae.push(Rt),Ce=Ue}if(s+c===N){if(Ce!==null){const je=Ce.getWritable();je.__next=null,b.__last=Ce.__key}}else if(me!==null){const je=me.getWritable();if(Ce!==null){const Ue=Ce.getWritable();je.__prev=Ce.__key,Ue.__next=me.__key}else je.__prev=null}if(b.__size=we,he.length){const je=_n();if(Tt(je)){const Ue=new Set(he),$e=new Set(ae),{anchor:Rt,focus:Qe}=je;of(Rt,Ue,$e)&&Ga(Rt,Rt.getNode(),this,xe,me),of(Qe,Ue,$e)&&Ga(Qe,Qe.getNode(),this,xe,me),we===0&&!this.canBeEmpty()&&!si(this)&&this.remove()}}return b}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(s,c){return null}canIndent(){return!0}collapseAtStart(s){return!1}excludeFromCopy(s){return!1}canExtractContents(){return!0}canReplaceWith(s){return!0}canInsertAfter(s){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(s){return!1}extractWithChild(s,c,h){return!1}}function et(u){return u instanceof Xs}function of(u,s,c){let h=u.getNode();for(;h;){const y=h.__key;if(s.has(y)&&!c.has(y))return!0;h=h.getParent()}return!1}class Bo extends Xs{static getType(){return"root"}static clone(){return new Bo}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Fo()||xn()._dirtyType===qe)&&s!==null?s:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(s){throw Error("replace: cannot be called on root nodes")}insertBefore(s){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(s){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(s,c){return!1}append(...s){for(let c=0;c<s.length;c++){const h=s[c];if(!et(h)&&!An(h))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...s)}static importJSON(s){const c=tr();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function B_(){return new Bo}function Ur(u){return u instanceof Bo}function H_(u,s){const c=s.getEditorState()._selection,h=u._selection;if(h!==null){if(h.dirty||!h.is(c))return!0}else if(c!==null)return!0;return!1}function W_(u){return new Va(new Map(u._nodeMap))}function zc(){return new Va(new Map([["root",B_()]]))}function lf(u){const s=u.exportJSON(),c=u.constructor;if(s.type!==c.getType())throw Error(`LexicalNode: Node ${c.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const h=s.children;if(!Array.isArray(h))throw Error(`LexicalNode: Node ${c.name} is an element but .exportJSON() does not have a children array.`);const y=u.getChildren();for(let N=0;N<y.length;N++){const b=y[N],$=lf(b);h.push($)}}return s}class Va{constructor(s,c){this._nodeMap=s,this._selection=c||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(s){return ef(this,s)}clone(s){const c=new Va(this._nodeMap,s===void 0?this._selection:s);return c._readOnly=!0,c}toJSON(){return ef(this,()=>({root:lf(tr())}))}}class Ho extends Xs{static getType(){return"paragraph"}static clone(s){return new Ho(s.__key)}createDOM(s){const c=document.createElement("p"),h=$i(s.theme,"paragraph");return h!==void 0&&c.classList.add(...h),c}updateDOM(s,c,h){return!1}static importDOM(){return{p:s=>({conversion:K_,priority:0})}}exportDOM(s){const{element:c}=super.exportDOM(s);if(c&&Ws(c)){this.isEmpty()&&c.append(document.createElement("br"));const h=this.getFormatType();c.style.textAlign=h;const y=this.getDirection();y&&(c.dir=y);const N=this.getIndent();N>0&&(c.style.textIndent=`${N*20}px`)}return{element:c}}static importJSON(s){const c=qi();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(s,c){const h=qi(),y=this.getDirection();return h.setDirection(y),this.insertAfter(h,c),h}collapseAtStart(){const s=this.getChildren();if(s.length===0||_t(s[0])&&s[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 K_(u){const s=qi();if(u.style){s.setFormat(u.style.textAlign);const c=parseInt(u.style.textIndent,10)/20;c>0&&s.setIndent(c)}return{node:s}}function qi(){return Dr(new Ho)}function z_(u){return u instanceof Ho}const U_=0,G_=1,Y_=2,V_=3,j_=4;function af(u,s,c,h){const y=u._keyToDOMMap;y.clear(),u._editorState=zc(),u._pendingEditorState=h,u._compositionKey=null,u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const N=u._observer;N!==null&&(N.disconnect(),u._observer=null),s!==null&&(s.textContent=""),c!==null&&(c.textContent="",y.set("root",c))}function q_(u,s){const c=new Map,h=new Set,y=N=>{Object.keys(N).forEach(b=>{let $=c.get(b);$===void 0&&($=[],c.set(b,$)),$.push(N[b])})};return u.forEach(N=>{const b=N.klass.importDOM!=null?N.klass.importDOM.bind(N.klass):null;if(b==null||h.has(b))return;h.add(b);const $=b();$!==null&&y($)}),s&&y(s),c}function Z_(u){const s=u||{},c=M_(),h=s.theme||{},y=u===void 0?c:s.parentEditor||null,N=s.disableEvents||!1,b=zc(),$=s.namespace||(y!==null?y._config.namespace:Nl()),ae=s.editorState,he=[Bo,Jr,Vi,xr,Ho,...s.nodes||[]],{onError:me,html:xe}=s,we=s.editable!==void 0?s.editable:!0;let Ce;if(u===void 0&&c!==null)Ce=c._nodes;else{Ce=new Map;for(let Ue=0;Ue<he.length;Ue++){let $e=he[Ue],Rt=null,Qe=null;if(typeof $e!="function"){const Dt=$e;$e=Dt.replace,Rt=Dt.with,Qe=Dt.withKlass||null}{const Dt=$e.name;if(Dt!=="RootNode"){const cn=$e.prototype;["getType","clone"].forEach(ir=>{$e.hasOwnProperty(ir)||console.warn(`${Dt} must implement static "${ir}" method`)}),!$e.hasOwnProperty("importDOM")&&$e.hasOwnProperty("exportDOM")&&console.warn(`${Dt} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),cn instanceof Kc&&(cn.hasOwnProperty("decorate")||console.warn(`${cn.constructor.name} must implement "decorate" method`)),$e.hasOwnProperty("importJSON")||console.warn(`${Dt} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),cn.hasOwnProperty("exportJSON")||console.warn(`${Dt} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ht=$e.getType(),qt=$e.transform(),Wt=new Set;qt!==null&&Wt.add(qt),Ce.set(ht,{exportDOM:xe&&xe.export?xe.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const je=new J_(b,y,Ce,{disableEvents:N,namespace:$,theme:h},me||console.error,q_(Ce,xe?xe.import:void 0),we);return ae!==void 0&&(je._pendingEditorState=ae,je._dirtyType=ct),je}class J_{constructor(s,c,h,y,N,b,$){this._parentEditor=c,this._rootElement=null,this._editorState=s,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=y,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=qe,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=Nl(),this._onError=N,this._htmlConversions=b,this._editable=$,this._headless=c!==null&&c._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(s){const c=this._listeners.update;return c.add(s),()=>{c.delete(s)}}registerEditableListener(s){const c=this._listeners.editable;return c.add(s),()=>{c.delete(s)}}registerDecoratorListener(s){const c=this._listeners.decorator;return c.add(s),()=>{c.delete(s)}}registerTextContentListener(s){const c=this._listeners.textcontent;return c.add(s),()=>{c.delete(s)}}registerRootListener(s){const c=this._listeners.root;return s(this._rootElement,null),c.add(s),()=>{s(null,this._rootElement),c.delete(s)}}registerCommand(s,c,h){if(h===void 0)throw Error('Listener for type "command" requires a "priority".');const y=this._commands;y.has(s)||y.set(s,[new Set,new Set,new Set,new Set,new Set]);const N=y.get(s);if(N===void 0)throw Error(`registerCommand: Command ${String(s)} not found in command map`);const b=N[h];return b.add(c),()=>{b.delete(c),N.every($=>$.size===0)&&y.delete(s)}}registerMutationListener(s,c){if(this._nodes.get(s.getType())===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);const y=this._listeners.mutation;return y.set(c,s),()=>{y.delete(c)}}registerNodeTransformToKlass(s,c){const h=s.getType(),y=this._nodes.get(h);if(y===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);return y.transforms.add(c),y}registerNodeTransform(s,c){const h=this.registerNodeTransformToKlass(s,c),y=[h],N=h.replaceWithKlass;if(N!=null){const b=this.registerNodeTransformToKlass(N,c);y.push(b)}return bi(this,s.getType()),()=>{y.forEach(b=>b.transforms.delete(c))}}hasNode(s){return this._nodes.has(s.getType())}hasNodes(s){return s.every(this.hasNode.bind(this))}dispatchCommand(s,c){return ut(this,s,c)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(s){const c=this._rootElement;if(s!==c){const h=$i(this._config.theme,"root"),y=this._pendingEditorState||this._editorState;if(this._rootElement=s,af(this,c,s,y),c!==null&&(this._config.disableEvents||wt(c),h!=null&&c.classList.remove(...h)),s!==null){const N=Ma(s),b=s.style;b.userSelect="text",b.whiteSpace="pre-wrap",b.wordBreak="break-word",s.setAttribute("data-lexical-editor","true"),this._window=N,this._dirtyType=ct,sr(this),this._updateTags.add("history-merge"),Js(this),this._config.disableEvents||pt(s,this),h!=null&&s.classList.add(...h)}else this._editorState=y,this._pendingEditorState=null,this._window=null;Gl("root",this,!1,s,c)}}getElementByKey(s){return this._keyToDOMMap.get(s)||null}getEditorState(){return this._editorState}setEditorState(s,c){if(s.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");fn(this);const h=this._pendingEditorState,y=this._updateTags,N=c!==void 0?c.tag:null;h!==null&&!h.isEmpty()&&(N!=null&&y.add(N),Js(this)),this._pendingEditorState=s,this._dirtyType=ct,this._dirtyElements.set("root",!1),this._compositionKey=null,N!=null&&y.add(N),Js(this)}parseEditorState(s,c){const h=typeof s=="string"?JSON.parse(s):s;return I_(h,this,c)}update(s,c){zr(this,s,c)}focus(s,c={}){const h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),zr(this,()=>{const y=_n(),N=tr();y!==null?y.dirty=!0:N.getChildrenSize()!==0&&(c.defaultSelection==="rootStart"?N.selectStart():N.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),s&&s()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){const s=this._rootElement;s!==null&&s.blur();const c=ar(this._window);c!==null&&c.removeAllRanges()}isEditable(){return this._editable}setEditable(s){this._editable!==s&&(this._editable=s,Gl("editable",this,!0,s))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Uc extends Xs{constructor(s,c){super(c),this.__colSpan=s,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(s){return this.getWritable().__colSpan=s,this}getRowSpan(){return this.__rowSpan}setRowSpan(s){return this.getWritable().__rowSpan=s,this}}function Wo(u){return u instanceof Uc}class cf extends Xs{}function uf(u){return u instanceof cf}class df extends Xs{}function Gc(u){return u instanceof df}return He.$INTERNAL_isPointSelection=ur,He.$addUpdateTag=Ct,He.$applyNodeReplacement=Dr,He.$copyNode=Dl,He.$createLineBreakNode=ps,He.$createNodeSelection=$c,He.$createParagraphNode=qi,He.$createPoint=Rr,He.$createRangeSelection=E_,He.$createTabNode=Lo,He.$createTextNode=Dn,He.$getAdjacentNode=wl,He.$getNearestNodeFromDOMNode=ii,He.$getNearestRootOrShadowRoot=Co,He.$getNodeByKey=Cn,He.$getPreviousSelection=$o,He.$getRoot=tr,He.$getSelection=_n,He.$getTextContent=w_,He.$hasAncestor=Bi,He.$hasUpdateTag=Un,He.$insertNodes=S_,He.$isBlockElementNode=C_,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Fr,He.$isLeafNode=As,He.$isLineBreakNode=ai,He.$isNodeSelection=Kr,He.$isParagraphNode=z_,He.$isRangeSelection=Tt,He.$isRootNode=Ur,He.$isRootOrShadowRoot=si,He.$isTabNode=Io,He.$isTextNode=_t,He.$nodesOfType=Fi,He.$normalizeSelection__EXPERIMENTAL=Os,He.$parseSerializedNode=L_,He.$selectAll=Sl,He.$setCompositionKey=vn,He.$setSelection=Cr,He.$splitNode=Ra,He.BLUR_COMMAND=B,He.CAN_REDO_COMMAND=X,He.CAN_UNDO_COMMAND=fe,He.CLEAR_EDITOR_COMMAND=R,He.CLEAR_HISTORY_COMMAND=U,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=j_,He.COMMAND_PRIORITY_EDITOR=U_,He.COMMAND_PRIORITY_HIGH=V_,He.COMMAND_PRIORITY_LOW=G_,He.COMMAND_PRIORITY_NORMAL=Y_,He.CONTROLLED_TEXT_INSERTION_COMMAND=p,He.COPY_COMMAND=Y,He.CUT_COMMAND=W,He.DELETE_CHARACTER_COMMAND=l,He.DELETE_LINE_COMMAND=S,He.DELETE_WORD_COMMAND=E,He.DEPRECATED_$computeGridMap=O_,He.DEPRECATED_$getGridCellNodeRect=Lr,He.DEPRECATED_$getNodeTriplet=qd,He.DEPRECATED_$isGridCellNode=Wo,He.DEPRECATED_$isGridNode=uf,He.DEPRECATED_$isGridRowNode=Gc,He.DEPRECATED_GridCellNode=Uc,He.DEPRECATED_GridNode=cf,He.DEPRECATED_GridRowNode=df,He.DRAGEND_COMMAND=oe,He.DRAGOVER_COMMAND=Z,He.DRAGSTART_COMMAND=O,He.DROP_COMMAND=de,He.DecoratorNode=Kc,He.ElementNode=Xs,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=K,He.FORMAT_TEXT_COMMAND=w,He.INDENT_CONTENT_COMMAND=Se,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=f,He.INSERT_TAB_COMMAND=Te,He.INTERNAL_PointSelection=br,He.KEY_ARROW_DOWN_COMMAND=V,He.KEY_ARROW_LEFT_COMMAND=I,He.KEY_ARROW_RIGHT_COMMAND=k,He.KEY_ARROW_UP_COMMAND=H,He.KEY_BACKSPACE_COMMAND=ce,He.KEY_DELETE_COMMAND=z,He.KEY_DOWN_COMMAND=v,He.KEY_ENTER_COMMAND=re,He.KEY_ESCAPE_COMMAND=j,He.KEY_MODIFIER_COMMAND=A,He.KEY_SPACE_COMMAND=te,He.KEY_TAB_COMMAND=q,He.LineBreakNode=Vi,He.MOVE_TO_END=G,He.MOVE_TO_START=P,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=_,He.ParagraphNode=Ho,He.REDO_COMMAND=m,He.REMOVE_TEXT_COMMAND=T,He.RootNode=Bo,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=J,He.TabNode=xr,He.TextNode=Jr,He.UNDO_COMMAND=M,He.createCommand=e,He.createEditor=Z_,He.getNearestEditorFromDOMNode=fl,He.isCurrentlyReadOnlyMode=Fo,He.isHTMLAnchorElement=ba,He.isHTMLElement=Ws,He.isSelectionCapturedInDecoratorInput=Ds,He.isSelectionWithinEditor=ss,He}var We={},bf;function HN(){if(bf)return We;bf=1;let e={},t={},n={},r={},l={},d={},f={},p={},_={},T={},E={},S={},w={},M={},m={},v={},k={},G={},I={},P={},H={},V={},re={},te={},ce={},j={},z={},q={},Te={},Se={},Ee={},de={},K={},O={},Z={},oe={};function Y(o){let i=new URLSearchParams;i.append("code",o);for(let a=1;a<arguments.length;a++)i.append("v",arguments[a]);throw Error(`Minified Lexical error #${o}; visit https://lexical.dev/docs/error?${i} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let W=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J=W&&"documentMode"in document?document.documentMode:null,R=W&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),U=W&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),X=W&&"InputEvent"in window&&!J?"getTargetRanges"in new window.InputEvent("input"):!1,fe=W&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=W&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,B=W&&/Android/.test(navigator.userAgent),A=W&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F=W&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!A,se=fe||_e||F?" ":"",ye=U?" ":se,De=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,ee=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,ne={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ue={directionless:1,unmergeable:2},be={center:2,end:6,justify:4,left:1,right:3,start:5},Ne={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Re={normal:0,segmented:2,token:1},ke={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(o){qe=o.timeStamp}function ct(o,i,a){return i.__lexicalLineBreak===o||o[`__lexicalKey_${a._key}`]!==void 0}function At(o){return o.getEditorState().read(()=>{let i=jt();return i!==null?i.clone():null})}function Ut(o,i,a){Fe=!0;let g=100<performance.now()-qe;try{Tr(o,()=>{let C=jt()||At(o);var x=new Map,D=o.getRootElement(),Q=o._editorState,ge=o._blockCursorElement;let Ae=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,pt=Ke.target,wt=Kt(pt,Q);if(!(wt===null&&pt!==D||En(wt))){if(Pe==="characterData"){if(Ke=g&&Ct(wt))e:{Ke=C,Pe=pt;var Ft=wt;if(Mt(Ke)){var zt=Ke.anchor.getNode();if(zt.is(Ft)&&Ke.format!==zt.getFormat()){Ke=!1;break e}}Ke=Pe.nodeType===3&&Ft.isAttached()}Ke&&(Ft=Vr(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===pt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),pt=pt.nodeValue,pt!==null&&St(wt,pt,Ke,Pe,!1))}else if(Pe==="childList"){for(Ae=!0,Pe=Ke.addedNodes,Ft=0;Ft<Pe.length;Ft++){zt=Pe[Ft];var Yn=$t(zt),Ar=zt.parentNode;Ar==null||zt===ge||Yn!==null||zt.nodeName==="BR"&&ct(zt,Ar,o)||(U&&(Yn=zt.innerText||zt.nodeValue)&&(Ye+=Yn),Ar.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)Ar=Ke[zt],(Ar.nodeName==="BR"&&ct(Ar,pt,o)||ge===Ar)&&(pt.appendChild(Ar),Ft++);Pe!==Ft&&(pt===D&&(wt=Q._nodeMap.get("root")),x.set(pt,wt))}}}}if(0<x.size)for(let[oi,li]of x)if(Je(li))for(x=li.getChildrenKeys(),D=oi.firstChild,Q=0;Q<x.length;Q++)ge=o.getElementByKey(x[Q]),ge!==null&&(D==null?(oi.appendChild(ge),D=ge):D!==ge&&oi.replaceChild(ge,D),D=D.nextSibling);else Ct(li)&&li.markDirty();if(x=a.takeRecords(),0<x.length){for(D=0;D<x.length;D++)for(ge=x[D],Q=ge.addedNodes,ge=ge.target,Xe=0;Xe<Q.length;Xe++)wt=Q[Xe],pt=wt.parentNode,pt==null||wt.nodeName!=="BR"||ct(wt,ge,o)||pt.removeChild(wt);a.takeRecords()}C!==null&&(Ae&&(C.dirty=!0,nn(C)),U&&sn(o)&&C.insertRawText(Ye))})}finally{Fe=!1}}function en(o){let i=o._observer;if(i!==null){let a=i.takeRecords();Ut(o,a,i)}}function Oe(o){qe===0&&fn(o).addEventListener("textInput",Be,!0),o._observer=new MutationObserver((i,a)=>{Ut(o,i,a)})}function ie(o,i){let a=o.__mode,g=o.__format;o=o.__style;let C=i.__mode,x=i.__format;return i=i.__style,(a===null||a===C)&&(g===null||g===x)&&(o===null||o===i)}function le(o,i){let a=o.mergeWithSibling(i),g=hn()._normalizedNodes;return g.add(o.__key),g.add(i.__key),a}function ve(o){if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable())o.remove();else{for(var i;(i=o.getPreviousSibling())!==null&&Ct(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{ie(i,o)&&(o=le(i,o));break}for(var a;(a=o.getNextSibling())!==null&&Ct(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else{ie(o,a)&&le(o,a);break}}}function Le(o){return Me(o.anchor),Me(o.focus),o}function Me(o){for(;o.type==="element";){var i=o.getNode(),a=o.offset;if(a===i.getChildrenSize()?(i=i.getChildAtIndex(a-1),a=!0):(i=i.getChildAtIndex(a),a=!1),Ct(i)){o.set(i.__key,a?i.getTextContentSize():0,"text");break}else if(!Je(i))break;o.set(i.__key,a?i.getChildrenSize():0,"element")}}let Ve=1,rt=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function it(o){let i=document.activeElement;if(i===null)return!1;let a=i.nodeName;return En(Kt(o))&&(a==="INPUT"||a==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function st(o,i,a){let g=o.getRootElement();try{return g!==null&&g.contains(i)&&g.contains(a)&&i!==null&&!it(i)&&vt(i)===o}catch{return!1}}function vt(o){for(;o!=null;){let i=o.__lexicalEditor;if(i!=null)return i;o=yr(o)}return null}function Ge(o){return o.isToken()||o.isSegmented()}function ze(o){for(;o!=null;){if(o.nodeType===3)return o;o=o.firstChild}return null}function tt(o,i,a){let g=ne[i];return a!==null&&(o&g)===(a&g)||(o^=g,i==="subscript"?o&=-65:i==="superscript"&&(o&=-33)),o}function yt(o,i){if(i!=null)o.__key=i;else{Jn(),99<Ki&&Y(14),i=hn();var a=Br(),g=""+Ve++;a._nodeMap.set(g,o),Je(o)?i._dirtyElements.set(g,!0):i._dirtyLeaves.add(g),i._cloneNotNeeded.add(g),i._dirtyType=1,o.__key=g}}function Nt(o){var i=o.getParent();if(i!==null){let C=o.getWritable();i=i.getWritable();var a=o.getPreviousSibling();if(o=o.getNextSibling(),a===null)if(o!==null){var g=o.getWritable();i.__first=o.__key,g.__prev=null}else i.__first=null;else{if(g=a.getWritable(),o!==null){let x=o.getWritable();x.__prev=g.__key,g.__next=x.__key}else g.__next=null;C.__prev=null}o===null?a!==null?(o=a.getWritable(),i.__last=a.__key,o.__next=null):i.__last=null:(o=o.getWritable(),a!==null?(a=a.getWritable(),a.__next=o.__key,o.__prev=a.__key):o.__prev=null,C.__next=null),i.__size--,C.__parent=null}}function Et(o){99<Ki&&Y(14);var i=o.getLatest(),a=i.__parent,g=Br();let C=hn(),x=g._nodeMap;if(g=C._dirtyElements,a!==null)e:for(;a!==null;){if(g.has(a))break e;let D=x.get(a);if(D===void 0)break;g.set(a,!1),a=D.__parent}i=i.__key,C._dirtyType=1,Je(o)?g.set(i,!0):C._dirtyLeaves.add(i)}function gt(o){Jn();var i=hn();let a=i._compositionKey;o!==a&&(i._compositionKey=o,a!==null&&(i=mt(a),i!==null&&i.getWritable()),o!==null&&(o=mt(o),o!==null&&o.getWritable()))}function xt(){return hs()?null:hn()._compositionKey}function mt(o,i){return o=(i||Br())._nodeMap.get(o),o===void 0?null:o}function $t(o,i){let a=hn();return o=o[`__lexicalKey_${a._key}`],o!==void 0?mt(o,i):null}function Kt(o,i){for(;o!=null;){let a=$t(o,i);if(a!==null)return a;o=yr(o)}return null}function tn(o){let i=Object.assign({},o._decorators);return o._pendingDecorators=i}function It(o){return o.read(()=>bt().getTextContent())}function Vt(o,i){Tr(o,()=>{var a=Br();if(!a.isEmpty())if(i==="root")bt().markDirty();else{a=a._nodeMap;for(let[,g]of a)g.markDirty()}},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return Br()._nodeMap.get("root")}function nn(o){Jn();let i=Br();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function Or(o){var i=hn(),a;e:{for(a=o;a!=null;){let g=a[`__lexicalKey_${i._key}`];if(g!==void 0){a=g;break e}a=yr(a)}a=null}return a===null?(i=i.getRootElement(),o===i?mt("root"):null):mt(a)}function _i(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function pe(o){let i=[];for(;o!==null;)i.push(o),o=o._parentEditor;return i}function Ze(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ot(o,i,a){if(i=Vr(i._window),i!==null){var g=i.anchorNode,{anchorOffset:C,focusOffset:x}=i;if(g!==null&&(i=g.nodeType===3?g.nodeValue:null,g=Kt(g),i!==null&&Ct(g))){if(i===se&&a){let D=a.length;i=a,x=C=D}i!==null&&St(g,i,C,x,o)}}}function St(o,i,a,g,C){let x=o;if(x.isAttached()&&(C||!x.isDirty())){let Ae=x.isComposing(),Ye=i;if((Ae||C)&&i[i.length-1]===se&&(Ye=i.slice(0,-1)),i=x.getTextContent(),C||Ye!==i)if(Ye==="")if(gt(null),fe||_e||F)x.remove();else{let Xe=hn();setTimeout(()=>{Xe.update(()=>{x.isAttached()&&x.remove()})},20)}else{C=x.getParent(),i=Er();var D=x.getTextContentSize(),Q=xt(),ge=x.getKey();x.isToken()||Q!==null&&ge===Q&&!Ae||Mt(i)&&(C!==null&&!C.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===o.__key&&i.anchor.offset===0&&!x.canInsertTextBefore()&&!Ae||i.focus.key===o.__key&&i.focus.offset===D&&!x.canInsertTextAfter()&&!Ae)?x.markDirty():(o=jt(),Mt(o)&&a!==null&&g!==null&&(o.setTextNodeRange(x,a,x,g),x.isSegmented()&&(a=x.getTextContent(),a=Un(a),x.replace(a),x=a)),x.setTextContent(Ye))}}}function Gt(o,i){if(i.isSegmented())return!0;if(!o.isCollapsed())return!1;o=o.anchor.offset;let a=i.getParentOrThrow(),g=i.isToken();return o===0?((o=!i.canInsertTextBefore()||!a.canInsertTextBefore()||g)||(i=i.getPreviousSibling(),o=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),o):o===i.getTextContentSize()?!i.canInsertTextAfter()||!a.canInsertTextAfter()||g:!1}function Bt(o,i){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let a=o.__lexicalClassNameCache,g=a[i];return g!==void 0?g:(o=o[i],typeof o=="string"?(o=o.split(" "),a[i]=o):o)}function Pt(o,i,a,g,C){a.size!==0&&(a=g.__type,g=g.__key,i=i.get(a),i===void 0&&Y(33,a),a=i.klass,i=o.get(a),i===void 0&&(i=new Map,o.set(a,i)),o=i.get(g),a=o==="destroyed"&&C==="created",(o===void 0||a)&&i.set(g,a?"updated":C))}function kt(o,i,a){let g=o.getParent(),C=a;return g!==null&&(i&&a===0?(C=o.getIndexWithinParent(),o=g):i||a!==o.getChildrenSize()||(C=o.getIndexWithinParent()+1,o=g)),o.getChildAtIndex(i?C-1:C)}function Ht(o,i){var a=o.offset;return o.type==="element"?(o=o.getNode(),kt(o,i,a)):(o=o.getNode(),i&&a===0||!i&&a===o.getTextContentSize()?(a=i?o.getPreviousSibling():o.getNextSibling(),a===null?kt(o.getParentOrThrow(),i,o.getIndexWithinParent()+(i?0:1)):a):null)}function sn(o){return o=(o=fn(o).event)&&o.inputType,o==="insertFromPaste"||o==="insertFromPasteAsQuotation"}function an(o){return!nr(o)&&!o.isLastChild()&&!o.isInline()}function bn(o,i){return o=o._keyToDOMMap.get(i),o===void 0&&Y(75,i),o}function yr(o){return o=o.assignedSlot||o.parentElement,o!==null&&o.nodeType===11?o.host:o}function Zn(o,i){for(o=o.getParent();o!==null;){if(o.is(i))return!0;o=o.getParent()}return!1}function fn(o){return o=o._window,o===null&&Y(78),o}function sr(o){for(o=o.getParentOrThrow();o!==null&&!or(o);)o=o.getParentOrThrow();return o}function or(o){return nr(o)||Je(o)&&o.isShadowRoot()}function Mi(o){return o=o.constructor.clone(o),yt(o,null),o}function Nr(o){var i=hn();let a=o.constructor.getType();return i=i._nodes.get(a),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||Y(98),i):o}function Os(o,i){o=o.getParent(),!nr(o)||Je(i)||En(i)||Y(99)}function uo(o){return(En(o)||Je(o)&&!o.canBeEmpty())&&!o.isInline()}function dl(o,i,a){a.style.removeProperty("caret-color"),i._blockCursorElement=null,i=o.parentElement,i!==null&&i.removeChild(o)}function Vr(o){return W?(o||window).getSelection():null}function pa(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function fo(o){return o.nodeType===1}function is(o){if(En(o)&&!o.isInline())return!0;if(!Je(o)||or(o))return!1;var i=o.getFirstChild();return i=i===null||ki(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function Ds(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function ss(o,i,a,g,C,x){for(o=o.getFirstChild();o!==null;){let D=o.__key;o.__parent===i&&(Je(o)&&ss(o,D,a,g,C,x),a.has(D)||x.delete(D),C.push(D)),o=o.getNextSibling()}}function fl(o,i,a,g){o=o._nodeMap,i=i._nodeMap;let C=[];for(let[x]of g){let D=i.get(x);D===void 0||D.isAttached()||(Je(D)&&ss(D,x,o,i,C,g),o.has(x)||g.delete(x),C.push(x))}for(let x of C)i.delete(x);for(let x of a)g=i.get(x),g===void 0||g.isAttached()||(o.has(x)||a.delete(x),i.delete(x))}let Ln="",zn="",ri="",Pr,Bn,As,hl=!1,gl=!1,jr,Ri=null,pl,vn,lr,Cn,ho,ii;function Ms(o,i){let a=lr.get(o);if(i!==null){let g=bs(o);g.parentNode===i&&i.removeChild(g)}Cn.has(o)||Bn._keyToDOMMap.delete(o),Je(a)&&(o=Rs(a,lr),go(o,0,o.length-1,null)),a!==void 0&&Pt(ii,As,jr,a,"destroyed")}function go(o,i,a,g){for(;i<=a;++i){let C=o[i];C!==void 0&&Ms(C,g)}}function bi(o,i){o.setProperty("text-align",i)}function tr(o,i){var a=Pr.theme.indent;if(typeof a=="string"){let g=o.classList.contains(a);0<i&&!g?o.classList.add(a):1>i&&g&&o.classList.remove(a)}a=getComputedStyle(o).getPropertyValue("--lexical-indent-base-value")||"40px",o.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${a})`)}function ml(o,i){o=o.style,i===0?bi(o,""):i===1?bi(o,"left"):i===2?bi(o,"center"):i===3?bi(o,"right"):i===4?bi(o,"justify"):i===5?bi(o,"start"):i===6&&bi(o,"end")}function Cr(o,i,a){let g=Cn.get(o);g===void 0&&Y(60);let C=g.createDOM(Pr,Bn);var x=Bn._keyToDOMMap;if(C["__lexicalKey_"+Bn._key]=o,x.set(o,C),Ct(g)?C.setAttribute("data-lexical-text","true"):En(g)&&C.setAttribute("data-lexical-decorator","true"),Je(g)){if(o=g.__indent,x=g.__size,o!==0&&tr(C,o),x!==0){--x,o=Rs(g,Cn);var D=zn;zn="",_l(o,g,0,x,C,null),ma(g,C),zn=D}o=g.__format,o!==0&&ml(C,o),g.isInline()||yl(null,g,C),an(g)&&(Ln+=`
|
|
46
|
+
`?h.push(ps()):b===" "?h.push(Lo()):h.push(Dn(b))}this.insertNodes(h)}insertText(s){const c=this.anchor,h=this.focus,y=this.isCollapsed()||c.isBefore(h),N=this.format,b=this.style;y&&c.type==="element"?Xn(c,h,N,b):!y&&h.type==="element"&&Xn(h,c,N,b);const $=this.getNodes(),ae=$.length,he=y?c:h,me=y?h:c,xe=he.offset,we=me.offset;let Ce=$[0];if(!_t(Ce))throw Error("insertText: first node is not a text node");const Ue=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Rt=ae-1;let Qe=$[Rt];if(this.isCollapsed()&&xe===Ue&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ht=Ce.getNextSibling();if((!_t(ht)||!ht.canInsertTextBefore()||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextAfter()?Ce.insertAfter(ht):$e.insertAfter(ht)),ht.select(0,0),Ce=ht,s!==""){this.insertText(s);return}}else if(this.isCollapsed()&&xe===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ht=Ce.getPreviousSibling();if((!_t(ht)||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextBefore()?Ce.insertBefore(ht):$e.insertBefore(ht)),ht.select(),Ce=ht,s!==""){this.insertText(s);return}}else if(Ce.isSegmented()&&xe!==Ue){const ht=Dn(Ce.getTextContent());ht.setFormat(N),Ce.replace(ht),Ce=ht}else if(!this.isCollapsed()&&s!==""){const ht=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ht)&&(!ht.canInsertTextBefore()||!ht.canInsertTextAfter())){this.insertText(""),Ud(this.anchor,this.focus,null),this.insertText(s);return}}if(ae===1){if(Ce.isToken()){const Dt=Dn(s);Dt.select(),Ce.replace(Dt);return}const ht=Ce.getFormat(),qt=Ce.getStyle();if(xe===we&&(ht!==N||qt!==b))if(Ce.getTextContent()==="")Ce.setFormat(N),Ce.setStyle(b);else{const Dt=Dn(s);if(Dt.setFormat(N),Dt.setStyle(b),Dt.select(),xe===0)Ce.insertBefore(Dt,!1);else{const[cn]=Ce.splitText(xe);cn.insertAfter(Dt,!1)}Dt.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);return}else if(Io(Ce)){const Dt=Dn(s);Dt.setFormat(N),Dt.setStyle(b),Dt.select(),Ce.replace(Dt);return}const Wt=we-xe;Ce=Ce.spliceText(xe,Wt,s,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=s.length:(this.format=ht,this.style=qt))}else{const ht=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),qt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),Dt=Qe;if(!qt.is(Wt)&&Wt.isInline())do Dt=Wt,Wt=Wt.getParentOrThrow();while(Wt.isInline());if(me.type==="text"&&(we!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<we)if(_t(Qe)&&!Qe.isToken()&&we!==Qe.getTextContentSize()){if(Qe.isSegmented()){const rn=Dn(Qe.getTextContent());Qe.replace(rn),Qe=rn}!Ur(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,we,"")),ht.add(Qe.__key)}else{const rn=Qe.getParentOrThrow();!rn.canBeEmpty()&&rn.getChildrenSize()===1?rn.remove():Qe.remove()}else ht.add(Qe.__key);const cn=Wt.getChildren(),ir=new Set($),ms=qt.is(Wt),hr=qt.isInline()&&Ce.getNextSibling()===null?qt:Ce;for(let rn=cn.length-1;rn>=0;rn--){const kn=cn[rn];if(kn.is(Ce)||et(kn)&&kn.isParentOf(Ce))break;kn.isAttached()&&(!ir.has(kn)||kn.is(Dt)?ms||hr.insertAfter(kn,!1):kn.remove())}if(!ms){let rn=Wt,kn=null;for(;rn!==null;){const ui=rn.getChildren(),Zi=ui.length;(Zi===0||ui[Zi-1].is(kn))&&(ht.delete(rn.__key),kn=rn),rn=rn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(xe,Ue-xe,s,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);else if(xe===Ue)Ce.select();else{const rn=Dn(s);rn.select(),Ce.replace(rn)}for(let rn=1;rn<ae;rn++){const kn=$[rn],ui=kn.__key;ht.has(ui)||kn.remove()}}}removeText(){this.insertText("")}formatText(s){if(this.isCollapsed()){this.toggleFormat(s),vn(null);return}const c=this.getNodes(),h=[];for(const Qe of c)_t(Qe)&&h.push(Qe);const y=h.length;if(y===0){this.toggleFormat(s),vn(null);return}const N=this.anchor,b=this.focus,$=this.isBackward(),ae=$?b:N,he=$?N:b;let me=0,xe=h[0],we=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&we===xe.getTextContentSize()&&(me=1,xe=h[1],we=0),xe==null)return;const Ce=xe.getFormatFlags(s,null),Ve=y-1;let Ue=h[Ve];const $e=he.type==="text"?he.offset:Ue.getTextContentSize();if(xe.is(Ue)){if(we===$e)return;if(we===0&&$e===xe.getTextContentSize())xe.setFormat(Ce);else{const Qe=xe.splitText(we,$e),ht=we===0?Qe[0]:Qe[1];ht.setFormat(Ce),ae.type==="text"&&ae.set(ht.__key,0,"text"),he.type==="text"&&he.set(ht.__key,$e-we,"text")}this.format=Ce;return}we!==0&&([,xe]=xe.splitText(we),we=0),xe.setFormat(Ce);const Rt=Ue.getFormatFlags(s,Ce);$e>0&&($e!==Ue.getTextContentSize()&&([Ue]=Ue.splitText($e)),Ue.setFormat(Rt));for(let Qe=me+1;Qe<Ve;Qe++){const ht=h[Qe];if(!ht.isToken()){const qt=ht.getFormatFlags(s,Rt);ht.setFormat(qt)}}ae.type==="text"&&ae.set(xe.__key,we,"text"),he.type==="text"&&he.set(Ue.__key,$e,"text"),this.format=Ce|Rt}insertNodes(s){if(s.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const $e=_n();if(!Tt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(s)}const c=xo(this.anchor.getNode(),Hi),h=s[s.length-1];if("__language"in c&&et(c)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Bc(this);c.splice($e,0,s),h.selectEnd()}return}const y=$e=>(et($e)||An($e))&&!$e.isInline();if(!s.some(y)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Bc(this);c.splice($e,0,s),h.selectEnd();return}const N=A_(s),b=N.getLastDescendant(),$=N.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,he=$e=>et($e)&&Hi($e)&&!$e.isEmpty()&&et(c)&&(!c.isEmpty()||ae(c)),xe=!et(c)||!c.isEmpty()?this.insertParagraph():null,we=$[$.length-1];let Ce=$[0];if(he(Ce)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");c.append(...Ce.getChildren()),Ce=$[1]}Ce&&Hl(c,Ce);const Ve=xo(b,Hi);xe&&et(Ve)&&(ae(xe)||Hi(we))&&(Ve.append(...xe.getChildren()),xe.remove()),et(c)&&c.isEmpty()&&c.remove(),b.selectEnd();const Ue=et(c)?c.getLastChild():null;ai(Ue)&&Ve!==c&&Ue.remove()}insertParagraph(){if(this.anchor.key==="root"){const b=qi();return tr().splice(this.anchor.offset,0,[b]),b.select(),b}const s=Bc(this),c=xo(this.anchor.getNode(),Hi);if(!et(c))throw Error("Expected ancestor to be an ElementNode");const h=c.getChildAtIndex(s),y=h?[h,...h.getNextSiblings()]:[],N=c.insertNewAfter(this,!1);return N?(N.append(...y),N.selectStart(),N):null}insertLineBreak(s){const c=ps();if(this.insertNodes([c]),s){const h=c.getParentOrThrow(),y=c.getIndexWithinParent();h.select(y,y)}}extract(){const s=this.getNodes(),c=s.length,h=c-1,y=this.anchor,N=this.focus;let b=s[0],$=s[h];const[ae,he]=ci(this);if(c===0)return[];if(c===1){if(_t(b)&&!this.isCollapsed()){const xe=ae>he?he:ae,we=ae>he?ae:he,Ce=b.splitText(xe,we),Ve=xe===0?Ce[0]:Ce[1];return Ve!=null?[Ve]:[]}return[b]}const me=y.isBefore(N);if(_t(b)){const xe=me?ae:he;xe===b.getTextContentSize()?s.shift():xe!==0&&([,b]=b.splitText(xe),s[0]=b)}if(_t($)){const we=$.getTextContent().length,Ce=me?he:ae;Ce===0?s.pop():Ce!==we&&([$]=$.splitText(Ce),s[h]=$)}return s}modify(s,c,h){const y=this.focus,N=this.anchor,b=s==="move",$=wl(y,c);if(An($)&&!$.isIsolated()){if(b&&$.isKeyboardSelectable()){const Ce=$c();Ce.add($.__key),Cr(Ce);return}const we=c?$.getPreviousSibling():$.getNextSibling();if(_t(we)){const Ce=we.__key,Ve=c?we.getTextContent().length:0;y.set(Ce,Ve,"text"),b&&N.set(Ce,Ve,"text");return}else{const Ce=$.getParentOrThrow();let Ve,Ue;et(we)?(Ue=we.__key,Ve=c?we.getChildrenSize():0):(Ve=$.getIndexWithinParent(),Ue=Ce.__key,c||Ve++),y.set(Ue,Ve,"element"),b&&N.set(Ue,Ve,"element");return}}const ae=xn(),he=ar(ae._window);if(!he)return;const me=ae._blockCursorElement,xe=ae._rootElement;if(xe!==null&&me!==null&&et($)&&!$.isInline()&&!$.canBeEmpty()&&Hs(me,ae,xe),za(he,s,c?"backward":"forward",h),he.rangeCount>0){const we=he.getRangeAt(0),Ce=this.anchor.getNode(),Ve=Ur(Ce)?Ce:Co(Ce);if(this.applyDOMRange(we),this.dirty=!0,!b){const Ue=this.getNodes(),$e=[];let Rt=!1;for(let Qe=0;Qe<Ue.length;Qe++){const ht=Ue[Qe];Bi(ht,Ve)?$e.push(ht):Rt=!0}if(Rt&&$e.length>0)if(c){const Qe=$e[0];et(Qe)?Qe.selectStart():Qe.getParentOrThrow().selectStart()}else{const Qe=$e[$e.length-1];et(Qe)?Qe.selectEnd():Qe.getParentOrThrow().selectEnd()}(he.anchorNode!==we.startContainer||he.anchorOffset!==we.startOffset)&&Po(this)}}}deleteCharacter(s){const c=this.isCollapsed();if(this.isCollapsed()){const h=this.anchor,y=this.focus;let N=h.getNode();if(!s&&(h.type==="element"&&et(N)&&h.offset===N.getChildrenSize()||h.type==="text"&&h.offset===N.getTextContentSize())){const $=N.getParent(),ae=N.getNextSibling()||($===null?null:$.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const b=wl(y,s);if(An(b)&&!b.isIsolated()){if(b.isKeyboardSelectable()&&et(N)&&N.getChildrenSize()===0){N.remove();const $=$c();$.add(b.__key),Cr($)}else b.remove(),xn().dispatchCommand(t,void 0);return}else if(!s&&et(b)&&et(N)&&N.isEmpty()){N.remove(),b.selectStart();return}if(this.modify("extend",s,"character"),this.isCollapsed()){if(s&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const $=y.type==="text"?y.getNode():null;if(N=h.type==="text"?h.getNode():null,$!==null&&$.isSegmented()){const ae=y.offset,he=$.getTextContentSize();if($.is(N)||s&&ae!==he||!s&&ae!==0){Wd($,s,ae);return}}else if(N!==null&&N.isSegmented()){const ae=h.offset,he=N.getTextContentSize();if(N.is($)||s&&ae!==0||!s&&ae!==he){Wd(N,s,ae);return}}y_(this,s)}}if(this.removeText(),s&&!c&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const h=this.anchor.getNode();h.isEmpty()&&Ur(h.getParent())&&h.getIndexWithinParent()===0&&h.collapseAtStart(this)}}deleteLine(s){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",s,"lineboundary"),(s?this.focus:this.anchor).offset===0&&this.modify("extend",s,"character")),this.removeText()}deleteWord(s){this.isCollapsed()&&this.modify("extend",s,"word"),this.removeText()}}function Kr(u){return u instanceof Ti}function dr(u){const s=u.offset;if(u.type==="text")return s;const c=u.getNode();return s===c.getChildrenSize()?c.getTextContent().length:0}function ci(u){const s=u.anchor,c=u.focus;return s.type==="element"&&c.type==="element"&&s.key===c.key&&s.offset===c.offset?[0,0]:[dr(s),dr(c)]}function Po(u){const s=u.focus,c=u.anchor,h=c.key,y=c.offset,N=c.type;Tn(c,s.key,s.offset,s.type),Tn(s,h,y,N),u._cachedNodes=null}function za(u,s,c,h){u.modify(s,c,h)}function y_(u,s){const c=u.anchor,h=u.focus,y=c.getNode(),N=h.getNode();if(y===N&&c.type==="text"&&h.type==="text"){const b=c.offset,$=h.offset,ae=b<$,he=ae?b:$,me=ae?$:b,xe=me-1;if(he!==xe){const we=y.getTextContent().slice(he,me);Rs(we)||(s?h.offset=xe:c.offset=xe)}}}function Wd(u,s,c){const h=u,N=h.getTextContent().split(/(?=\s)/g),b=N.length;let $=0,ae=0;for(let me=0;me<b;me++){const xe=N[me],we=me===b-1;if(ae=$,$+=xe.length,s&&$===c||$>c||we){N.splice(me,1),we&&(ae=void 0);break}}const he=N.join("").trim();he===""?h.remove():(h.setTextContent(he),h.select(ae,ae))}function N_(u,s,c){const h=u.getParent();return c===null||h===null||!h.canBeEmpty()||h!==c.getNode()}function Kd(u,s,c,h){let y=s,N;if(u.nodeType===ke){let b=!1;const $=u.childNodes,ae=$.length;y===ae&&(b=!0,y=ae-1);let he=$[y],me=!1;if(he===h._blockCursorElement?(he=$[y+1],me=!0):h._blockCursorElement!==null&&y--,N=Li(he),_t(N))y=yl(N,b);else{let xe=Li(u);if(xe===null)return null;if(et(xe)){let we=xe.getChildAtIndex(y);if(et(we)&&N_(we,y,c)){const Ce=b?we.getLastDescendant():we.getFirstDescendant();Ce===null?(xe=we,y=0):(we=Ce,xe=et(we)?we:we.getParentOrThrow())}_t(we)?(N=we,xe=null,y=yl(we,b)):we!==xe&&b&&!me&&y++}else{const we=xe.getIndexWithinParent();s===0&&An(xe)&&Li(u)===xe?y=we:y=we+1,xe=xe.getParentOrThrow()}if(et(xe))return Rr(xe.__key,y,"element")}}else N=Li(u);return _t(N)?Rr(N.__key,y,"text"):null}function zd(u,s,c){const h=u.offset,y=u.getNode();if(h===0){const N=y.getPreviousSibling(),b=y.getParent();if(!s)et(N)&&!c&&N.isInline()?(u.key=N.__key,u.offset=N.getChildrenSize(),u.type="element"):_t(N)&&(u.key=N.__key,u.offset=N.getTextContent().length);else if((c||!s)&&N===null&&et(b)&&b.isInline()){const $=b.getPreviousSibling();_t($)&&(u.key=$.__key,u.offset=$.getTextContent().length)}}else if(h===y.getTextContent().length){const N=y.getNextSibling(),b=y.getParent();if(s&&et(N)&&N.isInline())u.key=N.__key,u.offset=0,u.type="element";else if((c||s)&&N===null&&et(b)&&b.isInline()&&!b.canInsertTextAfter()){const $=b.getNextSibling();_t($)&&(u.key=$.__key,u.offset=0)}}}function Ud(u,s,c){if(u.type==="text"&&s.type==="text"){const h=u.isBefore(s),y=u.is(s);zd(u,h,y),zd(s,!h,y),y&&(s.key=u.key,s.offset=u.offset,s.type=u.type);const N=xn();if(N.isComposing()&&N._compositionKey!==u.key&&Tt(c)){const b=c.anchor,$=c.focus;Tn(u,b.key,b.offset,b.type),Tn(s,$.key,$.offset,$.type)}}}function Gd(u,s,c,h,y,N){if(u===null||c===null||!ss(y,u,c))return null;const b=Kd(u,s,Tt(N)?N.anchor:null,y);if(b===null)return null;const $=Kd(c,h,Tt(N)?N.focus:null,y);if($===null)return null;if(b.type==="element"&&$.type==="element"){const ae=Li(u),he=Li(c);if(An(ae)&&An(he))return null}return Ud(b,$,N),[b,$]}function C_(u){return et(u)&&!u.isInline()}function Yd(u,s,c,h,y,N){const b=xi(),$=new rr(Rr(u,s,y),Rr(c,h,N),0,"");return $.dirty=!0,b._selection=$,$}function E_(){const u=Rr("root",0,"element"),s=Rr("root",0,"element");return new rr(u,s,0,"")}function $c(){return new Ti(new Set)}function T_(u){const c=u.getEditorState()._selection,h=ar(u._window);return Tt(c)||c==null?Fc(c,h,u,null):c.clone()}function Fc(u,s,c,h){const y=c._window;if(y===null)return null;const N=h||y.event,b=N?N.type:void 0,$=b==="selectionchange",ae=!Pt()&&($||b==="beforeinput"||b==="compositionstart"||b==="compositionend"||b==="click"&&N&&N.detail===3||b==="drop"||b===void 0);let he,me,xe,we;if(!Tt(u)||ae){if(s===null)return null;if(he=s.anchorNode,me=s.focusNode,xe=s.anchorOffset,we=s.focusOffset,$&&Tt(u)&&!ss(c,he,me))return u.clone()}else return u.clone();const Ce=Gd(he,xe,me,we,c,u);if(Ce===null)return null;const[Ve,Ue]=Ce;return new rr(Ve,Ue,Tt(u)?u.format:0,Tt(u)?u.style:"")}function _n(){return xi()._selection}function $o(){return xn()._editorState._selection}function Ua(u,s,c,h=1){const y=u.anchor,N=u.focus,b=y.getNode(),$=N.getNode();if(!s.is(b)&&!s.is($))return;const ae=s.__key;if(u.isCollapsed()){const he=y.offset;if(c<=he&&h>0||c<he&&h<0){const me=Math.max(0,he+h);y.set(ae,me,"element"),N.set(ae,me,"element"),jd(u)}}else{const he=u.isBackward(),me=he?N:y,xe=me.getNode(),we=he?y:N,Ce=we.getNode();if(s.is(xe)){const Ve=me.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&me.set(ae,Math.max(0,Ve+h),"element")}if(s.is(Ce)){const Ve=we.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&we.set(ae,Math.max(0,Ve+h),"element")}}jd(u)}function jd(u){const s=u.anchor,c=s.offset,h=u.focus,y=h.offset,N=s.getNode(),b=h.getNode();if(u.isCollapsed()){if(!et(N))return;const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text"),h.set(he.__key,me,"text")}return}if(et(N)){const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text")}}if(et(b)){const $=b.getChildrenSize(),ae=y>=$,he=ae?b.getChildAtIndex($-1):b.getChildAtIndex(y);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),h.set(he.__key,me,"text")}}}function x_(u,s){const h=s.getEditorState()._selection,y=u._selection;if(Tt(y)){const N=y.anchor,b=y.focus;let $;if(N.type==="text"&&($=N.getNode(),$.selectionTransform(h,y)),b.type==="text"){const ae=b.getNode();$!==ae&&ae.selectionTransform(h,y)}}}function Ga(u,s,c,h,y){let N=null,b=0,$=null;h!==null?(N=h.__key,_t(h)?(b=h.getTextContentSize(),$="text"):et(h)&&(b=h.getChildrenSize(),$="element")):y!==null&&(N=y.__key,_t(y)?$="text":et(y)&&($="element")),N!==null&&$!==null?u.set(N,b,$):(b=s.getIndexWithinParent(),b===-1&&(b=c.getChildrenSize()),u.set(c.__key,b,"element"))}function Vd(u,s,c,h,y){u.type==="text"?(u.key=c,s||(u.offset+=y)):u.offset>h.getIndexWithinParent()&&(u.offset-=1)}function v_(u,s,c,h,y,N,b){const $=h.anchorNode,ae=h.focusNode,he=h.anchorOffset,me=h.focusOffset,xe=document.activeElement;if(y.has("collaboration")&&xe!==N||xe!==null&&Ds(xe))return;if(!Tt(s)){u!==null&&ss(c,$,ae)&&h.removeAllRanges();return}const we=s.anchor,Ce=s.focus,Ve=we.key,Ue=Ce.key,$e=Fs(c,Ve),Rt=Fs(c,Ue),Qe=we.offset,ht=Ce.offset,qt=s.format,Wt=s.style,Dt=s.isCollapsed();let cn=$e,ir=Rt,ms=!1;if(we.type==="text"){cn=Pr($e);const hr=we.getNode();ms=hr.getFormat()!==qt||hr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(ms=!0);if(Ce.type==="text"&&(ir=Pr(Rt)),!(cn===null||ir===null)&&(Dt&&(u===null||ms||Tt(u)&&(u.format!==qt||u.style!==Wt))&&Yn(qt,Wt,Qe,Ve,performance.now()),!(he===Qe&&me===ht&&$===cn&&ae===ir&&!(h.type==="Range"&&Dt)&&((xe===null||!N.contains(xe))&&N.focus({preventScroll:!0}),we.type!=="element")))){try{h.setBaseAndExtent(cn,Qe,ir,ht)}catch{}if(!y.has("skip-scroll-into-view")&&s.isCollapsed()&&N!==null&&N===document.activeElement){const hr=s instanceof rr&&s.anchor.type==="element"?cn.childNodes[Qe]||null:h.rangeCount>0?h.getRangeAt(0):null;if(hr!==null){let rn;if(hr instanceof Text){const kn=document.createRange();kn.selectNode(hr),rn=kn.getBoundingClientRect()}else rn=hr.getBoundingClientRect();yi(c,rn,N)}}zt()}}function S_(u){let s=_n()||$o();s===null&&(s=tr().selectEnd()),s.insertNodes(u)}function w_(){const u=_n();return u===null?"":u.getTextContent()}function O_(u,s,c){const h=[];let y=null,N=null;function b(he,me,xe){const we={cell:xe,startColumn:me,startRow:he},Ce=xe.__rowSpan,Ve=xe.__colSpan;for(let Ue=0;Ue<Ce;Ue++){h[he+Ue]===void 0&&(h[he+Ue]=[]);for(let $e=0;$e<Ve;$e++)h[he+Ue][me+$e]=we}s.is(xe)&&(y=we),c.is(xe)&&(N=we)}function $(he,me){return h[he]===void 0||h[he][me]===void 0}const ae=u.getChildren();for(let he=0;he<ae.length;he++){const me=ae[he];if(!Gc(me))throw Error("Expected GridNode children to be GridRowNode");const xe=me.getChildren();let we=0;for(const Ce of xe){if(!Wo(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!$(he,we);)we++;b(he,we,Ce),we+=Ce.__colSpan}}if(y===null)throw Error("Anchor not found in Grid");if(N===null)throw Error("Focus not found in Grid");return[h,y,N]}function qd(u){let s;if(u instanceof Uc)s=u;else if(u instanceof oi){const y=To(u,Wo);if(!Wo(y))throw Error("Expected to find a parent GridCellNode");s=y}else{const y=To(u.getNode(),Wo);if(!Wo(y))throw Error("Expected to find a parent GridCellNode");s=y}const c=s.getParent();if(!Gc(c))throw Error("Expected GridCellNode to have a parent GridRowNode");const h=c.getParent();if(!uf(h))throw Error("Expected GridRowNode to have a parent GridNode");return[s,c,h]}function Bc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let c=s.getNode(),h=s.offset;for(;!Hi(c);)[c,h]=D_(c,h);return h}function D_(u,s){const c=u.getParent();if(!c){const y=qi();return tr().append(y),y.select(),[tr(),0]}if(_t(u)){const y=u.splitText(s);if(y.length===0)return[c,u.getIndexWithinParent()];const N=s===0?0:1,b=y[0].getIndexWithinParent()+N;return[c,b]}if(!et(u)||s===0)return[c,u.getIndexWithinParent()];const h=u.getChildAtIndex(s);if(h){const y=new rr(Rr(u.__key,s,"element"),Rr(u.__key,s,"element"),0,""),N=u.insertNewAfter(y);N&&N.append(h,...h.getNextSiblings())}return[c,u.getIndexWithinParent()+1]}function A_(u){const s=qi();let c=null;for(let h=0;h<u.length;h++){const y=u[h],N=ai(y);if(N||An(y)&&y.isInline()||et(y)&&y.isInline()||_t(y)||y.isParentRequired()){if(c===null&&(c=y.createParentElementNode(),s.append(c),N))continue;c!==null&&c.append(y)}else s.append(y),c=null}return s}let Qn=null,er=null,Ir=!1,Hc=!1,Ya=0;const Zd={characterData:!0,childList:!0,subtree:!0};function Fo(){return Ir||Qn!==null&&Qn._readOnly}function fr(){if(Ir)throw Error("Cannot use method in read-only mode.")}function Jd(){if(Ya>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function xi(){if(Qn===null)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return Qn}function xn(){if(er===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return er}function M_(){return er}function Xd(u,s,c){const h=s.__type,y=pa(u,h);let N=c.get(h);N===void 0&&(N=Array.from(y.transforms),c.set(h,N));const b=N.length;for(let $=0;$<b&&(N[$](s),!!s.isAttached());$++);}function Qd(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function R_(u,s){const c=s._dirtyLeaves,h=u._nodeMap;for(const y of c){const N=h.get(y);_t(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&Nr(N)}}function b_(u,s){const c=s._dirtyLeaves,h=s._dirtyElements,y=u._nodeMap,N=lr(),b=new Map;let $=c,ae=$.size,he=h,me=he.size;for(;ae>0||me>0;){if(ae>0){s._dirtyLeaves=new Set;for(const xe of $){const we=y.get(xe);_t(we)&&we.isAttached()&&we.isSimpleText()&&!we.isUnmergeable()&&Nr(we),we!==void 0&&Qd(we,N)&&Xd(s,we,b),c.add(xe)}if($=s._dirtyLeaves,ae=$.size,ae>0){Ya++;continue}}s._dirtyLeaves=new Set,s._dirtyElements=new Map;for(const xe of he){const we=xe[0],Ce=xe[1];if(we!=="root"&&!Ce)continue;const Ve=y.get(we);Ve!==void 0&&Qd(Ve,N)&&Xd(s,Ve,b),h.set(we,Ce)}$=s._dirtyLeaves,ae=$.size,he=s._dirtyElements,me=he.size,Ya++}s._dirtyLeaves=c,s._dirtyElements=h}function L_(u){return Wc(u,xn()._nodes)}function Wc(u,s){const c=u.type,h=s.get(c);if(h===void 0)throw Error(`parseEditorState: type "${c}" + not found`);const y=h.klass;if(u.type!==y.getType())throw Error(`LexicalNode: Node ${y.name} does not implement .importJSON().`);const N=y.importJSON(u),b=u.children;if(et(N)&&Array.isArray(b))for(let $=0;$<b.length;$++){const ae=b[$],he=Wc(ae,s);N.append(he)}return N}function I_(u,s,c){const h=zc(),y=Qn,N=Ir,b=er,$=s._dirtyElements,ae=s._dirtyLeaves,he=s._cloneNotNeeded,me=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Qn=h,Ir=!1,er=s;try{const xe=s._nodes,we=u.root;Wc(we,xe),c&&c(),h._readOnly=!0,tf(h)}catch(xe){xe instanceof Error&&s._onError(xe)}finally{s._dirtyElements=$,s._dirtyLeaves=ae,s._cloneNotNeeded=he,s._dirtyType=me,Qn=y,Ir=N,er=b}return h}function ef(u,s){const c=Qn,h=Ir,y=er;Qn=u,Ir=!0,er=null;try{return s()}finally{Qn=c,Ir=h,er=y}}function tf(u){const s=u._nodeMap;s.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},s.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},s.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function Js(u,s){const c=u._pendingEditorState,h=u._rootElement,y=u._headless||h===null;if(c===null)return;const N=u._editorState,b=N._selection,$=c._selection,ae=u._dirtyType!==qe,he=Qn,me=Ir,xe=er,we=u._updating,Ce=u._observer;let Ve=null;if(u._pendingEditorState=null,u._editorState=c,!y&&ae&&Ce!==null){er=u,Qn=c,Ir=!1,u._updating=!0;try{const Dt=u._dirtyType,cn=u._dirtyElements,ir=u._dirtyLeaves;Ce.disconnect(),Ve=Ui(N,c,u,Dt,cn,ir)}catch(Dt){if(Dt instanceof Error&&u._onError(Dt),!Hc)af(u,null,h,c),sr(u),u._dirtyType=ut,Hc=!0,Js(u,N),Hc=!1;else throw Dt;return}finally{Ce.observe(h,Zd),u._updating=we,Qn=he,Ir=me,er=xe}}c._readOnly||(c._readOnly=!0,tf(c),Tt($)&&(Object.freeze($.anchor),Object.freeze($.focus)),Object.freeze($));const Ue=u._dirtyLeaves,$e=u._dirtyElements,Rt=u._normalizedNodes,Qe=u._updateTags,ht=u._deferred;ae&&(u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),La(u,c);const qt=y?null:ar(u._window);if(u._editable&&qt!==null&&(ae||$===null||$.dirty)){er=u,Qn=c;try{if(Ce!==null&&Ce.disconnect(),ae||$===null||$.dirty){const Dt=u._blockCursorElement;Dt!==null&&Hs(Dt,u,h),v_(b,$,u,qt,Qe,h)}Ni(u,h,$),Ce!==null&&Ce.observe(h,Zd)}finally{er=xe,Qn=he}}Ve!==null&&P_(u,Ve,Qe,Ue,N),!Tt($)&&$!==null&&(b===null||!b.is($))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Gl("decorator",u,!0,Wt)),k_(u,s||N,c),Gl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:c,normalizedNodes:Rt,prevEditorState:s||N,tags:Qe}),F_(u,ht),$_(u)}function k_(u,s,c){const h=go(s),y=go(c);h!==y&&Gl("textcontent",u,!0,y)}function P_(u,s,c,h,y){const N=Array.from(u._listeners.mutation),b=N.length;for(let $=0;$<b;$++){const[ae,he]=N[$],me=s.get(he);me!==void 0&&ae(me,{dirtyLeaves:h,prevEditorState:y,updateTags:c})}}function Gl(u,s,c,...h){const y=s._updating;s._updating=c;try{const N=Array.from(s._listeners[u]);for(let b=0;b<N.length;b++)N[b].apply(null,h)}finally{s._updating=y}}function nf(u,s,c){if(u._updating===!1||er!==u){let y=!1;return u.update(()=>{y=nf(u,s,c)}),y}const h=Ii(u);for(let y=4;y>=0;y--)for(let N=0;N<h.length;N++){const ae=h[N]._commands.get(s);if(ae!==void 0){const he=ae[y];if(he!==void 0){const me=Array.from(he),xe=me.length;for(let we=0;we<xe;we++)if(me[we](c,u)===!0)return!0}}}return!1}function $_(u){const s=u._updates;if(s.length!==0){const c=s.shift();if(c){const[h,y]=c;sf(u,h,y)}}}function F_(u,s){if(u._deferred=[],s.length!==0){const c=u._updating;u._updating=!0;try{for(let h=0;h<s.length;h++)s[h]()}finally{u._updating=c}}}function rf(u,s){const c=u._updates;let h=s||!1;for(;c.length!==0;){const y=c.shift();if(y){const[N,b]=y;let $,ae;b!==void 0&&($=b.onUpdate,ae=b.tag,b.skipTransforms&&(h=!0),$&&u._deferred.push($),ae&&u._updateTags.add(ae)),N()}}return h}function sf(u,s,c){const h=u._updateTags;let y,N,b=!1,$=!1;c!==void 0&&(y=c.onUpdate,N=c.tag,N!=null&&h.add(N),b=c.skipTransforms||!1,$=c.discrete||!1),y&&u._deferred.push(y);const ae=u._editorState;let he=u._pendingEditorState,me=!1;(he===null||he._readOnly)&&(he=u._pendingEditorState=W_(he||ae),me=!0),he._flushSync=$;const xe=Qn,we=Ir,Ce=er,Ve=u._updating;Qn=he,Ir=!1,u._updating=!0,er=u;try{me&&(u._headless?ae._selection!=null&&(he._selection=ae._selection.clone()):he._selection=T_(u));const $e=u._compositionKey;s(),b=rf(u,b),x_(he,u),u._dirtyType!==qe&&(b?R_(he,u):b_(he,u),rf(u),Ml(ae,he,u._dirtyLeaves,u._dirtyElements));const Rt=u._compositionKey;$e!==Rt&&(he._flushSync=!0);const Qe=he._selection;if(Tt(Qe)){const ht=he._nodeMap,qt=Qe.anchor.key,Wt=Qe.focus.key;if(ht.get(qt)===void 0||ht.get(Wt)===void 0)throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Kr(Qe)&&Qe._nodes.size===0&&(he._selection=null)}catch($e){$e instanceof Error&&u._onError($e),u._pendingEditorState=ae,u._dirtyType=ut,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),Js(u);return}finally{Qn=xe,Ir=we,er=Ce,u._updating=Ve,Ya=0}u._dirtyType!==qe||H_(he,u)?he._flushSync?(he._flushSync=!1,Js(u)):me&&fo(()=>{Js(u)}):(he._flushSync=!1,me&&(h.clear(),u._deferred=[],u._pendingEditorState=null))}function zr(u,s,c){u._updating?u._updates.push([s,c]):sf(u,s,c)}class Kc extends oi{constructor(s){super(s)}decorate(s,c){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof Kc}class Xs extends oi{constructor(s){super(s),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const s=this.getFormat();return pe[s]||""}getIndent(){return this.getLatest().__indent}getChildren(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getChildrenKeys(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c.__key),c=c.getNextSibling();return s}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const c=xn()._dirtyElements;return c!==null&&c.has(this.__key)}isLastChild(){const s=this.getLatest(),c=this.getParentOrThrow().getLastChild();return c!==null&&c.is(s)}getAllTextNodes(){const s=[];let c=this.getFirstChild();for(;c!==null;){if(_t(c)&&s.push(c),et(c)){const h=c.getAllTextNodes();s.push(...h)}c=c.getNextSibling()}return s}getFirstDescendant(){let s=this.getFirstChild();for(;s!==null;){if(et(s)){const c=s.getFirstChild();if(c!==null){s=c;continue}}break}return s}getLastDescendant(){let s=this.getLastChild();for(;s!==null;){if(et(s)){const c=s.getLastChild();if(c!==null){s=c;continue}}break}return s}getDescendantByIndex(s){const c=this.getChildren(),h=c.length;if(s>=h){const N=c[h-1];return et(N)&&N.getLastDescendant()||N||null}const y=c[s];return et(y)&&y.getFirstDescendant()||y||null}getFirstChild(){const c=this.getLatest().__first;return c===null?null:Cn(c)}getFirstChildOrThrow(){const s=this.getFirstChild();if(s===null)throw Error(`Expected node ${this.__key} to have a first child.`);return s}getLastChild(){const c=this.getLatest().__last;return c===null?null:Cn(c)}getLastChildOrThrow(){const s=this.getLastChild();if(s===null)throw Error(`Expected node ${this.__key} to have a last child.`);return s}getChildAtIndex(s){const c=this.getChildrenSize();let h,y;if(s<c/2){for(h=this.getFirstChild(),y=0;h!==null&&y<=s;){if(y===s)return h;h=h.getNextSibling(),y++}return null}for(h=this.getLastChild(),y=c-1;h!==null&&y>=s;){if(y===s)return h;h=h.getPreviousSibling(),y--}return null}getTextContent(){let s="";const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContent(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t)}return s}getTextContentSize(){let s=0;const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContentSize(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t.length)}return s}getDirection(){return this.getLatest().__dir}hasFormat(s){if(s!==""){const c=_i[s];return(this.getFormat()&c)!==0}return!1}select(s,c){fr();const h=_n();let y=s,N=c;const b=this.getChildrenSize();if(!this.canBeEmpty()){if(s===0&&c===0){const ae=this.getFirstChild();if(_t(ae)||et(ae))return ae.select(0,0)}else if((s===void 0||s===b)&&(c===void 0||c===b)){const ae=this.getLastChild();if(_t(ae)||et(ae))return ae.select()}}y===void 0&&(y=b),N===void 0&&(N=b);const $=this.__key;if(Tt(h))h.anchor.set($,y,"element"),h.focus.set($,N,"element"),h.dirty=!0;else return Yd($,y,$,N,"element","element");return h}selectStart(){const s=this.getFirstDescendant();return s?s.selectStart():this.select()}selectEnd(){const s=this.getLastDescendant();return s?s.selectEnd():this.select()}clear(){const s=this.getWritable();return this.getChildren().forEach(h=>h.remove()),s}append(...s){return this.splice(this.getChildrenSize(),0,s)}setDirection(s){const c=this.getWritable();return c.__dir=s,c}setFormat(s){const c=this.getWritable();return c.__format=s!==""?_i[s]:0,this}setIndent(s){const c=this.getWritable();return c.__indent=s,this}splice(s,c,h){const y=h.length,N=this.getChildrenSize(),b=this.getWritable(),$=b.__key,ae=[],he=[],me=this.getChildAtIndex(s+c);let xe=null,we=N-c+y;if(s!==0)if(s===N)xe=this.getLastChild();else{const Ve=this.getChildAtIndex(s);Ve!==null&&(xe=Ve.getPreviousSibling())}if(c>0){let Ve=xe===null?this.getFirstChild():xe.getNextSibling();for(let Ue=0;Ue<c;Ue++){if(Ve===null)throw Error("splice: sibling not found");const $e=Ve.getNextSibling(),Rt=Ve.__key,Qe=Ve.getWritable();Vr(Qe),he.push(Rt),Ve=$e}}let Ce=xe;for(let Ve=0;Ve<y;Ve++){const Ue=h[Ve];Ce!==null&&Ue.is(Ce)&&(xe=Ce=Ce.getPreviousSibling());const $e=Ue.getWritable();$e.__parent===$&&we--,Vr($e);const Rt=Ue.__key;if(Ce===null)b.__first=Rt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Rt,$e.__prev=Qe.__key}if(Ue.__key===$)throw Error("append: attempting to append self");$e.__parent=$,ae.push(Rt),Ce=Ue}if(s+c===N){if(Ce!==null){const Ve=Ce.getWritable();Ve.__next=null,b.__last=Ce.__key}}else if(me!==null){const Ve=me.getWritable();if(Ce!==null){const Ue=Ce.getWritable();Ve.__prev=Ce.__key,Ue.__next=me.__key}else Ve.__prev=null}if(b.__size=we,he.length){const Ve=_n();if(Tt(Ve)){const Ue=new Set(he),$e=new Set(ae),{anchor:Rt,focus:Qe}=Ve;of(Rt,Ue,$e)&&Ga(Rt,Rt.getNode(),this,xe,me),of(Qe,Ue,$e)&&Ga(Qe,Qe.getNode(),this,xe,me),we===0&&!this.canBeEmpty()&&!si(this)&&this.remove()}}return b}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(s,c){return null}canIndent(){return!0}collapseAtStart(s){return!1}excludeFromCopy(s){return!1}canExtractContents(){return!0}canReplaceWith(s){return!0}canInsertAfter(s){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(s){return!1}extractWithChild(s,c,h){return!1}}function et(u){return u instanceof Xs}function of(u,s,c){let h=u.getNode();for(;h;){const y=h.__key;if(s.has(y)&&!c.has(y))return!0;h=h.getParent()}return!1}class Bo extends Xs{static getType(){return"root"}static clone(){return new Bo}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Fo()||xn()._dirtyType===qe)&&s!==null?s:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(s){throw Error("replace: cannot be called on root nodes")}insertBefore(s){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(s){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(s,c){return!1}append(...s){for(let c=0;c<s.length;c++){const h=s[c];if(!et(h)&&!An(h))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...s)}static importJSON(s){const c=tr();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function B_(){return new Bo}function Ur(u){return u instanceof Bo}function H_(u,s){const c=s.getEditorState()._selection,h=u._selection;if(h!==null){if(h.dirty||!h.is(c))return!0}else if(c!==null)return!0;return!1}function W_(u){return new ja(new Map(u._nodeMap))}function zc(){return new ja(new Map([["root",B_()]]))}function lf(u){const s=u.exportJSON(),c=u.constructor;if(s.type!==c.getType())throw Error(`LexicalNode: Node ${c.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const h=s.children;if(!Array.isArray(h))throw Error(`LexicalNode: Node ${c.name} is an element but .exportJSON() does not have a children array.`);const y=u.getChildren();for(let N=0;N<y.length;N++){const b=y[N],$=lf(b);h.push($)}}return s}class ja{constructor(s,c){this._nodeMap=s,this._selection=c||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(s){return ef(this,s)}clone(s){const c=new ja(this._nodeMap,s===void 0?this._selection:s);return c._readOnly=!0,c}toJSON(){return ef(this,()=>({root:lf(tr())}))}}class Ho extends Xs{static getType(){return"paragraph"}static clone(s){return new Ho(s.__key)}createDOM(s){const c=document.createElement("p"),h=$i(s.theme,"paragraph");return h!==void 0&&c.classList.add(...h),c}updateDOM(s,c,h){return!1}static importDOM(){return{p:s=>({conversion:K_,priority:0})}}exportDOM(s){const{element:c}=super.exportDOM(s);if(c&&Ws(c)){this.isEmpty()&&c.append(document.createElement("br"));const h=this.getFormatType();c.style.textAlign=h;const y=this.getDirection();y&&(c.dir=y);const N=this.getIndent();N>0&&(c.style.textIndent=`${N*20}px`)}return{element:c}}static importJSON(s){const c=qi();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(s,c){const h=qi(),y=this.getDirection();return h.setDirection(y),this.insertAfter(h,c),h}collapseAtStart(){const s=this.getChildren();if(s.length===0||_t(s[0])&&s[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 K_(u){const s=qi();if(u.style){s.setFormat(u.style.textAlign);const c=parseInt(u.style.textIndent,10)/20;c>0&&s.setIndent(c)}return{node:s}}function qi(){return Dr(new Ho)}function z_(u){return u instanceof Ho}const U_=0,G_=1,Y_=2,j_=3,V_=4;function af(u,s,c,h){const y=u._keyToDOMMap;y.clear(),u._editorState=zc(),u._pendingEditorState=h,u._compositionKey=null,u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const N=u._observer;N!==null&&(N.disconnect(),u._observer=null),s!==null&&(s.textContent=""),c!==null&&(c.textContent="",y.set("root",c))}function q_(u,s){const c=new Map,h=new Set,y=N=>{Object.keys(N).forEach(b=>{let $=c.get(b);$===void 0&&($=[],c.set(b,$)),$.push(N[b])})};return u.forEach(N=>{const b=N.klass.importDOM!=null?N.klass.importDOM.bind(N.klass):null;if(b==null||h.has(b))return;h.add(b);const $=b();$!==null&&y($)}),s&&y(s),c}function Z_(u){const s=u||{},c=M_(),h=s.theme||{},y=u===void 0?c:s.parentEditor||null,N=s.disableEvents||!1,b=zc(),$=s.namespace||(y!==null?y._config.namespace:Nl()),ae=s.editorState,he=[Bo,Jr,ji,xr,Ho,...s.nodes||[]],{onError:me,html:xe}=s,we=s.editable!==void 0?s.editable:!0;let Ce;if(u===void 0&&c!==null)Ce=c._nodes;else{Ce=new Map;for(let Ue=0;Ue<he.length;Ue++){let $e=he[Ue],Rt=null,Qe=null;if(typeof $e!="function"){const Dt=$e;$e=Dt.replace,Rt=Dt.with,Qe=Dt.withKlass||null}{const Dt=$e.name;if(Dt!=="RootNode"){const cn=$e.prototype;["getType","clone"].forEach(ir=>{$e.hasOwnProperty(ir)||console.warn(`${Dt} must implement static "${ir}" method`)}),!$e.hasOwnProperty("importDOM")&&$e.hasOwnProperty("exportDOM")&&console.warn(`${Dt} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),cn instanceof Kc&&(cn.hasOwnProperty("decorate")||console.warn(`${cn.constructor.name} must implement "decorate" method`)),$e.hasOwnProperty("importJSON")||console.warn(`${Dt} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),cn.hasOwnProperty("exportJSON")||console.warn(`${Dt} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ht=$e.getType(),qt=$e.transform(),Wt=new Set;qt!==null&&Wt.add(qt),Ce.set(ht,{exportDOM:xe&&xe.export?xe.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new J_(b,y,Ce,{disableEvents:N,namespace:$,theme:h},me||console.error,q_(Ce,xe?xe.import:void 0),we);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ut),Ve}class J_{constructor(s,c,h,y,N,b,$){this._parentEditor=c,this._rootElement=null,this._editorState=s,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=y,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=qe,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=Nl(),this._onError=N,this._htmlConversions=b,this._editable=$,this._headless=c!==null&&c._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(s){const c=this._listeners.update;return c.add(s),()=>{c.delete(s)}}registerEditableListener(s){const c=this._listeners.editable;return c.add(s),()=>{c.delete(s)}}registerDecoratorListener(s){const c=this._listeners.decorator;return c.add(s),()=>{c.delete(s)}}registerTextContentListener(s){const c=this._listeners.textcontent;return c.add(s),()=>{c.delete(s)}}registerRootListener(s){const c=this._listeners.root;return s(this._rootElement,null),c.add(s),()=>{s(null,this._rootElement),c.delete(s)}}registerCommand(s,c,h){if(h===void 0)throw Error('Listener for type "command" requires a "priority".');const y=this._commands;y.has(s)||y.set(s,[new Set,new Set,new Set,new Set,new Set]);const N=y.get(s);if(N===void 0)throw Error(`registerCommand: Command ${String(s)} not found in command map`);const b=N[h];return b.add(c),()=>{b.delete(c),N.every($=>$.size===0)&&y.delete(s)}}registerMutationListener(s,c){if(this._nodes.get(s.getType())===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);const y=this._listeners.mutation;return y.set(c,s),()=>{y.delete(c)}}registerNodeTransformToKlass(s,c){const h=s.getType(),y=this._nodes.get(h);if(y===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);return y.transforms.add(c),y}registerNodeTransform(s,c){const h=this.registerNodeTransformToKlass(s,c),y=[h],N=h.replaceWithKlass;if(N!=null){const b=this.registerNodeTransformToKlass(N,c);y.push(b)}return bi(this,s.getType()),()=>{y.forEach(b=>b.transforms.delete(c))}}hasNode(s){return this._nodes.has(s.getType())}hasNodes(s){return s.every(this.hasNode.bind(this))}dispatchCommand(s,c){return dt(this,s,c)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(s){const c=this._rootElement;if(s!==c){const h=$i(this._config.theme,"root"),y=this._pendingEditorState||this._editorState;if(this._rootElement=s,af(this,c,s,y),c!==null&&(this._config.disableEvents||wt(c),h!=null&&c.classList.remove(...h)),s!==null){const N=Ma(s),b=s.style;b.userSelect="text",b.whiteSpace="pre-wrap",b.wordBreak="break-word",s.setAttribute("data-lexical-editor","true"),this._window=N,this._dirtyType=ut,sr(this),this._updateTags.add("history-merge"),Js(this),this._config.disableEvents||pt(s,this),h!=null&&s.classList.add(...h)}else this._editorState=y,this._pendingEditorState=null,this._window=null;Gl("root",this,!1,s,c)}}getElementByKey(s){return this._keyToDOMMap.get(s)||null}getEditorState(){return this._editorState}setEditorState(s,c){if(s.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");fn(this);const h=this._pendingEditorState,y=this._updateTags,N=c!==void 0?c.tag:null;h!==null&&!h.isEmpty()&&(N!=null&&y.add(N),Js(this)),this._pendingEditorState=s,this._dirtyType=ut,this._dirtyElements.set("root",!1),this._compositionKey=null,N!=null&&y.add(N),Js(this)}parseEditorState(s,c){const h=typeof s=="string"?JSON.parse(s):s;return I_(h,this,c)}update(s,c){zr(this,s,c)}focus(s,c={}){const h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),zr(this,()=>{const y=_n(),N=tr();y!==null?y.dirty=!0:N.getChildrenSize()!==0&&(c.defaultSelection==="rootStart"?N.selectStart():N.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),s&&s()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){const s=this._rootElement;s!==null&&s.blur();const c=ar(this._window);c!==null&&c.removeAllRanges()}isEditable(){return this._editable}setEditable(s){this._editable!==s&&(this._editable=s,Gl("editable",this,!0,s))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Uc extends Xs{constructor(s,c){super(c),this.__colSpan=s,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(s){return this.getWritable().__colSpan=s,this}getRowSpan(){return this.__rowSpan}setRowSpan(s){return this.getWritable().__rowSpan=s,this}}function Wo(u){return u instanceof Uc}class cf extends Xs{}function uf(u){return u instanceof cf}class df extends Xs{}function Gc(u){return u instanceof df}return He.$INTERNAL_isPointSelection=ur,He.$addUpdateTag=Ct,He.$applyNodeReplacement=Dr,He.$copyNode=Dl,He.$createLineBreakNode=ps,He.$createNodeSelection=$c,He.$createParagraphNode=qi,He.$createPoint=Rr,He.$createRangeSelection=E_,He.$createTabNode=Lo,He.$createTextNode=Dn,He.$getAdjacentNode=wl,He.$getNearestNodeFromDOMNode=ii,He.$getNearestRootOrShadowRoot=Co,He.$getNodeByKey=Cn,He.$getPreviousSelection=$o,He.$getRoot=tr,He.$getSelection=_n,He.$getTextContent=w_,He.$hasAncestor=Bi,He.$hasUpdateTag=Un,He.$insertNodes=S_,He.$isBlockElementNode=C_,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Fr,He.$isLeafNode=As,He.$isLineBreakNode=ai,He.$isNodeSelection=Kr,He.$isParagraphNode=z_,He.$isRangeSelection=Tt,He.$isRootNode=Ur,He.$isRootOrShadowRoot=si,He.$isTabNode=Io,He.$isTextNode=_t,He.$nodesOfType=Fi,He.$normalizeSelection__EXPERIMENTAL=Os,He.$parseSerializedNode=L_,He.$selectAll=Sl,He.$setCompositionKey=vn,He.$setSelection=Cr,He.$splitNode=Ra,He.BLUR_COMMAND=B,He.CAN_REDO_COMMAND=X,He.CAN_UNDO_COMMAND=fe,He.CLEAR_EDITOR_COMMAND=R,He.CLEAR_HISTORY_COMMAND=U,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=V_,He.COMMAND_PRIORITY_EDITOR=U_,He.COMMAND_PRIORITY_HIGH=j_,He.COMMAND_PRIORITY_LOW=G_,He.COMMAND_PRIORITY_NORMAL=Y_,He.CONTROLLED_TEXT_INSERTION_COMMAND=p,He.COPY_COMMAND=Y,He.CUT_COMMAND=W,He.DELETE_CHARACTER_COMMAND=l,He.DELETE_LINE_COMMAND=S,He.DELETE_WORD_COMMAND=E,He.DEPRECATED_$computeGridMap=O_,He.DEPRECATED_$getGridCellNodeRect=Lr,He.DEPRECATED_$getNodeTriplet=qd,He.DEPRECATED_$isGridCellNode=Wo,He.DEPRECATED_$isGridNode=uf,He.DEPRECATED_$isGridRowNode=Gc,He.DEPRECATED_GridCellNode=Uc,He.DEPRECATED_GridNode=cf,He.DEPRECATED_GridRowNode=df,He.DRAGEND_COMMAND=oe,He.DRAGOVER_COMMAND=Z,He.DRAGSTART_COMMAND=O,He.DROP_COMMAND=de,He.DecoratorNode=Kc,He.ElementNode=Xs,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=K,He.FORMAT_TEXT_COMMAND=w,He.INDENT_CONTENT_COMMAND=Se,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=f,He.INSERT_TAB_COMMAND=Te,He.INTERNAL_PointSelection=br,He.KEY_ARROW_DOWN_COMMAND=j,He.KEY_ARROW_LEFT_COMMAND=I,He.KEY_ARROW_RIGHT_COMMAND=k,He.KEY_ARROW_UP_COMMAND=H,He.KEY_BACKSPACE_COMMAND=ce,He.KEY_DELETE_COMMAND=z,He.KEY_DOWN_COMMAND=v,He.KEY_ENTER_COMMAND=re,He.KEY_ESCAPE_COMMAND=V,He.KEY_MODIFIER_COMMAND=A,He.KEY_SPACE_COMMAND=te,He.KEY_TAB_COMMAND=q,He.LineBreakNode=ji,He.MOVE_TO_END=G,He.MOVE_TO_START=P,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=_,He.ParagraphNode=Ho,He.REDO_COMMAND=m,He.REMOVE_TEXT_COMMAND=T,He.RootNode=Bo,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=J,He.TabNode=xr,He.TextNode=Jr,He.UNDO_COMMAND=M,He.createCommand=e,He.createEditor=Z_,He.getNearestEditorFromDOMNode=fl,He.isCurrentlyReadOnlyMode=Fo,He.isHTMLAnchorElement=ba,He.isHTMLElement=Ws,He.isSelectionCapturedInDecoratorInput=Ds,He.isSelectionWithinEditor=ss,He}var We={},bf;function HN(){if(bf)return We;bf=1;let e={},t={},n={},r={},l={},d={},f={},p={},_={},T={},E={},S={},w={},M={},m={},v={},k={},G={},I={},P={},H={},j={},re={},te={},ce={},V={},z={},q={},Te={},Se={},Ee={},de={},K={},O={},Z={},oe={};function Y(o){let i=new URLSearchParams;i.append("code",o);for(let a=1;a<arguments.length;a++)i.append("v",arguments[a]);throw Error(`Minified Lexical error #${o}; visit https://lexical.dev/docs/error?${i} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let W=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J=W&&"documentMode"in document?document.documentMode:null,R=W&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),U=W&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),X=W&&"InputEvent"in window&&!J?"getTargetRanges"in new window.InputEvent("input"):!1,fe=W&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=W&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,B=W&&/Android/.test(navigator.userAgent),A=W&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F=W&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!A,se=fe||_e||F?" ":"",ye=U?" ":se,De=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,ee=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,ne={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ue={directionless:1,unmergeable:2},be={center:2,end:6,justify:4,left:1,right:3,start:5},Ne={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Re={normal:0,segmented:2,token:1},ke={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(o){qe=o.timeStamp}function ut(o,i,a){return i.__lexicalLineBreak===o||o[`__lexicalKey_${a._key}`]!==void 0}function At(o){return o.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function Ut(o,i,a){Fe=!0;let g=100<performance.now()-qe;try{Tr(o,()=>{let C=Vt()||At(o);var x=new Map,D=o.getRootElement(),Q=o._editorState,ge=o._blockCursorElement;let Ae=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,pt=Ke.target,wt=Kt(pt,Q);if(!(wt===null&&pt!==D||En(wt))){if(Pe==="characterData"){if(Ke=g&&Ct(wt))e:{Ke=C,Pe=pt;var Ft=wt;if(Mt(Ke)){var zt=Ke.anchor.getNode();if(zt.is(Ft)&&Ke.format!==zt.getFormat()){Ke=!1;break e}}Ke=Pe.nodeType===3&&Ft.isAttached()}Ke&&(Ft=jr(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===pt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),pt=pt.nodeValue,pt!==null&&St(wt,pt,Ke,Pe,!1))}else if(Pe==="childList"){for(Ae=!0,Pe=Ke.addedNodes,Ft=0;Ft<Pe.length;Ft++){zt=Pe[Ft];var Yn=$t(zt),Ar=zt.parentNode;Ar==null||zt===ge||Yn!==null||zt.nodeName==="BR"&&ut(zt,Ar,o)||(U&&(Yn=zt.innerText||zt.nodeValue)&&(Ye+=Yn),Ar.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)Ar=Ke[zt],(Ar.nodeName==="BR"&&ut(Ar,pt,o)||ge===Ar)&&(pt.appendChild(Ar),Ft++);Pe!==Ft&&(pt===D&&(wt=Q._nodeMap.get("root")),x.set(pt,wt))}}}}if(0<x.size)for(let[oi,li]of x)if(Je(li))for(x=li.getChildrenKeys(),D=oi.firstChild,Q=0;Q<x.length;Q++)ge=o.getElementByKey(x[Q]),ge!==null&&(D==null?(oi.appendChild(ge),D=ge):D!==ge&&oi.replaceChild(ge,D),D=D.nextSibling);else Ct(li)&&li.markDirty();if(x=a.takeRecords(),0<x.length){for(D=0;D<x.length;D++)for(ge=x[D],Q=ge.addedNodes,ge=ge.target,Xe=0;Xe<Q.length;Xe++)wt=Q[Xe],pt=wt.parentNode,pt==null||wt.nodeName!=="BR"||ut(wt,ge,o)||pt.removeChild(wt);a.takeRecords()}C!==null&&(Ae&&(C.dirty=!0,nn(C)),U&&sn(o)&&C.insertRawText(Ye))})}finally{Fe=!1}}function en(o){let i=o._observer;if(i!==null){let a=i.takeRecords();Ut(o,a,i)}}function Oe(o){qe===0&&fn(o).addEventListener("textInput",Be,!0),o._observer=new MutationObserver((i,a)=>{Ut(o,i,a)})}function ie(o,i){let a=o.__mode,g=o.__format;o=o.__style;let C=i.__mode,x=i.__format;return i=i.__style,(a===null||a===C)&&(g===null||g===x)&&(o===null||o===i)}function le(o,i){let a=o.mergeWithSibling(i),g=hn()._normalizedNodes;return g.add(o.__key),g.add(i.__key),a}function ve(o){if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable())o.remove();else{for(var i;(i=o.getPreviousSibling())!==null&&Ct(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{ie(i,o)&&(o=le(i,o));break}for(var a;(a=o.getNextSibling())!==null&&Ct(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else{ie(o,a)&&le(o,a);break}}}function Le(o){return Me(o.anchor),Me(o.focus),o}function Me(o){for(;o.type==="element";){var i=o.getNode(),a=o.offset;if(a===i.getChildrenSize()?(i=i.getChildAtIndex(a-1),a=!0):(i=i.getChildAtIndex(a),a=!1),Ct(i)){o.set(i.__key,a?i.getTextContentSize():0,"text");break}else if(!Je(i))break;o.set(i.__key,a?i.getChildrenSize():0,"element")}}let je=1,rt=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function it(o){let i=document.activeElement;if(i===null)return!1;let a=i.nodeName;return En(Kt(o))&&(a==="INPUT"||a==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function st(o,i,a){let g=o.getRootElement();try{return g!==null&&g.contains(i)&&g.contains(a)&&i!==null&&!it(i)&&vt(i)===o}catch{return!1}}function vt(o){for(;o!=null;){let i=o.__lexicalEditor;if(i!=null)return i;o=yr(o)}return null}function Ge(o){return o.isToken()||o.isSegmented()}function ze(o){for(;o!=null;){if(o.nodeType===3)return o;o=o.firstChild}return null}function tt(o,i,a){let g=ne[i];return a!==null&&(o&g)===(a&g)||(o^=g,i==="subscript"?o&=-65:i==="superscript"&&(o&=-33)),o}function yt(o,i){if(i!=null)o.__key=i;else{Jn(),99<Ki&&Y(14),i=hn();var a=Br(),g=""+je++;a._nodeMap.set(g,o),Je(o)?i._dirtyElements.set(g,!0):i._dirtyLeaves.add(g),i._cloneNotNeeded.add(g),i._dirtyType=1,o.__key=g}}function Nt(o){var i=o.getParent();if(i!==null){let C=o.getWritable();i=i.getWritable();var a=o.getPreviousSibling();if(o=o.getNextSibling(),a===null)if(o!==null){var g=o.getWritable();i.__first=o.__key,g.__prev=null}else i.__first=null;else{if(g=a.getWritable(),o!==null){let x=o.getWritable();x.__prev=g.__key,g.__next=x.__key}else g.__next=null;C.__prev=null}o===null?a!==null?(o=a.getWritable(),i.__last=a.__key,o.__next=null):i.__last=null:(o=o.getWritable(),a!==null?(a=a.getWritable(),a.__next=o.__key,o.__prev=a.__key):o.__prev=null,C.__next=null),i.__size--,C.__parent=null}}function Et(o){99<Ki&&Y(14);var i=o.getLatest(),a=i.__parent,g=Br();let C=hn(),x=g._nodeMap;if(g=C._dirtyElements,a!==null)e:for(;a!==null;){if(g.has(a))break e;let D=x.get(a);if(D===void 0)break;g.set(a,!1),a=D.__parent}i=i.__key,C._dirtyType=1,Je(o)?g.set(i,!0):C._dirtyLeaves.add(i)}function gt(o){Jn();var i=hn();let a=i._compositionKey;o!==a&&(i._compositionKey=o,a!==null&&(i=mt(a),i!==null&&i.getWritable()),o!==null&&(o=mt(o),o!==null&&o.getWritable()))}function xt(){return hs()?null:hn()._compositionKey}function mt(o,i){return o=(i||Br())._nodeMap.get(o),o===void 0?null:o}function $t(o,i){let a=hn();return o=o[`__lexicalKey_${a._key}`],o!==void 0?mt(o,i):null}function Kt(o,i){for(;o!=null;){let a=$t(o,i);if(a!==null)return a;o=yr(o)}return null}function tn(o){let i=Object.assign({},o._decorators);return o._pendingDecorators=i}function It(o){return o.read(()=>bt().getTextContent())}function jt(o,i){Tr(o,()=>{var a=Br();if(!a.isEmpty())if(i==="root")bt().markDirty();else{a=a._nodeMap;for(let[,g]of a)g.markDirty()}},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return Br()._nodeMap.get("root")}function nn(o){Jn();let i=Br();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function Or(o){var i=hn(),a;e:{for(a=o;a!=null;){let g=a[`__lexicalKey_${i._key}`];if(g!==void 0){a=g;break e}a=yr(a)}a=null}return a===null?(i=i.getRootElement(),o===i?mt("root"):null):mt(a)}function _i(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function pe(o){let i=[];for(;o!==null;)i.push(o),o=o._parentEditor;return i}function Ze(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ot(o,i,a){if(i=jr(i._window),i!==null){var g=i.anchorNode,{anchorOffset:C,focusOffset:x}=i;if(g!==null&&(i=g.nodeType===3?g.nodeValue:null,g=Kt(g),i!==null&&Ct(g))){if(i===se&&a){let D=a.length;i=a,x=C=D}i!==null&&St(g,i,C,x,o)}}}function St(o,i,a,g,C){let x=o;if(x.isAttached()&&(C||!x.isDirty())){let Ae=x.isComposing(),Ye=i;if((Ae||C)&&i[i.length-1]===se&&(Ye=i.slice(0,-1)),i=x.getTextContent(),C||Ye!==i)if(Ye==="")if(gt(null),fe||_e||F)x.remove();else{let Xe=hn();setTimeout(()=>{Xe.update(()=>{x.isAttached()&&x.remove()})},20)}else{C=x.getParent(),i=Er();var D=x.getTextContentSize(),Q=xt(),ge=x.getKey();x.isToken()||Q!==null&&ge===Q&&!Ae||Mt(i)&&(C!==null&&!C.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===o.__key&&i.anchor.offset===0&&!x.canInsertTextBefore()&&!Ae||i.focus.key===o.__key&&i.focus.offset===D&&!x.canInsertTextAfter()&&!Ae)?x.markDirty():(o=Vt(),Mt(o)&&a!==null&&g!==null&&(o.setTextNodeRange(x,a,x,g),x.isSegmented()&&(a=x.getTextContent(),a=Un(a),x.replace(a),x=a)),x.setTextContent(Ye))}}}function Gt(o,i){if(i.isSegmented())return!0;if(!o.isCollapsed())return!1;o=o.anchor.offset;let a=i.getParentOrThrow(),g=i.isToken();return o===0?((o=!i.canInsertTextBefore()||!a.canInsertTextBefore()||g)||(i=i.getPreviousSibling(),o=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),o):o===i.getTextContentSize()?!i.canInsertTextAfter()||!a.canInsertTextAfter()||g:!1}function Bt(o,i){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let a=o.__lexicalClassNameCache,g=a[i];return g!==void 0?g:(o=o[i],typeof o=="string"?(o=o.split(" "),a[i]=o):o)}function Pt(o,i,a,g,C){a.size!==0&&(a=g.__type,g=g.__key,i=i.get(a),i===void 0&&Y(33,a),a=i.klass,i=o.get(a),i===void 0&&(i=new Map,o.set(a,i)),o=i.get(g),a=o==="destroyed"&&C==="created",(o===void 0||a)&&i.set(g,a?"updated":C))}function kt(o,i,a){let g=o.getParent(),C=a;return g!==null&&(i&&a===0?(C=o.getIndexWithinParent(),o=g):i||a!==o.getChildrenSize()||(C=o.getIndexWithinParent()+1,o=g)),o.getChildAtIndex(i?C-1:C)}function Ht(o,i){var a=o.offset;return o.type==="element"?(o=o.getNode(),kt(o,i,a)):(o=o.getNode(),i&&a===0||!i&&a===o.getTextContentSize()?(a=i?o.getPreviousSibling():o.getNextSibling(),a===null?kt(o.getParentOrThrow(),i,o.getIndexWithinParent()+(i?0:1)):a):null)}function sn(o){return o=(o=fn(o).event)&&o.inputType,o==="insertFromPaste"||o==="insertFromPasteAsQuotation"}function an(o){return!nr(o)&&!o.isLastChild()&&!o.isInline()}function bn(o,i){return o=o._keyToDOMMap.get(i),o===void 0&&Y(75,i),o}function yr(o){return o=o.assignedSlot||o.parentElement,o!==null&&o.nodeType===11?o.host:o}function Zn(o,i){for(o=o.getParent();o!==null;){if(o.is(i))return!0;o=o.getParent()}return!1}function fn(o){return o=o._window,o===null&&Y(78),o}function sr(o){for(o=o.getParentOrThrow();o!==null&&!or(o);)o=o.getParentOrThrow();return o}function or(o){return nr(o)||Je(o)&&o.isShadowRoot()}function Mi(o){return o=o.constructor.clone(o),yt(o,null),o}function Nr(o){var i=hn();let a=o.constructor.getType();return i=i._nodes.get(a),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||Y(98),i):o}function Os(o,i){o=o.getParent(),!nr(o)||Je(i)||En(i)||Y(99)}function uo(o){return(En(o)||Je(o)&&!o.canBeEmpty())&&!o.isInline()}function dl(o,i,a){a.style.removeProperty("caret-color"),i._blockCursorElement=null,i=o.parentElement,i!==null&&i.removeChild(o)}function jr(o){return W?(o||window).getSelection():null}function pa(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function fo(o){return o.nodeType===1}function is(o){if(En(o)&&!o.isInline())return!0;if(!Je(o)||or(o))return!1;var i=o.getFirstChild();return i=i===null||ki(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function Ds(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function ss(o,i,a,g,C,x){for(o=o.getFirstChild();o!==null;){let D=o.__key;o.__parent===i&&(Je(o)&&ss(o,D,a,g,C,x),a.has(D)||x.delete(D),C.push(D)),o=o.getNextSibling()}}function fl(o,i,a,g){o=o._nodeMap,i=i._nodeMap;let C=[];for(let[x]of g){let D=i.get(x);D===void 0||D.isAttached()||(Je(D)&&ss(D,x,o,i,C,g),o.has(x)||g.delete(x),C.push(x))}for(let x of C)i.delete(x);for(let x of a)g=i.get(x),g===void 0||g.isAttached()||(o.has(x)||a.delete(x),i.delete(x))}let Ln="",zn="",ri="",Pr,Bn,As,hl=!1,gl=!1,Vr,Ri=null,pl,vn,lr,Cn,ho,ii;function Ms(o,i){let a=lr.get(o);if(i!==null){let g=bs(o);g.parentNode===i&&i.removeChild(g)}Cn.has(o)||Bn._keyToDOMMap.delete(o),Je(a)&&(o=Rs(a,lr),go(o,0,o.length-1,null)),a!==void 0&&Pt(ii,As,Vr,a,"destroyed")}function go(o,i,a,g){for(;i<=a;++i){let C=o[i];C!==void 0&&Ms(C,g)}}function bi(o,i){o.setProperty("text-align",i)}function tr(o,i){var a=Pr.theme.indent;if(typeof a=="string"){let g=o.classList.contains(a);0<i&&!g?o.classList.add(a):1>i&&g&&o.classList.remove(a)}a=getComputedStyle(o).getPropertyValue("--lexical-indent-base-value")||"40px",o.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${a})`)}function ml(o,i){o=o.style,i===0?bi(o,""):i===1?bi(o,"left"):i===2?bi(o,"center"):i===3?bi(o,"right"):i===4?bi(o,"justify"):i===5?bi(o,"start"):i===6&&bi(o,"end")}function Cr(o,i,a){let g=Cn.get(o);g===void 0&&Y(60);let C=g.createDOM(Pr,Bn);var x=Bn._keyToDOMMap;if(C["__lexicalKey_"+Bn._key]=o,x.set(o,C),Ct(g)?C.setAttribute("data-lexical-text","true"):En(g)&&C.setAttribute("data-lexical-decorator","true"),Je(g)){if(o=g.__indent,x=g.__size,o!==0&&tr(C,o),x!==0){--x,o=Rs(g,Cn);var D=zn;zn="",_l(o,g,0,x,C,null),ma(g,C),zn=D}o=g.__format,o!==0&&ml(C,o),g.isInline()||yl(null,g,C),an(g)&&(Ln+=`
|
|
47
47
|
|
|
48
48
|
`,ri+=`
|
|
49
49
|
|
|
50
|
-
`)}else x=g.getTextContent(),En(g)?(D=g.decorate(Bn,Pr),D!==null&&Nl(o,D),C.contentEditable="false"):Ct(g)&&(g.isDirectionless()||(zn+=x)),Ln+=x,ri+=x;return i!==null&&(a!=null?i.insertBefore(C,a):(a=i.__lexicalLineBreak,a!=null?i.insertBefore(C,a):i.appendChild(C))),Pt(ii,As,
|
|
50
|
+
`)}else x=g.getTextContent(),En(g)?(D=g.decorate(Bn,Pr),D!==null&&Nl(o,D),C.contentEditable="false"):Ct(g)&&(g.isDirectionless()||(zn+=x)),Ln+=x,ri+=x;return i!==null&&(a!=null?i.insertBefore(C,a):(a=i.__lexicalLineBreak,a!=null?i.insertBefore(C,a):i.appendChild(C))),Pt(ii,As,Vr,g,"created"),C}function _l(o,i,a,g,C,x){let D=Ln;for(Ln="";a<=g;++a)Cr(o[a],C,x);an(i)&&(Ln+=`
|
|
51
51
|
|
|
52
|
-
`),C.__lexicalTextContent=Ln,Ln=D+Ln}function Li(o,i){return o=i.get(o),ki(o)||En(o)&&o.isInline()}function yl(o,i,a){o=o!==null&&(o.__size===0||Li(o.__last,lr)),i=i.__size===0||Li(i.__last,Cn),o?i||(i=a.__lexicalLineBreak,i!=null&&a.removeChild(i),a.__lexicalLineBreak=null):i&&(i=document.createElement("br"),a.__lexicalLineBreak=i,a.appendChild(i))}function ma(o,i){var a=i.__lexicalDir;if(i.__lexicalDirTextContent!==zn||a!==Ri){let x=zn==="";if(x)var g=Ri;else g=zn,g=De.test(g)?"rtl":ee.test(g)?"ltr":null;if(g!==a){let D=i.classList,Q=Pr.theme;var C=a!==null?Q[a]:void 0;let ge=g!==null?Q[g]:void 0;C!==void 0&&(typeof C=="string"&&(C=C.split(" "),C=Q[a]=C),D.remove(...C)),g===null||x&&g==="ltr"?i.removeAttribute("dir"):(ge!==void 0&&(typeof ge=="string"&&(a=ge.split(" "),ge=Q[g]=a),ge!==void 0&&D.add(...ge)),i.dir=g),gl||(o.getWritable().__dir=g)}Ri=g,i.__lexicalDirTextContent=zn,i.__lexicalDir=g}}function Rs(o,i){let a=[];for(o=o.__first;o!==null;){let g=i.get(o);g===void 0&&Y(101),a.push(o),o=g.__next}return a}function Ii(o,i){var a=lr.get(o),g=Cn.get(o);a!==void 0&&g!==void 0||Y(61);var C=hl||vn.has(o)||pl.has(o);let x=bn(Bn,o);if(a===g&&!C)return Je(a)?(g=x.__lexicalTextContent,g!==void 0&&(Ln+=g,ri+=g),g=x.__lexicalDirTextContent,g!==void 0&&(zn+=g)):(g=a.getTextContent(),Ct(a)&&!a.isDirectionless()&&(zn+=g),ri+=g,Ln+=g),x;if(a!==g&&C&&Pt(ii,As,
|
|
52
|
+
`),C.__lexicalTextContent=Ln,Ln=D+Ln}function Li(o,i){return o=i.get(o),ki(o)||En(o)&&o.isInline()}function yl(o,i,a){o=o!==null&&(o.__size===0||Li(o.__last,lr)),i=i.__size===0||Li(i.__last,Cn),o?i||(i=a.__lexicalLineBreak,i!=null&&a.removeChild(i),a.__lexicalLineBreak=null):i&&(i=document.createElement("br"),a.__lexicalLineBreak=i,a.appendChild(i))}function ma(o,i){var a=i.__lexicalDir;if(i.__lexicalDirTextContent!==zn||a!==Ri){let x=zn==="";if(x)var g=Ri;else g=zn,g=De.test(g)?"rtl":ee.test(g)?"ltr":null;if(g!==a){let D=i.classList,Q=Pr.theme;var C=a!==null?Q[a]:void 0;let ge=g!==null?Q[g]:void 0;C!==void 0&&(typeof C=="string"&&(C=C.split(" "),C=Q[a]=C),D.remove(...C)),g===null||x&&g==="ltr"?i.removeAttribute("dir"):(ge!==void 0&&(typeof ge=="string"&&(a=ge.split(" "),ge=Q[g]=a),ge!==void 0&&D.add(...ge)),i.dir=g),gl||(o.getWritable().__dir=g)}Ri=g,i.__lexicalDirTextContent=zn,i.__lexicalDir=g}}function Rs(o,i){let a=[];for(o=o.__first;o!==null;){let g=i.get(o);g===void 0&&Y(101),a.push(o),o=g.__next}return a}function Ii(o,i){var a=lr.get(o),g=Cn.get(o);a!==void 0&&g!==void 0||Y(61);var C=hl||vn.has(o)||pl.has(o);let x=bn(Bn,o);if(a===g&&!C)return Je(a)?(g=x.__lexicalTextContent,g!==void 0&&(Ln+=g,ri+=g),g=x.__lexicalDirTextContent,g!==void 0&&(zn+=g)):(g=a.getTextContent(),Ct(a)&&!a.isDirectionless()&&(zn+=g),ri+=g,Ln+=g),x;if(a!==g&&C&&Pt(ii,As,Vr,g,"updated"),g.updateDOM(a,x,Pr))return g=Cr(o,null,null),i===null&&Y(62),i.replaceChild(g,x),Ms(o,null),g;if(Je(a)&&Je(g)){if(o=g.__indent,o!==a.__indent&&tr(x,o),o=g.__format,o!==a.__format&&ml(x,o),C){o=zn,zn="",C=Ln;var D=a.__size,Q=g.__size;if(Ln="",D===1&&Q===1){var ge=a.__first;if(i=g.__first,ge===i)Ii(ge,x);else{var Ae=bs(ge);i=Cr(i,null,null),x.replaceChild(i,Ae),Ms(ge,null)}}else{i=Rs(a,lr);var Ye=Rs(g,Cn);if(D===0)Q!==0&&_l(Ye,g,0,Q-1,x,null);else if(Q===0)D!==0&&(ge=x.__lexicalLineBreak==null,go(i,0,D-1,ge?null:x),ge&&(x.textContent=""));else{var Xe=i;i=Ye,Ye=D-1,D=Q-1;let Pe=x.firstChild,pt=0;for(Q=0;pt<=Ye&&Q<=D;){var Ke=Xe[pt];let wt=i[Q];if(Ke===wt)Pe=po(Ii(wt,x)),pt++,Q++;else{ge===void 0&&(ge=new Set(Xe)),Ae===void 0&&(Ae=new Set(i));let Ft=Ae.has(Ke),zt=ge.has(wt);Ft?(zt?(Ke=bn(Bn,wt),Ke===Pe?Pe=po(Ii(wt,x)):(Pe!=null?x.insertBefore(Ke,Pe):x.appendChild(Ke),Ii(wt,x)),pt++):Cr(wt,x,Pe),Q++):(Pe=po(bs(Ke)),Ms(Ke,x),pt++)}}ge=pt>Ye,Ae=Q>D,ge&&!Ae?(ge=i[D+1],ge=ge===void 0?null:Bn.getElementByKey(ge),_l(i,g,Q,D,x,ge)):Ae&&!ge&&go(Xe,pt,Ye,x)}}an(g)&&(Ln+=`
|
|
53
53
|
|
|
54
54
|
`),x.__lexicalTextContent=Ln,Ln=C+Ln,ma(g,x),zn=o,nr(g)||g.isInline()||yl(a,g,x)}an(g)&&(Ln+=`
|
|
55
55
|
|
|
56
56
|
`,ri+=`
|
|
57
57
|
|
|
58
|
-
`)}else a=g.getTextContent(),En(g)?(C=g.decorate(Bn,Pr),C!==null&&Nl(o,C)):Ct(g)&&!g.isDirectionless()&&(zn+=a),Ln+=a,ri+=a;return!gl&&nr(g)&&g.__cachedText!==ri&&(g.getWritable().__cachedText=ri),x}function Nl(o,i){let a=Bn._pendingDecorators,g=Bn._decorators;if(a===null){if(g[o]===i)return;a=tn(Bn)}a[o]=i}function po(o){return o=o.nextSibling,o!==null&&o===Bn._blockCursorElement&&(o=o.nextSibling),o}function bs(o){let i=ho.get(o);return i===void 0&&Y(75,o),i}let $r=Object.freeze({}),Cl=[["keydown",Lc],["pointerdown",Ac],["compositionstart",Sa],["compositionend",bc],["input",va],["click",Dc],["cut",$r],["copy",$r],["dragstart",$r],["dragover",$r],["dragend",$r],["paste",$r],["focus",$r],["blur",$r],["drop",$r]];X&&Cl.push(["beforeinput",(o,i)=>Rc(o,i)]);let Ls=0,_a=0,ya=0,os=null,Is=0,El=!1,Tl=!1,ks=!1,Ps=!1,Na=[0,"",0,"root",0];function Ca(o,i,a,g,C){let x=o.anchor,D=o.focus,Q=x.getNode();var ge=hn();let Ae=
|
|
59
|
-
`?(o.preventDefault(),
|
|
58
|
+
`)}else a=g.getTextContent(),En(g)?(C=g.decorate(Bn,Pr),C!==null&&Nl(o,C)):Ct(g)&&!g.isDirectionless()&&(zn+=a),Ln+=a,ri+=a;return!gl&&nr(g)&&g.__cachedText!==ri&&(g.getWritable().__cachedText=ri),x}function Nl(o,i){let a=Bn._pendingDecorators,g=Bn._decorators;if(a===null){if(g[o]===i)return;a=tn(Bn)}a[o]=i}function po(o){return o=o.nextSibling,o!==null&&o===Bn._blockCursorElement&&(o=o.nextSibling),o}function bs(o){let i=ho.get(o);return i===void 0&&Y(75,o),i}let $r=Object.freeze({}),Cl=[["keydown",Lc],["pointerdown",Ac],["compositionstart",Sa],["compositionend",bc],["input",va],["click",Dc],["cut",$r],["copy",$r],["dragstart",$r],["dragover",$r],["dragend",$r],["paste",$r],["focus",$r],["blur",$r],["drop",$r]];X&&Cl.push(["beforeinput",(o,i)=>Rc(o,i)]);let Ls=0,_a=0,ya=0,os=null,Is=0,El=!1,Tl=!1,ks=!1,Ps=!1,Na=[0,"",0,"root",0];function Ca(o,i,a,g,C){let x=o.anchor,D=o.focus,Q=x.getNode();var ge=hn();let Ae=jr(ge._window),Ye=Ae!==null?Ae.anchorNode:null,Xe=x.key;ge=ge.getElementByKey(Xe);let Ke=a.length;return Xe!==D.key||!Ct(Q)||(!C&&(!X||ya<g+50)||Q.isDirty()&&2>Ke||_i(a))&&x.offset!==D.offset&&!Q.isComposing()||Ge(Q)||Q.isDirty()&&1<Ke||(C||!X)&&ge!==null&&!Q.isComposing()&&Ye!==ze(ge)||Ae!==null&&i!==null&&(!i.collapsed||i.startContainer!==Ae.anchorNode||i.startOffset!==Ae.anchorOffset)||Q.getFormat()!==o.format||Q.getStyle()!==o.style||Gt(o,Q)}function Ea(o,i){return o!==null&&o.nodeValue!==null&&o.nodeType===3&&i!==0&&i!==o.nodeValue.length}function Ta(o,i,a){let{anchorNode:g,anchorOffset:C,focusNode:x,focusOffset:D}=o;El&&(El=!1,Ea(g,C)&&Ea(x,D))||Tr(i,()=>{if(!a)nn(null);else if(st(i,g,x)){var Q=Vt();if(Mt(Q)){var ge=Q.anchor,Ae=ge.getNode();if(Q.isCollapsed()){o.type==="Range"&&o.anchorNode===o.focusNode&&(Q.dirty=!0);var Ye=fn(i).event;Ye=Ye?Ye.timeStamp:performance.now();let[Ke,Pe,pt,wt,Ft]=Na;var Xe=bt();if(Xe=i.isComposing()===!1&&Xe.getTextContent()==="",Ye<Ft+200&&ge.offset===pt&&ge.key===wt)Q.format=Ke,Q.style=Pe;else if(ge.type==="text"){if(!Ct(Ae))throw Error("Point.getNode() must return TextNode when type is text");Q.format=Ae.getFormat(),Q.style=Ae.getStyle()}else ge.type!=="element"||Xe||(Q.format=0,Q.style="")}else{ge=255,Ae=!1,Ye=Q.getNodes(),Xe=Ye.length;for(let Ke=0;Ke<Xe;Ke++){let Pe=Ye[Ke];if(Ct(Pe)&&(Ae=!0,ge&=Pe.getFormat(),ge===0))break}Q.format=Ae?ge:0}}ct(i,e,void 0)}})}function Dc(o,i){Tr(i,()=>{let a=Vt();var g=jr(i._window);let C=Er();if(g)if(Mt(a)){let D=a.anchor;var x=D.getNode();D.type==="element"&&D.offset===0&&a.isCollapsed()&&!nr(x)&&bt().getChildrenSize()===1&&x.getTopLevelElementOrThrow().isEmpty()&&C!==null&&a.is(C)?(g.removeAllRanges(),a.dirty=!0):o.detail!==3||a.isCollapsed()||(g=a.focus.getNode(),x!==g&&(Je(x)?x.select(0):x.getParentOrThrow().select(0)))}else o.pointerType==="touch"&&(x=g.anchorNode,x!==null&&(x=x.nodeType,x===1||x===3))&&(g=Gn(C,g,i,o),nn(g));ct(i,t,o)})}function Ac(o,i){let a=o.target;o=o.pointerType,a instanceof Node&&o!=="touch"&&Tr(i,()=>{En(Kt(a))||(Tl=!0)})}function xa(o){return o.getTargetRanges?(o=o.getTargetRanges(),o.length===0?null:o[0]):null}function Mc(o,i){return o!==i||Je(o)||Je(i)||!o.isToken()||!i.isToken()}function Rc(o,i){let a=o.inputType,g=xa(o);a==="deleteCompositionText"||U&&sn(i)||a!=="insertCompositionText"&&Tr(i,()=>{let C=Vt();if(a==="deleteContentBackward"){if(C===null){var x=Er();if(!Mt(x))return;nn(x.clone())}if(Mt(C)){if(B&>(C.anchor.key),_a===229&&o.timeStamp<Ls+30&&i.isComposing()&&C.anchor.key===C.focus.key){if(gt(null),Ls=0,setTimeout(()=>{Tr(i,()=>{gt(null)})},30),Mt(C)){if(x=C.anchor.getNode(),x.markDirty(),C.format=x.getFormat(),!Ct(x))throw Error("Anchor node must be a TextNode");C.style=x.getStyle()}1>=C.anchor.getNode().getTextContent().length&&(o.preventDefault(),ct(i,n,!0))}else gt(null),o.preventDefault(),ct(i,n,!0);return}}if(Mt(C)){x=o.data,os!==null&&ot(!1,i,os),C.dirty&&os===null||!C.isCollapsed()||nr(C.anchor.getNode())||g===null||C.applyDOMRange(g),os=null;var D=C.focus,Q=C.anchor.getNode();if(D=D.getNode(),a==="insertText"||a==="insertTranspose")x===`
|
|
59
|
+
`?(o.preventDefault(),ct(i,r,!1)):x===`
|
|
60
60
|
|
|
61
|
-
`?(o.preventDefault(),
|
|
62
|
-
`&&(a=jt(),Mt(a))){i=a.focus,a.anchor.set(i.key,i.offset,i.type),at(o,H,null);return}}ot(!0,o,i)}function bc(o,i){U?Ps=!0:Tr(i,()=>{xl(i,o.data)})}function Lc(o,i){if(Ls=o.timeStamp,_a=o.keyCode,!i.isComposing()){var{keyCode:a,shiftKey:g,ctrlKey:C,metaKey:x,altKey:D}=o;if(!at(i,M,o)){if(a!==39||C||x||D)if(a!==39||D||g||!C&&!x)if(a!==37||C||x||D)if(a!==37||D||g||!C&&!x)if(a!==38||C||x)if(a!==40||C||x)if(a===13&&g)ks=!0,at(i,H,o);else if(a===32)at(i,V,o);else if(R&&C&&a===79)o.preventDefault(),ks=!0,at(i,r,!0);else if(a!==13||g){var Q=R?D||x?!1:a===8||a===72&&C:C||D||x?!1:a===8;Q?a===8?at(i,re,o):(o.preventDefault(),at(i,n,!0)):a===27?at(i,te,o):(Q=R?g||D||x?!1:a===46||a===68&&C:C||D||x?!1:a===46,Q?a===46?at(i,ce,o):(o.preventDefault(),at(i,n,!1)):a===8&&(R?D:C)?(o.preventDefault(),at(i,_,!0)):a===46&&(R?D:C)?(o.preventDefault(),at(i,_,!1)):R&&x&&a===8?(o.preventDefault(),at(i,T,!0)):R&&x&&a===46?(o.preventDefault(),at(i,T,!1)):a===66&&!D&&(R?x:C)?(o.preventDefault(),at(i,E,"bold")):a===85&&!D&&(R?x:C)?(o.preventDefault(),at(i,E,"underline")):a===73&&!D&&(R?x:C)?(o.preventDefault(),at(i,E,"italic")):a!==9||D||C||x?a===90&&!g&&(R?x:C)?(o.preventDefault(),at(i,S,void 0)):(Q=R?a===90&&x&&g:a===89&&C||a===90&&C&&g,Q?(o.preventDefault(),at(i,w,void 0)):ar(i._editorState._selection)?(Q=g?!1:a===67?R?x:C:!1,Q?(o.preventDefault(),at(i,Ee,o)):(Q=g?!1:a===88?R?x:C:!1,Q?(o.preventDefault(),at(i,de,o)):a===65&&(R?x:C)&&(o.preventDefault(),at(i,K,o)))):!U&&a===65&&(R?x:C)&&(o.preventDefault(),at(i,K,o))):at(i,j,o))}else ks=!1,at(i,H,o);else at(i,P,o);else at(i,I,o);else at(i,G,o);else at(i,k,o);else at(i,v,o);else at(i,m,o);(C||g||D||x)&&at(i,oe,o)}}}function wa(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let ls=new Map;function Oa(o){var i=o.target;let a=Vr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(a!==null){var g=vt(a.anchorNode);if(g!==null){Tl&&(Tl=!1,Tr(g,()=>{var Q=Er(),ge=a.anchorNode;ge!==null&&(ge=ge.nodeType,ge===1||ge===3)&&(Q=Gn(Q,a,g,o),nn(Q))})),i=pe(g),i=i[i.length-1];var C=i._key,x=ls.get(C),D=x||i;D!==g&&Ta(a,D,!1),Ta(a,g,!0),g!==i?ls.set(C,g):x&&ls.delete(C)}}}function Ic(o,i){Is===0&&o.ownerDocument.addEventListener("selectionchange",Oa),Is++,o.__lexicalEditor=i;let a=wa(o);for(let g=0;g<Cl.length;g++){let[C,x]=Cl[g],D=typeof x=="function"?Q=>{Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()&&x(Q,i))}:Q=>{if(Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()))switch(C){case"cut":return at(i,de,Q);case"copy":return at(i,Ee,Q);case"paste":return at(i,f,Q);case"dragstart":return at(i,q,Q);case"dragover":return at(i,Te,Q);case"dragend":return at(i,Se,Q);case"focus":return at(i,O,Q);case"blur":return at(i,Z,Q);case"drop":return at(i,z,Q)}};o.addEventListener(C,D),a.push(()=>{o.removeEventListener(C,D)})}}function vl(o,i,a){Jn();var g=o.__key;let C=o.getParent();if(C!==null){var x=jt();if(Mt(x)&&Je(o)){var{anchor:D,focus:Q}=x,ge=D.getNode(),Ae=Q.getNode();Zn(ge,o)&&D.set(o.__key,0,"element"),Zn(Ae,o)&&Q.set(o.__key,0,"element")}if(ge=x,Ae=!1,Mt(ge)&&i){x=ge.anchor;let Ye=ge.focus;x.key===g&&(ds(x,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0),Ye.key===g&&(ds(Ye,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0)}else ar(ge)&&i&&o.isSelected()&&o.selectPrevious();Mt(ge)&&i&&!Ae?(g=o.getIndexWithinParent(),Nt(o),Hn(ge,C,g,-1)):Nt(o),a||or(C)||C.canBeEmpty()||!C.isEmpty()||vl(C,i),i&&nr(C)&&C.isEmpty()&&C.selectEnd()}}class $s{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,yt(this,i)}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=mt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||jt(),i==null)return!1;let a=i.getNodes().some(g=>g.__key===this.__key);return Ct(this)?a:Mt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:a}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let a=0;for(;i!==null;){if(this.is(i))return a;a++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:mt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let a=i.getParent();if(or(a)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=a}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],a=this.getParent();for(;a!==null;)i.push(a),a=a.getParent();return i}getParentKeys(){let i=[],a=this.getParent();for(;a!==null;)i.push(a.__key),a=a.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:mt(i)}getPreviousSiblings(){let i=[];var a=this.getParent();if(a===null)return i;for(a=a.getFirstChild();a!==null&&!a.is(this);)i.push(a),a=a.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:mt(i)}getNextSiblings(){let i=[],a=this.getNextSibling();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getCommonAncestor(i){let a=this.getParents();var g=i.getParents();Je(this)&&a.unshift(this),Je(i)&&g.unshift(i),i=a.length;var C=g.length;if(i===0||C===0||a[i-1]!==g[C-1])return null;for(g=new Set(g),C=0;C<i;C++){let x=a[C];if(g.has(x))return x}return null}is(i){return i==null?!1:this.__key===i.__key}isBefore(i){if(this===i)return!1;if(i.isParentOf(this))return!0;if(this.isParentOf(i))return!1;var a=this.getCommonAncestor(i);let g=this;for(;;){var C=g.getParentOrThrow();if(C===a){C=g.getIndexWithinParent();break}g=C}for(g=i;;){if(i=g.getParentOrThrow(),i===a){a=g.getIndexWithinParent();break}g=i}return C<a}isParentOf(i){let a=this.__key;if(a===i.__key)return!1;for(;i!==null;){if(i.__key===a)return!0;i=i.getParent()}return!1}getNodesBetween(i){let a=this.isBefore(i),g=[],C=new Set;for(var x=this;;){var D=x.__key;if(C.has(D)||(C.add(D),g.push(x)),x===i)break;if(D=Je(x)?a?x.getFirstChild():x.getLastChild():null,D!==null)x=D;else if(D=a?x.getNextSibling():x.getPreviousSibling(),D!==null)x=D;else{if(x=x.getParentOrThrow(),C.has(x.__key)||g.push(x),x===i)break;D=x;do D===null&&Y(68),x=a?D.getNextSibling():D.getPreviousSibling(),D=D.getParent(),D!==null&&(x!==null||C.has(D.__key)||g.push(D));while(x===null)}}return a||g.reverse(),g}isDirty(){let i=hn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=mt(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=Br(),a=hn();i=i._nodeMap;let g=this.__key,C=this.getLatest(),x=C.__parent;a=a._cloneNotNeeded;var D=jt();return Hs(D)&&D.setCachedNodes(null),a.has(g)?(Et(C),C):(D=C.constructor.clone(C),D.__parent=x,D.__next=C.__next,D.__prev=C.__prev,Je(C)&&Je(D)?(D.__first=C.__first,D.__last=C.__last,D.__size=C.__size,D.__indent=C.__indent,D.__format=C.__format,D.__dir=C.__dir):Ct(C)&&Ct(D)&&(D.__format=C.__format,D.__style=C.__style,D.__mode=C.__mode,D.__detail=C.__detail),a.add(g),D.__key=g,Et(D),i.set(g,D),D)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){vl(this,!0,i)}replace(i,a){Jn();var g=jt();g!==null&&(g=g.clone()),Os(this,i);let C=this.getLatest(),x=this.__key,D=i.__key,Q=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;Nt(Q);let Ae=C.getPreviousSibling(),Ye=C.getNextSibling(),Xe=C.__prev,Ke=C.__next,Pe=C.__parent;if(vl(C,!1,!0),Ae===null?i.__first=D:Ae.getWritable().__next=D,Q.__prev=Xe,Ye===null?i.__last=D:Ye.getWritable().__prev=D,Q.__next=Ke,Q.__parent=Pe,i.__size=ge,a){if(!Je(this)||!Je(Q))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(pt=>{Q.append(pt)})}return Mt(g)&&(nn(g),a=g.anchor,g=g.focus,a.key===x&&si(a,Q),g.key===x&&si(g,Q)),xt()===x&>(D),Q}insertAfter(i,a=!0){Jn(),Os(this,i);var g=this.getWritable();let C=i.getWritable();var x=C.getParent();let D=jt();var Q=!1,ge=!1;if(x!==null){var Ae=i.getIndexWithinParent();Nt(C),Mt(D)&&(ge=x.__key,Q=D.anchor,x=D.focus,Q=Q.type==="element"&&Q.key===ge&&Q.offset===Ae+1,ge=x.type==="element"&&x.key===ge&&x.offset===Ae+1)}x=this.getNextSibling(),Ae=this.getParentOrThrow().getWritable();let Ye=C.__key,Xe=g.__next;return x===null?Ae.__last=Ye:x.getWritable().__prev=Ye,Ae.__size++,g.__next=Ye,C.__next=Xe,C.__prev=g.__key,C.__parent=g.__parent,a&&Mt(D)&&(a=this.getIndexWithinParent(),Hn(D,Ae,a+1),g=Ae.__key,Q&&D.anchor.set(g,a+2,"element"),ge&&D.focus.set(g,a+2,"element")),i}insertBefore(i,a=!0){Jn(),Os(this,i);var g=this.getWritable();let C=i.getWritable(),x=C.__key;Nt(C);let D=this.getPreviousSibling(),Q=this.getParentOrThrow().getWritable(),ge=g.__prev,Ae=this.getIndexWithinParent();return D===null?Q.__first=x:D.getWritable().__next=x,Q.__size++,g.__prev=x,C.__prev=ge,C.__next=g.__key,C.__parent=g.__parent,g=jt(),a&&Mt(g)&&(a=this.getParentOrThrow(),Hn(g,a,Ae)),i}isParentRequired(){return!1}createParentElementNode(){return Wr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,a){Jn();let g=this.getPreviousSibling(),C=this.getParentOrThrow();return g===null?C.select(0,0):Je(g)?g.select():Ct(g)?g.select(i,a):(i=g.getIndexWithinParent()+1,C.select(i,i))}selectNext(i,a){Jn();let g=this.getNextSibling(),C=this.getParentOrThrow();return g===null?C.select():Je(g)?g.select(0,0):Ct(g)?g.select(i,a):(i=g.getIndexWithinParent(),C.select(i,i))}markDirty(){this.getWritable()}}function kc(o,i,a){a=a||i.getParentOrThrow().getLastChild();let g=i;for(i=[i];g!==a;){if(!g.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");g=g.getNextSibling(),i.push(g)}for(let C of i)o=o.insertAfter(C)}class qr extends $s{static getType(){return"linebreak"}static clone(i){return new qr(i.__key)}constructor(i){super(i)}getTextContent(){return`
|
|
63
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let a=i.parentElement,g,C;return a!==null&&((g=a.firstChild)===i||g.nextSibling===i&&g.nodeType===3&&(g.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((C=a.lastChild)===i||C.previousSibling===i&&C.nodeType===3&&(C.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Da,priority:0}}}}static importJSON(){return Zr()}exportJSON(){return{type:"linebreak",version:1}}}function Da(){return{node:Zr()}}function Zr(){return Nr(new qr)}function ki(o){return o instanceof qr}function Pi(o,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function mo(o,i){return i&1?"strong":i&2?"em":"span"}function Sl(o,i,a,g,C){o=g.classList,g=Bt(C,"base"),g!==void 0&&o.add(...g),g=Bt(C,"underlineStrikethrough");let x=!1,D=i&8&&i&4;var Q=a&8&&a&4;g!==void 0&&(Q?(x=!0,D||o.add(...g)):D&&o.remove(...g));for(let ge in ne)Q=ne[ge],g=Bt(C,ge),g!==void 0&&(a&Q?!x||ge!=="underline"&&ge!=="strikethrough"?(!(i&Q)||D&&ge==="underline"||ge==="strikethrough")&&o.add(...g):i&Q&&o.remove(...g):i&Q&&o.remove(...g))}function $i(o,i,a){let g=i.firstChild;if(a=a.isComposing(),o+=a?se:"",g==null)i.textContent=o;else if(i=g.nodeValue,i!==o)if(a||U){a=i.length;let C=o.length,x=0,D=0;for(;x<a&&x<C&&i[x]===o[x];)x++;for(;D+x<a&&D+x<C&&i[a-D-1]===o[C-D-1];)D++;o=[x,a-x-D,o.slice(x,C-D)];let[Q,ge,Ae]=o;ge!==0&&g.deleteData(Q,ge),g.insertData(Q,Ae)}else g.nodeValue=o}function as(o,i){return i=document.createElement(i),i.appendChild(o),i}class Fi extends $s{static getType(){return"text"}static clone(i){return new Fi(i.__text,i.__key)}constructor(i,a){super(a),this.__text=i,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let i=this.getLatest();return ke[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===xt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(this.getLatest().__detail&1)!==0}isUnmergeable(){return(this.getLatest().__detail&2)!==0}hasFormat(i){return i=ne[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,a){let g=this.getLatest().__format;return tt(g,i,a)}createDOM(i){var a=this.__format,g=Pi(this,a);let C=mo(this,a),x=document.createElement(g===null?C:g),D=x;return this.hasFormat("code")&&x.setAttribute("spellcheck","false"),g!==null&&(D=document.createElement(C),x.appendChild(D)),g=D,$i(this.__text,g,this),i=i.theme.text,i!==void 0&&Sl(C,0,a,g,i),a=this.__style,a!==""&&(x.style.cssText=a),x}updateDOM(i,a,g){let C=this.__text;var x=i.__format,D=this.__format,Q=Pi(this,x);let ge=Pi(this,D);var Ae=mo(this,x);let Ye=mo(this,D);return(Q===null?Ae:Q)!==(ge===null?Ye:ge)?!0:Q===ge&&Ae!==Ye?(x=a.firstChild,x==null&&Y(48),i=Q=document.createElement(Ye),$i(C,i,this),g=g.theme.text,g!==void 0&&Sl(Ye,0,D,i,g),a.replaceChild(Q,x),!1):(Ae=a,ge!==null&&Q!==null&&(Ae=a.firstChild,Ae==null&&Y(49)),$i(C,Ae,this),g=g.theme.text,g!==void 0&&x!==D&&Sl(Ye,x,D,Ae,g),D=this.__style,i.__style!==D&&(a.style.cssText=D),!1)}static importDOM(){return{"#text":()=>({conversion:
|
|
61
|
+
`?(o.preventDefault(),ct(i,l,void 0)):x==null&&o.dataTransfer?(x=o.dataTransfer.getData("text/plain"),o.preventDefault(),C.insertRawText(x)):x!=null&&Ca(C,g,x,o.timeStamp,!0)?(o.preventDefault(),ct(i,d,x)):os=x,ya=o.timeStamp;else switch(o.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ct(i,d,o);break;case"insertFromComposition":gt(null),ct(i,d,o);break;case"insertLineBreak":gt(null),ct(i,r,!1);break;case"insertParagraph":gt(null),ks&&!_e?(ks=!1,ct(i,r,!1)):ct(i,l,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ct(i,f,o);break;case"deleteByComposition":Mc(Q,D)&&ct(i,p,o);break;case"deleteByDrag":case"deleteByCut":ct(i,p,o);break;case"deleteContent":ct(i,n,!1);break;case"deleteWordBackward":ct(i,_,!0);break;case"deleteWordForward":ct(i,_,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ct(i,T,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ct(i,T,!1);break;case"formatStrikeThrough":ct(i,E,"strikethrough");break;case"formatBold":ct(i,E,"bold");break;case"formatItalic":ct(i,E,"italic");break;case"formatUnderline":ct(i,E,"underline");break;case"historyUndo":ct(i,S,void 0);break;case"historyRedo":ct(i,w,void 0)}}})}function va(o,i){o.stopPropagation(),Tr(i,()=>{var a=Vt(),g=o.data,C=xa(o);if(g!=null&&Mt(a)&&Ca(a,C,g,o.timeStamp,!1)){Ps&&(xl(i,g),Ps=!1);var x=a.anchor,D=x.getNode();if(C=jr(i._window),C===null)return;let Q=x.offset;(x=X&&!a.isCollapsed()&&Ct(D)&&C.anchorNode!==null)&&(D=D.getTextContent().slice(0,Q)+g+D.getTextContent().slice(Q+a.focus.offset),C=C.anchorNode,x=D===(C.nodeType===3?C.nodeValue:null)),x||ct(i,d,g),g=g.length,U&&1<g&&o.inputType==="insertCompositionText"&&!i.isComposing()&&(a.anchor.offset-=g),fe||_e||F||!i.isComposing()||(Ls=0,gt(null))}else ot(!1,i,g!==null?g:void 0),Ps&&(xl(i,g||void 0),Ps=!1);Jn(),a=hn(),en(a)}),os=null}function Sa(o,i){Tr(i,()=>{let a=Vt();if(Mt(a)&&!i.isComposing()){let g=a.anchor,C=a.anchor.getNode();gt(g.key),(o.timeStamp<Ls+30||g.type==="element"||!a.isCollapsed()||C.getFormat()!==a.format||Ct(C)&&C.getStyle()!==a.style)&&ct(i,d,ye)}})}function xl(o,i){var a=o._compositionKey;if(gt(null),a!==null&&i!=null){if(i===""){i=mt(a),o=ze(o.getElementByKey(a)),o!==null&&o.nodeValue!==null&&Ct(i)&&St(i,o.nodeValue,null,null,!0);return}if(i[i.length-1]===`
|
|
62
|
+
`&&(a=Vt(),Mt(a))){i=a.focus,a.anchor.set(i.key,i.offset,i.type),ct(o,H,null);return}}ot(!0,o,i)}function bc(o,i){U?Ps=!0:Tr(i,()=>{xl(i,o.data)})}function Lc(o,i){if(Ls=o.timeStamp,_a=o.keyCode,!i.isComposing()){var{keyCode:a,shiftKey:g,ctrlKey:C,metaKey:x,altKey:D}=o;if(!ct(i,M,o)){if(a!==39||C||x||D)if(a!==39||D||g||!C&&!x)if(a!==37||C||x||D)if(a!==37||D||g||!C&&!x)if(a!==38||C||x)if(a!==40||C||x)if(a===13&&g)ks=!0,ct(i,H,o);else if(a===32)ct(i,j,o);else if(R&&C&&a===79)o.preventDefault(),ks=!0,ct(i,r,!0);else if(a!==13||g){var Q=R?D||x?!1:a===8||a===72&&C:C||D||x?!1:a===8;Q?a===8?ct(i,re,o):(o.preventDefault(),ct(i,n,!0)):a===27?ct(i,te,o):(Q=R?g||D||x?!1:a===46||a===68&&C:C||D||x?!1:a===46,Q?a===46?ct(i,ce,o):(o.preventDefault(),ct(i,n,!1)):a===8&&(R?D:C)?(o.preventDefault(),ct(i,_,!0)):a===46&&(R?D:C)?(o.preventDefault(),ct(i,_,!1)):R&&x&&a===8?(o.preventDefault(),ct(i,T,!0)):R&&x&&a===46?(o.preventDefault(),ct(i,T,!1)):a===66&&!D&&(R?x:C)?(o.preventDefault(),ct(i,E,"bold")):a===85&&!D&&(R?x:C)?(o.preventDefault(),ct(i,E,"underline")):a===73&&!D&&(R?x:C)?(o.preventDefault(),ct(i,E,"italic")):a!==9||D||C||x?a===90&&!g&&(R?x:C)?(o.preventDefault(),ct(i,S,void 0)):(Q=R?a===90&&x&&g:a===89&&C||a===90&&C&&g,Q?(o.preventDefault(),ct(i,w,void 0)):ar(i._editorState._selection)?(Q=g?!1:a===67?R?x:C:!1,Q?(o.preventDefault(),ct(i,Ee,o)):(Q=g?!1:a===88?R?x:C:!1,Q?(o.preventDefault(),ct(i,de,o)):a===65&&(R?x:C)&&(o.preventDefault(),ct(i,K,o)))):!U&&a===65&&(R?x:C)&&(o.preventDefault(),ct(i,K,o))):ct(i,V,o))}else ks=!1,ct(i,H,o);else ct(i,P,o);else ct(i,I,o);else ct(i,G,o);else ct(i,k,o);else ct(i,v,o);else ct(i,m,o);(C||g||D||x)&&ct(i,oe,o)}}}function wa(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let ls=new Map;function Oa(o){var i=o.target;let a=jr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(a!==null){var g=vt(a.anchorNode);if(g!==null){Tl&&(Tl=!1,Tr(g,()=>{var Q=Er(),ge=a.anchorNode;ge!==null&&(ge=ge.nodeType,ge===1||ge===3)&&(Q=Gn(Q,a,g,o),nn(Q))})),i=pe(g),i=i[i.length-1];var C=i._key,x=ls.get(C),D=x||i;D!==g&&Ta(a,D,!1),Ta(a,g,!0),g!==i?ls.set(C,g):x&&ls.delete(C)}}}function Ic(o,i){Is===0&&o.ownerDocument.addEventListener("selectionchange",Oa),Is++,o.__lexicalEditor=i;let a=wa(o);for(let g=0;g<Cl.length;g++){let[C,x]=Cl[g],D=typeof x=="function"?Q=>{Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()&&x(Q,i))}:Q=>{if(Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()))switch(C){case"cut":return ct(i,de,Q);case"copy":return ct(i,Ee,Q);case"paste":return ct(i,f,Q);case"dragstart":return ct(i,q,Q);case"dragover":return ct(i,Te,Q);case"dragend":return ct(i,Se,Q);case"focus":return ct(i,O,Q);case"blur":return ct(i,Z,Q);case"drop":return ct(i,z,Q)}};o.addEventListener(C,D),a.push(()=>{o.removeEventListener(C,D)})}}function vl(o,i,a){Jn();var g=o.__key;let C=o.getParent();if(C!==null){var x=Vt();if(Mt(x)&&Je(o)){var{anchor:D,focus:Q}=x,ge=D.getNode(),Ae=Q.getNode();Zn(ge,o)&&D.set(o.__key,0,"element"),Zn(Ae,o)&&Q.set(o.__key,0,"element")}if(ge=x,Ae=!1,Mt(ge)&&i){x=ge.anchor;let Ye=ge.focus;x.key===g&&(ds(x,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0),Ye.key===g&&(ds(Ye,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0)}else ar(ge)&&i&&o.isSelected()&&o.selectPrevious();Mt(ge)&&i&&!Ae?(g=o.getIndexWithinParent(),Nt(o),Hn(ge,C,g,-1)):Nt(o),a||or(C)||C.canBeEmpty()||!C.isEmpty()||vl(C,i),i&&nr(C)&&C.isEmpty()&&C.selectEnd()}}class $s{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,yt(this,i)}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=mt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let a=i.getNodes().some(g=>g.__key===this.__key);return Ct(this)?a:Mt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:a}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let a=0;for(;i!==null;){if(this.is(i))return a;a++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:mt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let a=i.getParent();if(or(a)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=a}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],a=this.getParent();for(;a!==null;)i.push(a),a=a.getParent();return i}getParentKeys(){let i=[],a=this.getParent();for(;a!==null;)i.push(a.__key),a=a.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:mt(i)}getPreviousSiblings(){let i=[];var a=this.getParent();if(a===null)return i;for(a=a.getFirstChild();a!==null&&!a.is(this);)i.push(a),a=a.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:mt(i)}getNextSiblings(){let i=[],a=this.getNextSibling();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getCommonAncestor(i){let a=this.getParents();var g=i.getParents();Je(this)&&a.unshift(this),Je(i)&&g.unshift(i),i=a.length;var C=g.length;if(i===0||C===0||a[i-1]!==g[C-1])return null;for(g=new Set(g),C=0;C<i;C++){let x=a[C];if(g.has(x))return x}return null}is(i){return i==null?!1:this.__key===i.__key}isBefore(i){if(this===i)return!1;if(i.isParentOf(this))return!0;if(this.isParentOf(i))return!1;var a=this.getCommonAncestor(i);let g=this;for(;;){var C=g.getParentOrThrow();if(C===a){C=g.getIndexWithinParent();break}g=C}for(g=i;;){if(i=g.getParentOrThrow(),i===a){a=g.getIndexWithinParent();break}g=i}return C<a}isParentOf(i){let a=this.__key;if(a===i.__key)return!1;for(;i!==null;){if(i.__key===a)return!0;i=i.getParent()}return!1}getNodesBetween(i){let a=this.isBefore(i),g=[],C=new Set;for(var x=this;;){var D=x.__key;if(C.has(D)||(C.add(D),g.push(x)),x===i)break;if(D=Je(x)?a?x.getFirstChild():x.getLastChild():null,D!==null)x=D;else if(D=a?x.getNextSibling():x.getPreviousSibling(),D!==null)x=D;else{if(x=x.getParentOrThrow(),C.has(x.__key)||g.push(x),x===i)break;D=x;do D===null&&Y(68),x=a?D.getNextSibling():D.getPreviousSibling(),D=D.getParent(),D!==null&&(x!==null||C.has(D.__key)||g.push(D));while(x===null)}}return a||g.reverse(),g}isDirty(){let i=hn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=mt(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=Br(),a=hn();i=i._nodeMap;let g=this.__key,C=this.getLatest(),x=C.__parent;a=a._cloneNotNeeded;var D=Vt();return Hs(D)&&D.setCachedNodes(null),a.has(g)?(Et(C),C):(D=C.constructor.clone(C),D.__parent=x,D.__next=C.__next,D.__prev=C.__prev,Je(C)&&Je(D)?(D.__first=C.__first,D.__last=C.__last,D.__size=C.__size,D.__indent=C.__indent,D.__format=C.__format,D.__dir=C.__dir):Ct(C)&&Ct(D)&&(D.__format=C.__format,D.__style=C.__style,D.__mode=C.__mode,D.__detail=C.__detail),a.add(g),D.__key=g,Et(D),i.set(g,D),D)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){vl(this,!0,i)}replace(i,a){Jn();var g=Vt();g!==null&&(g=g.clone()),Os(this,i);let C=this.getLatest(),x=this.__key,D=i.__key,Q=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;Nt(Q);let Ae=C.getPreviousSibling(),Ye=C.getNextSibling(),Xe=C.__prev,Ke=C.__next,Pe=C.__parent;if(vl(C,!1,!0),Ae===null?i.__first=D:Ae.getWritable().__next=D,Q.__prev=Xe,Ye===null?i.__last=D:Ye.getWritable().__prev=D,Q.__next=Ke,Q.__parent=Pe,i.__size=ge,a){if(!Je(this)||!Je(Q))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(pt=>{Q.append(pt)})}return Mt(g)&&(nn(g),a=g.anchor,g=g.focus,a.key===x&&si(a,Q),g.key===x&&si(g,Q)),xt()===x&>(D),Q}insertAfter(i,a=!0){Jn(),Os(this,i);var g=this.getWritable();let C=i.getWritable();var x=C.getParent();let D=Vt();var Q=!1,ge=!1;if(x!==null){var Ae=i.getIndexWithinParent();Nt(C),Mt(D)&&(ge=x.__key,Q=D.anchor,x=D.focus,Q=Q.type==="element"&&Q.key===ge&&Q.offset===Ae+1,ge=x.type==="element"&&x.key===ge&&x.offset===Ae+1)}x=this.getNextSibling(),Ae=this.getParentOrThrow().getWritable();let Ye=C.__key,Xe=g.__next;return x===null?Ae.__last=Ye:x.getWritable().__prev=Ye,Ae.__size++,g.__next=Ye,C.__next=Xe,C.__prev=g.__key,C.__parent=g.__parent,a&&Mt(D)&&(a=this.getIndexWithinParent(),Hn(D,Ae,a+1),g=Ae.__key,Q&&D.anchor.set(g,a+2,"element"),ge&&D.focus.set(g,a+2,"element")),i}insertBefore(i,a=!0){Jn(),Os(this,i);var g=this.getWritable();let C=i.getWritable(),x=C.__key;Nt(C);let D=this.getPreviousSibling(),Q=this.getParentOrThrow().getWritable(),ge=g.__prev,Ae=this.getIndexWithinParent();return D===null?Q.__first=x:D.getWritable().__next=x,Q.__size++,g.__prev=x,C.__prev=ge,C.__next=g.__key,C.__parent=g.__parent,g=Vt(),a&&Mt(g)&&(a=this.getParentOrThrow(),Hn(g,a,Ae)),i}isParentRequired(){return!1}createParentElementNode(){return Wr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,a){Jn();let g=this.getPreviousSibling(),C=this.getParentOrThrow();return g===null?C.select(0,0):Je(g)?g.select():Ct(g)?g.select(i,a):(i=g.getIndexWithinParent()+1,C.select(i,i))}selectNext(i,a){Jn();let g=this.getNextSibling(),C=this.getParentOrThrow();return g===null?C.select():Je(g)?g.select(0,0):Ct(g)?g.select(i,a):(i=g.getIndexWithinParent(),C.select(i,i))}markDirty(){this.getWritable()}}function kc(o,i,a){a=a||i.getParentOrThrow().getLastChild();let g=i;for(i=[i];g!==a;){if(!g.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");g=g.getNextSibling(),i.push(g)}for(let C of i)o=o.insertAfter(C)}class qr extends $s{static getType(){return"linebreak"}static clone(i){return new qr(i.__key)}constructor(i){super(i)}getTextContent(){return`
|
|
63
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let a=i.parentElement,g,C;return a!==null&&((g=a.firstChild)===i||g.nextSibling===i&&g.nodeType===3&&(g.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((C=a.lastChild)===i||C.previousSibling===i&&C.nodeType===3&&(C.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Da,priority:0}}}}static importJSON(){return Zr()}exportJSON(){return{type:"linebreak",version:1}}}function Da(){return{node:Zr()}}function Zr(){return Nr(new qr)}function ki(o){return o instanceof qr}function Pi(o,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function mo(o,i){return i&1?"strong":i&2?"em":"span"}function Sl(o,i,a,g,C){o=g.classList,g=Bt(C,"base"),g!==void 0&&o.add(...g),g=Bt(C,"underlineStrikethrough");let x=!1,D=i&8&&i&4;var Q=a&8&&a&4;g!==void 0&&(Q?(x=!0,D||o.add(...g)):D&&o.remove(...g));for(let ge in ne)Q=ne[ge],g=Bt(C,ge),g!==void 0&&(a&Q?!x||ge!=="underline"&&ge!=="strikethrough"?(!(i&Q)||D&&ge==="underline"||ge==="strikethrough")&&o.add(...g):i&Q&&o.remove(...g):i&Q&&o.remove(...g))}function $i(o,i,a){let g=i.firstChild;if(a=a.isComposing(),o+=a?se:"",g==null)i.textContent=o;else if(i=g.nodeValue,i!==o)if(a||U){a=i.length;let C=o.length,x=0,D=0;for(;x<a&&x<C&&i[x]===o[x];)x++;for(;D+x<a&&D+x<C&&i[a-D-1]===o[C-D-1];)D++;o=[x,a-x-D,o.slice(x,C-D)];let[Q,ge,Ae]=o;ge!==0&&g.deleteData(Q,ge),g.insertData(Q,Ae)}else g.nodeValue=o}function as(o,i){return i=document.createElement(i),i.appendChild(o),i}class Fi extends $s{static getType(){return"text"}static clone(i){return new Fi(i.__text,i.__key)}constructor(i,a){super(a),this.__text=i,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let i=this.getLatest();return ke[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===xt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(this.getLatest().__detail&1)!==0}isUnmergeable(){return(this.getLatest().__detail&2)!==0}hasFormat(i){return i=ne[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,a){let g=this.getLatest().__format;return tt(g,i,a)}createDOM(i){var a=this.__format,g=Pi(this,a);let C=mo(this,a),x=document.createElement(g===null?C:g),D=x;return this.hasFormat("code")&&x.setAttribute("spellcheck","false"),g!==null&&(D=document.createElement(C),x.appendChild(D)),g=D,$i(this.__text,g,this),i=i.theme.text,i!==void 0&&Sl(C,0,a,g,i),a=this.__style,a!==""&&(x.style.cssText=a),x}updateDOM(i,a,g){let C=this.__text;var x=i.__format,D=this.__format,Q=Pi(this,x);let ge=Pi(this,D);var Ae=mo(this,x);let Ye=mo(this,D);return(Q===null?Ae:Q)!==(ge===null?Ye:ge)?!0:Q===ge&&Ae!==Ye?(x=a.firstChild,x==null&&Y(48),i=Q=document.createElement(Ye),$i(C,i,this),g=g.theme.text,g!==void 0&&Sl(Ye,0,D,i,g),a.replaceChild(Q,x),!1):(Ae=a,ge!==null&&Q!==null&&(Ae=a.firstChild,Ae==null&&Y(49)),$i(C,Ae,this),g=g.theme.text,g!==void 0&&x!==D&&Sl(Ye,x,D,Ae,g),D=this.__style,i.__style!==D&&(a.style.cssText=D),!1)}static importDOM(){return{"#text":()=>({conversion:dt,priority:0}),b:()=>({conversion:wl,priority:0}),code:()=>({conversion:yi,priority:0}),em:()=>({conversion:yi,priority:0}),i:()=>({conversion:yi,priority:0}),s:()=>({conversion:yi,priority:0}),span:()=>({conversion:Aa,priority:0}),strong:()=>({conversion:yi,priority:0}),sub:()=>({conversion:yi,priority:0}),sup:()=>({conversion:yi,priority:0}),u:()=>({conversion:yi,priority:0})}}static importJSON(i){let a=Un(i.text);return a.setFormat(i.format),a.setDetail(i.detail),a.setMode(i.mode),a.setStyle(i.style),a}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&fo(i)||Y(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=as(i,"b")),this.hasFormat("italic")&&(i=as(i,"i")),this.hasFormat("strikethrough")&&(i=as(i,"s")),this.hasFormat("underline")&&(i=as(i,"u")),{element:i}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(i){let a=this.getWritable();return a.__format=typeof i=="string"?ne[i]:i,a}setDetail(i){let a=this.getWritable();return a.__detail=typeof i=="string"?ue[i]:i,a}setStyle(i){let a=this.getWritable();return a.__style=i,a}toggleFormat(i){let a=this.getFormat();return i=tt(a,i,null),this.setFormat(i)}toggleDirectionless(){let i=this.getWritable();return i.__detail^=1,i}toggleUnmergeable(){let i=this.getWritable();return i.__detail^=2,i}setMode(i){if(i=Re[i],this.__mode===i)return this;let a=this.getWritable();return a.__mode=i,a}setTextContent(i){if(this.__text===i)return this;let a=this.getWritable();return a.__text=i,a}select(i,a){Jn();let g=Vt();var C=this.getTextContent();let x=this.__key;if(typeof C=="string"?(C=C.length,i===void 0&&(i=C),a===void 0&&(a=C)):a=i=0,Mt(g))C=xt(),C!==g.anchor.key&&C!==g.focus.key||gt(x),g.setTextNodeRange(this,i,this,a);else return Al(x,i,x,a,"text","text");return g}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,a,g,C){let x=this.getWritable(),D=x.__text,Q=g.length,ge=i;0>ge&&(ge=Q+ge,0>ge&&(ge=0));let Ae=Vt();return C&&Mt(Ae)&&(i+=Q,Ae.setTextNodeRange(x,i,x,i)),a=D.slice(0,ge)+g+D.slice(ge+a),x.__text=a,x}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Jn();var a=this.getLatest(),g=a.getTextContent(),C=a.__key,x=xt(),D=new Set(i);i=[];for(var Q=g.length,ge="",Ae=0;Ae<Q;Ae++)ge!==""&&D.has(Ae)&&(i.push(ge),ge=""),ge+=g[Ae];if(ge!==""&&i.push(ge),D=i.length,D===0)return[];if(i[0]===g)return[a];var Ye=i[0];g=a.getParentOrThrow(),Ae=a.getFormat();let Xe=a.getStyle(),Ke=a.__detail;Q=!1,a.isSegmented()?(ge=Un(Ye),ge.__format=Ae,ge.__style=Xe,ge.__detail=Ke,Q=!0):(ge=a.getWritable(),ge.__text=Ye),a=Vt(),ge=[ge],Ye=Ye.length;for(let wt=1;wt<D;wt++){var Pe=i[wt],pt=Pe.length;Pe=Un(Pe).getWritable(),Pe.__format=Ae,Pe.__style=Xe,Pe.__detail=Ke;let Ft=Pe.__key;if(pt=Ye+pt,Mt(a)){let zt=a.anchor,Yn=a.focus;zt.key===C&&zt.type==="text"&&zt.offset>Ye&&zt.offset<=pt&&(zt.key=Ft,zt.offset-=Ye,a.dirty=!0),Yn.key===C&&Yn.type==="text"&&Yn.offset>Ye&&Yn.offset<=pt&&(Yn.key=Ft,Yn.offset-=Ye,a.dirty=!0)}x===C&>(Ft),Ye=pt,ge.push(Pe)}return C=this.getPreviousSibling(),x=this.getNextSibling(),C!==null&&Et(C),x!==null&&Et(x),C=g.getWritable(),x=this.getIndexWithinParent(),Q?(C.splice(x,0,ge),this.remove()):C.splice(x,1,ge),Mt(a)&&Hn(a,g,x,D-1),ge}mergeWithSibling(i){var a=i===this.getPreviousSibling();a||i===this.getNextSibling()||Y(50);var g=this.__key;let C=i.__key,x=this.__text,D=x.length;xt()===C&>(g);let Q=Vt();if(Mt(Q)){let ge=Q.anchor,Ae=Q.focus;ge!==null&&ge.key===C&&(Ks(ge,a,g,i,D),Q.dirty=!0),Ae!==null&&Ae.key===C&&(Ks(Ae,a,g,i,D),Q.dirty=!0)}return g=i.__text,this.setTextContent(a?g+x:x+g),a=this.getWritable(),i.remove(),a}isTextEntity(){return!1}}function Aa(o){let i=o.style.fontWeight==="700",a=o.style.textDecoration==="line-through",g=o.style.fontStyle==="italic",C=o.style.textDecoration==="underline",x=o.style.verticalAlign;return{forChild:D=>(Ct(D)&&(i&&D.toggleFormat("bold"),a&&D.toggleFormat("strikethrough"),g&&D.toggleFormat("italic"),C&&D.toggleFormat("underline"),x==="sub"&&D.toggleFormat("subscript"),x==="super"&&D.toggleFormat("superscript")),D),node:null}}function wl(o){let i=o.style.fontWeight==="normal";return{forChild:a=>(Ct(a)&&!i&&a.toggleFormat("bold"),a),node:null}}let Ol=new WeakMap;function dt(o){o.parentElement===null&&Y(129);for(var i=o.textContent||"",a,g=o.parentNode,C=[o];g!==null&&(a=Ol.get(g))===void 0&&!(g.nodeName==="PRE"||g.nodeType===1&&g.style!==void 0&&g.style.whiteSpace!==void 0&&g.style.whiteSpace.startsWith("pre"));)C.push(g),g=g.parentNode;for(a=a===void 0?g:a,g=0;g<C.length;g++)Ol.set(C[g],a);if(a!==null){for(i=i.split(/(\r?\n|\t)/),o=[],C=i.length,a=0;a<C;a++)g=i[a],g===`
|
|
64
64
|
`||g===`\r
|
|
65
65
|
`?o.push(Zr()):g===" "?o.push(Bi()):g!==""&&o.push(Un(g));return{node:o}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(C=o,a=!0;C!==null&&(C=Fs(C,!1))!==null;)if(g=C.textContent||"",0<g.length){/[ \t\n]$/.test(g)&&(i=i.slice(1)),a=!1;break}a&&(i=i.slice(1))}if(i[i.length-1]===" "){for(C=!0;o!==null&&(o=Fs(o,!0))!==null;)if(0<(o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){C=!1;break}C&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Un(i)}}let _o=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)$/,"i");function Fs(o,i){for(;;){for(var a=void 0;(a=i?o.nextSibling:o.previousSibling)===null;)if(o=o.parentElement,o===null)return null;if(o=a,o.nodeType===1&&(a=o.style.display,a===""&&o.nodeName.match(_o)===null||a!==""&&!a.startsWith("inline")))return null;for(;(a=i?o.firstChild:o.lastChild)!==null;)o=a;if(o.nodeType===3)return o;if(o.nodeName==="BR")return null}}let yo={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function yi(o){let i=yo[o.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:a=>(Ct(a)&&!a.hasFormat(i)&&a.toggleFormat(i),a),node:null}}function Un(o=""){return Nr(new Fi(o))}function Ct(o){return o instanceof Fi}class cs extends Fi{static getType(){return"tab"}static clone(i){let a=new cs(i.__key);return a.__text=i.__text,a.__format=i.__format,a.__style=i.__style,a}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let a=Bi();return a.setFormat(i.format),a.setStyle(i.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){Y(126)}setDetail(){Y(127)}setMode(){Y(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Bi(){return Nr(new cs)}function Ma(o){return o instanceof cs}class No{constructor(i,a,g){this._selection=null,this.key=i,this.offset=a,this.type=g}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let a=this.getNode(),g=i.getNode(),C=this.offset;if(i=i.offset,Je(a)){var x=a.getDescendantByIndex(C);a=x??a}return Je(g)&&(x=g.getDescendantByIndex(i),g=x??g),a===g?C<i:a.isBefore(g)}getNode(){let i=mt(this.key);return i===null&&Y(20),i}set(i,a,g){let C=this._selection,x=this.key;this.key=i,this.offset=a,this.type=g,hs()||(xt()===x&>(i),C!==null&&(C.setCachedNodes(null),C.dirty=!0))}}function Fr(o,i,a){return new No(o,i,a)}function Co(o,i){let a=i.__key,g=o.offset,C="element";if(Ct(i))C="text",i=i.getTextContentSize(),g>i&&(g=i);else if(!Je(i)){var x=i.getNextSibling();Ct(x)?(a=x.__key,g=0,C="text"):(x=i.getParent())&&(a=x.__key,g=i.getIndexWithinParent()+1)}o.set(a,g,C)}function si(o,i){if(Je(i)){let a=i.getLastDescendant();Je(a)||Ct(a)?Co(o,a):Co(o,i)}else Co(o,i)}function Dl(o,i,a,g){let C=o.getNode(),x=C.getChildAtIndex(o.offset),D=Un(),Q=nr(C)?Wr().append(D):D;D.setFormat(a),D.setStyle(g),x===null?C.append(Q):x.insertBefore(Q),o.is(i)&&i.set(D.__key,0,"text"),o.set(D.__key,0,"text")}function Dr(o,i,a,g){o.key=i,o.offset=a,o.type=g}class Bs{constructor(i,a){this.anchor=i,this.focus=a,i._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Hs(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return To(this)}}class Eo{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!ar(i))return!1;let a=this._nodes,g=i._nodes;return a.size===g.size&&Array.from(a).every(C=>g.has(C))}add(i){this.dirty=!0,this._nodes.add(i),this._cachedNodes=null}delete(i){this.dirty=!0,this._nodes.delete(i),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(i){return this._nodes.has(i)}clone(){return new Eo(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let a=this.getNodes(),g=a.length;var C=a[g-1];if(Ct(C))C=C.select();else{let x=C.getIndexWithinParent()+1;C=C.getParentOrThrow().select(x,x)}for(C.insertNodes(i),i=0;i<g;i++)a[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var a=this._nodes;i=[];for(let g of a)a=mt(g),a!==null&&i.push(a);return hs()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),a="";for(let g=0;g<i.length;g++)a+=i[g].getTextContent();return a}}function Mt(o){return o instanceof Ni}function Hs(o){return o instanceof Bs}class Ni extends Bs{constructor(i,a,g,C){super(i,a),this.format=g,this.style=C}is(i){return Mt(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus)&&this.format===i.format&&this.style===i.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var i=this._cachedNodes;if(i!==null)return i;i=this.anchor;var a=this.focus,g=i.isBefore(a),C=g?i:a;g=g?a:i,i=C.getNode(),a=g.getNode();let x=C.offset;return C=g.offset,Je(i)&&(g=i.getDescendantByIndex(x),i=g??i),Je(a)&&(g=a.getDescendantByIndex(C),g!==null&&g!==i&&a.getChildAtIndex(C)===g&&(g=g.getPreviousSibling()),a=g??a),i=i.is(a)?Je(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(a),hs()||(this._cachedNodes=i),i}setTextNodeRange(i,a,g,C){Dr(this.anchor,i.__key,a,"text"),Dr(this.focus,g.__key,C,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let a=i[0],g=i[i.length-1],C=this.anchor,x=this.focus,D=C.isBefore(x),[Q,ge]=To(this),Ae="",Ye=!0;for(let Xe=0;Xe<i.length;Xe++){let Ke=i[Xe];if(Je(Ke)&&!Ke.isInline())Ye||(Ae+=`
|
|
66
66
|
`),Ye=!Ke.isEmpty();else if(Ye=!1,Ct(Ke)){let Pe=Ke.getTextContent();Ke===a?Ke===g?(C.type!=="element"||x.type!=="element"||x.offset===C.offset)&&(Pe=Q<ge?Pe.slice(Q,ge):Pe.slice(ge,Q)):Pe=D?Pe.slice(Q):Pe.slice(ge):Ke===g&&(Pe=D?Pe.slice(0,ge):Pe.slice(0,Q)),Ae+=Pe}else!En(Ke)&&!ki(Ke)||Ke===g&&this.isCollapsed()||(Ae+=Ke.getTextContent())}return Ae}applyDOMRange(i){let a=hn(),g=a.getEditorState()._selection;if(i=La(i.startContainer,i.startOffset,i.endContainer,i.endOffset,a,g),i!==null){var[C,x]=i;Dr(this.anchor,C.key,C.offset,C.type),Dr(this.focus,x.key,x.offset,x.type),this._cachedNodes=null}}clone(){let i=this.anchor,a=this.focus;return new Ni(Fr(i.key,i.offset,i.type),Fr(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(i){this.format=tt(this.format,i,null),this.dirty=!0}setStyle(i){this.style=i,this.dirty=!0}hasFormat(i){return(this.format&ne[i])!==0}insertRawText(i){i=i.split(/(\r?\n|\t)/);let a=[],g=i.length;for(let C=0;C<g;C++){let x=i[C];x===`
|
|
67
67
|
`||x===`\r
|
|
68
|
-
`?a.push(Zr()):x===" "?a.push(Bi()):a.push(Un(x))}this.insertNodes(a)}insertText(i){var a=this.anchor,g=this.focus,C=this.isCollapsed()||a.isBefore(g),x=this.format,D=this.style;C&&a.type==="element"?Dl(a,g,x,D):C||g.type!=="element"||Dl(g,a,x,D);var Q=this.getNodes(),ge=Q.length,Ae=C?g:a;g=(C?a:g).offset;var Ye=Ae.offset;a=Q[0],Ct(a)||Y(26),C=a.getTextContent().length;var Xe=a.getParentOrThrow(),Ke=Q[ge-1];if(this.isCollapsed()&&g===C&&(a.isSegmented()||a.isToken()||!a.canInsertTextAfter()||!Xe.canInsertTextAfter()&&a.getNextSibling()===null)){var Pe=a.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ge(Pe)||(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextAfter()?a.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),a=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&g===0&&(a.isSegmented()||a.isToken()||!a.canInsertTextBefore()||!Xe.canInsertTextBefore()&&a.getPreviousSibling()===null)){if(Pe=a.getPreviousSibling(),(!Ct(Pe)||Ge(Pe))&&(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextBefore()?a.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),a=Pe,i!==""){this.insertText(i);return}}else if(a.isSegmented()&&g!==C)Xe=Un(a.getTextContent()),Xe.setFormat(x),a.replace(Xe),a=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),xo(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(a.isToken())i=Un(i),i.select(),a.replace(i);else{if(Q=a.getFormat(),ge=a.getStyle(),g===Ye&&(Q!==x||ge!==D))if(a.getTextContent()==="")a.setFormat(x),a.setStyle(D);else{Q=Un(i),Q.setFormat(x),Q.setStyle(D),Q.select(),g===0?a.insertBefore(Q,!1):([ge]=a.splitText(g),ge.insertAfter(Q,!1)),Q.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(Ma(a)){i=Un(i),i.setFormat(x),i.setStyle(D),i.select(),a.replace(i);return}a=a.spliceText(g,Ye-g,i,!0),a.getTextContent()===""?a.remove():this.anchor.type==="text"&&(a.isComposing()?this.anchor.offset-=i.length:(this.format=Q,this.style=ge))}else{if(x=new Set([...a.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(a)?a:a.getParentOrThrow(),D=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(D)&&D.isInline())do Xe=D,D=D.getParentOrThrow();while(D.isInline());if(Ae.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||Ae.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var pt=Un(Ke.getTextContent());Ke.replace(pt),Ke=pt}nr(Ae.getNode())||Ae.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),x.add(Ke.__key)}else Ae=Ke.getParentOrThrow(),Ae.canBeEmpty()||Ae.getChildrenSize()!==1?Ke.remove():Ae.remove();else x.add(Ke.__key);for(Ae=D.getChildren(),Ye=new Set(Q),Ke=Pe.is(D),Pe=Pe.isInline()&&a.getNextSibling()===null?Pe:a,pt=Ae.length-1;0<=pt;pt--){let wt=Ae[pt];if(wt.is(a)||Je(wt)&&wt.isParentOf(a))break;wt.isAttached()&&(!Ye.has(wt)||wt.is(Xe)?Ke||Pe.insertAfter(wt,!1):wt.remove())}if(!Ke)for(Ae=D,D=null;Ae!==null;)Ye=Ae.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(D))&&(x.delete(Ae.__key),D=Ae),Ae=Ae.getParent();for(a.isToken()?g===C?a.select():(i=Un(i),i.select(),a.replace(i)):(a=a.spliceText(g,C-g,i,!0),a.getTextContent()===""?a.remove():a.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)a=Q[i],x.has(a.__key)||a.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),gt(null);else{var a=this.getNodes(),g=[];for(var C of a)Ct(C)&&g.push(C);var x=g.length;if(x===0)this.toggleFormat(i),gt(null);else{C=this.anchor;var D=this.focus,Q=this.isBackward();a=Q?D:C,C=Q?C:D;var ge=0,Ae=g[0];if(D=a.type==="element"?0:a.offset,a.type==="text"&&D===Ae.getTextContentSize()&&(ge=1,Ae=g[1],D=0),Ae!=null){Q=Ae.getFormatFlags(i,null);var Ye=x-1,Xe=g[Ye];if(x=C.type==="text"?C.offset:Xe.getTextContentSize(),Ae.is(Xe))D!==x&&(D===0&&x===Ae.getTextContentSize()?Ae.setFormat(Q):(i=Ae.splitText(D,x),i=D===0?i[0]:i[1],i.setFormat(Q),a.type==="text"&&a.set(i.__key,0,"text"),C.type==="text"&&C.set(i.__key,x-D,"text")),this.format=Q);else{D!==0&&([,Ae]=Ae.splitText(D),D=0),Ae.setFormat(Q);var Ke=Xe.getFormatFlags(i,Q);for(0<x&&(x!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(x)),Xe.setFormat(Ke)),ge+=1;ge<Ye;ge++){let Pe=g[ge];if(!Pe.isToken()){let pt=Pe.getFormatFlags(i,Ke);Pe.setFormat(pt)}}a.type==="text"&&a.set(Ae.__key,D,"text"),C.type==="text"&&C.set(Xe.__key,x,"text"),this.format=Q|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var a=jt();if(!Mt(a))throw Error("Expected RangeSelection after insertParagraph");return a.insertNodes(i)}var g=Ds(this.anchor.getNode(),is);if(a=i[i.length-1],"__language"in g&&Je(g))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var C=Us(this);g.splice(C,0,i),a.selectEnd()}else if(i.some(Q=>(Je(Q)||En(Q))&&!Q.isInline())){a=Wi(i),i=a.getLastDescendant();var x=a.getChildren();a=Je(g)&&g.isEmpty()?null:this.insertParagraph(),C=x[x.length-1];var D=x[0];if((Q=>Je(Q)&&is(Q)&&!Q.isEmpty()&&Je(g)&&(!g.isEmpty()||"__value"in g&&"__checked"in g))(D)){if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");g.append(...D.getChildren()),D=x[1]}D&&kc(g,D),x=Ds(i,is),a&&Je(x)&&("__value"in a&&"__checked"in a||is(C))&&(x.append(...a.getChildren()),a.remove()),Je(g)&&g.isEmpty()&&g.remove(),i.selectEnd(),i=Je(g)?g.getLastChild():null,ki(i)&&x!==g&&i.remove()}else{if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");C=Us(this),g.splice(C,0,i),a.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Wr();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var a=Us(this);if(i=Ds(this.anchor.getNode(),is),!Je(i))throw Error("Expected ancestor to be an ElementNode");return a=(a=i.getChildAtIndex(a))?[a,...a.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...a),i.selectStart(),i):null}insertLineBreak(i){var a=Zr();this.insertNodes([a]),i&&(i=a.getParentOrThrow(),a=a.getIndexWithinParent(),i.select(a,a))}extract(){var i=this.getNodes(),a=i.length,g=a-1,C=this.anchor;let x=this.focus;var D=i[0];let Q=i[g],[ge,Ae]=To(this);return a===0?[]:a===1?Ct(D)&&!this.isCollapsed()?(i=ge>Ae?Ae:ge,g=D.splitText(i,ge>Ae?ge:Ae),i=i===0?g[0]:g[1],i!=null?[i]:[]):[D]:(a=C.isBefore(x),Ct(D)&&(C=a?ge:Ae,C===D.getTextContentSize()?i.shift():C!==0&&([,D]=D.splitText(C),i[0]=D)),Ct(Q)&&(D=Q.getTextContent().length,a=a?Ae:ge,a===0?i.pop():a!==D&&([Q]=Q.splitText(a),i[g]=Q)),i)}modify(i,a,g){var C=this.focus,x=this.anchor,D=i==="move",Q=Ht(C,a);if(En(Q)&&!Q.isIsolated())D&&Q.isKeyboardSelectable()?(a=Ml(),a.add(Q.__key),nn(a)):(i=a?Q.getPreviousSibling():Q.getNextSibling(),Ct(i)?(Q=i.__key,a=a?i.getTextContent().length:0,C.set(Q,a,"text"),D&&x.set(Q,a,"text")):(g=Q.getParentOrThrow(),Je(i)?(g=i.__key,Q=a?i.getChildrenSize():0):(Q=Q.getIndexWithinParent(),g=g.__key,a||Q++),C.set(g,Q,"element"),D&&x.set(g,Q,"element")));else if(x=hn(),C=Vr(x._window)){var ge=x._blockCursorElement,Ae=x._rootElement;if(Ae===null||ge===null||!Je(Q)||Q.isInline()||Q.canBeEmpty()||dl(ge,x,Ae),C.modify(i,a?"backward":"forward",g),0<C.rangeCount&&(Q=C.getRangeAt(0),x=this.anchor.getNode(),x=nr(x)?x:sr(x),this.applyDOMRange(Q),this.dirty=!0,!D)){for(D=this.getNodes(),i=[],g=!1,ge=0;ge<D.length;ge++)Ae=D[ge],Zn(Ae,x)?i.push(Ae):g=!0;g&&0<i.length&&(a?(a=i[0],Je(a)?a.selectStart():a.getParentOrThrow().selectStart()):(a=i[i.length-1],Je(a)?a.selectEnd():a.getParentOrThrow().selectEnd())),(C.anchorNode!==Q.startContainer||C.anchorOffset!==Q.startOffset)&&(a=this.focus,D=this.anchor,C=D.key,Q=D.offset,x=D.type,Dr(D,a.key,a.offset,a.type),Dr(a,C,Q,x),this._cachedNodes=null)}}}deleteCharacter(i){let a=this.isCollapsed();if(this.isCollapsed()){var g=this.anchor,C=this.focus,x=g.getNode();if(!i&&(g.type==="element"&&Je(x)&&g.offset===x.getChildrenSize()||g.type==="text"&&g.offset===x.getTextContentSize())){var D=x.getParent();if(D=x.getNextSibling()||(D===null?null:D.getNextSibling()),Je(D)&&D.isShadowRoot())return}if(D=Ht(C,i),En(D)&&!D.isIsolated()){D.isKeyboardSelectable()&&Je(x)&&x.getChildrenSize()===0?(x.remove(),i=Ml(),i.add(D.__key),nn(i)):(D.remove(),hn().dispatchCommand(e,void 0));return}if(!i&&Je(D)&&Je(x)&&x.isEmpty()){x.remove(),D.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&g.offset===0&&(g.type==="element"?g.getNode():g.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(D=C.type==="text"?C.getNode():null,x=g.type==="text"?g.getNode():null,D!==null&&D.isSegmented()){if(g=C.offset,C=D.getTextContentSize(),D.is(x)||i&&g!==C||!i&&g!==0){ba(D,i,g);return}}else if(x!==null&&x.isSegmented()&&(g=g.offset,C=x.getTextContentSize(),x.is(D)||i&&g!==0||!i&&g!==C)){ba(x,i,g);return}if(x=this.anchor,D=this.focus,g=x.getNode(),C=D.getNode(),g===C&&x.type==="text"&&D.type==="text"){var Q=x.offset,ge=D.offset;let Ae=Q<ge;C=Ae?Q:ge,ge=Ae?ge:Q,Q=ge-1,C!==Q&&(g=g.getTextContent().slice(C,ge),_i(g)||(i?D.offset=Q:x.offset=Q))}}}this.removeText(),i&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&nr(i.getParent())&&i.getIndexWithinParent()===0&&i.collapseAtStart(this))}deleteLine(i){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",i,"lineboundary"),(i?this.focus:this.anchor).offset===0&&this.modify("extend",i,"character")),this.removeText()}deleteWord(i){this.isCollapsed()&&this.modify("extend",i,"word"),this.removeText()}}function ar(o){return o instanceof Eo}function Ra(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function To(o){let i=o.anchor;return o=o.focus,i.type==="element"&&o.type==="element"&&i.key===o.key&&i.offset===o.offset?[0,0]:[Ra(i),Ra(o)]}function ba(o,i,a){let g=o.getTextContent().split(/(?=\s)/g),C=g.length,x=0,D=0;for(let Q=0;Q<C;Q++){let ge=g[Q],Ae=Q===C-1;if(D=x,x+=ge.length,i&&x===a||x>a||Ae){g.splice(Q,1),Ae&&(D=void 0);break}}i=g.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(D,D))}function Ws(o,i,a,g){var C=i;if(o.nodeType===1){let Q=!1;var x=o.childNodes,D=x.length;C===D&&(Q=!0,C=D-1);let ge=x[C];if(D=!1,ge===g._blockCursorElement?(ge=x[C+1],D=!0):g._blockCursorElement!==null&&C--,g=Or(ge),Ct(g))C=Q?g.getTextContentSize():0;else{if(x=Or(o),x===null)return null;if(Je(x)?(o=x.getChildAtIndex(C),(i=Je(o))&&(i=o.getParent(),i=a===null||i===null||!i.canBeEmpty()||i!==a.getNode()),i&&(a=Q?o.getLastDescendant():o.getFirstDescendant(),a===null?(x=o,C=0):(o=a,x=Je(o)?o:o.getParentOrThrow())),Ct(o)?(g=o,x=null,C=Q?o.getTextContentSize():0):o!==x&&Q&&!D&&C++):(C=x.getIndexWithinParent(),C=i===0&&En(x)&&Or(o)===x?C:C+1,x=x.getParentOrThrow()),Je(x))return Fr(x.__key,C,"element")}}else g=Or(o);return Ct(g)?Fr(g.__key,C,"text"):null}function Hi(o,i,a){var g=o.offset,C=o.getNode();g===0?(g=C.getPreviousSibling(),C=C.getParent(),i?(a||!i)&&g===null&&Je(C)&&C.isInline()&&(i=C.getPreviousSibling(),Ct(i)&&(o.key=i.__key,o.offset=i.getTextContent().length)):Je(g)&&!a&&g.isInline()?(o.key=g.__key,o.offset=g.getChildrenSize(),o.type="element"):Ct(g)&&(o.key=g.__key,o.offset=g.getTextContent().length)):g===C.getTextContent().length&&(g=C.getNextSibling(),C=C.getParent(),i&&Je(g)&&g.isInline()?(o.key=g.__key,o.offset=0,o.type="element"):(a||i)&&g===null&&Je(C)&&C.isInline()&&!C.canInsertTextAfter()&&(i=C.getNextSibling(),Ct(i)&&(o.key=i.__key,o.offset=0)))}function xo(o,i,a){if(o.type==="text"&&i.type==="text"){var g=o.isBefore(i);let C=o.is(i);Hi(o,g,C),Hi(i,!g,C),C&&(i.key=o.key,i.offset=o.offset,i.type=o.type),g=hn(),g.isComposing()&&g._compositionKey!==o.key&&Mt(a)&&(g=a.anchor,a=a.focus,Dr(o,g.key,g.offset,g.type),Dr(i,a.key,a.offset,a.type))}}function La(o,i,a,g,C,x){return o===null||a===null||!st(C,o,a)||(i=Ws(o,i,Mt(x)?x.anchor:null,C),i===null)||(g=Ws(a,g,Mt(x)?x.focus:null,C),g===null||i.type==="element"&&g.type==="element"&&(o=Or(o),a=Or(a),En(o)&&En(a)))?null:(xo(i,g,x),[i,g])}function Al(o,i,a,g,C,x){let D=Br();return o=new Ni(Fr(o,i,C),Fr(a,g,x),0,""),o.dirty=!0,D._selection=o}function Ml(){return new Eo(new Set)}function In(o){let i=o.getEditorState()._selection,a=Vr(o._window);return Mt(i)||i==null?Gn(i,a,o,null):i.clone()}function Gn(o,i,a,g){var C=a._window;if(C===null)return null;var x=(C=g||C.event)?C.type:void 0;g=x==="selectionchange",C=!Fe&&(g||x==="beforeinput"||x==="compositionstart"||x==="compositionend"||x==="click"&&C&&C.detail===3||x==="drop"||x===void 0);let D;if(!Mt(o)||C){if(i===null)return null;if(C=i.anchorNode,x=i.focusNode,D=i.anchorOffset,i=i.focusOffset,g&&Mt(o)&&!st(a,C,x))return o.clone()}else return o.clone();if(a=La(C,D,x,i,a,o),a===null)return null;let[Q,ge]=a;return new Ni(Q,ge,Mt(o)?o.format:0,Mt(o)?o.style:"")}function jt(){return Br()._selection}function Er(){return hn()._editorState._selection}function Hn(o,i,a,g=1){var C=o.anchor,x=o.focus,D=C.getNode(),Q=x.getNode();if(i.is(D)||i.is(Q)){if(D=i.__key,o.isCollapsed())i=C.offset,(a<=i&&0<g||a<i&&0>g)&&(a=Math.max(0,i+g),C.set(D,a,"element"),x.set(D,a,"element"),us(o));else{let Ae=o.isBackward();Q=Ae?x:C;var ge=Q.getNode();C=Ae?C:x,x=C.getNode(),i.is(ge)&&(ge=Q.offset,(a<=ge&&0<g||a<ge&&0>g)&&Q.set(D,Math.max(0,ge+g),"element")),i.is(x)&&(i=C.offset,(a<=i&&0<g||a<i&&0>g)&&C.set(D,Math.max(0,i+g),"element"))}us(o)}}function us(o){var i=o.anchor,a=i.offset;let g=o.focus;var C=g.offset,x=i.getNode(),D=g.getNode();if(o.isCollapsed())Je(x)&&(D=x.getChildrenSize(),D=(C=a>=D)?x.getChildAtIndex(D-1):x.getChildAtIndex(a),Ct(D)&&(a=0,C&&(a=D.getTextContentSize()),i.set(D.__key,a,"text"),g.set(D.__key,a,"text")));else{if(Je(x)){let Q=x.getChildrenSize();a=(o=a>=Q)?x.getChildAtIndex(Q-1):x.getChildAtIndex(a),Ct(a)&&(x=0,o&&(x=a.getTextContentSize()),i.set(a.__key,x,"text"))}Je(D)&&(a=D.getChildrenSize(),C=(i=C>=a)?D.getChildAtIndex(a-1):D.getChildAtIndex(C),Ct(C)&&(D=0,i&&(D=C.getTextContentSize()),g.set(C.__key,D,"text")))}}function Ia(o,i){if(i=i.getEditorState()._selection,o=o._selection,Mt(o)){var a=o.anchor;let g=o.focus,C;a.type==="text"&&(C=a.getNode(),C.selectionTransform(i,o)),g.type==="text"&&(a=g.getNode(),C!==a&&a.selectionTransform(i,o))}}function ds(o,i,a,g,C){let x=null,D=0,Q=null;g!==null?(x=g.__key,Ct(g)?(D=g.getTextContentSize(),Q="text"):Je(g)&&(D=g.getChildrenSize(),Q="element")):C!==null&&(x=C.__key,Ct(C)?Q="text":Je(C)&&(Q="element")),x!==null&&Q!==null?o.set(x,D,Q):(D=i.getIndexWithinParent(),D===-1&&(D=a.getChildrenSize()),o.set(a.__key,D,"element"))}function Ks(o,i,a,g,C){o.type==="text"?(o.key=a,i||(o.offset+=C)):o.offset>g.getIndexWithinParent()&&--o.offset}function zs(o){o instanceof Do||(o instanceof $s?(o=pa(o,Yi),Yi(o)||Y(114)):(o=pa(o.getNode(),Yi),Yi(o)||Y(114)));let i=o.getParent();Bl(i)||Y(115);let a=i.getParent();return Fl(a)||Y(116),[o,i,a]}function Us(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!is(o);)[o,i]=Rl(o,i);return i}function Rl(o,i){var a=o.getParent();if(!a)return a=Wr(),bt().append(a),a.select(),[bt(),0];if(Ct(o)){var g=o.splitText(i);return g.length===0?[a,o.getIndexWithinParent()]:(o=i===0?0:1,o=g[0].getIndexWithinParent()+o,[a,o])}return!Je(o)||i===0?[a,o.getIndexWithinParent()]:((g=o.getChildAtIndex(i))&&(i=new Ni(Fr(o.__key,i,"element"),Fr(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(g,...g.getNextSiblings())),[a,o.getIndexWithinParent()+1])}function Wi(o){let i=Wr(),a=null;for(let g=0;g<o.length;g++){let C=o[g],x=ki(C);if(x||En(C)&&C.isInline()||Je(C)&&C.isInline()||Ct(C)||C.isParentRequired()){if(a===null&&(a=C.createParentElementNode(),i.append(a),x))continue;a!==null&&a.append(C)}else i.append(C),a=null}return i}let gn=null,On=null,Wn=!1,fs=!1,Ki=0,Ci={characterData:!0,childList:!0,subtree:!0};function hs(){return Wn||gn!==null&&gn._readOnly}function Jn(){Wn&&Y(13)}function Br(){return gn===null&&Y(15),gn}function hn(){return On===null&&Y(16),On}function ka(o,i,a){var g=i.__type;let C=o._nodes.get(g);for(C===void 0&&Y(30,g),o=a.get(g),o===void 0&&(o=Array.from(C.transforms),a.set(g,o)),a=o.length,g=0;g<a&&(o[g](i),i.isAttached());g++);}function bl(o,i){i=i._dirtyLeaves,o=o._nodeMap;for(let a of i)i=o.get(a),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&ve(i)}function Pa(o,i){let a=i._dirtyLeaves,g=i._dirtyElements;o=o._nodeMap;let C=xt(),x=new Map;var D=a;let Q=D.size;for(var ge=g,Ae=ge.size;0<Q||0<Ae;){if(0<Q){i._dirtyLeaves=new Set;for(let Ye of D)D=o.get(Ye),Ct(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&ve(D),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),a.add(Ye);if(D=i._dirtyLeaves,Q=D.size,0<Q){Ki++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of ge)ge=Ye[0],Ae=Ye[1],(ge==="root"||Ae)&&(D=o.get(ge),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),g.set(ge,Ae));D=i._dirtyLeaves,Q=D.size,ge=i._dirtyElements,Ae=ge.size,Ki++}i._dirtyLeaves=a,i._dirtyElements=g}function vo(o,i){var a=o.type,g=i.get(a);if(g===void 0&&Y(17,a),a=g.klass,o.type!==a.getType()&&Y(18,a.name),a=a.importJSON(o),o=o.children,Je(a)&&Array.isArray(o))for(g=0;g<o.length;g++){let C=vo(o[g],i);a.append(C)}return a}function Ll(o,i){let a=gn,g=Wn,C=On;gn=o,Wn=!0,On=null;try{return i()}finally{gn=a,Wn=g,On=C}}function zi(o,i){let a=o._pendingEditorState,g=o._rootElement,C=o._headless||g===null;if(a!==null){var x=o._editorState,D=x._selection,Q=a._selection,ge=o._dirtyType!==0,Ae=gn,Ye=Wn,Xe=On,Ke=o._updating,Pe=o._observer,pt=null;if(o._pendingEditorState=null,o._editorState=a,!C&&ge&&Pe!==null){On=o,gn=a,Wn=!1,o._updating=!0;try{let mn=o._dirtyType,Xn=o._dirtyElements,Tn=o._dirtyLeaves;Pe.disconnect();var wt=mn,Ft=Xn,zt=Tn;zn=ri=Ln="",hl=wt===2,Ri=null,Bn=o,Pr=o._config,As=o._nodes,jr=Bn._listeners.mutation,pl=Ft,vn=zt,lr=x._nodeMap,Cn=a._nodeMap,gl=a._readOnly,ho=new Map(o._keyToDOMMap);let br=new Map;ii=br,Ii("root",null),ii=ho=Pr=Cn=lr=vn=pl=As=Bn=void 0,pt=br}catch(mn){if(mn instanceof Error&&o._onError(mn),fs)throw mn;Oo(o,null,g,a),Oe(o),o._dirtyType=2,fs=!0,zi(o,x),fs=!1;return}finally{Pe.observe(g,Ci),o._updating=Ke,gn=Ae,Wn=Ye,On=Xe}}a._readOnly||(a._readOnly=!0);var Yn=o._dirtyLeaves,Ar=o._dirtyElements,oi=o._normalizedNodes,li=o._updateTags,Hl=o._deferred;ge&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set);var Vi=o._decorators,Ao=o._pendingDecorators||Vi,ps=a._nodeMap,ai;for(ai in Ao)ps.has(ai)||(Ao===Vi&&(Ao=tn(o)),delete Ao[ai]);var Mr=C?null:Vr(o._window);if(o._editable&&Mr!==null&&(ge||Q===null||Q.dirty)){On=o,gn=a;try{if(Pe!==null&&Pe.disconnect(),ge||Q===null||Q.dirty){let mn=o._blockCursorElement;mn!==null&&dl(mn,o,g);e:{let Xn=Mr.anchorNode,Tn=Mr.focusNode,br=Mr.anchorOffset,Ti=Mr.focusOffset,Tt=document.activeElement;if(!(li.has("collaboration")&&Tt!==g||Tt!==null&&it(Tt)))if(Mt(Q)){var ji=Q.anchor,Mo=Q.focus,Fa=ji.key,Ba=Mo.key,Wl=bn(o,Fa),qs=bn(o,Ba),Jr=ji.offset,Ha=Mo.offset,Kl=Q.format,Ro=Q.style,Wa=Q.isCollapsed(),Zs=Wl,bo=qs,zl=!1;if(ji.type==="text"){Zs=ze(Wl);let ur=ji.getNode();zl=ur.getFormat()!==Kl||ur.getStyle()!==Ro}else Mt(D)&&D.anchor.type==="text"&&(zl=!0);if(Mo.type==="text"&&(bo=ze(qs)),Zs!==null&&bo!==null){if(Wa&&(D===null||zl||Mt(D)&&(D.format!==Kl||D.style!==Ro))){var Ka=performance.now();Na=[Kl,Ro,Jr,Fa,Ka]}if(br===Jr&&Ti===Ha&&Xn===Zs&&Tn===bo&&(Mr.type!=="Range"||!Wa)&&(Tt!==null&&g.contains(Tt)||g.focus({preventScroll:!0}),ji.type!=="element"))break e;try{Mr.setBaseAndExtent(Zs,Jr,bo,Ha)}catch{}if(!li.has("skip-scroll-into-view")&&Q.isCollapsed()&&g!==null&&g===document.activeElement){let ur=Q instanceof Ni&&Q.anchor.type==="element"?Zs.childNodes[Jr]||null:0<Mr.rangeCount?Mr.getRangeAt(0):null;if(ur!==null){let Lr;if(ur instanceof Text){let dr=document.createRange();dr.selectNode(ur),Lr=dr.getBoundingClientRect()}else Lr=ur.getBoundingClientRect();let rr=g.ownerDocument,Kr=rr.defaultView;if(Kr!==null)for(var{top:Ul,bottom:Xr}=Lr,Dn,_t,xr=g;xr!==null;){let dr=xr===rr.body;if(dr)Dn=0,_t=fn(o).innerHeight;else{let Po=xr.getBoundingClientRect();Dn=Po.top,_t=Po.bottom}let ci=0;if(Ul<Dn?ci=-(Dn-Ul):Xr>_t&&(ci=Xr-_t),ci!==0)if(dr)Kr.scrollBy(0,ci);else{let Po=xr.scrollTop;xr.scrollTop+=ci;let za=xr.scrollTop-Po;Ul-=za,Xr-=za}if(dr)break;xr=yr(xr)}}}El=!0}}else D!==null&&st(o,Xn,Tn)&&Mr.removeAllRanges()}}e:{let mn=o._blockCursorElement;if(Mt(Q)&&Q.isCollapsed()&&Q.anchor.type==="element"&&g.contains(document.activeElement)){let Xn=Q.anchor,Tn=Xn.getNode(),br=Xn.offset,Ti=Tn.getChildrenSize(),Tt=!1,ur=null;if(br===Ti){let Lr=Tn.getChildAtIndex(br-1);uo(Lr)&&(Tt=!0)}else{let Lr=Tn.getChildAtIndex(br);if(uo(Lr)){let rr=Lr.getPreviousSibling();(rr===null||uo(rr))&&(Tt=!0,ur=o.getElementByKey(Lr.__key))}}if(Tt){let Lr=o.getElementByKey(Tn.__key);if(mn===null){let rr=o._config.theme,Kr=document.createElement("div");Kr.contentEditable="false",Kr.setAttribute("data-lexical-cursor","true");let dr=rr.blockCursor;if(dr!==void 0){if(typeof dr=="string"){let ci=dr.split(" ");dr=rr.blockCursor=ci}dr!==void 0&&Kr.classList.add(...dr)}o._blockCursorElement=mn=Kr}g.style.caretColor="transparent",ur===null?Lr.appendChild(mn):Lr.insertBefore(mn,ur);break e}}mn!==null&&dl(mn,o,g)}Pe!==null&&Pe.observe(g,Ci)}finally{On=Xe,gn=Ae}}if(pt!==null){var Lo=pt;let mn=Array.from(o._listeners.mutation),Xn=mn.length;for(let Tn=0;Tn<Xn;Tn++){let[br,Ti]=mn[Tn],Tt=Lo.get(Ti);Tt!==void 0&&br(Tt,{dirtyLeaves:Yn,prevEditorState:x,updateTags:li})}}Mt(Q)||Q===null||D!==null&&D.is(Q)||o.dispatchCommand(e,void 0);var Io=o._pendingDecorators;Io!==null&&(o._decorators=Io,o._pendingDecorators=null,Ei("decorator",o,!0,Io));var Pc=It(i||x),Rr=It(a);if(Pc!==Rr&&Ei("textcontent",o,!0,Rr),Ei("update",o,!0,{dirtyElements:Ar,dirtyLeaves:Yn,editorState:a,normalizedNodes:oi,prevEditorState:i||x,tags:li}),o._deferred=[],Hl.length!==0){let mn=o._updating;o._updating=!0;try{for(let Xn=0;Xn<Hl.length;Xn++)Hl[Xn]()}finally{o._updating=mn}}var ko=o._updates;if(ko.length!==0){let mn=ko.shift();if(mn){let[Xn,Tn]=mn;Il(o,Xn,Tn)}}}}function Ei(o,i,a,...g){let C=i._updating;i._updating=a;try{let x=Array.from(i._listeners[o]);for(o=0;o<x.length;o++)x[o].apply(null,g)}finally{i._updating=C}}function at(o,i,a){if(o._updating===!1||On!==o){let x=!1;return o.update(()=>{x=at(o,i,a)}),x}let g=pe(o);for(let x=4;0<=x;x--)for(let D=0;D<g.length;D++){var C=g[D]._commands.get(i);if(C!==void 0&&(C=C[x],C!==void 0)){C=Array.from(C);let Q=C.length;for(let ge=0;ge<Q;ge++)if(C[ge](a,o)===!0)return!0}}return!1}function gs(o,i){let a=o._updates;for(i=i||!1;a.length!==0;){var g=a.shift();if(g){let[C,x]=g,D;x!==void 0&&(g=x.onUpdate,D=x.tag,x.skipTransforms&&(i=!0),g&&o._deferred.push(g),D&&o._updateTags.add(D)),C()}}return i}function Il(o,i,a){let g=o._updateTags;var C,x=C=!1;if(a!==void 0){var D=a.onUpdate;C=a.tag,C!=null&&g.add(C),C=a.skipTransforms||!1,x=a.discrete||!1}D&&o._deferred.push(D),a=o._editorState,D=o._pendingEditorState;let Q=!1;(D===null||D._readOnly)&&(D=o._pendingEditorState=new Gs(new Map((D||a)._nodeMap)),Q=!0),D._flushSync=x,x=gn;let ge=Wn,Ae=On,Ye=o._updating;gn=D,Wn=!1,o._updating=!0,On=o;try{Q&&(o._headless?a._selection!=null&&(D._selection=a._selection.clone()):D._selection=In(o));let Xe=o._compositionKey;i(),C=gs(o,C),Ia(D,o),o._dirtyType!==0&&(C?bl(D,o):Pa(D,o),gs(o),fl(a,D,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(D._flushSync=!0);let Ke=D._selection;if(Mt(Ke)){let Pe=D._nodeMap,pt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(pt)!==void 0||Y(19)}else ar(Ke)&&Ke._nodes.size===0&&(D._selection=null)}catch(Xe){Xe instanceof Error&&o._onError(Xe),o._pendingEditorState=a,o._dirtyType=2,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),zi(o);return}finally{gn=x,Wn=ge,On=Ae,o._updating=Ye,Ki=0}o._dirtyType!==0||kl(D,o)?D._flushSync?(D._flushSync=!1,zi(o)):Q&&rt(()=>{zi(o)}):(D._flushSync=!1,Q&&(g.clear(),o._deferred=[],o._pendingEditorState=null))}function Tr(o,i,a){o._updating?o._updates.push([i,a]):Il(o,i,a)}class So extends $s{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function En(o){return o instanceof So}class Ui extends $s{constructor(i){super(i),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let i=this.getFormat();return Ne[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getChildrenKeys(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a.__key),a=a.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=hn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(i)}getAllTextNodes(){let i=[],a=this.getFirstChild();for(;a!==null;){if(Ct(a)&&i.push(a),Je(a)){let g=a.getAllTextNodes();i.push(...g)}a=a.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let a=i.getFirstChild();if(a!==null){i=a;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let a=i.getLastChild();if(a!==null){i=a;continue}}break}return i}getDescendantByIndex(i){let a=this.getChildren(),g=a.length;return i>=g?(i=a[g-1],Je(i)&&i.getLastDescendant()||i||null):(i=a[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:mt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:mt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var a=this.getChildrenSize();let g;if(i<a/2){for(g=this.getFirstChild(),a=0;g!==null&&a<=i;){if(a===i)return g;g=g.getNextSibling(),a++}return null}for(g=this.getLastChild(),--a;g!==null&&a>=i;){if(a===i)return g;g=g.getPreviousSibling(),a--}return null}getTextContent(){let i="",a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContent(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=`
|
|
68
|
+
`?a.push(Zr()):x===" "?a.push(Bi()):a.push(Un(x))}this.insertNodes(a)}insertText(i){var a=this.anchor,g=this.focus,C=this.isCollapsed()||a.isBefore(g),x=this.format,D=this.style;C&&a.type==="element"?Dl(a,g,x,D):C||g.type!=="element"||Dl(g,a,x,D);var Q=this.getNodes(),ge=Q.length,Ae=C?g:a;g=(C?a:g).offset;var Ye=Ae.offset;a=Q[0],Ct(a)||Y(26),C=a.getTextContent().length;var Xe=a.getParentOrThrow(),Ke=Q[ge-1];if(this.isCollapsed()&&g===C&&(a.isSegmented()||a.isToken()||!a.canInsertTextAfter()||!Xe.canInsertTextAfter()&&a.getNextSibling()===null)){var Pe=a.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ge(Pe)||(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextAfter()?a.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),a=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&g===0&&(a.isSegmented()||a.isToken()||!a.canInsertTextBefore()||!Xe.canInsertTextBefore()&&a.getPreviousSibling()===null)){if(Pe=a.getPreviousSibling(),(!Ct(Pe)||Ge(Pe))&&(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextBefore()?a.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),a=Pe,i!==""){this.insertText(i);return}}else if(a.isSegmented()&&g!==C)Xe=Un(a.getTextContent()),Xe.setFormat(x),a.replace(Xe),a=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),xo(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(a.isToken())i=Un(i),i.select(),a.replace(i);else{if(Q=a.getFormat(),ge=a.getStyle(),g===Ye&&(Q!==x||ge!==D))if(a.getTextContent()==="")a.setFormat(x),a.setStyle(D);else{Q=Un(i),Q.setFormat(x),Q.setStyle(D),Q.select(),g===0?a.insertBefore(Q,!1):([ge]=a.splitText(g),ge.insertAfter(Q,!1)),Q.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(Ma(a)){i=Un(i),i.setFormat(x),i.setStyle(D),i.select(),a.replace(i);return}a=a.spliceText(g,Ye-g,i,!0),a.getTextContent()===""?a.remove():this.anchor.type==="text"&&(a.isComposing()?this.anchor.offset-=i.length:(this.format=Q,this.style=ge))}else{if(x=new Set([...a.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(a)?a:a.getParentOrThrow(),D=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(D)&&D.isInline())do Xe=D,D=D.getParentOrThrow();while(D.isInline());if(Ae.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||Ae.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var pt=Un(Ke.getTextContent());Ke.replace(pt),Ke=pt}nr(Ae.getNode())||Ae.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),x.add(Ke.__key)}else Ae=Ke.getParentOrThrow(),Ae.canBeEmpty()||Ae.getChildrenSize()!==1?Ke.remove():Ae.remove();else x.add(Ke.__key);for(Ae=D.getChildren(),Ye=new Set(Q),Ke=Pe.is(D),Pe=Pe.isInline()&&a.getNextSibling()===null?Pe:a,pt=Ae.length-1;0<=pt;pt--){let wt=Ae[pt];if(wt.is(a)||Je(wt)&&wt.isParentOf(a))break;wt.isAttached()&&(!Ye.has(wt)||wt.is(Xe)?Ke||Pe.insertAfter(wt,!1):wt.remove())}if(!Ke)for(Ae=D,D=null;Ae!==null;)Ye=Ae.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(D))&&(x.delete(Ae.__key),D=Ae),Ae=Ae.getParent();for(a.isToken()?g===C?a.select():(i=Un(i),i.select(),a.replace(i)):(a=a.spliceText(g,C-g,i,!0),a.getTextContent()===""?a.remove():a.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)a=Q[i],x.has(a.__key)||a.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),gt(null);else{var a=this.getNodes(),g=[];for(var C of a)Ct(C)&&g.push(C);var x=g.length;if(x===0)this.toggleFormat(i),gt(null);else{C=this.anchor;var D=this.focus,Q=this.isBackward();a=Q?D:C,C=Q?C:D;var ge=0,Ae=g[0];if(D=a.type==="element"?0:a.offset,a.type==="text"&&D===Ae.getTextContentSize()&&(ge=1,Ae=g[1],D=0),Ae!=null){Q=Ae.getFormatFlags(i,null);var Ye=x-1,Xe=g[Ye];if(x=C.type==="text"?C.offset:Xe.getTextContentSize(),Ae.is(Xe))D!==x&&(D===0&&x===Ae.getTextContentSize()?Ae.setFormat(Q):(i=Ae.splitText(D,x),i=D===0?i[0]:i[1],i.setFormat(Q),a.type==="text"&&a.set(i.__key,0,"text"),C.type==="text"&&C.set(i.__key,x-D,"text")),this.format=Q);else{D!==0&&([,Ae]=Ae.splitText(D),D=0),Ae.setFormat(Q);var Ke=Xe.getFormatFlags(i,Q);for(0<x&&(x!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(x)),Xe.setFormat(Ke)),ge+=1;ge<Ye;ge++){let Pe=g[ge];if(!Pe.isToken()){let pt=Pe.getFormatFlags(i,Ke);Pe.setFormat(pt)}}a.type==="text"&&a.set(Ae.__key,D,"text"),C.type==="text"&&C.set(Xe.__key,x,"text"),this.format=Q|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var a=Vt();if(!Mt(a))throw Error("Expected RangeSelection after insertParagraph");return a.insertNodes(i)}var g=Ds(this.anchor.getNode(),is);if(a=i[i.length-1],"__language"in g&&Je(g))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var C=Us(this);g.splice(C,0,i),a.selectEnd()}else if(i.some(Q=>(Je(Q)||En(Q))&&!Q.isInline())){a=Wi(i),i=a.getLastDescendant();var x=a.getChildren();a=Je(g)&&g.isEmpty()?null:this.insertParagraph(),C=x[x.length-1];var D=x[0];if((Q=>Je(Q)&&is(Q)&&!Q.isEmpty()&&Je(g)&&(!g.isEmpty()||"__value"in g&&"__checked"in g))(D)){if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");g.append(...D.getChildren()),D=x[1]}D&&kc(g,D),x=Ds(i,is),a&&Je(x)&&("__value"in a&&"__checked"in a||is(C))&&(x.append(...a.getChildren()),a.remove()),Je(g)&&g.isEmpty()&&g.remove(),i.selectEnd(),i=Je(g)?g.getLastChild():null,ki(i)&&x!==g&&i.remove()}else{if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");C=Us(this),g.splice(C,0,i),a.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Wr();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var a=Us(this);if(i=Ds(this.anchor.getNode(),is),!Je(i))throw Error("Expected ancestor to be an ElementNode");return a=(a=i.getChildAtIndex(a))?[a,...a.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...a),i.selectStart(),i):null}insertLineBreak(i){var a=Zr();this.insertNodes([a]),i&&(i=a.getParentOrThrow(),a=a.getIndexWithinParent(),i.select(a,a))}extract(){var i=this.getNodes(),a=i.length,g=a-1,C=this.anchor;let x=this.focus;var D=i[0];let Q=i[g],[ge,Ae]=To(this);return a===0?[]:a===1?Ct(D)&&!this.isCollapsed()?(i=ge>Ae?Ae:ge,g=D.splitText(i,ge>Ae?ge:Ae),i=i===0?g[0]:g[1],i!=null?[i]:[]):[D]:(a=C.isBefore(x),Ct(D)&&(C=a?ge:Ae,C===D.getTextContentSize()?i.shift():C!==0&&([,D]=D.splitText(C),i[0]=D)),Ct(Q)&&(D=Q.getTextContent().length,a=a?Ae:ge,a===0?i.pop():a!==D&&([Q]=Q.splitText(a),i[g]=Q)),i)}modify(i,a,g){var C=this.focus,x=this.anchor,D=i==="move",Q=Ht(C,a);if(En(Q)&&!Q.isIsolated())D&&Q.isKeyboardSelectable()?(a=Ml(),a.add(Q.__key),nn(a)):(i=a?Q.getPreviousSibling():Q.getNextSibling(),Ct(i)?(Q=i.__key,a=a?i.getTextContent().length:0,C.set(Q,a,"text"),D&&x.set(Q,a,"text")):(g=Q.getParentOrThrow(),Je(i)?(g=i.__key,Q=a?i.getChildrenSize():0):(Q=Q.getIndexWithinParent(),g=g.__key,a||Q++),C.set(g,Q,"element"),D&&x.set(g,Q,"element")));else if(x=hn(),C=jr(x._window)){var ge=x._blockCursorElement,Ae=x._rootElement;if(Ae===null||ge===null||!Je(Q)||Q.isInline()||Q.canBeEmpty()||dl(ge,x,Ae),C.modify(i,a?"backward":"forward",g),0<C.rangeCount&&(Q=C.getRangeAt(0),x=this.anchor.getNode(),x=nr(x)?x:sr(x),this.applyDOMRange(Q),this.dirty=!0,!D)){for(D=this.getNodes(),i=[],g=!1,ge=0;ge<D.length;ge++)Ae=D[ge],Zn(Ae,x)?i.push(Ae):g=!0;g&&0<i.length&&(a?(a=i[0],Je(a)?a.selectStart():a.getParentOrThrow().selectStart()):(a=i[i.length-1],Je(a)?a.selectEnd():a.getParentOrThrow().selectEnd())),(C.anchorNode!==Q.startContainer||C.anchorOffset!==Q.startOffset)&&(a=this.focus,D=this.anchor,C=D.key,Q=D.offset,x=D.type,Dr(D,a.key,a.offset,a.type),Dr(a,C,Q,x),this._cachedNodes=null)}}}deleteCharacter(i){let a=this.isCollapsed();if(this.isCollapsed()){var g=this.anchor,C=this.focus,x=g.getNode();if(!i&&(g.type==="element"&&Je(x)&&g.offset===x.getChildrenSize()||g.type==="text"&&g.offset===x.getTextContentSize())){var D=x.getParent();if(D=x.getNextSibling()||(D===null?null:D.getNextSibling()),Je(D)&&D.isShadowRoot())return}if(D=Ht(C,i),En(D)&&!D.isIsolated()){D.isKeyboardSelectable()&&Je(x)&&x.getChildrenSize()===0?(x.remove(),i=Ml(),i.add(D.__key),nn(i)):(D.remove(),hn().dispatchCommand(e,void 0));return}if(!i&&Je(D)&&Je(x)&&x.isEmpty()){x.remove(),D.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&g.offset===0&&(g.type==="element"?g.getNode():g.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(D=C.type==="text"?C.getNode():null,x=g.type==="text"?g.getNode():null,D!==null&&D.isSegmented()){if(g=C.offset,C=D.getTextContentSize(),D.is(x)||i&&g!==C||!i&&g!==0){ba(D,i,g);return}}else if(x!==null&&x.isSegmented()&&(g=g.offset,C=x.getTextContentSize(),x.is(D)||i&&g!==0||!i&&g!==C)){ba(x,i,g);return}if(x=this.anchor,D=this.focus,g=x.getNode(),C=D.getNode(),g===C&&x.type==="text"&&D.type==="text"){var Q=x.offset,ge=D.offset;let Ae=Q<ge;C=Ae?Q:ge,ge=Ae?ge:Q,Q=ge-1,C!==Q&&(g=g.getTextContent().slice(C,ge),_i(g)||(i?D.offset=Q:x.offset=Q))}}}this.removeText(),i&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&nr(i.getParent())&&i.getIndexWithinParent()===0&&i.collapseAtStart(this))}deleteLine(i){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",i,"lineboundary"),(i?this.focus:this.anchor).offset===0&&this.modify("extend",i,"character")),this.removeText()}deleteWord(i){this.isCollapsed()&&this.modify("extend",i,"word"),this.removeText()}}function ar(o){return o instanceof Eo}function Ra(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function To(o){let i=o.anchor;return o=o.focus,i.type==="element"&&o.type==="element"&&i.key===o.key&&i.offset===o.offset?[0,0]:[Ra(i),Ra(o)]}function ba(o,i,a){let g=o.getTextContent().split(/(?=\s)/g),C=g.length,x=0,D=0;for(let Q=0;Q<C;Q++){let ge=g[Q],Ae=Q===C-1;if(D=x,x+=ge.length,i&&x===a||x>a||Ae){g.splice(Q,1),Ae&&(D=void 0);break}}i=g.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(D,D))}function Ws(o,i,a,g){var C=i;if(o.nodeType===1){let Q=!1;var x=o.childNodes,D=x.length;C===D&&(Q=!0,C=D-1);let ge=x[C];if(D=!1,ge===g._blockCursorElement?(ge=x[C+1],D=!0):g._blockCursorElement!==null&&C--,g=Or(ge),Ct(g))C=Q?g.getTextContentSize():0;else{if(x=Or(o),x===null)return null;if(Je(x)?(o=x.getChildAtIndex(C),(i=Je(o))&&(i=o.getParent(),i=a===null||i===null||!i.canBeEmpty()||i!==a.getNode()),i&&(a=Q?o.getLastDescendant():o.getFirstDescendant(),a===null?(x=o,C=0):(o=a,x=Je(o)?o:o.getParentOrThrow())),Ct(o)?(g=o,x=null,C=Q?o.getTextContentSize():0):o!==x&&Q&&!D&&C++):(C=x.getIndexWithinParent(),C=i===0&&En(x)&&Or(o)===x?C:C+1,x=x.getParentOrThrow()),Je(x))return Fr(x.__key,C,"element")}}else g=Or(o);return Ct(g)?Fr(g.__key,C,"text"):null}function Hi(o,i,a){var g=o.offset,C=o.getNode();g===0?(g=C.getPreviousSibling(),C=C.getParent(),i?(a||!i)&&g===null&&Je(C)&&C.isInline()&&(i=C.getPreviousSibling(),Ct(i)&&(o.key=i.__key,o.offset=i.getTextContent().length)):Je(g)&&!a&&g.isInline()?(o.key=g.__key,o.offset=g.getChildrenSize(),o.type="element"):Ct(g)&&(o.key=g.__key,o.offset=g.getTextContent().length)):g===C.getTextContent().length&&(g=C.getNextSibling(),C=C.getParent(),i&&Je(g)&&g.isInline()?(o.key=g.__key,o.offset=0,o.type="element"):(a||i)&&g===null&&Je(C)&&C.isInline()&&!C.canInsertTextAfter()&&(i=C.getNextSibling(),Ct(i)&&(o.key=i.__key,o.offset=0)))}function xo(o,i,a){if(o.type==="text"&&i.type==="text"){var g=o.isBefore(i);let C=o.is(i);Hi(o,g,C),Hi(i,!g,C),C&&(i.key=o.key,i.offset=o.offset,i.type=o.type),g=hn(),g.isComposing()&&g._compositionKey!==o.key&&Mt(a)&&(g=a.anchor,a=a.focus,Dr(o,g.key,g.offset,g.type),Dr(i,a.key,a.offset,a.type))}}function La(o,i,a,g,C,x){return o===null||a===null||!st(C,o,a)||(i=Ws(o,i,Mt(x)?x.anchor:null,C),i===null)||(g=Ws(a,g,Mt(x)?x.focus:null,C),g===null||i.type==="element"&&g.type==="element"&&(o=Or(o),a=Or(a),En(o)&&En(a)))?null:(xo(i,g,x),[i,g])}function Al(o,i,a,g,C,x){let D=Br();return o=new Ni(Fr(o,i,C),Fr(a,g,x),0,""),o.dirty=!0,D._selection=o}function Ml(){return new Eo(new Set)}function In(o){let i=o.getEditorState()._selection,a=jr(o._window);return Mt(i)||i==null?Gn(i,a,o,null):i.clone()}function Gn(o,i,a,g){var C=a._window;if(C===null)return null;var x=(C=g||C.event)?C.type:void 0;g=x==="selectionchange",C=!Fe&&(g||x==="beforeinput"||x==="compositionstart"||x==="compositionend"||x==="click"&&C&&C.detail===3||x==="drop"||x===void 0);let D;if(!Mt(o)||C){if(i===null)return null;if(C=i.anchorNode,x=i.focusNode,D=i.anchorOffset,i=i.focusOffset,g&&Mt(o)&&!st(a,C,x))return o.clone()}else return o.clone();if(a=La(C,D,x,i,a,o),a===null)return null;let[Q,ge]=a;return new Ni(Q,ge,Mt(o)?o.format:0,Mt(o)?o.style:"")}function Vt(){return Br()._selection}function Er(){return hn()._editorState._selection}function Hn(o,i,a,g=1){var C=o.anchor,x=o.focus,D=C.getNode(),Q=x.getNode();if(i.is(D)||i.is(Q)){if(D=i.__key,o.isCollapsed())i=C.offset,(a<=i&&0<g||a<i&&0>g)&&(a=Math.max(0,i+g),C.set(D,a,"element"),x.set(D,a,"element"),us(o));else{let Ae=o.isBackward();Q=Ae?x:C;var ge=Q.getNode();C=Ae?C:x,x=C.getNode(),i.is(ge)&&(ge=Q.offset,(a<=ge&&0<g||a<ge&&0>g)&&Q.set(D,Math.max(0,ge+g),"element")),i.is(x)&&(i=C.offset,(a<=i&&0<g||a<i&&0>g)&&C.set(D,Math.max(0,i+g),"element"))}us(o)}}function us(o){var i=o.anchor,a=i.offset;let g=o.focus;var C=g.offset,x=i.getNode(),D=g.getNode();if(o.isCollapsed())Je(x)&&(D=x.getChildrenSize(),D=(C=a>=D)?x.getChildAtIndex(D-1):x.getChildAtIndex(a),Ct(D)&&(a=0,C&&(a=D.getTextContentSize()),i.set(D.__key,a,"text"),g.set(D.__key,a,"text")));else{if(Je(x)){let Q=x.getChildrenSize();a=(o=a>=Q)?x.getChildAtIndex(Q-1):x.getChildAtIndex(a),Ct(a)&&(x=0,o&&(x=a.getTextContentSize()),i.set(a.__key,x,"text"))}Je(D)&&(a=D.getChildrenSize(),C=(i=C>=a)?D.getChildAtIndex(a-1):D.getChildAtIndex(C),Ct(C)&&(D=0,i&&(D=C.getTextContentSize()),g.set(C.__key,D,"text")))}}function Ia(o,i){if(i=i.getEditorState()._selection,o=o._selection,Mt(o)){var a=o.anchor;let g=o.focus,C;a.type==="text"&&(C=a.getNode(),C.selectionTransform(i,o)),g.type==="text"&&(a=g.getNode(),C!==a&&a.selectionTransform(i,o))}}function ds(o,i,a,g,C){let x=null,D=0,Q=null;g!==null?(x=g.__key,Ct(g)?(D=g.getTextContentSize(),Q="text"):Je(g)&&(D=g.getChildrenSize(),Q="element")):C!==null&&(x=C.__key,Ct(C)?Q="text":Je(C)&&(Q="element")),x!==null&&Q!==null?o.set(x,D,Q):(D=i.getIndexWithinParent(),D===-1&&(D=a.getChildrenSize()),o.set(a.__key,D,"element"))}function Ks(o,i,a,g,C){o.type==="text"?(o.key=a,i||(o.offset+=C)):o.offset>g.getIndexWithinParent()&&--o.offset}function zs(o){o instanceof Do||(o instanceof $s?(o=pa(o,Yi),Yi(o)||Y(114)):(o=pa(o.getNode(),Yi),Yi(o)||Y(114)));let i=o.getParent();Bl(i)||Y(115);let a=i.getParent();return Fl(a)||Y(116),[o,i,a]}function Us(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!is(o);)[o,i]=Rl(o,i);return i}function Rl(o,i){var a=o.getParent();if(!a)return a=Wr(),bt().append(a),a.select(),[bt(),0];if(Ct(o)){var g=o.splitText(i);return g.length===0?[a,o.getIndexWithinParent()]:(o=i===0?0:1,o=g[0].getIndexWithinParent()+o,[a,o])}return!Je(o)||i===0?[a,o.getIndexWithinParent()]:((g=o.getChildAtIndex(i))&&(i=new Ni(Fr(o.__key,i,"element"),Fr(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(g,...g.getNextSiblings())),[a,o.getIndexWithinParent()+1])}function Wi(o){let i=Wr(),a=null;for(let g=0;g<o.length;g++){let C=o[g],x=ki(C);if(x||En(C)&&C.isInline()||Je(C)&&C.isInline()||Ct(C)||C.isParentRequired()){if(a===null&&(a=C.createParentElementNode(),i.append(a),x))continue;a!==null&&a.append(C)}else i.append(C),a=null}return i}let gn=null,On=null,Wn=!1,fs=!1,Ki=0,Ci={characterData:!0,childList:!0,subtree:!0};function hs(){return Wn||gn!==null&&gn._readOnly}function Jn(){Wn&&Y(13)}function Br(){return gn===null&&Y(15),gn}function hn(){return On===null&&Y(16),On}function ka(o,i,a){var g=i.__type;let C=o._nodes.get(g);for(C===void 0&&Y(30,g),o=a.get(g),o===void 0&&(o=Array.from(C.transforms),a.set(g,o)),a=o.length,g=0;g<a&&(o[g](i),i.isAttached());g++);}function bl(o,i){i=i._dirtyLeaves,o=o._nodeMap;for(let a of i)i=o.get(a),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&ve(i)}function Pa(o,i){let a=i._dirtyLeaves,g=i._dirtyElements;o=o._nodeMap;let C=xt(),x=new Map;var D=a;let Q=D.size;for(var ge=g,Ae=ge.size;0<Q||0<Ae;){if(0<Q){i._dirtyLeaves=new Set;for(let Ye of D)D=o.get(Ye),Ct(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&ve(D),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),a.add(Ye);if(D=i._dirtyLeaves,Q=D.size,0<Q){Ki++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of ge)ge=Ye[0],Ae=Ye[1],(ge==="root"||Ae)&&(D=o.get(ge),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),g.set(ge,Ae));D=i._dirtyLeaves,Q=D.size,ge=i._dirtyElements,Ae=ge.size,Ki++}i._dirtyLeaves=a,i._dirtyElements=g}function vo(o,i){var a=o.type,g=i.get(a);if(g===void 0&&Y(17,a),a=g.klass,o.type!==a.getType()&&Y(18,a.name),a=a.importJSON(o),o=o.children,Je(a)&&Array.isArray(o))for(g=0;g<o.length;g++){let C=vo(o[g],i);a.append(C)}return a}function Ll(o,i){let a=gn,g=Wn,C=On;gn=o,Wn=!0,On=null;try{return i()}finally{gn=a,Wn=g,On=C}}function zi(o,i){let a=o._pendingEditorState,g=o._rootElement,C=o._headless||g===null;if(a!==null){var x=o._editorState,D=x._selection,Q=a._selection,ge=o._dirtyType!==0,Ae=gn,Ye=Wn,Xe=On,Ke=o._updating,Pe=o._observer,pt=null;if(o._pendingEditorState=null,o._editorState=a,!C&&ge&&Pe!==null){On=o,gn=a,Wn=!1,o._updating=!0;try{let mn=o._dirtyType,Xn=o._dirtyElements,Tn=o._dirtyLeaves;Pe.disconnect();var wt=mn,Ft=Xn,zt=Tn;zn=ri=Ln="",hl=wt===2,Ri=null,Bn=o,Pr=o._config,As=o._nodes,Vr=Bn._listeners.mutation,pl=Ft,vn=zt,lr=x._nodeMap,Cn=a._nodeMap,gl=a._readOnly,ho=new Map(o._keyToDOMMap);let br=new Map;ii=br,Ii("root",null),ii=ho=Pr=Cn=lr=vn=pl=As=Bn=void 0,pt=br}catch(mn){if(mn instanceof Error&&o._onError(mn),fs)throw mn;Oo(o,null,g,a),Oe(o),o._dirtyType=2,fs=!0,zi(o,x),fs=!1;return}finally{Pe.observe(g,Ci),o._updating=Ke,gn=Ae,Wn=Ye,On=Xe}}a._readOnly||(a._readOnly=!0);var Yn=o._dirtyLeaves,Ar=o._dirtyElements,oi=o._normalizedNodes,li=o._updateTags,Hl=o._deferred;ge&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set);var ji=o._decorators,Ao=o._pendingDecorators||ji,ps=a._nodeMap,ai;for(ai in Ao)ps.has(ai)||(Ao===ji&&(Ao=tn(o)),delete Ao[ai]);var Mr=C?null:jr(o._window);if(o._editable&&Mr!==null&&(ge||Q===null||Q.dirty)){On=o,gn=a;try{if(Pe!==null&&Pe.disconnect(),ge||Q===null||Q.dirty){let mn=o._blockCursorElement;mn!==null&&dl(mn,o,g);e:{let Xn=Mr.anchorNode,Tn=Mr.focusNode,br=Mr.anchorOffset,Ti=Mr.focusOffset,Tt=document.activeElement;if(!(li.has("collaboration")&&Tt!==g||Tt!==null&&it(Tt)))if(Mt(Q)){var Vi=Q.anchor,Mo=Q.focus,Fa=Vi.key,Ba=Mo.key,Wl=bn(o,Fa),qs=bn(o,Ba),Jr=Vi.offset,Ha=Mo.offset,Kl=Q.format,Ro=Q.style,Wa=Q.isCollapsed(),Zs=Wl,bo=qs,zl=!1;if(Vi.type==="text"){Zs=ze(Wl);let ur=Vi.getNode();zl=ur.getFormat()!==Kl||ur.getStyle()!==Ro}else Mt(D)&&D.anchor.type==="text"&&(zl=!0);if(Mo.type==="text"&&(bo=ze(qs)),Zs!==null&&bo!==null){if(Wa&&(D===null||zl||Mt(D)&&(D.format!==Kl||D.style!==Ro))){var Ka=performance.now();Na=[Kl,Ro,Jr,Fa,Ka]}if(br===Jr&&Ti===Ha&&Xn===Zs&&Tn===bo&&(Mr.type!=="Range"||!Wa)&&(Tt!==null&&g.contains(Tt)||g.focus({preventScroll:!0}),Vi.type!=="element"))break e;try{Mr.setBaseAndExtent(Zs,Jr,bo,Ha)}catch{}if(!li.has("skip-scroll-into-view")&&Q.isCollapsed()&&g!==null&&g===document.activeElement){let ur=Q instanceof Ni&&Q.anchor.type==="element"?Zs.childNodes[Jr]||null:0<Mr.rangeCount?Mr.getRangeAt(0):null;if(ur!==null){let Lr;if(ur instanceof Text){let dr=document.createRange();dr.selectNode(ur),Lr=dr.getBoundingClientRect()}else Lr=ur.getBoundingClientRect();let rr=g.ownerDocument,Kr=rr.defaultView;if(Kr!==null)for(var{top:Ul,bottom:Xr}=Lr,Dn,_t,xr=g;xr!==null;){let dr=xr===rr.body;if(dr)Dn=0,_t=fn(o).innerHeight;else{let Po=xr.getBoundingClientRect();Dn=Po.top,_t=Po.bottom}let ci=0;if(Ul<Dn?ci=-(Dn-Ul):Xr>_t&&(ci=Xr-_t),ci!==0)if(dr)Kr.scrollBy(0,ci);else{let Po=xr.scrollTop;xr.scrollTop+=ci;let za=xr.scrollTop-Po;Ul-=za,Xr-=za}if(dr)break;xr=yr(xr)}}}El=!0}}else D!==null&&st(o,Xn,Tn)&&Mr.removeAllRanges()}}e:{let mn=o._blockCursorElement;if(Mt(Q)&&Q.isCollapsed()&&Q.anchor.type==="element"&&g.contains(document.activeElement)){let Xn=Q.anchor,Tn=Xn.getNode(),br=Xn.offset,Ti=Tn.getChildrenSize(),Tt=!1,ur=null;if(br===Ti){let Lr=Tn.getChildAtIndex(br-1);uo(Lr)&&(Tt=!0)}else{let Lr=Tn.getChildAtIndex(br);if(uo(Lr)){let rr=Lr.getPreviousSibling();(rr===null||uo(rr))&&(Tt=!0,ur=o.getElementByKey(Lr.__key))}}if(Tt){let Lr=o.getElementByKey(Tn.__key);if(mn===null){let rr=o._config.theme,Kr=document.createElement("div");Kr.contentEditable="false",Kr.setAttribute("data-lexical-cursor","true");let dr=rr.blockCursor;if(dr!==void 0){if(typeof dr=="string"){let ci=dr.split(" ");dr=rr.blockCursor=ci}dr!==void 0&&Kr.classList.add(...dr)}o._blockCursorElement=mn=Kr}g.style.caretColor="transparent",ur===null?Lr.appendChild(mn):Lr.insertBefore(mn,ur);break e}}mn!==null&&dl(mn,o,g)}Pe!==null&&Pe.observe(g,Ci)}finally{On=Xe,gn=Ae}}if(pt!==null){var Lo=pt;let mn=Array.from(o._listeners.mutation),Xn=mn.length;for(let Tn=0;Tn<Xn;Tn++){let[br,Ti]=mn[Tn],Tt=Lo.get(Ti);Tt!==void 0&&br(Tt,{dirtyLeaves:Yn,prevEditorState:x,updateTags:li})}}Mt(Q)||Q===null||D!==null&&D.is(Q)||o.dispatchCommand(e,void 0);var Io=o._pendingDecorators;Io!==null&&(o._decorators=Io,o._pendingDecorators=null,Ei("decorator",o,!0,Io));var Pc=It(i||x),Rr=It(a);if(Pc!==Rr&&Ei("textcontent",o,!0,Rr),Ei("update",o,!0,{dirtyElements:Ar,dirtyLeaves:Yn,editorState:a,normalizedNodes:oi,prevEditorState:i||x,tags:li}),o._deferred=[],Hl.length!==0){let mn=o._updating;o._updating=!0;try{for(let Xn=0;Xn<Hl.length;Xn++)Hl[Xn]()}finally{o._updating=mn}}var ko=o._updates;if(ko.length!==0){let mn=ko.shift();if(mn){let[Xn,Tn]=mn;Il(o,Xn,Tn)}}}}function Ei(o,i,a,...g){let C=i._updating;i._updating=a;try{let x=Array.from(i._listeners[o]);for(o=0;o<x.length;o++)x[o].apply(null,g)}finally{i._updating=C}}function ct(o,i,a){if(o._updating===!1||On!==o){let x=!1;return o.update(()=>{x=ct(o,i,a)}),x}let g=pe(o);for(let x=4;0<=x;x--)for(let D=0;D<g.length;D++){var C=g[D]._commands.get(i);if(C!==void 0&&(C=C[x],C!==void 0)){C=Array.from(C);let Q=C.length;for(let ge=0;ge<Q;ge++)if(C[ge](a,o)===!0)return!0}}return!1}function gs(o,i){let a=o._updates;for(i=i||!1;a.length!==0;){var g=a.shift();if(g){let[C,x]=g,D;x!==void 0&&(g=x.onUpdate,D=x.tag,x.skipTransforms&&(i=!0),g&&o._deferred.push(g),D&&o._updateTags.add(D)),C()}}return i}function Il(o,i,a){let g=o._updateTags;var C,x=C=!1;if(a!==void 0){var D=a.onUpdate;C=a.tag,C!=null&&g.add(C),C=a.skipTransforms||!1,x=a.discrete||!1}D&&o._deferred.push(D),a=o._editorState,D=o._pendingEditorState;let Q=!1;(D===null||D._readOnly)&&(D=o._pendingEditorState=new Gs(new Map((D||a)._nodeMap)),Q=!0),D._flushSync=x,x=gn;let ge=Wn,Ae=On,Ye=o._updating;gn=D,Wn=!1,o._updating=!0,On=o;try{Q&&(o._headless?a._selection!=null&&(D._selection=a._selection.clone()):D._selection=In(o));let Xe=o._compositionKey;i(),C=gs(o,C),Ia(D,o),o._dirtyType!==0&&(C?bl(D,o):Pa(D,o),gs(o),fl(a,D,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(D._flushSync=!0);let Ke=D._selection;if(Mt(Ke)){let Pe=D._nodeMap,pt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(pt)!==void 0||Y(19)}else ar(Ke)&&Ke._nodes.size===0&&(D._selection=null)}catch(Xe){Xe instanceof Error&&o._onError(Xe),o._pendingEditorState=a,o._dirtyType=2,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),zi(o);return}finally{gn=x,Wn=ge,On=Ae,o._updating=Ye,Ki=0}o._dirtyType!==0||kl(D,o)?D._flushSync?(D._flushSync=!1,zi(o)):Q&&rt(()=>{zi(o)}):(D._flushSync=!1,Q&&(g.clear(),o._deferred=[],o._pendingEditorState=null))}function Tr(o,i,a){o._updating?o._updates.push([i,a]):Il(o,i,a)}class So extends $s{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function En(o){return o instanceof So}class Ui extends $s{constructor(i){super(i),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let i=this.getFormat();return Ne[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getChildrenKeys(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a.__key),a=a.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=hn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(i)}getAllTextNodes(){let i=[],a=this.getFirstChild();for(;a!==null;){if(Ct(a)&&i.push(a),Je(a)){let g=a.getAllTextNodes();i.push(...g)}a=a.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let a=i.getFirstChild();if(a!==null){i=a;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let a=i.getLastChild();if(a!==null){i=a;continue}}break}return i}getDescendantByIndex(i){let a=this.getChildren(),g=a.length;return i>=g?(i=a[g-1],Je(i)&&i.getLastDescendant()||i||null):(i=a[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:mt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:mt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var a=this.getChildrenSize();let g;if(i<a/2){for(g=this.getFirstChild(),a=0;g!==null&&a<=i;){if(a===i)return g;g=g.getNextSibling(),a++}return null}for(g=this.getLastChild(),--a;g!==null&&a>=i;){if(a===i)return g;g=g.getPreviousSibling(),a--}return null}getTextContent(){let i="",a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContent(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=`
|
|
69
69
|
|
|
70
|
-
`)}return i}getTextContentSize(){let i=0,a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContentSize(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,a){Jn();let g=jt(),C=i,x=a;var D=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&a===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==D||a!==void 0&&a!==D)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(C===void 0&&(C=D),x===void 0&&(x=D),D=this.__key,Mt(g))g.anchor.set(D,C,"element"),g.focus.set(D,x,"element"),g.dirty=!0;else return Al(D,C,D,x,"element","element");return g}selectStart(){let i=this.getFirstDescendant();return i?i.selectStart():this.select()}selectEnd(){let i=this.getLastDescendant();return i?i.selectEnd():this.select()}clear(){let i=this.getWritable();return this.getChildren().forEach(a=>a.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let a=this.getWritable();return a.__dir=i,a}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,a,g){let C=g.length,x=this.getChildrenSize(),D=this.getWritable(),Q=D.__key;var ge=[],Ae=[];let Ye=this.getChildAtIndex(i+a),Xe=null,Ke=x-a+C;if(i!==0)if(i===x)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<a){var pt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<a;Pe++){pt===null&&Y(100);var wt=pt.getNextSibling(),Ft=pt.__key;pt=pt.getWritable(),Nt(pt),Ae.push(Ft),pt=wt}}for(Pe=Xe,wt=0;wt<C;wt++){Ft=g[wt],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),pt=Ft.getWritable(),pt.__parent===Q&&Ke--,Nt(pt);let zt=Ft.__key;Pe===null?(D.__first=zt,pt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=zt,pt.__prev=Pe.__key),Ft.__key===Q&&Y(76),pt.__parent=Q,ge.push(zt),Pe=Ft}if(i+a===x?Pe!==null&&(Pe.getWritable().__next=null,D.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(a=Pe.getWritable(),i.__prev=Pe.__key,a.__next=Ye.__key):i.__prev=null),D.__size=Ke,Ae.length&&(i=jt(),Mt(i))){Ae=new Set(Ae),ge=new Set(ge);let{anchor:zt,focus:Yn}=i;wo(zt,Ae,ge)&&ds(zt,zt.getNode(),this,Xe,Ye),wo(Yn,Ae,ge)&&ds(Yn,Yn.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||or(this)||this.remove()}return D}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function Je(o){return o instanceof Ui}function wo(o,i,a){for(o=o.getNode();o;){let g=o.__key;if(i.has(g)&&!a.has(g))return!0;o=o.getParent()}return!1}class cr extends Ui{static getType(){return"root"}static clone(){return new cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!hs()&&hn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let a=0;a<i.length;a++){let g=i[a];Je(g)||En(g)||Y(56)}return super.append(...i)}static importJSON(i){let a=bt();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function nr(o){return o instanceof cr}function kl(o,i){if(i=i.getEditorState()._selection,o=o._selection,o!==null){if(o.dirty||!o.is(i))return!0}else if(i!==null)return!0;return!1}function Gi(){return new Gs(new Map([["root",new cr]]))}function Pl(o){let i=o.exportJSON();var a=o.constructor;if(i.type!==a.getType()&&Y(130,a.name),Je(o)){let g=i.children;for(Array.isArray(g)||Y(59,a.name),o=o.getChildren(),a=0;a<o.length;a++){let C=Pl(o[a]);g.push(C)}}return i}class Gs{constructor(i,a){this._nodeMap=i,this._selection=a||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Ll(this,i)}clone(i){return i=new Gs(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ll(this,()=>({root:Pl(bt())}))}}class Hr extends Ui{static getType(){return"paragraph"}static clone(i){return new Hr(i.__key)}createDOM(i){let a=document.createElement("p");return i=Bt(i.theme,"paragraph"),i!==void 0&&a.classList.add(...i),a}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Ys,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&fo(i)){this.isEmpty()&&i.append(document.createElement("br"));var a=this.getFormatType();i.style.textAlign=a,(a=this.getDirection())&&(i.dir=a),a=this.getIndent(),0<a&&(i.style.textIndent=`${20*a}px`)}return{element:i}}static importJSON(i){let a=Wr();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,a){i=Wr();let g=this.getDirection();return i.setDirection(g),this.insertAfter(i,a),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||Ct(i[0])&&i[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 Ys(o){let i=Wr();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Wr(){return Nr(new Hr)}function Oo(o,i,a,g){let C=o._keyToDOMMap;C.clear(),o._editorState=Gi(),o._pendingEditorState=g,o._compositionKey=null,o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),o._normalizedNodes=new Set,o._updateTags=new Set,o._updates=[],o._blockCursorElement=null,g=o._observer,g!==null&&(g.disconnect(),o._observer=null),i!==null&&(i.textContent=""),a!==null&&(a.textContent="",C.set("root",a))}function Vs(o,i){let a=new Map,g=new Set,C=x=>{Object.keys(x).forEach(D=>{let Q=a.get(D);Q===void 0&&(Q=[],a.set(D,Q)),Q.push(x[D])})};return o.forEach(x=>{x=x.klass.importDOM!=null?x.klass.importDOM.bind(x.klass):null,x==null||g.has(x)||(g.add(x),x=x(),x!==null&&C(x))}),i&&C(i),a}class js{constructor(i,a,g,C,x,D,Q){this._parentEditor=a,this._rootElement=null,this._editorState=i,this._compositionKey=this._pendingEditorState=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=C,this._nodes=g,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,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=Ze(),this._onError=x,this._htmlConversions=D,this._editable=Q,this._headless=a!==null&&a._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let a=this._listeners.update;return a.add(i),()=>{a.delete(i)}}registerEditableListener(i){let a=this._listeners.editable;return a.add(i),()=>{a.delete(i)}}registerDecoratorListener(i){let a=this._listeners.decorator;return a.add(i),()=>{a.delete(i)}}registerTextContentListener(i){let a=this._listeners.textcontent;return a.add(i),()=>{a.delete(i)}}registerRootListener(i){let a=this._listeners.root;return i(this._rootElement,null),a.add(i),()=>{i(null,this._rootElement),a.delete(i)}}registerCommand(i,a,g){g===void 0&&Y(35);let C=this._commands;C.has(i)||C.set(i,[new Set,new Set,new Set,new Set,new Set]);let x=C.get(i);x===void 0&&Y(36,String(i));let D=x[g];return D.add(a),()=>{D.delete(a),x.every(Q=>Q.size===0)&&C.delete(i)}}registerMutationListener(i,a){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let g=this._listeners.mutation;return g.set(a,i),()=>{g.delete(a)}}registerNodeTransformToKlass(i,a){var g=i.getType();return g=this._nodes.get(g),g===void 0&&Y(37,i.name),g.transforms.add(a),g}registerNodeTransform(i,a){var g=this.registerNodeTransformToKlass(i,a);let C=[g];return g=g.replaceWithKlass,g!=null&&(g=this.registerNodeTransformToKlass(g,a),C.push(g)),Vt(this,i.getType()),()=>{C.forEach(x=>x.transforms.delete(a))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,a){return at(this,i,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let a=this._rootElement;if(i!==a){let D=Bt(this._config.theme,"root");var g=this._pendingEditorState||this._editorState;if(this._rootElement=i,Oo(this,a,i,g),a!==null){if(!this._config.disableEvents){Is!==0&&(Is--,Is===0&&a.ownerDocument.removeEventListener("selectionchange",Oa));var C=a.__lexicalEditor;if(C!=null){if(C._parentEditor!==null){var x=pe(C);x=x[x.length-1]._key,ls.get(x)===C&&ls.delete(x)}else ls.delete(C._key);a.__lexicalEditor=null}for(C=wa(a),x=0;x<C.length;x++)C[x]();a.__lexicalEventHandles=[]}D!=null&&a.classList.remove(...D)}i!==null?(g=(g=i.ownerDocument)&&g.defaultView||null,C=i.style,C.userSelect="text",C.whiteSpace="pre-wrap",C.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=g,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),zi(this),this._config.disableEvents||Ic(i,this),D!=null&&i.classList.add(...D)):(this._editorState=g,this._window=this._pendingEditorState=null),Ei("root",this,!1,i,a)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,a){i.isEmpty()&&Y(38),en(this);let g=this._pendingEditorState,C=this._updateTags;a=a!==void 0?a.tag:null,g===null||g.isEmpty()||(a!=null&&C.add(a),zi(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,a!=null&&C.add(a),zi(this)}parseEditorState(i,a){i=typeof i=="string"?JSON.parse(i):i;let g=Gi(),C=gn,x=Wn,D=On,Q=this._dirtyElements,ge=this._dirtyLeaves,Ae=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,gn=g,Wn=!1,On=this;try{vo(i.root,this._nodes),a&&a(),g._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=Q,this._dirtyLeaves=ge,this._cloneNotNeeded=Ae,this._dirtyType=Ye,gn=C,Wn=x,On=D}return g}update(i,a){Tr(this,i,a)}focus(i,a={}){let g=this._rootElement;g!==null&&(g.setAttribute("autocapitalize","off"),Tr(this,()=>{let C=jt(),x=bt();C!==null?C.dirty=!0:x.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?x.selectStart():x.selectEnd())},{onUpdate:()=>{g.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&g.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=Vr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ei("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Do extends Ui{constructor(i,a){super(a),this.__colSpan=i,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(i){return this.getWritable().__colSpan=i,this}getRowSpan(){return this.__rowSpan}setRowSpan(i){return this.getWritable().__rowSpan=i,this}}function Yi(o){return o instanceof Do}class $l extends Ui{}function Fl(o){return o instanceof $l}class $a extends Ui{}function Bl(o){return o instanceof $a}return We.$INTERNAL_isPointSelection=Hs,We.$addUpdateTag=function(o){Jn(),hn()._updateTags.add(o)},We.$applyNodeReplacement=Nr,We.$copyNode=Mi,We.$createLineBreakNode=Zr,We.$createNodeSelection=Ml,We.$createParagraphNode=Wr,We.$createPoint=Fr,We.$createRangeSelection=function(){let o=Fr("root",0,"element"),i=Fr("root",0,"element");return new Ni(o,i,0,"")},We.$createTabNode=Bi,We.$createTextNode=Un,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=sr,We.$getNodeByKey=mt,We.$getPreviousSelection=Er,We.$getRoot=bt,We.$getSelection=jt,We.$getTextContent=function(){let o=jt();return o===null?"":o.getTextContent()},We.$hasAncestor=Zn,We.$hasUpdateTag=function(o){return hn()._updateTags.has(o)},We.$insertNodes=function(o){let i=jt()||Er();i===null&&(i=bt().selectEnd()),i.insertNodes(o)},We.$isBlockElementNode=function(o){return Je(o)&&!o.isInline()},We.$isDecoratorNode=En,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(o){return Je(o)&&o.isInline()||En(o)&&o.isInline()},We.$isLeafNode=function(o){return Ct(o)||ki(o)||En(o)},We.$isLineBreakNode=ki,We.$isNodeSelection=ar,We.$isParagraphNode=function(o){return o instanceof Hr},We.$isRangeSelection=Mt,We.$isRootNode=nr,We.$isRootOrShadowRoot=or,We.$isTabNode=Ma,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=Br();let a=i._readOnly,g=o.getType();i=i._nodeMap;let C=[];for(let[,x]of i)x instanceof o&&x.__type===g&&(a||x.isAttached())&&C.push(x);return C},We.$normalizeSelection__EXPERIMENTAL=Le,We.$parseSerializedNode=function(o){return vo(o,hn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),nn(Le(o))},We.$setCompositionKey=gt,We.$setSelection=nn,We.$splitNode=function(o,i){let a=o.getChildAtIndex(i);a==null&&(a=o),or(o)&&Y(102);let g=D=>{const Q=D.getParentOrThrow(),ge=or(Q),Ae=D!==a||ge?Mi(D):D;if(ge){if(!Je(D)||!Je(Ae))throw Error("Children of a root must be ElementNode");return D.insertAfter(Ae),[D,Ae,Ae]}const[Ye,Xe,Ke]=g(Q);return D=D.getNextSiblings(),Ke.append(Ae,...D),[Ye,Xe,Ae]},[C,x]=g(a);return[C,x]},We.BLUR_COMMAND=Z,We.CAN_REDO_COMMAND={},We.CAN_UNDO_COMMAND={},We.CLEAR_EDITOR_COMMAND={},We.CLEAR_HISTORY_COMMAND={},We.CLICK_COMMAND=t,We.COMMAND_PRIORITY_CRITICAL=4,We.COMMAND_PRIORITY_EDITOR=0,We.COMMAND_PRIORITY_HIGH=3,We.COMMAND_PRIORITY_LOW=1,We.COMMAND_PRIORITY_NORMAL=2,We.CONTROLLED_TEXT_INSERTION_COMMAND=d,We.COPY_COMMAND=Ee,We.CUT_COMMAND=de,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=T,We.DELETE_WORD_COMMAND=_,We.DEPRECATED_$computeGridMap=function(o,i,a){let g=[],C=null,x=null;o=o.getChildren();for(let Ye=0;Ye<o.length;Ye++){var D=o[Ye];Bl(D)||Y(108);var Q=D.getChildren();D=0;for(let Xe of Q){for(Yi(Xe)||Y(109);g[Ye]!==void 0&&g[Ye][D]!==void 0;)D++;Q=Ye;var ge=D,Ae=Xe;let Ke={cell:Ae,startColumn:ge,startRow:Q},Pe=Ae.__rowSpan,pt=Ae.__colSpan;for(let wt=0;wt<Pe;wt++){g[Q+wt]===void 0&&(g[Q+wt]=[]);for(let Ft=0;Ft<pt;Ft++)g[Q+wt][ge+Ft]=Ke}i.is(Ae)&&(C=Ke),a.is(Ae)&&(x=Ke),D+=Xe.__colSpan}}return C===null&&Y(110),x===null&&Y(111),[g,C,x]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,a]=zs(o);o=a.getChildren();let g=o.length;var C=o[0].getChildren().length;let x=Array(g);for(var D=0;D<g;D++)x[D]=Array(C);for(C=0;C<g;C++){D=o[C].getChildren();let Q=0;for(let ge=0;ge<D.length;ge++){for(;x[C][Q];)Q++;let Ae=D[ge],Ye=Ae.__rowSpan||1,Xe=Ae.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)x[C+Ke][Q+Pe]=Ae;if(i===Ae)return{colSpan:Xe,columnIndex:Q,rowIndex:C,rowSpan:Ye};Q+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=zs,We.DEPRECATED_$isGridCellNode=Yi,We.DEPRECATED_$isGridNode=Fl,We.DEPRECATED_$isGridRowNode=Bl,We.DEPRECATED_GridCellNode=Do,We.DEPRECATED_GridNode=$l,We.DEPRECATED_GridRowNode=$a,We.DRAGEND_COMMAND=Se,We.DRAGOVER_COMMAND=Te,We.DRAGSTART_COMMAND=q,We.DROP_COMMAND=z,We.DecoratorNode=So,We.ElementNode=Ui,We.FOCUS_COMMAND=O,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=E,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=l,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Bs,We.KEY_ARROW_DOWN_COMMAND=P,We.KEY_ARROW_LEFT_COMMAND=k,We.KEY_ARROW_RIGHT_COMMAND=m,We.KEY_ARROW_UP_COMMAND=I,We.KEY_BACKSPACE_COMMAND=re,We.KEY_DELETE_COMMAND=ce,We.KEY_DOWN_COMMAND=M,We.KEY_ENTER_COMMAND=H,We.KEY_ESCAPE_COMMAND=te,We.KEY_MODIFIER_COMMAND=oe,We.KEY_SPACE_COMMAND=V,We.KEY_TAB_COMMAND=j,We.LineBreakNode=qr,We.MOVE_TO_END=v,We.MOVE_TO_START=G,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=f,We.ParagraphNode=Hr,We.REDO_COMMAND=w,We.REMOVE_TEXT_COMMAND=p,We.RootNode=cr,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=K,We.TabNode=cs,We.TextNode=Fi,We.UNDO_COMMAND=S,We.createCommand=function(){return{}},We.createEditor=function(o){var i=o||{},a=On,g=i.theme||{};let C=o===void 0?a:i.parentEditor||null,x=i.disableEvents||!1,D=Gi(),Q=i.namespace||(C!==null?C._config.namespace:Ze()),ge=i.editorState,Ae=[cr,Fi,qr,cs,Hr,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,o===void 0&&a!==null)o=a._nodes;else for(o=new Map,a=0;a<Ae.length;a++){let Pe=Ae[a],pt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,pt=Ke.with,Ke=Ke.withKlass||null);let wt=Pe.getType(),Ft=Pe.transform(),zt=new Set;Ft!==null&&zt.add(Ft),o.set(wt,{exportDOM:Xe&&Xe.export?Xe.export.get(Pe):void 0,klass:Pe,replace:pt,replaceWithKlass:Ke,transforms:zt})}return g=new js(D,C,o,{disableEvents:x,namespace:Q,theme:g},Ye||console.error,Vs(o,Xe?Xe.import:void 0),i),ge!==void 0&&(g._pendingEditorState=ge,g._dirtyType=2),g},We.getNearestEditorFromDOMNode=vt,We.isCurrentlyReadOnlyMode=hs,We.isHTMLAnchorElement=function(o){return fo(o)&&o.tagName==="A"},We.isHTMLElement=fo,We.isSelectionCapturedInDecoratorInput=it,We.isSelectionWithinEditor=st,We}var Jc,Lf;function Yt(){return Lf||(Lf=1,Jc=process.env.NODE_ENV==="development"?BN():HN()),Jc}var If;function WN(){if(If)return qc;If=1;var e=qn(),t=Yt(),n=nt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const f={tag:"history-merge"};function p({initialConfig:T,children:E}){const S=n.useMemo(()=>{const{theme:w,namespace:M,editor__DEPRECATED:m,nodes:v,onError:k,editorState:G,html:I}=T,P=e.createLexicalComposerContext(null,w);let H=m||null;if(H===null){const V=t.createEditor({editable:T.editable,html:I,namespace:M,nodes:v,onError:re=>k(re,V),theme:w});_(V,G),H=V}return[H,P]},[]);return d(()=>{const w=T.editable,[M]=S;M.setEditable(w!==void 0?w:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:S},E)}function _(T,E){if(E!==null){if(E===void 0)T.update(()=>{const S=t.$getRoot();if(S.isEmpty()){const w=t.$createParagraphNode();S.append(w);const M=r?document.activeElement:null;(t.$getSelection()!==null||M!==null&&M===T.getRootElement())&&w.select()}},f);else if(E!==null)switch(typeof E){case"string":{const S=T.parseEditorState(E);T.setEditorState(S,f);break}case"object":{T.setEditorState(E,f);break}case"function":{T.update(()=>{t.$getRoot().isEmpty()&&E(T)},f);break}}}}return qc.LexicalComposer=p,qc}var Xc={},kf;function KN(){if(kf)return Xc;kf=1;var e=qn(),t=Yt(),n=nt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var l=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function f(p,_){if(_!==null){if(_===void 0)p.update(()=>{var T=t.$getRoot();if(T.isEmpty()){let E=t.$createParagraphNode();T.append(E),T=r?document.activeElement:null,(t.$getSelection()!==null||T!==null&&T===p.getRootElement())&&E.select()}},d);else if(_!==null)switch(typeof _){case"string":let T=p.parseEditorState(_);p.setEditorState(T,d);break;case"object":p.setEditorState(_,d);break;case"function":p.update(()=>{t.$getRoot().isEmpty()&&_(p)},d)}}}return Xc.LexicalComposer=function({initialConfig:p,children:_}){let T=n.useMemo(()=>{const{theme:E,namespace:S,editor__DEPRECATED:w,nodes:M,onError:m,editorState:v,html:k}=p,G=e.createLexicalComposerContext(null,E);let I=w||null;if(I===null){const P=t.createEditor({editable:p.editable,html:k,namespace:S,nodes:M,onError:H=>m(H,P),theme:E});f(P,v),I=P}return[I,G]},[]);return l(()=>{let E=p.editable,[S]=T;S.setEditable(E!==void 0?E:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:T},_)},Xc}const zN=process.env.NODE_ENV==="development"?WN():KN();var UN=zN,Qc={},eu,Pf;function GN(){if(Pf)return eu;Pf=1;var e=qn(),t=nt,l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function d(_){const[T]=e.useLexicalComposerContext(),E=t.useMemo(()=>_(T),[T,_]),S=t.useRef(E.initialValueFn()),[w,M]=t.useState(S.current);return l(()=>{const{initialValueFn:m,subscribe:v}=E,k=m();return S.current!==k&&(S.current=k,M(k)),v(G=>{S.current=G,M(G)})},[E,_]),w}function f(_){return{initialValueFn:()=>_.isEditable(),subscribe:T=>_.registerEditableListener(T)}}function p(){return d(f)}return eu=p,eu}var tu,$f;function YN(){if($f)return tu;$f=1;var e=qn(),t=nt,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function r(d){let[f]=e.useLexicalComposerContext(),p=t.useMemo(()=>d(f),[f,d]),_=t.useRef(p.initialValueFn()),[T,E]=t.useState(_.current);return n(()=>{let{initialValueFn:S,subscribe:w}=p,M=S();return _.current!==M&&(_.current=M,E(M)),w(m=>{_.current=m,E(m)})},[p,d]),T}function l(d){return{initialValueFn:()=>d.isEditable(),subscribe:f=>d.registerEditableListener(f)}}return tu=function(){return r(l)},tu}var nu,Ff;function Cp(){return Ff||(Ff=1,nu=process.env.NODE_ENV==="development"?GN():YN()),nu}var Xi={},Bf;function VN(){if(Bf)return Xi;Bf=1;var e=Yt();function t(_,T){let E=_.getFirstChild(),S=0;e:for(;E!==null;){if(e.$isElementNode(E)){const m=E.getFirstChild();if(m!==null){E=m;continue}}else if(e.$isTextNode(E)){const m=E.getTextContentSize();if(S+m>T)return{node:E,offset:T-S};S+=m}const w=E.getNextSibling();if(w!==null){E=w;continue}let M=E.getParent();for(;M!==null;){const m=M.getNextSibling();if(m!==null){E=m;continue e}M=M.getParent()}break}return null}function n(_,T=!0){if(_)return!1;let E=l();return T&&(E=E.trim()),E===""}function r(_,T){return()=>n(_,T)}function l(){return e.$getRoot().getTextContent()}function d(_){if(!n(_,!1))return!1;const E=e.$getRoot().getChildren(),S=E.length;if(S>1)return!1;for(let w=0;w<S;w++){const M=E[w];if(e.$isDecoratorNode(M))return!1;if(e.$isElementNode(M)){if(!e.$isParagraphNode(M)||M.__indent!==0)return!1;const m=M.getChildren(),v=m.length;for(let k=0;k<v;k++){const G=m[w];if(!e.$isTextNode(G))return!1}}}return!0}function f(_){return()=>d(_)}function p(_,T,E,S){const w=P=>P instanceof E,M=P=>{const H=e.$createTextNode(P.getTextContent());H.setFormat(P.getFormat()),P.replace(H)},m=P=>P.getLatest().__mode,v=P=>{if(!P.isSimpleText())return;const H=P.getPreviousSibling();let V=P.getTextContent(),re=P,te;if(e.$isTextNode(H)){const ce=H.getTextContent(),j=ce+V,z=T(j);if(w(H))if(z===null||m(H)!==0){M(H);return}else{const q=z.end-ce.length;if(q>0){const Te=V.slice(0,q),Se=ce+Te;if(H.select(),H.setTextContent(Se),q===V.length)P.remove();else{const Ee=V.slice(q);P.setTextContent(Ee)}return}}else if(z===null||z.start<ce.length)return}for(;;){te=T(V);let ce=te===null?"":V.slice(te.end);if(V=ce,ce===""){const q=re.getNextSibling();if(e.$isTextNode(q)){ce=re.getTextContent()+q.getTextContent();const Te=T(ce);if(Te===null){w(q)?M(q):q.markDirty();return}else if(Te.start!==0)return}}else{const q=T(ce);if(q!==null&&q.start===0)return}if(te===null)return;if(te.start===0&&e.$isTextNode(H)&&H.isTextEntity())continue;let j;te.start===0?[j,re]=re.splitText(te.end):[,j,re]=re.splitText(te.start,te.end);const z=S(j);if(z.setFormat(j.getFormat()),j.replace(z),re==null)return}},k=P=>{const H=P.getTextContent(),V=T(H);if(V===null||V.start!==0){M(P);return}if(H.length>V.end){P.splitText(V.end);return}const re=P.getPreviousSibling();e.$isTextNode(re)&&re.isTextEntity()&&(M(re),M(P));const te=P.getNextSibling();e.$isTextNode(te)&&te.isTextEntity()&&(M(te),w(P)&&M(P))},G=_.registerNodeTransform(e.TextNode,v),I=_.registerNodeTransform(E,k);return[G,I]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=f,Xi.$findTextIntersectionFromCharacters=t,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=l,Xi.registerLexicalTextEntity=p,Xi}var Qi={},Hf;function jN(){if(Hf)return Qi;Hf=1;var e=Yt();function t(l,d=!0){return l?!1:(l=n(),d&&(l=l.trim()),l==="")}function n(){return e.$getRoot().getTextContent()}function r(l){if(!t(l,!1))return!1;l=e.$getRoot().getChildren();let d=l.length;if(1<d)return!1;for(let p=0;p<d;p++){var f=l[p];if(e.$isDecoratorNode(f))return!1;if(e.$isElementNode(f)){if(!e.$isParagraphNode(f)||f.__indent!==0)return!1;f=f.getChildren();let _=f.length;for(let T=0;T<_;T++)if(!e.$isTextNode(f[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(l){return()=>r(l)},Qi.$findTextIntersectionFromCharacters=function(l,d){var f=l.getFirstChild();l=0;e:for(;f!==null;){if(e.$isElementNode(f)){var p=f.getFirstChild();if(p!==null){f=p;continue}}else if(e.$isTextNode(f)){if(p=f.getTextContentSize(),l+p>d)return{node:f,offset:d-l};l+=p}if(p=f.getNextSibling(),p!==null)f=p;else{for(f=f.getParent();f!==null;){if(p=f.getNextSibling(),p!==null){f=p;continue e}f=f.getParent()}break}}return null},Qi.$isRootTextContentEmpty=t,Qi.$isRootTextContentEmptyCurry=function(l,d){return()=>t(l,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(l,d,f,p){let _=E=>{const S=e.$createTextNode(E.getTextContent());S.setFormat(E.getFormat()),E.replace(S)},T=l.registerNodeTransform(e.TextNode,E=>{if(E.isSimpleText()){var S=E.getPreviousSibling(),w=E.getTextContent(),M=E;if(e.$isTextNode(S)){var m=S.getTextContent(),v=d(m+w);if(S instanceof f){if(v===null||S.getLatest().__mode!==0){_(S);return}if(v=v.end-m.length,0<v){M=w.slice(0,v),M=m+M,S.select(),S.setTextContent(M),v===w.length?E.remove():(S=w.slice(v),E.setTextContent(S));return}}else if(v===null||v.start<m.length)return}for(;;){if(E=d(w),w=v=E===null?"":w.slice(E.end),v===""){if(m=M.getNextSibling(),e.$isTextNode(m)){if(v=M.getTextContent()+m.getTextContent(),v=d(v),v===null){m instanceof f?_(m):m.markDirty();break}else if(v.start!==0)break}}else if(m=d(v),m!==null&&m.start===0)break;if(E===null)break;if(E.start===0&&e.$isTextNode(S)&&S.isTextEntity())continue;let k;if(E.start===0?[k,M]=M.splitText(E.end):[,k,M]=M.splitText(E.start,E.end),E=p(k),E.setFormat(k.getFormat()),k.replace(E),M==null)break}}});return l=l.registerNodeTransform(f,E=>{var S=E.getTextContent();const w=d(S);w===null||w.start!==0?_(E):S.length>w.end?E.splitText(w.end):(S=E.getPreviousSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),_(E)),S=E.getNextSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),E instanceof f&&_(E)))}),[T,l]},Qi}var ru,Wf;function Ep(){return Wf||(Wf=1,ru=process.env.NODE_ENV==="development"?VN():jN()),ru}var Sn={},Vn={},Kf;function qN(){if(Kf)return Vn;Kf=1;var e=Yt();const t=new Map;function n(K){let O=K;for(;O!=null;){if(O.nodeType===Node.TEXT_NODE)return O;O=O.firstChild}return null}function r(K){const O=K.parentNode;if(O==null)throw new Error("Should never happen");return[O,Array.from(O.childNodes).indexOf(K)]}function l(K,O,Z,oe,Y){const W=O.getKey(),J=oe.getKey(),R=document.createRange();let U=K.getElementByKey(W),X=K.getElementByKey(J),fe=Z,_e=Y;if(e.$isTextNode(O)&&(U=n(U)),e.$isTextNode(oe)&&(X=n(X)),O===void 0||oe===void 0||U===null||X===null)return null;U.nodeName==="BR"&&([U,fe]=r(U)),X.nodeName==="BR"&&([X,_e]=r(X));const B=U.firstChild;U===X&&B!=null&&B.nodeName==="BR"&&fe===0&&_e===0&&(_e=1);try{R.setStart(U,fe),R.setEnd(X,_e)}catch{return null}return R.collapsed&&(fe!==_e||W!==J)&&(R.setStart(X,_e),R.setEnd(U,fe)),R}function d(K,O){const Z=K.getRootElement();if(Z===null)return[];const oe=Z.getBoundingClientRect(),Y=getComputedStyle(Z),W=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),J=Array.from(O.getClientRects());let R=J.length;J.sort((X,fe)=>{const _e=X.top-fe.top;return Math.abs(_e)<=3?X.left-fe.left:_e});let U;for(let X=0;X<R;X++){const fe=J[X],_e=U&&U.top<=fe.top&&U.top+U.height>fe.top&&U.left+U.width>fe.left,B=fe.width+W===oe.width;if(_e||B){J.splice(X--,1),R--;continue}U=fe}return J}function f(K){const O={},Z=K.split(";");for(const oe of Z)if(oe!==""){const[Y,W]=oe.split(/:([^]+)/);Y&&W&&(O[Y.trim()]=W.trim())}return O}function p(K){let O=t.get(K);return O===void 0&&(O=f(K),t.set(K,O)),Object.freeze(O),O}function _(K){let O="";for(const Z in K)Z&&(O+=`${Z}: ${K[Z]};`);return O}function T(K,O){return K.__first=O.__first,K.__last=O.__last,K.__size=O.__size,K.__format=O.__format,K.__indent=O.__indent,K.__dir=O.__dir,K}function E(K,O){return K.__format=O.__format,K.__style=O.__style,K.__mode=O.__mode,K.__detail=O.__detail,K}function S(K){const Z=K.constructor.clone(K);return Z.__parent=K.__parent,Z.__next=K.__next,Z.__prev=K.__prev,e.$isElementNode(K)&&e.$isElementNode(Z)?T(Z,K):e.$isTextNode(K)&&e.$isTextNode(Z)?E(Z,K):Z}function w(K,O){if(O.isSelected(K)&&!O.isSegmented()&&!O.isToken()&&e.$INTERNAL_isPointSelection(K)){const Z=K.anchor.getNode(),oe=K.focus.getNode(),Y=O.is(Z),W=O.is(oe);if(Y||W){const J=K.isBackward(),[R,U]=K.getCharacterOffsets(),X=Z.is(oe),fe=O.is(J?oe:Z),_e=O.is(J?Z:oe);let B=0,A;if(X)B=R>U?U:R,A=R>U?R:U;else if(fe)B=J?U:R,A=void 0;else if(_e){const F=J?R:U;B=0,A=F}return O.__text=O.__text.slice(B,A),O}}return O}function M(K){if(K.type==="text")return K.offset===K.getNode().getTextContentSize();const O=K.getNode();if(!e.$isElementNode(O))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return K.offset===O.getChildrenSize()}function m(K,O,Z){let oe=O.getNode(),Y=Z;if(e.$isElementNode(oe)){const W=oe.getDescendantByIndex(O.offset);W!==null&&(oe=W)}for(;Y>0&&oe!==null;){if(e.$isElementNode(oe)){const X=oe.getLastDescendant();X!==null&&(oe=X)}let W=oe.getPreviousSibling(),J=0;if(W===null){let X=oe.getParentOrThrow(),fe=X.getPreviousSibling();for(;fe===null;){if(X=X.getParent(),X===null){W=null;break}fe=X.getPreviousSibling()}X!==null&&(J=X.isInline()?0:2,W=fe)}let R=oe.getTextContent();R===""&&e.$isElementNode(oe)&&!oe.isInline()&&(R=`
|
|
70
|
+
`)}return i}getTextContentSize(){let i=0,a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContentSize(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,a){Jn();let g=Vt(),C=i,x=a;var D=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&a===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==D||a!==void 0&&a!==D)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(C===void 0&&(C=D),x===void 0&&(x=D),D=this.__key,Mt(g))g.anchor.set(D,C,"element"),g.focus.set(D,x,"element"),g.dirty=!0;else return Al(D,C,D,x,"element","element");return g}selectStart(){let i=this.getFirstDescendant();return i?i.selectStart():this.select()}selectEnd(){let i=this.getLastDescendant();return i?i.selectEnd():this.select()}clear(){let i=this.getWritable();return this.getChildren().forEach(a=>a.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let a=this.getWritable();return a.__dir=i,a}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,a,g){let C=g.length,x=this.getChildrenSize(),D=this.getWritable(),Q=D.__key;var ge=[],Ae=[];let Ye=this.getChildAtIndex(i+a),Xe=null,Ke=x-a+C;if(i!==0)if(i===x)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<a){var pt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<a;Pe++){pt===null&&Y(100);var wt=pt.getNextSibling(),Ft=pt.__key;pt=pt.getWritable(),Nt(pt),Ae.push(Ft),pt=wt}}for(Pe=Xe,wt=0;wt<C;wt++){Ft=g[wt],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),pt=Ft.getWritable(),pt.__parent===Q&&Ke--,Nt(pt);let zt=Ft.__key;Pe===null?(D.__first=zt,pt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=zt,pt.__prev=Pe.__key),Ft.__key===Q&&Y(76),pt.__parent=Q,ge.push(zt),Pe=Ft}if(i+a===x?Pe!==null&&(Pe.getWritable().__next=null,D.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(a=Pe.getWritable(),i.__prev=Pe.__key,a.__next=Ye.__key):i.__prev=null),D.__size=Ke,Ae.length&&(i=Vt(),Mt(i))){Ae=new Set(Ae),ge=new Set(ge);let{anchor:zt,focus:Yn}=i;wo(zt,Ae,ge)&&ds(zt,zt.getNode(),this,Xe,Ye),wo(Yn,Ae,ge)&&ds(Yn,Yn.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||or(this)||this.remove()}return D}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function Je(o){return o instanceof Ui}function wo(o,i,a){for(o=o.getNode();o;){let g=o.__key;if(i.has(g)&&!a.has(g))return!0;o=o.getParent()}return!1}class cr extends Ui{static getType(){return"root"}static clone(){return new cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!hs()&&hn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let a=0;a<i.length;a++){let g=i[a];Je(g)||En(g)||Y(56)}return super.append(...i)}static importJSON(i){let a=bt();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function nr(o){return o instanceof cr}function kl(o,i){if(i=i.getEditorState()._selection,o=o._selection,o!==null){if(o.dirty||!o.is(i))return!0}else if(i!==null)return!0;return!1}function Gi(){return new Gs(new Map([["root",new cr]]))}function Pl(o){let i=o.exportJSON();var a=o.constructor;if(i.type!==a.getType()&&Y(130,a.name),Je(o)){let g=i.children;for(Array.isArray(g)||Y(59,a.name),o=o.getChildren(),a=0;a<o.length;a++){let C=Pl(o[a]);g.push(C)}}return i}class Gs{constructor(i,a){this._nodeMap=i,this._selection=a||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Ll(this,i)}clone(i){return i=new Gs(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ll(this,()=>({root:Pl(bt())}))}}class Hr extends Ui{static getType(){return"paragraph"}static clone(i){return new Hr(i.__key)}createDOM(i){let a=document.createElement("p");return i=Bt(i.theme,"paragraph"),i!==void 0&&a.classList.add(...i),a}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Ys,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&fo(i)){this.isEmpty()&&i.append(document.createElement("br"));var a=this.getFormatType();i.style.textAlign=a,(a=this.getDirection())&&(i.dir=a),a=this.getIndent(),0<a&&(i.style.textIndent=`${20*a}px`)}return{element:i}}static importJSON(i){let a=Wr();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,a){i=Wr();let g=this.getDirection();return i.setDirection(g),this.insertAfter(i,a),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||Ct(i[0])&&i[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 Ys(o){let i=Wr();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Wr(){return Nr(new Hr)}function Oo(o,i,a,g){let C=o._keyToDOMMap;C.clear(),o._editorState=Gi(),o._pendingEditorState=g,o._compositionKey=null,o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),o._normalizedNodes=new Set,o._updateTags=new Set,o._updates=[],o._blockCursorElement=null,g=o._observer,g!==null&&(g.disconnect(),o._observer=null),i!==null&&(i.textContent=""),a!==null&&(a.textContent="",C.set("root",a))}function js(o,i){let a=new Map,g=new Set,C=x=>{Object.keys(x).forEach(D=>{let Q=a.get(D);Q===void 0&&(Q=[],a.set(D,Q)),Q.push(x[D])})};return o.forEach(x=>{x=x.klass.importDOM!=null?x.klass.importDOM.bind(x.klass):null,x==null||g.has(x)||(g.add(x),x=x(),x!==null&&C(x))}),i&&C(i),a}class Vs{constructor(i,a,g,C,x,D,Q){this._parentEditor=a,this._rootElement=null,this._editorState=i,this._compositionKey=this._pendingEditorState=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=C,this._nodes=g,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,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=Ze(),this._onError=x,this._htmlConversions=D,this._editable=Q,this._headless=a!==null&&a._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let a=this._listeners.update;return a.add(i),()=>{a.delete(i)}}registerEditableListener(i){let a=this._listeners.editable;return a.add(i),()=>{a.delete(i)}}registerDecoratorListener(i){let a=this._listeners.decorator;return a.add(i),()=>{a.delete(i)}}registerTextContentListener(i){let a=this._listeners.textcontent;return a.add(i),()=>{a.delete(i)}}registerRootListener(i){let a=this._listeners.root;return i(this._rootElement,null),a.add(i),()=>{i(null,this._rootElement),a.delete(i)}}registerCommand(i,a,g){g===void 0&&Y(35);let C=this._commands;C.has(i)||C.set(i,[new Set,new Set,new Set,new Set,new Set]);let x=C.get(i);x===void 0&&Y(36,String(i));let D=x[g];return D.add(a),()=>{D.delete(a),x.every(Q=>Q.size===0)&&C.delete(i)}}registerMutationListener(i,a){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let g=this._listeners.mutation;return g.set(a,i),()=>{g.delete(a)}}registerNodeTransformToKlass(i,a){var g=i.getType();return g=this._nodes.get(g),g===void 0&&Y(37,i.name),g.transforms.add(a),g}registerNodeTransform(i,a){var g=this.registerNodeTransformToKlass(i,a);let C=[g];return g=g.replaceWithKlass,g!=null&&(g=this.registerNodeTransformToKlass(g,a),C.push(g)),jt(this,i.getType()),()=>{C.forEach(x=>x.transforms.delete(a))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,a){return ct(this,i,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let a=this._rootElement;if(i!==a){let D=Bt(this._config.theme,"root");var g=this._pendingEditorState||this._editorState;if(this._rootElement=i,Oo(this,a,i,g),a!==null){if(!this._config.disableEvents){Is!==0&&(Is--,Is===0&&a.ownerDocument.removeEventListener("selectionchange",Oa));var C=a.__lexicalEditor;if(C!=null){if(C._parentEditor!==null){var x=pe(C);x=x[x.length-1]._key,ls.get(x)===C&&ls.delete(x)}else ls.delete(C._key);a.__lexicalEditor=null}for(C=wa(a),x=0;x<C.length;x++)C[x]();a.__lexicalEventHandles=[]}D!=null&&a.classList.remove(...D)}i!==null?(g=(g=i.ownerDocument)&&g.defaultView||null,C=i.style,C.userSelect="text",C.whiteSpace="pre-wrap",C.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=g,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),zi(this),this._config.disableEvents||Ic(i,this),D!=null&&i.classList.add(...D)):(this._editorState=g,this._window=this._pendingEditorState=null),Ei("root",this,!1,i,a)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,a){i.isEmpty()&&Y(38),en(this);let g=this._pendingEditorState,C=this._updateTags;a=a!==void 0?a.tag:null,g===null||g.isEmpty()||(a!=null&&C.add(a),zi(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,a!=null&&C.add(a),zi(this)}parseEditorState(i,a){i=typeof i=="string"?JSON.parse(i):i;let g=Gi(),C=gn,x=Wn,D=On,Q=this._dirtyElements,ge=this._dirtyLeaves,Ae=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,gn=g,Wn=!1,On=this;try{vo(i.root,this._nodes),a&&a(),g._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=Q,this._dirtyLeaves=ge,this._cloneNotNeeded=Ae,this._dirtyType=Ye,gn=C,Wn=x,On=D}return g}update(i,a){Tr(this,i,a)}focus(i,a={}){let g=this._rootElement;g!==null&&(g.setAttribute("autocapitalize","off"),Tr(this,()=>{let C=Vt(),x=bt();C!==null?C.dirty=!0:x.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?x.selectStart():x.selectEnd())},{onUpdate:()=>{g.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&g.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=jr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ei("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Do extends Ui{constructor(i,a){super(a),this.__colSpan=i,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(i){return this.getWritable().__colSpan=i,this}getRowSpan(){return this.__rowSpan}setRowSpan(i){return this.getWritable().__rowSpan=i,this}}function Yi(o){return o instanceof Do}class $l extends Ui{}function Fl(o){return o instanceof $l}class $a extends Ui{}function Bl(o){return o instanceof $a}return We.$INTERNAL_isPointSelection=Hs,We.$addUpdateTag=function(o){Jn(),hn()._updateTags.add(o)},We.$applyNodeReplacement=Nr,We.$copyNode=Mi,We.$createLineBreakNode=Zr,We.$createNodeSelection=Ml,We.$createParagraphNode=Wr,We.$createPoint=Fr,We.$createRangeSelection=function(){let o=Fr("root",0,"element"),i=Fr("root",0,"element");return new Ni(o,i,0,"")},We.$createTabNode=Bi,We.$createTextNode=Un,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=sr,We.$getNodeByKey=mt,We.$getPreviousSelection=Er,We.$getRoot=bt,We.$getSelection=Vt,We.$getTextContent=function(){let o=Vt();return o===null?"":o.getTextContent()},We.$hasAncestor=Zn,We.$hasUpdateTag=function(o){return hn()._updateTags.has(o)},We.$insertNodes=function(o){let i=Vt()||Er();i===null&&(i=bt().selectEnd()),i.insertNodes(o)},We.$isBlockElementNode=function(o){return Je(o)&&!o.isInline()},We.$isDecoratorNode=En,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(o){return Je(o)&&o.isInline()||En(o)&&o.isInline()},We.$isLeafNode=function(o){return Ct(o)||ki(o)||En(o)},We.$isLineBreakNode=ki,We.$isNodeSelection=ar,We.$isParagraphNode=function(o){return o instanceof Hr},We.$isRangeSelection=Mt,We.$isRootNode=nr,We.$isRootOrShadowRoot=or,We.$isTabNode=Ma,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=Br();let a=i._readOnly,g=o.getType();i=i._nodeMap;let C=[];for(let[,x]of i)x instanceof o&&x.__type===g&&(a||x.isAttached())&&C.push(x);return C},We.$normalizeSelection__EXPERIMENTAL=Le,We.$parseSerializedNode=function(o){return vo(o,hn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),nn(Le(o))},We.$setCompositionKey=gt,We.$setSelection=nn,We.$splitNode=function(o,i){let a=o.getChildAtIndex(i);a==null&&(a=o),or(o)&&Y(102);let g=D=>{const Q=D.getParentOrThrow(),ge=or(Q),Ae=D!==a||ge?Mi(D):D;if(ge){if(!Je(D)||!Je(Ae))throw Error("Children of a root must be ElementNode");return D.insertAfter(Ae),[D,Ae,Ae]}const[Ye,Xe,Ke]=g(Q);return D=D.getNextSiblings(),Ke.append(Ae,...D),[Ye,Xe,Ae]},[C,x]=g(a);return[C,x]},We.BLUR_COMMAND=Z,We.CAN_REDO_COMMAND={},We.CAN_UNDO_COMMAND={},We.CLEAR_EDITOR_COMMAND={},We.CLEAR_HISTORY_COMMAND={},We.CLICK_COMMAND=t,We.COMMAND_PRIORITY_CRITICAL=4,We.COMMAND_PRIORITY_EDITOR=0,We.COMMAND_PRIORITY_HIGH=3,We.COMMAND_PRIORITY_LOW=1,We.COMMAND_PRIORITY_NORMAL=2,We.CONTROLLED_TEXT_INSERTION_COMMAND=d,We.COPY_COMMAND=Ee,We.CUT_COMMAND=de,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=T,We.DELETE_WORD_COMMAND=_,We.DEPRECATED_$computeGridMap=function(o,i,a){let g=[],C=null,x=null;o=o.getChildren();for(let Ye=0;Ye<o.length;Ye++){var D=o[Ye];Bl(D)||Y(108);var Q=D.getChildren();D=0;for(let Xe of Q){for(Yi(Xe)||Y(109);g[Ye]!==void 0&&g[Ye][D]!==void 0;)D++;Q=Ye;var ge=D,Ae=Xe;let Ke={cell:Ae,startColumn:ge,startRow:Q},Pe=Ae.__rowSpan,pt=Ae.__colSpan;for(let wt=0;wt<Pe;wt++){g[Q+wt]===void 0&&(g[Q+wt]=[]);for(let Ft=0;Ft<pt;Ft++)g[Q+wt][ge+Ft]=Ke}i.is(Ae)&&(C=Ke),a.is(Ae)&&(x=Ke),D+=Xe.__colSpan}}return C===null&&Y(110),x===null&&Y(111),[g,C,x]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,a]=zs(o);o=a.getChildren();let g=o.length;var C=o[0].getChildren().length;let x=Array(g);for(var D=0;D<g;D++)x[D]=Array(C);for(C=0;C<g;C++){D=o[C].getChildren();let Q=0;for(let ge=0;ge<D.length;ge++){for(;x[C][Q];)Q++;let Ae=D[ge],Ye=Ae.__rowSpan||1,Xe=Ae.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)x[C+Ke][Q+Pe]=Ae;if(i===Ae)return{colSpan:Xe,columnIndex:Q,rowIndex:C,rowSpan:Ye};Q+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=zs,We.DEPRECATED_$isGridCellNode=Yi,We.DEPRECATED_$isGridNode=Fl,We.DEPRECATED_$isGridRowNode=Bl,We.DEPRECATED_GridCellNode=Do,We.DEPRECATED_GridNode=$l,We.DEPRECATED_GridRowNode=$a,We.DRAGEND_COMMAND=Se,We.DRAGOVER_COMMAND=Te,We.DRAGSTART_COMMAND=q,We.DROP_COMMAND=z,We.DecoratorNode=So,We.ElementNode=Ui,We.FOCUS_COMMAND=O,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=E,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=l,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Bs,We.KEY_ARROW_DOWN_COMMAND=P,We.KEY_ARROW_LEFT_COMMAND=k,We.KEY_ARROW_RIGHT_COMMAND=m,We.KEY_ARROW_UP_COMMAND=I,We.KEY_BACKSPACE_COMMAND=re,We.KEY_DELETE_COMMAND=ce,We.KEY_DOWN_COMMAND=M,We.KEY_ENTER_COMMAND=H,We.KEY_ESCAPE_COMMAND=te,We.KEY_MODIFIER_COMMAND=oe,We.KEY_SPACE_COMMAND=j,We.KEY_TAB_COMMAND=V,We.LineBreakNode=qr,We.MOVE_TO_END=v,We.MOVE_TO_START=G,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=f,We.ParagraphNode=Hr,We.REDO_COMMAND=w,We.REMOVE_TEXT_COMMAND=p,We.RootNode=cr,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=K,We.TabNode=cs,We.TextNode=Fi,We.UNDO_COMMAND=S,We.createCommand=function(){return{}},We.createEditor=function(o){var i=o||{},a=On,g=i.theme||{};let C=o===void 0?a:i.parentEditor||null,x=i.disableEvents||!1,D=Gi(),Q=i.namespace||(C!==null?C._config.namespace:Ze()),ge=i.editorState,Ae=[cr,Fi,qr,cs,Hr,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,o===void 0&&a!==null)o=a._nodes;else for(o=new Map,a=0;a<Ae.length;a++){let Pe=Ae[a],pt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,pt=Ke.with,Ke=Ke.withKlass||null);let wt=Pe.getType(),Ft=Pe.transform(),zt=new Set;Ft!==null&&zt.add(Ft),o.set(wt,{exportDOM:Xe&&Xe.export?Xe.export.get(Pe):void 0,klass:Pe,replace:pt,replaceWithKlass:Ke,transforms:zt})}return g=new Vs(D,C,o,{disableEvents:x,namespace:Q,theme:g},Ye||console.error,js(o,Xe?Xe.import:void 0),i),ge!==void 0&&(g._pendingEditorState=ge,g._dirtyType=2),g},We.getNearestEditorFromDOMNode=vt,We.isCurrentlyReadOnlyMode=hs,We.isHTMLAnchorElement=function(o){return fo(o)&&o.tagName==="A"},We.isHTMLElement=fo,We.isSelectionCapturedInDecoratorInput=it,We.isSelectionWithinEditor=st,We}var Jc,Lf;function Yt(){return Lf||(Lf=1,Jc=process.env.NODE_ENV==="development"?BN():HN()),Jc}var If;function WN(){if(If)return qc;If=1;var e=qn(),t=Yt(),n=nt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const f={tag:"history-merge"};function p({initialConfig:T,children:E}){const S=n.useMemo(()=>{const{theme:w,namespace:M,editor__DEPRECATED:m,nodes:v,onError:k,editorState:G,html:I}=T,P=e.createLexicalComposerContext(null,w);let H=m||null;if(H===null){const j=t.createEditor({editable:T.editable,html:I,namespace:M,nodes:v,onError:re=>k(re,j),theme:w});_(j,G),H=j}return[H,P]},[]);return d(()=>{const w=T.editable,[M]=S;M.setEditable(w!==void 0?w:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:S},E)}function _(T,E){if(E!==null){if(E===void 0)T.update(()=>{const S=t.$getRoot();if(S.isEmpty()){const w=t.$createParagraphNode();S.append(w);const M=r?document.activeElement:null;(t.$getSelection()!==null||M!==null&&M===T.getRootElement())&&w.select()}},f);else if(E!==null)switch(typeof E){case"string":{const S=T.parseEditorState(E);T.setEditorState(S,f);break}case"object":{T.setEditorState(E,f);break}case"function":{T.update(()=>{t.$getRoot().isEmpty()&&E(T)},f);break}}}}return qc.LexicalComposer=p,qc}var Xc={},kf;function KN(){if(kf)return Xc;kf=1;var e=qn(),t=Yt(),n=nt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var l=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function f(p,_){if(_!==null){if(_===void 0)p.update(()=>{var T=t.$getRoot();if(T.isEmpty()){let E=t.$createParagraphNode();T.append(E),T=r?document.activeElement:null,(t.$getSelection()!==null||T!==null&&T===p.getRootElement())&&E.select()}},d);else if(_!==null)switch(typeof _){case"string":let T=p.parseEditorState(_);p.setEditorState(T,d);break;case"object":p.setEditorState(_,d);break;case"function":p.update(()=>{t.$getRoot().isEmpty()&&_(p)},d)}}}return Xc.LexicalComposer=function({initialConfig:p,children:_}){let T=n.useMemo(()=>{const{theme:E,namespace:S,editor__DEPRECATED:w,nodes:M,onError:m,editorState:v,html:k}=p,G=e.createLexicalComposerContext(null,E);let I=w||null;if(I===null){const P=t.createEditor({editable:p.editable,html:k,namespace:S,nodes:M,onError:H=>m(H,P),theme:E});f(P,v),I=P}return[I,G]},[]);return l(()=>{let E=p.editable,[S]=T;S.setEditable(E!==void 0?E:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:T},_)},Xc}const zN=process.env.NODE_ENV==="development"?WN():KN();var UN=zN,Qc={},eu,Pf;function GN(){if(Pf)return eu;Pf=1;var e=qn(),t=nt,l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function d(_){const[T]=e.useLexicalComposerContext(),E=t.useMemo(()=>_(T),[T,_]),S=t.useRef(E.initialValueFn()),[w,M]=t.useState(S.current);return l(()=>{const{initialValueFn:m,subscribe:v}=E,k=m();return S.current!==k&&(S.current=k,M(k)),v(G=>{S.current=G,M(G)})},[E,_]),w}function f(_){return{initialValueFn:()=>_.isEditable(),subscribe:T=>_.registerEditableListener(T)}}function p(){return d(f)}return eu=p,eu}var tu,$f;function YN(){if($f)return tu;$f=1;var e=qn(),t=nt,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function r(d){let[f]=e.useLexicalComposerContext(),p=t.useMemo(()=>d(f),[f,d]),_=t.useRef(p.initialValueFn()),[T,E]=t.useState(_.current);return n(()=>{let{initialValueFn:S,subscribe:w}=p,M=S();return _.current!==M&&(_.current=M,E(M)),w(m=>{_.current=m,E(m)})},[p,d]),T}function l(d){return{initialValueFn:()=>d.isEditable(),subscribe:f=>d.registerEditableListener(f)}}return tu=function(){return r(l)},tu}var nu,Ff;function Cp(){return Ff||(Ff=1,nu=process.env.NODE_ENV==="development"?GN():YN()),nu}var Xi={},Bf;function jN(){if(Bf)return Xi;Bf=1;var e=Yt();function t(_,T){let E=_.getFirstChild(),S=0;e:for(;E!==null;){if(e.$isElementNode(E)){const m=E.getFirstChild();if(m!==null){E=m;continue}}else if(e.$isTextNode(E)){const m=E.getTextContentSize();if(S+m>T)return{node:E,offset:T-S};S+=m}const w=E.getNextSibling();if(w!==null){E=w;continue}let M=E.getParent();for(;M!==null;){const m=M.getNextSibling();if(m!==null){E=m;continue e}M=M.getParent()}break}return null}function n(_,T=!0){if(_)return!1;let E=l();return T&&(E=E.trim()),E===""}function r(_,T){return()=>n(_,T)}function l(){return e.$getRoot().getTextContent()}function d(_){if(!n(_,!1))return!1;const E=e.$getRoot().getChildren(),S=E.length;if(S>1)return!1;for(let w=0;w<S;w++){const M=E[w];if(e.$isDecoratorNode(M))return!1;if(e.$isElementNode(M)){if(!e.$isParagraphNode(M)||M.__indent!==0)return!1;const m=M.getChildren(),v=m.length;for(let k=0;k<v;k++){const G=m[w];if(!e.$isTextNode(G))return!1}}}return!0}function f(_){return()=>d(_)}function p(_,T,E,S){const w=P=>P instanceof E,M=P=>{const H=e.$createTextNode(P.getTextContent());H.setFormat(P.getFormat()),P.replace(H)},m=P=>P.getLatest().__mode,v=P=>{if(!P.isSimpleText())return;const H=P.getPreviousSibling();let j=P.getTextContent(),re=P,te;if(e.$isTextNode(H)){const ce=H.getTextContent(),V=ce+j,z=T(V);if(w(H))if(z===null||m(H)!==0){M(H);return}else{const q=z.end-ce.length;if(q>0){const Te=j.slice(0,q),Se=ce+Te;if(H.select(),H.setTextContent(Se),q===j.length)P.remove();else{const Ee=j.slice(q);P.setTextContent(Ee)}return}}else if(z===null||z.start<ce.length)return}for(;;){te=T(j);let ce=te===null?"":j.slice(te.end);if(j=ce,ce===""){const q=re.getNextSibling();if(e.$isTextNode(q)){ce=re.getTextContent()+q.getTextContent();const Te=T(ce);if(Te===null){w(q)?M(q):q.markDirty();return}else if(Te.start!==0)return}}else{const q=T(ce);if(q!==null&&q.start===0)return}if(te===null)return;if(te.start===0&&e.$isTextNode(H)&&H.isTextEntity())continue;let V;te.start===0?[V,re]=re.splitText(te.end):[,V,re]=re.splitText(te.start,te.end);const z=S(V);if(z.setFormat(V.getFormat()),V.replace(z),re==null)return}},k=P=>{const H=P.getTextContent(),j=T(H);if(j===null||j.start!==0){M(P);return}if(H.length>j.end){P.splitText(j.end);return}const re=P.getPreviousSibling();e.$isTextNode(re)&&re.isTextEntity()&&(M(re),M(P));const te=P.getNextSibling();e.$isTextNode(te)&&te.isTextEntity()&&(M(te),w(P)&&M(P))},G=_.registerNodeTransform(e.TextNode,v),I=_.registerNodeTransform(E,k);return[G,I]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=f,Xi.$findTextIntersectionFromCharacters=t,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=l,Xi.registerLexicalTextEntity=p,Xi}var Qi={},Hf;function VN(){if(Hf)return Qi;Hf=1;var e=Yt();function t(l,d=!0){return l?!1:(l=n(),d&&(l=l.trim()),l==="")}function n(){return e.$getRoot().getTextContent()}function r(l){if(!t(l,!1))return!1;l=e.$getRoot().getChildren();let d=l.length;if(1<d)return!1;for(let p=0;p<d;p++){var f=l[p];if(e.$isDecoratorNode(f))return!1;if(e.$isElementNode(f)){if(!e.$isParagraphNode(f)||f.__indent!==0)return!1;f=f.getChildren();let _=f.length;for(let T=0;T<_;T++)if(!e.$isTextNode(f[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(l){return()=>r(l)},Qi.$findTextIntersectionFromCharacters=function(l,d){var f=l.getFirstChild();l=0;e:for(;f!==null;){if(e.$isElementNode(f)){var p=f.getFirstChild();if(p!==null){f=p;continue}}else if(e.$isTextNode(f)){if(p=f.getTextContentSize(),l+p>d)return{node:f,offset:d-l};l+=p}if(p=f.getNextSibling(),p!==null)f=p;else{for(f=f.getParent();f!==null;){if(p=f.getNextSibling(),p!==null){f=p;continue e}f=f.getParent()}break}}return null},Qi.$isRootTextContentEmpty=t,Qi.$isRootTextContentEmptyCurry=function(l,d){return()=>t(l,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(l,d,f,p){let _=E=>{const S=e.$createTextNode(E.getTextContent());S.setFormat(E.getFormat()),E.replace(S)},T=l.registerNodeTransform(e.TextNode,E=>{if(E.isSimpleText()){var S=E.getPreviousSibling(),w=E.getTextContent(),M=E;if(e.$isTextNode(S)){var m=S.getTextContent(),v=d(m+w);if(S instanceof f){if(v===null||S.getLatest().__mode!==0){_(S);return}if(v=v.end-m.length,0<v){M=w.slice(0,v),M=m+M,S.select(),S.setTextContent(M),v===w.length?E.remove():(S=w.slice(v),E.setTextContent(S));return}}else if(v===null||v.start<m.length)return}for(;;){if(E=d(w),w=v=E===null?"":w.slice(E.end),v===""){if(m=M.getNextSibling(),e.$isTextNode(m)){if(v=M.getTextContent()+m.getTextContent(),v=d(v),v===null){m instanceof f?_(m):m.markDirty();break}else if(v.start!==0)break}}else if(m=d(v),m!==null&&m.start===0)break;if(E===null)break;if(E.start===0&&e.$isTextNode(S)&&S.isTextEntity())continue;let k;if(E.start===0?[k,M]=M.splitText(E.end):[,k,M]=M.splitText(E.start,E.end),E=p(k),E.setFormat(k.getFormat()),k.replace(E),M==null)break}}});return l=l.registerNodeTransform(f,E=>{var S=E.getTextContent();const w=d(S);w===null||w.start!==0?_(E):S.length>w.end?E.splitText(w.end):(S=E.getPreviousSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),_(E)),S=E.getNextSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),E instanceof f&&_(E)))}),[T,l]},Qi}var ru,Wf;function Ep(){return Wf||(Wf=1,ru=process.env.NODE_ENV==="development"?jN():VN()),ru}var Sn={},jn={},Kf;function qN(){if(Kf)return jn;Kf=1;var e=Yt();const t=new Map;function n(K){let O=K;for(;O!=null;){if(O.nodeType===Node.TEXT_NODE)return O;O=O.firstChild}return null}function r(K){const O=K.parentNode;if(O==null)throw new Error("Should never happen");return[O,Array.from(O.childNodes).indexOf(K)]}function l(K,O,Z,oe,Y){const W=O.getKey(),J=oe.getKey(),R=document.createRange();let U=K.getElementByKey(W),X=K.getElementByKey(J),fe=Z,_e=Y;if(e.$isTextNode(O)&&(U=n(U)),e.$isTextNode(oe)&&(X=n(X)),O===void 0||oe===void 0||U===null||X===null)return null;U.nodeName==="BR"&&([U,fe]=r(U)),X.nodeName==="BR"&&([X,_e]=r(X));const B=U.firstChild;U===X&&B!=null&&B.nodeName==="BR"&&fe===0&&_e===0&&(_e=1);try{R.setStart(U,fe),R.setEnd(X,_e)}catch{return null}return R.collapsed&&(fe!==_e||W!==J)&&(R.setStart(X,_e),R.setEnd(U,fe)),R}function d(K,O){const Z=K.getRootElement();if(Z===null)return[];const oe=Z.getBoundingClientRect(),Y=getComputedStyle(Z),W=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),J=Array.from(O.getClientRects());let R=J.length;J.sort((X,fe)=>{const _e=X.top-fe.top;return Math.abs(_e)<=3?X.left-fe.left:_e});let U;for(let X=0;X<R;X++){const fe=J[X],_e=U&&U.top<=fe.top&&U.top+U.height>fe.top&&U.left+U.width>fe.left,B=fe.width+W===oe.width;if(_e||B){J.splice(X--,1),R--;continue}U=fe}return J}function f(K){const O={},Z=K.split(";");for(const oe of Z)if(oe!==""){const[Y,W]=oe.split(/:([^]+)/);Y&&W&&(O[Y.trim()]=W.trim())}return O}function p(K){let O=t.get(K);return O===void 0&&(O=f(K),t.set(K,O)),Object.freeze(O),O}function _(K){let O="";for(const Z in K)Z&&(O+=`${Z}: ${K[Z]};`);return O}function T(K,O){return K.__first=O.__first,K.__last=O.__last,K.__size=O.__size,K.__format=O.__format,K.__indent=O.__indent,K.__dir=O.__dir,K}function E(K,O){return K.__format=O.__format,K.__style=O.__style,K.__mode=O.__mode,K.__detail=O.__detail,K}function S(K){const Z=K.constructor.clone(K);return Z.__parent=K.__parent,Z.__next=K.__next,Z.__prev=K.__prev,e.$isElementNode(K)&&e.$isElementNode(Z)?T(Z,K):e.$isTextNode(K)&&e.$isTextNode(Z)?E(Z,K):Z}function w(K,O){if(O.isSelected(K)&&!O.isSegmented()&&!O.isToken()&&e.$INTERNAL_isPointSelection(K)){const Z=K.anchor.getNode(),oe=K.focus.getNode(),Y=O.is(Z),W=O.is(oe);if(Y||W){const J=K.isBackward(),[R,U]=K.getCharacterOffsets(),X=Z.is(oe),fe=O.is(J?oe:Z),_e=O.is(J?Z:oe);let B=0,A;if(X)B=R>U?U:R,A=R>U?R:U;else if(fe)B=J?U:R,A=void 0;else if(_e){const F=J?R:U;B=0,A=F}return O.__text=O.__text.slice(B,A),O}}return O}function M(K){if(K.type==="text")return K.offset===K.getNode().getTextContentSize();const O=K.getNode();if(!e.$isElementNode(O))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return K.offset===O.getChildrenSize()}function m(K,O,Z){let oe=O.getNode(),Y=Z;if(e.$isElementNode(oe)){const W=oe.getDescendantByIndex(O.offset);W!==null&&(oe=W)}for(;Y>0&&oe!==null;){if(e.$isElementNode(oe)){const X=oe.getLastDescendant();X!==null&&(oe=X)}let W=oe.getPreviousSibling(),J=0;if(W===null){let X=oe.getParentOrThrow(),fe=X.getPreviousSibling();for(;fe===null;){if(X=X.getParent(),X===null){W=null;break}fe=X.getPreviousSibling()}X!==null&&(J=X.isInline()?0:2,W=fe)}let R=oe.getTextContent();R===""&&e.$isElementNode(oe)&&!oe.isInline()&&(R=`
|
|
71
71
|
|
|
72
|
-
`);const U=R.length;if(!e.$isTextNode(oe)||Y>=U){const X=oe.getParent();oe.remove(),X!=null&&X.getChildrenSize()===0&&!e.$isRootNode(X)&&X.remove(),Y-=U+J,oe=W}else{const X=oe.getKey(),fe=K.getEditorState().read(()=>{const A=e.$getNodeByKey(X);return e.$isTextNode(A)&&A.isSimpleText()?A.getTextContent():null}),_e=U-Y,B=R.slice(0,_e);if(fe!==null&&fe!==R){const A=e.$getPreviousSelection();let F=oe;if(oe.isSimpleText())oe.setTextContent(fe);else{const se=e.$createTextNode(fe);oe.replace(se),F=se}if(e.$isRangeSelection(A)&&A.isCollapsed()){const se=A.anchor.offset;F.select(se,se)}}else if(oe.isSimpleText()){const A=O.key===X;let F=O.offset;F<Y&&(F=U);const se=A?F-Y:0,ye=A?F:_e;if(A&&se===0){const[De]=oe.splitText(se,ye);De.remove()}else{const[,De]=oe.splitText(se,ye);De.remove()}}else{const A=e.$createTextNode(B);oe.replace(A)}Y=0}}}function v(K){const O=K.getStyle(),Z=f(O);t.set(O,Z)}function k(K,O){const Z=p("getStyle"in K?K.getStyle():K.style),oe=Object.entries(O).reduce((W,[J,R])=>(R===null?delete W[J]:W[J]=R,W),{...Z}),Y=_(oe);K.setStyle(Y),t.set(Y,oe)}function G(K,O){const Z=K.getNodes(),oe=Z.length;if(!e.$isRangeSelection(K)){const ne=e.$createRangeSelection(),ue=ne.anchor,be=ne.focus;for(let Ne=0;Ne<oe;Ne++){const Re=Z[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ue.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),G(e.$normalizeSelection__EXPERIMENTAL(ne),O))}e.$setSelection(K);return}const Y=oe-1;let W=Z[0],J=Z[Y];if(K.isCollapsed()&&e.$isRangeSelection(K)){k(K,O);return}const R=K.anchor,U=K.focus,fe=W.getTextContent().length,_e=U.offset;let B=R.offset;const A=R.isBefore(U);let F=A?B:_e,se=A?_e:B;const ye=A?R.type:U.type,De=A?U.type:R.type,ee=A?U.key:R.key;if(e.$isTextNode(W)&&F===fe){const ne=W.getNextSibling();e.$isTextNode(ne)&&(B=0,F=0,W=ne)}if(Z.length===1){if(e.$isTextNode(W)){if(F=ye==="element"?0:B>_e?_e:B,se=De==="element"?fe:B>_e?B:_e,F===se)return;if(F===0&&se===fe)k(W,O),W.select(F,se);else{const ne=W.splitText(F,se),ue=F===0?ne[0]:ne[1];k(ue,O),ue.select(0,se-F)}}}else{if(e.$isTextNode(W)&&F<W.getTextContentSize()&&(F!==0&&(W=W.splitText(F)[1],F=0,R.set(W.getKey(),F,"text")),k(W,O)),e.$isTextNode(J)){const ue=J.getTextContent().length;J.__key!==ee&&se!==0&&(se=ue),se!==ue&&([J]=J.splitText(se)),se!==0&&k(J,O)}for(let ne=1;ne<Y;ne++){const ue=Z[ne],be=ue.getKey();e.$isTextNode(ue)&&be!==W.getKey()&&be!==J.getKey()&&!ue.isToken()&&k(ue,O)}}}function I(K,O){if(K.anchor.key==="root"){const Y=O(),W=e.$getRoot(),J=W.getFirstChild();J?J.replace(Y,!0):W.append(Y);return}const Z=K.getNodes(),oe=de(K.anchor.getNode(),Ee);oe&&Z.indexOf(oe)===-1&&Z.push(oe);for(let Y=0;Y<Z.length;Y++){const W=Z[Y];if(!Ee(W))continue;if(!e.$isElementNode(W))throw Error("Expected block node to be an ElementNode");const J=O();J.setFormat(W.getFormatType()),J.setIndent(W.getIndent()),W.replace(J,!0)}}function P(K){return K.getNode().isAttached()}function H(K){let O=K;for(;O!==null&&!e.$isRootOrShadowRoot(O);){const Z=O.getLatest(),oe=O.getParent();Z.getChildrenSize()===0&&O.remove(!0),O=oe}}function V(K,O,Z=null){const oe=K.getNodes(),Y=oe.length,W=K.anchor;if(Y===0||Y===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){const U=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),X=U.getChildren();let fe=O();fe.setFormat(U.getFormatType()),fe.setIndent(U.getIndent()),X.forEach(_e=>fe.append(_e)),Z&&(fe=Z.append(fe)),U.replace(fe);return}let J=null,R=[];for(let U=0;U<Y;U++){const X=oe[U];e.$isRootOrShadowRoot(X)?(re(K,R,R.length,O,Z),R=[],J=X):J===null||J!==null&&e.$hasAncestor(X,J)?R.push(X):(re(K,R,R.length,O,Z),R=[X])}re(K,R,R.length,O,Z)}function re(K,O,Z,oe,Y=null){if(O.length===0)return;const W=O[0],J=new Map,R=[];let U=e.$isElementNode(W)?W:W.getParentOrThrow();U.isInline()&&(U=U.getParentOrThrow());let X=!1;for(;U!==null;){const F=U.getPreviousSibling();if(F!==null){U=F,X=!0;break}if(U=U.getParentOrThrow(),e.$isRootOrShadowRoot(U))break}const fe=new Set;for(let F=0;F<Z;F++){const se=O[F];e.$isElementNode(se)&&se.getChildrenSize()===0&&fe.add(se.getKey())}const _e=new Set;for(let F=0;F<Z;F++){const se=O[F];let ye=se.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(se)&&!_e.has(se.getKey())){const De=ye.getKey();if(J.get(De)===void 0){const ee=oe();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),R.push(ee),J.set(De,ee),ye.getChildren().forEach(ne=>{ee.append(ne),_e.add(ne.getKey()),e.$isElementNode(ne)&&ne.getChildrenKeys().forEach(ue=>_e.add(ue))}),H(ye)}}else if(fe.has(se.getKey())){if(!e.$isElementNode(se))throw Error("Expected node in emptyElements to be an ElementNode");const De=oe();De.setFormat(se.getFormatType()),De.setIndent(se.getIndent()),R.push(De),se.remove(!0)}}if(Y!==null)for(let F=0;F<R.length;F++){const se=R[F];Y.append(se)}let B=null;if(e.$isRootOrShadowRoot(U))if(X)if(Y!==null)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se)}else{const F=U.getFirstChild();if(e.$isElementNode(F)&&(U=F),F===null)if(Y)U.append(Y);else for(let se=0;se<R.length;se++){const ye=R[se];U.append(ye),B=ye}else if(Y!==null)F.insertBefore(Y);else for(let se=0;se<R.length;se++){const ye=R[se];F.insertBefore(ye),B=ye}}else if(Y)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se),B=se}const A=e.$getPreviousSelection();e.$isRangeSelection(A)&&P(A.anchor)&&P(A.focus)?e.$setSelection(A.clone()):B!==null?B.selectEnd():K.dirty=!0}function te(K,O){const Z=e.$getAdjacentNode(K.focus,O);return e.$isDecoratorNode(Z)&&!Z.isIsolated()||e.$isElementNode(Z)&&!Z.isInline()&&!Z.canBeEmpty()}function ce(K,O,Z,oe){K.modify(O?"extend":"move",Z,oe)}function j(K){const O=K.anchor.getNode();return(e.$isRootNode(O)?O:O.getParentOrThrow()).getDirection()==="rtl"}function z(K,O,Z){const oe=j(K);ce(K,O,Z?!oe:oe,"character")}function q(K){const O=K.anchor,Z=K.focus,W=O.getNode().getTopLevelElementOrThrow().getParentOrThrow();let J=W.getFirstDescendant(),R=W.getLastDescendant(),U="element",X="element",fe=0;e.$isTextNode(J)?U="text":!e.$isElementNode(J)&&J!==null&&(J=J.getParentOrThrow()),e.$isTextNode(R)?(X="text",fe=R.getTextContentSize()):!e.$isElementNode(R)&&R!==null&&(R=R.getParentOrThrow()),J&&R&&(O.set(J.getKey(),0,U),Z.set(R.getKey(),fe,X))}function Te(K,O,Z){const oe=K.getStyle(),Y=p(oe);return Y!==null&&Y[O]||Z}function Se(K,O,Z=""){let oe=null;const Y=K.getNodes(),W=K.anchor,J=K.focus,R=K.isBackward(),U=R?J.offset:W.offset,X=R?J.getNode():W.getNode();if(K.isCollapsed()&&K.style!==""){const fe=K.style,_e=p(fe);if(_e!==null&&O in _e)return _e[O]}for(let fe=0;fe<Y.length;fe++){const _e=Y[fe];if(!(fe!==0&&U===0&&_e.is(X))&&e.$isTextNode(_e)){const B=Te(_e,O,Z);if(oe===null)oe=B;else if(oe!==B){oe="";break}}}return oe===null?Z:oe}function Ee(K){if(e.$isDecoratorNode(K)&&!K.isInline())return!0;if(!e.$isElementNode(K)||e.$isRootOrShadowRoot(K))return!1;const O=K.getFirstChild(),Z=O===null||e.$isLineBreakNode(O)||e.$isTextNode(O)||O.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&Z}function de(K,O){let Z=K;for(;Z!==null&&Z.getParent()!==null&&!O(Z);)Z=Z.getParentOrThrow();return O(Z)?Z:null}return Vn.$addNodeStyle=v,Vn.$cloneWithProperties=S,Vn.$getSelectionStyleValueForProperty=Se,Vn.$isAtNodeEnd=M,Vn.$isParentElementRTL=j,Vn.$moveCaretSelection=ce,Vn.$moveCharacter=z,Vn.$patchStyleText=G,Vn.$selectAll=q,Vn.$setBlocksType=I,Vn.$shouldOverrideDefaultCharacterSelection=te,Vn.$sliceSelectedTextNodeContent=w,Vn.$wrapNodes=V,Vn.createDOMRange=l,Vn.createRectsFromDOMRange=d,Vn.getStyleObjectFromCSS=p,Vn.trimTextContentFromAnchor=m,Vn}var jn={},zf;function ZN(){if(zf)return jn;zf=1;var e=Yt();let t=new Map;function n(m){for(;m!=null;){if(m.nodeType===Node.TEXT_NODE)return m;m=m.firstChild}return null}function r(m){let v=m.parentNode;if(v==null)throw Error("Should never happen");return[v,Array.from(v.childNodes).indexOf(m)]}function l(m){let v={};m=m.split(";");for(let k of m)if(k!==""){let[G,I]=k.split(/:([^]+)/);G&&I&&(v[G.trim()]=I.trim())}return v}function d(m){let v=t.get(m);return v===void 0&&(v=l(m),t.set(m,v)),v}function f(m){let v="";for(let k in m)k&&(v+=`${k}: ${m[k]};`);return v}function p(m,v){var k=d("getStyle"in m?m.getStyle():m.style);v=Object.entries(v).reduce((G,[I,P])=>(P===null?delete G[I]:G[I]=P,G),{...k}),k=f(v),m.setStyle(k),t.set(k,v)}function _(m,v){var k=m.getNodes(),G=k.length;if(e.$isRangeSelection(m)){--G;var I=k[0],P=k[G];if(m.isCollapsed()&&e.$isRangeSelection(m))p(m,v);else{var H=m.anchor,V=m.focus,re=I.getTextContent().length,te=V.offset,ce=H.offset,j=H.isBefore(V),z=j?ce:te;m=j?te:ce;var q=j?H.type:V.type,Te=j?V.type:H.type;if(V=j?V.key:H.key,e.$isTextNode(I)&&z===re&&(j=I.getNextSibling(),e.$isTextNode(j)&&(z=ce=0,I=j)),k.length===1)e.$isTextNode(I)&&(z=q==="element"?0:ce>te?te:ce,m=Te==="element"?re:ce>te?ce:te,z!==m&&(z===0&&m===re?(p(I,v),I.select(z,m)):(k=I.splitText(z,m),k=z===0?k[0]:k[1],p(k,v),k.select(0,m-z))));else for(e.$isTextNode(I)&&z<I.getTextContentSize()&&(z!==0&&(I=I.splitText(z)[1],z=0,H.set(I.getKey(),z,"text")),p(I,v)),e.$isTextNode(P)&&(z=P.getTextContent().length,P.__key!==V&&m!==0&&(m=z),m!==z&&([P]=P.splitText(m)),m!==0&&p(P,v)),m=1;m<G;m++)z=k[m],H=z.getKey(),e.$isTextNode(z)&&H!==I.getKey()&&H!==P.getKey()&&!z.isToken()&&p(z,v)}}else{for(I=e.$createRangeSelection(),P=I.anchor,z=I.focus,H=0;H<G;H++)re=k[H],e.DEPRECATED_$isGridCellNode(re)&&(P.set(re.getKey(),0,"element"),z.set(re.getKey(),re.getChildrenSize(),"element"),_(e.$normalizeSelection__EXPERIMENTAL(I),v));e.$setSelection(m)}}function T(m){for(;m!==null&&!e.$isRootOrShadowRoot(m);){let v=m.getLatest(),k=m.getParent();v.getChildrenSize()===0&&m.remove(!0),m=k}}function E(m,v,k,G,I=null){if(v.length!==0){var P=v[0],H=new Map,V=[];P=e.$isElementNode(P)?P:P.getParentOrThrow(),P.isInline()&&(P=P.getParentOrThrow());for(var re=!1;P!==null;){var te=P.getPreviousSibling();if(te!==null){P=te,re=!0;break}if(P=P.getParentOrThrow(),e.$isRootOrShadowRoot(P))break}te=new Set;for(var ce=0;ce<k;ce++){var j=v[ce];e.$isElementNode(j)&&j.getChildrenSize()===0&&te.add(j.getKey())}var z=new Set;for(ce=0;ce<k;ce++){j=v[ce];var q=j.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&e.$isLeafNode(j)&&!z.has(j.getKey())){if(j=q.getKey(),H.get(j)===void 0){let Te=G();Te.setFormat(q.getFormatType()),Te.setIndent(q.getIndent()),V.push(Te),H.set(j,Te),q.getChildren().forEach(Se=>{Te.append(Se),z.add(Se.getKey()),e.$isElementNode(Se)&&Se.getChildrenKeys().forEach(Ee=>z.add(Ee))}),T(q)}}else if(te.has(j.getKey())){if(!e.$isElementNode(j))throw Error("Expected node in emptyElements to be an ElementNode");q=G(),q.setFormat(j.getFormatType()),q.setIndent(j.getIndent()),V.push(q),j.remove(!0)}}if(I!==null)for(v=0;v<V.length;v++)I.append(V[v]);if(v=null,e.$isRootOrShadowRoot(P))if(re)if(I!==null)P.insertAfter(I);else for(I=V.length-1;0<=I;I--)P.insertAfter(V[I]);else if(re=P.getFirstChild(),e.$isElementNode(re)&&(P=re),re===null)if(I)P.append(I);else for(I=0;I<V.length;I++)re=V[I],P.append(re),v=re;else if(I!==null)re.insertBefore(I);else for(P=0;P<V.length;P++)I=V[P],re.insertBefore(I),v=I;else if(I)P.insertAfter(I);else for(I=V.length-1;0<=I;I--)re=V[I],P.insertAfter(re),v=re;V=e.$getPreviousSelection(),e.$isRangeSelection(V)&&V.anchor.getNode().isAttached()&&V.focus.getNode().isAttached()?e.$setSelection(V.clone()):v!==null?v.selectEnd():m.dirty=!0}}function S(m,v,k,G){m.modify(v?"extend":"move",k,G)}function w(m){return m=m.anchor.getNode(),(e.$isRootNode(m)?m:m.getParentOrThrow()).getDirection()==="rtl"}function M(m){if(e.$isDecoratorNode(m)&&!m.isInline())return!0;if(!e.$isElementNode(m)||e.$isRootOrShadowRoot(m))return!1;var v=m.getFirstChild();return v=v===null||e.$isLineBreakNode(v)||e.$isTextNode(v)||v.isInline(),!m.isInline()&&m.canBeEmpty()!==!1&&v}return jn.$addNodeStyle=function(m){m=m.getStyle();let v=l(m);t.set(m,v)},jn.$cloneWithProperties=function(m){let v=m.constructor.clone(m);return v.__parent=m.__parent,v.__next=m.__next,v.__prev=m.__prev,e.$isElementNode(m)&&e.$isElementNode(v)?(v.__first=m.__first,v.__last=m.__last,v.__size=m.__size,v.__format=m.__format,v.__indent=m.__indent,v.__dir=m.__dir,v):(e.$isTextNode(m)&&e.$isTextNode(v)&&(v.__format=m.__format,v.__style=m.__style,v.__mode=m.__mode,v.__detail=m.__detail),v)},jn.$getSelectionStyleValueForProperty=function(m,v,k=""){let G=null,I=m.getNodes();var P=m.anchor,H=m.focus,V=m.isBackward();let re=V?H.offset:P.offset;if(P=V?H.getNode():P.getNode(),m.isCollapsed()&&m.style!==""&&(m=d(m.style),m!==null&&v in m))return m[v];for(m=0;m<I.length;m++){var te=I[m];if((m===0||re!==0||!te.is(P))&&e.$isTextNode(te)){if(H=v,V=k,te=te.getStyle(),te=d(te),H=te!==null&&te[H]||V,G===null)G=H;else if(G!==H){G="";break}}}return G===null?k:G},jn.$isAtNodeEnd=function(m){if(m.type==="text")return m.offset===m.getNode().getTextContentSize();let v=m.getNode();if(!e.$isElementNode(v))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return m.offset===v.getChildrenSize()},jn.$isParentElementRTL=w,jn.$moveCaretSelection=S,jn.$moveCharacter=function(m,v,k){let G=w(m);S(m,v,k?!G:G,"character")},jn.$patchStyleText=_,jn.$selectAll=function(m){let v=m.anchor;m=m.focus;var k=v.getNode().getTopLevelElementOrThrow().getParentOrThrow();let G=k.getFirstDescendant();k=k.getLastDescendant();let I="element",P="element",H=0;e.$isTextNode(G)?I="text":e.$isElementNode(G)||G===null||(G=G.getParentOrThrow()),e.$isTextNode(k)?(P="text",H=k.getTextContentSize()):e.$isElementNode(k)||k===null||(k=k.getParentOrThrow()),G&&k&&(v.set(G.getKey(),0,I),m.set(k.getKey(),H,P))},jn.$setBlocksType=function(m,v){if(m.anchor.key==="root"){v=v();var k=e.$getRoot();(m=k.getFirstChild())?m.replace(v,!0):k.append(v)}else{for(k=m.getNodes(),m=m.anchor.getNode();m!==null&&m.getParent()!==null&&!M(m);)m=m.getParentOrThrow();for((m=M(m)?m:null)&&k.indexOf(m)===-1&&k.push(m),m=0;m<k.length;m++){let G=k[m];if(!M(G))continue;if(!e.$isElementNode(G))throw Error("Expected block node to be an ElementNode");let I=v();I.setFormat(G.getFormatType()),I.setIndent(G.getIndent()),G.replace(I,!0)}}},jn.$shouldOverrideDefaultCharacterSelection=function(m,v){return m=e.$getAdjacentNode(m.focus,v),e.$isDecoratorNode(m)&&!m.isIsolated()||e.$isElementNode(m)&&!m.isInline()&&!m.canBeEmpty()},jn.$sliceSelectedTextNodeContent=function(m,v){if(v.isSelected(m)&&!v.isSegmented()&&!v.isToken()&&e.$INTERNAL_isPointSelection(m)){var k=m.anchor.getNode(),G=m.focus.getNode(),I=v.is(k),P=v.is(G);if(I||P){I=m.isBackward();let[H,V]=m.getCharacterOffsets();m=k.is(G),P=v.is(I?G:k),G=v.is(I?k:G),k=0;let re;m?(k=H>V?V:H,re=H>V?H:V):P?(k=I?V:H,re=void 0):G&&(I=I?H:V,k=0,re=I),v.__text=v.__text.slice(k,re)}}return v},jn.$wrapNodes=function(m,v,k=null){var G=m.getNodes();let I=G.length;var P=m.anchor;if(I===0||I===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){m=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),G=m.getChildren();let V=v();V.setFormat(m.getFormatType()),V.setIndent(m.getIndent()),G.forEach(re=>V.append(re)),k&&(V=k.append(V)),m.replace(V)}else{P=null;var H=[];for(let V=0;V<I;V++){let re=G[V];e.$isRootOrShadowRoot(re)?(E(m,H,H.length,v,k),H=[],P=re):P===null||P!==null&&e.$hasAncestor(re,P)?H.push(re):(E(m,H,H.length,v,k),H=[re])}E(m,H,H.length,v,k)}},jn.createDOMRange=function(m,v,k,G,I){let P=v.getKey(),H=G.getKey(),V=document.createRange(),re=m.getElementByKey(P);if(m=m.getElementByKey(H),e.$isTextNode(v)&&(re=n(re)),e.$isTextNode(G)&&(m=n(m)),v===void 0||G===void 0||re===null||m===null)return null;re.nodeName==="BR"&&([re,k]=r(re)),m.nodeName==="BR"&&([m,I]=r(m)),v=re.firstChild,re===m&&v!=null&&v.nodeName==="BR"&&k===0&&I===0&&(I=1);try{V.setStart(re,k),V.setEnd(m,I)}catch{return null}return!V.collapsed||k===I&&P===H||(V.setStart(m,I),V.setEnd(re,k)),V},jn.createRectsFromDOMRange=function(m,v){var k=m.getRootElement();if(k===null)return[];m=k.getBoundingClientRect(),k=getComputedStyle(k),k=parseFloat(k.paddingLeft)+parseFloat(k.paddingRight),v=Array.from(v.getClientRects());let G=v.length;v.sort((P,H)=>{let V=P.top-H.top;return 3>=Math.abs(V)?P.left-H.left:V});let I;for(let P=0;P<G;P++){let H=v[P],V=H.width+k===m.width;I&&I.top<=H.top&&I.top+I.height>H.top&&I.left+I.width>H.left||V?(v.splice(P--,1),G--):I=H}return v},jn.getStyleObjectFromCSS=d,jn.trimTextContentFromAnchor=function(m,v,k){let G=v.getNode();if(e.$isElementNode(G)){var I=G.getDescendantByIndex(v.offset);I!==null&&(G=I)}for(;0<k&&G!==null;){e.$isElementNode(G)&&(I=G.getLastDescendant(),I!==null&&(G=I));var P=G.getPreviousSibling(),H=0;if(P===null){I=G.getParentOrThrow();for(var V=I.getPreviousSibling();V===null;){if(I=I.getParent(),I===null){P=null;break}V=I.getPreviousSibling()}I!==null&&(H=I.isInline()?0:2,P=V)}if(V=G.getTextContent(),V===""&&e.$isElementNode(G)&&!G.isInline()&&(V=`
|
|
72
|
+
`);const U=R.length;if(!e.$isTextNode(oe)||Y>=U){const X=oe.getParent();oe.remove(),X!=null&&X.getChildrenSize()===0&&!e.$isRootNode(X)&&X.remove(),Y-=U+J,oe=W}else{const X=oe.getKey(),fe=K.getEditorState().read(()=>{const A=e.$getNodeByKey(X);return e.$isTextNode(A)&&A.isSimpleText()?A.getTextContent():null}),_e=U-Y,B=R.slice(0,_e);if(fe!==null&&fe!==R){const A=e.$getPreviousSelection();let F=oe;if(oe.isSimpleText())oe.setTextContent(fe);else{const se=e.$createTextNode(fe);oe.replace(se),F=se}if(e.$isRangeSelection(A)&&A.isCollapsed()){const se=A.anchor.offset;F.select(se,se)}}else if(oe.isSimpleText()){const A=O.key===X;let F=O.offset;F<Y&&(F=U);const se=A?F-Y:0,ye=A?F:_e;if(A&&se===0){const[De]=oe.splitText(se,ye);De.remove()}else{const[,De]=oe.splitText(se,ye);De.remove()}}else{const A=e.$createTextNode(B);oe.replace(A)}Y=0}}}function v(K){const O=K.getStyle(),Z=f(O);t.set(O,Z)}function k(K,O){const Z=p("getStyle"in K?K.getStyle():K.style),oe=Object.entries(O).reduce((W,[J,R])=>(R===null?delete W[J]:W[J]=R,W),{...Z}),Y=_(oe);K.setStyle(Y),t.set(Y,oe)}function G(K,O){const Z=K.getNodes(),oe=Z.length;if(!e.$isRangeSelection(K)){const ne=e.$createRangeSelection(),ue=ne.anchor,be=ne.focus;for(let Ne=0;Ne<oe;Ne++){const Re=Z[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ue.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),G(e.$normalizeSelection__EXPERIMENTAL(ne),O))}e.$setSelection(K);return}const Y=oe-1;let W=Z[0],J=Z[Y];if(K.isCollapsed()&&e.$isRangeSelection(K)){k(K,O);return}const R=K.anchor,U=K.focus,fe=W.getTextContent().length,_e=U.offset;let B=R.offset;const A=R.isBefore(U);let F=A?B:_e,se=A?_e:B;const ye=A?R.type:U.type,De=A?U.type:R.type,ee=A?U.key:R.key;if(e.$isTextNode(W)&&F===fe){const ne=W.getNextSibling();e.$isTextNode(ne)&&(B=0,F=0,W=ne)}if(Z.length===1){if(e.$isTextNode(W)){if(F=ye==="element"?0:B>_e?_e:B,se=De==="element"?fe:B>_e?B:_e,F===se)return;if(F===0&&se===fe)k(W,O),W.select(F,se);else{const ne=W.splitText(F,se),ue=F===0?ne[0]:ne[1];k(ue,O),ue.select(0,se-F)}}}else{if(e.$isTextNode(W)&&F<W.getTextContentSize()&&(F!==0&&(W=W.splitText(F)[1],F=0,R.set(W.getKey(),F,"text")),k(W,O)),e.$isTextNode(J)){const ue=J.getTextContent().length;J.__key!==ee&&se!==0&&(se=ue),se!==ue&&([J]=J.splitText(se)),se!==0&&k(J,O)}for(let ne=1;ne<Y;ne++){const ue=Z[ne],be=ue.getKey();e.$isTextNode(ue)&&be!==W.getKey()&&be!==J.getKey()&&!ue.isToken()&&k(ue,O)}}}function I(K,O){if(K.anchor.key==="root"){const Y=O(),W=e.$getRoot(),J=W.getFirstChild();J?J.replace(Y,!0):W.append(Y);return}const Z=K.getNodes(),oe=de(K.anchor.getNode(),Ee);oe&&Z.indexOf(oe)===-1&&Z.push(oe);for(let Y=0;Y<Z.length;Y++){const W=Z[Y];if(!Ee(W))continue;if(!e.$isElementNode(W))throw Error("Expected block node to be an ElementNode");const J=O();J.setFormat(W.getFormatType()),J.setIndent(W.getIndent()),W.replace(J,!0)}}function P(K){return K.getNode().isAttached()}function H(K){let O=K;for(;O!==null&&!e.$isRootOrShadowRoot(O);){const Z=O.getLatest(),oe=O.getParent();Z.getChildrenSize()===0&&O.remove(!0),O=oe}}function j(K,O,Z=null){const oe=K.getNodes(),Y=oe.length,W=K.anchor;if(Y===0||Y===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){const U=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),X=U.getChildren();let fe=O();fe.setFormat(U.getFormatType()),fe.setIndent(U.getIndent()),X.forEach(_e=>fe.append(_e)),Z&&(fe=Z.append(fe)),U.replace(fe);return}let J=null,R=[];for(let U=0;U<Y;U++){const X=oe[U];e.$isRootOrShadowRoot(X)?(re(K,R,R.length,O,Z),R=[],J=X):J===null||J!==null&&e.$hasAncestor(X,J)?R.push(X):(re(K,R,R.length,O,Z),R=[X])}re(K,R,R.length,O,Z)}function re(K,O,Z,oe,Y=null){if(O.length===0)return;const W=O[0],J=new Map,R=[];let U=e.$isElementNode(W)?W:W.getParentOrThrow();U.isInline()&&(U=U.getParentOrThrow());let X=!1;for(;U!==null;){const F=U.getPreviousSibling();if(F!==null){U=F,X=!0;break}if(U=U.getParentOrThrow(),e.$isRootOrShadowRoot(U))break}const fe=new Set;for(let F=0;F<Z;F++){const se=O[F];e.$isElementNode(se)&&se.getChildrenSize()===0&&fe.add(se.getKey())}const _e=new Set;for(let F=0;F<Z;F++){const se=O[F];let ye=se.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(se)&&!_e.has(se.getKey())){const De=ye.getKey();if(J.get(De)===void 0){const ee=oe();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),R.push(ee),J.set(De,ee),ye.getChildren().forEach(ne=>{ee.append(ne),_e.add(ne.getKey()),e.$isElementNode(ne)&&ne.getChildrenKeys().forEach(ue=>_e.add(ue))}),H(ye)}}else if(fe.has(se.getKey())){if(!e.$isElementNode(se))throw Error("Expected node in emptyElements to be an ElementNode");const De=oe();De.setFormat(se.getFormatType()),De.setIndent(se.getIndent()),R.push(De),se.remove(!0)}}if(Y!==null)for(let F=0;F<R.length;F++){const se=R[F];Y.append(se)}let B=null;if(e.$isRootOrShadowRoot(U))if(X)if(Y!==null)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se)}else{const F=U.getFirstChild();if(e.$isElementNode(F)&&(U=F),F===null)if(Y)U.append(Y);else for(let se=0;se<R.length;se++){const ye=R[se];U.append(ye),B=ye}else if(Y!==null)F.insertBefore(Y);else for(let se=0;se<R.length;se++){const ye=R[se];F.insertBefore(ye),B=ye}}else if(Y)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se),B=se}const A=e.$getPreviousSelection();e.$isRangeSelection(A)&&P(A.anchor)&&P(A.focus)?e.$setSelection(A.clone()):B!==null?B.selectEnd():K.dirty=!0}function te(K,O){const Z=e.$getAdjacentNode(K.focus,O);return e.$isDecoratorNode(Z)&&!Z.isIsolated()||e.$isElementNode(Z)&&!Z.isInline()&&!Z.canBeEmpty()}function ce(K,O,Z,oe){K.modify(O?"extend":"move",Z,oe)}function V(K){const O=K.anchor.getNode();return(e.$isRootNode(O)?O:O.getParentOrThrow()).getDirection()==="rtl"}function z(K,O,Z){const oe=V(K);ce(K,O,Z?!oe:oe,"character")}function q(K){const O=K.anchor,Z=K.focus,W=O.getNode().getTopLevelElementOrThrow().getParentOrThrow();let J=W.getFirstDescendant(),R=W.getLastDescendant(),U="element",X="element",fe=0;e.$isTextNode(J)?U="text":!e.$isElementNode(J)&&J!==null&&(J=J.getParentOrThrow()),e.$isTextNode(R)?(X="text",fe=R.getTextContentSize()):!e.$isElementNode(R)&&R!==null&&(R=R.getParentOrThrow()),J&&R&&(O.set(J.getKey(),0,U),Z.set(R.getKey(),fe,X))}function Te(K,O,Z){const oe=K.getStyle(),Y=p(oe);return Y!==null&&Y[O]||Z}function Se(K,O,Z=""){let oe=null;const Y=K.getNodes(),W=K.anchor,J=K.focus,R=K.isBackward(),U=R?J.offset:W.offset,X=R?J.getNode():W.getNode();if(K.isCollapsed()&&K.style!==""){const fe=K.style,_e=p(fe);if(_e!==null&&O in _e)return _e[O]}for(let fe=0;fe<Y.length;fe++){const _e=Y[fe];if(!(fe!==0&&U===0&&_e.is(X))&&e.$isTextNode(_e)){const B=Te(_e,O,Z);if(oe===null)oe=B;else if(oe!==B){oe="";break}}}return oe===null?Z:oe}function Ee(K){if(e.$isDecoratorNode(K)&&!K.isInline())return!0;if(!e.$isElementNode(K)||e.$isRootOrShadowRoot(K))return!1;const O=K.getFirstChild(),Z=O===null||e.$isLineBreakNode(O)||e.$isTextNode(O)||O.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&Z}function de(K,O){let Z=K;for(;Z!==null&&Z.getParent()!==null&&!O(Z);)Z=Z.getParentOrThrow();return O(Z)?Z:null}return jn.$addNodeStyle=v,jn.$cloneWithProperties=S,jn.$getSelectionStyleValueForProperty=Se,jn.$isAtNodeEnd=M,jn.$isParentElementRTL=V,jn.$moveCaretSelection=ce,jn.$moveCharacter=z,jn.$patchStyleText=G,jn.$selectAll=q,jn.$setBlocksType=I,jn.$shouldOverrideDefaultCharacterSelection=te,jn.$sliceSelectedTextNodeContent=w,jn.$wrapNodes=j,jn.createDOMRange=l,jn.createRectsFromDOMRange=d,jn.getStyleObjectFromCSS=p,jn.trimTextContentFromAnchor=m,jn}var Vn={},zf;function ZN(){if(zf)return Vn;zf=1;var e=Yt();let t=new Map;function n(m){for(;m!=null;){if(m.nodeType===Node.TEXT_NODE)return m;m=m.firstChild}return null}function r(m){let v=m.parentNode;if(v==null)throw Error("Should never happen");return[v,Array.from(v.childNodes).indexOf(m)]}function l(m){let v={};m=m.split(";");for(let k of m)if(k!==""){let[G,I]=k.split(/:([^]+)/);G&&I&&(v[G.trim()]=I.trim())}return v}function d(m){let v=t.get(m);return v===void 0&&(v=l(m),t.set(m,v)),v}function f(m){let v="";for(let k in m)k&&(v+=`${k}: ${m[k]};`);return v}function p(m,v){var k=d("getStyle"in m?m.getStyle():m.style);v=Object.entries(v).reduce((G,[I,P])=>(P===null?delete G[I]:G[I]=P,G),{...k}),k=f(v),m.setStyle(k),t.set(k,v)}function _(m,v){var k=m.getNodes(),G=k.length;if(e.$isRangeSelection(m)){--G;var I=k[0],P=k[G];if(m.isCollapsed()&&e.$isRangeSelection(m))p(m,v);else{var H=m.anchor,j=m.focus,re=I.getTextContent().length,te=j.offset,ce=H.offset,V=H.isBefore(j),z=V?ce:te;m=V?te:ce;var q=V?H.type:j.type,Te=V?j.type:H.type;if(j=V?j.key:H.key,e.$isTextNode(I)&&z===re&&(V=I.getNextSibling(),e.$isTextNode(V)&&(z=ce=0,I=V)),k.length===1)e.$isTextNode(I)&&(z=q==="element"?0:ce>te?te:ce,m=Te==="element"?re:ce>te?ce:te,z!==m&&(z===0&&m===re?(p(I,v),I.select(z,m)):(k=I.splitText(z,m),k=z===0?k[0]:k[1],p(k,v),k.select(0,m-z))));else for(e.$isTextNode(I)&&z<I.getTextContentSize()&&(z!==0&&(I=I.splitText(z)[1],z=0,H.set(I.getKey(),z,"text")),p(I,v)),e.$isTextNode(P)&&(z=P.getTextContent().length,P.__key!==j&&m!==0&&(m=z),m!==z&&([P]=P.splitText(m)),m!==0&&p(P,v)),m=1;m<G;m++)z=k[m],H=z.getKey(),e.$isTextNode(z)&&H!==I.getKey()&&H!==P.getKey()&&!z.isToken()&&p(z,v)}}else{for(I=e.$createRangeSelection(),P=I.anchor,z=I.focus,H=0;H<G;H++)re=k[H],e.DEPRECATED_$isGridCellNode(re)&&(P.set(re.getKey(),0,"element"),z.set(re.getKey(),re.getChildrenSize(),"element"),_(e.$normalizeSelection__EXPERIMENTAL(I),v));e.$setSelection(m)}}function T(m){for(;m!==null&&!e.$isRootOrShadowRoot(m);){let v=m.getLatest(),k=m.getParent();v.getChildrenSize()===0&&m.remove(!0),m=k}}function E(m,v,k,G,I=null){if(v.length!==0){var P=v[0],H=new Map,j=[];P=e.$isElementNode(P)?P:P.getParentOrThrow(),P.isInline()&&(P=P.getParentOrThrow());for(var re=!1;P!==null;){var te=P.getPreviousSibling();if(te!==null){P=te,re=!0;break}if(P=P.getParentOrThrow(),e.$isRootOrShadowRoot(P))break}te=new Set;for(var ce=0;ce<k;ce++){var V=v[ce];e.$isElementNode(V)&&V.getChildrenSize()===0&&te.add(V.getKey())}var z=new Set;for(ce=0;ce<k;ce++){V=v[ce];var q=V.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&e.$isLeafNode(V)&&!z.has(V.getKey())){if(V=q.getKey(),H.get(V)===void 0){let Te=G();Te.setFormat(q.getFormatType()),Te.setIndent(q.getIndent()),j.push(Te),H.set(V,Te),q.getChildren().forEach(Se=>{Te.append(Se),z.add(Se.getKey()),e.$isElementNode(Se)&&Se.getChildrenKeys().forEach(Ee=>z.add(Ee))}),T(q)}}else if(te.has(V.getKey())){if(!e.$isElementNode(V))throw Error("Expected node in emptyElements to be an ElementNode");q=G(),q.setFormat(V.getFormatType()),q.setIndent(V.getIndent()),j.push(q),V.remove(!0)}}if(I!==null)for(v=0;v<j.length;v++)I.append(j[v]);if(v=null,e.$isRootOrShadowRoot(P))if(re)if(I!==null)P.insertAfter(I);else for(I=j.length-1;0<=I;I--)P.insertAfter(j[I]);else if(re=P.getFirstChild(),e.$isElementNode(re)&&(P=re),re===null)if(I)P.append(I);else for(I=0;I<j.length;I++)re=j[I],P.append(re),v=re;else if(I!==null)re.insertBefore(I);else for(P=0;P<j.length;P++)I=j[P],re.insertBefore(I),v=I;else if(I)P.insertAfter(I);else for(I=j.length-1;0<=I;I--)re=j[I],P.insertAfter(re),v=re;j=e.$getPreviousSelection(),e.$isRangeSelection(j)&&j.anchor.getNode().isAttached()&&j.focus.getNode().isAttached()?e.$setSelection(j.clone()):v!==null?v.selectEnd():m.dirty=!0}}function S(m,v,k,G){m.modify(v?"extend":"move",k,G)}function w(m){return m=m.anchor.getNode(),(e.$isRootNode(m)?m:m.getParentOrThrow()).getDirection()==="rtl"}function M(m){if(e.$isDecoratorNode(m)&&!m.isInline())return!0;if(!e.$isElementNode(m)||e.$isRootOrShadowRoot(m))return!1;var v=m.getFirstChild();return v=v===null||e.$isLineBreakNode(v)||e.$isTextNode(v)||v.isInline(),!m.isInline()&&m.canBeEmpty()!==!1&&v}return Vn.$addNodeStyle=function(m){m=m.getStyle();let v=l(m);t.set(m,v)},Vn.$cloneWithProperties=function(m){let v=m.constructor.clone(m);return v.__parent=m.__parent,v.__next=m.__next,v.__prev=m.__prev,e.$isElementNode(m)&&e.$isElementNode(v)?(v.__first=m.__first,v.__last=m.__last,v.__size=m.__size,v.__format=m.__format,v.__indent=m.__indent,v.__dir=m.__dir,v):(e.$isTextNode(m)&&e.$isTextNode(v)&&(v.__format=m.__format,v.__style=m.__style,v.__mode=m.__mode,v.__detail=m.__detail),v)},Vn.$getSelectionStyleValueForProperty=function(m,v,k=""){let G=null,I=m.getNodes();var P=m.anchor,H=m.focus,j=m.isBackward();let re=j?H.offset:P.offset;if(P=j?H.getNode():P.getNode(),m.isCollapsed()&&m.style!==""&&(m=d(m.style),m!==null&&v in m))return m[v];for(m=0;m<I.length;m++){var te=I[m];if((m===0||re!==0||!te.is(P))&&e.$isTextNode(te)){if(H=v,j=k,te=te.getStyle(),te=d(te),H=te!==null&&te[H]||j,G===null)G=H;else if(G!==H){G="";break}}}return G===null?k:G},Vn.$isAtNodeEnd=function(m){if(m.type==="text")return m.offset===m.getNode().getTextContentSize();let v=m.getNode();if(!e.$isElementNode(v))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return m.offset===v.getChildrenSize()},Vn.$isParentElementRTL=w,Vn.$moveCaretSelection=S,Vn.$moveCharacter=function(m,v,k){let G=w(m);S(m,v,k?!G:G,"character")},Vn.$patchStyleText=_,Vn.$selectAll=function(m){let v=m.anchor;m=m.focus;var k=v.getNode().getTopLevelElementOrThrow().getParentOrThrow();let G=k.getFirstDescendant();k=k.getLastDescendant();let I="element",P="element",H=0;e.$isTextNode(G)?I="text":e.$isElementNode(G)||G===null||(G=G.getParentOrThrow()),e.$isTextNode(k)?(P="text",H=k.getTextContentSize()):e.$isElementNode(k)||k===null||(k=k.getParentOrThrow()),G&&k&&(v.set(G.getKey(),0,I),m.set(k.getKey(),H,P))},Vn.$setBlocksType=function(m,v){if(m.anchor.key==="root"){v=v();var k=e.$getRoot();(m=k.getFirstChild())?m.replace(v,!0):k.append(v)}else{for(k=m.getNodes(),m=m.anchor.getNode();m!==null&&m.getParent()!==null&&!M(m);)m=m.getParentOrThrow();for((m=M(m)?m:null)&&k.indexOf(m)===-1&&k.push(m),m=0;m<k.length;m++){let G=k[m];if(!M(G))continue;if(!e.$isElementNode(G))throw Error("Expected block node to be an ElementNode");let I=v();I.setFormat(G.getFormatType()),I.setIndent(G.getIndent()),G.replace(I,!0)}}},Vn.$shouldOverrideDefaultCharacterSelection=function(m,v){return m=e.$getAdjacentNode(m.focus,v),e.$isDecoratorNode(m)&&!m.isIsolated()||e.$isElementNode(m)&&!m.isInline()&&!m.canBeEmpty()},Vn.$sliceSelectedTextNodeContent=function(m,v){if(v.isSelected(m)&&!v.isSegmented()&&!v.isToken()&&e.$INTERNAL_isPointSelection(m)){var k=m.anchor.getNode(),G=m.focus.getNode(),I=v.is(k),P=v.is(G);if(I||P){I=m.isBackward();let[H,j]=m.getCharacterOffsets();m=k.is(G),P=v.is(I?G:k),G=v.is(I?k:G),k=0;let re;m?(k=H>j?j:H,re=H>j?H:j):P?(k=I?j:H,re=void 0):G&&(I=I?H:j,k=0,re=I),v.__text=v.__text.slice(k,re)}}return v},Vn.$wrapNodes=function(m,v,k=null){var G=m.getNodes();let I=G.length;var P=m.anchor;if(I===0||I===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){m=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),G=m.getChildren();let j=v();j.setFormat(m.getFormatType()),j.setIndent(m.getIndent()),G.forEach(re=>j.append(re)),k&&(j=k.append(j)),m.replace(j)}else{P=null;var H=[];for(let j=0;j<I;j++){let re=G[j];e.$isRootOrShadowRoot(re)?(E(m,H,H.length,v,k),H=[],P=re):P===null||P!==null&&e.$hasAncestor(re,P)?H.push(re):(E(m,H,H.length,v,k),H=[re])}E(m,H,H.length,v,k)}},Vn.createDOMRange=function(m,v,k,G,I){let P=v.getKey(),H=G.getKey(),j=document.createRange(),re=m.getElementByKey(P);if(m=m.getElementByKey(H),e.$isTextNode(v)&&(re=n(re)),e.$isTextNode(G)&&(m=n(m)),v===void 0||G===void 0||re===null||m===null)return null;re.nodeName==="BR"&&([re,k]=r(re)),m.nodeName==="BR"&&([m,I]=r(m)),v=re.firstChild,re===m&&v!=null&&v.nodeName==="BR"&&k===0&&I===0&&(I=1);try{j.setStart(re,k),j.setEnd(m,I)}catch{return null}return!j.collapsed||k===I&&P===H||(j.setStart(m,I),j.setEnd(re,k)),j},Vn.createRectsFromDOMRange=function(m,v){var k=m.getRootElement();if(k===null)return[];m=k.getBoundingClientRect(),k=getComputedStyle(k),k=parseFloat(k.paddingLeft)+parseFloat(k.paddingRight),v=Array.from(v.getClientRects());let G=v.length;v.sort((P,H)=>{let j=P.top-H.top;return 3>=Math.abs(j)?P.left-H.left:j});let I;for(let P=0;P<G;P++){let H=v[P],j=H.width+k===m.width;I&&I.top<=H.top&&I.top+I.height>H.top&&I.left+I.width>H.left||j?(v.splice(P--,1),G--):I=H}return v},Vn.getStyleObjectFromCSS=d,Vn.trimTextContentFromAnchor=function(m,v,k){let G=v.getNode();if(e.$isElementNode(G)){var I=G.getDescendantByIndex(v.offset);I!==null&&(G=I)}for(;0<k&&G!==null;){e.$isElementNode(G)&&(I=G.getLastDescendant(),I!==null&&(G=I));var P=G.getPreviousSibling(),H=0;if(P===null){I=G.getParentOrThrow();for(var j=I.getPreviousSibling();j===null;){if(I=I.getParent(),I===null){P=null;break}j=I.getPreviousSibling()}I!==null&&(H=I.isInline()?0:2,P=j)}if(j=G.getTextContent(),j===""&&e.$isElementNode(G)&&!G.isInline()&&(j=`
|
|
73
73
|
|
|
74
|
-
`),I=V.length,!e.$isTextNode(G)||k>=I)V=G.getParent(),G.remove(),V==null||V.getChildrenSize()!==0||e.$isRootNode(V)||V.remove(),k-=I+H,G=P;else{let re=G.getKey();H=m.getEditorState().read(()=>{const ce=e.$getNodeByKey(re);return e.$isTextNode(ce)&&ce.isSimpleText()?ce.getTextContent():null}),P=I-k;let te=V.slice(0,P);H!==null&&H!==V?(k=e.$getPreviousSelection(),I=G,G.isSimpleText()?G.setTextContent(H):(I=e.$createTextNode(H),G.replace(I)),e.$isRangeSelection(k)&&k.isCollapsed()&&(k=k.anchor.offset,I.select(k,k))):G.isSimpleText()?(H=v.key===re,V=v.offset,V<k&&(V=I),k=H?V-k:0,I=H?V:P,H&&k===0?([k]=G.splitText(k,I),k.remove()):([,k]=G.splitText(k,I),k.remove())):(k=e.$createTextNode(te),G.replace(k)),k=0}}},jn}var iu,Uf;function vs(){return Uf||(Uf=1,iu=process.env.NODE_ENV==="development"?qN():ZN()),iu}var Gf;function JN(){if(Gf)return Sn;Gf=1;var e=vs(),t=Yt();function n(...te){return()=>{te.forEach(ce=>ce())}}function r(te){return`${te}px`}const l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(te,ce,j){let z=null,q=null,Te=null,Se=[];const Ee=document.createElement("div");function de(){if(z===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:oe,top:Y}=z.getBoundingClientRect(),W=q,J=e.createRectsFromDOMRange(te,ce);Ee.isConnected||W.append(Ee);let R=!1;for(let U=0;U<J.length;U++){const X=J[U],fe=Se[U]||document.createElement("div"),_e=fe.style;_e.position!=="absolute"&&(_e.position="absolute",R=!0);const B=r(X.left-oe);_e.left!==B&&(_e.left=B,R=!0);const A=r(X.top-Y);_e.top!==A&&(fe.style.top=A,R=!0);const F=r(X.width);_e.width!==F&&(fe.style.width=F,R=!0);const se=r(X.height);_e.height!==se&&(fe.style.height=se,R=!0),fe.parentNode!==Ee&&(Ee.append(fe),R=!0),Se[U]=fe}for(;Se.length>J.length;)Se.pop();R&&j(Se)}function K(){q=null,z=null,Te!==null&&Te.disconnect(),Te=null,Ee.remove();for(const oe of Se)oe.remove();Se=[]}function O(){const oe=te.getRootElement();if(oe===null)return K();const Y=oe.parentElement;if(!(Y instanceof HTMLElement))return K();K(),z=oe,q=Y,Te=new MutationObserver(W=>{const J=te.getRootElement(),R=J&&J.parentElement;if(J!==z||R!==q)return O();for(const U of W)if(!Ee.contains(U.target))return de()}),Te.observe(Y,l),de()}const Z=te.registerRootListener(O);return()=>{Z(),K()}}function f(te,ce){let j=null,z=null,q=null,Te=null,Se=()=>{};function Ee(de){de.read(()=>{const K=t.$getSelection();if(!t.$isRangeSelection(K)){j=null,z=null,q=null,Te=null,Se(),Se=()=>{};return}const{anchor:O,focus:Z}=K,oe=O.getNode(),Y=oe.getKey(),W=O.offset,J=Z.getNode(),R=J.getKey(),U=Z.offset,X=te.getElementByKey(Y),fe=te.getElementByKey(R),_e=j===null||X===null||W!==z||Y!==j.getKey()||oe!==j&&(!(j instanceof t.TextNode)||oe.updateDOM(j,X,te._config)),B=q===null||fe===null||U!==Te||R!==q.getKey()||J!==q&&(!(q instanceof t.TextNode)||J.updateDOM(q,fe,te._config));if(_e||B){const A=te.getElementByKey(O.getNode().getKey()),F=te.getElementByKey(Z.getNode().getKey());if(A!==null&&F!==null&&A.tagName==="SPAN"&&F.tagName==="SPAN"){const se=document.createRange();let ye,De,ee,ne;Z.isBefore(O)?(ye=F,De=Z.offset,ee=A,ne=O.offset):(ye=A,De=O.offset,ee=F,ne=Z.offset);const ue=ye.firstChild;if(ue===null)throw Error("Expected text node to be first child of span");const be=ee.firstChild;if(be===null)throw Error("Expected text node to be first child of span");se.setStart(ue,De),se.setEnd(be,ne),Se(),Se=d(te,se,Ne=>{for(const Re of Ne){const ke=Re.style;ke.background!=="Highlight"&&(ke.background="Highlight"),ke.color!=="HighlightText"&&(ke.color="HighlightText"),ke.zIndex!=="-1"&&(ke.zIndex="-1"),ke.pointerEvents!=="none"&&(ke.pointerEvents="none"),ke.marginTop!==r(-1.5)&&(ke.marginTop=r(-1.5)),ke.paddingTop!==r(4)&&(ke.paddingTop=r(4)),ke.paddingBottom!==r(0)&&(ke.paddingBottom=r(0))}ce!==void 0&&ce(Ne)})}}j=oe,z=W,q=J,Te=U})}return Ee(te.getEditorState()),n(te.registerUpdateListener(({editorState:de})=>Ee(de)),Se,()=>{Se()})}function p(te,...ce){ce.forEach(j=>{if(typeof j=="string"){const z=j.split(" ").filter(q=>q!=="");te.classList.add(...z)}})}function _(te,...ce){ce.forEach(j=>{typeof j=="string"&&te.classList.remove(...j.split(" "))})}function T(te,ce){for(const j of ce)if(te.type.startsWith(j))return!0;return!1}function E(te,ce){const j=te[Symbol.iterator]();return new Promise((z,q)=>{const Te=[],Se=()=>{const{done:Ee,value:de}=j.next();if(Ee)return z(Te);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const O=K.result;typeof O=="string"&&Te.push({file:de,result:O}),Se()}),T(de,ce)?K.readAsDataURL(de):Se()};Se()})}function S(te,ce){const j=[],z=(te||t.$getRoot()).getLatest(),q=ce||(t.$isElementNode(z)?z.getLastDescendant():z);let Te=z,Se=w(Te);for(;Te!==null&&!Te.is(q);)if(j.push({depth:Se,node:Te}),t.$isElementNode(Te)&&Te.getChildrenSize()>0)Te=Te.getFirstChild(),Se++;else{let Ee=null;for(;Ee===null&&Te!==null;)Ee=Te.getNextSibling(),Ee===null?(Te=Te.getParent(),Se--):Te=Ee}return Te!==null&&Te.is(q)&&j.push({depth:Se,node:Te}),j}function w(te){let ce=te,j=0;for(;(ce=ce.getParent())!==null;)j++;return j}function M(te,ce){let j=te;for(;j!=null;){if(j instanceof ce)return j;j=j.getParent()}return null}function m(te){const ce=v(te,j=>t.$isElementNode(j)&&!j.isInline());if(!t.$isElementNode(ce))throw Error(`Expected node ${te.__key} to have closest block element node.`);return ce}const v=(te,ce)=>{let j=te;for(;j!==t.$getRoot()&&j!=null;){if(ce(j))return j;j=j.getParent()}return null};function k(te,ce,j,z){const q=Ee=>Ee instanceof ce,Te=Ee=>{const de=Ee.getChildren();for(let Z=0;Z<de.length;Z++){const oe=de[Z];if(q(oe))return null}let K=Ee,O=Ee;for(;K!==null;)if(O=K,K=K.getParent(),q(K))return{child:O,parent:K};return null},Se=Ee=>{const de=Te(Ee);if(de!==null){const{child:K,parent:O}=de;if(K.is(Ee)){z(O,Ee);const Z=K.getNextSiblings(),oe=Z.length;if(O.insertAfter(K),oe!==0){const Y=j(O);K.insertAfter(Y);for(let W=0;W<oe;W++)Y.append(Z[W])}!O.canBeEmpty()&&O.getChildrenSize()===0&&O.remove()}}};return te.registerNodeTransform(ce,Se)}function G(te,ce){const z=new Map,q=te._pendingEditorState;for(const[Se,Ee]of ce._nodeMap){const de=e.$cloneWithProperties(Ee);if(t.$isTextNode(de)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");de.__text=Ee.__text}z.set(Se,de)}q&&(q._nodeMap=z),te._dirtyType=2;const Te=ce._selection;t.$setSelection(Te===null?null:Te.clone())}function I(te){const ce=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ce)){const{focus:j}=ce,z=j.getNode(),q=j.offset;if(t.$isRootOrShadowRoot(z)){const Te=z.getChildAtIndex(q);Te==null?z.append(te):Te.insertBefore(te),te.selectNext()}else{let Te,Se;t.$isTextNode(z)?(Te=z.getParentOrThrow(),Se=z.getIndexWithinParent(),q>0&&(Se+=1,z.splitText(q))):(Te=z,Se=q);const[,Ee]=t.$splitNode(Te,Se);Ee.insertBefore(te),Ee.selectStart()}}else{if(ce!=null){const z=ce.getNodes();z[z.length-1].getTopLevelElementOrThrow().insertAfter(te)}else t.$getRoot().append(te);const j=t.$createParagraphNode();te.insertAfter(j),j.select()}return te.getLatest()}function P(te,ce){const j=ce();return te.replace(j),j.append(te),j}function H(te,ce){return te!==null?Object.getPrototypeOf(te).constructor.name===ce.name:!1}function V(te,ce){const j=[];for(let z=0;z<te.length;z++){const q=ce(te[z]);q!==null&&j.push(q)}return j}function re(te,ce){const j=te.getFirstChild();j!==null?j.insertBefore(ce):te.append(ce)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=S,Sn.$filter=V,Sn.$findMatchingParent=v,Sn.$getNearestBlockElementAncestorOrThrow=m,Sn.$getNearestNodeOfType=M,Sn.$insertFirst=re,Sn.$insertNodeToNearestRoot=I,Sn.$restoreEditorState=G,Sn.$wrapNodeInElement=P,Sn.addClassNamesToElement=p,Sn.isMimeType=T,Sn.markSelection=f,Sn.mediaFileReader=E,Sn.mergeRegister=n,Sn.objectKlassEquals=H,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=k,Sn.removeClassNamesFromElement=_,Sn}var wn={},Yf;function XN(){if(Yf)return wn;Yf=1;var e=vs(),t=Yt();function n(_){let T=new URLSearchParams;T.append("code",_);for(let E=1;E<arguments.length;E++)T.append("v",arguments[E]);throw Error(`Minified Lexical error #${_}; visit https://lexical.dev/docs/error?${T} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(..._){return()=>{_.forEach(T=>T())}}let l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(_,T,E){function S(){if(m===null)throw Error("Unexpected null rootDOMNode");if(v===null)throw Error("Unexpected null parentDOMNode");let{left:H,top:V}=m.getBoundingClientRect();var re=v;let te=e.createRectsFromDOMRange(_,T);I.isConnected||re.append(I),re=!1;for(let z=0;z<te.length;z++){var ce=te[z];let q=G[z]||document.createElement("div"),Te=q.style;Te.position!=="absolute"&&(Te.position="absolute",re=!0);var j=`${ce.left-H}px`;Te.left!==j&&(Te.left=j,re=!0),j=`${ce.top-V}px`,Te.top!==j&&(q.style.top=j,re=!0),j=`${ce.width}px`,Te.width!==j&&(q.style.width=j,re=!0),ce=`${ce.height}px`,Te.height!==ce&&(q.style.height=ce,re=!0),q.parentNode!==I&&(I.append(q),re=!0),G[z]=q}for(;G.length>te.length;)G.pop();re&&E(G)}function w(){m=v=null,k!==null&&k.disconnect(),k=null,I.remove();for(let H of G)H.remove();G=[]}function M(){let H=_.getRootElement();if(H===null)return w();let V=H.parentElement;if(!(V instanceof HTMLElement))return w();w(),m=H,v=V,k=new MutationObserver(re=>{let te=_.getRootElement(),ce=te&&te.parentElement;if(te!==m||ce!==v)return M();for(let j of re)if(!I.contains(j.target))return S()}),k.observe(V,l),S()}let m=null,v=null,k=null,G=[],I=document.createElement("div"),P=_.registerRootListener(M);return()=>{P(),w()}}function f(_,T){for(let E of T)if(_.type.startsWith(E))return!0;return!1}let p=(_,T)=>{for(;_!==t.$getRoot()&&_!=null;){if(T(_))return _;_=_.getParent()}return null};return wn.$splitNode=t.$splitNode,wn.isHTMLAnchorElement=t.isHTMLAnchorElement,wn.isHTMLElement=t.isHTMLElement,wn.$dfs=function(_,T){let E=[];_=(_||t.$getRoot()).getLatest(),T=T||(t.$isElementNode(_)?_.getLastDescendant():_);for(var S=_,w=0;(S=S.getParent())!==null;)w++;for(S=w;_!==null&&!_.is(T);)if(E.push({depth:S,node:_}),t.$isElementNode(_)&&0<_.getChildrenSize())_=_.getFirstChild(),S++;else for(w=null;w===null&&_!==null;)w=_.getNextSibling(),w===null?(_=_.getParent(),S--):_=w;return _!==null&&_.is(T)&&E.push({depth:S,node:_}),E},wn.$filter=function(_,T){let E=[];for(let S=0;S<_.length;S++){let w=T(_[S]);w!==null&&E.push(w)}return E},wn.$findMatchingParent=p,wn.$getNearestBlockElementAncestorOrThrow=function(_){let T=p(_,E=>t.$isElementNode(E)&&!E.isInline());return t.$isElementNode(T)||n(4,_.__key),T},wn.$getNearestNodeOfType=function(_,T){for(;_!=null;){if(_ instanceof T)return _;_=_.getParent()}return null},wn.$insertFirst=function(_,T){let E=_.getFirstChild();E!==null?E.insertBefore(T):_.append(T)},wn.$insertNodeToNearestRoot=function(_){var T=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(T)){var{focus:E}=T;if(T=E.getNode(),E=E.offset,t.$isRootOrShadowRoot(T))E=T.getChildAtIndex(E),E==null?T.append(_):E.insertBefore(_),_.selectNext();else{let S,w;t.$isTextNode(T)?(S=T.getParentOrThrow(),w=T.getIndexWithinParent(),0<E&&(w+=1,T.splitText(E))):(S=T,w=E),[,T]=t.$splitNode(S,w),T.insertBefore(_),T.selectStart()}}else T!=null?(T=T.getNodes(),T[T.length-1].getTopLevelElementOrThrow().insertAfter(_)):t.$getRoot().append(_),T=t.$createParagraphNode(),_.insertAfter(T),T.select();return _.getLatest()},wn.$restoreEditorState=function(_,T){let E=new Map,S=_._pendingEditorState;for(let[w,M]of T._nodeMap){let m=e.$cloneWithProperties(M);if(t.$isTextNode(m)){if(!t.$isTextNode(M))throw Error("Expected node be a TextNode");m.__text=M.__text}E.set(w,m)}S&&(S._nodeMap=E),_._dirtyType=2,_=T._selection,t.$setSelection(_===null?null:_.clone())},wn.$wrapNodeInElement=function(_,T){return T=T(),_.replace(T),T.append(_),T},wn.addClassNamesToElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&(E=E.split(" ").filter(S=>S!==""),_.classList.add(...E))})},wn.isMimeType=f,wn.markSelection=function(_,T){function E(k){k.read(()=>{var G=t.$getSelection();if(t.$isRangeSelection(G)){var{anchor:I,focus:P}=G;G=I.getNode();var H=G.getKey(),V=I.offset,re=P.getNode(),te=re.getKey(),ce=P.offset,j=_.getElementByKey(H),z=_.getElementByKey(te);if(H=S===null||j===null||V!==w||H!==S.getKey()||G!==S&&(!(S instanceof t.TextNode)||G.updateDOM(S,j,_._config)),te=M===null||z===null||ce!==m||te!==M.getKey()||re!==M&&(!(M instanceof t.TextNode)||re.updateDOM(M,z,_._config)),H||te){j=_.getElementByKey(I.getNode().getKey());var q=_.getElementByKey(P.getNode().getKey());if(j!==null&&q!==null&&j.tagName==="SPAN"&&q.tagName==="SPAN"){if(te=document.createRange(),P.isBefore(I)?(H=q,z=P.offset,q=j,j=I.offset):(H=j,z=I.offset,j=P.offset),H=H.firstChild,H===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");te.setStart(H,z),te.setEnd(q,j),v(),v=d(_,te,Te=>{for(let Se of Te){let Ee=Se.style;Ee.background!=="Highlight"&&(Ee.background="Highlight"),Ee.color!=="HighlightText"&&(Ee.color="HighlightText"),Ee.zIndex!=="-1"&&(Ee.zIndex="-1"),Ee.pointerEvents!=="none"&&(Ee.pointerEvents="none"),Ee.marginTop!=="-1.5px"&&(Ee.marginTop="-1.5px"),Ee.paddingTop!=="4px"&&(Ee.paddingTop="4px"),Ee.paddingBottom!=="0px"&&(Ee.paddingBottom="0px")}T!==void 0&&T(Te)})}}S=G,w=V,M=re,m=ce}else m=M=w=S=null,v(),v=()=>{}})}let S=null,w=null,M=null,m=null,v=()=>{};return E(_.getEditorState()),r(_.registerUpdateListener(({editorState:k})=>E(k)),v,()=>{v()})},wn.mediaFileReader=function(_,T){let E=_[Symbol.iterator]();return new Promise((S,w)=>{let M=[],m=()=>{const{done:v,value:k}=E.next();if(v)return S(M);const G=new FileReader;G.addEventListener("error",w),G.addEventListener("load",()=>{const I=G.result;typeof I=="string"&&M.push({file:k,result:I}),m()}),f(k,T)?G.readAsDataURL(k):m()};m()})},wn.mergeRegister=r,wn.objectKlassEquals=function(_,T){return _!==null?Object.getPrototypeOf(_).constructor.name===T.name:!1},wn.positionNodeOnRange=d,wn.registerNestedElementResolver=function(_,T,E,S){return _.registerNodeTransform(T,w=>{e:{for(var M=w.getChildren(),m=0;m<M.length;m++)if(M[m]instanceof T){M=null;break e}for(M=w;M!==null;)if(m=M,M=M.getParent(),M instanceof T){M={child:m,parent:M};break e}M=null}if(M!==null){const{child:v,parent:k}=M;if(v.is(w)){if(S(k,w),w=v.getNextSiblings(),M=w.length,k.insertAfter(v),M!==0){m=E(k),v.insertAfter(m);for(let G=0;G<M;G++)m.append(w[G])}k.canBeEmpty()||k.getChildrenSize()!==0||k.remove()}}})},wn.removeClassNamesFromElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&_.classList.remove(...E.split(" "))})},wn}var su,Vf;function pn(){return Vf||(Vf=1,su=process.env.NODE_ENV==="development"?JN():XN()),su}var ou={},jf;function QN(){if(jf)return ou;jf=1;var e=Yt();function t(n){const r=window.location.origin,l=d=>{if(d.origin!==r)return;const f=n.getRootElement();if(document.activeElement!==f)return;const p=d.data;if(typeof p=="string"){let _;try{_=JSON.parse(p)}catch{return}if(_&&_.protocol==="nuanria_messaging"&&_.type==="request"){const T=_.payload;if(T&&T.functionId==="makeChanges"){const E=T.args;if(E){const[S,w,M,m,v,k]=E;n.update(()=>{const G=e.$getSelection();if(e.$isRangeSelection(G)){const I=G.anchor;let P=I.getNode(),H=0,V=0;if(e.$isTextNode(P)&&S>=0&&w>=0&&(H=S,V=S+w,G.setTextNodeRange(P,H,P,V)),(H!==V||M!=="")&&(G.insertRawText(M),P=I.getNode()),e.$isTextNode(P)){H=m,V=m+v;const re=P.getTextContentSize();H=H>re?re:H,V=V>re?re:V,G.setTextNodeRange(P,H,P,V)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",l,!0),()=>{window.removeEventListener("message",l,!0)}}return ou.registerDragonSupport=t,ou}var lu={},qf;function eC(){if(qf)return lu;qf=1;var e=Yt();return lu.registerDragonSupport=function(t){let n=window.location.origin,r=l=>{if(l.origin===n){var d=t.getRootElement();if(document.activeElement===d&&(d=l.data,typeof d=="string")){try{var f=JSON.parse(d)}catch{return}if(f&&f.protocol==="nuanria_messaging"&&f.type==="request"&&(f=f.payload)&&f.functionId==="makeChanges"&&(f=f.args)){const[p,_,T,E,S]=f;t.update(()=>{const w=e.$getSelection();if(e.$isRangeSelection(w)){var M=w.anchor;let m=M.getNode(),v=0,k=0;e.$isTextNode(m)&&0<=p&&0<=_&&(v=p,k=p+_,w.setTextNodeRange(m,v,m,k)),(v!==k||T!=="")&&(w.insertRawText(T),m=M.getNode()),e.$isTextNode(m)&&(v=E,k=E+S,M=m.getTextContentSize(),v=v>M?M:v,k=k>M?M:k,w.setTextNodeRange(m,v,m,k)),l.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},lu}var au,Zf;function Tp(){return Zf||(Zf=1,au=process.env.NODE_ENV==="development"?QN():eC()),au}var di={},vi={},qa={},Jf;function tC(){if(Jf)return qa;Jf=1;var e=vs(),t=pn(),n=Yt();function r(T,E){const S=E.body?E.body.childNodes:[];let w=[];for(let M=0;M<S.length;M++){const m=S[M];if(!p.has(m.nodeName)){const v=_(m,T);v!==null&&(w=w.concat(v))}}return w}function l(T,E){if(typeof document>"u"||typeof window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const S=document.createElement("div"),M=n.$getRoot().getChildren();for(let m=0;m<M.length;m++){const v=M[m];d(T,v,S,E)}return S.innerHTML}function d(T,E,S,w=null){let M=w!=null?E.isSelected(w):!0;const m=n.$isElementNode(E)&&E.excludeFromCopy("html");let v=E;if(w!==null){let re=e.$cloneWithProperties(E);re=n.$isTextNode(re)&&w!=null?e.$sliceSelectedTextNodeContent(w,re):re,v=re}const k=n.$isElementNode(v)?v.getChildren():[],G=T._nodes.get(v.getType());let I;G&&G.exportDOM!==void 0?I=G.exportDOM(T,v):I=v.exportDOM(T);const{element:P,after:H}=I;if(!P)return!1;const V=document.createDocumentFragment();for(let re=0;re<k.length;re++){const te=k[re],ce=d(T,te,V,w);!M&&n.$isElementNode(E)&&ce&&E.extractWithChild(te,w,"html")&&(M=!0)}if(M&&!m){if(t.isHTMLElement(P)&&P.append(V),S.append(P),H){const re=H.call(v,P);re&&P.replaceWith(re)}}else S.append(V);return M}function f(T,E){const{nodeName:S}=T,w=E._htmlConversions.get(S.toLowerCase());let M=null;if(w!==void 0)for(const m of w){const v=m(T);v!==null&&(M===null||(M.priority||0)<(v.priority||0))&&(M=v)}return M!==null?M.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function _(T,E,S=new Map,w){let M=[];if(p.has(T.nodeName))return M;let m=null;const v=f(T,E),k=v?v(T):null;let G=null;if(k!==null){G=k.after;const H=k.node;if(m=Array.isArray(H)?H[H.length-1]:H,m!==null){for(const[,V]of S)if(m=V(m,w),!m)break;m&&M.push(...Array.isArray(H)?H:[m])}k.forChild!=null&&S.set(T.nodeName,k.forChild)}const I=T.childNodes;let P=[];for(let H=0;H<I.length;H++)P.push(..._(I[H],E,new Map(S),m));return G!=null&&(P=G(P)),m==null?M=M.concat(P):n.$isElementNode(m)&&m.append(...P),M}return qa.$generateHtmlFromNodes=l,qa.$generateNodesFromDOM=r,qa}var Za={},Xf;function nC(){if(Xf)return Za;Xf=1;var e=vs(),t=pn(),n=Yt();function r(f,p,_,T=null){let E=T!=null?p.isSelected(T):!0,S=n.$isElementNode(p)&&p.excludeFromCopy("html");var w=p;T!==null&&(w=e.$cloneWithProperties(p),w=n.$isTextNode(w)&&T!=null?e.$sliceSelectedTextNodeContent(T,w):w);let M=n.$isElementNode(w)?w.getChildren():[];var m=f._nodes.get(w.getType());m=m&&m.exportDOM!==void 0?m.exportDOM(f,w):w.exportDOM(f);let{element:v,after:k}=m;if(!v)return!1;m=document.createDocumentFragment();for(let G=0;G<M.length;G++){let I=M[G],P=r(f,I,m,T);!E&&n.$isElementNode(p)&&P&&p.extractWithChild(I,T,"html")&&(E=!0)}return E&&!S?(t.isHTMLElement(v)&&v.append(m),_.append(v),k&&(f=k.call(w,v))&&v.replaceWith(f)):_.append(m),E}let l=new Set(["STYLE","SCRIPT"]);function d(f,p,_=new Map,T){let E=[];if(l.has(f.nodeName))return E;let S=null;var w,{nodeName:M}=f,m=p._htmlConversions.get(M.toLowerCase());if(M=null,m!==void 0)for(w of m)m=w(f),m!==null&&(M===null||(M.priority||0)<(m.priority||0))&&(M=m);if(M=(w=M!==null?M.conversion:null)?w(f):null,w=null,M!==null){if(w=M.after,m=M.node,S=Array.isArray(m)?m[m.length-1]:m,S!==null){for(var[,v]of _)if(S=v(S,T),!S)break;S&&E.push(...Array.isArray(m)?m:[S])}M.forChild!=null&&_.set(f.nodeName,M.forChild)}for(f=f.childNodes,T=[],v=0;v<f.length;v++)T.push(...d(f[v],p,new Map(_),S));return w!=null&&(T=w(T)),S==null?E=E.concat(T):n.$isElementNode(S)&&S.append(...T),E}return Za.$generateHtmlFromNodes=function(f,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let _=document.createElement("div"),T=n.$getRoot().getChildren();for(let E=0;E<T.length;E++)r(f,T[E],_,p);return _.innerHTML},Za.$generateNodesFromDOM=function(f,p){p=p.body?p.body.childNodes:[];let _=[];for(let E=0;E<p.length;E++){var T=p[E];l.has(T.nodeName)||(T=d(T,f),T!==null&&(_=_.concat(T)))}return _},Za}var cu,Qf;function xp(){return Qf||(Qf=1,cu=process.env.NODE_ENV==="development"?tC():nC()),cu}var eh;function rC(){if(eh)return vi;eh=1;var e=xp(),t=vs(),n=pn(),r=Yt();const l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=P=>l?(P||window).getSelection():null;function f(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?"":e.$generateHtmlFromNodes(P,H)}function p(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?null:JSON.stringify(M(P,H))}function _(P,H){const V=P.getData("text/plain")||P.getData("text/uri-list");V!=null&&H.insertRawText(V)}function T(P,H,V){const re=P.getData("application/x-lexical-editor");if(re)try{const j=JSON.parse(re);if(j.namespace===V._config.namespace&&Array.isArray(j.nodes)){const z=m(j.nodes);return E(V,z,H)}}catch{}const te=P.getData("text/html");if(te)try{const z=new DOMParser().parseFromString(te,"text/html"),q=e.$generateNodesFromDOM(V,z);return E(V,q,H)}catch{}const ce=P.getData("text/plain")||P.getData("text/uri-list");if(ce!=null)if(r.$isRangeSelection(H)){const j=ce.split(/(\r?\n|\t)/);j[j.length-1]===""&&j.pop();for(let z=0;z<j.length;z++){const q=j[z];q===`
|
|
74
|
+
`),I=j.length,!e.$isTextNode(G)||k>=I)j=G.getParent(),G.remove(),j==null||j.getChildrenSize()!==0||e.$isRootNode(j)||j.remove(),k-=I+H,G=P;else{let re=G.getKey();H=m.getEditorState().read(()=>{const ce=e.$getNodeByKey(re);return e.$isTextNode(ce)&&ce.isSimpleText()?ce.getTextContent():null}),P=I-k;let te=j.slice(0,P);H!==null&&H!==j?(k=e.$getPreviousSelection(),I=G,G.isSimpleText()?G.setTextContent(H):(I=e.$createTextNode(H),G.replace(I)),e.$isRangeSelection(k)&&k.isCollapsed()&&(k=k.anchor.offset,I.select(k,k))):G.isSimpleText()?(H=v.key===re,j=v.offset,j<k&&(j=I),k=H?j-k:0,I=H?j:P,H&&k===0?([k]=G.splitText(k,I),k.remove()):([,k]=G.splitText(k,I),k.remove())):(k=e.$createTextNode(te),G.replace(k)),k=0}}},Vn}var iu,Uf;function vs(){return Uf||(Uf=1,iu=process.env.NODE_ENV==="development"?qN():ZN()),iu}var Gf;function JN(){if(Gf)return Sn;Gf=1;var e=vs(),t=Yt();function n(...te){return()=>{te.forEach(ce=>ce())}}function r(te){return`${te}px`}const l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(te,ce,V){let z=null,q=null,Te=null,Se=[];const Ee=document.createElement("div");function de(){if(z===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:oe,top:Y}=z.getBoundingClientRect(),W=q,J=e.createRectsFromDOMRange(te,ce);Ee.isConnected||W.append(Ee);let R=!1;for(let U=0;U<J.length;U++){const X=J[U],fe=Se[U]||document.createElement("div"),_e=fe.style;_e.position!=="absolute"&&(_e.position="absolute",R=!0);const B=r(X.left-oe);_e.left!==B&&(_e.left=B,R=!0);const A=r(X.top-Y);_e.top!==A&&(fe.style.top=A,R=!0);const F=r(X.width);_e.width!==F&&(fe.style.width=F,R=!0);const se=r(X.height);_e.height!==se&&(fe.style.height=se,R=!0),fe.parentNode!==Ee&&(Ee.append(fe),R=!0),Se[U]=fe}for(;Se.length>J.length;)Se.pop();R&&V(Se)}function K(){q=null,z=null,Te!==null&&Te.disconnect(),Te=null,Ee.remove();for(const oe of Se)oe.remove();Se=[]}function O(){const oe=te.getRootElement();if(oe===null)return K();const Y=oe.parentElement;if(!(Y instanceof HTMLElement))return K();K(),z=oe,q=Y,Te=new MutationObserver(W=>{const J=te.getRootElement(),R=J&&J.parentElement;if(J!==z||R!==q)return O();for(const U of W)if(!Ee.contains(U.target))return de()}),Te.observe(Y,l),de()}const Z=te.registerRootListener(O);return()=>{Z(),K()}}function f(te,ce){let V=null,z=null,q=null,Te=null,Se=()=>{};function Ee(de){de.read(()=>{const K=t.$getSelection();if(!t.$isRangeSelection(K)){V=null,z=null,q=null,Te=null,Se(),Se=()=>{};return}const{anchor:O,focus:Z}=K,oe=O.getNode(),Y=oe.getKey(),W=O.offset,J=Z.getNode(),R=J.getKey(),U=Z.offset,X=te.getElementByKey(Y),fe=te.getElementByKey(R),_e=V===null||X===null||W!==z||Y!==V.getKey()||oe!==V&&(!(V instanceof t.TextNode)||oe.updateDOM(V,X,te._config)),B=q===null||fe===null||U!==Te||R!==q.getKey()||J!==q&&(!(q instanceof t.TextNode)||J.updateDOM(q,fe,te._config));if(_e||B){const A=te.getElementByKey(O.getNode().getKey()),F=te.getElementByKey(Z.getNode().getKey());if(A!==null&&F!==null&&A.tagName==="SPAN"&&F.tagName==="SPAN"){const se=document.createRange();let ye,De,ee,ne;Z.isBefore(O)?(ye=F,De=Z.offset,ee=A,ne=O.offset):(ye=A,De=O.offset,ee=F,ne=Z.offset);const ue=ye.firstChild;if(ue===null)throw Error("Expected text node to be first child of span");const be=ee.firstChild;if(be===null)throw Error("Expected text node to be first child of span");se.setStart(ue,De),se.setEnd(be,ne),Se(),Se=d(te,se,Ne=>{for(const Re of Ne){const ke=Re.style;ke.background!=="Highlight"&&(ke.background="Highlight"),ke.color!=="HighlightText"&&(ke.color="HighlightText"),ke.zIndex!=="-1"&&(ke.zIndex="-1"),ke.pointerEvents!=="none"&&(ke.pointerEvents="none"),ke.marginTop!==r(-1.5)&&(ke.marginTop=r(-1.5)),ke.paddingTop!==r(4)&&(ke.paddingTop=r(4)),ke.paddingBottom!==r(0)&&(ke.paddingBottom=r(0))}ce!==void 0&&ce(Ne)})}}V=oe,z=W,q=J,Te=U})}return Ee(te.getEditorState()),n(te.registerUpdateListener(({editorState:de})=>Ee(de)),Se,()=>{Se()})}function p(te,...ce){ce.forEach(V=>{if(typeof V=="string"){const z=V.split(" ").filter(q=>q!=="");te.classList.add(...z)}})}function _(te,...ce){ce.forEach(V=>{typeof V=="string"&&te.classList.remove(...V.split(" "))})}function T(te,ce){for(const V of ce)if(te.type.startsWith(V))return!0;return!1}function E(te,ce){const V=te[Symbol.iterator]();return new Promise((z,q)=>{const Te=[],Se=()=>{const{done:Ee,value:de}=V.next();if(Ee)return z(Te);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const O=K.result;typeof O=="string"&&Te.push({file:de,result:O}),Se()}),T(de,ce)?K.readAsDataURL(de):Se()};Se()})}function S(te,ce){const V=[],z=(te||t.$getRoot()).getLatest(),q=ce||(t.$isElementNode(z)?z.getLastDescendant():z);let Te=z,Se=w(Te);for(;Te!==null&&!Te.is(q);)if(V.push({depth:Se,node:Te}),t.$isElementNode(Te)&&Te.getChildrenSize()>0)Te=Te.getFirstChild(),Se++;else{let Ee=null;for(;Ee===null&&Te!==null;)Ee=Te.getNextSibling(),Ee===null?(Te=Te.getParent(),Se--):Te=Ee}return Te!==null&&Te.is(q)&&V.push({depth:Se,node:Te}),V}function w(te){let ce=te,V=0;for(;(ce=ce.getParent())!==null;)V++;return V}function M(te,ce){let V=te;for(;V!=null;){if(V instanceof ce)return V;V=V.getParent()}return null}function m(te){const ce=v(te,V=>t.$isElementNode(V)&&!V.isInline());if(!t.$isElementNode(ce))throw Error(`Expected node ${te.__key} to have closest block element node.`);return ce}const v=(te,ce)=>{let V=te;for(;V!==t.$getRoot()&&V!=null;){if(ce(V))return V;V=V.getParent()}return null};function k(te,ce,V,z){const q=Ee=>Ee instanceof ce,Te=Ee=>{const de=Ee.getChildren();for(let Z=0;Z<de.length;Z++){const oe=de[Z];if(q(oe))return null}let K=Ee,O=Ee;for(;K!==null;)if(O=K,K=K.getParent(),q(K))return{child:O,parent:K};return null},Se=Ee=>{const de=Te(Ee);if(de!==null){const{child:K,parent:O}=de;if(K.is(Ee)){z(O,Ee);const Z=K.getNextSiblings(),oe=Z.length;if(O.insertAfter(K),oe!==0){const Y=V(O);K.insertAfter(Y);for(let W=0;W<oe;W++)Y.append(Z[W])}!O.canBeEmpty()&&O.getChildrenSize()===0&&O.remove()}}};return te.registerNodeTransform(ce,Se)}function G(te,ce){const z=new Map,q=te._pendingEditorState;for(const[Se,Ee]of ce._nodeMap){const de=e.$cloneWithProperties(Ee);if(t.$isTextNode(de)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");de.__text=Ee.__text}z.set(Se,de)}q&&(q._nodeMap=z),te._dirtyType=2;const Te=ce._selection;t.$setSelection(Te===null?null:Te.clone())}function I(te){const ce=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ce)){const{focus:V}=ce,z=V.getNode(),q=V.offset;if(t.$isRootOrShadowRoot(z)){const Te=z.getChildAtIndex(q);Te==null?z.append(te):Te.insertBefore(te),te.selectNext()}else{let Te,Se;t.$isTextNode(z)?(Te=z.getParentOrThrow(),Se=z.getIndexWithinParent(),q>0&&(Se+=1,z.splitText(q))):(Te=z,Se=q);const[,Ee]=t.$splitNode(Te,Se);Ee.insertBefore(te),Ee.selectStart()}}else{if(ce!=null){const z=ce.getNodes();z[z.length-1].getTopLevelElementOrThrow().insertAfter(te)}else t.$getRoot().append(te);const V=t.$createParagraphNode();te.insertAfter(V),V.select()}return te.getLatest()}function P(te,ce){const V=ce();return te.replace(V),V.append(te),V}function H(te,ce){return te!==null?Object.getPrototypeOf(te).constructor.name===ce.name:!1}function j(te,ce){const V=[];for(let z=0;z<te.length;z++){const q=ce(te[z]);q!==null&&V.push(q)}return V}function re(te,ce){const V=te.getFirstChild();V!==null?V.insertBefore(ce):te.append(ce)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=S,Sn.$filter=j,Sn.$findMatchingParent=v,Sn.$getNearestBlockElementAncestorOrThrow=m,Sn.$getNearestNodeOfType=M,Sn.$insertFirst=re,Sn.$insertNodeToNearestRoot=I,Sn.$restoreEditorState=G,Sn.$wrapNodeInElement=P,Sn.addClassNamesToElement=p,Sn.isMimeType=T,Sn.markSelection=f,Sn.mediaFileReader=E,Sn.mergeRegister=n,Sn.objectKlassEquals=H,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=k,Sn.removeClassNamesFromElement=_,Sn}var wn={},Yf;function XN(){if(Yf)return wn;Yf=1;var e=vs(),t=Yt();function n(_){let T=new URLSearchParams;T.append("code",_);for(let E=1;E<arguments.length;E++)T.append("v",arguments[E]);throw Error(`Minified Lexical error #${_}; visit https://lexical.dev/docs/error?${T} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(..._){return()=>{_.forEach(T=>T())}}let l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(_,T,E){function S(){if(m===null)throw Error("Unexpected null rootDOMNode");if(v===null)throw Error("Unexpected null parentDOMNode");let{left:H,top:j}=m.getBoundingClientRect();var re=v;let te=e.createRectsFromDOMRange(_,T);I.isConnected||re.append(I),re=!1;for(let z=0;z<te.length;z++){var ce=te[z];let q=G[z]||document.createElement("div"),Te=q.style;Te.position!=="absolute"&&(Te.position="absolute",re=!0);var V=`${ce.left-H}px`;Te.left!==V&&(Te.left=V,re=!0),V=`${ce.top-j}px`,Te.top!==V&&(q.style.top=V,re=!0),V=`${ce.width}px`,Te.width!==V&&(q.style.width=V,re=!0),ce=`${ce.height}px`,Te.height!==ce&&(q.style.height=ce,re=!0),q.parentNode!==I&&(I.append(q),re=!0),G[z]=q}for(;G.length>te.length;)G.pop();re&&E(G)}function w(){m=v=null,k!==null&&k.disconnect(),k=null,I.remove();for(let H of G)H.remove();G=[]}function M(){let H=_.getRootElement();if(H===null)return w();let j=H.parentElement;if(!(j instanceof HTMLElement))return w();w(),m=H,v=j,k=new MutationObserver(re=>{let te=_.getRootElement(),ce=te&&te.parentElement;if(te!==m||ce!==v)return M();for(let V of re)if(!I.contains(V.target))return S()}),k.observe(j,l),S()}let m=null,v=null,k=null,G=[],I=document.createElement("div"),P=_.registerRootListener(M);return()=>{P(),w()}}function f(_,T){for(let E of T)if(_.type.startsWith(E))return!0;return!1}let p=(_,T)=>{for(;_!==t.$getRoot()&&_!=null;){if(T(_))return _;_=_.getParent()}return null};return wn.$splitNode=t.$splitNode,wn.isHTMLAnchorElement=t.isHTMLAnchorElement,wn.isHTMLElement=t.isHTMLElement,wn.$dfs=function(_,T){let E=[];_=(_||t.$getRoot()).getLatest(),T=T||(t.$isElementNode(_)?_.getLastDescendant():_);for(var S=_,w=0;(S=S.getParent())!==null;)w++;for(S=w;_!==null&&!_.is(T);)if(E.push({depth:S,node:_}),t.$isElementNode(_)&&0<_.getChildrenSize())_=_.getFirstChild(),S++;else for(w=null;w===null&&_!==null;)w=_.getNextSibling(),w===null?(_=_.getParent(),S--):_=w;return _!==null&&_.is(T)&&E.push({depth:S,node:_}),E},wn.$filter=function(_,T){let E=[];for(let S=0;S<_.length;S++){let w=T(_[S]);w!==null&&E.push(w)}return E},wn.$findMatchingParent=p,wn.$getNearestBlockElementAncestorOrThrow=function(_){let T=p(_,E=>t.$isElementNode(E)&&!E.isInline());return t.$isElementNode(T)||n(4,_.__key),T},wn.$getNearestNodeOfType=function(_,T){for(;_!=null;){if(_ instanceof T)return _;_=_.getParent()}return null},wn.$insertFirst=function(_,T){let E=_.getFirstChild();E!==null?E.insertBefore(T):_.append(T)},wn.$insertNodeToNearestRoot=function(_){var T=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(T)){var{focus:E}=T;if(T=E.getNode(),E=E.offset,t.$isRootOrShadowRoot(T))E=T.getChildAtIndex(E),E==null?T.append(_):E.insertBefore(_),_.selectNext();else{let S,w;t.$isTextNode(T)?(S=T.getParentOrThrow(),w=T.getIndexWithinParent(),0<E&&(w+=1,T.splitText(E))):(S=T,w=E),[,T]=t.$splitNode(S,w),T.insertBefore(_),T.selectStart()}}else T!=null?(T=T.getNodes(),T[T.length-1].getTopLevelElementOrThrow().insertAfter(_)):t.$getRoot().append(_),T=t.$createParagraphNode(),_.insertAfter(T),T.select();return _.getLatest()},wn.$restoreEditorState=function(_,T){let E=new Map,S=_._pendingEditorState;for(let[w,M]of T._nodeMap){let m=e.$cloneWithProperties(M);if(t.$isTextNode(m)){if(!t.$isTextNode(M))throw Error("Expected node be a TextNode");m.__text=M.__text}E.set(w,m)}S&&(S._nodeMap=E),_._dirtyType=2,_=T._selection,t.$setSelection(_===null?null:_.clone())},wn.$wrapNodeInElement=function(_,T){return T=T(),_.replace(T),T.append(_),T},wn.addClassNamesToElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&(E=E.split(" ").filter(S=>S!==""),_.classList.add(...E))})},wn.isMimeType=f,wn.markSelection=function(_,T){function E(k){k.read(()=>{var G=t.$getSelection();if(t.$isRangeSelection(G)){var{anchor:I,focus:P}=G;G=I.getNode();var H=G.getKey(),j=I.offset,re=P.getNode(),te=re.getKey(),ce=P.offset,V=_.getElementByKey(H),z=_.getElementByKey(te);if(H=S===null||V===null||j!==w||H!==S.getKey()||G!==S&&(!(S instanceof t.TextNode)||G.updateDOM(S,V,_._config)),te=M===null||z===null||ce!==m||te!==M.getKey()||re!==M&&(!(M instanceof t.TextNode)||re.updateDOM(M,z,_._config)),H||te){V=_.getElementByKey(I.getNode().getKey());var q=_.getElementByKey(P.getNode().getKey());if(V!==null&&q!==null&&V.tagName==="SPAN"&&q.tagName==="SPAN"){if(te=document.createRange(),P.isBefore(I)?(H=q,z=P.offset,q=V,V=I.offset):(H=V,z=I.offset,V=P.offset),H=H.firstChild,H===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");te.setStart(H,z),te.setEnd(q,V),v(),v=d(_,te,Te=>{for(let Se of Te){let Ee=Se.style;Ee.background!=="Highlight"&&(Ee.background="Highlight"),Ee.color!=="HighlightText"&&(Ee.color="HighlightText"),Ee.zIndex!=="-1"&&(Ee.zIndex="-1"),Ee.pointerEvents!=="none"&&(Ee.pointerEvents="none"),Ee.marginTop!=="-1.5px"&&(Ee.marginTop="-1.5px"),Ee.paddingTop!=="4px"&&(Ee.paddingTop="4px"),Ee.paddingBottom!=="0px"&&(Ee.paddingBottom="0px")}T!==void 0&&T(Te)})}}S=G,w=j,M=re,m=ce}else m=M=w=S=null,v(),v=()=>{}})}let S=null,w=null,M=null,m=null,v=()=>{};return E(_.getEditorState()),r(_.registerUpdateListener(({editorState:k})=>E(k)),v,()=>{v()})},wn.mediaFileReader=function(_,T){let E=_[Symbol.iterator]();return new Promise((S,w)=>{let M=[],m=()=>{const{done:v,value:k}=E.next();if(v)return S(M);const G=new FileReader;G.addEventListener("error",w),G.addEventListener("load",()=>{const I=G.result;typeof I=="string"&&M.push({file:k,result:I}),m()}),f(k,T)?G.readAsDataURL(k):m()};m()})},wn.mergeRegister=r,wn.objectKlassEquals=function(_,T){return _!==null?Object.getPrototypeOf(_).constructor.name===T.name:!1},wn.positionNodeOnRange=d,wn.registerNestedElementResolver=function(_,T,E,S){return _.registerNodeTransform(T,w=>{e:{for(var M=w.getChildren(),m=0;m<M.length;m++)if(M[m]instanceof T){M=null;break e}for(M=w;M!==null;)if(m=M,M=M.getParent(),M instanceof T){M={child:m,parent:M};break e}M=null}if(M!==null){const{child:v,parent:k}=M;if(v.is(w)){if(S(k,w),w=v.getNextSiblings(),M=w.length,k.insertAfter(v),M!==0){m=E(k),v.insertAfter(m);for(let G=0;G<M;G++)m.append(w[G])}k.canBeEmpty()||k.getChildrenSize()!==0||k.remove()}}})},wn.removeClassNamesFromElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&_.classList.remove(...E.split(" "))})},wn}var su,jf;function pn(){return jf||(jf=1,su=process.env.NODE_ENV==="development"?JN():XN()),su}var ou={},Vf;function QN(){if(Vf)return ou;Vf=1;var e=Yt();function t(n){const r=window.location.origin,l=d=>{if(d.origin!==r)return;const f=n.getRootElement();if(document.activeElement!==f)return;const p=d.data;if(typeof p=="string"){let _;try{_=JSON.parse(p)}catch{return}if(_&&_.protocol==="nuanria_messaging"&&_.type==="request"){const T=_.payload;if(T&&T.functionId==="makeChanges"){const E=T.args;if(E){const[S,w,M,m,v,k]=E;n.update(()=>{const G=e.$getSelection();if(e.$isRangeSelection(G)){const I=G.anchor;let P=I.getNode(),H=0,j=0;if(e.$isTextNode(P)&&S>=0&&w>=0&&(H=S,j=S+w,G.setTextNodeRange(P,H,P,j)),(H!==j||M!=="")&&(G.insertRawText(M),P=I.getNode()),e.$isTextNode(P)){H=m,j=m+v;const re=P.getTextContentSize();H=H>re?re:H,j=j>re?re:j,G.setTextNodeRange(P,H,P,j)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",l,!0),()=>{window.removeEventListener("message",l,!0)}}return ou.registerDragonSupport=t,ou}var lu={},qf;function eC(){if(qf)return lu;qf=1;var e=Yt();return lu.registerDragonSupport=function(t){let n=window.location.origin,r=l=>{if(l.origin===n){var d=t.getRootElement();if(document.activeElement===d&&(d=l.data,typeof d=="string")){try{var f=JSON.parse(d)}catch{return}if(f&&f.protocol==="nuanria_messaging"&&f.type==="request"&&(f=f.payload)&&f.functionId==="makeChanges"&&(f=f.args)){const[p,_,T,E,S]=f;t.update(()=>{const w=e.$getSelection();if(e.$isRangeSelection(w)){var M=w.anchor;let m=M.getNode(),v=0,k=0;e.$isTextNode(m)&&0<=p&&0<=_&&(v=p,k=p+_,w.setTextNodeRange(m,v,m,k)),(v!==k||T!=="")&&(w.insertRawText(T),m=M.getNode()),e.$isTextNode(m)&&(v=E,k=E+S,M=m.getTextContentSize(),v=v>M?M:v,k=k>M?M:k,w.setTextNodeRange(m,v,m,k)),l.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},lu}var au,Zf;function Tp(){return Zf||(Zf=1,au=process.env.NODE_ENV==="development"?QN():eC()),au}var di={},vi={},qa={},Jf;function tC(){if(Jf)return qa;Jf=1;var e=vs(),t=pn(),n=Yt();function r(T,E){const S=E.body?E.body.childNodes:[];let w=[];for(let M=0;M<S.length;M++){const m=S[M];if(!p.has(m.nodeName)){const v=_(m,T);v!==null&&(w=w.concat(v))}}return w}function l(T,E){if(typeof document>"u"||typeof window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const S=document.createElement("div"),M=n.$getRoot().getChildren();for(let m=0;m<M.length;m++){const v=M[m];d(T,v,S,E)}return S.innerHTML}function d(T,E,S,w=null){let M=w!=null?E.isSelected(w):!0;const m=n.$isElementNode(E)&&E.excludeFromCopy("html");let v=E;if(w!==null){let re=e.$cloneWithProperties(E);re=n.$isTextNode(re)&&w!=null?e.$sliceSelectedTextNodeContent(w,re):re,v=re}const k=n.$isElementNode(v)?v.getChildren():[],G=T._nodes.get(v.getType());let I;G&&G.exportDOM!==void 0?I=G.exportDOM(T,v):I=v.exportDOM(T);const{element:P,after:H}=I;if(!P)return!1;const j=document.createDocumentFragment();for(let re=0;re<k.length;re++){const te=k[re],ce=d(T,te,j,w);!M&&n.$isElementNode(E)&&ce&&E.extractWithChild(te,w,"html")&&(M=!0)}if(M&&!m){if(t.isHTMLElement(P)&&P.append(j),S.append(P),H){const re=H.call(v,P);re&&P.replaceWith(re)}}else S.append(j);return M}function f(T,E){const{nodeName:S}=T,w=E._htmlConversions.get(S.toLowerCase());let M=null;if(w!==void 0)for(const m of w){const v=m(T);v!==null&&(M===null||(M.priority||0)<(v.priority||0))&&(M=v)}return M!==null?M.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function _(T,E,S=new Map,w){let M=[];if(p.has(T.nodeName))return M;let m=null;const v=f(T,E),k=v?v(T):null;let G=null;if(k!==null){G=k.after;const H=k.node;if(m=Array.isArray(H)?H[H.length-1]:H,m!==null){for(const[,j]of S)if(m=j(m,w),!m)break;m&&M.push(...Array.isArray(H)?H:[m])}k.forChild!=null&&S.set(T.nodeName,k.forChild)}const I=T.childNodes;let P=[];for(let H=0;H<I.length;H++)P.push(..._(I[H],E,new Map(S),m));return G!=null&&(P=G(P)),m==null?M=M.concat(P):n.$isElementNode(m)&&m.append(...P),M}return qa.$generateHtmlFromNodes=l,qa.$generateNodesFromDOM=r,qa}var Za={},Xf;function nC(){if(Xf)return Za;Xf=1;var e=vs(),t=pn(),n=Yt();function r(f,p,_,T=null){let E=T!=null?p.isSelected(T):!0,S=n.$isElementNode(p)&&p.excludeFromCopy("html");var w=p;T!==null&&(w=e.$cloneWithProperties(p),w=n.$isTextNode(w)&&T!=null?e.$sliceSelectedTextNodeContent(T,w):w);let M=n.$isElementNode(w)?w.getChildren():[];var m=f._nodes.get(w.getType());m=m&&m.exportDOM!==void 0?m.exportDOM(f,w):w.exportDOM(f);let{element:v,after:k}=m;if(!v)return!1;m=document.createDocumentFragment();for(let G=0;G<M.length;G++){let I=M[G],P=r(f,I,m,T);!E&&n.$isElementNode(p)&&P&&p.extractWithChild(I,T,"html")&&(E=!0)}return E&&!S?(t.isHTMLElement(v)&&v.append(m),_.append(v),k&&(f=k.call(w,v))&&v.replaceWith(f)):_.append(m),E}let l=new Set(["STYLE","SCRIPT"]);function d(f,p,_=new Map,T){let E=[];if(l.has(f.nodeName))return E;let S=null;var w,{nodeName:M}=f,m=p._htmlConversions.get(M.toLowerCase());if(M=null,m!==void 0)for(w of m)m=w(f),m!==null&&(M===null||(M.priority||0)<(m.priority||0))&&(M=m);if(M=(w=M!==null?M.conversion:null)?w(f):null,w=null,M!==null){if(w=M.after,m=M.node,S=Array.isArray(m)?m[m.length-1]:m,S!==null){for(var[,v]of _)if(S=v(S,T),!S)break;S&&E.push(...Array.isArray(m)?m:[S])}M.forChild!=null&&_.set(f.nodeName,M.forChild)}for(f=f.childNodes,T=[],v=0;v<f.length;v++)T.push(...d(f[v],p,new Map(_),S));return w!=null&&(T=w(T)),S==null?E=E.concat(T):n.$isElementNode(S)&&S.append(...T),E}return Za.$generateHtmlFromNodes=function(f,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let _=document.createElement("div"),T=n.$getRoot().getChildren();for(let E=0;E<T.length;E++)r(f,T[E],_,p);return _.innerHTML},Za.$generateNodesFromDOM=function(f,p){p=p.body?p.body.childNodes:[];let _=[];for(let E=0;E<p.length;E++){var T=p[E];l.has(T.nodeName)||(T=d(T,f),T!==null&&(_=_.concat(T)))}return _},Za}var cu,Qf;function xp(){return Qf||(Qf=1,cu=process.env.NODE_ENV==="development"?tC():nC()),cu}var eh;function rC(){if(eh)return vi;eh=1;var e=xp(),t=vs(),n=pn(),r=Yt();const l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=P=>l?(P||window).getSelection():null;function f(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?"":e.$generateHtmlFromNodes(P,H)}function p(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?null:JSON.stringify(M(P,H))}function _(P,H){const j=P.getData("text/plain")||P.getData("text/uri-list");j!=null&&H.insertRawText(j)}function T(P,H,j){const re=P.getData("application/x-lexical-editor");if(re)try{const V=JSON.parse(re);if(V.namespace===j._config.namespace&&Array.isArray(V.nodes)){const z=m(V.nodes);return E(j,z,H)}}catch{}const te=P.getData("text/html");if(te)try{const z=new DOMParser().parseFromString(te,"text/html"),q=e.$generateNodesFromDOM(j,z);return E(j,q,H)}catch{}const ce=P.getData("text/plain")||P.getData("text/uri-list");if(ce!=null)if(r.$isRangeSelection(H)){const V=ce.split(/(\r?\n|\t)/);V[V.length-1]===""&&V.pop();for(let z=0;z<V.length;z++){const q=V[z];q===`
|
|
75
75
|
`||q===`\r
|
|
76
|
-
`?H.insertParagraph():q===" "?H.insertNodes([r.$createTabNode()]):H.insertText(q)}}else H.insertRawText(ce)}function E(P,H,
|
|
76
|
+
`?H.insertParagraph():q===" "?H.insertNodes([r.$createTabNode()]):H.insertText(q)}}else H.insertRawText(ce)}function E(P,H,j){P.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:H,selection:j})||j.insertNodes(H)}function S(P){const H=P.exportJSON(),j=P.constructor;if(H.type!==j.getType())throw Error(`LexicalNode: Node ${j.name} does not implement .exportJSON().`);if(r.$isElementNode(P)){const re=H.children;if(!Array.isArray(re))throw Error(`LexicalNode: Node ${j.name} is an element but .exportJSON() does not have a children array.`)}return H}function w(P,H,j,re=[]){let te=H!=null?j.isSelected(H):!0;const ce=r.$isElementNode(j)&&j.excludeFromCopy("html");let V=j;if(H!==null){let Te=t.$cloneWithProperties(j);Te=r.$isTextNode(Te)&&H!=null?t.$sliceSelectedTextNodeContent(H,Te):Te,V=Te}const z=r.$isElementNode(V)?V.getChildren():[],q=S(V);if(r.$isTextNode(V)){const Te=V.__text;Te.length>0?q.text=Te:te=!1}for(let Te=0;Te<z.length;Te++){const Se=z[Te],Ee=w(P,H,Se,q.children);!te&&r.$isElementNode(j)&&Ee&&j.extractWithChild(Se,H,"clone")&&(te=!0)}if(te&&!ce)re.push(q);else if(Array.isArray(q.children))for(let Te=0;Te<q.children.length;Te++){const Se=q.children[Te];re.push(Se)}return te}function M(P,H){const j=[],te=r.$getRoot().getChildren();for(let ce=0;ce<te.length;ce++){const V=te[ce];w(P,H,V,j)}return{namespace:P._config.namespace,nodes:j}}function m(P){const H=[];for(let j=0;j<P.length;j++){const re=P[j],te=r.$parseSerializedNode(re);r.$isTextNode(te)&&t.$addNodeStyle(te),H.push(te)}return H}const v=50;let k=null;async function G(P,H){if(k!==null)return!1;if(H!==null)return new Promise((z,q)=>{P.update(()=>{z(I(P,H))})});const j=P.getRootElement(),re=P._window==null?window.document:P._window.document,te=d(P._window);if(j===null||te===null)return!1;const ce=re.createElement("span");ce.style.cssText="position: fixed; top: -1000px;",ce.append(re.createTextNode("#")),j.append(ce);const V=new Range;return V.setStart(ce,0),V.setEnd(ce,1),te.removeAllRanges(),te.addRange(V),new Promise((z,q)=>{const Te=P.registerCommand(r.COPY_COMMAND,Se=>(n.objectKlassEquals(Se,ClipboardEvent)&&(Te(),k!==null&&(window.clearTimeout(k),k=null),z(I(P,Se))),!0),r.COMMAND_PRIORITY_CRITICAL);k=window.setTimeout(()=>{Te(),k=null,z(!1)},v),re.execCommand("copy"),ce.remove()})}function I(P,H){const j=d(P._window);if(!j)return!1;const re=j.anchorNode,te=j.focusNode;if(re!==null&&te!==null&&!r.isSelectionWithinEditor(P,re,te))return!1;H.preventDefault();const ce=H.clipboardData,V=r.$getSelection();if(ce===null||V===null)return!1;const z=f(P),q=p(P);let Te="";return V!==null&&(Te=V.getTextContent()),z!==null&&ce.setData("text/html",z),q!==null&&ce.setData("application/x-lexical-editor",q),ce.setData("text/plain",Te),!0}return vi.$generateJSONFromSelectedNodes=M,vi.$generateNodesFromSerializedNodes=m,vi.$getHtmlContent=f,vi.$getLexicalContent=p,vi.$insertDataTransferForPlainText=_,vi.$insertDataTransferForRichText=T,vi.$insertGeneratedNodes=E,vi.copyToClipboard=G,vi}var Si={},th;function iC(){if(th)return Si;th=1;var e=xp(),t=vs(),n=pn(),r=Yt();function l(m){let v=new URLSearchParams;v.append("code",m);for(let k=1;k<arguments.length;k++)v.append("v",arguments[k]);throw Error(`Minified Lexical error #${m}; visit https://lexical.dev/docs/error?${v} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function f(m){let v=r.$getSelection();if(v==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(v)&&v.isCollapsed()||v.getNodes().length===0?"":e.$generateHtmlFromNodes(m,v)}function p(m){let v=r.$getSelection();if(v==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(v)&&v.isCollapsed()||v.getNodes().length===0?null:JSON.stringify(E(m,v))}function _(m,v,k){m.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:v,selection:k})||k.insertNodes(v)}function T(m,v,k,G=[]){let I=v!=null?k.isSelected(v):!0,P=r.$isElementNode(k)&&k.excludeFromCopy("html");var H=k;if(v!==null){var j=t.$cloneWithProperties(k);H=j=r.$isTextNode(j)&&v!=null?t.$sliceSelectedTextNodeContent(v,j):j}let re=r.$isElementNode(H)?H.getChildren():[];var te=H;j=te.exportJSON();var ce=te.constructor;for(j.type!==ce.getType()&&l(58,ce.name),r.$isElementNode(te)&&(Array.isArray(j.children)||l(59,ce.name)),r.$isTextNode(H)&&(H=H.__text,0<H.length?j.text=H:I=!1),H=0;H<re.length;H++)te=re[H],ce=T(m,v,te,j.children),!I&&r.$isElementNode(k)&&ce&&k.extractWithChild(te,v,"clone")&&(I=!0);if(I&&!P)G.push(j);else if(Array.isArray(j.children))for(m=0;m<j.children.length;m++)G.push(j.children[m]);return I}function E(m,v){let k=[],G=r.$getRoot().getChildren();for(let I=0;I<G.length;I++)T(m,v,G[I],k);return{namespace:m._config.namespace,nodes:k}}function S(m){let v=[];for(let k=0;k<m.length;k++){let G=r.$parseSerializedNode(m[k]);r.$isTextNode(G)&&t.$addNodeStyle(G),v.push(G)}return v}let w=null;function M(m,v){var k=d?(m._window||window).getSelection():null;if(!k)return!1;var G=k.anchorNode;if(k=k.focusNode,G!==null&&k!==null&&!r.isSelectionWithinEditor(m,G,k)||(v.preventDefault(),v=v.clipboardData,G=r.$getSelection(),v===null||G===null))return!1;k=f(m),m=p(m);let I="";return G!==null&&(I=G.getTextContent()),k!==null&&v.setData("text/html",k),m!==null&&v.setData("application/x-lexical-editor",m),v.setData("text/plain",I),!0}return Si.$generateJSONFromSelectedNodes=E,Si.$generateNodesFromSerializedNodes=S,Si.$getHtmlContent=f,Si.$getLexicalContent=p,Si.$insertDataTransferForPlainText=function(m,v){m=m.getData("text/plain")||m.getData("text/uri-list"),m!=null&&v.insertRawText(m)},Si.$insertDataTransferForRichText=function(m,v,k){var G=m.getData("application/x-lexical-editor");if(G)try{let P=JSON.parse(G);if(P.namespace===k._config.namespace&&Array.isArray(P.nodes)){let H=S(P.nodes);return _(k,H,v)}}catch{}if(G=m.getData("text/html"))try{var I=new DOMParser().parseFromString(G,"text/html");let P=e.$generateNodesFromDOM(k,I);return _(k,P,v)}catch{}if(m=m.getData("text/plain")||m.getData("text/uri-list"),m!=null)if(r.$isRangeSelection(v))for(m=m.split(/(\r?\n|\t)/),m[m.length-1]===""&&m.pop(),k=0;k<m.length;k++)I=m[k],I===`
|
|
77
77
|
`||I===`\r
|
|
78
|
-
`?v.insertParagraph():I===" "?v.insertNodes([r.$createTabNode()]):v.insertText(I);else v.insertRawText(m)},Si.$insertGeneratedNodes=_,Si.copyToClipboard=async function(m,v){if(w!==null)return!1;if(v!==null)return new Promise(H=>{m.update(()=>{H(M(m,v))})});var k=m.getRootElement();let G=m._window==null?window.document:m._window.document,I=d?(m._window||window).getSelection():null;if(k===null||I===null)return!1;let P=G.createElement("span");return P.style.cssText="position: fixed; top: -1000px;",P.append(G.createTextNode("#")),k.append(P),k=new Range,k.setStart(P,0),k.setEnd(P,1),I.removeAllRanges(),I.addRange(k),new Promise(H=>{let V=m.registerCommand(r.COPY_COMMAND,re=>(n.objectKlassEquals(re,ClipboardEvent)&&(V(),w!==null&&(window.clearTimeout(w),w=null),H(M(m,re))),!0),r.COMMAND_PRIORITY_CRITICAL);w=window.setTimeout(()=>{V(),w=null,H(!1)},50),G.execCommand("copy"),P.remove()})},Si}var uu,nh;function vp(){return nh||(nh=1,uu=process.env.NODE_ENV==="development"?rC():iC()),uu}var rh;function sC(){if(rh)return di;rh=1;var e=vp(),t=vs(),n=pn(),r=Yt();function l(Se,Ee){if(typeof document.caretRangeFromPoint<"u"){const de=document.caretRangeFromPoint(Se,Ee);return de===null?null:{node:de.startContainer,offset:de.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const de=document.caretPositionFromPoint(Se,Ee);return de===null?null:{node:de.offsetNode,offset:de.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new M(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const de=document.createElement("blockquote");return n.addClassNamesToElement(de,Ee.theme.quote),de}updateDOM(Ee,de){return!1}static importDOM(){return{blockquote:Ee=>({conversion:P,priority:0})}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=m();return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,de){const K=r.$createParagraphNode(),O=this.getDirection();return K.setDirection(O),this.insertAfter(K,de),K}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}}function m(){return r.$applyNodeReplacement(new M)}function v(Se){return Se instanceof M}class k extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new k(Ee.__tag,Ee.__key)}constructor(Ee,de){super(de),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const de=this.__tag,K=document.createElement(de),Z=Ee.theme.heading;if(Z!==void 0){const oe=Z[de];n.addClassNamesToElement(K,oe)}return K}updateDOM(Ee,de){return!1}static importDOM(){return{h1:Ee=>({conversion:I,priority:0}),h2:Ee=>({conversion:I,priority:0}),h3:Ee=>({conversion:I,priority:0}),h4:Ee=>({conversion:I,priority:0}),h5:Ee=>({conversion:I,priority:0}),h6:Ee=>({conversion:I,priority:0}),p:Ee=>{const K=Ee.firstChild;return K!==null&&G(K)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>G(Ee)?{conversion:de=>({node:H("h1")}),priority:3}:null}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=H(Ee.tag);return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,de=!0){const K=Ee?Ee.anchor.offset:0,O=K===this.getTextContentSize()||!Ee?r.$createParagraphNode():H(this.getTag()),Z=this.getDirection();if(O.setDirection(Z),this.insertAfter(O,de),K===0&&!this.isEmpty()&&Ee){const oe=r.$createParagraphNode();oe.select(),this.replace(oe,!0)}return O}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():H(this.getTag());return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}extractWithChild(){return!0}}function G(Se){return Se.nodeName.toLowerCase()==="span"?Se.style.fontSize==="26pt":!1}function I(Se){const Ee=Se.nodeName.toLowerCase();let de=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(de=H(Ee),Se.style!==null&&de.setFormat(Se.style.textAlign)),{node:de}}function P(Se){const Ee=m();return Se.style!==null&&Ee.setFormat(Se.style.textAlign),{node:Ee}}function H(Se){return r.$applyNodeReplacement(new k(Se))}function V(Se){return Se instanceof k}function re(Se,Ee){Se.preventDefault(),Ee.update(()=>{const de=r.$getSelection(),K=Se instanceof InputEvent||Se instanceof KeyboardEvent?null:Se.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(de)&&e.$insertDataTransferForRichText(K,de,Ee)},{tag:"paste"})}async function te(Se,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(Se,ClipboardEvent)?Se:null),Ee.update(()=>{const de=r.$getSelection();r.$isRangeSelection(de)?de.removeText():r.$isNodeSelection(de)&&de.getNodes().forEach(K=>K.remove())})}function ce(Se){let Ee=null;if(Se instanceof DragEvent?Ee=Se.dataTransfer:Se instanceof ClipboardEvent&&(Ee=Se.clipboardData),Ee===null)return[!1,[],!1];const de=Ee.types,K=de.includes("Files"),O=de.includes("text/html")||de.includes("text/plain");return[K,Array.from(Ee.files),O]}function j(Se){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const de=new Set,K=Ee.getNodes();for(let O=0;O<K.length;O++){const Z=K[O],oe=Z.getKey();if(de.has(oe))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(Z),W=Y.getKey();Y.canIndent()&&!de.has(W)&&(de.add(W),Se(Y))}return de.size>0}function z(Se){const Ee=r.$getNearestNodeFromDOMNode(Se);return r.$isDecoratorNode(Ee)}function q(Se){const Ee=Se.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function Te(Se){return n.mergeRegister(Se.registerCommand(r.CLICK_COMMAND,de=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),Se.registerCommand(r.DELETE_CHARACTER_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_WORD_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_LINE_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,de=>{const K=r.$getSelection();if(typeof de=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(de);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const O=de.dataTransfer;if(O!=null)e.$insertDataTransferForRichText(O,K,Se);else if(r.$isRangeSelection(K)){const Z=de.data;return Z&&K.insertText(Z),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_TEXT_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_ELEMENT_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const O=K.getNodes();for(const Z of O){const oe=n.$findMatchingParent(Z,Y=>r.$isElementNode(Y)&&!Y.isInline());oe!==null&&oe.setFormat(de)}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_LINE_BREAK_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INDENT_CONTENT_COMMAND,()=>j(de=>{const K=de.getIndent();de.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>j(de=>{const K=de.getIndent();K>0&&de.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_UP_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const O=K.getNodes();if(O.length>0)return O[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const O=r.$getAdjacentNode(K.focus,!0);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectPrevious(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_DOWN_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return O[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return de.preventDefault(),!0;const O=r.$getAdjacentNode(K.focus,!1);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectNext(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_LEFT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return de.preventDefault(),O[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(t.$shouldOverrideDefaultCharacterSelection(K,!0)){const O=de.shiftKey;return de.preventDefault(),t.$moveCharacter(K,O,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const Z=K.getNodes();if(Z.length>0)return de.preventDefault(),Z[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const O=de.shiftKey;return t.$shouldOverrideDefaultCharacterSelection(K,!1)?(de.preventDefault(),t.$moveCharacter(K,O,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_BACKSPACE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;de.preventDefault();const{anchor:O}=K,Z=O.getNode();return K.isCollapsed()&&O.offset===0&&!r.$isRootNode(Z)&&n.$getNearestBlockElementAncestorOrThrow(Z).getIndent()>0?Se.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_DELETE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(de.preventDefault(),Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ENTER_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(de!==null){if((T||_||S)&&p)return!1;if(de.preventDefault(),de.shiftKey)return Se.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return Se.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(Se.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DROP_COMMAND,de=>{const[,K]=ce(de);if(K.length>0){const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const{offset:W,node:J}=Y,R=r.$getNearestNodeFromDOMNode(J);if(R!==null){const U=r.$createRangeSelection();if(r.$isTextNode(R))U.anchor.set(R.getKey(),W,"text"),U.focus.set(R.getKey(),W,"text");else{const fe=R.getParentOrThrow().getKey(),_e=R.getIndexWithinParent()+1;U.anchor.set(fe,_e,"element"),U.focus.set(fe,_e,"element")}const X=r.$normalizeSelection__EXPERIMENTAL(U);r.$setSelection(X)}Se.dispatchCommand(w,K)}return de.preventDefault(),!0}const O=r.$getSelection();return!!r.$isRangeSelection(O)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGSTART_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();return!(K&&!r.$isRangeSelection(O))},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGOVER_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();if(K&&!r.$isRangeSelection(O))return!1;const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const W=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(W)&&de.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.COPY_COMMAND,de=>(e.copyToClipboard(Se,n.objectKlassEquals(de,ClipboardEvent)?de:null),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CUT_COMMAND,de=>(te(de,Se),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.PASTE_COMMAND,de=>{const[,K,O]=ce(de);if(K.length>0&&!O)return Se.dispatchCommand(w,K),!0;if(r.isSelectionCapturedInDecoratorInput(de.target))return!1;const Z=r.$getSelection();return r.$INTERNAL_isPointSelection(Z)?(re(de,Se),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return di.$createHeadingNode=H,di.$createQuoteNode=m,di.$isHeadingNode=V,di.$isQuoteNode=v,di.DRAG_DROP_PASTE=w,di.HeadingNode=k,di.QuoteNode=M,di.eventFiles=ce,di.registerRichText=Te,di}var fi={},ih;function oC(){if(ih)return fi;ih=1;var e=vp(),t=vs(),n=pn(),r=Yt();function l(j,z){return typeof document.caretRangeFromPoint<"u"?(j=document.caretRangeFromPoint(j,z),j===null?null:{node:j.startContainer,offset:j.startOffset}):document.caretPositionFromPoint!=="undefined"?(j=document.caretPositionFromPoint(j,z),j===null?null:{node:j.offsetNode,offset:j.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(z){return new M(z.__key)}constructor(z){super(z)}createDOM(z){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,z.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:I,priority:0})}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=m();return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(z,q){z=r.$createParagraphNode();let Te=this.getDirection();return z.setDirection(Te),this.insertAfter(z,q),z}collapseAtStart(){let z=r.$createParagraphNode();return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}}function m(){return r.$applyNodeReplacement(new M)}class v extends r.ElementNode{static getType(){return"heading"}static clone(z){return new v(z.__tag,z.__key)}constructor(z,q){super(q),this.__tag=z}getTag(){return this.__tag}createDOM(z){let q=this.__tag,Te=document.createElement(q);return z=z.theme.heading,z!==void 0&&n.addClassNamesToElement(Te,z[q]),Te}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:G,priority:0}),h2:()=>({conversion:G,priority:0}),h3:()=>({conversion:G,priority:0}),h4:()=>({conversion:G,priority:0}),h5:()=>({conversion:G,priority:0}),h6:()=>({conversion:G,priority:0}),p:z=>(z=z.firstChild,z!==null&&k(z)?{conversion:()=>({node:null}),priority:3}:null),span:z=>k(z)?{conversion:()=>({node:P("h1")}),priority:3}:null}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=P(z.tag);return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(z,q=!0){let Te=z?z.anchor.offset:0,Se=Te!==this.getTextContentSize()&&z?P(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return Se.setDirection(Ee),this.insertAfter(Se,q),Te===0&&!this.isEmpty()&&z&&(z=r.$createParagraphNode(),z.select(),this.replace(z,!0)),Se}collapseAtStart(){let z=this.isEmpty()?r.$createParagraphNode():P(this.getTag());return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}extractWithChild(){return!0}}function k(j){return j.nodeName.toLowerCase()==="span"?j.style.fontSize==="26pt":!1}function G(j){let z=j.nodeName.toLowerCase(),q=null;return(z==="h1"||z==="h2"||z==="h3"||z==="h4"||z==="h5"||z==="h6")&&(q=P(z),j.style!==null&&q.setFormat(j.style.textAlign)),{node:q}}function I(j){let z=m();return j.style!==null&&z.setFormat(j.style.textAlign),{node:z}}function P(j){return r.$applyNodeReplacement(new v(j))}function H(j,z){j.preventDefault(),z.update(()=>{let q=r.$getSelection(),Te=j instanceof InputEvent||j instanceof KeyboardEvent?null:j.clipboardData;Te!=null&&r.$INTERNAL_isPointSelection(q)&&e.$insertDataTransferForRichText(Te,q,z)},{tag:"paste"})}async function V(j,z){await e.copyToClipboard(z,n.objectKlassEquals(j,ClipboardEvent)?j:null),z.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(Te=>Te.remove())})}function re(j){let z=null;if(j instanceof DragEvent?z=j.dataTransfer:j instanceof ClipboardEvent&&(z=j.clipboardData),z===null)return[!1,[],!1];var q=z.types;return j=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[j,Array.from(z.files),q]}function te(j){var z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;let q=new Set;z=z.getNodes();for(let Ee=0;Ee<z.length;Ee++){var Te=z[Ee],Se=Te.getKey();q.has(Se)||(Te=n.$getNearestBlockElementAncestorOrThrow(Te),Se=Te.getKey(),Te.canIndent()&&!q.has(Se)&&(q.add(Se),j(Te)))}return 0<q.size}function ce(j){return j=r.$getNearestNodeFromDOMNode(j),r.$isDecoratorNode(j)}return fi.$createHeadingNode=P,fi.$createQuoteNode=m,fi.$isHeadingNode=function(j){return j instanceof v},fi.$isQuoteNode=function(j){return j instanceof M},fi.DRAG_DROP_PASTE=w,fi.HeadingNode=v,fi.QuoteNode=M,fi.eventFiles=re,fi.registerRichText=function(j){return n.mergeRegister(j.registerCommand(r.CLICK_COMMAND,()=>{const z=r.$getSelection();return r.$isNodeSelection(z)?(z.clear(),!0):!1},0),j.registerCommand(r.DELETE_CHARACTER_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_WORD_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_LINE_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,z=>{const q=r.$getSelection();if(typeof z=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(z);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const Te=z.dataTransfer;Te!=null?e.$insertDataTransferForRichText(Te,q,j):r.$isRangeSelection(q)&&(z=z.data)&&q.insertText(z)}return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_TEXT_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_ELEMENT_COMMAND,z=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const Te of q)q=n.$findMatchingParent(Te,Se=>r.$isElementNode(Se)&&!Se.isInline()),q!==null&&q.setFormat(z);return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_LINE_BREAK_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();z.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();0<q&&z.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_UP_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){if(z=q.getNodes(),0<z.length)return z[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),z.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_DOWN_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(z=q.getNodes(),0<z.length)return z[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let Te=q.focus;if(Te.key==="root"&&Te.offset===r.$getRoot().getChildrenSize())return z.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),z.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_LEFT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&t.$shouldOverrideDefaultCharacterSelection(q,!0)?(Te=z.shiftKey,z.preventDefault(),t.$moveCharacter(q,Te,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(Te=z.shiftKey,t.$shouldOverrideDefaultCharacterSelection(q,!1)?(z.preventDefault(),t.$moveCharacter(q,Te,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_BACKSPACE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;z.preventDefault(),{anchor:z}=q;const Te=z.getNode();return q.isCollapsed()&&z.offset===0&&!r.$isRootNode(Te)&&0<n.$getNearestBlockElementAncestorOrThrow(Te).getIndent()?j.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_DELETE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(z.preventDefault(),j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ENTER_COMMAND,z=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(z!==null){if((T||_||S)&&p)return!1;if(z.preventDefault(),z.shiftKey)return j.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return j.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(j.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DROP_COMMAND,z=>{const[,q]=re(z);if(0<q.length){var Te=l(z.clientX,z.clientY);if(Te!==null){const{offset:Ee,node:de}=Te;var Se=r.$getNearestNodeFromDOMNode(de);if(Se!==null){if(Te=r.$createRangeSelection(),r.$isTextNode(Se))Te.anchor.set(Se.getKey(),Ee,"text"),Te.focus.set(Se.getKey(),Ee,"text");else{const K=Se.getParentOrThrow().getKey();Se=Se.getIndexWithinParent()+1,Te.anchor.set(K,Se,"element"),Te.focus.set(K,Se,"element")}Te=r.$normalizeSelection__EXPERIMENTAL(Te),r.$setSelection(Te)}j.dispatchCommand(w,q)}return z.preventDefault(),!0}return z=r.$getSelection(),!!r.$isRangeSelection(z)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGSTART_COMMAND,z=>{[z]=re(z);const q=r.$getSelection();return!(z&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGOVER_COMMAND,z=>{var[q]=re(z);const Te=r.$getSelection();return q&&!r.$isRangeSelection(Te)?!1:(q=l(z.clientX,z.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&z.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.COPY_COMMAND,z=>(e.copyToClipboard(j,n.objectKlassEquals(z,ClipboardEvent)?z:null),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CUT_COMMAND,z=>(V(z,j),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.PASTE_COMMAND,z=>{const[,q,Te]=re(z);if(0<q.length&&!Te)return j.dispatchCommand(w,q),!0;if(r.isSelectionCapturedInDecoratorInput(z.target))return!1;const Se=r.$getSelection();return r.$INTERNAL_isPointSelection(Se)?(H(z,j),!0):!1},r.COMMAND_PRIORITY_EDITOR))},fi}var du,sh;function md(){return sh||(sh=1,du=process.env.NODE_ENV==="development"?sC():oC()),du}var oh;function lC(){if(oh)return Qc;oh=1;var e=qn(),t=Cp(),n=nt,r=Ep(),l=pn(),d=ld,f=Tp(),p=md(),E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function S(G){return G.getEditorState().read(r.$canShowPlaceholderCurry(G.isComposing()))}function w(G){const[I,P]=n.useState(()=>S(G));return E(()=>{function H(){const V=S(G);P(V)}return H(),l.mergeRegister(G.registerUpdateListener(()=>{H()}),G.registerEditableListener(()=>{H()}))},[G]),I}function M(G,I){const[P,H]=n.useState(()=>G.getDecorators());return E(()=>G.registerDecoratorListener(V=>{d.flushSync(()=>{H(V)})}),[G]),n.useEffect(()=>{H(G.getDecorators())},[G]),n.useMemo(()=>{const V=[],re=Object.keys(P);for(let te=0;te<re.length;te++){const ce=re[te],j=n.createElement(I,{onError:q=>G._onError(q)},n.createElement(n.Suspense,{fallback:null},P[ce])),z=G.getElementByKey(ce);z!==null&&V.push(d.createPortal(j,z,ce))}return V},[I,P,G])}function m(G){E(()=>l.mergeRegister(p.registerRichText(G),f.registerDragonSupport(G)),[G])}function v({contentEditable:G,placeholder:I,ErrorBoundary:P}){const[H]=e.useLexicalComposerContext(),V=M(H,P);return m(H),n.createElement(n.Fragment,null,G,n.createElement(k,{content:I}),V)}function k({content:G}){const[I]=e.useLexicalComposerContext(),P=w(I),H=t();return P?typeof G=="function"?G(H):G:null}return Qc.RichTextPlugin=v,Qc}var fu={},lh;function aC(){if(lh)return fu;lh=1;var e=qn(),t=Cp(),n=nt,r=Ep(),l=pn(),d=ld,f=Tp(),p=md(),_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function T(m){return m.getEditorState().read(r.$canShowPlaceholderCurry(m.isComposing()))}function E(m){let[v,k]=n.useState(()=>T(m));return _(()=>{function G(){let I=T(m);k(I)}return G(),l.mergeRegister(m.registerUpdateListener(()=>{G()}),m.registerEditableListener(()=>{G()}))},[m]),v}function S(m,v){let[k,G]=n.useState(()=>m.getDecorators());return _(()=>m.registerDecoratorListener(I=>{d.flushSync(()=>{G(I)})}),[m]),n.useEffect(()=>{G(m.getDecorators())},[m]),n.useMemo(()=>{let I=[],P=Object.keys(k);for(let H=0;H<P.length;H++){let V=P[H],re=n.createElement(v,{onError:ce=>m._onError(ce)},n.createElement(n.Suspense,{fallback:null},k[V])),te=m.getElementByKey(V);te!==null&&I.push(d.createPortal(re,te,V))}return I},[v,k,m])}function w(m){_(()=>l.mergeRegister(p.registerRichText(m),f.registerDragonSupport(m)),[m])}function M({content:m}){var[v]=e.useLexicalComposerContext();v=E(v);let k=t();return v?typeof m=="function"?m(k):m:null}return fu.RichTextPlugin=function({contentEditable:m,placeholder:v,ErrorBoundary:k}){let[G]=e.useLexicalComposerContext();return k=S(G,k),w(G),n.createElement(n.Fragment,null,m,n.createElement(M,{content:v}),k)},fu}const cC=process.env.NODE_ENV==="development"?lC():aC();var uC=cC,hu={},ah;function dC(){if(ah)return hu;ah=1;var e=qn(),t=nt;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var T=arguments[_];for(var E in T)Object.prototype.hasOwnProperty.call(T,E)&&(p[E]=T[E])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function f({ariaActiveDescendant:p,ariaAutoComplete:_,ariaControls:T,ariaDescribedBy:E,ariaExpanded:S,ariaLabel:w,ariaLabelledBy:M,ariaMultiline:m,ariaOwns:v,ariaRequired:k,autoCapitalize:G,className:I,id:P,role:H="textbox",spellCheck:V=!0,style:re,tabIndex:te,"data-testid":ce,...j}){const[z]=e.useLexicalComposerContext(),[q,Te]=t.useState(!1),Se=t.useCallback(Ee=>{z.setRootElement(Ee)},[z]);return d(()=>(Te(z.isEditable()),z.registerEditableListener(Ee=>{Te(Ee)})),[z]),t.createElement("div",n({},j,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?_:"none","aria-controls":q?T:void 0,"aria-describedby":E,"aria-expanded":q&&H==="combobox"?!!S:void 0,"aria-label":w,"aria-labelledby":M,"aria-multiline":m,"aria-owns":q?v:void 0,"aria-readonly":q?void 0:!0,"aria-required":k,autoCapitalize:G,className:I,contentEditable:q,"data-testid":ce,id:P,ref:Se,role:H,spellCheck:V,style:re,tabIndex:te}))}return hu.ContentEditable=f,hu}var gu={},ch;function fC(){if(ch)return gu;ch=1;var e=qn(),t=nt;function n(){return n=Object.assign?Object.assign.bind():function(l){for(var d=1;d<arguments.length;d++){var f=arguments[d],p;for(p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}return l},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;return gu.ContentEditable=function({ariaActiveDescendant:l,ariaAutoComplete:d,ariaControls:f,ariaDescribedBy:p,ariaExpanded:_,ariaLabel:T,ariaLabelledBy:E,ariaMultiline:S,ariaOwns:w,ariaRequired:M,autoCapitalize:m,className:v,id:k,role:G="textbox",spellCheck:I=!0,style:P,tabIndex:H,"data-testid":V,...re}){let[te]=e.useLexicalComposerContext(),[ce,j]=t.useState(!1),z=t.useCallback(q=>{te.setRootElement(q)},[te]);return r(()=>(j(te.isEditable()),te.registerEditableListener(q=>{j(q)})),[te]),t.createElement("div",n({},re,{"aria-activedescendant":ce?l:void 0,"aria-autocomplete":ce?d:"none","aria-controls":ce?f:void 0,"aria-describedby":p,"aria-expanded":ce&&G==="combobox"?!!_:void 0,"aria-label":T,"aria-labelledby":E,"aria-multiline":S,"aria-owns":ce?w:void 0,"aria-readonly":ce?void 0:!0,"aria-required":M,autoCapitalize:m,className:v,contentEditable:ce,"data-testid":V,id:k,ref:z,role:G,spellCheck:I,style:P,tabIndex:H}))},gu}const hC=process.env.NODE_ENV==="development"?dC():fC();var gC=hC,pu,uh;function pC(){if(uh)return pu;uh=1;var e=nt;function t(p,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,S){return E.__proto__=S,E},t(p,_)}function n(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}var r=function(_,T){return _===void 0&&(_=[]),T===void 0&&(T=[]),_.length!==T.length||_.some(function(E,S){return!Object.is(E,T[S])})},l={error:null},d=function(p){n(_,p);function _(){for(var E,S=arguments.length,w=new Array(S),M=0;M<S;M++)w[M]=arguments[M];return E=p.call.apply(p,[this].concat(w))||this,E.state=l,E.resetErrorBoundary=function(){for(var m,v=arguments.length,k=new Array(v),G=0;G<v;G++)k[G]=arguments[G];E.props.onReset==null||(m=E.props).onReset.apply(m,k),E.reset()},E}_.getDerivedStateFromError=function(S){return{error:S}};var T=_.prototype;return T.reset=function(){this.setState(l)},T.componentDidCatch=function(S,w){var M,m;(M=(m=this.props).onError)==null||M.call(m,S,w)},T.componentDidUpdate=function(S,w){var M=this.state.error,m=this.props.resetKeys;if(M!==null&&w.error!==null&&r(S.resetKeys,m)){var v,k;(v=(k=this.props).onResetKeysChange)==null||v.call(k,S.resetKeys,m),this.reset()}},T.render=function(){var S=this.state.error,w=this.props,M=w.fallbackRender,m=w.FallbackComponent,v=w.fallback;if(S!==null){var k={error:S,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(v))return v;if(typeof M=="function")return M(k);if(m)return e.createElement(m,k);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},_}(e.Component);function f({children:p,onError:_}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:_},p)}return pu=f,pu}var mu,dh;function mC(){if(dh)return mu;dh=1;var e=nt;function t(f,p){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,T){return _.__proto__=T,_},t(f,p)}function n(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,t(f,p)}function r(f,p){return f===void 0&&(f=[]),p===void 0&&(p=[]),f.length!==p.length||f.some(function(_,T){return!Object.is(_,p[T])})}var l={error:null},d=function(f){function p(){for(var T,E=arguments.length,S=Array(E),w=0;w<E;w++)S[w]=arguments[w];return T=f.call.apply(f,[this].concat(S))||this,T.state=l,T.resetErrorBoundary=function(){for(var M,m=arguments.length,v=Array(m),k=0;k<m;k++)v[k]=arguments[k];T.props.onReset==null||(M=T.props).onReset.apply(M,v),T.reset()},T}n(p,f),p.getDerivedStateFromError=function(T){return{error:T}};var _=p.prototype;return _.reset=function(){this.setState(l)},_.componentDidCatch=function(T,E){var S,w;(S=(w=this.props).onError)==null||S.call(w,T,E)},_.componentDidUpdate=function(T,E){var S=this.props.resetKeys;if(this.state.error!==null&&E.error!==null&&r(T.resetKeys,S)){var w,M;(w=(M=this.props).onResetKeysChange)==null||w.call(M,T.resetKeys,S),this.reset()}},_.render=function(){var T=this.state.error,E=this.props,S=E.fallbackRender,w=E.FallbackComponent;if(E=E.fallback,T!==null){if(T={error:T,resetErrorBoundary:this.resetErrorBoundary},e.isValidElement(E))return E;if(typeof S=="function")return S(T);if(w)return e.createElement(w,T);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(e.Component);return mu=function({children:f,onError:p}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},f)},mu}const _C=process.env.NODE_ENV==="development"?pC():mC();var yC=_C;const NC=ad(yC);var _u={},gr={},fh;function CC(){if(fh)return gr;fh=1;var e=Yt(),t=pn();function n(Y){let W=1,J=Y.getParent();for(;J!=null;){if(ce(J)){const R=J.getParent();if(de(R)){W++,J=R.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return W}return W}function r(Y){let W=Y.getParent();if(!de(W))throw Error("A ListItemNode must have a ListNode for a parent.");let J=W;for(;J!==null;)J=J.getParent(),de(J)&&(W=J);return W}function l(Y){let W=[];const J=Y.getChildren().filter(ce);for(let R=0;R<J.length;R++){const U=J[R],X=U.getFirstChild();de(X)?W=W.concat(l(X)):W.push(U)}return W}function d(Y){return ce(Y)&&de(Y.getFirstChild())}function f(Y){let W=Y;for(;W.getNextSibling()==null&&W.getPreviousSibling()==null;){const J=W.getParent();if(J==null||!(ce(W)||de(W)))break;W=J}W.remove()}function p(Y){return te().append(Y)}function _(Y,W){return ce(Y)&&(W.length===0||W.length===1&&Y.is(W[0])&&Y.getChildrenSize()===0)}function T(Y){const W=Y.getParent();let J=1;if(W!=null)if(de(W))J=W.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const R=Y.getPreviousSiblings();for(let U=0;U<R.length;U++){const X=R[U];ce(X)&&!de(X.getFirstChild())&&J++}return J}function E(Y,W){Y.update(()=>{const J=e.$getSelection();if(e.$INTERNAL_isPointSelection(J)){const R=J.getNodes(),X=J.anchor.getNode(),fe=X.getParent();if(_(X,R)){const _e=Ee(W);if(e.$isRootOrShadowRoot(fe)){X.replace(_e);const B=te();e.$isElementNode(X)&&(B.setFormat(X.getFormatType()),B.setIndent(X.getIndent())),_e.append(B)}else if(ce(X)){const B=X.getParentOrThrow();S(_e,B.getChildren()),B.replace(_e)}return}else{const _e=new Set;for(let B=0;B<R.length;B++){const A=R[B];if(e.$isElementNode(A)&&A.isEmpty()&&!ce(A)&&!_e.has(A.getKey())){w(A,W);continue}if(e.$isLeafNode(A)){let F=A.getParent();for(;F!=null;){const se=F.getKey();if(de(F)){if(!_e.has(se)){const ye=Ee(W);S(ye,F.getChildren()),F.replace(ye),v(ye),_e.add(se)}break}else{const ye=F.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(se)){_e.add(se),w(F,W);break}F=ye}}}}}}})}function S(Y,W){Y.splice(Y.getChildrenSize(),0,W)}function w(Y,W){if(de(Y))return Y;const J=Y.getPreviousSibling(),R=Y.getNextSibling(),U=te();if(U.setFormat(Y.getFormatType()),U.setIndent(Y.getIndent()),S(U,Y.getChildren()),de(J)&&W===J.getListType())return J.append(U),Y.remove(),de(R)&&W===R.getListType()&&(S(J,R.getChildren()),R.remove()),J;if(de(R)&&W===R.getListType())return R.getFirstChildOrThrow().insertBefore(U),Y.remove(),R;{const X=Ee(W);return X.append(U),Y.replace(X),v(X),X}}function M(Y,W){const J=Y.getLastChild(),R=W.getFirstChild();J&&R&&d(J)&&d(R)&&(M(J.getFirstChild(),R.getFirstChild()),R.remove());const U=W.getChildren();U.length>0&&(Y.append(...U),v(Y)),W.remove()}function m(Y){Y.update(()=>{const W=e.$getSelection();if(e.$isRangeSelection(W)){const J=new Set,R=W.getNodes(),U=W.anchor.getNode();if(_(U,R))J.add(r(U));else for(let X=0;X<R.length;X++){const fe=R[X];if(e.$isLeafNode(fe)){const _e=t.$getNearestNodeOfType(fe,P);_e!=null&&J.add(r(_e))}}for(const X of J){let fe=X;const _e=l(X);for(const B of _e){const A=e.$createParagraphNode();S(A,B.getChildren()),fe.insertAfter(A),fe=A,B.__key===W.anchor.key&&W.anchor.set(A.getKey(),0,"element"),B.__key===W.focus.key&&W.focus.set(A.getKey(),0,"element"),B.remove()}X.remove()}}})}function v(Y,W){const J=W||Y.getChildren();if(J!==void 0)for(let R=0;R<J.length;R++){const U=J[R];if(ce(U)){const X=U.getValue(),fe=T(U);X!==fe&&U.setValue(fe)}}}function k(Y){const W=new Set;if(d(Y)||W.has(Y.getKey()))return;const J=Y.getParent(),R=Y.getNextSibling(),U=Y.getPreviousSibling();if(d(R)&&d(U)){const X=U.getFirstChild();if(de(X)){X.append(Y);const fe=R.getFirstChild();if(de(fe)){const _e=fe.getChildren();S(X,_e),R.remove(),W.add(R.getKey())}v(X)}}else if(d(R)){const X=R.getFirstChild();if(de(X)){const fe=X.getFirstChild();fe!==null&&fe.insertBefore(Y),v(X)}}else if(d(U)){const X=U.getFirstChild();de(X)&&(X.append(Y),v(X))}else if(de(J)){const X=te(),fe=Ee(J.getListType());X.append(fe),fe.append(Y),U?U.insertAfter(X):R?R.insertBefore(X):J.append(X),v(fe)}de(J)&&v(J)}function G(Y){if(d(Y))return;const W=Y.getParent(),J=W?W.getParent():void 0,R=J?J.getParent():void 0;if(de(R)&&ce(J)&&de(W)){const U=W?W.getFirstChild():void 0,X=W?W.getLastChild():void 0;if(Y.is(U))J.insertBefore(Y),W.isEmpty()&&J.remove();else if(Y.is(X))J.insertAfter(Y),W.isEmpty()&&J.remove();else{const fe=W.getListType(),_e=te(),B=Ee(fe);_e.append(B),Y.getPreviousSiblings().forEach(se=>B.append(se));const A=te(),F=Ee(fe);A.append(F),S(F,Y.getNextSiblings()),J.insertBefore(_e),J.insertAfter(A),J.replace(Y)}v(W),v(R)}}function I(){const Y=e.$getSelection();if(!e.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const W=Y.anchor.getNode();if(!ce(W)||W.getChildrenSize()!==0)return!1;const J=r(W),R=W.getParent();if(!de(R))throw Error("A ListItemNode must have a ListNode for a parent.");const U=R.getParent();let X;if(e.$isRootOrShadowRoot(U))X=e.$createParagraphNode(),J.insertAfter(X);else if(ce(U))X=te(),U.insertAfter(X);else return!1;X.select();const fe=W.getNextSiblings();if(fe.length>0){const _e=Ee(R.getListType());if(e.$isParagraphNode(X))X.insertAfter(_e);else{const B=te();B.append(_e),X.insertAfter(B)}fe.forEach(B=>{B.remove(),_e.append(B)})}return f(W),!0}class P extends e.ElementNode{static getType(){return"listitem"}static clone(W){return new P(W.__value,W.__checked,W.__key)}constructor(W,J,R){super(R),this.__value=W===void 0?1:W,this.__checked=J}createDOM(W){const J=document.createElement("li"),R=this.getParent();return de(R)&&R.getListType()==="check"&&V(J,this,null),J.value=this.__value,H(J,W.theme,this),J}updateDOM(W,J,R){const U=this.getParent();return de(U)&&U.getListType()==="check"&&V(J,this,W),J.value=this.__value,H(J,R.theme,this),!1}static transform(){return W=>{const J=W.getParent();if(de(J)){if(v(J),!ce(W))throw Error("node is not a ListItemNode");J.getListType()!=="check"&&W.getChecked()!=null&&W.setChecked(void 0)}}}static importDOM(){return{li:W=>({conversion:re,priority:0})}}static importJSON(W){const J=te();return J.setChecked(W.checked),J.setValue(W.value),J.setFormat(W.format),J.setDirection(W.direction),J}exportDOM(W){const J=this.createDOM(W._config);return J.style.textAlign=this.getFormatType(),{element:J}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(e.$isElementNode(R)&&this.canMergeWith(R)){const U=R.getChildren();this.append(...U),R.remove()}else super.append(R)}return this}replace(W,J){if(ce(W))return super.replace(W);this.setIndent(0);const R=this.getParentOrThrow();if(!de(R))return W;if(R.__first===this.getKey())R.insertBefore(W);else if(R.__last===this.getKey())R.insertAfter(W);else{const U=Ee(R.getListType());let X=this.getNextSibling();for(;X;){const fe=X;X=X.getNextSibling(),U.append(fe)}R.insertAfter(W),W.insertAfter(U)}if(J){if(!e.$isElementNode(W))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(U=>{W.append(U)})}return this.remove(),R.getChildrenSize()===0&&R.remove(),W}insertAfter(W,J=!0){const R=this.getParentOrThrow();if(!de(R))throw Error("insertAfter: list node is not parent of list item node");const U=this.getNextSiblings();if(ce(W)){const X=super.insertAfter(W,J),fe=W.getParentOrThrow();return de(fe)&&v(fe),X}if(de(W)){let X=W;const fe=W.getChildren();for(let _e=fe.length-1;_e>=0;_e--)X=fe[_e],this.insertAfter(X,J);return X}if(R.insertAfter(W,J),U.length!==0){const X=Ee(R.getListType());U.forEach(fe=>X.append(fe)),W.insertAfter(X,J)}return W}remove(W){const J=this.getPreviousSibling(),R=this.getNextSibling();if(super.remove(W),J&&R&&d(J)&&d(R))M(J.getFirstChild(),R.getFirstChild()),R.remove();else if(R){const U=R.getParent();de(U)&&v(U)}}insertNewAfter(W,J=!0){const R=te(this.__checked==null?void 0:!1);return this.insertAfter(R,J),R}collapseAtStart(W){const J=e.$createParagraphNode();this.getChildren().forEach(_e=>J.append(_e));const U=this.getParentOrThrow(),X=U.getParentOrThrow(),fe=ce(X);if(U.getChildrenSize()===1)if(fe)U.remove(),X.select();else{U.insertBefore(J),U.remove();const _e=W.anchor,B=W.focus,A=J.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(A,_e.offset,"element"),B.type==="element"&&B.getNode().is(this)&&B.set(A,B.offset,"element")}else U.insertBefore(J),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(W){const J=this.getWritable();J.__value=W}getChecked(){return this.getLatest().__checked}setChecked(W){const J=this.getWritable();J.__checked=W}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const W=this.getParent();if(W===null)return this.getLatest().__indent;let J=W.getParentOrThrow(),R=0;for(;ce(J);)J=J.getParentOrThrow().getParentOrThrow(),R++;return R}setIndent(W){if(!(typeof W=="number"&&W>-1))throw Error("Invalid indent value.");let J=this.getIndent();for(;J!==W;)J<W?(k(this),J++):(G(this),J--);return this}insertBefore(W){if(ce(W)){const J=this.getParentOrThrow();if(de(J)){const R=this.getNextSiblings();v(J,R)}}return super.insertBefore(W)}canInsertAfter(W){return ce(W)}canReplaceWith(W){return ce(W)}canMergeWith(W){return e.$isParagraphNode(W)||ce(W)}extractWithChild(W,J){if(!e.$isRangeSelection(J))return!1;const R=J.anchor.getNode(),U=J.focus.getNode();return this.isParentOf(R)&&this.isParentOf(U)&&this.getTextContent().length===J.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function H(Y,W,J){const R=[],U=[],X=W.list,fe=X?X.listitem:void 0;let _e;if(X&&X.nested&&(_e=X.nested.listitem),fe!==void 0){const B=fe.split(" ");R.push(...B)}if(X){const B=J.getParent(),A=de(B)&&B.getListType()==="check",F=J.getChecked();(!A||F)&&U.push(X.listitemUnchecked),(!A||!F)&&U.push(X.listitemChecked),A&&R.push(F?X.listitemChecked:X.listitemUnchecked)}if(_e!==void 0){const B=_e.split(" ");J.getChildren().some(A=>de(A))?R.push(...B):U.push(...B)}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function V(Y,W,J,R){de(W.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!J||W.__checked!==J.__checked)&&Y.setAttribute("aria-checked",W.getChecked()?"true":"false"))}function re(Y){const W=t.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:te(W)}}function te(Y){return e.$applyNodeReplacement(new P(void 0,Y))}function ce(Y){return Y instanceof P}class j extends e.ElementNode{static getType(){return"list"}static clone(W){const J=W.__listType||Se[W.__tag];return new j(J,W.__start,W.__key)}constructor(W,J,R){super(R);const U=Se[W]||W;this.__listType=U,this.__tag=U==="number"?"ol":"ul",this.__start=J}getTag(){return this.__tag}setListType(W){const J=this.getWritable();J.__listType=W,J.__tag=W==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(W,J){const R=this.__tag,U=document.createElement(R);return this.__start!==1&&U.setAttribute("start",String(this.__start)),U.__lexicalListType=this.__listType,z(U,W.theme,this),U}updateDOM(W,J,R){return W.__tag!==this.__tag?!0:(z(J,R.theme,this),!1)}static importDOM(){return{ol:W=>({conversion:Te,priority:0}),ul:W=>({conversion:Te,priority:0})}}static importJSON(W){const J=Ee(W.listType,W.start);return J.setFormat(W.format),J.setIndent(W.indent),J.setDirection(W.direction),J}exportDOM(W){const{element:J}=super.exportDOM(W);return J&&t.isHTMLElement(J)&&(this.__start!==1&&J.setAttribute("start",String(this.__start)),this.__listType==="check"&&J.setAttribute("__lexicalListType","check")),{element:J}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(ce(R))super.append(R);else{const U=te();if(de(R))U.append(R);else if(e.$isElementNode(R)){const X=e.$createTextNode(R.getTextContent());U.append(X)}else U.append(R);super.append(U)}}return v(this),this}extractWithChild(W){return ce(W)}}function z(Y,W,J){const R=[],U=[],X=W.list;if(X!==void 0){const fe=X[`${J.__tag}Depth`]||[],_e=n(J)-1,B=_e%fe.length,A=fe[B],F=X[J.__tag];let se;const ye=X.nested;if(ye!==void 0&&ye.list&&(se=ye.list),F!==void 0&&R.push(F),A!==void 0){const De=A.split(" ");R.push(...De);for(let ee=0;ee<fe.length;ee++)ee!==B&&U.push(J.__tag+ee)}if(se!==void 0){const De=se.split(" ");_e>1?R.push(...De):U.push(...De)}}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function q(Y){const W=[];for(let J=0;J<Y.length;J++){const R=Y[J];if(ce(R)){W.push(R);const U=R.getChildren();U.length>1&&U.forEach(X=>{de(X)&&W.push(p(X))})}else W.push(p(R))}return W}function Te(Y){const W=Y.nodeName.toLowerCase();let J=null;if(W==="ol"){const R=Y.start;J=Ee("number",R)}else W==="ul"&&(t.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?J=Ee("check"):J=Ee("bullet"));return{after:q,node:J}}const Se={ol:"number",ul:"bullet"};function Ee(Y,W=1){return e.$applyNodeReplacement(new j(Y,W))}function de(Y){return Y instanceof j}const K=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),O=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Z=e.createCommand("INSERT_CHECK_LIST_COMMAND"),oe=e.createCommand("REMOVE_LIST_COMMAND");return gr.$createListItemNode=te,gr.$createListNode=Ee,gr.$getListDepth=n,gr.$handleListInsertParagraph=I,gr.$isListItemNode=ce,gr.$isListNode=de,gr.INSERT_CHECK_LIST_COMMAND=Z,gr.INSERT_ORDERED_LIST_COMMAND=O,gr.INSERT_UNORDERED_LIST_COMMAND=K,gr.ListItemNode=P,gr.ListNode=j,gr.REMOVE_LIST_COMMAND=oe,gr.insertList=E,gr.removeList=m,gr}var pr={},hh;function EC(){if(hh)return pr;hh=1;var e=Yt(),t=pn();function n(K){let O=new URLSearchParams;O.append("code",K);for(let Z=1;Z<arguments.length;Z++)O.append("v",arguments[Z]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${O} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let O=1;for(K=K.getParent();K!=null;){if(H(K)){if(K=K.getParent(),q(K)){O++,K=K.getParent();continue}n(40)}break}return O}function l(K){K=K.getParent(),q(K)||n(40);let O=K;for(;O!==null;)O=O.getParent(),q(O)&&(K=O);return K}function d(K){let O=[];K=K.getChildren().filter(H);for(let Z=0;Z<K.length;Z++){let oe=K[Z],Y=oe.getFirstChild();q(Y)?O=O.concat(d(Y)):O.push(oe)}return O}function f(K){return H(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let O=K.getParent();if(O==null||!H(K)&&!q(K))break;K=O}K.remove()}function _(K){return P().append(K)}function T(K,O){return H(K)&&(O.length===0||O.length===1&&K.is(O[0])&&K.getChildrenSize()===0)}function E(K,O){K.splice(K.getChildrenSize(),0,O)}function S(K,O){if(q(K))return K;let Z=K.getPreviousSibling(),oe=K.getNextSibling(),Y=P();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),E(Y,K.getChildren()),q(Z)&&O===Z.getListType()?(Z.append(Y),K.remove(),q(oe)&&O===oe.getListType()&&(E(Z,oe.getChildren()),oe.remove()),Z):q(oe)&&O===oe.getListType()?(oe.getFirstChildOrThrow().insertBefore(Y),K.remove(),oe):(O=z(O),O.append(Y),K.replace(O),M(O),O)}function w(K,O){var Z=K.getLastChild();let oe=O.getFirstChild();Z&&oe&&f(Z)&&f(oe)&&(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()),Z=O.getChildren(),0<Z.length&&(K.append(...Z),M(K)),O.remove()}function M(K,O){if(K=O||K.getChildren(),K!==void 0)for(O=0;O<K.length;O++){let W=K[O];if(H(W)){let J=W.getValue();var Z=W,oe=Z.getParent(),Y=1;for(oe!=null&&(q(oe)?Y=oe.getStart():n(44)),Z=Z.getPreviousSiblings(),oe=0;oe<Z.length;oe++){let R=Z[oe];H(R)&&!q(R.getFirstChild())&&Y++}J!==Y&&W.setValue(Y)}}}function m(K){if(!f(K)){var O=K.getParent(),Z=O?O.getParent():void 0,oe=Z?Z.getParent():void 0;if(q(oe)&&H(Z)&&q(O)){var Y=O?O.getFirstChild():void 0,W=O?O.getLastChild():void 0;if(K.is(Y))Z.insertBefore(K),O.isEmpty()&&Z.remove();else if(K.is(W))Z.insertAfter(K),O.isEmpty()&&Z.remove();else{var J=O.getListType();Y=P();let R=z(J);Y.append(R),K.getPreviousSiblings().forEach(U=>R.append(U)),W=P(),J=z(J),W.append(J),E(J,K.getNextSiblings()),Z.insertBefore(Y),Z.insertAfter(W),Z.replace(K)}M(O),M(oe)}}}class v extends e.ElementNode{static getType(){return"listitem"}static clone(O){return new v(O.__value,O.__checked,O.__key)}constructor(O,Z,oe){super(oe),this.__value=O===void 0?1:O,this.__checked=Z}createDOM(O){let Z=document.createElement("li"),oe=this.getParent();return q(oe)&&oe.getListType()==="check"&&G(Z,this,null),Z.value=this.__value,k(Z,O.theme,this),Z}updateDOM(O,Z,oe){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&G(Z,this,O),Z.value=this.__value,k(Z,oe.theme,this),!1}static transform(){return O=>{let Z=O.getParent();if(q(Z)){if(M(Z),!H(O))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&O.getChecked()!=null&&O.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:I,priority:0})}}static importJSON(O){let Z=P();return Z.setChecked(O.checked),Z.setValue(O.value),Z.setFormat(O.format),Z.setDirection(O.direction),Z}exportDOM(O){return O=this.createDOM(O._config),O.style.textAlign=this.getFormatType(),{element:O}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...O){for(let Z=0;Z<O.length;Z++){let oe=O[Z];if(e.$isElementNode(oe)&&this.canMergeWith(oe)){let Y=oe.getChildren();this.append(...Y),oe.remove()}else super.append(oe)}return this}replace(O,Z){if(H(O))return super.replace(O);this.setIndent(0);let oe=this.getParentOrThrow();if(!q(oe))return O;if(oe.__first===this.getKey())oe.insertBefore(O);else if(oe.__last===this.getKey())oe.insertAfter(O);else{let Y=z(oe.getListType()),W=this.getNextSibling();for(;W;){let J=W;W=W.getNextSibling(),Y.append(J)}oe.insertAfter(O),O.insertAfter(Y)}if(Z){if(!e.$isElementNode(O))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Y=>{O.append(Y)})}return this.remove(),oe.getChildrenSize()===0&&oe.remove(),O}insertAfter(O,Z=!0){var oe=this.getParentOrThrow();q(oe)||n(39);var Y=this.getNextSiblings();if(H(O))return Z=super.insertAfter(O,Z),O=O.getParentOrThrow(),q(O)&&M(O),Z;if(q(O)){for(oe=O,O=O.getChildren(),Y=O.length-1;0<=Y;Y--)oe=O[Y],this.insertAfter(oe,Z);return oe}if(oe.insertAfter(O,Z),Y.length!==0){let W=z(oe.getListType());Y.forEach(J=>W.append(J)),O.insertAfter(W,Z)}return O}remove(O){let Z=this.getPreviousSibling(),oe=this.getNextSibling();super.remove(O),Z&&oe&&f(Z)&&f(oe)?(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()):oe&&(O=oe.getParent(),q(O)&&M(O))}insertNewAfter(O,Z=!0){return O=P(this.__checked==null?void 0:!1),this.insertAfter(O,Z),O}collapseAtStart(O){let Z=e.$createParagraphNode();this.getChildren().forEach(J=>Z.append(J));var oe=this.getParentOrThrow(),Y=oe.getParentOrThrow();let W=H(Y);return oe.getChildrenSize()===1?W?(oe.remove(),Y.select()):(oe.insertBefore(Z),oe.remove(),oe=O.anchor,O=O.focus,Y=Z.getKey(),oe.type==="element"&&oe.getNode().is(this)&&oe.set(Y,oe.offset,"element"),O.type==="element"&&O.getNode().is(this)&&O.set(Y,O.offset,"element")):(oe.insertBefore(Z),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(O){this.getWritable().__value=O}getChecked(){return this.getLatest().__checked}setChecked(O){this.getWritable().__checked=O}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var O=this.getParent();if(O===null)return this.getLatest().__indent;O=O.getParentOrThrow();let Z=0;for(;H(O);)O=O.getParentOrThrow().getParentOrThrow(),Z++;return Z}setIndent(O){typeof O=="number"&&-1<O||n(117);let Z=this.getIndent();for(;Z!==O;)if(Z<O){e:{var oe=new Set;if(f(this)||oe.has(this.getKey()))break e;let R=this.getParent();var Y=this.getNextSibling(),W=this.getPreviousSibling();if(f(Y)&&f(W)){if(W=W.getFirstChild(),q(W)){W.append(this);var J=Y.getFirstChild();q(J)&&(J=J.getChildren(),E(W,J),Y.remove(),oe.add(Y.getKey())),M(W)}}else f(Y)?(Y=Y.getFirstChild(),q(Y)&&(oe=Y.getFirstChild(),oe!==null&&oe.insertBefore(this),M(Y))):f(W)?(Y=W.getFirstChild(),q(Y)&&(Y.append(this),M(Y))):q(R)&&(oe=P(),J=z(R.getListType()),oe.append(J),J.append(this),W?W.insertAfter(oe):Y?Y.insertBefore(oe):R.append(oe),M(J));q(R)&&M(R)}Z++}else m(this),Z--;return this}insertBefore(O){if(H(O)){let Z=this.getParentOrThrow();if(q(Z)){let oe=this.getNextSiblings();M(Z,oe)}}return super.insertBefore(O)}canInsertAfter(O){return H(O)}canReplaceWith(O){return H(O)}canMergeWith(O){return e.$isParagraphNode(O)||H(O)}extractWithChild(O,Z){if(!e.$isRangeSelection(Z))return!1;O=Z.anchor.getNode();let oe=Z.focus.getNode();return this.isParentOf(O)&&this.isParentOf(oe)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return z("bullet")}}function k(K,O,Z){let oe=[],Y=[];var W=(O=O.list)?O.listitem:void 0;if(O&&O.nested)var J=O.nested.listitem;if(W!==void 0&&(W=W.split(" "),oe.push(...W)),O){W=Z.getParent(),W=q(W)&&W.getListType()==="check";let R=Z.getChecked();W&&!R||Y.push(O.listitemUnchecked),W&&R||Y.push(O.listitemChecked),W&&oe.push(R?O.listitemChecked:O.listitemUnchecked)}J!==void 0&&(J=J.split(" "),Z.getChildren().some(R=>q(R))?oe.push(...J):Y.push(...J)),0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function G(K,O,Z){q(O.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),Z&&O.__checked===Z.__checked||K.setAttribute("aria-checked",O.getChecked()?"true":"false"))}function I(K){return K=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:P(K)}}function P(K){return e.$applyNodeReplacement(new v(void 0,K))}function H(K){return K instanceof v}class V extends e.ElementNode{static getType(){return"list"}static clone(O){return new V(O.__listType||j[O.__tag],O.__start,O.__key)}constructor(O,Z,oe){super(oe),this.__listType=O=j[O]||O,this.__tag=O==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(O){let Z=this.getWritable();Z.__listType=O,Z.__tag=O==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(O){let Z=document.createElement(this.__tag);return this.__start!==1&&Z.setAttribute("start",String(this.__start)),Z.__lexicalListType=this.__listType,re(Z,O.theme,this),Z}updateDOM(O,Z,oe){return O.__tag!==this.__tag?!0:(re(Z,oe.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ce,priority:0}),ul:()=>({conversion:ce,priority:0})}}static importJSON(O){let Z=z(O.listType,O.start);return Z.setFormat(O.format),Z.setIndent(O.indent),Z.setDirection(O.direction),Z}exportDOM(O){return{element:O}=super.exportDOM(O),O&&t.isHTMLElement(O)&&(this.__start!==1&&O.setAttribute("start",String(this.__start)),this.__listType==="check"&&O.setAttribute("__lexicalListType","check")),{element:O}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...O){for(let oe=0;oe<O.length;oe++){var Z=O[oe];if(H(Z))super.append(Z);else{let Y=P();q(Z)||e.$isElementNode(Z)&&(Z=e.$createTextNode(Z.getTextContent())),Y.append(Z),super.append(Y)}}return M(this),this}extractWithChild(O){return H(O)}}function re(K,O,Z){let oe=[],Y=[];var W=O.list;if(W!==void 0){let R=W[`${Z.__tag}Depth`]||[];O=r(Z)-1;let U=O%R.length;var J=R[U];let X=W[Z.__tag],fe;if(W=W.nested,W!==void 0&&W.list&&(fe=W.list),X!==void 0&&oe.push(X),J!==void 0)for(J=J.split(" "),oe.push(...J),J=0;J<R.length;J++)J!==U&&Y.push(Z.__tag+J);fe!==void 0&&(Z=fe.split(" "),1<O?oe.push(...Z):Y.push(...Z))}0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function te(K){let O=[];for(let oe=0;oe<K.length;oe++){var Z=K[oe];H(Z)?(O.push(Z),Z=Z.getChildren(),1<Z.length&&Z.forEach(Y=>{q(Y)&&O.push(_(Y))})):O.push(_(Z))}return O}function ce(K){let O=K.nodeName.toLowerCase(),Z=null;return O==="ol"?Z=z("number",K.start):O==="ul"&&(Z=t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?z("check"):z("bullet")),{after:te,node:Z}}let j={ol:"number",ul:"bullet"};function z(K,O=1){return e.$applyNodeReplacement(new V(K,O))}function q(K){return K instanceof V}let Te=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),Se=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),de=e.createCommand("REMOVE_LIST_COMMAND");return pr.$createListItemNode=P,pr.$createListNode=z,pr.$getListDepth=r,pr.$handleListInsertParagraph=function(){var K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!H(K)||K.getChildrenSize()!==0))return!1;var O=l(K),Z=K.getParent();q(Z)||n(40);let oe=Z.getParent(),Y;if(e.$isRootOrShadowRoot(oe))Y=e.$createParagraphNode(),O.insertAfter(Y);else if(H(oe))Y=P(),oe.insertAfter(Y);else return!1;if(Y.select(),O=K.getNextSiblings(),0<O.length){let W=z(Z.getListType());e.$isParagraphNode(Y)?Y.insertAfter(W):(Z=P(),Z.append(W),Y.insertAfter(Z)),O.forEach(J=>{J.remove(),W.append(J)})}return p(K),!0},pr.$isListItemNode=H,pr.$isListNode=q,pr.INSERT_CHECK_LIST_COMMAND=Ee,pr.INSERT_ORDERED_LIST_COMMAND=Se,pr.INSERT_UNORDERED_LIST_COMMAND=Te,pr.ListItemNode=v,pr.ListNode=V,pr.REMOVE_LIST_COMMAND=de,pr.insertList=function(K,O){K.update(()=>{var Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){var oe=Z.getNodes();Z=Z.anchor.getNode();var Y=Z.getParent();if(T(Z,oe))oe=z(O),e.$isRootOrShadowRoot(Y)?(Z.replace(oe),Y=P(),e.$isElementNode(Z)&&(Y.setFormat(Z.getFormatType()),Y.setIndent(Z.getIndent())),oe.append(Y)):H(Z)&&(Z=Z.getParentOrThrow(),E(oe,Z.getChildren()),Z.replace(oe));else for(Z=new Set,Y=0;Y<oe.length;Y++){var W=oe[Y];if(e.$isElementNode(W)&&W.isEmpty()&&!H(W)&&!Z.has(W.getKey()))S(W,O);else if(e.$isLeafNode(W))for(W=W.getParent();W!=null;){let R=W.getKey();if(q(W)){if(!Z.has(R)){var J=z(O);E(J,W.getChildren()),W.replace(J),M(J),Z.add(R)}break}else{if(J=W.getParent(),e.$isRootOrShadowRoot(J)&&!Z.has(R)){Z.add(R),S(W,O);break}W=J}}}}})},pr.removeList=function(K){K.update(()=>{let O=e.$getSelection();if(e.$isRangeSelection(O)){var Z=new Set,oe=O.getNodes(),Y=O.anchor.getNode();if(T(Y,oe))Z.add(l(Y));else for(Y=0;Y<oe.length;Y++){var W=oe[Y];e.$isLeafNode(W)&&(W=t.$getNearestNodeOfType(W,v),W!=null&&Z.add(l(W)))}for(let J of Z){Z=J,oe=d(J);for(let R of oe)oe=e.$createParagraphNode(),E(oe,R.getChildren()),Z.insertAfter(oe),Z=oe,R.__key===O.anchor.key&&O.anchor.set(oe.getKey(),0,"element"),R.__key===O.focus.key&&O.focus.set(oe.getKey(),0,"element"),R.remove();J.remove()}}})},pr}var yu,gh;function _d(){return gh||(gh=1,yu=process.env.NODE_ENV==="development"?CC():EC()),yu}var ph;function TC(){if(ph)return _u;ph=1;var e=_d(),t=qn(),n=nt,r=pn(),l=Yt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(p,"number"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(p,"bullet"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(p),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[p])}function f(){const[p]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([e.ListNode,e.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return _u.ListPlugin=f,_u}var Nu={},mh;function xC(){if(mh)return Nu;mh=1;var e=_d(),t=qn(),n=nt,r=pn(),l=Yt();function d(f){n.useEffect(()=>r.mergeRegister(f.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(f,"number"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(f,"bullet"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(f),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[f])}return Nu.ListPlugin=function(){let[f]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!f.hasNodes([e.ListNode,e.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[f]),d(f),null},Nu}const vC=process.env.NODE_ENV==="development"?TC():xC();var SC=vC,Cu={},wi={},_h;function wC(){if(_h)return wi;_h=1;var e=pn(),t=Yt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(m){return new r(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}constructor(m,v={},k){super(k);const{target:G=null,rel:I=null,title:P=null}=v;this.__url=m,this.__target=G,this.__rel=I,this.__title=P}createDOM(m){const v=document.createElement("a");return v.href=this.sanitizeUrl(this.__url),this.__target!==null&&(v.target=this.__target),this.__rel!==null&&(v.rel=this.__rel),this.__title!==null&&(v.title=this.__title),e.addClassNamesToElement(v,m.theme.link),v}updateDOM(m,v,k){const G=this.__url,I=this.__target,P=this.__rel,H=this.__title;return G!==m.__url&&(v.href=G),I!==m.__target&&(I?v.target=I:v.removeAttribute("target")),P!==m.__rel&&(P?v.rel=P:v.removeAttribute("rel")),H!==m.__title&&(H?v.title=H:v.removeAttribute("title")),!1}static importDOM(){return{a:m=>({conversion:l,priority:1})}}static importJSON(m){const v=d(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}sanitizeUrl(m){try{const v=new URL(m);if(!n.has(v.protocol))return"about:blank"}catch{return m}return m}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(m){const v=this.getWritable();v.__url=m}getTarget(){return this.getLatest().__target}setTarget(m){const v=this.getWritable();v.__target=m}getRel(){return this.getLatest().__rel}setRel(m){const v=this.getWritable();v.__rel=m}getTitle(){return this.getLatest().__title}setTitle(m){const v=this.getWritable();v.__title=m}insertNewAfter(m,v=!0){const k=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(k,v),k}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(m,v,k){if(!t.$isRangeSelection(v))return!1;const G=v.anchor.getNode(),I=v.focus.getNode();return this.isParentOf(G)&&this.isParentOf(I)&&v.getTextContent().length>0}}function l(M){let m=null;if(e.isHTMLAnchorElement(M)){const v=M.textContent;(v!==null&&v!==""||M.children.length>0)&&(m=d(M.getAttribute("href")||"",{rel:M.getAttribute("rel"),target:M.getAttribute("target"),title:M.getAttribute("title")}))}return{node:m}}function d(M,m){return t.$applyNodeReplacement(new r(M,m))}function f(M){return M instanceof r}class p extends r{static getType(){return"autolink"}static clone(m){return new p(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}static importJSON(m){const v=_(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(m,v=!0){const k=this.getParentOrThrow().insertNewAfter(m,v);if(t.$isElementNode(k)){const G=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return k.append(G),G}return null}}function _(M,m){return t.$applyNodeReplacement(new p(M,m))}function T(M){return M instanceof p}const E=t.createCommand("TOGGLE_LINK_COMMAND");function S(M,m={}){const{target:v,title:k}=m,G=m.rel===void 0?"noreferrer":m.rel,I=t.$getSelection();if(!t.$isRangeSelection(I))return;const P=I.extract();if(M===null)P.forEach(H=>{const V=H.getParent();if(f(V)){const re=V.getChildren();for(let te=0;te<re.length;te++)V.insertBefore(re[te]);V.remove()}});else{if(P.length===1){const re=P[0],te=w(re,f);if(te!==null){te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&te.setRel(G),k!==void 0&&te.setTitle(k);return}}let H=null,V=null;P.forEach(re=>{const te=re.getParent();if(!(te===V||te===null||t.$isElementNode(re)&&!re.isInline())){if(f(te)){V=te,te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&V.setRel(G),k!==void 0&&V.setTitle(k);return}if(te.is(H)||(H=te,V=d(M,{rel:G,target:v,title:k}),f(te)?re.getPreviousSibling()===null?te.insertBefore(V):te.insertAfter(V):re.insertBefore(V)),f(re)){if(re.is(V))return;if(V!==null){const ce=re.getChildren();for(let j=0;j<ce.length;j++)V.append(ce[j])}re.remove();return}V!==null&&V.append(re)}})}}function w(M,m){let v=M;for(;v!==null&&v.getParent()!==null&&!m(v);)v=v.getParentOrThrow();return m(v)?v:null}return wi.$createAutoLinkNode=_,wi.$createLinkNode=d,wi.$isAutoLinkNode=T,wi.$isLinkNode=f,wi.AutoLinkNode=p,wi.LinkNode=r,wi.TOGGLE_LINK_COMMAND=E,wi.toggleLink=S,wi}var Oi={},yh;function OC(){if(yh)return Oi;yh=1;var e=pn(),t=Yt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(w){return new r(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}constructor(w,M={},m){super(m);let{target:v=null,rel:k=null,title:G=null}=M;this.__url=w,this.__target=v,this.__rel=k,this.__title=G}createDOM(w){let M=document.createElement("a");return M.href=this.sanitizeUrl(this.__url),this.__target!==null&&(M.target=this.__target),this.__rel!==null&&(M.rel=this.__rel),this.__title!==null&&(M.title=this.__title),e.addClassNamesToElement(M,w.theme.link),M}updateDOM(w,M){let m=this.__url,v=this.__target,k=this.__rel,G=this.__title;return m!==w.__url&&(M.href=m),v!==w.__target&&(v?M.target=v:M.removeAttribute("target")),k!==w.__rel&&(k?M.rel=k:M.removeAttribute("rel")),G!==w.__title&&(G?M.title=G:M.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:l,priority:1})}}static importJSON(w){let M=d(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}sanitizeUrl(w){try{let M=new URL(w);if(!n.has(M.protocol))return"about:blank"}catch{}return w}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(w){this.getWritable().__url=w}getTarget(){return this.getLatest().__target}setTarget(w){this.getWritable().__target=w}getRel(){return this.getLatest().__rel}setRel(w){this.getWritable().__rel=w}getTitle(){return this.getLatest().__title}setTitle(w){this.getWritable().__title=w}insertNewAfter(w,M=!0){return w=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(w,M),w}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(w,M){if(!t.$isRangeSelection(M))return!1;w=M.anchor.getNode();let m=M.focus.getNode();return this.isParentOf(w)&&this.isParentOf(m)&&0<M.getTextContent().length}}function l(S){let w=null;if(e.isHTMLAnchorElement(S)){let M=S.textContent;(M!==null&&M!==""||0<S.children.length)&&(w=d(S.getAttribute("href")||"",{rel:S.getAttribute("rel"),target:S.getAttribute("target"),title:S.getAttribute("title")}))}return{node:w}}function d(S,w){return t.$applyNodeReplacement(new r(S,w))}function f(S){return S instanceof r}class p extends r{static getType(){return"autolink"}static clone(w){return new p(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}static importJSON(w){let M=_(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(w,M=!0){return w=this.getParentOrThrow().insertNewAfter(w,M),t.$isElementNode(w)?(M=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),w.append(M),M):null}}function _(S,w){return t.$applyNodeReplacement(new p(S,w))}let T=t.createCommand("TOGGLE_LINK_COMMAND");function E(S,w){for(;S!==null&&S.getParent()!==null&&!w(S);)S=S.getParentOrThrow();return w(S)?S:null}return Oi.$createAutoLinkNode=_,Oi.$createLinkNode=d,Oi.$isAutoLinkNode=function(S){return S instanceof p},Oi.$isLinkNode=f,Oi.AutoLinkNode=p,Oi.LinkNode=r,Oi.TOGGLE_LINK_COMMAND=T,Oi.toggleLink=function(S,w={}){let{target:M,title:m}=w,v=w.rel===void 0?"noreferrer":w.rel;if(w=t.$getSelection(),t.$isRangeSelection(w))if(w=w.extract(),S===null)w.forEach(k=>{if(k=k.getParent(),f(k)){let G=k.getChildren();for(let I=0;I<G.length;I++)k.insertBefore(G[I]);k.remove()}});else{if(w.length===1){let I=E(w[0],f);if(I!==null){I.setURL(S),M!==void 0&&I.setTarget(M),v!==null&&I.setRel(v),m!==void 0&&I.setTitle(m);return}}let k=null,G=null;w.forEach(I=>{var P=I.getParent();if(P!==G&&P!==null&&(!t.$isElementNode(I)||I.isInline()))if(f(P))G=P,P.setURL(S),M!==void 0&&P.setTarget(M),v!==null&&G.setRel(v),m!==void 0&&G.setTitle(m);else if(P.is(k)||(k=P,G=d(S,{rel:v,target:M,title:m}),f(P)?I.getPreviousSibling()===null?P.insertBefore(G):P.insertAfter(G):I.insertBefore(G)),f(I)){if(!I.is(G)){if(G!==null){P=I.getChildren();for(let H=0;H<P.length;H++)G.append(P[H])}I.remove()}}else G!==null&&G.append(I)})}},Oi}var Eu,Nh;function yd(){return Nh||(Nh=1,Eu=process.env.NODE_ENV==="development"?wC():OC()),Eu}var Ch;function DC(){if(Ch)return Cu;Ch=1;var e=yd(),t=qn(),n=pn(),r=Yt(),l=nt;function d({validateUrl:f}){const[p]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!p.hasNodes([e.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(e.TOGGLE_LINK_COMMAND,_=>{if(_===null)return e.toggleLink(_),!0;if(typeof _=="string")return f===void 0||f(_)?(e.toggleLink(_),!0):!1;{const{url:T,target:E,rel:S,title:w}=_;return e.toggleLink(T,{rel:S,target:E,title:w}),!0}},r.COMMAND_PRIORITY_LOW),f!==void 0?p.registerCommand(r.PASTE_COMMAND,_=>{const T=r.$getSelection();if(!r.$isRangeSelection(T)||T.isCollapsed()||!(_ instanceof ClipboardEvent)||_.clipboardData==null)return!1;const E=_.clipboardData.getData("text");return f(E)?T.getNodes().some(S=>r.$isElementNode(S))?!1:(p.dispatchCommand(e.TOGGLE_LINK_COMMAND,E),_.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,f]),null}return Cu.LinkPlugin=d,Cu}var Tu={},Eh;function AC(){if(Eh)return Tu;Eh=1;var e=yd(),t=qn(),n=pn(),r=Yt(),l=nt;return Tu.LinkPlugin=function({validateUrl:d}){let[f]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!f.hasNodes([e.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(f.registerCommand(e.TOGGLE_LINK_COMMAND,p=>{if(p===null)return e.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(e.toggleLink(p),!0):!1;let{url:_,target:T,rel:E,title:S}=p;return e.toggleLink(_,{rel:E,target:T,title:S}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?f.registerCommand(r.PASTE_COMMAND,p=>{let _=r.$getSelection();if(!r.$isRangeSelection(_)||_.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let T=p.clipboardData.getData("text");return d(T)?_.getNodes().some(E=>r.$isElementNode(E))?!1:(f.dispatchCommand(e.TOGGLE_LINK_COMMAND,T),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[f,d]),null},Tu}const MC=process.env.NODE_ENV==="development"?DC():AC();var RC=MC,xu={},Zt={},Th;function bC(){if(Th)return Zt;Th=1;var e=Yt(),t=pn();class n extends e.INTERNAL_PointSelection{constructor(ie,le,ve){super(le,ve),this.gridKey=ie}getCachedNodes(){return this._cachedNodes}setCachedNodes(ie){this._cachedNodes=ie}is(ie){return r(ie)?this.gridKey===ie.gridKey&&this.anchor.is(ie.anchor)&&this.focus.is(ie.focus):!1}set(ie,le,ve){this.dirty=!0,this.gridKey=ie,this.anchor.key=le,this.focus.key=ve,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ie){}insertText(){}insertNodes(ie){const le=this.focus.getNode();if(!e.$isElementNode(le))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(le.select(0,le.getChildrenSize())).insertNodes(ie)}getShape(){const ie=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ie))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const le=e.DEPRECATED_$getGridCellNodeRect(ie);if(le===null)throw Error("getCellRect: expected to find AnchorNode");const ve=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(ve))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Le=e.DEPRECATED_$getGridCellNodeRect(ve);if(Le===null)throw Error("getCellRect: expected to find focusCellNode");const Me=Math.min(le.columnIndex,Le.columnIndex),Ve=Math.max(le.columnIndex,Le.columnIndex),rt=Math.min(le.rowIndex,Le.rowIndex),it=Math.max(le.rowIndex,Le.rowIndex);return{fromX:Math.min(Me,Ve),fromY:Math.min(rt,it),toX:Math.max(Me,Ve),toY:Math.max(rt,it)}}getNodes(){const ie=this._cachedNodes;if(ie!==null)return ie;const le=this.anchor.getNode(),ve=this.focus.getNode(),Le=t.$findMatchingParent(le,e.DEPRECATED_$isGridCellNode),Me=t.$findMatchingParent(ve,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Le))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!e.DEPRECATED_$isGridCellNode(Me))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Ve=Le.getParent();if(!e.DEPRECATED_$isGridRowNode(Ve))throw Error("Expected anchorCell to have a parent GridRowNode");const rt=Ve.getParent();if(!e.DEPRECATED_$isGridNode(rt))throw Error("Expected tableNode to have a parent GridNode");const it=Me.getParents()[1];if(it!==rt){if(rt.isParentOf(Me)){const It=it.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),It.getKey())}else{const It=rt.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),Me.getKey())}return this.getNodes()}const[st,vt,Ge]=e.DEPRECATED_$computeGridMap(rt,Le,Me);let ze=Math.min(vt.startColumn,Ge.startColumn),tt=Math.min(vt.startRow,Ge.startRow),yt=Math.max(vt.startColumn+vt.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(vt.startRow+vt.cell.__rowSpan-1,Ge.startRow+Ge.cell.__rowSpan-1),Et=ze,gt=tt,xt=ze,mt=tt;function $t(It){const{cell:Vt,startColumn:bt,startRow:nn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,nn),yt=Math.max(yt,bt+Vt.__colSpan-1),Nt=Math.max(Nt,nn+Vt.__rowSpan-1)}for(;ze<Et||tt<gt||yt>xt||Nt>mt;){if(ze<Et){const It=mt-gt,Vt=Et-1;for(let bt=0;bt<=It;bt++)$t(st[gt+bt][Vt]);Et=Vt}if(tt<gt){const It=xt-Et,Vt=gt-1;for(let bt=0;bt<=It;bt++)$t(st[Vt][Et+bt]);gt=Vt}if(yt>xt){const It=mt-gt,Vt=xt+1;for(let bt=0;bt<=It;bt++)$t(st[gt+bt][Vt]);xt=Vt}if(Nt>mt){const It=xt-Et,Vt=mt+1;for(let bt=0;bt<=It;bt++)$t(st[Vt][Et+bt]);mt=Vt}}const Kt=[rt];let tn=null;for(let It=tt;It<=Nt;It++)for(let Vt=ze;Vt<=yt;Vt++){const{cell:bt}=st[It][Vt],nn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected GridCellNode parent to be a GridRowNode");nn!==tn&&Kt.push(nn),Kt.push(bt,...d(bt)),tn=nn}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Kt),Kt}getTextContent(){const ie=this.getNodes();let le="";for(let ve=0;ve<ie.length;ve++)le+=ie[ve].getTextContent();return le}}function r(Oe){return Oe instanceof n}function l(){const Oe=e.$createPoint("root",0,"element"),ie=e.$createPoint("root",0,"element");return new n("root",Oe,ie)}function d(Oe){const ie=[],le=[Oe];for(;le.length>0;){const ve=le.pop();if(ve===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(ve)&&le.unshift(...ve.getChildren()),ve!==Oe&&ie.push(ve)}return ie}const f=/^(\d+(?:\.\d+)?)px$/,p={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class _ extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const le=new _(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return le.__rowSpan=ie.__rowSpan,le.__backgroundColor=ie.__backgroundColor,le}static importDOM(){return{td:ie=>({conversion:T,priority:0}),th:ie=>({conversion:T,priority:0})}}static importJSON(ie){const le=ie.colSpan||1,ve=ie.rowSpan||1,Le=E(ie.headerState,le,ie.width||void 0);return Le.__rowSpan=ve,Le.__backgroundColor=ie.backgroundColor||null,Le}constructor(ie=p.NO_STATUS,le=1,ve,Le){super(le,Le),this.__headerState=ie,this.__width=ve,this.__backgroundColor=null}createDOM(ie){const le=document.createElement(this.getTag());return this.__width&&(le.style.width=`${this.__width}px`),this.__colSpan>1&&(le.colSpan=this.__colSpan),this.__rowSpan>1&&(le.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(le.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(le,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),le}exportDOM(ie){const{element:le}=super.exportDOM(ie);if(le){const ve=le,Le=700,Me=this.getParentOrThrow().getChildrenSize();ve.style.border="1px solid black",this.__colSpan>1&&(ve.colSpan=this.__colSpan),this.__rowSpan>1&&(ve.rowSpan=this.__rowSpan),ve.style.width=`${this.getWidth()||Math.max(90,Le/Me)}px`,ve.style.verticalAlign="top",ve.style.textAlign="start";const Ve=this.getBackgroundColor();Ve!==null?ve.style.backgroundColor=Ve:this.hasHeader()&&(ve.style.backgroundColor="#f2f3f5")}return{element:le}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const le=this.getWritable();return le.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const le=this.getWritable();return le.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const le=this.getWritable();return(le.__headerState&ie)===ie?le.__headerState-=ie:le.__headerState+=ie,le}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==p.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(Oe){const ie=Oe,le=Oe.nodeName.toLowerCase();let ve;f.test(ie.style.width)&&(ve=parseFloat(ie.style.width));const Le=E(le==="th"?p.ROW:p.NO_STATUS,ie.colSpan,ve);Le.__rowSpan=ie.rowSpan;const Me=ie.style.backgroundColor;return Me!==""&&(Le.__backgroundColor=Me),{forChild:(Ve,rt)=>{if(S(rt)&&!e.$isElementNode(Ve)){const it=e.$createParagraphNode();return e.$isLineBreakNode(Ve)&&Ve.getTextContent()===`
|
|
79
|
-
`?null:(it.append(Ve),it)}return Ve},node:Le}}function E(Oe,ie=1,le){return e.$applyNodeReplacement(new _(Oe,ie,le))}function S(Oe){return Oe instanceof _}class w extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new w(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:M,priority:0})}}static importJSON(ie){return m(ie.height)}constructor(ie,le){super(le),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const le=document.createElement("tr");return this.__height&&(le.style.height=`${this.__height}px`),t.addClassNamesToElement(le,ie.theme.tableRow),le}isShadowRoot(){return!0}setHeight(ie){const le=this.getWritable();return le.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function M(Oe){const ie=Oe;let le;return f.test(ie.style.height)&&(le=parseFloat(ie.style.height)),{node:m(le)}}function m(Oe){return e.$applyNodeReplacement(new w(Oe))}function v(Oe){return Oe instanceof w}const k=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Oe=>k?(Oe||window).getSelection():null;class I{constructor(ie,le){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=le,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(le=>{this.editor.update(()=>{let ve=!1;for(let Me=0;Me<le.length;Me++){const it=le[Me].target.nodeName;if(it==="TABLE"||it==="TR"){ve=!0;break}}if(!ve)return;const Le=this.editor.getElementByKey(this.tableNodeKey);if(!Le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(Le)})});this.editor.update(()=>{const le=this.editor.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(le),ie.observe(le,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=ie.getElementByKey(this.tableNodeKey);if(!ve)throw new Error("Expected to find TableElement in DOM");const Le=ce(ve);j(ie,Le,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(le,ie._config.theme.tableSelection),le.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(le,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const le=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(le,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,le=!1){const ve=this.editor;ve.update(()=>{const Le=e.$getNodeByKey(this.tableNodeKey);if(!B(Le))throw new Error("Expected TableNode.");if(!ve.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const Ve=ie.x,rt=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const it=G(ve._window);it&&it.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==Ve||this.anchorY!==rt||le))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(Ve===this.focusX&&rt===this.focusY)return;if(this.focusX=Ve,this.focusY=rt,this.isHighlightingCells){const it=e.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&S(it)){const st=it.getKey();this.gridSelection=this.gridSelection.clone()||l(),this.focusCellNodeKey=st,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),ve.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),j(ve,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const le=e.$getNearestNodeFromDOMNode(ie.elem);if(S(le)){const ve=le.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():l(),this.anchorCellNodeKey=ve}})}formatCells(ie){this.editor.update(()=>{const le=e.$getSelection();if(!r(le))throw Error("Expected grid selection");const ve=e.$createRangeSelection(),Le=ve.anchor,Me=ve.focus;le.getNodes().forEach(Ve=>{S(Ve)&&Ve.getTextContentSize()!==0&&(Le.set(Ve.getKey(),0,"element"),Me.set(Ve.getKey(),Ve.getChildrenSize(),"element"),ve.formatText(ie))}),e.$setSelection(le),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=e.$getSelection();if(!r(ve))throw Error("Expected grid selection");const Le=ve.getNodes().filter(S);if(Le.length===this.grid.columns*this.grid.rows){le.selectPrevious(),le.remove(),e.$getRoot().selectStart();return}Le.forEach(Me=>{if(e.$isElementNode(Me)){const Ve=e.$createParagraphNode(),rt=e.$createTextNode();Ve.append(rt),Me.append(Ve),Me.getChildren().forEach(it=>{it!==Ve&&it.remove()})}}),j(ie,this.grid,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const P="__lexicalTableSelection";function H(Oe,ie,le,ve){const Le=le.getRootElement();if(Le===null)throw new Error("No root element.");const Me=new I(le,Oe.getKey()),Ve=le._window||window;V(ie,Me),ie.addEventListener("mousedown",Ge=>{setTimeout(()=>{if(Ge.button!==0||!Ve)return;const ze=te(Ge.target);ze!==null&&(R(Ge),Me.setAnchorCellForSelection(ze));const tt=()=>{Ve.removeEventListener("mouseup",tt),Ve.removeEventListener("mousemove",yt)},yt=Nt=>{const Et=te(Nt.target);Et!==null&&(Me.anchorX!==Et.x||Me.anchorY!==Et.y)&&(Nt.preventDefault(),Me.setFocusCellForSelection(Et))};Ve.addEventListener("mouseup",tt),Ve.addEventListener("mousemove",yt)},0)});const rt=Ge=>{Ge.button===0&&le.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===Me.tableNodeKey&&Le.contains(tt)&&Me.clearHighlight()})};Ve.addEventListener("mousedown",rt),Me.listenersToRemove.add(()=>Ve.removeEventListener("mousedown",rt)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ge=>J(le,Ge,"down",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_UP_COMMAND,Ge=>J(le,Ge,"up",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ge=>J(le,Ge,"backward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ge=>J(le,Ge,"forward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ESCAPE_COMMAND,Ge=>{const ze=e.$getSelection();if(r(ze)){const tt=t.$findMatchingParent(ze.focus.getNode(),S);if(S(tt))return R(Ge),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const it=Ge=>()=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>S(Kt));if(!S(tt))return!1;const yt=ze.anchor.getNode(),Nt=ze.focus.getNode(),Et=Oe.isParentOf(yt),gt=Oe.isParentOf(Nt);if(Et&&!gt||gt&&!Et)return Me.clearText(),!0;const mt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>e.$isElementNode(Kt)),$t=mt&&t.$findMatchingParent(mt,Kt=>e.$isElementNode(Kt)&&S(Kt.getParent()));if(!e.$isElementNode($t)||!e.$isElementNode(mt))return!1;if(Ge===e.DELETE_LINE_COMMAND&&$t.getPreviousSibling()===null)return!0;if((Ge===e.DELETE_CHARACTER_COMMAND||Ge===e.DELETE_WORD_COMMAND)&&ze.isCollapsed()&&ze.anchor.offset===0&&mt!==$t){const Kt=mt.getChildren(),tn=e.$createParagraphNode();return Kt.forEach(It=>tn.append(It)),mt.replace(tn),mt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ge=>{Me.listenersToRemove.add(le.registerCommand(Ge,it(Ge),e.COMMAND_PRIORITY_CRITICAL))});const st=Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Ge.preventDefault(),Ge.stopPropagation(),Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1};Me.listenersToRemove.add(le.registerCommand(e.KEY_BACKSPACE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.KEY_DELETE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FORMAT_TEXT_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.formatCells(Ge),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearHighlight(),!1;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),ve&&Me.listenersToRemove.add(le.registerCommand(e.KEY_TAB_COMMAND,Ge=>{const ze=e.$getSelection();if(!e.$isRangeSelection(ze)||!ze.isCollapsed()||!de(ze,Oe))return!1;const tt=Y(ze.anchor.getNode());if(tt===null)return!1;R(Ge);const yt=Oe.getCordsFromCellNode(tt,Me.grid);return Se(Me,Oe,yt.x,yt.y,Ge.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FOCUS_COMMAND,Ge=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function vt(Ge){const ze=Oe.getCordsFromCellNode(Ge,Me.grid);return Oe.getCellFromCordsOrThrow(ze.x,ze.y,Me.grid)}return Me.listenersToRemove.add(le.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ge=>{const{nodes:ze,selection:tt}=Ge,yt=e.$INTERNAL_isPointSelection(tt),Nt=e.$isRangeSelection(tt),Et=Nt&&t.$findMatchingParent(tt.anchor.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null&&t.$findMatchingParent(tt.focus.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null||yt&&!Nt;if(ze.length!==1||!e.DEPRECATED_$isGridNode(ze[0])||!Et)return!1;const{anchor:gt}=tt,xt=ze[0],mt=xt.getChildren(),$t=xt.getFirstChildOrThrow().getChildrenSize(),Kt=xt.getChildrenSize(),tn=t.$findMatchingParent(gt.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=tn&&t.$findMatchingParent(tn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),Vt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(tn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(Vt))return!1;const bt=It.getIndexWithinParent(),nn=Math.min(Vt.getChildrenSize()-1,bt+Kt-1),Or=tn.getIndexWithinParent(),_i=Math.min(It.getChildrenSize()-1,Or+$t-1),pe=Math.min(Or,_i),Ze=Math.min(bt,nn),ot=Math.max(Or,_i),St=Math.max(bt,nn),Gt=Vt.getChildren();let Bt=0,Pt,kt;for(let Ht=Ze;Ht<=St;Ht++){const sn=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(sn))return!1;const an=mt[Bt];if(!e.DEPRECATED_$isGridRowNode(an))return!1;const bn=sn.getChildren(),yr=an.getChildren();let Zn=0;for(let fn=pe;fn<=ot;fn++){const sr=bn[fn];if(!e.DEPRECATED_$isGridCellNode(sr))return!1;const or=yr[Zn];if(!e.DEPRECATED_$isGridCellNode(or))return!1;Ht===Ze&&fn===pe?Pt=sr.getKey():Ht===St&&fn===ot&&(kt=sr.getKey());const Mi=sr.getChildren();or.getChildren().forEach(Nr=>{e.$isTextNode(Nr)&&e.$createParagraphNode().append(Nr),sr.append(Nr)}),Mi.forEach(Nr=>Nr.remove()),Zn++}Bt++}if(Pt&&kt){const Ht=l();Ht.set(ze[0].getKey(),Pt,kt),e.$setSelection(Ht)}return!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ge=e.$getSelection(),ze=e.$getPreviousSelection();if(e.$isRangeSelection(Ge)){const{anchor:tt,focus:yt}=Ge,Nt=tt.getNode(),Et=yt.getNode(),gt=Y(Nt),xt=Y(Et),mt=gt&&Oe.is(W(gt)),$t=xt&&Oe.is(W(xt)),Kt=mt!==$t,tn=mt&&$t,It=Ge.isBackward();if(Kt){const Vt=Ge.clone();Vt.focus.set(Oe.getKey(),It?0:Oe.getChildrenSize(),"element"),e.$setSelection(Vt),q(le,Me)}else tn&&(gt.is(xt)||(Me.setAnchorCellForSelection(vt(gt)),Me.setFocusCellForSelection(vt(xt),!0)))}return Ge&&!Ge.is(ze)&&(r(Ge)||r(ze))&&Me.gridSelection&&!Me.gridSelection.is(ze)?(r(Ge)&&Ge.gridKey===Me.tableNodeKey?Me.updateTableGridSelection(Ge):!r(Ge)&&r(ze)&&ze.gridKey===Me.tableNodeKey&&Me.updateTableGridSelection(null),!1):(Me.hasHijackedSelectionStyles&&!Oe.isSelected()?Te(le,Me):!Me.hasHijackedSelectionStyles&&Oe.isSelected()&&q(le,Me),!1)},e.COMMAND_PRIORITY_CRITICAL)),Me}function V(Oe,ie){Oe[P]=ie}function re(Oe){return Oe[P]}function te(Oe){let ie=Oe;for(;ie!=null;){const le=ie.nodeName;if(le==="TD"||le==="TH"){const ve=ie._cell;return ve===void 0?null:ve}ie=ie.parentNode}return null}function ce(Oe){const ie=[],le={cells:ie,columns:0,rows:0};let ve=Oe.firstChild,Le=0,Me=0;for(ie.length=0;ve!=null;){const Ve=ve.nodeName;if(Ve==="TD"||Ve==="TH"){const st=ve,vt={elem:st,hasBackgroundColor:st.style.backgroundColor!=="",highlighted:!1,x:Le,y:Me};ve._cell=vt;let Ge=ie[Me];Ge===void 0&&(Ge=ie[Me]=[]),Ge[Le]=vt}else{const st=ve.firstChild;if(st!=null){ve=st;continue}}const rt=ve.nextSibling;if(rt!=null){Le++,ve=rt;continue}const it=ve.parentNode;if(it!=null){const st=it.nextSibling;if(st==null)break;Me++,Le=0,ve=st}}return le.columns=Le+1,le.rows=Me+1,le}function j(Oe,ie,le){const ve=new Set(le?le.getNodes():[]);z(ie,(Le,Me)=>{const Ve=Le.elem;ve.has(Me)?(Le.highlighted=!0,Z(Oe,Le)):(Le.highlighted=!1,oe(Oe,Le),Ve.getAttribute("style")||Ve.removeAttribute("style"))})}function z(Oe,ie){const{cells:le}=Oe;for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(Le)for(let Me=0;Me<Le.length;Me++){const Ve=Le[Me];if(!Ve)continue;const rt=e.$getNearestNodeFromDOMNode(Ve.elem);rt!==null&&ie(Ve,rt,{x:Me,y:ve})}}}function q(Oe,ie){ie.disableHighlightStyle(),z(ie.grid,le=>{le.highlighted=!0,Z(Oe,le)})}function Te(Oe,ie){ie.enableHighlightStyle(),z(ie.grid,le=>{const ve=le.elem;le.highlighted=!1,oe(Oe,le),ve.getAttribute("style")||ve.removeAttribute("style")})}const Se=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)?K(ie.getCellNodeFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid),Me):ve!==(Me?Oe.grid.rows-1:0)?K(ie.getCellNodeFromCordsOrThrow(Me?0:Oe.grid.columns-1,ve+(Me?1:-1),Oe.grid),Me):Me?ie.selectNext():ie.selectPrevious(),!0;case"up":return ve!==0?K(ie.getCellNodeFromCordsOrThrow(le,ve-1,Oe.grid),!1):ie.selectPrevious(),!0;case"down":return ve!==Oe.grid.rows-1?K(ie.getCellNodeFromCordsOrThrow(le,ve+1,Oe.grid),!0):ie.selectNext(),!0;default:return!1}},Ee=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid)),!0;case"up":return ve!==0?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve-1,Oe.grid)),!0):!1;case"down":return ve!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve+1,Oe.grid)),!0):!1;default:return!1}};function de(Oe,ie){if(e.$isRangeSelection(Oe)||r(Oe)){const le=ie.isParentOf(Oe.anchor.getNode()),ve=ie.isParentOf(Oe.focus.getNode());return le&&ve}return!1}function K(Oe,ie){ie?Oe.selectStart():Oe.selectEnd()}const O="172,206,247";function Z(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null?le.style.setProperty("background-color",`rgb(${O})`):le.style.setProperty("background-image",`linear-gradient(to right, rgba(${O},0.85), rgba(${O},0.85))`),le.style.setProperty("caret-color","transparent")}function oe(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null&&le.style.removeProperty("background-color"),le.style.removeProperty("background-image"),le.style.removeProperty("caret-color")}function Y(Oe){const ie=t.$findMatchingParent(Oe,S);return S(ie)?ie:null}function W(Oe){const ie=t.$findMatchingParent(Oe,B);return B(ie)?ie:null}function J(Oe,ie,le,ve,Le){const Me=e.$getSelection();if(!de(Me,ve))return!1;if(e.$isRangeSelection(Me)&&Me.isCollapsed()){if(le==="backward"||le==="forward")return!1;const{anchor:Ve,focus:rt}=Me,it=t.$findMatchingParent(Ve.getNode(),S),st=t.$findMatchingParent(rt.getNode(),S);if(!S(it)||!it.is(st))return!1;const vt=W(it);if(vt!==ve&&vt!=null){const xt=Oe.getElementByKey(vt.getKey());if(xt!=null)return Le.grid=ce(xt),J(Oe,ie,le,vt,Le)}const Ge=Oe.getElementByKey(it.__key),ze=Oe.getElementByKey(Ve.key);if(ze==null||Ge==null)return!1;let tt;if(Ve.type==="element")tt=ze.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const yt=le==="up"?it.getFirstChild():it.getLastChild();if(yt==null)return!1;const Nt=Oe.getElementByKey(yt.__key);if(Nt==null)return!1;const Et=Nt.getBoundingClientRect();if(le==="up"?Et.top>tt.top-tt.height:tt.bottom+tt.height>Et.bottom){R(ie);const xt=ve.getCordsFromCellNode(it,Le.grid);if(ie.shiftKey){const mt=ve.getCellFromCordsOrThrow(xt.x,xt.y,Le.grid);Le.setAnchorCellForSelection(mt),Le.setFocusCellForSelection(mt,!0)}else return Se(Le,ve,xt.x,xt.y,le);return!0}}else if(r(Me)){const{anchor:Ve,focus:rt}=Me,it=t.$findMatchingParent(Ve.getNode(),S),st=t.$findMatchingParent(rt.getNode(),S),[vt]=Me.getNodes(),Ge=Oe.getElementByKey(vt.getKey());if(!S(it)||!S(st)||!B(vt)||Ge==null)return!1;Le.updateTableGridSelection(Me);const ze=ce(Ge),tt=ve.getCordsFromCellNode(it,ze),yt=ve.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Le.setAnchorCellForSelection(yt),R(ie),ie.shiftKey){const Nt=ve.getCordsFromCellNode(st,ze);return Ee(Le,vt,Nt.x,Nt.y,le)}else st.selectEnd();return!0}return!1}function R(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class U extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new U(ie.__key)}static importDOM(){return{table:ie=>({conversion:fe,priority:1})}}static importJSON(ie){return _e()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,le){const ve=document.createElement("table");return t.addClassNamesToElement(ve,ie.theme.table),ve}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:le=>{if(le){const ve=le.cloneNode(),Le=document.createElement("colgroup"),Me=document.createElement("tbody");t.isHTMLElement(le)&&Me.append(...le.children);const Ve=this.getFirstChildOrThrow();if(!v(Ve))throw new Error("Expected to find row node.");const rt=Ve.getChildrenSize();for(let it=0;it<rt;it++){const st=document.createElement("col");Le.append(st)}return ve.replaceChildren(Le,Me),ve}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,le){const{rows:ve,cells:Le}=le;for(let Me=0;Me<ve;Me++){const Ve=Le[Me];if(Ve==null)continue;const rt=Ve.findIndex(it=>{if(!it)return;const{elem:st}=it;return e.$getNearestNodeFromDOMNode(st)===ie});if(rt!==-1)return{x:rt,y:Me}}throw new Error("Cell not found in table.")}getCellFromCords(ie,le,ve){const{cells:Le}=ve,Me=Le[le];if(Me==null)return null;const Ve=Me[ie];return Ve??null}getCellFromCordsOrThrow(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(!Le)throw new Error("Cell not found at cords.");return Le}getCellNodeFromCords(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(Le==null)return null;const Me=e.$getNearestNodeFromDOMNode(Le.elem);return S(Me)?Me:null}getCellNodeFromCordsOrThrow(ie,le,ve){const Le=this.getCellNodeFromCords(ie,le,ve);if(!Le)throw new Error("Node at cords not TableCellNode.");return Le}canSelectBefore(){return!0}canIndent(){return!1}}function X(Oe,ie){const le=Oe.getElementByKey(ie.getKey());if(le==null)throw new Error("Table Element Not Found");return ce(le)}function fe(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new U)}function B(Oe){return Oe instanceof U}function A(Oe,ie,le=!0){const ve=_e();for(let Le=0;Le<Oe;Le++){const Me=m();for(let Ve=0;Ve<ie;Ve++){let rt=p.NO_STATUS;typeof le=="object"?(Le===0&&le.rows&&(rt|=p.ROW),Ve===0&&le.columns&&(rt|=p.COLUMN)):le&&(Le===0&&(rt|=p.ROW),Ve===0&&(rt|=p.COLUMN));const it=E(rt),st=e.$createParagraphNode();st.append(e.$createTextNode()),it.append(st),Me.append(it)}ve.append(Me)}return ve}function F(Oe){const ie=t.$findMatchingParent(Oe,le=>S(le));return S(ie)?ie:null}function se(Oe){const ie=t.$findMatchingParent(Oe,le=>v(le));if(v(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ie=t.$findMatchingParent(Oe,le=>B(le));if(B(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function De(Oe){const ie=se(Oe);return ye(ie).getChildren().findIndex(ve=>ve.is(ie))}function ee(Oe){return se(Oe).getChildren().findIndex(le=>le.is(Oe))}function ne(Oe,ie){const le=ye(Oe),{x:ve,y:Le}=le.getCordsFromCellNode(Oe,ie);return{above:le.getCellNodeFromCords(ve,Le-1,ie),below:le.getCellNodeFromCords(ve,Le+1,ie),left:le.getCellNodeFromCords(ve-1,Le,ie),right:le.getCellNodeFromCords(ve+1,Le,ie)}}function ue(Oe,ie){const le=Oe.getChildren();if(ie>=le.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return le[ie].remove(),Oe}function be(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table row target index out of range");const Ve=Me[ie];if(v(Ve))for(let rt=0;rt<ve;rt++){const it=Ve.getChildren(),st=it.length,vt=m();for(let Ge=0;Ge<st;Ge++){const ze=it[Ge];if(!S(ze))throw Error("Expected table cell");const{above:tt,below:yt}=ne(ze,Le);let Nt=p.NO_STATUS;const Et=tt&&tt.getWidth()||yt&&yt.getWidth()||void 0;(tt&&tt.hasHeaderState(p.COLUMN)||yt&&yt.hasHeaderState(p.COLUMN))&&(Nt|=p.COLUMN);const gt=E(Nt,1,Et);gt.append(e.$createParagraphNode()),vt.append(gt)}le?Ve.insertAfter(vt):Ve.insertBefore(vt)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const le=ie.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,Ve]=e.DEPRECATED_$computeGridMap(Le,ve,ve),rt=Me[0].length,{startRow:it}=Ve;if(Oe){const st=it+ve.__rowSpan-1,vt=Me[st],Ge=m();for(let tt=0;tt<rt;tt++){const{cell:yt,startRow:Nt}=vt[tt];Nt+yt.__rowSpan-1<=st?Ge.append(E(p.NO_STATUS).append(e.$createParagraphNode())):yt.setRowSpan(yt.__rowSpan+1)}const ze=Le.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const st=Me[it],vt=m();for(let ze=0;ze<rt;ze++){const{cell:tt,startRow:yt}=st[ze];yt===it?vt.append(E(p.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Le.getChildAtIndex(it);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(vt)}}function Re(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren(),Ve=[];for(let rt=0;rt<Me.length;rt++){const it=Me[rt];if(v(it))for(let st=0;st<ve;st++){const vt=it.getChildren();if(ie>=vt.length||ie<0)throw new Error("Table column target index out of range");const Ge=vt[ie];if(!S(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=ne(Ge,Le);let yt=p.NO_STATUS;(ze&&ze.hasHeaderState(p.ROW)||tt&&tt.hasHeaderState(p.ROW))&&(yt|=p.ROW);const Nt=E(yt);Nt.append(e.$createParagraphNode()),Ve.push({newTableCell:Nt,targetCell:Ge})}}return Ve.forEach(({newTableCell:rt,targetCell:it})=>{le?it.insertAfter(rt):it.insertBefore(rt)}),Oe}function ke(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const le=ie.anchor.getNode(),ve=ie.focus.getNode(),[Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,,Ve]=e.DEPRECATED_$getNodeTriplet(ve),[rt,it,st]=e.DEPRECATED_$computeGridMap(Ve,Me,Le),vt=rt.length,Ge=Oe?Math.max(it.startColumn,st.startColumn):Math.min(it.startColumn,st.startColumn),ze=Oe?Ge+Me.__colSpan-1:Ge-1,tt=Ve.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let yt=null;function Nt(){const gt=E(p.NO_STATUS).append(e.$createParagraphNode());return yt===null&&(yt=gt),gt}let Et=tt;e:for(let gt=0;gt<vt;gt++){if(gt!==0){const tn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(tn))throw Error("Expected row nextSibling to be a row");Et=tn}const xt=rt[gt];if(ze<0){At(Et,Nt());continue}const{cell:mt,startColumn:$t,startRow:Kt}=xt[ze];if($t+mt.__colSpan-1<=ze){let tn=mt,It=Kt,Vt=ze;for(;It!==gt&&tn.__rowSpan>1;)if(Vt-=mt.__colSpan,Vt>=0){const{cell:bt,startRow:nn}=xt[Vt];tn=bt,It=nn}else{Et.append(Nt());continue e}tn.insertAfter(Nt())}else mt.setColSpan(mt.__colSpan+1)}yt!==null&&ct(yt)}function Fe(Oe,ie){const le=Oe.getChildren();for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(v(Le)){const Me=Le.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table column target index out of range");Me[ie].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[Ve,rt,it]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startRow:st}=rt,{startRow:vt}=it,Ge=vt+Me.__rowSpan-1;if(Ve.length===Ge-st+1){Le.remove();return}const ze=Ve[0].length,tt=Ve[Ge+1],yt=Le.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=st;Nt--){for(let gt=ze-1;gt>=0;gt--){const{cell:xt,startRow:mt,startColumn:$t}=Ve[Nt][gt];if($t===gt&&(Nt===st&&mt<st&&xt.setRowSpan(xt.__rowSpan-(mt-st)),mt>=st&&mt+xt.__rowSpan-1>Ge)){if(xt.setRowSpan(xt.__rowSpan-(Ge-mt+1)),yt===null)throw Error("Expected nextRowNode not to be null");if(gt===0)At(yt,xt);else{const{cell:Kt}=tt[gt-1];Kt.insertAfter(xt)}}}const Et=Le.getChildAtIndex(Nt);if(!e.DEPRECATED_$isGridRowNode(Et))throw Error(`Expected GridNode childAtIndex(${String(Nt)}) to be RowNode`);Et.remove()}if(tt!==void 0){const{cell:Nt}=tt[0];ct(Nt)}else{const Nt=Ve[st-1],{cell:Et}=Nt[0];ct(Et)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[Ve,rt,it]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startColumn:st}=rt,{startRow:vt,startColumn:Ge}=it,ze=Math.min(st,Ge),tt=Math.max(st+ve.__colSpan-1,Ge+Me.__colSpan-1),yt=tt-ze+1;if(Ve[0].length===tt-ze+1){Le.selectPrevious(),Le.remove();return}const Et=Ve.length;for(let mt=0;mt<Et;mt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:tn}=Ve[mt][$t];if(tn<ze){if($t===ze){const It=ze-tn;Kt.setColSpan(Kt.__colSpan-Math.min(yt,Kt.__colSpan-It))}}else if(tn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-tn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const gt=Ve[vt],xt=gt[Ge+Me.__colSpan];if(xt!==void 0){const{cell:mt}=xt;ct(mt)}else{const mt=gt[Ge-1],{cell:$t}=mt;ct($t)}}function ct(Oe){const ie=Oe.getFirstDescendant();ie==null?Oe.selectStart():ie.getParentOrThrow().selectStart()}function At(Oe,ie){const le=Oe.getFirstChild();le!==null?le.insertBefore(ie):Oe.append(ie)}function Ut(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),[le,ve,Le]=e.DEPRECATED_$getNodeTriplet(ie),Me=le.__colSpan,Ve=le.__rowSpan;if(Me>1){for(let rt=1;rt<Me;rt++)le.insertAfter(E(p.NO_STATUS));le.setColSpan(1)}if(Ve>1){const[rt,it]=e.DEPRECATED_$computeGridMap(Le,le,le),{startColumn:st,startRow:vt}=it;let Ge;for(let ze=1;ze<Ve;ze++){const tt=vt+ze,yt=rt[tt];if(Ge=(Ge||ve).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ge))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Et=0;Et<st;Et++){const gt=yt[Et],xt=gt.cell;gt.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Et+=xt.__colSpan-1)}if(Nt===null)for(let Et=0;Et<Me;Et++)At(Ge,E(p.NO_STATUS));else for(let Et=0;Et<Me;Et++)Nt.insertAfter(E(p.NO_STATUS))}le.setRowSpan(1)}}const en=e.createCommand("INSERT_TABLE_COMMAND");return Zt.$createGridSelection=l,Zt.$createTableCellNode=E,Zt.$createTableNode=_e,Zt.$createTableNodeWithDimensions=A,Zt.$createTableRowNode=m,Zt.$deleteTableColumn=Fe,Zt.$deleteTableColumn__EXPERIMENTAL=Be,Zt.$deleteTableRow__EXPERIMENTAL=qe,Zt.$getElementGridForTableNode=X,Zt.$getTableCellNodeFromLexicalNode=F,Zt.$getTableColumnIndexFromTableCellNode=ee,Zt.$getTableNodeFromLexicalNodeOrThrow=ye,Zt.$getTableRowIndexFromTableCellNode=De,Zt.$getTableRowNodeFromTableCellNodeOrThrow=se,Zt.$insertTableColumn=Re,Zt.$insertTableColumn__EXPERIMENTAL=ke,Zt.$insertTableRow=be,Zt.$insertTableRow__EXPERIMENTAL=Ne,Zt.$isGridSelection=r,Zt.$isTableCellNode=S,Zt.$isTableNode=B,Zt.$isTableRowNode=v,Zt.$removeTableRowAtIndex=ue,Zt.$unmergeCell=Ut,Zt.INSERT_TABLE_COMMAND=en,Zt.TableCellHeaderStates=p,Zt.TableCellNode=_,Zt.TableNode=U,Zt.TableRowNode=w,Zt.TableSelection=I,Zt.applyTableHandlers=H,Zt.getCellFromTarget=te,Zt.getTableSelectionFromTableElement=re,Zt}var Jt={},xh;function LC(){if(xh)return Jt;xh=1;var e=Yt(),t=pn();function n(B){let A=new URLSearchParams;A.append("code",B);for(let F=1;F<arguments.length;F++)A.append("v",arguments[F]);throw Error(`Minified Lexical error #${B}; visit https://lexical.dev/docs/error?${A} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class r extends e.INTERNAL_PointSelection{constructor(A,F,se){super(F,se),this.gridKey=A}getCachedNodes(){return this._cachedNodes}setCachedNodes(A){this._cachedNodes=A}is(A){return l(A)?this.gridKey===A.gridKey&&this.anchor.is(A.anchor)&&this.focus.is(A.focus):!1}set(A,F,se){this.dirty=!0,this.gridKey=A,this.anchor.key=F,this.focus.key=se,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(A){let F=this.focus.getNode();if(!e.$isElementNode(F))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(F.select(0,F.getChildrenSize())).insertNodes(A)}getShape(){var A=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(A)||n(103),A=e.DEPRECATED_$getGridCellNodeRect(A),A===null)throw Error("getCellRect: expected to find AnchorNode");var F=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(F)||n(104);let se=e.DEPRECATED_$getGridCellNodeRect(F);if(se===null)throw Error("getCellRect: expected to find focusCellNode");F=Math.min(A.columnIndex,se.columnIndex);let ye=Math.max(A.columnIndex,se.columnIndex),De=Math.min(A.rowIndex,se.rowIndex);return A=Math.max(A.rowIndex,se.rowIndex),{fromX:Math.min(F,ye),fromY:Math.min(De,A),toX:Math.max(F,ye),toY:Math.max(De,A)}}getNodes(){function A(ct){let{cell:At,startColumn:Ut,startRow:en}=ct;be=Math.min(be,Ut),Ne=Math.min(Ne,en),Re=Math.max(Re,Ut+At.__colSpan-1),ke=Math.max(ke,en+At.__rowSpan-1)}var F=this._cachedNodes;if(F!==null)return F;var se=this.anchor.getNode();F=this.focus.getNode();var ye=t.$findMatchingParent(se,e.DEPRECATED_$isGridCellNode);se=t.$findMatchingParent(F,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(se)||n(104),F=ye.getParent(),e.DEPRECATED_$isGridRowNode(F)||n(105),F=F.getParent(),e.DEPRECATED_$isGridNode(F)||n(106);var De=se.getParents()[1];if(De!==F){if(F.isParentOf(se)){if(F=De.getParent(),F==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,se.getKey(),F.getKey())}else{if(F=F.getParent(),F==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,F.getKey(),se.getKey())}return this.getNodes()}let[ee,ne,ue]=e.DEPRECATED_$computeGridMap(F,ye,se),be=Math.min(ne.startColumn,ue.startColumn),Ne=Math.min(ne.startRow,ue.startRow),Re=Math.max(ne.startColumn+ne.cell.__colSpan-1,ue.startColumn+ue.cell.__colSpan-1),ke=Math.max(ne.startRow+ne.cell.__rowSpan-1,ue.startRow+ue.cell.__rowSpan-1);se=be,ye=Ne,De=be;for(var Fe=Ne;be<se||Ne<ye||Re>De||ke>Fe;){if(be<se){var qe=Fe-ye;--se;for(var Be=0;Be<=qe;Be++)A(ee[ye+Be][se])}if(Ne<ye)for(qe=De-se,--ye,Be=0;Be<=qe;Be++)A(ee[ye][se+Be]);if(Re>De)for(qe=Fe-ye,De+=1,Be=0;Be<=qe;Be++)A(ee[ye+Be][De]);if(ke>Fe)for(qe=De-se,Fe+=1,Be=0;Be<=qe;Be++)A(ee[Fe][se+Be])}for(F=[F],se=null,ye=Ne;ye<=ke;ye++)for(De=be;De<=Re;De++)({cell:Fe}=ee[ye][De]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==se&&F.push(qe),F.push(Fe,...f(Fe)),se=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=F),F}getTextContent(){let A=this.getNodes(),F="";for(let se=0;se<A.length;se++)F+=A[se].getTextContent();return F}}function l(B){return B instanceof r}function d(){let B=e.$createPoint("root",0,"element"),A=e.$createPoint("root",0,"element");return new r("root",B,A)}function f(B){let A=[],F=[B];for(;0<F.length;){let se=F.pop();se===void 0&&n(112),e.$isElementNode(se)&&F.unshift(...se.getChildren()),se!==B&&A.push(se)}return A}let p=/^(\d+(?:\.\d+)?)px$/,_={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class T extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(A){let F=new T(A.__headerState,A.__colSpan,A.__width,A.__key);return F.__rowSpan=A.__rowSpan,F.__backgroundColor=A.__backgroundColor,F}static importDOM(){return{td:()=>({conversion:E,priority:0}),th:()=>({conversion:E,priority:0})}}static importJSON(A){let F=A.rowSpan||1,se=S(A.headerState,A.colSpan||1,A.width||void 0);return se.__rowSpan=F,se.__backgroundColor=A.backgroundColor||null,se}constructor(A=_.NO_STATUS,F=1,se,ye){super(F,ye),this.__headerState=A,this.__width=se,this.__backgroundColor=null}createDOM(A){let F=document.createElement(this.getTag());return this.__width&&(F.style.width=`${this.__width}px`),1<this.__colSpan&&(F.colSpan=this.__colSpan),1<this.__rowSpan&&(F.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(F.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(F,A.theme.tableCell,this.hasHeader()&&A.theme.tableCellHeader),F}exportDOM(A){if({element:A}=super.exportDOM(A),A){var F=this.getParentOrThrow().getChildrenSize();A.style.border="1px solid black",1<this.__colSpan&&(A.colSpan=this.__colSpan),1<this.__rowSpan&&(A.rowSpan=this.__rowSpan),A.style.width=`${this.getWidth()||Math.max(90,700/F)}px`,A.style.verticalAlign="top",A.style.textAlign="start",F=this.getBackgroundColor(),F!==null?A.style.backgroundColor=F:this.hasHeader()&&(A.style.backgroundColor="#f2f3f5")}return{element:A}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(A){return this.getWritable().__headerState=A,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(A){return this.getWritable().__width=A,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(A){this.getWritable().__backgroundColor=A}toggleHeaderStyle(A){let F=this.getWritable();return F.__headerState=(F.__headerState&A)===A?F.__headerState-A:F.__headerState+A,F}hasHeaderState(A){return(this.getHeaderStyles()&A)===A}hasHeader(){return this.getLatest().__headerState!==_.NO_STATUS}updateDOM(A){return A.__headerState!==this.__headerState||A.__width!==this.__width||A.__colSpan!==this.__colSpan||A.__rowSpan!==this.__rowSpan||A.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function E(B){var A=B.nodeName.toLowerCase();let F;return p.test(B.style.width)&&(F=parseFloat(B.style.width)),A=S(A==="th"?_.ROW:_.NO_STATUS,B.colSpan,F),A.__rowSpan=B.rowSpan,B=B.style.backgroundColor,B!==""&&(A.__backgroundColor=B),{forChild:(se,ye)=>w(ye)&&!e.$isElementNode(se)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(se)&&se.getTextContent()===`
|
|
80
|
-
`?null:(ye.append(se),ye)):se,node:A}}function S(B,A=1,F){return e.$applyNodeReplacement(new T(B,A,F))}function w(B){return B instanceof T}class M extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(A){return new M(A.__height,A.__key)}static importDOM(){return{tr:()=>({conversion:m,priority:0})}}static importJSON(A){return v(A.height)}constructor(A,F){super(F),this.__height=A}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(A){let F=document.createElement("tr");return this.__height&&(F.style.height=`${this.__height}px`),t.addClassNamesToElement(F,A.theme.tableRow),F}isShadowRoot(){return!0}setHeight(A){return this.getWritable().__height=A,this.__height}getHeight(){return this.getLatest().__height}updateDOM(A){return A.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function m(B){let A;return p.test(B.style.height)&&(A=parseFloat(B.style.height)),{node:v(A)}}function v(B){return e.$applyNodeReplacement(new M(B))}function k(B){return B instanceof M}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class I{constructor(A,F){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=F,this.editor=A,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(A=>A())}trackTableGrid(){let A=new MutationObserver(F=>{this.editor.update(()=>{var se=!1;for(let ye=0;ye<F.length;ye++){const De=F[ye].target.nodeName;if(De==="TABLE"||De==="TR"){se=!0;break}}if(se){if(se=this.editor.getElementByKey(this.tableNodeKey),!se)throw Error("Expected to find TableElement in DOM");this.grid=H(se)}})});this.editor.update(()=>{let F=this.editor.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");this.grid=H(F),A.observe(F,{childList:!0,subtree:!0})})}clearHighlight(){let A=this.editor;this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),A.update(()=>{var F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");if(F=A.getElementByKey(this.tableNodeKey),!F)throw Error("Expected to find TableElement in DOM");F=H(F),V(A,F,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(F,A._config.theme.tableSelection),F.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(F,A._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(A){if(A!=null&&A.gridKey===this.tableNodeKey){let F=this.editor;this.gridSelection=A,this.isHighlightingCells=!0,this.disableHighlightStyle(),V(F,this.grid,this.gridSelection)}else A==null?this.clearHighlight():(this.tableNodeKey=A.gridKey,this.updateTableGridSelection(A))}setFocusCellForSelection(A,F=!1){let se=this.editor;se.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!W(ye))throw Error("Expected TableNode.");if(!se.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=A.x;let De=A.y;if(this.focusCell=A,this.anchorCell!==null){let ee=G?(se._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==De||F))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&De===this.focusY)return;this.focusX=ye,this.focusY=De,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(A.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&w(ye)&&(ye=ye.getKey(),this.gridSelection=this.gridSelection.clone()||d(),this.focusCellNodeKey=ye,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),se.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),V(se,this.grid,this.gridSelection)))})}setAnchorCellForSelection(A){this.isHighlightingCells=!1,this.anchorCell=A,this.anchorX=A.x,this.anchorY=A.y,this.editor.update(()=>{var F=e.$getNearestNodeFromDOMNode(A.elem);w(F)&&(F=F.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=F)})}formatCells(A){this.editor.update(()=>{let F=e.$getSelection();l(F)||n(11);let se=e.$createRangeSelection(),ye=se.anchor,De=se.focus;F.getNodes().forEach(ee=>{w(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),De.set(ee.getKey(),ee.getChildrenSize(),"element"),se.formatText(A))}),e.$setSelection(F),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let A=this.editor;A.update(()=>{let F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");var se=e.$getSelection();l(se)||n(11),se=se.getNodes().filter(w),se.length===this.grid.columns*this.grid.rows?(F.selectPrevious(),F.remove(),e.$getRoot().selectStart()):(se.forEach(ye=>{if(e.$isElementNode(ye)){let De=e.$createParagraphNode(),ee=e.$createTextNode();De.append(ee),ye.append(De),ye.getChildren().forEach(ne=>{ne!==De&&ne.remove()})}}),V(A,this.grid,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function P(B){for(;B!=null;){let A=B.nodeName;if(A==="TD"||A==="TH"){if(B=B._cell,B===void 0)break;return B}B=B.parentNode}return null}function H(B){let A=[],F={cells:A,columns:0,rows:0};var se=B.firstChild;let ye=B=0;for(A.length=0;se!=null;){var De=se.nodeName;if(De==="TD"||De==="TH"){De=se,De={elem:De,hasBackgroundColor:De.style.backgroundColor!=="",highlighted:!1,x:B,y:ye},se._cell=De;let ee=A[ye];ee===void 0&&(ee=A[ye]=[]),ee[B]=De}else if(De=se.firstChild,De!=null){se=De;continue}if(De=se.nextSibling,De!=null)B++,se=De;else if(De=se.parentNode,De!=null){if(se=De.nextSibling,se==null)break;ye++,B=0}}return F.columns=B+1,F.rows=ye+1,F}function V(B,A,F){let se=new Set(F?F.getNodes():[]);re(A,(ye,De)=>{let ee=ye.elem;se.has(De)?(ye.highlighted=!0,Te(B,ye)):(ye.highlighted=!1,Se(B,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function re(B,A){({cells:B}=B);for(let F=0;F<B.length;F++){let se=B[F];if(se)for(let ye=0;ye<se.length;ye++){let De=se[ye];if(!De)continue;let ee=e.$getNearestNodeFromDOMNode(De.elem);ee!==null&&A(De,ee,{x:ye,y:F})}}}function te(B,A){A.disableHighlightStyle(),re(A.grid,F=>{F.highlighted=!0,Te(B,F)})}function ce(B,A){A.enableHighlightStyle(),re(A.grid,F=>{let se=F.elem;F.highlighted=!1,Se(B,F),se.getAttribute("style")||se.removeAttribute("style")})}let j=(B,A,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)?(B=A.getCellNodeFromCordsOrThrow(F+(De?1:-1),se,B.grid),De?B.selectStart():B.selectEnd()):se!==(De?B.grid.rows-1:0)?(B=A.getCellNodeFromCordsOrThrow(De?0:B.grid.columns-1,se+(De?1:-1),B.grid),De?B.selectStart():B.selectEnd()):De?A.selectNext():A.selectPrevious(),!0;case"up":return se!==0?A.getCellNodeFromCordsOrThrow(F,se-1,B.grid).selectEnd():A.selectPrevious(),!0;case"down":return se!==B.grid.rows-1?A.getCellNodeFromCordsOrThrow(F,se+1,B.grid).selectStart():A.selectNext(),!0;default:return!1}},z=(B,A,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)&&B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F+(De?1:-1),se,B.grid)),!0;case"up":return se!==0?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,se-1,B.grid)),!0):!1;case"down":return se!==B.grid.rows-1?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,se+1,B.grid)),!0):!1;default:return!1}};function q(B,A){if(e.$isRangeSelection(B)||l(B)){let F=A.isParentOf(B.anchor.getNode());return B=A.isParentOf(B.focus.getNode()),F&&B}return!1}function Te(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null?B.style.setProperty("background-color","rgb(172,206,247)"):B.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),B.style.setProperty("caret-color","transparent")}function Se(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null&&B.style.removeProperty("background-color"),B.style.removeProperty("background-image"),B.style.removeProperty("caret-color")}function Ee(B){return B=t.$findMatchingParent(B,w),w(B)?B:null}function de(B){return B=t.$findMatchingParent(B,W),W(B)?B:null}function K(B,A,F,se,ye){let De=e.$getSelection();if(!q(De,se))return!1;if(e.$isRangeSelection(De)&&De.isCollapsed()){if(F==="backward"||F==="forward")return!1;let{anchor:be,focus:Ne}=De;var ee=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w);if(!w(ee)||!ee.is(ne))return!1;if(ne=de(ee),ne!==se&&ne!=null){var ue=B.getElementByKey(ne.getKey());if(ue!=null)return ye.grid=H(ue),K(B,A,F,ne,ye)}if(ne=B.getElementByKey(ee.__key),ue=B.getElementByKey(be.key),ue==null||ne==null)return!1;if(be.type==="element")ne=ue.getBoundingClientRect();else{if(ne=window.getSelection(),ne===null||ne.rangeCount===0)return!1;ne=ne.getRangeAt(0).getBoundingClientRect()}if(ue=F==="up"?ee.getFirstChild():ee.getLastChild(),ue==null||(B=B.getElementByKey(ue.__key),B==null))return!1;if(B=B.getBoundingClientRect(),F==="up"?B.top>ne.top-ne.height:ne.bottom+ne.height>B.bottom){if(O(A),B=se.getCordsFromCellNode(ee,ye.grid),A.shiftKey)F=se.getCellFromCordsOrThrow(B.x,B.y,ye.grid),ye.setAnchorCellForSelection(F),ye.setFocusCellForSelection(F,!0);else return j(ye,se,B.x,B.y,F);return!0}}else if(l(De)){let{anchor:be,focus:Ne}=De;return ue=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w),[ee]=De.getNodes(),B=B.getElementByKey(ee.getKey()),!w(ue)||!w(ne)||!W(ee)||B==null?!1:(ye.updateTableGridSelection(De),B=H(B),ue=se.getCordsFromCellNode(ue,B),ue=se.getCellFromCordsOrThrow(ue.x,ue.y,B),ye.setAnchorCellForSelection(ue),O(A),A.shiftKey?(A=se.getCordsFromCellNode(ne,B),z(ye,ee,A.x,A.y,F)):(ne.selectEnd(),!0))}return!1}function O(B){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation()}class Z extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(A){return new Z(A.__key)}static importDOM(){return{table:()=>({conversion:oe,priority:1})}}static importJSON(){return Y()}constructor(A){super(A)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(A){let F=document.createElement("table");return t.addClassNamesToElement(F,A.theme.table),F}updateDOM(){return!1}exportDOM(A){return{...super.exportDOM(A),after:F=>{if(F){let se=F.cloneNode(),ye=document.createElement("colgroup"),De=document.createElement("tbody");if(t.isHTMLElement(F)&&De.append(...F.children),F=this.getFirstChildOrThrow(),!k(F))throw Error("Expected to find row node.");F=F.getChildrenSize();for(let ee=0;ee<F;ee++){let ne=document.createElement("col");ye.append(ne)}return se.replaceChildren(ye,De),se}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(A,F){let{rows:se,cells:ye}=F;for(F=0;F<se;F++){var De=ye[F];if(De!=null&&(De=De.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===A}),De!==-1))return{x:De,y:F}}throw Error("Cell not found in table.")}getCellFromCords(A,F,se){return{cells:se}=se,F=se[F],F==null?null:(A=F[A],A??null)}getCellFromCordsOrThrow(A,F,se){if(A=this.getCellFromCords(A,F,se),!A)throw Error("Cell not found at cords.");return A}getCellNodeFromCords(A,F,se){return A=this.getCellFromCords(A,F,se),A==null?null:(A=e.$getNearestNodeFromDOMNode(A.elem),w(A)?A:null)}getCellNodeFromCordsOrThrow(A,F,se){if(A=this.getCellNodeFromCords(A,F,se),!A)throw Error("Node at cords not TableCellNode.");return A}canSelectBefore(){return!0}canIndent(){return!1}}function oe(){return{node:Y()}}function Y(){return e.$applyNodeReplacement(new Z)}function W(B){return B instanceof Z}function J(B){if(B=t.$findMatchingParent(B,A=>k(A)),k(B))return B;throw Error("Expected table cell to be inside of table row.")}function R(B){if(B=t.$findMatchingParent(B,A=>W(A)),W(B))return B;throw Error("Expected table cell to be inside of table.")}function U(B,A){let F=R(B),{x:se,y:ye}=F.getCordsFromCellNode(B,A);return{above:F.getCellNodeFromCords(se,ye-1,A),below:F.getCellNodeFromCords(se,ye+1,A),left:F.getCellNodeFromCords(se-1,ye,A),right:F.getCellNodeFromCords(se+1,ye,A)}}function X(B){let A=B.getFirstDescendant();A==null?B.selectStart():A.getParentOrThrow().selectStart()}function fe(B,A){let F=B.getFirstChild();F!==null?F.insertBefore(A):B.append(A)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=d,Jt.$createTableCellNode=S,Jt.$createTableNode=Y,Jt.$createTableNodeWithDimensions=function(B,A,F=!0){let se=Y();for(let De=0;De<B;De++){let ee=v();for(let ne=0;ne<A;ne++){var ye=_.NO_STATUS;typeof F=="object"?(De===0&&F.rows&&(ye|=_.ROW),ne===0&&F.columns&&(ye|=_.COLUMN)):F&&(De===0&&(ye|=_.ROW),ne===0&&(ye|=_.COLUMN)),ye=S(ye);let ue=e.$createParagraphNode();ue.append(e.$createTextNode()),ye.append(ue),ee.append(ye)}se.append(ee)}return se},Jt.$createTableRowNode=v,Jt.$deleteTableColumn=function(B,A){let F=B.getChildren();for(let ye=0;ye<F.length;ye++){var se=F[ye];if(k(se)){if(se=se.getChildren(),A>=se.length||0>A)throw Error("Table column target index out of range");se[A].remove()}}return B},Jt.$deleteTableColumn__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A);[A]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,A);var{startColumn:ne}=De;let{startRow:ue,startColumn:be}=ee;B=Math.min(ne,be),ne=Math.max(ne+F.__colSpan-1,be+A.__colSpan-1);let Ne=ne-B+1;if(ye[0].length===ne-B+1)se.selectPrevious(),se.remove();else{var Re=ye.length;for(let ke=0;ke<Re;ke++)for(let Fe=B;Fe<=ne;Fe++){let{cell:qe,startColumn:Be}=ye[ke][Fe];Be<B?Fe===B&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(B-Be))):Be+qe.__colSpan-1>ne?Fe===ne&&qe.setColSpan(qe.__colSpan-(ne-Be+1)):qe.remove()}B=ye[ue],A=B[be+A.__colSpan],A!==void 0?({cell:A}=A,X(A)):({cell:A}=B[be-1],X(A))}},Jt.$deleteTableRow__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A);[B]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,B);({startRow:A}=De);var{startRow:ne}=ee;if(B=ne+B.__rowSpan-1,ye.length===B-A+1)se.remove();else{ne=ye[0].length;var ue=ye[B+1],be=se.getChildAtIndex(B+1);for(let Re=B;Re>=A;Re--){for(var Ne=ne-1;0<=Ne;Ne--){let{cell:ke,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===A&&Fe<A&&ke.setRowSpan(ke.__rowSpan-(Fe-A)),Fe>=A&&Fe+ke.__rowSpan-1>B))if(ke.setRowSpan(ke.__rowSpan-(B-Fe+1)),be===null&&n(122),Ne===0)fe(be,ke);else{let{cell:Be}=ue[Ne-1];Be.insertAfter(ke)}}Ne=se.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ue!==void 0?({cell:A}=ue[0],X(A)):({cell:A}=ye[A-1][0],X(A))}},Jt.$getElementGridForTableNode=function(B,A){if(B=B.getElementByKey(A.getKey()),B==null)throw Error("Table Element Not Found");return H(B)},Jt.$getTableCellNodeFromLexicalNode=function(B){return B=t.$findMatchingParent(B,A=>w(A)),w(B)?B:null},Jt.$getTableColumnIndexFromTableCellNode=function(B){return J(B).getChildren().findIndex(A=>A.is(B))},Jt.$getTableNodeFromLexicalNodeOrThrow=R,Jt.$getTableRowIndexFromTableCellNode=function(B){let A=J(B);return R(A).getChildren().findIndex(F=>F.is(A))},Jt.$getTableRowNodeFromTableCellNodeOrThrow=J,Jt.$insertTableColumn=function(B,A,F=!0,se,ye){let De=B.getChildren(),ee=[];for(let be=0;be<De.length;be++){let Ne=De[be];if(k(Ne))for(let Re=0;Re<se;Re++){var ne=Ne.getChildren();if(A>=ne.length||0>A)throw Error("Table column target index out of range");ne=ne[A],w(ne)||n(12);let{left:ke,right:Fe}=U(ne,ye);var ue=_.NO_STATUS;(ke&&ke.hasHeaderState(_.ROW)||Fe&&Fe.hasHeaderState(_.ROW))&&(ue|=_.ROW),ue=S(ue),ue.append(e.$createParagraphNode()),ee.push({newTableCell:ue,targetCell:ne})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{F?Ne.insertAfter(be):Ne.insertBefore(be)}),B},Jt.$insertTableColumn__EXPERIMENTAL=function(B=!0){function A(){let Re=S(_.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var F=e.$getSelection();if(!e.$INTERNAL_isPointSelection(F))throw Error("Expected a PointSeleciton");var se=F.anchor.getNode();F=F.focus.getNode(),[se]=e.DEPRECATED_$getNodeTriplet(se);let[ye,,De]=e.DEPRECATED_$getNodeTriplet(F),[ee,ne,ue]=e.DEPRECATED_$computeGridMap(De,ye,se);se=ee.length,F=B?Math.max(ne.startColumn,ue.startColumn):Math.min(ne.startColumn,ue.startColumn),B=B?F+ye.__colSpan-1:F-1,F=De.getFirstChild(),e.DEPRECATED_$isGridRowNode(F)||n(120);let be=null;var Ne=F;e:for(F=0;F<se;F++){F!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[F];if(0>B){fe(Ne,A());continue}let{cell:ke,startColumn:Fe,startRow:qe}=Re[B];if(Fe+ke.__colSpan-1<=B){let Be=ke,ct=qe,At=B;for(;ct!==F&&1<Be.__rowSpan;)if(At-=ke.__colSpan,0<=At){let{cell:Ut,startRow:en}=Re[At];Be=Ut,ct=en}else{Ne.append(A());continue e}Be.insertAfter(A())}else ke.setColSpan(ke.__colSpan+1)}be!==null&&X(be)},Jt.$insertTableRow=function(B,A,F=!0,se,ye){var De=B.getChildren();if(A>=De.length||0>A)throw Error("Table row target index out of range");if(A=De[A],k(A))for(De=0;De<se;De++){let ne=A.getChildren(),ue=ne.length,be=v();for(let Ne=0;Ne<ue;Ne++){var ee=ne[Ne];w(ee)||n(12);let{above:Re,below:ke}=U(ee,ye);ee=_.NO_STATUS;let Fe=Re&&Re.getWidth()||ke&&ke.getWidth()||void 0;(Re&&Re.hasHeaderState(_.COLUMN)||ke&&ke.hasHeaderState(_.COLUMN))&&(ee|=_.COLUMN),ee=S(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}F?A.insertAfter(be):A.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return B},Jt.$insertTableRow__EXPERIMENTAL=function(B=!0){var A=e.$getSelection();if(!e.$INTERNAL_isPointSelection(A))throw Error("Expected a INTERNAL_PointSelection");A=A.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A),[ye,De]=e.DEPRECATED_$computeGridMap(se,F,F);A=ye[0].length;var{startRow:ee}=De;if(B){B=ee+F.__rowSpan-1;var ne=ye[B];ee=v();for(var ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne+be.__rowSpan-1<=B?ee.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=se.getChildAtIndex(B),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertAfter(ee)}else{for(ne=ye[ee],B=v(),ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne===ee?B.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=se.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertBefore(B)}},Jt.$isGridSelection=l,Jt.$isTableCellNode=w,Jt.$isTableNode=W,Jt.$isTableRowNode=k,Jt.$removeTableRowAtIndex=function(B,A){let F=B.getChildren();if(A>=F.length||0>A)throw Error("Expected table cell to be inside of table row.");return F[A].remove(),B},Jt.$unmergeCell=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");B=B.anchor.getNode();let[A,F,se]=e.DEPRECATED_$getNodeTriplet(B);B=A.__colSpan;let ye=A.__rowSpan;if(1<B){for(var De=1;De<B;De++)A.insertAfter(S(_.NO_STATUS));A.setColSpan(1)}if(1<ye){let[ue,be]=e.DEPRECATED_$computeGridMap(se,A,A),{startColumn:Ne,startRow:Re}=be,ke;for(De=1;De<ye;De++){var ee=Re+De;let Fe=ue[ee];ke=(ke||F).getNextSibling(),e.DEPRECATED_$isGridRowNode(ke)||n(125);var ne=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ct=Be.cell;Be.startRow===ee&&(ne=ct),1<ct.__colSpan&&(qe+=ct.__colSpan-1)}if(ne===null)for(ne=0;ne<B;ne++)fe(ke,S(_.NO_STATUS));else for(ee=0;ee<B;ee++)ne.insertAfter(S(_.NO_STATUS))}A.setRowSpan(1)}},Jt.INSERT_TABLE_COMMAND=_e,Jt.TableCellHeaderStates=_,Jt.TableCellNode=T,Jt.TableNode=Z,Jt.TableRowNode=M,Jt.TableSelection=I,Jt.applyTableHandlers=function(B,A,F,se){function ye(Ne){return Ne=B.getCordsFromCellNode(Ne,ee.grid),B.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let De=F.getRootElement();if(De===null)throw Error("No root element.");let ee=new I(F,B.getKey()),ne=F._window||window;A.__lexicalTableSelection=ee,A.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&ne){var Re=P(Ne.target);Re!==null&&(O(Ne),ee.setAnchorCellForSelection(Re));var ke=()=>{ne.removeEventListener("mouseup",ke),ne.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=P(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};ne.addEventListener("mouseup",ke),ne.addEventListener("mousemove",Fe)}},0)});let ue=Ne=>{Ne.button===0&&F.update(()=>{const Re=e.$getSelection(),ke=Ne.target;l(Re)&&Re.gridKey===ee.tableNodeKey&&De.contains(ke)&&ee.clearHighlight()})};ne.addEventListener("mousedown",ue),ee.listenersToRemove.add(()=>ne.removeEventListener("mousedown",ue)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>K(F,Ne,"down",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>K(F,Ne,"up",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>K(F,Ne,"backward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>K(F,Ne,"forward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return l(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),w),w(Re))?(O(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!q(Re,B))return!1;if(l(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>w(Be));if(!w(qe))return!1;var ke=Re.anchor.getNode(),Fe=Re.focus.getNode();if(ke=B.isParentOf(ke),Fe=B.isParentOf(Fe),ke&&!Fe||Fe&&!ke)return ee.clearText(),!0;if(ke=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&w(Be.getParent())),!e.$isElementNode(ke)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&ke.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==ke){Re=Fe.getChildren();const Be=e.$createParagraphNode();return Re.forEach(ct=>Be.append(ct)),Fe.replace(Be),Fe.getWritable().__parent=qe.getKey(),!0}}return!1};return[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ne=>{ee.listenersToRemove.add(F.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),A=Ne=>{const Re=e.$getSelection();return q(Re,B)?l(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},ee.listenersToRemove.add(F.registerCommand(e.KEY_BACKSPACE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.KEY_DELETE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return q(Re,B)?l(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return q(Ne,B)&&(l(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>w(Re)),w(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),se&&ee.listenersToRemove.add(F.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!q(Re,B)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(O(Ne),Re=B.getCordsFromCellNode(Re,ee.grid),j(ee,B,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FOCUS_COMMAND,()=>B.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:ke}=Ne;Ne=e.$INTERNAL_isPointSelection(ke);var Fe=e.$isRangeSelection(ke);if(Ne=Fe&&t.$findMatchingParent(ke.anchor.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null&&t.$findMatchingParent(ke.focus.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=ke,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ct=t.$findMatchingParent(qe.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le)),At=(qe=ct&&t.$findMatchingParent(ct,Le=>e.DEPRECATED_$isGridRowNode(Le)))&&t.$findMatchingParent(qe,Le=>e.DEPRECATED_$isGridNode(Le));if(!e.DEPRECATED_$isGridCellNode(ct)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(At))return!1;var Ut=qe.getIndexWithinParent(),en=Math.min(At.getChildrenSize()-1,Ut+Be-1);Be=ct.getIndexWithinParent(),ct=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ct),qe=Math.min(Ut,en),Be=Math.max(Be,ct),Ut=Math.max(Ut,en),At=At.getChildren(),en=0;let Oe,ie;for(ct=qe;ct<=Ut;ct++){var le=At[ct];if(!e.DEPRECATED_$isGridRowNode(le))return!1;var ve=Ne[en];if(!e.DEPRECATED_$isGridRowNode(ve))return!1;le=le.getChildren(),ve=ve.getChildren();let Le=0;for(let Me=Fe;Me<=Be;Me++){let Ve=le[Me];if(!e.DEPRECATED_$isGridCellNode(Ve))return!1;let rt=ve[Le];if(!e.DEPRECATED_$isGridCellNode(rt))return!1;ct===qe&&Me===Fe?Oe=Ve.getKey():ct===Ut&&Me===Be&&(ie=Ve.getKey());let it=Ve.getChildren();rt.getChildren().forEach(st=>{e.$isTextNode(st)&&e.$createParagraphNode().append(st),Ve.append(st)}),it.forEach(st=>st.remove()),Le++}en++}return Oe&&ie&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ie),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ct,focus:At}=Ne;var ke=ct.getNode(),Fe=At.getNode();ke=Ee(ke),Fe=Ee(Fe);var qe=ke&&B.is(de(ke)),Be=Fe&&B.is(de(Fe));let Ut=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),Ut?(ke=Ne.clone(),ke.focus.set(B.getKey(),qe?0:B.getChildrenSize(),"element"),e.$setSelection(ke),te(F,ee)):Be&&!ke.is(Fe)&&(ee.setAnchorCellForSelection(ye(ke)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(l(Ne)||l(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(l(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!l(Ne)&&l(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!B.isSelected()?ce(F,ee):!ee.hasHijackedSelectionStyles&&B.isSelected()&&te(F,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Jt.getCellFromTarget=P,Jt.getTableSelectionFromTableElement=function(B){return B.__lexicalTableSelection},Jt}var vu,vh;function Nd(){return vh||(vh=1,vu=process.env.NODE_ENV==="development"?bC():LC()),vu}var Sh;function IC(){if(Sh)return xu;Sh=1;var e=qn(),t=Nd(),n=pn(),r=Yt(),l=nt;function d({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){const[T]=e.useLexicalComposerContext();return l.useEffect(()=>{if(!T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>{const M=t.$createTableNodeWithDimensions(Number(S),Number(E),w);n.$insertNodeToNearestRoot(M);const m=M.getFirstDescendant();return r.$isTextNode(m)&&m.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[T]),l.useEffect(()=>{const E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);if(v&&!E.has(m)){const k=t.applyTableHandlers(M,v,T,_);E.set(m,k)}};T.getEditorState().read(()=>{const M=r.$nodesOfType(t.TableNode);for(const m of M)t.$isTableNode(m)&&S(m)});const w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)if(v==="created")T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)});else if(v==="destroyed"){const k=E.get(m);k!==void 0&&(k.removeListeners(),E.delete(m))}});return()=>{w();for(const[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(E.getColSpan()>1||E.getRowSpan()>1){const[,,S]=r.DEPRECATED_$getNodeTriplet(E),[w]=r.DEPRECATED_$computeGridMap(S,E,E),M=w.length,m=w[0].length;let v=S.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(v))throw Error("Expected TableNode first child to be a RowNode");const k=[];for(let G=0;G<M;G++){if(G!==0&&(v=v.getNextSibling(),!r.DEPRECATED_$isGridRowNode(v)))throw Error("Expected TableNode first child to be a RowNode");let I=null;for(let P=0;P<m;P++){const H=w[G][P],V=H.cell;if(H.startRow===G&&H.startColumn===P)I=V,k.push(V);else if(V.getColSpan()>1||V.getRowSpan()>1){if(!t.$isTableCellNode(V))throw Error("Expected TableNode cell to be a TableCellNode");const re=t.$createTableCellNode(V.__headerState);I!==null?I.insertAfter(re):n.$insertFirst(v,re)}}}for(const G of k)G.setColSpan(1),G.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null}return xu.TablePlugin=d,xu}var Su={},wh;function kC(){if(wh)return Su;wh=1;var e=qn(),t=Nd(),n=pn(),r=Yt(),l=nt;function d(f){let p=new URLSearchParams;p.append("code",f);for(let _=1;_<arguments.length;_++)p.append("v",arguments[_]);throw Error(`Minified Lexical error #${f}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Su.TablePlugin=function({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){let[T]=e.useLexicalComposerContext();return l.useEffect(()=>(T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode])||d(10),T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>(E=t.$createTableNodeWithDimensions(Number(S),Number(E),w),n.$insertNodeToNearestRoot(E),E=E.getFirstDescendant(),r.$isTextNode(E)&&E.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[T]),l.useEffect(()=>{let E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);v&&!E.has(m)&&(M=t.applyTableHandlers(M,v,T,_),E.set(m,M))};T.getEditorState().read(()=>{let M=r.$nodesOfType(t.TableNode);for(let m of M)t.$isTableNode(m)&&S(m)});let w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)v==="created"?T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)}):v==="destroyed"&&(M=E.get(m),M!==void 0&&(M.removeListeners(),E.delete(m)))});return()=>{w();for(let[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(1<E.getColSpan()||1<E.getRowSpan()){var[,,S]=r.DEPRECATED_$getNodeTriplet(E);[E]=r.DEPRECATED_$computeGridMap(S,E,E);let M=E.length,m=E[0].length;if(S=S.getFirstChild(),!r.DEPRECATED_$isGridRowNode(S))throw Error("Expected TableNode first child to be a RowNode");let v=[];for(let k=0;k<M;k++){if(k!==0&&(S=S.getNextSibling(),!r.DEPRECATED_$isGridRowNode(S)))throw Error("Expected TableNode first child to be a RowNode");let G=null;for(let I=0;I<m;I++){var w=E[k][I];let P=w.cell;if(w.startRow===k&&w.startColumn===I)G=P,v.push(P);else if(1<P.getColSpan()||1<P.getRowSpan()){if(!t.$isTableCellNode(P))throw Error("Expected TableNode cell to be a TableCellNode");w=t.$createTableCellNode(P.__headerState),G!==null?G.insertAfter(w):n.$insertFirst(S,w)}}}for(let k of v)k.setColSpan(1),k.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null},Su}const PC=process.env.NODE_ENV==="development"?IC():kC();var $C=PC,Pn={},wu={exports:{}},Oh;function Sp(){return Oh||(Oh=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
78
|
+
`?v.insertParagraph():I===" "?v.insertNodes([r.$createTabNode()]):v.insertText(I);else v.insertRawText(m)},Si.$insertGeneratedNodes=_,Si.copyToClipboard=async function(m,v){if(w!==null)return!1;if(v!==null)return new Promise(H=>{m.update(()=>{H(M(m,v))})});var k=m.getRootElement();let G=m._window==null?window.document:m._window.document,I=d?(m._window||window).getSelection():null;if(k===null||I===null)return!1;let P=G.createElement("span");return P.style.cssText="position: fixed; top: -1000px;",P.append(G.createTextNode("#")),k.append(P),k=new Range,k.setStart(P,0),k.setEnd(P,1),I.removeAllRanges(),I.addRange(k),new Promise(H=>{let j=m.registerCommand(r.COPY_COMMAND,re=>(n.objectKlassEquals(re,ClipboardEvent)&&(j(),w!==null&&(window.clearTimeout(w),w=null),H(M(m,re))),!0),r.COMMAND_PRIORITY_CRITICAL);w=window.setTimeout(()=>{j(),w=null,H(!1)},50),G.execCommand("copy"),P.remove()})},Si}var uu,nh;function vp(){return nh||(nh=1,uu=process.env.NODE_ENV==="development"?rC():iC()),uu}var rh;function sC(){if(rh)return di;rh=1;var e=vp(),t=vs(),n=pn(),r=Yt();function l(Se,Ee){if(typeof document.caretRangeFromPoint<"u"){const de=document.caretRangeFromPoint(Se,Ee);return de===null?null:{node:de.startContainer,offset:de.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const de=document.caretPositionFromPoint(Se,Ee);return de===null?null:{node:de.offsetNode,offset:de.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new M(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const de=document.createElement("blockquote");return n.addClassNamesToElement(de,Ee.theme.quote),de}updateDOM(Ee,de){return!1}static importDOM(){return{blockquote:Ee=>({conversion:P,priority:0})}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=m();return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,de){const K=r.$createParagraphNode(),O=this.getDirection();return K.setDirection(O),this.insertAfter(K,de),K}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}}function m(){return r.$applyNodeReplacement(new M)}function v(Se){return Se instanceof M}class k extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new k(Ee.__tag,Ee.__key)}constructor(Ee,de){super(de),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const de=this.__tag,K=document.createElement(de),Z=Ee.theme.heading;if(Z!==void 0){const oe=Z[de];n.addClassNamesToElement(K,oe)}return K}updateDOM(Ee,de){return!1}static importDOM(){return{h1:Ee=>({conversion:I,priority:0}),h2:Ee=>({conversion:I,priority:0}),h3:Ee=>({conversion:I,priority:0}),h4:Ee=>({conversion:I,priority:0}),h5:Ee=>({conversion:I,priority:0}),h6:Ee=>({conversion:I,priority:0}),p:Ee=>{const K=Ee.firstChild;return K!==null&&G(K)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>G(Ee)?{conversion:de=>({node:H("h1")}),priority:3}:null}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=H(Ee.tag);return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,de=!0){const K=Ee?Ee.anchor.offset:0,O=K===this.getTextContentSize()||!Ee?r.$createParagraphNode():H(this.getTag()),Z=this.getDirection();if(O.setDirection(Z),this.insertAfter(O,de),K===0&&!this.isEmpty()&&Ee){const oe=r.$createParagraphNode();oe.select(),this.replace(oe,!0)}return O}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():H(this.getTag());return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}extractWithChild(){return!0}}function G(Se){return Se.nodeName.toLowerCase()==="span"?Se.style.fontSize==="26pt":!1}function I(Se){const Ee=Se.nodeName.toLowerCase();let de=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(de=H(Ee),Se.style!==null&&de.setFormat(Se.style.textAlign)),{node:de}}function P(Se){const Ee=m();return Se.style!==null&&Ee.setFormat(Se.style.textAlign),{node:Ee}}function H(Se){return r.$applyNodeReplacement(new k(Se))}function j(Se){return Se instanceof k}function re(Se,Ee){Se.preventDefault(),Ee.update(()=>{const de=r.$getSelection(),K=Se instanceof InputEvent||Se instanceof KeyboardEvent?null:Se.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(de)&&e.$insertDataTransferForRichText(K,de,Ee)},{tag:"paste"})}async function te(Se,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(Se,ClipboardEvent)?Se:null),Ee.update(()=>{const de=r.$getSelection();r.$isRangeSelection(de)?de.removeText():r.$isNodeSelection(de)&&de.getNodes().forEach(K=>K.remove())})}function ce(Se){let Ee=null;if(Se instanceof DragEvent?Ee=Se.dataTransfer:Se instanceof ClipboardEvent&&(Ee=Se.clipboardData),Ee===null)return[!1,[],!1];const de=Ee.types,K=de.includes("Files"),O=de.includes("text/html")||de.includes("text/plain");return[K,Array.from(Ee.files),O]}function V(Se){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const de=new Set,K=Ee.getNodes();for(let O=0;O<K.length;O++){const Z=K[O],oe=Z.getKey();if(de.has(oe))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(Z),W=Y.getKey();Y.canIndent()&&!de.has(W)&&(de.add(W),Se(Y))}return de.size>0}function z(Se){const Ee=r.$getNearestNodeFromDOMNode(Se);return r.$isDecoratorNode(Ee)}function q(Se){const Ee=Se.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function Te(Se){return n.mergeRegister(Se.registerCommand(r.CLICK_COMMAND,de=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),Se.registerCommand(r.DELETE_CHARACTER_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_WORD_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_LINE_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,de=>{const K=r.$getSelection();if(typeof de=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(de);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const O=de.dataTransfer;if(O!=null)e.$insertDataTransferForRichText(O,K,Se);else if(r.$isRangeSelection(K)){const Z=de.data;return Z&&K.insertText(Z),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_TEXT_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_ELEMENT_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const O=K.getNodes();for(const Z of O){const oe=n.$findMatchingParent(Z,Y=>r.$isElementNode(Y)&&!Y.isInline());oe!==null&&oe.setFormat(de)}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_LINE_BREAK_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();de.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();K>0&&de.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_UP_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const O=K.getNodes();if(O.length>0)return O[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const O=r.$getAdjacentNode(K.focus,!0);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectPrevious(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_DOWN_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return O[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return de.preventDefault(),!0;const O=r.$getAdjacentNode(K.focus,!1);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectNext(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_LEFT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return de.preventDefault(),O[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(t.$shouldOverrideDefaultCharacterSelection(K,!0)){const O=de.shiftKey;return de.preventDefault(),t.$moveCharacter(K,O,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const Z=K.getNodes();if(Z.length>0)return de.preventDefault(),Z[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const O=de.shiftKey;return t.$shouldOverrideDefaultCharacterSelection(K,!1)?(de.preventDefault(),t.$moveCharacter(K,O,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_BACKSPACE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;de.preventDefault();const{anchor:O}=K,Z=O.getNode();return K.isCollapsed()&&O.offset===0&&!r.$isRootNode(Z)&&n.$getNearestBlockElementAncestorOrThrow(Z).getIndent()>0?Se.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_DELETE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(de.preventDefault(),Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ENTER_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(de!==null){if((T||_||S)&&p)return!1;if(de.preventDefault(),de.shiftKey)return Se.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return Se.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(Se.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DROP_COMMAND,de=>{const[,K]=ce(de);if(K.length>0){const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const{offset:W,node:J}=Y,R=r.$getNearestNodeFromDOMNode(J);if(R!==null){const U=r.$createRangeSelection();if(r.$isTextNode(R))U.anchor.set(R.getKey(),W,"text"),U.focus.set(R.getKey(),W,"text");else{const fe=R.getParentOrThrow().getKey(),_e=R.getIndexWithinParent()+1;U.anchor.set(fe,_e,"element"),U.focus.set(fe,_e,"element")}const X=r.$normalizeSelection__EXPERIMENTAL(U);r.$setSelection(X)}Se.dispatchCommand(w,K)}return de.preventDefault(),!0}const O=r.$getSelection();return!!r.$isRangeSelection(O)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGSTART_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();return!(K&&!r.$isRangeSelection(O))},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGOVER_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();if(K&&!r.$isRangeSelection(O))return!1;const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const W=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(W)&&de.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.COPY_COMMAND,de=>(e.copyToClipboard(Se,n.objectKlassEquals(de,ClipboardEvent)?de:null),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CUT_COMMAND,de=>(te(de,Se),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.PASTE_COMMAND,de=>{const[,K,O]=ce(de);if(K.length>0&&!O)return Se.dispatchCommand(w,K),!0;if(r.isSelectionCapturedInDecoratorInput(de.target))return!1;const Z=r.$getSelection();return r.$INTERNAL_isPointSelection(Z)?(re(de,Se),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return di.$createHeadingNode=H,di.$createQuoteNode=m,di.$isHeadingNode=j,di.$isQuoteNode=v,di.DRAG_DROP_PASTE=w,di.HeadingNode=k,di.QuoteNode=M,di.eventFiles=ce,di.registerRichText=Te,di}var fi={},ih;function oC(){if(ih)return fi;ih=1;var e=vp(),t=vs(),n=pn(),r=Yt();function l(V,z){return typeof document.caretRangeFromPoint<"u"?(V=document.caretRangeFromPoint(V,z),V===null?null:{node:V.startContainer,offset:V.startOffset}):document.caretPositionFromPoint!=="undefined"?(V=document.caretPositionFromPoint(V,z),V===null?null:{node:V.offsetNode,offset:V.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(z){return new M(z.__key)}constructor(z){super(z)}createDOM(z){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,z.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:I,priority:0})}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=m();return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(z,q){z=r.$createParagraphNode();let Te=this.getDirection();return z.setDirection(Te),this.insertAfter(z,q),z}collapseAtStart(){let z=r.$createParagraphNode();return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}}function m(){return r.$applyNodeReplacement(new M)}class v extends r.ElementNode{static getType(){return"heading"}static clone(z){return new v(z.__tag,z.__key)}constructor(z,q){super(q),this.__tag=z}getTag(){return this.__tag}createDOM(z){let q=this.__tag,Te=document.createElement(q);return z=z.theme.heading,z!==void 0&&n.addClassNamesToElement(Te,z[q]),Te}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:G,priority:0}),h2:()=>({conversion:G,priority:0}),h3:()=>({conversion:G,priority:0}),h4:()=>({conversion:G,priority:0}),h5:()=>({conversion:G,priority:0}),h6:()=>({conversion:G,priority:0}),p:z=>(z=z.firstChild,z!==null&&k(z)?{conversion:()=>({node:null}),priority:3}:null),span:z=>k(z)?{conversion:()=>({node:P("h1")}),priority:3}:null}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=P(z.tag);return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(z,q=!0){let Te=z?z.anchor.offset:0,Se=Te!==this.getTextContentSize()&&z?P(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return Se.setDirection(Ee),this.insertAfter(Se,q),Te===0&&!this.isEmpty()&&z&&(z=r.$createParagraphNode(),z.select(),this.replace(z,!0)),Se}collapseAtStart(){let z=this.isEmpty()?r.$createParagraphNode():P(this.getTag());return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}extractWithChild(){return!0}}function k(V){return V.nodeName.toLowerCase()==="span"?V.style.fontSize==="26pt":!1}function G(V){let z=V.nodeName.toLowerCase(),q=null;return(z==="h1"||z==="h2"||z==="h3"||z==="h4"||z==="h5"||z==="h6")&&(q=P(z),V.style!==null&&q.setFormat(V.style.textAlign)),{node:q}}function I(V){let z=m();return V.style!==null&&z.setFormat(V.style.textAlign),{node:z}}function P(V){return r.$applyNodeReplacement(new v(V))}function H(V,z){V.preventDefault(),z.update(()=>{let q=r.$getSelection(),Te=V instanceof InputEvent||V instanceof KeyboardEvent?null:V.clipboardData;Te!=null&&r.$INTERNAL_isPointSelection(q)&&e.$insertDataTransferForRichText(Te,q,z)},{tag:"paste"})}async function j(V,z){await e.copyToClipboard(z,n.objectKlassEquals(V,ClipboardEvent)?V:null),z.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(Te=>Te.remove())})}function re(V){let z=null;if(V instanceof DragEvent?z=V.dataTransfer:V instanceof ClipboardEvent&&(z=V.clipboardData),z===null)return[!1,[],!1];var q=z.types;return V=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[V,Array.from(z.files),q]}function te(V){var z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;let q=new Set;z=z.getNodes();for(let Ee=0;Ee<z.length;Ee++){var Te=z[Ee],Se=Te.getKey();q.has(Se)||(Te=n.$getNearestBlockElementAncestorOrThrow(Te),Se=Te.getKey(),Te.canIndent()&&!q.has(Se)&&(q.add(Se),V(Te)))}return 0<q.size}function ce(V){return V=r.$getNearestNodeFromDOMNode(V),r.$isDecoratorNode(V)}return fi.$createHeadingNode=P,fi.$createQuoteNode=m,fi.$isHeadingNode=function(V){return V instanceof v},fi.$isQuoteNode=function(V){return V instanceof M},fi.DRAG_DROP_PASTE=w,fi.HeadingNode=v,fi.QuoteNode=M,fi.eventFiles=re,fi.registerRichText=function(V){return n.mergeRegister(V.registerCommand(r.CLICK_COMMAND,()=>{const z=r.$getSelection();return r.$isNodeSelection(z)?(z.clear(),!0):!1},0),V.registerCommand(r.DELETE_CHARACTER_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_WORD_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_LINE_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,z=>{const q=r.$getSelection();if(typeof z=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(z);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const Te=z.dataTransfer;Te!=null?e.$insertDataTransferForRichText(Te,q,V):r.$isRangeSelection(q)&&(z=z.data)&&q.insertText(z)}return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_TEXT_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_ELEMENT_COMMAND,z=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const Te of q)q=n.$findMatchingParent(Te,Se=>r.$isElementNode(Se)&&!Se.isInline()),q!==null&&q.setFormat(z);return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_LINE_BREAK_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();z.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();0<q&&z.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_UP_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){if(z=q.getNodes(),0<z.length)return z[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),z.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_DOWN_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(z=q.getNodes(),0<z.length)return z[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let Te=q.focus;if(Te.key==="root"&&Te.offset===r.$getRoot().getChildrenSize())return z.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),z.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_LEFT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&t.$shouldOverrideDefaultCharacterSelection(q,!0)?(Te=z.shiftKey,z.preventDefault(),t.$moveCharacter(q,Te,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(Te=z.shiftKey,t.$shouldOverrideDefaultCharacterSelection(q,!1)?(z.preventDefault(),t.$moveCharacter(q,Te,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_BACKSPACE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;z.preventDefault(),{anchor:z}=q;const Te=z.getNode();return q.isCollapsed()&&z.offset===0&&!r.$isRootNode(Te)&&0<n.$getNearestBlockElementAncestorOrThrow(Te).getIndent()?V.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_DELETE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(z.preventDefault(),V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ENTER_COMMAND,z=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(z!==null){if((T||_||S)&&p)return!1;if(z.preventDefault(),z.shiftKey)return V.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return V.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(V.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DROP_COMMAND,z=>{const[,q]=re(z);if(0<q.length){var Te=l(z.clientX,z.clientY);if(Te!==null){const{offset:Ee,node:de}=Te;var Se=r.$getNearestNodeFromDOMNode(de);if(Se!==null){if(Te=r.$createRangeSelection(),r.$isTextNode(Se))Te.anchor.set(Se.getKey(),Ee,"text"),Te.focus.set(Se.getKey(),Ee,"text");else{const K=Se.getParentOrThrow().getKey();Se=Se.getIndexWithinParent()+1,Te.anchor.set(K,Se,"element"),Te.focus.set(K,Se,"element")}Te=r.$normalizeSelection__EXPERIMENTAL(Te),r.$setSelection(Te)}V.dispatchCommand(w,q)}return z.preventDefault(),!0}return z=r.$getSelection(),!!r.$isRangeSelection(z)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGSTART_COMMAND,z=>{[z]=re(z);const q=r.$getSelection();return!(z&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGOVER_COMMAND,z=>{var[q]=re(z);const Te=r.$getSelection();return q&&!r.$isRangeSelection(Te)?!1:(q=l(z.clientX,z.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&z.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.COPY_COMMAND,z=>(e.copyToClipboard(V,n.objectKlassEquals(z,ClipboardEvent)?z:null),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CUT_COMMAND,z=>(j(z,V),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.PASTE_COMMAND,z=>{const[,q,Te]=re(z);if(0<q.length&&!Te)return V.dispatchCommand(w,q),!0;if(r.isSelectionCapturedInDecoratorInput(z.target))return!1;const Se=r.$getSelection();return r.$INTERNAL_isPointSelection(Se)?(H(z,V),!0):!1},r.COMMAND_PRIORITY_EDITOR))},fi}var du,sh;function md(){return sh||(sh=1,du=process.env.NODE_ENV==="development"?sC():oC()),du}var oh;function lC(){if(oh)return Qc;oh=1;var e=qn(),t=Cp(),n=nt,r=Ep(),l=pn(),d=ld,f=Tp(),p=md(),E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function S(G){return G.getEditorState().read(r.$canShowPlaceholderCurry(G.isComposing()))}function w(G){const[I,P]=n.useState(()=>S(G));return E(()=>{function H(){const j=S(G);P(j)}return H(),l.mergeRegister(G.registerUpdateListener(()=>{H()}),G.registerEditableListener(()=>{H()}))},[G]),I}function M(G,I){const[P,H]=n.useState(()=>G.getDecorators());return E(()=>G.registerDecoratorListener(j=>{d.flushSync(()=>{H(j)})}),[G]),n.useEffect(()=>{H(G.getDecorators())},[G]),n.useMemo(()=>{const j=[],re=Object.keys(P);for(let te=0;te<re.length;te++){const ce=re[te],V=n.createElement(I,{onError:q=>G._onError(q)},n.createElement(n.Suspense,{fallback:null},P[ce])),z=G.getElementByKey(ce);z!==null&&j.push(d.createPortal(V,z,ce))}return j},[I,P,G])}function m(G){E(()=>l.mergeRegister(p.registerRichText(G),f.registerDragonSupport(G)),[G])}function v({contentEditable:G,placeholder:I,ErrorBoundary:P}){const[H]=e.useLexicalComposerContext(),j=M(H,P);return m(H),n.createElement(n.Fragment,null,G,n.createElement(k,{content:I}),j)}function k({content:G}){const[I]=e.useLexicalComposerContext(),P=w(I),H=t();return P?typeof G=="function"?G(H):G:null}return Qc.RichTextPlugin=v,Qc}var fu={},lh;function aC(){if(lh)return fu;lh=1;var e=qn(),t=Cp(),n=nt,r=Ep(),l=pn(),d=ld,f=Tp(),p=md(),_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function T(m){return m.getEditorState().read(r.$canShowPlaceholderCurry(m.isComposing()))}function E(m){let[v,k]=n.useState(()=>T(m));return _(()=>{function G(){let I=T(m);k(I)}return G(),l.mergeRegister(m.registerUpdateListener(()=>{G()}),m.registerEditableListener(()=>{G()}))},[m]),v}function S(m,v){let[k,G]=n.useState(()=>m.getDecorators());return _(()=>m.registerDecoratorListener(I=>{d.flushSync(()=>{G(I)})}),[m]),n.useEffect(()=>{G(m.getDecorators())},[m]),n.useMemo(()=>{let I=[],P=Object.keys(k);for(let H=0;H<P.length;H++){let j=P[H],re=n.createElement(v,{onError:ce=>m._onError(ce)},n.createElement(n.Suspense,{fallback:null},k[j])),te=m.getElementByKey(j);te!==null&&I.push(d.createPortal(re,te,j))}return I},[v,k,m])}function w(m){_(()=>l.mergeRegister(p.registerRichText(m),f.registerDragonSupport(m)),[m])}function M({content:m}){var[v]=e.useLexicalComposerContext();v=E(v);let k=t();return v?typeof m=="function"?m(k):m:null}return fu.RichTextPlugin=function({contentEditable:m,placeholder:v,ErrorBoundary:k}){let[G]=e.useLexicalComposerContext();return k=S(G,k),w(G),n.createElement(n.Fragment,null,m,n.createElement(M,{content:v}),k)},fu}const cC=process.env.NODE_ENV==="development"?lC():aC();var uC=cC,hu={},ah;function dC(){if(ah)return hu;ah=1;var e=qn(),t=nt;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var T=arguments[_];for(var E in T)Object.prototype.hasOwnProperty.call(T,E)&&(p[E]=T[E])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function f({ariaActiveDescendant:p,ariaAutoComplete:_,ariaControls:T,ariaDescribedBy:E,ariaExpanded:S,ariaLabel:w,ariaLabelledBy:M,ariaMultiline:m,ariaOwns:v,ariaRequired:k,autoCapitalize:G,className:I,id:P,role:H="textbox",spellCheck:j=!0,style:re,tabIndex:te,"data-testid":ce,...V}){const[z]=e.useLexicalComposerContext(),[q,Te]=t.useState(!1),Se=t.useCallback(Ee=>{z.setRootElement(Ee)},[z]);return d(()=>(Te(z.isEditable()),z.registerEditableListener(Ee=>{Te(Ee)})),[z]),t.createElement("div",n({},V,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?_:"none","aria-controls":q?T:void 0,"aria-describedby":E,"aria-expanded":q&&H==="combobox"?!!S:void 0,"aria-label":w,"aria-labelledby":M,"aria-multiline":m,"aria-owns":q?v:void 0,"aria-readonly":q?void 0:!0,"aria-required":k,autoCapitalize:G,className:I,contentEditable:q,"data-testid":ce,id:P,ref:Se,role:H,spellCheck:j,style:re,tabIndex:te}))}return hu.ContentEditable=f,hu}var gu={},ch;function fC(){if(ch)return gu;ch=1;var e=qn(),t=nt;function n(){return n=Object.assign?Object.assign.bind():function(l){for(var d=1;d<arguments.length;d++){var f=arguments[d],p;for(p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}return l},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;return gu.ContentEditable=function({ariaActiveDescendant:l,ariaAutoComplete:d,ariaControls:f,ariaDescribedBy:p,ariaExpanded:_,ariaLabel:T,ariaLabelledBy:E,ariaMultiline:S,ariaOwns:w,ariaRequired:M,autoCapitalize:m,className:v,id:k,role:G="textbox",spellCheck:I=!0,style:P,tabIndex:H,"data-testid":j,...re}){let[te]=e.useLexicalComposerContext(),[ce,V]=t.useState(!1),z=t.useCallback(q=>{te.setRootElement(q)},[te]);return r(()=>(V(te.isEditable()),te.registerEditableListener(q=>{V(q)})),[te]),t.createElement("div",n({},re,{"aria-activedescendant":ce?l:void 0,"aria-autocomplete":ce?d:"none","aria-controls":ce?f:void 0,"aria-describedby":p,"aria-expanded":ce&&G==="combobox"?!!_:void 0,"aria-label":T,"aria-labelledby":E,"aria-multiline":S,"aria-owns":ce?w:void 0,"aria-readonly":ce?void 0:!0,"aria-required":M,autoCapitalize:m,className:v,contentEditable:ce,"data-testid":j,id:k,ref:z,role:G,spellCheck:I,style:P,tabIndex:H}))},gu}const hC=process.env.NODE_ENV==="development"?dC():fC();var gC=hC,pu,uh;function pC(){if(uh)return pu;uh=1;var e=nt;function t(p,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,S){return E.__proto__=S,E},t(p,_)}function n(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}var r=function(_,T){return _===void 0&&(_=[]),T===void 0&&(T=[]),_.length!==T.length||_.some(function(E,S){return!Object.is(E,T[S])})},l={error:null},d=function(p){n(_,p);function _(){for(var E,S=arguments.length,w=new Array(S),M=0;M<S;M++)w[M]=arguments[M];return E=p.call.apply(p,[this].concat(w))||this,E.state=l,E.resetErrorBoundary=function(){for(var m,v=arguments.length,k=new Array(v),G=0;G<v;G++)k[G]=arguments[G];E.props.onReset==null||(m=E.props).onReset.apply(m,k),E.reset()},E}_.getDerivedStateFromError=function(S){return{error:S}};var T=_.prototype;return T.reset=function(){this.setState(l)},T.componentDidCatch=function(S,w){var M,m;(M=(m=this.props).onError)==null||M.call(m,S,w)},T.componentDidUpdate=function(S,w){var M=this.state.error,m=this.props.resetKeys;if(M!==null&&w.error!==null&&r(S.resetKeys,m)){var v,k;(v=(k=this.props).onResetKeysChange)==null||v.call(k,S.resetKeys,m),this.reset()}},T.render=function(){var S=this.state.error,w=this.props,M=w.fallbackRender,m=w.FallbackComponent,v=w.fallback;if(S!==null){var k={error:S,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(v))return v;if(typeof M=="function")return M(k);if(m)return e.createElement(m,k);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},_}(e.Component);function f({children:p,onError:_}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:_},p)}return pu=f,pu}var mu,dh;function mC(){if(dh)return mu;dh=1;var e=nt;function t(f,p){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,T){return _.__proto__=T,_},t(f,p)}function n(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,t(f,p)}function r(f,p){return f===void 0&&(f=[]),p===void 0&&(p=[]),f.length!==p.length||f.some(function(_,T){return!Object.is(_,p[T])})}var l={error:null},d=function(f){function p(){for(var T,E=arguments.length,S=Array(E),w=0;w<E;w++)S[w]=arguments[w];return T=f.call.apply(f,[this].concat(S))||this,T.state=l,T.resetErrorBoundary=function(){for(var M,m=arguments.length,v=Array(m),k=0;k<m;k++)v[k]=arguments[k];T.props.onReset==null||(M=T.props).onReset.apply(M,v),T.reset()},T}n(p,f),p.getDerivedStateFromError=function(T){return{error:T}};var _=p.prototype;return _.reset=function(){this.setState(l)},_.componentDidCatch=function(T,E){var S,w;(S=(w=this.props).onError)==null||S.call(w,T,E)},_.componentDidUpdate=function(T,E){var S=this.props.resetKeys;if(this.state.error!==null&&E.error!==null&&r(T.resetKeys,S)){var w,M;(w=(M=this.props).onResetKeysChange)==null||w.call(M,T.resetKeys,S),this.reset()}},_.render=function(){var T=this.state.error,E=this.props,S=E.fallbackRender,w=E.FallbackComponent;if(E=E.fallback,T!==null){if(T={error:T,resetErrorBoundary:this.resetErrorBoundary},e.isValidElement(E))return E;if(typeof S=="function")return S(T);if(w)return e.createElement(w,T);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(e.Component);return mu=function({children:f,onError:p}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},f)},mu}const _C=process.env.NODE_ENV==="development"?pC():mC();var yC=_C;const NC=ad(yC);var _u={},gr={},fh;function CC(){if(fh)return gr;fh=1;var e=Yt(),t=pn();function n(Y){let W=1,J=Y.getParent();for(;J!=null;){if(ce(J)){const R=J.getParent();if(de(R)){W++,J=R.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return W}return W}function r(Y){let W=Y.getParent();if(!de(W))throw Error("A ListItemNode must have a ListNode for a parent.");let J=W;for(;J!==null;)J=J.getParent(),de(J)&&(W=J);return W}function l(Y){let W=[];const J=Y.getChildren().filter(ce);for(let R=0;R<J.length;R++){const U=J[R],X=U.getFirstChild();de(X)?W=W.concat(l(X)):W.push(U)}return W}function d(Y){return ce(Y)&&de(Y.getFirstChild())}function f(Y){let W=Y;for(;W.getNextSibling()==null&&W.getPreviousSibling()==null;){const J=W.getParent();if(J==null||!(ce(W)||de(W)))break;W=J}W.remove()}function p(Y){return te().append(Y)}function _(Y,W){return ce(Y)&&(W.length===0||W.length===1&&Y.is(W[0])&&Y.getChildrenSize()===0)}function T(Y){const W=Y.getParent();let J=1;if(W!=null)if(de(W))J=W.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const R=Y.getPreviousSiblings();for(let U=0;U<R.length;U++){const X=R[U];ce(X)&&!de(X.getFirstChild())&&J++}return J}function E(Y,W){Y.update(()=>{const J=e.$getSelection();if(e.$INTERNAL_isPointSelection(J)){const R=J.getNodes(),X=J.anchor.getNode(),fe=X.getParent();if(_(X,R)){const _e=Ee(W);if(e.$isRootOrShadowRoot(fe)){X.replace(_e);const B=te();e.$isElementNode(X)&&(B.setFormat(X.getFormatType()),B.setIndent(X.getIndent())),_e.append(B)}else if(ce(X)){const B=X.getParentOrThrow();S(_e,B.getChildren()),B.replace(_e)}return}else{const _e=new Set;for(let B=0;B<R.length;B++){const A=R[B];if(e.$isElementNode(A)&&A.isEmpty()&&!ce(A)&&!_e.has(A.getKey())){w(A,W);continue}if(e.$isLeafNode(A)){let F=A.getParent();for(;F!=null;){const se=F.getKey();if(de(F)){if(!_e.has(se)){const ye=Ee(W);S(ye,F.getChildren()),F.replace(ye),v(ye),_e.add(se)}break}else{const ye=F.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(se)){_e.add(se),w(F,W);break}F=ye}}}}}}})}function S(Y,W){Y.splice(Y.getChildrenSize(),0,W)}function w(Y,W){if(de(Y))return Y;const J=Y.getPreviousSibling(),R=Y.getNextSibling(),U=te();if(U.setFormat(Y.getFormatType()),U.setIndent(Y.getIndent()),S(U,Y.getChildren()),de(J)&&W===J.getListType())return J.append(U),Y.remove(),de(R)&&W===R.getListType()&&(S(J,R.getChildren()),R.remove()),J;if(de(R)&&W===R.getListType())return R.getFirstChildOrThrow().insertBefore(U),Y.remove(),R;{const X=Ee(W);return X.append(U),Y.replace(X),v(X),X}}function M(Y,W){const J=Y.getLastChild(),R=W.getFirstChild();J&&R&&d(J)&&d(R)&&(M(J.getFirstChild(),R.getFirstChild()),R.remove());const U=W.getChildren();U.length>0&&(Y.append(...U),v(Y)),W.remove()}function m(Y){Y.update(()=>{const W=e.$getSelection();if(e.$isRangeSelection(W)){const J=new Set,R=W.getNodes(),U=W.anchor.getNode();if(_(U,R))J.add(r(U));else for(let X=0;X<R.length;X++){const fe=R[X];if(e.$isLeafNode(fe)){const _e=t.$getNearestNodeOfType(fe,P);_e!=null&&J.add(r(_e))}}for(const X of J){let fe=X;const _e=l(X);for(const B of _e){const A=e.$createParagraphNode();S(A,B.getChildren()),fe.insertAfter(A),fe=A,B.__key===W.anchor.key&&W.anchor.set(A.getKey(),0,"element"),B.__key===W.focus.key&&W.focus.set(A.getKey(),0,"element"),B.remove()}X.remove()}}})}function v(Y,W){const J=W||Y.getChildren();if(J!==void 0)for(let R=0;R<J.length;R++){const U=J[R];if(ce(U)){const X=U.getValue(),fe=T(U);X!==fe&&U.setValue(fe)}}}function k(Y){const W=new Set;if(d(Y)||W.has(Y.getKey()))return;const J=Y.getParent(),R=Y.getNextSibling(),U=Y.getPreviousSibling();if(d(R)&&d(U)){const X=U.getFirstChild();if(de(X)){X.append(Y);const fe=R.getFirstChild();if(de(fe)){const _e=fe.getChildren();S(X,_e),R.remove(),W.add(R.getKey())}v(X)}}else if(d(R)){const X=R.getFirstChild();if(de(X)){const fe=X.getFirstChild();fe!==null&&fe.insertBefore(Y),v(X)}}else if(d(U)){const X=U.getFirstChild();de(X)&&(X.append(Y),v(X))}else if(de(J)){const X=te(),fe=Ee(J.getListType());X.append(fe),fe.append(Y),U?U.insertAfter(X):R?R.insertBefore(X):J.append(X),v(fe)}de(J)&&v(J)}function G(Y){if(d(Y))return;const W=Y.getParent(),J=W?W.getParent():void 0,R=J?J.getParent():void 0;if(de(R)&&ce(J)&&de(W)){const U=W?W.getFirstChild():void 0,X=W?W.getLastChild():void 0;if(Y.is(U))J.insertBefore(Y),W.isEmpty()&&J.remove();else if(Y.is(X))J.insertAfter(Y),W.isEmpty()&&J.remove();else{const fe=W.getListType(),_e=te(),B=Ee(fe);_e.append(B),Y.getPreviousSiblings().forEach(se=>B.append(se));const A=te(),F=Ee(fe);A.append(F),S(F,Y.getNextSiblings()),J.insertBefore(_e),J.insertAfter(A),J.replace(Y)}v(W),v(R)}}function I(){const Y=e.$getSelection();if(!e.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const W=Y.anchor.getNode();if(!ce(W)||W.getChildrenSize()!==0)return!1;const J=r(W),R=W.getParent();if(!de(R))throw Error("A ListItemNode must have a ListNode for a parent.");const U=R.getParent();let X;if(e.$isRootOrShadowRoot(U))X=e.$createParagraphNode(),J.insertAfter(X);else if(ce(U))X=te(),U.insertAfter(X);else return!1;X.select();const fe=W.getNextSiblings();if(fe.length>0){const _e=Ee(R.getListType());if(e.$isParagraphNode(X))X.insertAfter(_e);else{const B=te();B.append(_e),X.insertAfter(B)}fe.forEach(B=>{B.remove(),_e.append(B)})}return f(W),!0}class P extends e.ElementNode{static getType(){return"listitem"}static clone(W){return new P(W.__value,W.__checked,W.__key)}constructor(W,J,R){super(R),this.__value=W===void 0?1:W,this.__checked=J}createDOM(W){const J=document.createElement("li"),R=this.getParent();return de(R)&&R.getListType()==="check"&&j(J,this,null),J.value=this.__value,H(J,W.theme,this),J}updateDOM(W,J,R){const U=this.getParent();return de(U)&&U.getListType()==="check"&&j(J,this,W),J.value=this.__value,H(J,R.theme,this),!1}static transform(){return W=>{const J=W.getParent();if(de(J)){if(v(J),!ce(W))throw Error("node is not a ListItemNode");J.getListType()!=="check"&&W.getChecked()!=null&&W.setChecked(void 0)}}}static importDOM(){return{li:W=>({conversion:re,priority:0})}}static importJSON(W){const J=te();return J.setChecked(W.checked),J.setValue(W.value),J.setFormat(W.format),J.setDirection(W.direction),J}exportDOM(W){const J=this.createDOM(W._config);return J.style.textAlign=this.getFormatType(),{element:J}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(e.$isElementNode(R)&&this.canMergeWith(R)){const U=R.getChildren();this.append(...U),R.remove()}else super.append(R)}return this}replace(W,J){if(ce(W))return super.replace(W);this.setIndent(0);const R=this.getParentOrThrow();if(!de(R))return W;if(R.__first===this.getKey())R.insertBefore(W);else if(R.__last===this.getKey())R.insertAfter(W);else{const U=Ee(R.getListType());let X=this.getNextSibling();for(;X;){const fe=X;X=X.getNextSibling(),U.append(fe)}R.insertAfter(W),W.insertAfter(U)}if(J){if(!e.$isElementNode(W))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(U=>{W.append(U)})}return this.remove(),R.getChildrenSize()===0&&R.remove(),W}insertAfter(W,J=!0){const R=this.getParentOrThrow();if(!de(R))throw Error("insertAfter: list node is not parent of list item node");const U=this.getNextSiblings();if(ce(W)){const X=super.insertAfter(W,J),fe=W.getParentOrThrow();return de(fe)&&v(fe),X}if(de(W)){let X=W;const fe=W.getChildren();for(let _e=fe.length-1;_e>=0;_e--)X=fe[_e],this.insertAfter(X,J);return X}if(R.insertAfter(W,J),U.length!==0){const X=Ee(R.getListType());U.forEach(fe=>X.append(fe)),W.insertAfter(X,J)}return W}remove(W){const J=this.getPreviousSibling(),R=this.getNextSibling();if(super.remove(W),J&&R&&d(J)&&d(R))M(J.getFirstChild(),R.getFirstChild()),R.remove();else if(R){const U=R.getParent();de(U)&&v(U)}}insertNewAfter(W,J=!0){const R=te(this.__checked==null?void 0:!1);return this.insertAfter(R,J),R}collapseAtStart(W){const J=e.$createParagraphNode();this.getChildren().forEach(_e=>J.append(_e));const U=this.getParentOrThrow(),X=U.getParentOrThrow(),fe=ce(X);if(U.getChildrenSize()===1)if(fe)U.remove(),X.select();else{U.insertBefore(J),U.remove();const _e=W.anchor,B=W.focus,A=J.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(A,_e.offset,"element"),B.type==="element"&&B.getNode().is(this)&&B.set(A,B.offset,"element")}else U.insertBefore(J),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(W){const J=this.getWritable();J.__value=W}getChecked(){return this.getLatest().__checked}setChecked(W){const J=this.getWritable();J.__checked=W}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const W=this.getParent();if(W===null)return this.getLatest().__indent;let J=W.getParentOrThrow(),R=0;for(;ce(J);)J=J.getParentOrThrow().getParentOrThrow(),R++;return R}setIndent(W){if(!(typeof W=="number"&&W>-1))throw Error("Invalid indent value.");let J=this.getIndent();for(;J!==W;)J<W?(k(this),J++):(G(this),J--);return this}insertBefore(W){if(ce(W)){const J=this.getParentOrThrow();if(de(J)){const R=this.getNextSiblings();v(J,R)}}return super.insertBefore(W)}canInsertAfter(W){return ce(W)}canReplaceWith(W){return ce(W)}canMergeWith(W){return e.$isParagraphNode(W)||ce(W)}extractWithChild(W,J){if(!e.$isRangeSelection(J))return!1;const R=J.anchor.getNode(),U=J.focus.getNode();return this.isParentOf(R)&&this.isParentOf(U)&&this.getTextContent().length===J.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function H(Y,W,J){const R=[],U=[],X=W.list,fe=X?X.listitem:void 0;let _e;if(X&&X.nested&&(_e=X.nested.listitem),fe!==void 0){const B=fe.split(" ");R.push(...B)}if(X){const B=J.getParent(),A=de(B)&&B.getListType()==="check",F=J.getChecked();(!A||F)&&U.push(X.listitemUnchecked),(!A||!F)&&U.push(X.listitemChecked),A&&R.push(F?X.listitemChecked:X.listitemUnchecked)}if(_e!==void 0){const B=_e.split(" ");J.getChildren().some(A=>de(A))?R.push(...B):U.push(...B)}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function j(Y,W,J,R){de(W.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!J||W.__checked!==J.__checked)&&Y.setAttribute("aria-checked",W.getChecked()?"true":"false"))}function re(Y){const W=t.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:te(W)}}function te(Y){return e.$applyNodeReplacement(new P(void 0,Y))}function ce(Y){return Y instanceof P}class V extends e.ElementNode{static getType(){return"list"}static clone(W){const J=W.__listType||Se[W.__tag];return new V(J,W.__start,W.__key)}constructor(W,J,R){super(R);const U=Se[W]||W;this.__listType=U,this.__tag=U==="number"?"ol":"ul",this.__start=J}getTag(){return this.__tag}setListType(W){const J=this.getWritable();J.__listType=W,J.__tag=W==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(W,J){const R=this.__tag,U=document.createElement(R);return this.__start!==1&&U.setAttribute("start",String(this.__start)),U.__lexicalListType=this.__listType,z(U,W.theme,this),U}updateDOM(W,J,R){return W.__tag!==this.__tag?!0:(z(J,R.theme,this),!1)}static importDOM(){return{ol:W=>({conversion:Te,priority:0}),ul:W=>({conversion:Te,priority:0})}}static importJSON(W){const J=Ee(W.listType,W.start);return J.setFormat(W.format),J.setIndent(W.indent),J.setDirection(W.direction),J}exportDOM(W){const{element:J}=super.exportDOM(W);return J&&t.isHTMLElement(J)&&(this.__start!==1&&J.setAttribute("start",String(this.__start)),this.__listType==="check"&&J.setAttribute("__lexicalListType","check")),{element:J}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(ce(R))super.append(R);else{const U=te();if(de(R))U.append(R);else if(e.$isElementNode(R)){const X=e.$createTextNode(R.getTextContent());U.append(X)}else U.append(R);super.append(U)}}return v(this),this}extractWithChild(W){return ce(W)}}function z(Y,W,J){const R=[],U=[],X=W.list;if(X!==void 0){const fe=X[`${J.__tag}Depth`]||[],_e=n(J)-1,B=_e%fe.length,A=fe[B],F=X[J.__tag];let se;const ye=X.nested;if(ye!==void 0&&ye.list&&(se=ye.list),F!==void 0&&R.push(F),A!==void 0){const De=A.split(" ");R.push(...De);for(let ee=0;ee<fe.length;ee++)ee!==B&&U.push(J.__tag+ee)}if(se!==void 0){const De=se.split(" ");_e>1?R.push(...De):U.push(...De)}}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function q(Y){const W=[];for(let J=0;J<Y.length;J++){const R=Y[J];if(ce(R)){W.push(R);const U=R.getChildren();U.length>1&&U.forEach(X=>{de(X)&&W.push(p(X))})}else W.push(p(R))}return W}function Te(Y){const W=Y.nodeName.toLowerCase();let J=null;if(W==="ol"){const R=Y.start;J=Ee("number",R)}else W==="ul"&&(t.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?J=Ee("check"):J=Ee("bullet"));return{after:q,node:J}}const Se={ol:"number",ul:"bullet"};function Ee(Y,W=1){return e.$applyNodeReplacement(new V(Y,W))}function de(Y){return Y instanceof V}const K=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),O=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Z=e.createCommand("INSERT_CHECK_LIST_COMMAND"),oe=e.createCommand("REMOVE_LIST_COMMAND");return gr.$createListItemNode=te,gr.$createListNode=Ee,gr.$getListDepth=n,gr.$handleListInsertParagraph=I,gr.$isListItemNode=ce,gr.$isListNode=de,gr.INSERT_CHECK_LIST_COMMAND=Z,gr.INSERT_ORDERED_LIST_COMMAND=O,gr.INSERT_UNORDERED_LIST_COMMAND=K,gr.ListItemNode=P,gr.ListNode=V,gr.REMOVE_LIST_COMMAND=oe,gr.insertList=E,gr.removeList=m,gr}var pr={},hh;function EC(){if(hh)return pr;hh=1;var e=Yt(),t=pn();function n(K){let O=new URLSearchParams;O.append("code",K);for(let Z=1;Z<arguments.length;Z++)O.append("v",arguments[Z]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${O} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let O=1;for(K=K.getParent();K!=null;){if(H(K)){if(K=K.getParent(),q(K)){O++,K=K.getParent();continue}n(40)}break}return O}function l(K){K=K.getParent(),q(K)||n(40);let O=K;for(;O!==null;)O=O.getParent(),q(O)&&(K=O);return K}function d(K){let O=[];K=K.getChildren().filter(H);for(let Z=0;Z<K.length;Z++){let oe=K[Z],Y=oe.getFirstChild();q(Y)?O=O.concat(d(Y)):O.push(oe)}return O}function f(K){return H(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let O=K.getParent();if(O==null||!H(K)&&!q(K))break;K=O}K.remove()}function _(K){return P().append(K)}function T(K,O){return H(K)&&(O.length===0||O.length===1&&K.is(O[0])&&K.getChildrenSize()===0)}function E(K,O){K.splice(K.getChildrenSize(),0,O)}function S(K,O){if(q(K))return K;let Z=K.getPreviousSibling(),oe=K.getNextSibling(),Y=P();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),E(Y,K.getChildren()),q(Z)&&O===Z.getListType()?(Z.append(Y),K.remove(),q(oe)&&O===oe.getListType()&&(E(Z,oe.getChildren()),oe.remove()),Z):q(oe)&&O===oe.getListType()?(oe.getFirstChildOrThrow().insertBefore(Y),K.remove(),oe):(O=z(O),O.append(Y),K.replace(O),M(O),O)}function w(K,O){var Z=K.getLastChild();let oe=O.getFirstChild();Z&&oe&&f(Z)&&f(oe)&&(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()),Z=O.getChildren(),0<Z.length&&(K.append(...Z),M(K)),O.remove()}function M(K,O){if(K=O||K.getChildren(),K!==void 0)for(O=0;O<K.length;O++){let W=K[O];if(H(W)){let J=W.getValue();var Z=W,oe=Z.getParent(),Y=1;for(oe!=null&&(q(oe)?Y=oe.getStart():n(44)),Z=Z.getPreviousSiblings(),oe=0;oe<Z.length;oe++){let R=Z[oe];H(R)&&!q(R.getFirstChild())&&Y++}J!==Y&&W.setValue(Y)}}}function m(K){if(!f(K)){var O=K.getParent(),Z=O?O.getParent():void 0,oe=Z?Z.getParent():void 0;if(q(oe)&&H(Z)&&q(O)){var Y=O?O.getFirstChild():void 0,W=O?O.getLastChild():void 0;if(K.is(Y))Z.insertBefore(K),O.isEmpty()&&Z.remove();else if(K.is(W))Z.insertAfter(K),O.isEmpty()&&Z.remove();else{var J=O.getListType();Y=P();let R=z(J);Y.append(R),K.getPreviousSiblings().forEach(U=>R.append(U)),W=P(),J=z(J),W.append(J),E(J,K.getNextSiblings()),Z.insertBefore(Y),Z.insertAfter(W),Z.replace(K)}M(O),M(oe)}}}class v extends e.ElementNode{static getType(){return"listitem"}static clone(O){return new v(O.__value,O.__checked,O.__key)}constructor(O,Z,oe){super(oe),this.__value=O===void 0?1:O,this.__checked=Z}createDOM(O){let Z=document.createElement("li"),oe=this.getParent();return q(oe)&&oe.getListType()==="check"&&G(Z,this,null),Z.value=this.__value,k(Z,O.theme,this),Z}updateDOM(O,Z,oe){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&G(Z,this,O),Z.value=this.__value,k(Z,oe.theme,this),!1}static transform(){return O=>{let Z=O.getParent();if(q(Z)){if(M(Z),!H(O))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&O.getChecked()!=null&&O.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:I,priority:0})}}static importJSON(O){let Z=P();return Z.setChecked(O.checked),Z.setValue(O.value),Z.setFormat(O.format),Z.setDirection(O.direction),Z}exportDOM(O){return O=this.createDOM(O._config),O.style.textAlign=this.getFormatType(),{element:O}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...O){for(let Z=0;Z<O.length;Z++){let oe=O[Z];if(e.$isElementNode(oe)&&this.canMergeWith(oe)){let Y=oe.getChildren();this.append(...Y),oe.remove()}else super.append(oe)}return this}replace(O,Z){if(H(O))return super.replace(O);this.setIndent(0);let oe=this.getParentOrThrow();if(!q(oe))return O;if(oe.__first===this.getKey())oe.insertBefore(O);else if(oe.__last===this.getKey())oe.insertAfter(O);else{let Y=z(oe.getListType()),W=this.getNextSibling();for(;W;){let J=W;W=W.getNextSibling(),Y.append(J)}oe.insertAfter(O),O.insertAfter(Y)}if(Z){if(!e.$isElementNode(O))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Y=>{O.append(Y)})}return this.remove(),oe.getChildrenSize()===0&&oe.remove(),O}insertAfter(O,Z=!0){var oe=this.getParentOrThrow();q(oe)||n(39);var Y=this.getNextSiblings();if(H(O))return Z=super.insertAfter(O,Z),O=O.getParentOrThrow(),q(O)&&M(O),Z;if(q(O)){for(oe=O,O=O.getChildren(),Y=O.length-1;0<=Y;Y--)oe=O[Y],this.insertAfter(oe,Z);return oe}if(oe.insertAfter(O,Z),Y.length!==0){let W=z(oe.getListType());Y.forEach(J=>W.append(J)),O.insertAfter(W,Z)}return O}remove(O){let Z=this.getPreviousSibling(),oe=this.getNextSibling();super.remove(O),Z&&oe&&f(Z)&&f(oe)?(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()):oe&&(O=oe.getParent(),q(O)&&M(O))}insertNewAfter(O,Z=!0){return O=P(this.__checked==null?void 0:!1),this.insertAfter(O,Z),O}collapseAtStart(O){let Z=e.$createParagraphNode();this.getChildren().forEach(J=>Z.append(J));var oe=this.getParentOrThrow(),Y=oe.getParentOrThrow();let W=H(Y);return oe.getChildrenSize()===1?W?(oe.remove(),Y.select()):(oe.insertBefore(Z),oe.remove(),oe=O.anchor,O=O.focus,Y=Z.getKey(),oe.type==="element"&&oe.getNode().is(this)&&oe.set(Y,oe.offset,"element"),O.type==="element"&&O.getNode().is(this)&&O.set(Y,O.offset,"element")):(oe.insertBefore(Z),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(O){this.getWritable().__value=O}getChecked(){return this.getLatest().__checked}setChecked(O){this.getWritable().__checked=O}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var O=this.getParent();if(O===null)return this.getLatest().__indent;O=O.getParentOrThrow();let Z=0;for(;H(O);)O=O.getParentOrThrow().getParentOrThrow(),Z++;return Z}setIndent(O){typeof O=="number"&&-1<O||n(117);let Z=this.getIndent();for(;Z!==O;)if(Z<O){e:{var oe=new Set;if(f(this)||oe.has(this.getKey()))break e;let R=this.getParent();var Y=this.getNextSibling(),W=this.getPreviousSibling();if(f(Y)&&f(W)){if(W=W.getFirstChild(),q(W)){W.append(this);var J=Y.getFirstChild();q(J)&&(J=J.getChildren(),E(W,J),Y.remove(),oe.add(Y.getKey())),M(W)}}else f(Y)?(Y=Y.getFirstChild(),q(Y)&&(oe=Y.getFirstChild(),oe!==null&&oe.insertBefore(this),M(Y))):f(W)?(Y=W.getFirstChild(),q(Y)&&(Y.append(this),M(Y))):q(R)&&(oe=P(),J=z(R.getListType()),oe.append(J),J.append(this),W?W.insertAfter(oe):Y?Y.insertBefore(oe):R.append(oe),M(J));q(R)&&M(R)}Z++}else m(this),Z--;return this}insertBefore(O){if(H(O)){let Z=this.getParentOrThrow();if(q(Z)){let oe=this.getNextSiblings();M(Z,oe)}}return super.insertBefore(O)}canInsertAfter(O){return H(O)}canReplaceWith(O){return H(O)}canMergeWith(O){return e.$isParagraphNode(O)||H(O)}extractWithChild(O,Z){if(!e.$isRangeSelection(Z))return!1;O=Z.anchor.getNode();let oe=Z.focus.getNode();return this.isParentOf(O)&&this.isParentOf(oe)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return z("bullet")}}function k(K,O,Z){let oe=[],Y=[];var W=(O=O.list)?O.listitem:void 0;if(O&&O.nested)var J=O.nested.listitem;if(W!==void 0&&(W=W.split(" "),oe.push(...W)),O){W=Z.getParent(),W=q(W)&&W.getListType()==="check";let R=Z.getChecked();W&&!R||Y.push(O.listitemUnchecked),W&&R||Y.push(O.listitemChecked),W&&oe.push(R?O.listitemChecked:O.listitemUnchecked)}J!==void 0&&(J=J.split(" "),Z.getChildren().some(R=>q(R))?oe.push(...J):Y.push(...J)),0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function G(K,O,Z){q(O.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),Z&&O.__checked===Z.__checked||K.setAttribute("aria-checked",O.getChecked()?"true":"false"))}function I(K){return K=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:P(K)}}function P(K){return e.$applyNodeReplacement(new v(void 0,K))}function H(K){return K instanceof v}class j extends e.ElementNode{static getType(){return"list"}static clone(O){return new j(O.__listType||V[O.__tag],O.__start,O.__key)}constructor(O,Z,oe){super(oe),this.__listType=O=V[O]||O,this.__tag=O==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(O){let Z=this.getWritable();Z.__listType=O,Z.__tag=O==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(O){let Z=document.createElement(this.__tag);return this.__start!==1&&Z.setAttribute("start",String(this.__start)),Z.__lexicalListType=this.__listType,re(Z,O.theme,this),Z}updateDOM(O,Z,oe){return O.__tag!==this.__tag?!0:(re(Z,oe.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ce,priority:0}),ul:()=>({conversion:ce,priority:0})}}static importJSON(O){let Z=z(O.listType,O.start);return Z.setFormat(O.format),Z.setIndent(O.indent),Z.setDirection(O.direction),Z}exportDOM(O){return{element:O}=super.exportDOM(O),O&&t.isHTMLElement(O)&&(this.__start!==1&&O.setAttribute("start",String(this.__start)),this.__listType==="check"&&O.setAttribute("__lexicalListType","check")),{element:O}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...O){for(let oe=0;oe<O.length;oe++){var Z=O[oe];if(H(Z))super.append(Z);else{let Y=P();q(Z)||e.$isElementNode(Z)&&(Z=e.$createTextNode(Z.getTextContent())),Y.append(Z),super.append(Y)}}return M(this),this}extractWithChild(O){return H(O)}}function re(K,O,Z){let oe=[],Y=[];var W=O.list;if(W!==void 0){let R=W[`${Z.__tag}Depth`]||[];O=r(Z)-1;let U=O%R.length;var J=R[U];let X=W[Z.__tag],fe;if(W=W.nested,W!==void 0&&W.list&&(fe=W.list),X!==void 0&&oe.push(X),J!==void 0)for(J=J.split(" "),oe.push(...J),J=0;J<R.length;J++)J!==U&&Y.push(Z.__tag+J);fe!==void 0&&(Z=fe.split(" "),1<O?oe.push(...Z):Y.push(...Z))}0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function te(K){let O=[];for(let oe=0;oe<K.length;oe++){var Z=K[oe];H(Z)?(O.push(Z),Z=Z.getChildren(),1<Z.length&&Z.forEach(Y=>{q(Y)&&O.push(_(Y))})):O.push(_(Z))}return O}function ce(K){let O=K.nodeName.toLowerCase(),Z=null;return O==="ol"?Z=z("number",K.start):O==="ul"&&(Z=t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?z("check"):z("bullet")),{after:te,node:Z}}let V={ol:"number",ul:"bullet"};function z(K,O=1){return e.$applyNodeReplacement(new j(K,O))}function q(K){return K instanceof j}let Te=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),Se=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),de=e.createCommand("REMOVE_LIST_COMMAND");return pr.$createListItemNode=P,pr.$createListNode=z,pr.$getListDepth=r,pr.$handleListInsertParagraph=function(){var K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!H(K)||K.getChildrenSize()!==0))return!1;var O=l(K),Z=K.getParent();q(Z)||n(40);let oe=Z.getParent(),Y;if(e.$isRootOrShadowRoot(oe))Y=e.$createParagraphNode(),O.insertAfter(Y);else if(H(oe))Y=P(),oe.insertAfter(Y);else return!1;if(Y.select(),O=K.getNextSiblings(),0<O.length){let W=z(Z.getListType());e.$isParagraphNode(Y)?Y.insertAfter(W):(Z=P(),Z.append(W),Y.insertAfter(Z)),O.forEach(J=>{J.remove(),W.append(J)})}return p(K),!0},pr.$isListItemNode=H,pr.$isListNode=q,pr.INSERT_CHECK_LIST_COMMAND=Ee,pr.INSERT_ORDERED_LIST_COMMAND=Se,pr.INSERT_UNORDERED_LIST_COMMAND=Te,pr.ListItemNode=v,pr.ListNode=j,pr.REMOVE_LIST_COMMAND=de,pr.insertList=function(K,O){K.update(()=>{var Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){var oe=Z.getNodes();Z=Z.anchor.getNode();var Y=Z.getParent();if(T(Z,oe))oe=z(O),e.$isRootOrShadowRoot(Y)?(Z.replace(oe),Y=P(),e.$isElementNode(Z)&&(Y.setFormat(Z.getFormatType()),Y.setIndent(Z.getIndent())),oe.append(Y)):H(Z)&&(Z=Z.getParentOrThrow(),E(oe,Z.getChildren()),Z.replace(oe));else for(Z=new Set,Y=0;Y<oe.length;Y++){var W=oe[Y];if(e.$isElementNode(W)&&W.isEmpty()&&!H(W)&&!Z.has(W.getKey()))S(W,O);else if(e.$isLeafNode(W))for(W=W.getParent();W!=null;){let R=W.getKey();if(q(W)){if(!Z.has(R)){var J=z(O);E(J,W.getChildren()),W.replace(J),M(J),Z.add(R)}break}else{if(J=W.getParent(),e.$isRootOrShadowRoot(J)&&!Z.has(R)){Z.add(R),S(W,O);break}W=J}}}}})},pr.removeList=function(K){K.update(()=>{let O=e.$getSelection();if(e.$isRangeSelection(O)){var Z=new Set,oe=O.getNodes(),Y=O.anchor.getNode();if(T(Y,oe))Z.add(l(Y));else for(Y=0;Y<oe.length;Y++){var W=oe[Y];e.$isLeafNode(W)&&(W=t.$getNearestNodeOfType(W,v),W!=null&&Z.add(l(W)))}for(let J of Z){Z=J,oe=d(J);for(let R of oe)oe=e.$createParagraphNode(),E(oe,R.getChildren()),Z.insertAfter(oe),Z=oe,R.__key===O.anchor.key&&O.anchor.set(oe.getKey(),0,"element"),R.__key===O.focus.key&&O.focus.set(oe.getKey(),0,"element"),R.remove();J.remove()}}})},pr}var yu,gh;function _d(){return gh||(gh=1,yu=process.env.NODE_ENV==="development"?CC():EC()),yu}var ph;function TC(){if(ph)return _u;ph=1;var e=_d(),t=qn(),n=nt,r=pn(),l=Yt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(p,"number"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(p,"bullet"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(p),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[p])}function f(){const[p]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([e.ListNode,e.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return _u.ListPlugin=f,_u}var Nu={},mh;function xC(){if(mh)return Nu;mh=1;var e=_d(),t=qn(),n=nt,r=pn(),l=Yt();function d(f){n.useEffect(()=>r.mergeRegister(f.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(f,"number"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(f,"bullet"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(f),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[f])}return Nu.ListPlugin=function(){let[f]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!f.hasNodes([e.ListNode,e.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[f]),d(f),null},Nu}const vC=process.env.NODE_ENV==="development"?TC():xC();var SC=vC,Cu={},wi={},_h;function wC(){if(_h)return wi;_h=1;var e=pn(),t=Yt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(m){return new r(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}constructor(m,v={},k){super(k);const{target:G=null,rel:I=null,title:P=null}=v;this.__url=m,this.__target=G,this.__rel=I,this.__title=P}createDOM(m){const v=document.createElement("a");return v.href=this.sanitizeUrl(this.__url),this.__target!==null&&(v.target=this.__target),this.__rel!==null&&(v.rel=this.__rel),this.__title!==null&&(v.title=this.__title),e.addClassNamesToElement(v,m.theme.link),v}updateDOM(m,v,k){const G=this.__url,I=this.__target,P=this.__rel,H=this.__title;return G!==m.__url&&(v.href=G),I!==m.__target&&(I?v.target=I:v.removeAttribute("target")),P!==m.__rel&&(P?v.rel=P:v.removeAttribute("rel")),H!==m.__title&&(H?v.title=H:v.removeAttribute("title")),!1}static importDOM(){return{a:m=>({conversion:l,priority:1})}}static importJSON(m){const v=d(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}sanitizeUrl(m){try{const v=new URL(m);if(!n.has(v.protocol))return"about:blank"}catch{return m}return m}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(m){const v=this.getWritable();v.__url=m}getTarget(){return this.getLatest().__target}setTarget(m){const v=this.getWritable();v.__target=m}getRel(){return this.getLatest().__rel}setRel(m){const v=this.getWritable();v.__rel=m}getTitle(){return this.getLatest().__title}setTitle(m){const v=this.getWritable();v.__title=m}insertNewAfter(m,v=!0){const k=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(k,v),k}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(m,v,k){if(!t.$isRangeSelection(v))return!1;const G=v.anchor.getNode(),I=v.focus.getNode();return this.isParentOf(G)&&this.isParentOf(I)&&v.getTextContent().length>0}}function l(M){let m=null;if(e.isHTMLAnchorElement(M)){const v=M.textContent;(v!==null&&v!==""||M.children.length>0)&&(m=d(M.getAttribute("href")||"",{rel:M.getAttribute("rel"),target:M.getAttribute("target"),title:M.getAttribute("title")}))}return{node:m}}function d(M,m){return t.$applyNodeReplacement(new r(M,m))}function f(M){return M instanceof r}class p extends r{static getType(){return"autolink"}static clone(m){return new p(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}static importJSON(m){const v=_(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(m,v=!0){const k=this.getParentOrThrow().insertNewAfter(m,v);if(t.$isElementNode(k)){const G=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return k.append(G),G}return null}}function _(M,m){return t.$applyNodeReplacement(new p(M,m))}function T(M){return M instanceof p}const E=t.createCommand("TOGGLE_LINK_COMMAND");function S(M,m={}){const{target:v,title:k}=m,G=m.rel===void 0?"noreferrer":m.rel,I=t.$getSelection();if(!t.$isRangeSelection(I))return;const P=I.extract();if(M===null)P.forEach(H=>{const j=H.getParent();if(f(j)){const re=j.getChildren();for(let te=0;te<re.length;te++)j.insertBefore(re[te]);j.remove()}});else{if(P.length===1){const re=P[0],te=w(re,f);if(te!==null){te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&te.setRel(G),k!==void 0&&te.setTitle(k);return}}let H=null,j=null;P.forEach(re=>{const te=re.getParent();if(!(te===j||te===null||t.$isElementNode(re)&&!re.isInline())){if(f(te)){j=te,te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&j.setRel(G),k!==void 0&&j.setTitle(k);return}if(te.is(H)||(H=te,j=d(M,{rel:G,target:v,title:k}),f(te)?re.getPreviousSibling()===null?te.insertBefore(j):te.insertAfter(j):re.insertBefore(j)),f(re)){if(re.is(j))return;if(j!==null){const ce=re.getChildren();for(let V=0;V<ce.length;V++)j.append(ce[V])}re.remove();return}j!==null&&j.append(re)}})}}function w(M,m){let v=M;for(;v!==null&&v.getParent()!==null&&!m(v);)v=v.getParentOrThrow();return m(v)?v:null}return wi.$createAutoLinkNode=_,wi.$createLinkNode=d,wi.$isAutoLinkNode=T,wi.$isLinkNode=f,wi.AutoLinkNode=p,wi.LinkNode=r,wi.TOGGLE_LINK_COMMAND=E,wi.toggleLink=S,wi}var Oi={},yh;function OC(){if(yh)return Oi;yh=1;var e=pn(),t=Yt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(w){return new r(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}constructor(w,M={},m){super(m);let{target:v=null,rel:k=null,title:G=null}=M;this.__url=w,this.__target=v,this.__rel=k,this.__title=G}createDOM(w){let M=document.createElement("a");return M.href=this.sanitizeUrl(this.__url),this.__target!==null&&(M.target=this.__target),this.__rel!==null&&(M.rel=this.__rel),this.__title!==null&&(M.title=this.__title),e.addClassNamesToElement(M,w.theme.link),M}updateDOM(w,M){let m=this.__url,v=this.__target,k=this.__rel,G=this.__title;return m!==w.__url&&(M.href=m),v!==w.__target&&(v?M.target=v:M.removeAttribute("target")),k!==w.__rel&&(k?M.rel=k:M.removeAttribute("rel")),G!==w.__title&&(G?M.title=G:M.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:l,priority:1})}}static importJSON(w){let M=d(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}sanitizeUrl(w){try{let M=new URL(w);if(!n.has(M.protocol))return"about:blank"}catch{}return w}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(w){this.getWritable().__url=w}getTarget(){return this.getLatest().__target}setTarget(w){this.getWritable().__target=w}getRel(){return this.getLatest().__rel}setRel(w){this.getWritable().__rel=w}getTitle(){return this.getLatest().__title}setTitle(w){this.getWritable().__title=w}insertNewAfter(w,M=!0){return w=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(w,M),w}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(w,M){if(!t.$isRangeSelection(M))return!1;w=M.anchor.getNode();let m=M.focus.getNode();return this.isParentOf(w)&&this.isParentOf(m)&&0<M.getTextContent().length}}function l(S){let w=null;if(e.isHTMLAnchorElement(S)){let M=S.textContent;(M!==null&&M!==""||0<S.children.length)&&(w=d(S.getAttribute("href")||"",{rel:S.getAttribute("rel"),target:S.getAttribute("target"),title:S.getAttribute("title")}))}return{node:w}}function d(S,w){return t.$applyNodeReplacement(new r(S,w))}function f(S){return S instanceof r}class p extends r{static getType(){return"autolink"}static clone(w){return new p(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}static importJSON(w){let M=_(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(w,M=!0){return w=this.getParentOrThrow().insertNewAfter(w,M),t.$isElementNode(w)?(M=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),w.append(M),M):null}}function _(S,w){return t.$applyNodeReplacement(new p(S,w))}let T=t.createCommand("TOGGLE_LINK_COMMAND");function E(S,w){for(;S!==null&&S.getParent()!==null&&!w(S);)S=S.getParentOrThrow();return w(S)?S:null}return Oi.$createAutoLinkNode=_,Oi.$createLinkNode=d,Oi.$isAutoLinkNode=function(S){return S instanceof p},Oi.$isLinkNode=f,Oi.AutoLinkNode=p,Oi.LinkNode=r,Oi.TOGGLE_LINK_COMMAND=T,Oi.toggleLink=function(S,w={}){let{target:M,title:m}=w,v=w.rel===void 0?"noreferrer":w.rel;if(w=t.$getSelection(),t.$isRangeSelection(w))if(w=w.extract(),S===null)w.forEach(k=>{if(k=k.getParent(),f(k)){let G=k.getChildren();for(let I=0;I<G.length;I++)k.insertBefore(G[I]);k.remove()}});else{if(w.length===1){let I=E(w[0],f);if(I!==null){I.setURL(S),M!==void 0&&I.setTarget(M),v!==null&&I.setRel(v),m!==void 0&&I.setTitle(m);return}}let k=null,G=null;w.forEach(I=>{var P=I.getParent();if(P!==G&&P!==null&&(!t.$isElementNode(I)||I.isInline()))if(f(P))G=P,P.setURL(S),M!==void 0&&P.setTarget(M),v!==null&&G.setRel(v),m!==void 0&&G.setTitle(m);else if(P.is(k)||(k=P,G=d(S,{rel:v,target:M,title:m}),f(P)?I.getPreviousSibling()===null?P.insertBefore(G):P.insertAfter(G):I.insertBefore(G)),f(I)){if(!I.is(G)){if(G!==null){P=I.getChildren();for(let H=0;H<P.length;H++)G.append(P[H])}I.remove()}}else G!==null&&G.append(I)})}},Oi}var Eu,Nh;function yd(){return Nh||(Nh=1,Eu=process.env.NODE_ENV==="development"?wC():OC()),Eu}var Ch;function DC(){if(Ch)return Cu;Ch=1;var e=yd(),t=qn(),n=pn(),r=Yt(),l=nt;function d({validateUrl:f}){const[p]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!p.hasNodes([e.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(e.TOGGLE_LINK_COMMAND,_=>{if(_===null)return e.toggleLink(_),!0;if(typeof _=="string")return f===void 0||f(_)?(e.toggleLink(_),!0):!1;{const{url:T,target:E,rel:S,title:w}=_;return e.toggleLink(T,{rel:S,target:E,title:w}),!0}},r.COMMAND_PRIORITY_LOW),f!==void 0?p.registerCommand(r.PASTE_COMMAND,_=>{const T=r.$getSelection();if(!r.$isRangeSelection(T)||T.isCollapsed()||!(_ instanceof ClipboardEvent)||_.clipboardData==null)return!1;const E=_.clipboardData.getData("text");return f(E)?T.getNodes().some(S=>r.$isElementNode(S))?!1:(p.dispatchCommand(e.TOGGLE_LINK_COMMAND,E),_.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,f]),null}return Cu.LinkPlugin=d,Cu}var Tu={},Eh;function AC(){if(Eh)return Tu;Eh=1;var e=yd(),t=qn(),n=pn(),r=Yt(),l=nt;return Tu.LinkPlugin=function({validateUrl:d}){let[f]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!f.hasNodes([e.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(f.registerCommand(e.TOGGLE_LINK_COMMAND,p=>{if(p===null)return e.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(e.toggleLink(p),!0):!1;let{url:_,target:T,rel:E,title:S}=p;return e.toggleLink(_,{rel:E,target:T,title:S}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?f.registerCommand(r.PASTE_COMMAND,p=>{let _=r.$getSelection();if(!r.$isRangeSelection(_)||_.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let T=p.clipboardData.getData("text");return d(T)?_.getNodes().some(E=>r.$isElementNode(E))?!1:(f.dispatchCommand(e.TOGGLE_LINK_COMMAND,T),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[f,d]),null},Tu}const MC=process.env.NODE_ENV==="development"?DC():AC();var RC=MC,xu={},Zt={},Th;function bC(){if(Th)return Zt;Th=1;var e=Yt(),t=pn();class n extends e.INTERNAL_PointSelection{constructor(ie,le,ve){super(le,ve),this.gridKey=ie}getCachedNodes(){return this._cachedNodes}setCachedNodes(ie){this._cachedNodes=ie}is(ie){return r(ie)?this.gridKey===ie.gridKey&&this.anchor.is(ie.anchor)&&this.focus.is(ie.focus):!1}set(ie,le,ve){this.dirty=!0,this.gridKey=ie,this.anchor.key=le,this.focus.key=ve,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ie){}insertText(){}insertNodes(ie){const le=this.focus.getNode();if(!e.$isElementNode(le))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(le.select(0,le.getChildrenSize())).insertNodes(ie)}getShape(){const ie=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ie))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const le=e.DEPRECATED_$getGridCellNodeRect(ie);if(le===null)throw Error("getCellRect: expected to find AnchorNode");const ve=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(ve))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Le=e.DEPRECATED_$getGridCellNodeRect(ve);if(Le===null)throw Error("getCellRect: expected to find focusCellNode");const Me=Math.min(le.columnIndex,Le.columnIndex),je=Math.max(le.columnIndex,Le.columnIndex),rt=Math.min(le.rowIndex,Le.rowIndex),it=Math.max(le.rowIndex,Le.rowIndex);return{fromX:Math.min(Me,je),fromY:Math.min(rt,it),toX:Math.max(Me,je),toY:Math.max(rt,it)}}getNodes(){const ie=this._cachedNodes;if(ie!==null)return ie;const le=this.anchor.getNode(),ve=this.focus.getNode(),Le=t.$findMatchingParent(le,e.DEPRECATED_$isGridCellNode),Me=t.$findMatchingParent(ve,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Le))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!e.DEPRECATED_$isGridCellNode(Me))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const je=Le.getParent();if(!e.DEPRECATED_$isGridRowNode(je))throw Error("Expected anchorCell to have a parent GridRowNode");const rt=je.getParent();if(!e.DEPRECATED_$isGridNode(rt))throw Error("Expected tableNode to have a parent GridNode");const it=Me.getParents()[1];if(it!==rt){if(rt.isParentOf(Me)){const It=it.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),It.getKey())}else{const It=rt.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),Me.getKey())}return this.getNodes()}const[st,vt,Ge]=e.DEPRECATED_$computeGridMap(rt,Le,Me);let ze=Math.min(vt.startColumn,Ge.startColumn),tt=Math.min(vt.startRow,Ge.startRow),yt=Math.max(vt.startColumn+vt.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(vt.startRow+vt.cell.__rowSpan-1,Ge.startRow+Ge.cell.__rowSpan-1),Et=ze,gt=tt,xt=ze,mt=tt;function $t(It){const{cell:jt,startColumn:bt,startRow:nn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,nn),yt=Math.max(yt,bt+jt.__colSpan-1),Nt=Math.max(Nt,nn+jt.__rowSpan-1)}for(;ze<Et||tt<gt||yt>xt||Nt>mt;){if(ze<Et){const It=mt-gt,jt=Et-1;for(let bt=0;bt<=It;bt++)$t(st[gt+bt][jt]);Et=jt}if(tt<gt){const It=xt-Et,jt=gt-1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);gt=jt}if(yt>xt){const It=mt-gt,jt=xt+1;for(let bt=0;bt<=It;bt++)$t(st[gt+bt][jt]);xt=jt}if(Nt>mt){const It=xt-Et,jt=mt+1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);mt=jt}}const Kt=[rt];let tn=null;for(let It=tt;It<=Nt;It++)for(let jt=ze;jt<=yt;jt++){const{cell:bt}=st[It][jt],nn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected GridCellNode parent to be a GridRowNode");nn!==tn&&Kt.push(nn),Kt.push(bt,...d(bt)),tn=nn}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Kt),Kt}getTextContent(){const ie=this.getNodes();let le="";for(let ve=0;ve<ie.length;ve++)le+=ie[ve].getTextContent();return le}}function r(Oe){return Oe instanceof n}function l(){const Oe=e.$createPoint("root",0,"element"),ie=e.$createPoint("root",0,"element");return new n("root",Oe,ie)}function d(Oe){const ie=[],le=[Oe];for(;le.length>0;){const ve=le.pop();if(ve===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(ve)&&le.unshift(...ve.getChildren()),ve!==Oe&&ie.push(ve)}return ie}const f=/^(\d+(?:\.\d+)?)px$/,p={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class _ extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const le=new _(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return le.__rowSpan=ie.__rowSpan,le.__backgroundColor=ie.__backgroundColor,le}static importDOM(){return{td:ie=>({conversion:T,priority:0}),th:ie=>({conversion:T,priority:0})}}static importJSON(ie){const le=ie.colSpan||1,ve=ie.rowSpan||1,Le=E(ie.headerState,le,ie.width||void 0);return Le.__rowSpan=ve,Le.__backgroundColor=ie.backgroundColor||null,Le}constructor(ie=p.NO_STATUS,le=1,ve,Le){super(le,Le),this.__headerState=ie,this.__width=ve,this.__backgroundColor=null}createDOM(ie){const le=document.createElement(this.getTag());return this.__width&&(le.style.width=`${this.__width}px`),this.__colSpan>1&&(le.colSpan=this.__colSpan),this.__rowSpan>1&&(le.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(le.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(le,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),le}exportDOM(ie){const{element:le}=super.exportDOM(ie);if(le){const ve=le,Le=700,Me=this.getParentOrThrow().getChildrenSize();ve.style.border="1px solid black",this.__colSpan>1&&(ve.colSpan=this.__colSpan),this.__rowSpan>1&&(ve.rowSpan=this.__rowSpan),ve.style.width=`${this.getWidth()||Math.max(90,Le/Me)}px`,ve.style.verticalAlign="top",ve.style.textAlign="start";const je=this.getBackgroundColor();je!==null?ve.style.backgroundColor=je:this.hasHeader()&&(ve.style.backgroundColor="#f2f3f5")}return{element:le}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const le=this.getWritable();return le.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const le=this.getWritable();return le.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const le=this.getWritable();return(le.__headerState&ie)===ie?le.__headerState-=ie:le.__headerState+=ie,le}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==p.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(Oe){const ie=Oe,le=Oe.nodeName.toLowerCase();let ve;f.test(ie.style.width)&&(ve=parseFloat(ie.style.width));const Le=E(le==="th"?p.ROW:p.NO_STATUS,ie.colSpan,ve);Le.__rowSpan=ie.rowSpan;const Me=ie.style.backgroundColor;return Me!==""&&(Le.__backgroundColor=Me),{forChild:(je,rt)=>{if(S(rt)&&!e.$isElementNode(je)){const it=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
79
|
+
`?null:(it.append(je),it)}return je},node:Le}}function E(Oe,ie=1,le){return e.$applyNodeReplacement(new _(Oe,ie,le))}function S(Oe){return Oe instanceof _}class w extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new w(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:M,priority:0})}}static importJSON(ie){return m(ie.height)}constructor(ie,le){super(le),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const le=document.createElement("tr");return this.__height&&(le.style.height=`${this.__height}px`),t.addClassNamesToElement(le,ie.theme.tableRow),le}isShadowRoot(){return!0}setHeight(ie){const le=this.getWritable();return le.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function M(Oe){const ie=Oe;let le;return f.test(ie.style.height)&&(le=parseFloat(ie.style.height)),{node:m(le)}}function m(Oe){return e.$applyNodeReplacement(new w(Oe))}function v(Oe){return Oe instanceof w}const k=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Oe=>k?(Oe||window).getSelection():null;class I{constructor(ie,le){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=le,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(le=>{this.editor.update(()=>{let ve=!1;for(let Me=0;Me<le.length;Me++){const it=le[Me].target.nodeName;if(it==="TABLE"||it==="TR"){ve=!0;break}}if(!ve)return;const Le=this.editor.getElementByKey(this.tableNodeKey);if(!Le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(Le)})});this.editor.update(()=>{const le=this.editor.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(le),ie.observe(le,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=ie.getElementByKey(this.tableNodeKey);if(!ve)throw new Error("Expected to find TableElement in DOM");const Le=ce(ve);V(ie,Le,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(le,ie._config.theme.tableSelection),le.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(le,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const le=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),V(le,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,le=!1){const ve=this.editor;ve.update(()=>{const Le=e.$getNodeByKey(this.tableNodeKey);if(!B(Le))throw new Error("Expected TableNode.");if(!ve.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ie.x,rt=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const it=G(ve._window);it&&it.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==rt||le))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&rt===this.focusY)return;if(this.focusX=je,this.focusY=rt,this.isHighlightingCells){const it=e.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&S(it)){const st=it.getKey();this.gridSelection=this.gridSelection.clone()||l(),this.focusCellNodeKey=st,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),ve.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),V(ve,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const le=e.$getNearestNodeFromDOMNode(ie.elem);if(S(le)){const ve=le.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():l(),this.anchorCellNodeKey=ve}})}formatCells(ie){this.editor.update(()=>{const le=e.$getSelection();if(!r(le))throw Error("Expected grid selection");const ve=e.$createRangeSelection(),Le=ve.anchor,Me=ve.focus;le.getNodes().forEach(je=>{S(je)&&je.getTextContentSize()!==0&&(Le.set(je.getKey(),0,"element"),Me.set(je.getKey(),je.getChildrenSize(),"element"),ve.formatText(ie))}),e.$setSelection(le),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=e.$getSelection();if(!r(ve))throw Error("Expected grid selection");const Le=ve.getNodes().filter(S);if(Le.length===this.grid.columns*this.grid.rows){le.selectPrevious(),le.remove(),e.$getRoot().selectStart();return}Le.forEach(Me=>{if(e.$isElementNode(Me)){const je=e.$createParagraphNode(),rt=e.$createTextNode();je.append(rt),Me.append(je),Me.getChildren().forEach(it=>{it!==je&&it.remove()})}}),V(ie,this.grid,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const P="__lexicalTableSelection";function H(Oe,ie,le,ve){const Le=le.getRootElement();if(Le===null)throw new Error("No root element.");const Me=new I(le,Oe.getKey()),je=le._window||window;j(ie,Me),ie.addEventListener("mousedown",Ge=>{setTimeout(()=>{if(Ge.button!==0||!je)return;const ze=te(Ge.target);ze!==null&&(R(Ge),Me.setAnchorCellForSelection(ze));const tt=()=>{je.removeEventListener("mouseup",tt),je.removeEventListener("mousemove",yt)},yt=Nt=>{const Et=te(Nt.target);Et!==null&&(Me.anchorX!==Et.x||Me.anchorY!==Et.y)&&(Nt.preventDefault(),Me.setFocusCellForSelection(Et))};je.addEventListener("mouseup",tt),je.addEventListener("mousemove",yt)},0)});const rt=Ge=>{Ge.button===0&&le.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===Me.tableNodeKey&&Le.contains(tt)&&Me.clearHighlight()})};je.addEventListener("mousedown",rt),Me.listenersToRemove.add(()=>je.removeEventListener("mousedown",rt)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ge=>J(le,Ge,"down",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_UP_COMMAND,Ge=>J(le,Ge,"up",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ge=>J(le,Ge,"backward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ge=>J(le,Ge,"forward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ESCAPE_COMMAND,Ge=>{const ze=e.$getSelection();if(r(ze)){const tt=t.$findMatchingParent(ze.focus.getNode(),S);if(S(tt))return R(Ge),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const it=Ge=>()=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>S(Kt));if(!S(tt))return!1;const yt=ze.anchor.getNode(),Nt=ze.focus.getNode(),Et=Oe.isParentOf(yt),gt=Oe.isParentOf(Nt);if(Et&&!gt||gt&&!Et)return Me.clearText(),!0;const mt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>e.$isElementNode(Kt)),$t=mt&&t.$findMatchingParent(mt,Kt=>e.$isElementNode(Kt)&&S(Kt.getParent()));if(!e.$isElementNode($t)||!e.$isElementNode(mt))return!1;if(Ge===e.DELETE_LINE_COMMAND&&$t.getPreviousSibling()===null)return!0;if((Ge===e.DELETE_CHARACTER_COMMAND||Ge===e.DELETE_WORD_COMMAND)&&ze.isCollapsed()&&ze.anchor.offset===0&&mt!==$t){const Kt=mt.getChildren(),tn=e.$createParagraphNode();return Kt.forEach(It=>tn.append(It)),mt.replace(tn),mt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ge=>{Me.listenersToRemove.add(le.registerCommand(Ge,it(Ge),e.COMMAND_PRIORITY_CRITICAL))});const st=Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Ge.preventDefault(),Ge.stopPropagation(),Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1};Me.listenersToRemove.add(le.registerCommand(e.KEY_BACKSPACE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.KEY_DELETE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FORMAT_TEXT_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.formatCells(Ge),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearHighlight(),!1;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),ve&&Me.listenersToRemove.add(le.registerCommand(e.KEY_TAB_COMMAND,Ge=>{const ze=e.$getSelection();if(!e.$isRangeSelection(ze)||!ze.isCollapsed()||!de(ze,Oe))return!1;const tt=Y(ze.anchor.getNode());if(tt===null)return!1;R(Ge);const yt=Oe.getCordsFromCellNode(tt,Me.grid);return Se(Me,Oe,yt.x,yt.y,Ge.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FOCUS_COMMAND,Ge=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function vt(Ge){const ze=Oe.getCordsFromCellNode(Ge,Me.grid);return Oe.getCellFromCordsOrThrow(ze.x,ze.y,Me.grid)}return Me.listenersToRemove.add(le.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ge=>{const{nodes:ze,selection:tt}=Ge,yt=e.$INTERNAL_isPointSelection(tt),Nt=e.$isRangeSelection(tt),Et=Nt&&t.$findMatchingParent(tt.anchor.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null&&t.$findMatchingParent(tt.focus.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null||yt&&!Nt;if(ze.length!==1||!e.DEPRECATED_$isGridNode(ze[0])||!Et)return!1;const{anchor:gt}=tt,xt=ze[0],mt=xt.getChildren(),$t=xt.getFirstChildOrThrow().getChildrenSize(),Kt=xt.getChildrenSize(),tn=t.$findMatchingParent(gt.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=tn&&t.$findMatchingParent(tn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),jt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(tn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(jt))return!1;const bt=It.getIndexWithinParent(),nn=Math.min(jt.getChildrenSize()-1,bt+Kt-1),Or=tn.getIndexWithinParent(),_i=Math.min(It.getChildrenSize()-1,Or+$t-1),pe=Math.min(Or,_i),Ze=Math.min(bt,nn),ot=Math.max(Or,_i),St=Math.max(bt,nn),Gt=jt.getChildren();let Bt=0,Pt,kt;for(let Ht=Ze;Ht<=St;Ht++){const sn=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(sn))return!1;const an=mt[Bt];if(!e.DEPRECATED_$isGridRowNode(an))return!1;const bn=sn.getChildren(),yr=an.getChildren();let Zn=0;for(let fn=pe;fn<=ot;fn++){const sr=bn[fn];if(!e.DEPRECATED_$isGridCellNode(sr))return!1;const or=yr[Zn];if(!e.DEPRECATED_$isGridCellNode(or))return!1;Ht===Ze&&fn===pe?Pt=sr.getKey():Ht===St&&fn===ot&&(kt=sr.getKey());const Mi=sr.getChildren();or.getChildren().forEach(Nr=>{e.$isTextNode(Nr)&&e.$createParagraphNode().append(Nr),sr.append(Nr)}),Mi.forEach(Nr=>Nr.remove()),Zn++}Bt++}if(Pt&&kt){const Ht=l();Ht.set(ze[0].getKey(),Pt,kt),e.$setSelection(Ht)}return!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ge=e.$getSelection(),ze=e.$getPreviousSelection();if(e.$isRangeSelection(Ge)){const{anchor:tt,focus:yt}=Ge,Nt=tt.getNode(),Et=yt.getNode(),gt=Y(Nt),xt=Y(Et),mt=gt&&Oe.is(W(gt)),$t=xt&&Oe.is(W(xt)),Kt=mt!==$t,tn=mt&&$t,It=Ge.isBackward();if(Kt){const jt=Ge.clone();jt.focus.set(Oe.getKey(),It?0:Oe.getChildrenSize(),"element"),e.$setSelection(jt),q(le,Me)}else tn&&(gt.is(xt)||(Me.setAnchorCellForSelection(vt(gt)),Me.setFocusCellForSelection(vt(xt),!0)))}return Ge&&!Ge.is(ze)&&(r(Ge)||r(ze))&&Me.gridSelection&&!Me.gridSelection.is(ze)?(r(Ge)&&Ge.gridKey===Me.tableNodeKey?Me.updateTableGridSelection(Ge):!r(Ge)&&r(ze)&&ze.gridKey===Me.tableNodeKey&&Me.updateTableGridSelection(null),!1):(Me.hasHijackedSelectionStyles&&!Oe.isSelected()?Te(le,Me):!Me.hasHijackedSelectionStyles&&Oe.isSelected()&&q(le,Me),!1)},e.COMMAND_PRIORITY_CRITICAL)),Me}function j(Oe,ie){Oe[P]=ie}function re(Oe){return Oe[P]}function te(Oe){let ie=Oe;for(;ie!=null;){const le=ie.nodeName;if(le==="TD"||le==="TH"){const ve=ie._cell;return ve===void 0?null:ve}ie=ie.parentNode}return null}function ce(Oe){const ie=[],le={cells:ie,columns:0,rows:0};let ve=Oe.firstChild,Le=0,Me=0;for(ie.length=0;ve!=null;){const je=ve.nodeName;if(je==="TD"||je==="TH"){const st=ve,vt={elem:st,hasBackgroundColor:st.style.backgroundColor!=="",highlighted:!1,x:Le,y:Me};ve._cell=vt;let Ge=ie[Me];Ge===void 0&&(Ge=ie[Me]=[]),Ge[Le]=vt}else{const st=ve.firstChild;if(st!=null){ve=st;continue}}const rt=ve.nextSibling;if(rt!=null){Le++,ve=rt;continue}const it=ve.parentNode;if(it!=null){const st=it.nextSibling;if(st==null)break;Me++,Le=0,ve=st}}return le.columns=Le+1,le.rows=Me+1,le}function V(Oe,ie,le){const ve=new Set(le?le.getNodes():[]);z(ie,(Le,Me)=>{const je=Le.elem;ve.has(Me)?(Le.highlighted=!0,Z(Oe,Le)):(Le.highlighted=!1,oe(Oe,Le),je.getAttribute("style")||je.removeAttribute("style"))})}function z(Oe,ie){const{cells:le}=Oe;for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(Le)for(let Me=0;Me<Le.length;Me++){const je=Le[Me];if(!je)continue;const rt=e.$getNearestNodeFromDOMNode(je.elem);rt!==null&&ie(je,rt,{x:Me,y:ve})}}}function q(Oe,ie){ie.disableHighlightStyle(),z(ie.grid,le=>{le.highlighted=!0,Z(Oe,le)})}function Te(Oe,ie){ie.enableHighlightStyle(),z(ie.grid,le=>{const ve=le.elem;le.highlighted=!1,oe(Oe,le),ve.getAttribute("style")||ve.removeAttribute("style")})}const Se=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)?K(ie.getCellNodeFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid),Me):ve!==(Me?Oe.grid.rows-1:0)?K(ie.getCellNodeFromCordsOrThrow(Me?0:Oe.grid.columns-1,ve+(Me?1:-1),Oe.grid),Me):Me?ie.selectNext():ie.selectPrevious(),!0;case"up":return ve!==0?K(ie.getCellNodeFromCordsOrThrow(le,ve-1,Oe.grid),!1):ie.selectPrevious(),!0;case"down":return ve!==Oe.grid.rows-1?K(ie.getCellNodeFromCordsOrThrow(le,ve+1,Oe.grid),!0):ie.selectNext(),!0;default:return!1}},Ee=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid)),!0;case"up":return ve!==0?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve-1,Oe.grid)),!0):!1;case"down":return ve!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve+1,Oe.grid)),!0):!1;default:return!1}};function de(Oe,ie){if(e.$isRangeSelection(Oe)||r(Oe)){const le=ie.isParentOf(Oe.anchor.getNode()),ve=ie.isParentOf(Oe.focus.getNode());return le&&ve}return!1}function K(Oe,ie){ie?Oe.selectStart():Oe.selectEnd()}const O="172,206,247";function Z(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null?le.style.setProperty("background-color",`rgb(${O})`):le.style.setProperty("background-image",`linear-gradient(to right, rgba(${O},0.85), rgba(${O},0.85))`),le.style.setProperty("caret-color","transparent")}function oe(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null&&le.style.removeProperty("background-color"),le.style.removeProperty("background-image"),le.style.removeProperty("caret-color")}function Y(Oe){const ie=t.$findMatchingParent(Oe,S);return S(ie)?ie:null}function W(Oe){const ie=t.$findMatchingParent(Oe,B);return B(ie)?ie:null}function J(Oe,ie,le,ve,Le){const Me=e.$getSelection();if(!de(Me,ve))return!1;if(e.$isRangeSelection(Me)&&Me.isCollapsed()){if(le==="backward"||le==="forward")return!1;const{anchor:je,focus:rt}=Me,it=t.$findMatchingParent(je.getNode(),S),st=t.$findMatchingParent(rt.getNode(),S);if(!S(it)||!it.is(st))return!1;const vt=W(it);if(vt!==ve&&vt!=null){const xt=Oe.getElementByKey(vt.getKey());if(xt!=null)return Le.grid=ce(xt),J(Oe,ie,le,vt,Le)}const Ge=Oe.getElementByKey(it.__key),ze=Oe.getElementByKey(je.key);if(ze==null||Ge==null)return!1;let tt;if(je.type==="element")tt=ze.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const yt=le==="up"?it.getFirstChild():it.getLastChild();if(yt==null)return!1;const Nt=Oe.getElementByKey(yt.__key);if(Nt==null)return!1;const Et=Nt.getBoundingClientRect();if(le==="up"?Et.top>tt.top-tt.height:tt.bottom+tt.height>Et.bottom){R(ie);const xt=ve.getCordsFromCellNode(it,Le.grid);if(ie.shiftKey){const mt=ve.getCellFromCordsOrThrow(xt.x,xt.y,Le.grid);Le.setAnchorCellForSelection(mt),Le.setFocusCellForSelection(mt,!0)}else return Se(Le,ve,xt.x,xt.y,le);return!0}}else if(r(Me)){const{anchor:je,focus:rt}=Me,it=t.$findMatchingParent(je.getNode(),S),st=t.$findMatchingParent(rt.getNode(),S),[vt]=Me.getNodes(),Ge=Oe.getElementByKey(vt.getKey());if(!S(it)||!S(st)||!B(vt)||Ge==null)return!1;Le.updateTableGridSelection(Me);const ze=ce(Ge),tt=ve.getCordsFromCellNode(it,ze),yt=ve.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Le.setAnchorCellForSelection(yt),R(ie),ie.shiftKey){const Nt=ve.getCordsFromCellNode(st,ze);return Ee(Le,vt,Nt.x,Nt.y,le)}else st.selectEnd();return!0}return!1}function R(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class U extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new U(ie.__key)}static importDOM(){return{table:ie=>({conversion:fe,priority:1})}}static importJSON(ie){return _e()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,le){const ve=document.createElement("table");return t.addClassNamesToElement(ve,ie.theme.table),ve}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:le=>{if(le){const ve=le.cloneNode(),Le=document.createElement("colgroup"),Me=document.createElement("tbody");t.isHTMLElement(le)&&Me.append(...le.children);const je=this.getFirstChildOrThrow();if(!v(je))throw new Error("Expected to find row node.");const rt=je.getChildrenSize();for(let it=0;it<rt;it++){const st=document.createElement("col");Le.append(st)}return ve.replaceChildren(Le,Me),ve}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,le){const{rows:ve,cells:Le}=le;for(let Me=0;Me<ve;Me++){const je=Le[Me];if(je==null)continue;const rt=je.findIndex(it=>{if(!it)return;const{elem:st}=it;return e.$getNearestNodeFromDOMNode(st)===ie});if(rt!==-1)return{x:rt,y:Me}}throw new Error("Cell not found in table.")}getCellFromCords(ie,le,ve){const{cells:Le}=ve,Me=Le[le];if(Me==null)return null;const je=Me[ie];return je??null}getCellFromCordsOrThrow(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(!Le)throw new Error("Cell not found at cords.");return Le}getCellNodeFromCords(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(Le==null)return null;const Me=e.$getNearestNodeFromDOMNode(Le.elem);return S(Me)?Me:null}getCellNodeFromCordsOrThrow(ie,le,ve){const Le=this.getCellNodeFromCords(ie,le,ve);if(!Le)throw new Error("Node at cords not TableCellNode.");return Le}canSelectBefore(){return!0}canIndent(){return!1}}function X(Oe,ie){const le=Oe.getElementByKey(ie.getKey());if(le==null)throw new Error("Table Element Not Found");return ce(le)}function fe(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new U)}function B(Oe){return Oe instanceof U}function A(Oe,ie,le=!0){const ve=_e();for(let Le=0;Le<Oe;Le++){const Me=m();for(let je=0;je<ie;je++){let rt=p.NO_STATUS;typeof le=="object"?(Le===0&&le.rows&&(rt|=p.ROW),je===0&&le.columns&&(rt|=p.COLUMN)):le&&(Le===0&&(rt|=p.ROW),je===0&&(rt|=p.COLUMN));const it=E(rt),st=e.$createParagraphNode();st.append(e.$createTextNode()),it.append(st),Me.append(it)}ve.append(Me)}return ve}function F(Oe){const ie=t.$findMatchingParent(Oe,le=>S(le));return S(ie)?ie:null}function se(Oe){const ie=t.$findMatchingParent(Oe,le=>v(le));if(v(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ie=t.$findMatchingParent(Oe,le=>B(le));if(B(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function De(Oe){const ie=se(Oe);return ye(ie).getChildren().findIndex(ve=>ve.is(ie))}function ee(Oe){return se(Oe).getChildren().findIndex(le=>le.is(Oe))}function ne(Oe,ie){const le=ye(Oe),{x:ve,y:Le}=le.getCordsFromCellNode(Oe,ie);return{above:le.getCellNodeFromCords(ve,Le-1,ie),below:le.getCellNodeFromCords(ve,Le+1,ie),left:le.getCellNodeFromCords(ve-1,Le,ie),right:le.getCellNodeFromCords(ve+1,Le,ie)}}function ue(Oe,ie){const le=Oe.getChildren();if(ie>=le.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return le[ie].remove(),Oe}function be(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table row target index out of range");const je=Me[ie];if(v(je))for(let rt=0;rt<ve;rt++){const it=je.getChildren(),st=it.length,vt=m();for(let Ge=0;Ge<st;Ge++){const ze=it[Ge];if(!S(ze))throw Error("Expected table cell");const{above:tt,below:yt}=ne(ze,Le);let Nt=p.NO_STATUS;const Et=tt&&tt.getWidth()||yt&&yt.getWidth()||void 0;(tt&&tt.hasHeaderState(p.COLUMN)||yt&&yt.hasHeaderState(p.COLUMN))&&(Nt|=p.COLUMN);const gt=E(Nt,1,Et);gt.append(e.$createParagraphNode()),vt.append(gt)}le?je.insertAfter(vt):je.insertBefore(vt)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const le=ie.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,je]=e.DEPRECATED_$computeGridMap(Le,ve,ve),rt=Me[0].length,{startRow:it}=je;if(Oe){const st=it+ve.__rowSpan-1,vt=Me[st],Ge=m();for(let tt=0;tt<rt;tt++){const{cell:yt,startRow:Nt}=vt[tt];Nt+yt.__rowSpan-1<=st?Ge.append(E(p.NO_STATUS).append(e.$createParagraphNode())):yt.setRowSpan(yt.__rowSpan+1)}const ze=Le.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const st=Me[it],vt=m();for(let ze=0;ze<rt;ze++){const{cell:tt,startRow:yt}=st[ze];yt===it?vt.append(E(p.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Le.getChildAtIndex(it);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(vt)}}function Re(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren(),je=[];for(let rt=0;rt<Me.length;rt++){const it=Me[rt];if(v(it))for(let st=0;st<ve;st++){const vt=it.getChildren();if(ie>=vt.length||ie<0)throw new Error("Table column target index out of range");const Ge=vt[ie];if(!S(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=ne(Ge,Le);let yt=p.NO_STATUS;(ze&&ze.hasHeaderState(p.ROW)||tt&&tt.hasHeaderState(p.ROW))&&(yt|=p.ROW);const Nt=E(yt);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:rt,targetCell:it})=>{le?it.insertAfter(rt):it.insertBefore(rt)}),Oe}function ke(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const le=ie.anchor.getNode(),ve=ie.focus.getNode(),[Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,,je]=e.DEPRECATED_$getNodeTriplet(ve),[rt,it,st]=e.DEPRECATED_$computeGridMap(je,Me,Le),vt=rt.length,Ge=Oe?Math.max(it.startColumn,st.startColumn):Math.min(it.startColumn,st.startColumn),ze=Oe?Ge+Me.__colSpan-1:Ge-1,tt=je.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let yt=null;function Nt(){const gt=E(p.NO_STATUS).append(e.$createParagraphNode());return yt===null&&(yt=gt),gt}let Et=tt;e:for(let gt=0;gt<vt;gt++){if(gt!==0){const tn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(tn))throw Error("Expected row nextSibling to be a row");Et=tn}const xt=rt[gt];if(ze<0){At(Et,Nt());continue}const{cell:mt,startColumn:$t,startRow:Kt}=xt[ze];if($t+mt.__colSpan-1<=ze){let tn=mt,It=Kt,jt=ze;for(;It!==gt&&tn.__rowSpan>1;)if(jt-=mt.__colSpan,jt>=0){const{cell:bt,startRow:nn}=xt[jt];tn=bt,It=nn}else{Et.append(Nt());continue e}tn.insertAfter(Nt())}else mt.setColSpan(mt.__colSpan+1)}yt!==null&&ut(yt)}function Fe(Oe,ie){const le=Oe.getChildren();for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(v(Le)){const Me=Le.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table column target index out of range");Me[ie].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,rt,it]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startRow:st}=rt,{startRow:vt}=it,Ge=vt+Me.__rowSpan-1;if(je.length===Ge-st+1){Le.remove();return}const ze=je[0].length,tt=je[Ge+1],yt=Le.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=st;Nt--){for(let gt=ze-1;gt>=0;gt--){const{cell:xt,startRow:mt,startColumn:$t}=je[Nt][gt];if($t===gt&&(Nt===st&&mt<st&&xt.setRowSpan(xt.__rowSpan-(mt-st)),mt>=st&&mt+xt.__rowSpan-1>Ge)){if(xt.setRowSpan(xt.__rowSpan-(Ge-mt+1)),yt===null)throw Error("Expected nextRowNode not to be null");if(gt===0)At(yt,xt);else{const{cell:Kt}=tt[gt-1];Kt.insertAfter(xt)}}}const Et=Le.getChildAtIndex(Nt);if(!e.DEPRECATED_$isGridRowNode(Et))throw Error(`Expected GridNode childAtIndex(${String(Nt)}) to be RowNode`);Et.remove()}if(tt!==void 0){const{cell:Nt}=tt[0];ut(Nt)}else{const Nt=je[st-1],{cell:Et}=Nt[0];ut(Et)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,rt,it]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startColumn:st}=rt,{startRow:vt,startColumn:Ge}=it,ze=Math.min(st,Ge),tt=Math.max(st+ve.__colSpan-1,Ge+Me.__colSpan-1),yt=tt-ze+1;if(je[0].length===tt-ze+1){Le.selectPrevious(),Le.remove();return}const Et=je.length;for(let mt=0;mt<Et;mt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:tn}=je[mt][$t];if(tn<ze){if($t===ze){const It=ze-tn;Kt.setColSpan(Kt.__colSpan-Math.min(yt,Kt.__colSpan-It))}}else if(tn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-tn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const gt=je[vt],xt=gt[Ge+Me.__colSpan];if(xt!==void 0){const{cell:mt}=xt;ut(mt)}else{const mt=gt[Ge-1],{cell:$t}=mt;ut($t)}}function ut(Oe){const ie=Oe.getFirstDescendant();ie==null?Oe.selectStart():ie.getParentOrThrow().selectStart()}function At(Oe,ie){const le=Oe.getFirstChild();le!==null?le.insertBefore(ie):Oe.append(ie)}function Ut(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),[le,ve,Le]=e.DEPRECATED_$getNodeTriplet(ie),Me=le.__colSpan,je=le.__rowSpan;if(Me>1){for(let rt=1;rt<Me;rt++)le.insertAfter(E(p.NO_STATUS));le.setColSpan(1)}if(je>1){const[rt,it]=e.DEPRECATED_$computeGridMap(Le,le,le),{startColumn:st,startRow:vt}=it;let Ge;for(let ze=1;ze<je;ze++){const tt=vt+ze,yt=rt[tt];if(Ge=(Ge||ve).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ge))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Et=0;Et<st;Et++){const gt=yt[Et],xt=gt.cell;gt.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Et+=xt.__colSpan-1)}if(Nt===null)for(let Et=0;Et<Me;Et++)At(Ge,E(p.NO_STATUS));else for(let Et=0;Et<Me;Et++)Nt.insertAfter(E(p.NO_STATUS))}le.setRowSpan(1)}}const en=e.createCommand("INSERT_TABLE_COMMAND");return Zt.$createGridSelection=l,Zt.$createTableCellNode=E,Zt.$createTableNode=_e,Zt.$createTableNodeWithDimensions=A,Zt.$createTableRowNode=m,Zt.$deleteTableColumn=Fe,Zt.$deleteTableColumn__EXPERIMENTAL=Be,Zt.$deleteTableRow__EXPERIMENTAL=qe,Zt.$getElementGridForTableNode=X,Zt.$getTableCellNodeFromLexicalNode=F,Zt.$getTableColumnIndexFromTableCellNode=ee,Zt.$getTableNodeFromLexicalNodeOrThrow=ye,Zt.$getTableRowIndexFromTableCellNode=De,Zt.$getTableRowNodeFromTableCellNodeOrThrow=se,Zt.$insertTableColumn=Re,Zt.$insertTableColumn__EXPERIMENTAL=ke,Zt.$insertTableRow=be,Zt.$insertTableRow__EXPERIMENTAL=Ne,Zt.$isGridSelection=r,Zt.$isTableCellNode=S,Zt.$isTableNode=B,Zt.$isTableRowNode=v,Zt.$removeTableRowAtIndex=ue,Zt.$unmergeCell=Ut,Zt.INSERT_TABLE_COMMAND=en,Zt.TableCellHeaderStates=p,Zt.TableCellNode=_,Zt.TableNode=U,Zt.TableRowNode=w,Zt.TableSelection=I,Zt.applyTableHandlers=H,Zt.getCellFromTarget=te,Zt.getTableSelectionFromTableElement=re,Zt}var Jt={},xh;function LC(){if(xh)return Jt;xh=1;var e=Yt(),t=pn();function n(B){let A=new URLSearchParams;A.append("code",B);for(let F=1;F<arguments.length;F++)A.append("v",arguments[F]);throw Error(`Minified Lexical error #${B}; visit https://lexical.dev/docs/error?${A} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class r extends e.INTERNAL_PointSelection{constructor(A,F,se){super(F,se),this.gridKey=A}getCachedNodes(){return this._cachedNodes}setCachedNodes(A){this._cachedNodes=A}is(A){return l(A)?this.gridKey===A.gridKey&&this.anchor.is(A.anchor)&&this.focus.is(A.focus):!1}set(A,F,se){this.dirty=!0,this.gridKey=A,this.anchor.key=F,this.focus.key=se,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(A){let F=this.focus.getNode();if(!e.$isElementNode(F))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(F.select(0,F.getChildrenSize())).insertNodes(A)}getShape(){var A=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(A)||n(103),A=e.DEPRECATED_$getGridCellNodeRect(A),A===null)throw Error("getCellRect: expected to find AnchorNode");var F=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(F)||n(104);let se=e.DEPRECATED_$getGridCellNodeRect(F);if(se===null)throw Error("getCellRect: expected to find focusCellNode");F=Math.min(A.columnIndex,se.columnIndex);let ye=Math.max(A.columnIndex,se.columnIndex),De=Math.min(A.rowIndex,se.rowIndex);return A=Math.max(A.rowIndex,se.rowIndex),{fromX:Math.min(F,ye),fromY:Math.min(De,A),toX:Math.max(F,ye),toY:Math.max(De,A)}}getNodes(){function A(ut){let{cell:At,startColumn:Ut,startRow:en}=ut;be=Math.min(be,Ut),Ne=Math.min(Ne,en),Re=Math.max(Re,Ut+At.__colSpan-1),ke=Math.max(ke,en+At.__rowSpan-1)}var F=this._cachedNodes;if(F!==null)return F;var se=this.anchor.getNode();F=this.focus.getNode();var ye=t.$findMatchingParent(se,e.DEPRECATED_$isGridCellNode);se=t.$findMatchingParent(F,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(se)||n(104),F=ye.getParent(),e.DEPRECATED_$isGridRowNode(F)||n(105),F=F.getParent(),e.DEPRECATED_$isGridNode(F)||n(106);var De=se.getParents()[1];if(De!==F){if(F.isParentOf(se)){if(F=De.getParent(),F==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,se.getKey(),F.getKey())}else{if(F=F.getParent(),F==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,F.getKey(),se.getKey())}return this.getNodes()}let[ee,ne,ue]=e.DEPRECATED_$computeGridMap(F,ye,se),be=Math.min(ne.startColumn,ue.startColumn),Ne=Math.min(ne.startRow,ue.startRow),Re=Math.max(ne.startColumn+ne.cell.__colSpan-1,ue.startColumn+ue.cell.__colSpan-1),ke=Math.max(ne.startRow+ne.cell.__rowSpan-1,ue.startRow+ue.cell.__rowSpan-1);se=be,ye=Ne,De=be;for(var Fe=Ne;be<se||Ne<ye||Re>De||ke>Fe;){if(be<se){var qe=Fe-ye;--se;for(var Be=0;Be<=qe;Be++)A(ee[ye+Be][se])}if(Ne<ye)for(qe=De-se,--ye,Be=0;Be<=qe;Be++)A(ee[ye][se+Be]);if(Re>De)for(qe=Fe-ye,De+=1,Be=0;Be<=qe;Be++)A(ee[ye+Be][De]);if(ke>Fe)for(qe=De-se,Fe+=1,Be=0;Be<=qe;Be++)A(ee[Fe][se+Be])}for(F=[F],se=null,ye=Ne;ye<=ke;ye++)for(De=be;De<=Re;De++)({cell:Fe}=ee[ye][De]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==se&&F.push(qe),F.push(Fe,...f(Fe)),se=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=F),F}getTextContent(){let A=this.getNodes(),F="";for(let se=0;se<A.length;se++)F+=A[se].getTextContent();return F}}function l(B){return B instanceof r}function d(){let B=e.$createPoint("root",0,"element"),A=e.$createPoint("root",0,"element");return new r("root",B,A)}function f(B){let A=[],F=[B];for(;0<F.length;){let se=F.pop();se===void 0&&n(112),e.$isElementNode(se)&&F.unshift(...se.getChildren()),se!==B&&A.push(se)}return A}let p=/^(\d+(?:\.\d+)?)px$/,_={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class T extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(A){let F=new T(A.__headerState,A.__colSpan,A.__width,A.__key);return F.__rowSpan=A.__rowSpan,F.__backgroundColor=A.__backgroundColor,F}static importDOM(){return{td:()=>({conversion:E,priority:0}),th:()=>({conversion:E,priority:0})}}static importJSON(A){let F=A.rowSpan||1,se=S(A.headerState,A.colSpan||1,A.width||void 0);return se.__rowSpan=F,se.__backgroundColor=A.backgroundColor||null,se}constructor(A=_.NO_STATUS,F=1,se,ye){super(F,ye),this.__headerState=A,this.__width=se,this.__backgroundColor=null}createDOM(A){let F=document.createElement(this.getTag());return this.__width&&(F.style.width=`${this.__width}px`),1<this.__colSpan&&(F.colSpan=this.__colSpan),1<this.__rowSpan&&(F.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(F.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(F,A.theme.tableCell,this.hasHeader()&&A.theme.tableCellHeader),F}exportDOM(A){if({element:A}=super.exportDOM(A),A){var F=this.getParentOrThrow().getChildrenSize();A.style.border="1px solid black",1<this.__colSpan&&(A.colSpan=this.__colSpan),1<this.__rowSpan&&(A.rowSpan=this.__rowSpan),A.style.width=`${this.getWidth()||Math.max(90,700/F)}px`,A.style.verticalAlign="top",A.style.textAlign="start",F=this.getBackgroundColor(),F!==null?A.style.backgroundColor=F:this.hasHeader()&&(A.style.backgroundColor="#f2f3f5")}return{element:A}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(A){return this.getWritable().__headerState=A,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(A){return this.getWritable().__width=A,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(A){this.getWritable().__backgroundColor=A}toggleHeaderStyle(A){let F=this.getWritable();return F.__headerState=(F.__headerState&A)===A?F.__headerState-A:F.__headerState+A,F}hasHeaderState(A){return(this.getHeaderStyles()&A)===A}hasHeader(){return this.getLatest().__headerState!==_.NO_STATUS}updateDOM(A){return A.__headerState!==this.__headerState||A.__width!==this.__width||A.__colSpan!==this.__colSpan||A.__rowSpan!==this.__rowSpan||A.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function E(B){var A=B.nodeName.toLowerCase();let F;return p.test(B.style.width)&&(F=parseFloat(B.style.width)),A=S(A==="th"?_.ROW:_.NO_STATUS,B.colSpan,F),A.__rowSpan=B.rowSpan,B=B.style.backgroundColor,B!==""&&(A.__backgroundColor=B),{forChild:(se,ye)=>w(ye)&&!e.$isElementNode(se)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(se)&&se.getTextContent()===`
|
|
80
|
+
`?null:(ye.append(se),ye)):se,node:A}}function S(B,A=1,F){return e.$applyNodeReplacement(new T(B,A,F))}function w(B){return B instanceof T}class M extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(A){return new M(A.__height,A.__key)}static importDOM(){return{tr:()=>({conversion:m,priority:0})}}static importJSON(A){return v(A.height)}constructor(A,F){super(F),this.__height=A}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(A){let F=document.createElement("tr");return this.__height&&(F.style.height=`${this.__height}px`),t.addClassNamesToElement(F,A.theme.tableRow),F}isShadowRoot(){return!0}setHeight(A){return this.getWritable().__height=A,this.__height}getHeight(){return this.getLatest().__height}updateDOM(A){return A.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function m(B){let A;return p.test(B.style.height)&&(A=parseFloat(B.style.height)),{node:v(A)}}function v(B){return e.$applyNodeReplacement(new M(B))}function k(B){return B instanceof M}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class I{constructor(A,F){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=F,this.editor=A,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(A=>A())}trackTableGrid(){let A=new MutationObserver(F=>{this.editor.update(()=>{var se=!1;for(let ye=0;ye<F.length;ye++){const De=F[ye].target.nodeName;if(De==="TABLE"||De==="TR"){se=!0;break}}if(se){if(se=this.editor.getElementByKey(this.tableNodeKey),!se)throw Error("Expected to find TableElement in DOM");this.grid=H(se)}})});this.editor.update(()=>{let F=this.editor.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");this.grid=H(F),A.observe(F,{childList:!0,subtree:!0})})}clearHighlight(){let A=this.editor;this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),A.update(()=>{var F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");if(F=A.getElementByKey(this.tableNodeKey),!F)throw Error("Expected to find TableElement in DOM");F=H(F),j(A,F,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(F,A._config.theme.tableSelection),F.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(F,A._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(A){if(A!=null&&A.gridKey===this.tableNodeKey){let F=this.editor;this.gridSelection=A,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(F,this.grid,this.gridSelection)}else A==null?this.clearHighlight():(this.tableNodeKey=A.gridKey,this.updateTableGridSelection(A))}setFocusCellForSelection(A,F=!1){let se=this.editor;se.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!W(ye))throw Error("Expected TableNode.");if(!se.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=A.x;let De=A.y;if(this.focusCell=A,this.anchorCell!==null){let ee=G?(se._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==De||F))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&De===this.focusY)return;this.focusX=ye,this.focusY=De,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(A.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&w(ye)&&(ye=ye.getKey(),this.gridSelection=this.gridSelection.clone()||d(),this.focusCellNodeKey=ye,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),se.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),j(se,this.grid,this.gridSelection)))})}setAnchorCellForSelection(A){this.isHighlightingCells=!1,this.anchorCell=A,this.anchorX=A.x,this.anchorY=A.y,this.editor.update(()=>{var F=e.$getNearestNodeFromDOMNode(A.elem);w(F)&&(F=F.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=F)})}formatCells(A){this.editor.update(()=>{let F=e.$getSelection();l(F)||n(11);let se=e.$createRangeSelection(),ye=se.anchor,De=se.focus;F.getNodes().forEach(ee=>{w(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),De.set(ee.getKey(),ee.getChildrenSize(),"element"),se.formatText(A))}),e.$setSelection(F),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let A=this.editor;A.update(()=>{let F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");var se=e.$getSelection();l(se)||n(11),se=se.getNodes().filter(w),se.length===this.grid.columns*this.grid.rows?(F.selectPrevious(),F.remove(),e.$getRoot().selectStart()):(se.forEach(ye=>{if(e.$isElementNode(ye)){let De=e.$createParagraphNode(),ee=e.$createTextNode();De.append(ee),ye.append(De),ye.getChildren().forEach(ne=>{ne!==De&&ne.remove()})}}),j(A,this.grid,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function P(B){for(;B!=null;){let A=B.nodeName;if(A==="TD"||A==="TH"){if(B=B._cell,B===void 0)break;return B}B=B.parentNode}return null}function H(B){let A=[],F={cells:A,columns:0,rows:0};var se=B.firstChild;let ye=B=0;for(A.length=0;se!=null;){var De=se.nodeName;if(De==="TD"||De==="TH"){De=se,De={elem:De,hasBackgroundColor:De.style.backgroundColor!=="",highlighted:!1,x:B,y:ye},se._cell=De;let ee=A[ye];ee===void 0&&(ee=A[ye]=[]),ee[B]=De}else if(De=se.firstChild,De!=null){se=De;continue}if(De=se.nextSibling,De!=null)B++,se=De;else if(De=se.parentNode,De!=null){if(se=De.nextSibling,se==null)break;ye++,B=0}}return F.columns=B+1,F.rows=ye+1,F}function j(B,A,F){let se=new Set(F?F.getNodes():[]);re(A,(ye,De)=>{let ee=ye.elem;se.has(De)?(ye.highlighted=!0,Te(B,ye)):(ye.highlighted=!1,Se(B,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function re(B,A){({cells:B}=B);for(let F=0;F<B.length;F++){let se=B[F];if(se)for(let ye=0;ye<se.length;ye++){let De=se[ye];if(!De)continue;let ee=e.$getNearestNodeFromDOMNode(De.elem);ee!==null&&A(De,ee,{x:ye,y:F})}}}function te(B,A){A.disableHighlightStyle(),re(A.grid,F=>{F.highlighted=!0,Te(B,F)})}function ce(B,A){A.enableHighlightStyle(),re(A.grid,F=>{let se=F.elem;F.highlighted=!1,Se(B,F),se.getAttribute("style")||se.removeAttribute("style")})}let V=(B,A,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)?(B=A.getCellNodeFromCordsOrThrow(F+(De?1:-1),se,B.grid),De?B.selectStart():B.selectEnd()):se!==(De?B.grid.rows-1:0)?(B=A.getCellNodeFromCordsOrThrow(De?0:B.grid.columns-1,se+(De?1:-1),B.grid),De?B.selectStart():B.selectEnd()):De?A.selectNext():A.selectPrevious(),!0;case"up":return se!==0?A.getCellNodeFromCordsOrThrow(F,se-1,B.grid).selectEnd():A.selectPrevious(),!0;case"down":return se!==B.grid.rows-1?A.getCellNodeFromCordsOrThrow(F,se+1,B.grid).selectStart():A.selectNext(),!0;default:return!1}},z=(B,A,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)&&B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F+(De?1:-1),se,B.grid)),!0;case"up":return se!==0?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,se-1,B.grid)),!0):!1;case"down":return se!==B.grid.rows-1?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,se+1,B.grid)),!0):!1;default:return!1}};function q(B,A){if(e.$isRangeSelection(B)||l(B)){let F=A.isParentOf(B.anchor.getNode());return B=A.isParentOf(B.focus.getNode()),F&&B}return!1}function Te(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null?B.style.setProperty("background-color","rgb(172,206,247)"):B.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),B.style.setProperty("caret-color","transparent")}function Se(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null&&B.style.removeProperty("background-color"),B.style.removeProperty("background-image"),B.style.removeProperty("caret-color")}function Ee(B){return B=t.$findMatchingParent(B,w),w(B)?B:null}function de(B){return B=t.$findMatchingParent(B,W),W(B)?B:null}function K(B,A,F,se,ye){let De=e.$getSelection();if(!q(De,se))return!1;if(e.$isRangeSelection(De)&&De.isCollapsed()){if(F==="backward"||F==="forward")return!1;let{anchor:be,focus:Ne}=De;var ee=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w);if(!w(ee)||!ee.is(ne))return!1;if(ne=de(ee),ne!==se&&ne!=null){var ue=B.getElementByKey(ne.getKey());if(ue!=null)return ye.grid=H(ue),K(B,A,F,ne,ye)}if(ne=B.getElementByKey(ee.__key),ue=B.getElementByKey(be.key),ue==null||ne==null)return!1;if(be.type==="element")ne=ue.getBoundingClientRect();else{if(ne=window.getSelection(),ne===null||ne.rangeCount===0)return!1;ne=ne.getRangeAt(0).getBoundingClientRect()}if(ue=F==="up"?ee.getFirstChild():ee.getLastChild(),ue==null||(B=B.getElementByKey(ue.__key),B==null))return!1;if(B=B.getBoundingClientRect(),F==="up"?B.top>ne.top-ne.height:ne.bottom+ne.height>B.bottom){if(O(A),B=se.getCordsFromCellNode(ee,ye.grid),A.shiftKey)F=se.getCellFromCordsOrThrow(B.x,B.y,ye.grid),ye.setAnchorCellForSelection(F),ye.setFocusCellForSelection(F,!0);else return V(ye,se,B.x,B.y,F);return!0}}else if(l(De)){let{anchor:be,focus:Ne}=De;return ue=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w),[ee]=De.getNodes(),B=B.getElementByKey(ee.getKey()),!w(ue)||!w(ne)||!W(ee)||B==null?!1:(ye.updateTableGridSelection(De),B=H(B),ue=se.getCordsFromCellNode(ue,B),ue=se.getCellFromCordsOrThrow(ue.x,ue.y,B),ye.setAnchorCellForSelection(ue),O(A),A.shiftKey?(A=se.getCordsFromCellNode(ne,B),z(ye,ee,A.x,A.y,F)):(ne.selectEnd(),!0))}return!1}function O(B){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation()}class Z extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(A){return new Z(A.__key)}static importDOM(){return{table:()=>({conversion:oe,priority:1})}}static importJSON(){return Y()}constructor(A){super(A)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(A){let F=document.createElement("table");return t.addClassNamesToElement(F,A.theme.table),F}updateDOM(){return!1}exportDOM(A){return{...super.exportDOM(A),after:F=>{if(F){let se=F.cloneNode(),ye=document.createElement("colgroup"),De=document.createElement("tbody");if(t.isHTMLElement(F)&&De.append(...F.children),F=this.getFirstChildOrThrow(),!k(F))throw Error("Expected to find row node.");F=F.getChildrenSize();for(let ee=0;ee<F;ee++){let ne=document.createElement("col");ye.append(ne)}return se.replaceChildren(ye,De),se}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(A,F){let{rows:se,cells:ye}=F;for(F=0;F<se;F++){var De=ye[F];if(De!=null&&(De=De.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===A}),De!==-1))return{x:De,y:F}}throw Error("Cell not found in table.")}getCellFromCords(A,F,se){return{cells:se}=se,F=se[F],F==null?null:(A=F[A],A??null)}getCellFromCordsOrThrow(A,F,se){if(A=this.getCellFromCords(A,F,se),!A)throw Error("Cell not found at cords.");return A}getCellNodeFromCords(A,F,se){return A=this.getCellFromCords(A,F,se),A==null?null:(A=e.$getNearestNodeFromDOMNode(A.elem),w(A)?A:null)}getCellNodeFromCordsOrThrow(A,F,se){if(A=this.getCellNodeFromCords(A,F,se),!A)throw Error("Node at cords not TableCellNode.");return A}canSelectBefore(){return!0}canIndent(){return!1}}function oe(){return{node:Y()}}function Y(){return e.$applyNodeReplacement(new Z)}function W(B){return B instanceof Z}function J(B){if(B=t.$findMatchingParent(B,A=>k(A)),k(B))return B;throw Error("Expected table cell to be inside of table row.")}function R(B){if(B=t.$findMatchingParent(B,A=>W(A)),W(B))return B;throw Error("Expected table cell to be inside of table.")}function U(B,A){let F=R(B),{x:se,y:ye}=F.getCordsFromCellNode(B,A);return{above:F.getCellNodeFromCords(se,ye-1,A),below:F.getCellNodeFromCords(se,ye+1,A),left:F.getCellNodeFromCords(se-1,ye,A),right:F.getCellNodeFromCords(se+1,ye,A)}}function X(B){let A=B.getFirstDescendant();A==null?B.selectStart():A.getParentOrThrow().selectStart()}function fe(B,A){let F=B.getFirstChild();F!==null?F.insertBefore(A):B.append(A)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=d,Jt.$createTableCellNode=S,Jt.$createTableNode=Y,Jt.$createTableNodeWithDimensions=function(B,A,F=!0){let se=Y();for(let De=0;De<B;De++){let ee=v();for(let ne=0;ne<A;ne++){var ye=_.NO_STATUS;typeof F=="object"?(De===0&&F.rows&&(ye|=_.ROW),ne===0&&F.columns&&(ye|=_.COLUMN)):F&&(De===0&&(ye|=_.ROW),ne===0&&(ye|=_.COLUMN)),ye=S(ye);let ue=e.$createParagraphNode();ue.append(e.$createTextNode()),ye.append(ue),ee.append(ye)}se.append(ee)}return se},Jt.$createTableRowNode=v,Jt.$deleteTableColumn=function(B,A){let F=B.getChildren();for(let ye=0;ye<F.length;ye++){var se=F[ye];if(k(se)){if(se=se.getChildren(),A>=se.length||0>A)throw Error("Table column target index out of range");se[A].remove()}}return B},Jt.$deleteTableColumn__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A);[A]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,A);var{startColumn:ne}=De;let{startRow:ue,startColumn:be}=ee;B=Math.min(ne,be),ne=Math.max(ne+F.__colSpan-1,be+A.__colSpan-1);let Ne=ne-B+1;if(ye[0].length===ne-B+1)se.selectPrevious(),se.remove();else{var Re=ye.length;for(let ke=0;ke<Re;ke++)for(let Fe=B;Fe<=ne;Fe++){let{cell:qe,startColumn:Be}=ye[ke][Fe];Be<B?Fe===B&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(B-Be))):Be+qe.__colSpan-1>ne?Fe===ne&&qe.setColSpan(qe.__colSpan-(ne-Be+1)):qe.remove()}B=ye[ue],A=B[be+A.__colSpan],A!==void 0?({cell:A}=A,X(A)):({cell:A}=B[be-1],X(A))}},Jt.$deleteTableRow__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A);[B]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,B);({startRow:A}=De);var{startRow:ne}=ee;if(B=ne+B.__rowSpan-1,ye.length===B-A+1)se.remove();else{ne=ye[0].length;var ue=ye[B+1],be=se.getChildAtIndex(B+1);for(let Re=B;Re>=A;Re--){for(var Ne=ne-1;0<=Ne;Ne--){let{cell:ke,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===A&&Fe<A&&ke.setRowSpan(ke.__rowSpan-(Fe-A)),Fe>=A&&Fe+ke.__rowSpan-1>B))if(ke.setRowSpan(ke.__rowSpan-(B-Fe+1)),be===null&&n(122),Ne===0)fe(be,ke);else{let{cell:Be}=ue[Ne-1];Be.insertAfter(ke)}}Ne=se.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ue!==void 0?({cell:A}=ue[0],X(A)):({cell:A}=ye[A-1][0],X(A))}},Jt.$getElementGridForTableNode=function(B,A){if(B=B.getElementByKey(A.getKey()),B==null)throw Error("Table Element Not Found");return H(B)},Jt.$getTableCellNodeFromLexicalNode=function(B){return B=t.$findMatchingParent(B,A=>w(A)),w(B)?B:null},Jt.$getTableColumnIndexFromTableCellNode=function(B){return J(B).getChildren().findIndex(A=>A.is(B))},Jt.$getTableNodeFromLexicalNodeOrThrow=R,Jt.$getTableRowIndexFromTableCellNode=function(B){let A=J(B);return R(A).getChildren().findIndex(F=>F.is(A))},Jt.$getTableRowNodeFromTableCellNodeOrThrow=J,Jt.$insertTableColumn=function(B,A,F=!0,se,ye){let De=B.getChildren(),ee=[];for(let be=0;be<De.length;be++){let Ne=De[be];if(k(Ne))for(let Re=0;Re<se;Re++){var ne=Ne.getChildren();if(A>=ne.length||0>A)throw Error("Table column target index out of range");ne=ne[A],w(ne)||n(12);let{left:ke,right:Fe}=U(ne,ye);var ue=_.NO_STATUS;(ke&&ke.hasHeaderState(_.ROW)||Fe&&Fe.hasHeaderState(_.ROW))&&(ue|=_.ROW),ue=S(ue),ue.append(e.$createParagraphNode()),ee.push({newTableCell:ue,targetCell:ne})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{F?Ne.insertAfter(be):Ne.insertBefore(be)}),B},Jt.$insertTableColumn__EXPERIMENTAL=function(B=!0){function A(){let Re=S(_.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var F=e.$getSelection();if(!e.$INTERNAL_isPointSelection(F))throw Error("Expected a PointSeleciton");var se=F.anchor.getNode();F=F.focus.getNode(),[se]=e.DEPRECATED_$getNodeTriplet(se);let[ye,,De]=e.DEPRECATED_$getNodeTriplet(F),[ee,ne,ue]=e.DEPRECATED_$computeGridMap(De,ye,se);se=ee.length,F=B?Math.max(ne.startColumn,ue.startColumn):Math.min(ne.startColumn,ue.startColumn),B=B?F+ye.__colSpan-1:F-1,F=De.getFirstChild(),e.DEPRECATED_$isGridRowNode(F)||n(120);let be=null;var Ne=F;e:for(F=0;F<se;F++){F!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[F];if(0>B){fe(Ne,A());continue}let{cell:ke,startColumn:Fe,startRow:qe}=Re[B];if(Fe+ke.__colSpan-1<=B){let Be=ke,ut=qe,At=B;for(;ut!==F&&1<Be.__rowSpan;)if(At-=ke.__colSpan,0<=At){let{cell:Ut,startRow:en}=Re[At];Be=Ut,ut=en}else{Ne.append(A());continue e}Be.insertAfter(A())}else ke.setColSpan(ke.__colSpan+1)}be!==null&&X(be)},Jt.$insertTableRow=function(B,A,F=!0,se,ye){var De=B.getChildren();if(A>=De.length||0>A)throw Error("Table row target index out of range");if(A=De[A],k(A))for(De=0;De<se;De++){let ne=A.getChildren(),ue=ne.length,be=v();for(let Ne=0;Ne<ue;Ne++){var ee=ne[Ne];w(ee)||n(12);let{above:Re,below:ke}=U(ee,ye);ee=_.NO_STATUS;let Fe=Re&&Re.getWidth()||ke&&ke.getWidth()||void 0;(Re&&Re.hasHeaderState(_.COLUMN)||ke&&ke.hasHeaderState(_.COLUMN))&&(ee|=_.COLUMN),ee=S(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}F?A.insertAfter(be):A.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return B},Jt.$insertTableRow__EXPERIMENTAL=function(B=!0){var A=e.$getSelection();if(!e.$INTERNAL_isPointSelection(A))throw Error("Expected a INTERNAL_PointSelection");A=A.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A),[ye,De]=e.DEPRECATED_$computeGridMap(se,F,F);A=ye[0].length;var{startRow:ee}=De;if(B){B=ee+F.__rowSpan-1;var ne=ye[B];ee=v();for(var ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne+be.__rowSpan-1<=B?ee.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=se.getChildAtIndex(B),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertAfter(ee)}else{for(ne=ye[ee],B=v(),ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne===ee?B.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=se.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertBefore(B)}},Jt.$isGridSelection=l,Jt.$isTableCellNode=w,Jt.$isTableNode=W,Jt.$isTableRowNode=k,Jt.$removeTableRowAtIndex=function(B,A){let F=B.getChildren();if(A>=F.length||0>A)throw Error("Expected table cell to be inside of table row.");return F[A].remove(),B},Jt.$unmergeCell=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");B=B.anchor.getNode();let[A,F,se]=e.DEPRECATED_$getNodeTriplet(B);B=A.__colSpan;let ye=A.__rowSpan;if(1<B){for(var De=1;De<B;De++)A.insertAfter(S(_.NO_STATUS));A.setColSpan(1)}if(1<ye){let[ue,be]=e.DEPRECATED_$computeGridMap(se,A,A),{startColumn:Ne,startRow:Re}=be,ke;for(De=1;De<ye;De++){var ee=Re+De;let Fe=ue[ee];ke=(ke||F).getNextSibling(),e.DEPRECATED_$isGridRowNode(ke)||n(125);var ne=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ut=Be.cell;Be.startRow===ee&&(ne=ut),1<ut.__colSpan&&(qe+=ut.__colSpan-1)}if(ne===null)for(ne=0;ne<B;ne++)fe(ke,S(_.NO_STATUS));else for(ee=0;ee<B;ee++)ne.insertAfter(S(_.NO_STATUS))}A.setRowSpan(1)}},Jt.INSERT_TABLE_COMMAND=_e,Jt.TableCellHeaderStates=_,Jt.TableCellNode=T,Jt.TableNode=Z,Jt.TableRowNode=M,Jt.TableSelection=I,Jt.applyTableHandlers=function(B,A,F,se){function ye(Ne){return Ne=B.getCordsFromCellNode(Ne,ee.grid),B.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let De=F.getRootElement();if(De===null)throw Error("No root element.");let ee=new I(F,B.getKey()),ne=F._window||window;A.__lexicalTableSelection=ee,A.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&ne){var Re=P(Ne.target);Re!==null&&(O(Ne),ee.setAnchorCellForSelection(Re));var ke=()=>{ne.removeEventListener("mouseup",ke),ne.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=P(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};ne.addEventListener("mouseup",ke),ne.addEventListener("mousemove",Fe)}},0)});let ue=Ne=>{Ne.button===0&&F.update(()=>{const Re=e.$getSelection(),ke=Ne.target;l(Re)&&Re.gridKey===ee.tableNodeKey&&De.contains(ke)&&ee.clearHighlight()})};ne.addEventListener("mousedown",ue),ee.listenersToRemove.add(()=>ne.removeEventListener("mousedown",ue)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>K(F,Ne,"down",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>K(F,Ne,"up",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>K(F,Ne,"backward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>K(F,Ne,"forward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return l(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),w),w(Re))?(O(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!q(Re,B))return!1;if(l(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>w(Be));if(!w(qe))return!1;var ke=Re.anchor.getNode(),Fe=Re.focus.getNode();if(ke=B.isParentOf(ke),Fe=B.isParentOf(Fe),ke&&!Fe||Fe&&!ke)return ee.clearText(),!0;if(ke=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&w(Be.getParent())),!e.$isElementNode(ke)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&ke.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==ke){Re=Fe.getChildren();const Be=e.$createParagraphNode();return Re.forEach(ut=>Be.append(ut)),Fe.replace(Be),Fe.getWritable().__parent=qe.getKey(),!0}}return!1};return[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ne=>{ee.listenersToRemove.add(F.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),A=Ne=>{const Re=e.$getSelection();return q(Re,B)?l(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},ee.listenersToRemove.add(F.registerCommand(e.KEY_BACKSPACE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.KEY_DELETE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return q(Re,B)?l(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return q(Ne,B)&&(l(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>w(Re)),w(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),se&&ee.listenersToRemove.add(F.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!q(Re,B)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(O(Ne),Re=B.getCordsFromCellNode(Re,ee.grid),V(ee,B,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FOCUS_COMMAND,()=>B.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:ke}=Ne;Ne=e.$INTERNAL_isPointSelection(ke);var Fe=e.$isRangeSelection(ke);if(Ne=Fe&&t.$findMatchingParent(ke.anchor.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null&&t.$findMatchingParent(ke.focus.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=ke,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ut=t.$findMatchingParent(qe.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le)),At=(qe=ut&&t.$findMatchingParent(ut,Le=>e.DEPRECATED_$isGridRowNode(Le)))&&t.$findMatchingParent(qe,Le=>e.DEPRECATED_$isGridNode(Le));if(!e.DEPRECATED_$isGridCellNode(ut)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(At))return!1;var Ut=qe.getIndexWithinParent(),en=Math.min(At.getChildrenSize()-1,Ut+Be-1);Be=ut.getIndexWithinParent(),ut=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ut),qe=Math.min(Ut,en),Be=Math.max(Be,ut),Ut=Math.max(Ut,en),At=At.getChildren(),en=0;let Oe,ie;for(ut=qe;ut<=Ut;ut++){var le=At[ut];if(!e.DEPRECATED_$isGridRowNode(le))return!1;var ve=Ne[en];if(!e.DEPRECATED_$isGridRowNode(ve))return!1;le=le.getChildren(),ve=ve.getChildren();let Le=0;for(let Me=Fe;Me<=Be;Me++){let je=le[Me];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let rt=ve[Le];if(!e.DEPRECATED_$isGridCellNode(rt))return!1;ut===qe&&Me===Fe?Oe=je.getKey():ut===Ut&&Me===Be&&(ie=je.getKey());let it=je.getChildren();rt.getChildren().forEach(st=>{e.$isTextNode(st)&&e.$createParagraphNode().append(st),je.append(st)}),it.forEach(st=>st.remove()),Le++}en++}return Oe&&ie&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ie),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ut,focus:At}=Ne;var ke=ut.getNode(),Fe=At.getNode();ke=Ee(ke),Fe=Ee(Fe);var qe=ke&&B.is(de(ke)),Be=Fe&&B.is(de(Fe));let Ut=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),Ut?(ke=Ne.clone(),ke.focus.set(B.getKey(),qe?0:B.getChildrenSize(),"element"),e.$setSelection(ke),te(F,ee)):Be&&!ke.is(Fe)&&(ee.setAnchorCellForSelection(ye(ke)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(l(Ne)||l(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(l(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!l(Ne)&&l(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!B.isSelected()?ce(F,ee):!ee.hasHijackedSelectionStyles&&B.isSelected()&&te(F,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Jt.getCellFromTarget=P,Jt.getTableSelectionFromTableElement=function(B){return B.__lexicalTableSelection},Jt}var vu,vh;function Nd(){return vh||(vh=1,vu=process.env.NODE_ENV==="development"?bC():LC()),vu}var Sh;function IC(){if(Sh)return xu;Sh=1;var e=qn(),t=Nd(),n=pn(),r=Yt(),l=nt;function d({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){const[T]=e.useLexicalComposerContext();return l.useEffect(()=>{if(!T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>{const M=t.$createTableNodeWithDimensions(Number(S),Number(E),w);n.$insertNodeToNearestRoot(M);const m=M.getFirstDescendant();return r.$isTextNode(m)&&m.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[T]),l.useEffect(()=>{const E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);if(v&&!E.has(m)){const k=t.applyTableHandlers(M,v,T,_);E.set(m,k)}};T.getEditorState().read(()=>{const M=r.$nodesOfType(t.TableNode);for(const m of M)t.$isTableNode(m)&&S(m)});const w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)if(v==="created")T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)});else if(v==="destroyed"){const k=E.get(m);k!==void 0&&(k.removeListeners(),E.delete(m))}});return()=>{w();for(const[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(E.getColSpan()>1||E.getRowSpan()>1){const[,,S]=r.DEPRECATED_$getNodeTriplet(E),[w]=r.DEPRECATED_$computeGridMap(S,E,E),M=w.length,m=w[0].length;let v=S.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(v))throw Error("Expected TableNode first child to be a RowNode");const k=[];for(let G=0;G<M;G++){if(G!==0&&(v=v.getNextSibling(),!r.DEPRECATED_$isGridRowNode(v)))throw Error("Expected TableNode first child to be a RowNode");let I=null;for(let P=0;P<m;P++){const H=w[G][P],j=H.cell;if(H.startRow===G&&H.startColumn===P)I=j,k.push(j);else if(j.getColSpan()>1||j.getRowSpan()>1){if(!t.$isTableCellNode(j))throw Error("Expected TableNode cell to be a TableCellNode");const re=t.$createTableCellNode(j.__headerState);I!==null?I.insertAfter(re):n.$insertFirst(v,re)}}}for(const G of k)G.setColSpan(1),G.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null}return xu.TablePlugin=d,xu}var Su={},wh;function kC(){if(wh)return Su;wh=1;var e=qn(),t=Nd(),n=pn(),r=Yt(),l=nt;function d(f){let p=new URLSearchParams;p.append("code",f);for(let _=1;_<arguments.length;_++)p.append("v",arguments[_]);throw Error(`Minified Lexical error #${f}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Su.TablePlugin=function({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){let[T]=e.useLexicalComposerContext();return l.useEffect(()=>(T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode])||d(10),T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>(E=t.$createTableNodeWithDimensions(Number(S),Number(E),w),n.$insertNodeToNearestRoot(E),E=E.getFirstDescendant(),r.$isTextNode(E)&&E.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[T]),l.useEffect(()=>{let E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);v&&!E.has(m)&&(M=t.applyTableHandlers(M,v,T,_),E.set(m,M))};T.getEditorState().read(()=>{let M=r.$nodesOfType(t.TableNode);for(let m of M)t.$isTableNode(m)&&S(m)});let w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)v==="created"?T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)}):v==="destroyed"&&(M=E.get(m),M!==void 0&&(M.removeListeners(),E.delete(m)))});return()=>{w();for(let[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(1<E.getColSpan()||1<E.getRowSpan()){var[,,S]=r.DEPRECATED_$getNodeTriplet(E);[E]=r.DEPRECATED_$computeGridMap(S,E,E);let M=E.length,m=E[0].length;if(S=S.getFirstChild(),!r.DEPRECATED_$isGridRowNode(S))throw Error("Expected TableNode first child to be a RowNode");let v=[];for(let k=0;k<M;k++){if(k!==0&&(S=S.getNextSibling(),!r.DEPRECATED_$isGridRowNode(S)))throw Error("Expected TableNode first child to be a RowNode");let G=null;for(let I=0;I<m;I++){var w=E[k][I];let P=w.cell;if(w.startRow===k&&w.startColumn===I)G=P,v.push(P);else if(1<P.getColSpan()||1<P.getRowSpan()){if(!t.$isTableCellNode(P))throw Error("Expected TableNode cell to be a TableCellNode");w=t.$createTableCellNode(P.__headerState),G!==null?G.insertAfter(w):n.$insertFirst(S,w)}}}for(let k of v)k.setColSpan(1),k.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null},Su}const PC=process.env.NODE_ENV==="development"?IC():kC();var $C=PC,Pn={},wu={exports:{}},Oh;function Sp(){return Oh||(Oh=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
81
81
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
82
82
|
*
|
|
83
83
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
84
84
|
* @author Lea Verou <https://lea.verou.me>
|
|
85
85
|
* @namespace
|
|
86
86
|
* @public
|
|
87
|
-
*/var n=function(r){var l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,f={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function I(P){return P instanceof _?new _(P.type,I(P.content),P.alias):Array.isArray(P)?P.map(I):P.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(I){return Object.prototype.toString.call(I).slice(8,-1)},objId:function(I){return I.__id||Object.defineProperty(I,"__id",{value:++d}),I.__id},clone:function I(P,H){H=H||{};var V,re;switch(p.util.type(P)){case"Object":if(re=p.util.objId(P),H[re])return H[re];V={},H[re]=V;for(var te in P)P.hasOwnProperty(te)&&(V[te]=I(P[te],H));return V;case"Array":return re=p.util.objId(P),H[re]?H[re]:(V=[],H[re]=V,P.forEach(function(ce,j){V[j]=I(ce,H)}),V);default:return P}},getLanguage:function(I){for(;I;){var P=l.exec(I.className);if(P)return P[1].toLowerCase();I=I.parentElement}return"none"},setLanguage:function(I,P){I.className=I.className.replace(RegExp(l,"gi"),""),I.classList.add("language-"+P)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(V){var I=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(V.stack)||[])[1];if(I){var P=document.getElementsByTagName("script");for(var H in P)if(P[H].src==I)return P[H]}return null}},isActive:function(I,P,H){for(var V="no-"+P;I;){var re=I.classList;if(re.contains(P))return!0;if(re.contains(V))return!1;I=I.parentElement}return!!H}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(I,P){var H=p.util.clone(p.languages[I]);for(var V in P)H[V]=P[V];return H},insertBefore:function(I,P,H,V){V=V||p.languages;var re=V[I],te={};for(var ce in re)if(re.hasOwnProperty(ce)){if(ce==P)for(var j in H)H.hasOwnProperty(j)&&(te[j]=H[j]);H.hasOwnProperty(ce)||(te[ce]=re[ce])}var z=V[I];return V[I]=te,p.languages.DFS(p.languages,function(q,Te){Te===z&&q!=I&&(this[q]=te)}),te},DFS:function I(P,H,V,re){re=re||{};var te=p.util.objId;for(var ce in P)if(P.hasOwnProperty(ce)){H.call(P,ce,P[ce],V||ce);var j=P[ce],z=p.util.type(j);z==="Object"&&!re[te(j)]?(re[te(j)]=!0,I(j,H,null,re)):z==="Array"&&!re[te(j)]&&(re[te(j)]=!0,I(j,H,ce,re))}}},plugins:{},highlightAll:function(I,P){p.highlightAllUnder(document,I,P)},highlightAllUnder:function(I,P,H){var V={callback:H,container:I,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",V),V.elements=Array.prototype.slice.apply(V.container.querySelectorAll(V.selector)),p.hooks.run("before-all-elements-highlight",V);for(var re=0,te;te=V.elements[re++];)p.highlightElement(te,P===!0,V.callback)},highlightElement:function(I,P,H){var V=p.util.getLanguage(I),re=p.languages[V];p.util.setLanguage(I,V);var te=I.parentElement;te&&te.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(te,V);var ce=I.textContent,j={element:I,language:V,grammar:re,code:ce};function z(Te){j.highlightedCode=Te,p.hooks.run("before-insert",j),j.element.innerHTML=j.highlightedCode,p.hooks.run("after-highlight",j),p.hooks.run("complete",j),H&&H.call(j.element)}if(p.hooks.run("before-sanity-check",j),te=j.element.parentElement,te&&te.nodeName.toLowerCase()==="pre"&&!te.hasAttribute("tabindex")&&te.setAttribute("tabindex","0"),!j.code){p.hooks.run("complete",j),H&&H.call(j.element);return}if(p.hooks.run("before-highlight",j),!j.grammar){z(p.util.encode(j.code));return}if(P&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(Te){z(Te.data)},q.postMessage(JSON.stringify({language:j.language,code:j.code,immediateClose:!0}))}else z(p.highlight(j.code,j.grammar,j.language))},highlight:function(I,P,H){var V={code:I,grammar:P,language:H};if(p.hooks.run("before-tokenize",V),!V.grammar)throw new Error('The language "'+V.language+'" has no grammar.');return V.tokens=p.tokenize(V.code,V.grammar),p.hooks.run("after-tokenize",V),_.stringify(p.util.encode(V.tokens),V.language)},tokenize:function(I,P){var H=P.rest;if(H){for(var V in H)P[V]=H[V];delete P.rest}var re=new S;return w(re,re.head,I),E(I,re,P,re.head,0),m(re)},hooks:{all:{},add:function(I,P){var H=p.hooks.all;H[I]=H[I]||[],H[I].push(P)},run:function(I,P){var H=p.hooks.all[I];if(!(!H||!H.length))for(var V=0,re;re=H[V++];)re(P)}},Token:_};r.Prism=p;function _(I,P,H,V){this.type=I,this.content=P,this.alias=H,this.length=(V||"").length|0}_.stringify=function I(P,H){if(typeof P=="string")return P;if(Array.isArray(P)){var V="";return P.forEach(function(z){V+=I(z,H)}),V}var re={type:P.type,content:I(P.content,H),tag:"span",classes:["token",P.type],attributes:{},language:H},te=P.alias;te&&(Array.isArray(te)?Array.prototype.push.apply(re.classes,te):re.classes.push(te)),p.hooks.run("wrap",re);var ce="";for(var j in re.attributes)ce+=" "+j+'="'+(re.attributes[j]||"").replace(/"/g,""")+'"';return"<"+re.tag+' class="'+re.classes.join(" ")+'"'+ce+">"+re.content+"</"+re.tag+">"};function T(I,P,H,V){I.lastIndex=P;var re=I.exec(H);if(re&&V&&re[1]){var te=re[1].length;re.index+=te,re[0]=re[0].slice(te)}return re}function E(I,P,H,V,re,te){for(var ce in H)if(!(!H.hasOwnProperty(ce)||!H[ce])){var j=H[ce];j=Array.isArray(j)?j:[j];for(var z=0;z<j.length;++z){if(te&&te.cause==ce+","+z)return;var q=j[z],Te=q.inside,Se=!!q.lookbehind,Ee=!!q.greedy,de=q.alias;if(Ee&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var O=q.pattern||q,Z=V.next,oe=re;Z!==P.tail&&!(te&&oe>=te.reach);oe+=Z.value.length,Z=Z.next){var Y=Z.value;if(P.length>I.length)return;if(!(Y instanceof _)){var W=1,J;if(Ee){if(J=T(O,oe,I,Se),!J||J.index>=I.length)break;var fe=J.index,R=J.index+J[0].length,U=oe;for(U+=Z.value.length;fe>=U;)Z=Z.next,U+=Z.value.length;if(U-=Z.value.length,oe=U,Z.value instanceof _)continue;for(var X=Z;X!==P.tail&&(U<R||typeof X.value=="string");X=X.next)W++,U+=X.value.length;W--,Y=I.slice(oe,U),J.index-=oe}else if(J=T(O,0,Y,Se),!J)continue;var fe=J.index,_e=J[0],B=Y.slice(0,fe),A=Y.slice(fe+_e.length),F=oe+Y.length;te&&F>te.reach&&(te.reach=F);var se=Z.prev;B&&(se=w(P,se,B),oe+=B.length),M(P,se,W);var ye=new _(ce,Te?p.tokenize(_e,Te):_e,de,_e);if(Z=w(P,se,ye),A&&w(P,Z,A),W>1){var De={cause:ce+","+z,reach:F};E(I,P,H,Z.prev,oe,De),te&&De.reach>te.reach&&(te.reach=De.reach)}}}}}}function S(){var I={value:null,prev:null,next:null},P={value:null,prev:I,next:null};I.next=P,this.head=I,this.tail=P,this.length=0}function w(I,P,H){var V=P.next,re={value:H,prev:P,next:V};return P.next=re,V.prev=re,I.length++,re}function M(I,P,H){for(var V=P.next,re=0;re<H&&V!==I.tail;re++)V=V.next;P.next=V,V.prev=P,I.length-=re}function m(I){for(var P=[],H=I.head.next;H!==I.tail;)P.push(H.value),H=H.next;return P}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(I){var P=JSON.parse(I.data),H=P.language,V=P.code,re=P.immediateClose;r.postMessage(p.highlight(V,p.languages[H],H)),re&&r.close()},!1)),p;var v=p.util.currentScript();v&&(p.filename=v.src,v.hasAttribute("data-manual")&&(p.manual=!0));function k(){p.manual||p.highlightAll()}if(!p.manual){var G=document.readyState;G==="loading"||G==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",k):window.requestAnimationFrame?window.requestAnimationFrame(k):window.setTimeout(k,16)}return p}(t);e.exports&&(e.exports=n),typeof ff<"u"&&(ff.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(l,d){var f={};f["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},f.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:f}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var _={};_[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",_)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,l){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[l,"language-"+l],inside:n.languages[l]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var l=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+l.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var d=r.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",l=function(v,k){return"✖ Error "+v+" while fetching file: "+k},d="✖ Error: File does not exist or is empty",f={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",_="loading",T="loaded",E="failed",S="pre[data-src]:not(["+p+'="'+T+'"]):not(['+p+'="'+_+'"])';function w(v,k,G){var I=new XMLHttpRequest;I.open("GET",v,!0),I.onreadystatechange=function(){I.readyState==4&&(I.status<400&&I.responseText?k(I.responseText):I.status>=400?G(l(I.status,I.statusText)):G(d))},I.send(null)}function M(v){var k=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(k){var G=Number(k[1]),I=k[2],P=k[3];return I?P?[G,Number(P)]:[G,void 0]:[G,G]}}n.hooks.add("before-highlightall",function(v){v.selector+=", "+S}),n.hooks.add("before-sanity-check",function(v){var k=v.element;if(k.matches(S)){v.code="",k.setAttribute(p,_);var G=k.appendChild(document.createElement("CODE"));G.textContent=r;var I=k.getAttribute("data-src"),P=v.language;if(P==="none"){var H=(/\.(\w+)$/.exec(I)||[,"none"])[1];P=f[H]||H}n.util.setLanguage(G,P),n.util.setLanguage(k,P);var V=n.plugins.autoloader;V&&V.loadLanguages(P),w(I,function(re){k.setAttribute(p,T);var te=M(k.getAttribute("data-range"));if(te){var ce=re.split(/\r\n?|\n/g),j=te[0],z=te[1]==null?ce.length:te[1];j<0&&(j+=ce.length),j=Math.max(0,Math.min(j-1,ce.length)),z<0&&(z+=ce.length),z=Math.max(0,Math.min(z,ce.length)),re=ce.slice(j,z).join(`
|
|
88
|
-
`),k.hasAttribute("data-start")||k.setAttribute("data-start",String(j+1))}G.textContent=re,n.highlightElement(G)},function(re){k.setAttribute(p,E),G.textContent=re})}}),n.plugins.fileHighlight={highlight:function(k){for(var G=(k||document).querySelectorAll(S),I=0,P;P=G[I++];)n.highlightElement(P)}};var m=!1;n.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(wu)),wu.exports}var Dh={},Ah;function wp(){return Ah||(Ah=1,Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}),Dh}var Mh={},Rh;function Op(){return Rh||(Rh=1,Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript),Mh}var bh={},Lh;function Dp(){return Lh||(Lh=1,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};l["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var d={};d[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:l},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml),bh}var Ih={},kh;function Ap(){return kh||(kh=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(E){return E=E.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+E+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+d+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+d+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(E){["url","bold","italic","strike","code-snippet"].forEach(function(S){E!==S&&(e.languages.markdown[E].inside.content.inside[S]=e.languages.markdown[S])})}),e.hooks.add("after-tokenize",function(E){if(E.language!=="markdown"&&E.language!=="md")return;function S(w){if(!(!w||typeof w=="string"))for(var M=0,m=w.length;M<m;M++){var v=w[M];if(v.type!=="code"){S(v.content);continue}var k=v.content[1],G=v.content[3];if(k&&G&&k.type==="code-language"&&G.type==="code-block"&&typeof k.content=="string"){var I=k.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");I=(/[a-z][\w-]*/i.exec(I)||[""])[0].toLowerCase();var P="language-"+I;G.alias?typeof G.alias=="string"?G.alias=[G.alias,P]:G.alias.push(P):G.alias=[P]}}}S(E.tokens)}),e.hooks.add("wrap",function(E){if(E.type==="code-block"){for(var S="",w=0,M=E.classes.length;w<M;w++){var m=E.classes[w],v=/language-(.+)/.exec(m);if(v){S=v[1];break}}var k=e.languages[S];if(k)E.content=e.highlight(T(E.content),k,S);else if(S&&S!=="none"&&e.plugins.autoloader){var G="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);E.attributes.id=G,e.plugins.autoloader.loadLanguages(S,function(){var I=document.getElementById(G);I&&(I.innerHTML=e.highlight(I.textContent,e.languages[S],S))})}}});var f=RegExp(e.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},_=String.fromCodePoint||String.fromCharCode;function T(E){var S=E.replace(f,"");return S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,M){if(M=M.toLowerCase(),M[0]==="#"){var m;return M[1]==="x"?m=parseInt(M.slice(2),16):m=Number(M.slice(1)),_(m)}else{var v=p[M];return v||w}}),S}e.languages.md=e.languages.markdown}(Prism)),Ih}var Ph={},$h;function Mp(){return $h||($h=1,Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean),Ph}var Fh={},Bh;function Rp(){return Bh||(Bh=1,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),Fh}var Hh={},Wh;function bp(){return Wh||(Wh=1,Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec),Hh}var Kh={},zh;function Lp(){return zh||(zh=1,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}),Kh}var Uh={},Gh;function Ip(){return Gh||(Gh=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Uh}var Yh={},Vh;function kp(){return Vh||(Vh=1,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)),Yh}var jh={},qh;function Pp(){return qh||(qh=1,Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift})),jh}var Zh={},Jh;function $p(){return Jh||(Jh=1,function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)),Zh}var Xh={},Qh;function Fp(){return Qh||(Qh=1,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),Xh}var eg={},tg;function Bp(){return tg||(tg=1,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)),eg}var ng;function FC(){if(ng)return Pn;ng=1;var e=Sp();wp(),Op(),Dp(),Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp();var t=pn(),n=Yt();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function l(ee,ne){for(const ue of ee.childNodes){if(t.isHTMLElement(ue)&&ue.tagName===ne)return!0;l(ue,ne)}return!1}const d="data-highlight-language";class f extends n.ElementNode{static getType(){return"code"}static clone(ne){return new f(ne.__language,ne.__key)}constructor(ne,ue){super(ue),this.__language=r(ne)}createDOM(ne){const ue=document.createElement("code");t.addClassNamesToElement(ue,ne.theme.code),ue.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ue.setAttribute(d,be),ue}updateDOM(ne,ue,be){const Ne=this.__language,Re=ne.__language;return Ne?Ne!==Re&&ue.setAttribute(d,Ne):Re&&ue.removeAttribute(d),!1}exportDOM(){const ne=document.createElement("pre");ne.setAttribute("spellcheck","false");const ue=this.getLanguage();return ue&&ne.setAttribute(d,ue),{element:ne}}static importDOM(){return{code:ne=>ne.textContent!=null&&(/\r?\n/.test(ne.textContent)||l(ne,"BR"))?{conversion:T,priority:1}:null,div:ne=>({conversion:E,priority:1}),pre:ne=>({conversion:T,priority:0}),table:ne=>G(ne)?{conversion:S,priority:3}:null,td:ne=>{const ue=ne,be=ue.closest("table");return k(ue)?{conversion:M,priority:3}:be&&G(be)?{conversion:w,priority:3}:null},tr:ne=>{const be=ne.closest("table");return be&&G(be)?{conversion:w,priority:3}:null}}}static importJSON(ne){const ue=p(ne.language);return ue.setFormat(ne.format),ue.setIndent(ne.indent),ue.setDirection(ne.direction),ue}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(ne,ue=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
|
|
87
|
+
*/var n=function(r){var l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,f={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function I(P){return P instanceof _?new _(P.type,I(P.content),P.alias):Array.isArray(P)?P.map(I):P.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(I){return Object.prototype.toString.call(I).slice(8,-1)},objId:function(I){return I.__id||Object.defineProperty(I,"__id",{value:++d}),I.__id},clone:function I(P,H){H=H||{};var j,re;switch(p.util.type(P)){case"Object":if(re=p.util.objId(P),H[re])return H[re];j={},H[re]=j;for(var te in P)P.hasOwnProperty(te)&&(j[te]=I(P[te],H));return j;case"Array":return re=p.util.objId(P),H[re]?H[re]:(j=[],H[re]=j,P.forEach(function(ce,V){j[V]=I(ce,H)}),j);default:return P}},getLanguage:function(I){for(;I;){var P=l.exec(I.className);if(P)return P[1].toLowerCase();I=I.parentElement}return"none"},setLanguage:function(I,P){I.className=I.className.replace(RegExp(l,"gi"),""),I.classList.add("language-"+P)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(j){var I=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(j.stack)||[])[1];if(I){var P=document.getElementsByTagName("script");for(var H in P)if(P[H].src==I)return P[H]}return null}},isActive:function(I,P,H){for(var j="no-"+P;I;){var re=I.classList;if(re.contains(P))return!0;if(re.contains(j))return!1;I=I.parentElement}return!!H}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(I,P){var H=p.util.clone(p.languages[I]);for(var j in P)H[j]=P[j];return H},insertBefore:function(I,P,H,j){j=j||p.languages;var re=j[I],te={};for(var ce in re)if(re.hasOwnProperty(ce)){if(ce==P)for(var V in H)H.hasOwnProperty(V)&&(te[V]=H[V]);H.hasOwnProperty(ce)||(te[ce]=re[ce])}var z=j[I];return j[I]=te,p.languages.DFS(p.languages,function(q,Te){Te===z&&q!=I&&(this[q]=te)}),te},DFS:function I(P,H,j,re){re=re||{};var te=p.util.objId;for(var ce in P)if(P.hasOwnProperty(ce)){H.call(P,ce,P[ce],j||ce);var V=P[ce],z=p.util.type(V);z==="Object"&&!re[te(V)]?(re[te(V)]=!0,I(V,H,null,re)):z==="Array"&&!re[te(V)]&&(re[te(V)]=!0,I(V,H,ce,re))}}},plugins:{},highlightAll:function(I,P){p.highlightAllUnder(document,I,P)},highlightAllUnder:function(I,P,H){var j={callback:H,container:I,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",j),j.elements=Array.prototype.slice.apply(j.container.querySelectorAll(j.selector)),p.hooks.run("before-all-elements-highlight",j);for(var re=0,te;te=j.elements[re++];)p.highlightElement(te,P===!0,j.callback)},highlightElement:function(I,P,H){var j=p.util.getLanguage(I),re=p.languages[j];p.util.setLanguage(I,j);var te=I.parentElement;te&&te.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(te,j);var ce=I.textContent,V={element:I,language:j,grammar:re,code:ce};function z(Te){V.highlightedCode=Te,p.hooks.run("before-insert",V),V.element.innerHTML=V.highlightedCode,p.hooks.run("after-highlight",V),p.hooks.run("complete",V),H&&H.call(V.element)}if(p.hooks.run("before-sanity-check",V),te=V.element.parentElement,te&&te.nodeName.toLowerCase()==="pre"&&!te.hasAttribute("tabindex")&&te.setAttribute("tabindex","0"),!V.code){p.hooks.run("complete",V),H&&H.call(V.element);return}if(p.hooks.run("before-highlight",V),!V.grammar){z(p.util.encode(V.code));return}if(P&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(Te){z(Te.data)},q.postMessage(JSON.stringify({language:V.language,code:V.code,immediateClose:!0}))}else z(p.highlight(V.code,V.grammar,V.language))},highlight:function(I,P,H){var j={code:I,grammar:P,language:H};if(p.hooks.run("before-tokenize",j),!j.grammar)throw new Error('The language "'+j.language+'" has no grammar.');return j.tokens=p.tokenize(j.code,j.grammar),p.hooks.run("after-tokenize",j),_.stringify(p.util.encode(j.tokens),j.language)},tokenize:function(I,P){var H=P.rest;if(H){for(var j in H)P[j]=H[j];delete P.rest}var re=new S;return w(re,re.head,I),E(I,re,P,re.head,0),m(re)},hooks:{all:{},add:function(I,P){var H=p.hooks.all;H[I]=H[I]||[],H[I].push(P)},run:function(I,P){var H=p.hooks.all[I];if(!(!H||!H.length))for(var j=0,re;re=H[j++];)re(P)}},Token:_};r.Prism=p;function _(I,P,H,j){this.type=I,this.content=P,this.alias=H,this.length=(j||"").length|0}_.stringify=function I(P,H){if(typeof P=="string")return P;if(Array.isArray(P)){var j="";return P.forEach(function(z){j+=I(z,H)}),j}var re={type:P.type,content:I(P.content,H),tag:"span",classes:["token",P.type],attributes:{},language:H},te=P.alias;te&&(Array.isArray(te)?Array.prototype.push.apply(re.classes,te):re.classes.push(te)),p.hooks.run("wrap",re);var ce="";for(var V in re.attributes)ce+=" "+V+'="'+(re.attributes[V]||"").replace(/"/g,""")+'"';return"<"+re.tag+' class="'+re.classes.join(" ")+'"'+ce+">"+re.content+"</"+re.tag+">"};function T(I,P,H,j){I.lastIndex=P;var re=I.exec(H);if(re&&j&&re[1]){var te=re[1].length;re.index+=te,re[0]=re[0].slice(te)}return re}function E(I,P,H,j,re,te){for(var ce in H)if(!(!H.hasOwnProperty(ce)||!H[ce])){var V=H[ce];V=Array.isArray(V)?V:[V];for(var z=0;z<V.length;++z){if(te&&te.cause==ce+","+z)return;var q=V[z],Te=q.inside,Se=!!q.lookbehind,Ee=!!q.greedy,de=q.alias;if(Ee&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var O=q.pattern||q,Z=j.next,oe=re;Z!==P.tail&&!(te&&oe>=te.reach);oe+=Z.value.length,Z=Z.next){var Y=Z.value;if(P.length>I.length)return;if(!(Y instanceof _)){var W=1,J;if(Ee){if(J=T(O,oe,I,Se),!J||J.index>=I.length)break;var fe=J.index,R=J.index+J[0].length,U=oe;for(U+=Z.value.length;fe>=U;)Z=Z.next,U+=Z.value.length;if(U-=Z.value.length,oe=U,Z.value instanceof _)continue;for(var X=Z;X!==P.tail&&(U<R||typeof X.value=="string");X=X.next)W++,U+=X.value.length;W--,Y=I.slice(oe,U),J.index-=oe}else if(J=T(O,0,Y,Se),!J)continue;var fe=J.index,_e=J[0],B=Y.slice(0,fe),A=Y.slice(fe+_e.length),F=oe+Y.length;te&&F>te.reach&&(te.reach=F);var se=Z.prev;B&&(se=w(P,se,B),oe+=B.length),M(P,se,W);var ye=new _(ce,Te?p.tokenize(_e,Te):_e,de,_e);if(Z=w(P,se,ye),A&&w(P,Z,A),W>1){var De={cause:ce+","+z,reach:F};E(I,P,H,Z.prev,oe,De),te&&De.reach>te.reach&&(te.reach=De.reach)}}}}}}function S(){var I={value:null,prev:null,next:null},P={value:null,prev:I,next:null};I.next=P,this.head=I,this.tail=P,this.length=0}function w(I,P,H){var j=P.next,re={value:H,prev:P,next:j};return P.next=re,j.prev=re,I.length++,re}function M(I,P,H){for(var j=P.next,re=0;re<H&&j!==I.tail;re++)j=j.next;P.next=j,j.prev=P,I.length-=re}function m(I){for(var P=[],H=I.head.next;H!==I.tail;)P.push(H.value),H=H.next;return P}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(I){var P=JSON.parse(I.data),H=P.language,j=P.code,re=P.immediateClose;r.postMessage(p.highlight(j,p.languages[H],H)),re&&r.close()},!1)),p;var v=p.util.currentScript();v&&(p.filename=v.src,v.hasAttribute("data-manual")&&(p.manual=!0));function k(){p.manual||p.highlightAll()}if(!p.manual){var G=document.readyState;G==="loading"||G==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",k):window.requestAnimationFrame?window.requestAnimationFrame(k):window.setTimeout(k,16)}return p}(t);e.exports&&(e.exports=n),typeof ff<"u"&&(ff.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(l,d){var f={};f["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},f.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:f}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var _={};_[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",_)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,l){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[l,"language-"+l],inside:n.languages[l]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var l=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+l.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var d=r.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",l=function(v,k){return"✖ Error "+v+" while fetching file: "+k},d="✖ Error: File does not exist or is empty",f={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",_="loading",T="loaded",E="failed",S="pre[data-src]:not(["+p+'="'+T+'"]):not(['+p+'="'+_+'"])';function w(v,k,G){var I=new XMLHttpRequest;I.open("GET",v,!0),I.onreadystatechange=function(){I.readyState==4&&(I.status<400&&I.responseText?k(I.responseText):I.status>=400?G(l(I.status,I.statusText)):G(d))},I.send(null)}function M(v){var k=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(k){var G=Number(k[1]),I=k[2],P=k[3];return I?P?[G,Number(P)]:[G,void 0]:[G,G]}}n.hooks.add("before-highlightall",function(v){v.selector+=", "+S}),n.hooks.add("before-sanity-check",function(v){var k=v.element;if(k.matches(S)){v.code="",k.setAttribute(p,_);var G=k.appendChild(document.createElement("CODE"));G.textContent=r;var I=k.getAttribute("data-src"),P=v.language;if(P==="none"){var H=(/\.(\w+)$/.exec(I)||[,"none"])[1];P=f[H]||H}n.util.setLanguage(G,P),n.util.setLanguage(k,P);var j=n.plugins.autoloader;j&&j.loadLanguages(P),w(I,function(re){k.setAttribute(p,T);var te=M(k.getAttribute("data-range"));if(te){var ce=re.split(/\r\n?|\n/g),V=te[0],z=te[1]==null?ce.length:te[1];V<0&&(V+=ce.length),V=Math.max(0,Math.min(V-1,ce.length)),z<0&&(z+=ce.length),z=Math.max(0,Math.min(z,ce.length)),re=ce.slice(V,z).join(`
|
|
88
|
+
`),k.hasAttribute("data-start")||k.setAttribute("data-start",String(V+1))}G.textContent=re,n.highlightElement(G)},function(re){k.setAttribute(p,E),G.textContent=re})}}),n.plugins.fileHighlight={highlight:function(k){for(var G=(k||document).querySelectorAll(S),I=0,P;P=G[I++];)n.highlightElement(P)}};var m=!1;n.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(wu)),wu.exports}var Dh={},Ah;function wp(){return Ah||(Ah=1,Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}),Dh}var Mh={},Rh;function Op(){return Rh||(Rh=1,Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript),Mh}var bh={},Lh;function Dp(){return Lh||(Lh=1,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};l["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var d={};d[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:l},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml),bh}var Ih={},kh;function Ap(){return kh||(kh=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(E){return E=E.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+E+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+d+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+d+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(E){["url","bold","italic","strike","code-snippet"].forEach(function(S){E!==S&&(e.languages.markdown[E].inside.content.inside[S]=e.languages.markdown[S])})}),e.hooks.add("after-tokenize",function(E){if(E.language!=="markdown"&&E.language!=="md")return;function S(w){if(!(!w||typeof w=="string"))for(var M=0,m=w.length;M<m;M++){var v=w[M];if(v.type!=="code"){S(v.content);continue}var k=v.content[1],G=v.content[3];if(k&&G&&k.type==="code-language"&&G.type==="code-block"&&typeof k.content=="string"){var I=k.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");I=(/[a-z][\w-]*/i.exec(I)||[""])[0].toLowerCase();var P="language-"+I;G.alias?typeof G.alias=="string"?G.alias=[G.alias,P]:G.alias.push(P):G.alias=[P]}}}S(E.tokens)}),e.hooks.add("wrap",function(E){if(E.type==="code-block"){for(var S="",w=0,M=E.classes.length;w<M;w++){var m=E.classes[w],v=/language-(.+)/.exec(m);if(v){S=v[1];break}}var k=e.languages[S];if(k)E.content=e.highlight(T(E.content),k,S);else if(S&&S!=="none"&&e.plugins.autoloader){var G="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);E.attributes.id=G,e.plugins.autoloader.loadLanguages(S,function(){var I=document.getElementById(G);I&&(I.innerHTML=e.highlight(I.textContent,e.languages[S],S))})}}});var f=RegExp(e.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},_=String.fromCodePoint||String.fromCharCode;function T(E){var S=E.replace(f,"");return S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,M){if(M=M.toLowerCase(),M[0]==="#"){var m;return M[1]==="x"?m=parseInt(M.slice(2),16):m=Number(M.slice(1)),_(m)}else{var v=p[M];return v||w}}),S}e.languages.md=e.languages.markdown}(Prism)),Ih}var Ph={},$h;function Mp(){return $h||($h=1,Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean),Ph}var Fh={},Bh;function Rp(){return Bh||(Bh=1,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),Fh}var Hh={},Wh;function bp(){return Wh||(Wh=1,Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec),Hh}var Kh={},zh;function Lp(){return zh||(zh=1,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}),Kh}var Uh={},Gh;function Ip(){return Gh||(Gh=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Uh}var Yh={},jh;function kp(){return jh||(jh=1,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)),Yh}var Vh={},qh;function Pp(){return qh||(qh=1,Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift})),Vh}var Zh={},Jh;function $p(){return Jh||(Jh=1,function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)),Zh}var Xh={},Qh;function Fp(){return Qh||(Qh=1,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),Xh}var eg={},tg;function Bp(){return tg||(tg=1,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)),eg}var ng;function FC(){if(ng)return Pn;ng=1;var e=Sp();wp(),Op(),Dp(),Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp();var t=pn(),n=Yt();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function l(ee,ne){for(const ue of ee.childNodes){if(t.isHTMLElement(ue)&&ue.tagName===ne)return!0;l(ue,ne)}return!1}const d="data-highlight-language";class f extends n.ElementNode{static getType(){return"code"}static clone(ne){return new f(ne.__language,ne.__key)}constructor(ne,ue){super(ue),this.__language=r(ne)}createDOM(ne){const ue=document.createElement("code");t.addClassNamesToElement(ue,ne.theme.code),ue.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ue.setAttribute(d,be),ue}updateDOM(ne,ue,be){const Ne=this.__language,Re=ne.__language;return Ne?Ne!==Re&&ue.setAttribute(d,Ne):Re&&ue.removeAttribute(d),!1}exportDOM(){const ne=document.createElement("pre");ne.setAttribute("spellcheck","false");const ue=this.getLanguage();return ue&&ne.setAttribute(d,ue),{element:ne}}static importDOM(){return{code:ne=>ne.textContent!=null&&(/\r?\n/.test(ne.textContent)||l(ne,"BR"))?{conversion:T,priority:1}:null,div:ne=>({conversion:E,priority:1}),pre:ne=>({conversion:T,priority:0}),table:ne=>G(ne)?{conversion:S,priority:3}:null,td:ne=>{const ue=ne,be=ue.closest("table");return k(ue)?{conversion:M,priority:3}:be&&G(be)?{conversion:w,priority:3}:null},tr:ne=>{const be=ne.closest("table");return be&&G(be)?{conversion:w,priority:3}:null}}}static importJSON(ne){const ue=p(ne.language);return ue.setFormat(ne.format),ue.setIndent(ne.indent),ue.setDirection(ne.direction),ue}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(ne,ue=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
|
|
89
89
|
`&&be[Ne-2].getTextContent()===`
|
|
90
|
-
`&&ne.isCollapsed()&&ne.anchor.key===this.__key&&ne.anchor.offset===Ne){be[Ne-1].remove(),be[Ne-2].remove();const Be=n.$createParagraphNode();return this.insertAfter(Be,ue),Be}const{anchor:Re,focus:ke}=ne,qe=(Re.isBefore(ke)?Re:ke).getNode();if(n.$isTextNode(qe)){let Be=Se(qe);const
|
|
91
|
-
`+ ++ke);ue.setAttribute("data-gutter",Re)}const W=new Set;function J(ee,ne,ue){const be=ee.getKey();W.has(be)||(W.add(be),ee.getLanguage()===void 0&&ee.setLanguage(ue.defaultLanguage),ne.update(()=>{U(be,()=>{const Ne=n.$getNodeByKey(be);if(!_(Ne)||!Ne.isAttached())return!1;const Re=Ne.getTextContent(),ke=ue.tokenize(Re,Ne.getLanguage()||ue.defaultLanguage),Fe=R(ke),qe=X(Ne.getChildren(),Fe),{from:Be,to:
|
|
90
|
+
`&&ne.isCollapsed()&&ne.anchor.key===this.__key&&ne.anchor.offset===Ne){be[Ne-1].remove(),be[Ne-2].remove();const Be=n.$createParagraphNode();return this.insertAfter(Be,ue),Be}const{anchor:Re,focus:ke}=ne,qe=(Re.isBefore(ke)?Re:ke).getNode();if(n.$isTextNode(qe)){let Be=Se(qe);const ut=[];for(;;)if(n.$isTabNode(Be))ut.push(n.$createTabNode()),Be=Be.getNextSibling();else if(Te(Be)){let ve=0;const Le=Be.getTextContent(),Me=Be.getTextContentSize();for(;ve<Me&&Le[ve]===" ";ve++);if(ve!==0&&ut.push(q(" ".repeat(ve))),ve!==Me)break;Be=Be.getNextSibling()}else break;const At=qe.splitText(Re.offset)[0],Ut=Re.offset===0?0:1,en=At.getIndexWithinParent()+Ut,Oe=qe.getParentOrThrow(),ie=[n.$createLineBreakNode(),...ut];Oe.splice(en,0,ie);const le=ut[ut.length-1];le?le.select():Re.offset===0?At.selectPrevious():At.getNextSibling().selectNext(0,0)}if(_(qe)){const{offset:Be}=ne.anchor;qe.splice(Be,0,[n.$createLineBreakNode()]),qe.select(Be+1,Be+1)}return null}canIndent(){return!1}collapseAtStart(){const ne=n.$createParagraphNode();return this.getChildren().forEach(be=>ne.append(be)),this.replace(ne),!0}setLanguage(ne){const ue=this.getWritable();ue.__language=r(ne)}getLanguage(){return this.getLatest().__language}}function p(ee){return n.$applyNodeReplacement(new f(ee))}function _(ee){return ee instanceof f}function T(ee){let ne;return t.isHTMLElement(ee)&&(ne=ee.getAttribute(d)),{node:p(ne)}}function E(ee){const ne=ee,ue=m(ne);return!ue&&!v(ne)?{node:null}:{after:be=>{const Ne=ee.parentNode;return Ne!=null&&ee!==Ne.lastChild&&be.push(n.$createLineBreakNode()),be},node:ue?p():null}}function S(){return{node:p()}}function w(){return{node:null}}function M(ee){const ne=ee;return{after:ue=>(ne.parentNode&&ne.parentNode.nextSibling&&ue.push(n.$createLineBreakNode()),ue),node:null}}function m(ee){return ee.style.fontFamily.match("monospace")!==null}function v(ee){let ne=ee.parentElement;for(;ne!==null;){if(m(ne))return!0;ne=ne.parentElement}return!1}function k(ee){return ee.classList.contains("js-file-line")}function G(ee){return ee.classList.contains("js-file-line-container")}const I="javascript",P={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},H={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function j(ee){return H[ee]||ee}function re(ee){const ne=j(ee);return P[ne]||ne}const te=()=>I,ce=()=>Object.keys(e.languages).filter(ee=>typeof e.languages[ee]!="function").sort();class V extends n.TextNode{constructor(ne,ue,be){super(ne,be),this.__highlightType=ue}static getType(){return"code-highlight"}static clone(ne){return new V(ne.__text,ne.__highlightType||void 0,ne.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(ne){const ue=super.createDOM(ne),be=z(ne.theme,this.__highlightType);return t.addClassNamesToElement(ue,be),ue}updateDOM(ne,ue,be){const Ne=super.updateDOM(ne,ue,be),Re=z(be.theme,ne.__highlightType),ke=z(be.theme,this.__highlightType);return Re!==ke&&(Re&&t.removeClassNamesFromElement(ue,Re),ke&&t.addClassNamesToElement(ue,ke)),Ne}static importJSON(ne){const ue=q(ne.text,ne.highlightType);return ue.setFormat(ne.format),ue.setDetail(ne.detail),ue.setMode(ne.mode),ue.setStyle(ne.style),ue}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(ne){return this}isParentRequired(){return!0}createParentElementNode(){return p()}}function z(ee,ne){return ne&&ee&&ee.codeHighlight&&ee.codeHighlight[ne]}function q(ee,ne){return n.$applyNodeReplacement(new V(ee,ne))}function Te(ee){return ee instanceof V}function Se(ee){let ne=ee,ue=ee;for(;Te(ue)||n.$isTabNode(ue);)ne=ue,ue=ue.getPreviousSibling();return ne}function Ee(ee){let ne=ee,ue=ee;for(;Te(ue)||n.$isTabNode(ue);)ne=ue,ue=ue.getNextSibling();return ne}const de={defaultLanguage:I,tokenize(ee,ne){return e.tokenize(ee,e.languages[ne||""]||e.languages[this.defaultLanguage])}};function K(ee,ne){let ue=null,be=null,Ne=ee,Re=ne,ke=ee.getTextContent();for(;;){if(Re===0){if(Ne=Ne.getPreviousSibling(),Ne===null)break;if(!(Te(Ne)||n.$isTabNode(Ne)||n.$isLineBreakNode(Ne)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Ne)){ue={node:Ne,offset:1};break}Re=Math.max(0,Ne.getTextContentSize()-1),ke=Ne.getTextContent()}else Re--;const qe=ke[Re];Te(Ne)&&qe!==" "&&(be={node:Ne,offset:Re})}if(be!==null)return be;let Fe=null;if(ne<ee.getTextContentSize())Te(ee)&&(Fe=ee.getTextContent()[ne]);else{const qe=ee.getNextSibling();Te(qe)&&(Fe=qe.getTextContent()[0])}if(Fe!==null&&Fe!==" ")return ue;{const qe=O(ee,ne);return qe!==null?qe:ue}}function O(ee,ne){let ue=ee,be=ne,Ne=ee.getTextContent(),Re=ee.getTextContentSize();for(;;){if(!Te(ue)||be===Re){if(ue=ue.getNextSibling(),ue===null||n.$isLineBreakNode(ue))return null;Te(ue)&&(be=0,Ne=ue.getTextContent(),Re=ue.getTextContentSize())}if(Te(ue)){if(Ne[be]!==" ")return{node:ue,offset:be};be++}}}function Z(ee){const ne=Ee(ee);if(n.$isLineBreakNode(ne))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return ne}function oe(ee,ne,ue){const be=ee.getParent();_(be)?J(be,ne,ue):Te(ee)&&ee.replace(n.$createTextNode(ee.__text))}function Y(ee,ne){const ue=ne.getElementByKey(ee.getKey());if(ue===null)return;const be=ee.getChildren(),Ne=be.length;if(Ne===ue.__cachedChildrenLength)return;ue.__cachedChildrenLength=Ne;let Re="1",ke=1;for(let Fe=0;Fe<Ne;Fe++)n.$isLineBreakNode(be[Fe])&&(Re+=`
|
|
91
|
+
`+ ++ke);ue.setAttribute("data-gutter",Re)}const W=new Set;function J(ee,ne,ue){const be=ee.getKey();W.has(be)||(W.add(be),ee.getLanguage()===void 0&&ee.setLanguage(ue.defaultLanguage),ne.update(()=>{U(be,()=>{const Ne=n.$getNodeByKey(be);if(!_(Ne)||!Ne.isAttached())return!1;const Re=Ne.getTextContent(),ke=ue.tokenize(Re,Ne.getLanguage()||ue.defaultLanguage),Fe=R(ke),qe=X(Ne.getChildren(),Fe),{from:Be,to:ut,nodesForReplacement:At}=qe;return Be!==ut||At.length?(ee.splice(Be,ut-Be,At),!0):!1})},{onUpdate:()=>{W.delete(be)},skipTransforms:!0}))}function R(ee,ne){const ue=[];for(const be of ee)if(typeof be=="string"){const Ne=be.split(/(\n|\t)/),Re=Ne.length;for(let ke=0;ke<Re;ke++){const Fe=Ne[ke];Fe===`
|
|
92
92
|
`||Fe===`\r
|
|
93
|
-
`?ue.push(n.$createLineBreakNode()):Fe===" "?ue.push(n.$createTabNode()):Fe.length>0&&ue.push(q(Fe,ne))}}else{const{content:Ne}=be;typeof Ne=="string"?ue.push(...R([Ne],be.type)):Array.isArray(Ne)&&ue.push(...R(Ne,be.type))}return ue}function U(ee,ne){const ue=n.$getNodeByKey(ee);if(!_(ue)||!ue.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){ne();return}const Ne=be.anchor,Re=Ne.offset,ke=Ne.type==="element"&&n.$isLineBreakNode(ue.getChildAtIndex(Ne.offset-1));let Fe=0;if(!ke){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((
|
|
93
|
+
`?ue.push(n.$createLineBreakNode()):Fe===" "?ue.push(n.$createTabNode()):Fe.length>0&&ue.push(q(Fe,ne))}}else{const{content:Ne}=be;typeof Ne=="string"?ue.push(...R([Ne],be.type)):Array.isArray(Ne)&&ue.push(...R(Ne,be.type))}return ue}function U(ee,ne){const ue=n.$getNodeByKey(ee);if(!_(ue)||!ue.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){ne();return}const Ne=be.anchor,Re=Ne.offset,ke=Ne.type==="element"&&n.$isLineBreakNode(ue.getChildAtIndex(Ne.offset-1));let Fe=0;if(!ke){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((ut,At)=>ut+At.getTextContentSize(),0)}if(ne()){if(ke){Ne.getNode().select(Re,Re);return}ue.getChildren().some(Be=>{const ut=n.$isTextNode(Be);if(ut||n.$isLineBreakNode(Be)){const At=Be.getTextContentSize();if(ut&&At>=Fe)return Be.select(Fe,Fe),!0;Fe-=At}return!1})}}function X(ee,ne){let ue=0;for(;ue<ee.length&&fe(ee[ue],ne[ue]);)ue++;const be=ee.length,Ne=ne.length,Re=Math.min(be,Ne)-ue;let ke=0;for(;ke<Re;)if(ke++,!fe(ee[be-ke],ne[Ne-ke])){ke--;break}const Fe=ue,qe=be-ke,Be=ne.slice(ue,Ne-ke);return{from:Fe,nodesForReplacement:Be,to:qe}}function fe(ee,ne){return Te(ee)&&Te(ne)&&ee.__text===ne.__text&&ee.__highlightType===ne.__highlightType||n.$isTabNode(ee)&&n.$isTabNode(ne)||n.$isLineBreakNode(ee)&&n.$isLineBreakNode(ne)}function _e(ee){if(!n.$isRangeSelection(ee))return!1;const ne=ee.anchor.getNode(),ue=ee.focus.getNode();if(ne.is(ue)&&_(ne))return!0;const be=ne.getParent();return _(be)&&be.is(ue.getParent())}function B(ee){const ne=ee.getNodes(),ue=[[]];if(ne.length===1&&_(ne[0]))return ue;let be=ue[0];for(let Ne=0;Ne<ne.length;Ne++){const Re=ne[Ne];if(!(Te(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Re)?Ne!==0&&be.length>0&&(be=[],ue.push(be)):be.push(Re)}return ue}function A(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return null;const ue=ee?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,be=ee?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(B(ne).length>1)return ue;const ke=ne.getNodes()[0];if(!(_(ke)||Te(ke)||n.$isTabNode(ke)||n.$isLineBreakNode(ke)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(_(ke))return ue;const Fe=Se(ke),qe=Ee(ke),Be=ne.anchor,ut=ne.focus;let At,Ut;return ut.isBefore(Be)?(At=ut,Ut=Be):(At=Be,Ut=ut),Fe!==null&&qe!==null&&At.key===Fe.getKey()&&At.offset===0&&Ut.key===qe.getKey()&&Ut.offset===qe.getTextContentSize()?ue:be}function F(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return!1;const ue=B(ne),be=ue.length;if(ue.length>1){for(let Fe=0;Fe<be;Fe++){const qe=ue[Fe];if(qe.length>0){let Be=qe[0];Fe===0&&(Be=Se(Be)),Be!==null&&(ee===n.INDENT_CONTENT_COMMAND?Be.insertBefore(n.$createTabNode()):n.$isTabNode(Be)&&Be.remove())}}return!0}const Re=ne.getNodes()[0];if(!(_(Re)||Te(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(_(Re))return ee===n.INDENT_CONTENT_COMMAND&&ne.insertNodes([n.$createTabNode()]),!0;const ke=Se(Re);if(ke===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return ee===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(ke)?ke.insertAfter(n.$createTabNode()):ke.insertBefore(n.$createTabNode()):n.$isTabNode(ke)&&ke.remove(),!0}function se(ee,ne){const ue=n.$getSelection();if(!n.$isRangeSelection(ue))return!1;const{anchor:be,focus:Ne}=ue,Re=be.offset,ke=Ne.offset,Fe=be.getNode(),qe=Ne.getNode(),Be=ee===n.KEY_ARROW_UP_COMMAND;if(!_e(ue)||!(Te(Fe)||n.$isTabNode(Fe))||!(Te(qe)||n.$isTabNode(qe)))return!1;if(!ne.altKey){if(ue.isCollapsed()){const ve=Fe.getParentOrThrow();if(Be&&Re===0&&Fe.getPreviousSibling()===null){if(ve.getPreviousSibling()===null)return ve.selectPrevious(),ne.preventDefault(),!0}else if(!Be&&Re===Fe.getTextContentSize()&&Fe.getNextSibling()===null&&ve.getNextSibling()===null)return ve.selectNext(),ne.preventDefault(),!0}return!1}let ut,At;if(Fe.isBefore(qe)?(ut=Se(Fe),At=Ee(qe)):(ut=Se(qe),At=Ee(Fe)),ut==null||At==null)return!1;const Ut=ut.getNodesBetween(At);for(let ve=0;ve<Ut.length;ve++){const Le=Ut[ve];if(!Te(Le)&&!n.$isTabNode(Le)&&!n.$isLineBreakNode(Le))return!1}ne.preventDefault(),ne.stopPropagation();const en=Be?ut.getPreviousSibling():At.getNextSibling();if(!n.$isLineBreakNode(en))return!0;const Oe=Be?en.getPreviousSibling():en.getNextSibling();if(Oe==null)return!0;const ie=Te(Oe)||n.$isTabNode(Oe)||n.$isLineBreakNode(Oe)?Be?Se(Oe):Ee(Oe):null;let le=ie??Oe;return en.remove(),Ut.forEach(ve=>ve.remove()),ee===n.KEY_ARROW_UP_COMMAND?(Ut.forEach(ve=>le.insertBefore(ve)),le.insertBefore(en)):(le.insertAfter(en),le=en,Ut.forEach(ve=>{le.insertAfter(ve),le=ve})),ue.setTextNodeRange(Fe,Re,qe,ke),!0}function ye(ee,ne){const ue=n.$getSelection();if(!n.$isRangeSelection(ue))return!1;const{anchor:be,focus:Ne}=ue,Re=be.getNode(),ke=Ne.getNode(),Fe=ee===n.MOVE_TO_START;if(!(Te(Re)||n.$isTabNode(Re))||!(Te(ke)||n.$isTabNode(ke)))return!1;if(Fe){const qe=K(ke,Ne.offset);if(qe!==null){const{node:Be,offset:ut}=qe;n.$isLineBreakNode(Be)?Be.selectNext(0,0):ue.setTextNodeRange(Be,ut,Be,ut)}else ke.getParentOrThrow().selectStart()}else Z(ke).select();return ne.preventDefault(),ne.stopPropagation(),!0}function De(ee,ne){if(!ee.hasNodes([f,V]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return ne==null&&(ne=de),t.mergeRegister(ee.registerMutationListener(f,ue=>{ee.update(()=>{for(const[be,Ne]of ue)if(Ne!=="destroyed"){const Re=n.$getNodeByKey(be);Re!==null&&Y(Re,ee)}})}),ee.registerNodeTransform(f,ue=>J(ue,ee,ne)),ee.registerNodeTransform(n.TextNode,ue=>oe(ue,ee,ne)),ee.registerNodeTransform(V,ue=>oe(ue,ee,ne)),ee.registerCommand(n.KEY_TAB_COMMAND,ue=>{const be=A(ue.shiftKey);return be===null?!1:(ue.preventDefault(),ee.dispatchCommand(be,void 0),!0)},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ue=n.$getSelection();return _e(ue)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INDENT_CONTENT_COMMAND,ue=>F(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.OUTDENT_CONTENT_COMMAND,ue=>F(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_UP_COMMAND,ue=>se(n.KEY_ARROW_UP_COMMAND,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ue=>se(n.KEY_ARROW_DOWN_COMMAND,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_END,ue=>ye(n.MOVE_TO_END,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_START,ue=>ye(n.MOVE_TO_START,ue),n.COMMAND_PRIORITY_LOW))}return Pn.$createCodeHighlightNode=q,Pn.$createCodeNode=p,Pn.$isCodeHighlightNode=Te,Pn.$isCodeNode=_,Pn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=P,Pn.CODE_LANGUAGE_MAP=H,Pn.CodeHighlightNode=V,Pn.CodeNode=f,Pn.DEFAULT_CODE_LANGUAGE=I,Pn.PrismTokenizer=de,Pn.getCodeLanguages=ce,Pn.getDefaultCodeLanguage=te,Pn.getEndOfCodeInLine=Z,Pn.getFirstCodeNodeOfLine=Se,Pn.getLanguageFriendlyName=re,Pn.getLastCodeNodeOfLine=Ee,Pn.getStartOfCodeInLine=K,Pn.normalizeCodeLang=j,Pn.registerCodeHighlighting=De,Pn}var $n={},rg;function BC(){if(rg)return $n;rg=1;var e=Sp();wp(),Op(),Dp(),Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp();var t=pn(),n=Yt();let r=R=>R!=null&&e.languages.hasOwnProperty(R)?R:void 0;function l(R,U){for(let X of R.childNodes){if(t.isHTMLElement(X)&&X.tagName===U)return!0;l(X,U)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(U){return new d(U.__language,U.__key)}constructor(U,X){super(X),this.__language=r(U)}createDOM(U){let X=document.createElement("code");return t.addClassNamesToElement(X,U.theme.code),X.setAttribute("spellcheck","false"),(U=this.getLanguage())&&X.setAttribute("data-highlight-language",U),X}updateDOM(U,X){let fe=this.__language;return U=U.__language,fe?fe!==U&&X.setAttribute("data-highlight-language",fe):U&&X.removeAttribute("data-highlight-language"),!1}exportDOM(){let U=document.createElement("pre");U.setAttribute("spellcheck","false");let X=this.getLanguage();return X&&U.setAttribute("data-highlight-language",X),{element:U}}static importDOM(){return{code:U=>U.textContent!=null&&(/\r?\n/.test(U.textContent)||l(U,"BR"))?{conversion:_,priority:1}:null,div:()=>({conversion:T,priority:1}),pre:()=>({conversion:_,priority:0}),table:U=>m(U)?{conversion:E,priority:3}:null,td:U=>{let X=U.closest("table");return U.classList.contains("js-file-line")?{conversion:w,priority:3}:X&&m(X)?{conversion:S,priority:3}:null},tr:U=>(U=U.closest("table"))&&m(U)?{conversion:S,priority:3}:null}}static importJSON(U){let X=f(U.language);return X.setFormat(U.format),X.setIndent(U.indent),X.setDirection(U.direction),X}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(U,X=!0){var fe=this.getChildren(),_e=fe.length;if(2<=_e&&fe[_e-1].getTextContent()===`
|
|
94
94
|
`&&fe[_e-2].getTextContent()===`
|
|
95
|
-
`&&U.isCollapsed()&&U.anchor.key===this.__key&&U.anchor.offset===_e)return fe[_e-1].remove(),fe[_e-2].remove(),U=n.$createParagraphNode(),this.insertAfter(U,X),U;let{anchor:B,focus:A}=U;if(X=(B.isBefore(A)?B:A).getNode(),n.$isTextNode(X)){for(_e=re(X),fe=[];;)if(n.$isTabNode(_e))fe.push(n.$createTabNode()),_e=_e.getNextSibling();else if(
|
|
95
|
+
`&&U.isCollapsed()&&U.anchor.key===this.__key&&U.anchor.offset===_e)return fe[_e-1].remove(),fe[_e-2].remove(),U=n.$createParagraphNode(),this.insertAfter(U,X),U;let{anchor:B,focus:A}=U;if(X=(B.isBefore(A)?B:A).getNode(),n.$isTextNode(X)){for(_e=re(X),fe=[];;)if(n.$isTabNode(_e))fe.push(n.$createTabNode()),_e=_e.getNextSibling();else if(j(_e)){for(var F=0,se=_e.getTextContent(),ye=_e.getTextContentSize();F<ye&&se[F]===" ";F++);if(F!==0&&fe.push(H(" ".repeat(F))),F!==ye)break;_e=_e.getNextSibling()}else break;_e=X.splitText(B.offset)[0],F=B.offset===0?0:1,F=_e.getIndexWithinParent()+F,se=X.getParentOrThrow(),ye=[n.$createLineBreakNode(),...fe],se.splice(F,0,ye),(fe=fe[fe.length-1])?fe.select():B.offset===0?_e.selectPrevious():_e.getNextSibling().selectNext(0,0)}return p(X)&&({offset:U}=U.anchor,X.splice(U,0,[n.$createLineBreakNode()]),X.select(U+1,U+1)),null}canIndent(){return!1}collapseAtStart(){let U=n.$createParagraphNode();return this.getChildren().forEach(X=>U.append(X)),this.replace(U),!0}setLanguage(U){this.getWritable().__language=r(U)}getLanguage(){return this.getLatest().__language}}function f(R){return n.$applyNodeReplacement(new d(R))}function p(R){return R instanceof d}function _(R){let U;return t.isHTMLElement(R)&&(U=R.getAttribute("data-highlight-language")),{node:f(U)}}function T(R){let U=R.style.fontFamily.match("monospace")!==null;return U||M(R)?{after:X=>{let fe=R.parentNode;return fe!=null&&R!==fe.lastChild&&X.push(n.$createLineBreakNode()),X},node:U?f():null}:{node:null}}function E(){return{node:f()}}function S(){return{node:null}}function w(R){return{after:U=>(R.parentNode&&R.parentNode.nextSibling&&U.push(n.$createLineBreakNode()),U),node:null}}function M(R){for(R=R.parentElement;R!==null;){if(R.style.fontFamily.match("monospace")!==null)return!0;R=R.parentElement}return!1}function m(R){return R.classList.contains("js-file-line-container")}let v={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},k={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function G(R){return k[R]||R}class I extends n.TextNode{constructor(U,X,fe){super(U,fe),this.__highlightType=X}static getType(){return"code-highlight"}static clone(U){return new I(U.__text,U.__highlightType||void 0,U.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(U){let X=super.createDOM(U);return U=P(U.theme,this.__highlightType),t.addClassNamesToElement(X,U),X}updateDOM(U,X,fe){let _e=super.updateDOM(U,X,fe);return U=P(fe.theme,U.__highlightType),fe=P(fe.theme,this.__highlightType),U!==fe&&(U&&t.removeClassNamesFromElement(X,U),fe&&t.addClassNamesToElement(X,fe)),_e}static importJSON(U){let X=H(U.text,U.highlightType);return X.setFormat(U.format),X.setDetail(U.detail),X.setMode(U.mode),X.setStyle(U.style),X}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return f()}}function P(R,U){return U&&R&&R.codeHighlight&&R.codeHighlight[U]}function H(R,U){return n.$applyNodeReplacement(new I(R,U))}function j(R){return R instanceof I}function re(R){let U=R;for(;j(R)||n.$isTabNode(R);)U=R,R=R.getPreviousSibling();return U}function te(R){let U=R;for(;j(R)||n.$isTabNode(R);)U=R,R=R.getNextSibling();return U}let ce={defaultLanguage:"javascript",tokenize(R,U){return e.tokenize(R,e.languages[U||""]||e.languages[this.defaultLanguage])}};function V(R,U){let X=null;var fe=null,_e=R;let B=U,A=R.getTextContent();for(;;){if(B===0){if(_e=_e.getPreviousSibling(),_e===null)break;if(!(j(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(_e)){X={node:_e,offset:1};break}B=Math.max(0,_e.getTextContentSize()-1),A=_e.getTextContent()}else B--;let F=A[B];j(_e)&&F!==" "&&(fe={node:_e,offset:B})}if(fe!==null)return fe;if(fe=null,U<R.getTextContentSize()?j(R)&&(fe=R.getTextContent()[U]):(_e=R.getNextSibling(),j(_e)&&(fe=_e.getTextContent()[0])),fe!==null&&fe!==" ")return X;e:for(fe=R,_e=R.getTextContent(),R=R.getTextContentSize();;){if(!j(fe)||U===R){if(fe=fe.getNextSibling(),fe===null||n.$isLineBreakNode(fe)){R=null;break e}j(fe)&&(U=0,_e=fe.getTextContent(),R=fe.getTextContentSize())}if(j(fe)){if(_e[U]!==" "){R={node:fe,offset:U};break e}U++}}return R!==null?R:X}function z(R){if(R=te(R),n.$isLineBreakNode(R))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return R}function q(R,U,X){let fe=R.getParent();p(fe)?Se(fe,U,X):j(R)&&R.replace(n.$createTextNode(R.__text))}let Te=new Set;function Se(R,U,X){let fe=R.getKey();Te.has(fe)||(Te.add(fe),R.getLanguage()===void 0&&R.setLanguage(X.defaultLanguage),U.update(()=>{de(fe,()=>{var _e=n.$getNodeByKey(fe);if(!p(_e)||!_e.isAttached())return!1;var B=_e.getTextContent();B=X.tokenize(B,_e.getLanguage()||X.defaultLanguage),B=Ee(B);var A=_e.getChildren();for(_e=0;_e<A.length&&K(A[_e],B[_e]);)_e++;var F=A.length;let se=B.length,ye=Math.min(F,se)-_e,De=0;for(;De<ye;)if(De++,!K(A[F-De],B[se-De])){De--;break}A=_e,F-=De,B=B.slice(_e,se-De);let{from:ee,to:ne,nodesForReplacement:ue}={from:A,nodesForReplacement:B,to:F};return ee!==ne||ue.length?(R.splice(ee,ne-ee,ue),!0):!1})},{onUpdate:()=>{Te.delete(fe)},skipTransforms:!0}))}function Ee(R,U){let X=[];for(let fe of R)if(typeof fe=="string"){R=fe.split(/(\n|\t)/);let _e=R.length;for(let B=0;B<_e;B++){let A=R[B];A===`
|
|
96
96
|
`||A===`\r
|
|
97
|
-
`?X.push(n.$createLineBreakNode()):A===" "?X.push(n.$createTabNode()):0<A.length&&X.push(H(A,U))}}else({content:R}=fe),typeof R=="string"?X.push(...Ee([R],fe.type)):Array.isArray(R)&&X.push(...Ee(R,fe.type));return X}function de(R,U){if(R=n.$getNodeByKey(R),p(R)&&R.isAttached()){var X=n.$getSelection();if(n.$isRangeSelection(X)){X=X.anchor;var fe=X.offset,_e=X.type==="element"&&n.$isLineBreakNode(R.getChildAtIndex(X.offset-1)),B=0;if(!_e){let A=X.getNode();B=fe+A.getPreviousSiblings().reduce((F,se)=>F+se.getTextContentSize(),0)}U()&&(_e?X.getNode().select(fe,fe):R.getChildren().some(A=>{let F=n.$isTextNode(A);if(F||n.$isLineBreakNode(A)){let se=A.getTextContentSize();if(F&&se>=B)return A.select(B,B),!0;B-=se}return!1}))}else U()}}function K(R,U){return
|
|
98
|
-
`+ ++ye);fe.setAttribute("data-gutter",se)}}})}),R.registerNodeTransform(d,X=>Se(X,R,U)),R.registerNodeTransform(n.TextNode,X=>q(X,R,U)),R.registerNodeTransform(I,X=>q(X,R,U)),R.registerCommand(n.KEY_TAB_COMMAND,X=>{let fe=oe(X.shiftKey);return fe===null?!1:(X.preventDefault(),R.dispatchCommand(fe,void 0),!0)},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INSERT_TAB_COMMAND,()=>{let X=n.$getSelection();return O(X)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_UP_COMMAND,X=>W(n.KEY_ARROW_UP_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_DOWN_COMMAND,X=>W(n.KEY_ARROW_DOWN_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_END,X=>J(n.MOVE_TO_END,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_START,X=>J(n.MOVE_TO_START,X),n.COMMAND_PRIORITY_LOW))},$n}const HC=process.env.NODE_ENV==="development"?FC():BC();var Vu=HC,Cd=qn();function WC(){const[e]=Cd.useLexicalComposerContext();return nt.useEffect(()=>Vu.registerCodeHighlighting(e),[e]),null}var ig=pn(),Fn=Yt();function KC({src:e,altText:t,width:n,height:r,maxWidth:l}){const d=nt.useMemo(()=>({height:r,width:n,maxWidth:l}),[r,n,l]);return ft.jsx("img",{src:e,alt:t,style:d})}function Hp({altText:e,height:t,maxWidth:n=500,src:r,width:l,key:d}){return Fn.$applyNodeReplacement(new sl(r,e,n,l,t,d))}function zC(e){return e instanceof sl}class sl extends Fn.DecoratorNode{constructor(n,r,l,d,f,p){super(p);Ie(this,"__src");Ie(this,"__altText");Ie(this,"__width");Ie(this,"__height");Ie(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=l,this.__width=d||"inherit",this.__height=f||"inherit"}static getType(){return"image"}static clone(n){return new sl(n.__src,n.__altText,n.__maxWidth,n.__width,n.__height,n.__key)}getSrc(){return this.getLatest().__src}getAltText(){return this.getLatest().__altText}exportJSON(){return{altText:this.getAltText(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,src:this.getSrc(),type:"image",version:1,width:this.__width==="inherit"?0:this.__width}}static importJSON(n){return Hp(n)}createDOM(n){const r=document.createElement("span"),l=n.theme.image;return l&&(r.className=l),r}updateDOM(){return!1}decorate(){return ft.jsx(KC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const UC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",GC=e=>UC?(e||window).getSelection():null,Wp=Fn.createCommand("INSERT_IMAGE_COMMAND");function YC(){const[e]=Cd.useLexicalComposerContext();return nt.useEffect(()=>{if(!e.hasNodes([sl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ig.mergeRegister(e.registerCommand(Wp,t=>{const n=Hp(t);return Fn.$insertNodes([n]),Fn.$isRootOrShadowRoot(n.getParentOrThrow())&&ig.$wrapNodeInElement(n,Fn.$createParagraphNode).selectEnd(),!0},Fn.COMMAND_PRIORITY_EDITOR),e.registerCommand(Fn.DRAGSTART_COMMAND,t=>VC(t),Fn.COMMAND_PRIORITY_HIGH),e.registerCommand(Fn.DRAGOVER_COMMAND,t=>jC(t),Fn.COMMAND_PRIORITY_LOW),e.registerCommand(Fn.DROP_COMMAND,t=>qC(t,e),Fn.COMMAND_PRIORITY_HIGH))},[e]),null}function VC(e){const t="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=t;const r=Ed();if(!r)return!1;const l=e.dataTransfer;return l?(l.setData("text/plain","_"),l.setDragImage(n,0,0),l.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function jC(e){return Ed()?(Kp(e)||e.preventDefault(),!0):!1}function qC(e,t){const n=Ed();if(!n)return!1;const r=ZC(e);if(!r)return!1;if(e.preventDefault(),Kp(e)){const l=JC(e);n.remove();const d=Fn.$createRangeSelection();l!=null&&d.applyDOMRange(l),Fn.$setSelection(d),t.dispatchCommand(Wp,r)}return!0}function Ed(){const e=Fn.$getSelection();if(!Fn.$isNodeSelection(e))return null;const n=e.getNodes()[0];return zC(n)?n:null}function ZC(e){var l;const t=(l=e.dataTransfer)==null?void 0:l.getData("application/x-lexical-drag");if(!t)return null;const{type:n,data:r}=JSON.parse(t);return n!=="image"?null:r}function Kp(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.yext-default-richtextv2-theme__image")&&t.parentElement)}function JC(e){let t;const n=e.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,l=GC(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&l!==null)l.collapse(e.rangeParent,e.rangeOffset||0),t=l.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var ro=_d();function XC(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>Fn.$isElementNode(n)?n:n.getParentOrThrow()))}const QC=3;function eE(e){const t=Fn.$getSelection();if(!Fn.$isRangeSelection(t))return!1;const n=XC(t);let r=0;for(const l of n)if(ro.$isListNode(l))r=Math.max(ro.$getListDepth(l)+1,r);else if(ro.$isListItemNode(l)){const d=l.getParent();if(!ro.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(ro.$getListDepth(d)+1,r)}return r<=e}function tE({maxDepth:e}){const[t]=Cd.useLexicalComposerContext();return nt.useEffect(()=>t.registerCommand(Fn.INDENT_CONTENT_COMMAND,()=>!eE(e||7),QC),[t,e]),null}var Ou=Nd(),sg=yd(),og=md(),Zl={},lg;function nE(){if(lg)return Zl;lg=1;var e=pn(),t=Yt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(f){return new n(f.__text,f.__key)}constructor(f,p){super(f,p)}createDOM(f){const p=super.createDOM(f);return e.addClassNamesToElement(p,f.theme.hashtag),p}static importJSON(f){const p=r(f.text);return p.setFormat(f.format),p.setDetail(f.detail),p.setMode(f.mode),p.setStyle(f.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function l(d){return d instanceof n}return Zl.$createHashtagNode=r,Zl.$isHashtagNode=l,Zl.HashtagNode=n,Zl}var Jl={},ag;function rE(){if(ag)return Jl;ag=1;var e=pn(),t=Yt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,f){super(d,f)}createDOM(d){let f=super.createDOM(d);return e.addClassNamesToElement(f,d.theme.hashtag),f}static importJSON(d){let f=r(d.text);return f.setFormat(d.format),f.setDetail(d.detail),f.setMode(d.mode),f.setStyle(d.style),f}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(l=""){return t.$applyNodeReplacement(new n(l))}return Jl.$createHashtagNode=r,Jl.$isHashtagNode=function(l){return l instanceof n},Jl.HashtagNode=n,Jl}const iE=process.env.NODE_ENV==="development"?nE():rE();var sE=iE;const dt={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271","yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366","yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},oE={characterLimit:dt["yext-default-richtextv2-theme__characterLimit"],code:dt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:dt["yext-default-richtextv2-theme__tokenAttr"],attr:dt["yext-default-richtextv2-theme__tokenAttr"],boolean:dt["yext-default-richtextv2-theme__tokenProperty"],builtin:dt["yext-default-richtextv2-theme__tokenSelector"],cdata:dt["yext-default-richtextv2-theme__tokenComment"],char:dt["yext-default-richtextv2-theme__tokenSelector"],class:dt["yext-default-richtextv2-theme__tokenFunction"],"class-name":dt["yext-default-richtextv2-theme__tokenFunction"],comment:dt["yext-default-richtextv2-theme__tokenComment"],constant:dt["yext-default-richtextv2-theme__tokenProperty"],deleted:dt["yext-default-richtextv2-theme__tokenProperty"],doctype:dt["yext-default-richtextv2-theme__tokenComment"],entity:dt["yext-default-richtextv2-theme__tokenOperator"],function:dt["yext-default-richtextv2-theme__tokenFunction"],important:dt["yext-default-richtextv2-theme__tokenVariable"],inserted:dt["yext-default-richtextv2-theme__tokenSelector"],keyword:dt["yext-default-richtextv2-theme__tokenAttr"],namespace:dt["yext-default-richtextv2-theme__tokenVariable"],number:dt["yext-default-richtextv2-theme__tokenProperty"],operator:dt["yext-default-richtextv2-theme__tokenOperator"],prolog:dt["yext-default-richtextv2-theme__tokenComment"],property:dt["yext-default-richtextv2-theme__tokenProperty"],punctuation:dt["yext-default-richtextv2-theme__tokenPunctuation"],regex:dt["yext-default-richtextv2-theme__tokenVariable"],selector:dt["yext-default-richtextv2-theme__tokenSelector"],string:dt["yext-default-richtextv2-theme__tokenSelector"],symbol:dt["yext-default-richtextv2-theme__tokenProperty"],tag:dt["yext-default-richtextv2-theme__tokenProperty"],url:dt["yext-default-richtextv2-theme__tokenOperator"],variable:dt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:dt["yext-default-richtextv2-theme__embedBlock"],focus:dt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:dt["yext-default-richtextv2-theme__hashtag"],heading:{h1:dt["yext-default-richtextv2-theme__h1"],h2:dt["yext-default-richtextv2-theme__h2"],h3:dt["yext-default-richtextv2-theme__h3"],h4:dt["yext-default-richtextv2-theme__h4"],h5:dt["yext-default-richtextv2-theme__h5"],h6:dt["yext-default-richtextv2-theme__h6"]},image:dt["yext-default-richtextv2-theme__image"],link:dt["yext-default-richtextv2-theme__link"],list:{listitem:dt["yext-default-richtextv2-theme__listItem"],listitemChecked:dt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:dt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:dt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[dt["yext-default-richtextv2-theme__ol1"],dt["yext-default-richtextv2-theme__ol2"],dt["yext-default-richtextv2-theme__ol3"],dt["yext-default-richtextv2-theme__ol4"],dt["yext-default-richtextv2-theme__ol5"]],ulDepth:[dt["yext-default-richtextv2-theme__ul1"],dt["yext-default-richtextv2-theme__ul2"],dt["yext-default-richtextv2-theme__ul3"]]},ltr:dt["yext-default-richtextv2-theme__ltr"],mark:dt["yext-default-richtextv2-theme__mark"],markOverlap:dt["yext-default-richtextv2-theme__markOverlap"],paragraph:dt["yext-default-richtextv2-theme__paragraph"],quote:dt["yext-default-richtextv2-theme__quote"],rtl:dt["yext-default-richtextv2-theme__rtl"],table:dt["yext-default-richtextv2-theme__table"],tableCell:dt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:dt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:dt["yext-default-richtextv2-theme__textBold"],code:dt["yext-default-richtextv2-theme__textCode"],italic:dt["yext-default-richtextv2-theme__textItalic"],strikethrough:dt["yext-default-richtextv2-theme__textStrikethrough"],subscript:dt["yext-default-richtextv2-theme__textSubscript"],superscript:dt["yext-default-richtextv2-theme__textSuperscript"],underline:dt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:dt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Ko={},Du={},cg;function lE(){if(cg)return Du;cg=1;var e=qn(),t=Yt(),n=nt;function r(d,f){return d.getEditorState().read(()=>{const p=t.$getNodeByKey(f);return p===null?!1:p.isSelected()})}function l(d){const[f]=e.useLexicalComposerContext(),[p,_]=n.useState(()=>r(f,d));n.useEffect(()=>{let S=!0;const w=f.registerUpdateListener(()=>{S&&_(r(f,d))});return()=>{S=!1,w()}},[f,d]);const T=n.useCallback(S=>{f.update(()=>{let w=t.$getSelection();t.$isNodeSelection(w)||(w=t.$createNodeSelection(),t.$setSelection(w)),t.$isNodeSelection(w)&&(S?w.add(d):w.delete(d))})},[f,d]),E=n.useCallback(()=>{f.update(()=>{const S=t.$getSelection();t.$isNodeSelection(S)&&S.clear()})},[f]);return[p,T,E]}return Du.useLexicalNodeSelection=l,Du}var Au={},ug;function aE(){if(ug)return Au;ug=1;var e=qn(),t=Yt(),n=nt;function r(l,d){return l.getEditorState().read(()=>{let f=t.$getNodeByKey(d);return f===null?!1:f.isSelected()})}return Au.useLexicalNodeSelection=function(l){let[d]=e.useLexicalComposerContext(),[f,p]=n.useState(()=>r(d,l));n.useEffect(()=>{let E=!0,S=d.registerUpdateListener(()=>{E&&p(r(d,l))});return()=>{E=!1,S()}},[d,l]);let _=n.useCallback(E=>{d.update(()=>{let S=t.$getSelection();t.$isNodeSelection(S)||(S=t.$createNodeSelection(),t.$setSelection(S)),t.$isNodeSelection(S)&&(E?S.add(l):S.delete(l))})},[d,l]),T=n.useCallback(()=>{d.update(()=>{const E=t.$getSelection();t.$isNodeSelection(E)&&E.clear()})},[d]);return[f,_,T]},Au}var Mu,dg;function zp(){return dg||(dg=1,Mu=process.env.NODE_ENV==="development"?lE():aE()),Mu}var fg;function cE(){if(fg)return Ko;fg=1;var e=qn(),t=zp(),n=pn(),r=Yt(),l=nt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){const[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),k=l.useCallback(G=>{if(M&&r.$isNodeSelection(r.$getSelection())){G.preventDefault();const I=r.$getNodeByKey(S);E(I)&&I.remove()}return!1},[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{const I=w.getElementByKey(S);return G.target===I?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,k,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,k,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,k,m]),l.useEffect(()=>{const G=w.getElementByKey(S);G!==null&&(G.className=M?"selected":"")},[w,M,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(w){return T()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
|
|
97
|
+
`?X.push(n.$createLineBreakNode()):A===" "?X.push(n.$createTabNode()):0<A.length&&X.push(H(A,U))}}else({content:R}=fe),typeof R=="string"?X.push(...Ee([R],fe.type)):Array.isArray(R)&&X.push(...Ee(R,fe.type));return X}function de(R,U){if(R=n.$getNodeByKey(R),p(R)&&R.isAttached()){var X=n.$getSelection();if(n.$isRangeSelection(X)){X=X.anchor;var fe=X.offset,_e=X.type==="element"&&n.$isLineBreakNode(R.getChildAtIndex(X.offset-1)),B=0;if(!_e){let A=X.getNode();B=fe+A.getPreviousSiblings().reduce((F,se)=>F+se.getTextContentSize(),0)}U()&&(_e?X.getNode().select(fe,fe):R.getChildren().some(A=>{let F=n.$isTextNode(A);if(F||n.$isLineBreakNode(A)){let se=A.getTextContentSize();if(F&&se>=B)return A.select(B,B),!0;B-=se}return!1}))}else U()}}function K(R,U){return j(R)&&j(U)&&R.__text===U.__text&&R.__highlightType===U.__highlightType||n.$isTabNode(R)&&n.$isTabNode(U)||n.$isLineBreakNode(R)&&n.$isLineBreakNode(U)}function O(R){if(!n.$isRangeSelection(R))return!1;var U=R.anchor.getNode();return R=R.focus.getNode(),U.is(R)&&p(U)?!0:(U=U.getParent(),p(U)&&U.is(R.getParent()))}function Z(R){R=R.getNodes();let U=[[]];if(R.length===1&&p(R[0]))return U;let X=U[0];for(let fe=0;fe<R.length;fe++){let _e=R[fe];if(!(j(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(_e)?fe!==0&&0<X.length&&(X=[],U.push(X)):X.push(_e)}return U}function oe(R){var U=n.$getSelection();if(!n.$isRangeSelection(U)||!O(U))return null;let X=R?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(R=R?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<Z(U).length)return X;var fe=U.getNodes()[0];if(!(p(fe)||j(fe)||n.$isTabNode(fe)||n.$isLineBreakNode(fe)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(p(fe))return X;let _e=re(fe);fe=te(fe);var B=U.anchor;let A=U.focus;return A.isBefore(B)?U=A:(U=B,B=A),_e!==null&&fe!==null&&U.key===_e.getKey()&&U.offset===0&&B.key===fe.getKey()&&B.offset===fe.getTextContentSize()?X:R}function Y(R){var U=n.$getSelection();if(!n.$isRangeSelection(U)||!O(U))return!1;var X=Z(U);let fe=X.length;if(1<X.length){for(U=0;U<fe;U++){var _e=X[U];0<_e.length&&(_e=_e[0],U===0&&(_e=re(_e)),_e!==null&&(R===n.INDENT_CONTENT_COMMAND?_e.insertBefore(n.$createTabNode()):n.$isTabNode(_e)&&_e.remove()))}return!0}if(X=U.getNodes()[0],!(p(X)||j(X)||n.$isTabNode(X)||n.$isLineBreakNode(X)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(p(X))return R===n.INDENT_CONTENT_COMMAND&&U.insertNodes([n.$createTabNode()]),!0;if(X=re(X),X===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return R===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(X)?X.insertAfter(n.$createTabNode()):X.insertBefore(n.$createTabNode()):n.$isTabNode(X)&&X.remove(),!0}function W(R,U){let X=n.$getSelection();if(!n.$isRangeSelection(X))return!1;let{anchor:fe,focus:_e}=X,B=fe.offset,A=_e.offset,F=fe.getNode(),se=_e.getNode();var ye=R===n.KEY_ARROW_UP_COMMAND;if(!O(X)||!j(F)&&!n.$isTabNode(F)||!j(se)&&!n.$isTabNode(se))return!1;if(!U.altKey){if(X.isCollapsed()){if(R=F.getParentOrThrow(),ye&&B===0&&F.getPreviousSibling()===null){if(R.getPreviousSibling()===null)return R.selectPrevious(),U.preventDefault(),!0}else if(!ye&&B===F.getTextContentSize()&&F.getNextSibling()===null&&R.getNextSibling()===null)return R.selectNext(),U.preventDefault(),!0}return!1}let De;if(F.isBefore(se)){var ee=re(F);De=te(se)}else ee=re(se),De=te(F);if(ee==null||De==null)return!1;let ne=ee.getNodesBetween(De);for(let be=0;be<ne.length;be++){let Ne=ne[be];if(!j(Ne)&&!n.$isTabNode(Ne)&&!n.$isLineBreakNode(Ne))return!1}if(U.preventDefault(),U.stopPropagation(),U=ye?ee.getPreviousSibling():De.getNextSibling(),!n.$isLineBreakNode(U)||(ee=ye?U.getPreviousSibling():U.getNextSibling(),ee==null))return!0;ye=j(ee)||n.$isTabNode(ee)||n.$isLineBreakNode(ee)?ye?re(ee):te(ee):null;let ue=ye??ee;return U.remove(),ne.forEach(be=>be.remove()),R===n.KEY_ARROW_UP_COMMAND?(ne.forEach(be=>ue.insertBefore(be)),ue.insertBefore(U)):(ue.insertAfter(U),ue=U,ne.forEach(be=>{ue.insertAfter(be),ue=be})),X.setTextNodeRange(F,B,se,A),!0}function J(R,U){let X=n.$getSelection();if(!n.$isRangeSelection(X))return!1;let{anchor:fe,focus:_e}=X;var B=fe.getNode();let A=_e.getNode();if(R=R===n.MOVE_TO_START,!j(B)&&!n.$isTabNode(B)||!j(A)&&!n.$isTabNode(A))return!1;if(R)if(B=V(A,_e.offset),B!==null){let{node:F,offset:se}=B;n.$isLineBreakNode(F)?F.selectNext(0,0):X.setTextNodeRange(F,se,F,se)}else A.getParentOrThrow().selectStart();else z(A).select();return U.preventDefault(),U.stopPropagation(),!0}return $n.$createCodeHighlightNode=H,$n.$createCodeNode=f,$n.$isCodeHighlightNode=j,$n.$isCodeNode=p,$n.CODE_LANGUAGE_FRIENDLY_NAME_MAP=v,$n.CODE_LANGUAGE_MAP=k,$n.CodeHighlightNode=I,$n.CodeNode=d,$n.DEFAULT_CODE_LANGUAGE="javascript",$n.PrismTokenizer=ce,$n.getCodeLanguages=()=>Object.keys(e.languages).filter(R=>typeof e.languages[R]!="function").sort(),$n.getDefaultCodeLanguage=()=>"javascript",$n.getEndOfCodeInLine=z,$n.getFirstCodeNodeOfLine=re,$n.getLanguageFriendlyName=function(R){return R=G(R),v[R]||R},$n.getLastCodeNodeOfLine=te,$n.getStartOfCodeInLine=V,$n.normalizeCodeLang=G,$n.registerCodeHighlighting=function(R,U){if(!R.hasNodes([d,I]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return U==null&&(U=ce),t.mergeRegister(R.registerMutationListener(d,X=>{R.update(()=>{for(let[B,A]of X)if(A!=="destroyed"){var fe=n.$getNodeByKey(B);if(fe!==null)e:{var _e=fe;if(fe=R.getElementByKey(_e.getKey()),fe===null)break e;_e=_e.getChildren();let F=_e.length;if(F===fe.__cachedChildrenLength)break e;fe.__cachedChildrenLength=F;let se="1",ye=1;for(let De=0;De<F;De++)n.$isLineBreakNode(_e[De])&&(se+=`
|
|
98
|
+
`+ ++ye);fe.setAttribute("data-gutter",se)}}})}),R.registerNodeTransform(d,X=>Se(X,R,U)),R.registerNodeTransform(n.TextNode,X=>q(X,R,U)),R.registerNodeTransform(I,X=>q(X,R,U)),R.registerCommand(n.KEY_TAB_COMMAND,X=>{let fe=oe(X.shiftKey);return fe===null?!1:(X.preventDefault(),R.dispatchCommand(fe,void 0),!0)},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INSERT_TAB_COMMAND,()=>{let X=n.$getSelection();return O(X)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_UP_COMMAND,X=>W(n.KEY_ARROW_UP_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_DOWN_COMMAND,X=>W(n.KEY_ARROW_DOWN_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_END,X=>J(n.MOVE_TO_END,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_START,X=>J(n.MOVE_TO_START,X),n.COMMAND_PRIORITY_LOW))},$n}const HC=process.env.NODE_ENV==="development"?FC():BC();var ju=HC,Cd=qn();function WC(){const[e]=Cd.useLexicalComposerContext();return nt.useEffect(()=>ju.registerCodeHighlighting(e),[e]),null}var ig=pn(),Fn=Yt();function KC({src:e,altText:t,width:n,height:r,maxWidth:l}){const d=nt.useMemo(()=>({height:r,width:n,maxWidth:l}),[r,n,l]);return at.jsx("img",{src:e,alt:t,style:d})}function Hp({altText:e,height:t,maxWidth:n=500,src:r,width:l,key:d}){return Fn.$applyNodeReplacement(new sl(r,e,n,l,t,d))}function zC(e){return e instanceof sl}class sl extends Fn.DecoratorNode{constructor(n,r,l,d,f,p){super(p);Ie(this,"__src");Ie(this,"__altText");Ie(this,"__width");Ie(this,"__height");Ie(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=l,this.__width=d||"inherit",this.__height=f||"inherit"}static getType(){return"image"}static clone(n){return new sl(n.__src,n.__altText,n.__maxWidth,n.__width,n.__height,n.__key)}getSrc(){return this.getLatest().__src}getAltText(){return this.getLatest().__altText}exportJSON(){return{altText:this.getAltText(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,src:this.getSrc(),type:"image",version:1,width:this.__width==="inherit"?0:this.__width}}static importJSON(n){return Hp(n)}createDOM(n){const r=document.createElement("span"),l=n.theme.image;return l&&(r.className=l),r}updateDOM(){return!1}decorate(){return at.jsx(KC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const UC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",GC=e=>UC?(e||window).getSelection():null,Wp=Fn.createCommand("INSERT_IMAGE_COMMAND");function YC(){const[e]=Cd.useLexicalComposerContext();return nt.useEffect(()=>{if(!e.hasNodes([sl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ig.mergeRegister(e.registerCommand(Wp,t=>{const n=Hp(t);return Fn.$insertNodes([n]),Fn.$isRootOrShadowRoot(n.getParentOrThrow())&&ig.$wrapNodeInElement(n,Fn.$createParagraphNode).selectEnd(),!0},Fn.COMMAND_PRIORITY_EDITOR),e.registerCommand(Fn.DRAGSTART_COMMAND,t=>jC(t),Fn.COMMAND_PRIORITY_HIGH),e.registerCommand(Fn.DRAGOVER_COMMAND,t=>VC(t),Fn.COMMAND_PRIORITY_LOW),e.registerCommand(Fn.DROP_COMMAND,t=>qC(t,e),Fn.COMMAND_PRIORITY_HIGH))},[e]),null}function jC(e){const t="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=t;const r=Ed();if(!r)return!1;const l=e.dataTransfer;return l?(l.setData("text/plain","_"),l.setDragImage(n,0,0),l.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function VC(e){return Ed()?(Kp(e)||e.preventDefault(),!0):!1}function qC(e,t){const n=Ed();if(!n)return!1;const r=ZC(e);if(!r)return!1;if(e.preventDefault(),Kp(e)){const l=JC(e);n.remove();const d=Fn.$createRangeSelection();l!=null&&d.applyDOMRange(l),Fn.$setSelection(d),t.dispatchCommand(Wp,r)}return!0}function Ed(){const e=Fn.$getSelection();if(!Fn.$isNodeSelection(e))return null;const n=e.getNodes()[0];return zC(n)?n:null}function ZC(e){var l;const t=(l=e.dataTransfer)==null?void 0:l.getData("application/x-lexical-drag");if(!t)return null;const{type:n,data:r}=JSON.parse(t);return n!=="image"?null:r}function Kp(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.yext-default-richtextv2-theme__image")&&t.parentElement)}function JC(e){let t;const n=e.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,l=GC(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&l!==null)l.collapse(e.rangeParent,e.rangeOffset||0),t=l.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var ro=_d();function XC(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>Fn.$isElementNode(n)?n:n.getParentOrThrow()))}const QC=3;function eE(e){const t=Fn.$getSelection();if(!Fn.$isRangeSelection(t))return!1;const n=XC(t);let r=0;for(const l of n)if(ro.$isListNode(l))r=Math.max(ro.$getListDepth(l)+1,r);else if(ro.$isListItemNode(l)){const d=l.getParent();if(!ro.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(ro.$getListDepth(d)+1,r)}return r<=e}function tE({maxDepth:e}){const[t]=Cd.useLexicalComposerContext();return nt.useEffect(()=>t.registerCommand(Fn.INDENT_CONTENT_COMMAND,()=>!eE(e||7),QC),[t,e]),null}var Ou=Nd(),sg=yd(),og=md(),Zl={},lg;function nE(){if(lg)return Zl;lg=1;var e=pn(),t=Yt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(f){return new n(f.__text,f.__key)}constructor(f,p){super(f,p)}createDOM(f){const p=super.createDOM(f);return e.addClassNamesToElement(p,f.theme.hashtag),p}static importJSON(f){const p=r(f.text);return p.setFormat(f.format),p.setDetail(f.detail),p.setMode(f.mode),p.setStyle(f.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function l(d){return d instanceof n}return Zl.$createHashtagNode=r,Zl.$isHashtagNode=l,Zl.HashtagNode=n,Zl}var Jl={},ag;function rE(){if(ag)return Jl;ag=1;var e=pn(),t=Yt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,f){super(d,f)}createDOM(d){let f=super.createDOM(d);return e.addClassNamesToElement(f,d.theme.hashtag),f}static importJSON(d){let f=r(d.text);return f.setFormat(d.format),f.setDetail(d.detail),f.setMode(d.mode),f.setStyle(d.style),f}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(l=""){return t.$applyNodeReplacement(new n(l))}return Jl.$createHashtagNode=r,Jl.$isHashtagNode=function(l){return l instanceof n},Jl.HashtagNode=n,Jl}const iE=process.env.NODE_ENV==="development"?nE():rE();var sE=iE;const ft={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271","yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366","yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},oE={characterLimit:ft["yext-default-richtextv2-theme__characterLimit"],code:ft["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:ft["yext-default-richtextv2-theme__tokenAttr"],attr:ft["yext-default-richtextv2-theme__tokenAttr"],boolean:ft["yext-default-richtextv2-theme__tokenProperty"],builtin:ft["yext-default-richtextv2-theme__tokenSelector"],cdata:ft["yext-default-richtextv2-theme__tokenComment"],char:ft["yext-default-richtextv2-theme__tokenSelector"],class:ft["yext-default-richtextv2-theme__tokenFunction"],"class-name":ft["yext-default-richtextv2-theme__tokenFunction"],comment:ft["yext-default-richtextv2-theme__tokenComment"],constant:ft["yext-default-richtextv2-theme__tokenProperty"],deleted:ft["yext-default-richtextv2-theme__tokenProperty"],doctype:ft["yext-default-richtextv2-theme__tokenComment"],entity:ft["yext-default-richtextv2-theme__tokenOperator"],function:ft["yext-default-richtextv2-theme__tokenFunction"],important:ft["yext-default-richtextv2-theme__tokenVariable"],inserted:ft["yext-default-richtextv2-theme__tokenSelector"],keyword:ft["yext-default-richtextv2-theme__tokenAttr"],namespace:ft["yext-default-richtextv2-theme__tokenVariable"],number:ft["yext-default-richtextv2-theme__tokenProperty"],operator:ft["yext-default-richtextv2-theme__tokenOperator"],prolog:ft["yext-default-richtextv2-theme__tokenComment"],property:ft["yext-default-richtextv2-theme__tokenProperty"],punctuation:ft["yext-default-richtextv2-theme__tokenPunctuation"],regex:ft["yext-default-richtextv2-theme__tokenVariable"],selector:ft["yext-default-richtextv2-theme__tokenSelector"],string:ft["yext-default-richtextv2-theme__tokenSelector"],symbol:ft["yext-default-richtextv2-theme__tokenProperty"],tag:ft["yext-default-richtextv2-theme__tokenProperty"],url:ft["yext-default-richtextv2-theme__tokenOperator"],variable:ft["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:ft["yext-default-richtextv2-theme__embedBlock"],focus:ft["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:ft["yext-default-richtextv2-theme__hashtag"],heading:{h1:ft["yext-default-richtextv2-theme__h1"],h2:ft["yext-default-richtextv2-theme__h2"],h3:ft["yext-default-richtextv2-theme__h3"],h4:ft["yext-default-richtextv2-theme__h4"],h5:ft["yext-default-richtextv2-theme__h5"],h6:ft["yext-default-richtextv2-theme__h6"]},image:ft["yext-default-richtextv2-theme__image"],link:ft["yext-default-richtextv2-theme__link"],list:{listitem:ft["yext-default-richtextv2-theme__listItem"],listitemChecked:ft["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:ft["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:ft["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[ft["yext-default-richtextv2-theme__ol1"],ft["yext-default-richtextv2-theme__ol2"],ft["yext-default-richtextv2-theme__ol3"],ft["yext-default-richtextv2-theme__ol4"],ft["yext-default-richtextv2-theme__ol5"]],ulDepth:[ft["yext-default-richtextv2-theme__ul1"],ft["yext-default-richtextv2-theme__ul2"],ft["yext-default-richtextv2-theme__ul3"]]},ltr:ft["yext-default-richtextv2-theme__ltr"],mark:ft["yext-default-richtextv2-theme__mark"],markOverlap:ft["yext-default-richtextv2-theme__markOverlap"],paragraph:ft["yext-default-richtextv2-theme__paragraph"],quote:ft["yext-default-richtextv2-theme__quote"],rtl:ft["yext-default-richtextv2-theme__rtl"],table:ft["yext-default-richtextv2-theme__table"],tableCell:ft["yext-default-richtextv2-theme__tableCell"],tableCellHeader:ft["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:ft["yext-default-richtextv2-theme__textBold"],code:ft["yext-default-richtextv2-theme__textCode"],italic:ft["yext-default-richtextv2-theme__textItalic"],strikethrough:ft["yext-default-richtextv2-theme__textStrikethrough"],subscript:ft["yext-default-richtextv2-theme__textSubscript"],superscript:ft["yext-default-richtextv2-theme__textSuperscript"],underline:ft["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:ft["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Ko={},Du={},cg;function lE(){if(cg)return Du;cg=1;var e=qn(),t=Yt(),n=nt;function r(d,f){return d.getEditorState().read(()=>{const p=t.$getNodeByKey(f);return p===null?!1:p.isSelected()})}function l(d){const[f]=e.useLexicalComposerContext(),[p,_]=n.useState(()=>r(f,d));n.useEffect(()=>{let S=!0;const w=f.registerUpdateListener(()=>{S&&_(r(f,d))});return()=>{S=!1,w()}},[f,d]);const T=n.useCallback(S=>{f.update(()=>{let w=t.$getSelection();t.$isNodeSelection(w)||(w=t.$createNodeSelection(),t.$setSelection(w)),t.$isNodeSelection(w)&&(S?w.add(d):w.delete(d))})},[f,d]),E=n.useCallback(()=>{f.update(()=>{const S=t.$getSelection();t.$isNodeSelection(S)&&S.clear()})},[f]);return[p,T,E]}return Du.useLexicalNodeSelection=l,Du}var Au={},ug;function aE(){if(ug)return Au;ug=1;var e=qn(),t=Yt(),n=nt;function r(l,d){return l.getEditorState().read(()=>{let f=t.$getNodeByKey(d);return f===null?!1:f.isSelected()})}return Au.useLexicalNodeSelection=function(l){let[d]=e.useLexicalComposerContext(),[f,p]=n.useState(()=>r(d,l));n.useEffect(()=>{let E=!0,S=d.registerUpdateListener(()=>{E&&p(r(d,l))});return()=>{E=!1,S()}},[d,l]);let _=n.useCallback(E=>{d.update(()=>{let S=t.$getSelection();t.$isNodeSelection(S)||(S=t.$createNodeSelection(),t.$setSelection(S)),t.$isNodeSelection(S)&&(E?S.add(l):S.delete(l))})},[d,l]),T=n.useCallback(()=>{d.update(()=>{const E=t.$getSelection();t.$isNodeSelection(E)&&E.clear()})},[d]);return[f,_,T]},Au}var Mu,dg;function zp(){return dg||(dg=1,Mu=process.env.NODE_ENV==="development"?lE():aE()),Mu}var fg;function cE(){if(fg)return Ko;fg=1;var e=qn(),t=zp(),n=pn(),r=Yt(),l=nt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){const[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),k=l.useCallback(G=>{if(M&&r.$isNodeSelection(r.$getSelection())){G.preventDefault();const I=r.$getNodeByKey(S);E(I)&&I.remove()}return!1},[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{const I=w.getElementByKey(S);return G.target===I?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,k,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,k,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,k,m]),l.useEffect(()=>{const G=w.getElementByKey(S);G!==null&&(G.className=M?"selected":"")},[w,M,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(w){return T()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
|
|
99
99
|
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:T()}}function T(){return r.$applyNodeReplacement(new p)}function E(S){return S instanceof p}return Ko.$createHorizontalRuleNode=T,Ko.$isHorizontalRuleNode=E,Ko.HorizontalRuleNode=p,Ko.INSERT_HORIZONTAL_RULE_COMMAND=d,Ko}var zo={},hg;function uE(){if(hg)return zo;hg=1;var e=qn(),t=zp(),n=pn(),r=Yt(),l=nt;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){let[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),k=l.useCallback(G=>(M&&r.$isNodeSelection(r.$getSelection())&&(G.preventDefault(),G=r.$getNodeByKey(S),E(G)&&G.remove()),!1),[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{let I=w.getElementByKey(S);return G.target===I?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,k,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,k,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,k,m]),l.useEffect(()=>{let G=w.getElementByKey(S);G!==null&&(G.className=M?"selected":"")},[w,M,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(){return T()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
|
|
100
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:T()}}function T(){return r.$applyNodeReplacement(new p)}function E(S){return S instanceof p}return zo.$createHorizontalRuleNode=T,zo.$isHorizontalRuleNode=E,zo.HorizontalRuleNode=p,zo.INSERT_HORIZONTAL_RULE_COMMAND=d,zo}const dE=process.env.NODE_ENV==="development"?cE():uE();var fE=dE;function hE(e,t){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:e,theme:t??oE,nodes:[og.HeadingNode,sE.HashtagNode,sl,ro.ListNode,ro.ListItemNode,og.QuoteNode,
|
|
100
|
+
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:T()}}function T(){return r.$applyNodeReplacement(new p)}function E(S){return S instanceof p}return zo.$createHorizontalRuleNode=T,zo.$isHorizontalRuleNode=E,zo.HorizontalRuleNode=p,zo.INSERT_HORIZONTAL_RULE_COMMAND=d,zo}const dE=process.env.NODE_ENV==="development"?cE():uE();var fE=dE;function hE(e,t){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:e,theme:t??oE,nodes:[og.HeadingNode,sE.HashtagNode,sl,ro.ListNode,ro.ListItemNode,og.QuoteNode,ju.CodeNode,ju.CodeHighlightNode,Ou.TableNode,Ou.TableCellNode,Ou.TableRowNode,sg.AutoLinkNode,sg.LinkNode,fE.HorizontalRuleNode]}}const Ru={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function gE({serializedAST:e,nodeClassNames:t}){return at.jsx(UN.LexicalComposer,{initialConfig:hE(e,t),children:at.jsx("div",{className:`${Ru["editor-inner"]} ${Ru["no-border"]}`,children:at.jsxs("div",{className:Ru["editor-inner"],children:[at.jsx(uC.RichTextPlugin,{contentEditable:at.jsx(gC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:NC,placeholder:at.jsx("div",{})}),at.jsx(WC,{}),at.jsx(SC.ListPlugin,{}),at.jsx(RC.LinkPlugin,{}),at.jsx($C.TablePlugin,{}),at.jsx(YC,{}),at.jsx(tE,{maxDepth:7})]})})})}function yc(e,t,n,r){const l=e.length;let d=0,f;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,r.length<1e4)f=Array.from(r),f.unshift(t,n),[].splice.apply(e,f);else for(n&&[].splice.apply(e,[t,n]);d<r.length;)f=r.slice(d,d+1e4),f.unshift(t,0),[].splice.apply(e,f),d+=1e4,t+=1e4}function jo(e,t){return e.length>0?(yc(e,e.length,0,t),e):t}const gg={}.hasOwnProperty;function Up(e){const t={};let n=-1;for(;++n<e.length;)pE(t,e[n]);return t}function pE(e,t){let n;for(n in t){const l=(gg.call(e,n)?e[n]:void 0)||(e[n]={}),d=t[n];let f;for(f in d){gg.call(l,f)||(l[f]=[]);const p=d[f];mE(l[f],Array.isArray(p)?p:p?[p]:[])}}}function mE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yc(e,0,0,r)}const es={plusSign:43,caret:94,tilde:126};var pg=Object.prototype.hasOwnProperty;function mg(e,t,n){for(n of e.keys())if(ia(n,t))return n}function ia(e,t){var n,r,l;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ia(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(l=r,l&&typeof l=="object"&&(l=mg(t,l),!l)||!t.has(l))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(l=r[0],l&&typeof l=="object"&&(l=mg(t,l),!l)||!ia(r[1],t.get(l)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(pg.call(e,n)&&++r&&!pg.call(t,n)||!(n in t)||!ia(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}let Vu,Gp,Yp,jp,Vp=!0;typeof process<"u"&&({FORCE_COLOR:Vu,NODE_DISABLE_COLORS:Gp,NO_COLOR:Yp,TERM:jp}=process.env||{},Vp=process.stdout&&process.stdout.isTTY);const Xt={enabled:!Gp&&Yp==null&&jp!=="dumb"&&(Vu!=null&&Vu!=="0"||Vp),reset:yn(0,0),bold:yn(1,22),dim:yn(2,22),italic:yn(3,23),underline:yn(4,24),inverse:yn(7,27),hidden:yn(8,28),strikethrough:yn(9,29),black:yn(30,39),red:yn(31,39),green:yn(32,39),yellow:yn(33,39),blue:yn(34,39),magenta:yn(35,39),cyan:yn(36,39),white:yn(37,39),gray:yn(90,39),grey:yn(90,39),bgBlack:yn(40,49),bgRed:yn(41,49),bgGreen:yn(42,49),bgYellow:yn(43,49),bgBlue:yn(44,49),bgMagenta:yn(45,49),bgCyan:yn(46,49),bgWhite:yn(47,49)};function _g(e,t){let n=0,r,l="",d="";for(;n<e.length;n++)r=e[n],l+=r.open,d+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return l+t+d}function _E(e,t){let n={has:e,keys:t};return n.reset=Xt.reset.bind(n),n.bold=Xt.bold.bind(n),n.dim=Xt.dim.bind(n),n.italic=Xt.italic.bind(n),n.underline=Xt.underline.bind(n),n.inverse=Xt.inverse.bind(n),n.hidden=Xt.hidden.bind(n),n.strikethrough=Xt.strikethrough.bind(n),n.black=Xt.black.bind(n),n.red=Xt.red.bind(n),n.green=Xt.green.bind(n),n.yellow=Xt.yellow.bind(n),n.blue=Xt.blue.bind(n),n.magenta=Xt.magenta.bind(n),n.cyan=Xt.cyan.bind(n),n.white=Xt.white.bind(n),n.gray=Xt.gray.bind(n),n.grey=Xt.grey.bind(n),n.bgBlack=Xt.bgBlack.bind(n),n.bgRed=Xt.bgRed.bind(n),n.bgGreen=Xt.bgGreen.bind(n),n.bgYellow=Xt.bgYellow.bind(n),n.bgBlue=Xt.bgBlue.bind(n),n.bgMagenta=Xt.bgMagenta.bind(n),n.bgCyan=Xt.bgCyan.bind(n),n.bgWhite=Xt.bgWhite.bind(n),n}function yn(e,t){let n={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),r===void 0?this:Xt.enabled?_g(this.keys,r+""):r+""):r===void 0?_E([e],[n]):Xt.enabled?_g([n],r+""):r+""}}function Ss(){}Ss.prototype={diff:function(t,n){var r,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=l.callback;typeof l=="function"&&(d=l,l={}),this.options=l;var f=this;function p(H){return d?(setTimeout(function(){d(void 0,H)},0),!0):H}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var _=n.length,T=t.length,E=1,S=_+T;l.maxEditLength&&(S=Math.min(S,l.maxEditLength));var w=(r=l.timeout)!==null&&r!==void 0?r:1/0,M=Date.now()+w,m=[{oldPos:-1,lastComponent:void 0}],v=this.extractCommon(m[0],n,t,0);if(m[0].oldPos+1>=T&&v+1>=_)return p([{value:this.join(n),count:n.length}]);var k=-1/0,G=1/0;function I(){for(var H=Math.max(k,-E);H<=Math.min(G,E);H+=2){var j=void 0,re=m[H-1],te=m[H+1];re&&(m[H-1]=void 0);var ce=!1;if(te){var V=te.oldPos-H;ce=te&&0<=V&&V<_}var z=re&&re.oldPos+1<T;if(!ce&&!z){m[H]=void 0;continue}if(!z||ce&&re.oldPos+1<te.oldPos?j=f.addToPath(te,!0,void 0,0):j=f.addToPath(re,void 0,!0,1),v=f.extractCommon(j,n,t,H),j.oldPos+1>=T&&v+1>=_)return p(yE(f,j.lastComponent,n,t,f.useLongestToken));m[H]=j,j.oldPos+1>=T&&(G=Math.min(G,H-1)),v+1>=_&&(k=Math.max(k,H+1))}E++}if(d)(function H(){setTimeout(function(){if(E>S||Date.now()>M)return d();I()||H()},0)})();else for(;E<=S&&Date.now()<=M;){var P=I();if(P)return P}},addToPath:function(t,n,r,l){var d=t.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:t.oldPos+l,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:t.oldPos+l,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(t,n,r,l){for(var d=n.length,f=r.length,p=t.oldPos,_=p-l,T=0;_+1<d&&p+1<f&&this.equals(n[_+1],r[p+1]);)_++,p++,T++;return T&&(t.lastComponent={count:T,previousComponent:t.lastComponent}),t.oldPos=p,_},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function yE(e,t,n,r,l){for(var d=[],f;t;)d.push(t),f=t.previousComponent,delete t.previousComponent,t=f;d.reverse();for(var p=0,_=d.length,T=0,E=0;p<_;p++){var S=d[p];if(S.removed){if(S.value=e.join(r.slice(E,E+S.count)),E+=S.count,p&&d[p-1].added){var M=d[p-1];d[p-1]=d[p],d[p]=M}}else{if(!S.added&&l){var w=n.slice(T,T+S.count);w=w.map(function(v,k){var G=r[E+k];return G.length>v.length?G:v}),S.value=e.join(w)}else S.value=e.join(n.slice(T,T+S.count));T+=S.count,S.added||(E+=S.count)}}var m=d[_-1];return _>1&&typeof m.value=="string"&&(m.added||m.removed)&&e.equals("",m.value)&&(d[_-2].value+=m.value,d.pop()),d}var yg=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Ng=/\S/,qp=new Ss;qp.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Ng.test(e)&&!Ng.test(t)};qp.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&yg.test(t[n])&&yg.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Zp=new Ss;Zp.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
101
101
|
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var l=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),t.push(l))}return t};var NE=new Ss;NE.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var CE=new Ss;CE.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ic(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ic=function(t){return typeof t}:ic=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ic(e)}var EE=Object.prototype.toString,oa=new Ss;oa.useLongestToken=!0;oa.tokenize=Zp.tokenize;oa.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,l=r===void 0?function(d,f){return typeof f>"u"?n:f}:r;return typeof e=="string"?e:JSON.stringify(qu(e,null,null,l),l," ")};oa.equals=function(e,t){return Ss.prototype.equals.call(oa,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function qu(e,t,n,r,l){t=t||[],n=n||[],r&&(e=r(l,e));var d;for(d=0;d<t.length;d+=1)if(t[d]===e)return n[d];var f;if(EE.call(e)==="[object Array]"){for(t.push(e),f=new Array(e.length),n.push(f),d=0;d<e.length;d+=1)f[d]=qu(e[d],t,n,r,l);return t.pop(),n.pop(),f}if(e&&e.toJSON&&(e=e.toJSON()),ic(e)==="object"&&e!==null){t.push(e),f={},n.push(f);var p=[],_;for(_ in e)e.hasOwnProperty(_)&&p.push(_);for(p.sort(),d=0;d<p.length;d+=1)_=p[d],f[_]=qu(e[_],t,n,r,_);t.pop(),n.pop()}else f=e;return f}var Zu=new Ss;Zu.tokenize=function(e){return e.slice()};Zu.join=Zu.removeEmpty=function(e){return e};Xt.red,Xt.grey,Xt.green;Xt.dim().italic;Xt.dim("→");Xt.dim("·");Xt.dim("↵");function uc(e){e=e.replace(/\r?\n/g,`
|
|
102
|
-
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,l=(t||[]).length;for(;n<l;n++)r=Math.min(r,t[n].length);return l&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class TE extends Error{constructor(t={}){super(t.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=t.details||!1,this.generated=!!t.generated,this.operator=t.operator,this.expects=t.expects,this.actual=t.actual}}function ni(e,t,n,r,l,d,f){if(e)return;let p=f||d;if(f instanceof Error)throw f;let _=l;throw new TE({actual:t,expects:n,operator:r,message:p,details:_,generated:!f})}function Nc(e,t){ni(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}function ts(e,t){ni(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}ts.ok=ts;ts.equal=function(e,t,n){ni(!ia(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};ts.type=function(e,t,n){let r=typeof e;ni(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};ts.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";ni(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};ts.snapshot=function(e,t,n){e=uc(e),t=uc(t),ni(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};ts.fixture=function(e,t,n){e=uc(e),t=uc(t),ni(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};ts.match=function(e,t,n){typeof t=="string"?ni(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):ni(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};ts.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?ni(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?ni(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||ni(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const xE=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,vE=ws(/[A-Za-z]/),Ju=ws(/[\dA-Za-z]/),SE=ws(/[#-'*+\--9=?A-Z^-~]/);function wE(e){return e!==null&&(e<32||e===127)}const OE=ws(/\d/),DE=ws(/[\dA-Fa-f]/),AE=ws(/[!-/:-@[-`{-~]/);function ME(e){return e!==null&&e<-2}function Jp(e){return e!==null&&(e<0||e===32)}function RE(e){return e===-2||e===-1||e===32}const bE=ws(xE),LE=ws(/\s/);function ws(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function la(e){if(e===null||Jp(e)||LE(e))return 1;if(bE(e))return 2}const dc={characterGroupPunctuation:2};function IE(e,t){const n=this.previous,r=la(n);return l;function l(f){return Nc(f===es.tilde,"expected `~`"),e.enter("tildeSequenceTemporary"),d(f)}function d(f){if(f===es.tilde)return e.consume(f),d;const p=e.exit("tildeSequenceTemporary"),_=la(f);return p._open=!_||_===dc.characterGroupPunctuation&&!!r,p._close=!r||r===dc.characterGroupPunctuation&&!!_,t(f)}}function Xp(e,t,n){const r=[];let l=-1;for(;++l<e.length;){const d=e[l].resolveAll;d&&!r.includes(d)&&(t=d(t,n),r.push(d))}return t}const kE={data:"data"};function Td(e,t){return!!(e[0]==="enter"&&e[1].type===`${t}SequenceTemporary`&&e[1]._close)}function xd(e,t){return!!(e[0]==="exit"&&e[1].type===`${t}SequenceTemporary`&&e[1]._open)}function vd(e,t,n,r,l,d){const[f,p,_,T]=PE(e[t],e[n],l,d);e[t][1].end=Object.assign({},f.start),e[n][1].start=Object.assign({},p.end);let E=[];e[t][1].end.offset-e[t][1].start.offset&&(E=
|
|
102
|
+
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,l=(t||[]).length;for(;n<l;n++)r=Math.min(r,t[n].length);return l&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class TE extends Error{constructor(t={}){super(t.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=t.details||!1,this.generated=!!t.generated,this.operator=t.operator,this.expects=t.expects,this.actual=t.actual}}function ni(e,t,n,r,l,d,f){if(e)return;let p=f||d;if(f instanceof Error)throw f;let _=l;throw new TE({actual:t,expects:n,operator:r,message:p,details:_,generated:!f})}function Nc(e,t){ni(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}function ts(e,t){ni(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}ts.ok=ts;ts.equal=function(e,t,n){ni(!ia(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};ts.type=function(e,t,n){let r=typeof e;ni(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};ts.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";ni(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};ts.snapshot=function(e,t,n){e=uc(e),t=uc(t),ni(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};ts.fixture=function(e,t,n){e=uc(e),t=uc(t),ni(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};ts.match=function(e,t,n){typeof t=="string"?ni(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):ni(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};ts.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?ni(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?ni(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||ni(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const xE=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,vE=ws(/[A-Za-z]/),Ju=ws(/[\dA-Za-z]/),SE=ws(/[#-'*+\--9=?A-Z^-~]/);function wE(e){return e!==null&&(e<32||e===127)}const OE=ws(/\d/),DE=ws(/[\dA-Fa-f]/),AE=ws(/[!-/:-@[-`{-~]/);function ME(e){return e!==null&&e<-2}function Jp(e){return e!==null&&(e<0||e===32)}function RE(e){return e===-2||e===-1||e===32}const bE=ws(xE),LE=ws(/\s/);function ws(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function la(e){if(e===null||Jp(e)||LE(e))return 1;if(bE(e))return 2}const dc={characterGroupPunctuation:2};function IE(e,t){const n=this.previous,r=la(n);return l;function l(f){return Nc(f===es.tilde,"expected `~`"),e.enter("tildeSequenceTemporary"),d(f)}function d(f){if(f===es.tilde)return e.consume(f),d;const p=e.exit("tildeSequenceTemporary"),_=la(f);return p._open=!_||_===dc.characterGroupPunctuation&&!!r,p._close=!r||r===dc.characterGroupPunctuation&&!!_,t(f)}}function Xp(e,t,n){const r=[];let l=-1;for(;++l<e.length;){const d=e[l].resolveAll;d&&!r.includes(d)&&(t=d(t,n),r.push(d))}return t}const kE={data:"data"};function Td(e,t){return!!(e[0]==="enter"&&e[1].type===`${t}SequenceTemporary`&&e[1]._close)}function xd(e,t){return!!(e[0]==="exit"&&e[1].type===`${t}SequenceTemporary`&&e[1]._open)}function vd(e,t,n,r,l,d){const[f,p,_,T]=PE(e[t],e[n],l,d);e[t][1].end=Object.assign({},f.start),e[n][1].start=Object.assign({},p.end);let E=[];e[t][1].end.offset-e[t][1].start.offset&&(E=jo(E,[["enter",e[t][1],r],["exit",e[t][1],r]])),E=jo(E,[["enter",T,r],["enter",f,r],["exit",f,r],["enter",_,r]]),E=jo(E,Xp(r.parser.constructs.insideSpan.null,e.slice(t+1,n),r)),E=jo(E,[["exit",_,r],["enter",p,r],["exit",p,r],["exit",T,r]]);let S=0;return e[n][1].end.offset-e[n][1].start.offset&&(S=2,E=jo(E,[["enter",e[n][1],r],["exit",e[n][1],r]])),yc(e,t-1,n-t+3,E),t+E.length-S-2}function PE(e,t,n,r){const l=Object.assign({},e[1].end),d=Object.assign({},t[1].start);Cg(l,-r),Cg(d,r);const f={type:`${n}Sequence`,start:l,end:Object.assign({},e[1].end)},p={type:`${n}Sequence`,start:Object.assign({},t[1].start),end:d},_={type:`${n}Text`,start:Object.assign({},e[1].end),end:Object.assign({},t[1].start)},T={type:`${n}`,start:Object.assign({},f.start),end:Object.assign({},p.end)};return[f,p,_,T]}function Cg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Sd(e,t){e.forEach(n=>{n[1].type===`${t}SequenceTemporary`&&(n[1].type=kE.data)})}function $E(e,t){let n=-1;for(;++n<e.length;)if(Td(e[n],"tilde")){let r=n;for(;r--;)if(xd(e[r],"tilde")){const l=FE(e[r],e[n]);n=vd(e,r,n,t,l===1?"subscript":"strikethrough",l);break}}return Sd(e,"tilde"),e}function FE(e,t){const n=e[1].end.offset-e[1].start.offset,r=t[1].end.offset-t[1].start.offset;return n<3||r<3?r<n?r:n:r%2===0?2:1}function BE(){const e={tokenize:IE,resolveAll:$E};return{text:{[es.tilde]:e},insideSpan:{null:[e]}}}function HE(e,t){let n=-1;for(;++n<e.length;)if(Td(e[n],"superscript")){let r=n;for(;r--;)if(xd(e[r],"superscript")){n=vd(e,r,n,t,"superscript",1);break}}return Sd(e,"superscript"),e}function WE(e,t){return n;function n(l){return Nc(l===es.caret,"expected `^`"),e.enter("superscriptSequenceTemporary"),r(l)}function r(l){if(l===es.caret)return e.consume(l),r;const d=e.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,t(l)}}function KE(){const e={tokenize:WE,resolveAll:HE};return{text:{[es.caret]:e},insideSpan:{null:[e]}}}function zE(e,t,n){const r=this.previous,l=la(r);let d=0;return f;function f(_){return Nc(_===es.plusSign,"expected `+`"),e.enter("underlineSequenceTemporary"),p(_)}function p(_){if(_===es.plusSign)return e.consume(_),d++,p;if(d<2)return n(_);const T=e.exit("underlineSequenceTemporary"),E=la(_);return T._open=!E||E===dc.characterGroupPunctuation&&!!l,T._close=!l||l===dc.characterGroupPunctuation&&!!E,t(_)}}function UE(e,t){let n=-1;for(;++n<e.length;)if(Td(e[n],"underline")&&e[n][1].end.offset-e[n][1].start.offset>1){let r=n;for(;r--;)if(xd(e[r],"underline")&&e[r][1].end.offset-e[r][1].start.offset>1){n=vd(e,r,n,t,"underline",2);break}}return Sd(e,"underline"),e}function GE(){const e={tokenize:zE,resolveAll:UE};return{text:{[es.plusSign]:e},insideSpan:{null:[e]}}}function YE(){return Up([GE(),KE(),BE()])}const jE={canContainEols:["strikethrough"],enter:{strikethrough:VE},exit:{strikethrough:qE}};function VE(e){this.enter({type:"strikethrough",children:[]},e)}function qE(e){this.exit(e)}const ZE={canContainEols:["subscript"],enter:{subscript:JE},exit:{subscript:XE}};function JE(e){this.enter({type:"subscript",children:[]},e)}function XE(e){this.exit(e)}const QE={canContainEols:["superscript"],enter:{superscript:eT},exit:{superscript:tT}};function eT(e){this.enter({type:"superscript",children:[]},e)}function tT(e){this.exit(e)}const nT={canContainEols:["underline"],enter:{underline:rT},exit:{underline:iT}};function rT(e){this.enter({type:"underline",children:[]},e)}function iT(e){this.exit(e)}function sT(){return[nT,jE,ZE,QE]}function oT(){const e=this.data();t("micromarkExtensions",YE()),t("fromMarkdownExtensions",sT());function t(n,r){const l=e[n];l?(Nc(Array.isArray(l)),l.push(r)):e[n]=[r]}}function lT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function aT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
103
103
|
`}]}function cT(e,t){const n=t.value?t.value+`
|
|
104
104
|
`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,l={};r&&(l.className=["language-"+r]);let d={type:"element",tagName:"code",properties:l,children:[{type:"text",value:n}]};return t.meta&&(d.data={meta:t.meta}),e.patch(t,d),d=e.applyData(t,d),d={type:"element",tagName:"pre",properties:{},children:[d]},e.patch(t,d),d}function uT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ol(e){const t=[];let n=-1,r=0,l=0;for(;++n<e.length;){const d=e.charCodeAt(n);let f="";if(d===37&&Ju(e.charCodeAt(n+1))&&Ju(e.charCodeAt(n+2)))l=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(f=String.fromCharCode(d));else if(d>55295&&d<57344){const p=e.charCodeAt(n+1);d<56320&&p>56319&&p<57344?(f=String.fromCharCode(d,p),l=1):f="�"}else f=String.fromCharCode(d);f&&(t.push(e.slice(r,n),encodeURIComponent(f)),r=n+l+1,f=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function Qp(e,t){const n=String(t.identifier).toUpperCase(),r=ol(n.toLowerCase()),l=e.footnoteOrder.indexOf(n);let d;l===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,d=e.footnoteOrder.length):(e.footnoteCounts[n]++,d=l+1);const f=e.footnoteCounts[n],p={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,p);const _={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,_),e.applyData(t,_)}function fT(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const l=String(r);return n[l]={type:"footnoteDefinition",identifier:l,children:[{type:"paragraph",children:t.children}],position:t.position},Qp(e,{type:"footnoteReference",identifier:l,position:t.position})}function hT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gT(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function em(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const l=e.all(t),d=l[0];d&&d.type==="text"?d.value="["+d.value:l.unshift({type:"text",value:"["});const f=l[l.length-1];return f&&f.type==="text"?f.value+=r:l.push({type:"text",value:r}),l}function pT(e,t){const n=e.definition(t.identifier);if(!n)return em(e,t);const r={src:ol(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,l),e.applyData(t,l)}function mT(e,t){const n={src:ol(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function _T(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function yT(e,t){const n=e.definition(t.identifier);if(!n)return em(e,t);const r={href:ol(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function NT(e,t){const n={href:ol(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function CT(e,t,n){const r=e.all(t),l=n?ET(n):tm(t),d={},f=[];if(typeof t.checked=="boolean"){const E=r[0];let S;E&&E.type==="element"&&E.tagName==="p"?S=E:(S={type:"element",tagName:"p",properties:{},children:[]},r.unshift(S)),S.children.length>0&&S.children.unshift({type:"text",value:" "}),S.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const E=r[p];(l||p!==0||E.type!=="element"||E.tagName!=="p")&&f.push({type:"text",value:`
|
|
105
105
|
`}),E.type==="element"&&E.tagName==="p"&&!l?f.push(...E.children):f.push(E)}const _=r[r.length-1];_&&(l||_.type!=="element"||_.tagName!=="p")&&f.push({type:"text",value:`
|
|
106
|
-
`});const T={type:"element",tagName:"li",properties:d,children:f};return e.patch(t,T),e.applyData(t,T)}function ET(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=tm(n[r])}return t}function tm(e){const t=e.spread;return t??e.children.length>1}function TT(e,t){const n={},r=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<r.length;){const f=r[l];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const d={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,d),e.applyData(t,d)}function xT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ST(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const wd=nm("start"),Od=nm("end");function wT(e){return{start:wd(e),end:Od(e)}}function nm(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function OT(e,t){const n=e.all(t),r=n.shift(),l=[];if(r){const f={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],f),l.push(f)}if(n.length>0){const f={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},p=wd(t.children[1]),_=Od(t.children[t.children.length-1]);p.line&&_.line&&(f.position={start:p,end:_}),l.push(f)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,d),e.applyData(t,d)}function DT(e,t,n){const r=n?n.children:void 0,d=(r?r.indexOf(t):1)===0?"th":"td",f=n&&n.type==="table"?n.align:void 0,p=f?f.length:t.children.length;let _=-1;const T=[];for(;++_<p;){const S=t.children[_],w={},M=f?f[_]:void 0;M&&(w.align=M);let m={type:"element",tagName:d,properties:w,children:[]};S&&(m.children=e.all(S),e.patch(S,m),m=e.applyData(t,m)),T.push(m)}const E={type:"element",tagName:"tr",properties:{},children:e.wrap(T,!0)};return e.patch(t,E),e.applyData(t,E)}function AT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Eg=9,Tg=32;function MT(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),l=0;const d=[];for(;r;)d.push(xg(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return d.push(xg(t.slice(l),l>0,!1)),d.join("")}function xg(e,t,n){let r=0,l=e.length;if(t){let d=e.codePointAt(r);for(;d===Eg||d===Tg;)r++,d=e.codePointAt(r)}if(n){let d=e.codePointAt(l-1);for(;d===Eg||d===Tg;)l--,d=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}function RT(e,t){const n={type:"text",value:MT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function bT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const LT={blockquote:lT,break:aT,code:cT,delete:uT,emphasis:dT,footnoteReference:Qp,footnote:fT,heading:hT,html:gT,imageReference:pT,image:mT,inlineCode:_T,linkReference:yT,link:NT,listItem:CT,list:TT,paragraph:xT,root:vT,strong:ST,table:OT,tableCell:AT,tableRow:DT,text:RT,thematicBreak:bT,toml:Ja,yaml:Ja,definition:Ja,footnoteDefinition:Ja};function Ja(){return null}const rm=function(e){if(e==null)return $T;if(typeof e=="string")return PT(e);if(typeof e=="object")return Array.isArray(e)?IT(e):kT(e);if(typeof e=="function")return Cc(e);throw new Error("Expected function, string, or object as test")};function IT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rm(e[n]);return Cc(r);function r(...l){let d=-1;for(;++d<t.length;)if(t[d].call(this,...l))return!0;return!1}}function kT(e){return Cc(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function PT(e){return Cc(t);function t(n){return n&&n.type===e}}function Cc(e){return t;function t(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&e.call(this,n,...r))}}function $T(){return!0}const FT=!0,vg=!1,BT="skip",HT=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const l=rm(t),d=r?-1:1;f(e,void 0,[])();function f(p,_,T){const E=p&&typeof p=="object"?p:{};if(typeof E.type=="string"){const w=typeof E.tagName=="string"?E.tagName:typeof E.name=="string"?E.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(p.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=[],M,m,v;if((!t||l(p,_,T[T.length-1]||null))&&(w=WT(n(p,T)),w[0]===vg))return w;if(p.children&&w[0]!==BT)for(m=(r?p.children.length:-1)+d,v=T.concat(p);m>-1&&m<p.children.length;){if(M=f(p.children[m],m,v)(),M[0]===vg)return M;m=typeof M[1]=="number"?M[1]:m+d}return w}}};function WT(e){return Array.isArray(e)?e:typeof e=="number"?[FT,e]:[e]}const Dd=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),HT(e,t,l,r);function l(d,f){const p=f[f.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function KT(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const Sg={}.hasOwnProperty;function zT(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Dd(e,"definition",r=>{const l=wg(r.identifier);l&&!Sg.call(t,l)&&(t[l]=r)}),n;function n(r){const l=wg(r);return l&&Sg.call(t,l)?t[l]:null}}function wg(e){return String(e||"").toUpperCase()}const fc={}.hasOwnProperty;function UT(e,t){const n=t||{},r=n.allowDangerousHtml||!1,l={};return f.dangerous=r,f.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,f.footnoteLabel=n.footnoteLabel||"Footnotes",f.footnoteLabelTagName=n.footnoteLabelTagName||"h2",f.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},f.footnoteBackLabel=n.footnoteBackLabel||"Back to content",f.unknownHandler=n.unknownHandler,f.passThrough=n.passThrough,f.handlers={...LT,...n.handlers},f.definition=zT(e),f.footnoteById=l,f.footnoteOrder=[],f.footnoteCounts={},f.patch=GT,f.applyData=YT,f.one=p,f.all=_,f.wrap=
|
|
106
|
+
`});const T={type:"element",tagName:"li",properties:d,children:f};return e.patch(t,T),e.applyData(t,T)}function ET(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=tm(n[r])}return t}function tm(e){const t=e.spread;return t??e.children.length>1}function TT(e,t){const n={},r=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<r.length;){const f=r[l];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const d={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,d),e.applyData(t,d)}function xT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ST(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const wd=nm("start"),Od=nm("end");function wT(e){return{start:wd(e),end:Od(e)}}function nm(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function OT(e,t){const n=e.all(t),r=n.shift(),l=[];if(r){const f={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],f),l.push(f)}if(n.length>0){const f={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},p=wd(t.children[1]),_=Od(t.children[t.children.length-1]);p.line&&_.line&&(f.position={start:p,end:_}),l.push(f)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,d),e.applyData(t,d)}function DT(e,t,n){const r=n?n.children:void 0,d=(r?r.indexOf(t):1)===0?"th":"td",f=n&&n.type==="table"?n.align:void 0,p=f?f.length:t.children.length;let _=-1;const T=[];for(;++_<p;){const S=t.children[_],w={},M=f?f[_]:void 0;M&&(w.align=M);let m={type:"element",tagName:d,properties:w,children:[]};S&&(m.children=e.all(S),e.patch(S,m),m=e.applyData(t,m)),T.push(m)}const E={type:"element",tagName:"tr",properties:{},children:e.wrap(T,!0)};return e.patch(t,E),e.applyData(t,E)}function AT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Eg=9,Tg=32;function MT(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),l=0;const d=[];for(;r;)d.push(xg(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return d.push(xg(t.slice(l),l>0,!1)),d.join("")}function xg(e,t,n){let r=0,l=e.length;if(t){let d=e.codePointAt(r);for(;d===Eg||d===Tg;)r++,d=e.codePointAt(r)}if(n){let d=e.codePointAt(l-1);for(;d===Eg||d===Tg;)l--,d=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}function RT(e,t){const n={type:"text",value:MT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function bT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const LT={blockquote:lT,break:aT,code:cT,delete:uT,emphasis:dT,footnoteReference:Qp,footnote:fT,heading:hT,html:gT,imageReference:pT,image:mT,inlineCode:_T,linkReference:yT,link:NT,listItem:CT,list:TT,paragraph:xT,root:vT,strong:ST,table:OT,tableCell:AT,tableRow:DT,text:RT,thematicBreak:bT,toml:Ja,yaml:Ja,definition:Ja,footnoteDefinition:Ja};function Ja(){return null}const rm=function(e){if(e==null)return $T;if(typeof e=="string")return PT(e);if(typeof e=="object")return Array.isArray(e)?IT(e):kT(e);if(typeof e=="function")return Cc(e);throw new Error("Expected function, string, or object as test")};function IT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rm(e[n]);return Cc(r);function r(...l){let d=-1;for(;++d<t.length;)if(t[d].call(this,...l))return!0;return!1}}function kT(e){return Cc(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function PT(e){return Cc(t);function t(n){return n&&n.type===e}}function Cc(e){return t;function t(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&e.call(this,n,...r))}}function $T(){return!0}const FT=!0,vg=!1,BT="skip",HT=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const l=rm(t),d=r?-1:1;f(e,void 0,[])();function f(p,_,T){const E=p&&typeof p=="object"?p:{};if(typeof E.type=="string"){const w=typeof E.tagName=="string"?E.tagName:typeof E.name=="string"?E.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(p.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=[],M,m,v;if((!t||l(p,_,T[T.length-1]||null))&&(w=WT(n(p,T)),w[0]===vg))return w;if(p.children&&w[0]!==BT)for(m=(r?p.children.length:-1)+d,v=T.concat(p);m>-1&&m<p.children.length;){if(M=f(p.children[m],m,v)(),M[0]===vg)return M;m=typeof M[1]=="number"?M[1]:m+d}return w}}};function WT(e){return Array.isArray(e)?e:typeof e=="number"?[FT,e]:[e]}const Dd=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),HT(e,t,l,r);function l(d,f){const p=f[f.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function KT(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const Sg={}.hasOwnProperty;function zT(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Dd(e,"definition",r=>{const l=wg(r.identifier);l&&!Sg.call(t,l)&&(t[l]=r)}),n;function n(r){const l=wg(r);return l&&Sg.call(t,l)?t[l]:null}}function wg(e){return String(e||"").toUpperCase()}const fc={}.hasOwnProperty;function UT(e,t){const n=t||{},r=n.allowDangerousHtml||!1,l={};return f.dangerous=r,f.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,f.footnoteLabel=n.footnoteLabel||"Footnotes",f.footnoteLabelTagName=n.footnoteLabelTagName||"h2",f.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},f.footnoteBackLabel=n.footnoteBackLabel||"Back to content",f.unknownHandler=n.unknownHandler,f.passThrough=n.passThrough,f.handlers={...LT,...n.handlers},f.definition=zT(e),f.footnoteById=l,f.footnoteOrder=[],f.footnoteCounts={},f.patch=GT,f.applyData=YT,f.one=p,f.all=_,f.wrap=VT,f.augment=d,Dd(e,"footnoteDefinition",T=>{const E=String(T.identifier).toUpperCase();fc.call(l,E)||(l[E]=T)}),f;function d(T,E){if(T&&"data"in T&&T.data){const S=T.data;S.hName&&(E.type!=="element"&&(E={type:"element",tagName:"",properties:{},children:[]}),E.tagName=S.hName),E.type==="element"&&S.hProperties&&(E.properties={...E.properties,...S.hProperties}),"children"in E&&E.children&&S.hChildren&&(E.children=S.hChildren)}if(T){const S="type"in T?T:{position:T};KT(S)||(E.position={start:wd(S),end:Od(S)})}return E}function f(T,E,S,w){return Array.isArray(S)&&(w=S,S={}),d(T,{type:"element",tagName:E,properties:S||{},children:w||[]})}function p(T,E){return im(f,T,E)}function _(T){return rs(f,T)}}function GT(e,t){e.position&&(t.position=wT(e))}function YT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,l=e.data.hChildren,d=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&d&&(n.properties={...n.properties,...d}),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function im(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return fc.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:rs(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):jT(e,t)}function rs(e,t){const n=[];if("children"in t){const r=t.children;let l=-1;for(;++l<r.length;){const d=im(e,r[l],t);if(d){if(l&&r[l-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=d.value.replace(/^\s+/,"")),!Array.isArray(d)&&d.type==="element")){const f=d.children[0];f&&f.type==="text"&&(f.value=f.value.replace(/^\s+/,""))}Array.isArray(d)?n.push(...d):n.push(d)}}}return n}function jT(e,t){const n=t.data||{},r="value"in t&&!(fc.call(n,"hProperties")||fc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:rs(e,t)};return e.patch(t,r),e.applyData(t,r)}function VT(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
107
107
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
108
108
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
109
|
-
`}),n}const qT=(e,t)=>e(t,"i",rs(e,t)),ZT=(e,t)=>e(t,"b",rs(e,t)),JT=(e,t)=>e(t,"u",rs(e,t)),XT=(e,t)=>e(t,"s",rs(e,t)),QT=(e,t)=>e(t,"sub",rs(e,t)),ex=(e,t)=>e(t,"sup",rs(e,t)),tx={emphasis:qT,strong:ZT,underline:JT,strikethrough:XT,subscript:QT,superscript:ex},nx=e=>{const[t,n]=nt.useState();let r;return nt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-DmzJWbSH.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[oT],remarkRehypeOptions:{handlers:tx}});n(d)})()},[e.markdown]),t||null};class co extends Error{}class rx extends co{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class ix extends co{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class sx extends co{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class qo extends co{}class sm extends co{constructor(t){super(`Invalid unit ${t}`)}}class mr extends co{}class ys extends co{constructor(){super("Zone is an abstract class")}}const lt="numeric",mi="short",Yr="long",hc={year:lt,month:lt,day:lt},om={year:lt,month:mi,day:lt},ox={year:lt,month:mi,day:lt,weekday:mi},lm={year:lt,month:Yr,day:lt},am={year:lt,month:Yr,day:lt,weekday:Yr},cm={hour:lt,minute:lt},um={hour:lt,minute:lt,second:lt},dm={hour:lt,minute:lt,second:lt,timeZoneName:mi},fm={hour:lt,minute:lt,second:lt,timeZoneName:Yr},hm={hour:lt,minute:lt,hourCycle:"h23"},gm={hour:lt,minute:lt,second:lt,hourCycle:"h23"},pm={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:mi},mm={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:Yr},_m={year:lt,month:lt,day:lt,hour:lt,minute:lt},ym={year:lt,month:lt,day:lt,hour:lt,minute:lt,second:lt},Nm={year:lt,month:mi,day:lt,hour:lt,minute:lt},Cm={year:lt,month:mi,day:lt,hour:lt,minute:lt,second:lt},lx={year:lt,month:mi,day:lt,weekday:mi,hour:lt,minute:lt},Em={year:lt,month:Yr,day:lt,hour:lt,minute:lt,timeZoneName:mi},Tm={year:lt,month:Yr,day:lt,hour:lt,minute:lt,second:lt,timeZoneName:mi},xm={year:lt,month:Yr,day:lt,weekday:Yr,hour:lt,minute:lt,timeZoneName:Yr},vm={year:lt,month:Yr,day:lt,weekday:Yr,hour:lt,minute:lt,second:lt,timeZoneName:Yr};class ca{get type(){throw new ys}get name(){throw new ys}get ianaName(){return this.name}get isUniversal(){throw new ys}offsetName(t,n){throw new ys}formatOffset(t,n){throw new ys}offset(t){throw new ys}equals(t){throw new ys}get isValid(){throw new ys}}let bu=null;class Ec extends ca{static get instance(){return bu===null&&(bu=new Ec),bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Lm(t,n,r)}formatOffset(t,n){return sa(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let sc={};function ax(e){return sc[e]||(sc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),sc[e]}const cx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ux(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,l,d,f,p,_,T,E]=r;return[f,l,d,p,_,T,E]}function dx(e,t){const n=e.formatToParts(t),r=[];for(let l=0;l<n.length;l++){const{type:d,value:f}=n[l],p=cx[d];d==="era"?r[p]=f:Lt(p)||(r[p]=parseInt(f,10))}return r}let Xa={};class ns extends ca{static create(t){return Xa[t]||(Xa[t]=new ns(t)),Xa[t]}static resetCache(){Xa={},sc={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ns.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Lm(t,n,r,this.name)}formatOffset(t,n){return sa(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=ax(this.name);let[l,d,f,p,_,T,E]=r.formatToParts?dx(r,n):ux(r,n);p==="BC"&&(l=-Math.abs(l)+1);const w=xc({year:l,month:d,day:f,hour:_===24?0:_,minute:T,second:E,millisecond:0});let M=+n;const m=M%1e3;return M-=m>=0?m:1e3+m,(w-M)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Og={};function fx(e,t={}){const n=JSON.stringify([e,t]);let r=Og[n];return r||(r=new Intl.ListFormat(e,t),Og[n]=r),r}let Xu={};function Qu(e,t={}){const n=JSON.stringify([e,t]);let r=Xu[n];return r||(r=new Intl.DateTimeFormat(e,t),Xu[n]=r),r}let ed={};function hx(e,t={}){const n=JSON.stringify([e,t]);let r=ed[n];return r||(r=new Intl.NumberFormat(e,t),ed[n]=r),r}let td={};function gx(e,t={}){const{base:n,...r}=t,l=JSON.stringify([e,r]);let d=td[l];return d||(d=new Intl.RelativeTimeFormat(e,t),td[l]=d),d}let ta=null;function px(){return ta||(ta=new Intl.DateTimeFormat().resolvedOptions().locale,ta)}let Dg={};function mx(e){let t=Dg[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Dg[e]=t}return t}function _x(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,l;try{r=Qu(e).resolvedOptions(),l=e}catch{const _=e.substring(0,n);r=Qu(_).resolvedOptions(),l=_}const{numberingSystem:d,calendar:f}=r;return[l,d,f]}}function yx(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Nx(e){const t=[];for(let n=1;n<=12;n++){const r=Ot.utc(2009,n,1);t.push(e(r))}return t}function Cx(e){const t=[];for(let n=1;n<=7;n++){const r=Ot.utc(2016,11,13+n);t.push(e(r))}return t}function Qa(e,t,n,r){const l=e.listingMode();return l==="error"?null:l==="en"?n(t):r(t)}function Ex(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class Tx{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:l,floor:d,...f}=r;if(!n||Object.keys(f).length>0){const p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=hx(t,p)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):Ld(t,3);return Kn(n,this.padTo)}}}class xx{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const f=-1*(t.offset/60),p=f>=0?`Etc/GMT+${f}`:`Etc/GMT${f}`;t.offset!==0&&ns.create(p).valid?(l=p,this.dt=t):(l="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,l=t.zone.name):(l="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||l,this.dtf=Qu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class vx{constructor(t,n,r){this.opts={style:"long",...r},!n&&Rm()&&(this.rtf=gx(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Vx(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const Sx={firstDay:1,minimalDays:4,weekend:[6,7]};class un{static fromOpts(t){return un.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,l,d=!1){const f=t||Rn.defaultLocale,p=f||(d?"en-US":px()),_=n||Rn.defaultNumberingSystem,T=r||Rn.defaultOutputCalendar,E=nd(l)||Rn.defaultWeekSettings;return new un(p,_,T,E,f)}static resetCache(){ta=null,Xu={},ed={},td={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:l}={}){return un.create(t,n,r,l)}constructor(t,n,r,l,d){const[f,p,_]=_x(t);this.locale=f,this.numberingSystem=n||p||null,this.outputCalendar=r||_||null,this.weekSettings=l,this.intl=yx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ex(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:un.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,nd(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Qa(this,t,Pm,()=>{const r=n?{month:t,day:"numeric"}:{month:t},l=n?"format":"standalone";return this.monthsCache[l][t]||(this.monthsCache[l][t]=Nx(d=>this.extract(d,r,"month"))),this.monthsCache[l][t]})}weekdays(t,n=!1){return Qa(this,t,Bm,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},l=n?"format":"standalone";return this.weekdaysCache[l][t]||(this.weekdaysCache[l][t]=Cx(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[l][t]})}meridiems(){return Qa(this,void 0,()=>Hm,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ot.utc(2016,11,13,9),Ot.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Qa(this,t,Wm,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[Ot.utc(-40,1,1),Ot.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const l=this.dtFormatter(t,n),d=l.formatToParts(),f=d.find(p=>p.type.toLowerCase()===r);return f?f.value:null}numberFormatter(t={}){return new Tx(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new xx(t,this.intl,n)}relFormatter(t={}){return new vx(this.intl,this.isEnglish(),t)}listFormatter(t={}){return fx(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bm()?mx(this.locale):Sx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Lu=null;class vr extends ca{static get utcInstance(){return Lu===null&&(Lu=new vr(0)),Lu}static instance(t){return t===0?vr.utcInstance:new vr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new vr(vc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sa(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return sa(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class wx extends ca{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Es(e,t){if(Lt(e)||e===null)return t;if(e instanceof ca)return e;if(bx(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ec.instance:n==="utc"||n==="gmt"?vr.utcInstance:vr.parseSpecifier(n)||ns.create(e)}else return xs(e)?vr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new wx(e)}const Ad={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ag={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ox=Ad.hanidec.replace(/[\[|\]]/g,"").split("");function Dx(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Ad.hanidec)!==-1)t+=Ox.indexOf(e[n]);else for(const l in Ag){const[d,f]=Ag[l];r>=d&&r<=f&&(t+=r-d)}}return parseInt(t,10)}else return t}let jo={};function Ax(){jo={}}function hi({numberingSystem:e},t=""){const n=e||"latn";return jo[n]||(jo[n]={}),jo[n][t]||(jo[n][t]=new RegExp(`${Ad[n]}${t}`)),jo[n][t]}let Mg=()=>Date.now(),Rg="system",bg=null,Lg=null,Ig=null,kg=60,Pg,$g=null;class Rn{static get now(){return Mg}static set now(t){Mg=t}static set defaultZone(t){Rg=t}static get defaultZone(){return Es(Rg,Ec.instance)}static get defaultLocale(){return bg}static set defaultLocale(t){bg=t}static get defaultNumberingSystem(){return Lg}static set defaultNumberingSystem(t){Lg=t}static get defaultOutputCalendar(){return Ig}static set defaultOutputCalendar(t){Ig=t}static get defaultWeekSettings(){return $g}static set defaultWeekSettings(t){$g=nd(t)}static get twoDigitCutoffYear(){return kg}static set twoDigitCutoffYear(t){kg=t%100}static get throwOnInvalid(){return Pg}static set throwOnInvalid(t){Pg=t}static resetCaches(){un.resetCache(),ns.resetCache(),Ot.resetCache(),Ax()}}class pi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Sm=[0,31,59,90,120,151,181,212,243,273,304,334],wm=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new pi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Md(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const l=r.getUTCDay();return l===0?7:l}function Om(e,t,n){return n+(ua(e)?wm:Sm)[t-1]}function Dm(e,t){const n=ua(e)?wm:Sm,r=n.findIndex(d=>d<t),l=t-n[r];return{month:r+1,day:l}}function Rd(e,t){return(e-t+7)%7+1}function gc(e,t=4,n=1){const{year:r,month:l,day:d}=e,f=Om(r,l,d),p=Rd(Md(r,l,d),n);let _=Math.floor((f-p+14-t)/7),T;return _<1?(T=r-1,_=aa(T,t,n)):_>aa(r,t,n)?(T=r+1,_=1):T=r,{weekYear:T,weekNumber:_,weekday:p,...Sc(e)}}function Fg(e,t=4,n=1){const{weekYear:r,weekNumber:l,weekday:d}=e,f=Rd(Md(r,1,t),n),p=Zo(r);let _=l*7+d-f-7+t,T;_<1?(T=r-1,_+=Zo(T)):_>p?(T=r+1,_-=Zo(r)):T=r;const{month:E,day:S}=Dm(T,_);return{year:T,month:E,day:S,...Sc(e)}}function Iu(e){const{year:t,month:n,day:r}=e,l=Om(t,n,r);return{year:t,ordinal:l,...Sc(e)}}function Bg(e){const{year:t,ordinal:n}=e,{month:r,day:l}=Dm(t,n);return{year:t,month:r,day:l,...Sc(e)}}function Hg(e,t){if(!Lt(e.localWeekday)||!Lt(e.localWeekNumber)||!Lt(e.localWeekYear)){if(!Lt(e.weekday)||!Lt(e.weekNumber)||!Lt(e.weekYear))throw new qo("Cannot mix locale-based week fields with ISO-based week fields");return Lt(e.localWeekday)||(e.weekday=e.localWeekday),Lt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Lt(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Mx(e,t=4,n=1){const r=Tc(e.weekYear),l=ti(e.weekNumber,1,aa(e.weekYear,t,n)),d=ti(e.weekday,1,7);return r?l?d?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function Rx(e){const t=Tc(e.year),n=ti(e.ordinal,1,Zo(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function Am(e){const t=Tc(e.year),n=ti(e.month,1,12),r=ti(e.day,1,pc(e.year,e.month));return t?n?r?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Mm(e){const{hour:t,minute:n,second:r,millisecond:l}=e,d=ti(t,0,23)||t===24&&n===0&&r===0&&l===0,f=ti(n,0,59),p=ti(r,0,59),_=ti(l,0,999);return d?f?p?_?!1:ei("millisecond",l):ei("second",r):ei("minute",n):ei("hour",t)}function Lt(e){return typeof e>"u"}function xs(e){return typeof e=="number"}function Tc(e){return typeof e=="number"&&e%1===0}function bx(e){return typeof e=="string"}function Lx(e){return Object.prototype.toString.call(e)==="[object Date]"}function Rm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ix(e){return Array.isArray(e)?e:[e]}function Wg(e,t,n){if(e.length!==0)return e.reduce((r,l)=>{const d=[t(l),l];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function kx(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function el(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nd(e){if(e==null)return null;if(typeof e!="object")throw new mr("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new mr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return Tc(e)&&e>=t&&e<=n}function Px(e,t){return e-t*Math.floor(e/t)}function Kn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Cs(e){if(!(Lt(e)||e===null||e===""))return parseInt(e,10)}function Qs(e){if(!(Lt(e)||e===null||e===""))return parseFloat(e)}function bd(e){if(!(Lt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Ld(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function ua(e){return e%4===0&&(e%100!==0||e%400===0)}function Zo(e){return ua(e)?366:365}function pc(e,t){const n=Px(t-1,12)+1,r=e+(t-n)/12;return n===2?ua(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function xc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Kg(e,t,n){return-Rd(Md(e,1,t),n)+t-1}function aa(e,t=4,n=1){const r=Kg(e,t,n),l=Kg(e+1,t,n);return(Zo(e)-r+l)/7}function rd(e){return e>99?e:e>Rn.twoDigitCutoffYear?1900+e:2e3+e}function Lm(e,t,n,r=null){const l=new Date(e),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const f={timeZoneName:t,...d},p=new Intl.DateTimeFormat(n,f).formatToParts(l).find(_=>_.type.toLowerCase()==="timezonename");return p?p.value:null}function vc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,l=n<0||Object.is(n,-0)?-r:r;return n*60+l}function Im(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new mr(`Invalid unit value ${e}`);return t}function mc(e,t){const n={};for(const r in e)if(el(e,r)){const l=e[r];if(l==null)continue;n[t(r)]=Im(l)}return n}function sa(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),l=e>=0?"+":"-";switch(t){case"short":return`${l}${Kn(n,2)}:${Kn(r,2)}`;case"narrow":return`${l}${n}${r>0?`:${r}`:""}`;case"techie":return`${l}${Kn(n,2)}${Kn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Sc(e){return kx(e,["hour","minute","second","millisecond"])}const $x=["January","February","March","April","May","June","July","August","September","October","November","December"],km=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Pm(e){switch(e){case"narrow":return[...Fx];case"short":return[...km];case"long":return[...$x];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const $m=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Fm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Bx=["M","T","W","T","F","S","S"];function Bm(e){switch(e){case"narrow":return[...Bx];case"short":return[...Fm];case"long":return[...$m];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Hm=["AM","PM"],Hx=["Before Christ","Anno Domini"],Wx=["BC","AD"],Kx=["B","A"];function Wm(e){switch(e){case"narrow":return[...Kx];case"short":return[...Wx];case"long":return[...Hx];default:return null}}function zx(e){return Hm[e.hour<12?0:1]}function Ux(e,t){return Bm(t)[e.weekday-1]}function Gx(e,t){return Pm(t)[e.month-1]}function Yx(e,t){return Wm(t)[e.year<0?0:1]}function Vx(e,t,n="always",r=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},d=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&d){const S=e==="days";switch(t){case 1:return S?"tomorrow":`next ${l[e][0]}`;case-1:return S?"yesterday":`last ${l[e][0]}`;case 0:return S?"today":`this ${l[e][0]}`}}const f=Object.is(t,-0)||t<0,p=Math.abs(t),_=p===1,T=l[e],E=r?_?T[1]:T[2]||T[1]:_?l[e][0]:e;return f?`${p} ${E} ago`:`in ${p} ${E}`}function zg(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const jx={D:hc,DD:om,DDD:lm,DDDD:am,t:cm,tt:um,ttt:dm,tttt:fm,T:hm,TT:gm,TTT:pm,TTTT:mm,f:_m,ff:Nm,fff:Em,ffff:xm,F:ym,FF:Cm,FFF:Tm,FFFF:vm};class _r{static create(t,n={}){return new _r(t,n)}static parseFormat(t){let n=null,r="",l=!1;const d=[];for(let f=0;f<t.length;f++){const p=t.charAt(f);p==="'"?(r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),n=null,r="",l=!l):l||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return jx[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Kn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(M,m)=>this.loc.extract(t,M,m),f=M=>t.isOffsetFixed&&t.offset===0&&M.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,M.format):"",p=()=>r?zx(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),_=(M,m)=>r?Gx(t,M):d(m?{month:M}:{month:M,day:"numeric"},"month"),T=(M,m)=>r?Ux(t,M):d(m?{weekday:M}:{weekday:M,month:"long",day:"numeric"},"weekday"),E=M=>{const m=_r.macroTokenToFormatOpts(M);return m?this.formatWithSystemDefault(t,m):M},S=M=>r?Yx(t,M):d({era:M},"era"),w=M=>{switch(M){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return f({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return f({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return f({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return p();case"d":return l?d({day:"numeric"},"day"):this.num(t.day);case"dd":return l?d({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return T("short",!0);case"cccc":return T("long",!0);case"ccccc":return T("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return T("short",!1);case"EEEE":return T("long",!1);case"EEEEE":return T("narrow",!1);case"L":return l?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return l?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return _("short",!0);case"LLLL":return _("long",!0);case"LLLLL":return _("narrow",!0);case"M":return l?d({month:"numeric"},"month"):this.num(t.month);case"MM":return l?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return _("short",!1);case"MMMM":return _("long",!1);case"MMMMM":return _("narrow",!1);case"y":return l?d({year:"numeric"},"year"):this.num(t.year);case"yy":return l?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return l?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return l?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return S("short");case"GG":return S("long");case"GGGGG":return S("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return E(M)}};return zg(_r.parseFormat(n),w)}formatDurationFromString(t,n){const r=_=>{switch(_[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=_=>T=>{const E=r(T);return E?this.num(_.get(E),T.length):T},d=_r.parseFormat(n),f=d.reduce((_,{literal:T,val:E})=>T?_:_.concat(E),[]),p=t.shiftTo(...f.map(r).filter(_=>_));return zg(d,l(p))}}const Km=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ll(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function al(...e){return t=>e.reduce(([n,r,l],d)=>{const[f,p,_]=d(t,l);return[{...n,...f},p||r,_]},[{},null,1]).slice(0,2)}function cl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const l=n.exec(e);if(l)return r(l)}return[null,null]}function zm(...e){return(t,n)=>{const r={};let l;for(l=0;l<e.length;l++)r[e[l]]=Cs(t[n+l]);return[r,null,n+l]}}const Um=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,qx=`(?:${Um.source}?(?:\\[(${Km.source})\\])?)?`,Id=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Gm=RegExp(`${Id.source}${qx}`),kd=RegExp(`(?:T${Gm.source})?`),Zx=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Jx=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Xx=/(\d{4})-?(\d{3})/,Qx=zm("weekYear","weekNumber","weekDay"),ev=zm("year","ordinal"),tv=/(\d{4})-(\d\d)-(\d\d)/,Ym=RegExp(`${Id.source} ?(?:${Um.source}|(${Km.source}))?`),nv=RegExp(`(?: ${Ym.source})?`);function Jo(e,t,n){const r=e[t];return Lt(r)?n:Cs(r)}function rv(e,t){return[{year:Jo(e,t),month:Jo(e,t+1,1),day:Jo(e,t+2,1)},null,t+3]}function ul(e,t){return[{hours:Jo(e,t,0),minutes:Jo(e,t+1,0),seconds:Jo(e,t+2,0),milliseconds:bd(e[t+3])},null,t+4]}function da(e,t){const n=!e[t]&&!e[t+1],r=vc(e[t+1],e[t+2]),l=n?null:vr.instance(r);return[{},l,t+3]}function fa(e,t){const n=e[t]?ns.create(e[t]):null;return[{},n,t+1]}const iv=RegExp(`^T?${Id.source}$`),sv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function ov(e){const[t,n,r,l,d,f,p,_,T]=e,E=t[0]==="-",S=_&&_[0]==="-",w=(M,m=!1)=>M!==void 0&&(m||M&&E)?-M:M;return[{years:w(Qs(n)),months:w(Qs(r)),weeks:w(Qs(l)),days:w(Qs(d)),hours:w(Qs(f)),minutes:w(Qs(p)),seconds:w(Qs(_),_==="-0"),milliseconds:w(bd(T),S)}]}const lv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Pd(e,t,n,r,l,d,f){const p={year:t.length===2?rd(Cs(t)):Cs(t),month:km.indexOf(n)+1,day:Cs(r),hour:Cs(l),minute:Cs(d)};return f&&(p.second=Cs(f)),e&&(p.weekday=e.length>3?$m.indexOf(e)+1:Fm.indexOf(e)+1),p}const av=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function cv(e){const[,t,n,r,l,d,f,p,_,T,E,S]=e,w=Pd(t,l,r,n,d,f,p);let M;return _?M=lv[_]:T?M=0:M=vc(E,S),[w,new vr(M)]}function uv(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const dv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,fv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,hv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ug(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,l,r,n,d,f,p),vr.utcInstance]}function gv(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,p,n,r,l,d,f),vr.utcInstance]}const pv=ll(Zx,kd),mv=ll(Jx,kd),_v=ll(Xx,kd),yv=ll(Gm),Vm=al(rv,ul,da,fa),Nv=al(Qx,ul,da,fa),Cv=al(ev,ul,da,fa),Ev=al(ul,da,fa);function Tv(e){return cl(e,[pv,Vm],[mv,Nv],[_v,Cv],[yv,Ev])}function xv(e){return cl(uv(e),[av,cv])}function vv(e){return cl(e,[dv,Ug],[fv,Ug],[hv,gv])}function Sv(e){return cl(e,[sv,ov])}const wv=al(ul);function Ov(e){return cl(e,[iv,wv])}const Dv=ll(tv,nv),Av=ll(Ym),Mv=al(ul,da,fa);function Rv(e){return cl(e,[Dv,Vm],[Av,Mv])}const Gg="Invalid Duration",jm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},bv={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...jm},Qr=146097/400,Uo=146097/4800,Lv={years:{quarters:4,months:12,weeks:Qr/7,days:Qr,hours:Qr*24,minutes:Qr*24*60,seconds:Qr*24*60*60,milliseconds:Qr*24*60*60*1e3},quarters:{months:3,weeks:Qr/28,days:Qr/4,hours:Qr*24/4,minutes:Qr*24*60/4,seconds:Qr*24*60*60/4,milliseconds:Qr*24*60*60*1e3/4},months:{weeks:Uo/7,days:Uo,hours:Uo*24,minutes:Uo*24*60,seconds:Uo*24*60*60,milliseconds:Uo*24*60*60*1e3},...jm},so=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Iv=so.slice(0).reverse();function Ns(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Qt(r)}function qm(e,t){let n=t.milliseconds??0;for(const r of Iv.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Yg(e,t){const n=qm(e,t)<0?-1:1;so.reduceRight((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]*n,f=e[l][r],p=Math.floor(d/f);t[l]+=p*n,t[r]-=p*f*n}return l},null),so.reduce((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]%1;t[r]-=d,t[l]+=d*e[r][l]}return l},null)}function kv(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Qt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?Lv:bv;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||un.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Qt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new mr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Qt({values:mc(t,Qt.normalizeUnit),loc:un.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(xs(t))return Qt.fromMillis(t);if(Qt.isDuration(t))return t;if(typeof t=="object")return Qt.fromObject(t);throw new mr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Sv(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Ov(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Duration is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new sx(r);return new Qt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new sm(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?_r.create(this.loc,r).formatDurationFromString(this,t):Gg}toHuman(t={}){if(!this.isValid)return Gg;const n=so.map(r=>{const l=this.values[r];return Lt(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(l)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Ld(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Ot.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?qm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t),r={};for(const l of so)(el(n.values,l)||el(this.values,l))&&(r[l]=n.get(l)+this.get(l));return Ns(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Im(t(this.values[r],r));return Ns(this,{values:n},!0)}get(t){return this[Qt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...mc(t,Qt.normalizeUnit)};return Ns(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:l}={}){const f={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:l,conversionAccuracy:r};return Ns(this,f)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Yg(this.matrix,t),Ns(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=kv(this.normalize().shiftToAll().toObject());return Ns(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(f=>Qt.normalizeUnit(f));const n={},r={},l=this.toObject();let d;for(const f of so)if(t.indexOf(f)>=0){d=f;let p=0;for(const T in r)p+=this.matrix[T][f]*r[T],r[T]=0;xs(l[f])&&(p+=l[f]);const _=Math.trunc(p);n[f]=_,r[f]=(p*1e3-_*1e3)/1e3}else xs(l[f])&&(r[f]=l[f]);for(const f in r)r[f]!==0&&(n[d]+=f===d?r[f]:r[f]/this.matrix[d][f]);return Yg(this.matrix,n),Ns(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Ns(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,l){return r===void 0||r===0?l===void 0||l===0:r===l}for(const r of so)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Go="Invalid Interval";function Pv(e,t){return!e||!e.isValid?Mn.invalid("missing or invalid start"):!t||!t.isValid?Mn.invalid("missing or invalid end"):t<e?Mn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Mn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Interval is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new ix(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Xl(t),l=Xl(n),d=Pv(r,l);return d??new Mn({start:r,end:l})}static after(t,n){const r=Qt.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l,l.plus(r))}static before(t,n){const r=Qt.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l.minus(r),l)}static fromISO(t,n){const[r,l]=(t||"").split("/",2);if(r&&l){let d,f;try{d=Ot.fromISO(r,n),f=d.isValid}catch{f=!1}let p,_;try{p=Ot.fromISO(l,n),_=p.isValid}catch{_=!1}if(f&&_)return Mn.fromDateTimes(d,p);if(f){const T=Qt.fromISO(l,n);if(T.isValid)return Mn.after(d,T)}else if(_){const T=Qt.fromISO(r,n);if(T.isValid)return Mn.before(p,T)}}return Mn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let l;return n!=null&&n.useLocaleWeeks?l=this.end.reconfigure({locale:r.locale}):l=this.end,l=l.startOf(t,n),Math.floor(l.diff(r,t).get(t))+(l.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Mn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Xl).filter(f=>this.contains(f)).sort((f,p)=>f.toMillis()-p.toMillis()),r=[];let{s:l}=this,d=0;for(;l<this.e;){const f=n[d]||this.e,p=+f>+this.e?this.e:f;r.push(Mn.fromDateTimes(l,p)),l=p,d+=1}return r}splitBy(t){const n=Qt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,l=1,d;const f=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(_=>_*l));d=+p>+this.e?this.e:p,f.push(Mn.fromDateTimes(r,d)),r=d,l+=1}return f}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Mn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Mn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((l,d)=>l.s-d.s).reduce(([l,d],f)=>d?d.overlaps(f)||d.abutsStart(f)?[l,d.union(f)]:[l.concat([d]),f]:[l,f],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const l=[],d=t.map(_=>[{time:_.s,type:"s"},{time:_.e,type:"e"}]),f=Array.prototype.concat(...d),p=f.sort((_,T)=>_.time-T.time);for(const _ of p)r+=_.type==="s"?1:-1,r===1?n=_.time:(n&&+n!=+_.time&&l.push(Mn.fromDateTimes(n,_.time)),n=null);return Mn.merge(l)}difference(...t){return Mn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Go}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=hc,n={}){return this.isValid?_r.create(this.s.loc.clone(n),t).formatInterval(this):Go}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Go}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Go}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Go}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Go}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Qt.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class ec{static hasDST(t=Rn.defaultZone){const n=Ot.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return ns.isValidZone(t)}static normalizeZone(t){return Es(t,Rn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return un.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return un.create(n,null,"gregory").eras(t)}static features(){return{relative:Rm(),localeWeek:bm()}}}function Vg(e,t){const n=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Qt.fromMillis(r).as("days"))}function $v(e,t,n){const r=[["years",(_,T)=>T.year-_.year],["quarters",(_,T)=>T.quarter-_.quarter+(T.year-_.year)*4],["months",(_,T)=>T.month-_.month+(T.year-_.year)*12],["weeks",(_,T)=>{const E=Vg(_,T);return(E-E%7)/7}],["days",Vg]],l={},d=e;let f,p;for(const[_,T]of r)n.indexOf(_)>=0&&(f=_,l[_]=T(e,t),p=d.plus(l),p>t?(l[_]--,e=d.plus(l),e>t&&(p=e,l[_]--,e=d.plus(l))):e=p);return[e,l,p,f]}function Fv(e,t,n,r){let[l,d,f,p]=$v(e,t,n);const _=t-l,T=n.filter(S=>["hours","minutes","seconds","milliseconds"].indexOf(S)>=0);T.length===0&&(f<t&&(f=l.plus({[p]:1})),f!==l&&(d[p]=(d[p]||0)+_/(f-l)));const E=Qt.fromObject(d,r);return T.length>0?Qt.fromMillis(_,r).shiftTo(...T).plus(E):E}const Bv="missing Intl.DateTimeFormat.formatToParts support";function on(e,t=n=>n){return{regex:e,deser:([n])=>t(Dx(n))}}const Hv=" ",Zm=`[ ${Hv}]`,Jm=new RegExp(Zm,"g");function Wv(e){return e.replace(/\./g,"\\.?").replace(Jm,Zm)}function jg(e){return e.replace(/\./g,"").replace(Jm," ").toLowerCase()}function gi(e,t){return e===null?null:{regex:RegExp(e.map(Wv).join("|")),deser:([n])=>e.findIndex(r=>jg(n)===jg(r))+t}}function qg(e,t){return{regex:e,deser:([,n,r])=>vc(n,r),groups:t}}function tc(e){return{regex:e,deser:([t])=>t}}function Kv(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function zv(e,t){const n=hi(t),r=hi(t,"{2}"),l=hi(t,"{3}"),d=hi(t,"{4}"),f=hi(t,"{6}"),p=hi(t,"{1,2}"),_=hi(t,"{1,3}"),T=hi(t,"{1,6}"),E=hi(t,"{1,9}"),S=hi(t,"{2,4}"),w=hi(t,"{4,6}"),M=k=>({regex:RegExp(Kv(k.val)),deser:([G])=>G,literal:!0}),v=(k=>{if(e.literal)return M(k);switch(k.val){case"G":return gi(t.eras("short"),0);case"GG":return gi(t.eras("long"),0);case"y":return on(T);case"yy":return on(S,rd);case"yyyy":return on(d);case"yyyyy":return on(w);case"yyyyyy":return on(f);case"M":return on(p);case"MM":return on(r);case"MMM":return gi(t.months("short",!0),1);case"MMMM":return gi(t.months("long",!0),1);case"L":return on(p);case"LL":return on(r);case"LLL":return gi(t.months("short",!1),1);case"LLLL":return gi(t.months("long",!1),1);case"d":return on(p);case"dd":return on(r);case"o":return on(_);case"ooo":return on(l);case"HH":return on(r);case"H":return on(p);case"hh":return on(r);case"h":return on(p);case"mm":return on(r);case"m":return on(p);case"q":return on(p);case"qq":return on(r);case"s":return on(p);case"ss":return on(r);case"S":return on(_);case"SSS":return on(l);case"u":return tc(E);case"uu":return tc(p);case"uuu":return on(n);case"a":return gi(t.meridiems(),0);case"kkkk":return on(d);case"kk":return on(S,rd);case"W":return on(p);case"WW":return on(r);case"E":case"c":return on(n);case"EEE":return gi(t.weekdays("short",!1),1);case"EEEE":return gi(t.weekdays("long",!1),1);case"ccc":return gi(t.weekdays("short",!0),1);case"cccc":return gi(t.weekdays("long",!0),1);case"Z":case"ZZ":return qg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return qg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return tc(/[a-z_+-/]{1,256}?/i);case" ":return tc(/[^\S\n\r]/);default:return M(k)}})(e)||{invalidReason:Bv};return v.token=e,v}const Uv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Gv(e,t,n){const{type:r,value:l}=e;if(r==="literal"){const _=/^\s+$/.test(l);return{literal:!_,val:_?" ":l}}const d=t[r];let f=r;r==="hour"&&(t.hour12!=null?f=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?f="hour12":f="hour24":f=n.hour12?"hour12":"hour24");let p=Uv[f];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Yv(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function Vv(e,t,n){const r=e.match(t);if(r){const l={};let d=1;for(const f in n)if(el(n,f)){const p=n[f],_=p.groups?p.groups+1:1;!p.literal&&p.token&&(l[p.token.val[0]]=p.deser(r.slice(d,d+_))),d+=_}return[r,l]}else return[r,{}]}function jv(e){const t=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(e.z)||(n=ns.create(e.z)),Lt(e.Z)||(n||(n=new vr(e.Z)),r=e.Z),Lt(e.q)||(e.M=(e.q-1)*3+1),Lt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Lt(e.u)||(e.S=bd(e.u)),[Object.keys(e).reduce((d,f)=>{const p=t(f);return p&&(d[p]=e[f]),d},{}),n,r]}let ku=null;function qv(){return ku||(ku=Ot.fromMillis(1555555555555)),ku}function Zv(e,t){if(e.literal)return e;const n=_r.macroTokenToFormatOpts(e.val),r=t_(n,t);return r==null||r.includes(void 0)?e:r}function Xm(e,t){return Array.prototype.concat(...e.map(n=>Zv(n,t)))}class Qm{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Xm(_r.parseFormat(n),t),this.units=this.tokens.map(r=>zv(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,l]=Yv(this.units);this.regex=RegExp(r,"i"),this.handlers=l}}explainFromTokens(t){if(this.isValid){const[n,r]=Vv(t,this.regex,this.handlers),[l,d,f]=r?jv(r):[null,null,void 0];if(el(r,"a")&&el(r,"H"))throw new qo("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:l,zone:d,specificOffset:f}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function e_(e,t,n){return new Qm(e,n).explainFromTokens(t)}function Jv(e,t,n){const{result:r,zone:l,specificOffset:d,invalidReason:f}=e_(e,t,n);return[r,l,d,f]}function t_(e,t){if(!e)return null;const r=_r.create(t,e).dtFormatter(qv()),l=r.formatToParts(),d=r.resolvedOptions();return l.map(f=>Gv(f,e,d))}const Pu="Invalid DateTime",Xv=864e13;function na(e){return new pi("unsupported zone",`the zone "${e.name}" is not supported`)}function $u(e){return e.weekData===null&&(e.weekData=gc(e.c)),e.weekData}function Fu(e){return e.localWeekData===null&&(e.localWeekData=gc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function eo(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ot({...n,...t,old:n})}function n_(e,t,n){let r=e-t*60*1e3;const l=n.offset(r);if(t===l)return[r,t];r-=(l-t)*60*1e3;const d=n.offset(r);return l===d?[r,l]:[e-Math.min(l,d)*60*1e3,Math.max(l,d)]}function nc(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function oc(e,t,n){return n_(xc(e),t,n)}function Zg(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),l=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:l,day:Math.min(e.c.day,pc(r,l))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},f=Qt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),p=xc(d);let[_,T]=n_(p,n,e.zone);return f!==0&&(_+=f,T=e.zone.offset(_)),{ts:_,o:T}}function Yo(e,t,n,r,l,d){const{setZone:f,zone:p}=n;if(e&&Object.keys(e).length!==0||t){const _=t||p,T=Ot.fromObject(e,{...n,zone:_,specificOffset:d});return f?T:T.setZone(p)}else return Ot.invalid(new pi("unparsable",`the input "${l}" can't be parsed as ${r}`))}function rc(e,t,n=!0){return e.isValid?_r.create(un.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Bu(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Kn(e.c.year,n?6:4),t?(r+="-",r+=Kn(e.c.month),r+="-",r+=Kn(e.c.day)):(r+=Kn(e.c.month),r+=Kn(e.c.day)),r}function Jg(e,t,n,r,l,d){let f=Kn(e.c.hour);return t?(f+=":",f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=":")):f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=Kn(e.c.second),(e.c.millisecond!==0||!r)&&(f+=".",f+=Kn(e.c.millisecond,3))),l&&(e.isOffsetFixed&&e.offset===0&&!d?f+="Z":e.o<0?(f+="-",f+=Kn(Math.trunc(-e.o/60)),f+=":",f+=Kn(Math.trunc(-e.o%60))):(f+="+",f+=Kn(Math.trunc(e.o/60)),f+=":",f+=Kn(Math.trunc(e.o%60)))),d&&(f+="["+e.zone.ianaName+"]"),f}const r_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Qv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},eS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},i_=["year","month","day","hour","minute","second","millisecond"],tS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],nS=["year","ordinal","hour","minute","second","millisecond"];function rS(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new sm(e);return t}function Xg(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return rS(e)}}function iS(e){return ac[e]||(lc===void 0&&(lc=Rn.now()),ac[e]=e.offset(lc)),ac[e]}function Qg(e,t){const n=Es(t.zone,Rn.defaultZone);if(!n.isValid)return Ot.invalid(na(n));const r=un.fromObject(t);let l,d;if(Lt(e.year))l=Rn.now();else{for(const _ of i_)Lt(e[_])&&(e[_]=r_[_]);const f=Am(e)||Mm(e);if(f)return Ot.invalid(f);const p=iS(n);[l,d]=oc(e,p,n)}return new Ot({ts:l,zone:n,loc:r,o:d})}function ep(e,t,n){const r=Lt(n.round)?!0:n.round,l=(f,p)=>(f=Ld(f,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(f,p)),d=f=>n.calendary?t.hasSame(e,f)?0:t.startOf(f).diff(e.startOf(f),f).get(f):t.diff(e,f).get(f);if(n.unit)return l(d(n.unit),n.unit);for(const f of n.units){const p=d(f);if(Math.abs(p)>=1)return l(p,f)}return l(e>t?-0:0,n.units[n.units.length-1])}function tp(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let lc,ac={};class Ot{constructor(t){const n=t.zone||Rn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new pi("invalid input"):null)||(n.isValid?null:na(n));this.ts=Lt(t.ts)?Rn.now():t.ts;let l=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[l,d]=[t.old.c,t.old.o];else{const p=xs(t.o)&&!t.old?t.o:n.offset(this.ts);l=nc(this.ts,p),r=Number.isNaN(l.year)?new pi("invalid input"):null,l=r?null:l,d=r?null:p}this._zone=n,this.loc=t.loc||un.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=l,this.o=d,this.isLuxonDateTime=!0}static now(){return new Ot({})}static local(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static utc(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return t.zone=vr.utcInstance,Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static fromJSDate(t,n={}){const r=Lx(t)?t.valueOf():NaN;if(Number.isNaN(r))return Ot.invalid("invalid input");const l=Es(n.zone,Rn.defaultZone);return l.isValid?new Ot({ts:r,zone:l,loc:un.fromObject(n)}):Ot.invalid(na(l))}static fromMillis(t,n={}){if(xs(t))return t<-864e13||t>Xv?Ot.invalid("Timestamp out of range"):new Ot({ts:t,zone:Es(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(xs(t))return new Ot({ts:t*1e3,zone:Es(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Es(n.zone,Rn.defaultZone);if(!r.isValid)return Ot.invalid(na(r));const l=un.fromObject(n),d=mc(t,Xg),{minDaysInFirstWeek:f,startOfWeek:p}=Hg(d,l),_=Rn.now(),T=Lt(n.specificOffset)?r.offset(_):n.specificOffset,E=!Lt(d.ordinal),S=!Lt(d.year),w=!Lt(d.month)||!Lt(d.day),M=S||w,m=d.weekYear||d.weekNumber;if((M||E)&&m)throw new qo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&E)throw new qo("Can't mix ordinal dates with month/day");const v=m||d.weekday&&!M;let k,G,I=nc(_,T);v?(k=tS,G=Qv,I=gc(I,f,p)):E?(k=nS,G=eS,I=Iu(I)):(k=i_,G=r_);let P=!1;for(const z of k){const q=d[z];Lt(q)?P?d[z]=G[z]:d[z]=I[z]:P=!0}const H=v?Mx(d,f,p):E?Rx(d):Am(d),V=H||Mm(d);if(V)return Ot.invalid(V);const re=v?Fg(d,f,p):E?Bg(d):d,[te,ce]=oc(re,T,r),j=new Ot({ts:te,zone:r,o:ce,loc:l});return d.weekday&&M&&t.weekday!==j.weekday?Ot.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${j.toISO()}`):j.isValid?j:Ot.invalid(j.invalid)}static fromISO(t,n={}){const[r,l]=Tv(t);return Yo(r,l,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,l]=xv(t);return Yo(r,l,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,l]=vv(t);return Yo(r,l,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0}),[p,_,T,E]=Jv(f,t,n);return E?Ot.invalid(E):Yo(p,_,r,`format ${n}`,t,T)}static fromString(t,n,r={}){return Ot.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,l]=Rv(t);return Yo(r,l,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the DateTime is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new rx(r);return new Ot({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=t_(t,un.fromObject(n));return r?r.map(l=>l?l.val:null).join(""):null}static expandFormat(t,n={}){return Xm(_r.parseFormat(t),un.fromObject(n)).map(l=>l.val).join("")}static resetCache(){lc=void 0,ac={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?$u(this).weekYear:NaN}get weekNumber(){return this.isValid?$u(this).weekNumber:NaN}get weekday(){return this.isValid?$u(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Fu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Fu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Fu(this).weekYear:NaN}get ordinal(){return this.isValid?Iu(this.c).ordinal:NaN}get monthShort(){return this.isValid?ec.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ec.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ec.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ec.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=xc(this.c),l=this.zone.offset(r-t),d=this.zone.offset(r+t),f=this.zone.offset(r-l*n),p=this.zone.offset(r-d*n);if(f===p)return[this];const _=r-f*n,T=r-p*n,E=nc(_,f),S=nc(T,p);return E.hour===S.hour&&E.minute===S.minute&&E.second===S.second&&E.millisecond===S.millisecond?[eo(this,{ts:_}),eo(this,{ts:T})]:[this]}get isInLeapYear(){return ua(this.year)}get daysInMonth(){return pc(this.year,this.month)}get daysInYear(){return this.isValid?Zo(this.year):NaN}get weeksInWeekYear(){return this.isValid?aa(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?aa(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:l}=_r.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:l}}toUTC(t=0,n={}){return this.setZone(vr.instance(t),n)}toLocal(){return this.setZone(Rn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Es(t,Rn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let l=this.ts;if(n||r){const d=t.offset(this.ts),f=this.toObject();[l]=oc(f,d,t)}return eo(this,{ts:l,zone:t})}else return Ot.invalid(na(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const l=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return eo(this,{loc:l})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=mc(t,Xg),{minDaysInFirstWeek:r,startOfWeek:l}=Hg(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),f=!Lt(n.ordinal),p=!Lt(n.year),_=!Lt(n.month)||!Lt(n.day),T=p||_,E=n.weekYear||n.weekNumber;if((T||f)&&E)throw new qo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new qo("Can't mix ordinal dates with month/day");let S;d?S=Fg({...gc(this.c,r,l),...n},r,l):Lt(n.ordinal)?(S={...this.toObject(),...n},Lt(n.day)&&(S.day=Math.min(pc(S.year,S.month),S.day))):S=Bg({...Iu(this.c),...n});const[w,M]=oc(S,this.o,this.zone);return eo(this,{ts:w,o:M})}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return eo(this,Zg(this,n))}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t).negate();return eo(this,Zg(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},l=Qt.normalizeUnit(t);switch(l){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(l==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:f}=this;f<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(l==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?_r.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Pu}toLocaleString(t=hc,n={}){return this.isValid?_r.create(this.loc.clone(n),t).formatDateTime(this):Pu}toLocaleParts(t={}){return this.isValid?_r.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:l=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const f=t==="extended";let p=Bu(this,f);return p+="T",p+=Jg(this,f,n,r,l,d),p}toISODate({format:t="extended"}={}){return this.isValid?Bu(this,t==="extended"):null}toISOWeekDate(){return rc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:l=!1,extendedZone:d=!1,format:f="extended"}={}){return this.isValid?(l?"T":"")+Jg(this,f==="extended",n,t,r,d):null}toRFC2822(){return rc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return rc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Bu(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let l="HH:mm:ss.SSS";return(n||t)&&(r&&(l+=" "),n?l+="z":t&&(l+="ZZ")),rc(this,l,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Pu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Qt.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Ix(n).map(Qt.normalizeUnit),f=t.valueOf()>this.valueOf(),p=f?this:t,_=f?t:this,T=Fv(p,_,d,l);return f?T.negate():T}diffNow(t="milliseconds",n={}){return this.diff(Ot.now(),t,n)}until(t){return this.isValid?Mn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const l=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=l&&l<=d.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||Ot.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let l=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(l=t.unit,d=void 0),ep(n,this.plus(r),{...t,numeric:"always",units:l,unit:d})}toRelativeCalendar(t={}){return this.isValid?ep(t.base||Ot.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Ot.isDateTime))throw new mr("min requires all arguments be DateTimes");return Wg(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(Ot.isDateTime))throw new mr("max requires all arguments be DateTimes");return Wg(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});return e_(f,t,n)}static fromStringExplain(t,n,r={}){return Ot.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:l=null}=n,d=un.fromOpts({locale:r,numberingSystem:l,defaultToEN:!0});return new Qm(d,t)}static fromFormatParser(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});if(!f.equals(n.locale))throw new mr(`fromFormatParser called with a locale of ${f}, but the format parser was created for ${n.locale}`);const{result:p,zone:_,specificOffset:T,invalidReason:E}=n.explainFromTokens(t);return E?Ot.invalid(E):Yo(p,_,r,`format ${n.format}`,t,T)}static get DATE_SHORT(){return hc}static get DATE_MED(){return om}static get DATE_MED_WITH_WEEKDAY(){return ox}static get DATE_FULL(){return lm}static get DATE_HUGE(){return am}static get TIME_SIMPLE(){return cm}static get TIME_WITH_SECONDS(){return um}static get TIME_WITH_SHORT_OFFSET(){return dm}static get TIME_WITH_LONG_OFFSET(){return fm}static get TIME_24_SIMPLE(){return hm}static get TIME_24_WITH_SECONDS(){return gm}static get TIME_24_WITH_SHORT_OFFSET(){return pm}static get TIME_24_WITH_LONG_OFFSET(){return mm}static get DATETIME_SHORT(){return _m}static get DATETIME_SHORT_WITH_SECONDS(){return ym}static get DATETIME_MED(){return Nm}static get DATETIME_MED_WITH_SECONDS(){return Cm}static get DATETIME_MED_WITH_WEEKDAY(){return lx}static get DATETIME_FULL(){return Em}static get DATETIME_FULL_WITH_SECONDS(){return Tm}static get DATETIME_HUGE(){return xm}static get DATETIME_HUGE_WITH_SECONDS(){return vm}}function Xl(e){if(Ot.isDateTime(e))return e;if(e&&e.valueOf&&xs(e.valueOf()))return Ot.fromJSDate(e);if(e&&typeof e=="object")return Ot.fromObject(e);throw new mr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var ln=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(ln||{});function $d(e){const t={1:ln.Monday,2:ln.Tuesday,3:ln.Wednesday,4:ln.Thursday,5:ln.Friday,6:ln.Saturday,7:ln.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function Di(e){return{[ln.Monday]:"Monday",[ln.Tuesday]:"Tuesday",[ln.Wednesday]:"Wednesday",[ln.Thursday]:"Thursday",[ln.Friday]:"Friday",[ln.Saturday]:"Saturday",[ln.Sunday]:"Sunday"}[e]}class np{constructor(t,n,r){Ie(this,"end");Ie(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(T=>{if(T.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[l,d]=n.start.split(":"),[f,p]=n.end.split(":");let _=0;f<l&&(_=1),this.end=this.end.set({hour:Number(f),minute:Number(p),day:this.end.day+_}),this.start=this.start.set({hour:Number(l),minute:Number(d)}),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(t){return this.start<=t&&t<this.end}getStartTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(t||"en-US").toLocaleString(r)}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r)}timeIsEqualTo(t){const n=this.getStartTime()===t.getStartTime(),r=this.getEndTime()===t.getEndTime();return n&&r}is24h(){const t=this.start.minute===0&&this.start.hour===0,n=this.end.minute===0&&this.end.hour===0,r=this.end.day-this.start.day===1||this.end.day===1;return t&&n&&r}}class s_{constructor(t,n){Ie(this,"holidayHoursByDate");Ie(this,"hours");Ie(this,"timezone");this.holidayHoursByDate=Object.fromEntries((t.holidayHours||[]).map(r=>[r.date,r])),this.hours=t,this.timezone=n}getInterval(t){if(this.isTemporarilyClosedAt(t))return null;let n=t;n=n.minus({days:1});for(const r of[n,t]){const l=this.getHours(r);if(l&&!l.isClosed)for(const d of l.openIntervals||[]){const f=new np(r,d,this.timezone);if(f.contains(t))return f}}return null}getCurrentInterval(){return this.getInterval(Ot.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,f)=>d.start===f.start?0:d.start>f.start?1:-1,l=n.sort(r);for(const[d,f]of l.entries())if(f.contains(t)&&l.length>d+1)return l[d+1];for(const d of l)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let l=0;l<t;l++){let d=n;d=d.plus({days:l});const f=this.getHours(d);f&&!f.isClosed&&r.push(...f.openIntervals.map(p=>new np(d,p,this.timezone)))}return r}getHolidayHours(t){return this.isTemporarilyClosedAt(t)?null:this.holidayHoursByDate[(t.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(t){if(this.isTemporarilyClosedAt(t))return null;const n=Di($d(t)).toLowerCase();return this.hours[n]}getHours(t){const n=this.getHolidayHours(t);return!n||n.isRegularHours?this.getNormalHours(t):n}getNextInterval(){return this.getIntervalAfter(Ot.now())}isHoliday(t){return!!this.getHolidayHours(t)}isTemporarilyClosedAt(t){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,l,d]=n,f=Ot.fromObject({year:Number(r),month:Number(l),day:Number(d)},{zone:this.timezone});if(t<f)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(Ot.now())}}function sS(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function oS(e,t){if(e.length!==t.length)return!1;for(const[n,r]of e.entries())if(!r.timeIsEqualTo(t[n]))return!1;return!0}function ha(e){var t,n;return((n=(t=e==null?void 0:e.currentInterval)==null?void 0:t.is24h)==null?void 0:n.call(t))||!1}function ga(e){return!e.futureInterval}function lS(e){return ha(e)?ft.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):ga(e)?ft.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):ft.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function aS(e){return ha(e)||ga(e)?null:ft.jsx("span",{className:"HoursStatus-separator",children:" • "})}function cS(e){return ha(e)||ga(e)?null:ft.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function uS(e){if(ha(e)||ga(e))return null;let t="";if(e.isOpen){const n=e.currentInterval;t+=n?n.getEndTime("en-US",e.timeOptions):""}else{const n=e.futureInterval;t+=n?n.getStartTime("en-US",e.timeOptions):""}return ft.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function dS(e){var r,l;if(ha(e)||ga(e))return null;const t={weekday:"long",...e.dayOptions??{}};let n="";if(e.isOpen){const d=e.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(t))||""}else{const d=e.futureInterval;n+=((l=d==null?void 0:d.start)==null?void 0:l.setLocale("en-US").toLocaleString(t))||""}return ft.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function fS(e,t){const n=e.currentTemplate||lS,r=e.separatorTemplate||aS,l=e.futureTemplate||cS,d=e.timeTemplate||uS,f=e.dayOfWeekTemplate||dS;return ft.jsxs("div",{className:Qo("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),l(e),d(e),f(e)]})}const hS=e=>{const[t,n]=nt.useState(!1),[r,l]=nt.useState(!1);nt.useEffect(()=>{l(!0)},[]);const d=e.statusTemplate||fS,f=new s_(e.hours,e.timezone),p=f.isOpenNow(),_=f.getCurrentInterval(),T=f.getNextInterval(),E=(_==null?void 0:_.end)||(T==null?void 0:T.start);if(E&&!t){n(!0);const w=E.toMillis()-Ot.now().toMillis();setTimeout(()=>n(!1),w)}const S={isOpen:p,currentInterval:_,futureInterval:T,...e};return ft.jsx(ft.Fragment,{children:r&&d(S,e)})};function gS(e,t){const n=[];return e.forEach(r=>{const l=n[n.length-1];l?oS(l.intervals,r.intervals)?(l.endDay=r.endDay,l.isToday=l.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const l=t&&Di(r.startDay)in t?t[Di(r.startDay)]||"":Di(r.startDay),d=t&&Di(r.endDay)in t?t[Di(r.endDay)]||"":Di(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${l}`:`${l} - ${d}`}})}function pS(e,t){const n=[],r=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):e.intervals.forEach(l=>{const d=l.getStartTime("en-US",t),f=l.getEndTime("en-US",t);n.push(`${d} - ${f}`)}),n}function mS(e,t,n){const r=[];for(let l=1;l<=7;l++){const d=Ot.fromObject({weekday:l}),f=$d(d);r.push({startDay:f,endDay:f,dayName:n&&Di(f).toLowerCase()in n?n[Di(f).toLowerCase()]||"":Di(f),intervals:e.filter(p=>p.start.weekday===l),isToday:t.weekday===l})}return r}const _S=e=>{const[t,n]=nt.useState(!1);nt.useEffect(()=>{n(!0)},[]);const r=new s_(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),l=Ot.now(),d=r.getIntervalsForNDays(7,l);let f=mS(d,l,e.dayOfWeekNames);function p(E){return E?{today:$d(l),monday:ln.Monday,tuesday:ln.Tuesday,wednesday:ln.Wednesday,thursday:ln.Thursday,friday:ln.Friday,saturday:ln.Saturday,sunday:ln.Sunday}[E]:ln.Sunday}let _=[ln.Sunday,ln.Monday,ln.Tuesday,ln.Wednesday,ln.Thursday,ln.Friday,ln.Saturday];const T=_.indexOf(p(e.startOfWeek));return _=sS(_,7-T),f.sort((E,S)=>_.indexOf(E.startDay)-_.indexOf(S.startDay)),e.collapseDays&&(f=gS(f,e.dayOfWeekNames)),ft.jsx(ft.Fragment,{children:t&&ft.jsx("div",{className:Qo("HoursTable",e.className),children:f.map(E=>{const w=(e.intervalStringsBuilderFn||pS)(E,e.timeOptions);return ft.jsxs("div",{className:Qo("HoursTable-row",{"is-today":E.isToday}),children:[ft.jsx("span",{className:"HoursTable-day",children:E.dayName}),ft.jsx("span",{className:"HoursTable-intervals",children:w.map((M,m)=>ft.jsx("span",{className:"HoursTable-interval",children:M},m))})]},E.dayName)})})})},yS=e=>`<script type="application/ld+json">
|
|
109
|
+
`}),n}const qT=(e,t)=>e(t,"i",rs(e,t)),ZT=(e,t)=>e(t,"b",rs(e,t)),JT=(e,t)=>e(t,"u",rs(e,t)),XT=(e,t)=>e(t,"s",rs(e,t)),QT=(e,t)=>e(t,"sub",rs(e,t)),ex=(e,t)=>e(t,"sup",rs(e,t)),tx={emphasis:qT,strong:ZT,underline:JT,strikethrough:XT,subscript:QT,superscript:ex},nx=e=>{const[t,n]=nt.useState();let r;return nt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-dVLsHsji.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[oT],remarkRehypeOptions:{handlers:tx}});n(d)})()},[e.markdown]),t||null};class co extends Error{}class rx extends co{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class ix extends co{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class sx extends co{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class qo extends co{}class sm extends co{constructor(t){super(`Invalid unit ${t}`)}}class mr extends co{}class ys extends co{constructor(){super("Zone is an abstract class")}}const lt="numeric",mi="short",Yr="long",hc={year:lt,month:lt,day:lt},om={year:lt,month:mi,day:lt},ox={year:lt,month:mi,day:lt,weekday:mi},lm={year:lt,month:Yr,day:lt},am={year:lt,month:Yr,day:lt,weekday:Yr},cm={hour:lt,minute:lt},um={hour:lt,minute:lt,second:lt},dm={hour:lt,minute:lt,second:lt,timeZoneName:mi},fm={hour:lt,minute:lt,second:lt,timeZoneName:Yr},hm={hour:lt,minute:lt,hourCycle:"h23"},gm={hour:lt,minute:lt,second:lt,hourCycle:"h23"},pm={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:mi},mm={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:Yr},_m={year:lt,month:lt,day:lt,hour:lt,minute:lt},ym={year:lt,month:lt,day:lt,hour:lt,minute:lt,second:lt},Nm={year:lt,month:mi,day:lt,hour:lt,minute:lt},Cm={year:lt,month:mi,day:lt,hour:lt,minute:lt,second:lt},lx={year:lt,month:mi,day:lt,weekday:mi,hour:lt,minute:lt},Em={year:lt,month:Yr,day:lt,hour:lt,minute:lt,timeZoneName:mi},Tm={year:lt,month:Yr,day:lt,hour:lt,minute:lt,second:lt,timeZoneName:mi},xm={year:lt,month:Yr,day:lt,weekday:Yr,hour:lt,minute:lt,timeZoneName:Yr},vm={year:lt,month:Yr,day:lt,weekday:Yr,hour:lt,minute:lt,second:lt,timeZoneName:Yr};class ca{get type(){throw new ys}get name(){throw new ys}get ianaName(){return this.name}get isUniversal(){throw new ys}offsetName(t,n){throw new ys}formatOffset(t,n){throw new ys}offset(t){throw new ys}equals(t){throw new ys}get isValid(){throw new ys}}let bu=null;class Ec extends ca{static get instance(){return bu===null&&(bu=new Ec),bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Lm(t,n,r)}formatOffset(t,n){return sa(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let sc={};function ax(e){return sc[e]||(sc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),sc[e]}const cx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ux(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,l,d,f,p,_,T,E]=r;return[f,l,d,p,_,T,E]}function dx(e,t){const n=e.formatToParts(t),r=[];for(let l=0;l<n.length;l++){const{type:d,value:f}=n[l],p=cx[d];d==="era"?r[p]=f:Lt(p)||(r[p]=parseInt(f,10))}return r}let Xa={};class ns extends ca{static create(t){return Xa[t]||(Xa[t]=new ns(t)),Xa[t]}static resetCache(){Xa={},sc={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ns.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Lm(t,n,r,this.name)}formatOffset(t,n){return sa(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=ax(this.name);let[l,d,f,p,_,T,E]=r.formatToParts?dx(r,n):ux(r,n);p==="BC"&&(l=-Math.abs(l)+1);const w=xc({year:l,month:d,day:f,hour:_===24?0:_,minute:T,second:E,millisecond:0});let M=+n;const m=M%1e3;return M-=m>=0?m:1e3+m,(w-M)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Og={};function fx(e,t={}){const n=JSON.stringify([e,t]);let r=Og[n];return r||(r=new Intl.ListFormat(e,t),Og[n]=r),r}let Xu={};function Qu(e,t={}){const n=JSON.stringify([e,t]);let r=Xu[n];return r||(r=new Intl.DateTimeFormat(e,t),Xu[n]=r),r}let ed={};function hx(e,t={}){const n=JSON.stringify([e,t]);let r=ed[n];return r||(r=new Intl.NumberFormat(e,t),ed[n]=r),r}let td={};function gx(e,t={}){const{base:n,...r}=t,l=JSON.stringify([e,r]);let d=td[l];return d||(d=new Intl.RelativeTimeFormat(e,t),td[l]=d),d}let ta=null;function px(){return ta||(ta=new Intl.DateTimeFormat().resolvedOptions().locale,ta)}let Dg={};function mx(e){let t=Dg[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Dg[e]=t}return t}function _x(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,l;try{r=Qu(e).resolvedOptions(),l=e}catch{const _=e.substring(0,n);r=Qu(_).resolvedOptions(),l=_}const{numberingSystem:d,calendar:f}=r;return[l,d,f]}}function yx(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Nx(e){const t=[];for(let n=1;n<=12;n++){const r=Ot.utc(2009,n,1);t.push(e(r))}return t}function Cx(e){const t=[];for(let n=1;n<=7;n++){const r=Ot.utc(2016,11,13+n);t.push(e(r))}return t}function Qa(e,t,n,r){const l=e.listingMode();return l==="error"?null:l==="en"?n(t):r(t)}function Ex(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class Tx{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:l,floor:d,...f}=r;if(!n||Object.keys(f).length>0){const p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=hx(t,p)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):Ld(t,3);return Kn(n,this.padTo)}}}class xx{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const f=-1*(t.offset/60),p=f>=0?`Etc/GMT+${f}`:`Etc/GMT${f}`;t.offset!==0&&ns.create(p).valid?(l=p,this.dt=t):(l="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,l=t.zone.name):(l="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||l,this.dtf=Qu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class vx{constructor(t,n,r){this.opts={style:"long",...r},!n&&Rm()&&(this.rtf=gx(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):jx(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const Sx={firstDay:1,minimalDays:4,weekend:[6,7]};class un{static fromOpts(t){return un.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,l,d=!1){const f=t||Rn.defaultLocale,p=f||(d?"en-US":px()),_=n||Rn.defaultNumberingSystem,T=r||Rn.defaultOutputCalendar,E=nd(l)||Rn.defaultWeekSettings;return new un(p,_,T,E,f)}static resetCache(){ta=null,Xu={},ed={},td={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:l}={}){return un.create(t,n,r,l)}constructor(t,n,r,l,d){const[f,p,_]=_x(t);this.locale=f,this.numberingSystem=n||p||null,this.outputCalendar=r||_||null,this.weekSettings=l,this.intl=yx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ex(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:un.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,nd(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Qa(this,t,Pm,()=>{const r=n?{month:t,day:"numeric"}:{month:t},l=n?"format":"standalone";return this.monthsCache[l][t]||(this.monthsCache[l][t]=Nx(d=>this.extract(d,r,"month"))),this.monthsCache[l][t]})}weekdays(t,n=!1){return Qa(this,t,Bm,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},l=n?"format":"standalone";return this.weekdaysCache[l][t]||(this.weekdaysCache[l][t]=Cx(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[l][t]})}meridiems(){return Qa(this,void 0,()=>Hm,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ot.utc(2016,11,13,9),Ot.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Qa(this,t,Wm,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[Ot.utc(-40,1,1),Ot.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const l=this.dtFormatter(t,n),d=l.formatToParts(),f=d.find(p=>p.type.toLowerCase()===r);return f?f.value:null}numberFormatter(t={}){return new Tx(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new xx(t,this.intl,n)}relFormatter(t={}){return new vx(this.intl,this.isEnglish(),t)}listFormatter(t={}){return fx(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bm()?mx(this.locale):Sx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Lu=null;class vr extends ca{static get utcInstance(){return Lu===null&&(Lu=new vr(0)),Lu}static instance(t){return t===0?vr.utcInstance:new vr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new vr(vc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sa(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return sa(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class wx extends ca{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Es(e,t){if(Lt(e)||e===null)return t;if(e instanceof ca)return e;if(bx(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ec.instance:n==="utc"||n==="gmt"?vr.utcInstance:vr.parseSpecifier(n)||ns.create(e)}else return xs(e)?vr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new wx(e)}const Ad={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ag={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ox=Ad.hanidec.replace(/[\[|\]]/g,"").split("");function Dx(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Ad.hanidec)!==-1)t+=Ox.indexOf(e[n]);else for(const l in Ag){const[d,f]=Ag[l];r>=d&&r<=f&&(t+=r-d)}}return parseInt(t,10)}else return t}let Vo={};function Ax(){Vo={}}function hi({numberingSystem:e},t=""){const n=e||"latn";return Vo[n]||(Vo[n]={}),Vo[n][t]||(Vo[n][t]=new RegExp(`${Ad[n]}${t}`)),Vo[n][t]}let Mg=()=>Date.now(),Rg="system",bg=null,Lg=null,Ig=null,kg=60,Pg,$g=null;class Rn{static get now(){return Mg}static set now(t){Mg=t}static set defaultZone(t){Rg=t}static get defaultZone(){return Es(Rg,Ec.instance)}static get defaultLocale(){return bg}static set defaultLocale(t){bg=t}static get defaultNumberingSystem(){return Lg}static set defaultNumberingSystem(t){Lg=t}static get defaultOutputCalendar(){return Ig}static set defaultOutputCalendar(t){Ig=t}static get defaultWeekSettings(){return $g}static set defaultWeekSettings(t){$g=nd(t)}static get twoDigitCutoffYear(){return kg}static set twoDigitCutoffYear(t){kg=t%100}static get throwOnInvalid(){return Pg}static set throwOnInvalid(t){Pg=t}static resetCaches(){un.resetCache(),ns.resetCache(),Ot.resetCache(),Ax()}}class pi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Sm=[0,31,59,90,120,151,181,212,243,273,304,334],wm=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new pi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Md(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const l=r.getUTCDay();return l===0?7:l}function Om(e,t,n){return n+(ua(e)?wm:Sm)[t-1]}function Dm(e,t){const n=ua(e)?wm:Sm,r=n.findIndex(d=>d<t),l=t-n[r];return{month:r+1,day:l}}function Rd(e,t){return(e-t+7)%7+1}function gc(e,t=4,n=1){const{year:r,month:l,day:d}=e,f=Om(r,l,d),p=Rd(Md(r,l,d),n);let _=Math.floor((f-p+14-t)/7),T;return _<1?(T=r-1,_=aa(T,t,n)):_>aa(r,t,n)?(T=r+1,_=1):T=r,{weekYear:T,weekNumber:_,weekday:p,...Sc(e)}}function Fg(e,t=4,n=1){const{weekYear:r,weekNumber:l,weekday:d}=e,f=Rd(Md(r,1,t),n),p=Zo(r);let _=l*7+d-f-7+t,T;_<1?(T=r-1,_+=Zo(T)):_>p?(T=r+1,_-=Zo(r)):T=r;const{month:E,day:S}=Dm(T,_);return{year:T,month:E,day:S,...Sc(e)}}function Iu(e){const{year:t,month:n,day:r}=e,l=Om(t,n,r);return{year:t,ordinal:l,...Sc(e)}}function Bg(e){const{year:t,ordinal:n}=e,{month:r,day:l}=Dm(t,n);return{year:t,month:r,day:l,...Sc(e)}}function Hg(e,t){if(!Lt(e.localWeekday)||!Lt(e.localWeekNumber)||!Lt(e.localWeekYear)){if(!Lt(e.weekday)||!Lt(e.weekNumber)||!Lt(e.weekYear))throw new qo("Cannot mix locale-based week fields with ISO-based week fields");return Lt(e.localWeekday)||(e.weekday=e.localWeekday),Lt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Lt(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Mx(e,t=4,n=1){const r=Tc(e.weekYear),l=ti(e.weekNumber,1,aa(e.weekYear,t,n)),d=ti(e.weekday,1,7);return r?l?d?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function Rx(e){const t=Tc(e.year),n=ti(e.ordinal,1,Zo(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function Am(e){const t=Tc(e.year),n=ti(e.month,1,12),r=ti(e.day,1,pc(e.year,e.month));return t?n?r?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Mm(e){const{hour:t,minute:n,second:r,millisecond:l}=e,d=ti(t,0,23)||t===24&&n===0&&r===0&&l===0,f=ti(n,0,59),p=ti(r,0,59),_=ti(l,0,999);return d?f?p?_?!1:ei("millisecond",l):ei("second",r):ei("minute",n):ei("hour",t)}function Lt(e){return typeof e>"u"}function xs(e){return typeof e=="number"}function Tc(e){return typeof e=="number"&&e%1===0}function bx(e){return typeof e=="string"}function Lx(e){return Object.prototype.toString.call(e)==="[object Date]"}function Rm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ix(e){return Array.isArray(e)?e:[e]}function Wg(e,t,n){if(e.length!==0)return e.reduce((r,l)=>{const d=[t(l),l];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function kx(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function el(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nd(e){if(e==null)return null;if(typeof e!="object")throw new mr("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new mr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return Tc(e)&&e>=t&&e<=n}function Px(e,t){return e-t*Math.floor(e/t)}function Kn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Cs(e){if(!(Lt(e)||e===null||e===""))return parseInt(e,10)}function Qs(e){if(!(Lt(e)||e===null||e===""))return parseFloat(e)}function bd(e){if(!(Lt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Ld(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function ua(e){return e%4===0&&(e%100!==0||e%400===0)}function Zo(e){return ua(e)?366:365}function pc(e,t){const n=Px(t-1,12)+1,r=e+(t-n)/12;return n===2?ua(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function xc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Kg(e,t,n){return-Rd(Md(e,1,t),n)+t-1}function aa(e,t=4,n=1){const r=Kg(e,t,n),l=Kg(e+1,t,n);return(Zo(e)-r+l)/7}function rd(e){return e>99?e:e>Rn.twoDigitCutoffYear?1900+e:2e3+e}function Lm(e,t,n,r=null){const l=new Date(e),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const f={timeZoneName:t,...d},p=new Intl.DateTimeFormat(n,f).formatToParts(l).find(_=>_.type.toLowerCase()==="timezonename");return p?p.value:null}function vc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,l=n<0||Object.is(n,-0)?-r:r;return n*60+l}function Im(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new mr(`Invalid unit value ${e}`);return t}function mc(e,t){const n={};for(const r in e)if(el(e,r)){const l=e[r];if(l==null)continue;n[t(r)]=Im(l)}return n}function sa(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),l=e>=0?"+":"-";switch(t){case"short":return`${l}${Kn(n,2)}:${Kn(r,2)}`;case"narrow":return`${l}${n}${r>0?`:${r}`:""}`;case"techie":return`${l}${Kn(n,2)}${Kn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Sc(e){return kx(e,["hour","minute","second","millisecond"])}const $x=["January","February","March","April","May","June","July","August","September","October","November","December"],km=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Pm(e){switch(e){case"narrow":return[...Fx];case"short":return[...km];case"long":return[...$x];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const $m=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Fm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Bx=["M","T","W","T","F","S","S"];function Bm(e){switch(e){case"narrow":return[...Bx];case"short":return[...Fm];case"long":return[...$m];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Hm=["AM","PM"],Hx=["Before Christ","Anno Domini"],Wx=["BC","AD"],Kx=["B","A"];function Wm(e){switch(e){case"narrow":return[...Kx];case"short":return[...Wx];case"long":return[...Hx];default:return null}}function zx(e){return Hm[e.hour<12?0:1]}function Ux(e,t){return Bm(t)[e.weekday-1]}function Gx(e,t){return Pm(t)[e.month-1]}function Yx(e,t){return Wm(t)[e.year<0?0:1]}function jx(e,t,n="always",r=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},d=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&d){const S=e==="days";switch(t){case 1:return S?"tomorrow":`next ${l[e][0]}`;case-1:return S?"yesterday":`last ${l[e][0]}`;case 0:return S?"today":`this ${l[e][0]}`}}const f=Object.is(t,-0)||t<0,p=Math.abs(t),_=p===1,T=l[e],E=r?_?T[1]:T[2]||T[1]:_?l[e][0]:e;return f?`${p} ${E} ago`:`in ${p} ${E}`}function zg(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Vx={D:hc,DD:om,DDD:lm,DDDD:am,t:cm,tt:um,ttt:dm,tttt:fm,T:hm,TT:gm,TTT:pm,TTTT:mm,f:_m,ff:Nm,fff:Em,ffff:xm,F:ym,FF:Cm,FFF:Tm,FFFF:vm};class _r{static create(t,n={}){return new _r(t,n)}static parseFormat(t){let n=null,r="",l=!1;const d=[];for(let f=0;f<t.length;f++){const p=t.charAt(f);p==="'"?(r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),n=null,r="",l=!l):l||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return Vx[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Kn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(M,m)=>this.loc.extract(t,M,m),f=M=>t.isOffsetFixed&&t.offset===0&&M.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,M.format):"",p=()=>r?zx(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),_=(M,m)=>r?Gx(t,M):d(m?{month:M}:{month:M,day:"numeric"},"month"),T=(M,m)=>r?Ux(t,M):d(m?{weekday:M}:{weekday:M,month:"long",day:"numeric"},"weekday"),E=M=>{const m=_r.macroTokenToFormatOpts(M);return m?this.formatWithSystemDefault(t,m):M},S=M=>r?Yx(t,M):d({era:M},"era"),w=M=>{switch(M){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return f({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return f({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return f({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return p();case"d":return l?d({day:"numeric"},"day"):this.num(t.day);case"dd":return l?d({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return T("short",!0);case"cccc":return T("long",!0);case"ccccc":return T("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return T("short",!1);case"EEEE":return T("long",!1);case"EEEEE":return T("narrow",!1);case"L":return l?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return l?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return _("short",!0);case"LLLL":return _("long",!0);case"LLLLL":return _("narrow",!0);case"M":return l?d({month:"numeric"},"month"):this.num(t.month);case"MM":return l?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return _("short",!1);case"MMMM":return _("long",!1);case"MMMMM":return _("narrow",!1);case"y":return l?d({year:"numeric"},"year"):this.num(t.year);case"yy":return l?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return l?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return l?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return S("short");case"GG":return S("long");case"GGGGG":return S("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return E(M)}};return zg(_r.parseFormat(n),w)}formatDurationFromString(t,n){const r=_=>{switch(_[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=_=>T=>{const E=r(T);return E?this.num(_.get(E),T.length):T},d=_r.parseFormat(n),f=d.reduce((_,{literal:T,val:E})=>T?_:_.concat(E),[]),p=t.shiftTo(...f.map(r).filter(_=>_));return zg(d,l(p))}}const Km=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ll(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function al(...e){return t=>e.reduce(([n,r,l],d)=>{const[f,p,_]=d(t,l);return[{...n,...f},p||r,_]},[{},null,1]).slice(0,2)}function cl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const l=n.exec(e);if(l)return r(l)}return[null,null]}function zm(...e){return(t,n)=>{const r={};let l;for(l=0;l<e.length;l++)r[e[l]]=Cs(t[n+l]);return[r,null,n+l]}}const Um=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,qx=`(?:${Um.source}?(?:\\[(${Km.source})\\])?)?`,Id=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Gm=RegExp(`${Id.source}${qx}`),kd=RegExp(`(?:T${Gm.source})?`),Zx=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Jx=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Xx=/(\d{4})-?(\d{3})/,Qx=zm("weekYear","weekNumber","weekDay"),ev=zm("year","ordinal"),tv=/(\d{4})-(\d\d)-(\d\d)/,Ym=RegExp(`${Id.source} ?(?:${Um.source}|(${Km.source}))?`),nv=RegExp(`(?: ${Ym.source})?`);function Jo(e,t,n){const r=e[t];return Lt(r)?n:Cs(r)}function rv(e,t){return[{year:Jo(e,t),month:Jo(e,t+1,1),day:Jo(e,t+2,1)},null,t+3]}function ul(e,t){return[{hours:Jo(e,t,0),minutes:Jo(e,t+1,0),seconds:Jo(e,t+2,0),milliseconds:bd(e[t+3])},null,t+4]}function da(e,t){const n=!e[t]&&!e[t+1],r=vc(e[t+1],e[t+2]),l=n?null:vr.instance(r);return[{},l,t+3]}function fa(e,t){const n=e[t]?ns.create(e[t]):null;return[{},n,t+1]}const iv=RegExp(`^T?${Id.source}$`),sv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function ov(e){const[t,n,r,l,d,f,p,_,T]=e,E=t[0]==="-",S=_&&_[0]==="-",w=(M,m=!1)=>M!==void 0&&(m||M&&E)?-M:M;return[{years:w(Qs(n)),months:w(Qs(r)),weeks:w(Qs(l)),days:w(Qs(d)),hours:w(Qs(f)),minutes:w(Qs(p)),seconds:w(Qs(_),_==="-0"),milliseconds:w(bd(T),S)}]}const lv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Pd(e,t,n,r,l,d,f){const p={year:t.length===2?rd(Cs(t)):Cs(t),month:km.indexOf(n)+1,day:Cs(r),hour:Cs(l),minute:Cs(d)};return f&&(p.second=Cs(f)),e&&(p.weekday=e.length>3?$m.indexOf(e)+1:Fm.indexOf(e)+1),p}const av=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function cv(e){const[,t,n,r,l,d,f,p,_,T,E,S]=e,w=Pd(t,l,r,n,d,f,p);let M;return _?M=lv[_]:T?M=0:M=vc(E,S),[w,new vr(M)]}function uv(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const dv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,fv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,hv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ug(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,l,r,n,d,f,p),vr.utcInstance]}function gv(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,p,n,r,l,d,f),vr.utcInstance]}const pv=ll(Zx,kd),mv=ll(Jx,kd),_v=ll(Xx,kd),yv=ll(Gm),jm=al(rv,ul,da,fa),Nv=al(Qx,ul,da,fa),Cv=al(ev,ul,da,fa),Ev=al(ul,da,fa);function Tv(e){return cl(e,[pv,jm],[mv,Nv],[_v,Cv],[yv,Ev])}function xv(e){return cl(uv(e),[av,cv])}function vv(e){return cl(e,[dv,Ug],[fv,Ug],[hv,gv])}function Sv(e){return cl(e,[sv,ov])}const wv=al(ul);function Ov(e){return cl(e,[iv,wv])}const Dv=ll(tv,nv),Av=ll(Ym),Mv=al(ul,da,fa);function Rv(e){return cl(e,[Dv,jm],[Av,Mv])}const Gg="Invalid Duration",Vm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},bv={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Vm},Qr=146097/400,Uo=146097/4800,Lv={years:{quarters:4,months:12,weeks:Qr/7,days:Qr,hours:Qr*24,minutes:Qr*24*60,seconds:Qr*24*60*60,milliseconds:Qr*24*60*60*1e3},quarters:{months:3,weeks:Qr/28,days:Qr/4,hours:Qr*24/4,minutes:Qr*24*60/4,seconds:Qr*24*60*60/4,milliseconds:Qr*24*60*60*1e3/4},months:{weeks:Uo/7,days:Uo,hours:Uo*24,minutes:Uo*24*60,seconds:Uo*24*60*60,milliseconds:Uo*24*60*60*1e3},...Vm},so=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Iv=so.slice(0).reverse();function Ns(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Qt(r)}function qm(e,t){let n=t.milliseconds??0;for(const r of Iv.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Yg(e,t){const n=qm(e,t)<0?-1:1;so.reduceRight((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]*n,f=e[l][r],p=Math.floor(d/f);t[l]+=p*n,t[r]-=p*f*n}return l},null),so.reduce((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]%1;t[r]-=d,t[l]+=d*e[r][l]}return l},null)}function kv(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Qt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?Lv:bv;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||un.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Qt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new mr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Qt({values:mc(t,Qt.normalizeUnit),loc:un.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(xs(t))return Qt.fromMillis(t);if(Qt.isDuration(t))return t;if(typeof t=="object")return Qt.fromObject(t);throw new mr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Sv(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Ov(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Duration is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new sx(r);return new Qt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new sm(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?_r.create(this.loc,r).formatDurationFromString(this,t):Gg}toHuman(t={}){if(!this.isValid)return Gg;const n=so.map(r=>{const l=this.values[r];return Lt(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(l)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Ld(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Ot.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?qm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t),r={};for(const l of so)(el(n.values,l)||el(this.values,l))&&(r[l]=n.get(l)+this.get(l));return Ns(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Im(t(this.values[r],r));return Ns(this,{values:n},!0)}get(t){return this[Qt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...mc(t,Qt.normalizeUnit)};return Ns(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:l}={}){const f={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:l,conversionAccuracy:r};return Ns(this,f)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Yg(this.matrix,t),Ns(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=kv(this.normalize().shiftToAll().toObject());return Ns(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(f=>Qt.normalizeUnit(f));const n={},r={},l=this.toObject();let d;for(const f of so)if(t.indexOf(f)>=0){d=f;let p=0;for(const T in r)p+=this.matrix[T][f]*r[T],r[T]=0;xs(l[f])&&(p+=l[f]);const _=Math.trunc(p);n[f]=_,r[f]=(p*1e3-_*1e3)/1e3}else xs(l[f])&&(r[f]=l[f]);for(const f in r)r[f]!==0&&(n[d]+=f===d?r[f]:r[f]/this.matrix[d][f]);return Yg(this.matrix,n),Ns(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Ns(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,l){return r===void 0||r===0?l===void 0||l===0:r===l}for(const r of so)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Go="Invalid Interval";function Pv(e,t){return!e||!e.isValid?Mn.invalid("missing or invalid start"):!t||!t.isValid?Mn.invalid("missing or invalid end"):t<e?Mn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Mn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Interval is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new ix(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Xl(t),l=Xl(n),d=Pv(r,l);return d??new Mn({start:r,end:l})}static after(t,n){const r=Qt.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l,l.plus(r))}static before(t,n){const r=Qt.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l.minus(r),l)}static fromISO(t,n){const[r,l]=(t||"").split("/",2);if(r&&l){let d,f;try{d=Ot.fromISO(r,n),f=d.isValid}catch{f=!1}let p,_;try{p=Ot.fromISO(l,n),_=p.isValid}catch{_=!1}if(f&&_)return Mn.fromDateTimes(d,p);if(f){const T=Qt.fromISO(l,n);if(T.isValid)return Mn.after(d,T)}else if(_){const T=Qt.fromISO(r,n);if(T.isValid)return Mn.before(p,T)}}return Mn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let l;return n!=null&&n.useLocaleWeeks?l=this.end.reconfigure({locale:r.locale}):l=this.end,l=l.startOf(t,n),Math.floor(l.diff(r,t).get(t))+(l.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Mn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Xl).filter(f=>this.contains(f)).sort((f,p)=>f.toMillis()-p.toMillis()),r=[];let{s:l}=this,d=0;for(;l<this.e;){const f=n[d]||this.e,p=+f>+this.e?this.e:f;r.push(Mn.fromDateTimes(l,p)),l=p,d+=1}return r}splitBy(t){const n=Qt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,l=1,d;const f=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(_=>_*l));d=+p>+this.e?this.e:p,f.push(Mn.fromDateTimes(r,d)),r=d,l+=1}return f}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Mn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Mn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((l,d)=>l.s-d.s).reduce(([l,d],f)=>d?d.overlaps(f)||d.abutsStart(f)?[l,d.union(f)]:[l.concat([d]),f]:[l,f],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const l=[],d=t.map(_=>[{time:_.s,type:"s"},{time:_.e,type:"e"}]),f=Array.prototype.concat(...d),p=f.sort((_,T)=>_.time-T.time);for(const _ of p)r+=_.type==="s"?1:-1,r===1?n=_.time:(n&&+n!=+_.time&&l.push(Mn.fromDateTimes(n,_.time)),n=null);return Mn.merge(l)}difference(...t){return Mn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Go}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=hc,n={}){return this.isValid?_r.create(this.s.loc.clone(n),t).formatInterval(this):Go}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Go}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Go}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Go}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Go}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Qt.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class ec{static hasDST(t=Rn.defaultZone){const n=Ot.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return ns.isValidZone(t)}static normalizeZone(t){return Es(t,Rn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return un.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return un.create(n,null,"gregory").eras(t)}static features(){return{relative:Rm(),localeWeek:bm()}}}function jg(e,t){const n=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Qt.fromMillis(r).as("days"))}function $v(e,t,n){const r=[["years",(_,T)=>T.year-_.year],["quarters",(_,T)=>T.quarter-_.quarter+(T.year-_.year)*4],["months",(_,T)=>T.month-_.month+(T.year-_.year)*12],["weeks",(_,T)=>{const E=jg(_,T);return(E-E%7)/7}],["days",jg]],l={},d=e;let f,p;for(const[_,T]of r)n.indexOf(_)>=0&&(f=_,l[_]=T(e,t),p=d.plus(l),p>t?(l[_]--,e=d.plus(l),e>t&&(p=e,l[_]--,e=d.plus(l))):e=p);return[e,l,p,f]}function Fv(e,t,n,r){let[l,d,f,p]=$v(e,t,n);const _=t-l,T=n.filter(S=>["hours","minutes","seconds","milliseconds"].indexOf(S)>=0);T.length===0&&(f<t&&(f=l.plus({[p]:1})),f!==l&&(d[p]=(d[p]||0)+_/(f-l)));const E=Qt.fromObject(d,r);return T.length>0?Qt.fromMillis(_,r).shiftTo(...T).plus(E):E}const Bv="missing Intl.DateTimeFormat.formatToParts support";function on(e,t=n=>n){return{regex:e,deser:([n])=>t(Dx(n))}}const Hv=" ",Zm=`[ ${Hv}]`,Jm=new RegExp(Zm,"g");function Wv(e){return e.replace(/\./g,"\\.?").replace(Jm,Zm)}function Vg(e){return e.replace(/\./g,"").replace(Jm," ").toLowerCase()}function gi(e,t){return e===null?null:{regex:RegExp(e.map(Wv).join("|")),deser:([n])=>e.findIndex(r=>Vg(n)===Vg(r))+t}}function qg(e,t){return{regex:e,deser:([,n,r])=>vc(n,r),groups:t}}function tc(e){return{regex:e,deser:([t])=>t}}function Kv(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function zv(e,t){const n=hi(t),r=hi(t,"{2}"),l=hi(t,"{3}"),d=hi(t,"{4}"),f=hi(t,"{6}"),p=hi(t,"{1,2}"),_=hi(t,"{1,3}"),T=hi(t,"{1,6}"),E=hi(t,"{1,9}"),S=hi(t,"{2,4}"),w=hi(t,"{4,6}"),M=k=>({regex:RegExp(Kv(k.val)),deser:([G])=>G,literal:!0}),v=(k=>{if(e.literal)return M(k);switch(k.val){case"G":return gi(t.eras("short"),0);case"GG":return gi(t.eras("long"),0);case"y":return on(T);case"yy":return on(S,rd);case"yyyy":return on(d);case"yyyyy":return on(w);case"yyyyyy":return on(f);case"M":return on(p);case"MM":return on(r);case"MMM":return gi(t.months("short",!0),1);case"MMMM":return gi(t.months("long",!0),1);case"L":return on(p);case"LL":return on(r);case"LLL":return gi(t.months("short",!1),1);case"LLLL":return gi(t.months("long",!1),1);case"d":return on(p);case"dd":return on(r);case"o":return on(_);case"ooo":return on(l);case"HH":return on(r);case"H":return on(p);case"hh":return on(r);case"h":return on(p);case"mm":return on(r);case"m":return on(p);case"q":return on(p);case"qq":return on(r);case"s":return on(p);case"ss":return on(r);case"S":return on(_);case"SSS":return on(l);case"u":return tc(E);case"uu":return tc(p);case"uuu":return on(n);case"a":return gi(t.meridiems(),0);case"kkkk":return on(d);case"kk":return on(S,rd);case"W":return on(p);case"WW":return on(r);case"E":case"c":return on(n);case"EEE":return gi(t.weekdays("short",!1),1);case"EEEE":return gi(t.weekdays("long",!1),1);case"ccc":return gi(t.weekdays("short",!0),1);case"cccc":return gi(t.weekdays("long",!0),1);case"Z":case"ZZ":return qg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return qg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return tc(/[a-z_+-/]{1,256}?/i);case" ":return tc(/[^\S\n\r]/);default:return M(k)}})(e)||{invalidReason:Bv};return v.token=e,v}const Uv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Gv(e,t,n){const{type:r,value:l}=e;if(r==="literal"){const _=/^\s+$/.test(l);return{literal:!_,val:_?" ":l}}const d=t[r];let f=r;r==="hour"&&(t.hour12!=null?f=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?f="hour12":f="hour24":f=n.hour12?"hour12":"hour24");let p=Uv[f];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Yv(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function jv(e,t,n){const r=e.match(t);if(r){const l={};let d=1;for(const f in n)if(el(n,f)){const p=n[f],_=p.groups?p.groups+1:1;!p.literal&&p.token&&(l[p.token.val[0]]=p.deser(r.slice(d,d+_))),d+=_}return[r,l]}else return[r,{}]}function Vv(e){const t=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(e.z)||(n=ns.create(e.z)),Lt(e.Z)||(n||(n=new vr(e.Z)),r=e.Z),Lt(e.q)||(e.M=(e.q-1)*3+1),Lt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Lt(e.u)||(e.S=bd(e.u)),[Object.keys(e).reduce((d,f)=>{const p=t(f);return p&&(d[p]=e[f]),d},{}),n,r]}let ku=null;function qv(){return ku||(ku=Ot.fromMillis(1555555555555)),ku}function Zv(e,t){if(e.literal)return e;const n=_r.macroTokenToFormatOpts(e.val),r=t_(n,t);return r==null||r.includes(void 0)?e:r}function Xm(e,t){return Array.prototype.concat(...e.map(n=>Zv(n,t)))}class Qm{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Xm(_r.parseFormat(n),t),this.units=this.tokens.map(r=>zv(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,l]=Yv(this.units);this.regex=RegExp(r,"i"),this.handlers=l}}explainFromTokens(t){if(this.isValid){const[n,r]=jv(t,this.regex,this.handlers),[l,d,f]=r?Vv(r):[null,null,void 0];if(el(r,"a")&&el(r,"H"))throw new qo("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:l,zone:d,specificOffset:f}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function e_(e,t,n){return new Qm(e,n).explainFromTokens(t)}function Jv(e,t,n){const{result:r,zone:l,specificOffset:d,invalidReason:f}=e_(e,t,n);return[r,l,d,f]}function t_(e,t){if(!e)return null;const r=_r.create(t,e).dtFormatter(qv()),l=r.formatToParts(),d=r.resolvedOptions();return l.map(f=>Gv(f,e,d))}const Pu="Invalid DateTime",Xv=864e13;function na(e){return new pi("unsupported zone",`the zone "${e.name}" is not supported`)}function $u(e){return e.weekData===null&&(e.weekData=gc(e.c)),e.weekData}function Fu(e){return e.localWeekData===null&&(e.localWeekData=gc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function eo(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ot({...n,...t,old:n})}function n_(e,t,n){let r=e-t*60*1e3;const l=n.offset(r);if(t===l)return[r,t];r-=(l-t)*60*1e3;const d=n.offset(r);return l===d?[r,l]:[e-Math.min(l,d)*60*1e3,Math.max(l,d)]}function nc(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function oc(e,t,n){return n_(xc(e),t,n)}function Zg(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),l=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:l,day:Math.min(e.c.day,pc(r,l))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},f=Qt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),p=xc(d);let[_,T]=n_(p,n,e.zone);return f!==0&&(_+=f,T=e.zone.offset(_)),{ts:_,o:T}}function Yo(e,t,n,r,l,d){const{setZone:f,zone:p}=n;if(e&&Object.keys(e).length!==0||t){const _=t||p,T=Ot.fromObject(e,{...n,zone:_,specificOffset:d});return f?T:T.setZone(p)}else return Ot.invalid(new pi("unparsable",`the input "${l}" can't be parsed as ${r}`))}function rc(e,t,n=!0){return e.isValid?_r.create(un.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Bu(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Kn(e.c.year,n?6:4),t?(r+="-",r+=Kn(e.c.month),r+="-",r+=Kn(e.c.day)):(r+=Kn(e.c.month),r+=Kn(e.c.day)),r}function Jg(e,t,n,r,l,d){let f=Kn(e.c.hour);return t?(f+=":",f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=":")):f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=Kn(e.c.second),(e.c.millisecond!==0||!r)&&(f+=".",f+=Kn(e.c.millisecond,3))),l&&(e.isOffsetFixed&&e.offset===0&&!d?f+="Z":e.o<0?(f+="-",f+=Kn(Math.trunc(-e.o/60)),f+=":",f+=Kn(Math.trunc(-e.o%60))):(f+="+",f+=Kn(Math.trunc(e.o/60)),f+=":",f+=Kn(Math.trunc(e.o%60)))),d&&(f+="["+e.zone.ianaName+"]"),f}const r_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Qv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},eS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},i_=["year","month","day","hour","minute","second","millisecond"],tS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],nS=["year","ordinal","hour","minute","second","millisecond"];function rS(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new sm(e);return t}function Xg(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return rS(e)}}function iS(e){return ac[e]||(lc===void 0&&(lc=Rn.now()),ac[e]=e.offset(lc)),ac[e]}function Qg(e,t){const n=Es(t.zone,Rn.defaultZone);if(!n.isValid)return Ot.invalid(na(n));const r=un.fromObject(t);let l,d;if(Lt(e.year))l=Rn.now();else{for(const _ of i_)Lt(e[_])&&(e[_]=r_[_]);const f=Am(e)||Mm(e);if(f)return Ot.invalid(f);const p=iS(n);[l,d]=oc(e,p,n)}return new Ot({ts:l,zone:n,loc:r,o:d})}function ep(e,t,n){const r=Lt(n.round)?!0:n.round,l=(f,p)=>(f=Ld(f,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(f,p)),d=f=>n.calendary?t.hasSame(e,f)?0:t.startOf(f).diff(e.startOf(f),f).get(f):t.diff(e,f).get(f);if(n.unit)return l(d(n.unit),n.unit);for(const f of n.units){const p=d(f);if(Math.abs(p)>=1)return l(p,f)}return l(e>t?-0:0,n.units[n.units.length-1])}function tp(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let lc,ac={};class Ot{constructor(t){const n=t.zone||Rn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new pi("invalid input"):null)||(n.isValid?null:na(n));this.ts=Lt(t.ts)?Rn.now():t.ts;let l=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[l,d]=[t.old.c,t.old.o];else{const p=xs(t.o)&&!t.old?t.o:n.offset(this.ts);l=nc(this.ts,p),r=Number.isNaN(l.year)?new pi("invalid input"):null,l=r?null:l,d=r?null:p}this._zone=n,this.loc=t.loc||un.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=l,this.o=d,this.isLuxonDateTime=!0}static now(){return new Ot({})}static local(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static utc(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return t.zone=vr.utcInstance,Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static fromJSDate(t,n={}){const r=Lx(t)?t.valueOf():NaN;if(Number.isNaN(r))return Ot.invalid("invalid input");const l=Es(n.zone,Rn.defaultZone);return l.isValid?new Ot({ts:r,zone:l,loc:un.fromObject(n)}):Ot.invalid(na(l))}static fromMillis(t,n={}){if(xs(t))return t<-864e13||t>Xv?Ot.invalid("Timestamp out of range"):new Ot({ts:t,zone:Es(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(xs(t))return new Ot({ts:t*1e3,zone:Es(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Es(n.zone,Rn.defaultZone);if(!r.isValid)return Ot.invalid(na(r));const l=un.fromObject(n),d=mc(t,Xg),{minDaysInFirstWeek:f,startOfWeek:p}=Hg(d,l),_=Rn.now(),T=Lt(n.specificOffset)?r.offset(_):n.specificOffset,E=!Lt(d.ordinal),S=!Lt(d.year),w=!Lt(d.month)||!Lt(d.day),M=S||w,m=d.weekYear||d.weekNumber;if((M||E)&&m)throw new qo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&E)throw new qo("Can't mix ordinal dates with month/day");const v=m||d.weekday&&!M;let k,G,I=nc(_,T);v?(k=tS,G=Qv,I=gc(I,f,p)):E?(k=nS,G=eS,I=Iu(I)):(k=i_,G=r_);let P=!1;for(const z of k){const q=d[z];Lt(q)?P?d[z]=G[z]:d[z]=I[z]:P=!0}const H=v?Mx(d,f,p):E?Rx(d):Am(d),j=H||Mm(d);if(j)return Ot.invalid(j);const re=v?Fg(d,f,p):E?Bg(d):d,[te,ce]=oc(re,T,r),V=new Ot({ts:te,zone:r,o:ce,loc:l});return d.weekday&&M&&t.weekday!==V.weekday?Ot.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${V.toISO()}`):V.isValid?V:Ot.invalid(V.invalid)}static fromISO(t,n={}){const[r,l]=Tv(t);return Yo(r,l,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,l]=xv(t);return Yo(r,l,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,l]=vv(t);return Yo(r,l,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0}),[p,_,T,E]=Jv(f,t,n);return E?Ot.invalid(E):Yo(p,_,r,`format ${n}`,t,T)}static fromString(t,n,r={}){return Ot.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,l]=Rv(t);return Yo(r,l,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the DateTime is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new rx(r);return new Ot({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=t_(t,un.fromObject(n));return r?r.map(l=>l?l.val:null).join(""):null}static expandFormat(t,n={}){return Xm(_r.parseFormat(t),un.fromObject(n)).map(l=>l.val).join("")}static resetCache(){lc=void 0,ac={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?$u(this).weekYear:NaN}get weekNumber(){return this.isValid?$u(this).weekNumber:NaN}get weekday(){return this.isValid?$u(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Fu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Fu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Fu(this).weekYear:NaN}get ordinal(){return this.isValid?Iu(this.c).ordinal:NaN}get monthShort(){return this.isValid?ec.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ec.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ec.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ec.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=xc(this.c),l=this.zone.offset(r-t),d=this.zone.offset(r+t),f=this.zone.offset(r-l*n),p=this.zone.offset(r-d*n);if(f===p)return[this];const _=r-f*n,T=r-p*n,E=nc(_,f),S=nc(T,p);return E.hour===S.hour&&E.minute===S.minute&&E.second===S.second&&E.millisecond===S.millisecond?[eo(this,{ts:_}),eo(this,{ts:T})]:[this]}get isInLeapYear(){return ua(this.year)}get daysInMonth(){return pc(this.year,this.month)}get daysInYear(){return this.isValid?Zo(this.year):NaN}get weeksInWeekYear(){return this.isValid?aa(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?aa(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:l}=_r.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:l}}toUTC(t=0,n={}){return this.setZone(vr.instance(t),n)}toLocal(){return this.setZone(Rn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Es(t,Rn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let l=this.ts;if(n||r){const d=t.offset(this.ts),f=this.toObject();[l]=oc(f,d,t)}return eo(this,{ts:l,zone:t})}else return Ot.invalid(na(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const l=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return eo(this,{loc:l})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=mc(t,Xg),{minDaysInFirstWeek:r,startOfWeek:l}=Hg(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),f=!Lt(n.ordinal),p=!Lt(n.year),_=!Lt(n.month)||!Lt(n.day),T=p||_,E=n.weekYear||n.weekNumber;if((T||f)&&E)throw new qo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new qo("Can't mix ordinal dates with month/day");let S;d?S=Fg({...gc(this.c,r,l),...n},r,l):Lt(n.ordinal)?(S={...this.toObject(),...n},Lt(n.day)&&(S.day=Math.min(pc(S.year,S.month),S.day))):S=Bg({...Iu(this.c),...n});const[w,M]=oc(S,this.o,this.zone);return eo(this,{ts:w,o:M})}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return eo(this,Zg(this,n))}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t).negate();return eo(this,Zg(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},l=Qt.normalizeUnit(t);switch(l){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(l==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:f}=this;f<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(l==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?_r.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Pu}toLocaleString(t=hc,n={}){return this.isValid?_r.create(this.loc.clone(n),t).formatDateTime(this):Pu}toLocaleParts(t={}){return this.isValid?_r.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:l=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const f=t==="extended";let p=Bu(this,f);return p+="T",p+=Jg(this,f,n,r,l,d),p}toISODate({format:t="extended"}={}){return this.isValid?Bu(this,t==="extended"):null}toISOWeekDate(){return rc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:l=!1,extendedZone:d=!1,format:f="extended"}={}){return this.isValid?(l?"T":"")+Jg(this,f==="extended",n,t,r,d):null}toRFC2822(){return rc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return rc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Bu(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let l="HH:mm:ss.SSS";return(n||t)&&(r&&(l+=" "),n?l+="z":t&&(l+="ZZ")),rc(this,l,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Pu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Qt.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Ix(n).map(Qt.normalizeUnit),f=t.valueOf()>this.valueOf(),p=f?this:t,_=f?t:this,T=Fv(p,_,d,l);return f?T.negate():T}diffNow(t="milliseconds",n={}){return this.diff(Ot.now(),t,n)}until(t){return this.isValid?Mn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const l=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=l&&l<=d.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||Ot.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let l=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(l=t.unit,d=void 0),ep(n,this.plus(r),{...t,numeric:"always",units:l,unit:d})}toRelativeCalendar(t={}){return this.isValid?ep(t.base||Ot.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Ot.isDateTime))throw new mr("min requires all arguments be DateTimes");return Wg(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(Ot.isDateTime))throw new mr("max requires all arguments be DateTimes");return Wg(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});return e_(f,t,n)}static fromStringExplain(t,n,r={}){return Ot.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:l=null}=n,d=un.fromOpts({locale:r,numberingSystem:l,defaultToEN:!0});return new Qm(d,t)}static fromFormatParser(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});if(!f.equals(n.locale))throw new mr(`fromFormatParser called with a locale of ${f}, but the format parser was created for ${n.locale}`);const{result:p,zone:_,specificOffset:T,invalidReason:E}=n.explainFromTokens(t);return E?Ot.invalid(E):Yo(p,_,r,`format ${n.format}`,t,T)}static get DATE_SHORT(){return hc}static get DATE_MED(){return om}static get DATE_MED_WITH_WEEKDAY(){return ox}static get DATE_FULL(){return lm}static get DATE_HUGE(){return am}static get TIME_SIMPLE(){return cm}static get TIME_WITH_SECONDS(){return um}static get TIME_WITH_SHORT_OFFSET(){return dm}static get TIME_WITH_LONG_OFFSET(){return fm}static get TIME_24_SIMPLE(){return hm}static get TIME_24_WITH_SECONDS(){return gm}static get TIME_24_WITH_SHORT_OFFSET(){return pm}static get TIME_24_WITH_LONG_OFFSET(){return mm}static get DATETIME_SHORT(){return _m}static get DATETIME_SHORT_WITH_SECONDS(){return ym}static get DATETIME_MED(){return Nm}static get DATETIME_MED_WITH_SECONDS(){return Cm}static get DATETIME_MED_WITH_WEEKDAY(){return lx}static get DATETIME_FULL(){return Em}static get DATETIME_FULL_WITH_SECONDS(){return Tm}static get DATETIME_HUGE(){return xm}static get DATETIME_HUGE_WITH_SECONDS(){return vm}}function Xl(e){if(Ot.isDateTime(e))return e;if(e&&e.valueOf&&xs(e.valueOf()))return Ot.fromJSDate(e);if(e&&typeof e=="object")return Ot.fromObject(e);throw new mr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var ln=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(ln||{});function $d(e){const t={1:ln.Monday,2:ln.Tuesday,3:ln.Wednesday,4:ln.Thursday,5:ln.Friday,6:ln.Saturday,7:ln.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function Di(e){return{[ln.Monday]:"Monday",[ln.Tuesday]:"Tuesday",[ln.Wednesday]:"Wednesday",[ln.Thursday]:"Thursday",[ln.Friday]:"Friday",[ln.Saturday]:"Saturday",[ln.Sunday]:"Sunday"}[e]}class np{constructor(t,n,r){Ie(this,"end");Ie(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(T=>{if(T.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[l,d]=n.start.split(":"),[f,p]=n.end.split(":");let _=0;f<l&&(_=1),this.end=this.end.set({hour:Number(f),minute:Number(p),day:this.end.day+_}),this.start=this.start.set({hour:Number(l),minute:Number(d)}),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(t){return this.start<=t&&t<this.end}getStartTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(t||"en-US").toLocaleString(r)}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r)}timeIsEqualTo(t){const n=this.getStartTime()===t.getStartTime(),r=this.getEndTime()===t.getEndTime();return n&&r}is24h(){const t=this.start.minute===0&&this.start.hour===0,n=this.end.minute===0&&this.end.hour===0,r=this.end.day-this.start.day===1||this.end.day===1;return t&&n&&r}}class s_{constructor(t,n){Ie(this,"holidayHoursByDate");Ie(this,"hours");Ie(this,"timezone");this.holidayHoursByDate=Object.fromEntries((t.holidayHours||[]).map(r=>[r.date,r])),this.hours=t,this.timezone=n}getInterval(t){if(this.isTemporarilyClosedAt(t))return null;let n=t;n=n.minus({days:1});for(const r of[n,t]){const l=this.getHours(r);if(l&&!l.isClosed)for(const d of l.openIntervals||[]){const f=new np(r,d,this.timezone);if(f.contains(t))return f}}return null}getCurrentInterval(){return this.getInterval(Ot.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,f)=>d.start===f.start?0:d.start>f.start?1:-1,l=n.sort(r);for(const[d,f]of l.entries())if(f.contains(t)&&l.length>d+1)return l[d+1];for(const d of l)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let l=0;l<t;l++){let d=n;d=d.plus({days:l});const f=this.getHours(d);f&&!f.isClosed&&r.push(...f.openIntervals.map(p=>new np(d,p,this.timezone)))}return r}getHolidayHours(t){return this.isTemporarilyClosedAt(t)?null:this.holidayHoursByDate[(t.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(t){if(this.isTemporarilyClosedAt(t))return null;const n=Di($d(t)).toLowerCase();return this.hours[n]}getHours(t){const n=this.getHolidayHours(t);return!n||n.isRegularHours?this.getNormalHours(t):n}getNextInterval(){return this.getIntervalAfter(Ot.now())}isHoliday(t){return!!this.getHolidayHours(t)}isTemporarilyClosedAt(t){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,l,d]=n,f=Ot.fromObject({year:Number(r),month:Number(l),day:Number(d)},{zone:this.timezone});if(t<f)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(Ot.now())}}function sS(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function oS(e,t){if(e.length!==t.length)return!1;for(const[n,r]of e.entries())if(!r.timeIsEqualTo(t[n]))return!1;return!0}function ha(e){var t,n;return((n=(t=e==null?void 0:e.currentInterval)==null?void 0:t.is24h)==null?void 0:n.call(t))||!1}function ga(e){return!e.futureInterval}function lS(e){return ha(e)?at.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):ga(e)?at.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):at.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function aS(e){return ha(e)||ga(e)?null:at.jsx("span",{className:"HoursStatus-separator",children:" • "})}function cS(e){return ha(e)||ga(e)?null:at.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function uS(e){if(ha(e)||ga(e))return null;let t="";if(e.isOpen){const n=e.currentInterval;t+=n?n.getEndTime("en-US",e.timeOptions):""}else{const n=e.futureInterval;t+=n?n.getStartTime("en-US",e.timeOptions):""}return at.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function dS(e){var r,l;if(ha(e)||ga(e))return null;const t={weekday:"long",...e.dayOptions??{}};let n="";if(e.isOpen){const d=e.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(t))||""}else{const d=e.futureInterval;n+=((l=d==null?void 0:d.start)==null?void 0:l.setLocale("en-US").toLocaleString(t))||""}return at.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function fS(e,t){const n=e.currentTemplate||lS,r=e.separatorTemplate||aS,l=e.futureTemplate||cS,d=e.timeTemplate||uS,f=e.dayOfWeekTemplate||dS;return at.jsxs("div",{className:Qo("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),l(e),d(e),f(e)]})}const hS={minHeight:`${1.5}em`},gS=e=>{const[t,n]=nt.useState(!1),[r,l]=nt.useState(!1);nt.useEffect(()=>{l(!0)},[]);const d=e.statusTemplate||fS,f=new s_(e.hours,e.timezone),p=f.isOpenNow(),_=f.getCurrentInterval(),T=f.getNextInterval(),E=(_==null?void 0:_.end)||(T==null?void 0:T.start);if(E&&!t){n(!0);const w=E.toMillis()-Ot.now().toMillis();setTimeout(()=>n(!1),w)}const S={isOpen:p,currentInterval:_,futureInterval:T,...e};return at.jsx(at.Fragment,{children:r?d(S,e):at.jsx("div",{style:hS})})};function pS(e,t){const n=[];return e.forEach(r=>{const l=n[n.length-1];l?oS(l.intervals,r.intervals)?(l.endDay=r.endDay,l.isToday=l.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const l=t&&Di(r.startDay)in t?t[Di(r.startDay)]||"":Di(r.startDay),d=t&&Di(r.endDay)in t?t[Di(r.endDay)]||"":Di(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${l}`:`${l} - ${d}`}})}function mS(e,t){const n=[],r=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):e.intervals.forEach(l=>{const d=l.getStartTime("en-US",t),f=l.getEndTime("en-US",t);n.push(`${d} - ${f}`)}),n}function _S(e,t,n){const r=[];for(let l=1;l<=7;l++){const d=Ot.fromObject({weekday:l}),f=$d(d);r.push({startDay:f,endDay:f,dayName:n&&Di(f).toLowerCase()in n?n[Di(f).toLowerCase()]||"":Di(f),intervals:e.filter(p=>p.start.weekday===l),isToday:t.weekday===l})}return r}const yS=e=>{const[t,n]=nt.useState(!1);nt.useEffect(()=>{n(!0)},[]);const r=new s_(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),l=Ot.now(),d=r.getIntervalsForNDays(7,l);let f=_S(d,l,e.dayOfWeekNames);function p(S){return S?{today:$d(l),monday:ln.Monday,tuesday:ln.Tuesday,wednesday:ln.Wednesday,thursday:ln.Thursday,friday:ln.Friday,saturday:ln.Saturday,sunday:ln.Sunday}[S]:ln.Sunday}let _=[ln.Sunday,ln.Monday,ln.Tuesday,ln.Wednesday,ln.Thursday,ln.Friday,ln.Saturday];const T=_.indexOf(p(e.startOfWeek));_=sS(_,7-T),f.sort((S,w)=>_.indexOf(S.startDay)-_.indexOf(w.startDay)),e.collapseDays&&(f=pS(f,e.dayOfWeekNames));const E=nt.useMemo(()=>({minHeight:`${f.length*1.5}em`}),[f.length]);return at.jsx(at.Fragment,{children:t?at.jsx("div",{className:Qo("HoursTable",e.className),children:f.map(S=>{const M=(e.intervalStringsBuilderFn||mS)(S,e.timeOptions);return at.jsxs("div",{className:Qo("HoursTable-row",{"is-today":S.isToday}),children:[at.jsx("span",{className:"HoursTable-day",children:S.dayName}),at.jsx("span",{className:"HoursTable-intervals",children:M.map((m,v)=>at.jsx("span",{className:"HoursTable-interval",children:m},v))})]},S.dayName)})}):at.jsx("div",{style:E})})},NS=e=>`<script type="application/ld+json">
|
|
110
110
|
${JSON.stringify(e)}
|
|
111
|
-
<\/script>`,wc=(e,t)=>({"@context":"https://schema.org","@type":t,name:e.name}),NS=e=>typeof e!="object"?!1:"name"in e||"address"in e,CS=e=>typeof e!="object"?!1:"line1"in e||"city"in e||"region"in e||"postalCode"in e||"countryCode"in e,Fd=e=>CS(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},o_=e=>NS(e)&&{"@type":"Place",name:e.name,...Fd(e.address)},l_=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image,Oc=e=>{if(!e)return{};const t=new Array;for(const n of e)l_(n)&&t.push(n.image.url);return{image:t}},ES=e=>l_(e)&&{image:e.image.url},TS=e=>typeof e!="object"?!1:"url"in e||"name"in e,xS=e=>Array.isArray(e),a_=e=>xS(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},c_=e=>TS(e)&&{organizer:{"@type":"Organization",name:e.name,url:e.url}},vS=e=>typeof e!="object"?!1:"url"in e||"priceCurrency"in e||"price"in e||"priceValidUntil"in e||"itemCondition"in e||"availability"in e,Bd=e=>vS(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},SS=(e,t)=>({...wc(e,t??"Event"),...Oc(e.photoGallery),...o_({name:e.geomodifier,address:e.address}),startDate:e.c_startDate,endDate:e.c_endDate,description:e.description,eventAttendanceMode:e.attendance,eventStatus:e.eventStatus,...a_(e.performers),...c_({name:e.organizerName}),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate})}),wS=e=>typeof e!="object"?!1:"monday"in e||"tuesday"in e||"wednesday"in e||"thursday"in e||"friday"in e||"saturday"in e||"sunday"in e,OS=e=>typeof e=="object"&&"isClosed"in e&&Array.isArray(e.openIntervals)?e.openIntervals.length===0?!0:e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,u_=e=>{if(!wS(e))return{};let t=new Map;t=to(e.monday,t,"Mo"),t=to(e.tuesday,t,"Tu"),t=to(e.wednesday,t,"We"),t=to(e.thursday,t,"Th"),t=to(e.friday,t,"Fr"),t=to(e.saturday,t,"Sa"),t=to(e.sunday,t,"Su");const n=new Array;for(const[r,l]of t){const d=l.join(",");n.push(d+" "+r)}return{openingHours:n}},to=(e,t,n)=>{if(!OS(e)||e.isClosed){const r="00:00-00:00",l=t.get(r)??[];return l.push(n),t.set(r,l),t}for(let r=0;r<e.openIntervals.length;r++){const l=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(l)??[];d.push(n),t.set(l,d)}return t},DS=(e,t)=>({...wc(e,t??"LocalBusiness"),...Fd(e.address),...u_(e.hours),...Oc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),AS=e=>typeof e!="object"?!1:"ratingValue"in e||"bestRating"in e||"author"in e,MS=e=>typeof e!="object"?!1:"ratingValue"in e||"reviewCount"in e,d_=e=>AS(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},author:{"@type":"Person",name:e.author}}},f_=e=>MS(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,RS=(e,t)=>({...wc(e,t??"Product"),...Oc(e.photoGallery),...d_(e.c_reviews),...f_(e.c_aggregateRating),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate}),description:e.description,sku:e.sku,mpn:e.mpn,brand:{"@type":"Brand",name:e.brand}}),bS=e=>typeof e!="object"?!1:"question"in e&&"answer"in e,LS=e=>typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function id(e,t){for(const n in e)if(typeof e[n]=="object")if(Array.isArray(e[n]))for(let r=0;r<e[n].length;r++)id(e[n][r],t);else id(e[n],t);else n==="text"&&t.push(e[n])}function IS(e){if(e.json){const t=[];return id(e.json,t),t.join("")}return""}const kS=e=>({"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:e.map(t=>{if(bS(t)||LS(t))return{"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:"answer"in t?t.answer:IS(t.answerV2)}}})}),sd=Math.log2(1.6745627884839434),PS=4,$S=19,od="js-baidu-neg-lng-fix";let h_;const FS=new Promise(e=>h_=e),BS="https://api.map.baidu.com/geoconv/v1/";let Ql=[];const HS="gcj02ToBD09Callback_b872c21c";let WS=0,rp;async function g_(e){return await new Promise((t,n)=>{Ql.push({coordinates:e,resolve:t,reject:n}),Ql.length===1&&(rp=setTimeout(r,100)),Ql.length>40&&(clearTimeout(rp),r());function r(){const l=Ql;Ql=[];const d=[].concat(...l.map(_=>_.coordinates)),f=HS+"_"+WS++,p=document.createElement("script");window[f]=_=>{var S;if(_.status){const w=new Error(`Unable to convert coordinates to BD-09: Received status code ${_.status}${_.message?": "+_.message:""}`);l.forEach(M=>M.reject(w))}const T=_.result.map(w=>new dn(w.y,w.x));let E=0;l.forEach(w=>{w.resolve(T.slice(E,E+=w.coordinates.length))}),delete window[f],(S=p.parentNode)==null||S.removeChild(p)},FS.then(_=>{const T={ak:_,callback:f,coords:d.map(E=>`${E.longitude},${E.latitude}`).join(";"),from:3,to:5};p.src=BS+"?"+Object.entries(T).map(([E,S])=>E+"="+S).join("&"),document.head.appendChild(p)})}})}class KS extends rl{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"map");Ie(this,"_panStartHandler");Ie(this,"_panHandler");Ie(this,"_centerReady");const r=!!(window.MSInputMethodContext&&document.DOCUMENT_NODE);this._wrapper=n.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:n.controlEnabled,maxZoom:r?14:18,...n.providerOptions}),n.controlEnabled?(this.map.enableScrollWheelZoom(),this.map.addControl(new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_ZOOM}))):(this.map.disableDragging(),this.map.disableDoubleClickZoom(),this.map.disablePinchToZoom()),this._panStartHandler=()=>null,this._panHandler=()=>null,this.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper&&(this._wrapper.dataset.baiduZoom=this.map.getZoom()),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new dn(this.map.getCenter())}getZoom(){return this.map.getZoom()-sd}setCenter(n,r){this._centerReady=g_([n]).then(([l])=>{const d=new BMap.Point(l.longitude,l.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+sd)},{enableAnimation:r})})}}class zS extends il{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"_zIndex");Ie(this,"_wrapperClass");Ie(this,"_originalWrapperClass");Ie(this,"_element");Ie(this,"_coordinateReady");Ie(this,"_negativeLngFix");Ie(this,"pin");this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;class r extends BMap.Marker{constructor(p,_){super(p);Ie(this,"pin");this.pin=_}initialize(p){return this.pin._wrapper=super.initialize(p),this.pin._wrapper&&(this.pin._wrapper.style.zIndex=this.pin._zIndex.toString(),this.pin._originalWrapperClass=this.pin._wrapper.getAttribute("class")??"",this.pin._wrapper.setAttribute("class",this.pin._getClass()),this.pin._wrapper.appendChild(this.pin._element),this.pin.addListeners()),this.pin._wrapper}draw(){if(this.pin._wrapper){const p=this.pin._wrapper.style.zIndex;super.draw(),this.pin._wrapper.style.height="",this.pin._wrapper.style.width="",this.pin._wrapper.style.pointerEvents="none",this.pin._wrapper.style.zIndex=p}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const l=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(l),this.pin.setShadow(l)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=g_([n]).then(([r])=>{this._negativeLngFix=r.longitude<0,this.pin.setPosition(new BMap.Point(r.longitude+(this._negativeLngFix?180:0),r.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](od)})}setMap(n,r){this._coordinateReady.then(()=>{r&&r.getProviderMap().map.removeOverlay(this.pin),n&&n.getProviderMap().map.addOverlay(this.pin)})}setProperties(n){super.setProperties(n),this._wrapperClass=n.getClass(),this._element=n.getElement()||this._pinEl,this._zIndex=n.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?od:""} ${this._wrapperClass}`}}const US="https://api.map.baidu.com/getscript";function GS(e,t,n,{params:r={},version:l="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,f={ak:d,v:l,...r};h_(d);const p=document.createElement("script");p.src=US+"?"+Object.entries(f).map(([E,S])=>E+"="+S).join("&"),p.onload=()=>e(),document.head.appendChild(p);let _="";for(let E=PS;E<=$S;E++){const S=2**(E-sd+7);_+=`[data-baidu-zoom="${E}"] .${od}{transform:translateX(-${S}px);}`}const T=document.createElement("style");T.appendChild(document.createTextNode(_)),document.head.appendChild(T)}const YS=new lo().withLoadFunction(GS).withMapClass(KS).withPinClass(zS).withProviderName("Baidu").build();let p_;function VS(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});Ie(this,"_container");Ie(this,"_pins");Ie(this,"_viewChangeEventHandler");Ie(this,"_map");this._container=document.createElement("div"),this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(r){this._pins.add(r),r._wrapper&&(r._wrapper.style.position="absolute",this._container.appendChild(r._wrapper)),this._map&&this.updatePinPosition(r)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){this._viewChangeEventHandler&&Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(r){this._pins.delete(r),r._wrapper&&this._container.removeChild(r._wrapper)}updatePinPosition(r){if(!this._map)return;const l=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&l instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=l.x+"px",r._wrapper.style.top=l.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}p_=e}class jS extends rl{constructor(n){super(n);Ie(this,"wrapper");Ie(this,"map");Ie(this,"pinOverlay");this.wrapper=n.wrapper,this.wrapper&&(this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!n.controlEnabled,disableZooming:!n.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...n.providerOptions}),this.pinOverlay=new p_(this.map),this.map.layers.insert(this.pinOverlay),Microsoft.Maps.Events.addHandler(this.map,"viewchangestart",()=>this._panStartHandler()),Microsoft.Maps.Events.addHandler(this.map,"viewchangeend",()=>this._panHandler()))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:l}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var l;(l=this.map)==null||l.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class m_ extends il{constructor(n){super(n);Ie(this,"_location");Ie(this,"_map");this._map=null,this._location=new Microsoft.Maps.Location(0,0)}static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}setCoordinate(n){this._location=new Microsoft.Maps.Location(n.latitude,n.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(n,r){r&&r.getProviderMap().pinOverlay.removePin(this),n&&n.getProviderMap().pinOverlay.addPin(this),this._map=n}}Ie(m_,"_pinId");const ip="BingMapsCallback_593d7d33",qS="https://www.bing.com/api/maps/mapcontrol";function ZS(e,t,n,{params:r={}}={}){window[ip]=()=>{VS(),e()};const l={callback:ip,key:n,...r};hp(qS+"?"+Object.entries(l).map(([d,f])=>d+"="+f).join("&"))}const JS=new lo().withLoadFunction(ZS).withMapClass(jS).withPinClass(m_).withProviderName("Bing").build();class XS extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");if(n.wrapper&&(this.map=new mapboxgl.Map({container:n.wrapper,interactive:n.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...n.providerOptions})),n.controlEnabled){const f=new mapboxgl.NavigationControl({showCompass:!1});(r=this.map)==null||r.addControl(f)}(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return(((n=this.map)==null?void 0:n.getZoom())??0)+1}setCenter(n,r){const l=new mapboxgl.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](l)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,l){const d=new mapboxgl.LngLat(r.longitude,r.latitude);this.map&&this.map[l?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class QS extends il{constructor(n){super(n);Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new mapboxgl.LngLat(n.longitude,n.latitude))}setMap(n,r){var l,d;if(n){const f=n.getProviderMap().map;f&&((l=this.pin)==null||l.addTo(f))}else(d=this.pin)==null||d.remove()}}function ew(e,t,n,{version:r="v1.13.0"}={}){const l=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{mapboxgl.accessToken=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const tw=new lo().withLoadFunction(ew).withMapClass(XS).withPinClass(QS).withProviderName("Mapbox").build();var oo;let __=(oo=class extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(l,{animate:r})}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(n,{animate:r})}setZoomCenter(n,r,l){var f;const d=new L.LatLng(r.latitude,r.longitude);(f=this.map)==null||f.setView(d,n,{animate:l})}_initMap(n){n.wrapper&&(this.map=new L.Map(n.wrapper,{boxZoom:n.controlEnabled,doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions}));const r=n.providerOptions,l=r.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",d=r.tileLayerOptions||{attribution:'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',id:"mapbox/streets-v11"};d.accessToken=oo.apiKey,this.map&&L.tileLayer(l,d).addTo(this.map)}},Ie(oo,"apiKey"),oo),nw=class extends fd{constructor(n){super(n);Ie(this,"pin");this.pin=new L.Marker(new L.LatLng(0,0)),this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(n){const r=new L.LatLng(n.latitude,n.longitude);this.pin.setLatLng(r)}setMap(n,r){if(n){const l=n.getProviderMap().map;l&&this.pin.addTo(l)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),l=n.getHeight(),d=n.getAnchorX(),f=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,l],iconAnchor:[d*r,f*l],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function rw(e,t,n,{version:r="1.7.1"}={}){const l=`https://unpkg.com/leaflet@${r}/dist/leaflet`;__.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(f)}const Hd=new lo().withLoadFunction(rw).withMapClass(__).withPinClass(nw).withProviderName("Leaflet").build(),iw=Hd.getMapClass(),sw=Hd.getPinClass();class ow extends iw{constructor(){super(...arguments);Ie(this,"map")}_initMap(n){this.map=L.mapquest.map(n.wrapper,{boxZoom:n.controlEnabled,center:new L.LatLng(0,0),doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions})}}class lw extends sw{}function aw(e,t,n,{version:r="v1.3.2"}={}){const l=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const cw=new lo().withLoadFunction(aw).withMapClass(ow).withPinClass(lw).withProviderName("MapQuest").build();exports.Address=ay;exports.AddressSchema=Fd;exports.AggregateRatingSchema=f_;exports.Analytics=cp;exports.AnalyticsContext=ud;exports.AnalyticsProvider=Vy;exports.AnalyticsScopeProvider=jy;exports.BaiduMaps=YS;exports.BaseSchema=wc;exports.BingMaps=JS;exports.Clusterer=LN;exports.Coordinate=dn;exports.Day=ln;exports.Event=SS;exports.FAQPage=kS;exports.GoogleMaps=mp;exports.HoursStatus=hS;exports.HoursTable=_S;exports.Image=nN;exports.ImageLayoutOption=Ts;exports.LeafletMaps=Hd;exports.LegacyRichText=nx;exports.LexicalRichText=gE;exports.Link=fp;exports.ListingPublisherOption=sp;exports.LocalBusiness=DS;exports.LocationMap=PN;exports.LocationSchema=o_;exports.Map=Np;exports.MapProviderOption=Wu;exports.MapQuestMaps=cw;exports.MapboxMaps=tw;exports.Marker=pd;exports.OfferSchema=Bd;exports.OpeningHoursSchema=u_;exports.OrganizationSchema=c_;exports.PerformerSchema=a_;exports.PhotoGallerySchema=Oc;exports.PhotoSchema=ES;exports.Product=RS;exports.ReviewSchema=d_;exports.SchemaWrapper=yS;exports.asciiAlpha=vE;exports.asciiAlphanumeric=Ju;exports.asciiAtext=SE;exports.asciiControl=wE;exports.asciiDigit=OE;exports.asciiHexDigit=DE;exports.asciiPunctuation=AE;exports.c=Qo;exports.classifyCharacter=la;exports.combineExtensions=Up;exports.createState=UT;exports.debuggingParamDetected=cc;exports.getDefaultExportFromCjs=ad;exports.getDirections=oy;exports.getRuntime=Xo;exports.jsxRuntimeExports=ft;exports.markdownLineEnding=ME;exports.markdownLineEndingOrSpace=Jp;exports.markdownSpace=RE;exports.normalizeUri=ol;exports.push=Vo;exports.resolveAll=Xp;exports.splice=yc;exports.useAnalytics=nl;exports.useClusterContext=bN;exports.useIdentify=Jy;exports.useMapContext=MN;exports.usePageView=Zy;exports.useScope=dd;exports.useTrack=qy;exports.visit=Dd;
|
|
111
|
+
<\/script>`,wc=(e,t)=>({"@context":"https://schema.org","@type":t,name:e.name}),CS=e=>typeof e!="object"?!1:"name"in e||"address"in e,ES=e=>typeof e!="object"?!1:"line1"in e||"city"in e||"region"in e||"postalCode"in e||"countryCode"in e,Fd=e=>ES(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},o_=e=>CS(e)&&{"@type":"Place",name:e.name,...Fd(e.address)},l_=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image,Oc=e=>{if(!e)return{};const t=new Array;for(const n of e)l_(n)&&t.push(n.image.url);return{image:t}},TS=e=>l_(e)&&{image:e.image.url},xS=e=>typeof e!="object"?!1:"url"in e||"name"in e,vS=e=>Array.isArray(e),a_=e=>vS(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},c_=e=>xS(e)&&{organizer:{"@type":"Organization",name:e.name,url:e.url}},SS=e=>typeof e!="object"?!1:"url"in e||"priceCurrency"in e||"price"in e||"priceValidUntil"in e||"itemCondition"in e||"availability"in e,Bd=e=>SS(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},wS=(e,t)=>({...wc(e,t??"Event"),...Oc(e.photoGallery),...o_({name:e.geomodifier,address:e.address}),startDate:e.c_startDate,endDate:e.c_endDate,description:e.description,eventAttendanceMode:e.attendance,eventStatus:e.eventStatus,...a_(e.performers),...c_({name:e.organizerName}),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate})}),OS=e=>typeof e!="object"?!1:"monday"in e||"tuesday"in e||"wednesday"in e||"thursday"in e||"friday"in e||"saturday"in e||"sunday"in e,DS=e=>typeof e=="object"&&"isClosed"in e&&Array.isArray(e.openIntervals)?e.openIntervals.length===0?!0:e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,u_=e=>{if(!OS(e))return{};let t=new Map;t=to(e.monday,t,"Mo"),t=to(e.tuesday,t,"Tu"),t=to(e.wednesday,t,"We"),t=to(e.thursday,t,"Th"),t=to(e.friday,t,"Fr"),t=to(e.saturday,t,"Sa"),t=to(e.sunday,t,"Su");const n=new Array;for(const[r,l]of t){const d=l.join(",");n.push(d+" "+r)}return{openingHours:n}},to=(e,t,n)=>{if(!DS(e)||e.isClosed){const r="00:00-00:00",l=t.get(r)??[];return l.push(n),t.set(r,l),t}for(let r=0;r<e.openIntervals.length;r++){const l=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(l)??[];d.push(n),t.set(l,d)}return t},AS=(e,t)=>({...wc(e,t??"LocalBusiness"),...Fd(e.address),...u_(e.hours),...Oc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),MS=e=>typeof e!="object"?!1:"ratingValue"in e||"bestRating"in e||"author"in e,RS=e=>typeof e!="object"?!1:"ratingValue"in e||"reviewCount"in e,d_=e=>MS(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},author:{"@type":"Person",name:e.author}}},f_=e=>RS(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,bS=(e,t)=>({...wc(e,t??"Product"),...Oc(e.photoGallery),...d_(e.c_reviews),...f_(e.c_aggregateRating),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate}),description:e.description,sku:e.sku,mpn:e.mpn,brand:{"@type":"Brand",name:e.brand}}),LS=e=>typeof e!="object"?!1:"question"in e&&"answer"in e,IS=e=>typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function id(e,t){for(const n in e)if(typeof e[n]=="object")if(Array.isArray(e[n]))for(let r=0;r<e[n].length;r++)id(e[n][r],t);else id(e[n],t);else n==="text"&&t.push(e[n])}function kS(e){if(e.json){const t=[];return id(e.json,t),t.join("")}return""}const PS=e=>({"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:e.map(t=>{if(LS(t)||IS(t))return{"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:"answer"in t?t.answer:kS(t.answerV2)}}})}),sd=Math.log2(1.6745627884839434),$S=4,FS=19,od="js-baidu-neg-lng-fix";let h_;const BS=new Promise(e=>h_=e),HS="https://api.map.baidu.com/geoconv/v1/";let Ql=[];const WS="gcj02ToBD09Callback_b872c21c";let KS=0,rp;async function g_(e){return await new Promise((t,n)=>{Ql.push({coordinates:e,resolve:t,reject:n}),Ql.length===1&&(rp=setTimeout(r,100)),Ql.length>40&&(clearTimeout(rp),r());function r(){const l=Ql;Ql=[];const d=[].concat(...l.map(_=>_.coordinates)),f=WS+"_"+KS++,p=document.createElement("script");window[f]=_=>{var S;if(_.status){const w=new Error(`Unable to convert coordinates to BD-09: Received status code ${_.status}${_.message?": "+_.message:""}`);l.forEach(M=>M.reject(w))}const T=_.result.map(w=>new dn(w.y,w.x));let E=0;l.forEach(w=>{w.resolve(T.slice(E,E+=w.coordinates.length))}),delete window[f],(S=p.parentNode)==null||S.removeChild(p)},BS.then(_=>{const T={ak:_,callback:f,coords:d.map(E=>`${E.longitude},${E.latitude}`).join(";"),from:3,to:5};p.src=HS+"?"+Object.entries(T).map(([E,S])=>E+"="+S).join("&"),document.head.appendChild(p)})}})}class zS extends rl{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"map");Ie(this,"_panStartHandler");Ie(this,"_panHandler");Ie(this,"_centerReady");const r=!!(window.MSInputMethodContext&&document.DOCUMENT_NODE);this._wrapper=n.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:n.controlEnabled,maxZoom:r?14:18,...n.providerOptions}),n.controlEnabled?(this.map.enableScrollWheelZoom(),this.map.addControl(new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_ZOOM}))):(this.map.disableDragging(),this.map.disableDoubleClickZoom(),this.map.disablePinchToZoom()),this._panStartHandler=()=>null,this._panHandler=()=>null,this.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper&&(this._wrapper.dataset.baiduZoom=this.map.getZoom()),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new dn(this.map.getCenter())}getZoom(){return this.map.getZoom()-sd}setCenter(n,r){this._centerReady=g_([n]).then(([l])=>{const d=new BMap.Point(l.longitude,l.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+sd)},{enableAnimation:r})})}}class US extends il{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"_zIndex");Ie(this,"_wrapperClass");Ie(this,"_originalWrapperClass");Ie(this,"_element");Ie(this,"_coordinateReady");Ie(this,"_negativeLngFix");Ie(this,"pin");this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;class r extends BMap.Marker{constructor(p,_){super(p);Ie(this,"pin");this.pin=_}initialize(p){return this.pin._wrapper=super.initialize(p),this.pin._wrapper&&(this.pin._wrapper.style.zIndex=this.pin._zIndex.toString(),this.pin._originalWrapperClass=this.pin._wrapper.getAttribute("class")??"",this.pin._wrapper.setAttribute("class",this.pin._getClass()),this.pin._wrapper.appendChild(this.pin._element),this.pin.addListeners()),this.pin._wrapper}draw(){if(this.pin._wrapper){const p=this.pin._wrapper.style.zIndex;super.draw(),this.pin._wrapper.style.height="",this.pin._wrapper.style.width="",this.pin._wrapper.style.pointerEvents="none",this.pin._wrapper.style.zIndex=p}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const l=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(l),this.pin.setShadow(l)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=g_([n]).then(([r])=>{this._negativeLngFix=r.longitude<0,this.pin.setPosition(new BMap.Point(r.longitude+(this._negativeLngFix?180:0),r.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](od)})}setMap(n,r){this._coordinateReady.then(()=>{r&&r.getProviderMap().map.removeOverlay(this.pin),n&&n.getProviderMap().map.addOverlay(this.pin)})}setProperties(n){super.setProperties(n),this._wrapperClass=n.getClass(),this._element=n.getElement()||this._pinEl,this._zIndex=n.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?od:""} ${this._wrapperClass}`}}const GS="https://api.map.baidu.com/getscript";function YS(e,t,n,{params:r={},version:l="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,f={ak:d,v:l,...r};h_(d);const p=document.createElement("script");p.src=GS+"?"+Object.entries(f).map(([E,S])=>E+"="+S).join("&"),p.onload=()=>e(),document.head.appendChild(p);let _="";for(let E=$S;E<=FS;E++){const S=2**(E-sd+7);_+=`[data-baidu-zoom="${E}"] .${od}{transform:translateX(-${S}px);}`}const T=document.createElement("style");T.appendChild(document.createTextNode(_)),document.head.appendChild(T)}const jS=new lo().withLoadFunction(YS).withMapClass(zS).withPinClass(US).withProviderName("Baidu").build();let p_;function VS(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});Ie(this,"_container");Ie(this,"_pins");Ie(this,"_viewChangeEventHandler");Ie(this,"_map");this._container=document.createElement("div"),this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(r){this._pins.add(r),r._wrapper&&(r._wrapper.style.position="absolute",this._container.appendChild(r._wrapper)),this._map&&this.updatePinPosition(r)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){this._viewChangeEventHandler&&Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(r){this._pins.delete(r),r._wrapper&&this._container.removeChild(r._wrapper)}updatePinPosition(r){if(!this._map)return;const l=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&l instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=l.x+"px",r._wrapper.style.top=l.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}p_=e}class qS extends rl{constructor(n){super(n);Ie(this,"wrapper");Ie(this,"map");Ie(this,"pinOverlay");this.wrapper=n.wrapper,this.wrapper&&(this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!n.controlEnabled,disableZooming:!n.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...n.providerOptions}),this.pinOverlay=new p_(this.map),this.map.layers.insert(this.pinOverlay),Microsoft.Maps.Events.addHandler(this.map,"viewchangestart",()=>this._panStartHandler()),Microsoft.Maps.Events.addHandler(this.map,"viewchangeend",()=>this._panHandler()))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:l}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var l;(l=this.map)==null||l.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class m_ extends il{constructor(n){super(n);Ie(this,"_location");Ie(this,"_map");this._map=null,this._location=new Microsoft.Maps.Location(0,0)}static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}setCoordinate(n){this._location=new Microsoft.Maps.Location(n.latitude,n.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(n,r){r&&r.getProviderMap().pinOverlay.removePin(this),n&&n.getProviderMap().pinOverlay.addPin(this),this._map=n}}Ie(m_,"_pinId");const ip="BingMapsCallback_593d7d33",ZS="https://www.bing.com/api/maps/mapcontrol";function JS(e,t,n,{params:r={}}={}){window[ip]=()=>{VS(),e()};const l={callback:ip,key:n,...r};hp(ZS+"?"+Object.entries(l).map(([d,f])=>d+"="+f).join("&"))}const XS=new lo().withLoadFunction(JS).withMapClass(qS).withPinClass(m_).withProviderName("Bing").build();class QS extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");if(n.wrapper&&(this.map=new mapboxgl.Map({container:n.wrapper,interactive:n.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...n.providerOptions})),n.controlEnabled){const f=new mapboxgl.NavigationControl({showCompass:!1});(r=this.map)==null||r.addControl(f)}(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return(((n=this.map)==null?void 0:n.getZoom())??0)+1}setCenter(n,r){const l=new mapboxgl.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](l)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,l){const d=new mapboxgl.LngLat(r.longitude,r.latitude);this.map&&this.map[l?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class ew extends il{constructor(n){super(n);Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new mapboxgl.LngLat(n.longitude,n.latitude))}setMap(n,r){var l,d;if(n){const f=n.getProviderMap().map;f&&((l=this.pin)==null||l.addTo(f))}else(d=this.pin)==null||d.remove()}}function tw(e,t,n,{version:r="v1.13.0"}={}){const l=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{mapboxgl.accessToken=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const nw=new lo().withLoadFunction(tw).withMapClass(QS).withPinClass(ew).withProviderName("Mapbox").build();var oo;let __=(oo=class extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(l,{animate:r})}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(n,{animate:r})}setZoomCenter(n,r,l){var f;const d=new L.LatLng(r.latitude,r.longitude);(f=this.map)==null||f.setView(d,n,{animate:l})}_initMap(n){n.wrapper&&(this.map=new L.Map(n.wrapper,{boxZoom:n.controlEnabled,doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions}));const r=n.providerOptions,l=r.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",d=r.tileLayerOptions||{attribution:'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',id:"mapbox/streets-v11"};d.accessToken=oo.apiKey,this.map&&L.tileLayer(l,d).addTo(this.map)}},Ie(oo,"apiKey"),oo),rw=class extends fd{constructor(n){super(n);Ie(this,"pin");this.pin=new L.Marker(new L.LatLng(0,0)),this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(n){const r=new L.LatLng(n.latitude,n.longitude);this.pin.setLatLng(r)}setMap(n,r){if(n){const l=n.getProviderMap().map;l&&this.pin.addTo(l)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),l=n.getHeight(),d=n.getAnchorX(),f=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,l],iconAnchor:[d*r,f*l],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function iw(e,t,n,{version:r="1.7.1"}={}){const l=`https://unpkg.com/leaflet@${r}/dist/leaflet`;__.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(f)}const Hd=new lo().withLoadFunction(iw).withMapClass(__).withPinClass(rw).withProviderName("Leaflet").build(),sw=Hd.getMapClass(),ow=Hd.getPinClass();class lw extends sw{constructor(){super(...arguments);Ie(this,"map")}_initMap(n){this.map=L.mapquest.map(n.wrapper,{boxZoom:n.controlEnabled,center:new L.LatLng(0,0),doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions})}}class aw extends ow{}function cw(e,t,n,{version:r="v1.3.2"}={}){const l=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const uw=new lo().withLoadFunction(cw).withMapClass(lw).withPinClass(aw).withProviderName("MapQuest").build();exports.Address=ay;exports.AddressSchema=Fd;exports.AggregateRatingSchema=f_;exports.Analytics=cp;exports.AnalyticsContext=ud;exports.AnalyticsProvider=jy;exports.AnalyticsScopeProvider=Vy;exports.BaiduMaps=jS;exports.BaseSchema=wc;exports.BingMaps=XS;exports.Clusterer=LN;exports.Coordinate=dn;exports.Day=ln;exports.Event=wS;exports.FAQPage=PS;exports.GoogleMaps=mp;exports.HoursStatus=gS;exports.HoursTable=yS;exports.Image=nN;exports.ImageLayoutOption=Ts;exports.LeafletMaps=Hd;exports.LegacyRichText=nx;exports.LexicalRichText=gE;exports.Link=fp;exports.ListingPublisherOption=sp;exports.LocalBusiness=AS;exports.LocationMap=PN;exports.LocationSchema=o_;exports.Map=Np;exports.MapProviderOption=Wu;exports.MapQuestMaps=uw;exports.MapboxMaps=nw;exports.Marker=pd;exports.OfferSchema=Bd;exports.OpeningHoursSchema=u_;exports.OrganizationSchema=c_;exports.PerformerSchema=a_;exports.PhotoGallerySchema=Oc;exports.PhotoSchema=TS;exports.Product=bS;exports.ReviewSchema=d_;exports.SchemaWrapper=NS;exports.asciiAlpha=vE;exports.asciiAlphanumeric=Ju;exports.asciiAtext=SE;exports.asciiControl=wE;exports.asciiDigit=OE;exports.asciiHexDigit=DE;exports.asciiPunctuation=AE;exports.c=Qo;exports.classifyCharacter=la;exports.combineExtensions=Up;exports.createState=UT;exports.debuggingParamDetected=cc;exports.getDefaultExportFromCjs=ad;exports.getDirections=oy;exports.getRuntime=Xo;exports.jsxRuntimeExports=at;exports.markdownLineEnding=ME;exports.markdownLineEndingOrSpace=Jp;exports.markdownSpace=RE;exports.normalizeUri=ol;exports.push=jo;exports.resolveAll=Xp;exports.splice=yc;exports.useAnalytics=nl;exports.useClusterContext=bN;exports.useIdentify=Jy;exports.useMapContext=MN;exports.usePageView=Zy;exports.useScope=dd;exports.useTrack=qy;exports.visit=Dd;
|