@yext/pages-components 1.1.11 → 1.1.13
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-CgvWSiIa.js → debugger-DIK3Bqjc.js} +1 -1
- package/dist/{debugger-rbW480FR.cjs → debugger-Def1AiTA.cjs} +1 -1
- package/dist/{index-B-lQrz2O.js → index-C0vLxGfU.js} +1 -1
- package/dist/{index-C7vTnykM.cjs → index-CFORd6Yp.cjs} +1 -1
- package/dist/{index-DKVTGEU-.js → index-Dkg0GfHt.js} +5802 -5740
- package/dist/{index-BUNvw5E2.cjs → index-Dx5KqQIE.cjs} +53 -53
- package/dist/index.d.cts +48 -3
- package/dist/index.d.ts +48 -3
- package/dist/pages-components.cjs +1 -1
- package/dist/pages-components.js +20 -19
- package/package.json +18 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var sy=Object.defineProperty;var oy=(e,t,n)=>t in e?sy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Le=(e,t,n)=>oy(e,typeof t!="symbol"?t+"":t,n);const rt=require("react"),hd=require("react-dom"),Uu=require("mapbox-gl");function ly(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ay=ly(rt);var yf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gu={exports:{}},Yl={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Nf;function cy(){if(Nf)return Yl;Nf=1;var e=rt,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,_,E){var T,S={},w=null,M=null;E!==void 0&&(w=""+E),_.key!==void 0&&(w=""+_.key),_.ref!==void 0&&(M=_.ref);for(T in _)r.call(_,T)&&!d.hasOwnProperty(T)&&(S[T]=_[T]);if(p&&p.defaultProps)for(T in _=p.defaultProps,_)S[T]===void 0&&(S[T]=_[T]);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
|
|
18
|
-
`+_e+pe}}var
|
|
17
|
+
*/var Cf;function uy(){return Cf||(Cf=1,process.env.NODE_ENV!=="production"&&function(){var e=rt,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"),E=Symbol.for("react.suspense"),T=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 I(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 P(pe){{for(var Ze=arguments.length,lt=new Array(Ze>1?Ze-1:0),wt=1;wt<Ze;wt++)lt[wt-1]=arguments[wt];k("error",pe,lt)}}function k(pe,Ze,lt){{var wt=G.ReactDebugCurrentFrame,Gt=wt.getStackAddendum();Gt!==""&&(Ze+="%s",lt=lt.concat([Gt]));var Bt=lt.map(function(Pt){return String(Pt)});Bt.unshift("Warning: "+Ze),Function.prototype.apply.call(console[pe],console,Bt)}}var W=!1,Y=!1,re=!1,te=!1,ue=!1,q;q=Symbol.for("react.module.reference");function H(pe){return!!(typeof pe=="string"||typeof pe=="function"||pe===r||pe===d||ue||pe===l||pe===E||pe===T||te||pe===M||W||Y||re||typeof pe=="object"&&pe!==null&&(pe.$$typeof===w||pe.$$typeof===S||pe.$$typeof===f||pe.$$typeof===p||pe.$$typeof===_||pe.$$typeof===q||pe.getModuleId!==void 0))}function V(pe,Ze,lt){var wt=pe.displayName;if(wt)return wt;var Gt=Ze.displayName||Ze.name||"";return Gt!==""?lt+"("+Gt+")":lt}function Ee(pe){return pe.displayName||"Context"}function Se(pe){if(pe==null)return null;if(typeof pe.tag=="number"&&P("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 E:return"Suspense";case T:return"SuspenseList"}if(typeof pe=="object")switch(pe.$$typeof){case p:var Ze=pe;return Ee(Ze)+".Consumer";case f:var lt=pe;return Ee(lt._context)+".Provider";case _:return V(pe,pe.render,"ForwardRef");case S:var wt=pe.displayName||null;return wt!==null?wt: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 Te=Object.assign,de=0,z,O,Z,oe,j,K,J;function R(){}R.__reactDisabledLog=!0;function U(){{if(de===0){z=console.log,O=console.info,Z=console.warn,oe=console.error,j=console.group,K=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:Te({},pe,{value:z}),info:Te({},pe,{value:O}),warn:Te({},pe,{value:Z}),error:Te({},pe,{value:oe}),group:Te({},pe,{value:j}),groupCollapsed:Te({},pe,{value:K}),groupEnd:Te({},pe,{value:J})})}de<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=G.ReactCurrentDispatcher,_e;function B(pe,Ze,lt){{if(_e===void 0)try{throw Error()}catch(Gt){var wt=Gt.stack.trim().match(/\n( *(at )?)/);_e=wt&&wt[1]||""}return`
|
|
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 lt=F.get(pe);if(lt!==void 0)return lt}var wt;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){wt=fn}Reflect.construct(pe,[],Pt)}else{try{Pt.call()}catch(fn){wt=fn}pe.call(Pt.prototype)}}else{try{throw Error()}catch(fn){wt=fn}pe()}}catch(fn){if(fn&&wt&&typeof fn.stack=="string"){for(var kt=fn.stack.split(`
|
|
19
19
|
`),Ht=wt.stack.split(`
|
|
20
20
|
`),on=kt.length-1,an=Ht.length-1;on>=1&&an>=0&&kt[on]!==Ht[an];)an--;for(;on>=1&&an>=0;on--,an--)if(kt[on]!==Ht[an]){if(on!==1||an!==1)do if(on--,an--,an<0||kt[on]!==Ht[an]){var bn=`
|
|
21
|
-
`+kt[on].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(on>=1&&an>=0);break}}}finally{
|
|
21
|
+
`+kt[on].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(on>=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,lt){return ye(pe,!1)}function ee(pe){var Ze=pe.prototype;return!!(Ze&&Ze.isReactComponent)}function ne(pe,Ze,lt){if(pe==null)return"";if(typeof pe=="function")return ye(pe,ee(pe));if(typeof pe=="string")return B(pe);switch(pe){case E:return B("Suspense");case T:return B("SuspenseList")}if(typeof pe=="object")switch(pe.$$typeof){case _:return De(pe.render);case S:return ne(pe.type,Ze,lt);case w:{var wt=pe,Gt=wt._payload,Bt=wt._init;try{return ne(Bt(Gt),Ze,lt)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,be={},Ne=G.ReactDebugCurrentFrame;function Re(pe){if(pe){var Ze=pe._owner,lt=ne(pe.type,pe._source,Ze?Ze.type:null);Ne.setExtraStackFrame(lt)}else Ne.setExtraStackFrame(null)}function ke(pe,Ze,lt,wt,Gt){{var Bt=Function.call.bind(ce);for(var Pt in pe)if(Bt(pe,Pt)){var kt=void 0;try{if(typeof pe[Pt]!="function"){var Ht=Error((wt||"React class")+": "+lt+" 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,wt,lt,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(on){kt=on}kt&&!(kt instanceof Error)&&(Re(Gt),P("%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).",wt||"React class",lt,Pt,typeof kt),Re(null)),kt instanceof Error&&!(kt.message in be)&&(be[kt.message]=!0,Re(Gt),P("Failed %s type: %s",lt,kt.message),Re(null))}}}var Fe=Array.isArray;function qe(pe){return Fe(pe)}function Be(pe){{var Ze=typeof Symbol=="function"&&Symbol.toStringTag,lt=Ze&&pe[Symbol.toStringTag]||pe.constructor.name||"Object";return lt}}function ut(pe){try{return At(pe),!1}catch{return!0}}function At(pe){return""+pe}function Ut(pe){if(ut(pe))return P("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 tn=G.ReactCurrentOwner,Oe={key:!0,ref:!0,__self:!0,__source:!0},ie,le;function ve(pe){if(ce.call(pe,"ref")){var Ze=Object.getOwnPropertyDescriptor(pe,"ref").get;if(Ze&&Ze.isReactWarning)return!1}return pe.ref!==void 0}function Ie(pe){if(ce.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"&&tn.current}function je(pe,Ze){{var lt=function(){ie||(ie=!0,P("%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))};lt.isReactWarning=!0,Object.defineProperty(pe,"key",{get:lt,configurable:!0})}}function it(pe,Ze){{var lt=function(){le||(le=!0,P("%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))};lt.isReactWarning=!0,Object.defineProperty(pe,"ref",{get:lt,configurable:!0})}}var st=function(pe,Ze,lt,wt,Gt,Bt,Pt){var kt={$$typeof:t,type:pe,key:Ze,ref:lt,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:wt}),Object.defineProperty(kt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Gt}),Object.freeze&&(Object.freeze(kt.props),Object.freeze(kt)),kt};function ot(pe,Ze,lt,wt,Gt){{var Bt,Pt={},kt=null,Ht=null;lt!==void 0&&(Ut(lt),kt=""+lt),Ie(Ze)&&(Ut(Ze.key),kt=""+Ze.key),ve(Ze)&&(Ht=Ze.ref,Me(Ze,Gt));for(Bt in Ze)ce.call(Ze,Bt)&&!Oe.hasOwnProperty(Bt)&&(Pt[Bt]=Ze[Bt]);if(pe&&pe.defaultProps){var on=pe.defaultProps;for(Bt in on)Pt[Bt]===void 0&&(Pt[Bt]=on[Bt])}if(kt||Ht){var an=typeof pe=="function"?pe.displayName||pe.name||"Unknown":pe;kt&&je(Pt,an),Ht&&it(Pt,an)}return st(pe,kt,Ht,Gt,wt,tn.current,Pt)}}var St=G.ReactCurrentOwner,Ge=G.ReactDebugCurrentFrame;function ze(pe){if(pe){var Ze=pe._owner,lt=ne(pe.type,pe._source,Ze?Ze.type:null);Ge.setExtraStackFrame(lt)}else Ge.setExtraStackFrame(null)}var tt;tt=!1;function yt(pe){return typeof pe=="object"&&pe!==null&&pe.$$typeof===t}function Nt(){{if(St.current){var pe=Se(St.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 lt=typeof pe=="string"?pe:pe.displayName||pe.name;lt&&(Ze=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+lt+">.")}return Ze}}function mt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var lt=xt(Ze);if(gt[lt])return;gt[lt]=!0;var wt="";pe&&pe._owner&&pe._owner!==St.current&&(wt=" It was passed a child from "+Se(pe._owner.type)+"."),ze(pe),
|
|
25
|
+
Check the top-level render call using <`+lt+">.")}return Ze}}function mt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var lt=xt(Ze);if(gt[lt])return;gt[lt]=!0;var wt="";pe&&pe._owner&&pe._owner!==St.current&&(wt=" It was passed a child from "+Se(pe._owner.type)+"."),ze(pe),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',lt,wt),ze(null)}}function $t(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var lt=0;lt<pe.length;lt++){var wt=pe[lt];yt(wt)&&mt(wt,Ze)}else if(yt(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Gt=I(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 lt;if(typeof Ze=="function")lt=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===_||Ze.$$typeof===S))lt=Ze.propTypes;else return;if(lt){var wt=Se(Ze);ke(lt,pe.props,"prop",wt,pe)}else if(Ze.PropTypes!==void 0&&!tt){tt=!0;var Gt=Se(Ze);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Gt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nn(pe){{for(var Ze=Object.keys(pe.props),lt=0;lt<Ze.length;lt++){var wt=Ze[lt];if(wt!=="children"&&wt!=="key"){ze(pe),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",wt),ze(null);break}}pe.ref!==null&&(ze(pe),P("Invalid attribute `ref` supplied to `React.Fragment`."),ze(null))}}var It={};function Vt(pe,Ze,lt,wt,Gt,Bt){{var Pt=H(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 on;pe===null?on="null":qe(pe)?on="array":pe!==void 0&&pe.$$typeof===t?(on="<"+(Se(pe.type)||"Unknown")+" />",kt=" Did you accidentally export a JSX literal instead of a component?"):on=typeof pe,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",on,kt)}var an=ot(pe,Ze,lt,Gt,Bt);if(an==null)return an;if(Pt){var bn=Ze.children;if(bn!==void 0)if(wt)if(qe(bn)){for(var yr=0;yr<bn.length;yr++)$t(bn[yr],pe);Object.freeze&&Object.freeze(bn)}else P("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(ce.call(Ze,"key")){var Zn=Se(pe),fn=Object.keys(Ze).filter(function(Ai){return Ai!=="key"}),sr=fn.length>0?"{key: someKey, "+fn.join(": ..., ")+": ...}":"{key: someKey}";if(!It[Zn+sr]){var or=fn.length>0?"{"+fn.join(": ..., ")+": ...}":"{}";P(`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?nn(an):Kt(an),an}}function bt(pe,Ze,lt){return Vt(pe,Ze,lt,!0)}function rn(pe,Ze,lt){return Vt(pe,Ze,lt,!1)}var Or=rn,_i=bt;jl.Fragment=r,jl.jsx=Or,jl.jsxs=_i}()),jl}process.env.NODE_ENV==="production"?zu.exports=oy():zu.exports=ly();var nt=zu.exports;function ay(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 ap={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Uu={GOOGLE:"google",APPLE:"apple",BING:"bing"},cy=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},uy=(e,t=[],n,r={route:!1},l)=>{const d="Failed to construct query for maps service.";let f=e&&Tf([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case Uu.APPLE:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Nf(`${l.latitude},${l.longitude}`,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Nf(f,r.route)}case Uu.BING:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Cf(`${l.latitude},${l.longitude}`,r.route);if(f=e&&Tf([e.line1,e.city,e.region,e.postalCode]),!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Cf(f,r.route)}default:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Ef(`${l.latitude},${l.longitude}`,r.route);const p=t.find(_=>{var E;return((E=_==null?void 0:_.publisher)==null?void 0:E.toUpperCase())===ap.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return dy(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 Ef(f,r.route)}}},Nf=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,Cf=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,dy=(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`},Ef=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,Tf=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},fy=({address:e,lines:t,separator:n=",",...r})=>{const l=(t||ay(e.countryCode)).map(d=>nt.jsx(hy,{address:e,line:d,separator:n},d.toString()));return rt.createElement("div",{...r,key:e.toString()},l)},hy=({address:e,line:t,separator:n})=>{const r=[];let l=0;for(const d of t){if(d===","){r.push(nt.jsx("span",{children:n},`separator-${l++}`));continue}const f=e[d];if(!f)continue;const p=cy(d,e);if(p){r.push(nt.jsxs(sy.Fragment,{children:[" ",nt.jsx("abbr",{title:p,children:f})]},d));continue}r.push(nt.jsx("span",{children:" "+f},d))}return nt.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var gy=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},py=typeof window<"u"&&typeof window.document<"u",my=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,_y=(typeof self>"u"?"undefined":gy(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",yy=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ny=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",xf=tl.isBrowser=py;tl.isWebWorker=_y;var Cy=tl.isNode=my;tl.isJsDom=yy;var Ey=tl.isDeno=Ny;class Ty{constructor(){Ie(this,"name");Ie(this,"isServerSide");Ie(this,"version");var t;Ey?(this.name="deno",this.version="",xf&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):Cy?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):xf?(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 Qo=()=>new Ty,xy=(...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 qc(e){if(!gd(e))throw new Error("Parameter was not an error")}function gd(e){return!!e&&typeof e=="object"&&vy(e)==="[object Error]"||e instanceof Error}function vy(e){return Object.prototype.toString.call(e)}const Sy="Layerr";let wy=Sy;function Oy(){return wy}function Dy(e){let t,n="";if(e.length===0)t={};else if(gd(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 Di extends Error{constructor(t,n){const r=[...arguments],{options:l,shortMessage:d}=Dy(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=Oy(),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 qc(t),t._cause&&gd(t._cause)?t._cause:null}static fullStack(t){qc(t);const n=Di.cause(t);return n?`${t.stack}
|
|
31
|
-
caused by: ${Di.fullStack(n)}`:t.stack??""}static info(t){
|
|
32
|
-
`,t),null}}const By="1.0.0",wf={version:By};function Hy(e,t,n){return n.debug?(up(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function Wy(e,t,n){return n.debug?(up(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Ky(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function up(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 Gu=function(){return Gu=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},Gu.apply(this,arguments)},Yu=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]=Yu(n[r],l)}return Gu({},n)},zy="yextevents.com/accounts/me/events";function Uy(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")+"."+zy}var Gy=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(T){try{E(r.next(T))}catch(S){f(S)}}function _(T){try{E(r.throw(T))}catch(S){f(S)}}function E(T){T.done?d(T.value):l(T.value).then(p,_)}E((r=r.apply(e,t||[])).next())})},Yy=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(E){return function(T){return _([E,T])}}function _(E){if(r)throw new TypeError("Generator is already executing.");for(;f&&(f=0,E[0]&&(n=0)),n;)try{if(r=1,l&&(d=E[0]&2?l.return:E[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,E[1])).done)return d;switch(l=0,d&&(E=[E[0]&2,d.value]),E[0]){case 0:case 1:d=E;break;case 4:return n.label++,{value:E[1],done:!1};case 5:n.label++,l=E[1],E=[0];continue;case 7:E=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(E[0]===6||E[0]===2)){n=0;continue}if(E[0]===3&&(!d||E[1]>d[0]&&E[1]<d[3])){n.label=E[1];break}if(E[0]===6&&n.label<d[1]){n.label=d[1],d=E;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(E);break}d[2]&&n.ops.pop(),n.trys.pop();continue}E=t.call(e,n)}catch(T){E=[6,T],l=0}finally{r=d=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}},jy=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:Yu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return Gy(this,void 0,void 0,function(){var r,l,d,f,p=this;return Yy(this,function(_){return r=Yu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Fy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=wf.version:r.clientSdk=(f={},f.ANALYTICS=wf.version,f),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,l=Ky(r,this.config.forceFetch),d=Uy(this.config.env,this.config.region),l?[2,new Promise(function(E,T){Hy(d,r,p.config)?E(""):T("Failed Beacon Call")})]:[2,Wy(d,r,this.config).then(function(E){return E}).catch(function(E){return E})]})})},e}();function Vy(e){return new jy(e)}function ju(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function dp(e,t){return[e,t].filter(n=>!!n).map(n=>ju(n)).join("_")}const qy=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},pd=rt.createContext(null),Zy=rt.lazy(()=>Promise.resolve().then(()=>require("./debugger-rbW480FR.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 E=rt.useRef(null),[T,S]=rt.useState(!1);rt.useEffect(()=>{S(!0)},[]),E.current===null&&(E.current=new fp(n,r,l,d,f,_,p??uc()));const w=E.current;return rt.useEffect(()=>(window.enableYextAnalytics=()=>{w.optIn()},()=>{delete window.enableYextAnalytics}),[w]),nt.jsxs(nt.Fragment,{children:[nt.jsx(pd.Provider,{value:w,children:t}),T&&(p||uc())&&Qo().name==="browser"?nt.jsx(rt.Suspense,{fallback:nt.jsx(nt.Fragment,{}),children:nt.jsx(Zy,{})}):null]})}function uc(){return Qo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class fp{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(Qo().name!=="browser"||!this._optedIn)return;if(!xy(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=qy(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=Vy(n).with(r)}canTrack(){return Qo().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:E}=t;let T;f&&(T={amount:f,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:ju(r)||void 0,originalEventName:dp(r||"",ju(l)||"")},value:T,destinationUrl:p,customTags:_,customValues:E}))}getDebugEnabled(){return this.enableDebugging||uc()}}const Vu=rt.createContext({name:""}),md=()=>rt.useContext(Vu).name;function Xy(e){var f;const t=md(),[n]=rt.useState({name:dp(t,e.name)}),r=(f=nl())==null?void 0:f.getDebugEnabled(),[l,d]=rt.useState(!1);return rt.useEffect(()=>{d(!0)},[]),r&&l?nt.jsx("section",{"data-ya-scope":n.name,children:nt.jsx(Vu.Provider,{value:n,children:e.children})}):nt.jsx(Vu.Provider,{value:n,children:e.children})}function nl(){const e=rt.useContext(pd);if(!e)return e;Qo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=md();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},eN=()=>{var e;return(e=nl())==null?void 0:e.pageView},tN=()=>{var e;return(e=nl())==null?void 0:e.identify},Es={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},nN=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]}`:"",E=p[0];return{scheme:t,partition:r,env:d,accountId:f,contentHash:E,extension:_}},rN=(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)}`},iN=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}},sN=(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)}`},qu=(e,t,n)=>{if(!hp(e)){console.error(`Invalid image url: ${e}.`);return}const r=new URL(e);if(r.pathname.startsWith("/p")){const l=iN(r);if(l)return sN(l,t,n)}else if(r.pathname.startsWith("/f")){const l=nN(r);if(l)return rN(l,t,n)}return e},hp=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},oN=({image:e,className:t,width:n,height:r,aspectRatio:l,layout:d=Es.INTRINSIC,placeholder:f,imgOverrides:p,style:_={},loading:E="lazy"})=>{const T=rt.useRef(null),[S,w]=rt.useState(!1),O="image"in e?e.image:e;rt.useEffect(()=>{var ce;(ce=T.current)!=null&&ce.complete&&w(!0)},[]),lN(d,O.width,O.height,n,r,l);const m=Math.abs(O.width);m||console.warn("Invalid image width.");const v=Math.abs(O.height);if(v||console.warn("Invalid image height."),!hp(O.url))return console.error(`Invalid image url: ${O.url}`),nt.jsx(nt.Fragment,{children:f!=null&&f});const I=n&&n>0?n:void 0,G=r&&r>0?r:void 0,{src:k,imgStyle:P,widths:H}=aN(d,m,v,_,O.url,I,G,l),j=H.map(ce=>`${qu(O.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 nt.jsxs(nt.Fragment,{children:[!S&&f!=null&&f,nt.jsx("img",{ref:T,style:P,src:k,className:t,width:I,height:G,srcSet:j,sizes:te,loading:E,alt:O.alternateText||"",...p})]})},lN=(e,t,n,r,l,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Es.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===Es.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},aN=(e,t,n,r,l,d,f,p)=>{let _=[100,320,640,960,1280,1920],E=qu(l,500,500);const T={...r};switch(T.objectFit=T.objectFit||"cover",T.objectPosition=T.objectPosition||"center",e){case Es.INTRINSIC:T.maxWidth=t,T.width="100%",T.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Es.FIXED:{const{fixedWidth:S,fixedHeight:w,fixedWidths:O}=cN(t,n,_,d,f);T.width=S,T.height=w,_=O,E=qu(l,S,w);break}case Es.ASPECT:T.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Es.FILL:T.width="100%",T.aspectRatio=p?`${p}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:E,imgStyle:T,widths:_}},cN=(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 gp={exports:{}};/*!
|
|
30
|
+
<%s key={someKey} {...props} />`,sr,Zn,or,Zn),It[Zn+sr]=!0}}return pe===r?nn(an):Kt(an),an}}function bt(pe,Ze,lt){return Vt(pe,Ze,lt,!0)}function rn(pe,Ze,lt){return Vt(pe,Ze,lt,!1)}var wr=rn,_i=bt;jl.Fragment=r,jl.jsx=wr,jl.jsxs=_i}()),jl}process.env.NODE_ENV==="production"?Gu.exports=cy():Gu.exports=uy();var nt=Gu.exports;function dy(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 up={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Yu={GOOGLE:"google",APPLE:"apple",BING:"bing"},fy=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},hy=(e,t=[],n,r={route:!1},l)=>{const d="Failed to construct query for maps service.";let f=e&&vf([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case Yu.APPLE:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Ef(`${l.latitude},${l.longitude}`,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Ef(f,r.route)}case Yu.BING:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Tf(`${l.latitude},${l.longitude}`,r.route);if(f=e&&vf([e.line1,e.city,e.region,e.postalCode]),!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Tf(f,r.route)}default:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return xf(`${l.latitude},${l.longitude}`,r.route);const p=t.find(_=>{var E;return((E=_==null?void 0:_.publisher)==null?void 0:E.toUpperCase())===up.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return gy(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 xf(f,r.route)}}},Ef=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,Tf=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,gy=(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`},xf=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,vf=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},py=({address:e,lines:t,separator:n=",",...r})=>{const l=(t||dy(e.countryCode)).map(d=>nt.jsx(my,{address:e,line:d,separator:n},d.toString()));return rt.createElement("div",{...r,key:e.toString()},l)},my=({address:e,line:t,separator:n})=>{const r=[];let l=0;for(const d of t){if(d===","){r.push(nt.jsx("span",{children:n},`separator-${l++}`));continue}const f=e[d];if(!f)continue;const p=fy(d,e);if(p){r.push(nt.jsxs(ay.Fragment,{children:[" ",nt.jsx("abbr",{title:p,children:f})]},d));continue}r.push(nt.jsx("span",{children:" "+f},d))}return nt.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var _y=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},yy=typeof window<"u"&&typeof window.document<"u",Ny=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Cy=(typeof self>"u"?"undefined":_y(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",Ey=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ty=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Sf=tl.isBrowser=yy;tl.isWebWorker=Cy;var xy=tl.isNode=Ny;tl.isJsDom=Ey;var vy=tl.isDeno=Ty;class Sy{constructor(){Le(this,"name");Le(this,"isServerSide");Le(this,"version");var t;vy?(this.name="deno",this.version="",Sf&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):xy?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):Sf?(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 Qo=()=>new Sy,wy=(...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 Zc(e){if(!pd(e))throw new Error("Parameter was not an error")}function pd(e){return!!e&&typeof e=="object"&&Oy(e)==="[object Error]"||e instanceof Error}function Oy(e){return Object.prototype.toString.call(e)}const Dy="Layerr";let Ay=Dy;function My(){return Ay}function Ry(e){let t,n="";if(e.length===0)t={};else if(pd(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 Di extends Error{constructor(t,n){const r=[...arguments],{options:l,shortMessage:d}=Ry(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=My(),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 Zc(t),t._cause&&pd(t._cause)?t._cause:null}static fullStack(t){Zc(t);const n=Di.cause(t);return n?`${t.stack}
|
|
31
|
+
caused by: ${Di.fullStack(n)}`:t.stack??""}static info(t){Zc(t);const n={},r=Di.cause(t);return r&&Object.assign(n,Di.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 dp="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ia=32,wf=0xffffffffffff,by=10,Ly=16,ea=Object.freeze({source:"ulid"});function Iy(e){const t=ky(),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 Di({info:{code:"PRNG_DETECT",...ea}},"Failed to find a reliable PRNG")}function ky(){return Fy()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Py(e,t){let n="";for(;e>0;e--)n=By(t)+n;return n}function $y(e,t){if(isNaN(e))throw new Di({info:{code:"ENC_TIME_NAN",...ea}},`Time must be a number: ${e}`);if(e>wf)throw new Di({info:{code:"ENC_TIME_SIZE_EXCEED",...ea}},`Cannot encode a time larger than ${wf}: ${e}`);if(e<0)throw new Di({info:{code:"ENC_TIME_NEG",...ea}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Di({info:{code:"ENC_TIME_TYPE",...ea}},`Time must be an integer: ${e}`);let n,r="";for(let l=t;l>0;l--)n=e%ia,r=dp.charAt(n)+r,e=(e-n)/ia;return r}function Fy(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function By(e){let t=Math.floor(e()*ia);return t===ia&&(t=ia-1),dp.charAt(t)}function Hy(e,t){const n=Iy(),r=isNaN(e)?Date.now():e;return $y(r,by)+Py(Ly,n)}var Of="yext_analytics_session_id";function Wy(){if(typeof window>"u")return null;try{var e=window.sessionStorage.getItem(Of);return e||(e=Hy(),window.sessionStorage.setItem(Of,e)),e}catch(t){return console.warn(`Unable to use browser sessionStorage for sessionId.
|
|
32
|
+
`,t),null}}const Ky="1.0.0",Df={version:Ky};function zy(e,t,n){return n.debug?(fp(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function Uy(e,t,n){return n.debug?(fp(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Gy(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function fp(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 ju=function(){return ju=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},ju.apply(this,arguments)},Vu=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]=Vu(n[r],l)}return ju({},n)},Yy="yextevents.com/accounts/me/events";function jy(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")+"."+Yy}var Vy=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(T){try{E(r.next(T))}catch(S){f(S)}}function _(T){try{E(r.throw(T))}catch(S){f(S)}}function E(T){T.done?d(T.value):l(T.value).then(p,_)}E((r=r.apply(e,t||[])).next())})},qy=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(E){return function(T){return _([E,T])}}function _(E){if(r)throw new TypeError("Generator is already executing.");for(;f&&(f=0,E[0]&&(n=0)),n;)try{if(r=1,l&&(d=E[0]&2?l.return:E[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,E[1])).done)return d;switch(l=0,d&&(E=[E[0]&2,d.value]),E[0]){case 0:case 1:d=E;break;case 4:return n.label++,{value:E[1],done:!1};case 5:n.label++,l=E[1],E=[0];continue;case 7:E=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(E[0]===6||E[0]===2)){n=0;continue}if(E[0]===3&&(!d||E[1]>d[0]&&E[1]<d[3])){n.label=E[1];break}if(E[0]===6&&n.label<d[1]){n.label=d[1],d=E;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(E);break}d[2]&&n.ops.pop(),n.trys.pop();continue}E=t.call(e,n)}catch(T){E=[6,T],l=0}finally{r=d=0}if(E[0]&5)throw E[1];return{value:E[0]?E[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:Vu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return Vy(this,void 0,void 0,function(){var r,l,d,f,p=this;return qy(this,function(_){return r=Vu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Wy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Df.version:r.clientSdk=(f={},f.ANALYTICS=Df.version,f),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,l=Gy(r,this.config.forceFetch),d=jy(this.config.env,this.config.region),l?[2,new Promise(function(E,T){zy(d,r,p.config)?E(""):T("Failed Beacon Call")})]:[2,Uy(d,r,this.config).then(function(E){return E}).catch(function(E){return E})]})})},e}();function Jy(e){return new Zy(e)}function qu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function hp(e,t){return[e,t].filter(n=>!!n).map(n=>qu(n)).join("_")}const Xy=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},md=rt.createContext(null),Qy=rt.lazy(()=>Promise.resolve().then(()=>require("./debugger-Def1AiTA.cjs")));function eN(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 E=rt.useRef(null),[T,S]=rt.useState(!1);rt.useEffect(()=>{S(!0)},[]),E.current===null&&(E.current=new gp(n,r,l,d,f,_,p??uc()));const w=E.current;return rt.useEffect(()=>(window.enableYextAnalytics=()=>{w.optIn()},()=>{delete window.enableYextAnalytics}),[w]),nt.jsxs(nt.Fragment,{children:[nt.jsx(md.Provider,{value:w,children:t}),T&&(p||uc())&&Qo().name==="browser"?nt.jsx(rt.Suspense,{fallback:nt.jsx(nt.Fragment,{}),children:nt.jsx(Qy,{})}):null]})}function uc(){return Qo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class gp{constructor(t,n,r,l,d,f,p=!1){Le(this,"_optedIn");Le(this,"_sessionTrackingEnabled");Le(this,"_analyticsEventService");Le(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(Qo().name!=="browser"||!this._optedIn)return;if(!wy(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=Xy(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=Jy(n).with(r)}canTrack(){return Qo().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:E}=t;let T;f&&(T={amount:f,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:qu(r)||void 0,originalEventName:hp(r||"",qu(l)||"")},value:T,destinationUrl:p||void 0,customTags:_,customValues:E}))}getDebugEnabled(){return this.enableDebugging||uc()}}const Zu=rt.createContext({name:""}),_d=()=>rt.useContext(Zu).name;function tN(e){var f;const t=_d(),[n]=rt.useState({name:hp(t,e.name)}),r=(f=nl())==null?void 0:f.getDebugEnabled(),[l,d]=rt.useState(!1);return rt.useEffect(()=>{d(!0)},[]),r&&l?nt.jsx("section",{"data-ya-scope":n.name,children:nt.jsx(Zu.Provider,{value:n,children:e.children})}):nt.jsx(Zu.Provider,{value:n,children:e.children})}function nl(){const e=rt.useContext(md);if(!e)return e;Qo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=_d();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 nN=()=>{var e;return(e=nl())==null?void 0:e.track},rN=()=>{var e;return(e=nl())==null?void 0:e.pageView},iN=()=>{var e;return(e=nl())==null?void 0:e.identify},Qi={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},sN=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]}`:"",E=p[0];return{scheme:t,partition:r,env:d,accountId:f,contentHash:E,extension:_}},oN=(e,t,n,r)=>{const l=`https://dyn${e.partition==="us"?"":`.${e.partition}`}.mktgcdn.com`;let d="f";switch(e.env){case"prod":break;case"sbx":{d+="-sandbox";break}default:d+=`-${e.env.toString()}`}const f=e.accountId!==void 0?`${e.accountId}/`:"",p=mp(r);return`${l}/${d}/${f}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}${p}`},lN=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}},aN=(e,t,n,r)=>{const l="https://dyn.mktgcdn.com";let d="p";switch(e.env){case"prod":break;case"sbx":{d+="-sandbox";break}default:d+=`-${e.env.toString()}`}const f=mp(r);return`${l}/${d}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}${f}`},dc=(e,t,n,r)=>{if(!pp(e)){console.error(`Invalid image url: ${e}.`);return}const l=new URL(e);if(l.pathname.startsWith("/p")){const d=lN(l);if(d)return aN(d,t,n,r)}else if(l.pathname.startsWith("/f")){const d=sN(l);if(d)return oN(d,t,n,r)}return e},pp=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},mp=e=>{if(!e||Object.keys(e).length===0)return"";const t=Object.entries(e).filter(([n,r])=>r!==void 0&&String(r)!=="").map(([n,r])=>`${n}=${r}`).join(",");return t.length>0?`,${t}`:""},cN=({image:e,className:t,width:n,height:r,aspectRatio:l,layout:d=Qi.INTRINSIC,placeholder:f,imgOverrides:p,style:_={},imageTransformations:E,loading:T="lazy"})=>{const S=rt.useRef(null),[w,M]=rt.useState(!1),m="image"in e?e.image:e;rt.useEffect(()=>{var H;(H=S.current)!=null&&H.complete&&M(!0)},[]),uN(d,m.width,m.height,n,r,l);const v=Math.abs(m.width);v||console.warn("Invalid image width.");const I=Math.abs(m.height);if(I||console.warn("Invalid image height."),!pp(m.url))return console.error(`Invalid image url: ${m.url}`),nt.jsx(nt.Fragment,{children:f!=null&&f});const G=n&&n>0?n:void 0,P=r&&r>0?r:void 0,{src:k,imgStyle:W,widths:Y,updatedImageTransformations:re}=dN(d,v,I,_,m.url,G,P,l,E),te=Y.map(H=>`${dc(m.url,H,(d===Qi.ASPECT&&l?1/l:I/v)*H,re)} ${H}w`).join(", "),ue=[640,768,1024,1280,1536],q=Y.map((H,V)=>V===Y.length-1?`${H}px`:`(max-width: ${ue[V]}px) ${H}px`).join(", ");return nt.jsxs(nt.Fragment,{children:[!w&&f!=null&&f,nt.jsx("img",{ref:S,style:W,src:k,className:t,width:G,height:P,srcSet:te,sizes:q,loading:T,alt:m.alternateText||"",...p})]})},uN=(e,t,n,r,l,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Qi.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===Qi.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},dN=(e,t,n,r,l,d,f,p,_)=>{let E=[100,320,640,960,1280,1920],T=dc(l,500,p?500/p:500,_);const S={...r},w=_?{..._}:{};switch(S.objectFit=S.objectFit||"cover",S.objectPosition=S.objectPosition||"center",e){case Qi.INTRINSIC:S.maxWidth=t,S.width="100%",S.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Qi.FIXED:{const{fixedWidth:M,fixedHeight:m,fixedWidths:v}=fN(t,n,E,d,f);S.width=M,S.height=m,E=v,T=dc(l,M,m,w);break}case Qi.ASPECT:S.aspectRatio=p?`${p}`:`${t} / ${n}`,w&&(w.fit=(w==null?void 0:w.fit)||"cover");break;case Qi.FILL:S.width="100%",S.aspectRatio=p?`${p}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:T,imgStyle:S,widths:E,updatedImageTransformations:w}},fN=(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 _p={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})()})(gp);var uN=gp.exports;const lo=hd(uN),dN="phonecall",fN="drivingdirection",Of="calltoactionclick",hN="clicktowebsite",gN="other",Df="link",pN="cta",mN=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=NN(t.link)),t.link=CN(t),t},_N=(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"}},yN=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return dN;case"EMAIL":return Of;case"URL":return Df;case"DRIVING_DIRECTIONS":return fN;case"CLICK_TO_WEBSITE":return hN;case"OTHER":return gN;default:return n?Of:Df}return pN},NN=e=>EN(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",CN=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,EN=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),pp=rt.forwardRef(function(t,n){const{children:r,onClick:l,className:d,eventName:f,scope:p,currency:_,amount:E,cta:T,obfuscate:S,customTags:w,customValues:O,...m}=t,v=mN(t),I=_N(v,!!T),G=yN(f,v.linkType,!!T),k=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(k!==null)try{await k.track({action:I,scope:p,eventName:G,currency:_,amount:E,destinationUrl:V||ce.href,customTags:w,customValues:O})}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:lo("Link",d),href:P?btoa(v.link):v.link,onClick:H,rel:t.target&&!t.rel?"noopener":t.rel,ref:n};return k!=null&&k.getDebugEnabled()&&(re["data-ya-action"]=I,re["data-ya-scopeoverride"]=p,re["data-ya-eventname"]=G),nt.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 Zc=3959,Jc=6371,TN=["latitude","lat"],xN=["longitude","lon","lng","long"];function Af(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function Mf(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 ro(e){return e*Math.PI/180}function Zi(e){return e/Math.PI*180}function vN(e,t){const n=ro(e.latitude),r=ro(t.latitude),l=r-n,d=ro(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 SN(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 wN(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=Af(t,TN)??0,l=Af(t,xN)??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(Mf(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=Mf(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?ro(t):t,f=r===Nn.DEGREE?n:Zi(n);this.latitude=wN(this.latitude,d),this.longitude+=f}else switch(r){case Nn.DEGREE:this.latitude+=t,this.longitude+=n;break;case Nn.KILOMETER:this.latitude+=Zi(t)*Jc,this.longitude+=Zi(n)*Jc*Math.cos(ro(this.latitude));break;case Nn.MILE:this.latitude+=Zi(t)*Zc,this.longitude+=Zi(n)*Zc*Math.cos(ro(this.latitude));break;case Nn.RADIAN:this.latitude+=Zi(t),this.longitude+=Zi(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=SN(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),f=ro(Math.min(d,360-d)),p=Math.sqrt(Math.pow(l,2)+Math.pow(f,2));switch(n){case Nn.DEGREE:return Zi(p);case Nn.RADIAN:return p;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const l=vN(this,t);switch(n){case Nn.DEGREE:return Zi(l);case Nn.KILOMETER:return l*Jc;case Nn.MILE:return l*Zc;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 mp(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 _p{constructor(t,n){Ie(this,"providerMapClass");Ie(this,"wrapper");Ie(this,"controlEnabled");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"providerOptions");wr(t,co),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,_p),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 yp{constructor(t){Ie(this,"providerPinClass");Ie(this,"clickHandler");Ie(this,"focusHandler");Ie(this,"hoverHandler");Ie(this,"icons");Ie(this,"hasPinUrl");wr(t,co),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 _d{constructor(t){Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_icons");wr(t,yp),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 ON=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class il extends _d{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 ON}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 ao{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=_d,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 co(this)}}class co{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,ao),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 DN 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 AN 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 Rf="GoogleMapsCallback_b7d77ff2",MN="https://maps.googleapis.com/maps/api/js";function RN(e,t,n,{autocomplete:r=!1,channel:l=window.location.hostname,client:d,language:f,region:p,libraries:_=[],loading:E="async",params:T={}}={}){window[Rf]=e,r&&_.push("geocoder","places");const S={callback:Rf,channel:l,libraries:_.join(","),...T};n&&(S.key=n),d&&(S.client=d),f&&(S.language=f),p&&(S.region=p),E&&(S.loading=E),mp(MN+"?"+Object.entries(S).map(([w,O])=>w+"="+O).join("&"))}const Np=new ao().withLoadFunction(RN).withMapClass(DN).withPinClass(AN).withProviderName("Google").build();class to{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(E=>E.latitude),r=Math.max(...n),l=Math.min(...n),d=t.map(E=>E.normalLon).sort((E,T)=>E-T),f=d.map((E,T)=>({distance:(T<d.length-1?d[T+1]:d[0]+360)-E,index:T})).reduce((E,T)=>T.distance>E.distance?T:E).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 bN{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 yd{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 bN,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,co),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new LN(this)}}class LN{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,yd),t.provider&&wr(t.provider,co),!((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 yp(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,Ep),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 ms=.98;function qa(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class Cp{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,co),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 Ep(this)}}let Ep=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,Cp),t.provider&&wr(t.provider,co),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 _p(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(to.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,E=r*p;this._cachedBounds=new to(f,f),this._cachedBounds.ne.add(E/2,_/2,Nn.DEGREE,Gr.MERCATOR),this._cachedBounds.sw.add(-E/2,-_/2,Nn.DEGREE,Gr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new to(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 yd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new to(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 to(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 _=qa(l.bottom,f),E=qa(l.left,p),T=qa(l.right,p),S=qa(l.top,f),w=E+T,O=_+S;w>ms&&(E*=ms/w,T*=ms/w,w=ms),O>ms&&(_*=ms/O,S*=ms/O,O=ms);const m=f*(1-O),v=p*(1-w),I=new to(n,t),G=new dn(I.ne.latitude,I.sw.longitude),k=I.sw.distanceTo(G,Nn.DEGREE,Gr.MERCATOR),P=(I.ne.longitude-G.longitude+360)%360;let H=Math.max(k,P*m/v)/(1-O),j=Math.max(P,k*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=I.getCenter(Gr.MERCATOR),ce=(S-_)/2*H,V=(T-E)/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 Nc=rt.createContext(null);function IN(){const e=rt.useContext(Nc);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Tp=({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:E={bottom:50,left:50,right:50,top:50},panHandler:T=()=>null,panStartHandler:S=()=>null,provider:w=Np,providerOptions:O={},singleZoom:m=14})=>{const v=rt.useRef(null),[I,G]=rt.useState(new dn(f)),[k,P]=rt.useState(!1),[H,j]=rt.useState(),[re,te]=rt.useState(p),ce=(V,z)=>{T(V,z),z&&G(z.getCenter())};return rt.useEffect(()=>{!k||!H||te(H.getZoom())},[I]),rt.useEffect(()=>{if(!t||!k||!H)return;const V=t.map(z=>new dn(z));H.fitCoordinates(V)},[JSON.stringify(t),H]),rt.useEffect(()=>{if(!k||H)return;const V=new Cp().withControlEnabled(d).withDefaultCenter(I).withDefaultZoom(re).withPadding(E).withPanHandler(ce).withPanStartHandler(S).withProvider(w).withProviderOptions(O).withSinglePinZoom(m).withWrapper(v.current).build();j(V),_&&(_.current=V)},[k]),rt.useEffect(()=>{k||H||!v.current||w.load(e,{...O,...l&&{client:l}}).then(()=>P(!0))},[]),nt.jsx("div",{className:lo({"is-loaded":k},r),id:"map",ref:v,"data-testid":"map",children:H&&nt.jsx(Nc.Provider,{value:{map:H,provider:w},children:n})})},kN=({count:e})=>nt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:nt.jsxs("g",{fill:"none",fillRule:"evenodd",children:[nt.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),nt.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:nt.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),Nd=rt.createContext(null);function PN(){const e=rt.useContext(Nd);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const $N=({clusterRadius:e=50,children:t,ClusterTemplate:n=kN})=>{const{map:r}=rt.useContext(Nc),[l,d]=rt.useState([]),[f,p]=rt.useState(),[_,E]=rt.useState([]),[T,S]=rt.useState([]);return rt.useEffect(()=>{p(FN(l,r.getZoom(),e))},[l,r.getZoom()]),rt.useEffect(()=>{S(()=>[]),E(()=>[]),(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 O=to.fit(w.map(v=>v.pin.getCoordinate())).getCenter(Gr.MERCATOR),m=`cluster-{${O._lat},${O._lon}}`;w.forEach(v=>v.pin.setMap(null)),E(v=>[...v,m]),S(v=>[...v,nt.jsx(Cd,{coordinate:O,id:m,onClick:()=>r.fitCoordinates(w.map(I=>I.pin.getCoordinate()),!0,1/0),children:nt.jsx(n,{count:w.length})},m)])}}))},[f]),nt.jsx(Nd.Provider,{value:{clusters:f??[],clusterIds:_,setPinStore:d},children:nt.jsxs(nt.Fragment,{children:[T.map((w,O)=>nt.jsx(rt.Fragment,{children:w},O)),t]})})},FN=(e,t,n)=>{const r=n*Math.PI/2**(t+7),l=e.map((p,_)=>[_]),d=[];e.forEach((p,_)=>{for(let E=_;E<e.length;E++)E!==_&&new dn(p.pin.getCoordinate()).distanceTo(new dn(e[E].pin.getCoordinate()),Nn.RADIAN,Gr.MERCATOR)<=r&&(l[_].push(E),l[E].push(_))});let f=1;for(;f;){f=0;let p;if(l.forEach((T,S)=>{T.length>f&&(f=T.length,p=S)}),!f)break;const _=l[p??0],E=[];l[p??0]=[];for(const T of _){const S=l[T];E.push(e[T]),l[T]=[],S.forEach(w=>l[w].splice(l[w].indexOf(T),1))}d.push(E)}return d},BN=nt.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:nt.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"})}),Cd=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:l=BN,onClick:d=()=>null,onFocus:f=()=>null,onHover:p=()=>null,zIndex:_,hasPinUrl:E=!1})=>{const{map:T,provider:S}=rt.useContext(Nc),w=rt.useContext(Nd),O=rt.useMemo(()=>new yd().withCoordinate(t).withHideOffscreen(n).withProvider(S).withHasPinUrl(E).build(),[]);rt.useEffect(()=>{if(_!==0&&!_)return;const v=O.getProviderPin().getWrapperElement();v&&(v.style.zIndex=_.toString())},[_]),rt.useEffect(()=>{O.setMap(T),O.setClickHandler(()=>d(r)),O.setFocusHandler(I=>f(I,r)),O.setHoverHandler(I=>p(I,r));const v=w==null?void 0:w.clusterIds.includes(r);return w&&!v&&w.setPinStore(I=>[...I,{pin:O,id:r}]),()=>{O.setMap(null),w&&w.setPinStore(I=>I.filter(G=>G.id!==r))}},[]);const m=e||l;if(m){const v=O.getProviderPin().getPinElement();return Object.assign(v.style,{height:"auto",width:"auto"}),fd.createPortal(m,v)}return null},HN=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:l=()=>null,onHover:d=()=>null,onFocus:f=()=>null,...p})=>{var _;return nt.jsx(Tp,{bounds:[t],...p,children:nt.jsx(Cd,{coordinate:t,id:"location-map-marker",onClick:l,onHover:d,onFocus:f,hasPinUrl:((_=r||"")==null?void 0:_.length)>0,children:r?nt.jsx(pp,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var Xc={},Vl={},bf;function WN(){if(bf)return Vl;bf=1;var e=rt;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={},Lf;function KN(){if(Lf)return ql;Lf=1;var e=rt;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 Qc,If;function qn(){return If||(If=1,Qc=process.env.NODE_ENV==="development"?WN():KN()),Qc}var He={},kf;function zN(){if(kf)return He;kf=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"),E=e("REMOVE_TEXT_COMMAND"),T=e("DELETE_WORD_COMMAND"),S=e("DELETE_LINE_COMMAND"),w=e("FORMAT_TEXT_COMMAND"),O=e("UNDO_COMMAND"),m=e("REDO_COMMAND"),v=e("KEYDOWN_COMMAND"),I=e("KEY_ARROW_RIGHT_COMMAND"),G=e("MOVE_TO_END"),k=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"),D=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"),M=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,tn=2,Oe=1,ie=2,le=4,ve=8,Le=16,Me=32,je=64,it=128,st=Oe|ie|le|ve|Le|Me|je|it,ot=1,St=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})()})(_p);var hN=_p.exports;const ao=gd(hN),gN="phonecall",pN="drivingdirection",Af="calltoactionclick",mN="clicktowebsite",_N="other",Mf="link",yN="cta",NN=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");if(typeof t.link!="string")throw e.cta?new Error("CTA's link is not a valid string"):new Error("Link's href is not a valid string");return t.linkType||(t.linkType=TN(t.link)),t.link=xN(t),t},CN=(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"}},EN=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return gN;case"EMAIL":return Af;case"URL":return Mf;case"DRIVING_DIRECTIONS":return pN;case"CLICK_TO_WEBSITE":return mN;case"OTHER":return _N;default:return n?Af:Mf}return yN},TN=e=>vN(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",xN=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,vN=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),yp=rt.forwardRef(function(t,n){const{children:r,onClick:l,className:d,eventName:f,scope:p,currency:_,amount:E,cta:T,obfuscate:S,customTags:w,customValues:M,...m}=t,v=NN(t),I=CN(v,!!T),G=EN(f,v.linkType,!!T),P=nl(),k=S||S!==!1&&v.linkType==="EMAIL",W=async te=>{const ue=te.currentTarget;let q="";if(k){te.preventDefault();const H=ue.href.split("/").at(-1);H&&(q=atob(H))}if(P!==null)try{await P.track({action:I,scope:p,eventName:G,currency:_,amount:E,destinationUrl:q||ue.href,customTags:w,customValues:M})}catch{console.error("Failed to report click Analytics Event")}l&&l(te),q&&(window.location.href=q)},Y=k?"Obfuscated, set a label or child":v.link,re={className:ao("Link",d),href:k?btoa(v.link):v.link,onClick:W,rel:t.target&&!t.rel?"noopener":t.rel,ref:n};return P!=null&&P.getDebugEnabled()&&(re["data-ya-action"]=I,re["data-ya-scopeoverride"]=p,re["data-ya-eventname"]=G),nt.jsx("a",{...m,...re,suppressHydrationWarning:!0,children:r||v.label||Y})});var Nn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(Nn||{}),Ur=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Ur||{});const Jc=3959,Xc=6371,SN=["latitude","lat"],wN=["longitude","lon","lng","long"];function Rf(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function bf(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 Zi(e){return e/Math.PI*180}function ON(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 DN(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 AN(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){Le(this,"_lat");Le(this,"_lon");let r=t,l=n;this._lat=0,this._lon=0,typeof t=="object"?(r=Rf(t,SN)??0,l=Rf(t,wN)??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(bf(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=bf(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=Nn.DEGREE,l=Ur.SPHERICAL){if(l===Ur.MERCATOR&&(r===Nn.DEGREE||r===Nn.RADIAN)){const d=r===Nn.DEGREE?io(t):t,f=r===Nn.DEGREE?n:Zi(n);this.latitude=AN(this.latitude,d),this.longitude+=f}else switch(r){case Nn.DEGREE:this.latitude+=t,this.longitude+=n;break;case Nn.KILOMETER:this.latitude+=Zi(t)*Xc,this.longitude+=Zi(n)*Xc*Math.cos(io(this.latitude));break;case Nn.MILE:this.latitude+=Zi(t)*Jc,this.longitude+=Zi(n)*Jc*Math.cos(io(this.latitude));break;case Nn.RADIAN:this.latitude+=Zi(t),this.longitude+=Zi(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=Nn.MILE,r=Ur.SPHERICAL){if(r===Ur.MERCATOR&&(n===Nn.DEGREE||n===Nn.RADIAN)){const l=DN(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 Zi(p);case Nn.RADIAN:return p;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const l=ON(this,t);switch(n){case Nn.DEGREE:return Zi(l);case Nn.KILOMETER:return l*Xc;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 Np(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 Ir(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 yd(e){if(!(e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.tagName=="string"))throw new Error(`Value with name ${e.constructor.name} is not a valid HTMLElement.`)}function ti(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 Cp{constructor(t,n){Le(this,"providerMapClass");Le(this,"wrapper");Le(this,"controlEnabled");Le(this,"panHandler");Le(this,"panStartHandler");Le(this,"providerOptions");Le(this,"iframeWindow");Le(this,"apiKey");ti(t,xs),n&&yd(n),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 Ir(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return Ir(t,Sr.FUNCTION),this.panStartHandler=t,this}withProviderOptions(t){return this.providerOptions=t,this}withIframeWindow(t){return this.iframeWindow=t,this}withApiKey(t){return this.apiKey=t,this}build(){const t=this.providerMapClass;return new t(this)}}class rl{constructor(t){Le(this,"_panHandler");Le(this,"_panStartHandler");ti(t,Cp),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 Ep{constructor(t){Le(this,"providerPinClass");Le(this,"clickHandler");Le(this,"focusHandler");Le(this,"hoverHandler");Le(this,"icons");Le(this,"hasPinUrl");ti(t,xs),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return Ir(t,Sr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return Ir(t,Sr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return Ir(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 Nd{constructor(t){Le(this,"_clickHandler");Le(this,"_focusHandler");Le(this,"_hoverHandler");Le(this,"_icons");ti(t,Ep),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 MN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class il extends Nd{constructor(n){super(n);Le(this,"_pinEl");Le(this,"_pinAlt");Le(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 MN}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 co{constructor(){Le(this,"loadFunction");Le(this,"mapClass");Le(this,"pinClass");Le(this,"providerName");this.loadFunction=(t,n,r,l)=>t(),this.mapClass=rl,this.pinClass=Nd,this.providerName=""}withLoadFunction(t){return Ir(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 xs(this)}}class xs{constructor(t){Le(this,"_loadFunction");Le(this,"_mapClass");Le(this,"_pinClass");Le(this,"_providerName");Le(this,"_loadPromise");Le(this,"_resolveLoad");Le(this,"_rejectLoad");Le(this,"_apiKey");Le(this,"_loadInvoked");Le(this,"_loaded");Le(this,"_options");ti(t,co),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 RN extends rl{constructor(n){super(n);Le(this,"map");Le(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 bN extends il{constructor(n){super(n);Le(this,"_latLng");Le(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(f){super();Le(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 Lf="GoogleMapsCallback_b7d77ff2",LN="https://maps.googleapis.com/maps/api/js";function IN(e,t,n,{autocomplete:r=!1,channel:l=window.location.hostname,client:d,language:f,region:p,libraries:_=[],loading:E="async",params:T={}}={}){window[Lf]=e,r&&_.push("geocoder","places");const S={callback:Lf,channel:l,libraries:_.join(","),...T};n&&(S.key=n),d&&(S.client=d),f&&(S.language=f),p&&(S.region=p),E&&(S.loading=E),Np(LN+"?"+Object.entries(S).map(([w,M])=>w+"="+M).join("&"))}const Tp=new co().withLoadFunction(IN).withMapClass(RN).withPinClass(bN).withProviderName("Google").build();class no{constructor(t,n){Le(this,"_ne");Le(this,"_sw");this._ne=new dn(n),this._sw=new dn(t)}static fit(t){const n=t.map(E=>E.latitude),r=Math.max(...n),l=Math.min(...n),d=t.map(E=>E.normalLon).sort((E,T)=>E-T),f=d.map((E,T)=>({distance:(T<d.length-1?d[T+1]:d[0]+360)-E,index:T})).reduce((E,T)=>T.distance>E.distance?T:E).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=Ur.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 kN{constructor(){Le(this,"_anchorX");Le(this,"_anchorY");Le(this,"_height");Le(this,"_icon");Le(this,"_srText");Le(this,"_width");Le(this,"_zIndex");Le(this,"_class");Le(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 Cd{constructor(){Le(this,"coordinate");Le(this,"hideOffscreen");Le(this,"icons");Le(this,"propertiesForStatus");Le(this,"provider");Le(this,"type");Le(this,"hasPinUrl");this.coordinate=new dn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new kN,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 Ir(t,Sr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(ti(t,xs),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new PN(this)}}class PN{constructor(t){Le(this,"_coordinate");Le(this,"_hideOffscreen");Le(this,"_icons");Le(this,"_propertiesForStatus");Le(this,"_type");Le(this,"_clickHandler");Le(this,"_focusHandler");Le(this,"_hoverHandler");Le(this,"_hidden");Le(this,"_cancelHiddenUpdater");Le(this,"_map");Le(this,"_pin");Le(this,"_status");var n,r;if(ti(t,Cd),t.provider&&ti(t.provider,xs),!((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 Ep(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){Ir(t,Sr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new dn(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){Ir(t,Sr.FUNCTION),this._focusHandler=t}setHoverHandler(t){Ir(t,Sr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&ti(t,vp),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 qa(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class xp{constructor(){Le(this,"controlEnabled");Le(this,"defaultCenter");Le(this,"defaultZoom");Le(this,"legendPins");Le(this,"padding");Le(this,"panHandler");Le(this,"panStartHandler");Le(this,"provider");Le(this,"providerOptions");Le(this,"singlePinZoom");Le(this,"wrapper");Le(this,"iframeWindow");Le(this,"apiKey");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 Ir(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return Ir(t,Sr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return ti(t,xs),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(yd(t),this.wrapper=t,this):this}withIframeWindow(t){return this.iframeWindow=t,this}withApiKey(t){return this.apiKey=t,this}build(){return new vp(this)}}let vp=class{constructor(t){Le(this,"_defaultCenter");Le(this,"_defaultZoom");Le(this,"_legendPins");Le(this,"_padding");Le(this,"_provider");Le(this,"_singlePinZoom");Le(this,"_wrapper");Le(this,"_cachedBounds");Le(this,"_resolveIdle");Le(this,"_resolveMoving");Le(this,"_idlePromise");Le(this,"_panHandlerRunning");Le(this,"_panStartHandlerRunning");Le(this,"_currentBounds");Le(this,"_movingPromise");Le(this,"_panHandler");Le(this,"_panStartHandler");Le(this,"_map");var n,r,l;if(ti(t,xp),t.provider&&ti(t.provider,xs),t.wrapper&&yd(t.wrapper),!((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 Cp(t.provider,this._wrapper).withControlEnabled(t.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(t.providerOptions).withIframeWindow(t.iframeWindow).withApiKey(t.apiKey).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,E=r*p;this._cachedBounds=new no(f,f),this._cachedBounds.ne.add(E/2,_/2,Nn.DEGREE,Ur.MERCATOR),this._cachedBounds.sw.add(-E/2,-_/2,Nn.DEGREE,Ur.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 Cd().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 H,V;const f=(H=this._wrapper)==null?void 0:H.offsetHeight,p=(V=this._wrapper)==null?void 0:V.offsetWidth;if(!f||!p)return;let _=qa(l.bottom,f),E=qa(l.left,p),T=qa(l.right,p),S=qa(l.top,f),w=E+T,M=_+S;w>_s&&(E*=_s/w,T*=_s/w,w=_s),M>_s&&(_*=_s/M,S*=_s/M,M=_s);const m=f*(1-M),v=p*(1-w),I=new no(n,t),G=new dn(I.ne.latitude,I.sw.longitude),P=I.sw.distanceTo(G,Nn.DEGREE,Ur.MERCATOR),k=(I.ne.longitude-G.longitude+360)%360;let W=Math.max(P,k*m/v)/(1-M),Y=Math.max(k,P*v/m)/(1-w),re=Math.log2(p*360/Y)-8;re>d&&(re=d,Y=p*360/2**(re+8),W=Y*f/p);const te=I.getCenter(Ur.MERCATOR),ue=(S-_)/2*W,q=(T-E)/2*Y;te.add(ue,q,Nn.DEGREE,Ur.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){Ir(t,Sr.FUNCTION),this._panHandler=t}setPanStartHandler(t){Ir(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 Cc=rt.createContext(null);function $N(){const e=rt.useContext(Cc);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Sp=({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:E={bottom:50,left:50,right:50,top:50},panHandler:T=()=>null,panStartHandler:S=()=>null,provider:w=Tp,providerOptions:M={},singleZoom:m=14,iframeId:v})=>{const I=rt.useRef(null),[G,P]=rt.useState(new dn(f)),[k,W]=rt.useState(!1),[Y,re]=rt.useState(),[te,ue]=rt.useState(p),q=(H,V)=>{T(H,V),V&&P(V.getCenter())};return rt.useEffect(()=>{!k||!Y||ue(Y.getZoom())},[G]),rt.useEffect(()=>{if(!t||!k||!Y)return;const H=t.map(V=>new dn(V));Y.fitCoordinates(H)},[JSON.stringify(t),Y]),rt.useEffect(()=>{var Ee;if(!k||Y)return;const H=v&&typeof document<"u"?((Ee=document.getElementById(v))==null?void 0:Ee.contentWindow)??void 0:void 0,V=new xp().withControlEnabled(d).withDefaultCenter(G).withDefaultZoom(te).withPadding(E).withPanHandler(q).withPanStartHandler(S).withProvider(w).withProviderOptions(M).withSinglePinZoom(m).withWrapper(I.current).withIframeWindow(H).withApiKey(e).build();re(V),_&&(_.current=V)},[k]),rt.useEffect(()=>{k||Y||!I.current||w instanceof xs&&w.load(e,{...M,...l&&{client:l}}).then(()=>W(!0))},[]),nt.jsx("div",{className:ao({"is-loaded":k},r),id:"map",ref:I,"data-testid":"map",children:Y&&nt.jsx(Cc.Provider,{value:{map:Y,provider:w},children:n})})},FN=({count:e})=>nt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:nt.jsxs("g",{fill:"none",fillRule:"evenodd",children:[nt.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),nt.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:nt.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),Ed=rt.createContext(null);function BN(){const e=rt.useContext(Ed);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const HN=({clusterRadius:e=50,children:t,ClusterTemplate:n=FN})=>{const{map:r}=rt.useContext(Cc),[l,d]=rt.useState([]),[f,p]=rt.useState(),[_,E]=rt.useState([]),[T,S]=rt.useState([]);return rt.useEffect(()=>{p(WN(l,r.getZoom(),e))},[l,r.getZoom()]),rt.useEffect(()=>{S(()=>[]),E(()=>[]),(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(Ur.MERCATOR),m=`cluster-{${M._lat},${M._lon}}`;w.forEach(v=>v.pin.setMap(null)),E(v=>[...v,m]),S(v=>[...v,nt.jsx(Td,{coordinate:M,id:m,onClick:()=>r.fitCoordinates(w.map(I=>I.pin.getCoordinate()),!0,1/0),children:nt.jsx(n,{count:w.length})},m)])}}))},[f]),nt.jsx(Ed.Provider,{value:{clusters:f??[],clusterIds:_,setPinStore:d},children:nt.jsxs(nt.Fragment,{children:[T.map((w,M)=>nt.jsx(rt.Fragment,{children:w},M)),t]})})},WN=(e,t,n)=>{const r=n*Math.PI/2**(t+7),l=e.map((p,_)=>[_]),d=[];e.forEach((p,_)=>{for(let E=_;E<e.length;E++)E!==_&&new dn(p.pin.getCoordinate()).distanceTo(new dn(e[E].pin.getCoordinate()),Nn.RADIAN,Ur.MERCATOR)<=r&&(l[_].push(E),l[E].push(_))});let f=1;for(;f;){f=0;let p;if(l.forEach((T,S)=>{T.length>f&&(f=T.length,p=S)}),!f)break;const _=l[p??0],E=[];l[p??0]=[];for(const T of _){const S=l[T];E.push(e[T]),l[T]=[],S.forEach(w=>l[w].splice(l[w].indexOf(T),1))}d.push(E)}return d},KN=nt.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:nt.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"})}),Td=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:l=KN,onClick:d=()=>null,onFocus:f=()=>null,onHover:p=()=>null,zIndex:_,hasPinUrl:E=!1})=>{const{map:T,provider:S}=rt.useContext(Cc),w=rt.useContext(Ed),M=rt.useMemo(()=>new Cd().withCoordinate(t).withHideOffscreen(n).withProvider(S).withHasPinUrl(E).build(),[]);rt.useEffect(()=>{if(_!==0&&!_)return;const v=M.getProviderPin().getWrapperElement();v&&(v.style.zIndex=_.toString())},[_]),rt.useEffect(()=>{M.setMap(T),M.setClickHandler(()=>d(r)),M.setFocusHandler(I=>f(I,r)),M.setHoverHandler(I=>p(I,r));const v=w==null?void 0:w.clusterIds.includes(r);return w&&!v&&w.setPinStore(I=>[...I,{pin:M,id:r}]),()=>{M.setMap(null),w&&w.setPinStore(I=>I.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"}),hd.createPortal(m,v)}return null},zN=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:l=()=>null,onHover:d=()=>null,onFocus:f=()=>null,...p})=>{var _;return nt.jsx(Sp,{bounds:[t],...p,children:nt.jsx(Td,{coordinate:t,id:"location-map-marker",onClick:l,onHover:d,onFocus:f,hasPinUrl:((_=r||"")==null?void 0:_.length)>0,children:r?nt.jsx(yp,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var Qc={},Vl={},If;function UN(){if(If)return Vl;If=1;var e=rt;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={},kf;function GN(){if(kf)return ql;kf=1;var e=rt;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 eu,Pf;function qn(){return Pf||(Pf=1,eu=process.env.NODE_ENV==="development"?UN():GN()),eu}var He={},$f;function YN(){if($f)return He;$f=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"),E=e("REMOVE_TEXT_COMMAND"),T=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"),I=e("KEY_ARROW_RIGHT_COMMAND"),G=e("MOVE_TO_END"),P=e("KEY_ARROW_LEFT_COMMAND"),k=e("MOVE_TO_START"),W=e("KEY_ARROW_UP_COMMAND"),Y=e("KEY_ARROW_DOWN_COMMAND"),re=e("KEY_ENTER_COMMAND"),te=e("KEY_SPACE_COMMAND"),ue=e("KEY_BACKSPACE_COMMAND"),q=e("KEY_ESCAPE_COMMAND"),H=e("KEY_DELETE_COMMAND"),V=e("KEY_TAB_COMMAND"),Ee=e("INSERT_TAB_COMMAND"),Se=e("INDENT_CONTENT_COMMAND"),Te=e("OUTDENT_CONTENT_COMMAND"),de=e("DROP_COMMAND"),z=e("FORMAT_ELEMENT_COMMAND"),O=e("DRAGSTART_COMMAND"),Z=e("DRAGOVER_COMMAND"),oe=e("DRAGEND_COMMAND"),j=e("COPY_COMMAND"),K=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),ce=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,tn=2,Oe=1,ie=2,le=4,ve=8,Ie=16,Me=32,je=64,it=128,st=Oe|ie|le|ve|Ie|Me|je|it,ot=1,St=2,Ge=1,ze=2,tt=3,yt=4,Nt=5,Et=6,gt=" ",mt=ne||ce||Re?gt:"",$t=`
|
|
37
37
|
|
|
38
|
-
`,Kt=De?gt:mt,nn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Vt=new RegExp("^[^"+It+"]*["+nn+"]"),bt=new RegExp("^[^"+nn+"]*["+It+"]"),rn={bold:Oe,code:Le,highlight:it,italic:ie,strikethrough:le,subscript:Me,superscript:je,underline:ve},Or={directionless:ot,unmergeable:St},_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:tn,token:Ut},lt={[At]:"normal",[tn]:"segmented",[Ut]:"token"},wt=100;let Gt=!1,Bt=0;function Pt(){return Gt}function kt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&Co(u).addEventListener("textInput",kt,!0)}function on(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>wt;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 Zt=0;Zt<Rt.length;Zt++){const Wt=Rt[Zt],Dt=go(Wt),cn=Wt.parentNode;if(cn!=null&&Wt!==ae&&Dt===null&&(Wt.nodeName!=="BR"||!on(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 Zt=0;for(let Wt=0;Wt<ht;Wt++){const Dt=Qe[Wt];(Dt.nodeName==="BR"&&on(Dt,Ue,u)||ae===Dt)&&(Ue.appendChild(Dt),Zt++)}ht!==Zt&&(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"&&!on(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 Ai(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=Ai(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=Ai(s,h);break}else break}function ws(u){return fo(u.anchor),fo(u.focus),u}function fo(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 ma(u,s){const c=u._nodes.get(s);if(c===void 0)throw Error(`registeredNode: Type ${s} not found`);return c}const ho=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function rs(u){return An(ii(u))}function Os(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 is(u,s,c){const h=u.getRootElement();try{return h!==null&&h.contains(s)&&h.contains(c)&&s!==null&&!Os(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=No(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=rn[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 Ds(u){return _t(u)||ai(u)||An(u)}function hl(u,s){if(s!=null){u.__key=s;return}fr(),tf();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 Mi(u){tf();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&&Mi(s),c!==null&&Mi(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 Bo()?null:xn()._compositionKey}function Cn(u,s){const h=(s||xi())._nodeMap.get(u);return h===void 0?null:h}function go(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=go(c,s);if(h!==null)return h;c=No(c)}return null}function As(u){const s=u._decorators,c=Object.assign({},s);return u._pendingDecorators=c,c}function po(u){return u.read(()=>tr().getTextContent())}function Ri(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 bi(u){const s=xn(),c=_a(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 _a(u,s){let c=u;for(;c!=null;){const h=c[`__lexicalKey_${s._key}`];if(h!==void 0)return h;c=No(c)}return null}function Ms(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Li(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 mo(u){return u.nodeType===Fe?u.nodeValue:null}function Rs(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 $=mo(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=Fo(),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 bs(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 ya(u,s,c,h){return u===9&&!s&&!c&&!h}function Na(u,s,c,h){return u===66&&!s&&qr(c,h)}function ss(u,s,c,h){return u===73&&!s&&qr(c,h)}function Ls(u,s,c,h){return u===85&&!s&&qr(c,h)}function El(u,s){return Aa(u)&&!s}function Tl(u,s){return Aa(u)&&s}function Is(u,s){return ye&&s&&u===79}function ks(u,s,c){return Zr(u)&&(ye?s:c)}function Ca(u,s,c){return ki(u)&&(ye?s:c)}function Ea(u,s){return ye&&s&&Zr(u)}function Ta(u,s){return ye&&s&&ki(u)}function xa(u,s,c,h){return ye?s||c?!1:Zr(u)||u===72&&h:h||s||c?!1:Zr(u)}function Rc(u,s,c,h,y){return ye?c||h||y?!1:ki(u)||u===68&&s:s||h||y?!1:ki(u)}function bc(u,s,c,h){return u===90&&!s&&qr(c,h)}function va(u,s,c,h){return ye?u===90&&c&&s:u===89&&h||u===90&&h&&s}function Lc(u,s,c,h){return s?!1:u===67?ye?c:h:!1}function Ic(u,s,c,h){return s?!1:u===88?ye?c:h:!1}function Sa(u){return u===37}function wa(u){return u===39}function xl(u){return u===38}function kc(u){return u===40}function Pc(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 os(u,s,c,h){return wa(u)&&!s&&!h&&!c}function Da(u,s,c,h,y){return wa(u)&&!h&&!c&&(s||y)}function $c(u,s,c){return xl(u)&&!s&&!c}function vl(u,s,c){return kc(u)&&!s&&!c}function Ps(u,s,c,h){return u||s||c||h}function Fc(u){return u===32}function qr(u,s){return ye?u:s}function Aa(u){return u===13}function Zr(u){return u===8}function Ii(u){return u===27}function ki(u){return u===46}function _o(u,s,c){return u===65&&qr(s,c)}function Sl(){const u=tr(),s=u.select(0,u.getChildrenSize());Cr(ws(s))}function Pi(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 ls(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 $i(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 Ma(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 Ma(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?Ma(h.getParentOrThrow(),s,h.getIndexWithinParent()+(s?0:1)):y}}return null}function Ol(u){const s=Co(u).event,c=s&&s.inputType;return c==="insertFromPaste"||c==="insertFromPasteAsQuotation"}function dt(u,s,c){return lf(u,s,c)}function yo(u){return!Ur(u)&&!u.isLastChild()&&!u.isInline()}function $s(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 No(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=Co(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=No(he)}}function Un(u){return xn()._updateTags.has(u)}function Ct(u){fr(),xn()._updateTags.add(u)}function as(u){const s=_n();if(!Tt(s)||!et(u))return s;const{anchor:c,focus:h}=s,y=c.getNode(),N=h.getNode();return Fi(y,u)&&c.set(u.__key,0,"element"),Fi(N,u)&&h.set(u.__key,0,"element"),s}function Fi(u,s){let c=u.getParent();for(;c!==null;){if(c.is(s))return!0;c=c.getParent()}return!1}function Ra(u){const s=u.ownerDocument;return s&&s.defaultView||null}function Co(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 Eo(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 Fs(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 To(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 Bs(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=To(u._config)),s.style.caretColor="transparent",he===null?me.appendChild(h):me.insertBefore(h,he);return}}h!==null&&Bs(h,u,s)}function ar(u){return F?(u||window).getSelection():null}function ba(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 xo(u,s){let c=u;for(;c!==tr()&&c!=null;){if(s(c))return c;c=c.getParent()}return null}function La(u){return Hs(u)&&u.tagName==="A"}function Hs(u){return u.nodeType===1}function Bi(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 vo(u,s){let c=u;for(;c!==null&&c.getParent()!==null&&!s(c);)c=c.getParentOrThrow();return s(c)?c:null}function Ia(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=As(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="",qt="",Er,Hn,cs,ka=!1,us=!1,Ws,Ks=null,zs,Rl,Hi,gn,On,Wn;function ds(u,s){const c=Hi.get(u);if(s!==null){const h=Oo(u);h.parentNode===s&&s.removeChild(h)}if(gn.has(u)||Hn._keyToDOMMap.delete(u),et(c)){const h=Ei(c,Hi);Wi(h,0,h.length-1,null)}c!==void 0&&ls(Wn,cs,Ws,c,"destroyed")}function Wi(u,s,c,h){let y=s;for(;y<=c;++y){const N=u[y];N!==void 0&&ds(N,h)}}function Ci(u,s){u.setProperty("text-align",s)}const fs="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")||fs;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);Pa(he,ae,h,y)}const $=h.__format;$!==0&&Br(y,$),h.isInline()||So(null,h,y),yo(h)&&(In+=$t,qt+=$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,qt+=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),ls(Wn,cs,Ws,h,"created"),y}function Pa(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);yo(s)&&(In+=$t),y.__lexicalTextContent=In,In=b+In}function $a(u,s){const c=s.get(u);return ai(c)||An(c)&&c.isInline()}function So(u,s,c){const h=u!==null&&(u.__size===0||$a(u.__last,Hi)),y=s.__size===0||$a(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!==Ks){const y=Gn==="",N=y?Ks: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(!us){const me=u.getWritable();me.__dir=N}}Ks=N,s.__lexicalDirTextContent=Gn,s.__lexicalDir=N}}function Ki(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===$)hs(b,c);else{const ae=Oo(b),he=hn($,null,null);c.replaceChild(he,ae),ds(b,null)}}else{const b=Ei(u,Hi),$=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;Wi(b,0,y-1,he?null:c),he&&(c.textContent="")}}else En(s,b,$,y,N,c)}yo(s)&&(In+=$t),c.__lexicalTextContent=In,In=h+In}function hs(u,s){const c=Hi.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=ka||Rl.has(u)||zs.has(u),N=$s(Hn,u);if(c===h&&!y){if(et(c)){const b=N.__lexicalTextContent;b!==void 0&&(In+=b,qt+=b);const $=N.__lexicalDirTextContent;$!==void 0&&(Gn+=$)}else{const b=c.getTextContent();_t(c)&&!c.isDirectionless()&&(Gn+=b),qt+=b,In+=b}return N}if(c!==h&&y&&ls(Wn,cs,Ws,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),ds(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&&(Ki(c,h,N),!Ur(h)&&!h.isInline()&&So(c,h,N)),yo(h)&&(In+=$t,qt+=$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,qt+=b}if(!us&&Ur(h)&&h.__cachedText!==qt){const b=h.getWritable();b.__cachedText=qt,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=As(Hn)}c[u]=s}function Tr(u){return u.firstChild}function wo(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=wo(hs($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=wo(Oo(Ue)),ds(Ue,N),xe++;else if(!Qe)hn($e,N,me),we++;else{const ht=$s(Hn,$e);ht===me?me=wo(hs($e,N)):(me!=null?N.insertBefore(ht,me):N.appendChild(ht),hs($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&&Wi(s,xe,b,N)}function zi(u,s,c,h,y,N){In="",qt="",Gn="",ka=h===ut,Ks=null,Hn=c,Er=c._config,cs=c._nodes,Ws=Hn._listeners.mutation,zs=y,Rl=N,Hi=u._nodeMap,gn=s._nodeMap,us=s._readOnly,On=new Map(c._keyToDOMMap);const b=new Map;return Wn=b,hs("root",null),Hn=void 0,cs=void 0,zs=void 0,Rl=void 0,Hi=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 Oo(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",Fa],["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 Ui=0,Pl=0,Us=0,Hr=null,Gs=0,Wr=!1,Do=!1,Ys=!1,js=!1,Ao=[0,"",0,"root",0];function Gi(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||Us<h+50)||$.isDirty()&&Ce<2||Ms(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||bs(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(!is(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=Co(s).event,xe=me?me.timeStamp:performance.now(),[we,Ce,Ve,Ue,$e]=Ao,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=st,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 Fa(u,s){zr(s,()=>{const c=_n(),h=ar(s._window),y=Fo();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 $=Wc(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,()=>{rs(c)||(Do=!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<Ui+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=Fo();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),Ui=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&&Rs(!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&&Gi(y,h,N,u.timeStamp,!0)?(u.preventDefault(),dt(s,p,N)):
|
|
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}}}Rs(!0,u,s)}function Q(u,s){De?js=!0:zr(s,()=>{A(s,u.data)})}function ge(u,s){if(Ui=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(os(c,y,b,N))dt(s,I,u);else if(Da(c,y,h,b,N))dt(s,G,u);else if(Pc(c,y,b,N))dt(s,k,u);else if(Oa(c,y,h,b,N))dt(s,P,u);else if($c(c,y,N))dt(s,H,u);else if(vl(c,y,N))dt(s,j,u);else if(Tl(c,h))Ys=!0,dt(s,re,u);else if(Fc(c))dt(s,te,u);else if(Is(c,y))u.preventDefault(),Ys=!0,dt(s,d,!0);else if(El(c,h))Ys=!1,dt(s,re,u);else if(xa(c,b,N,y))Zr(c)?dt(s,ce,u):(u.preventDefault(),dt(s,l,!0));else if(Ii(c))dt(s,V,u);else if(Rc(c,y,h,b,N))ki(c)?dt(s,z,u):(u.preventDefault(),dt(s,l,!1));else if(ks(c,b,y))u.preventDefault(),dt(s,T,!0);else if(Ca(c,b,y))u.preventDefault(),dt(s,T,!1);else if(Ea(c,N))u.preventDefault(),dt(s,S,!0);else if(Ta(c,N))u.preventDefault(),dt(s,S,!1);else if(Na(c,b,N,y))u.preventDefault(),dt(s,w,"bold");else if(Ls(c,b,N,y))u.preventDefault(),dt(s,w,"underline");else if(ss(c,b,N,y))u.preventDefault(),dt(s,w,"italic");else if(ya(c,b,y,N))dt(s,q,u);else if(bc(c,h,N,y))u.preventDefault(),dt(s,O,void 0);else if(va(c,h,N,y))u.preventDefault(),dt(s,m,void 0);else{const $=s._editorState._selection;Kr($)?Lc(c,h,N,y)?(u.preventDefault(),dt(s,Y,u)):Ic(c,h,N,y)?(u.preventDefault(),dt(s,W,u)):_o(c,N,y)&&(u.preventDefault(),dt(s,J,u)):!De&&_o(c,N,y)&&(u.preventDefault(),dt(s,J,u))}Ps(y,h,b,N)&&dt(s,M,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;Do&&(Do=!1,zr(y,()=>{const me=Fo(),xe=h.anchorNode;if(xe===null)return;const we=xe.nodeType;if(we!==ke&&we!==Fe)return;const Ce=Wc(me,h,y,u);Cr(Ce)}));const N=Li(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){Gs===0&&u.ownerDocument.addEventListener("selectionchange",Xe),Gs++,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,D,$);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 Ot(u){Gs!==0&&(Gs--,Gs===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=Li(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){Ao=[u,s,c,h,y]}function Ar(u,s,c){fr();const h=u.__key,y=u.getParent();if(y===null)return;const N=as(u);let b=!1;if(Tt(N)&&s){const $=N.anchor,ae=N.focus;$.key===h&&(Ya($,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0),ae.key===h&&(Ya(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),Ga(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 Mi(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,Mi(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()),Fs(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(),Fs(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();Ga(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(),Fs(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();Ga(me,xe,he)}return s}isParentRequired(){return!1}createParentElementNode(){return Vi()}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 Yi extends oi{static getType(){return"linebreak"}static clone(s){return new Yi(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:Mo,priority:0}}}}static importJSON(s){return
|
|
38
|
+
`,Kt=De?gt:mt,nn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Vt=new RegExp("^[^"+It+"]*["+nn+"]"),bt=new RegExp("^[^"+nn+"]*["+It+"]"),rn={bold:Oe,code:Ie,highlight:it,italic:ie,strikethrough:le,subscript:Me,superscript:je,underline:ve},wr={directionless:ot,unmergeable:St},_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:tn,token:Ut},lt={[At]:"normal",[tn]:"segmented",[Ut]:"token"},wt=100;let Gt=!1,Bt=0;function Pt(){return Gt}function kt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&Co(u).addEventListener("textInput",kt,!0)}function on(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&&Pr(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>wt;try{Kr(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 Zt=0;Zt<Rt.length;Zt++){const Wt=Rt[Zt],Dt=go(Wt),cn=Wt.parentNode;if(cn!=null&&Wt!==ae&&Dt===null&&(Wt.nodeName!=="BR"||!on(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 Zt=0;for(let Wt=0;Wt<ht;Wt++){const Dt=Qe[Wt];(Dt.nodeName==="BR"&&on(Dt,Ue,u)||ae===Dt)&&(Ue.appendChild(Dt),Zt++)}ht!==Zt&&(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"&&!on(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 Ai(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=Ai(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=Ai(s,h);break}else break}function Os(u){return fo(u.anchor),fo(u.focus),u}function fo(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 Yr(){return""+dl++}function ma(u,s){const c=u._nodes.get(s);if(c===void 0)throw Error(`registeredNode: Type ${s} not found`);return c}const ho=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=No(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 kr(u){let s=u;for(;s!=null;){if(ri(s))return s;s=s.firstChild}return null}function Bn(u,s,c){const h=rn[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(),rf();const c=xn(),h=xi(),y=Yr();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 Mi(u){rf();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&&Mi(s),c!==null&&Mi(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 Bo()?null:xn()._compositionKey}function Cn(u,s){const h=(s||xi())._nodeMap.get(u);return h===void 0?null:h}function go(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=go(c,s);if(h!==null)return h;c=No(c)}return null}function Ms(u){const s=u._decorators,c=Object.assign({},s);return u._pendingDecorators=c,c}function po(u){return u.read(()=>tr().getTextContent())}function Ri(u,s){Kr(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 bi(u){const s=xn(),c=_a(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 _a(u,s){let c=u;for(;c!=null;){const h=c[`__lexicalKey_${s._key}`];if(h!==void 0)return h;c=No(c)}return null}function Rs(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Li(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 mo(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 $=mo(y);const ae=ii(y);if($!==null&&_t(ae)){if($===mt&&c){const he=c.length;$=c,N=he,b=he}$!==null&&Pr(ae,$,N,b,u)}}}function Pr(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&&!ce&&!Re){const Ue=xn();setTimeout(()=>{Ue.update(()=>{N.isAttached()&&N.remove()})},20)}else N.remove();return}const he=N.getParent(),me=Fo(),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 ya(u,s,c,h){return u===9&&!s&&!c&&!h}function Na(u,s,c,h){return u===66&&!s&&Vr(c,h)}function os(u,s,c,h){return u===73&&!s&&Vr(c,h)}function Is(u,s,c,h){return u===85&&!s&&Vr(c,h)}function El(u,s){return Aa(u)&&!s}function Tl(u,s){return Aa(u)&&s}function ks(u,s){return ye&&s&&u===79}function Ps(u,s,c){return qr(u)&&(ye?s:c)}function Ca(u,s,c){return ki(u)&&(ye?s:c)}function Ea(u,s){return ye&&s&&qr(u)}function Ta(u,s){return ye&&s&&ki(u)}function xa(u,s,c,h){return ye?s||c?!1:qr(u)||u===72&&h:h||s||c?!1:qr(u)}function bc(u,s,c,h,y){return ye?c||h||y?!1:ki(u)||u===68&&s:s||h||y?!1:ki(u)}function Lc(u,s,c,h){return u===90&&!s&&Vr(c,h)}function va(u,s,c,h){return ye?u===90&&c&&s:u===89&&h||u===90&&h&&s}function Ic(u,s,c,h){return s?!1:u===67?ye?c:h:!1}function kc(u,s,c,h){return s?!1:u===88?ye?c:h:!1}function Sa(u){return u===37}function wa(u){return u===39}function xl(u){return u===38}function Pc(u){return u===40}function $c(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 ls(u,s,c,h){return wa(u)&&!s&&!h&&!c}function Da(u,s,c,h,y){return wa(u)&&!h&&!c&&(s||y)}function Fc(u,s,c){return xl(u)&&!s&&!c}function vl(u,s,c){return Pc(u)&&!s&&!c}function $s(u,s,c,h){return u||s||c||h}function Bc(u){return u===32}function Vr(u,s){return ye?u:s}function Aa(u){return u===13}function qr(u){return u===8}function Ii(u){return u===27}function ki(u){return u===46}function _o(u,s,c){return u===65&&Vr(s,c)}function Sl(){const u=tr(),s=u.select(0,u.getChildrenSize());Cr(Os(s))}function Pi(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 $i(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 Ma(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 Ma(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?Ma(h.getParentOrThrow(),s,h.getIndexWithinParent()+(s?0:1)):y}}return null}function Ol(u){const s=Co(u).event,c=s&&s.inputType;return c==="insertFromPaste"||c==="insertFromPasteAsQuotation"}function dt(u,s,c){return cf(u,s,c)}function yo(u){return!zr(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 No(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=Co(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=No(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 Fi(y,u)&&c.set(u.__key,0,"element"),Fi(N,u)&&h.set(u.__key,0,"element"),s}function Fi(u,s){let c=u.getParent();for(;c!==null;){if(c.is(s))return!0;c=c.getParent()}return!1}function Ra(u){const s=u.ownerDocument;return s&&s.defaultView||null}function Co(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function $r(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function Eo(u){let s=u.getParentOrThrow();for(;s!==null;){if(si(s))return s;s=s.getParentOrThrow()}return s}function si(u){return zr(u)||et(u)&&u.isShadowRoot()}function Dl(u){const s=u.constructor.clone(u);return hl(s,null),s}function Or(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(zr(c)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function To(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=To(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 ba(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 xo(u,s){let c=u;for(;c!==tr()&&c!=null;){if(s(c))return c;c=c.getParent()}return null}function La(u){return Ws(u)&&u.tagName==="A"}function Ws(u){return u.nodeType===1}function Bi(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 vo(u,s){let c=u;for(;c!==null&&c.getParent()!==null&&!s(c);)c=c.getParentOrThrow();return s(c)?c:null}function Ia(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="",qt="",Er,Hn,us,ka=!1,ds=!1,Ks,zs=null,Us,Rl,Hi,gn,On,Wn;function fs(u,s){const c=Hi.get(u);if(s!==null){const h=Oo(u);h.parentNode===s&&s.removeChild(h)}if(gn.has(u)||Hn._keyToDOMMap.delete(u),et(c)){const h=Ei(c,Hi);Wi(h,0,h.length-1,null)}c!==void 0&&as(Wn,us,Ks,c,"destroyed")}function Wi(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 Fr(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);Pa(he,ae,h,y)}const $=h.__format;$!==0&&Fr(y,$),h.isInline()||So(null,h,y),yo(h)&&(In+=$t,qt+=$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,qt+=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 Pa(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);yo(s)&&(In+=$t),y.__lexicalTextContent=In,In=b+In}function $a(u,s){const c=s.get(u);return ai(c)||An(c)&&c.isInline()}function So(u,s,c){const h=u!==null&&(u.__size===0||$a(u.__last,Hi)),y=s.__size===0||$a(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 Ki(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=Oo(b),he=hn($,null,null);c.replaceChild(he,ae),fs(b,null)}}else{const b=Ei(u,Hi),$=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;Wi(b,0,y-1,he?null:c),he&&(c.textContent="")}}else En(s,b,$,y,N,c)}yo(s)&&(In+=$t),c.__lexicalTextContent=In,In=h+In}function gs(u,s){const c=Hi.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=ka||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,qt+=b);const $=N.__lexicalDirTextContent;$!==void 0&&(Gn+=$)}else{const b=c.getTextContent();_t(c)&&!c.isDirectionless()&&(Gn+=b),qt+=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&&Fr(N,$),y&&(Ki(c,h,N),!zr(h)&&!h.isInline()&&So(c,h,N)),yo(h)&&(In+=$t,qt+=$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,qt+=b}if(!ds&&zr(h)&&h.__cachedText!==qt){const b=h.getWritable();b.__cachedText=qt,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 wo(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=wo(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=wo(Oo(Ue)),fs(Ue,N),xe++;else if(!Qe)hn($e,N,me),we++;else{const ht=Fs(Hn,$e);ht===me?me=wo(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&&Wi(s,xe,b,N)}function zi(u,s,c,h,y,N){In="",qt="",Gn="",ka=h===ut,zs=null,Hn=c,Er=c._config,us=c._nodes,Ks=Hn._listeners.mutation,Us=y,Rl=N,Hi=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,Hi=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 Oo(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",Fa],["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 Ui=0,Pl=0,Gs=0,Br=null,Ys=0,Hr=!1,Do=!1,js=!1,Vs=!1,Ao=[0,"",0,"root",0];function Gi(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!==kr(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;Hr&&(Hr=!1,$l(h,y)&&$l(N,b))||Kr(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=Co(s).event,xe=me?me.timeStamp:performance.now(),[we,Ce,Ve,Ue,$e]=Ao,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=st,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 Fa(u,s){Kr(s,()=>{const c=_n(),h=ar(s._window),y=Fo();if(h){if(Tt(c)){const N=c.anchor,b=N.getNode();if(N.type==="element"&&N.offset===0&&c.isCollapsed()&&!zr(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 $=Kc(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"&&Kr(s,()=>{is(c)||(Do=!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<Ui+nr}function g(u,s){const c=u.inputType,h=o(u);c==="deleteCompositionText"||De&&Ol(s)||c!=="insertCompositionText"&&Kr(s,()=>{const y=_n();if(c==="deleteContentBackward"){if(y===null){const me=Fo();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),Ui=0,setTimeout(()=>{Kr(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;Br!==null&&bs(!1,s,Br),(!y.dirty||Br!==null)&&y.isCollapsed()&&!zr(y.anchor.getNode())&&h!==null&&y.applyDOMRange(h),Br=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&&Gi(y,h,N,u.timeStamp,!0)?(u.preventDefault(),dt(s,p,N)):Br=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&&!ce?(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,E,u);break}case"deleteByDrag":case"deleteByCut":{dt(s,E,u);break}case"deleteContent":{dt(s,l,!1);break}case"deleteWordBackward":{dt(s,T,!0);break}case"deleteWordForward":{dt(s,T,!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(),Kr(s,()=>{const c=_n(),h=u.data,y=o(u);if(h!=null&&Tt(c)&&Gi(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)!==mo($.anchorNode))&&dt(s,p,h);const he=h.length;De&&he>1&&u.inputType==="insertCompositionText"&&!s.isComposing()&&(c.anchor.offset-=he),!ne&&!ce&&!Re&&s.isComposing()&&(Ui=0,vn(null))}else bs(!1,s,h!==null?h:void 0),Vs&&(D(s,h||void 0),Vs=!1);_l()}),Br=null}function x(u,s){Kr(s,()=>{const c=_n();if(Tt(c)&&!s.isComposing()){const h=c.anchor,y=c.anchor.getNode();vn(h.key),(u.timeStamp<Ui+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=kr(u.getElementByKey(c));y!==null&&y.nodeValue!==null&&_t(h)&&Pr(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:Kr(s,()=>{D(s,u.data)})}function ge(u,s){if(Ui=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,I,u);else if(Da(c,y,h,b,N))dt(s,G,u);else if($c(c,y,b,N))dt(s,P,u);else if(Oa(c,y,h,b,N))dt(s,k,u);else if(Fc(c,y,N))dt(s,W,u);else if(vl(c,y,N))dt(s,Y,u);else if(Tl(c,h))js=!0,dt(s,re,u);else if(Bc(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(xa(c,b,N,y))qr(c)?dt(s,ue,u):(u.preventDefault(),dt(s,l,!0));else if(Ii(c))dt(s,q,u);else if(bc(c,y,h,b,N))ki(c)?dt(s,H,u):(u.preventDefault(),dt(s,l,!1));else if(Ps(c,b,y))u.preventDefault(),dt(s,T,!0);else if(Ca(c,b,y))u.preventDefault(),dt(s,T,!1);else if(Ea(c,N))u.preventDefault(),dt(s,S,!0);else if(Ta(c,N))u.preventDefault(),dt(s,S,!1);else if(Na(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(ya(c,b,y,N))dt(s,V,u);else if(Lc(c,h,N,y))u.preventDefault(),dt(s,M,void 0);else if(va(c,h,N,y))u.preventDefault(),dt(s,m,void 0);else{const $=s._editorState._selection;Wr($)?Ic(c,h,N,y)?(u.preventDefault(),dt(s,j,u)):kc(c,h,N,y)?(u.preventDefault(),dt(s,K,u)):_o(c,N,y)&&(u.preventDefault(),dt(s,J,u)):!De&&_o(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;Do&&(Do=!1,Kr(y,()=>{const me=Fo(),xe=h.anchorNode;if(xe===null)return;const we=xe.nodeType;if(we!==ke&&we!==Fe)return;const Ce=Kc(me,h,y,u);Cr(Ce)}));const N=Li(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,K,$);case"copy":return dt(s,j,$);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 Ot(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=Li(u),h=s[s.length-1]._key;Ye.get(h)===u&&Ye.delete(h)}else Ye.delete(u._key)}function zt(){Hr=!0}function Yn(u,s,c,h,y){Ao=[u,s,c,h,y]}function Dr(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&&(Ya($,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0),ae.key===h&&(Ya(ae,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0)}else Wr(N)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(N)&&s&&!b){const $=u.getIndexWithinParent();jr(u),Ga(N,y,$,-1)}else jr(u);!c&&!si(y)&&!y.canBeEmpty()&&y.isEmpty()&&Dr(y,s),s&&zr(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 Mi(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,Mi(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){Dr(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,Ve=y.__parent;if(Dr(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(jr(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();Ga(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;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();Ga(me,xe,he)}return s}isParentRequired(){return!1}createParentElementNode(){return Vi()}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 Yi extends oi{static getType(){return"linebreak"}static clone(s){return new Yi(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:Mo,priority:0}}}}static importJSON(s){return ps()}exportJSON(){return{type:"linebreak",version:1}}}function Mo(u){return{node:ps()}}function ps(){return Or(new Yi)}function ai(u){return u instanceof Yi}function Ar(u,s){return s&Ie?"code":s&it?"mark":s&Me?"sub":s&je?"sup":null}function ji(u,s){return s&Oe?"strong":s&ie?"em":"span"}function Ro(u,s,c,h,y){const N=h.classList;let b=Pi(y,"base");b!==void 0&&N.add(...b),b=Pi(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 rn){const we=rn[me];if(b=Pi(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 Ba(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 Ha(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]=Ba($,b);he!==0&&h.deleteData(ae,he),h.insertData(ae,me)}else h.nodeValue=b}}function Wl(u,s,c,h,y,N){Ha(y,u,s);const $=N.theme.text;$!==void 0&&Ro(c,0,h,u,$)}function qs(u,s){const c=document.createElement(s);return c.appendChild(u),c}class Zr extends oi{static getType(){return"text"}static clone(s){return new Zr(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 lt[s.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===Ut}isComposing(){return this.__key===lr()}isSegmented(){return this.getLatest().__mode===tn}isDirectionless(){return(this.getLatest().__detail&ot)!==0}isUnmergeable(){return(this.getLatest().__detail&St)!==0}hasFormat(s){const c=rn[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=Ar(this,h),N=ji(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,$=Ar(this,N),ae=Ar(this,b),he=ji(this,N),me=ji(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");Ha(y,Ce,this);const Ue=h.theme.text;Ue!==void 0&&N!==b&&Ro(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:Lo,priority:0}),b:()=>({conversion:Kl,priority:0}),code:()=>({conversion:Jr,priority:0}),em:()=>({conversion:Jr,priority:0}),i:()=>({conversion:Jr,priority:0}),s:()=>({conversion:Jr,priority:0}),span:()=>({conversion:Wa,priority:0}),strong:()=>({conversion:Jr,priority:0}),sub:()=>({conversion:Jr,priority:0}),sup:()=>({conversion:Jr,priority:0}),u:()=>({conversion:Jr,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"?rn[s]:s,c}setDetail(s){const c=this.getWritable();return c.__detail=typeof s=="string"?wr[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^=ot,s}toggleUnmergeable(){const s=this.getWritable();return s.__detail^=St,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 Xd($,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 Zt=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 sn=hr.__key,kn=Zt+ms;if(Tt(Qe)){const ui=Qe.anchor,qi=Qe.focus;ui.key===y&&ui.type==="text"&&ui.offset>Zt&&ui.offset<=kn&&(ui.key=sn,ui.offset-=Zt,Qe.dirty=!0),qi.key===y&&qi.type==="text"&&qi.offset>Zt&&qi.offset<=kn&&(qi.key=sn,qi.offset-=Zt,Qe.dirty=!0)}N===y&&vn(sn),Zt=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)&&Ga(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&&(ef(we,c,h,s,b),ae.dirty=!0),Ce!==null&&Ce.key===y&&(ef(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 Wa(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 bo=new WeakMap;function Ka(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=bo.get(c))===void 0&&!Ka(c);)h.push(c),c=c.parentNode;const y=s===void 0?c:s;for(let N=0;N<h.length;N++)bo.set(h[N],y);return y}function Lo(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(
|
|
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=
|
|
43
|
+
`?N.push(ps()):ae===" "?N.push(Io()):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=za(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=za(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 za(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 Jr(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 Or(new Zr(u))}function _t(u){return u instanceof Zr}class xr extends Zr{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=St}static importDOM(){return null}static importJSON(s){const c=Io();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 Io(){return Or(new xr)}function ko(u){return u instanceof xr}class Hc{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,Bo()||(lr()===N&&vn(s),y!==null&&(y.setCachedNodes(null),y.dirty=!0))}}function Mr(u,s,c){return new Hc(u,s,c)}function Po(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)?Po(u,c):Po(u,s)}else Po(u,s)}function Xn(u,s,c,h){const y=u.getNode(),N=y.getChildAtIndex(u.offset),b=Dn(),$=zr(y)?Vi().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 Rr{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(!Wr(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 Bo()||(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 Rr}function br(u){const[s,,c]=tf(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 Rr{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),Bo()||(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
|
+
`),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=Jd(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(Mr(s.key,s.offset,s.type),Mr(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=rn[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(gs()):b===" "?h.push(Io()):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(""),Vd(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(),Zt=Ce.getStyle();if(xe===we&&(ht!==N||Zt!==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(ko(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=Zt))}else{const ht=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),Zt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),Dt=Qe;if(!Zt.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 sn=Dn(Qe.getTextContent());Qe.replace(sn),Qe=sn}!Ur(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,we,"")),ht.add(Qe.__key)}else{const sn=Qe.getParentOrThrow();!sn.canBeEmpty()&&sn.getChildrenSize()===1?sn.remove():Qe.remove()}else ht.add(Qe.__key);const cn=Wt.getChildren(),ir=new Set($),ps=Zt.is(Wt),hr=Zt.isInline()&&Ce.getNextSibling()===null?Zt:Ce;for(let sn=cn.length-1;sn>=0;sn--){const kn=cn[sn];if(kn.is(Ce)||et(kn)&&kn.isParentOf(Ce))break;kn.isAttached()&&(!ir.has(kn)||kn.is(Dt)?ps||hr.insertAfter(kn,!1):kn.remove())}if(!ps){let sn=Wt,kn=null;for(;sn!==null;){const ui=sn.getChildren(),qi=ui.length;(qi===0||ui[qi-1].is(kn))&&(ht.delete(sn.__key),kn=sn),sn=sn.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 sn=Dn(s);sn.select(),Ce.replace(sn)}for(let sn=1;sn<ae;sn++){const kn=$[sn],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 Zt=ht.getFormatFlags(s,Rt);ht.setFormat(Zt)}}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=vo(this.anchor.getNode(),Bi),h=s[s.length-1];if("__language"in c&&et(c)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Kc(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=Kc(this);c.splice($e,0,s),h.selectEnd();return}const N=L_(s),b=N.getLastDescendant(),$=N.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,he=$e=>et($e)&&Bi($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=vo(b,Bi);xe&&et(Ve)&&(ae(xe)||Bi(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=Vi();return tr().splice(this.anchor.offset,0,[b]),b.select(),b}const s=Kc(this),c=vo(this.anchor.getNode(),Bi);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=gs();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=Hc();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()&&Bs(me,ae,xe),Ua(he,s,c?"backward":"forward",h),he.rangeCount>0){const we=he.getRangeAt(0),Ce=this.anchor.getNode(),Ve=Ur(Ce)?Ce:Eo(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];Fi(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)&&$o(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 $=Hc();$.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){Gd($,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){Gd(N,s,ae);return}}T_(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 $o(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 Ua(u,s,c,h){u.modify(s,c,h)}function T_(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);Ms(we)||(s?h.offset=xe:c.offset=xe)}}}function Gd(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 x_(u,s,c){const h=u.getParent();return c===null||h===null||!h.canBeEmpty()||h!==c.getNode()}function Yd(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=bi(he),_t(N))y=yl(N,b);else{let xe=bi(u);if(xe===null)return null;if(et(xe)){let we=xe.getChildAtIndex(y);if(et(we)&&x_(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)&&bi(u)===xe?y=we:y=we+1,xe=xe.getParentOrThrow()}if(et(xe))return Rr(xe.__key,y,"element")}}else N=bi(u);return _t(N)?Rr(N.__key,y,"text"):null}function jd(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 Vd(u,s,c){if(u.type==="text"&&s.type==="text"){const h=u.isBefore(s),y=u.is(s);jd(u,h,y),jd(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 qd(u,s,c,h,y,N){if(u===null||c===null||!is(y,u,c))return null;const b=Yd(u,s,Tt(N)?N.anchor:null,y);if(b===null)return null;const $=Yd(c,h,Tt(N)?N.focus:null,y);if($===null)return null;if(b.type==="element"&&$.type==="element"){const ae=bi(u),he=bi(c);if(An(ae)&&An(he))return null}return Vd(b,$,N),[b,$]}function v_(u){return et(u)&&!u.isInline()}function Zd(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 S_(){const u=Rr("root",0,"element"),s=Rr("root",0,"element");return new rr(u,s,0,"")}function Hc(){return new Ti(new Set)}function w_(u){const c=u.getEditorState()._selection,h=ar(u._window);return Tt(c)||c==null?Wc(c,h,u,null):c.clone()}function Wc(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)&&!is(c,he,me))return u.clone()}else return u.clone();const Ce=qd(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 Fo(){return xn()._editorState._selection}function Ga(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 O_(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 Ya(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 Xd(u,s,c,h,y){u.type==="text"?(u.key=c,s||(u.offset+=y)):u.offset>h.getIndexWithinParent()&&(u.offset-=1)}function D_(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&&Os(xe))return;if(!Tt(s)){u!==null&&is(c,$,ae)&&h.removeAllRanges();return}const we=s.anchor,Ce=s.focus,Ve=we.key,Ue=Ce.key,$e=$s(c,Ve),Rt=$s(c,Ue),Qe=we.offset,ht=Ce.offset,Zt=s.format,Wt=s.style,Dt=s.isCollapsed();let cn=$e,ir=Rt,ps=!1;if(we.type==="text"){cn=Pr($e);const hr=we.getNode();ps=hr.getFormat()!==Zt||hr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(ps=!0);if(Ce.type==="text"&&(ir=Pr(Rt)),!(cn===null||ir===null)&&(Dt&&(u===null||ps||Tt(u)&&(u.format!==Zt||u.style!==Wt))&&Yn(Zt,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 sn;if(hr instanceof Text){const kn=document.createRange();kn.selectNode(hr),sn=kn.getBoundingClientRect()}else sn=hr.getBoundingClientRect();yi(c,sn,N)}}zt()}}function A_(u){let s=_n()||Fo();s===null&&(s=tr().selectEnd()),s.insertNodes(u)}function M_(){const u=_n();return u===null?"":u.getTextContent()}function R_(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(!Vc(me))throw Error("Expected GridNode children to be GridRowNode");const xe=me.getChildren();let we=0;for(const Ce of xe){if(!Ko(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 jc)s=u;else if(u instanceof oi){const y=xo(u,Ko);if(!Ko(y))throw Error("Expected to find a parent GridCellNode");s=y}else{const y=xo(u.getNode(),Ko);if(!Ko(y))throw Error("Expected to find a parent GridCellNode");s=y}const c=s.getParent();if(!Vc(c))throw Error("Expected GridCellNode to have a parent GridRowNode");const h=c.getParent();if(!gf(h))throw Error("Expected GridRowNode to have a parent GridNode");return[s,c,h]}function Kc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let c=s.getNode(),h=s.offset;for(;!Bi(c);)[c,h]=b_(c,h);return h}function b_(u,s){const c=u.getParent();if(!c){const y=Vi();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 L_(u){const s=Vi();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,zc=!1,ja=0;const ef={characterData:!0,childList:!0,subtree:!0};function Bo(){return Ir||Qn!==null&&Qn._readOnly}function fr(){if(Ir)throw Error("Cannot use method in read-only mode.")}function tf(){if(ja>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 I_(){return er}function nf(u,s,c){const h=s.__type,y=ma(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 rf(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function k_(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 P_(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&&rf(we,N)&&nf(s,we,b),c.add(xe)}if($=s._dirtyLeaves,ae=$.size,ae>0){ja++;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&&rf(Ve,N)&&nf(s,Ve,b),h.set(we,Ce)}$=s._dirtyLeaves,ae=$.size,he=s._dirtyElements,me=he.size,ja++}s._dirtyLeaves=c,s._dirtyElements=h}function $_(u){return Uc(u,xn()._nodes)}function Uc(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=Uc(ae,s);N.append(he)}return N}function F_(u,s,c){const h=Yc(),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;Uc(we,xe),c&&c(),h._readOnly=!0,of(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 sf(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 of(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 Zs(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=zi(N,c,u,Dt,cn,ir)}catch(Dt){if(Dt instanceof Error&&u._onError(Dt),!zc)ff(u,null,h,c),sr(u),u._dirtyType=ut,zc=!0,Zs(u,N),zc=!1;else throw Dt;return}finally{Ce.observe(h,ef),u._updating=we,Qn=he,Ir=me,er=xe}}c._readOnly||(c._readOnly=!0,of(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),Ia(u,c);const Zt=y?null:ar(u._window);if(u._editable&&Zt!==null&&(ae||$===null||$.dirty)){er=u,Qn=c;try{if(Ce!==null&&Ce.disconnect(),ae||$===null||$.dirty){const Dt=u._blockCursorElement;Dt!==null&&Bs(Dt,u,h),D_(b,$,u,Zt,Qe,h)}Ni(u,h,$),Ce!==null&&Ce.observe(h,ef)}finally{er=xe,Qn=he}}Ve!==null&&H_(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)),B_(u,s||N,c),Gl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:c,normalizedNodes:Rt,prevEditorState:s||N,tags:Qe}),K_(u,ht),W_(u)}function B_(u,s,c){const h=po(s),y=po(c);h!==y&&Gl("textcontent",u,!0,y)}function H_(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 lf(u,s,c){if(u._updating===!1||er!==u){let y=!1;return u.update(()=>{y=lf(u,s,c)}),y}const h=Li(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 W_(u){const s=u._updates;if(s.length!==0){const c=s.shift();if(c){const[h,y]=c;cf(u,h,y)}}}function K_(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 af(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 cf(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=G_(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=w_(u));const $e=u._compositionKey;s(),b=af(u,b),O_(he,u),u._dirtyType!==qe&&(b?k_(he,u):P_(he,u),af(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,Zt=Qe.anchor.key,Wt=Qe.focus.key;if(ht.get(Zt)===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(),Zs(u);return}finally{Qn=xe,Ir=we,er=Ce,u._updating=Ve,ja=0}u._dirtyType!==qe||U_(he,u)?he._flushSync?(he._flushSync=!1,Zs(u)):me&&ho(()=>{Zs(u)}):(he._flushSync=!1,me&&(h.clear(),u._deferred=[],u._pendingEditorState=null))}function zr(u,s,c){u._updating?u._updates.push([s,c]):cf(u,s,c)}class Gc 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 Gc}class Js 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 Zd($,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;uf(Rt,Ue,$e)&&Ya(Rt,Rt.getNode(),this,xe,me),uf(Qe,Ue,$e)&&Ya(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 Js}function uf(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 Ho extends Js{static getType(){return"root"}static clone(){return new Ho}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Bo()||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 z_(){return new Ho}function Ur(u){return u instanceof Ho}function U_(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 G_(u){return new Va(new Map(u._nodeMap))}function Yc(){return new Va(new Map([["root",z_()]]))}function df(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],$=df(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 sf(this,s)}clone(s){const c=new Va(this._nodeMap,s===void 0?this._selection:s);return c._readOnly=!0,c}toJSON(){return sf(this,()=>({root:df(tr())}))}}class Wo extends Js{static getType(){return"paragraph"}static clone(s){return new Wo(s.__key)}createDOM(s){const c=document.createElement("p"),h=Pi(s.theme,"paragraph");return h!==void 0&&c.classList.add(...h),c}updateDOM(s,c,h){return!1}static importDOM(){return{p:s=>({conversion:Y_,priority:0})}}exportDOM(s){const{element:c}=super.exportDOM(s);if(c&&Hs(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=Vi();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=Vi(),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 Y_(u){const s=Vi();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 Vi(){return Dr(new Wo)}function j_(u){return u instanceof Wo}const V_=0,q_=1,Z_=2,J_=3,X_=4;function ff(u,s,c,h){const y=u._keyToDOMMap;y.clear(),u._editorState=Yc(),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 ey(u){const s=u||{},c=I_(),h=s.theme||{},y=u===void 0?c:s.parentEditor||null,N=s.disableEvents||!1,b=Yc(),$=s.namespace||(y!==null?y._config.namespace:Nl()),ae=s.editorState,he=[Ho,Jr,Yi,xr,Wo,...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 Gc&&(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(),Zt=$e.transform(),Wt=new Set;Zt!==null&&Wt.add(Zt),Ce.set(ht,{exportDOM:xe&&xe.export?xe.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new ty(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 ty{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 Ri(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=Pi(this._config.theme,"root"),y=this._pendingEditorState||this._editorState;if(this._rootElement=s,ff(this,c,s,y),c!==null&&(this._config.disableEvents||Ot(c),h!=null&&c.classList.remove(...h)),s!==null){const N=Ra(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"),Zs(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),Zs(this)),this._pendingEditorState=s,this._dirtyType=ut,this._dirtyElements.set("root",!1),this._compositionKey=null,N!=null&&y.add(N),Zs(this)}parseEditorState(s,c){const h=typeof s=="string"?JSON.parse(s):s;return F_(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 jc extends Js{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 Ko(u){return u instanceof jc}class hf extends Js{}function gf(u){return u instanceof hf}class pf extends Js{}function Vc(u){return u instanceof pf}return He.$INTERNAL_isPointSelection=ur,He.$addUpdateTag=Ct,He.$applyNodeReplacement=Dr,He.$copyNode=Dl,He.$createLineBreakNode=gs,He.$createNodeSelection=Hc,He.$createParagraphNode=Vi,He.$createPoint=Rr,He.$createRangeSelection=S_,He.$createTabNode=Io,He.$createTextNode=Dn,He.$getAdjacentNode=wl,He.$getNearestNodeFromDOMNode=ii,He.$getNearestRootOrShadowRoot=Eo,He.$getNodeByKey=Cn,He.$getPreviousSelection=Fo,He.$getRoot=tr,He.$getSelection=_n,He.$getTextContent=M_,He.$hasAncestor=Fi,He.$hasUpdateTag=Un,He.$insertNodes=A_,He.$isBlockElementNode=v_,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Fr,He.$isLeafNode=Ds,He.$isLineBreakNode=ai,He.$isNodeSelection=Kr,He.$isParagraphNode=j_,He.$isRangeSelection=Tt,He.$isRootNode=Ur,He.$isRootOrShadowRoot=si,He.$isTabNode=ko,He.$isTextNode=_t,He.$nodesOfType=$i,He.$normalizeSelection__EXPERIMENTAL=ws,He.$parseSerializedNode=$_,He.$selectAll=Sl,He.$setCompositionKey=vn,He.$setSelection=Cr,He.$splitNode=ba,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=X_,He.COMMAND_PRIORITY_EDITOR=V_,He.COMMAND_PRIORITY_HIGH=J_,He.COMMAND_PRIORITY_LOW=q_,He.COMMAND_PRIORITY_NORMAL=Z_,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=T,He.DEPRECATED_$computeGridMap=R_,He.DEPRECATED_$getGridCellNodeRect=Lr,He.DEPRECATED_$getNodeTriplet=Qd,He.DEPRECATED_$isGridCellNode=Ko,He.DEPRECATED_$isGridNode=gf,He.DEPRECATED_$isGridRowNode=Vc,He.DEPRECATED_GridCellNode=jc,He.DEPRECATED_GridNode=hf,He.DEPRECATED_GridRowNode=pf,He.DRAGEND_COMMAND=oe,He.DRAGOVER_COMMAND=Z,He.DRAGSTART_COMMAND=D,He.DROP_COMMAND=de,He.DecoratorNode=Gc,He.ElementNode=Js,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=k,He.KEY_ARROW_RIGHT_COMMAND=I,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=M,He.KEY_SPACE_COMMAND=te,He.KEY_TAB_COMMAND=q,He.LineBreakNode=Yi,He.MOVE_TO_END=G,He.MOVE_TO_START=P,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=_,He.ParagraphNode=Wo,He.REDO_COMMAND=m,He.REMOVE_TEXT_COMMAND=E,He.RootNode=Ho,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=O,He.createCommand=e,He.createEditor=ey,He.getNearestEditorFromDOMNode=fl,He.isCurrentlyReadOnlyMode=Bo,He.isHTMLAnchorElement=La,He.isHTMLElement=Hs,He.isSelectionCapturedInDecoratorInput=Os,He.isSelectionWithinEditor=is,He}var We={},Pf;function UN(){if(Pf)return We;Pf=1;let e={},t={},n={},r={},l={},d={},f={},p={},_={},E={},T={},S={},w={},O={},m={},v={},I={},G={},k={},P={},H={},j={},re={},te={},ce={},V={},z={},q={},Te={},Se={},Ee={},de={},K={},D={},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),M=W&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F=W&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!M,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=qt();return i!==null?i.clone():null})}function Ut(o,i,a){Fe=!0;let g=100<performance.now()-qe;try{Tr(o,()=>{let C=qt()||At(o);var x=new Map,A=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,Ot=Kt(pt,Q);if(!(Ot===null&&pt!==A||En(Ot))){if(Pe==="characterData"){if(Ke=g&&Ct(Ot))e:{Ke=C,Pe=pt;var Ft=Ot;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&&wt(Ot,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===A&&(Ot=Q._nodeMap.get("root")),x.set(pt,Ot))}}}}if(0<x.size)for(let[oi,li]of x)if(Je(li))for(x=li.getChildrenKeys(),A=oi.firstChild,Q=0;Q<x.length;Q++)ge=o.getElementByKey(x[Q]),ge!==null&&(A==null?(oi.appendChild(ge),A=ge):A!==ge&&oi.replaceChild(ge,A),A=A.nextSibling);else Ct(li)&&li.markDirty();if(x=a.takeRecords(),0<x.length){for(A=0;A<x.length;A++)for(ge=x[A],Q=ge.addedNodes,ge=ge.target,Xe=0;Xe<Q.length;Xe++)Ot=Q[Xe],pt=Ot.parentNode,pt==null||Ot.nodeName!=="BR"||ut(Ot,ge,o)||pt.removeChild(Ot);a.takeRecords()}C!==null&&(Ae&&(C.dirty=!0,rn(C)),U&&on(o)&&C.insertRawText(Ye))})}finally{Fe=!1}}function tn(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,it=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function st(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 ot(o,i,a){let g=o.getRootElement();try{return g!==null&&g.contains(i)&&g.contains(a)&&i!==null&&!st(i)&&St(i)===o}catch{return!1}}function St(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<Wi&&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<Wi&&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 A=x.get(a);if(A===void 0)break;g.set(a,!1),a=A.__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 fs()?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 nn(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 rn(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 lt(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 A=a.length;i=a,x=C=A}i!==null&&wt(g,i,C,x,o)}}}function wt(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 A=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===A&&!x.canInsertTextAfter()&&!Ae)?x.markDirty():(o=qt(),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 on(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 Ai(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 ws(o,i){o=o.getParent(),!nr(o)||Je(i)||En(i)||Y(99)}function fo(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 ma(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function ho(o){return o.nodeType===1}function rs(o){if(En(o)&&!o.isInline())return!0;if(!Je(o)||or(o))return!1;var i=o.getFirstChild();return i=i===null||Ii(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function Os(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function is(o,i,a,g,C,x){for(o=o.getFirstChild();o!==null;){let A=o.__key;o.__parent===i&&(Je(o)&&is(o,A,a,g,C,x),a.has(A)||x.delete(A),C.push(A)),o=o.getNextSibling()}}function fl(o,i,a,g){o=o._nodeMap,i=i._nodeMap;let C=[];for(let[x]of g){let A=i.get(x);A===void 0||A.isAttached()||(Je(A)&&is(A,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,Ds,hl=!1,gl=!1,Vr,Mi=null,pl,vn,lr,Cn,go,ii;function As(o,i){let a=lr.get(o);if(i!==null){let g=Rs(o);g.parentNode===i&&i.removeChild(g)}Cn.has(o)||Bn._keyToDOMMap.delete(o),Je(a)&&(o=Ms(a,lr),po(o,0,o.length-1,null)),a!==void 0&&Pt(ii,Ds,Vr,a,"destroyed")}function po(o,i,a,g){for(;i<=a;++i){let C=o[i];C!==void 0&&As(C,g)}}function Ri(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?Ri(o,""):i===1?Ri(o,"left"):i===2?Ri(o,"center"):i===3?Ri(o,"right"):i===4?Ri(o,"justify"):i===5?Ri(o,"start"):i===6&&Ri(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=Ms(g,Cn);var A=zn;zn="",_l(o,g,0,x,C,null),_a(g,C),zn=A}o=g.__format,o!==0&&ml(C,o),g.isInline()||yl(null,g,C),an(g)&&(Ln+=`
|
|
46
|
+
`?h.push(ps()):b===" "?h.push(Io()):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(""),Zd(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(),Zt=Ce.getStyle();if(xe===we&&(ht!==N||Zt!==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(ko(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=Zt))}else{const ht=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),Zt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),Dt=Qe;if(!Zt.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 sn=Dn(Qe.getTextContent());Qe.replace(sn),Qe=sn}!zr(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,we,"")),ht.add(Qe.__key)}else{const sn=Qe.getParentOrThrow();!sn.canBeEmpty()&&sn.getChildrenSize()===1?sn.remove():Qe.remove()}else ht.add(Qe.__key);const cn=Wt.getChildren(),ir=new Set($),ms=Zt.is(Wt),hr=Zt.isInline()&&Ce.getNextSibling()===null?Zt:Ce;for(let sn=cn.length-1;sn>=0;sn--){const kn=cn[sn];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 sn=Wt,kn=null;for(;sn!==null;){const ui=sn.getChildren(),qi=ui.length;(qi===0||ui[qi-1].is(kn))&&(ht.delete(sn.__key),kn=sn),sn=sn.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 sn=Dn(s);sn.select(),Ce.replace(sn)}for(let sn=1;sn<ae;sn++){const kn=$[sn],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 Zt=ht.getFormatFlags(s,Rt);ht.setFormat(Zt)}}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=vo(this.anchor.getNode(),Bi),h=s[s.length-1];if("__language"in c&&et(c)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=zc(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=zc(this);c.splice($e,0,s),h.selectEnd();return}const N=P_(s),b=N.getLastDescendant(),$=N.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,he=$e=>et($e)&&Bi($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=vo(b,Bi);xe&&et(Ve)&&(ae(xe)||Bi(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=Vi();return tr().splice(this.anchor.offset,0,[b]),b.select(),b}const s=zc(this),c=vo(this.anchor.getNode(),Bi);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=Wc();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),Ua(he,s,c?"backward":"forward",h),he.rangeCount>0){const we=he.getRangeAt(0),Ce=this.anchor.getNode(),Ve=zr(Ce)?Ce:Eo(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];Fi(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)&&$o(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 $=Wc();$.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){jd($,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){jd(N,s,ae);return}}S_(this,s)}}if(this.removeText(),s&&!c&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const h=this.anchor.getNode();h.isEmpty()&&zr(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 Wr(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 $o(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 Ua(u,s,c,h){u.modify(s,c,h)}function S_(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 jd(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 w_(u,s,c){const h=u.getParent();return c===null||h===null||!h.canBeEmpty()||h!==c.getNode()}function Vd(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=bi(he),_t(N))y=yl(N,b);else{let xe=bi(u);if(xe===null)return null;if(et(xe)){let we=xe.getChildAtIndex(y);if(et(we)&&w_(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)&&bi(u)===xe?y=we:y=we+1,xe=xe.getParentOrThrow()}if(et(xe))return Mr(xe.__key,y,"element")}}else N=bi(u);return _t(N)?Mr(N.__key,y,"text"):null}function qd(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 Zd(u,s,c){if(u.type==="text"&&s.type==="text"){const h=u.isBefore(s),y=u.is(s);qd(u,h,y),qd(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 Jd(u,s,c,h,y,N){if(u===null||c===null||!ss(y,u,c))return null;const b=Vd(u,s,Tt(N)?N.anchor:null,y);if(b===null)return null;const $=Vd(c,h,Tt(N)?N.focus:null,y);if($===null)return null;if(b.type==="element"&&$.type==="element"){const ae=bi(u),he=bi(c);if(An(ae)&&An(he))return null}return Zd(b,$,N),[b,$]}function O_(u){return et(u)&&!u.isInline()}function Xd(u,s,c,h,y,N){const b=xi(),$=new rr(Mr(u,s,y),Mr(c,h,N),0,"");return $.dirty=!0,b._selection=$,$}function D_(){const u=Mr("root",0,"element"),s=Mr("root",0,"element");return new rr(u,s,0,"")}function Wc(){return new Ti(new Set)}function A_(u){const c=u.getEditorState()._selection,h=ar(u._window);return Tt(c)||c==null?Kc(c,h,u,null):c.clone()}function Kc(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=Jd(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 Fo(){return xn()._editorState._selection}function Ga(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"),Qd(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")}}Qd(u)}function Qd(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 M_(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 Ya(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 ef(u,s,c,h,y){u.type==="text"?(u.key=c,s||(u.offset+=y)):u.offset>h.getIndexWithinParent()&&(u.offset-=1)}function R_(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,Zt=s.format,Wt=s.style,Dt=s.isCollapsed();let cn=$e,ir=Rt,ms=!1;if(we.type==="text"){cn=kr($e);const hr=we.getNode();ms=hr.getFormat()!==Zt||hr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(ms=!0);if(Ce.type==="text"&&(ir=kr(Rt)),!(cn===null||ir===null)&&(Dt&&(u===null||ms||Tt(u)&&(u.format!==Zt||u.style!==Wt))&&Yn(Zt,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 sn;if(hr instanceof Text){const kn=document.createRange();kn.selectNode(hr),sn=kn.getBoundingClientRect()}else sn=hr.getBoundingClientRect();yi(c,sn,N)}}zt()}}function b_(u){let s=_n()||Fo();s===null&&(s=tr().selectEnd()),s.insertNodes(u)}function L_(){const u=_n();return u===null?"":u.getTextContent()}function I_(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(!qc(me))throw Error("Expected GridNode children to be GridRowNode");const xe=me.getChildren();let we=0;for(const Ce of xe){if(!Ko(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 tf(u){let s;if(u instanceof Vc)s=u;else if(u instanceof oi){const y=xo(u,Ko);if(!Ko(y))throw Error("Expected to find a parent GridCellNode");s=y}else{const y=xo(u.getNode(),Ko);if(!Ko(y))throw Error("Expected to find a parent GridCellNode");s=y}const c=s.getParent();if(!qc(c))throw Error("Expected GridCellNode to have a parent GridRowNode");const h=c.getParent();if(!mf(h))throw Error("Expected GridRowNode to have a parent GridNode");return[s,c,h]}function zc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let c=s.getNode(),h=s.offset;for(;!Bi(c);)[c,h]=k_(c,h);return h}function k_(u,s){const c=u.getParent();if(!c){const y=Vi();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(Mr(u.__key,s,"element"),Mr(u.__key,s,"element"),0,""),N=u.insertNewAfter(y);N&&N.append(h,...h.getNextSiblings())}return[c,u.getIndexWithinParent()+1]}function P_(u){const s=Vi();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,Lr=!1,Uc=!1,ja=0;const nf={characterData:!0,childList:!0,subtree:!0};function Bo(){return Lr||Qn!==null&&Qn._readOnly}function fr(){if(Lr)throw Error("Cannot use method in read-only mode.")}function rf(){if(ja>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 $_(){return er}function sf(u,s,c){const h=s.__type,y=ma(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 of(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function F_(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&&of(we,N)&&sf(s,we,b),c.add(xe)}if($=s._dirtyLeaves,ae=$.size,ae>0){ja++;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&&of(Ve,N)&&sf(s,Ve,b),h.set(we,Ce)}$=s._dirtyLeaves,ae=$.size,he=s._dirtyElements,me=he.size,ja++}s._dirtyLeaves=c,s._dirtyElements=h}function H_(u){return Gc(u,xn()._nodes)}function Gc(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=Gc(ae,s);N.append(he)}return N}function W_(u,s,c){const h=jc(),y=Qn,N=Lr,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,Lr=!1,er=s;try{const xe=s._nodes,we=u.root;Gc(we,xe),c&&c(),h._readOnly=!0,af(h)}catch(xe){xe instanceof Error&&s._onError(xe)}finally{s._dirtyElements=$,s._dirtyLeaves=ae,s._cloneNotNeeded=he,s._dirtyType=me,Qn=y,Lr=N,er=b}return h}function lf(u,s){const c=Qn,h=Lr,y=er;Qn=u,Lr=!0,er=null;try{return s()}finally{Qn=c,Lr=h,er=y}}function af(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=Lr,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,Lr=!1,u._updating=!0;try{const Dt=u._dirtyType,cn=u._dirtyElements,ir=u._dirtyLeaves;Ce.disconnect(),Ve=zi(N,c,u,Dt,cn,ir)}catch(Dt){if(Dt instanceof Error&&u._onError(Dt),!Uc)gf(u,null,h,c),sr(u),u._dirtyType=ut,Uc=!0,Js(u,N),Uc=!1;else throw Dt;return}finally{Ce.observe(h,nf),u._updating=we,Qn=he,Lr=me,er=xe}}c._readOnly||(c._readOnly=!0,af(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),Ia(u,c);const Zt=y?null:ar(u._window);if(u._editable&&Zt!==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),R_(b,$,u,Zt,Qe,h)}Ni(u,h,$),Ce!==null&&Ce.observe(h,nf)}finally{er=xe,Qn=he}}Ve!==null&&z_(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}),G_(u,ht),U_(u)}function K_(u,s,c){const h=po(s),y=po(c);h!==y&&Gl("textcontent",u,!0,y)}function z_(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 cf(u,s,c){if(u._updating===!1||er!==u){let y=!1;return u.update(()=>{y=cf(u,s,c)}),y}const h=Li(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_(u){const s=u._updates;if(s.length!==0){const c=s.shift();if(c){const[h,y]=c;df(u,h,y)}}}function G_(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 uf(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 df(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=V_(he||ae),me=!0),he._flushSync=$;const xe=Qn,we=Lr,Ce=er,Ve=u._updating;Qn=he,Lr=!1,u._updating=!0,er=u;try{me&&(u._headless?ae._selection!=null&&(he._selection=ae._selection.clone()):he._selection=A_(u));const $e=u._compositionKey;s(),b=uf(u,b),M_(he,u),u._dirtyType!==qe&&(b?F_(he,u):B_(he,u),uf(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,Zt=Qe.anchor.key,Wt=Qe.focus.key;if(ht.get(Zt)===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 Wr(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,Lr=we,er=Ce,u._updating=Ve,ja=0}u._dirtyType!==qe||j_(he,u)?he._flushSync?(he._flushSync=!1,Js(u)):me&&ho(()=>{Js(u)}):(he._flushSync=!1,me&&(h.clear(),u._deferred=[],u._pendingEditorState=null))}function Kr(u,s,c){u._updating?u._updates.push([s,c]):df(u,s,c)}class Yc 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 Yc}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 Xd($,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();jr(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--,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 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;ff(Rt,Ue,$e)&&Ya(Rt,Rt.getNode(),this,xe,me),ff(Qe,Ue,$e)&&Ya(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 ff(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 Ho extends Xs{static getType(){return"root"}static clone(){return new Ho}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Bo()||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 Y_(){return new Ho}function zr(u){return u instanceof Ho}function j_(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 V_(u){return new Va(new Map(u._nodeMap))}function jc(){return new Va(new Map([["root",Y_()]]))}function hf(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],$=hf(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 lf(this,s)}clone(s){const c=new Va(this._nodeMap,s===void 0?this._selection:s);return c._readOnly=!0,c}toJSON(){return lf(this,()=>({root:hf(tr())}))}}class Wo extends Xs{static getType(){return"paragraph"}static clone(s){return new Wo(s.__key)}createDOM(s){const c=document.createElement("p"),h=Pi(s.theme,"paragraph");return h!==void 0&&c.classList.add(...h),c}updateDOM(s,c,h){return!1}static importDOM(){return{p:s=>({conversion:q_,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=Vi();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=Vi(),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 q_(u){const s=Vi();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 Vi(){return Or(new Wo)}function Z_(u){return u instanceof Wo}const J_=0,X_=1,Q_=2,ey=3,ty=4;function gf(u,s,c,h){const y=u._keyToDOMMap;y.clear(),u._editorState=jc(),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 ny(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 ry(u){const s=u||{},c=$_(),h=s.theme||{},y=u===void 0?c:s.parentEditor||null,N=s.disableEvents||!1,b=jc(),$=s.namespace||(y!==null?y._config.namespace:Nl()),ae=s.editorState,he=[Ho,Zr,Yi,xr,Wo,...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 Yc&&(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(),Zt=$e.transform(),Wt=new Set;Zt!==null&&Wt.add(Zt),Ce.set(ht,{exportDOM:xe&&xe.export?xe.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new iy(b,y,Ce,{disableEvents:N,namespace:$,theme:h},me||console.error,ny(Ce,xe?xe.import:void 0),we);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ut),Ve}class iy{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 Ri(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=Pi(this._config.theme,"root"),y=this._pendingEditorState||this._editorState;if(this._rootElement=s,gf(this,c,s,y),c!==null&&(this._config.disableEvents||Ot(c),h!=null&&c.classList.remove(...h)),s!==null){const N=Ra(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 W_(h,this,c)}update(s,c){Kr(this,s,c)}focus(s,c={}){const h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),Kr(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 Vc 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 Ko(u){return u instanceof Vc}class pf extends Xs{}function mf(u){return u instanceof pf}class _f extends Xs{}function qc(u){return u instanceof _f}return He.$INTERNAL_isPointSelection=ur,He.$addUpdateTag=Ct,He.$applyNodeReplacement=Or,He.$copyNode=Dl,He.$createLineBreakNode=ps,He.$createNodeSelection=Wc,He.$createParagraphNode=Vi,He.$createPoint=Mr,He.$createRangeSelection=D_,He.$createTabNode=Io,He.$createTextNode=Dn,He.$getAdjacentNode=wl,He.$getNearestNodeFromDOMNode=ii,He.$getNearestRootOrShadowRoot=Eo,He.$getNodeByKey=Cn,He.$getPreviousSelection=Fo,He.$getRoot=tr,He.$getSelection=_n,He.$getTextContent=L_,He.$hasAncestor=Fi,He.$hasUpdateTag=Un,He.$insertNodes=b_,He.$isBlockElementNode=O_,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=$r,He.$isLeafNode=As,He.$isLineBreakNode=ai,He.$isNodeSelection=Wr,He.$isParagraphNode=Z_,He.$isRangeSelection=Tt,He.$isRootNode=zr,He.$isRootOrShadowRoot=si,He.$isTabNode=ko,He.$isTextNode=_t,He.$nodesOfType=$i,He.$normalizeSelection__EXPERIMENTAL=Os,He.$parseSerializedNode=H_,He.$selectAll=Sl,He.$setCompositionKey=vn,He.$setSelection=Cr,He.$splitNode=ba,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=ty,He.COMMAND_PRIORITY_EDITOR=J_,He.COMMAND_PRIORITY_HIGH=ey,He.COMMAND_PRIORITY_LOW=X_,He.COMMAND_PRIORITY_NORMAL=Q_,He.CONTROLLED_TEXT_INSERTION_COMMAND=p,He.COPY_COMMAND=j,He.CUT_COMMAND=K,He.DELETE_CHARACTER_COMMAND=l,He.DELETE_LINE_COMMAND=S,He.DELETE_WORD_COMMAND=T,He.DEPRECATED_$computeGridMap=I_,He.DEPRECATED_$getGridCellNodeRect=br,He.DEPRECATED_$getNodeTriplet=tf,He.DEPRECATED_$isGridCellNode=Ko,He.DEPRECATED_$isGridNode=mf,He.DEPRECATED_$isGridRowNode=qc,He.DEPRECATED_GridCellNode=Vc,He.DEPRECATED_GridNode=pf,He.DEPRECATED_GridRowNode=_f,He.DRAGEND_COMMAND=oe,He.DRAGOVER_COMMAND=Z,He.DRAGSTART_COMMAND=O,He.DROP_COMMAND=de,He.DecoratorNode=Yc,He.ElementNode=Xs,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=z,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=Ee,He.INTERNAL_PointSelection=Rr,He.KEY_ARROW_DOWN_COMMAND=Y,He.KEY_ARROW_LEFT_COMMAND=P,He.KEY_ARROW_RIGHT_COMMAND=I,He.KEY_ARROW_UP_COMMAND=W,He.KEY_BACKSPACE_COMMAND=ue,He.KEY_DELETE_COMMAND=H,He.KEY_DOWN_COMMAND=v,He.KEY_ENTER_COMMAND=re,He.KEY_ESCAPE_COMMAND=q,He.KEY_MODIFIER_COMMAND=A,He.KEY_SPACE_COMMAND=te,He.KEY_TAB_COMMAND=V,He.LineBreakNode=Yi,He.MOVE_TO_END=G,He.MOVE_TO_START=k,He.OUTDENT_CONTENT_COMMAND=Te,He.PASTE_COMMAND=_,He.ParagraphNode=Wo,He.REDO_COMMAND=m,He.REMOVE_TEXT_COMMAND=E,He.RootNode=Ho,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=J,He.TabNode=xr,He.TextNode=Zr,He.UNDO_COMMAND=M,He.createCommand=e,He.createEditor=ry,He.getNearestEditorFromDOMNode=fl,He.isCurrentlyReadOnlyMode=Bo,He.isHTMLAnchorElement=La,He.isHTMLElement=Ws,He.isSelectionCapturedInDecoratorInput=Ds,He.isSelectionWithinEditor=ss,He}var We={},Ff;function jN(){if(Ff)return We;Ff=1;let e={},t={},n={},r={},l={},d={},f={},p={},_={},E={},T={},S={},w={},M={},m={},v={},I={},G={},P={},k={},W={},Y={},re={},te={},ue={},q={},H={},V={},Ee={},Se={},Te={},de={},z={},O={},Z={},oe={};function j(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 K=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J=K&&"documentMode"in document?document.documentMode:null,R=K&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),U=K&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),X=K&&"InputEvent"in window&&!J?"getTargetRanges"in new window.InputEvent("input"):!1,fe=K&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=K&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,B=K&&/Android/.test(navigator.userAgent),A=K&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F=K&&/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},ce={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=qt();return i!==null?i.clone():null})}function Ut(o,i,a){Fe=!0;let g=100<performance.now()-qe;try{Tr(o,()=>{let C=qt()||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,Ot=Kt(pt,Q);if(!(Ot===null&&pt!==D||En(Ot))){if(Pe==="characterData"){if(Ke=g&&Ct(Ot))e:{Ke=C,Pe=pt;var Ft=Ot;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=Yr(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===pt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),pt=pt.nodeValue,pt!==null&&wt(Ot,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),Dr=zt.parentNode;Dr==null||zt===ge||Yn!==null||zt.nodeName==="BR"&&ut(zt,Dr,o)||(U&&(Yn=zt.innerText||zt.nodeValue)&&(Ye+=Yn),Dr.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)Dr=Ke[zt],(Dr.nodeName==="BR"&&ut(Dr,pt,o)||ge===Dr)&&(pt.appendChild(Dr),Ft++);Pe!==Ft&&(pt===D&&(Ot=Q._nodeMap.get("root")),x.set(pt,Ot))}}}}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++)Ot=Q[Xe],pt=Ot.parentNode,pt==null||Ot.nodeName!=="BR"||ut(Ot,ge,o)||pt.removeChild(Ot);a.takeRecords()}C!==null&&(Ae&&(C.dirty=!0,rn(C)),U&&on(o)&&C.insertRawText(Ye))})}finally{Fe=!1}}function tn(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 Ie(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,it=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function st(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 ot(o,i,a){let g=o.getRootElement();try{return g!==null&&g.contains(i)&&g.contains(a)&&i!==null&&!st(i)&&St(i)===o}catch{return!1}}function St(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<Wi&&j(14),i=hn();var a=Fr(),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<Wi&&j(14);var i=o.getLatest(),a=i.__parent,g=Fr();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||Fr())._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 nn(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=Fr();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 Fr()._nodeMap.get("root")}function rn(o){Jn();let i=Fr();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function wr(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 lt(o,i,a){if(i=Yr(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&&wt(g,i,C,x,o)}}}function wt(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=qt(),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&&j(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 on(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&&j(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&&j(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 Ai(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&&j(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||j(98),i):o}function Os(o,i){o=o.getParent(),!nr(o)||Je(i)||En(i)||j(99)}function fo(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 Yr(o){return K?(o||window).getSelection():null}function ma(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function ho(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||Ii(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="",kr,Bn,As,hl=!1,gl=!1,jr,Mi=null,pl,vn,lr,Cn,go,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),po(o,0,o.length-1,null)),a!==void 0&&Pt(ii,As,jr,a,"destroyed")}function po(o,i,a,g){for(;i<=a;++i){let C=o[i];C!==void 0&&Ms(C,g)}}function Ri(o,i){o.setProperty("text-align",i)}function tr(o,i){var a=kr.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?Ri(o,""):i===1?Ri(o,"left"):i===2?Ri(o,"center"):i===3?Ri(o,"right"):i===4?Ri(o,"justify"):i===5?Ri(o,"start"):i===6&&Ri(o,"end")}function Cr(o,i,a){let g=Cn.get(o);g===void 0&&j(60);let C=g.createDOM(kr,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),_a(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)?(
|
|
50
|
+
`)}else x=g.getTextContent(),En(g)?(D=g.decorate(Bn,kr),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,jr,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=
|
|
52
|
+
`),C.__lexicalTextContent=Ln,Ln=D+Ln}function bi(o,i){return o=i.get(o),Ii(o)||En(o)&&o.isInline()}function yl(o,i,a){o=o!==null&&(o.__size===0||bi(o.__last,lr)),i=i.__size===0||bi(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 _a(o,i){var a=i.__lexicalDir;if(i.__lexicalDirTextContent!==zn||a!==Mi){let x=zn==="";if(x)var g=Mi;else g=zn,g=De.test(g)?"rtl":ee.test(g)?"ltr":null;if(g!==a){let D=i.classList,Q=kr.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)}Mi=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&&j(101),a.push(o),o=g.__next}return a}function Li(o,i){var a=lr.get(o),g=Cn.get(o);a!==void 0&&g!==void 0||j(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,jr,g,"updated"),g.updateDOM(a,x,kr))return g=Cr(o,null,null),i===null&&j(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)Li(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,po(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 Ot=i[Q];if(Ke===Ot)Pe=mo(Li(Ot,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(Ot);Ft?(zt?(Ke=bn(Bn,Ot),Ke===Pe?Pe=mo(Li(Ot,x)):(Pe!=null?x.insertBefore(Ke,Pe):x.appendChild(Ke),Li(Ot,x)),pt++):Cr(Ot,x,Pe),Q++):(Pe=mo(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&&po(Xe,pt,Ye,x)}}an(g)&&(Ln+=`
|
|
53
53
|
|
|
54
54
|
`),x.__lexicalTextContent=Ln,Ln=C+Ln,_a(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,
|
|
58
|
+
`)}else a=g.getTextContent(),En(g)?(C=g.decorate(Bn,kr),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=nn(Bn)}a[o]=i}function mo(o){return o=o.nextSibling,o!==null&&o===Bn._blockCursorElement&&(o=o.nextSibling),o}function bs(o){let i=go.get(o);return i===void 0&&j(75,o),i}let Pr=Object.freeze({}),Cl=[["keydown",$c],["pointerdown",Lc],["compositionstart",wa],["compositionend",Pc],["input",Sa],["click",bc],["cut",Pr],["copy",Pr],["dragstart",Pr],["dragover",Pr],["dragend",Pr],["paste",Pr],["focus",Pr],["blur",Pr],["drop",Pr]];X&&Cl.push(["beforeinput",(o,i)=>kc(o,i)]);let Ls=0,ya=0,Na=0,os=null,Is=0,El=!1,Tl=!1,ks=!1,Ps=!1,Ca=[0,"",0,"root",0];function Ea(o,i,a,g,C){let x=o.anchor,D=o.focus,Q=x.getNode();var ge=hn();let Ae=Yr(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||Na<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 Ta(o,i){return o!==null&&o.nodeValue!==null&&o.nodeType===3&&i!==0&&i!==o.nodeValue.length}function xa(o,i,a){let{anchorNode:g,anchorOffset:C,focusNode:x,focusOffset:D}=o;El&&(El=!1,Ta(g,C)&&Ta(x,D))||Tr(i,()=>{if(!a)rn(null);else if(ot(i,g,x)){var Q=qt();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,Ot,Ft]=Ca;var Xe=bt();if(Xe=i.isComposing()===!1&&Xe.getTextContent()==="",Ye<Ft+200&&ge.offset===pt&&ge.key===Ot)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 bc(o,i){Tr(i,()=>{let a=qt();var g=Yr(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),rn(g));ct(i,t,o)})}function Lc(o,i){let a=o.target;o=o.pointerType,a instanceof Node&&o!=="touch"&&Tr(i,()=>{En(Kt(a))||(Tl=!0)})}function va(o){return o.getTargetRanges?(o=o.getTargetRanges(),o.length===0?null:o[0]):null}function Ic(o,i){return o!==i||Je(o)||Je(i)||!o.isToken()||!i.isToken()}function kc(o,i){let a=o.inputType,g=va(o);a==="deleteCompositionText"||U&&on(i)||a!=="insertCompositionText"&&Tr(i,()=>{let C=qt();if(a==="deleteContentBackward"){if(C===null){var x=Er();if(!Mt(x))return;rn(x.clone())}if(Mt(C)){if(B&>(C.anchor.key),ya===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&<(!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
59
|
`?(o.preventDefault(),ct(i,r,!1)):x===`
|
|
60
60
|
|
|
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&&Ea(C,g,x,o.timeStamp,!0)?(o.preventDefault(),ct(i,d,x)):
|
|
62
|
-
`&&(a=qt(),Mt(a))){i=a.focus,a.anchor.set(i.key,i.offset,i.type),ct(o,H,null);return}}lt(!0,o,i)}function kc(o,i){U?ks=!0:Tr(i,()=>{xl(i,o.data)})}function Pc(o,i){if(bs=o.timeStamp,ya=o.keyCode,!i.isComposing()){var{keyCode:a,shiftKey:g,ctrlKey:C,metaKey:x,altKey:A}=o;if(!ct(i,O,o)){if(a!==39||C||x||A)if(a!==39||A||g||!C&&!x)if(a!==37||C||x||A)if(a!==37||A||g||!C&&!x)if(a!==38||C||x)if(a!==40||C||x)if(a===13&&g)Is=!0,ct(i,H,o);else if(a===32)ct(i,j,o);else if(R&&C&&a===79)o.preventDefault(),Is=!0,ct(i,r,!0);else if(a!==13||g){var Q=R?A||x?!1:a===8||a===72&&C:C||A||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||A||x?!1:a===46||a===68&&C:C||A||x?!1:a===46,Q?a===46?ct(i,ce,o):(o.preventDefault(),ct(i,n,!1)):a===8&&(R?A:C)?(o.preventDefault(),ct(i,_,!0)):a===46&&(R?A:C)?(o.preventDefault(),ct(i,_,!1)):R&&x&&a===8?(o.preventDefault(),ct(i,E,!0)):R&&x&&a===46?(o.preventDefault(),ct(i,E,!1)):a===66&&!A&&(R?x:C)?(o.preventDefault(),ct(i,T,"bold")):a===85&&!A&&(R?x:C)?(o.preventDefault(),ct(i,T,"underline")):a===73&&!A&&(R?x:C)?(o.preventDefault(),ct(i,T,"italic")):a!==9||A||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 Is=!1,ct(i,H,o);else ct(i,P,o);else ct(i,k,o);else ct(i,G,o);else ct(i,I,o);else ct(i,v,o);else ct(i,m,o);(C||g||A||x)&&ct(i,oe,o)}}}function Oa(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let os=new Map;function Da(o){var i=o.target;let a=jr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(a!==null){var g=St(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),rn(Q))})),i=pe(g),i=i[i.length-1];var C=i._key,x=os.get(C),A=x||i;A!==g&&xa(a,A,!1),xa(a,g,!0),g!==i?os.set(C,g):x&&os.delete(C)}}}function $c(o,i){Ls===0&&o.ownerDocument.addEventListener("selectionchange",Da),Ls++,o.__lexicalEditor=i;let a=Oa(o);for(let g=0;g<Cl.length;g++){let[C,x]=Cl[g],A=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,D,Q);case"blur":return ct(i,Z,Q);case"drop":return ct(i,z,Q)}};o.addEventListener(C,A),a.push(()=>{o.removeEventListener(C,A)})}}function vl(o,i,a){Jn();var g=o.__key;let C=o.getParent();if(C!==null){var x=qt();if(Mt(x)&&Je(o)){var{anchor:A,focus:Q}=x,ge=A.getNode(),Ae=Q.getNode();Zn(ge,o)&&A.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&&(us(x,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0),Ye.key===g&&(us(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 Ps{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||qt(),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 A=x.__key;if(C.has(A)||(C.add(A),g.push(x)),x===i)break;if(A=Je(x)?a?x.getFirstChild():x.getLastChild():null,A!==null)x=A;else if(A=a?x.getNextSibling():x.getPreviousSibling(),A!==null)x=A;else{if(x=x.getParentOrThrow(),C.has(x.__key)||g.push(x),x===i)break;A=x;do A===null&&Y(68),x=a?A.getNextSibling():A.getPreviousSibling(),A=A.getParent(),A!==null&&(x!==null||C.has(A.__key)||g.push(A));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 A=qt();return Bs(A)&&A.setCachedNodes(null),a.has(g)?(Et(C),C):(A=C.constructor.clone(C),A.__parent=x,A.__next=C.__next,A.__prev=C.__prev,Je(C)&&Je(A)?(A.__first=C.__first,A.__last=C.__last,A.__size=C.__size,A.__indent=C.__indent,A.__format=C.__format,A.__dir=C.__dir):Ct(C)&&Ct(A)&&(A.__format=C.__format,A.__style=C.__style,A.__mode=C.__mode,A.__detail=C.__detail),a.add(g),A.__key=g,Et(A),i.set(g,A),A)}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=qt();g!==null&&(g=g.clone()),ws(this,i);let C=this.getLatest(),x=this.__key,A=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=A:Ae.getWritable().__next=A,Q.__prev=Xe,Ye===null?i.__last=A:Ye.getWritable().__prev=A,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)&&(rn(g),a=g.anchor,g=g.focus,a.key===x&&si(a,Q),g.key===x&&si(g,Q)),xt()===x&>(A),Q}insertAfter(i,a=!0){Jn(),ws(this,i);var g=this.getWritable();let C=i.getWritable();var x=C.getParent();let A=qt();var Q=!1,ge=!1;if(x!==null){var Ae=i.getIndexWithinParent();Nt(C),Mt(A)&&(ge=x.__key,Q=A.anchor,x=A.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(A)&&(a=this.getIndexWithinParent(),Hn(A,Ae,a+1),g=Ae.__key,Q&&A.anchor.set(g,a+2,"element"),ge&&A.focus.set(g,a+2,"element")),i}insertBefore(i,a=!0){Jn(),ws(this,i);var g=this.getWritable();let C=i.getWritable(),x=C.__key;Nt(C);let A=this.getPreviousSibling(),Q=this.getParentOrThrow().getWritable(),ge=g.__prev,Ae=this.getIndexWithinParent();return A===null?Q.__first=x:A.getWritable().__next=x,Q.__size++,g.__prev=x,C.__prev=ge,C.__next=g.__key,C.__parent=g.__parent,g=qt(),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 Fc(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 Ps{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:Aa,priority:0}}}}static importJSON(){return
|
|
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&&Ea(C,g,x,o.timeStamp,!0)?(o.preventDefault(),ct(i,d,x)):os=x,Na=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":Ic(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,E,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ct(i,E,!1);break;case"formatStrikeThrough":ct(i,T,"strikethrough");break;case"formatBold":ct(i,T,"bold");break;case"formatItalic":ct(i,T,"italic");break;case"formatUnderline":ct(i,T,"underline");break;case"historyUndo":ct(i,S,void 0);break;case"historyRedo":ct(i,w,void 0)}}})}function Sa(o,i){o.stopPropagation(),Tr(i,()=>{var a=qt(),g=o.data,C=va(o);if(g!=null&&Mt(a)&&Ea(a,C,g,o.timeStamp,!1)){Ps&&(xl(i,g),Ps=!1);var x=a.anchor,D=x.getNode();if(C=Yr(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 lt(!1,i,g!==null?g:void 0),Ps&&(xl(i,g||void 0),Ps=!1);Jn(),a=hn(),tn(a)}),os=null}function wa(o,i){Tr(i,()=>{let a=qt();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)&&wt(i,o.nodeValue,null,null,!0);return}if(i[i.length-1]===`
|
|
62
|
+
`&&(a=qt(),Mt(a))){i=a.focus,a.anchor.set(i.key,i.offset,i.type),ct(o,W,null);return}}lt(!0,o,i)}function Pc(o,i){U?Ps=!0:Tr(i,()=>{xl(i,o.data)})}function $c(o,i){if(Ls=o.timeStamp,ya=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,W,o);else if(a===32)ct(i,Y,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,ue,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,E,!0)):R&&x&&a===46?(o.preventDefault(),ct(i,E,!1)):a===66&&!D&&(R?x:C)?(o.preventDefault(),ct(i,T,"bold")):a===85&&!D&&(R?x:C)?(o.preventDefault(),ct(i,T,"underline")):a===73&&!D&&(R?x:C)?(o.preventDefault(),ct(i,T,"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,Te,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,z,o)))):!U&&a===65&&(R?x:C)&&(o.preventDefault(),ct(i,z,o))):ct(i,q,o))}else ks=!1,ct(i,W,o);else ct(i,k,o);else ct(i,P,o);else ct(i,G,o);else ct(i,I,o);else ct(i,v,o);else ct(i,m,o);(C||g||D||x)&&ct(i,oe,o)}}}function Oa(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let ls=new Map;function Da(o){var i=o.target;let a=Yr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(a!==null){var g=St(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),rn(Q))})),i=pe(g),i=i[i.length-1];var C=i._key,x=ls.get(C),D=x||i;D!==g&&xa(a,D,!1),xa(a,g,!0),g!==i?ls.set(C,g):x&&ls.delete(C)}}}function Fc(o,i){Is===0&&o.ownerDocument.addEventListener("selectionchange",Da),Is++,o.__lexicalEditor=i;let a=Oa(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,Te,Q);case"paste":return ct(i,f,Q);case"dragstart":return ct(i,V,Q);case"dragover":return ct(i,Ee,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,H,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=qt();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(){j(64,this.name)}static clone(){j(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||qt(),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&&j(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&&j(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&&j(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&&j(113),i}getWritable(){Jn();var i=Fr(),a=hn();i=i._nodeMap;let g=this.__key,C=this.getLatest(),x=C.__parent;a=a._cloneNotNeeded;var D=qt();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(){j(70)}updateDOM(){j(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){j(72)}static importJSON(){j(18,this.name)}static transform(){return null}remove(i){vl(this,!0,i)}replace(i,a){Jn();var g=qt();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)&&(rn(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=qt();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=qt(),a&&Mt(g)&&(a=this.getParentOrThrow(),Hn(g,a,Ae)),i}isParentRequired(){return!1}createParentElementNode(){return Hr()}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 Bc(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 Vr extends $s{static getType(){return"linebreak"}static clone(i){return new Vr(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:Aa,priority:0}}}}static importJSON(){return qr()}exportJSON(){return{type:"linebreak",version:1}}}function Aa(){return{node:qr()}}function qr(){return Nr(new Vr)}function Ii(o){return o instanceof Vr}function ki(o,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function _o(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 Pi(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 $i extends $s{static getType(){return"text"}static clone(i){return new $i(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=ki(this,a);let C=_o(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,Pi(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=ki(this,x);let ge=ki(this,D);var Ae=_o(this,x);let Ye=_o(this,D);return(Q===null?Ae:Q)!==(ge===null?Ye:ge)?!0:Q===ge&&Ae!==Ye?(x=a.firstChild,x==null&&j(48),i=Q=document.createElement(Ye),Pi(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&&j(49)),Pi(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:Ma,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&&ho(i)||j(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"?ce[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=qt();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=qt();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=qt(),ge=[ge],Ye=Ye.length;for(let Ot=1;Ot<D;Ot++){var Pe=i[Ot],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()||j(50);var g=this.__key;let C=i.__key,x=this.__text,D=x.length;xt()===C&>(g);let Q=qt();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 Ma(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&&j(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
|
-
`?o.push(
|
|
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=
|
|
65
|
+
`?o.push(qr()):g===" "?o.push(Fi()):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 yo=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(yo)===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 No={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function yi(o){let i=No[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 $i(o))}function Ct(o){return o instanceof $i}class cs extends $i{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=Fi();return a.setFormat(i.format),a.setStyle(i.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){j(126)}setDetail(){j(127)}setMode(){j(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Fi(){return Nr(new cs)}function Ra(o){return o instanceof cs}class Co{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&&j(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 $r(o,i,a){return new Co(o,i,a)}function Eo(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)?Eo(o,a):Eo(o,i)}else Eo(o,i)}function Dl(o,i,a,g){let C=o.getNode(),x=C.getChildAtIndex(o.offset),D=Un(),Q=nr(C)?Hr().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 Or(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 xo(this)}}class To{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 To(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){Or(this.anchor,i.__key,a,"text"),Or(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]=xo(this),Ae="",Ye=!0;for(let Xe=0;Xe<i.length;Xe++){let Ke=i[Xe];if(Je(Ke)&&!Ke.isInline())Ye||(Ae+=`
|
|
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)&&!Ii(Ke)||Ke===g&&this.isCollapsed()||(Ae+=Ke.getTextContent())}return Ae}applyDOMRange(i){let a=hn(),g=a.getEditorState()._selection;if(i=Ia(i.startContainer,i.startOffset,i.endContainer,i.endOffset,a,g),i!==null){var[C,x]=i;Or(this.anchor,C.key,C.offset,C.type),Or(this.focus,x.key,x.offset,x.type),this._cachedNodes=null}}clone(){let i=this.anchor,a=this.focus;return new Ni($r(i.key,i.offset,i.type),$r(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(Fi()):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,A=this.style;C&&a.type==="element"?Dl(a,g,x,A):C||g.type!=="element"||Dl(g,a,x,A);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(""),vo(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!==A))if(a.getTextContent()==="")a.setFormat(x),a.setStyle(A);else{Q=Un(i),Q.setFormat(x),Q.setStyle(A),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(Ra(a)){i=Un(i),i.setFormat(x),i.setStyle(A),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(),A=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(A)&&A.isInline())do Xe=A,A=A.getParentOrThrow();while(A.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=A.getChildren(),Ye=new Set(Q),Ke=Pe.is(A),Pe=Pe.isInline()&&a.getNextSibling()===null?Pe:a,pt=Ae.length-1;0<=pt;pt--){let Ot=Ae[pt];if(Ot.is(a)||Je(Ot)&&Ot.isParentOf(a))break;Ot.isAttached()&&(!Ye.has(Ot)||Ot.is(Xe)?Ke||Pe.insertAfter(Ot,!1):Ot.remove())}if(!Ke)for(Ae=A,A=null;Ae!==null;)Ye=Ae.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(A))&&(x.delete(Ae.__key),A=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 A=this.focus,Q=this.isBackward();a=Q?A:C,C=Q?C:A;var ge=0,Ae=g[0];if(A=a.type==="element"?0:a.offset,a.type==="text"&&A===Ae.getTextContentSize()&&(ge=1,Ae=g[1],A=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))A!==x&&(A===0&&x===Ae.getTextContentSize()?Ae.setFormat(Q):(i=Ae.splitText(A,x),i=A===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-A,"text")),this.format=Q);else{A!==0&&([,Ae]=Ae.splitText(A),A=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,A,"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=qt();if(!Mt(a))throw Error("Expected RangeSelection after insertParagraph");return a.insertNodes(i)}var g=Os(this.anchor.getNode(),rs);if(a=i[i.length-1],"__language"in g&&Je(g))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var C=zs(this);g.splice(C,0,i),a.selectEnd()}else if(i.some(Q=>(Je(Q)||En(Q))&&!Q.isInline())){a=Hi(i),i=a.getLastDescendant();var x=a.getChildren();a=Je(g)&&g.isEmpty()?null:this.insertParagraph(),C=x[x.length-1];var A=x[0];if((Q=>Je(Q)&&rs(Q)&&!Q.isEmpty()&&Je(g)&&(!g.isEmpty()||"__value"in g&&"__checked"in g))(A)){if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");g.append(...A.getChildren()),A=x[1]}A&&Fc(g,A),x=Os(i,rs),a&&Je(x)&&("__value"in a&&"__checked"in a||rs(C))&&(x.append(...a.getChildren()),a.remove()),Je(g)&&g.isEmpty()&&g.remove(),i.selectEnd(),i=Je(g)?g.getLastChild():null,Ii(i)&&x!==g&&i.remove()}else{if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");C=zs(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=zs(this);if(i=Os(this.anchor.getNode(),rs),!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 A=i[0];let Q=i[g],[ge,Ae]=xo(this);return a===0?[]:a===1?Ct(A)&&!this.isCollapsed()?(i=ge>Ae?Ae:ge,g=A.splitText(i,ge>Ae?ge:Ae),i=i===0?g[0]:g[1],i!=null?[i]:[]):[A]:(a=C.isBefore(x),Ct(A)&&(C=a?ge:Ae,C===A.getTextContentSize()?i.shift():C!==0&&([,A]=A.splitText(C),i[0]=A)),Ct(Q)&&(A=Q.getTextContent().length,a=a?Ae:ge,a===0?i.pop():a!==A&&([Q]=Q.splitText(a),i[g]=Q)),i)}modify(i,a,g){var C=this.focus,x=this.anchor,A=i==="move",Q=Ht(C,a);if(En(Q)&&!Q.isIsolated())A&&Q.isKeyboardSelectable()?(a=Ml(),a.add(Q.__key),rn(a)):(i=a?Q.getPreviousSibling():Q.getNextSibling(),Ct(i)?(Q=i.__key,a=a?i.getTextContent().length:0,C.set(Q,a,"text"),A&&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"),A&&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,!A)){for(A=this.getNodes(),i=[],g=!1,ge=0;ge<A.length;ge++)Ae=A[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,A=this.anchor,C=A.key,Q=A.offset,x=A.type,Dr(A,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 A=x.getParent();if(A=x.getNextSibling()||(A===null?null:A.getNextSibling()),Je(A)&&A.isShadowRoot())return}if(A=Ht(C,i),En(A)&&!A.isIsolated()){A.isKeyboardSelectable()&&Je(x)&&x.getChildrenSize()===0?(x.remove(),i=Ml(),i.add(A.__key),rn(i)):(A.remove(),hn().dispatchCommand(e,void 0));return}if(!i&&Je(A)&&Je(x)&&x.isEmpty()){x.remove(),A.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(A=C.type==="text"?C.getNode():null,x=g.type==="text"?g.getNode():null,A!==null&&A.isSegmented()){if(g=C.offset,C=A.getTextContentSize(),A.is(x)||i&&g!==C||!i&&g!==0){La(A,i,g);return}}else if(x!==null&&x.isSegmented()&&(g=g.offset,C=x.getTextContentSize(),x.is(A)||i&&g!==0||!i&&g!==C)){La(x,i,g);return}if(x=this.anchor,A=this.focus,g=x.getNode(),C=A.getNode(),g===C&&x.type==="text"&&A.type==="text"){var Q=x.offset,ge=A.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?A.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 To}function ba(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function xo(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]:[ba(i),ba(o)]}function La(o,i,a){let g=o.getTextContent().split(/(?=\s)/g),C=g.length,x=0,A=0;for(let Q=0;Q<C;Q++){let ge=g[Q],Ae=Q===C-1;if(A=x,x+=ge.length,i&&x===a||x>a||Ae){g.splice(Q,1),Ae&&(A=void 0);break}}i=g.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(A,A))}function Hs(o,i,a,g){var C=i;if(o.nodeType===1){let Q=!1;var x=o.childNodes,A=x.length;C===A&&(Q=!0,C=A-1);let ge=x[C];if(A=!1,ge===g._blockCursorElement?(ge=x[C+1],A=!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&&!A&&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 Bi(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 vo(o,i,a){if(o.type==="text"&&i.type==="text"){var g=o.isBefore(i);let C=o.is(i);Bi(o,g,C),Bi(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 Ia(o,i,a,g,C,x){return o===null||a===null||!ot(C,o,a)||(i=Hs(o,i,Mt(x)?x.anchor:null,C),i===null)||(g=Hs(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:(vo(i,g,x),[i,g])}function Al(o,i,a,g,C,x){let A=Br();return o=new Ni(Fr(o,i,C),Fr(a,g,x),0,""),o.dirty=!0,A._selection=o}function Ml(){return new To(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 A;if(!Mt(o)||C){if(i===null)return null;if(C=i.anchorNode,x=i.focusNode,A=i.anchorOffset,i=i.focusOffset,g&&Mt(o)&&!ot(a,C,x))return o.clone()}else return o.clone();if(a=Ia(C,A,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 qt(){return Br()._selection}function Er(){return hn()._editorState._selection}function Hn(o,i,a,g=1){var C=o.anchor,x=o.focus,A=C.getNode(),Q=x.getNode();if(i.is(A)||i.is(Q)){if(A=i.__key,o.isCollapsed())i=C.offset,(a<=i&&0<g||a<i&&0>g)&&(a=Math.max(0,i+g),C.set(A,a,"element"),x.set(A,a,"element"),cs(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(A,Math.max(0,ge+g),"element")),i.is(x)&&(i=C.offset,(a<=i&&0<g||a<i&&0>g)&&C.set(A,Math.max(0,i+g),"element"))}cs(o)}}function cs(o){var i=o.anchor,a=i.offset;let g=o.focus;var C=g.offset,x=i.getNode(),A=g.getNode();if(o.isCollapsed())Je(x)&&(A=x.getChildrenSize(),A=(C=a>=A)?x.getChildAtIndex(A-1):x.getChildAtIndex(a),Ct(A)&&(a=0,C&&(a=A.getTextContentSize()),i.set(A.__key,a,"text"),g.set(A.__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(A)&&(a=A.getChildrenSize(),C=(i=C>=a)?A.getChildAtIndex(a-1):A.getChildAtIndex(C),Ct(C)&&(A=0,i&&(A=C.getTextContentSize()),g.set(C.__key,A,"text")))}}function ka(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 us(o,i,a,g,C){let x=null,A=0,Q=null;g!==null?(x=g.__key,Ct(g)?(A=g.getTextContentSize(),Q="text"):Je(g)&&(A=g.getChildrenSize(),Q="element")):C!==null&&(x=C.__key,Ct(C)?Q="text":Je(C)&&(Q="element")),x!==null&&Q!==null?o.set(x,A,Q):(A=i.getIndexWithinParent(),A===-1&&(A=a.getChildrenSize()),o.set(a.__key,A,"element"))}function Ws(o,i,a,g,C){o.type==="text"?(o.key=a,i||(o.offset+=C)):o.offset>g.getIndexWithinParent()&&--o.offset}function Ks(o){o instanceof Ao||(o instanceof Ps?(o=ma(o,Gi),Gi(o)||Y(114)):(o=ma(o.getNode(),Gi),Gi(o)||Y(114)));let i=o.getParent();Bl(i)||Y(115);let a=i.getParent();return Fl(a)||Y(116),[o,i,a]}function zs(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!rs(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 Hi(o){let i=Wr(),a=null;for(let g=0;g<o.length;g++){let C=o[g],x=Ii(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,ds=!1,Wi=0,Ci={characterData:!0,childList:!0,subtree:!0};function fs(){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 Pa(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 $a(o,i){let a=i._dirtyLeaves,g=i._dirtyElements;o=o._nodeMap;let C=xt(),x=new Map;var A=a;let Q=A.size;for(var ge=g,Ae=ge.size;0<Q||0<Ae;){if(0<Q){i._dirtyLeaves=new Set;for(let Ye of A)A=o.get(Ye),Ct(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&ve(A),A!==void 0&&A!==void 0&&A.__key!==C&&A.isAttached()&&Pa(i,A,x),a.add(Ye);if(A=i._dirtyLeaves,Q=A.size,0<Q){Wi++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of ge)ge=Ye[0],Ae=Ye[1],(ge==="root"||Ae)&&(A=o.get(ge),A!==void 0&&A!==void 0&&A.__key!==C&&A.isAttached()&&Pa(i,A,x),g.set(ge,Ae));A=i._dirtyLeaves,Q=A.size,ge=i._dirtyElements,Ae=ge.size,Wi++}i._dirtyLeaves=a,i._dirtyElements=g}function So(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=So(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 Ki(o,i){let a=o._pendingEditorState,g=o._rootElement,C=o._headless||g===null;if(a!==null){var x=o._editorState,A=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 Ot=mn,Ft=Xn,zt=Tn;zn=ri=Ln="",hl=Ot===2,Mi=null,Bn=o,Pr=o._config,Ds=o._nodes,Vr=Bn._listeners.mutation,pl=Ft,vn=zt,lr=x._nodeMap,Cn=a._nodeMap,gl=a._readOnly,go=new Map(o._keyToDOMMap);let br=new Map;ii=br,Li("root",null),ii=go=Pr=Cn=lr=vn=pl=Ds=Bn=void 0,pt=br}catch(mn){if(mn instanceof Error&&o._onError(mn),ds)throw mn;Do(o,null,g,a),Oe(o),o._dirtyType=2,ds=!0,Ki(o,x),ds=!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 Yi=o._decorators,Mo=o._pendingDecorators||Yi,gs=a._nodeMap,ai;for(ai in Mo)gs.has(ai)||(Mo===Yi&&(Mo=nn(o)),delete Mo[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&&st(Tt)))if(Mt(Q)){var ji=Q.anchor,Ro=Q.focus,Ba=ji.key,Ha=Ro.key,Wl=bn(o,Ba),Vs=bn(o,Ha),Jr=ji.offset,Wa=Ro.offset,Kl=Q.format,bo=Q.style,Ka=Q.isCollapsed(),qs=Wl,Lo=Vs,zl=!1;if(ji.type==="text"){qs=ze(Wl);let ur=ji.getNode();zl=ur.getFormat()!==Kl||ur.getStyle()!==bo}else Mt(A)&&A.anchor.type==="text"&&(zl=!0);if(Ro.type==="text"&&(Lo=ze(Vs)),qs!==null&&Lo!==null){if(Ka&&(A===null||zl||Mt(A)&&(A.format!==Kl||A.style!==bo))){var za=performance.now();Ca=[Kl,bo,Jr,Ba,za]}if(br===Jr&&Ti===Wa&&Xn===qs&&Tn===Lo&&(Mr.type!=="Range"||!Ka)&&(Tt!==null&&g.contains(Tt)||g.focus({preventScroll:!0}),ji.type!=="element"))break e;try{Mr.setBaseAndExtent(qs,Jr,Lo,Wa)}catch{}if(!li.has("skip-scroll-into-view")&&Q.isCollapsed()&&g!==null&&g===document.activeElement){let ur=Q instanceof Ni&&Q.anchor.type==="element"?qs.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 $o=xr.getBoundingClientRect();Dn=$o.top,_t=$o.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 $o=xr.scrollTop;xr.scrollTop+=ci;let Ua=xr.scrollTop-$o;Ul-=Ua,Xr-=Ua}if(dr)break;xr=yr(xr)}}}El=!0}}else A!==null&&ot(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);fo(Lr)&&(Tt=!0)}else{let Lr=Tn.getChildAtIndex(br);if(fo(Lr)){let rr=Lr.getPreviousSibling();(rr===null||fo(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 Io=pt;let mn=Array.from(o._listeners.mutation),Xn=mn.length;for(let Tn=0;Tn<Xn;Tn++){let[br,Ti]=mn[Tn],Tt=Io.get(Ti);Tt!==void 0&&br(Tt,{dirtyLeaves:Yn,prevEditorState:x,updateTags:li})}}Mt(Q)||Q===null||A!==null&&A.is(Q)||o.dispatchCommand(e,void 0);var ko=o._pendingDecorators;ko!==null&&(o._decorators=ko,o._pendingDecorators=null,Ei("decorator",o,!0,ko));var Bc=It(i||x),Rr=It(a);if(Bc!==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 Po=o._updates;if(Po.length!==0){let mn=Po.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 A=0;A<g.length;A++){var C=g[A]._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 hs(o,i){let a=o._updates;for(i=i||!1;a.length!==0;){var g=a.shift();if(g){let[C,x]=g,A;x!==void 0&&(g=x.onUpdate,A=x.tag,x.skipTransforms&&(i=!0),g&&o._deferred.push(g),A&&o._updateTags.add(A)),C()}}return i}function Il(o,i,a){let g=o._updateTags;var C,x=C=!1;if(a!==void 0){var A=a.onUpdate;C=a.tag,C!=null&&g.add(C),C=a.skipTransforms||!1,x=a.discrete||!1}A&&o._deferred.push(A),a=o._editorState,A=o._pendingEditorState;let Q=!1;(A===null||A._readOnly)&&(A=o._pendingEditorState=new Us(new Map((A||a)._nodeMap)),Q=!0),A._flushSync=x,x=gn;let ge=Wn,Ae=On,Ye=o._updating;gn=A,Wn=!1,o._updating=!0,On=o;try{Q&&(o._headless?a._selection!=null&&(A._selection=a._selection.clone()):A._selection=In(o));let Xe=o._compositionKey;i(),C=hs(o,C),ka(A,o),o._dirtyType!==0&&(C?bl(A,o):$a(A,o),hs(o),fl(a,A,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(A._flushSync=!0);let Ke=A._selection;if(Mt(Ke)){let Pe=A._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&&(A._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(),Ki(o);return}finally{gn=x,Wn=ge,On=Ae,o._updating=Ye,Wi=0}o._dirtyType!==0||kl(A,o)?A._flushSync?(A._flushSync=!1,Ki(o)):Q&&it(()=>{Ki(o)}):(A._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 wo extends Ps{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function En(o){return o instanceof wo}class zi extends Ps{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(qr()):x===" "?a.push(Fi()):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)||j(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(""),vo(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(Ra(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 Ot=Ae[pt];if(Ot.is(a)||Je(Ot)&&Ot.isParentOf(a))break;Ot.isAttached()&&(!Ye.has(Ot)||Ot.is(Xe)?Ke||Pe.insertAfter(Ot,!1):Ot.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=qt();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=Hi(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&&Bc(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,Ii(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=Hr();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=qr();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]=xo(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),rn(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=Yr(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,Or(D,a.key,a.offset,a.type),Or(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),rn(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){La(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)){La(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 To}function ba(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function xo(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]:[ba(i),ba(o)]}function La(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=wr(ge),Ct(g))C=Q?g.getTextContentSize():0;else{if(x=wr(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)&&wr(o)===x?C:C+1,x=x.getParentOrThrow()),Je(x))return $r(x.__key,C,"element")}}else g=wr(o);return Ct(g)?$r(g.__key,C,"text"):null}function Bi(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 vo(o,i,a){if(o.type==="text"&&i.type==="text"){var g=o.isBefore(i);let C=o.is(i);Bi(o,g,C),Bi(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,Or(o,g.key,g.offset,g.type),Or(i,a.key,a.offset,a.type))}}function Ia(o,i,a,g,C,x){return o===null||a===null||!ot(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=wr(o),a=wr(a),En(o)&&En(a)))?null:(vo(i,g,x),[i,g])}function Al(o,i,a,g,C,x){let D=Fr();return o=new Ni($r(o,i,C),$r(a,g,x),0,""),o.dirty=!0,D._selection=o}function Ml(){return new To(new Set)}function In(o){let i=o.getEditorState()._selection,a=Yr(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)&&!ot(a,C,x))return o.clone()}else return o.clone();if(a=Ia(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 qt(){return Fr()._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 ka(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 Ao||(o instanceof $s?(o=ma(o,Gi),Gi(o)||j(114)):(o=ma(o.getNode(),Gi),Gi(o)||j(114)));let i=o.getParent();Bl(i)||j(115);let a=i.getParent();return Fl(a)||j(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=Hr(),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($r(o.__key,i,"element"),$r(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(g,...g.getNextSiblings())),[a,o.getIndexWithinParent()+1])}function Hi(o){let i=Hr(),a=null;for(let g=0;g<o.length;g++){let C=o[g],x=Ii(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,Wi=0,Ci={characterData:!0,childList:!0,subtree:!0};function hs(){return Wn||gn!==null&&gn._readOnly}function Jn(){Wn&&j(13)}function Fr(){return gn===null&&j(15),gn}function hn(){return On===null&&j(16),On}function Pa(o,i,a){var g=i.__type;let C=o._nodes.get(g);for(C===void 0&&j(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 $a(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()&&Pa(i,D,x),a.add(Ye);if(D=i._dirtyLeaves,Q=D.size,0<Q){Wi++;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()&&Pa(i,D,x),g.set(ge,Ae));D=i._dirtyLeaves,Q=D.size,ge=i._dirtyElements,Ae=ge.size,Wi++}i._dirtyLeaves=a,i._dirtyElements=g}function So(o,i){var a=o.type,g=i.get(a);if(g===void 0&&j(17,a),a=g.klass,o.type!==a.getType()&&j(18,a.name),a=a.importJSON(o),o=o.children,Je(a)&&Array.isArray(o))for(g=0;g<o.length;g++){let C=So(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 Ki(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 Ot=mn,Ft=Xn,zt=Tn;zn=ri=Ln="",hl=Ot===2,Mi=null,Bn=o,kr=o._config,As=o._nodes,jr=Bn._listeners.mutation,pl=Ft,vn=zt,lr=x._nodeMap,Cn=a._nodeMap,gl=a._readOnly,go=new Map(o._keyToDOMMap);let Rr=new Map;ii=Rr,Li("root",null),ii=go=kr=Cn=lr=vn=pl=As=Bn=void 0,pt=Rr}catch(mn){if(mn instanceof Error&&o._onError(mn),fs)throw mn;Do(o,null,g,a),Oe(o),o._dirtyType=2,fs=!0,Ki(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,Dr=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 Yi=o._decorators,Mo=o._pendingDecorators||Yi,ps=a._nodeMap,ai;for(ai in Mo)ps.has(ai)||(Mo===Yi&&(Mo=nn(o)),delete Mo[ai]);var Ar=C?null:Yr(o._window);if(o._editable&&Ar!==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=Ar.anchorNode,Tn=Ar.focusNode,Rr=Ar.anchorOffset,Ti=Ar.focusOffset,Tt=document.activeElement;if(!(li.has("collaboration")&&Tt!==g||Tt!==null&&st(Tt)))if(Mt(Q)){var ji=Q.anchor,Ro=Q.focus,Ba=ji.key,Ha=Ro.key,Wl=bn(o,Ba),qs=bn(o,Ha),Zr=ji.offset,Wa=Ro.offset,Kl=Q.format,bo=Q.style,Ka=Q.isCollapsed(),Zs=Wl,Lo=qs,zl=!1;if(ji.type==="text"){Zs=ze(Wl);let ur=ji.getNode();zl=ur.getFormat()!==Kl||ur.getStyle()!==bo}else Mt(D)&&D.anchor.type==="text"&&(zl=!0);if(Ro.type==="text"&&(Lo=ze(qs)),Zs!==null&&Lo!==null){if(Ka&&(D===null||zl||Mt(D)&&(D.format!==Kl||D.style!==bo))){var za=performance.now();Ca=[Kl,bo,Zr,Ba,za]}if(Rr===Zr&&Ti===Wa&&Xn===Zs&&Tn===Lo&&(Ar.type!=="Range"||!Ka)&&(Tt!==null&&g.contains(Tt)||g.focus({preventScroll:!0}),ji.type!=="element"))break e;try{Ar.setBaseAndExtent(Zs,Zr,Lo,Wa)}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[Zr]||null:0<Ar.rangeCount?Ar.getRangeAt(0):null;if(ur!==null){let br;if(ur instanceof Text){let dr=document.createRange();dr.selectNode(ur),br=dr.getBoundingClientRect()}else br=ur.getBoundingClientRect();let rr=g.ownerDocument,Wr=rr.defaultView;if(Wr!==null)for(var{top:Ul,bottom:Jr}=br,Dn,_t,xr=g;xr!==null;){let dr=xr===rr.body;if(dr)Dn=0,_t=fn(o).innerHeight;else{let $o=xr.getBoundingClientRect();Dn=$o.top,_t=$o.bottom}let ci=0;if(Ul<Dn?ci=-(Dn-Ul):Jr>_t&&(ci=Jr-_t),ci!==0)if(dr)Wr.scrollBy(0,ci);else{let $o=xr.scrollTop;xr.scrollTop+=ci;let Ua=xr.scrollTop-$o;Ul-=Ua,Jr-=Ua}if(dr)break;xr=yr(xr)}}}El=!0}}else D!==null&&ot(o,Xn,Tn)&&Ar.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(),Rr=Xn.offset,Ti=Tn.getChildrenSize(),Tt=!1,ur=null;if(Rr===Ti){let br=Tn.getChildAtIndex(Rr-1);fo(br)&&(Tt=!0)}else{let br=Tn.getChildAtIndex(Rr);if(fo(br)){let rr=br.getPreviousSibling();(rr===null||fo(rr))&&(Tt=!0,ur=o.getElementByKey(br.__key))}}if(Tt){let br=o.getElementByKey(Tn.__key);if(mn===null){let rr=o._config.theme,Wr=document.createElement("div");Wr.contentEditable="false",Wr.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&&Wr.classList.add(...dr)}o._blockCursorElement=mn=Wr}g.style.caretColor="transparent",ur===null?br.appendChild(mn):br.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 Io=pt;let mn=Array.from(o._listeners.mutation),Xn=mn.length;for(let Tn=0;Tn<Xn;Tn++){let[Rr,Ti]=mn[Tn],Tt=Io.get(Ti);Tt!==void 0&&Rr(Tt,{dirtyLeaves:Yn,prevEditorState:x,updateTags:li})}}Mt(Q)||Q===null||D!==null&&D.is(Q)||o.dispatchCommand(e,void 0);var ko=o._pendingDecorators;ko!==null&&(o._decorators=ko,o._pendingDecorators=null,Ei("decorator",o,!0,ko));var Hc=It(i||x),Mr=It(a);if(Hc!==Mr&&Ei("textcontent",o,!0,Mr),Ei("update",o,!0,{dirtyElements:Dr,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 Po=o._updates;if(Po.length!==0){let mn=Po.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),ka(D,o),o._dirtyType!==0&&(C?bl(D,o):$a(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||j(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(),Ki(o);return}finally{gn=x,Wn=ge,On=Ae,o._updating=Ye,Wi=0}o._dirtyType!==0||kl(D,o)?D._flushSync?(D._flushSync=!1,Ki(o)):Q&&it(()=>{Ki(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 wo extends $s{constructor(i){super(i)}decorate(){j(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function En(o){return o instanceof wo}class zi 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&&j(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:mt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&j(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=qt(),C=i,x=a;var A=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!==A||a!==void 0&&a!==A)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(C===void 0&&(C=A),x===void 0&&(x=A),A=this.__key,Mt(g))g.anchor.set(A,C,"element"),g.focus.set(A,x,"element"),g.dirty=!0;else return Al(A,C,A,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(),A=this.getWritable(),Q=A.__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 Ot=pt.getNextSibling(),Ft=pt.__key;pt=pt.getWritable(),Nt(pt),Ae.push(Ft),pt=Ot}}for(Pe=Xe,Ot=0;Ot<C;Ot++){Ft=g[Ot],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),pt=Ft.getWritable(),pt.__parent===Q&&Ke--,Nt(pt);let zt=Ft.__key;Pe===null?(A.__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,A.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(a=Pe.getWritable(),i.__prev=Pe.__key,a.__next=Ye.__key):i.__prev=null),A.__size=Ke,Ae.length&&(i=qt(),Mt(i))){Ae=new Set(Ae),ge=new Set(ge);let{anchor:zt,focus:Yn}=i;Oo(zt,Ae,ge)&&us(zt,zt.getNode(),this,Xe,Ye),Oo(Yn,Ae,ge)&&us(Yn,Yn.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||or(this)||this.remove()}return A}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 zi}function Oo(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 zi{static getType(){return"root"}static clone(){return new cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!fs()&&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 Ui(){return new Us(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 Us{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 Us(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ll(this,()=>({root:Pl(bt())}))}}class Hr extends zi{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:Gs,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&ho(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 Gs(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 Do(o,i,a,g){let C=o._keyToDOMMap;C.clear(),o._editorState=Ui(),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 Ys(o,i){let a=new Map,g=new Set,C=x=>{Object.keys(x).forEach(A=>{let Q=a.get(A);Q===void 0&&(Q=[],a.set(A,Q)),Q.push(x[A])})};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,A,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=A,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 A=x[g];return A.add(a),()=>{A.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 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 A=Bt(this._config.theme,"root");var g=this._pendingEditorState||this._editorState;if(this._rootElement=i,Do(this,a,i,g),a!==null){if(!this._config.disableEvents){Ls!==0&&(Ls--,Ls===0&&a.ownerDocument.removeEventListener("selectionchange",Da));var C=a.__lexicalEditor;if(C!=null){if(C._parentEditor!==null){var x=pe(C);x=x[x.length-1]._key,os.get(x)===C&&os.delete(x)}else os.delete(C._key);a.__lexicalEditor=null}for(C=Oa(a),x=0;x<C.length;x++)C[x]();a.__lexicalEventHandles=[]}A!=null&&a.classList.remove(...A)}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"),Ki(this),this._config.disableEvents||$c(i,this),A!=null&&i.classList.add(...A)):(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),tn(this);let g=this._pendingEditorState,C=this._updateTags;a=a!==void 0?a.tag:null,g===null||g.isEmpty()||(a!=null&&C.add(a),Ki(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,a!=null&&C.add(a),Ki(this)}parseEditorState(i,a){i=typeof i=="string"?JSON.parse(i):i;let g=Ui(),C=gn,x=Wn,A=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{So(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=A}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=qt(),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 Ao extends zi{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 Gi(o){return o instanceof Ao}class $l extends zi{}function Fl(o){return o instanceof $l}class Fa extends zi{}function Bl(o){return o instanceof Fa}return We.$INTERNAL_isPointSelection=Bs,We.$addUpdateTag=function(o){Jn(),hn()._updateTags.add(o)},We.$applyNodeReplacement=Nr,We.$copyNode=Ai,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=Fi,We.$createTextNode=Un,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=sr,We.$getNodeByKey=mt,We.$getPreviousSelection=Er,We.$getRoot=bt,We.$getSelection=qt,We.$getTextContent=function(){let o=qt();return o===null?"":o.getTextContent()},We.$hasAncestor=Zn,We.$hasUpdateTag=function(o){return hn()._updateTags.has(o)},We.$insertNodes=function(o){let i=qt()||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)||Ii(o)||En(o)},We.$isLineBreakNode=Ii,We.$isNodeSelection=ar,We.$isParagraphNode=function(o){return o instanceof Hr},We.$isRangeSelection=Mt,We.$isRootNode=nr,We.$isRootOrShadowRoot=or,We.$isTabNode=Ra,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 So(o,hn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),rn(Le(o))},We.$setCompositionKey=gt,We.$setSelection=rn,We.$splitNode=function(o,i){let a=o.getChildAtIndex(i);a==null&&(a=o),or(o)&&Y(102);let g=A=>{const Q=A.getParentOrThrow(),ge=or(Q),Ae=A!==a||ge?Ai(A):A;if(ge){if(!Je(A)||!Je(Ae))throw Error("Children of a root must be ElementNode");return A.insertAfter(Ae),[A,Ae,Ae]}const[Ye,Xe,Ke]=g(Q);return A=A.getNextSiblings(),Ke.append(Ae,...A),[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=E,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 A=o[Ye];Bl(A)||Y(108);var Q=A.getChildren();A=0;for(let Xe of Q){for(Gi(Xe)||Y(109);g[Ye]!==void 0&&g[Ye][A]!==void 0;)A++;Q=Ye;var ge=A,Ae=Xe;let Ke={cell:Ae,startColumn:ge,startRow:Q},Pe=Ae.__rowSpan,pt=Ae.__colSpan;for(let Ot=0;Ot<Pe;Ot++){g[Q+Ot]===void 0&&(g[Q+Ot]=[]);for(let Ft=0;Ft<pt;Ft++)g[Q+Ot][ge+Ft]=Ke}i.is(Ae)&&(C=Ke),a.is(Ae)&&(x=Ke),A+=Xe.__colSpan}}return C===null&&Y(110),x===null&&Y(111),[g,C,x]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,a]=Ks(o);o=a.getChildren();let g=o.length;var C=o[0].getChildren().length;let x=Array(g);for(var A=0;A<g;A++)x[A]=Array(C);for(C=0;C<g;C++){A=o[C].getChildren();let Q=0;for(let ge=0;ge<A.length;ge++){for(;x[C][Q];)Q++;let Ae=A[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=Ks,We.DEPRECATED_$isGridCellNode=Gi,We.DEPRECATED_$isGridNode=Fl,We.DEPRECATED_$isGridRowNode=Bl,We.DEPRECATED_GridCellNode=Ao,We.DEPRECATED_GridNode=$l,We.DEPRECATED_GridRowNode=Fa,We.DRAGEND_COMMAND=Se,We.DRAGOVER_COMMAND=Te,We.DRAGSTART_COMMAND=q,We.DROP_COMMAND=z,We.DecoratorNode=wo,We.ElementNode=zi,We.FOCUS_COMMAND=D,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=T,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=l,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Fs,We.KEY_ARROW_DOWN_COMMAND=P,We.KEY_ARROW_LEFT_COMMAND=I,We.KEY_ARROW_RIGHT_COMMAND=m,We.KEY_ARROW_UP_COMMAND=k,We.KEY_BACKSPACE_COMMAND=re,We.KEY_DELETE_COMMAND=ce,We.KEY_DOWN_COMMAND=O,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=as,We.TextNode=$i,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,A=Ui(),Q=i.namespace||(C!==null?C._config.namespace:Ze()),ge=i.editorState,Ae=[cr,$i,qr,as,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 Ot=Pe.getType(),Ft=Pe.transform(),zt=new Set;Ft!==null&&zt.add(Ft),o.set(Ot,{exportDOM:Xe&&Xe.export?Xe.export.get(Pe):void 0,klass:Pe,replace:pt,replaceWithKlass:Ke,transforms:zt})}return g=new js(A,C,o,{disableEvents:x,namespace:Q,theme:g},Ye||console.error,Ys(o,Xe?Xe.import:void 0),i),ge!==void 0&&(g._pendingEditorState=ge,g._dirtyType=2),g},We.getNearestEditorFromDOMNode=St,We.isCurrentlyReadOnlyMode=fs,We.isHTMLAnchorElement=function(o){return ho(o)&&o.tagName==="A"},We.isHTMLElement=ho,We.isSelectionCapturedInDecoratorInput=st,We.isSelectionWithinEditor=ot,We}var eu,$f;function jt(){return $f||($f=1,eu=process.env.NODE_ENV==="development"?zN():UN()),eu}var Ff;function GN(){if(Ff)return Xc;Ff=1;var e=qn(),t=jt(),n=rt;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:E,children:T}){const S=n.useMemo(()=>{const{theme:w,namespace:O,editor__DEPRECATED:m,nodes:v,onError:I,editorState:G,html:k}=E,P=e.createLexicalComposerContext(null,w);let H=m||null;if(H===null){const j=t.createEditor({editable:E.editable,html:k,namespace:O,nodes:v,onError:re=>I(re,j),theme:w});_(j,G),H=j}return[H,P]},[]);return d(()=>{const w=E.editable,[O]=S;O.setEditable(w!==void 0?w:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:S},T)}function _(E,T){if(T!==null){if(T===void 0)E.update(()=>{const S=t.$getRoot();if(S.isEmpty()){const w=t.$createParagraphNode();S.append(w);const O=r?document.activeElement:null;(t.$getSelection()!==null||O!==null&&O===E.getRootElement())&&w.select()}},f);else if(T!==null)switch(typeof T){case"string":{const S=E.parseEditorState(T);E.setEditorState(S,f);break}case"object":{E.setEditorState(T,f);break}case"function":{E.update(()=>{t.$getRoot().isEmpty()&&T(E)},f);break}}}}return Xc.LexicalComposer=p,Xc}var tu={},Bf;function YN(){if(Bf)return tu;Bf=1;var e=qn(),t=jt(),n=rt;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 E=t.$getRoot();if(E.isEmpty()){let T=t.$createParagraphNode();E.append(T),E=r?document.activeElement:null,(t.$getSelection()!==null||E!==null&&E===p.getRootElement())&&T.select()}},d);else if(_!==null)switch(typeof _){case"string":let E=p.parseEditorState(_);p.setEditorState(E,d);break;case"object":p.setEditorState(_,d);break;case"function":p.update(()=>{t.$getRoot().isEmpty()&&_(p)},d)}}}return tu.LexicalComposer=function({initialConfig:p,children:_}){let E=n.useMemo(()=>{const{theme:T,namespace:S,editor__DEPRECATED:w,nodes:O,onError:m,editorState:v,html:I}=p,G=e.createLexicalComposerContext(null,T);let k=w||null;if(k===null){const P=t.createEditor({editable:p.editable,html:I,namespace:S,nodes:O,onError:H=>m(H,P),theme:T});f(P,v),k=P}return[k,G]},[]);return l(()=>{let T=p.editable,[S]=E;S.setEditable(T!==void 0?T:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:E},_)},tu}const jN=process.env.NODE_ENV==="development"?GN():YN();var VN=jN,nu={},ru,Hf;function qN(){if(Hf)return ru;Hf=1;var e=qn(),t=rt,l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function d(_){const[E]=e.useLexicalComposerContext(),T=t.useMemo(()=>_(E),[E,_]),S=t.useRef(T.initialValueFn()),[w,O]=t.useState(S.current);return l(()=>{const{initialValueFn:m,subscribe:v}=T,I=m();return S.current!==I&&(S.current=I,O(I)),v(G=>{S.current=G,O(G)})},[T,_]),w}function f(_){return{initialValueFn:()=>_.isEditable(),subscribe:E=>_.registerEditableListener(E)}}function p(){return d(f)}return ru=p,ru}var iu,Wf;function ZN(){if(Wf)return iu;Wf=1;var e=qn(),t=rt,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()),[E,T]=t.useState(_.current);return n(()=>{let{initialValueFn:S,subscribe:w}=p,O=S();return _.current!==O&&(_.current=O,T(O)),w(m=>{_.current=m,T(m)})},[p,d]),E}function l(d){return{initialValueFn:()=>d.isEditable(),subscribe:f=>d.registerEditableListener(f)}}return iu=function(){return r(l)},iu}var su,Kf;function xp(){return Kf||(Kf=1,su=process.env.NODE_ENV==="development"?qN():ZN()),su}var Ji={},zf;function JN(){if(zf)return Ji;zf=1;var e=jt();function t(_,E){let T=_.getFirstChild(),S=0;e:for(;T!==null;){if(e.$isElementNode(T)){const m=T.getFirstChild();if(m!==null){T=m;continue}}else if(e.$isTextNode(T)){const m=T.getTextContentSize();if(S+m>E)return{node:T,offset:E-S};S+=m}const w=T.getNextSibling();if(w!==null){T=w;continue}let O=T.getParent();for(;O!==null;){const m=O.getNextSibling();if(m!==null){T=m;continue e}O=O.getParent()}break}return null}function n(_,E=!0){if(_)return!1;let T=l();return E&&(T=T.trim()),T===""}function r(_,E){return()=>n(_,E)}function l(){return e.$getRoot().getTextContent()}function d(_){if(!n(_,!1))return!1;const T=e.$getRoot().getChildren(),S=T.length;if(S>1)return!1;for(let w=0;w<S;w++){const O=T[w];if(e.$isDecoratorNode(O))return!1;if(e.$isElementNode(O)){if(!e.$isParagraphNode(O)||O.__indent!==0)return!1;const m=O.getChildren(),v=m.length;for(let I=0;I<v;I++){const G=m[w];if(!e.$isTextNode(G))return!1}}}return!0}function f(_){return()=>d(_)}function p(_,E,T,S){const w=P=>P instanceof T,O=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=E(V);if(w(H))if(z===null||m(H)!==0){O(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=E(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=E(ce);if(Te===null){w(q)?O(q):q.markDirty();return}else if(Te.start!==0)return}}else{const q=E(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}},I=P=>{const H=P.getTextContent(),j=E(H);if(j===null||j.start!==0){O(P);return}if(H.length>j.end){P.splitText(j.end);return}const re=P.getPreviousSibling();e.$isTextNode(re)&&re.isTextEntity()&&(O(re),O(P));const te=P.getNextSibling();e.$isTextNode(te)&&te.isTextEntity()&&(O(te),w(P)&&O(P))},G=_.registerNodeTransform(e.TextNode,v),k=_.registerNodeTransform(T,I);return[G,k]}return Ji.$canShowPlaceholder=d,Ji.$canShowPlaceholderCurry=f,Ji.$findTextIntersectionFromCharacters=t,Ji.$isRootTextContentEmpty=n,Ji.$isRootTextContentEmptyCurry=r,Ji.$rootTextContent=l,Ji.registerLexicalTextEntity=p,Ji}var Xi={},Uf;function XN(){if(Uf)return Xi;Uf=1;var e=jt();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 E=0;E<_;E++)if(!e.$isTextNode(f[p]))return!1}}return!0}return Xi.$canShowPlaceholder=r,Xi.$canShowPlaceholderCurry=function(l){return()=>r(l)},Xi.$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},Xi.$isRootTextContentEmpty=t,Xi.$isRootTextContentEmptyCurry=function(l,d){return()=>t(l,d)},Xi.$rootTextContent=n,Xi.registerLexicalTextEntity=function(l,d,f,p){let _=T=>{const S=e.$createTextNode(T.getTextContent());S.setFormat(T.getFormat()),T.replace(S)},E=l.registerNodeTransform(e.TextNode,T=>{if(T.isSimpleText()){var S=T.getPreviousSibling(),w=T.getTextContent(),O=T;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){O=w.slice(0,v),O=m+O,S.select(),S.setTextContent(O),v===w.length?T.remove():(S=w.slice(v),T.setTextContent(S));return}}else if(v===null||v.start<m.length)return}for(;;){if(T=d(w),w=v=T===null?"":w.slice(T.end),v===""){if(m=O.getNextSibling(),e.$isTextNode(m)){if(v=O.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(T===null)break;if(T.start===0&&e.$isTextNode(S)&&S.isTextEntity())continue;let I;if(T.start===0?[I,O]=O.splitText(T.end):[,I,O]=O.splitText(T.start,T.end),T=p(I),T.setFormat(I.getFormat()),I.replace(T),O==null)break}}});return l=l.registerNodeTransform(f,T=>{var S=T.getTextContent();const w=d(S);w===null||w.start!==0?_(T):S.length>w.end?T.splitText(w.end):(S=T.getPreviousSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),_(T)),S=T.getNextSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),T instanceof f&&_(T)))}),[E,l]},Xi}var ou,Gf;function vp(){return Gf||(Gf=1,ou=process.env.NODE_ENV==="development"?JN():XN()),ou}var Sn={},jn={},Yf;function QN(){if(Yf)return jn;Yf=1;var e=jt();const t=new Map;function n(K){let D=K;for(;D!=null;){if(D.nodeType===Node.TEXT_NODE)return D;D=D.firstChild}return null}function r(K){const D=K.parentNode;if(D==null)throw new Error("Should never happen");return[D,Array.from(D.childNodes).indexOf(K)]}function l(K,D,Z,oe,Y){const W=D.getKey(),J=oe.getKey(),R=document.createRange();let U=K.getElementByKey(W),X=K.getElementByKey(J),fe=Z,_e=Y;if(e.$isTextNode(D)&&(U=n(U)),e.$isTextNode(oe)&&(X=n(X)),D===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,D){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(D.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 D={},Z=K.split(";");for(const oe of Z)if(oe!==""){const[Y,W]=oe.split(/:([^]+)/);Y&&W&&(D[Y.trim()]=W.trim())}return D}function p(K){let D=t.get(K);return D===void 0&&(D=f(K),t.set(K,D)),Object.freeze(D),D}function _(K){let D="";for(const Z in K)Z&&(D+=`${Z}: ${K[Z]};`);return D}function E(K,D){return K.__first=D.__first,K.__last=D.__last,K.__size=D.__size,K.__format=D.__format,K.__indent=D.__indent,K.__dir=D.__dir,K}function T(K,D){return K.__format=D.__format,K.__style=D.__style,K.__mode=D.__mode,K.__detail=D.__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)?E(Z,K):e.$isTextNode(K)&&e.$isTextNode(Z)?T(Z,K):Z}function w(K,D){if(D.isSelected(K)&&!D.isSegmented()&&!D.isToken()&&e.$INTERNAL_isPointSelection(K)){const Z=K.anchor.getNode(),oe=K.focus.getNode(),Y=D.is(Z),W=D.is(oe);if(Y||W){const J=K.isBackward(),[R,U]=K.getCharacterOffsets(),X=Z.is(oe),fe=D.is(J?oe:Z),_e=D.is(J?Z:oe);let B=0,M;if(X)B=R>U?U:R,M=R>U?R:U;else if(fe)B=J?U:R,M=void 0;else if(_e){const F=J?R:U;B=0,M=F}return D.__text=D.__text.slice(B,M),D}}return D}function O(K){if(K.type==="text")return K.offset===K.getNode().getTextContentSize();const D=K.getNode();if(!e.$isElementNode(D))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return K.offset===D.getChildrenSize()}function m(K,D,Z){let oe=D.getNode(),Y=Z;if(e.$isElementNode(oe)){const W=oe.getDescendantByIndex(D.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=qt(),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&&j(100);var Ot=pt.getNextSibling(),Ft=pt.__key;pt=pt.getWritable(),Nt(pt),Ae.push(Ft),pt=Ot}}for(Pe=Xe,Ot=0;Ot<C;Ot++){Ft=g[Ot],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&&j(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=qt(),Mt(i))){Ae=new Set(Ae),ge=new Set(ge);let{anchor:zt,focus:Yn}=i;Oo(zt,Ae,ge)&&ds(zt,zt.getNode(),this,Xe,Ye),Oo(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 zi}function Oo(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 zi{static getType(){return"root"}static clone(){return new cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){j(51)}getTextContent(){let i=this.__cachedText;return!hs()&&hn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){j(52)}replace(){j(53)}insertBefore(){j(54)}insertAfter(){j(55)}updateDOM(){return!1}append(...i){for(let a=0;a<i.length;a++){let g=i[a];Je(g)||En(g)||j(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 Ui(){return new Gs(new Map([["root",new cr]]))}function Pl(o){let i=o.exportJSON();var a=o.constructor;if(i.type!==a.getType()&&j(130,a.name),Je(o)){let g=i.children;for(Array.isArray(g)||j(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 Br extends zi{static getType(){return"paragraph"}static clone(i){return new Br(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&&ho(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=Hr();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=Hr();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=Hr();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Hr(){return Nr(new Br)}function Do(o,i,a,g){let C=o._keyToDOMMap;C.clear(),o._editorState=Ui(),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&&j(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&&j(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&&j(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&&j(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 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,Do(this,a,i,g),a!==null){if(!this._config.disableEvents){Is!==0&&(Is--,Is===0&&a.ownerDocument.removeEventListener("selectionchange",Da));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=Oa(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"),Ki(this),this._config.disableEvents||Fc(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()&&j(38),tn(this);let g=this._pendingEditorState,C=this._updateTags;a=a!==void 0?a.tag:null,g===null||g.isEmpty()||(a!=null&&C.add(a),Ki(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,a!=null&&C.add(a),Ki(this)}parseEditorState(i,a){i=typeof i=="string"?JSON.parse(i):i;let g=Ui(),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{So(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=qt(),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=Yr(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 Ao extends zi{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 Gi(o){return o instanceof Ao}class $l extends zi{}function Fl(o){return o instanceof $l}class Fa extends zi{}function Bl(o){return o instanceof Fa}return We.$INTERNAL_isPointSelection=Hs,We.$addUpdateTag=function(o){Jn(),hn()._updateTags.add(o)},We.$applyNodeReplacement=Nr,We.$copyNode=Ai,We.$createLineBreakNode=qr,We.$createNodeSelection=Ml,We.$createParagraphNode=Hr,We.$createPoint=$r,We.$createRangeSelection=function(){let o=$r("root",0,"element"),i=$r("root",0,"element");return new Ni(o,i,0,"")},We.$createTabNode=Fi,We.$createTextNode=Un,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=sr,We.$getNodeByKey=mt,We.$getPreviousSelection=Er,We.$getRoot=bt,We.$getSelection=qt,We.$getTextContent=function(){let o=qt();return o===null?"":o.getTextContent()},We.$hasAncestor=Zn,We.$hasUpdateTag=function(o){return hn()._updateTags.has(o)},We.$insertNodes=function(o){let i=qt()||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)||Ii(o)||En(o)},We.$isLineBreakNode=Ii,We.$isNodeSelection=ar,We.$isParagraphNode=function(o){return o instanceof Br},We.$isRangeSelection=Mt,We.$isRootNode=nr,We.$isRootOrShadowRoot=or,We.$isTabNode=Ra,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=Fr();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=Ie,We.$parseSerializedNode=function(o){return So(o,hn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),rn(Ie(o))},We.$setCompositionKey=gt,We.$setSelection=rn,We.$splitNode=function(o,i){let a=o.getChildAtIndex(i);a==null&&(a=o),or(o)&&j(102);let g=D=>{const Q=D.getParentOrThrow(),ge=or(Q),Ae=D!==a||ge?Ai(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=Te,We.CUT_COMMAND=de,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=E,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)||j(108);var Q=D.getChildren();D=0;for(let Xe of Q){for(Gi(Xe)||j(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 Ot=0;Ot<Pe;Ot++){g[Q+Ot]===void 0&&(g[Q+Ot]=[]);for(let Ft=0;Ft<pt;Ft++)g[Q+Ot][ge+Ft]=Ke}i.is(Ae)&&(C=Ke),a.is(Ae)&&(x=Ke),D+=Xe.__colSpan}}return C===null&&j(110),x===null&&j(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=Gi,We.DEPRECATED_$isGridNode=Fl,We.DEPRECATED_$isGridRowNode=Bl,We.DEPRECATED_GridCellNode=Ao,We.DEPRECATED_GridNode=$l,We.DEPRECATED_GridRowNode=Fa,We.DRAGEND_COMMAND=Se,We.DRAGOVER_COMMAND=Ee,We.DRAGSTART_COMMAND=V,We.DROP_COMMAND=H,We.DecoratorNode=wo,We.ElementNode=zi,We.FOCUS_COMMAND=O,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=T,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=k,We.KEY_ARROW_LEFT_COMMAND=I,We.KEY_ARROW_RIGHT_COMMAND=m,We.KEY_ARROW_UP_COMMAND=P,We.KEY_BACKSPACE_COMMAND=re,We.KEY_DELETE_COMMAND=ue,We.KEY_DOWN_COMMAND=M,We.KEY_ENTER_COMMAND=W,We.KEY_ESCAPE_COMMAND=te,We.KEY_MODIFIER_COMMAND=oe,We.KEY_SPACE_COMMAND=Y,We.KEY_TAB_COMMAND=q,We.LineBreakNode=Vr,We.MOVE_TO_END=v,We.MOVE_TO_START=G,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=f,We.ParagraphNode=Br,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=z,We.TabNode=cs,We.TextNode=$i,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=Ui(),Q=i.namespace||(C!==null?C._config.namespace:Ze()),ge=i.editorState,Ae=[cr,$i,Vr,cs,Br,...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 Ot=Pe.getType(),Ft=Pe.transform(),zt=new Set;Ft!==null&&zt.add(Ft),o.set(Ot,{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=St,We.isCurrentlyReadOnlyMode=hs,We.isHTMLAnchorElement=function(o){return ho(o)&&o.tagName==="A"},We.isHTMLElement=ho,We.isSelectionCapturedInDecoratorInput=st,We.isSelectionWithinEditor=ot,We}var tu,Bf;function jt(){return Bf||(Bf=1,tu=process.env.NODE_ENV==="development"?YN():jN()),tu}var Hf;function VN(){if(Hf)return Qc;Hf=1;var e=qn(),t=jt(),n=rt;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:E,children:T}){const S=n.useMemo(()=>{const{theme:w,namespace:M,editor__DEPRECATED:m,nodes:v,onError:I,editorState:G,html:P}=E,k=e.createLexicalComposerContext(null,w);let W=m||null;if(W===null){const Y=t.createEditor({editable:E.editable,html:P,namespace:M,nodes:v,onError:re=>I(re,Y),theme:w});_(Y,G),W=Y}return[W,k]},[]);return d(()=>{const w=E.editable,[M]=S;M.setEditable(w!==void 0?w:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:S},T)}function _(E,T){if(T!==null){if(T===void 0)E.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===E.getRootElement())&&w.select()}},f);else if(T!==null)switch(typeof T){case"string":{const S=E.parseEditorState(T);E.setEditorState(S,f);break}case"object":{E.setEditorState(T,f);break}case"function":{E.update(()=>{t.$getRoot().isEmpty()&&T(E)},f);break}}}}return Qc.LexicalComposer=p,Qc}var nu={},Wf;function qN(){if(Wf)return nu;Wf=1;var e=qn(),t=jt(),n=rt;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 E=t.$getRoot();if(E.isEmpty()){let T=t.$createParagraphNode();E.append(T),E=r?document.activeElement:null,(t.$getSelection()!==null||E!==null&&E===p.getRootElement())&&T.select()}},d);else if(_!==null)switch(typeof _){case"string":let E=p.parseEditorState(_);p.setEditorState(E,d);break;case"object":p.setEditorState(_,d);break;case"function":p.update(()=>{t.$getRoot().isEmpty()&&_(p)},d)}}}return nu.LexicalComposer=function({initialConfig:p,children:_}){let E=n.useMemo(()=>{const{theme:T,namespace:S,editor__DEPRECATED:w,nodes:M,onError:m,editorState:v,html:I}=p,G=e.createLexicalComposerContext(null,T);let P=w||null;if(P===null){const k=t.createEditor({editable:p.editable,html:I,namespace:S,nodes:M,onError:W=>m(W,k),theme:T});f(k,v),P=k}return[P,G]},[]);return l(()=>{let T=p.editable,[S]=E;S.setEditable(T!==void 0?T:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:E},_)},nu}const ZN=process.env.NODE_ENV==="development"?VN():qN();var JN=ZN,ru={},iu,Kf;function XN(){if(Kf)return iu;Kf=1;var e=qn(),t=rt,l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function d(_){const[E]=e.useLexicalComposerContext(),T=t.useMemo(()=>_(E),[E,_]),S=t.useRef(T.initialValueFn()),[w,M]=t.useState(S.current);return l(()=>{const{initialValueFn:m,subscribe:v}=T,I=m();return S.current!==I&&(S.current=I,M(I)),v(G=>{S.current=G,M(G)})},[T,_]),w}function f(_){return{initialValueFn:()=>_.isEditable(),subscribe:E=>_.registerEditableListener(E)}}function p(){return d(f)}return iu=p,iu}var su,zf;function QN(){if(zf)return su;zf=1;var e=qn(),t=rt,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()),[E,T]=t.useState(_.current);return n(()=>{let{initialValueFn:S,subscribe:w}=p,M=S();return _.current!==M&&(_.current=M,T(M)),w(m=>{_.current=m,T(m)})},[p,d]),E}function l(d){return{initialValueFn:()=>d.isEditable(),subscribe:f=>d.registerEditableListener(f)}}return su=function(){return r(l)},su}var ou,Uf;function wp(){return Uf||(Uf=1,ou=process.env.NODE_ENV==="development"?XN():QN()),ou}var Ji={},Gf;function eC(){if(Gf)return Ji;Gf=1;var e=jt();function t(_,E){let T=_.getFirstChild(),S=0;e:for(;T!==null;){if(e.$isElementNode(T)){const m=T.getFirstChild();if(m!==null){T=m;continue}}else if(e.$isTextNode(T)){const m=T.getTextContentSize();if(S+m>E)return{node:T,offset:E-S};S+=m}const w=T.getNextSibling();if(w!==null){T=w;continue}let M=T.getParent();for(;M!==null;){const m=M.getNextSibling();if(m!==null){T=m;continue e}M=M.getParent()}break}return null}function n(_,E=!0){if(_)return!1;let T=l();return E&&(T=T.trim()),T===""}function r(_,E){return()=>n(_,E)}function l(){return e.$getRoot().getTextContent()}function d(_){if(!n(_,!1))return!1;const T=e.$getRoot().getChildren(),S=T.length;if(S>1)return!1;for(let w=0;w<S;w++){const M=T[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 I=0;I<v;I++){const G=m[w];if(!e.$isTextNode(G))return!1}}}return!0}function f(_){return()=>d(_)}function p(_,E,T,S){const w=k=>k instanceof T,M=k=>{const W=e.$createTextNode(k.getTextContent());W.setFormat(k.getFormat()),k.replace(W)},m=k=>k.getLatest().__mode,v=k=>{if(!k.isSimpleText())return;const W=k.getPreviousSibling();let Y=k.getTextContent(),re=k,te;if(e.$isTextNode(W)){const ue=W.getTextContent(),q=ue+Y,H=E(q);if(w(W))if(H===null||m(W)!==0){M(W);return}else{const V=H.end-ue.length;if(V>0){const Ee=Y.slice(0,V),Se=ue+Ee;if(W.select(),W.setTextContent(Se),V===Y.length)k.remove();else{const Te=Y.slice(V);k.setTextContent(Te)}return}}else if(H===null||H.start<ue.length)return}for(;;){te=E(Y);let ue=te===null?"":Y.slice(te.end);if(Y=ue,ue===""){const V=re.getNextSibling();if(e.$isTextNode(V)){ue=re.getTextContent()+V.getTextContent();const Ee=E(ue);if(Ee===null){w(V)?M(V):V.markDirty();return}else if(Ee.start!==0)return}}else{const V=E(ue);if(V!==null&&V.start===0)return}if(te===null)return;if(te.start===0&&e.$isTextNode(W)&&W.isTextEntity())continue;let q;te.start===0?[q,re]=re.splitText(te.end):[,q,re]=re.splitText(te.start,te.end);const H=S(q);if(H.setFormat(q.getFormat()),q.replace(H),re==null)return}},I=k=>{const W=k.getTextContent(),Y=E(W);if(Y===null||Y.start!==0){M(k);return}if(W.length>Y.end){k.splitText(Y.end);return}const re=k.getPreviousSibling();e.$isTextNode(re)&&re.isTextEntity()&&(M(re),M(k));const te=k.getNextSibling();e.$isTextNode(te)&&te.isTextEntity()&&(M(te),w(k)&&M(k))},G=_.registerNodeTransform(e.TextNode,v),P=_.registerNodeTransform(T,I);return[G,P]}return Ji.$canShowPlaceholder=d,Ji.$canShowPlaceholderCurry=f,Ji.$findTextIntersectionFromCharacters=t,Ji.$isRootTextContentEmpty=n,Ji.$isRootTextContentEmptyCurry=r,Ji.$rootTextContent=l,Ji.registerLexicalTextEntity=p,Ji}var Xi={},Yf;function tC(){if(Yf)return Xi;Yf=1;var e=jt();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 E=0;E<_;E++)if(!e.$isTextNode(f[p]))return!1}}return!0}return Xi.$canShowPlaceholder=r,Xi.$canShowPlaceholderCurry=function(l){return()=>r(l)},Xi.$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},Xi.$isRootTextContentEmpty=t,Xi.$isRootTextContentEmptyCurry=function(l,d){return()=>t(l,d)},Xi.$rootTextContent=n,Xi.registerLexicalTextEntity=function(l,d,f,p){let _=T=>{const S=e.$createTextNode(T.getTextContent());S.setFormat(T.getFormat()),T.replace(S)},E=l.registerNodeTransform(e.TextNode,T=>{if(T.isSimpleText()){var S=T.getPreviousSibling(),w=T.getTextContent(),M=T;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?T.remove():(S=w.slice(v),T.setTextContent(S));return}}else if(v===null||v.start<m.length)return}for(;;){if(T=d(w),w=v=T===null?"":w.slice(T.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(T===null)break;if(T.start===0&&e.$isTextNode(S)&&S.isTextEntity())continue;let I;if(T.start===0?[I,M]=M.splitText(T.end):[,I,M]=M.splitText(T.start,T.end),T=p(I),T.setFormat(I.getFormat()),I.replace(T),M==null)break}}});return l=l.registerNodeTransform(f,T=>{var S=T.getTextContent();const w=d(S);w===null||w.start!==0?_(T):S.length>w.end?T.splitText(w.end):(S=T.getPreviousSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),_(T)),S=T.getNextSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),T instanceof f&&_(T)))}),[E,l]},Xi}var lu,jf;function Op(){return jf||(jf=1,lu=process.env.NODE_ENV==="development"?eC():tC()),lu}var Sn={},jn={},Vf;function nC(){if(Vf)return jn;Vf=1;var e=jt();const t=new Map;function n(z){let O=z;for(;O!=null;){if(O.nodeType===Node.TEXT_NODE)return O;O=O.firstChild}return null}function r(z){const O=z.parentNode;if(O==null)throw new Error("Should never happen");return[O,Array.from(O.childNodes).indexOf(z)]}function l(z,O,Z,oe,j){const K=O.getKey(),J=oe.getKey(),R=document.createRange();let U=z.getElementByKey(K),X=z.getElementByKey(J),fe=Z,_e=j;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||K!==J)&&(R.setStart(X,_e),R.setEnd(U,fe)),R}function d(z,O){const Z=z.getRootElement();if(Z===null)return[];const oe=Z.getBoundingClientRect(),j=getComputedStyle(Z),K=parseFloat(j.paddingLeft)+parseFloat(j.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+K===oe.width;if(_e||B){J.splice(X--,1),R--;continue}U=fe}return J}function f(z){const O={},Z=z.split(";");for(const oe of Z)if(oe!==""){const[j,K]=oe.split(/:([^]+)/);j&&K&&(O[j.trim()]=K.trim())}return O}function p(z){let O=t.get(z);return O===void 0&&(O=f(z),t.set(z,O)),Object.freeze(O),O}function _(z){let O="";for(const Z in z)Z&&(O+=`${Z}: ${z[Z]};`);return O}function E(z,O){return z.__first=O.__first,z.__last=O.__last,z.__size=O.__size,z.__format=O.__format,z.__indent=O.__indent,z.__dir=O.__dir,z}function T(z,O){return z.__format=O.__format,z.__style=O.__style,z.__mode=O.__mode,z.__detail=O.__detail,z}function S(z){const Z=z.constructor.clone(z);return Z.__parent=z.__parent,Z.__next=z.__next,Z.__prev=z.__prev,e.$isElementNode(z)&&e.$isElementNode(Z)?E(Z,z):e.$isTextNode(z)&&e.$isTextNode(Z)?T(Z,z):Z}function w(z,O){if(O.isSelected(z)&&!O.isSegmented()&&!O.isToken()&&e.$INTERNAL_isPointSelection(z)){const Z=z.anchor.getNode(),oe=z.focus.getNode(),j=O.is(Z),K=O.is(oe);if(j||K){const J=z.isBackward(),[R,U]=z.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(z){if(z.type==="text")return z.offset===z.getNode().getTextContentSize();const O=z.getNode();if(!e.$isElementNode(O))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return z.offset===O.getChildrenSize()}function m(z,O,Z){let oe=O.getNode(),j=Z;if(e.$isElementNode(oe)){const K=oe.getDescendantByIndex(O.offset);K!==null&&(oe=K)}for(;j>0&&oe!==null;){if(e.$isElementNode(oe)){const X=oe.getLastDescendant();X!==null&&(oe=X)}let K=oe.getPreviousSibling(),J=0;if(K===null){let X=oe.getParentOrThrow(),fe=X.getPreviousSibling();for(;fe===null;){if(X=X.getParent(),X===null){K=null;break}fe=X.getPreviousSibling()}X!==null&&(J=X.isInline()?0:2,K=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 M=e.$getNodeByKey(X);return e.$isTextNode(M)&&M.isSimpleText()?M.getTextContent():null}),_e=U-Y,B=R.slice(0,_e);if(fe!==null&&fe!==R){const M=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(M)&&M.isCollapsed()){const se=M.anchor.offset;F.select(se,se)}}else if(oe.isSimpleText()){const M=D.key===X;let F=D.offset;F<Y&&(F=U);const se=M?F-Y:0,ye=M?F:_e;if(M&&se===0){const[De]=oe.splitText(se,ye);De.remove()}else{const[,De]=oe.splitText(se,ye);De.remove()}}else{const M=e.$createTextNode(B);oe.replace(M)}Y=0}}}function v(K){const D=K.getStyle(),Z=f(D);t.set(D,Z)}function I(K,D){const Z=p("getStyle"in K?K.getStyle():K.style),oe=Object.entries(D).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,D){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),D))}e.$setSelection(K);return}const Y=oe-1;let W=Z[0],J=Z[Y];if(K.isCollapsed()&&e.$isRangeSelection(K)){I(K,D);return}const R=K.anchor,U=K.focus,fe=W.getTextContent().length,_e=U.offset;let B=R.offset;const M=R.isBefore(U);let F=M?B:_e,se=M?_e:B;const ye=M?R.type:U.type,De=M?U.type:R.type,ee=M?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)I(W,D),W.select(F,se);else{const ne=W.splitText(F,se),ue=F===0?ne[0]:ne[1];I(ue,D),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")),I(W,D)),e.$isTextNode(J)){const ue=J.getTextContent().length;J.__key!==ee&&se!==0&&(se=ue),se!==ue&&([J]=J.splitText(se)),se!==0&&I(J,D)}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()&&I(ue,D)}}}function k(K,D){if(K.anchor.key==="root"){const Y=D(),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=D();J.setFormat(W.getFormatType()),J.setIndent(W.getIndent()),W.replace(J,!0)}}function P(K){return K.getNode().isAttached()}function H(K){let D=K;for(;D!==null&&!e.$isRootOrShadowRoot(D);){const Z=D.getLatest(),oe=D.getParent();Z.getChildrenSize()===0&&D.remove(!0),D=oe}}function j(K,D,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=D();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,D,Z),R=[],J=X):J===null||J!==null&&e.$hasAncestor(X,J)?R.push(X):(re(K,R,R.length,D,Z),R=[X])}re(K,R,R.length,D,Z)}function re(K,D,Z,oe,Y=null){if(D.length===0)return;const W=D[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=D[F];e.$isElementNode(se)&&se.getChildrenSize()===0&&fe.add(se.getKey())}const _e=new Set;for(let F=0;F<Z;F++){const se=D[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 M=e.$getPreviousSelection();e.$isRangeSelection(M)&&P(M.anchor)&&P(M.focus)?e.$setSelection(M.clone()):B!==null?B.selectEnd():K.dirty=!0}function te(K,D){const Z=e.$getAdjacentNode(K.focus,D);return e.$isDecoratorNode(Z)&&!Z.isIsolated()||e.$isElementNode(Z)&&!Z.isInline()&&!Z.canBeEmpty()}function ce(K,D,Z,oe){K.modify(D?"extend":"move",Z,oe)}function V(K){const D=K.anchor.getNode();return(e.$isRootNode(D)?D:D.getParentOrThrow()).getDirection()==="rtl"}function z(K,D,Z){const oe=V(K);ce(K,D,Z?!oe:oe,"character")}function q(K){const D=K.anchor,Z=K.focus,W=D.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&&(D.set(J.getKey(),0,U),Z.set(R.getKey(),fe,X))}function Te(K,D,Z){const oe=K.getStyle(),Y=p(oe);return Y!==null&&Y[D]||Z}function Se(K,D,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&&D in _e)return _e[D]}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,D,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 D=K.getFirstChild(),Z=D===null||e.$isLineBreakNode(D)||e.$isTextNode(D)||D.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&Z}function de(K,D){let Z=K;for(;Z!==null&&Z.getParent()!==null&&!D(Z);)Z=Z.getParentOrThrow();return D(Z)?Z:null}return jn.$addNodeStyle=v,jn.$cloneWithProperties=S,jn.$getSelectionStyleValueForProperty=Se,jn.$isAtNodeEnd=O,jn.$isParentElementRTL=V,jn.$moveCaretSelection=ce,jn.$moveCharacter=z,jn.$patchStyleText=G,jn.$selectAll=q,jn.$setBlocksType=k,jn.$shouldOverrideDefaultCharacterSelection=te,jn.$sliceSelectedTextNodeContent=w,jn.$wrapNodes=j,jn.createDOMRange=l,jn.createRectsFromDOMRange=d,jn.getStyleObjectFromCSS=p,jn.trimTextContentFromAnchor=m,jn}var Vn={},jf;function eC(){if(jf)return Vn;jf=1;var e=jt();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 I of m)if(I!==""){let[G,k]=I.split(/:([^]+)/);G&&k&&(v[G.trim()]=k.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 I in m)I&&(v+=`${I}: ${m[I]};`);return v}function p(m,v){var I=d("getStyle"in m?m.getStyle():m.style);v=Object.entries(v).reduce((G,[k,P])=>(P===null?delete G[k]:G[k]=P,G),{...I}),I=f(v),m.setStyle(I),t.set(I,v)}function _(m,v){var I=m.getNodes(),G=I.length;if(e.$isRangeSelection(m)){--G;var k=I[0],P=I[G];if(m.isCollapsed()&&e.$isRangeSelection(m))p(m,v);else{var H=m.anchor,j=m.focus,re=k.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(k)&&z===re&&(V=k.getNextSibling(),e.$isTextNode(V)&&(z=ce=0,k=V)),I.length===1)e.$isTextNode(k)&&(z=q==="element"?0:ce>te?te:ce,m=Te==="element"?re:ce>te?ce:te,z!==m&&(z===0&&m===re?(p(k,v),k.select(z,m)):(I=k.splitText(z,m),I=z===0?I[0]:I[1],p(I,v),I.select(0,m-z))));else for(e.$isTextNode(k)&&z<k.getTextContentSize()&&(z!==0&&(k=k.splitText(z)[1],z=0,H.set(k.getKey(),z,"text")),p(k,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=I[m],H=z.getKey(),e.$isTextNode(z)&&H!==k.getKey()&&H!==P.getKey()&&!z.isToken()&&p(z,v)}}else{for(k=e.$createRangeSelection(),P=k.anchor,z=k.focus,H=0;H<G;H++)re=I[H],e.DEPRECATED_$isGridCellNode(re)&&(P.set(re.getKey(),0,"element"),z.set(re.getKey(),re.getChildrenSize(),"element"),_(e.$normalizeSelection__EXPERIMENTAL(k),v));e.$setSelection(m)}}function E(m){for(;m!==null&&!e.$isRootOrShadowRoot(m);){let v=m.getLatest(),I=m.getParent();v.getChildrenSize()===0&&m.remove(!0),m=I}}function T(m,v,I,G,k=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<I;ce++){var V=v[ce];e.$isElementNode(V)&&V.getChildrenSize()===0&&te.add(V.getKey())}var z=new Set;for(ce=0;ce<I;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))}),E(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(k!==null)for(v=0;v<j.length;v++)k.append(j[v]);if(v=null,e.$isRootOrShadowRoot(P))if(re)if(k!==null)P.insertAfter(k);else for(k=j.length-1;0<=k;k--)P.insertAfter(j[k]);else if(re=P.getFirstChild(),e.$isElementNode(re)&&(P=re),re===null)if(k)P.append(k);else for(k=0;k<j.length;k++)re=j[k],P.append(re),v=re;else if(k!==null)re.insertBefore(k);else for(P=0;P<j.length;P++)k=j[P],re.insertBefore(k),v=k;else if(k)P.insertAfter(k);else for(k=j.length-1;0<=k;k--)re=j[k],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,I,G){m.modify(v?"extend":"move",I,G)}function w(m){return m=m.anchor.getNode(),(e.$isRootNode(m)?m:m.getParentOrThrow()).getDirection()==="rtl"}function O(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,I=""){let G=null,k=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<k.length;m++){var te=k[m];if((m===0||re!==0||!te.is(P))&&e.$isTextNode(te)){if(H=v,j=I,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?I: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,I){let G=w(m);S(m,v,I?!G:G,"character")},Vn.$patchStyleText=_,Vn.$selectAll=function(m){let v=m.anchor;m=m.focus;var I=v.getNode().getTopLevelElementOrThrow().getParentOrThrow();let G=I.getFirstDescendant();I=I.getLastDescendant();let k="element",P="element",H=0;e.$isTextNode(G)?k="text":e.$isElementNode(G)||G===null||(G=G.getParentOrThrow()),e.$isTextNode(I)?(P="text",H=I.getTextContentSize()):e.$isElementNode(I)||I===null||(I=I.getParentOrThrow()),G&&I&&(v.set(G.getKey(),0,k),m.set(I.getKey(),H,P))},Vn.$setBlocksType=function(m,v){if(m.anchor.key==="root"){v=v();var I=e.$getRoot();(m=I.getFirstChild())?m.replace(v,!0):I.append(v)}else{for(I=m.getNodes(),m=m.anchor.getNode();m!==null&&m.getParent()!==null&&!O(m);)m=m.getParentOrThrow();for((m=O(m)?m:null)&&I.indexOf(m)===-1&&I.push(m),m=0;m<I.length;m++){let G=I[m];if(!O(G))continue;if(!e.$isElementNode(G))throw Error("Expected block node to be an ElementNode");let k=v();k.setFormat(G.getFormatType()),k.setIndent(G.getIndent()),G.replace(k,!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 I=m.anchor.getNode(),G=m.focus.getNode(),k=v.is(I),P=v.is(G);if(k||P){k=m.isBackward();let[H,j]=m.getCharacterOffsets();m=I.is(G),P=v.is(k?G:I),G=v.is(k?I:G),I=0;let re;m?(I=H>j?j:H,re=H>j?H:j):P?(I=k?j:H,re=void 0):G&&(k=k?H:j,I=0,re=k),v.__text=v.__text.slice(I,re)}}return v},Vn.$wrapNodes=function(m,v,I=null){var G=m.getNodes();let k=G.length;var P=m.anchor;if(k===0||k===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)),I&&(j=I.append(j)),m.replace(j)}else{P=null;var H=[];for(let j=0;j<k;j++){let re=G[j];e.$isRootOrShadowRoot(re)?(T(m,H,H.length,v,I),H=[],P=re):P===null||P!==null&&e.$hasAncestor(re,P)?H.push(re):(T(m,H,H.length,v,I),H=[re])}T(m,H,H.length,v,I)}},Vn.createDOMRange=function(m,v,I,G,k){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,I]=r(re)),m.nodeName==="BR"&&([m,k]=r(m)),v=re.firstChild,re===m&&v!=null&&v.nodeName==="BR"&&I===0&&k===0&&(k=1);try{j.setStart(re,I),j.setEnd(m,k)}catch{return null}return!j.collapsed||I===k&&P===H||(j.setStart(m,k),j.setEnd(re,I)),j},Vn.createRectsFromDOMRange=function(m,v){var I=m.getRootElement();if(I===null)return[];m=I.getBoundingClientRect(),I=getComputedStyle(I),I=parseFloat(I.paddingLeft)+parseFloat(I.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 k;for(let P=0;P<G;P++){let H=v[P],j=H.width+I===m.width;k&&k.top<=H.top&&k.top+k.height>H.top&&k.left+k.width>H.left||j?(v.splice(P--,1),G--):k=H}return v},Vn.getStyleObjectFromCSS=d,Vn.trimTextContentFromAnchor=function(m,v,I){let G=v.getNode();if(e.$isElementNode(G)){var k=G.getDescendantByIndex(v.offset);k!==null&&(G=k)}for(;0<I&&G!==null;){e.$isElementNode(G)&&(k=G.getLastDescendant(),k!==null&&(G=k));var P=G.getPreviousSibling(),H=0;if(P===null){k=G.getParentOrThrow();for(var j=k.getPreviousSibling();j===null;){if(k=k.getParent(),k===null){P=null;break}j=k.getPreviousSibling()}k!==null&&(H=k.isInline()?0:2,P=j)}if(j=G.getTextContent(),j===""&&e.$isElementNode(G)&&!G.isInline()&&(j=`
|
|
72
|
+
`);const U=R.length;if(!e.$isTextNode(oe)||j>=U){const X=oe.getParent();oe.remove(),X!=null&&X.getChildrenSize()===0&&!e.$isRootNode(X)&&X.remove(),j-=U+J,oe=K}else{const X=oe.getKey(),fe=z.getEditorState().read(()=>{const A=e.$getNodeByKey(X);return e.$isTextNode(A)&&A.isSimpleText()?A.getTextContent():null}),_e=U-j,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<j&&(F=U);const se=A?F-j: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)}j=0}}}function v(z){const O=z.getStyle(),Z=f(O);t.set(O,Z)}function I(z,O){const Z=p("getStyle"in z?z.getStyle():z.style),oe=Object.entries(O).reduce((K,[J,R])=>(R===null?delete K[J]:K[J]=R,K),{...Z}),j=_(oe);z.setStyle(j),t.set(j,oe)}function G(z,O){const Z=z.getNodes(),oe=Z.length;if(!e.$isRangeSelection(z)){const ne=e.$createRangeSelection(),ce=ne.anchor,be=ne.focus;for(let Ne=0;Ne<oe;Ne++){const Re=Z[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ce.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),G(e.$normalizeSelection__EXPERIMENTAL(ne),O))}e.$setSelection(z);return}const j=oe-1;let K=Z[0],J=Z[j];if(z.isCollapsed()&&e.$isRangeSelection(z)){I(z,O);return}const R=z.anchor,U=z.focus,fe=K.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(K)&&F===fe){const ne=K.getNextSibling();e.$isTextNode(ne)&&(B=0,F=0,K=ne)}if(Z.length===1){if(e.$isTextNode(K)){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)I(K,O),K.select(F,se);else{const ne=K.splitText(F,se),ce=F===0?ne[0]:ne[1];I(ce,O),ce.select(0,se-F)}}}else{if(e.$isTextNode(K)&&F<K.getTextContentSize()&&(F!==0&&(K=K.splitText(F)[1],F=0,R.set(K.getKey(),F,"text")),I(K,O)),e.$isTextNode(J)){const ce=J.getTextContent().length;J.__key!==ee&&se!==0&&(se=ce),se!==ce&&([J]=J.splitText(se)),se!==0&&I(J,O)}for(let ne=1;ne<j;ne++){const ce=Z[ne],be=ce.getKey();e.$isTextNode(ce)&&be!==K.getKey()&&be!==J.getKey()&&!ce.isToken()&&I(ce,O)}}}function P(z,O){if(z.anchor.key==="root"){const j=O(),K=e.$getRoot(),J=K.getFirstChild();J?J.replace(j,!0):K.append(j);return}const Z=z.getNodes(),oe=de(z.anchor.getNode(),Te);oe&&Z.indexOf(oe)===-1&&Z.push(oe);for(let j=0;j<Z.length;j++){const K=Z[j];if(!Te(K))continue;if(!e.$isElementNode(K))throw Error("Expected block node to be an ElementNode");const J=O();J.setFormat(K.getFormatType()),J.setIndent(K.getIndent()),K.replace(J,!0)}}function k(z){return z.getNode().isAttached()}function W(z){let O=z;for(;O!==null&&!e.$isRootOrShadowRoot(O);){const Z=O.getLatest(),oe=O.getParent();Z.getChildrenSize()===0&&O.remove(!0),O=oe}}function Y(z,O,Z=null){const oe=z.getNodes(),j=oe.length,K=z.anchor;if(j===0||j===1&&K.type==="element"&&K.getNode().getChildrenSize()===0){const U=K.type==="text"?K.getNode().getParentOrThrow():K.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<j;U++){const X=oe[U];e.$isRootOrShadowRoot(X)?(re(z,R,R.length,O,Z),R=[],J=X):J===null||J!==null&&e.$hasAncestor(X,J)?R.push(X):(re(z,R,R.length,O,Z),R=[X])}re(z,R,R.length,O,Z)}function re(z,O,Z,oe,j=null){if(O.length===0)return;const K=O[0],J=new Map,R=[];let U=e.$isElementNode(K)?K:K.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(ce=>_e.add(ce))}),W(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(j!==null)for(let F=0;F<R.length;F++){const se=R[F];j.append(se)}let B=null;if(e.$isRootOrShadowRoot(U))if(X)if(j!==null)U.insertAfter(j);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(j)U.append(j);else for(let se=0;se<R.length;se++){const ye=R[se];U.append(ye),B=ye}else if(j!==null)F.insertBefore(j);else for(let se=0;se<R.length;se++){const ye=R[se];F.insertBefore(ye),B=ye}}else if(j)U.insertAfter(j);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)&&k(A.anchor)&&k(A.focus)?e.$setSelection(A.clone()):B!==null?B.selectEnd():z.dirty=!0}function te(z,O){const Z=e.$getAdjacentNode(z.focus,O);return e.$isDecoratorNode(Z)&&!Z.isIsolated()||e.$isElementNode(Z)&&!Z.isInline()&&!Z.canBeEmpty()}function ue(z,O,Z,oe){z.modify(O?"extend":"move",Z,oe)}function q(z){const O=z.anchor.getNode();return(e.$isRootNode(O)?O:O.getParentOrThrow()).getDirection()==="rtl"}function H(z,O,Z){const oe=q(z);ue(z,O,Z?!oe:oe,"character")}function V(z){const O=z.anchor,Z=z.focus,K=O.getNode().getTopLevelElementOrThrow().getParentOrThrow();let J=K.getFirstDescendant(),R=K.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 Ee(z,O,Z){const oe=z.getStyle(),j=p(oe);return j!==null&&j[O]||Z}function Se(z,O,Z=""){let oe=null;const j=z.getNodes(),K=z.anchor,J=z.focus,R=z.isBackward(),U=R?J.offset:K.offset,X=R?J.getNode():K.getNode();if(z.isCollapsed()&&z.style!==""){const fe=z.style,_e=p(fe);if(_e!==null&&O in _e)return _e[O]}for(let fe=0;fe<j.length;fe++){const _e=j[fe];if(!(fe!==0&&U===0&&_e.is(X))&&e.$isTextNode(_e)){const B=Ee(_e,O,Z);if(oe===null)oe=B;else if(oe!==B){oe="";break}}}return oe===null?Z:oe}function Te(z){if(e.$isDecoratorNode(z)&&!z.isInline())return!0;if(!e.$isElementNode(z)||e.$isRootOrShadowRoot(z))return!1;const O=z.getFirstChild(),Z=O===null||e.$isLineBreakNode(O)||e.$isTextNode(O)||O.isInline();return!z.isInline()&&z.canBeEmpty()!==!1&&Z}function de(z,O){let Z=z;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=q,jn.$moveCaretSelection=ue,jn.$moveCharacter=H,jn.$patchStyleText=G,jn.$selectAll=V,jn.$setBlocksType=P,jn.$shouldOverrideDefaultCharacterSelection=te,jn.$sliceSelectedTextNodeContent=w,jn.$wrapNodes=Y,jn.createDOMRange=l,jn.createRectsFromDOMRange=d,jn.getStyleObjectFromCSS=p,jn.trimTextContentFromAnchor=m,jn}var Vn={},qf;function rC(){if(qf)return Vn;qf=1;var e=jt();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 I of m)if(I!==""){let[G,P]=I.split(/:([^]+)/);G&&P&&(v[G.trim()]=P.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 I in m)I&&(v+=`${I}: ${m[I]};`);return v}function p(m,v){var I=d("getStyle"in m?m.getStyle():m.style);v=Object.entries(v).reduce((G,[P,k])=>(k===null?delete G[P]:G[P]=k,G),{...I}),I=f(v),m.setStyle(I),t.set(I,v)}function _(m,v){var I=m.getNodes(),G=I.length;if(e.$isRangeSelection(m)){--G;var P=I[0],k=I[G];if(m.isCollapsed()&&e.$isRangeSelection(m))p(m,v);else{var W=m.anchor,Y=m.focus,re=P.getTextContent().length,te=Y.offset,ue=W.offset,q=W.isBefore(Y),H=q?ue:te;m=q?te:ue;var V=q?W.type:Y.type,Ee=q?Y.type:W.type;if(Y=q?Y.key:W.key,e.$isTextNode(P)&&H===re&&(q=P.getNextSibling(),e.$isTextNode(q)&&(H=ue=0,P=q)),I.length===1)e.$isTextNode(P)&&(H=V==="element"?0:ue>te?te:ue,m=Ee==="element"?re:ue>te?ue:te,H!==m&&(H===0&&m===re?(p(P,v),P.select(H,m)):(I=P.splitText(H,m),I=H===0?I[0]:I[1],p(I,v),I.select(0,m-H))));else for(e.$isTextNode(P)&&H<P.getTextContentSize()&&(H!==0&&(P=P.splitText(H)[1],H=0,W.set(P.getKey(),H,"text")),p(P,v)),e.$isTextNode(k)&&(H=k.getTextContent().length,k.__key!==Y&&m!==0&&(m=H),m!==H&&([k]=k.splitText(m)),m!==0&&p(k,v)),m=1;m<G;m++)H=I[m],W=H.getKey(),e.$isTextNode(H)&&W!==P.getKey()&&W!==k.getKey()&&!H.isToken()&&p(H,v)}}else{for(P=e.$createRangeSelection(),k=P.anchor,H=P.focus,W=0;W<G;W++)re=I[W],e.DEPRECATED_$isGridCellNode(re)&&(k.set(re.getKey(),0,"element"),H.set(re.getKey(),re.getChildrenSize(),"element"),_(e.$normalizeSelection__EXPERIMENTAL(P),v));e.$setSelection(m)}}function E(m){for(;m!==null&&!e.$isRootOrShadowRoot(m);){let v=m.getLatest(),I=m.getParent();v.getChildrenSize()===0&&m.remove(!0),m=I}}function T(m,v,I,G,P=null){if(v.length!==0){var k=v[0],W=new Map,Y=[];k=e.$isElementNode(k)?k:k.getParentOrThrow(),k.isInline()&&(k=k.getParentOrThrow());for(var re=!1;k!==null;){var te=k.getPreviousSibling();if(te!==null){k=te,re=!0;break}if(k=k.getParentOrThrow(),e.$isRootOrShadowRoot(k))break}te=new Set;for(var ue=0;ue<I;ue++){var q=v[ue];e.$isElementNode(q)&&q.getChildrenSize()===0&&te.add(q.getKey())}var H=new Set;for(ue=0;ue<I;ue++){q=v[ue];var V=q.getParent();if(V!==null&&V.isInline()&&(V=V.getParent()),V!==null&&e.$isLeafNode(q)&&!H.has(q.getKey())){if(q=V.getKey(),W.get(q)===void 0){let Ee=G();Ee.setFormat(V.getFormatType()),Ee.setIndent(V.getIndent()),Y.push(Ee),W.set(q,Ee),V.getChildren().forEach(Se=>{Ee.append(Se),H.add(Se.getKey()),e.$isElementNode(Se)&&Se.getChildrenKeys().forEach(Te=>H.add(Te))}),E(V)}}else if(te.has(q.getKey())){if(!e.$isElementNode(q))throw Error("Expected node in emptyElements to be an ElementNode");V=G(),V.setFormat(q.getFormatType()),V.setIndent(q.getIndent()),Y.push(V),q.remove(!0)}}if(P!==null)for(v=0;v<Y.length;v++)P.append(Y[v]);if(v=null,e.$isRootOrShadowRoot(k))if(re)if(P!==null)k.insertAfter(P);else for(P=Y.length-1;0<=P;P--)k.insertAfter(Y[P]);else if(re=k.getFirstChild(),e.$isElementNode(re)&&(k=re),re===null)if(P)k.append(P);else for(P=0;P<Y.length;P++)re=Y[P],k.append(re),v=re;else if(P!==null)re.insertBefore(P);else for(k=0;k<Y.length;k++)P=Y[k],re.insertBefore(P),v=P;else if(P)k.insertAfter(P);else for(P=Y.length-1;0<=P;P--)re=Y[P],k.insertAfter(re),v=re;Y=e.$getPreviousSelection(),e.$isRangeSelection(Y)&&Y.anchor.getNode().isAttached()&&Y.focus.getNode().isAttached()?e.$setSelection(Y.clone()):v!==null?v.selectEnd():m.dirty=!0}}function S(m,v,I,G){m.modify(v?"extend":"move",I,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,I=""){let G=null,P=m.getNodes();var k=m.anchor,W=m.focus,Y=m.isBackward();let re=Y?W.offset:k.offset;if(k=Y?W.getNode():k.getNode(),m.isCollapsed()&&m.style!==""&&(m=d(m.style),m!==null&&v in m))return m[v];for(m=0;m<P.length;m++){var te=P[m];if((m===0||re!==0||!te.is(k))&&e.$isTextNode(te)){if(W=v,Y=I,te=te.getStyle(),te=d(te),W=te!==null&&te[W]||Y,G===null)G=W;else if(G!==W){G="";break}}}return G===null?I: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,I){let G=w(m);S(m,v,I?!G:G,"character")},Vn.$patchStyleText=_,Vn.$selectAll=function(m){let v=m.anchor;m=m.focus;var I=v.getNode().getTopLevelElementOrThrow().getParentOrThrow();let G=I.getFirstDescendant();I=I.getLastDescendant();let P="element",k="element",W=0;e.$isTextNode(G)?P="text":e.$isElementNode(G)||G===null||(G=G.getParentOrThrow()),e.$isTextNode(I)?(k="text",W=I.getTextContentSize()):e.$isElementNode(I)||I===null||(I=I.getParentOrThrow()),G&&I&&(v.set(G.getKey(),0,P),m.set(I.getKey(),W,k))},Vn.$setBlocksType=function(m,v){if(m.anchor.key==="root"){v=v();var I=e.$getRoot();(m=I.getFirstChild())?m.replace(v,!0):I.append(v)}else{for(I=m.getNodes(),m=m.anchor.getNode();m!==null&&m.getParent()!==null&&!M(m);)m=m.getParentOrThrow();for((m=M(m)?m:null)&&I.indexOf(m)===-1&&I.push(m),m=0;m<I.length;m++){let G=I[m];if(!M(G))continue;if(!e.$isElementNode(G))throw Error("Expected block node to be an ElementNode");let P=v();P.setFormat(G.getFormatType()),P.setIndent(G.getIndent()),G.replace(P,!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 I=m.anchor.getNode(),G=m.focus.getNode(),P=v.is(I),k=v.is(G);if(P||k){P=m.isBackward();let[W,Y]=m.getCharacterOffsets();m=I.is(G),k=v.is(P?G:I),G=v.is(P?I:G),I=0;let re;m?(I=W>Y?Y:W,re=W>Y?W:Y):k?(I=P?Y:W,re=void 0):G&&(P=P?W:Y,I=0,re=P),v.__text=v.__text.slice(I,re)}}return v},Vn.$wrapNodes=function(m,v,I=null){var G=m.getNodes();let P=G.length;var k=m.anchor;if(P===0||P===1&&k.type==="element"&&k.getNode().getChildrenSize()===0){m=k.type==="text"?k.getNode().getParentOrThrow():k.getNode(),G=m.getChildren();let Y=v();Y.setFormat(m.getFormatType()),Y.setIndent(m.getIndent()),G.forEach(re=>Y.append(re)),I&&(Y=I.append(Y)),m.replace(Y)}else{k=null;var W=[];for(let Y=0;Y<P;Y++){let re=G[Y];e.$isRootOrShadowRoot(re)?(T(m,W,W.length,v,I),W=[],k=re):k===null||k!==null&&e.$hasAncestor(re,k)?W.push(re):(T(m,W,W.length,v,I),W=[re])}T(m,W,W.length,v,I)}},Vn.createDOMRange=function(m,v,I,G,P){let k=v.getKey(),W=G.getKey(),Y=document.createRange(),re=m.getElementByKey(k);if(m=m.getElementByKey(W),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,I]=r(re)),m.nodeName==="BR"&&([m,P]=r(m)),v=re.firstChild,re===m&&v!=null&&v.nodeName==="BR"&&I===0&&P===0&&(P=1);try{Y.setStart(re,I),Y.setEnd(m,P)}catch{return null}return!Y.collapsed||I===P&&k===W||(Y.setStart(m,P),Y.setEnd(re,I)),Y},Vn.createRectsFromDOMRange=function(m,v){var I=m.getRootElement();if(I===null)return[];m=I.getBoundingClientRect(),I=getComputedStyle(I),I=parseFloat(I.paddingLeft)+parseFloat(I.paddingRight),v=Array.from(v.getClientRects());let G=v.length;v.sort((k,W)=>{let Y=k.top-W.top;return 3>=Math.abs(Y)?k.left-W.left:Y});let P;for(let k=0;k<G;k++){let W=v[k],Y=W.width+I===m.width;P&&P.top<=W.top&&P.top+P.height>W.top&&P.left+P.width>W.left||Y?(v.splice(k--,1),G--):P=W}return v},Vn.getStyleObjectFromCSS=d,Vn.trimTextContentFromAnchor=function(m,v,I){let G=v.getNode();if(e.$isElementNode(G)){var P=G.getDescendantByIndex(v.offset);P!==null&&(G=P)}for(;0<I&&G!==null;){e.$isElementNode(G)&&(P=G.getLastDescendant(),P!==null&&(G=P));var k=G.getPreviousSibling(),W=0;if(k===null){P=G.getParentOrThrow();for(var Y=P.getPreviousSibling();Y===null;){if(P=P.getParent(),P===null){k=null;break}Y=P.getPreviousSibling()}P!==null&&(W=P.isInline()?0:2,k=Y)}if(Y=G.getTextContent(),Y===""&&e.$isElementNode(G)&&!G.isInline()&&(Y=`
|
|
73
73
|
|
|
74
|
-
`),k=j.length,!e.$isTextNode(G)||I>=k)j=G.getParent(),G.remove(),j==null||j.getChildrenSize()!==0||e.$isRootNode(j)||j.remove(),I-=k+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=k-I;let te=j.slice(0,P);H!==null&&H!==j?(I=e.$getPreviousSelection(),k=G,G.isSimpleText()?G.setTextContent(H):(k=e.$createTextNode(H),G.replace(k)),e.$isRangeSelection(I)&&I.isCollapsed()&&(I=I.anchor.offset,k.select(I,I))):G.isSimpleText()?(H=v.key===re,j=v.offset,j<I&&(j=k),I=H?j-I:0,k=H?j:P,H&&I===0?([I]=G.splitText(I,k),I.remove()):([,I]=G.splitText(I,k),I.remove())):(I=e.$createTextNode(te),G.replace(I)),I=0}}},Vn}var lu,Vf;function xs(){return Vf||(Vf=1,lu=process.env.NODE_ENV==="development"?QN():eC()),lu}var qf;function tC(){if(qf)return Sn;qf=1;var e=xs(),t=jt();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 M=r(X.top-Y);_e.top!==M&&(fe.style.top=M,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 D(){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 D();for(const U of W)if(!Ee.contains(U.target))return de()}),Te.observe(Y,l),de()}const Z=te.registerRootListener(D);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:D,focus:Z}=K,oe=D.getNode(),Y=oe.getKey(),W=D.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 M=te.getElementByKey(D.getNode().getKey()),F=te.getElementByKey(Z.getNode().getKey());if(M!==null&&F!==null&&M.tagName==="SPAN"&&F.tagName==="SPAN"){const se=document.createRange();let ye,De,ee,ne;Z.isBefore(D)?(ye=F,De=Z.offset,ee=M,ne=D.offset):(ye=M,De=D.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 E(te,ce){for(const V of ce)if(te.type.startsWith(V))return!0;return!1}function T(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 D=K.result;typeof D=="string"&&Te.push({file:de,result:D}),Se()}),E(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 O(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 I(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,D=Ee;for(;K!==null;)if(D=K,K=K.getParent(),q(K))return{child:D,parent:K};return null},Se=Ee=>{const de=Te(Ee);if(de!==null){const{child:K,parent:D}=de;if(K.is(Ee)){z(D,Ee);const Z=K.getNextSiblings(),oe=Z.length;if(D.insertAfter(K),oe!==0){const Y=V(D);K.insertAfter(Y);for(let W=0;W<oe;W++)Y.append(Z[W])}!D.canBeEmpty()&&D.getChildrenSize()===0&&D.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 k(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=O,Sn.$insertFirst=re,Sn.$insertNodeToNearestRoot=k,Sn.$restoreEditorState=G,Sn.$wrapNodeInElement=P,Sn.addClassNamesToElement=p,Sn.isMimeType=E,Sn.markSelection=f,Sn.mediaFileReader=T,Sn.mergeRegister=n,Sn.objectKlassEquals=H,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=I,Sn.removeClassNamesFromElement=_,Sn}var wn={},Zf;function nC(){if(Zf)return wn;Zf=1;var e=xs(),t=jt();function n(_){let E=new URLSearchParams;E.append("code",_);for(let T=1;T<arguments.length;T++)E.append("v",arguments[T]);throw Error(`Minified Lexical error #${_}; visit https://lexical.dev/docs/error?${E} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(..._){return()=>{_.forEach(E=>E())}}let l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(_,E,T){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(_,E);k.isConnected||re.append(k),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!==k&&(k.append(q),re=!0),G[z]=q}for(;G.length>te.length;)G.pop();re&&T(G)}function w(){m=v=null,I!==null&&I.disconnect(),I=null,k.remove();for(let H of G)H.remove();G=[]}function O(){let H=_.getRootElement();if(H===null)return w();let j=H.parentElement;if(!(j instanceof HTMLElement))return w();w(),m=H,v=j,I=new MutationObserver(re=>{let te=_.getRootElement(),ce=te&&te.parentElement;if(te!==m||ce!==v)return O();for(let V of re)if(!k.contains(V.target))return S()}),I.observe(j,l),S()}let m=null,v=null,I=null,G=[],k=document.createElement("div"),P=_.registerRootListener(O);return()=>{P(),w()}}function f(_,E){for(let T of E)if(_.type.startsWith(T))return!0;return!1}let p=(_,E)=>{for(;_!==t.$getRoot()&&_!=null;){if(E(_))return _;_=_.getParent()}return null};return wn.$splitNode=t.$splitNode,wn.isHTMLAnchorElement=t.isHTMLAnchorElement,wn.isHTMLElement=t.isHTMLElement,wn.$dfs=function(_,E){let T=[];_=(_||t.$getRoot()).getLatest(),E=E||(t.$isElementNode(_)?_.getLastDescendant():_);for(var S=_,w=0;(S=S.getParent())!==null;)w++;for(S=w;_!==null&&!_.is(E);)if(T.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(E)&&T.push({depth:S,node:_}),T},wn.$filter=function(_,E){let T=[];for(let S=0;S<_.length;S++){let w=E(_[S]);w!==null&&T.push(w)}return T},wn.$findMatchingParent=p,wn.$getNearestBlockElementAncestorOrThrow=function(_){let E=p(_,T=>t.$isElementNode(T)&&!T.isInline());return t.$isElementNode(E)||n(4,_.__key),E},wn.$getNearestNodeOfType=function(_,E){for(;_!=null;){if(_ instanceof E)return _;_=_.getParent()}return null},wn.$insertFirst=function(_,E){let T=_.getFirstChild();T!==null?T.insertBefore(E):_.append(E)},wn.$insertNodeToNearestRoot=function(_){var E=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(E)){var{focus:T}=E;if(E=T.getNode(),T=T.offset,t.$isRootOrShadowRoot(E))T=E.getChildAtIndex(T),T==null?E.append(_):T.insertBefore(_),_.selectNext();else{let S,w;t.$isTextNode(E)?(S=E.getParentOrThrow(),w=E.getIndexWithinParent(),0<T&&(w+=1,E.splitText(T))):(S=E,w=T),[,E]=t.$splitNode(S,w),E.insertBefore(_),E.selectStart()}}else E!=null?(E=E.getNodes(),E[E.length-1].getTopLevelElementOrThrow().insertAfter(_)):t.$getRoot().append(_),E=t.$createParagraphNode(),_.insertAfter(E),E.select();return _.getLatest()},wn.$restoreEditorState=function(_,E){let T=new Map,S=_._pendingEditorState;for(let[w,O]of E._nodeMap){let m=e.$cloneWithProperties(O);if(t.$isTextNode(m)){if(!t.$isTextNode(O))throw Error("Expected node be a TextNode");m.__text=O.__text}T.set(w,m)}S&&(S._nodeMap=T),_._dirtyType=2,_=E._selection,t.$setSelection(_===null?null:_.clone())},wn.$wrapNodeInElement=function(_,E){return E=E(),_.replace(E),E.append(_),E},wn.addClassNamesToElement=function(_,...E){E.forEach(T=>{typeof T=="string"&&(T=T.split(" ").filter(S=>S!==""),_.classList.add(...T))})},wn.isMimeType=f,wn.markSelection=function(_,E){function T(I){I.read(()=>{var G=t.$getSelection();if(t.$isRangeSelection(G)){var{anchor:k,focus:P}=G;G=k.getNode();var H=G.getKey(),j=k.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=O===null||z===null||ce!==m||te!==O.getKey()||re!==O&&(!(O instanceof t.TextNode)||re.updateDOM(O,z,_._config)),H||te){V=_.getElementByKey(k.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(k)?(H=q,z=P.offset,q=V,V=k.offset):(H=V,z=k.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")}E!==void 0&&E(Te)})}}S=G,w=j,O=re,m=ce}else m=O=w=S=null,v(),v=()=>{}})}let S=null,w=null,O=null,m=null,v=()=>{};return T(_.getEditorState()),r(_.registerUpdateListener(({editorState:I})=>T(I)),v,()=>{v()})},wn.mediaFileReader=function(_,E){let T=_[Symbol.iterator]();return new Promise((S,w)=>{let O=[],m=()=>{const{done:v,value:I}=T.next();if(v)return S(O);const G=new FileReader;G.addEventListener("error",w),G.addEventListener("load",()=>{const k=G.result;typeof k=="string"&&O.push({file:I,result:k}),m()}),f(I,E)?G.readAsDataURL(I):m()};m()})},wn.mergeRegister=r,wn.objectKlassEquals=function(_,E){return _!==null?Object.getPrototypeOf(_).constructor.name===E.name:!1},wn.positionNodeOnRange=d,wn.registerNestedElementResolver=function(_,E,T,S){return _.registerNodeTransform(E,w=>{e:{for(var O=w.getChildren(),m=0;m<O.length;m++)if(O[m]instanceof E){O=null;break e}for(O=w;O!==null;)if(m=O,O=O.getParent(),O instanceof E){O={child:m,parent:O};break e}O=null}if(O!==null){const{child:v,parent:I}=O;if(v.is(w)){if(S(I,w),w=v.getNextSiblings(),O=w.length,I.insertAfter(v),O!==0){m=T(I),v.insertAfter(m);for(let G=0;G<O;G++)m.append(w[G])}I.canBeEmpty()||I.getChildrenSize()!==0||I.remove()}}})},wn.removeClassNamesFromElement=function(_,...E){E.forEach(T=>{typeof T=="string"&&_.classList.remove(...T.split(" "))})},wn}var au,Jf;function pn(){return Jf||(Jf=1,au=process.env.NODE_ENV==="development"?tC():nC()),au}var cu={},Xf;function rC(){if(Xf)return cu;Xf=1;var e=jt();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 E=_.payload;if(E&&E.functionId==="makeChanges"){const T=E.args;if(T){const[S,w,O,m,v,I]=T;n.update(()=>{const G=e.$getSelection();if(e.$isRangeSelection(G)){const k=G.anchor;let P=k.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||O!=="")&&(G.insertRawText(O),P=k.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 cu.registerDragonSupport=t,cu}var uu={},Qf;function iC(){if(Qf)return uu;Qf=1;var e=jt();return uu.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,_,E,T,S]=f;t.update(()=>{const w=e.$getSelection();if(e.$isRangeSelection(w)){var O=w.anchor;let m=O.getNode(),v=0,I=0;e.$isTextNode(m)&&0<=p&&0<=_&&(v=p,I=p+_,w.setTextNodeRange(m,v,m,I)),(v!==I||E!=="")&&(w.insertRawText(E),m=O.getNode()),e.$isTextNode(m)&&(v=T,I=T+S,O=m.getTextContentSize(),v=v>O?O:v,I=I>O?O:I,w.setTextNodeRange(m,v,m,I)),l.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},uu}var du,eh;function Sp(){return eh||(eh=1,du=process.env.NODE_ENV==="development"?rC():iC()),du}var di={},vi={},Za={},th;function sC(){if(th)return Za;th=1;var e=xs(),t=pn(),n=jt();function r(E,T){const S=T.body?T.body.childNodes:[];let w=[];for(let O=0;O<S.length;O++){const m=S[O];if(!p.has(m.nodeName)){const v=_(m,E);v!==null&&(w=w.concat(v))}}return w}function l(E,T){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"),O=n.$getRoot().getChildren();for(let m=0;m<O.length;m++){const v=O[m];d(E,v,S,T)}return S.innerHTML}function d(E,T,S,w=null){let O=w!=null?T.isSelected(w):!0;const m=n.$isElementNode(T)&&T.excludeFromCopy("html");let v=T;if(w!==null){let re=e.$cloneWithProperties(T);re=n.$isTextNode(re)&&w!=null?e.$sliceSelectedTextNodeContent(w,re):re,v=re}const I=n.$isElementNode(v)?v.getChildren():[],G=E._nodes.get(v.getType());let k;G&&G.exportDOM!==void 0?k=G.exportDOM(E,v):k=v.exportDOM(E);const{element:P,after:H}=k;if(!P)return!1;const j=document.createDocumentFragment();for(let re=0;re<I.length;re++){const te=I[re],ce=d(E,te,j,w);!O&&n.$isElementNode(T)&&ce&&T.extractWithChild(te,w,"html")&&(O=!0)}if(O&&!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 O}function f(E,T){const{nodeName:S}=E,w=T._htmlConversions.get(S.toLowerCase());let O=null;if(w!==void 0)for(const m of w){const v=m(E);v!==null&&(O===null||(O.priority||0)<(v.priority||0))&&(O=v)}return O!==null?O.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function _(E,T,S=new Map,w){let O=[];if(p.has(E.nodeName))return O;let m=null;const v=f(E,T),I=v?v(E):null;let G=null;if(I!==null){G=I.after;const H=I.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&&O.push(...Array.isArray(H)?H:[m])}I.forChild!=null&&S.set(E.nodeName,I.forChild)}const k=E.childNodes;let P=[];for(let H=0;H<k.length;H++)P.push(..._(k[H],T,new Map(S),m));return G!=null&&(P=G(P)),m==null?O=O.concat(P):n.$isElementNode(m)&&m.append(...P),O}return Za.$generateHtmlFromNodes=l,Za.$generateNodesFromDOM=r,Za}var Ja={},nh;function oC(){if(nh)return Ja;nh=1;var e=xs(),t=pn(),n=jt();function r(f,p,_,E=null){let T=E!=null?p.isSelected(E):!0,S=n.$isElementNode(p)&&p.excludeFromCopy("html");var w=p;E!==null&&(w=e.$cloneWithProperties(p),w=n.$isTextNode(w)&&E!=null?e.$sliceSelectedTextNodeContent(E,w):w);let O=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:I}=m;if(!v)return!1;m=document.createDocumentFragment();for(let G=0;G<O.length;G++){let k=O[G],P=r(f,k,m,E);!T&&n.$isElementNode(p)&&P&&p.extractWithChild(k,E,"html")&&(T=!0)}return T&&!S?(t.isHTMLElement(v)&&v.append(m),_.append(v),I&&(f=I.call(w,v))&&v.replaceWith(f)):_.append(m),T}let l=new Set(["STYLE","SCRIPT"]);function d(f,p,_=new Map,E){let T=[];if(l.has(f.nodeName))return T;let S=null;var w,{nodeName:O}=f,m=p._htmlConversions.get(O.toLowerCase());if(O=null,m!==void 0)for(w of m)m=w(f),m!==null&&(O===null||(O.priority||0)<(m.priority||0))&&(O=m);if(O=(w=O!==null?O.conversion:null)?w(f):null,w=null,O!==null){if(w=O.after,m=O.node,S=Array.isArray(m)?m[m.length-1]:m,S!==null){for(var[,v]of _)if(S=v(S,E),!S)break;S&&T.push(...Array.isArray(m)?m:[S])}O.forChild!=null&&_.set(f.nodeName,O.forChild)}for(f=f.childNodes,E=[],v=0;v<f.length;v++)E.push(...d(f[v],p,new Map(_),S));return w!=null&&(E=w(E)),S==null?T=T.concat(E):n.$isElementNode(S)&&S.append(...E),T}return Ja.$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"),E=n.$getRoot().getChildren();for(let T=0;T<E.length;T++)r(f,E[T],_,p);return _.innerHTML},Ja.$generateNodesFromDOM=function(f,p){p=p.body?p.body.childNodes:[];let _=[];for(let T=0;T<p.length;T++){var E=p[T];l.has(E.nodeName)||(E=d(E,f),E!==null&&(_=_.concat(E)))}return _},Ja}var fu,rh;function wp(){return rh||(rh=1,fu=process.env.NODE_ENV==="development"?sC():oC()),fu}var ih;function lC(){if(ih)return vi;ih=1;var e=wp(),t=xs(),n=pn(),r=jt();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(O(P,H))}function _(P,H){const j=P.getData("text/plain")||P.getData("text/uri-list");j!=null&&H.insertRawText(j)}function E(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 T(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 T(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
|
-
`||
|
|
76
|
-
`?
|
|
77
|
-
`||
|
|
78
|
-
`?v.insertParagraph():k===" "?v.insertNodes([r.$createTabNode()]):v.insertText(k);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(O(m,v))})});var I=m.getRootElement();let G=m._window==null?window.document:m._window.document,k=d?(m._window||window).getSelection():null;if(I===null||k===null)return!1;let P=G.createElement("span");return P.style.cssText="position: fixed; top: -1000px;",P.append(G.createTextNode("#")),I.append(P),I=new Range,I.setStart(P,0),I.setEnd(P,1),k.removeAllRanges(),k.addRange(I),new Promise(H=>{let j=m.registerCommand(r.COPY_COMMAND,re=>(n.objectKlassEquals(re,ClipboardEvent)&&(j(),w!==null&&(window.clearTimeout(w),w=null),H(O(m,re))),!0),r.COMMAND_PRIORITY_CRITICAL);w=window.setTimeout(()=>{j(),w=null,H(!1)},50),G.execCommand("copy"),P.remove()})},Si}var hu,oh;function Op(){return oh||(oh=1,hu=process.env.NODE_ENV==="development"?lC():aC()),hu}var lh;function cC(){if(lh)return di;lh=1;var e=Op(),t=xs(),n=pn(),r=jt();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),E=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,w=r.createCommand("DRAG_DROP_PASTE_FILE");class O extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new O(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 D=this.getDirection();D&&(de.dir=D)}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(),D=this.getDirection();return K.setDirection(D),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 O)}function v(Se){return Se instanceof O}class I extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new I(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:k,priority:0}),h2:Ee=>({conversion:k,priority:0}),h3:Ee=>({conversion:k,priority:0}),h4:Ee=>({conversion:k,priority:0}),h5:Ee=>({conversion:k,priority:0}),h6:Ee=>({conversion:k,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 D=this.getDirection();D&&(de.dir=D)}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,D=K===this.getTextContentSize()||!Ee?r.$createParagraphNode():H(this.getTag()),Z=this.getDirection();if(D.setDirection(Z),this.insertAfter(D,de),K===0&&!this.isEmpty()&&Ee){const oe=r.$createParagraphNode();oe.select(),this.replace(oe,!0)}return D}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 k(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 I(Se))}function j(Se){return Se instanceof I}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"),D=de.includes("text/html")||de.includes("text/plain");return[K,Array.from(Ee.files),D]}function V(Se){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const de=new Set,K=Ee.getNodes();for(let D=0;D<K.length;D++){const Z=K[D],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 D=de.dataTransfer;if(D!=null)e.$insertDataTransferForRichText(D,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 D=K.getNodes();for(const Z of D){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 D=K.getNodes();if(D.length>0)return D[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const D=r.$getAdjacentNode(K.focus,!0);if(!de.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.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 D=K.getNodes();if(D.length>0)return D[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return de.preventDefault(),!0;const D=r.$getAdjacentNode(K.focus,!1);if(!de.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.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 D=K.getNodes();if(D.length>0)return de.preventDefault(),D[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(t.$shouldOverrideDefaultCharacterSelection(K,!0)){const D=de.shiftKey;return de.preventDefault(),t.$moveCharacter(K,D,!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 D=de.shiftKey;return t.$shouldOverrideDefaultCharacterSelection(K,!1)?(de.preventDefault(),t.$moveCharacter(K,D,!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:D}=K,Z=D.getNode();return K.isCollapsed()&&D.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((E||_||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 D=r.$getSelection();return!!r.$isRangeSelection(D)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGSTART_COMMAND,de=>{const[K]=ce(de),D=r.$getSelection();return!(K&&!r.$isRangeSelection(D))},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGOVER_COMMAND,de=>{const[K]=ce(de),D=r.$getSelection();if(K&&!r.$isRangeSelection(D))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,D]=ce(de);if(K.length>0&&!D)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=I,di.QuoteNode=O,di.eventFiles=ce,di.registerRichText=Te,di}var fi={},ah;function uC(){if(ah)return fi;ah=1;var e=Op(),t=xs(),n=pn(),r=jt();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),E=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,w=r.createCommand("DRAG_DROP_PASTE_FILE");class O extends r.ElementNode{static getType(){return"quote"}static clone(z){return new O(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:k,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 O)}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&&I(z)?{conversion:()=>({node:null}),priority:3}:null),span:z=>I(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 I(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 k(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 O},fi.DRAG_DROP_PASTE=w,fi.HeadingNode=v,fi.QuoteNode=O,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((E||_||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 gu,ch;function Ed(){return ch||(ch=1,gu=process.env.NODE_ENV==="development"?cC():uC()),gu}var uh;function dC(){if(uh)return nu;uh=1;var e=qn(),t=xp(),n=rt,r=vp(),l=pn(),d=fd,f=Sp(),p=Ed(),T=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[k,P]=n.useState(()=>S(G));return T(()=>{function H(){const j=S(G);P(j)}return H(),l.mergeRegister(G.registerUpdateListener(()=>{H()}),G.registerEditableListener(()=>{H()}))},[G]),k}function O(G,k){const[P,H]=n.useState(()=>G.getDecorators());return T(()=>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(k,{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},[k,P,G])}function m(G){T(()=>l.mergeRegister(p.registerRichText(G),f.registerDragonSupport(G)),[G])}function v({contentEditable:G,placeholder:k,ErrorBoundary:P}){const[H]=e.useLexicalComposerContext(),j=O(H,P);return m(H),n.createElement(n.Fragment,null,G,n.createElement(I,{content:k}),j)}function I({content:G}){const[k]=e.useLexicalComposerContext(),P=w(k),H=t();return P?typeof G=="function"?G(H):G:null}return nu.RichTextPlugin=v,nu}var pu={},dh;function fC(){if(dh)return pu;dh=1;var e=qn(),t=xp(),n=rt,r=vp(),l=pn(),d=fd,f=Sp(),p=Ed(),_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function E(m){return m.getEditorState().read(r.$canShowPlaceholderCurry(m.isComposing()))}function T(m){let[v,I]=n.useState(()=>E(m));return _(()=>{function G(){let k=E(m);I(k)}return G(),l.mergeRegister(m.registerUpdateListener(()=>{G()}),m.registerEditableListener(()=>{G()}))},[m]),v}function S(m,v){let[I,G]=n.useState(()=>m.getDecorators());return _(()=>m.registerDecoratorListener(k=>{d.flushSync(()=>{G(k)})}),[m]),n.useEffect(()=>{G(m.getDecorators())},[m]),n.useMemo(()=>{let k=[],P=Object.keys(I);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},I[j])),te=m.getElementByKey(j);te!==null&&k.push(d.createPortal(re,te,j))}return k},[v,I,m])}function w(m){_(()=>l.mergeRegister(p.registerRichText(m),f.registerDragonSupport(m)),[m])}function O({content:m}){var[v]=e.useLexicalComposerContext();v=T(v);let I=t();return v?typeof m=="function"?m(I):m:null}return pu.RichTextPlugin=function({contentEditable:m,placeholder:v,ErrorBoundary:I}){let[G]=e.useLexicalComposerContext();return I=S(G,I),w(G),n.createElement(n.Fragment,null,m,n.createElement(O,{content:v}),I)},pu}const hC=process.env.NODE_ENV==="development"?dC():fC();var gC=hC,mu={},fh;function pC(){if(fh)return mu;fh=1;var e=qn(),t=rt;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var E=arguments[_];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(p[T]=E[T])}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:E,ariaDescribedBy:T,ariaExpanded:S,ariaLabel:w,ariaLabelledBy:O,ariaMultiline:m,ariaOwns:v,ariaRequired:I,autoCapitalize:G,className:k,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?E:void 0,"aria-describedby":T,"aria-expanded":q&&H==="combobox"?!!S:void 0,"aria-label":w,"aria-labelledby":O,"aria-multiline":m,"aria-owns":q?v:void 0,"aria-readonly":q?void 0:!0,"aria-required":I,autoCapitalize:G,className:k,contentEditable:q,"data-testid":ce,id:P,ref:Se,role:H,spellCheck:j,style:re,tabIndex:te}))}return mu.ContentEditable=f,mu}var _u={},hh;function mC(){if(hh)return _u;hh=1;var e=qn(),t=rt;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 _u.ContentEditable=function({ariaActiveDescendant:l,ariaAutoComplete:d,ariaControls:f,ariaDescribedBy:p,ariaExpanded:_,ariaLabel:E,ariaLabelledBy:T,ariaMultiline:S,ariaOwns:w,ariaRequired:O,autoCapitalize:m,className:v,id:I,role:G="textbox",spellCheck:k=!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":E,"aria-labelledby":T,"aria-multiline":S,"aria-owns":ce?w:void 0,"aria-readonly":ce?void 0:!0,"aria-required":O,autoCapitalize:m,className:v,contentEditable:ce,"data-testid":j,id:I,ref:z,role:G,spellCheck:k,style:P,tabIndex:H}))},_u}const _C=process.env.NODE_ENV==="development"?pC():mC();var yC=_C,yu,gh;function NC(){if(gh)return yu;gh=1;var e=rt;function t(p,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,S){return T.__proto__=S,T},t(p,_)}function n(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}var r=function(_,E){return _===void 0&&(_=[]),E===void 0&&(E=[]),_.length!==E.length||_.some(function(T,S){return!Object.is(T,E[S])})},l={error:null},d=function(p){n(_,p);function _(){for(var T,S=arguments.length,w=new Array(S),O=0;O<S;O++)w[O]=arguments[O];return T=p.call.apply(p,[this].concat(w))||this,T.state=l,T.resetErrorBoundary=function(){for(var m,v=arguments.length,I=new Array(v),G=0;G<v;G++)I[G]=arguments[G];T.props.onReset==null||(m=T.props).onReset.apply(m,I),T.reset()},T}_.getDerivedStateFromError=function(S){return{error:S}};var E=_.prototype;return E.reset=function(){this.setState(l)},E.componentDidCatch=function(S,w){var O,m;(O=(m=this.props).onError)==null||O.call(m,S,w)},E.componentDidUpdate=function(S,w){var O=this.state.error,m=this.props.resetKeys;if(O!==null&&w.error!==null&&r(S.resetKeys,m)){var v,I;(v=(I=this.props).onResetKeysChange)==null||v.call(I,S.resetKeys,m),this.reset()}},E.render=function(){var S=this.state.error,w=this.props,O=w.fallbackRender,m=w.FallbackComponent,v=w.fallback;if(S!==null){var I={error:S,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(v))return v;if(typeof O=="function")return O(I);if(m)return e.createElement(m,I);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 yu=f,yu}var Nu,ph;function CC(){if(ph)return Nu;ph=1;var e=rt;function t(f,p){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,E){return _.__proto__=E,_},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(_,E){return!Object.is(_,p[E])})}var l={error:null},d=function(f){function p(){for(var E,T=arguments.length,S=Array(T),w=0;w<T;w++)S[w]=arguments[w];return E=f.call.apply(f,[this].concat(S))||this,E.state=l,E.resetErrorBoundary=function(){for(var O,m=arguments.length,v=Array(m),I=0;I<m;I++)v[I]=arguments[I];E.props.onReset==null||(O=E.props).onReset.apply(O,v),E.reset()},E}n(p,f),p.getDerivedStateFromError=function(E){return{error:E}};var _=p.prototype;return _.reset=function(){this.setState(l)},_.componentDidCatch=function(E,T){var S,w;(S=(w=this.props).onError)==null||S.call(w,E,T)},_.componentDidUpdate=function(E,T){var S=this.props.resetKeys;if(this.state.error!==null&&T.error!==null&&r(E.resetKeys,S)){var w,O;(w=(O=this.props).onResetKeysChange)==null||w.call(O,E.resetKeys,S),this.reset()}},_.render=function(){var E=this.state.error,T=this.props,S=T.fallbackRender,w=T.FallbackComponent;if(T=T.fallback,E!==null){if(E={error:E,resetErrorBoundary:this.resetErrorBoundary},e.isValidElement(T))return T;if(typeof S=="function")return S(E);if(w)return e.createElement(w,E);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(e.Component);return Nu=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)},Nu}const EC=process.env.NODE_ENV==="development"?NC():CC();var TC=EC;const xC=hd(TC);var Cu={},gr={},mh;function vC(){if(mh)return gr;mh=1;var e=jt(),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 E(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 T(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 M=R[B];if(e.$isElementNode(M)&&M.isEmpty()&&!ce(M)&&!_e.has(M.getKey())){w(M,W);continue}if(e.$isLeafNode(M)){let F=M.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 O(Y,W){const J=Y.getLastChild(),R=W.getFirstChild();J&&R&&d(J)&&d(R)&&(O(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 M=e.$createParagraphNode();S(M,B.getChildren()),fe.insertAfter(M),fe=M,B.__key===W.anchor.key&&W.anchor.set(M.getKey(),0,"element"),B.__key===W.focus.key&&W.focus.set(M.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=E(U);X!==fe&&U.setValue(fe)}}}function I(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 M=te(),F=Ee(fe);M.append(F),S(F,Y.getNextSiblings()),J.insertBefore(_e),J.insertAfter(M),J.replace(Y)}v(W),v(R)}}function k(){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))O(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,M=J.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(M,_e.offset,"element"),B.type==="element"&&B.getNode().is(this)&&B.set(M,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?(I(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(),M=de(B)&&B.getListType()==="check",F=J.getChecked();(!M||F)&&U.push(X.listitemUnchecked),(!M||!F)&&U.push(X.listitemChecked),M&&R.push(F?X.listitemChecked:X.listitemUnchecked)}if(_e!==void 0){const B=_e.split(" ");J.getChildren().some(M=>de(M))?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,M=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),M!==void 0){const De=M.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"),D=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=k,gr.$isListItemNode=ce,gr.$isListNode=de,gr.INSERT_CHECK_LIST_COMMAND=Z,gr.INSERT_ORDERED_LIST_COMMAND=D,gr.INSERT_UNORDERED_LIST_COMMAND=K,gr.ListItemNode=P,gr.ListNode=V,gr.REMOVE_LIST_COMMAND=oe,gr.insertList=T,gr.removeList=m,gr}var pr={},_h;function SC(){if(_h)return pr;_h=1;var e=jt(),t=pn();function n(K){let D=new URLSearchParams;D.append("code",K);for(let Z=1;Z<arguments.length;Z++)D.append("v",arguments[Z]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${D} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let D=1;for(K=K.getParent();K!=null;){if(H(K)){if(K=K.getParent(),q(K)){D++,K=K.getParent();continue}n(40)}break}return D}function l(K){K=K.getParent(),q(K)||n(40);let D=K;for(;D!==null;)D=D.getParent(),q(D)&&(K=D);return K}function d(K){let D=[];K=K.getChildren().filter(H);for(let Z=0;Z<K.length;Z++){let oe=K[Z],Y=oe.getFirstChild();q(Y)?D=D.concat(d(Y)):D.push(oe)}return D}function f(K){return H(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let D=K.getParent();if(D==null||!H(K)&&!q(K))break;K=D}K.remove()}function _(K){return P().append(K)}function E(K,D){return H(K)&&(D.length===0||D.length===1&&K.is(D[0])&&K.getChildrenSize()===0)}function T(K,D){K.splice(K.getChildrenSize(),0,D)}function S(K,D){if(q(K))return K;let Z=K.getPreviousSibling(),oe=K.getNextSibling(),Y=P();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),T(Y,K.getChildren()),q(Z)&&D===Z.getListType()?(Z.append(Y),K.remove(),q(oe)&&D===oe.getListType()&&(T(Z,oe.getChildren()),oe.remove()),Z):q(oe)&&D===oe.getListType()?(oe.getFirstChildOrThrow().insertBefore(Y),K.remove(),oe):(D=z(D),D.append(Y),K.replace(D),O(D),D)}function w(K,D){var Z=K.getLastChild();let oe=D.getFirstChild();Z&&oe&&f(Z)&&f(oe)&&(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()),Z=D.getChildren(),0<Z.length&&(K.append(...Z),O(K)),D.remove()}function O(K,D){if(K=D||K.getChildren(),K!==void 0)for(D=0;D<K.length;D++){let W=K[D];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 D=K.getParent(),Z=D?D.getParent():void 0,oe=Z?Z.getParent():void 0;if(q(oe)&&H(Z)&&q(D)){var Y=D?D.getFirstChild():void 0,W=D?D.getLastChild():void 0;if(K.is(Y))Z.insertBefore(K),D.isEmpty()&&Z.remove();else if(K.is(W))Z.insertAfter(K),D.isEmpty()&&Z.remove();else{var J=D.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),T(J,K.getNextSiblings()),Z.insertBefore(Y),Z.insertAfter(W),Z.replace(K)}O(D),O(oe)}}}class v extends e.ElementNode{static getType(){return"listitem"}static clone(D){return new v(D.__value,D.__checked,D.__key)}constructor(D,Z,oe){super(oe),this.__value=D===void 0?1:D,this.__checked=Z}createDOM(D){let Z=document.createElement("li"),oe=this.getParent();return q(oe)&&oe.getListType()==="check"&&G(Z,this,null),Z.value=this.__value,I(Z,D.theme,this),Z}updateDOM(D,Z,oe){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&G(Z,this,D),Z.value=this.__value,I(Z,oe.theme,this),!1}static transform(){return D=>{let Z=D.getParent();if(q(Z)){if(O(Z),!H(D))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&D.getChecked()!=null&&D.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:k,priority:0})}}static importJSON(D){let Z=P();return Z.setChecked(D.checked),Z.setValue(D.value),Z.setFormat(D.format),Z.setDirection(D.direction),Z}exportDOM(D){return D=this.createDOM(D._config),D.style.textAlign=this.getFormatType(),{element:D}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...D){for(let Z=0;Z<D.length;Z++){let oe=D[Z];if(e.$isElementNode(oe)&&this.canMergeWith(oe)){let Y=oe.getChildren();this.append(...Y),oe.remove()}else super.append(oe)}return this}replace(D,Z){if(H(D))return super.replace(D);this.setIndent(0);let oe=this.getParentOrThrow();if(!q(oe))return D;if(oe.__first===this.getKey())oe.insertBefore(D);else if(oe.__last===this.getKey())oe.insertAfter(D);else{let Y=z(oe.getListType()),W=this.getNextSibling();for(;W;){let J=W;W=W.getNextSibling(),Y.append(J)}oe.insertAfter(D),D.insertAfter(Y)}if(Z){if(!e.$isElementNode(D))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Y=>{D.append(Y)})}return this.remove(),oe.getChildrenSize()===0&&oe.remove(),D}insertAfter(D,Z=!0){var oe=this.getParentOrThrow();q(oe)||n(39);var Y=this.getNextSiblings();if(H(D))return Z=super.insertAfter(D,Z),D=D.getParentOrThrow(),q(D)&&O(D),Z;if(q(D)){for(oe=D,D=D.getChildren(),Y=D.length-1;0<=Y;Y--)oe=D[Y],this.insertAfter(oe,Z);return oe}if(oe.insertAfter(D,Z),Y.length!==0){let W=z(oe.getListType());Y.forEach(J=>W.append(J)),D.insertAfter(W,Z)}return D}remove(D){let Z=this.getPreviousSibling(),oe=this.getNextSibling();super.remove(D),Z&&oe&&f(Z)&&f(oe)?(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()):oe&&(D=oe.getParent(),q(D)&&O(D))}insertNewAfter(D,Z=!0){return D=P(this.__checked==null?void 0:!1),this.insertAfter(D,Z),D}collapseAtStart(D){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=D.anchor,D=D.focus,Y=Z.getKey(),oe.type==="element"&&oe.getNode().is(this)&&oe.set(Y,oe.offset,"element"),D.type==="element"&&D.getNode().is(this)&&D.set(Y,D.offset,"element")):(oe.insertBefore(Z),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(D){this.getWritable().__value=D}getChecked(){return this.getLatest().__checked}setChecked(D){this.getWritable().__checked=D}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var D=this.getParent();if(D===null)return this.getLatest().__indent;D=D.getParentOrThrow();let Z=0;for(;H(D);)D=D.getParentOrThrow().getParentOrThrow(),Z++;return Z}setIndent(D){typeof D=="number"&&-1<D||n(117);let Z=this.getIndent();for(;Z!==D;)if(Z<D){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(),T(W,J),Y.remove(),oe.add(Y.getKey())),O(W)}}else f(Y)?(Y=Y.getFirstChild(),q(Y)&&(oe=Y.getFirstChild(),oe!==null&&oe.insertBefore(this),O(Y))):f(W)?(Y=W.getFirstChild(),q(Y)&&(Y.append(this),O(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),O(J));q(R)&&O(R)}Z++}else m(this),Z--;return this}insertBefore(D){if(H(D)){let Z=this.getParentOrThrow();if(q(Z)){let oe=this.getNextSiblings();O(Z,oe)}}return super.insertBefore(D)}canInsertAfter(D){return H(D)}canReplaceWith(D){return H(D)}canMergeWith(D){return e.$isParagraphNode(D)||H(D)}extractWithChild(D,Z){if(!e.$isRangeSelection(Z))return!1;D=Z.anchor.getNode();let oe=Z.focus.getNode();return this.isParentOf(D)&&this.isParentOf(oe)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return z("bullet")}}function I(K,D,Z){let oe=[],Y=[];var W=(D=D.list)?D.listitem:void 0;if(D&&D.nested)var J=D.nested.listitem;if(W!==void 0&&(W=W.split(" "),oe.push(...W)),D){W=Z.getParent(),W=q(W)&&W.getListType()==="check";let R=Z.getChecked();W&&!R||Y.push(D.listitemUnchecked),W&&R||Y.push(D.listitemChecked),W&&oe.push(R?D.listitemChecked:D.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,D,Z){q(D.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),Z&&D.__checked===Z.__checked||K.setAttribute("aria-checked",D.getChecked()?"true":"false"))}function k(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(D){return new j(D.__listType||V[D.__tag],D.__start,D.__key)}constructor(D,Z,oe){super(oe),this.__listType=D=V[D]||D,this.__tag=D==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(D){let Z=this.getWritable();Z.__listType=D,Z.__tag=D==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(D){let Z=document.createElement(this.__tag);return this.__start!==1&&Z.setAttribute("start",String(this.__start)),Z.__lexicalListType=this.__listType,re(Z,D.theme,this),Z}updateDOM(D,Z,oe){return D.__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(D){let Z=z(D.listType,D.start);return Z.setFormat(D.format),Z.setIndent(D.indent),Z.setDirection(D.direction),Z}exportDOM(D){return{element:D}=super.exportDOM(D),D&&t.isHTMLElement(D)&&(this.__start!==1&&D.setAttribute("start",String(this.__start)),this.__listType==="check"&&D.setAttribute("__lexicalListType","check")),{element:D}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...D){for(let oe=0;oe<D.length;oe++){var Z=D[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 O(this),this}extractWithChild(D){return H(D)}}function re(K,D,Z){let oe=[],Y=[];var W=D.list;if(W!==void 0){let R=W[`${Z.__tag}Depth`]||[];D=r(Z)-1;let U=D%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<D?oe.push(...Z):Y.push(...Z))}0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function te(K){let D=[];for(let oe=0;oe<K.length;oe++){var Z=K[oe];H(Z)?(D.push(Z),Z=Z.getChildren(),1<Z.length&&Z.forEach(Y=>{q(Y)&&D.push(_(Y))})):D.push(_(Z))}return D}function ce(K){let D=K.nodeName.toLowerCase(),Z=null;return D==="ol"?Z=z("number",K.start):D==="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,D=1){return e.$applyNodeReplacement(new j(K,D))}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 D=l(K),Z=K.getParent();q(Z)||n(40);let oe=Z.getParent(),Y;if(e.$isRootOrShadowRoot(oe))Y=e.$createParagraphNode(),D.insertAfter(Y);else if(H(oe))Y=P(),oe.insertAfter(Y);else return!1;if(Y.select(),D=K.getNextSiblings(),0<D.length){let W=z(Z.getListType());e.$isParagraphNode(Y)?Y.insertAfter(W):(Z=P(),Z.append(W),Y.insertAfter(Z)),D.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,D){K.update(()=>{var Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){var oe=Z.getNodes();Z=Z.anchor.getNode();var Y=Z.getParent();if(E(Z,oe))oe=z(D),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(),T(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,D);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(D);T(J,W.getChildren()),W.replace(J),O(J),Z.add(R)}break}else{if(J=W.getParent(),e.$isRootOrShadowRoot(J)&&!Z.has(R)){Z.add(R),S(W,D);break}W=J}}}}})},pr.removeList=function(K){K.update(()=>{let D=e.$getSelection();if(e.$isRangeSelection(D)){var Z=new Set,oe=D.getNodes(),Y=D.anchor.getNode();if(E(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(),T(oe,R.getChildren()),Z.insertAfter(oe),Z=oe,R.__key===D.anchor.key&&D.anchor.set(oe.getKey(),0,"element"),R.__key===D.focus.key&&D.focus.set(oe.getKey(),0,"element"),R.remove();J.remove()}}})},pr}var Eu,yh;function Td(){return yh||(yh=1,Eu=process.env.NODE_ENV==="development"?vC():SC()),Eu}var Nh;function wC(){if(Nh)return Cu;Nh=1;var e=Td(),t=qn(),n=rt,r=pn(),l=jt();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 Cu.ListPlugin=f,Cu}var Tu={},Ch;function OC(){if(Ch)return Tu;Ch=1;var e=Td(),t=qn(),n=rt,r=pn(),l=jt();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 Tu.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},Tu}const DC=process.env.NODE_ENV==="development"?wC():OC();var AC=DC,xu={},wi={},Eh;function MC(){if(Eh)return wi;Eh=1;var e=pn(),t=jt();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={},I){super(I);const{target:G=null,rel:k=null,title:P=null}=v;this.__url=m,this.__target=G,this.__rel=k,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,I){const G=this.__url,k=this.__target,P=this.__rel,H=this.__title;return G!==m.__url&&(v.href=G),k!==m.__target&&(k?v.target=k: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 I=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(I,v),I}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(m,v,I){if(!t.$isRangeSelection(v))return!1;const G=v.anchor.getNode(),k=v.focus.getNode();return this.isParentOf(G)&&this.isParentOf(k)&&v.getTextContent().length>0}}function l(O){let m=null;if(e.isHTMLAnchorElement(O)){const v=O.textContent;(v!==null&&v!==""||O.children.length>0)&&(m=d(O.getAttribute("href")||"",{rel:O.getAttribute("rel"),target:O.getAttribute("target"),title:O.getAttribute("title")}))}return{node:m}}function d(O,m){return t.$applyNodeReplacement(new r(O,m))}function f(O){return O 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 I=this.getParentOrThrow().insertNewAfter(m,v);if(t.$isElementNode(I)){const G=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return I.append(G),G}return null}}function _(O,m){return t.$applyNodeReplacement(new p(O,m))}function E(O){return O instanceof p}const T=t.createCommand("TOGGLE_LINK_COMMAND");function S(O,m={}){const{target:v,title:I}=m,G=m.rel===void 0?"noreferrer":m.rel,k=t.$getSelection();if(!t.$isRangeSelection(k))return;const P=k.extract();if(O===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(O),v!==void 0&&te.setTarget(v),G!==null&&te.setRel(G),I!==void 0&&te.setTitle(I);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(O),v!==void 0&&te.setTarget(v),G!==null&&j.setRel(G),I!==void 0&&j.setTitle(I);return}if(te.is(H)||(H=te,j=d(O,{rel:G,target:v,title:I}),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(O,m){let v=O;for(;v!==null&&v.getParent()!==null&&!m(v);)v=v.getParentOrThrow();return m(v)?v:null}return wi.$createAutoLinkNode=_,wi.$createLinkNode=d,wi.$isAutoLinkNode=E,wi.$isLinkNode=f,wi.AutoLinkNode=p,wi.LinkNode=r,wi.TOGGLE_LINK_COMMAND=T,wi.toggleLink=S,wi}var Oi={},Th;function RC(){if(Th)return Oi;Th=1;var e=pn(),t=jt();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,O={},m){super(m);let{target:v=null,rel:I=null,title:G=null}=O;this.__url=w,this.__target=v,this.__rel=I,this.__title=G}createDOM(w){let O=document.createElement("a");return O.href=this.sanitizeUrl(this.__url),this.__target!==null&&(O.target=this.__target),this.__rel!==null&&(O.rel=this.__rel),this.__title!==null&&(O.title=this.__title),e.addClassNamesToElement(O,w.theme.link),O}updateDOM(w,O){let m=this.__url,v=this.__target,I=this.__rel,G=this.__title;return m!==w.__url&&(O.href=m),v!==w.__target&&(v?O.target=v:O.removeAttribute("target")),I!==w.__rel&&(I?O.rel=I:O.removeAttribute("rel")),G!==w.__title&&(G?O.title=G:O.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:l,priority:1})}}static importJSON(w){let O=d(w.url,{rel:w.rel,target:w.target,title:w.title});return O.setFormat(w.format),O.setIndent(w.indent),O.setDirection(w.direction),O}sanitizeUrl(w){try{let O=new URL(w);if(!n.has(O.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,O=!0){return w=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(w,O),w}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(w,O){if(!t.$isRangeSelection(O))return!1;w=O.anchor.getNode();let m=O.focus.getNode();return this.isParentOf(w)&&this.isParentOf(m)&&0<O.getTextContent().length}}function l(S){let w=null;if(e.isHTMLAnchorElement(S)){let O=S.textContent;(O!==null&&O!==""||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 O=_(w.url,{rel:w.rel,target:w.target,title:w.title});return O.setFormat(w.format),O.setIndent(w.indent),O.setDirection(w.direction),O}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(w,O=!0){return w=this.getParentOrThrow().insertNewAfter(w,O),t.$isElementNode(w)?(O=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),w.append(O),O):null}}function _(S,w){return t.$applyNodeReplacement(new p(S,w))}let E=t.createCommand("TOGGLE_LINK_COMMAND");function T(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=E,Oi.toggleLink=function(S,w={}){let{target:O,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(I=>{if(I=I.getParent(),f(I)){let G=I.getChildren();for(let k=0;k<G.length;k++)I.insertBefore(G[k]);I.remove()}});else{if(w.length===1){let k=T(w[0],f);if(k!==null){k.setURL(S),O!==void 0&&k.setTarget(O),v!==null&&k.setRel(v),m!==void 0&&k.setTitle(m);return}}let I=null,G=null;w.forEach(k=>{var P=k.getParent();if(P!==G&&P!==null&&(!t.$isElementNode(k)||k.isInline()))if(f(P))G=P,P.setURL(S),O!==void 0&&P.setTarget(O),v!==null&&G.setRel(v),m!==void 0&&G.setTitle(m);else if(P.is(I)||(I=P,G=d(S,{rel:v,target:O,title:m}),f(P)?k.getPreviousSibling()===null?P.insertBefore(G):P.insertAfter(G):k.insertBefore(G)),f(k)){if(!k.is(G)){if(G!==null){P=k.getChildren();for(let H=0;H<P.length;H++)G.append(P[H])}k.remove()}}else G!==null&&G.append(k)})}},Oi}var vu,xh;function xd(){return xh||(xh=1,vu=process.env.NODE_ENV==="development"?MC():RC()),vu}var vh;function bC(){if(vh)return xu;vh=1;var e=xd(),t=qn(),n=pn(),r=jt(),l=rt;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:E,target:T,rel:S,title:w}=_;return e.toggleLink(E,{rel:S,target:T,title:w}),!0}},r.COMMAND_PRIORITY_LOW),f!==void 0?p.registerCommand(r.PASTE_COMMAND,_=>{const E=r.$getSelection();if(!r.$isRangeSelection(E)||E.isCollapsed()||!(_ instanceof ClipboardEvent)||_.clipboardData==null)return!1;const T=_.clipboardData.getData("text");return f(T)?E.getNodes().some(S=>r.$isElementNode(S))?!1:(p.dispatchCommand(e.TOGGLE_LINK_COMMAND,T),_.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,f]),null}return xu.LinkPlugin=d,xu}var Su={},Sh;function LC(){if(Sh)return Su;Sh=1;var e=xd(),t=qn(),n=pn(),r=jt(),l=rt;return Su.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:E,rel:T,title:S}=p;return e.toggleLink(_,{rel:T,target:E,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 E=p.clipboardData.getData("text");return d(E)?_.getNodes().some(T=>r.$isElementNode(T))?!1:(f.dispatchCommand(e.TOGGLE_LINK_COMMAND,E),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[f,d]),null},Su}const IC=process.env.NODE_ENV==="development"?bC():LC();var kC=IC,wu={},Jt={},wh;function PC(){if(wh)return Jt;wh=1;var e=jt(),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),it=Math.min(le.rowIndex,Le.rowIndex),st=Math.max(le.rowIndex,Le.rowIndex);return{fromX:Math.min(Me,je),fromY:Math.min(it,st),toX:Math.max(Me,je),toY:Math.max(it,st)}}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 it=je.getParent();if(!e.DEPRECATED_$isGridNode(it))throw Error("Expected tableNode to have a parent GridNode");const st=Me.getParents()[1];if(st!==it){if(it.isParentOf(Me)){const It=st.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),It.getKey())}else{const It=it.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),Me.getKey())}return this.getNodes()}const[ot,St,Ge]=e.DEPRECATED_$computeGridMap(it,Le,Me);let ze=Math.min(St.startColumn,Ge.startColumn),tt=Math.min(St.startRow,Ge.startRow),yt=Math.max(St.startColumn+St.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(St.startRow+St.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:rn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,rn),yt=Math.max(yt,bt+Vt.__colSpan-1),Nt=Math.max(Nt,rn+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(ot[gt+bt][Vt]);Et=Vt}if(tt<gt){const It=xt-Et,Vt=gt-1;for(let bt=0;bt<=It;bt++)$t(ot[Vt][Et+bt]);gt=Vt}if(yt>xt){const It=mt-gt,Vt=xt+1;for(let bt=0;bt<=It;bt++)$t(ot[gt+bt][Vt]);xt=Vt}if(Nt>mt){const It=xt-Et,Vt=mt+1;for(let bt=0;bt<=It;bt++)$t(ot[Vt][Et+bt]);mt=Vt}}const Kt=[it];let nn=null;for(let It=tt;It<=Nt;It++)for(let Vt=ze;Vt<=yt;Vt++){const{cell:bt}=ot[It][Vt],rn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(rn))throw Error("Expected GridCellNode parent to be a GridRowNode");rn!==nn&&Kt.push(rn),Kt.push(bt,...d(bt)),nn=rn}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:E,priority:0}),th:ie=>({conversion:E,priority:0})}}static importJSON(ie){const le=ie.colSpan||1,ve=ie.rowSpan||1,Le=T(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 E(Oe){const ie=Oe,le=Oe.nodeName.toLowerCase();let ve;f.test(ie.style.width)&&(ve=parseFloat(ie.style.width));const Le=T(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,it)=>{if(S(it)&&!e.$isElementNode(je)){const st=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
79
|
-
`?null:(st.append(je),st)}return je},node:Le}}function T(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:O,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 O(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 I=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Oe=>I?(Oe||window).getSelection():null;class k{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 st=le[Me].target.nodeName;if(st==="TABLE"||st==="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,it=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const st=G(ve._window);st&&st.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==it||le))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&it===this.focusY)return;if(this.focusX=je,this.focusY=it,this.isHighlightingCells){const st=e.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&S(st)){const ot=st.getKey();this.gridSelection=this.gridSelection.clone()||l(),this.focusCellNodeKey=ot,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(),it=e.$createTextNode();je.append(it),Me.append(je),Me.getChildren().forEach(st=>{st!==je&&st.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 k(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 it=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",it),Me.listenersToRemove.add(()=>je.removeEventListener("mousedown",it)),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 st=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(),nn=e.$createParagraphNode();return Kt.forEach(It=>nn.append(It)),mt.replace(nn),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,st(Ge),e.COMMAND_PRIORITY_CRITICAL))});const ot=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,ot,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.KEY_DELETE_COMMAND,ot,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 St(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(),nn=t.$findMatchingParent(gt.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=nn&&t.$findMatchingParent(nn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),Vt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(nn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(Vt))return!1;const bt=It.getIndexWithinParent(),rn=Math.min(Vt.getChildrenSize()-1,bt+Kt-1),Or=nn.getIndexWithinParent(),_i=Math.min(It.getChildrenSize()-1,Or+$t-1),pe=Math.min(Or,_i),Ze=Math.min(bt,rn),lt=Math.max(Or,_i),wt=Math.max(bt,rn),Gt=Vt.getChildren();let Bt=0,Pt,kt;for(let Ht=Ze;Ht<=wt;Ht++){const on=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(on))return!1;const an=mt[Bt];if(!e.DEPRECATED_$isGridRowNode(an))return!1;const bn=on.getChildren(),yr=an.getChildren();let Zn=0;for(let fn=pe;fn<=lt;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===wt&&fn===lt&&(kt=sr.getKey());const Ai=sr.getChildren();or.getChildren().forEach(Nr=>{e.$isTextNode(Nr)&&e.$createParagraphNode().append(Nr),sr.append(Nr)}),Ai.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,nn=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 nn&&(gt.is(xt)||(Me.setAnchorCellForSelection(St(gt)),Me.setFocusCellForSelection(St(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 ot=ve,St={elem:ot,hasBackgroundColor:ot.style.backgroundColor!=="",highlighted:!1,x:Le,y:Me};ve._cell=St;let Ge=ie[Me];Ge===void 0&&(Ge=ie[Me]=[]),Ge[Le]=St}else{const ot=ve.firstChild;if(ot!=null){ve=ot;continue}}const it=ve.nextSibling;if(it!=null){Le++,ve=it;continue}const st=ve.parentNode;if(st!=null){const ot=st.nextSibling;if(ot==null)break;Me++,Le=0,ve=ot}}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 it=e.$getNearestNodeFromDOMNode(je.elem);it!==null&&ie(je,it,{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 D="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(${D})`):le.style.setProperty("background-image",`linear-gradient(to right, rgba(${D},0.85), rgba(${D},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:it}=Me,st=t.$findMatchingParent(je.getNode(),S),ot=t.$findMatchingParent(it.getNode(),S);if(!S(st)||!st.is(ot))return!1;const St=W(st);if(St!==ve&&St!=null){const xt=Oe.getElementByKey(St.getKey());if(xt!=null)return Le.grid=ce(xt),J(Oe,ie,le,St,Le)}const Ge=Oe.getElementByKey(st.__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"?st.getFirstChild():st.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(st,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:it}=Me,st=t.$findMatchingParent(je.getNode(),S),ot=t.$findMatchingParent(it.getNode(),S),[St]=Me.getNodes(),Ge=Oe.getElementByKey(St.getKey());if(!S(st)||!S(ot)||!B(St)||Ge==null)return!1;Le.updateTableGridSelection(Me);const ze=ce(Ge),tt=ve.getCordsFromCellNode(st,ze),yt=ve.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Le.setAnchorCellForSelection(yt),R(ie),ie.shiftKey){const Nt=ve.getCordsFromCellNode(ot,ze);return Ee(Le,St,Nt.x,Nt.y,le)}else ot.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 it=je.getChildrenSize();for(let st=0;st<it;st++){const ot=document.createElement("col");Le.append(ot)}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 it=je.findIndex(st=>{if(!st)return;const{elem:ot}=st;return e.$getNearestNodeFromDOMNode(ot)===ie});if(it!==-1)return{x:it,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 M(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 it=p.NO_STATUS;typeof le=="object"?(Le===0&&le.rows&&(it|=p.ROW),je===0&&le.columns&&(it|=p.COLUMN)):le&&(Le===0&&(it|=p.ROW),je===0&&(it|=p.COLUMN));const st=T(it),ot=e.$createParagraphNode();ot.append(e.$createTextNode()),st.append(ot),Me.append(st)}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 it=0;it<ve;it++){const st=je.getChildren(),ot=st.length,St=m();for(let Ge=0;Ge<ot;Ge++){const ze=st[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=T(Nt,1,Et);gt.append(e.$createParagraphNode()),St.append(gt)}le?je.insertAfter(St):je.insertBefore(St)}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),it=Me[0].length,{startRow:st}=je;if(Oe){const ot=st+ve.__rowSpan-1,St=Me[ot],Ge=m();for(let tt=0;tt<it;tt++){const{cell:yt,startRow:Nt}=St[tt];Nt+yt.__rowSpan-1<=ot?Ge.append(T(p.NO_STATUS).append(e.$createParagraphNode())):yt.setRowSpan(yt.__rowSpan+1)}const ze=Le.getChildAtIndex(ot);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const ot=Me[st],St=m();for(let ze=0;ze<it;ze++){const{cell:tt,startRow:yt}=ot[ze];yt===st?St.append(T(p.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Le.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(St)}}function Re(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren(),je=[];for(let it=0;it<Me.length;it++){const st=Me[it];if(v(st))for(let ot=0;ot<ve;ot++){const St=st.getChildren();if(ie>=St.length||ie<0)throw new Error("Table column target index out of range");const Ge=St[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=T(yt);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:it,targetCell:st})=>{le?st.insertAfter(it):st.insertBefore(it)}),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),[it,st,ot]=e.DEPRECATED_$computeGridMap(je,Me,Le),St=it.length,Ge=Oe?Math.max(st.startColumn,ot.startColumn):Math.min(st.startColumn,ot.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=T(p.NO_STATUS).append(e.$createParagraphNode());return yt===null&&(yt=gt),gt}let Et=tt;e:for(let gt=0;gt<St;gt++){if(gt!==0){const nn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected row nextSibling to be a row");Et=nn}const xt=it[gt];if(ze<0){At(Et,Nt());continue}const{cell:mt,startColumn:$t,startRow:Kt}=xt[ze];if($t+mt.__colSpan-1<=ze){let nn=mt,It=Kt,Vt=ze;for(;It!==gt&&nn.__rowSpan>1;)if(Vt-=mt.__colSpan,Vt>=0){const{cell:bt,startRow:rn}=xt[Vt];nn=bt,It=rn}else{Et.append(Nt());continue e}nn.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,it,st]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startRow:ot}=it,{startRow:St}=st,Ge=St+Me.__rowSpan-1;if(je.length===Ge-ot+1){Le.remove();return}const ze=je[0].length,tt=je[Ge+1],yt=Le.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=ot;Nt--){for(let gt=ze-1;gt>=0;gt--){const{cell:xt,startRow:mt,startColumn:$t}=je[Nt][gt];if($t===gt&&(Nt===ot&&mt<ot&&xt.setRowSpan(xt.__rowSpan-(mt-ot)),mt>=ot&&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[ot-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,it,st]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startColumn:ot}=it,{startRow:St,startColumn:Ge}=st,ze=Math.min(ot,Ge),tt=Math.max(ot+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:nn}=je[mt][$t];if(nn<ze){if($t===ze){const It=ze-nn;Kt.setColSpan(Kt.__colSpan-Math.min(yt,Kt.__colSpan-It))}}else if(nn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-nn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const gt=je[St],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 it=1;it<Me;it++)le.insertAfter(T(p.NO_STATUS));le.setColSpan(1)}if(je>1){const[it,st]=e.DEPRECATED_$computeGridMap(Le,le,le),{startColumn:ot,startRow:St}=st;let Ge;for(let ze=1;ze<je;ze++){const tt=St+ze,yt=it[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<ot;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,T(p.NO_STATUS));else for(let Et=0;Et<Me;Et++)Nt.insertAfter(T(p.NO_STATUS))}le.setRowSpan(1)}}const tn=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=l,Jt.$createTableCellNode=T,Jt.$createTableNode=_e,Jt.$createTableNodeWithDimensions=M,Jt.$createTableRowNode=m,Jt.$deleteTableColumn=Fe,Jt.$deleteTableColumn__EXPERIMENTAL=Be,Jt.$deleteTableRow__EXPERIMENTAL=qe,Jt.$getElementGridForTableNode=X,Jt.$getTableCellNodeFromLexicalNode=F,Jt.$getTableColumnIndexFromTableCellNode=ee,Jt.$getTableNodeFromLexicalNodeOrThrow=ye,Jt.$getTableRowIndexFromTableCellNode=De,Jt.$getTableRowNodeFromTableCellNodeOrThrow=se,Jt.$insertTableColumn=Re,Jt.$insertTableColumn__EXPERIMENTAL=ke,Jt.$insertTableRow=be,Jt.$insertTableRow__EXPERIMENTAL=Ne,Jt.$isGridSelection=r,Jt.$isTableCellNode=S,Jt.$isTableNode=B,Jt.$isTableRowNode=v,Jt.$removeTableRowAtIndex=ue,Jt.$unmergeCell=Ut,Jt.INSERT_TABLE_COMMAND=tn,Jt.TableCellHeaderStates=p,Jt.TableCellNode=_,Jt.TableNode=U,Jt.TableRowNode=w,Jt.TableSelection=k,Jt.applyTableHandlers=H,Jt.getCellFromTarget=te,Jt.getTableSelectionFromTableElement=re,Jt}var Xt={},Oh;function $C(){if(Oh)return Xt;Oh=1;var e=jt(),t=pn();function n(B){let M=new URLSearchParams;M.append("code",B);for(let F=1;F<arguments.length;F++)M.append("v",arguments[F]);throw Error(`Minified Lexical error #${B}; visit https://lexical.dev/docs/error?${M} 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(M,F,se){super(F,se),this.gridKey=M}getCachedNodes(){return this._cachedNodes}setCachedNodes(M){this._cachedNodes=M}is(M){return l(M)?this.gridKey===M.gridKey&&this.anchor.is(M.anchor)&&this.focus.is(M.focus):!1}set(M,F,se){this.dirty=!0,this.gridKey=M,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(M){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(M)}getShape(){var M=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(M)||n(103),M=e.DEPRECATED_$getGridCellNodeRect(M),M===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(M.columnIndex,se.columnIndex);let ye=Math.max(M.columnIndex,se.columnIndex),De=Math.min(M.rowIndex,se.rowIndex);return M=Math.max(M.rowIndex,se.rowIndex),{fromX:Math.min(F,ye),fromY:Math.min(De,M),toX:Math.max(F,ye),toY:Math.max(De,M)}}getNodes(){function M(ut){let{cell:At,startColumn:Ut,startRow:tn}=ut;be=Math.min(be,Ut),Ne=Math.min(Ne,tn),Re=Math.max(Re,Ut+At.__colSpan-1),ke=Math.max(ke,tn+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++)M(ee[ye+Be][se])}if(Ne<ye)for(qe=De-se,--ye,Be=0;Be<=qe;Be++)M(ee[ye][se+Be]);if(Re>De)for(qe=Fe-ye,De+=1,Be=0;Be<=qe;Be++)M(ee[ye+Be][De]);if(ke>Fe)for(qe=De-se,Fe+=1,Be=0;Be<=qe;Be++)M(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 M=this.getNodes(),F="";for(let se=0;se<M.length;se++)F+=M[se].getTextContent();return F}}function l(B){return B instanceof r}function d(){let B=e.$createPoint("root",0,"element"),M=e.$createPoint("root",0,"element");return new r("root",B,M)}function f(B){let M=[],F=[B];for(;0<F.length;){let se=F.pop();se===void 0&&n(112),e.$isElementNode(se)&&F.unshift(...se.getChildren()),se!==B&&M.push(se)}return M}let p=/^(\d+(?:\.\d+)?)px$/,_={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class E extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(M){let F=new E(M.__headerState,M.__colSpan,M.__width,M.__key);return F.__rowSpan=M.__rowSpan,F.__backgroundColor=M.__backgroundColor,F}static importDOM(){return{td:()=>({conversion:T,priority:0}),th:()=>({conversion:T,priority:0})}}static importJSON(M){let F=M.rowSpan||1,se=S(M.headerState,M.colSpan||1,M.width||void 0);return se.__rowSpan=F,se.__backgroundColor=M.backgroundColor||null,se}constructor(M=_.NO_STATUS,F=1,se,ye){super(F,ye),this.__headerState=M,this.__width=se,this.__backgroundColor=null}createDOM(M){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,M.theme.tableCell,this.hasHeader()&&M.theme.tableCellHeader),F}exportDOM(M){if({element:M}=super.exportDOM(M),M){var F=this.getParentOrThrow().getChildrenSize();M.style.border="1px solid black",1<this.__colSpan&&(M.colSpan=this.__colSpan),1<this.__rowSpan&&(M.rowSpan=this.__rowSpan),M.style.width=`${this.getWidth()||Math.max(90,700/F)}px`,M.style.verticalAlign="top",M.style.textAlign="start",F=this.getBackgroundColor(),F!==null?M.style.backgroundColor=F:this.hasHeader()&&(M.style.backgroundColor="#f2f3f5")}return{element:M}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(M){return this.getWritable().__headerState=M,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(M){return this.getWritable().__width=M,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(M){this.getWritable().__backgroundColor=M}toggleHeaderStyle(M){let F=this.getWritable();return F.__headerState=(F.__headerState&M)===M?F.__headerState-M:F.__headerState+M,F}hasHeaderState(M){return(this.getHeaderStyles()&M)===M}hasHeader(){return this.getLatest().__headerState!==_.NO_STATUS}updateDOM(M){return M.__headerState!==this.__headerState||M.__width!==this.__width||M.__colSpan!==this.__colSpan||M.__rowSpan!==this.__rowSpan||M.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(B){var M=B.nodeName.toLowerCase();let F;return p.test(B.style.width)&&(F=parseFloat(B.style.width)),M=S(M==="th"?_.ROW:_.NO_STATUS,B.colSpan,F),M.__rowSpan=B.rowSpan,B=B.style.backgroundColor,B!==""&&(M.__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:M}}function S(B,M=1,F){return e.$applyNodeReplacement(new E(B,M,F))}function w(B){return B instanceof E}class O extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(M){return new O(M.__height,M.__key)}static importDOM(){return{tr:()=>({conversion:m,priority:0})}}static importJSON(M){return v(M.height)}constructor(M,F){super(F),this.__height=M}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(M){let F=document.createElement("tr");return this.__height&&(F.style.height=`${this.__height}px`),t.addClassNamesToElement(F,M.theme.tableRow),F}isShadowRoot(){return!0}setHeight(M){return this.getWritable().__height=M,this.__height}getHeight(){return this.getLatest().__height}updateDOM(M){return M.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function m(B){let M;return p.test(B.style.height)&&(M=parseFloat(B.style.height)),{node:v(M)}}function v(B){return e.$applyNodeReplacement(new O(B))}function I(B){return B instanceof O}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class k{constructor(M,F){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=F,this.editor=M,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(M=>M())}trackTableGrid(){let M=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),M.observe(F,{childList:!0,subtree:!0})})}clearHighlight(){let M=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(),M.update(()=>{var F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");if(F=M.getElementByKey(this.tableNodeKey),!F)throw Error("Expected to find TableElement in DOM");F=H(F),j(M,F,null),e.$setSelection(null),M.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let M=this.editor;M.update(()=>{let F=M.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(F,M._config.theme.tableSelection),F.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let M=this.editor;M.update(()=>{let F=M.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(F,M._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(M){if(M!=null&&M.gridKey===this.tableNodeKey){let F=this.editor;this.gridSelection=M,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(F,this.grid,this.gridSelection)}else M==null?this.clearHighlight():(this.tableNodeKey=M.gridKey,this.updateTableGridSelection(M))}setFocusCellForSelection(M,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=M.x;let De=M.y;if(this.focusCell=M,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(M.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(M){this.isHighlightingCells=!1,this.anchorCell=M,this.anchorX=M.x,this.anchorY=M.y,this.editor.update(()=>{var F=e.$getNearestNodeFromDOMNode(M.elem);w(F)&&(F=F.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=F)})}formatCells(M){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(M))}),e.$setSelection(F),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let M=this.editor;M.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(M,this.grid,null),e.$setSelection(null),M.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function P(B){for(;B!=null;){let M=B.nodeName;if(M==="TD"||M==="TH"){if(B=B._cell,B===void 0)break;return B}B=B.parentNode}return null}function H(B){let M=[],F={cells:M,columns:0,rows:0};var se=B.firstChild;let ye=B=0;for(M.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=M[ye];ee===void 0&&(ee=M[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,M,F){let se=new Set(F?F.getNodes():[]);re(M,(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,M){({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&&M(De,ee,{x:ye,y:F})}}}function te(B,M){M.disableHighlightStyle(),re(M.grid,F=>{F.highlighted=!0,Te(B,F)})}function ce(B,M){M.enableHighlightStyle(),re(M.grid,F=>{let se=F.elem;F.highlighted=!1,Se(B,F),se.getAttribute("style")||se.removeAttribute("style")})}let V=(B,M,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)?(B=M.getCellNodeFromCordsOrThrow(F+(De?1:-1),se,B.grid),De?B.selectStart():B.selectEnd()):se!==(De?B.grid.rows-1:0)?(B=M.getCellNodeFromCordsOrThrow(De?0:B.grid.columns-1,se+(De?1:-1),B.grid),De?B.selectStart():B.selectEnd()):De?M.selectNext():M.selectPrevious(),!0;case"up":return se!==0?M.getCellNodeFromCordsOrThrow(F,se-1,B.grid).selectEnd():M.selectPrevious(),!0;case"down":return se!==B.grid.rows-1?M.getCellNodeFromCordsOrThrow(F,se+1,B.grid).selectStart():M.selectNext(),!0;default:return!1}},z=(B,M,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)&&B.setFocusCellForSelection(M.getCellFromCordsOrThrow(F+(De?1:-1),se,B.grid)),!0;case"up":return se!==0?(B.setFocusCellForSelection(M.getCellFromCordsOrThrow(F,se-1,B.grid)),!0):!1;case"down":return se!==B.grid.rows-1?(B.setFocusCellForSelection(M.getCellFromCordsOrThrow(F,se+1,B.grid)),!0):!1;default:return!1}};function q(B,M){if(e.$isRangeSelection(B)||l(B)){let F=M.isParentOf(B.anchor.getNode());return B=M.isParentOf(B.focus.getNode()),F&&B}return!1}function Te(B,M){B=M.elem,M=e.$getNearestNodeFromDOMNode(B),w(M)||n(131),M.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,M){B=M.elem,M=e.$getNearestNodeFromDOMNode(B),w(M)||n(131),M.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,M,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,M,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(D(M),B=se.getCordsFromCellNode(ee,ye.grid),M.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),D(M),M.shiftKey?(M=se.getCordsFromCellNode(ne,B),z(ye,ee,M.x,M.y,F)):(ne.selectEnd(),!0))}return!1}function D(B){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation()}class Z extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(M){return new Z(M.__key)}static importDOM(){return{table:()=>({conversion:oe,priority:1})}}static importJSON(){return Y()}constructor(M){super(M)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(M){let F=document.createElement("table");return t.addClassNamesToElement(F,M.theme.table),F}updateDOM(){return!1}exportDOM(M){return{...super.exportDOM(M),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(),!I(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(M,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)===M}),De!==-1))return{x:De,y:F}}throw Error("Cell not found in table.")}getCellFromCords(M,F,se){return{cells:se}=se,F=se[F],F==null?null:(M=F[M],M??null)}getCellFromCordsOrThrow(M,F,se){if(M=this.getCellFromCords(M,F,se),!M)throw Error("Cell not found at cords.");return M}getCellNodeFromCords(M,F,se){return M=this.getCellFromCords(M,F,se),M==null?null:(M=e.$getNearestNodeFromDOMNode(M.elem),w(M)?M:null)}getCellNodeFromCordsOrThrow(M,F,se){if(M=this.getCellNodeFromCords(M,F,se),!M)throw Error("Node at cords not TableCellNode.");return M}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,M=>I(M)),I(B))return B;throw Error("Expected table cell to be inside of table row.")}function R(B){if(B=t.$findMatchingParent(B,M=>W(M)),W(B))return B;throw Error("Expected table cell to be inside of table.")}function U(B,M){let F=R(B),{x:se,y:ye}=F.getCordsFromCellNode(B,M);return{above:F.getCellNodeFromCords(se,ye-1,M),below:F.getCellNodeFromCords(se,ye+1,M),left:F.getCellNodeFromCords(se-1,ye,M),right:F.getCellNodeFromCords(se+1,ye,M)}}function X(B){let M=B.getFirstDescendant();M==null?B.selectStart():M.getParentOrThrow().selectStart()}function fe(B,M){let F=B.getFirstChild();F!==null?F.insertBefore(M):B.append(M)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Xt.$createGridSelection=d,Xt.$createTableCellNode=S,Xt.$createTableNode=Y,Xt.$createTableNodeWithDimensions=function(B,M,F=!0){let se=Y();for(let De=0;De<B;De++){let ee=v();for(let ne=0;ne<M;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},Xt.$createTableRowNode=v,Xt.$deleteTableColumn=function(B,M){let F=B.getChildren();for(let ye=0;ye<F.length;ye++){var se=F[ye];if(I(se)){if(se=se.getChildren(),M>=se.length||0>M)throw Error("Table column target index out of range");se[M].remove()}}return B},Xt.$deleteTableColumn__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var M=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(M);[M]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,M);var{startColumn:ne}=De;let{startRow:ue,startColumn:be}=ee;B=Math.min(ne,be),ne=Math.max(ne+F.__colSpan-1,be+M.__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],M=B[be+M.__colSpan],M!==void 0?({cell:M}=M,X(M)):({cell:M}=B[be-1],X(M))}},Xt.$deleteTableRow__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var M=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(M);[B]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,B);({startRow:M}=De);var{startRow:ne}=ee;if(B=ne+B.__rowSpan-1,ye.length===B-M+1)se.remove();else{ne=ye[0].length;var ue=ye[B+1],be=se.getChildAtIndex(B+1);for(let Re=B;Re>=M;Re--){for(var Ne=ne-1;0<=Ne;Ne--){let{cell:ke,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===M&&Fe<M&&ke.setRowSpan(ke.__rowSpan-(Fe-M)),Fe>=M&&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:M}=ue[0],X(M)):({cell:M}=ye[M-1][0],X(M))}},Xt.$getElementGridForTableNode=function(B,M){if(B=B.getElementByKey(M.getKey()),B==null)throw Error("Table Element Not Found");return H(B)},Xt.$getTableCellNodeFromLexicalNode=function(B){return B=t.$findMatchingParent(B,M=>w(M)),w(B)?B:null},Xt.$getTableColumnIndexFromTableCellNode=function(B){return J(B).getChildren().findIndex(M=>M.is(B))},Xt.$getTableNodeFromLexicalNodeOrThrow=R,Xt.$getTableRowIndexFromTableCellNode=function(B){let M=J(B);return R(M).getChildren().findIndex(F=>F.is(M))},Xt.$getTableRowNodeFromTableCellNodeOrThrow=J,Xt.$insertTableColumn=function(B,M,F=!0,se,ye){let De=B.getChildren(),ee=[];for(let be=0;be<De.length;be++){let Ne=De[be];if(I(Ne))for(let Re=0;Re<se;Re++){var ne=Ne.getChildren();if(M>=ne.length||0>M)throw Error("Table column target index out of range");ne=ne[M],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},Xt.$insertTableColumn__EXPERIMENTAL=function(B=!0){function M(){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,M());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:tn}=Re[At];Be=Ut,ut=tn}else{Ne.append(M());continue e}Be.insertAfter(M())}else ke.setColSpan(ke.__colSpan+1)}be!==null&&X(be)},Xt.$insertTableRow=function(B,M,F=!0,se,ye){var De=B.getChildren();if(M>=De.length||0>M)throw Error("Table row target index out of range");if(M=De[M],I(M))for(De=0;De<se;De++){let ne=M.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?M.insertAfter(be):M.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return B},Xt.$insertTableRow__EXPERIMENTAL=function(B=!0){var M=e.$getSelection();if(!e.$INTERNAL_isPointSelection(M))throw Error("Expected a INTERNAL_PointSelection");M=M.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(M),[ye,De]=e.DEPRECATED_$computeGridMap(se,F,F);M=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<M;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)}M=se.getChildAtIndex(B),e.DEPRECATED_$isGridRowNode(M)||n(119),M.insertAfter(ee)}else{for(ne=ye[ee],B=v(),ue=0;ue<M;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne===ee?B.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}M=se.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(M)||n(119),M.insertBefore(B)}},Xt.$isGridSelection=l,Xt.$isTableCellNode=w,Xt.$isTableNode=W,Xt.$isTableRowNode=I,Xt.$removeTableRowAtIndex=function(B,M){let F=B.getChildren();if(M>=F.length||0>M)throw Error("Expected table cell to be inside of table row.");return F[M].remove(),B},Xt.$unmergeCell=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");B=B.anchor.getNode();let[M,F,se]=e.DEPRECATED_$getNodeTriplet(B);B=M.__colSpan;let ye=M.__rowSpan;if(1<B){for(var De=1;De<B;De++)M.insertAfter(S(_.NO_STATUS));M.setColSpan(1)}if(1<ye){let[ue,be]=e.DEPRECATED_$computeGridMap(se,M,M),{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))}M.setRowSpan(1)}},Xt.INSERT_TABLE_COMMAND=_e,Xt.TableCellHeaderStates=_,Xt.TableCellNode=E,Xt.TableNode=Z,Xt.TableRowNode=O,Xt.TableSelection=k,Xt.applyTableHandlers=function(B,M,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 k(F,B.getKey()),ne=F._window||window;M.__lexicalTableSelection=ee,M.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&ne){var Re=P(Ne.target);Re!==null&&(D(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))?(D(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))}),M=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,M,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.KEY_DELETE_COMMAND,M,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:(D(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(),tn=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,tn),Be=Math.max(Be,ut),Ut=Math.max(Ut,tn),At=At.getChildren(),tn=0;let Oe,ie;for(ut=qe;ut<=Ut;ut++){var le=At[ut];if(!e.DEPRECATED_$isGridRowNode(le))return!1;var ve=Ne[tn];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 it=ve[Le];if(!e.DEPRECATED_$isGridCellNode(it))return!1;ut===qe&&Me===Fe?Oe=je.getKey():ut===Ut&&Me===Be&&(ie=je.getKey());let st=je.getChildren();it.getChildren().forEach(ot=>{e.$isTextNode(ot)&&e.$createParagraphNode().append(ot),je.append(ot)}),st.forEach(ot=>ot.remove()),Le++}tn++}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},Xt.getCellFromTarget=P,Xt.getTableSelectionFromTableElement=function(B){return B.__lexicalTableSelection},Xt}var Ou,Dh;function vd(){return Dh||(Dh=1,Ou=process.env.NODE_ENV==="development"?PC():$C()),Ou}var Ah;function FC(){if(Ah)return wu;Ah=1;var e=qn(),t=vd(),n=pn(),r=jt(),l=rt;function d({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){const[E]=e.useLexicalComposerContext();return l.useEffect(()=>{if(!E.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return E.registerCommand(t.INSERT_TABLE_COMMAND,({columns:T,rows:S,includeHeaders:w})=>{const O=t.$createTableNodeWithDimensions(Number(S),Number(T),w);n.$insertNodeToNearestRoot(O);const m=O.getFirstDescendant();return r.$isTextNode(m)&&m.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[E]),l.useEffect(()=>{const T=new Map,S=O=>{const m=O.getKey(),v=E.getElementByKey(m);if(v&&!T.has(m)){const I=t.applyTableHandlers(O,v,E,_);T.set(m,I)}};E.getEditorState().read(()=>{const O=r.$nodesOfType(t.TableNode);for(const m of O)t.$isTableNode(m)&&S(m)});const w=E.registerMutationListener(t.TableNode,O=>{for(const[m,v]of O)if(v==="created")E.getEditorState().read(()=>{const I=r.$getNodeByKey(m);t.$isTableNode(I)&&S(I)});else if(v==="destroyed"){const I=T.get(m);I!==void 0&&(I.removeListeners(),T.delete(m))}});return()=>{w();for(const[,O]of T)O.removeListeners()}},[E,_]),l.useEffect(()=>{if(!f)return E.registerNodeTransform(t.TableCellNode,T=>{if(T.getColSpan()>1||T.getRowSpan()>1){const[,,S]=r.DEPRECATED_$getNodeTriplet(T),[w]=r.DEPRECATED_$computeGridMap(S,T,T),O=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 I=[];for(let G=0;G<O;G++){if(G!==0&&(v=v.getNextSibling(),!r.DEPRECATED_$isGridRowNode(v)))throw Error("Expected TableNode first child to be a RowNode");let k=null;for(let P=0;P<m;P++){const H=w[G][P],j=H.cell;if(H.startRow===G&&H.startColumn===P)k=j,I.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);k!==null?k.insertAfter(re):n.$insertFirst(v,re)}}}for(const G of I)G.setColSpan(1),G.setRowSpan(1)}})},[E,f]),l.useEffect(()=>{if(!p)return E.registerNodeTransform(t.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[E,p,f]),null}return wu.TablePlugin=d,wu}var Du={},Mh;function BC(){if(Mh)return Du;Mh=1;var e=qn(),t=vd(),n=pn(),r=jt(),l=rt;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 Du.TablePlugin=function({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){let[E]=e.useLexicalComposerContext();return l.useEffect(()=>(E.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode])||d(10),E.registerCommand(t.INSERT_TABLE_COMMAND,({columns:T,rows:S,includeHeaders:w})=>(T=t.$createTableNodeWithDimensions(Number(S),Number(T),w),n.$insertNodeToNearestRoot(T),T=T.getFirstDescendant(),r.$isTextNode(T)&&T.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[E]),l.useEffect(()=>{let T=new Map,S=O=>{const m=O.getKey(),v=E.getElementByKey(m);v&&!T.has(m)&&(O=t.applyTableHandlers(O,v,E,_),T.set(m,O))};E.getEditorState().read(()=>{let O=r.$nodesOfType(t.TableNode);for(let m of O)t.$isTableNode(m)&&S(m)});let w=E.registerMutationListener(t.TableNode,O=>{for(const[m,v]of O)v==="created"?E.getEditorState().read(()=>{const I=r.$getNodeByKey(m);t.$isTableNode(I)&&S(I)}):v==="destroyed"&&(O=T.get(m),O!==void 0&&(O.removeListeners(),T.delete(m)))});return()=>{w();for(let[,O]of T)O.removeListeners()}},[E,_]),l.useEffect(()=>{if(!f)return E.registerNodeTransform(t.TableCellNode,T=>{if(1<T.getColSpan()||1<T.getRowSpan()){var[,,S]=r.DEPRECATED_$getNodeTriplet(T);[T]=r.DEPRECATED_$computeGridMap(S,T,T);let O=T.length,m=T[0].length;if(S=S.getFirstChild(),!r.DEPRECATED_$isGridRowNode(S))throw Error("Expected TableNode first child to be a RowNode");let v=[];for(let I=0;I<O;I++){if(I!==0&&(S=S.getNextSibling(),!r.DEPRECATED_$isGridRowNode(S)))throw Error("Expected TableNode first child to be a RowNode");let G=null;for(let k=0;k<m;k++){var w=T[I][k];let P=w.cell;if(w.startRow===I&&w.startColumn===k)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 I of v)I.setColSpan(1),I.setRowSpan(1)}})},[E,f]),l.useEffect(()=>{if(!p)return E.registerNodeTransform(t.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[E,p,f]),null},Du}const HC=process.env.NODE_ENV==="development"?FC():BC();var WC=HC,Pn={},Au={exports:{}},Rh;function Dp(){return Rh||(Rh=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
74
|
+
`),P=Y.length,!e.$isTextNode(G)||I>=P)Y=G.getParent(),G.remove(),Y==null||Y.getChildrenSize()!==0||e.$isRootNode(Y)||Y.remove(),I-=P+W,G=k;else{let re=G.getKey();W=m.getEditorState().read(()=>{const ue=e.$getNodeByKey(re);return e.$isTextNode(ue)&&ue.isSimpleText()?ue.getTextContent():null}),k=P-I;let te=Y.slice(0,k);W!==null&&W!==Y?(I=e.$getPreviousSelection(),P=G,G.isSimpleText()?G.setTextContent(W):(P=e.$createTextNode(W),G.replace(P)),e.$isRangeSelection(I)&&I.isCollapsed()&&(I=I.anchor.offset,P.select(I,I))):G.isSimpleText()?(W=v.key===re,Y=v.offset,Y<I&&(Y=P),I=W?Y-I:0,P=W?Y:k,W&&I===0?([I]=G.splitText(I,P),I.remove()):([,I]=G.splitText(I,P),I.remove())):(I=e.$createTextNode(te),G.replace(I)),I=0}}},Vn}var au,Zf;function vs(){return Zf||(Zf=1,au=process.env.NODE_ENV==="development"?nC():rC()),au}var Jf;function iC(){if(Jf)return Sn;Jf=1;var e=vs(),t=jt();function n(...te){return()=>{te.forEach(ue=>ue())}}function r(te){return`${te}px`}const l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(te,ue,q){let H=null,V=null,Ee=null,Se=[];const Te=document.createElement("div");function de(){if(H===null)throw Error("Unexpected null rootDOMNode");if(V===null)throw Error("Unexpected null parentDOMNode");const{left:oe,top:j}=H.getBoundingClientRect(),K=V,J=e.createRectsFromDOMRange(te,ue);Te.isConnected||K.append(Te);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-j);_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!==Te&&(Te.append(fe),R=!0),Se[U]=fe}for(;Se.length>J.length;)Se.pop();R&&q(Se)}function z(){V=null,H=null,Ee!==null&&Ee.disconnect(),Ee=null,Te.remove();for(const oe of Se)oe.remove();Se=[]}function O(){const oe=te.getRootElement();if(oe===null)return z();const j=oe.parentElement;if(!(j instanceof HTMLElement))return z();z(),H=oe,V=j,Ee=new MutationObserver(K=>{const J=te.getRootElement(),R=J&&J.parentElement;if(J!==H||R!==V)return O();for(const U of K)if(!Te.contains(U.target))return de()}),Ee.observe(j,l),de()}const Z=te.registerRootListener(O);return()=>{Z(),z()}}function f(te,ue){let q=null,H=null,V=null,Ee=null,Se=()=>{};function Te(de){de.read(()=>{const z=t.$getSelection();if(!t.$isRangeSelection(z)){q=null,H=null,V=null,Ee=null,Se(),Se=()=>{};return}const{anchor:O,focus:Z}=z,oe=O.getNode(),j=oe.getKey(),K=O.offset,J=Z.getNode(),R=J.getKey(),U=Z.offset,X=te.getElementByKey(j),fe=te.getElementByKey(R),_e=q===null||X===null||K!==H||j!==q.getKey()||oe!==q&&(!(q instanceof t.TextNode)||oe.updateDOM(q,X,te._config)),B=V===null||fe===null||U!==Ee||R!==V.getKey()||J!==V&&(!(V instanceof t.TextNode)||J.updateDOM(V,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 ce=ye.firstChild;if(ce===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(ce,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))}ue!==void 0&&ue(Ne)})}}q=oe,H=K,V=J,Ee=U})}return Te(te.getEditorState()),n(te.registerUpdateListener(({editorState:de})=>Te(de)),Se,()=>{Se()})}function p(te,...ue){ue.forEach(q=>{if(typeof q=="string"){const H=q.split(" ").filter(V=>V!=="");te.classList.add(...H)}})}function _(te,...ue){ue.forEach(q=>{typeof q=="string"&&te.classList.remove(...q.split(" "))})}function E(te,ue){for(const q of ue)if(te.type.startsWith(q))return!0;return!1}function T(te,ue){const q=te[Symbol.iterator]();return new Promise((H,V)=>{const Ee=[],Se=()=>{const{done:Te,value:de}=q.next();if(Te)return H(Ee);const z=new FileReader;z.addEventListener("error",V),z.addEventListener("load",()=>{const O=z.result;typeof O=="string"&&Ee.push({file:de,result:O}),Se()}),E(de,ue)?z.readAsDataURL(de):Se()};Se()})}function S(te,ue){const q=[],H=(te||t.$getRoot()).getLatest(),V=ue||(t.$isElementNode(H)?H.getLastDescendant():H);let Ee=H,Se=w(Ee);for(;Ee!==null&&!Ee.is(V);)if(q.push({depth:Se,node:Ee}),t.$isElementNode(Ee)&&Ee.getChildrenSize()>0)Ee=Ee.getFirstChild(),Se++;else{let Te=null;for(;Te===null&&Ee!==null;)Te=Ee.getNextSibling(),Te===null?(Ee=Ee.getParent(),Se--):Ee=Te}return Ee!==null&&Ee.is(V)&&q.push({depth:Se,node:Ee}),q}function w(te){let ue=te,q=0;for(;(ue=ue.getParent())!==null;)q++;return q}function M(te,ue){let q=te;for(;q!=null;){if(q instanceof ue)return q;q=q.getParent()}return null}function m(te){const ue=v(te,q=>t.$isElementNode(q)&&!q.isInline());if(!t.$isElementNode(ue))throw Error(`Expected node ${te.__key} to have closest block element node.`);return ue}const v=(te,ue)=>{let q=te;for(;q!==t.$getRoot()&&q!=null;){if(ue(q))return q;q=q.getParent()}return null};function I(te,ue,q,H){const V=Te=>Te instanceof ue,Ee=Te=>{const de=Te.getChildren();for(let Z=0;Z<de.length;Z++){const oe=de[Z];if(V(oe))return null}let z=Te,O=Te;for(;z!==null;)if(O=z,z=z.getParent(),V(z))return{child:O,parent:z};return null},Se=Te=>{const de=Ee(Te);if(de!==null){const{child:z,parent:O}=de;if(z.is(Te)){H(O,Te);const Z=z.getNextSiblings(),oe=Z.length;if(O.insertAfter(z),oe!==0){const j=q(O);z.insertAfter(j);for(let K=0;K<oe;K++)j.append(Z[K])}!O.canBeEmpty()&&O.getChildrenSize()===0&&O.remove()}}};return te.registerNodeTransform(ue,Se)}function G(te,ue){const H=new Map,V=te._pendingEditorState;for(const[Se,Te]of ue._nodeMap){const de=e.$cloneWithProperties(Te);if(t.$isTextNode(de)){if(!t.$isTextNode(Te))throw Error("Expected node be a TextNode");de.__text=Te.__text}H.set(Se,de)}V&&(V._nodeMap=H),te._dirtyType=2;const Ee=ue._selection;t.$setSelection(Ee===null?null:Ee.clone())}function P(te){const ue=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ue)){const{focus:q}=ue,H=q.getNode(),V=q.offset;if(t.$isRootOrShadowRoot(H)){const Ee=H.getChildAtIndex(V);Ee==null?H.append(te):Ee.insertBefore(te),te.selectNext()}else{let Ee,Se;t.$isTextNode(H)?(Ee=H.getParentOrThrow(),Se=H.getIndexWithinParent(),V>0&&(Se+=1,H.splitText(V))):(Ee=H,Se=V);const[,Te]=t.$splitNode(Ee,Se);Te.insertBefore(te),Te.selectStart()}}else{if(ue!=null){const H=ue.getNodes();H[H.length-1].getTopLevelElementOrThrow().insertAfter(te)}else t.$getRoot().append(te);const q=t.$createParagraphNode();te.insertAfter(q),q.select()}return te.getLatest()}function k(te,ue){const q=ue();return te.replace(q),q.append(te),q}function W(te,ue){return te!==null?Object.getPrototypeOf(te).constructor.name===ue.name:!1}function Y(te,ue){const q=[];for(let H=0;H<te.length;H++){const V=ue(te[H]);V!==null&&q.push(V)}return q}function re(te,ue){const q=te.getFirstChild();q!==null?q.insertBefore(ue):te.append(ue)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=S,Sn.$filter=Y,Sn.$findMatchingParent=v,Sn.$getNearestBlockElementAncestorOrThrow=m,Sn.$getNearestNodeOfType=M,Sn.$insertFirst=re,Sn.$insertNodeToNearestRoot=P,Sn.$restoreEditorState=G,Sn.$wrapNodeInElement=k,Sn.addClassNamesToElement=p,Sn.isMimeType=E,Sn.markSelection=f,Sn.mediaFileReader=T,Sn.mergeRegister=n,Sn.objectKlassEquals=W,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=I,Sn.removeClassNamesFromElement=_,Sn}var wn={},Xf;function sC(){if(Xf)return wn;Xf=1;var e=vs(),t=jt();function n(_){let E=new URLSearchParams;E.append("code",_);for(let T=1;T<arguments.length;T++)E.append("v",arguments[T]);throw Error(`Minified Lexical error #${_}; visit https://lexical.dev/docs/error?${E} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(..._){return()=>{_.forEach(E=>E())}}let l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(_,E,T){function S(){if(m===null)throw Error("Unexpected null rootDOMNode");if(v===null)throw Error("Unexpected null parentDOMNode");let{left:W,top:Y}=m.getBoundingClientRect();var re=v;let te=e.createRectsFromDOMRange(_,E);P.isConnected||re.append(P),re=!1;for(let H=0;H<te.length;H++){var ue=te[H];let V=G[H]||document.createElement("div"),Ee=V.style;Ee.position!=="absolute"&&(Ee.position="absolute",re=!0);var q=`${ue.left-W}px`;Ee.left!==q&&(Ee.left=q,re=!0),q=`${ue.top-Y}px`,Ee.top!==q&&(V.style.top=q,re=!0),q=`${ue.width}px`,Ee.width!==q&&(V.style.width=q,re=!0),ue=`${ue.height}px`,Ee.height!==ue&&(V.style.height=ue,re=!0),V.parentNode!==P&&(P.append(V),re=!0),G[H]=V}for(;G.length>te.length;)G.pop();re&&T(G)}function w(){m=v=null,I!==null&&I.disconnect(),I=null,P.remove();for(let W of G)W.remove();G=[]}function M(){let W=_.getRootElement();if(W===null)return w();let Y=W.parentElement;if(!(Y instanceof HTMLElement))return w();w(),m=W,v=Y,I=new MutationObserver(re=>{let te=_.getRootElement(),ue=te&&te.parentElement;if(te!==m||ue!==v)return M();for(let q of re)if(!P.contains(q.target))return S()}),I.observe(Y,l),S()}let m=null,v=null,I=null,G=[],P=document.createElement("div"),k=_.registerRootListener(M);return()=>{k(),w()}}function f(_,E){for(let T of E)if(_.type.startsWith(T))return!0;return!1}let p=(_,E)=>{for(;_!==t.$getRoot()&&_!=null;){if(E(_))return _;_=_.getParent()}return null};return wn.$splitNode=t.$splitNode,wn.isHTMLAnchorElement=t.isHTMLAnchorElement,wn.isHTMLElement=t.isHTMLElement,wn.$dfs=function(_,E){let T=[];_=(_||t.$getRoot()).getLatest(),E=E||(t.$isElementNode(_)?_.getLastDescendant():_);for(var S=_,w=0;(S=S.getParent())!==null;)w++;for(S=w;_!==null&&!_.is(E);)if(T.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(E)&&T.push({depth:S,node:_}),T},wn.$filter=function(_,E){let T=[];for(let S=0;S<_.length;S++){let w=E(_[S]);w!==null&&T.push(w)}return T},wn.$findMatchingParent=p,wn.$getNearestBlockElementAncestorOrThrow=function(_){let E=p(_,T=>t.$isElementNode(T)&&!T.isInline());return t.$isElementNode(E)||n(4,_.__key),E},wn.$getNearestNodeOfType=function(_,E){for(;_!=null;){if(_ instanceof E)return _;_=_.getParent()}return null},wn.$insertFirst=function(_,E){let T=_.getFirstChild();T!==null?T.insertBefore(E):_.append(E)},wn.$insertNodeToNearestRoot=function(_){var E=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(E)){var{focus:T}=E;if(E=T.getNode(),T=T.offset,t.$isRootOrShadowRoot(E))T=E.getChildAtIndex(T),T==null?E.append(_):T.insertBefore(_),_.selectNext();else{let S,w;t.$isTextNode(E)?(S=E.getParentOrThrow(),w=E.getIndexWithinParent(),0<T&&(w+=1,E.splitText(T))):(S=E,w=T),[,E]=t.$splitNode(S,w),E.insertBefore(_),E.selectStart()}}else E!=null?(E=E.getNodes(),E[E.length-1].getTopLevelElementOrThrow().insertAfter(_)):t.$getRoot().append(_),E=t.$createParagraphNode(),_.insertAfter(E),E.select();return _.getLatest()},wn.$restoreEditorState=function(_,E){let T=new Map,S=_._pendingEditorState;for(let[w,M]of E._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}T.set(w,m)}S&&(S._nodeMap=T),_._dirtyType=2,_=E._selection,t.$setSelection(_===null?null:_.clone())},wn.$wrapNodeInElement=function(_,E){return E=E(),_.replace(E),E.append(_),E},wn.addClassNamesToElement=function(_,...E){E.forEach(T=>{typeof T=="string"&&(T=T.split(" ").filter(S=>S!==""),_.classList.add(...T))})},wn.isMimeType=f,wn.markSelection=function(_,E){function T(I){I.read(()=>{var G=t.$getSelection();if(t.$isRangeSelection(G)){var{anchor:P,focus:k}=G;G=P.getNode();var W=G.getKey(),Y=P.offset,re=k.getNode(),te=re.getKey(),ue=k.offset,q=_.getElementByKey(W),H=_.getElementByKey(te);if(W=S===null||q===null||Y!==w||W!==S.getKey()||G!==S&&(!(S instanceof t.TextNode)||G.updateDOM(S,q,_._config)),te=M===null||H===null||ue!==m||te!==M.getKey()||re!==M&&(!(M instanceof t.TextNode)||re.updateDOM(M,H,_._config)),W||te){q=_.getElementByKey(P.getNode().getKey());var V=_.getElementByKey(k.getNode().getKey());if(q!==null&&V!==null&&q.tagName==="SPAN"&&V.tagName==="SPAN"){if(te=document.createRange(),k.isBefore(P)?(W=V,H=k.offset,V=q,q=P.offset):(W=q,H=P.offset,q=k.offset),W=W.firstChild,W===null||(V=V.firstChild,V===null))throw Error("Expected text node to be first child of span");te.setStart(W,H),te.setEnd(V,q),v(),v=d(_,te,Ee=>{for(let Se of Ee){let Te=Se.style;Te.background!=="Highlight"&&(Te.background="Highlight"),Te.color!=="HighlightText"&&(Te.color="HighlightText"),Te.zIndex!=="-1"&&(Te.zIndex="-1"),Te.pointerEvents!=="none"&&(Te.pointerEvents="none"),Te.marginTop!=="-1.5px"&&(Te.marginTop="-1.5px"),Te.paddingTop!=="4px"&&(Te.paddingTop="4px"),Te.paddingBottom!=="0px"&&(Te.paddingBottom="0px")}E!==void 0&&E(Ee)})}}S=G,w=Y,M=re,m=ue}else m=M=w=S=null,v(),v=()=>{}})}let S=null,w=null,M=null,m=null,v=()=>{};return T(_.getEditorState()),r(_.registerUpdateListener(({editorState:I})=>T(I)),v,()=>{v()})},wn.mediaFileReader=function(_,E){let T=_[Symbol.iterator]();return new Promise((S,w)=>{let M=[],m=()=>{const{done:v,value:I}=T.next();if(v)return S(M);const G=new FileReader;G.addEventListener("error",w),G.addEventListener("load",()=>{const P=G.result;typeof P=="string"&&M.push({file:I,result:P}),m()}),f(I,E)?G.readAsDataURL(I):m()};m()})},wn.mergeRegister=r,wn.objectKlassEquals=function(_,E){return _!==null?Object.getPrototypeOf(_).constructor.name===E.name:!1},wn.positionNodeOnRange=d,wn.registerNestedElementResolver=function(_,E,T,S){return _.registerNodeTransform(E,w=>{e:{for(var M=w.getChildren(),m=0;m<M.length;m++)if(M[m]instanceof E){M=null;break e}for(M=w;M!==null;)if(m=M,M=M.getParent(),M instanceof E){M={child:m,parent:M};break e}M=null}if(M!==null){const{child:v,parent:I}=M;if(v.is(w)){if(S(I,w),w=v.getNextSiblings(),M=w.length,I.insertAfter(v),M!==0){m=T(I),v.insertAfter(m);for(let G=0;G<M;G++)m.append(w[G])}I.canBeEmpty()||I.getChildrenSize()!==0||I.remove()}}})},wn.removeClassNamesFromElement=function(_,...E){E.forEach(T=>{typeof T=="string"&&_.classList.remove(...T.split(" "))})},wn}var cu,Qf;function pn(){return Qf||(Qf=1,cu=process.env.NODE_ENV==="development"?iC():sC()),cu}var uu={},eh;function oC(){if(eh)return uu;eh=1;var e=jt();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 E=_.payload;if(E&&E.functionId==="makeChanges"){const T=E.args;if(T){const[S,w,M,m,v,I]=T;n.update(()=>{const G=e.$getSelection();if(e.$isRangeSelection(G)){const P=G.anchor;let k=P.getNode(),W=0,Y=0;if(e.$isTextNode(k)&&S>=0&&w>=0&&(W=S,Y=S+w,G.setTextNodeRange(k,W,k,Y)),(W!==Y||M!=="")&&(G.insertRawText(M),k=P.getNode()),e.$isTextNode(k)){W=m,Y=m+v;const re=k.getTextContentSize();W=W>re?re:W,Y=Y>re?re:Y,G.setTextNodeRange(k,W,k,Y)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",l,!0),()=>{window.removeEventListener("message",l,!0)}}return uu.registerDragonSupport=t,uu}var du={},th;function lC(){if(th)return du;th=1;var e=jt();return du.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,_,E,T,S]=f;t.update(()=>{const w=e.$getSelection();if(e.$isRangeSelection(w)){var M=w.anchor;let m=M.getNode(),v=0,I=0;e.$isTextNode(m)&&0<=p&&0<=_&&(v=p,I=p+_,w.setTextNodeRange(m,v,m,I)),(v!==I||E!=="")&&(w.insertRawText(E),m=M.getNode()),e.$isTextNode(m)&&(v=T,I=T+S,M=m.getTextContentSize(),v=v>M?M:v,I=I>M?M:I,w.setTextNodeRange(m,v,m,I)),l.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},du}var fu,nh;function Dp(){return nh||(nh=1,fu=process.env.NODE_ENV==="development"?oC():lC()),fu}var di={},vi={},Za={},rh;function aC(){if(rh)return Za;rh=1;var e=vs(),t=pn(),n=jt();function r(E,T){const S=T.body?T.body.childNodes:[];let w=[];for(let M=0;M<S.length;M++){const m=S[M];if(!p.has(m.nodeName)){const v=_(m,E);v!==null&&(w=w.concat(v))}}return w}function l(E,T){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(E,v,S,T)}return S.innerHTML}function d(E,T,S,w=null){let M=w!=null?T.isSelected(w):!0;const m=n.$isElementNode(T)&&T.excludeFromCopy("html");let v=T;if(w!==null){let re=e.$cloneWithProperties(T);re=n.$isTextNode(re)&&w!=null?e.$sliceSelectedTextNodeContent(w,re):re,v=re}const I=n.$isElementNode(v)?v.getChildren():[],G=E._nodes.get(v.getType());let P;G&&G.exportDOM!==void 0?P=G.exportDOM(E,v):P=v.exportDOM(E);const{element:k,after:W}=P;if(!k)return!1;const Y=document.createDocumentFragment();for(let re=0;re<I.length;re++){const te=I[re],ue=d(E,te,Y,w);!M&&n.$isElementNode(T)&&ue&&T.extractWithChild(te,w,"html")&&(M=!0)}if(M&&!m){if(t.isHTMLElement(k)&&k.append(Y),S.append(k),W){const re=W.call(v,k);re&&k.replaceWith(re)}}else S.append(Y);return M}function f(E,T){const{nodeName:S}=E,w=T._htmlConversions.get(S.toLowerCase());let M=null;if(w!==void 0)for(const m of w){const v=m(E);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 _(E,T,S=new Map,w){let M=[];if(p.has(E.nodeName))return M;let m=null;const v=f(E,T),I=v?v(E):null;let G=null;if(I!==null){G=I.after;const W=I.node;if(m=Array.isArray(W)?W[W.length-1]:W,m!==null){for(const[,Y]of S)if(m=Y(m,w),!m)break;m&&M.push(...Array.isArray(W)?W:[m])}I.forChild!=null&&S.set(E.nodeName,I.forChild)}const P=E.childNodes;let k=[];for(let W=0;W<P.length;W++)k.push(..._(P[W],T,new Map(S),m));return G!=null&&(k=G(k)),m==null?M=M.concat(k):n.$isElementNode(m)&&m.append(...k),M}return Za.$generateHtmlFromNodes=l,Za.$generateNodesFromDOM=r,Za}var Ja={},ih;function cC(){if(ih)return Ja;ih=1;var e=vs(),t=pn(),n=jt();function r(f,p,_,E=null){let T=E!=null?p.isSelected(E):!0,S=n.$isElementNode(p)&&p.excludeFromCopy("html");var w=p;E!==null&&(w=e.$cloneWithProperties(p),w=n.$isTextNode(w)&&E!=null?e.$sliceSelectedTextNodeContent(E,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:I}=m;if(!v)return!1;m=document.createDocumentFragment();for(let G=0;G<M.length;G++){let P=M[G],k=r(f,P,m,E);!T&&n.$isElementNode(p)&&k&&p.extractWithChild(P,E,"html")&&(T=!0)}return T&&!S?(t.isHTMLElement(v)&&v.append(m),_.append(v),I&&(f=I.call(w,v))&&v.replaceWith(f)):_.append(m),T}let l=new Set(["STYLE","SCRIPT"]);function d(f,p,_=new Map,E){let T=[];if(l.has(f.nodeName))return T;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,E),!S)break;S&&T.push(...Array.isArray(m)?m:[S])}M.forChild!=null&&_.set(f.nodeName,M.forChild)}for(f=f.childNodes,E=[],v=0;v<f.length;v++)E.push(...d(f[v],p,new Map(_),S));return w!=null&&(E=w(E)),S==null?T=T.concat(E):n.$isElementNode(S)&&S.append(...E),T}return Ja.$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"),E=n.$getRoot().getChildren();for(let T=0;T<E.length;T++)r(f,E[T],_,p);return _.innerHTML},Ja.$generateNodesFromDOM=function(f,p){p=p.body?p.body.childNodes:[];let _=[];for(let T=0;T<p.length;T++){var E=p[T];l.has(E.nodeName)||(E=d(E,f),E!==null&&(_=_.concat(E)))}return _},Ja}var hu,sh;function Ap(){return sh||(sh=1,hu=process.env.NODE_ENV==="development"?aC():cC()),hu}var oh;function uC(){if(oh)return vi;oh=1;var e=Ap(),t=vs(),n=pn(),r=jt();const l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=k=>l?(k||window).getSelection():null;function f(k){const W=r.$getSelection();if(W==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(W)&&W.isCollapsed()||W.getNodes().length===0?"":e.$generateHtmlFromNodes(k,W)}function p(k){const W=r.$getSelection();if(W==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(W)&&W.isCollapsed()||W.getNodes().length===0?null:JSON.stringify(M(k,W))}function _(k,W){const Y=k.getData("text/plain")||k.getData("text/uri-list");Y!=null&&W.insertRawText(Y)}function E(k,W,Y){const re=k.getData("application/x-lexical-editor");if(re)try{const q=JSON.parse(re);if(q.namespace===Y._config.namespace&&Array.isArray(q.nodes)){const H=m(q.nodes);return T(Y,H,W)}}catch{}const te=k.getData("text/html");if(te)try{const H=new DOMParser().parseFromString(te,"text/html"),V=e.$generateNodesFromDOM(Y,H);return T(Y,V,W)}catch{}const ue=k.getData("text/plain")||k.getData("text/uri-list");if(ue!=null)if(r.$isRangeSelection(W)){const q=ue.split(/(\r?\n|\t)/);q[q.length-1]===""&&q.pop();for(let H=0;H<q.length;H++){const V=q[H];V===`
|
|
75
|
+
`||V===`\r
|
|
76
|
+
`?W.insertParagraph():V===" "?W.insertNodes([r.$createTabNode()]):W.insertText(V)}}else W.insertRawText(ue)}function T(k,W,Y){k.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:W,selection:Y})||Y.insertNodes(W)}function S(k){const W=k.exportJSON(),Y=k.constructor;if(W.type!==Y.getType())throw Error(`LexicalNode: Node ${Y.name} does not implement .exportJSON().`);if(r.$isElementNode(k)){const re=W.children;if(!Array.isArray(re))throw Error(`LexicalNode: Node ${Y.name} is an element but .exportJSON() does not have a children array.`)}return W}function w(k,W,Y,re=[]){let te=W!=null?Y.isSelected(W):!0;const ue=r.$isElementNode(Y)&&Y.excludeFromCopy("html");let q=Y;if(W!==null){let Ee=t.$cloneWithProperties(Y);Ee=r.$isTextNode(Ee)&&W!=null?t.$sliceSelectedTextNodeContent(W,Ee):Ee,q=Ee}const H=r.$isElementNode(q)?q.getChildren():[],V=S(q);if(r.$isTextNode(q)){const Ee=q.__text;Ee.length>0?V.text=Ee:te=!1}for(let Ee=0;Ee<H.length;Ee++){const Se=H[Ee],Te=w(k,W,Se,V.children);!te&&r.$isElementNode(Y)&&Te&&Y.extractWithChild(Se,W,"clone")&&(te=!0)}if(te&&!ue)re.push(V);else if(Array.isArray(V.children))for(let Ee=0;Ee<V.children.length;Ee++){const Se=V.children[Ee];re.push(Se)}return te}function M(k,W){const Y=[],te=r.$getRoot().getChildren();for(let ue=0;ue<te.length;ue++){const q=te[ue];w(k,W,q,Y)}return{namespace:k._config.namespace,nodes:Y}}function m(k){const W=[];for(let Y=0;Y<k.length;Y++){const re=k[Y],te=r.$parseSerializedNode(re);r.$isTextNode(te)&&t.$addNodeStyle(te),W.push(te)}return W}const v=50;let I=null;async function G(k,W){if(I!==null)return!1;if(W!==null)return new Promise((H,V)=>{k.update(()=>{H(P(k,W))})});const Y=k.getRootElement(),re=k._window==null?window.document:k._window.document,te=d(k._window);if(Y===null||te===null)return!1;const ue=re.createElement("span");ue.style.cssText="position: fixed; top: -1000px;",ue.append(re.createTextNode("#")),Y.append(ue);const q=new Range;return q.setStart(ue,0),q.setEnd(ue,1),te.removeAllRanges(),te.addRange(q),new Promise((H,V)=>{const Ee=k.registerCommand(r.COPY_COMMAND,Se=>(n.objectKlassEquals(Se,ClipboardEvent)&&(Ee(),I!==null&&(window.clearTimeout(I),I=null),H(P(k,Se))),!0),r.COMMAND_PRIORITY_CRITICAL);I=window.setTimeout(()=>{Ee(),I=null,H(!1)},v),re.execCommand("copy"),ue.remove()})}function P(k,W){const Y=d(k._window);if(!Y)return!1;const re=Y.anchorNode,te=Y.focusNode;if(re!==null&&te!==null&&!r.isSelectionWithinEditor(k,re,te))return!1;W.preventDefault();const ue=W.clipboardData,q=r.$getSelection();if(ue===null||q===null)return!1;const H=f(k),V=p(k);let Ee="";return q!==null&&(Ee=q.getTextContent()),H!==null&&ue.setData("text/html",H),V!==null&&ue.setData("application/x-lexical-editor",V),ue.setData("text/plain",Ee),!0}return vi.$generateJSONFromSelectedNodes=M,vi.$generateNodesFromSerializedNodes=m,vi.$getHtmlContent=f,vi.$getLexicalContent=p,vi.$insertDataTransferForPlainText=_,vi.$insertDataTransferForRichText=E,vi.$insertGeneratedNodes=T,vi.copyToClipboard=G,vi}var Si={},lh;function dC(){if(lh)return Si;lh=1;var e=Ap(),t=vs(),n=pn(),r=jt();function l(m){let v=new URLSearchParams;v.append("code",m);for(let I=1;I<arguments.length;I++)v.append("v",arguments[I]);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(T(m,v))}function _(m,v,I){m.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:v,selection:I})||I.insertNodes(v)}function E(m,v,I,G=[]){let P=v!=null?I.isSelected(v):!0,k=r.$isElementNode(I)&&I.excludeFromCopy("html");var W=I;if(v!==null){var Y=t.$cloneWithProperties(I);W=Y=r.$isTextNode(Y)&&v!=null?t.$sliceSelectedTextNodeContent(v,Y):Y}let re=r.$isElementNode(W)?W.getChildren():[];var te=W;Y=te.exportJSON();var ue=te.constructor;for(Y.type!==ue.getType()&&l(58,ue.name),r.$isElementNode(te)&&(Array.isArray(Y.children)||l(59,ue.name)),r.$isTextNode(W)&&(W=W.__text,0<W.length?Y.text=W:P=!1),W=0;W<re.length;W++)te=re[W],ue=E(m,v,te,Y.children),!P&&r.$isElementNode(I)&&ue&&I.extractWithChild(te,v,"clone")&&(P=!0);if(P&&!k)G.push(Y);else if(Array.isArray(Y.children))for(m=0;m<Y.children.length;m++)G.push(Y.children[m]);return P}function T(m,v){let I=[],G=r.$getRoot().getChildren();for(let P=0;P<G.length;P++)E(m,v,G[P],I);return{namespace:m._config.namespace,nodes:I}}function S(m){let v=[];for(let I=0;I<m.length;I++){let G=r.$parseSerializedNode(m[I]);r.$isTextNode(G)&&t.$addNodeStyle(G),v.push(G)}return v}let w=null;function M(m,v){var I=d?(m._window||window).getSelection():null;if(!I)return!1;var G=I.anchorNode;if(I=I.focusNode,G!==null&&I!==null&&!r.isSelectionWithinEditor(m,G,I)||(v.preventDefault(),v=v.clipboardData,G=r.$getSelection(),v===null||G===null))return!1;I=f(m),m=p(m);let P="";return G!==null&&(P=G.getTextContent()),I!==null&&v.setData("text/html",I),m!==null&&v.setData("application/x-lexical-editor",m),v.setData("text/plain",P),!0}return Si.$generateJSONFromSelectedNodes=T,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,I){var G=m.getData("application/x-lexical-editor");if(G)try{let k=JSON.parse(G);if(k.namespace===I._config.namespace&&Array.isArray(k.nodes)){let W=S(k.nodes);return _(I,W,v)}}catch{}if(G=m.getData("text/html"))try{var P=new DOMParser().parseFromString(G,"text/html");let k=e.$generateNodesFromDOM(I,P);return _(I,k,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(),I=0;I<m.length;I++)P=m[I],P===`
|
|
77
|
+
`||P===`\r
|
|
78
|
+
`?v.insertParagraph():P===" "?v.insertNodes([r.$createTabNode()]):v.insertText(P);else v.insertRawText(m)},Si.$insertGeneratedNodes=_,Si.copyToClipboard=async function(m,v){if(w!==null)return!1;if(v!==null)return new Promise(W=>{m.update(()=>{W(M(m,v))})});var I=m.getRootElement();let G=m._window==null?window.document:m._window.document,P=d?(m._window||window).getSelection():null;if(I===null||P===null)return!1;let k=G.createElement("span");return k.style.cssText="position: fixed; top: -1000px;",k.append(G.createTextNode("#")),I.append(k),I=new Range,I.setStart(k,0),I.setEnd(k,1),P.removeAllRanges(),P.addRange(I),new Promise(W=>{let Y=m.registerCommand(r.COPY_COMMAND,re=>(n.objectKlassEquals(re,ClipboardEvent)&&(Y(),w!==null&&(window.clearTimeout(w),w=null),W(M(m,re))),!0),r.COMMAND_PRIORITY_CRITICAL);w=window.setTimeout(()=>{Y(),w=null,W(!1)},50),G.execCommand("copy"),k.remove()})},Si}var gu,ah;function Mp(){return ah||(ah=1,gu=process.env.NODE_ENV==="development"?uC():dC()),gu}var ch;function fC(){if(ch)return di;ch=1;var e=Mp(),t=vs(),n=pn(),r=jt();function l(Se,Te){if(typeof document.caretRangeFromPoint<"u"){const de=document.caretRangeFromPoint(Se,Te);return de===null?null:{node:de.startContainer,offset:de.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const de=document.caretPositionFromPoint(Se,Te);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),E=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(Te){return new M(Te.__key)}constructor(Te){super(Te)}createDOM(Te){const de=document.createElement("blockquote");return n.addClassNamesToElement(de,Te.theme.quote),de}updateDOM(Te,de){return!1}static importDOM(){return{blockquote:Te=>({conversion:k,priority:0})}}exportDOM(Te){const{element:de}=super.exportDOM(Te);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const z=this.getFormatType();de.style.textAlign=z;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Te){const de=m();return de.setFormat(Te.format),de.setIndent(Te.indent),de.setDirection(Te.direction),de}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Te,de){const z=r.$createParagraphNode(),O=this.getDirection();return z.setDirection(O),this.insertAfter(z,de),z}collapseAtStart(){const Te=r.$createParagraphNode();return this.getChildren().forEach(z=>Te.append(z)),this.replace(Te),!0}}function m(){return r.$applyNodeReplacement(new M)}function v(Se){return Se instanceof M}class I extends r.ElementNode{static getType(){return"heading"}static clone(Te){return new I(Te.__tag,Te.__key)}constructor(Te,de){super(de),this.__tag=Te}getTag(){return this.__tag}createDOM(Te){const de=this.__tag,z=document.createElement(de),Z=Te.theme.heading;if(Z!==void 0){const oe=Z[de];n.addClassNamesToElement(z,oe)}return z}updateDOM(Te,de){return!1}static importDOM(){return{h1:Te=>({conversion:P,priority:0}),h2:Te=>({conversion:P,priority:0}),h3:Te=>({conversion:P,priority:0}),h4:Te=>({conversion:P,priority:0}),h5:Te=>({conversion:P,priority:0}),h6:Te=>({conversion:P,priority:0}),p:Te=>{const z=Te.firstChild;return z!==null&&G(z)?{conversion:()=>({node:null}),priority:3}:null},span:Te=>G(Te)?{conversion:de=>({node:W("h1")}),priority:3}:null}}exportDOM(Te){const{element:de}=super.exportDOM(Te);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const z=this.getFormatType();de.style.textAlign=z;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Te){const de=W(Te.tag);return de.setFormat(Te.format),de.setIndent(Te.indent),de.setDirection(Te.direction),de}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Te,de=!0){const z=Te?Te.anchor.offset:0,O=z===this.getTextContentSize()||!Te?r.$createParagraphNode():W(this.getTag()),Z=this.getDirection();if(O.setDirection(Z),this.insertAfter(O,de),z===0&&!this.isEmpty()&&Te){const oe=r.$createParagraphNode();oe.select(),this.replace(oe,!0)}return O}collapseAtStart(){const Te=this.isEmpty()?r.$createParagraphNode():W(this.getTag());return this.getChildren().forEach(z=>Te.append(z)),this.replace(Te),!0}extractWithChild(){return!0}}function G(Se){return Se.nodeName.toLowerCase()==="span"?Se.style.fontSize==="26pt":!1}function P(Se){const Te=Se.nodeName.toLowerCase();let de=null;return(Te==="h1"||Te==="h2"||Te==="h3"||Te==="h4"||Te==="h5"||Te==="h6")&&(de=W(Te),Se.style!==null&&de.setFormat(Se.style.textAlign)),{node:de}}function k(Se){const Te=m();return Se.style!==null&&Te.setFormat(Se.style.textAlign),{node:Te}}function W(Se){return r.$applyNodeReplacement(new I(Se))}function Y(Se){return Se instanceof I}function re(Se,Te){Se.preventDefault(),Te.update(()=>{const de=r.$getSelection(),z=Se instanceof InputEvent||Se instanceof KeyboardEvent?null:Se.clipboardData;z!=null&&r.$INTERNAL_isPointSelection(de)&&e.$insertDataTransferForRichText(z,de,Te)},{tag:"paste"})}async function te(Se,Te){await e.copyToClipboard(Te,n.objectKlassEquals(Se,ClipboardEvent)?Se:null),Te.update(()=>{const de=r.$getSelection();r.$isRangeSelection(de)?de.removeText():r.$isNodeSelection(de)&&de.getNodes().forEach(z=>z.remove())})}function ue(Se){let Te=null;if(Se instanceof DragEvent?Te=Se.dataTransfer:Se instanceof ClipboardEvent&&(Te=Se.clipboardData),Te===null)return[!1,[],!1];const de=Te.types,z=de.includes("Files"),O=de.includes("text/html")||de.includes("text/plain");return[z,Array.from(Te.files),O]}function q(Se){const Te=r.$getSelection();if(!r.$isRangeSelection(Te))return!1;const de=new Set,z=Te.getNodes();for(let O=0;O<z.length;O++){const Z=z[O],oe=Z.getKey();if(de.has(oe))continue;const j=n.$getNearestBlockElementAncestorOrThrow(Z),K=j.getKey();j.canIndent()&&!de.has(K)&&(de.add(K),Se(j))}return de.size>0}function H(Se){const Te=r.$getNearestNodeFromDOMNode(Se);return r.$isDecoratorNode(Te)}function V(Se){const Te=Se.focus;return Te.key==="root"&&Te.offset===r.$getRoot().getChildrenSize()}function Ee(Se){return n.mergeRegister(Se.registerCommand(r.CLICK_COMMAND,de=>{const z=r.$getSelection();return r.$isNodeSelection(z)?(z.clear(),!0):!1},0),Se.registerCommand(r.DELETE_CHARACTER_COMMAND,de=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.deleteCharacter(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_WORD_COMMAND,de=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.deleteWord(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_LINE_COMMAND,de=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.deleteLine(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,de=>{const z=r.$getSelection();if(typeof de=="string")r.$INTERNAL_isPointSelection(z)&&z.insertText(de);else{if(!r.$INTERNAL_isPointSelection(z))return!1;const O=de.dataTransfer;if(O!=null)e.$insertDataTransferForRichText(O,z,Se);else if(r.$isRangeSelection(z)){const Z=de.data;return Z&&z.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 z=r.$getSelection();return r.$isRangeSelection(z)?(z.formatText(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_ELEMENT_COMMAND,de=>{const z=r.$getSelection();if(!r.$isRangeSelection(z)&&!r.$isNodeSelection(z))return!1;const O=z.getNodes();for(const Z of O){const oe=n.$findMatchingParent(Z,j=>r.$isElementNode(j)&&!j.isInline());oe!==null&&oe.setFormat(de)}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_LINE_BREAK_COMMAND,de=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.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,()=>q(de=>{const z=de.getIndent();de.setIndent(z+1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>q(de=>{const z=de.getIndent();z>0&&de.setIndent(z-1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_UP_COMMAND,de=>{const z=r.$getSelection();if(r.$isNodeSelection(z)&&!H(de.target)){const O=z.getNodes();if(O.length>0)return O[0].selectPrevious(),!0}else if(r.$isRangeSelection(z)){const O=r.$getAdjacentNode(z.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 z=r.$getSelection();if(r.$isNodeSelection(z)){const O=z.getNodes();if(O.length>0)return O[0].selectNext(0,0),!0}else if(r.$isRangeSelection(z)){if(V(z))return de.preventDefault(),!0;const O=r.$getAdjacentNode(z.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 z=r.$getSelection();if(r.$isNodeSelection(z)){const O=z.getNodes();if(O.length>0)return de.preventDefault(),O[0].selectPrevious(),!0}if(!r.$isRangeSelection(z))return!1;if(t.$shouldOverrideDefaultCharacterSelection(z,!0)){const O=de.shiftKey;return de.preventDefault(),t.$moveCharacter(z,O,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,de=>{const z=r.$getSelection();if(r.$isNodeSelection(z)&&!H(de.target)){const Z=z.getNodes();if(Z.length>0)return de.preventDefault(),Z[0].selectNext(0,0),!0}if(!r.$isRangeSelection(z))return!1;const O=de.shiftKey;return t.$shouldOverrideDefaultCharacterSelection(z,!1)?(de.preventDefault(),t.$moveCharacter(z,O,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_BACKSPACE_COMMAND,de=>{if(H(de.target))return!1;const z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;de.preventDefault();const{anchor:O}=z,Z=O.getNode();return z.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(H(de.target))return!1;const z=r.$getSelection();return r.$isRangeSelection(z)?(de.preventDefault(),Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ENTER_COMMAND,de=>{const z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;if(de!==null){if((E||_||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[,z]=ue(de);if(z.length>0){const Z=de.clientX,oe=de.clientY,j=l(Z,oe);if(j!==null){const{offset:K,node:J}=j,R=r.$getNearestNodeFromDOMNode(J);if(R!==null){const U=r.$createRangeSelection();if(r.$isTextNode(R))U.anchor.set(R.getKey(),K,"text"),U.focus.set(R.getKey(),K,"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,z)}return de.preventDefault(),!0}const O=r.$getSelection();return!!r.$isRangeSelection(O)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGSTART_COMMAND,de=>{const[z]=ue(de),O=r.$getSelection();return!(z&&!r.$isRangeSelection(O))},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGOVER_COMMAND,de=>{const[z]=ue(de),O=r.$getSelection();if(z&&!r.$isRangeSelection(O))return!1;const Z=de.clientX,oe=de.clientY,j=l(Z,oe);if(j!==null){const K=r.$getNearestNodeFromDOMNode(j.node);r.$isDecoratorNode(K)&&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[,z,O]=ue(de);if(z.length>0&&!O)return Se.dispatchCommand(w,z),!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=W,di.$createQuoteNode=m,di.$isHeadingNode=Y,di.$isQuoteNode=v,di.DRAG_DROP_PASTE=w,di.HeadingNode=I,di.QuoteNode=M,di.eventFiles=ue,di.registerRichText=Ee,di}var fi={},uh;function hC(){if(uh)return fi;uh=1;var e=Mp(),t=vs(),n=pn(),r=jt();function l(q,H){return typeof document.caretRangeFromPoint<"u"?(q=document.caretRangeFromPoint(q,H),q===null?null:{node:q.startContainer,offset:q.startOffset}):document.caretPositionFromPoint!=="undefined"?(q=document.caretPositionFromPoint(q,H),q===null?null:{node:q.offsetNode,offset:q.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),E=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(H){return new M(H.__key)}constructor(H){super(H)}createDOM(H){let V=document.createElement("blockquote");return n.addClassNamesToElement(V,H.theme.quote),V}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:P,priority:0})}}exportDOM(H){if({element:H}=super.exportDOM(H),H&&n.isHTMLElement(H)){this.isEmpty()&&H.append(document.createElement("br"));var V=this.getFormatType();H.style.textAlign=V,(V=this.getDirection())&&(H.dir=V)}return{element:H}}static importJSON(H){let V=m();return V.setFormat(H.format),V.setIndent(H.indent),V.setDirection(H.direction),V}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(H,V){H=r.$createParagraphNode();let Ee=this.getDirection();return H.setDirection(Ee),this.insertAfter(H,V),H}collapseAtStart(){let H=r.$createParagraphNode();return this.getChildren().forEach(V=>H.append(V)),this.replace(H),!0}}function m(){return r.$applyNodeReplacement(new M)}class v extends r.ElementNode{static getType(){return"heading"}static clone(H){return new v(H.__tag,H.__key)}constructor(H,V){super(V),this.__tag=H}getTag(){return this.__tag}createDOM(H){let V=this.__tag,Ee=document.createElement(V);return H=H.theme.heading,H!==void 0&&n.addClassNamesToElement(Ee,H[V]),Ee}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:H=>(H=H.firstChild,H!==null&&I(H)?{conversion:()=>({node:null}),priority:3}:null),span:H=>I(H)?{conversion:()=>({node:k("h1")}),priority:3}:null}}exportDOM(H){if({element:H}=super.exportDOM(H),H&&n.isHTMLElement(H)){this.isEmpty()&&H.append(document.createElement("br"));var V=this.getFormatType();H.style.textAlign=V,(V=this.getDirection())&&(H.dir=V)}return{element:H}}static importJSON(H){let V=k(H.tag);return V.setFormat(H.format),V.setIndent(H.indent),V.setDirection(H.direction),V}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(H,V=!0){let Ee=H?H.anchor.offset:0,Se=Ee!==this.getTextContentSize()&&H?k(this.getTag()):r.$createParagraphNode(),Te=this.getDirection();return Se.setDirection(Te),this.insertAfter(Se,V),Ee===0&&!this.isEmpty()&&H&&(H=r.$createParagraphNode(),H.select(),this.replace(H,!0)),Se}collapseAtStart(){let H=this.isEmpty()?r.$createParagraphNode():k(this.getTag());return this.getChildren().forEach(V=>H.append(V)),this.replace(H),!0}extractWithChild(){return!0}}function I(q){return q.nodeName.toLowerCase()==="span"?q.style.fontSize==="26pt":!1}function G(q){let H=q.nodeName.toLowerCase(),V=null;return(H==="h1"||H==="h2"||H==="h3"||H==="h4"||H==="h5"||H==="h6")&&(V=k(H),q.style!==null&&V.setFormat(q.style.textAlign)),{node:V}}function P(q){let H=m();return q.style!==null&&H.setFormat(q.style.textAlign),{node:H}}function k(q){return r.$applyNodeReplacement(new v(q))}function W(q,H){q.preventDefault(),H.update(()=>{let V=r.$getSelection(),Ee=q instanceof InputEvent||q instanceof KeyboardEvent?null:q.clipboardData;Ee!=null&&r.$INTERNAL_isPointSelection(V)&&e.$insertDataTransferForRichText(Ee,V,H)},{tag:"paste"})}async function Y(q,H){await e.copyToClipboard(H,n.objectKlassEquals(q,ClipboardEvent)?q:null),H.update(()=>{let V=r.$getSelection();r.$isRangeSelection(V)?V.removeText():r.$isNodeSelection(V)&&V.getNodes().forEach(Ee=>Ee.remove())})}function re(q){let H=null;if(q instanceof DragEvent?H=q.dataTransfer:q instanceof ClipboardEvent&&(H=q.clipboardData),H===null)return[!1,[],!1];var V=H.types;return q=V.includes("Files"),V=V.includes("text/html")||V.includes("text/plain"),[q,Array.from(H.files),V]}function te(q){var H=r.$getSelection();if(!r.$isRangeSelection(H))return!1;let V=new Set;H=H.getNodes();for(let Te=0;Te<H.length;Te++){var Ee=H[Te],Se=Ee.getKey();V.has(Se)||(Ee=n.$getNearestBlockElementAncestorOrThrow(Ee),Se=Ee.getKey(),Ee.canIndent()&&!V.has(Se)&&(V.add(Se),q(Ee)))}return 0<V.size}function ue(q){return q=r.$getNearestNodeFromDOMNode(q),r.$isDecoratorNode(q)}return fi.$createHeadingNode=k,fi.$createQuoteNode=m,fi.$isHeadingNode=function(q){return q instanceof v},fi.$isQuoteNode=function(q){return q instanceof M},fi.DRAG_DROP_PASTE=w,fi.HeadingNode=v,fi.QuoteNode=M,fi.eventFiles=re,fi.registerRichText=function(q){return n.mergeRegister(q.registerCommand(r.CLICK_COMMAND,()=>{const H=r.$getSelection();return r.$isNodeSelection(H)?(H.clear(),!0):!1},0),q.registerCommand(r.DELETE_CHARACTER_COMMAND,H=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteCharacter(H),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.DELETE_WORD_COMMAND,H=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteWord(H),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.DELETE_LINE_COMMAND,H=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteLine(H),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,H=>{const V=r.$getSelection();if(typeof H=="string")r.$INTERNAL_isPointSelection(V)&&V.insertText(H);else{if(!r.$INTERNAL_isPointSelection(V))return!1;const Ee=H.dataTransfer;Ee!=null?e.$insertDataTransferForRichText(Ee,V,q):r.$isRangeSelection(V)&&(H=H.data)&&V.insertText(H)}return!0},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const H=r.$getSelection();return r.$isRangeSelection(H)?(H.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.FORMAT_TEXT_COMMAND,H=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.formatText(H),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.FORMAT_ELEMENT_COMMAND,H=>{var V=r.$getSelection();if(!r.$isRangeSelection(V)&&!r.$isNodeSelection(V))return!1;V=V.getNodes();for(const Ee of V)V=n.$findMatchingParent(Ee,Se=>r.$isElementNode(Se)&&!Se.isInline()),V!==null&&V.setFormat(H);return!0},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.INSERT_LINE_BREAK_COMMAND,H=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.insertLineBreak(H),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const H=r.$getSelection();return r.$isRangeSelection(H)?(H.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.INDENT_CONTENT_COMMAND,()=>te(H=>{const V=H.getIndent();H.setIndent(V+1)}),r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>te(H=>{const V=H.getIndent();0<V&&H.setIndent(V-1)}),r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_ARROW_UP_COMMAND,H=>{var V=r.$getSelection();if(r.$isNodeSelection(V)&&!ue(H.target)){if(H=V.getNodes(),0<H.length)return H[0].selectPrevious(),!0}else if(r.$isRangeSelection(V)&&(V=r.$getAdjacentNode(V.focus,!0),!H.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline()))return V.selectPrevious(),H.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_ARROW_DOWN_COMMAND,H=>{var V=r.$getSelection();if(r.$isNodeSelection(V)){if(H=V.getNodes(),0<H.length)return H[0].selectNext(0,0),!0}else if(r.$isRangeSelection(V)){let Ee=V.focus;if(Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize())return H.preventDefault(),!0;if(V=r.$getAdjacentNode(V.focus,!1),!H.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline())return V.selectNext(),H.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_ARROW_LEFT_COMMAND,H=>{const V=r.$getSelection();if(r.$isNodeSelection(V)){var Ee=V.getNodes();if(0<Ee.length)return H.preventDefault(),Ee[0].selectPrevious(),!0}return r.$isRangeSelection(V)&&t.$shouldOverrideDefaultCharacterSelection(V,!0)?(Ee=H.shiftKey,H.preventDefault(),t.$moveCharacter(V,Ee,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,H=>{const V=r.$getSelection();if(r.$isNodeSelection(V)&&!ue(H.target)){var Ee=V.getNodes();if(0<Ee.length)return H.preventDefault(),Ee[0].selectNext(0,0),!0}return r.$isRangeSelection(V)?(Ee=H.shiftKey,t.$shouldOverrideDefaultCharacterSelection(V,!1)?(H.preventDefault(),t.$moveCharacter(V,Ee,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_BACKSPACE_COMMAND,H=>{if(ue(H.target))return!1;const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;H.preventDefault(),{anchor:H}=V;const Ee=H.getNode();return V.isCollapsed()&&H.offset===0&&!r.$isRootNode(Ee)&&0<n.$getNearestBlockElementAncestorOrThrow(Ee).getIndent()?q.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):q.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_DELETE_COMMAND,H=>{if(ue(H.target))return!1;const V=r.$getSelection();return r.$isRangeSelection(V)?(H.preventDefault(),q.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_ENTER_COMMAND,H=>{const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;if(H!==null){if((E||_||S)&&p)return!1;if(H.preventDefault(),H.shiftKey)return q.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return q.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const H=r.$getSelection();return r.$isRangeSelection(H)?(q.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.DROP_COMMAND,H=>{const[,V]=re(H);if(0<V.length){var Ee=l(H.clientX,H.clientY);if(Ee!==null){const{offset:Te,node:de}=Ee;var Se=r.$getNearestNodeFromDOMNode(de);if(Se!==null){if(Ee=r.$createRangeSelection(),r.$isTextNode(Se))Ee.anchor.set(Se.getKey(),Te,"text"),Ee.focus.set(Se.getKey(),Te,"text");else{const z=Se.getParentOrThrow().getKey();Se=Se.getIndexWithinParent()+1,Ee.anchor.set(z,Se,"element"),Ee.focus.set(z,Se,"element")}Ee=r.$normalizeSelection__EXPERIMENTAL(Ee),r.$setSelection(Ee)}q.dispatchCommand(w,V)}return H.preventDefault(),!0}return H=r.$getSelection(),!!r.$isRangeSelection(H)},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.DRAGSTART_COMMAND,H=>{[H]=re(H);const V=r.$getSelection();return!(H&&!r.$isRangeSelection(V))},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.DRAGOVER_COMMAND,H=>{var[V]=re(H);const Ee=r.$getSelection();return V&&!r.$isRangeSelection(Ee)?!1:(V=l(H.clientX,H.clientY),V!==null&&(V=r.$getNearestNodeFromDOMNode(V.node),r.$isDecoratorNode(V)&&H.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.COPY_COMMAND,H=>(e.copyToClipboard(q,n.objectKlassEquals(H,ClipboardEvent)?H:null),!0),r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.CUT_COMMAND,H=>(Y(H,q),!0),r.COMMAND_PRIORITY_EDITOR),q.registerCommand(r.PASTE_COMMAND,H=>{const[,V,Ee]=re(H);if(0<V.length&&!Ee)return q.dispatchCommand(w,V),!0;if(r.isSelectionCapturedInDecoratorInput(H.target))return!1;const Se=r.$getSelection();return r.$INTERNAL_isPointSelection(Se)?(W(H,q),!0):!1},r.COMMAND_PRIORITY_EDITOR))},fi}var pu,dh;function xd(){return dh||(dh=1,pu=process.env.NODE_ENV==="development"?fC():hC()),pu}var fh;function gC(){if(fh)return ru;fh=1;var e=qn(),t=wp(),n=rt,r=Op(),l=pn(),d=hd,f=Dp(),p=xd(),T=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[P,k]=n.useState(()=>S(G));return T(()=>{function W(){const Y=S(G);k(Y)}return W(),l.mergeRegister(G.registerUpdateListener(()=>{W()}),G.registerEditableListener(()=>{W()}))},[G]),P}function M(G,P){const[k,W]=n.useState(()=>G.getDecorators());return T(()=>G.registerDecoratorListener(Y=>{d.flushSync(()=>{W(Y)})}),[G]),n.useEffect(()=>{W(G.getDecorators())},[G]),n.useMemo(()=>{const Y=[],re=Object.keys(k);for(let te=0;te<re.length;te++){const ue=re[te],q=n.createElement(P,{onError:V=>G._onError(V)},n.createElement(n.Suspense,{fallback:null},k[ue])),H=G.getElementByKey(ue);H!==null&&Y.push(d.createPortal(q,H,ue))}return Y},[P,k,G])}function m(G){T(()=>l.mergeRegister(p.registerRichText(G),f.registerDragonSupport(G)),[G])}function v({contentEditable:G,placeholder:P,ErrorBoundary:k}){const[W]=e.useLexicalComposerContext(),Y=M(W,k);return m(W),n.createElement(n.Fragment,null,G,n.createElement(I,{content:P}),Y)}function I({content:G}){const[P]=e.useLexicalComposerContext(),k=w(P),W=t();return k?typeof G=="function"?G(W):G:null}return ru.RichTextPlugin=v,ru}var mu={},hh;function pC(){if(hh)return mu;hh=1;var e=qn(),t=wp(),n=rt,r=Op(),l=pn(),d=hd,f=Dp(),p=xd(),_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function E(m){return m.getEditorState().read(r.$canShowPlaceholderCurry(m.isComposing()))}function T(m){let[v,I]=n.useState(()=>E(m));return _(()=>{function G(){let P=E(m);I(P)}return G(),l.mergeRegister(m.registerUpdateListener(()=>{G()}),m.registerEditableListener(()=>{G()}))},[m]),v}function S(m,v){let[I,G]=n.useState(()=>m.getDecorators());return _(()=>m.registerDecoratorListener(P=>{d.flushSync(()=>{G(P)})}),[m]),n.useEffect(()=>{G(m.getDecorators())},[m]),n.useMemo(()=>{let P=[],k=Object.keys(I);for(let W=0;W<k.length;W++){let Y=k[W],re=n.createElement(v,{onError:ue=>m._onError(ue)},n.createElement(n.Suspense,{fallback:null},I[Y])),te=m.getElementByKey(Y);te!==null&&P.push(d.createPortal(re,te,Y))}return P},[v,I,m])}function w(m){_(()=>l.mergeRegister(p.registerRichText(m),f.registerDragonSupport(m)),[m])}function M({content:m}){var[v]=e.useLexicalComposerContext();v=T(v);let I=t();return v?typeof m=="function"?m(I):m:null}return mu.RichTextPlugin=function({contentEditable:m,placeholder:v,ErrorBoundary:I}){let[G]=e.useLexicalComposerContext();return I=S(G,I),w(G),n.createElement(n.Fragment,null,m,n.createElement(M,{content:v}),I)},mu}const mC=process.env.NODE_ENV==="development"?gC():pC();var _C=mC,_u={},gh;function yC(){if(gh)return _u;gh=1;var e=qn(),t=rt;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var E=arguments[_];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(p[T]=E[T])}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:E,ariaDescribedBy:T,ariaExpanded:S,ariaLabel:w,ariaLabelledBy:M,ariaMultiline:m,ariaOwns:v,ariaRequired:I,autoCapitalize:G,className:P,id:k,role:W="textbox",spellCheck:Y=!0,style:re,tabIndex:te,"data-testid":ue,...q}){const[H]=e.useLexicalComposerContext(),[V,Ee]=t.useState(!1),Se=t.useCallback(Te=>{H.setRootElement(Te)},[H]);return d(()=>(Ee(H.isEditable()),H.registerEditableListener(Te=>{Ee(Te)})),[H]),t.createElement("div",n({},q,{"aria-activedescendant":V?p:void 0,"aria-autocomplete":V?_:"none","aria-controls":V?E:void 0,"aria-describedby":T,"aria-expanded":V&&W==="combobox"?!!S:void 0,"aria-label":w,"aria-labelledby":M,"aria-multiline":m,"aria-owns":V?v:void 0,"aria-readonly":V?void 0:!0,"aria-required":I,autoCapitalize:G,className:P,contentEditable:V,"data-testid":ue,id:k,ref:Se,role:W,spellCheck:Y,style:re,tabIndex:te}))}return _u.ContentEditable=f,_u}var yu={},ph;function NC(){if(ph)return yu;ph=1;var e=qn(),t=rt;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 yu.ContentEditable=function({ariaActiveDescendant:l,ariaAutoComplete:d,ariaControls:f,ariaDescribedBy:p,ariaExpanded:_,ariaLabel:E,ariaLabelledBy:T,ariaMultiline:S,ariaOwns:w,ariaRequired:M,autoCapitalize:m,className:v,id:I,role:G="textbox",spellCheck:P=!0,style:k,tabIndex:W,"data-testid":Y,...re}){let[te]=e.useLexicalComposerContext(),[ue,q]=t.useState(!1),H=t.useCallback(V=>{te.setRootElement(V)},[te]);return r(()=>(q(te.isEditable()),te.registerEditableListener(V=>{q(V)})),[te]),t.createElement("div",n({},re,{"aria-activedescendant":ue?l:void 0,"aria-autocomplete":ue?d:"none","aria-controls":ue?f:void 0,"aria-describedby":p,"aria-expanded":ue&&G==="combobox"?!!_:void 0,"aria-label":E,"aria-labelledby":T,"aria-multiline":S,"aria-owns":ue?w:void 0,"aria-readonly":ue?void 0:!0,"aria-required":M,autoCapitalize:m,className:v,contentEditable:ue,"data-testid":Y,id:I,ref:H,role:G,spellCheck:P,style:k,tabIndex:W}))},yu}const CC=process.env.NODE_ENV==="development"?yC():NC();var EC=CC,Nu,mh;function TC(){if(mh)return Nu;mh=1;var e=rt;function t(p,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,S){return T.__proto__=S,T},t(p,_)}function n(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}var r=function(_,E){return _===void 0&&(_=[]),E===void 0&&(E=[]),_.length!==E.length||_.some(function(T,S){return!Object.is(T,E[S])})},l={error:null},d=function(p){n(_,p);function _(){for(var T,S=arguments.length,w=new Array(S),M=0;M<S;M++)w[M]=arguments[M];return T=p.call.apply(p,[this].concat(w))||this,T.state=l,T.resetErrorBoundary=function(){for(var m,v=arguments.length,I=new Array(v),G=0;G<v;G++)I[G]=arguments[G];T.props.onReset==null||(m=T.props).onReset.apply(m,I),T.reset()},T}_.getDerivedStateFromError=function(S){return{error:S}};var E=_.prototype;return E.reset=function(){this.setState(l)},E.componentDidCatch=function(S,w){var M,m;(M=(m=this.props).onError)==null||M.call(m,S,w)},E.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,I;(v=(I=this.props).onResetKeysChange)==null||v.call(I,S.resetKeys,m),this.reset()}},E.render=function(){var S=this.state.error,w=this.props,M=w.fallbackRender,m=w.FallbackComponent,v=w.fallback;if(S!==null){var I={error:S,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(v))return v;if(typeof M=="function")return M(I);if(m)return e.createElement(m,I);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 Nu=f,Nu}var Cu,_h;function xC(){if(_h)return Cu;_h=1;var e=rt;function t(f,p){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,E){return _.__proto__=E,_},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(_,E){return!Object.is(_,p[E])})}var l={error:null},d=function(f){function p(){for(var E,T=arguments.length,S=Array(T),w=0;w<T;w++)S[w]=arguments[w];return E=f.call.apply(f,[this].concat(S))||this,E.state=l,E.resetErrorBoundary=function(){for(var M,m=arguments.length,v=Array(m),I=0;I<m;I++)v[I]=arguments[I];E.props.onReset==null||(M=E.props).onReset.apply(M,v),E.reset()},E}n(p,f),p.getDerivedStateFromError=function(E){return{error:E}};var _=p.prototype;return _.reset=function(){this.setState(l)},_.componentDidCatch=function(E,T){var S,w;(S=(w=this.props).onError)==null||S.call(w,E,T)},_.componentDidUpdate=function(E,T){var S=this.props.resetKeys;if(this.state.error!==null&&T.error!==null&&r(E.resetKeys,S)){var w,M;(w=(M=this.props).onResetKeysChange)==null||w.call(M,E.resetKeys,S),this.reset()}},_.render=function(){var E=this.state.error,T=this.props,S=T.fallbackRender,w=T.FallbackComponent;if(T=T.fallback,E!==null){if(E={error:E,resetErrorBoundary:this.resetErrorBoundary},e.isValidElement(T))return T;if(typeof S=="function")return S(E);if(w)return e.createElement(w,E);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(e.Component);return Cu=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)},Cu}const vC=process.env.NODE_ENV==="development"?TC():xC();var SC=vC;const wC=gd(SC);var Eu={},gr={},yh;function OC(){if(yh)return gr;yh=1;var e=jt(),t=pn();function n(j){let K=1,J=j.getParent();for(;J!=null;){if(ue(J)){const R=J.getParent();if(de(R)){K++,J=R.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return K}return K}function r(j){let K=j.getParent();if(!de(K))throw Error("A ListItemNode must have a ListNode for a parent.");let J=K;for(;J!==null;)J=J.getParent(),de(J)&&(K=J);return K}function l(j){let K=[];const J=j.getChildren().filter(ue);for(let R=0;R<J.length;R++){const U=J[R],X=U.getFirstChild();de(X)?K=K.concat(l(X)):K.push(U)}return K}function d(j){return ue(j)&&de(j.getFirstChild())}function f(j){let K=j;for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){const J=K.getParent();if(J==null||!(ue(K)||de(K)))break;K=J}K.remove()}function p(j){return te().append(j)}function _(j,K){return ue(j)&&(K.length===0||K.length===1&&j.is(K[0])&&j.getChildrenSize()===0)}function E(j){const K=j.getParent();let J=1;if(K!=null)if(de(K))J=K.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const R=j.getPreviousSiblings();for(let U=0;U<R.length;U++){const X=R[U];ue(X)&&!de(X.getFirstChild())&&J++}return J}function T(j,K){j.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=Te(K);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(ue(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()&&!ue(A)&&!_e.has(A.getKey())){w(A,K);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=Te(K);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,K);break}F=ye}}}}}}})}function S(j,K){j.splice(j.getChildrenSize(),0,K)}function w(j,K){if(de(j))return j;const J=j.getPreviousSibling(),R=j.getNextSibling(),U=te();if(U.setFormat(j.getFormatType()),U.setIndent(j.getIndent()),S(U,j.getChildren()),de(J)&&K===J.getListType())return J.append(U),j.remove(),de(R)&&K===R.getListType()&&(S(J,R.getChildren()),R.remove()),J;if(de(R)&&K===R.getListType())return R.getFirstChildOrThrow().insertBefore(U),j.remove(),R;{const X=Te(K);return X.append(U),j.replace(X),v(X),X}}function M(j,K){const J=j.getLastChild(),R=K.getFirstChild();J&&R&&d(J)&&d(R)&&(M(J.getFirstChild(),R.getFirstChild()),R.remove());const U=K.getChildren();U.length>0&&(j.append(...U),v(j)),K.remove()}function m(j){j.update(()=>{const K=e.$getSelection();if(e.$isRangeSelection(K)){const J=new Set,R=K.getNodes(),U=K.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,k);_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===K.anchor.key&&K.anchor.set(A.getKey(),0,"element"),B.__key===K.focus.key&&K.focus.set(A.getKey(),0,"element"),B.remove()}X.remove()}}})}function v(j,K){const J=K||j.getChildren();if(J!==void 0)for(let R=0;R<J.length;R++){const U=J[R];if(ue(U)){const X=U.getValue(),fe=E(U);X!==fe&&U.setValue(fe)}}}function I(j){const K=new Set;if(d(j)||K.has(j.getKey()))return;const J=j.getParent(),R=j.getNextSibling(),U=j.getPreviousSibling();if(d(R)&&d(U)){const X=U.getFirstChild();if(de(X)){X.append(j);const fe=R.getFirstChild();if(de(fe)){const _e=fe.getChildren();S(X,_e),R.remove(),K.add(R.getKey())}v(X)}}else if(d(R)){const X=R.getFirstChild();if(de(X)){const fe=X.getFirstChild();fe!==null&&fe.insertBefore(j),v(X)}}else if(d(U)){const X=U.getFirstChild();de(X)&&(X.append(j),v(X))}else if(de(J)){const X=te(),fe=Te(J.getListType());X.append(fe),fe.append(j),U?U.insertAfter(X):R?R.insertBefore(X):J.append(X),v(fe)}de(J)&&v(J)}function G(j){if(d(j))return;const K=j.getParent(),J=K?K.getParent():void 0,R=J?J.getParent():void 0;if(de(R)&&ue(J)&&de(K)){const U=K?K.getFirstChild():void 0,X=K?K.getLastChild():void 0;if(j.is(U))J.insertBefore(j),K.isEmpty()&&J.remove();else if(j.is(X))J.insertAfter(j),K.isEmpty()&&J.remove();else{const fe=K.getListType(),_e=te(),B=Te(fe);_e.append(B),j.getPreviousSiblings().forEach(se=>B.append(se));const A=te(),F=Te(fe);A.append(F),S(F,j.getNextSiblings()),J.insertBefore(_e),J.insertAfter(A),J.replace(j)}v(K),v(R)}}function P(){const j=e.$getSelection();if(!e.$isRangeSelection(j)||!j.isCollapsed())return!1;const K=j.anchor.getNode();if(!ue(K)||K.getChildrenSize()!==0)return!1;const J=r(K),R=K.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(ue(U))X=te(),U.insertAfter(X);else return!1;X.select();const fe=K.getNextSiblings();if(fe.length>0){const _e=Te(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(K),!0}class k extends e.ElementNode{static getType(){return"listitem"}static clone(K){return new k(K.__value,K.__checked,K.__key)}constructor(K,J,R){super(R),this.__value=K===void 0?1:K,this.__checked=J}createDOM(K){const J=document.createElement("li"),R=this.getParent();return de(R)&&R.getListType()==="check"&&Y(J,this,null),J.value=this.__value,W(J,K.theme,this),J}updateDOM(K,J,R){const U=this.getParent();return de(U)&&U.getListType()==="check"&&Y(J,this,K),J.value=this.__value,W(J,R.theme,this),!1}static transform(){return K=>{const J=K.getParent();if(de(J)){if(v(J),!ue(K))throw Error("node is not a ListItemNode");J.getListType()!=="check"&&K.getChecked()!=null&&K.setChecked(void 0)}}}static importDOM(){return{li:K=>({conversion:re,priority:0})}}static importJSON(K){const J=te();return J.setChecked(K.checked),J.setValue(K.value),J.setFormat(K.format),J.setDirection(K.direction),J}exportDOM(K){const J=this.createDOM(K._config);return J.style.textAlign=this.getFormatType(),{element:J}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...K){for(let J=0;J<K.length;J++){const R=K[J];if(e.$isElementNode(R)&&this.canMergeWith(R)){const U=R.getChildren();this.append(...U),R.remove()}else super.append(R)}return this}replace(K,J){if(ue(K))return super.replace(K);this.setIndent(0);const R=this.getParentOrThrow();if(!de(R))return K;if(R.__first===this.getKey())R.insertBefore(K);else if(R.__last===this.getKey())R.insertAfter(K);else{const U=Te(R.getListType());let X=this.getNextSibling();for(;X;){const fe=X;X=X.getNextSibling(),U.append(fe)}R.insertAfter(K),K.insertAfter(U)}if(J){if(!e.$isElementNode(K))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(U=>{K.append(U)})}return this.remove(),R.getChildrenSize()===0&&R.remove(),K}insertAfter(K,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(ue(K)){const X=super.insertAfter(K,J),fe=K.getParentOrThrow();return de(fe)&&v(fe),X}if(de(K)){let X=K;const fe=K.getChildren();for(let _e=fe.length-1;_e>=0;_e--)X=fe[_e],this.insertAfter(X,J);return X}if(R.insertAfter(K,J),U.length!==0){const X=Te(R.getListType());U.forEach(fe=>X.append(fe)),K.insertAfter(X,J)}return K}remove(K){const J=this.getPreviousSibling(),R=this.getNextSibling();if(super.remove(K),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(K,J=!0){const R=te(this.__checked==null?void 0:!1);return this.insertAfter(R,J),R}collapseAtStart(K){const J=e.$createParagraphNode();this.getChildren().forEach(_e=>J.append(_e));const U=this.getParentOrThrow(),X=U.getParentOrThrow(),fe=ue(X);if(U.getChildrenSize()===1)if(fe)U.remove(),X.select();else{U.insertBefore(J),U.remove();const _e=K.anchor,B=K.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(K){const J=this.getWritable();J.__value=K}getChecked(){return this.getLatest().__checked}setChecked(K){const J=this.getWritable();J.__checked=K}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const K=this.getParent();if(K===null)return this.getLatest().__indent;let J=K.getParentOrThrow(),R=0;for(;ue(J);)J=J.getParentOrThrow().getParentOrThrow(),R++;return R}setIndent(K){if(!(typeof K=="number"&&K>-1))throw Error("Invalid indent value.");let J=this.getIndent();for(;J!==K;)J<K?(I(this),J++):(G(this),J--);return this}insertBefore(K){if(ue(K)){const J=this.getParentOrThrow();if(de(J)){const R=this.getNextSiblings();v(J,R)}}return super.insertBefore(K)}canInsertAfter(K){return ue(K)}canReplaceWith(K){return ue(K)}canMergeWith(K){return e.$isParagraphNode(K)||ue(K)}extractWithChild(K,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 Te("bullet")}}function W(j,K,J){const R=[],U=[],X=K.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(j,...U),R.length>0&&t.addClassNamesToElement(j,...R)}function Y(j,K,J,R){de(K.getFirstChild())?(j.removeAttribute("role"),j.removeAttribute("tabIndex"),j.removeAttribute("aria-checked")):(j.setAttribute("role","checkbox"),j.setAttribute("tabIndex","-1"),(!J||K.__checked!==J.__checked)&&j.setAttribute("aria-checked",K.getChecked()?"true":"false"))}function re(j){const K=t.isHTMLElement(j)&&j.getAttribute("aria-checked")==="true";return{node:te(K)}}function te(j){return e.$applyNodeReplacement(new k(void 0,j))}function ue(j){return j instanceof k}class q extends e.ElementNode{static getType(){return"list"}static clone(K){const J=K.__listType||Se[K.__tag];return new q(J,K.__start,K.__key)}constructor(K,J,R){super(R);const U=Se[K]||K;this.__listType=U,this.__tag=U==="number"?"ol":"ul",this.__start=J}getTag(){return this.__tag}setListType(K){const J=this.getWritable();J.__listType=K,J.__tag=K==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(K,J){const R=this.__tag,U=document.createElement(R);return this.__start!==1&&U.setAttribute("start",String(this.__start)),U.__lexicalListType=this.__listType,H(U,K.theme,this),U}updateDOM(K,J,R){return K.__tag!==this.__tag?!0:(H(J,R.theme,this),!1)}static importDOM(){return{ol:K=>({conversion:Ee,priority:0}),ul:K=>({conversion:Ee,priority:0})}}static importJSON(K){const J=Te(K.listType,K.start);return J.setFormat(K.format),J.setIndent(K.indent),J.setDirection(K.direction),J}exportDOM(K){const{element:J}=super.exportDOM(K);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(...K){for(let J=0;J<K.length;J++){const R=K[J];if(ue(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(K){return ue(K)}}function H(j,K,J){const R=[],U=[],X=K.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(j,...U),R.length>0&&t.addClassNamesToElement(j,...R)}function V(j){const K=[];for(let J=0;J<j.length;J++){const R=j[J];if(ue(R)){K.push(R);const U=R.getChildren();U.length>1&&U.forEach(X=>{de(X)&&K.push(p(X))})}else K.push(p(R))}return K}function Ee(j){const K=j.nodeName.toLowerCase();let J=null;if(K==="ol"){const R=j.start;J=Te("number",R)}else K==="ul"&&(t.isHTMLElement(j)&&j.getAttribute("__lexicallisttype")==="check"?J=Te("check"):J=Te("bullet"));return{after:V,node:J}}const Se={ol:"number",ul:"bullet"};function Te(j,K=1){return e.$applyNodeReplacement(new q(j,K))}function de(j){return j instanceof q}const z=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=Te,gr.$getListDepth=n,gr.$handleListInsertParagraph=P,gr.$isListItemNode=ue,gr.$isListNode=de,gr.INSERT_CHECK_LIST_COMMAND=Z,gr.INSERT_ORDERED_LIST_COMMAND=O,gr.INSERT_UNORDERED_LIST_COMMAND=z,gr.ListItemNode=k,gr.ListNode=q,gr.REMOVE_LIST_COMMAND=oe,gr.insertList=T,gr.removeList=m,gr}var pr={},Nh;function DC(){if(Nh)return pr;Nh=1;var e=jt(),t=pn();function n(z){let O=new URLSearchParams;O.append("code",z);for(let Z=1;Z<arguments.length;Z++)O.append("v",arguments[Z]);throw Error(`Minified Lexical error #${z}; 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(z){let O=1;for(z=z.getParent();z!=null;){if(W(z)){if(z=z.getParent(),V(z)){O++,z=z.getParent();continue}n(40)}break}return O}function l(z){z=z.getParent(),V(z)||n(40);let O=z;for(;O!==null;)O=O.getParent(),V(O)&&(z=O);return z}function d(z){let O=[];z=z.getChildren().filter(W);for(let Z=0;Z<z.length;Z++){let oe=z[Z],j=oe.getFirstChild();V(j)?O=O.concat(d(j)):O.push(oe)}return O}function f(z){return W(z)&&V(z.getFirstChild())}function p(z){for(;z.getNextSibling()==null&&z.getPreviousSibling()==null;){let O=z.getParent();if(O==null||!W(z)&&!V(z))break;z=O}z.remove()}function _(z){return k().append(z)}function E(z,O){return W(z)&&(O.length===0||O.length===1&&z.is(O[0])&&z.getChildrenSize()===0)}function T(z,O){z.splice(z.getChildrenSize(),0,O)}function S(z,O){if(V(z))return z;let Z=z.getPreviousSibling(),oe=z.getNextSibling(),j=k();return j.setFormat(z.getFormatType()),j.setIndent(z.getIndent()),T(j,z.getChildren()),V(Z)&&O===Z.getListType()?(Z.append(j),z.remove(),V(oe)&&O===oe.getListType()&&(T(Z,oe.getChildren()),oe.remove()),Z):V(oe)&&O===oe.getListType()?(oe.getFirstChildOrThrow().insertBefore(j),z.remove(),oe):(O=H(O),O.append(j),z.replace(O),M(O),O)}function w(z,O){var Z=z.getLastChild();let oe=O.getFirstChild();Z&&oe&&f(Z)&&f(oe)&&(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()),Z=O.getChildren(),0<Z.length&&(z.append(...Z),M(z)),O.remove()}function M(z,O){if(z=O||z.getChildren(),z!==void 0)for(O=0;O<z.length;O++){let K=z[O];if(W(K)){let J=K.getValue();var Z=K,oe=Z.getParent(),j=1;for(oe!=null&&(V(oe)?j=oe.getStart():n(44)),Z=Z.getPreviousSiblings(),oe=0;oe<Z.length;oe++){let R=Z[oe];W(R)&&!V(R.getFirstChild())&&j++}J!==j&&K.setValue(j)}}}function m(z){if(!f(z)){var O=z.getParent(),Z=O?O.getParent():void 0,oe=Z?Z.getParent():void 0;if(V(oe)&&W(Z)&&V(O)){var j=O?O.getFirstChild():void 0,K=O?O.getLastChild():void 0;if(z.is(j))Z.insertBefore(z),O.isEmpty()&&Z.remove();else if(z.is(K))Z.insertAfter(z),O.isEmpty()&&Z.remove();else{var J=O.getListType();j=k();let R=H(J);j.append(R),z.getPreviousSiblings().forEach(U=>R.append(U)),K=k(),J=H(J),K.append(J),T(J,z.getNextSiblings()),Z.insertBefore(j),Z.insertAfter(K),Z.replace(z)}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 V(oe)&&oe.getListType()==="check"&&G(Z,this,null),Z.value=this.__value,I(Z,O.theme,this),Z}updateDOM(O,Z,oe){let j=this.getParent();return V(j)&&j.getListType()==="check"&&G(Z,this,O),Z.value=this.__value,I(Z,oe.theme,this),!1}static transform(){return O=>{let Z=O.getParent();if(V(Z)){if(M(Z),!W(O))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&O.getChecked()!=null&&O.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:P,priority:0})}}static importJSON(O){let Z=k();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 j=oe.getChildren();this.append(...j),oe.remove()}else super.append(oe)}return this}replace(O,Z){if(W(O))return super.replace(O);this.setIndent(0);let oe=this.getParentOrThrow();if(!V(oe))return O;if(oe.__first===this.getKey())oe.insertBefore(O);else if(oe.__last===this.getKey())oe.insertAfter(O);else{let j=H(oe.getListType()),K=this.getNextSibling();for(;K;){let J=K;K=K.getNextSibling(),j.append(J)}oe.insertAfter(O),O.insertAfter(j)}if(Z){if(!e.$isElementNode(O))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(j=>{O.append(j)})}return this.remove(),oe.getChildrenSize()===0&&oe.remove(),O}insertAfter(O,Z=!0){var oe=this.getParentOrThrow();V(oe)||n(39);var j=this.getNextSiblings();if(W(O))return Z=super.insertAfter(O,Z),O=O.getParentOrThrow(),V(O)&&M(O),Z;if(V(O)){for(oe=O,O=O.getChildren(),j=O.length-1;0<=j;j--)oe=O[j],this.insertAfter(oe,Z);return oe}if(oe.insertAfter(O,Z),j.length!==0){let K=H(oe.getListType());j.forEach(J=>K.append(J)),O.insertAfter(K,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(),V(O)&&M(O))}insertNewAfter(O,Z=!0){return O=k(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(),j=oe.getParentOrThrow();let K=W(j);return oe.getChildrenSize()===1?K?(oe.remove(),j.select()):(oe.insertBefore(Z),oe.remove(),oe=O.anchor,O=O.focus,j=Z.getKey(),oe.type==="element"&&oe.getNode().is(this)&&oe.set(j,oe.offset,"element"),O.type==="element"&&O.getNode().is(this)&&O.set(j,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(;W(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 j=this.getNextSibling(),K=this.getPreviousSibling();if(f(j)&&f(K)){if(K=K.getFirstChild(),V(K)){K.append(this);var J=j.getFirstChild();V(J)&&(J=J.getChildren(),T(K,J),j.remove(),oe.add(j.getKey())),M(K)}}else f(j)?(j=j.getFirstChild(),V(j)&&(oe=j.getFirstChild(),oe!==null&&oe.insertBefore(this),M(j))):f(K)?(j=K.getFirstChild(),V(j)&&(j.append(this),M(j))):V(R)&&(oe=k(),J=H(R.getListType()),oe.append(J),J.append(this),K?K.insertAfter(oe):j?j.insertBefore(oe):R.append(oe),M(J));V(R)&&M(R)}Z++}else m(this),Z--;return this}insertBefore(O){if(W(O)){let Z=this.getParentOrThrow();if(V(Z)){let oe=this.getNextSiblings();M(Z,oe)}}return super.insertBefore(O)}canInsertAfter(O){return W(O)}canReplaceWith(O){return W(O)}canMergeWith(O){return e.$isParagraphNode(O)||W(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 H("bullet")}}function I(z,O,Z){let oe=[],j=[];var K=(O=O.list)?O.listitem:void 0;if(O&&O.nested)var J=O.nested.listitem;if(K!==void 0&&(K=K.split(" "),oe.push(...K)),O){K=Z.getParent(),K=V(K)&&K.getListType()==="check";let R=Z.getChecked();K&&!R||j.push(O.listitemUnchecked),K&&R||j.push(O.listitemChecked),K&&oe.push(R?O.listitemChecked:O.listitemUnchecked)}J!==void 0&&(J=J.split(" "),Z.getChildren().some(R=>V(R))?oe.push(...J):j.push(...J)),0<j.length&&t.removeClassNamesFromElement(z,...j),0<oe.length&&t.addClassNamesToElement(z,...oe)}function G(z,O,Z){V(O.getFirstChild())?(z.removeAttribute("role"),z.removeAttribute("tabIndex"),z.removeAttribute("aria-checked")):(z.setAttribute("role","checkbox"),z.setAttribute("tabIndex","-1"),Z&&O.__checked===Z.__checked||z.setAttribute("aria-checked",O.getChecked()?"true":"false"))}function P(z){return z=t.isHTMLElement(z)&&z.getAttribute("aria-checked")==="true",{node:k(z)}}function k(z){return e.$applyNodeReplacement(new v(void 0,z))}function W(z){return z instanceof v}class Y extends e.ElementNode{static getType(){return"list"}static clone(O){return new Y(O.__listType||q[O.__tag],O.__start,O.__key)}constructor(O,Z,oe){super(oe),this.__listType=O=q[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:ue,priority:0}),ul:()=>({conversion:ue,priority:0})}}static importJSON(O){let Z=H(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(W(Z))super.append(Z);else{let j=k();V(Z)||e.$isElementNode(Z)&&(Z=e.$createTextNode(Z.getTextContent())),j.append(Z),super.append(j)}}return M(this),this}extractWithChild(O){return W(O)}}function re(z,O,Z){let oe=[],j=[];var K=O.list;if(K!==void 0){let R=K[`${Z.__tag}Depth`]||[];O=r(Z)-1;let U=O%R.length;var J=R[U];let X=K[Z.__tag],fe;if(K=K.nested,K!==void 0&&K.list&&(fe=K.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&&j.push(Z.__tag+J);fe!==void 0&&(Z=fe.split(" "),1<O?oe.push(...Z):j.push(...Z))}0<j.length&&t.removeClassNamesFromElement(z,...j),0<oe.length&&t.addClassNamesToElement(z,...oe)}function te(z){let O=[];for(let oe=0;oe<z.length;oe++){var Z=z[oe];W(Z)?(O.push(Z),Z=Z.getChildren(),1<Z.length&&Z.forEach(j=>{V(j)&&O.push(_(j))})):O.push(_(Z))}return O}function ue(z){let O=z.nodeName.toLowerCase(),Z=null;return O==="ol"?Z=H("number",z.start):O==="ul"&&(Z=t.isHTMLElement(z)&&z.getAttribute("__lexicallisttype")==="check"?H("check"):H("bullet")),{after:te,node:Z}}let q={ol:"number",ul:"bullet"};function H(z,O=1){return e.$applyNodeReplacement(new Y(z,O))}function V(z){return z instanceof Y}let Ee=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),Se=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Te=e.createCommand("INSERT_CHECK_LIST_COMMAND"),de=e.createCommand("REMOVE_LIST_COMMAND");return pr.$createListItemNode=k,pr.$createListNode=H,pr.$getListDepth=r,pr.$handleListInsertParagraph=function(){var z=e.$getSelection();if(!e.$isRangeSelection(z)||!z.isCollapsed()||(z=z.anchor.getNode(),!W(z)||z.getChildrenSize()!==0))return!1;var O=l(z),Z=z.getParent();V(Z)||n(40);let oe=Z.getParent(),j;if(e.$isRootOrShadowRoot(oe))j=e.$createParagraphNode(),O.insertAfter(j);else if(W(oe))j=k(),oe.insertAfter(j);else return!1;if(j.select(),O=z.getNextSiblings(),0<O.length){let K=H(Z.getListType());e.$isParagraphNode(j)?j.insertAfter(K):(Z=k(),Z.append(K),j.insertAfter(Z)),O.forEach(J=>{J.remove(),K.append(J)})}return p(z),!0},pr.$isListItemNode=W,pr.$isListNode=V,pr.INSERT_CHECK_LIST_COMMAND=Te,pr.INSERT_ORDERED_LIST_COMMAND=Se,pr.INSERT_UNORDERED_LIST_COMMAND=Ee,pr.ListItemNode=v,pr.ListNode=Y,pr.REMOVE_LIST_COMMAND=de,pr.insertList=function(z,O){z.update(()=>{var Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){var oe=Z.getNodes();Z=Z.anchor.getNode();var j=Z.getParent();if(E(Z,oe))oe=H(O),e.$isRootOrShadowRoot(j)?(Z.replace(oe),j=k(),e.$isElementNode(Z)&&(j.setFormat(Z.getFormatType()),j.setIndent(Z.getIndent())),oe.append(j)):W(Z)&&(Z=Z.getParentOrThrow(),T(oe,Z.getChildren()),Z.replace(oe));else for(Z=new Set,j=0;j<oe.length;j++){var K=oe[j];if(e.$isElementNode(K)&&K.isEmpty()&&!W(K)&&!Z.has(K.getKey()))S(K,O);else if(e.$isLeafNode(K))for(K=K.getParent();K!=null;){let R=K.getKey();if(V(K)){if(!Z.has(R)){var J=H(O);T(J,K.getChildren()),K.replace(J),M(J),Z.add(R)}break}else{if(J=K.getParent(),e.$isRootOrShadowRoot(J)&&!Z.has(R)){Z.add(R),S(K,O);break}K=J}}}}})},pr.removeList=function(z){z.update(()=>{let O=e.$getSelection();if(e.$isRangeSelection(O)){var Z=new Set,oe=O.getNodes(),j=O.anchor.getNode();if(E(j,oe))Z.add(l(j));else for(j=0;j<oe.length;j++){var K=oe[j];e.$isLeafNode(K)&&(K=t.$getNearestNodeOfType(K,v),K!=null&&Z.add(l(K)))}for(let J of Z){Z=J,oe=d(J);for(let R of oe)oe=e.$createParagraphNode(),T(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 Tu,Ch;function vd(){return Ch||(Ch=1,Tu=process.env.NODE_ENV==="development"?OC():DC()),Tu}var Eh;function AC(){if(Eh)return Eu;Eh=1;var e=vd(),t=qn(),n=rt,r=pn(),l=jt();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 Eu.ListPlugin=f,Eu}var xu={},Th;function MC(){if(Th)return xu;Th=1;var e=vd(),t=qn(),n=rt,r=pn(),l=jt();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 xu.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},xu}const RC=process.env.NODE_ENV==="development"?AC():MC();var bC=RC,vu={},wi={},xh;function LC(){if(xh)return wi;xh=1;var e=pn(),t=jt();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={},I){super(I);const{target:G=null,rel:P=null,title:k=null}=v;this.__url=m,this.__target=G,this.__rel=P,this.__title=k}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,I){const G=this.__url,P=this.__target,k=this.__rel,W=this.__title;return G!==m.__url&&(v.href=G),P!==m.__target&&(P?v.target=P:v.removeAttribute("target")),k!==m.__rel&&(k?v.rel=k:v.removeAttribute("rel")),W!==m.__title&&(W?v.title=W: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 I=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(I,v),I}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(m,v,I){if(!t.$isRangeSelection(v))return!1;const G=v.anchor.getNode(),P=v.focus.getNode();return this.isParentOf(G)&&this.isParentOf(P)&&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 I=this.getParentOrThrow().insertNewAfter(m,v);if(t.$isElementNode(I)){const G=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return I.append(G),G}return null}}function _(M,m){return t.$applyNodeReplacement(new p(M,m))}function E(M){return M instanceof p}const T=t.createCommand("TOGGLE_LINK_COMMAND");function S(M,m={}){const{target:v,title:I}=m,G=m.rel===void 0?"noreferrer":m.rel,P=t.$getSelection();if(!t.$isRangeSelection(P))return;const k=P.extract();if(M===null)k.forEach(W=>{const Y=W.getParent();if(f(Y)){const re=Y.getChildren();for(let te=0;te<re.length;te++)Y.insertBefore(re[te]);Y.remove()}});else{if(k.length===1){const re=k[0],te=w(re,f);if(te!==null){te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&te.setRel(G),I!==void 0&&te.setTitle(I);return}}let W=null,Y=null;k.forEach(re=>{const te=re.getParent();if(!(te===Y||te===null||t.$isElementNode(re)&&!re.isInline())){if(f(te)){Y=te,te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&Y.setRel(G),I!==void 0&&Y.setTitle(I);return}if(te.is(W)||(W=te,Y=d(M,{rel:G,target:v,title:I}),f(te)?re.getPreviousSibling()===null?te.insertBefore(Y):te.insertAfter(Y):re.insertBefore(Y)),f(re)){if(re.is(Y))return;if(Y!==null){const ue=re.getChildren();for(let q=0;q<ue.length;q++)Y.append(ue[q])}re.remove();return}Y!==null&&Y.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=E,wi.$isLinkNode=f,wi.AutoLinkNode=p,wi.LinkNode=r,wi.TOGGLE_LINK_COMMAND=T,wi.toggleLink=S,wi}var Oi={},vh;function IC(){if(vh)return Oi;vh=1;var e=pn(),t=jt();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:I=null,title:G=null}=M;this.__url=w,this.__target=v,this.__rel=I,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,I=this.__rel,G=this.__title;return m!==w.__url&&(M.href=m),v!==w.__target&&(v?M.target=v:M.removeAttribute("target")),I!==w.__rel&&(I?M.rel=I: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 E=t.createCommand("TOGGLE_LINK_COMMAND");function T(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=E,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(I=>{if(I=I.getParent(),f(I)){let G=I.getChildren();for(let P=0;P<G.length;P++)I.insertBefore(G[P]);I.remove()}});else{if(w.length===1){let P=T(w[0],f);if(P!==null){P.setURL(S),M!==void 0&&P.setTarget(M),v!==null&&P.setRel(v),m!==void 0&&P.setTitle(m);return}}let I=null,G=null;w.forEach(P=>{var k=P.getParent();if(k!==G&&k!==null&&(!t.$isElementNode(P)||P.isInline()))if(f(k))G=k,k.setURL(S),M!==void 0&&k.setTarget(M),v!==null&&G.setRel(v),m!==void 0&&G.setTitle(m);else if(k.is(I)||(I=k,G=d(S,{rel:v,target:M,title:m}),f(k)?P.getPreviousSibling()===null?k.insertBefore(G):k.insertAfter(G):P.insertBefore(G)),f(P)){if(!P.is(G)){if(G!==null){k=P.getChildren();for(let W=0;W<k.length;W++)G.append(k[W])}P.remove()}}else G!==null&&G.append(P)})}},Oi}var Su,Sh;function Sd(){return Sh||(Sh=1,Su=process.env.NODE_ENV==="development"?LC():IC()),Su}var wh;function kC(){if(wh)return vu;wh=1;var e=Sd(),t=qn(),n=pn(),r=jt(),l=rt;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:E,target:T,rel:S,title:w}=_;return e.toggleLink(E,{rel:S,target:T,title:w}),!0}},r.COMMAND_PRIORITY_LOW),f!==void 0?p.registerCommand(r.PASTE_COMMAND,_=>{const E=r.$getSelection();if(!r.$isRangeSelection(E)||E.isCollapsed()||!(_ instanceof ClipboardEvent)||_.clipboardData==null)return!1;const T=_.clipboardData.getData("text");return f(T)?E.getNodes().some(S=>r.$isElementNode(S))?!1:(p.dispatchCommand(e.TOGGLE_LINK_COMMAND,T),_.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,f]),null}return vu.LinkPlugin=d,vu}var wu={},Oh;function PC(){if(Oh)return wu;Oh=1;var e=Sd(),t=qn(),n=pn(),r=jt(),l=rt;return wu.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:E,rel:T,title:S}=p;return e.toggleLink(_,{rel:T,target:E,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 E=p.clipboardData.getData("text");return d(E)?_.getNodes().some(T=>r.$isElementNode(T))?!1:(f.dispatchCommand(e.TOGGLE_LINK_COMMAND,E),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[f,d]),null},wu}const $C=process.env.NODE_ENV==="development"?kC():PC();var FC=$C,Ou={},Jt={},Dh;function BC(){if(Dh)return Jt;Dh=1;var e=jt(),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 Ie=e.DEPRECATED_$getGridCellNodeRect(ve);if(Ie===null)throw Error("getCellRect: expected to find focusCellNode");const Me=Math.min(le.columnIndex,Ie.columnIndex),je=Math.max(le.columnIndex,Ie.columnIndex),it=Math.min(le.rowIndex,Ie.rowIndex),st=Math.max(le.rowIndex,Ie.rowIndex);return{fromX:Math.min(Me,je),fromY:Math.min(it,st),toX:Math.max(Me,je),toY:Math.max(it,st)}}getNodes(){const ie=this._cachedNodes;if(ie!==null)return ie;const le=this.anchor.getNode(),ve=this.focus.getNode(),Ie=t.$findMatchingParent(le,e.DEPRECATED_$isGridCellNode),Me=t.$findMatchingParent(ve,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Ie))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=Ie.getParent();if(!e.DEPRECATED_$isGridRowNode(je))throw Error("Expected anchorCell to have a parent GridRowNode");const it=je.getParent();if(!e.DEPRECATED_$isGridNode(it))throw Error("Expected tableNode to have a parent GridNode");const st=Me.getParents()[1];if(st!==it){if(it.isParentOf(Me)){const It=st.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),It.getKey())}else{const It=it.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),Me.getKey())}return this.getNodes()}const[ot,St,Ge]=e.DEPRECATED_$computeGridMap(it,Ie,Me);let ze=Math.min(St.startColumn,Ge.startColumn),tt=Math.min(St.startRow,Ge.startRow),yt=Math.max(St.startColumn+St.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(St.startRow+St.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:rn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,rn),yt=Math.max(yt,bt+Vt.__colSpan-1),Nt=Math.max(Nt,rn+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(ot[gt+bt][Vt]);Et=Vt}if(tt<gt){const It=xt-Et,Vt=gt-1;for(let bt=0;bt<=It;bt++)$t(ot[Vt][Et+bt]);gt=Vt}if(yt>xt){const It=mt-gt,Vt=xt+1;for(let bt=0;bt<=It;bt++)$t(ot[gt+bt][Vt]);xt=Vt}if(Nt>mt){const It=xt-Et,Vt=mt+1;for(let bt=0;bt<=It;bt++)$t(ot[Vt][Et+bt]);mt=Vt}}const Kt=[it];let nn=null;for(let It=tt;It<=Nt;It++)for(let Vt=ze;Vt<=yt;Vt++){const{cell:bt}=ot[It][Vt],rn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(rn))throw Error("Expected GridCellNode parent to be a GridRowNode");rn!==nn&&Kt.push(rn),Kt.push(bt,...d(bt)),nn=rn}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:E,priority:0}),th:ie=>({conversion:E,priority:0})}}static importJSON(ie){const le=ie.colSpan||1,ve=ie.rowSpan||1,Ie=T(ie.headerState,le,ie.width||void 0);return Ie.__rowSpan=ve,Ie.__backgroundColor=ie.backgroundColor||null,Ie}constructor(ie=p.NO_STATUS,le=1,ve,Ie){super(le,Ie),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,Ie=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,Ie/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 E(Oe){const ie=Oe,le=Oe.nodeName.toLowerCase();let ve;f.test(ie.style.width)&&(ve=parseFloat(ie.style.width));const Ie=T(le==="th"?p.ROW:p.NO_STATUS,ie.colSpan,ve);Ie.__rowSpan=ie.rowSpan;const Me=ie.style.backgroundColor;return Me!==""&&(Ie.__backgroundColor=Me),{forChild:(je,it)=>{if(S(it)&&!e.$isElementNode(je)){const st=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
79
|
+
`?null:(st.append(je),st)}return je},node:Ie}}function T(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 I=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Oe=>I?(Oe||window).getSelection():null;class P{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 st=le[Me].target.nodeName;if(st==="TABLE"||st==="TR"){ve=!0;break}}if(!ve)return;const Ie=this.editor.getElementByKey(this.tableNodeKey);if(!Ie)throw new Error("Expected to find TableElement in DOM");this.grid=ue(Ie)})});this.editor.update(()=>{const le=this.editor.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");this.grid=ue(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 Ie=ue(ve);q(ie,Ie,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(),q(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 Ie=e.$getNodeByKey(this.tableNodeKey);if(!B(Ie))throw new Error("Expected TableNode.");if(!ve.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ie.x,it=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const st=G(ve._window);st&&st.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==it||le))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&it===this.focusY)return;if(this.focusX=je,this.focusY=it,this.isHighlightingCells){const st=e.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&S(st)){const ot=st.getKey();this.gridSelection=this.gridSelection.clone()||l(),this.focusCellNodeKey=ot,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),ve.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),q(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(),Ie=ve.anchor,Me=ve.focus;le.getNodes().forEach(je=>{S(je)&&je.getTextContentSize()!==0&&(Ie.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 Ie=ve.getNodes().filter(S);if(Ie.length===this.grid.columns*this.grid.rows){le.selectPrevious(),le.remove(),e.$getRoot().selectStart();return}Ie.forEach(Me=>{if(e.$isElementNode(Me)){const je=e.$createParagraphNode(),it=e.$createTextNode();je.append(it),Me.append(je),Me.getChildren().forEach(st=>{st!==je&&st.remove()})}}),q(ie,this.grid,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const k="__lexicalTableSelection";function W(Oe,ie,le,ve){const Ie=le.getRootElement();if(Ie===null)throw new Error("No root element.");const Me=new P(le,Oe.getKey()),je=le._window||window;Y(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 it=Ge=>{Ge.button===0&&le.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===Me.tableNodeKey&&Ie.contains(tt)&&Me.clearHighlight()})};je.addEventListener("mousedown",it),Me.listenersToRemove.add(()=>je.removeEventListener("mousedown",it)),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 st=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(),nn=e.$createParagraphNode();return Kt.forEach(It=>nn.append(It)),mt.replace(nn),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,st(Ge),e.COMMAND_PRIORITY_CRITICAL))});const ot=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,ot,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.KEY_DELETE_COMMAND,ot,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=j(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 St(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(),nn=t.$findMatchingParent(gt.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=nn&&t.$findMatchingParent(nn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),Vt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(nn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(Vt))return!1;const bt=It.getIndexWithinParent(),rn=Math.min(Vt.getChildrenSize()-1,bt+Kt-1),wr=nn.getIndexWithinParent(),_i=Math.min(It.getChildrenSize()-1,wr+$t-1),pe=Math.min(wr,_i),Ze=Math.min(bt,rn),lt=Math.max(wr,_i),wt=Math.max(bt,rn),Gt=Vt.getChildren();let Bt=0,Pt,kt;for(let Ht=Ze;Ht<=wt;Ht++){const on=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(on))return!1;const an=mt[Bt];if(!e.DEPRECATED_$isGridRowNode(an))return!1;const bn=on.getChildren(),yr=an.getChildren();let Zn=0;for(let fn=pe;fn<=lt;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===wt&&fn===lt&&(kt=sr.getKey());const Ai=sr.getChildren();or.getChildren().forEach(Nr=>{e.$isTextNode(Nr)&&e.$createParagraphNode().append(Nr),sr.append(Nr)}),Ai.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=j(Nt),xt=j(Et),mt=gt&&Oe.is(K(gt)),$t=xt&&Oe.is(K(xt)),Kt=mt!==$t,nn=mt&&$t,It=Ge.isBackward();if(Kt){const Vt=Ge.clone();Vt.focus.set(Oe.getKey(),It?0:Oe.getChildrenSize(),"element"),e.$setSelection(Vt),V(le,Me)}else nn&&(gt.is(xt)||(Me.setAnchorCellForSelection(St(gt)),Me.setFocusCellForSelection(St(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()?Ee(le,Me):!Me.hasHijackedSelectionStyles&&Oe.isSelected()&&V(le,Me),!1)},e.COMMAND_PRIORITY_CRITICAL)),Me}function Y(Oe,ie){Oe[k]=ie}function re(Oe){return Oe[k]}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 ue(Oe){const ie=[],le={cells:ie,columns:0,rows:0};let ve=Oe.firstChild,Ie=0,Me=0;for(ie.length=0;ve!=null;){const je=ve.nodeName;if(je==="TD"||je==="TH"){const ot=ve,St={elem:ot,hasBackgroundColor:ot.style.backgroundColor!=="",highlighted:!1,x:Ie,y:Me};ve._cell=St;let Ge=ie[Me];Ge===void 0&&(Ge=ie[Me]=[]),Ge[Ie]=St}else{const ot=ve.firstChild;if(ot!=null){ve=ot;continue}}const it=ve.nextSibling;if(it!=null){Ie++,ve=it;continue}const st=ve.parentNode;if(st!=null){const ot=st.nextSibling;if(ot==null)break;Me++,Ie=0,ve=ot}}return le.columns=Ie+1,le.rows=Me+1,le}function q(Oe,ie,le){const ve=new Set(le?le.getNodes():[]);H(ie,(Ie,Me)=>{const je=Ie.elem;ve.has(Me)?(Ie.highlighted=!0,Z(Oe,Ie)):(Ie.highlighted=!1,oe(Oe,Ie),je.getAttribute("style")||je.removeAttribute("style"))})}function H(Oe,ie){const{cells:le}=Oe;for(let ve=0;ve<le.length;ve++){const Ie=le[ve];if(Ie)for(let Me=0;Me<Ie.length;Me++){const je=Ie[Me];if(!je)continue;const it=e.$getNearestNodeFromDOMNode(je.elem);it!==null&&ie(je,it,{x:Me,y:ve})}}}function V(Oe,ie){ie.disableHighlightStyle(),H(ie.grid,le=>{le.highlighted=!0,Z(Oe,le)})}function Ee(Oe,ie){ie.enableHighlightStyle(),H(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,Ie)=>{const Me=Ie==="forward";switch(Ie){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)?z(ie.getCellNodeFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid),Me):ve!==(Me?Oe.grid.rows-1:0)?z(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?z(ie.getCellNodeFromCordsOrThrow(le,ve-1,Oe.grid),!1):ie.selectPrevious(),!0;case"down":return ve!==Oe.grid.rows-1?z(ie.getCellNodeFromCordsOrThrow(le,ve+1,Oe.grid),!0):ie.selectNext(),!0;default:return!1}},Te=(Oe,ie,le,ve,Ie)=>{const Me=Ie==="forward";switch(Ie){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 z(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 j(Oe){const ie=t.$findMatchingParent(Oe,S);return S(ie)?ie:null}function K(Oe){const ie=t.$findMatchingParent(Oe,B);return B(ie)?ie:null}function J(Oe,ie,le,ve,Ie){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:it}=Me,st=t.$findMatchingParent(je.getNode(),S),ot=t.$findMatchingParent(it.getNode(),S);if(!S(st)||!st.is(ot))return!1;const St=K(st);if(St!==ve&&St!=null){const xt=Oe.getElementByKey(St.getKey());if(xt!=null)return Ie.grid=ue(xt),J(Oe,ie,le,St,Ie)}const Ge=Oe.getElementByKey(st.__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"?st.getFirstChild():st.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(st,Ie.grid);if(ie.shiftKey){const mt=ve.getCellFromCordsOrThrow(xt.x,xt.y,Ie.grid);Ie.setAnchorCellForSelection(mt),Ie.setFocusCellForSelection(mt,!0)}else return Se(Ie,ve,xt.x,xt.y,le);return!0}}else if(r(Me)){const{anchor:je,focus:it}=Me,st=t.$findMatchingParent(je.getNode(),S),ot=t.$findMatchingParent(it.getNode(),S),[St]=Me.getNodes(),Ge=Oe.getElementByKey(St.getKey());if(!S(st)||!S(ot)||!B(St)||Ge==null)return!1;Ie.updateTableGridSelection(Me);const ze=ue(Ge),tt=ve.getCordsFromCellNode(st,ze),yt=ve.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Ie.setAnchorCellForSelection(yt),R(ie),ie.shiftKey){const Nt=ve.getCordsFromCellNode(ot,ze);return Te(Ie,St,Nt.x,Nt.y,le)}else ot.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(),Ie=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 it=je.getChildrenSize();for(let st=0;st<it;st++){const ot=document.createElement("col");Ie.append(ot)}return ve.replaceChildren(Ie,Me),ve}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,le){const{rows:ve,cells:Ie}=le;for(let Me=0;Me<ve;Me++){const je=Ie[Me];if(je==null)continue;const it=je.findIndex(st=>{if(!st)return;const{elem:ot}=st;return e.$getNearestNodeFromDOMNode(ot)===ie});if(it!==-1)return{x:it,y:Me}}throw new Error("Cell not found in table.")}getCellFromCords(ie,le,ve){const{cells:Ie}=ve,Me=Ie[le];if(Me==null)return null;const je=Me[ie];return je??null}getCellFromCordsOrThrow(ie,le,ve){const Ie=this.getCellFromCords(ie,le,ve);if(!Ie)throw new Error("Cell not found at cords.");return Ie}getCellNodeFromCords(ie,le,ve){const Ie=this.getCellFromCords(ie,le,ve);if(Ie==null)return null;const Me=e.$getNearestNodeFromDOMNode(Ie.elem);return S(Me)?Me:null}getCellNodeFromCordsOrThrow(ie,le,ve){const Ie=this.getCellNodeFromCords(ie,le,ve);if(!Ie)throw new Error("Node at cords not TableCellNode.");return Ie}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 ue(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 Ie=0;Ie<Oe;Ie++){const Me=m();for(let je=0;je<ie;je++){let it=p.NO_STATUS;typeof le=="object"?(Ie===0&&le.rows&&(it|=p.ROW),je===0&&le.columns&&(it|=p.COLUMN)):le&&(Ie===0&&(it|=p.ROW),je===0&&(it|=p.COLUMN));const st=T(it),ot=e.$createParagraphNode();ot.append(e.$createTextNode()),st.append(ot),Me.append(st)}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:Ie}=le.getCordsFromCellNode(Oe,ie);return{above:le.getCellNodeFromCords(ve,Ie-1,ie),below:le.getCellNodeFromCords(ve,Ie+1,ie),left:le.getCellNodeFromCords(ve-1,Ie,ie),right:le.getCellNodeFromCords(ve+1,Ie,ie)}}function ce(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,Ie){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 it=0;it<ve;it++){const st=je.getChildren(),ot=st.length,St=m();for(let Ge=0;Ge<ot;Ge++){const ze=st[Ge];if(!S(ze))throw Error("Expected table cell");const{above:tt,below:yt}=ne(ze,Ie);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=T(Nt,1,Et);gt.append(e.$createParagraphNode()),St.append(gt)}le?je.insertAfter(St):je.insertBefore(St)}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,,Ie]=e.DEPRECATED_$getNodeTriplet(le),[Me,je]=e.DEPRECATED_$computeGridMap(Ie,ve,ve),it=Me[0].length,{startRow:st}=je;if(Oe){const ot=st+ve.__rowSpan-1,St=Me[ot],Ge=m();for(let tt=0;tt<it;tt++){const{cell:yt,startRow:Nt}=St[tt];Nt+yt.__rowSpan-1<=ot?Ge.append(T(p.NO_STATUS).append(e.$createParagraphNode())):yt.setRowSpan(yt.__rowSpan+1)}const ze=Ie.getChildAtIndex(ot);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const ot=Me[st],St=m();for(let ze=0;ze<it;ze++){const{cell:tt,startRow:yt}=ot[ze];yt===st?St.append(T(p.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Ie.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(St)}}function Re(Oe,ie,le=!0,ve,Ie){const Me=Oe.getChildren(),je=[];for(let it=0;it<Me.length;it++){const st=Me[it];if(v(st))for(let ot=0;ot<ve;ot++){const St=st.getChildren();if(ie>=St.length||ie<0)throw new Error("Table column target index out of range");const Ge=St[ie];if(!S(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=ne(Ge,Ie);let yt=p.NO_STATUS;(ze&&ze.hasHeaderState(p.ROW)||tt&&tt.hasHeaderState(p.ROW))&&(yt|=p.ROW);const Nt=T(yt);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:it,targetCell:st})=>{le?st.insertAfter(it):st.insertBefore(it)}),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(),[Ie]=e.DEPRECATED_$getNodeTriplet(le),[Me,,je]=e.DEPRECATED_$getNodeTriplet(ve),[it,st,ot]=e.DEPRECATED_$computeGridMap(je,Me,Ie),St=it.length,Ge=Oe?Math.max(st.startColumn,ot.startColumn):Math.min(st.startColumn,ot.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=T(p.NO_STATUS).append(e.$createParagraphNode());return yt===null&&(yt=gt),gt}let Et=tt;e:for(let gt=0;gt<St;gt++){if(gt!==0){const nn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected row nextSibling to be a row");Et=nn}const xt=it[gt];if(ze<0){At(Et,Nt());continue}const{cell:mt,startColumn:$t,startRow:Kt}=xt[ze];if($t+mt.__colSpan-1<=ze){let nn=mt,It=Kt,Vt=ze;for(;It!==gt&&nn.__rowSpan>1;)if(Vt-=mt.__colSpan,Vt>=0){const{cell:bt,startRow:rn}=xt[Vt];nn=bt,It=rn}else{Et.append(Nt());continue e}nn.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 Ie=le[ve];if(v(Ie)){const Me=Ie.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,,Ie]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,it,st]=e.DEPRECATED_$computeGridMap(Ie,ve,Me),{startRow:ot}=it,{startRow:St}=st,Ge=St+Me.__rowSpan-1;if(je.length===Ge-ot+1){Ie.remove();return}const ze=je[0].length,tt=je[Ge+1],yt=Ie.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=ot;Nt--){for(let gt=ze-1;gt>=0;gt--){const{cell:xt,startRow:mt,startColumn:$t}=je[Nt][gt];if($t===gt&&(Nt===ot&&mt<ot&&xt.setRowSpan(xt.__rowSpan-(mt-ot)),mt>=ot&&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=Ie.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[ot-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,,Ie]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,it,st]=e.DEPRECATED_$computeGridMap(Ie,ve,Me),{startColumn:ot}=it,{startRow:St,startColumn:Ge}=st,ze=Math.min(ot,Ge),tt=Math.max(ot+ve.__colSpan-1,Ge+Me.__colSpan-1),yt=tt-ze+1;if(je[0].length===tt-ze+1){Ie.selectPrevious(),Ie.remove();return}const Et=je.length;for(let mt=0;mt<Et;mt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:nn}=je[mt][$t];if(nn<ze){if($t===ze){const It=ze-nn;Kt.setColSpan(Kt.__colSpan-Math.min(yt,Kt.__colSpan-It))}}else if(nn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-nn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const gt=je[St],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,Ie]=e.DEPRECATED_$getNodeTriplet(ie),Me=le.__colSpan,je=le.__rowSpan;if(Me>1){for(let it=1;it<Me;it++)le.insertAfter(T(p.NO_STATUS));le.setColSpan(1)}if(je>1){const[it,st]=e.DEPRECATED_$computeGridMap(Ie,le,le),{startColumn:ot,startRow:St}=st;let Ge;for(let ze=1;ze<je;ze++){const tt=St+ze,yt=it[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<ot;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,T(p.NO_STATUS));else for(let Et=0;Et<Me;Et++)Nt.insertAfter(T(p.NO_STATUS))}le.setRowSpan(1)}}const tn=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=l,Jt.$createTableCellNode=T,Jt.$createTableNode=_e,Jt.$createTableNodeWithDimensions=A,Jt.$createTableRowNode=m,Jt.$deleteTableColumn=Fe,Jt.$deleteTableColumn__EXPERIMENTAL=Be,Jt.$deleteTableRow__EXPERIMENTAL=qe,Jt.$getElementGridForTableNode=X,Jt.$getTableCellNodeFromLexicalNode=F,Jt.$getTableColumnIndexFromTableCellNode=ee,Jt.$getTableNodeFromLexicalNodeOrThrow=ye,Jt.$getTableRowIndexFromTableCellNode=De,Jt.$getTableRowNodeFromTableCellNodeOrThrow=se,Jt.$insertTableColumn=Re,Jt.$insertTableColumn__EXPERIMENTAL=ke,Jt.$insertTableRow=be,Jt.$insertTableRow__EXPERIMENTAL=Ne,Jt.$isGridSelection=r,Jt.$isTableCellNode=S,Jt.$isTableNode=B,Jt.$isTableRowNode=v,Jt.$removeTableRowAtIndex=ce,Jt.$unmergeCell=Ut,Jt.INSERT_TABLE_COMMAND=tn,Jt.TableCellHeaderStates=p,Jt.TableCellNode=_,Jt.TableNode=U,Jt.TableRowNode=w,Jt.TableSelection=P,Jt.applyTableHandlers=W,Jt.getCellFromTarget=te,Jt.getTableSelectionFromTableElement=re,Jt}var Xt={},Ah;function HC(){if(Ah)return Xt;Ah=1;var e=jt(),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:tn}=ut;be=Math.min(be,Ut),Ne=Math.min(Ne,tn),Re=Math.max(Re,Ut+At.__colSpan-1),ke=Math.max(ke,tn+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,ce]=e.DEPRECATED_$computeGridMap(F,ye,se),be=Math.min(ne.startColumn,ce.startColumn),Ne=Math.min(ne.startRow,ce.startRow),Re=Math.max(ne.startColumn+ne.cell.__colSpan-1,ce.startColumn+ce.cell.__colSpan-1),ke=Math.max(ne.startRow+ne.cell.__rowSpan-1,ce.startRow+ce.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 E extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(A){let F=new E(A.__headerState,A.__colSpan,A.__width,A.__key);return F.__rowSpan=A.__rowSpan,F.__backgroundColor=A.__backgroundColor,F}static importDOM(){return{td:()=>({conversion:T,priority:0}),th:()=>({conversion:T,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 T(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 E(B,A,F))}function w(B){return B instanceof E}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 I(B){return B instanceof M}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class P{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=W(se)}})});this.editor.update(()=>{let F=this.editor.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");this.grid=W(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(!K(F))throw Error("Expected TableNode.");if(F=A.getElementByKey(this.tableNodeKey),!F)throw Error("Expected to find TableElement in DOM");F=W(F),Y(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(),Y(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(!K(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),Y(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(!K(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()})}}),Y(A,this.grid,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function k(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 W(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 Y(B,A,F){let se=new Set(F?F.getNodes():[]);re(A,(ye,De)=>{let ee=ye.elem;se.has(De)?(ye.highlighted=!0,Ee(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,Ee(B,F)})}function ue(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 q=(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}},H=(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 V(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 Ee(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 Te(B){return B=t.$findMatchingParent(B,w),w(B)?B:null}function de(B){return B=t.$findMatchingParent(B,K),K(B)?B:null}function z(B,A,F,se,ye){let De=e.$getSelection();if(!V(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 ce=B.getElementByKey(ne.getKey());if(ce!=null)return ye.grid=W(ce),z(B,A,F,ne,ye)}if(ne=B.getElementByKey(ee.__key),ce=B.getElementByKey(be.key),ce==null||ne==null)return!1;if(be.type==="element")ne=ce.getBoundingClientRect();else{if(ne=window.getSelection(),ne===null||ne.rangeCount===0)return!1;ne=ne.getRangeAt(0).getBoundingClientRect()}if(ce=F==="up"?ee.getFirstChild():ee.getLastChild(),ce==null||(B=B.getElementByKey(ce.__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 q(ye,se,B.x,B.y,F);return!0}}else if(l(De)){let{anchor:be,focus:Ne}=De;return ce=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w),[ee]=De.getNodes(),B=B.getElementByKey(ee.getKey()),!w(ce)||!w(ne)||!K(ee)||B==null?!1:(ye.updateTableGridSelection(De),B=W(B),ce=se.getCordsFromCellNode(ce,B),ce=se.getCellFromCordsOrThrow(ce.x,ce.y,B),ye.setAnchorCellForSelection(ce),O(A),A.shiftKey?(A=se.getCordsFromCellNode(ne,B),H(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 j()}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(),!I(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:j()}}function j(){return e.$applyNodeReplacement(new Z)}function K(B){return B instanceof Z}function J(B){if(B=t.$findMatchingParent(B,A=>I(A)),I(B))return B;throw Error("Expected table cell to be inside of table row.")}function R(B){if(B=t.$findMatchingParent(B,A=>K(A)),K(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 Xt.$createGridSelection=d,Xt.$createTableCellNode=S,Xt.$createTableNode=j,Xt.$createTableNodeWithDimensions=function(B,A,F=!0){let se=j();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 ce=e.$createParagraphNode();ce.append(e.$createTextNode()),ye.append(ce),ee.append(ye)}se.append(ee)}return se},Xt.$createTableRowNode=v,Xt.$deleteTableColumn=function(B,A){let F=B.getChildren();for(let ye=0;ye<F.length;ye++){var se=F[ye];if(I(se)){if(se=se.getChildren(),A>=se.length||0>A)throw Error("Table column target index out of range");se[A].remove()}}return B},Xt.$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:ce,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[ce],A=B[be+A.__colSpan],A!==void 0?({cell:A}=A,X(A)):({cell:A}=B[be-1],X(A))}},Xt.$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 ce=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}=ce[Ne-1];Be.insertAfter(ke)}}Ne=se.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ce!==void 0?({cell:A}=ce[0],X(A)):({cell:A}=ye[A-1][0],X(A))}},Xt.$getElementGridForTableNode=function(B,A){if(B=B.getElementByKey(A.getKey()),B==null)throw Error("Table Element Not Found");return W(B)},Xt.$getTableCellNodeFromLexicalNode=function(B){return B=t.$findMatchingParent(B,A=>w(A)),w(B)?B:null},Xt.$getTableColumnIndexFromTableCellNode=function(B){return J(B).getChildren().findIndex(A=>A.is(B))},Xt.$getTableNodeFromLexicalNodeOrThrow=R,Xt.$getTableRowIndexFromTableCellNode=function(B){let A=J(B);return R(A).getChildren().findIndex(F=>F.is(A))},Xt.$getTableRowNodeFromTableCellNodeOrThrow=J,Xt.$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(I(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 ce=_.NO_STATUS;(ke&&ke.hasHeaderState(_.ROW)||Fe&&Fe.hasHeaderState(_.ROW))&&(ce|=_.ROW),ce=S(ce),ce.append(e.$createParagraphNode()),ee.push({newTableCell:ce,targetCell:ne})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{F?Ne.insertAfter(be):Ne.insertBefore(be)}),B},Xt.$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,ce]=e.DEPRECATED_$computeGridMap(De,ye,se);se=ee.length,F=B?Math.max(ne.startColumn,ce.startColumn):Math.min(ne.startColumn,ce.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:tn}=Re[At];Be=Ut,ut=tn}else{Ne.append(A());continue e}Be.insertAfter(A())}else ke.setColSpan(ke.__colSpan+1)}be!==null&&X(be)},Xt.$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],I(A))for(De=0;De<se;De++){let ne=A.getChildren(),ce=ne.length,be=v();for(let Ne=0;Ne<ce;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},Xt.$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 ce=0;ce<A;ce++){let{cell:be,startRow:Ne}=ne[ce];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(),ce=0;ce<A;ce++){let{cell:be,startRow:Ne}=ne[ce];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)}},Xt.$isGridSelection=l,Xt.$isTableCellNode=w,Xt.$isTableNode=K,Xt.$isTableRowNode=I,Xt.$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},Xt.$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[ce,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=ce[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)}},Xt.INSERT_TABLE_COMMAND=_e,Xt.TableCellHeaderStates=_,Xt.TableCellNode=E,Xt.TableNode=Z,Xt.TableRowNode=M,Xt.TableSelection=P,Xt.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 P(F,B.getKey()),ne=F._window||window;A.__lexicalTableSelection=ee,A.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&ne){var Re=k(Ne.target);Re!==null&&(O(Ne),ee.setAnchorCellForSelection(Re));var ke=()=>{ne.removeEventListener("mouseup",ke),ne.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=k(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 ce=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",ce),ee.listenersToRemove.add(()=>ne.removeEventListener("mousedown",ce)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>z(F,Ne,"down",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>z(F,Ne,"up",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>z(F,Ne,"backward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>z(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(!V(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 V(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 V(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 V(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()||!V(Re,B)||(Re=Te(Re.anchor.getNode()),Re===null)?!1:(O(Ne),Re=B.getCordsFromCellNode(Re,ee.grid),q(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(),Ie=>e.DEPRECATED_$isGridCellNode(Ie))!==null&&t.$findMatchingParent(ke.focus.getNode(),Ie=>e.DEPRECATED_$isGridCellNode(Ie))!==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(),Ie=>e.DEPRECATED_$isGridCellNode(Ie)),At=(qe=ut&&t.$findMatchingParent(ut,Ie=>e.DEPRECATED_$isGridRowNode(Ie)))&&t.$findMatchingParent(qe,Ie=>e.DEPRECATED_$isGridNode(Ie));if(!e.DEPRECATED_$isGridCellNode(ut)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(At))return!1;var Ut=qe.getIndexWithinParent(),tn=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,tn),Be=Math.max(Be,ut),Ut=Math.max(Ut,tn),At=At.getChildren(),tn=0;let Oe,ie;for(ut=qe;ut<=Ut;ut++){var le=At[ut];if(!e.DEPRECATED_$isGridRowNode(le))return!1;var ve=Ne[tn];if(!e.DEPRECATED_$isGridRowNode(ve))return!1;le=le.getChildren(),ve=ve.getChildren();let Ie=0;for(let Me=Fe;Me<=Be;Me++){let je=le[Me];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let it=ve[Ie];if(!e.DEPRECATED_$isGridCellNode(it))return!1;ut===qe&&Me===Fe?Oe=je.getKey():ut===Ut&&Me===Be&&(ie=je.getKey());let st=je.getChildren();it.getChildren().forEach(ot=>{e.$isTextNode(ot)&&e.$createParagraphNode().append(ot),je.append(ot)}),st.forEach(ot=>ot.remove()),Ie++}tn++}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=Te(ke),Fe=Te(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()?ue(F,ee):!ee.hasHijackedSelectionStyles&&B.isSelected()&&te(F,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Xt.getCellFromTarget=k,Xt.getTableSelectionFromTableElement=function(B){return B.__lexicalTableSelection},Xt}var Du,Mh;function wd(){return Mh||(Mh=1,Du=process.env.NODE_ENV==="development"?BC():HC()),Du}var Rh;function WC(){if(Rh)return Ou;Rh=1;var e=qn(),t=wd(),n=pn(),r=jt(),l=rt;function d({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){const[E]=e.useLexicalComposerContext();return l.useEffect(()=>{if(!E.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return E.registerCommand(t.INSERT_TABLE_COMMAND,({columns:T,rows:S,includeHeaders:w})=>{const M=t.$createTableNodeWithDimensions(Number(S),Number(T),w);n.$insertNodeToNearestRoot(M);const m=M.getFirstDescendant();return r.$isTextNode(m)&&m.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[E]),l.useEffect(()=>{const T=new Map,S=M=>{const m=M.getKey(),v=E.getElementByKey(m);if(v&&!T.has(m)){const I=t.applyTableHandlers(M,v,E,_);T.set(m,I)}};E.getEditorState().read(()=>{const M=r.$nodesOfType(t.TableNode);for(const m of M)t.$isTableNode(m)&&S(m)});const w=E.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)if(v==="created")E.getEditorState().read(()=>{const I=r.$getNodeByKey(m);t.$isTableNode(I)&&S(I)});else if(v==="destroyed"){const I=T.get(m);I!==void 0&&(I.removeListeners(),T.delete(m))}});return()=>{w();for(const[,M]of T)M.removeListeners()}},[E,_]),l.useEffect(()=>{if(!f)return E.registerNodeTransform(t.TableCellNode,T=>{if(T.getColSpan()>1||T.getRowSpan()>1){const[,,S]=r.DEPRECATED_$getNodeTriplet(T),[w]=r.DEPRECATED_$computeGridMap(S,T,T),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 I=[];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 P=null;for(let k=0;k<m;k++){const W=w[G][k],Y=W.cell;if(W.startRow===G&&W.startColumn===k)P=Y,I.push(Y);else if(Y.getColSpan()>1||Y.getRowSpan()>1){if(!t.$isTableCellNode(Y))throw Error("Expected TableNode cell to be a TableCellNode");const re=t.$createTableCellNode(Y.__headerState);P!==null?P.insertAfter(re):n.$insertFirst(v,re)}}}for(const G of I)G.setColSpan(1),G.setRowSpan(1)}})},[E,f]),l.useEffect(()=>{if(!p)return E.registerNodeTransform(t.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[E,p,f]),null}return Ou.TablePlugin=d,Ou}var Au={},bh;function KC(){if(bh)return Au;bh=1;var e=qn(),t=wd(),n=pn(),r=jt(),l=rt;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 Au.TablePlugin=function({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){let[E]=e.useLexicalComposerContext();return l.useEffect(()=>(E.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode])||d(10),E.registerCommand(t.INSERT_TABLE_COMMAND,({columns:T,rows:S,includeHeaders:w})=>(T=t.$createTableNodeWithDimensions(Number(S),Number(T),w),n.$insertNodeToNearestRoot(T),T=T.getFirstDescendant(),r.$isTextNode(T)&&T.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[E]),l.useEffect(()=>{let T=new Map,S=M=>{const m=M.getKey(),v=E.getElementByKey(m);v&&!T.has(m)&&(M=t.applyTableHandlers(M,v,E,_),T.set(m,M))};E.getEditorState().read(()=>{let M=r.$nodesOfType(t.TableNode);for(let m of M)t.$isTableNode(m)&&S(m)});let w=E.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)v==="created"?E.getEditorState().read(()=>{const I=r.$getNodeByKey(m);t.$isTableNode(I)&&S(I)}):v==="destroyed"&&(M=T.get(m),M!==void 0&&(M.removeListeners(),T.delete(m)))});return()=>{w();for(let[,M]of T)M.removeListeners()}},[E,_]),l.useEffect(()=>{if(!f)return E.registerNodeTransform(t.TableCellNode,T=>{if(1<T.getColSpan()||1<T.getRowSpan()){var[,,S]=r.DEPRECATED_$getNodeTriplet(T);[T]=r.DEPRECATED_$computeGridMap(S,T,T);let M=T.length,m=T[0].length;if(S=S.getFirstChild(),!r.DEPRECATED_$isGridRowNode(S))throw Error("Expected TableNode first child to be a RowNode");let v=[];for(let I=0;I<M;I++){if(I!==0&&(S=S.getNextSibling(),!r.DEPRECATED_$isGridRowNode(S)))throw Error("Expected TableNode first child to be a RowNode");let G=null;for(let P=0;P<m;P++){var w=T[I][P];let k=w.cell;if(w.startRow===I&&w.startColumn===P)G=k,v.push(k);else if(1<k.getColSpan()||1<k.getRowSpan()){if(!t.$isTableCellNode(k))throw Error("Expected TableNode cell to be a TableCellNode");w=t.$createTableCellNode(k.__headerState),G!==null?G.insertAfter(w):n.$insertFirst(S,w)}}}for(let I of v)I.setColSpan(1),I.setRowSpan(1)}})},[E,f]),l.useEffect(()=>{if(!p)return E.registerNodeTransform(t.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[E,p,f]),null},Au}const zC=process.env.NODE_ENV==="development"?WC():KC();var UC=zC,Pn={},Mu={exports:{}},Lh;function Rp(){return Lh||(Lh=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 k(P){return P instanceof _?new _(P.type,k(P.content),P.alias):Array.isArray(P)?P.map(k):P.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++d}),k.__id},clone:function k(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]=k(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]=k(ce,H)}),j);default:return P}},getLanguage:function(k){for(;k;){var P=l.exec(k.className);if(P)return P[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,P){k.className=k.className.replace(RegExp(l,"gi"),""),k.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 k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(j.stack)||[])[1];if(k){var P=document.getElementsByTagName("script");for(var H in P)if(P[H].src==k)return P[H]}return null}},isActive:function(k,P,H){for(var j="no-"+P;k;){var re=k.classList;if(re.contains(P))return!0;if(re.contains(j))return!1;k=k.parentElement}return!!H}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(k,P){var H=p.util.clone(p.languages[k]);for(var j in P)H[j]=P[j];return H},insertBefore:function(k,P,H,j){j=j||p.languages;var re=j[k],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[k];return j[k]=te,p.languages.DFS(p.languages,function(q,Te){Te===z&&q!=k&&(this[q]=te)}),te},DFS:function k(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,k(V,H,null,re)):z==="Array"&&!re[te(V)]&&(re[te(V)]=!0,k(V,H,ce,re))}}},plugins:{},highlightAll:function(k,P){p.highlightAllUnder(document,k,P)},highlightAllUnder:function(k,P,H){var j={callback:H,container:k,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(k,P,H){var j=p.util.getLanguage(k),re=p.languages[j];p.util.setLanguage(k,j);var te=k.parentElement;te&&te.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(te,j);var ce=k.textContent,V={element:k,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(k,P,H){var j={code:k,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(k,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,k),T(k,re,P,re.head,0),m(re)},hooks:{all:{},add:function(k,P){var H=p.hooks.all;H[k]=H[k]||[],H[k].push(P)},run:function(k,P){var H=p.hooks.all[k];if(!(!H||!H.length))for(var j=0,re;re=H[j++];)re(P)}},Token:_};r.Prism=p;function _(k,P,H,j){this.type=k,this.content=P,this.alias=H,this.length=(j||"").length|0}_.stringify=function k(P,H){if(typeof P=="string")return P;if(Array.isArray(P)){var j="";return P.forEach(function(z){j+=k(z,H)}),j}var re={type:P.type,content:k(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 E(k,P,H,j){k.lastIndex=P;var re=k.exec(H);if(re&&j&&re[1]){var te=re[1].length;re.index+=te,re[0]=re[0].slice(te)}return re}function T(k,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 D=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>k.length)return;if(!(Y instanceof _)){var W=1,J;if(Ee){if(J=E(D,oe,k,Se),!J||J.index>=k.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=k.slice(oe,U),J.index-=oe}else if(J=E(D,0,Y,Se),!J)continue;var fe=J.index,_e=J[0],B=Y.slice(0,fe),M=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),O(P,se,W);var ye=new _(ce,Te?p.tokenize(_e,Te):_e,de,_e);if(Z=w(P,se,ye),M&&w(P,Z,M),W>1){var De={cause:ce+","+z,reach:F};T(k,P,H,Z.prev,oe,De),te&&De.reach>te.reach&&(te.reach=De.reach)}}}}}}function S(){var k={value:null,prev:null,next:null},P={value:null,prev:k,next:null};k.next=P,this.head=k,this.tail=P,this.length=0}function w(k,P,H){var j=P.next,re={value:H,prev:P,next:j};return P.next=re,j.prev=re,k.length++,re}function O(k,P,H){for(var j=P.next,re=0;re<H&&j!==k.tail;re++)j=j.next;P.next=j,j.prev=P,k.length-=re}function m(k){for(var P=[],H=k.head.next;H!==k.tail;)P.push(H.value),H=H.next;return P}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(k){var P=JSON.parse(k.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 I(){p.manual||p.highlightAll()}if(!p.manual){var G=document.readyState;G==="loading"||G==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",I):window.requestAnimationFrame?window.requestAnimationFrame(I):window.setTimeout(I,16)}return p}(t);e.exports&&(e.exports=n),typeof mf<"u"&&(mf.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,I){return"✖ Error "+v+" while fetching file: "+I},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",E="loaded",T="failed",S="pre[data-src]:not(["+p+'="'+E+'"]):not(['+p+'="'+_+'"])';function w(v,I,G){var k=new XMLHttpRequest;k.open("GET",v,!0),k.onreadystatechange=function(){k.readyState==4&&(k.status<400&&k.responseText?I(k.responseText):k.status>=400?G(l(k.status,k.statusText)):G(d))},k.send(null)}function O(v){var I=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(I){var G=Number(I[1]),k=I[2],P=I[3];return k?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 I=v.element;if(I.matches(S)){v.code="",I.setAttribute(p,_);var G=I.appendChild(document.createElement("CODE"));G.textContent=r;var k=I.getAttribute("data-src"),P=v.language;if(P==="none"){var H=(/\.(\w+)$/.exec(k)||[,"none"])[1];P=f[H]||H}n.util.setLanguage(G,P),n.util.setLanguage(I,P);var j=n.plugins.autoloader;j&&j.loadLanguages(P),w(k,function(re){I.setAttribute(p,E);var te=O(I.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
|
-
`),I.hasAttribute("data-start")||I.setAttribute("data-start",String(V+1))}G.textContent=re,n.highlightElement(G)},function(re){I.setAttribute(p,T),G.textContent=re})}}),n.plugins.fileHighlight={highlight:function(I){for(var G=(I||document).querySelectorAll(S),k=0,P;P=G[k++];)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)}}()}(Au)),Au.exports}var bh={},Lh;function Ap(){return Lh||(Lh=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:/[{}[\];(),.:]/}),bh}var Ih={},kh;function Mp(){return kh||(kh=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),Ih}var Ph={},$h;function Rp(){return $h||($h=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),Ph}var Fh={},Bh;function bp(){return Bh||(Bh=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(T){return T=T.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+T+")")}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(T){["url","bold","italic","strike","code-snippet"].forEach(function(S){T!==S&&(e.languages.markdown[T].inside.content.inside[S]=e.languages.markdown[S])})}),e.hooks.add("after-tokenize",function(T){if(T.language!=="markdown"&&T.language!=="md")return;function S(w){if(!(!w||typeof w=="string"))for(var O=0,m=w.length;O<m;O++){var v=w[O];if(v.type!=="code"){S(v.content);continue}var I=v.content[1],G=v.content[3];if(I&&G&&I.type==="code-language"&&G.type==="code-block"&&typeof I.content=="string"){var k=I.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase();var P="language-"+k;G.alias?typeof G.alias=="string"?G.alias=[G.alias,P]:G.alias.push(P):G.alias=[P]}}}S(T.tokens)}),e.hooks.add("wrap",function(T){if(T.type==="code-block"){for(var S="",w=0,O=T.classes.length;w<O;w++){var m=T.classes[w],v=/language-(.+)/.exec(m);if(v){S=v[1];break}}var I=e.languages[S];if(I)T.content=e.highlight(E(T.content),I,S);else if(S&&S!=="none"&&e.plugins.autoloader){var G="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);T.attributes.id=G,e.plugins.autoloader.loadLanguages(S,function(){var k=document.getElementById(G);k&&(k.innerHTML=e.highlight(k.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 E(T){var S=T.replace(f,"");return S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,O){if(O=O.toLowerCase(),O[0]==="#"){var m;return O[1]==="x"?m=parseInt(O.slice(2),16):m=Number(O.slice(1)),_(m)}else{var v=p[O];return v||w}}),S}e.languages.md=e.languages.markdown}(Prism)),Fh}var Hh={},Wh;function Lp(){return Wh||(Wh=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),Hh}var Kh={},zh;function Ip(){return zh||(zh=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)),Kh}var Uh={},Gh;function kp(){return Gh||(Gh=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),Uh}var Yh={},jh;function Pp(){return jh||(jh=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:/[;[\]()`,.]/}),Yh}var Vh={},qh;function $p(){return qh||(qh=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),Vh}var Zh={},Jh;function Fp(){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)),Zh}var Xh={},Qh;function Bp(){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})),Xh}var eg={},tg;function Hp(){return tg||(tg=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)),eg}var ng={},rg;function Wp(){return rg||(rg=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)),ng}var ig={},sg;function Kp(){return sg||(sg=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)),ig}var og;function KC(){if(og)return Pn;og=1;var e=Dp();Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp(),Hp(),Wp(),Kp();var t=pn(),n=jt();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:E,priority:1}:null,div:ne=>({conversion:T,priority:1}),pre:ne=>({conversion:E,priority:0}),table:ne=>G(ne)?{conversion:S,priority:3}:null,td:ne=>{const ue=ne,be=ue.closest("table");return I(ue)?{conversion:O,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 P(k){return k instanceof _?new _(k.type,P(k.content),k.alias):Array.isArray(k)?k.map(P):k.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(P){return Object.prototype.toString.call(P).slice(8,-1)},objId:function(P){return P.__id||Object.defineProperty(P,"__id",{value:++d}),P.__id},clone:function P(k,W){W=W||{};var Y,re;switch(p.util.type(k)){case"Object":if(re=p.util.objId(k),W[re])return W[re];Y={},W[re]=Y;for(var te in k)k.hasOwnProperty(te)&&(Y[te]=P(k[te],W));return Y;case"Array":return re=p.util.objId(k),W[re]?W[re]:(Y=[],W[re]=Y,k.forEach(function(ue,q){Y[q]=P(ue,W)}),Y);default:return k}},getLanguage:function(P){for(;P;){var k=l.exec(P.className);if(k)return k[1].toLowerCase();P=P.parentElement}return"none"},setLanguage:function(P,k){P.className=P.className.replace(RegExp(l,"gi"),""),P.classList.add("language-"+k)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(Y){var P=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(Y.stack)||[])[1];if(P){var k=document.getElementsByTagName("script");for(var W in k)if(k[W].src==P)return k[W]}return null}},isActive:function(P,k,W){for(var Y="no-"+k;P;){var re=P.classList;if(re.contains(k))return!0;if(re.contains(Y))return!1;P=P.parentElement}return!!W}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(P,k){var W=p.util.clone(p.languages[P]);for(var Y in k)W[Y]=k[Y];return W},insertBefore:function(P,k,W,Y){Y=Y||p.languages;var re=Y[P],te={};for(var ue in re)if(re.hasOwnProperty(ue)){if(ue==k)for(var q in W)W.hasOwnProperty(q)&&(te[q]=W[q]);W.hasOwnProperty(ue)||(te[ue]=re[ue])}var H=Y[P];return Y[P]=te,p.languages.DFS(p.languages,function(V,Ee){Ee===H&&V!=P&&(this[V]=te)}),te},DFS:function P(k,W,Y,re){re=re||{};var te=p.util.objId;for(var ue in k)if(k.hasOwnProperty(ue)){W.call(k,ue,k[ue],Y||ue);var q=k[ue],H=p.util.type(q);H==="Object"&&!re[te(q)]?(re[te(q)]=!0,P(q,W,null,re)):H==="Array"&&!re[te(q)]&&(re[te(q)]=!0,P(q,W,ue,re))}}},plugins:{},highlightAll:function(P,k){p.highlightAllUnder(document,P,k)},highlightAllUnder:function(P,k,W){var Y={callback:W,container:P,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",Y),Y.elements=Array.prototype.slice.apply(Y.container.querySelectorAll(Y.selector)),p.hooks.run("before-all-elements-highlight",Y);for(var re=0,te;te=Y.elements[re++];)p.highlightElement(te,k===!0,Y.callback)},highlightElement:function(P,k,W){var Y=p.util.getLanguage(P),re=p.languages[Y];p.util.setLanguage(P,Y);var te=P.parentElement;te&&te.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(te,Y);var ue=P.textContent,q={element:P,language:Y,grammar:re,code:ue};function H(Ee){q.highlightedCode=Ee,p.hooks.run("before-insert",q),q.element.innerHTML=q.highlightedCode,p.hooks.run("after-highlight",q),p.hooks.run("complete",q),W&&W.call(q.element)}if(p.hooks.run("before-sanity-check",q),te=q.element.parentElement,te&&te.nodeName.toLowerCase()==="pre"&&!te.hasAttribute("tabindex")&&te.setAttribute("tabindex","0"),!q.code){p.hooks.run("complete",q),W&&W.call(q.element);return}if(p.hooks.run("before-highlight",q),!q.grammar){H(p.util.encode(q.code));return}if(k&&r.Worker){var V=new Worker(p.filename);V.onmessage=function(Ee){H(Ee.data)},V.postMessage(JSON.stringify({language:q.language,code:q.code,immediateClose:!0}))}else H(p.highlight(q.code,q.grammar,q.language))},highlight:function(P,k,W){var Y={code:P,grammar:k,language:W};if(p.hooks.run("before-tokenize",Y),!Y.grammar)throw new Error('The language "'+Y.language+'" has no grammar.');return Y.tokens=p.tokenize(Y.code,Y.grammar),p.hooks.run("after-tokenize",Y),_.stringify(p.util.encode(Y.tokens),Y.language)},tokenize:function(P,k){var W=k.rest;if(W){for(var Y in W)k[Y]=W[Y];delete k.rest}var re=new S;return w(re,re.head,P),T(P,re,k,re.head,0),m(re)},hooks:{all:{},add:function(P,k){var W=p.hooks.all;W[P]=W[P]||[],W[P].push(k)},run:function(P,k){var W=p.hooks.all[P];if(!(!W||!W.length))for(var Y=0,re;re=W[Y++];)re(k)}},Token:_};r.Prism=p;function _(P,k,W,Y){this.type=P,this.content=k,this.alias=W,this.length=(Y||"").length|0}_.stringify=function P(k,W){if(typeof k=="string")return k;if(Array.isArray(k)){var Y="";return k.forEach(function(H){Y+=P(H,W)}),Y}var re={type:k.type,content:P(k.content,W),tag:"span",classes:["token",k.type],attributes:{},language:W},te=k.alias;te&&(Array.isArray(te)?Array.prototype.push.apply(re.classes,te):re.classes.push(te)),p.hooks.run("wrap",re);var ue="";for(var q in re.attributes)ue+=" "+q+'="'+(re.attributes[q]||"").replace(/"/g,""")+'"';return"<"+re.tag+' class="'+re.classes.join(" ")+'"'+ue+">"+re.content+"</"+re.tag+">"};function E(P,k,W,Y){P.lastIndex=k;var re=P.exec(W);if(re&&Y&&re[1]){var te=re[1].length;re.index+=te,re[0]=re[0].slice(te)}return re}function T(P,k,W,Y,re,te){for(var ue in W)if(!(!W.hasOwnProperty(ue)||!W[ue])){var q=W[ue];q=Array.isArray(q)?q:[q];for(var H=0;H<q.length;++H){if(te&&te.cause==ue+","+H)return;var V=q[H],Ee=V.inside,Se=!!V.lookbehind,Te=!!V.greedy,de=V.alias;if(Te&&!V.pattern.global){var z=V.pattern.toString().match(/[imsuy]*$/)[0];V.pattern=RegExp(V.pattern.source,z+"g")}for(var O=V.pattern||V,Z=Y.next,oe=re;Z!==k.tail&&!(te&&oe>=te.reach);oe+=Z.value.length,Z=Z.next){var j=Z.value;if(k.length>P.length)return;if(!(j instanceof _)){var K=1,J;if(Te){if(J=E(O,oe,P,Se),!J||J.index>=P.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!==k.tail&&(U<R||typeof X.value=="string");X=X.next)K++,U+=X.value.length;K--,j=P.slice(oe,U),J.index-=oe}else if(J=E(O,0,j,Se),!J)continue;var fe=J.index,_e=J[0],B=j.slice(0,fe),A=j.slice(fe+_e.length),F=oe+j.length;te&&F>te.reach&&(te.reach=F);var se=Z.prev;B&&(se=w(k,se,B),oe+=B.length),M(k,se,K);var ye=new _(ue,Ee?p.tokenize(_e,Ee):_e,de,_e);if(Z=w(k,se,ye),A&&w(k,Z,A),K>1){var De={cause:ue+","+H,reach:F};T(P,k,W,Z.prev,oe,De),te&&De.reach>te.reach&&(te.reach=De.reach)}}}}}}function S(){var P={value:null,prev:null,next:null},k={value:null,prev:P,next:null};P.next=k,this.head=P,this.tail=k,this.length=0}function w(P,k,W){var Y=k.next,re={value:W,prev:k,next:Y};return k.next=re,Y.prev=re,P.length++,re}function M(P,k,W){for(var Y=k.next,re=0;re<W&&Y!==P.tail;re++)Y=Y.next;k.next=Y,Y.prev=k,P.length-=re}function m(P){for(var k=[],W=P.head.next;W!==P.tail;)k.push(W.value),W=W.next;return k}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(P){var k=JSON.parse(P.data),W=k.language,Y=k.code,re=k.immediateClose;r.postMessage(p.highlight(Y,p.languages[W],W)),re&&r.close()},!1)),p;var v=p.util.currentScript();v&&(p.filename=v.src,v.hasAttribute("data-manual")&&(p.manual=!0));function I(){p.manual||p.highlightAll()}if(!p.manual){var G=document.readyState;G==="loading"||G==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",I):window.requestAnimationFrame?window.requestAnimationFrame(I):window.setTimeout(I,16)}return p}(t);e.exports&&(e.exports=n),typeof yf<"u"&&(yf.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,I){return"✖ Error "+v+" while fetching file: "+I},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",E="loaded",T="failed",S="pre[data-src]:not(["+p+'="'+E+'"]):not(['+p+'="'+_+'"])';function w(v,I,G){var P=new XMLHttpRequest;P.open("GET",v,!0),P.onreadystatechange=function(){P.readyState==4&&(P.status<400&&P.responseText?I(P.responseText):P.status>=400?G(l(P.status,P.statusText)):G(d))},P.send(null)}function M(v){var I=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(I){var G=Number(I[1]),P=I[2],k=I[3];return P?k?[G,Number(k)]:[G,void 0]:[G,G]}}n.hooks.add("before-highlightall",function(v){v.selector+=", "+S}),n.hooks.add("before-sanity-check",function(v){var I=v.element;if(I.matches(S)){v.code="",I.setAttribute(p,_);var G=I.appendChild(document.createElement("CODE"));G.textContent=r;var P=I.getAttribute("data-src"),k=v.language;if(k==="none"){var W=(/\.(\w+)$/.exec(P)||[,"none"])[1];k=f[W]||W}n.util.setLanguage(G,k),n.util.setLanguage(I,k);var Y=n.plugins.autoloader;Y&&Y.loadLanguages(k),w(P,function(re){I.setAttribute(p,E);var te=M(I.getAttribute("data-range"));if(te){var ue=re.split(/\r\n?|\n/g),q=te[0],H=te[1]==null?ue.length:te[1];q<0&&(q+=ue.length),q=Math.max(0,Math.min(q-1,ue.length)),H<0&&(H+=ue.length),H=Math.max(0,Math.min(H,ue.length)),re=ue.slice(q,H).join(`
|
|
88
|
+
`),I.hasAttribute("data-start")||I.setAttribute("data-start",String(q+1))}G.textContent=re,n.highlightElement(G)},function(re){I.setAttribute(p,T),G.textContent=re})}}),n.plugins.fileHighlight={highlight:function(I){for(var G=(I||document).querySelectorAll(S),P=0,k;k=G[P++];)n.highlightElement(k)}};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)}}()}(Mu)),Mu.exports}var Ih={},kh;function bp(){return kh||(kh=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:/[{}[\];(),.:]/}),Ih}var Ph={},$h;function Lp(){return $h||($h=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),Ph}var Fh={},Bh;function Ip(){return Bh||(Bh=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),Fh}var Hh={},Wh;function kp(){return Wh||(Wh=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(T){return T=T.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+T+")")}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(T){["url","bold","italic","strike","code-snippet"].forEach(function(S){T!==S&&(e.languages.markdown[T].inside.content.inside[S]=e.languages.markdown[S])})}),e.hooks.add("after-tokenize",function(T){if(T.language!=="markdown"&&T.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 I=v.content[1],G=v.content[3];if(I&&G&&I.type==="code-language"&&G.type==="code-block"&&typeof I.content=="string"){var P=I.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");P=(/[a-z][\w-]*/i.exec(P)||[""])[0].toLowerCase();var k="language-"+P;G.alias?typeof G.alias=="string"?G.alias=[G.alias,k]:G.alias.push(k):G.alias=[k]}}}S(T.tokens)}),e.hooks.add("wrap",function(T){if(T.type==="code-block"){for(var S="",w=0,M=T.classes.length;w<M;w++){var m=T.classes[w],v=/language-(.+)/.exec(m);if(v){S=v[1];break}}var I=e.languages[S];if(I)T.content=e.highlight(E(T.content),I,S);else if(S&&S!=="none"&&e.plugins.autoloader){var G="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);T.attributes.id=G,e.plugins.autoloader.loadLanguages(S,function(){var P=document.getElementById(G);P&&(P.innerHTML=e.highlight(P.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 E(T){var S=T.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)),Hh}var Kh={},zh;function Pp(){return zh||(zh=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),Kh}var Uh={},Gh;function $p(){return Gh||(Gh=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)),Uh}var Yh={},jh;function Fp(){return jh||(jh=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),Yh}var Vh={},qh;function Bp(){return qh||(qh=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:/[;[\]()`,.]/}),Vh}var Zh={},Jh;function Hp(){return Jh||(Jh=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),Zh}var Xh={},Qh;function Wp(){return Qh||(Qh=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)),Xh}var eg={},tg;function Kp(){return tg||(tg=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})),eg}var ng={},rg;function zp(){return rg||(rg=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)),ng}var ig={},sg;function Up(){return sg||(sg=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)),ig}var og={},lg;function Gp(){return lg||(lg=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)),og}var ag;function GC(){if(ag)return Pn;ag=1;var e=Rp();bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp(),Hp(),Wp(),Kp(),zp(),Up(),Gp();var t=pn(),n=jt();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function l(ee,ne){for(const ce of ee.childNodes){if(t.isHTMLElement(ce)&&ce.tagName===ne)return!0;l(ce,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,ce){super(ce),this.__language=r(ne)}createDOM(ne){const ce=document.createElement("code");t.addClassNamesToElement(ce,ne.theme.code),ce.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ce.setAttribute(d,be),ce}updateDOM(ne,ce,be){const Ne=this.__language,Re=ne.__language;return Ne?Ne!==Re&&ce.setAttribute(d,Ne):Re&&ce.removeAttribute(d),!1}exportDOM(){const ne=document.createElement("pre");ne.setAttribute("spellcheck","false");const ce=this.getLanguage();return ce&&ne.setAttribute(d,ce),{element:ne}}static importDOM(){return{code:ne=>ne.textContent!=null&&(/\r?\n/.test(ne.textContent)||l(ne,"BR"))?{conversion:E,priority:1}:null,div:ne=>({conversion:T,priority:1}),pre:ne=>({conversion:E,priority:0}),table:ne=>G(ne)?{conversion:S,priority:3}:null,td:ne=>{const ce=ne,be=ce.closest("table");return I(ce)?{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 ce=p(ne.language);return ce.setFormat(ne.format),ce.setIndent(ne.indent),ce.setDirection(ne.direction),ce}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(ne,ce=!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,
|
|
91
|
-
`+ ++ke);
|
|
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,ce),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(Ee(Be)){let ve=0;const Ie=Be.getTextContent(),Me=Be.getTextContentSize();for(;ve<Me&&Ie[ve]===" ";ve++);if(ve!==0&&ut.push(V(" ".repeat(ve))),ve!==Me)break;Be=Be.getNextSibling()}else break;const At=qe.splitText(Re.offset)[0],Ut=Re.offset===0?0:1,tn=At.getIndexWithinParent()+Ut,Oe=qe.getParentOrThrow(),ie=[n.$createLineBreakNode(),...ut];Oe.splice(tn,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 ce=this.getWritable();ce.__language=r(ne)}getLanguage(){return this.getLatest().__language}}function p(ee){return n.$applyNodeReplacement(new f(ee))}function _(ee){return ee instanceof f}function E(ee){let ne;return t.isHTMLElement(ee)&&(ne=ee.getAttribute(d)),{node:p(ne)}}function T(ee){const ne=ee,ce=m(ne);return!ce&&!v(ne)?{node:null}:{after:be=>{const Ne=ee.parentNode;return Ne!=null&&ee!==Ne.lastChild&&be.push(n.$createLineBreakNode()),be},node:ce?p():null}}function S(){return{node:p()}}function w(){return{node:null}}function M(ee){const ne=ee;return{after:ce=>(ne.parentNode&&ne.parentNode.nextSibling&&ce.push(n.$createLineBreakNode()),ce),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 I(ee){return ee.classList.contains("js-file-line")}function G(ee){return ee.classList.contains("js-file-line-container")}const P="javascript",k={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"},W={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Y(ee){return W[ee]||ee}function re(ee){const ne=Y(ee);return k[ne]||ne}const te=()=>P,ue=()=>Object.keys(e.languages).filter(ee=>typeof e.languages[ee]!="function").sort();class q extends n.TextNode{constructor(ne,ce,be){super(ne,be),this.__highlightType=ce}static getType(){return"code-highlight"}static clone(ne){return new q(ne.__text,ne.__highlightType||void 0,ne.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(ne){const ce=super.createDOM(ne),be=H(ne.theme,this.__highlightType);return t.addClassNamesToElement(ce,be),ce}updateDOM(ne,ce,be){const Ne=super.updateDOM(ne,ce,be),Re=H(be.theme,ne.__highlightType),ke=H(be.theme,this.__highlightType);return Re!==ke&&(Re&&t.removeClassNamesFromElement(ce,Re),ke&&t.addClassNamesToElement(ce,ke)),Ne}static importJSON(ne){const ce=V(ne.text,ne.highlightType);return ce.setFormat(ne.format),ce.setDetail(ne.detail),ce.setMode(ne.mode),ce.setStyle(ne.style),ce}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(ne){return this}isParentRequired(){return!0}createParentElementNode(){return p()}}function H(ee,ne){return ne&&ee&&ee.codeHighlight&&ee.codeHighlight[ne]}function V(ee,ne){return n.$applyNodeReplacement(new q(ee,ne))}function Ee(ee){return ee instanceof q}function Se(ee){let ne=ee,ce=ee;for(;Ee(ce)||n.$isTabNode(ce);)ne=ce,ce=ce.getPreviousSibling();return ne}function Te(ee){let ne=ee,ce=ee;for(;Ee(ce)||n.$isTabNode(ce);)ne=ce,ce=ce.getNextSibling();return ne}const de={defaultLanguage:P,tokenize(ee,ne){return e.tokenize(ee,e.languages[ne||""]||e.languages[this.defaultLanguage])}};function z(ee,ne){let ce=null,be=null,Ne=ee,Re=ne,ke=ee.getTextContent();for(;;){if(Re===0){if(Ne=Ne.getPreviousSibling(),Ne===null)break;if(!(Ee(Ne)||n.$isTabNode(Ne)||n.$isLineBreakNode(Ne)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Ne)){ce={node:Ne,offset:1};break}Re=Math.max(0,Ne.getTextContentSize()-1),ke=Ne.getTextContent()}else Re--;const qe=ke[Re];Ee(Ne)&&qe!==" "&&(be={node:Ne,offset:Re})}if(be!==null)return be;let Fe=null;if(ne<ee.getTextContentSize())Ee(ee)&&(Fe=ee.getTextContent()[ne]);else{const qe=ee.getNextSibling();Ee(qe)&&(Fe=qe.getTextContent()[0])}if(Fe!==null&&Fe!==" ")return ce;{const qe=O(ee,ne);return qe!==null?qe:ce}}function O(ee,ne){let ce=ee,be=ne,Ne=ee.getTextContent(),Re=ee.getTextContentSize();for(;;){if(!Ee(ce)||be===Re){if(ce=ce.getNextSibling(),ce===null||n.$isLineBreakNode(ce))return null;Ee(ce)&&(be=0,Ne=ce.getTextContent(),Re=ce.getTextContentSize())}if(Ee(ce)){if(Ne[be]!==" ")return{node:ce,offset:be};be++}}}function Z(ee){const ne=Te(ee);if(n.$isLineBreakNode(ne))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return ne}function oe(ee,ne,ce){const be=ee.getParent();_(be)?J(be,ne,ce):Ee(ee)&&ee.replace(n.$createTextNode(ee.__text))}function j(ee,ne){const ce=ne.getElementByKey(ee.getKey());if(ce===null)return;const be=ee.getChildren(),Ne=be.length;if(Ne===ce.__cachedChildrenLength)return;ce.__cachedChildrenLength=Ne;let Re="1",ke=1;for(let Fe=0;Fe<Ne;Fe++)n.$isLineBreakNode(be[Fe])&&(Re+=`
|
|
91
|
+
`+ ++ke);ce.setAttribute("data-gutter",Re)}const K=new Set;function J(ee,ne,ce){const be=ee.getKey();K.has(be)||(K.add(be),ee.getLanguage()===void 0&&ee.setLanguage(ce.defaultLanguage),ne.update(()=>{U(be,()=>{const Ne=n.$getNodeByKey(be);if(!_(Ne)||!Ne.isAttached())return!1;const Re=Ne.getTextContent(),ke=ce.tokenize(Re,Ne.getLanguage()||ce.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:()=>{K.delete(be)},skipTransforms:!0}))}function R(ee,ne){const ce=[];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
|
-
`?
|
|
93
|
+
`?ce.push(n.$createLineBreakNode()):Fe===" "?ce.push(n.$createTabNode()):Fe.length>0&&ce.push(V(Fe,ne))}}else{const{content:Ne}=be;typeof Ne=="string"?ce.push(...R([Ne],be.type)):Array.isArray(Ne)&&ce.push(...R(Ne,be.type))}return ce}function U(ee,ne){const ce=n.$getNodeByKey(ee);if(!_(ce)||!ce.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(ce.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}ce.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 ce=0;for(;ce<ee.length&&fe(ee[ce],ne[ce]);)ce++;const be=ee.length,Ne=ne.length,Re=Math.min(be,Ne)-ce;let ke=0;for(;ke<Re;)if(ke++,!fe(ee[be-ke],ne[Ne-ke])){ke--;break}const Fe=ce,qe=be-ke,Be=ne.slice(ce,Ne-ke);return{from:Fe,nodesForReplacement:Be,to:qe}}function fe(ee,ne){return Ee(ee)&&Ee(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(),ce=ee.focus.getNode();if(ne.is(ce)&&_(ne))return!0;const be=ne.getParent();return _(be)&&be.is(ce.getParent())}function B(ee){const ne=ee.getNodes(),ce=[[]];if(ne.length===1&&_(ne[0]))return ce;let be=ce[0];for(let Ne=0;Ne<ne.length;Ne++){const Re=ne[Ne];if(!(Ee(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=[],ce.push(be)):be.push(Re)}return ce}function A(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return null;const ce=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 ce;const ke=ne.getNodes()[0];if(!(_(ke)||Ee(ke)||n.$isTabNode(ke)||n.$isLineBreakNode(ke)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(_(ke))return ce;const Fe=Se(ke),qe=Te(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()?ce:be}function F(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return!1;const ce=B(ne),be=ce.length;if(ce.length>1){for(let Fe=0;Fe<be;Fe++){const qe=ce[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)||Ee(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 ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.offset,ke=Ne.offset,Fe=be.getNode(),qe=Ne.getNode(),Be=ee===n.KEY_ARROW_UP_COMMAND;if(!_e(ce)||!(Ee(Fe)||n.$isTabNode(Fe))||!(Ee(qe)||n.$isTabNode(qe)))return!1;if(!ne.altKey){if(ce.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=Te(qe)):(ut=Se(qe),At=Te(Fe)),ut==null||At==null)return!1;const Ut=ut.getNodesBetween(At);for(let ve=0;ve<Ut.length;ve++){const Ie=Ut[ve];if(!Ee(Ie)&&!n.$isTabNode(Ie)&&!n.$isLineBreakNode(Ie))return!1}ne.preventDefault(),ne.stopPropagation();const tn=Be?ut.getPreviousSibling():At.getNextSibling();if(!n.$isLineBreakNode(tn))return!0;const Oe=Be?tn.getPreviousSibling():tn.getNextSibling();if(Oe==null)return!0;const ie=Ee(Oe)||n.$isTabNode(Oe)||n.$isLineBreakNode(Oe)?Be?Se(Oe):Te(Oe):null;let le=ie??Oe;return tn.remove(),Ut.forEach(ve=>ve.remove()),ee===n.KEY_ARROW_UP_COMMAND?(Ut.forEach(ve=>le.insertBefore(ve)),le.insertBefore(tn)):(le.insertAfter(tn),le=tn,Ut.forEach(ve=>{le.insertAfter(ve),le=ve})),ce.setTextNodeRange(Fe,Re,qe,ke),!0}function ye(ee,ne){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.getNode(),ke=Ne.getNode(),Fe=ee===n.MOVE_TO_START;if(!(Ee(Re)||n.$isTabNode(Re))||!(Ee(ke)||n.$isTabNode(ke)))return!1;if(Fe){const qe=z(ke,Ne.offset);if(qe!==null){const{node:Be,offset:ut}=qe;n.$isLineBreakNode(Be)?Be.selectNext(0,0):ce.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,q]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return ne==null&&(ne=de),t.mergeRegister(ee.registerMutationListener(f,ce=>{ee.update(()=>{for(const[be,Ne]of ce)if(Ne!=="destroyed"){const Re=n.$getNodeByKey(be);Re!==null&&j(Re,ee)}})}),ee.registerNodeTransform(f,ce=>J(ce,ee,ne)),ee.registerNodeTransform(n.TextNode,ce=>oe(ce,ee,ne)),ee.registerNodeTransform(q,ce=>oe(ce,ee,ne)),ee.registerCommand(n.KEY_TAB_COMMAND,ce=>{const be=A(ce.shiftKey);return be===null?!1:(ce.preventDefault(),ee.dispatchCommand(be,void 0),!0)},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ce=n.$getSelection();return _e(ce)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INDENT_CONTENT_COMMAND,ce=>F(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>F(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>se(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>se(n.KEY_ARROW_DOWN_COMMAND,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_END,ce=>ye(n.MOVE_TO_END,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_START,ce=>ye(n.MOVE_TO_START,ce),n.COMMAND_PRIORITY_LOW))}return Pn.$createCodeHighlightNode=V,Pn.$createCodeNode=p,Pn.$isCodeHighlightNode=Ee,Pn.$isCodeNode=_,Pn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=k,Pn.CODE_LANGUAGE_MAP=W,Pn.CodeHighlightNode=q,Pn.CodeNode=f,Pn.DEFAULT_CODE_LANGUAGE=P,Pn.PrismTokenizer=de,Pn.getCodeLanguages=ue,Pn.getDefaultCodeLanguage=te,Pn.getEndOfCodeInLine=Z,Pn.getFirstCodeNodeOfLine=Se,Pn.getLanguageFriendlyName=re,Pn.getLastCodeNodeOfLine=Te,Pn.getStartOfCodeInLine=z,Pn.normalizeCodeLang=Y,Pn.registerCodeHighlighting=De,Pn}var $n={},cg;function YC(){if(cg)return $n;cg=1;var e=Rp();bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp(),Hp(),Wp(),Kp(),zp(),Up(),Gp();var t=pn(),n=jt();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:E,priority:1}),pre:()=>({conversion:_,priority:0}),table:U=>m(U)?{conversion:T,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:
|
|
96
|
-
`||
|
|
97
|
-
`?X.push(n.$createLineBreakNode()):
|
|
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(k,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 D(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 UC=process.env.NODE_ENV==="development"?KC():zC();var Zu=UC,Sd=qn();function GC(){const[e]=Sd.useLexicalComposerContext();return rt.useEffect(()=>Zu.registerCodeHighlighting(e),[e]),null}var ag=pn(),Fn=jt();function YC({src:e,altText:t,width:n,height:r,maxWidth:l}){const d=rt.useMemo(()=>({height:r,width:n,maxWidth:l}),[r,n,l]);return nt.jsx("img",{src:e,alt:t,style:d})}function zp({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 jC(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 zp(n)}createDOM(n){const r=document.createElement("span"),l=n.theme.image;return l&&(r.className=l),r}updateDOM(){return!1}decorate(){return nt.jsx(YC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const VC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qC=e=>VC?(e||window).getSelection():null,Up=Fn.createCommand("INSERT_IMAGE_COMMAND");function ZC(){const[e]=Sd.useLexicalComposerContext();return rt.useEffect(()=>{if(!e.hasNodes([sl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ag.mergeRegister(e.registerCommand(Up,t=>{const n=zp(t);return Fn.$insertNodes([n]),Fn.$isRootOrShadowRoot(n.getParentOrThrow())&&ag.$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=>XC(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=wd();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 XC(e){return wd()?(Gp(e)||e.preventDefault(),!0):!1}function QC(e,t){const n=wd();if(!n)return!1;const r=eE(e);if(!r)return!1;if(e.preventDefault(),Gp(e)){const l=tE(e);n.remove();const d=Fn.$createRangeSelection();l!=null&&d.applyDOMRange(l),Fn.$setSelection(d),t.dispatchCommand(Up,r)}return!0}function wd(){const e=Fn.$getSelection();if(!Fn.$isNodeSelection(e))return null;const n=e.getNodes()[0];return jC(n)?n:null}function eE(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 Gp(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.yext-default-richtextv2-theme__image")&&t.parentElement)}function tE(e){let t;const n=e.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,l=qC(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 no=Td();function nE(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 rE=3;function iE(e){const t=Fn.$getSelection();if(!Fn.$isRangeSelection(t))return!1;const n=nE(t);let r=0;for(const l of n)if(no.$isListNode(l))r=Math.max(no.$getListDepth(l)+1,r);else if(no.$isListItemNode(l)){const d=l.getParent();if(!no.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(no.$getListDepth(d)+1,r)}return r<=e}function sE({maxDepth:e}){const[t]=Sd.useLexicalComposerContext();return rt.useEffect(()=>t.registerCommand(Fn.INDENT_CONTENT_COMMAND,()=>!iE(e||7),rE),[t,e]),null}var Mu=vd(),cg=xd(),ug=Ed(),Zl={},dg;function oE(){if(dg)return Zl;dg=1;var e=pn(),t=jt();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={},fg;function lE(){if(fg)return Jl;fg=1;var e=pn(),t=jt();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 aE=process.env.NODE_ENV==="development"?oE():lE();var cE=aE;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"},uE={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 zo={},Ru={},hg;function dE(){if(hg)return Ru;hg=1;var e=qn(),t=jt(),n=rt;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 E=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]),T=n.useCallback(()=>{f.update(()=>{const S=t.$getSelection();t.$isNodeSelection(S)&&S.clear()})},[f]);return[p,E,T]}return Ru.useLexicalNodeSelection=l,Ru}var bu={},gg;function fE(){if(gg)return bu;gg=1;var e=qn(),t=jt(),n=rt;function r(l,d){return l.getEditorState().read(()=>{let f=t.$getNodeByKey(d);return f===null?!1:f.isSelected()})}return bu.useLexicalNodeSelection=function(l){let[d]=e.useLexicalComposerContext(),[f,p]=n.useState(()=>r(d,l));n.useEffect(()=>{let T=!0,S=d.registerUpdateListener(()=>{T&&p(r(d,l))});return()=>{T=!1,S()}},[d,l]);let _=n.useCallback(T=>{d.update(()=>{let S=t.$getSelection();t.$isNodeSelection(S)||(S=t.$createNodeSelection(),t.$setSelection(S)),t.$isNodeSelection(S)&&(T?S.add(l):S.delete(l))})},[d,l]),E=n.useCallback(()=>{d.update(()=>{const T=t.$getSelection();t.$isNodeSelection(T)&&T.clear()})},[d]);return[f,_,E]},bu}var Lu,pg;function Yp(){return pg||(pg=1,Lu=process.env.NODE_ENV==="development"?dE():fE()),Lu}var mg;function hE(){if(mg)return zo;mg=1;var e=qn(),t=Yp(),n=pn(),r=jt(),l=rt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){const[w]=e.useLexicalComposerContext(),[O,m,v]=t.useLexicalNodeSelection(S),I=l.useCallback(G=>{if(O&&r.$isNodeSelection(r.$getSelection())){G.preventDefault();const k=r.$getNodeByKey(S);T(k)&&k.remove()}return!1},[O,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{const k=w.getElementByKey(S);return G.target===k?(G.shiftKey||v(),m(!O),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,I,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,I,r.COMMAND_PRIORITY_LOW)),[v,w,O,S,I,m]),l.useEffect(()=>{const G=w.getElementByKey(S);G!==null&&(G.className=O?"selected":"")},[w,O,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(w){return E()}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
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:E()}}function E(){return r.$applyNodeReplacement(new p)}function T(S){return S instanceof p}return zo.$createHorizontalRuleNode=E,zo.$isHorizontalRuleNode=T,zo.HorizontalRuleNode=p,zo.INSERT_HORIZONTAL_RULE_COMMAND=d,zo}var Uo={},
|
|
100
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:E()}}function E(){return r.$applyNodeReplacement(new p)}function T(S){return S instanceof p}return Uo.$createHorizontalRuleNode=E,Uo.$isHorizontalRuleNode=T,Uo.HorizontalRuleNode=p,Uo.INSERT_HORIZONTAL_RULE_COMMAND=d,Uo}const
|
|
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
|
|
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
|
|
103
|
-
`}]}function
|
|
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
|
|
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(Y(_e)){for(var F=0,se=_e.getTextContent(),ye=_e.getTextContentSize();F<ye&&se[F]===" ";F++);if(F!==0&&fe.push(W(" ".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 E(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 T(){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"},I={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function G(R){return I[R]||R}class P extends n.TextNode{constructor(U,X,fe){super(U,fe),this.__highlightType=X}static getType(){return"code-highlight"}static clone(U){return new P(U.__text,U.__highlightType||void 0,U.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(U){let X=super.createDOM(U);return U=k(U.theme,this.__highlightType),t.addClassNamesToElement(X,U),X}updateDOM(U,X,fe){let _e=super.updateDOM(U,X,fe);return U=k(fe.theme,U.__highlightType),fe=k(fe.theme,this.__highlightType),U!==fe&&(U&&t.removeClassNamesFromElement(X,U),fe&&t.addClassNamesToElement(X,fe)),_e}static importJSON(U){let X=W(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 k(R,U){return U&&R&&R.codeHighlight&&R.codeHighlight[U]}function W(R,U){return n.$applyNodeReplacement(new P(R,U))}function Y(R){return R instanceof P}function re(R){let U=R;for(;Y(R)||n.$isTabNode(R);)U=R,R=R.getPreviousSibling();return U}function te(R){let U=R;for(;Y(R)||n.$isTabNode(R);)U=R,R=R.getNextSibling();return U}let ue={defaultLanguage:"javascript",tokenize(R,U){return e.tokenize(R,e.languages[U||""]||e.languages[this.defaultLanguage])}};function q(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(!(Y(_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];Y(_e)&&F!==" "&&(fe={node:_e,offset:B})}if(fe!==null)return fe;if(fe=null,U<R.getTextContentSize()?Y(R)&&(fe=R.getTextContent()[U]):(_e=R.getNextSibling(),Y(_e)&&(fe=_e.getTextContent()[0])),fe!==null&&fe!==" ")return X;e:for(fe=R,_e=R.getTextContent(),R=R.getTextContentSize();;){if(!Y(fe)||U===R){if(fe=fe.getNextSibling(),fe===null||n.$isLineBreakNode(fe)){R=null;break e}Y(fe)&&(U=0,_e=fe.getTextContent(),R=fe.getTextContentSize())}if(Y(fe)){if(_e[U]!==" "){R={node:fe,offset:U};break e}U++}}return R!==null?R:X}function H(R){if(R=te(R),n.$isLineBreakNode(R))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return R}function V(R,U,X){let fe=R.getParent();p(fe)?Se(fe,U,X):Y(R)&&R.replace(n.$createTextNode(R.__text))}let Ee=new Set;function Se(R,U,X){let fe=R.getKey();Ee.has(fe)||(Ee.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=Te(B);var A=_e.getChildren();for(_e=0;_e<A.length&&z(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++,!z(A[F-De],B[se-De])){De--;break}A=_e,F-=De,B=B.slice(_e,se-De);let{from:ee,to:ne,nodesForReplacement:ce}={from:A,nodesForReplacement:B,to:F};return ee!==ne||ce.length?(R.splice(ee,ne-ee,ce),!0):!1})},{onUpdate:()=>{Ee.delete(fe)},skipTransforms:!0}))}function Te(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
|
+
`||A===`\r
|
|
97
|
+
`?X.push(n.$createLineBreakNode()):A===" "?X.push(n.$createTabNode()):0<A.length&&X.push(W(A,U))}}else({content:R}=fe),typeof R=="string"?X.push(...Te([R],fe.type)):Array.isArray(R)&&X.push(...Te(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 z(R,U){return Y(R)&&Y(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(!(Y(_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)||Y(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 j(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)||Y(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 K(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)||!Y(F)&&!n.$isTabNode(F)||!Y(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(!Y(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=Y(ee)||n.$isTabNode(ee)||n.$isLineBreakNode(ee)?ye?re(ee):te(ee):null;let ce=ye??ee;return U.remove(),ne.forEach(be=>be.remove()),R===n.KEY_ARROW_UP_COMMAND?(ne.forEach(be=>ce.insertBefore(be)),ce.insertBefore(U)):(ce.insertAfter(U),ce=U,ne.forEach(be=>{ce.insertAfter(be),ce=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,!Y(B)&&!n.$isTabNode(B)||!Y(A)&&!n.$isTabNode(A))return!1;if(R)if(B=q(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 H(A).select();return U.preventDefault(),U.stopPropagation(),!0}return $n.$createCodeHighlightNode=W,$n.$createCodeNode=f,$n.$isCodeHighlightNode=Y,$n.$isCodeNode=p,$n.CODE_LANGUAGE_FRIENDLY_NAME_MAP=v,$n.CODE_LANGUAGE_MAP=I,$n.CodeHighlightNode=P,$n.CodeNode=d,$n.DEFAULT_CODE_LANGUAGE="javascript",$n.PrismTokenizer=ue,$n.getCodeLanguages=()=>Object.keys(e.languages).filter(R=>typeof e.languages[R]!="function").sort(),$n.getDefaultCodeLanguage=()=>"javascript",$n.getEndOfCodeInLine=H,$n.getFirstCodeNodeOfLine=re,$n.getLanguageFriendlyName=function(R){return R=G(R),v[R]||R},$n.getLastCodeNodeOfLine=te,$n.getStartOfCodeInLine=q,$n.normalizeCodeLang=G,$n.registerCodeHighlighting=function(R,U){if(!R.hasNodes([d,P]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return U==null&&(U=ue),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=>V(X,R,U)),R.registerNodeTransform(P,X=>V(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,()=>j(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>j(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_UP_COMMAND,X=>K(n.KEY_ARROW_UP_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_DOWN_COMMAND,X=>K(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 jC=process.env.NODE_ENV==="development"?GC():YC();var Ju=jC,Od=qn();function VC(){const[e]=Od.useLexicalComposerContext();return rt.useEffect(()=>Ju.registerCodeHighlighting(e),[e]),null}var ug=pn(),Fn=jt();function qC({src:e,altText:t,width:n,height:r,maxWidth:l}){const d=rt.useMemo(()=>({height:r,width:n,maxWidth:l}),[r,n,l]);return nt.jsx("img",{src:e,alt:t,style:d})}function Yp({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);Le(this,"__src");Le(this,"__altText");Le(this,"__width");Le(this,"__height");Le(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 Yp(n)}createDOM(n){const r=document.createElement("span"),l=n.theme.image;return l&&(r.className=l),r}updateDOM(){return!1}decorate(){return nt.jsx(qC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const JC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",XC=e=>JC?(e||window).getSelection():null,jp=Fn.createCommand("INSERT_IMAGE_COMMAND");function QC(){const[e]=Od.useLexicalComposerContext();return rt.useEffect(()=>{if(!e.hasNodes([sl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ug.mergeRegister(e.registerCommand(jp,t=>{const n=Yp(t);return Fn.$insertNodes([n]),Fn.$isRootOrShadowRoot(n.getParentOrThrow())&&ug.$wrapNodeInElement(n,Fn.$createParagraphNode).selectEnd(),!0},Fn.COMMAND_PRIORITY_EDITOR),e.registerCommand(Fn.DRAGSTART_COMMAND,t=>eE(t),Fn.COMMAND_PRIORITY_HIGH),e.registerCommand(Fn.DRAGOVER_COMMAND,t=>tE(t),Fn.COMMAND_PRIORITY_LOW),e.registerCommand(Fn.DROP_COMMAND,t=>nE(t,e),Fn.COMMAND_PRIORITY_HIGH))},[e]),null}function eE(e){const t="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=t;const r=Dd();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 tE(e){return Dd()?(Vp(e)||e.preventDefault(),!0):!1}function nE(e,t){const n=Dd();if(!n)return!1;const r=rE(e);if(!r)return!1;if(e.preventDefault(),Vp(e)){const l=iE(e);n.remove();const d=Fn.$createRangeSelection();l!=null&&d.applyDOMRange(l),Fn.$setSelection(d),t.dispatchCommand(jp,r)}return!0}function Dd(){const e=Fn.$getSelection();if(!Fn.$isNodeSelection(e))return null;const n=e.getNodes()[0];return ZC(n)?n:null}function rE(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 Vp(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.yext-default-richtextv2-theme__image")&&t.parentElement)}function iE(e){let t;const n=e.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,l=XC(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=vd();function sE(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 oE=3;function lE(e){const t=Fn.$getSelection();if(!Fn.$isRangeSelection(t))return!1;const n=sE(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 aE({maxDepth:e}){const[t]=Od.useLexicalComposerContext();return rt.useEffect(()=>t.registerCommand(Fn.INDENT_CONTENT_COMMAND,()=>!lE(e||7),oE),[t,e]),null}var Ru=wd(),dg=Sd(),fg=xd(),Zl={},hg;function cE(){if(hg)return Zl;hg=1;var e=pn(),t=jt();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={},gg;function uE(){if(gg)return Jl;gg=1;var e=pn(),t=jt();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 dE=process.env.NODE_ENV==="development"?cE():uE();var fE=dE;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"},hE={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 zo={},bu={},pg;function gE(){if(pg)return bu;pg=1;var e=qn(),t=jt(),n=rt;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 E=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]),T=n.useCallback(()=>{f.update(()=>{const S=t.$getSelection();t.$isNodeSelection(S)&&S.clear()})},[f]);return[p,E,T]}return bu.useLexicalNodeSelection=l,bu}var Lu={},mg;function pE(){if(mg)return Lu;mg=1;var e=qn(),t=jt(),n=rt;function r(l,d){return l.getEditorState().read(()=>{let f=t.$getNodeByKey(d);return f===null?!1:f.isSelected()})}return Lu.useLexicalNodeSelection=function(l){let[d]=e.useLexicalComposerContext(),[f,p]=n.useState(()=>r(d,l));n.useEffect(()=>{let T=!0,S=d.registerUpdateListener(()=>{T&&p(r(d,l))});return()=>{T=!1,S()}},[d,l]);let _=n.useCallback(T=>{d.update(()=>{let S=t.$getSelection();t.$isNodeSelection(S)||(S=t.$createNodeSelection(),t.$setSelection(S)),t.$isNodeSelection(S)&&(T?S.add(l):S.delete(l))})},[d,l]),E=n.useCallback(()=>{d.update(()=>{const T=t.$getSelection();t.$isNodeSelection(T)&&T.clear()})},[d]);return[f,_,E]},Lu}var Iu,_g;function qp(){return _g||(_g=1,Iu=process.env.NODE_ENV==="development"?gE():pE()),Iu}var yg;function mE(){if(yg)return zo;yg=1;var e=qn(),t=qp(),n=pn(),r=jt(),l=rt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){const[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),I=l.useCallback(G=>{if(M&&r.$isNodeSelection(r.$getSelection())){G.preventDefault();const P=r.$getNodeByKey(S);T(P)&&P.remove()}return!1},[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{const P=w.getElementByKey(S);return G.target===P?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,I,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,I,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,I,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 E()}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
|
+
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:E()}}function E(){return r.$applyNodeReplacement(new p)}function T(S){return S instanceof p}return zo.$createHorizontalRuleNode=E,zo.$isHorizontalRuleNode=T,zo.HorizontalRuleNode=p,zo.INSERT_HORIZONTAL_RULE_COMMAND=d,zo}var Uo={},Ng;function _E(){if(Ng)return Uo;Ng=1;var e=qn(),t=qp(),n=pn(),r=jt(),l=rt;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){let[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),I=l.useCallback(G=>(M&&r.$isNodeSelection(r.$getSelection())&&(G.preventDefault(),G=r.$getNodeByKey(S),T(G)&&G.remove()),!1),[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{let P=w.getElementByKey(S);return G.target===P?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,I,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,I,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,I,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 E()}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:E()}}function E(){return r.$applyNodeReplacement(new p)}function T(S){return S instanceof p}return Uo.$createHorizontalRuleNode=E,Uo.$isHorizontalRuleNode=T,Uo.HorizontalRuleNode=p,Uo.INSERT_HORIZONTAL_RULE_COMMAND=d,Uo}const yE=process.env.NODE_ENV==="development"?mE():_E();var NE=yE;function CE(e,t){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:e,theme:t??hE,nodes:[fg.HeadingNode,fE.HashtagNode,sl,ro.ListNode,ro.ListItemNode,fg.QuoteNode,Ju.CodeNode,Ju.CodeHighlightNode,Ru.TableNode,Ru.TableCellNode,Ru.TableRowNode,dg.AutoLinkNode,dg.LinkNode,NE.HorizontalRuleNode]}}const ku={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function EE({serializedAST:e,nodeClassNames:t}){return nt.jsx(JN.LexicalComposer,{initialConfig:CE(e,t),children:nt.jsx("div",{className:`${ku["editor-inner"]} ${ku["no-border"]}`,children:nt.jsxs("div",{className:ku["editor-inner"],children:[nt.jsx(_C.RichTextPlugin,{contentEditable:nt.jsx(EC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:wC,placeholder:nt.jsx("div",{})}),nt.jsx(VC,{}),nt.jsx(bC.ListPlugin,{}),nt.jsx(FC.LinkPlugin,{}),nt.jsx(UC.TablePlugin,{}),nt.jsx(QC,{}),nt.jsx(aE,{maxDepth:7})]})})})}function Ec(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 Vo(e,t){return e.length>0?(Ec(e,e.length,0,t),e):t}const Cg={}.hasOwnProperty;function Zp(e){const t={};let n=-1;for(;++n<e.length;)TE(t,e[n]);return t}function TE(e,t){let n;for(n in t){const l=(Cg.call(e,n)?e[n]:void 0)||(e[n]={}),d=t[n];let f;for(f in d){Cg.call(l,f)||(l[f]=[]);const p=d[f];xE(l[f],Array.isArray(p)?p:p?[p]:[])}}}function xE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ec(e,0,0,r)}const es={plusSign:43,caret:94,tilde:126};var Eg=Object.prototype.hasOwnProperty;function Tg(e,t,n){for(n of e.keys())if(sa(n,t))return n}function sa(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--&&sa(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=Tg(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=Tg(t,l),!l)||!sa(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(Eg.call(e,n)&&++r&&!Eg.call(t,n)||!(n in t)||!sa(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}let Xu,Jp,Xp,Qp,em=!0;typeof process<"u"&&({FORCE_COLOR:Xu,NODE_DISABLE_COLORS:Jp,NO_COLOR:Xp,TERM:Qp}=process.env||{},em=process.stdout&&process.stdout.isTTY);const Qt={enabled:!Jp&&Xp==null&&Qp!=="dumb"&&(Xu!=null&&Xu!=="0"||em),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 xg(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 vE(e,t){let n={has:e,keys:t};return n.reset=Qt.reset.bind(n),n.bold=Qt.bold.bind(n),n.dim=Qt.dim.bind(n),n.italic=Qt.italic.bind(n),n.underline=Qt.underline.bind(n),n.inverse=Qt.inverse.bind(n),n.hidden=Qt.hidden.bind(n),n.strikethrough=Qt.strikethrough.bind(n),n.black=Qt.black.bind(n),n.red=Qt.red.bind(n),n.green=Qt.green.bind(n),n.yellow=Qt.yellow.bind(n),n.blue=Qt.blue.bind(n),n.magenta=Qt.magenta.bind(n),n.cyan=Qt.cyan.bind(n),n.white=Qt.white.bind(n),n.gray=Qt.gray.bind(n),n.grey=Qt.grey.bind(n),n.bgBlack=Qt.bgBlack.bind(n),n.bgRed=Qt.bgRed.bind(n),n.bgGreen=Qt.bgGreen.bind(n),n.bgYellow=Qt.bgYellow.bind(n),n.bgBlue=Qt.bgBlue.bind(n),n.bgMagenta=Qt.bgMagenta.bind(n),n.bgCyan=Qt.bgCyan.bind(n),n.bgWhite=Qt.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:Qt.enabled?xg(this.keys,r+""):r+""):r===void 0?vE([e],[n]):Qt.enabled?xg([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(W){return d?(setTimeout(function(){d(void 0,W)},0),!0):W}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var _=n.length,E=t.length,T=1,S=_+E;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>=E&&v+1>=_)return p([{value:this.join(n),count:n.length}]);var I=-1/0,G=1/0;function P(){for(var W=Math.max(I,-T);W<=Math.min(G,T);W+=2){var Y=void 0,re=m[W-1],te=m[W+1];re&&(m[W-1]=void 0);var ue=!1;if(te){var q=te.oldPos-W;ue=te&&0<=q&&q<_}var H=re&&re.oldPos+1<E;if(!ue&&!H){m[W]=void 0;continue}if(!H||ue&&re.oldPos+1<te.oldPos?Y=f.addToPath(te,!0,void 0,0):Y=f.addToPath(re,void 0,!0,1),v=f.extractCommon(Y,n,t,W),Y.oldPos+1>=E&&v+1>=_)return p(SE(f,Y.lastComponent,n,t,f.useLongestToken));m[W]=Y,Y.oldPos+1>=E&&(G=Math.min(G,W-1)),v+1>=_&&(I=Math.max(I,W+1))}T++}if(d)(function W(){setTimeout(function(){if(T>S||Date.now()>M)return d();P()||W()},0)})();else for(;T<=S&&Date.now()<=M;){var k=P();if(k)return k}},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,E=0;_+1<d&&p+1<f&&this.equals(n[_+1],r[p+1]);)_++,p++,E++;return E&&(t.lastComponent={count:E,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 SE(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,E=0,T=0;p<_;p++){var S=d[p];if(S.removed){if(S.value=e.join(r.slice(T,T+S.count)),T+=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(E,E+S.count);w=w.map(function(v,I){var G=r[T+I];return G.length>v.length?G:v}),S.value=e.join(w)}else S.value=e.join(n.slice(E,E+S.count));E+=S.count,S.added||(T+=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 vg=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Sg=/\S/,tm=new Ss;tm.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Sg.test(e)&&!Sg.test(t)};tm.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]&&vg.test(t[n])&&vg.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var nm=new Ss;nm.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
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 wE=new Ss;wE.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var OE=new Ss;OE.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function sc(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sc=function(t){return typeof t}:sc=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}var DE=Object.prototype.toString,la=new Ss;la.useLongestToken=!0;la.tokenize=nm.tokenize;la.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," ")};la.equals=function(e,t){return Ss.prototype.equals.call(la,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(DE.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()),sc(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 ed=new Ss;ed.tokenize=function(e){return e.slice()};ed.join=ed.removeEmpty=function(e){return e};Qt.red,Qt.grey,Qt.green;Qt.dim().italic;Qt.dim("→");Qt.dim("·");Qt.dim("↵");function fc(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 AE 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 AE({actual:t,expects:n,operator:r,message:p,details:_,generated:!f})}function Tc(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(!sa(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=fc(e),t=fc(t),ni(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};ts.fixture=function(e,t,n){e=fc(e),t=fc(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 ME=/[!-\/:-@\[-`\{-~\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]/,RE=ws(/[A-Za-z]/),td=ws(/[\dA-Za-z]/),bE=ws(/[#-'*+\--9=?A-Z^-~]/);function LE(e){return e!==null&&(e<32||e===127)}const IE=ws(/\d/),kE=ws(/[\dA-Fa-f]/),PE=ws(/[!-/:-@[-`{-~]/);function $E(e){return e!==null&&e<-2}function rm(e){return e!==null&&(e<0||e===32)}function FE(e){return e===-2||e===-1||e===32}const BE=ws(ME),HE=ws(/\s/);function ws(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function aa(e){if(e===null||rm(e)||HE(e))return 1;if(BE(e))return 2}const hc={characterGroupPunctuation:2};function WE(e,t){const n=this.previous,r=aa(n);return l;function l(f){return Tc(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"),_=aa(f);return p._open=!_||_===hc.characterGroupPunctuation&&!!r,p._close=!r||r===hc.characterGroupPunctuation&&!!_,t(f)}}function im(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 Ad(e,t){return!!(e[0]==="enter"&&e[1].type===`${t}SequenceTemporary`&&e[1]._close)}function Md(e,t){return!!(e[0]==="exit"&&e[1].type===`${t}SequenceTemporary`&&e[1]._open)}function Rd(e,t,n,r,l,d){const[f,p,_,E]=zE(e[t],e[n],l,d);e[t][1].end=Object.assign({},f.start),e[n][1].start=Object.assign({},p.end);let T=[];e[t][1].end.offset-e[t][1].start.offset&&(T=Vo(T,[["enter",e[t][1],r],["exit",e[t][1],r]])),T=Vo(T,[["enter",E,r],["enter",f,r],["exit",f,r],["enter",_,r]]),T=Vo(T,im(r.parser.constructs.insideSpan.null,e.slice(t+1,n),r)),T=Vo(T,[["exit",_,r],["enter",p,r],["exit",p,r],["exit",E,r]]);let S=0;return e[n][1].end.offset-e[n][1].start.offset&&(S=2,T=Vo(T,[["enter",e[n][1],r],["exit",e[n][1],r]])),Ec(e,t-1,n-t+3,T),t+T.length-S-2}function zE(e,t,n,r){const l=Object.assign({},e[1].end),d=Object.assign({},t[1].start);wg(l,-r),wg(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)},E={type:`${n}`,start:Object.assign({},f.start),end:Object.assign({},p.end)};return[f,p,_,E]}function wg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function bd(e,t){e.forEach(n=>{n[1].type===`${t}SequenceTemporary`&&(n[1].type=KE.data)})}function UE(e,t){let n=-1;for(;++n<e.length;)if(Ad(e[n],"tilde")){let r=n;for(;r--;)if(Md(e[r],"tilde")){const l=GE(e[r],e[n]);n=Rd(e,r,n,t,l===1?"subscript":"strikethrough",l);break}}return bd(e,"tilde"),e}function GE(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 YE(){const e={tokenize:WE,resolveAll:UE};return{text:{[es.tilde]:e},insideSpan:{null:[e]}}}function jE(e,t){let n=-1;for(;++n<e.length;)if(Ad(e[n],"superscript")){let r=n;for(;r--;)if(Md(e[r],"superscript")){n=Rd(e,r,n,t,"superscript",1);break}}return bd(e,"superscript"),e}function VE(e,t){return n;function n(l){return Tc(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 qE(){const e={tokenize:VE,resolveAll:jE};return{text:{[es.caret]:e},insideSpan:{null:[e]}}}function ZE(e,t,n){const r=this.previous,l=aa(r);let d=0;return f;function f(_){return Tc(_===es.plusSign,"expected `+`"),e.enter("underlineSequenceTemporary"),p(_)}function p(_){if(_===es.plusSign)return e.consume(_),d++,p;if(d<2)return n(_);const E=e.exit("underlineSequenceTemporary"),T=aa(_);return E._open=!T||T===hc.characterGroupPunctuation&&!!l,E._close=!l||l===hc.characterGroupPunctuation&&!!T,t(_)}}function JE(e,t){let n=-1;for(;++n<e.length;)if(Ad(e[n],"underline")&&e[n][1].end.offset-e[n][1].start.offset>1){let r=n;for(;r--;)if(Md(e[r],"underline")&&e[r][1].end.offset-e[r][1].start.offset>1){n=Rd(e,r,n,t,"underline",2);break}}return bd(e,"underline"),e}function XE(){const e={tokenize:ZE,resolveAll:JE};return{text:{[es.plusSign]:e},insideSpan:{null:[e]}}}function QE(){return Zp([XE(),qE(),YE()])}const eT={canContainEols:["strikethrough"],enter:{strikethrough:tT},exit:{strikethrough:nT}};function tT(e){this.enter({type:"strikethrough",children:[]},e)}function nT(e){this.exit(e)}const rT={canContainEols:["subscript"],enter:{subscript:iT},exit:{subscript:sT}};function iT(e){this.enter({type:"subscript",children:[]},e)}function sT(e){this.exit(e)}const oT={canContainEols:["superscript"],enter:{superscript:lT},exit:{superscript:aT}};function lT(e){this.enter({type:"superscript",children:[]},e)}function aT(e){this.exit(e)}const cT={canContainEols:["underline"],enter:{underline:uT},exit:{underline:dT}};function uT(e){this.enter({type:"underline",children:[]},e)}function dT(e){this.exit(e)}function fT(){return[cT,eT,rT,oT]}function hT(){const e=this.data();t("micromarkExtensions",QE()),t("fromMarkdownExtensions",fT());function t(n,r){const l=e[n];l?(Tc(Array.isArray(l)),l.push(r)):e[n]=[r]}}function gT(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 pT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
103
|
+
`}]}function mT(e,t){const n=t.value?t.value+`
|
|
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 _T(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yT(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&&td(e.charCodeAt(n+1))&&td(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 sm(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 NT(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},sm(e,{type:"footnoteReference",identifier:l,position:t.position})}function CT(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 ET(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function om(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 TT(e,t){const n=e.definition(t.identifier);if(!n)return om(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 xT(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 vT(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 ST(e,t){const n=e.definition(t.identifier);if(!n)return om(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 wT(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 OT(e,t,n){const r=e.all(t),l=n?DT(n):lm(t),d={},f=[];if(typeof t.checked=="boolean"){const T=r[0];let S;T&&T.type==="element"&&T.tagName==="p"?S=T:(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 T=r[p];(l||p!==0||T.type!=="element"||T.tagName!=="p")&&f.push({type:"text",value:`
|
|
105
105
|
`}),T.type==="element"&&T.tagName==="p"&&!l?f.push(...T.children):f.push(T)}const _=r[r.length-1];_&&(l||_.type!=="element"||_.tagName!=="p")&&f.push({type:"text",value:`
|
|
106
|
-
`});const E={type:"element",tagName:"li",properties:d,children:f};return e.patch(t,E),e.applyData(t,E)}function
|
|
106
|
+
`});const E={type:"element",tagName:"li",properties:d,children:f};return e.patch(t,E),e.applyData(t,E)}function DT(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=lm(n[r])}return t}function lm(e){const t=e.spread;return t??e.children.length>1}function AT(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 MT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function bT(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ld=am("start"),Id=am("end");function LT(e){return{start:Ld(e),end:Id(e)}}function am(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 IT(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=Ld(t.children[1]),_=Id(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 kT(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 E=[];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)),E.push(m)}const T={type:"element",tagName:"tr",properties:{},children:e.wrap(E,!0)};return e.patch(t,T),e.applyData(t,T)}function PT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Og=9,Dg=32;function $T(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),l=0;const d=[];for(;r;)d.push(Ag(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return d.push(Ag(t.slice(l),l>0,!1)),d.join("")}function Ag(e,t,n){let r=0,l=e.length;if(t){let d=e.codePointAt(r);for(;d===Og||d===Dg;)r++,d=e.codePointAt(r)}if(n){let d=e.codePointAt(l-1);for(;d===Og||d===Dg;)l--,d=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}function FT(e,t){const n={type:"text",value:$T(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 HT={blockquote:gT,break:pT,code:mT,delete:_T,emphasis:yT,footnoteReference:sm,footnote:NT,heading:CT,html:ET,imageReference:TT,image:xT,inlineCode:vT,linkReference:ST,link:wT,listItem:OT,list:AT,paragraph:MT,root:RT,strong:bT,table:IT,tableCell:PT,tableRow:kT,text:FT,thematicBreak:BT,toml:Xa,yaml:Xa,definition:Xa,footnoteDefinition:Xa};function Xa(){return null}const cm=function(e){if(e==null)return UT;if(typeof e=="string")return zT(e);if(typeof e=="object")return Array.isArray(e)?WT(e):KT(e);if(typeof e=="function")return xc(e);throw new Error("Expected function, string, or object as test")};function WT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=cm(e[n]);return xc(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 xc(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function zT(e){return xc(t);function t(n){return n&&n.type===e}}function xc(e){return t;function t(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&e.call(this,n,...r))}}function UT(){return!0}const GT=!0,Mg=!1,YT="skip",jT=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const l=cm(t),d=r?-1:1;f(e,void 0,[])();function f(p,_,E){const T=p&&typeof p=="object"?p:{};if(typeof T.type=="string"){const w=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.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,_,E[E.length-1]||null))&&(w=VT(n(p,E)),w[0]===Mg))return w;if(p.children&&w[0]!==YT)for(m=(r?p.children.length:-1)+d,v=E.concat(p);m>-1&&m<p.children.length;){if(M=f(p.children[m],m,v)(),M[0]===Mg)return M;m=typeof M[1]=="number"?M[1]:m+d}return w}}};function VT(e){return Array.isArray(e)?e:typeof e=="number"?[GT,e]:[e]}const kd=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),jT(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 qT(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 Rg={}.hasOwnProperty;function ZT(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return kd(e,"definition",r=>{const l=bg(r.identifier);l&&!Rg.call(t,l)&&(t[l]=r)}),n;function n(r){const l=bg(r);return l&&Rg.call(t,l)?t[l]:null}}function bg(e){return String(e||"").toUpperCase()}const gc={}.hasOwnProperty;function JT(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={...HT,...n.handlers},f.definition=ZT(e),f.footnoteById=l,f.footnoteOrder=[],f.footnoteCounts={},f.patch=XT,f.applyData=QT,f.one=p,f.all=_,f.wrap=tx,f.augment=d,kd(e,"footnoteDefinition",E=>{const T=String(E.identifier).toUpperCase();gc.call(l,T)||(l[T]=E)}),f;function d(E,T){if(E&&"data"in E&&E.data){const S=E.data;S.hName&&(T.type!=="element"&&(T={type:"element",tagName:"",properties:{},children:[]}),T.tagName=S.hName),T.type==="element"&&S.hProperties&&(T.properties={...T.properties,...S.hProperties}),"children"in T&&T.children&&S.hChildren&&(T.children=S.hChildren)}if(E){const S="type"in E?E:{position:E};qT(S)||(T.position={start:Ld(S),end:Id(S)})}return T}function f(E,T,S,w){return Array.isArray(S)&&(w=S,S={}),d(E,{type:"element",tagName:T,properties:S||{},children:w||[]})}function p(E,T){return um(f,E,T)}function _(E){return rs(f,E)}}function XT(e,t){e.position&&(t.position=LT(e))}function QT(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 um(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return gc.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):ex(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=um(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 ex(e,t){const n=t.data||{},r="value"in t&&!(gc.call(n,"hProperties")||gc.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 tx(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",ns(e,t)),ex=(e,t)=>e(t,"b",ns(e,t)),tx=(e,t)=>e(t,"u",ns(e,t)),nx=(e,t)=>e(t,"s",ns(e,t)),rx=(e,t)=>e(t,"sub",ns(e,t)),ix=(e,t)=>e(t,"sup",ns(e,t)),sx={emphasis:QT,strong:ex,underline:tx,strikethrough:nx,subscript:rx,superscript:ix},ox=e=>{const[t,n]=rt.useState();let r;return rt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-C7vTnykM.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[uT],remarkRehypeOptions:{handlers:sx}});n(d)})()},[e.markdown]),t||null};class uo extends Error{}class lx extends uo{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class ax extends uo{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class cx extends uo{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Zo extends uo{}class am extends uo{constructor(t){super(`Invalid unit ${t}`)}}class mr extends uo{}class _s extends uo{constructor(){super("Zone is an abstract class")}}const at="numeric",mi="short",Yr="long",gc={year:at,month:at,day:at},cm={year:at,month:mi,day:at},ux={year:at,month:mi,day:at,weekday:mi},um={year:at,month:Yr,day:at},dm={year:at,month:Yr,day:at,weekday:Yr},fm={hour:at,minute:at},hm={hour:at,minute:at,second:at},gm={hour:at,minute:at,second:at,timeZoneName:mi},pm={hour:at,minute:at,second:at,timeZoneName:Yr},mm={hour:at,minute:at,hourCycle:"h23"},_m={hour:at,minute:at,second:at,hourCycle:"h23"},ym={hour:at,minute:at,second:at,hourCycle:"h23",timeZoneName:mi},Nm={hour:at,minute:at,second:at,hourCycle:"h23",timeZoneName:Yr},Cm={year:at,month:at,day:at,hour:at,minute:at},Em={year:at,month:at,day:at,hour:at,minute:at,second:at},Tm={year:at,month:mi,day:at,hour:at,minute:at},xm={year:at,month:mi,day:at,hour:at,minute:at,second:at},dx={year:at,month:mi,day:at,weekday:mi,hour:at,minute:at},vm={year:at,month:Yr,day:at,hour:at,minute:at,timeZoneName:mi},Sm={year:at,month:Yr,day:at,hour:at,minute:at,second:at,timeZoneName:mi},wm={year:at,month:Yr,day:at,weekday:Yr,hour:at,minute:at,timeZoneName:Yr},Om={year:at,month:Yr,day:at,weekday:Yr,hour:at,minute:at,second:at,timeZoneName:Yr};class ua{get type(){throw new _s}get name(){throw new _s}get ianaName(){return this.name}get isUniversal(){throw new _s}offsetName(t,n){throw new _s}formatOffset(t,n){throw new _s}offset(t){throw new _s}equals(t){throw new _s}get isValid(){throw new _s}}let ku=null;class xc extends ua{static get instance(){return ku===null&&(ku=new xc),ku}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Pm(t,n,r)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let oc={};function fx(e){return oc[e]||(oc[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"})),oc[e]}const hx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function gx(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,_,E,T]=r;return[f,l,d,p,_,E,T]}function px(e,t){const n=e.formatToParts(t),r=[];for(let l=0;l<n.length;l++){const{type:d,value:f}=n[l],p=hx[d];d==="era"?r[p]=f:Lt(p)||(r[p]=parseInt(f,10))}return r}let Qa={};class ts extends ua{static create(t){return Qa[t]||(Qa[t]=new ts(t)),Qa[t]}static resetCache(){Qa={},oc={}}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=ts.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Pm(t,n,r,this.name)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=fx(this.name);let[l,d,f,p,_,E,T]=r.formatToParts?px(r,n):gx(r,n);p==="BC"&&(l=-Math.abs(l)+1);const w=Sc({year:l,month:d,day:f,hour:_===24?0:_,minute:E,second:T,millisecond:0});let O=+n;const m=O%1e3;return O-=m>=0?m:1e3+m,(w-O)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Rg={};function mx(e,t={}){const n=JSON.stringify([e,t]);let r=Rg[n];return r||(r=new Intl.ListFormat(e,t),Rg[n]=r),r}let td={};function nd(e,t={}){const n=JSON.stringify([e,t]);let r=td[n];return r||(r=new Intl.DateTimeFormat(e,t),td[n]=r),r}let rd={};function _x(e,t={}){const n=JSON.stringify([e,t]);let r=rd[n];return r||(r=new Intl.NumberFormat(e,t),rd[n]=r),r}let id={};function yx(e,t={}){const{base:n,...r}=t,l=JSON.stringify([e,r]);let d=id[l];return d||(d=new Intl.RelativeTimeFormat(e,t),id[l]=d),d}let ta=null;function Nx(){return ta||(ta=new Intl.DateTimeFormat().resolvedOptions().locale,ta)}let bg={};function Cx(e){let t=bg[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,bg[e]=t}return t}function Ex(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=nd(e).resolvedOptions(),l=e}catch{const _=e.substring(0,n);r=nd(_).resolvedOptions(),l=_}const{numberingSystem:d,calendar:f}=r;return[l,d,f]}}function Tx(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function xx(e){const t=[];for(let n=1;n<=12;n++){const r=vt.utc(2009,n,1);t.push(e(r))}return t}function vx(e){const t=[];for(let n=1;n<=7;n++){const r=vt.utc(2016,11,13+n);t.push(e(r))}return t}function ec(e,t,n,r){const l=e.listingMode();return l==="error"?null:l==="en"?n(t):r(t)}function Sx(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 wx{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=_x(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):Fd(t,3);return Kn(n,this.padTo)}}}class Ox{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&&ts.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=nd(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 Dx{constructor(t,n,r){this.opts={style:"long",...r},!n&&Im()&&(this.rtf=yx(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 Ax={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":Nx()),_=n||Rn.defaultNumberingSystem,E=r||Rn.defaultOutputCalendar,T=sd(l)||Rn.defaultWeekSettings;return new un(p,_,E,T,f)}static resetCache(){ta=null,td={},rd={},id={}}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,_]=Ex(t);this.locale=f,this.numberingSystem=n||p||null,this.outputCalendar=r||_||null,this.weekSettings=l,this.intl=Tx(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=Sx(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,sd(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 ec(this,t,Bm,()=>{const r=n?{month:t,day:"numeric"}:{month:t},l=n?"format":"standalone";return this.monthsCache[l][t]||(this.monthsCache[l][t]=xx(d=>this.extract(d,r,"month"))),this.monthsCache[l][t]})}weekdays(t,n=!1){return ec(this,t,Km,()=>{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]=vx(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[l][t]})}meridiems(){return ec(this,void 0,()=>zm,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[vt.utc(2016,11,13,9),vt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return ec(this,t,Um,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[vt.utc(-40,1,1),vt.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 wx(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Ox(t,this.intl,n)}relFormatter(t={}){return new Dx(this.intl,this.isEnglish(),t)}listFormatter(t={}){return mx(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:km()?Cx(this.locale):Ax}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 Pu=null;class vr extends ua{static get utcInstance(){return Pu===null&&(Pu=new vr(0)),Pu}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(wc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${oa(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${oa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return oa(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 Mx extends ua{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 Cs(e,t){if(Lt(e)||e===null)return t;if(e instanceof ua)return e;if(Px(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?xc.instance:n==="utc"||n==="gmt"?vr.utcInstance:vr.parseSpecifier(n)||ts.create(e)}else return Ts(e)?vr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Mx(e)}const Id={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Lg={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]},Rx=Id.hanidec.replace(/[\[|\]]/g,"").split("");function bx(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(Id.hanidec)!==-1)t+=Rx.indexOf(e[n]);else for(const l in Lg){const[d,f]=Lg[l];r>=d&&r<=f&&(t+=r-d)}}return parseInt(t,10)}else return t}let qo={};function Lx(){qo={}}function hi({numberingSystem:e},t=""){const n=e||"latn";return qo[n]||(qo[n]={}),qo[n][t]||(qo[n][t]=new RegExp(`${Id[n]}${t}`)),qo[n][t]}let Ig=()=>Date.now(),kg="system",Pg=null,$g=null,Fg=null,Bg=60,Hg,Wg=null;class Rn{static get now(){return Ig}static set now(t){Ig=t}static set defaultZone(t){kg=t}static get defaultZone(){return Cs(kg,xc.instance)}static get defaultLocale(){return Pg}static set defaultLocale(t){Pg=t}static get defaultNumberingSystem(){return $g}static set defaultNumberingSystem(t){$g=t}static get defaultOutputCalendar(){return Fg}static set defaultOutputCalendar(t){Fg=t}static get defaultWeekSettings(){return Wg}static set defaultWeekSettings(t){Wg=sd(t)}static get twoDigitCutoffYear(){return Bg}static set twoDigitCutoffYear(t){Bg=t%100}static get throwOnInvalid(){return Hg}static set throwOnInvalid(t){Hg=t}static resetCaches(){un.resetCache(),ts.resetCache(),vt.resetCache(),Lx()}}class pi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Dm=[0,31,59,90,120,151,181,212,243,273,304,334],Am=[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 kd(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 Mm(e,t,n){return n+(da(e)?Am:Dm)[t-1]}function Rm(e,t){const n=da(e)?Am:Dm,r=n.findIndex(d=>d<t),l=t-n[r];return{month:r+1,day:l}}function Pd(e,t){return(e-t+7)%7+1}function pc(e,t=4,n=1){const{year:r,month:l,day:d}=e,f=Mm(r,l,d),p=Pd(kd(r,l,d),n);let _=Math.floor((f-p+14-t)/7),E;return _<1?(E=r-1,_=ca(E,t,n)):_>ca(r,t,n)?(E=r+1,_=1):E=r,{weekYear:E,weekNumber:_,weekday:p,...Oc(e)}}function Kg(e,t=4,n=1){const{weekYear:r,weekNumber:l,weekday:d}=e,f=Pd(kd(r,1,t),n),p=Jo(r);let _=l*7+d-f-7+t,E;_<1?(E=r-1,_+=Jo(E)):_>p?(E=r+1,_-=Jo(r)):E=r;const{month:T,day:S}=Rm(E,_);return{year:E,month:T,day:S,...Oc(e)}}function $u(e){const{year:t,month:n,day:r}=e,l=Mm(t,n,r);return{year:t,ordinal:l,...Oc(e)}}function zg(e){const{year:t,ordinal:n}=e,{month:r,day:l}=Rm(t,n);return{year:t,month:r,day:l,...Oc(e)}}function Ug(e,t){if(!Lt(e.localWeekday)||!Lt(e.localWeekNumber)||!Lt(e.localWeekYear)){if(!Lt(e.weekday)||!Lt(e.weekNumber)||!Lt(e.weekYear))throw new Zo("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 Ix(e,t=4,n=1){const r=vc(e.weekYear),l=ti(e.weekNumber,1,ca(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 kx(e){const t=vc(e.year),n=ti(e.ordinal,1,Jo(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function bm(e){const t=vc(e.year),n=ti(e.month,1,12),r=ti(e.day,1,mc(e.year,e.month));return t?n?r?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Lm(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 Ts(e){return typeof e=="number"}function vc(e){return typeof e=="number"&&e%1===0}function Px(e){return typeof e=="string"}function $x(e){return Object.prototype.toString.call(e)==="[object Date]"}function Im(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function km(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Fx(e){return Array.isArray(e)?e:[e]}function Gg(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 Bx(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function el(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sd(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 vc(e)&&e>=t&&e<=n}function Hx(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 Ns(e){if(!(Lt(e)||e===null||e===""))return parseInt(e,10)}function Xs(e){if(!(Lt(e)||e===null||e===""))return parseFloat(e)}function $d(e){if(!(Lt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Fd(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function da(e){return e%4===0&&(e%100!==0||e%400===0)}function Jo(e){return da(e)?366:365}function mc(e,t){const n=Hx(t-1,12)+1,r=e+(t-n)/12;return n===2?da(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Sc(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 Yg(e,t,n){return-Pd(kd(e,1,t),n)+t-1}function ca(e,t=4,n=1){const r=Yg(e,t,n),l=Yg(e+1,t,n);return(Jo(e)-r+l)/7}function od(e){return e>99?e:e>Rn.twoDigitCutoffYear?1900+e:2e3+e}function Pm(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 wc(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 $m(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new mr(`Invalid unit value ${e}`);return t}function _c(e,t){const n={};for(const r in e)if(el(e,r)){const l=e[r];if(l==null)continue;n[t(r)]=$m(l)}return n}function oa(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 Oc(e){return Bx(e,["hour","minute","second","millisecond"])}const Wx=["January","February","March","April","May","June","July","August","September","October","November","December"],Fm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Kx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Bm(e){switch(e){case"narrow":return[...Kx];case"short":return[...Fm];case"long":return[...Wx];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 Hm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Wm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],zx=["M","T","W","T","F","S","S"];function Km(e){switch(e){case"narrow":return[...zx];case"short":return[...Wm];case"long":return[...Hm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const zm=["AM","PM"],Ux=["Before Christ","Anno Domini"],Gx=["BC","AD"],Yx=["B","A"];function Um(e){switch(e){case"narrow":return[...Yx];case"short":return[...Gx];case"long":return[...Ux];default:return null}}function jx(e){return zm[e.hour<12?0:1]}function Vx(e,t){return Km(t)[e.weekday-1]}function qx(e,t){return Bm(t)[e.month-1]}function Zx(e,t){return Um(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,E=l[e],T=r?_?E[1]:E[2]||E[1]:_?l[e][0]:e;return f?`${p} ${T} ago`:`in ${p} ${T}`}function jg(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Xx={D:gc,DD:cm,DDD:um,DDDD:dm,t:fm,tt:hm,ttt:gm,tttt:pm,T:mm,TT:_m,TTT:ym,TTTT:Nm,f:Cm,ff:Tm,fff:vm,ffff:wm,F:Em,FF:xm,FFF:Sm,FFFF:Om};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 Xx[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=(O,m)=>this.loc.extract(t,O,m),f=O=>t.isOffsetFixed&&t.offset===0&&O.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,O.format):"",p=()=>r?jx(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),_=(O,m)=>r?qx(t,O):d(m?{month:O}:{month:O,day:"numeric"},"month"),E=(O,m)=>r?Vx(t,O):d(m?{weekday:O}:{weekday:O,month:"long",day:"numeric"},"weekday"),T=O=>{const m=_r.macroTokenToFormatOpts(O);return m?this.formatWithSystemDefault(t,m):O},S=O=>r?Zx(t,O):d({era:O},"era"),w=O=>{switch(O){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 E("short",!0);case"cccc":return E("long",!0);case"ccccc":return E("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return E("short",!1);case"EEEE":return E("long",!1);case"EEEEE":return E("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 T(O)}};return jg(_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=_=>E=>{const T=r(E);return T?this.num(_.get(T),E.length):E},d=_r.parseFormat(n),f=d.reduce((_,{literal:E,val:T})=>E?_:_.concat(T),[]),p=t.shiftTo(...f.map(r).filter(_=>_));return jg(d,l(p))}}const Gm=/[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 Ym(...e){return(t,n)=>{const r={};let l;for(l=0;l<e.length;l++)r[e[l]]=Ns(t[n+l]);return[r,null,n+l]}}const jm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Qx=`(?:${jm.source}?(?:\\[(${Gm.source})\\])?)?`,Bd=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Vm=RegExp(`${Bd.source}${Qx}`),Hd=RegExp(`(?:T${Vm.source})?`),ev=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,tv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,nv=/(\d{4})-?(\d{3})/,rv=Ym("weekYear","weekNumber","weekDay"),iv=Ym("year","ordinal"),sv=/(\d{4})-(\d\d)-(\d\d)/,qm=RegExp(`${Bd.source} ?(?:${jm.source}|(${Gm.source}))?`),ov=RegExp(`(?: ${qm.source})?`);function Xo(e,t,n){const r=e[t];return Lt(r)?n:Ns(r)}function lv(e,t){return[{year:Xo(e,t),month:Xo(e,t+1,1),day:Xo(e,t+2,1)},null,t+3]}function ul(e,t){return[{hours:Xo(e,t,0),minutes:Xo(e,t+1,0),seconds:Xo(e,t+2,0),milliseconds:$d(e[t+3])},null,t+4]}function fa(e,t){const n=!e[t]&&!e[t+1],r=wc(e[t+1],e[t+2]),l=n?null:vr.instance(r);return[{},l,t+3]}function ha(e,t){const n=e[t]?ts.create(e[t]):null;return[{},n,t+1]}const av=RegExp(`^T?${Bd.source}$`),cv=/^-?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 uv(e){const[t,n,r,l,d,f,p,_,E]=e,T=t[0]==="-",S=_&&_[0]==="-",w=(O,m=!1)=>O!==void 0&&(m||O&&T)?-O:O;return[{years:w(Xs(n)),months:w(Xs(r)),weeks:w(Xs(l)),days:w(Xs(d)),hours:w(Xs(f)),minutes:w(Xs(p)),seconds:w(Xs(_),_==="-0"),milliseconds:w($d(E),S)}]}const dv={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 Wd(e,t,n,r,l,d,f){const p={year:t.length===2?od(Ns(t)):Ns(t),month:Fm.indexOf(n)+1,day:Ns(r),hour:Ns(l),minute:Ns(d)};return f&&(p.second=Ns(f)),e&&(p.weekday=e.length>3?Hm.indexOf(e)+1:Wm.indexOf(e)+1),p}const fv=/^(?:(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 hv(e){const[,t,n,r,l,d,f,p,_,E,T,S]=e,w=Wd(t,l,r,n,d,f,p);let O;return _?O=dv[_]:E?O=0:O=wc(T,S),[w,new vr(O)]}function gv(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const pv=/^(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$/,mv=/^(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$/,_v=/^(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 Vg(e){const[,t,n,r,l,d,f,p]=e;return[Wd(t,l,r,n,d,f,p),vr.utcInstance]}function yv(e){const[,t,n,r,l,d,f,p]=e;return[Wd(t,p,n,r,l,d,f),vr.utcInstance]}const Nv=ll(ev,Hd),Cv=ll(tv,Hd),Ev=ll(nv,Hd),Tv=ll(Vm),Zm=al(lv,ul,fa,ha),xv=al(rv,ul,fa,ha),vv=al(iv,ul,fa,ha),Sv=al(ul,fa,ha);function wv(e){return cl(e,[Nv,Zm],[Cv,xv],[Ev,vv],[Tv,Sv])}function Ov(e){return cl(gv(e),[fv,hv])}function Dv(e){return cl(e,[pv,Vg],[mv,Vg],[_v,yv])}function Av(e){return cl(e,[cv,uv])}const Mv=al(ul);function Rv(e){return cl(e,[av,Mv])}const bv=ll(sv,ov),Lv=ll(qm),Iv=al(ul,fa,ha);function kv(e){return cl(e,[bv,Zm],[Lv,Iv])}const qg="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}},Pv={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,Go=146097/4800,$v={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:Go/7,days:Go,hours:Go*24,minutes:Go*24*60,seconds:Go*24*60*60,milliseconds:Go*24*60*60*1e3},...Jm},io=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Fv=io.slice(0).reverse();function ys(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 en(r)}function Xm(e,t){let n=t.milliseconds??0;for(const r of Fv.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Zg(e,t){const n=Xm(e,t)<0?-1:1;io.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),io.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 Bv(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class en{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?$v:Pv;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 en.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 en({values:_c(t,en.normalizeUnit),loc:un.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Ts(t))return en.fromMillis(t);if(en.isDuration(t))return t;if(typeof t=="object")return en.fromObject(t);throw new mr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Av(t);return r?en.fromObject(r,n):en.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Rv(t);return r?en.fromObject(r,n):en.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 cx(r);return new en({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 am(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):qg}toHuman(t={}){if(!this.isValid)return qg;const n=io.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+=Fd(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},vt.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?Xm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t),r={};for(const l of io)(el(n.values,l)||el(this.values,l))&&(r[l]=n.get(l)+this.get(l));return ys(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=en.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]=$m(t(this.values[r],r));return ys(this,{values:n},!0)}get(t){return this[en.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,..._c(t,en.normalizeUnit)};return ys(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 ys(this,f)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Zg(this.matrix,t),ys(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Bv(this.normalize().shiftToAll().toObject());return ys(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(f=>en.normalizeUnit(f));const n={},r={},l=this.toObject();let d;for(const f of io)if(t.indexOf(f)>=0){d=f;let p=0;for(const E in r)p+=this.matrix[E][f]*r[E],r[E]=0;Ts(l[f])&&(p+=l[f]);const _=Math.trunc(p);n[f]=_,r[f]=(p*1e3-_*1e3)/1e3}else Ts(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 Zg(this.matrix,n),ys(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 ys(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 io)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Yo="Invalid Interval";function Hv(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 ax(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Xl(t),l=Xl(n),d=Hv(r,l);return d??new Mn({start:r,end:l})}static after(t,n){const r=en.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l,l.plus(r))}static before(t,n){const r=en.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=vt.fromISO(r,n),f=d.isValid}catch{f=!1}let p,_;try{p=vt.fromISO(l,n),_=p.isValid}catch{_=!1}if(f&&_)return Mn.fromDateTimes(d,p);if(f){const E=en.fromISO(l,n);if(E.isValid)return Mn.after(d,E)}else if(_){const E=en.fromISO(r,n);if(E.isValid)return Mn.before(p,E)}}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=en.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((_,E)=>_.time-E.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()})`:Yo}[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=gc,n={}){return this.isValid?_r.create(this.s.loc.clone(n),t).formatInterval(this):Yo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Yo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Yo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Yo}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Yo}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):en.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class tc{static hasDST(t=Rn.defaultZone){const n=vt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return ts.isValidZone(t)}static normalizeZone(t){return Cs(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:Im(),localeWeek:km()}}}function Jg(e,t){const n=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(en.fromMillis(r).as("days"))}function Wv(e,t,n){const r=[["years",(_,E)=>E.year-_.year],["quarters",(_,E)=>E.quarter-_.quarter+(E.year-_.year)*4],["months",(_,E)=>E.month-_.month+(E.year-_.year)*12],["weeks",(_,E)=>{const T=Jg(_,E);return(T-T%7)/7}],["days",Jg]],l={},d=e;let f,p;for(const[_,E]of r)n.indexOf(_)>=0&&(f=_,l[_]=E(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 Kv(e,t,n,r){let[l,d,f,p]=Wv(e,t,n);const _=t-l,E=n.filter(S=>["hours","minutes","seconds","milliseconds"].indexOf(S)>=0);E.length===0&&(f<t&&(f=l.plus({[p]:1})),f!==l&&(d[p]=(d[p]||0)+_/(f-l)));const T=en.fromObject(d,r);return E.length>0?en.fromMillis(_,r).shiftTo(...E).plus(T):T}const zv="missing Intl.DateTimeFormat.formatToParts support";function ln(e,t=n=>n){return{regex:e,deser:([n])=>t(bx(n))}}const Uv=" ",Qm=`[ ${Uv}]`,e_=new RegExp(Qm,"g");function Gv(e){return e.replace(/\./g,"\\.?").replace(e_,Qm)}function Xg(e){return e.replace(/\./g,"").replace(e_," ").toLowerCase()}function gi(e,t){return e===null?null:{regex:RegExp(e.map(Gv).join("|")),deser:([n])=>e.findIndex(r=>Xg(n)===Xg(r))+t}}function Qg(e,t){return{regex:e,deser:([,n,r])=>wc(n,r),groups:t}}function nc(e){return{regex:e,deser:([t])=>t}}function Yv(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function jv(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}"),E=hi(t,"{1,6}"),T=hi(t,"{1,9}"),S=hi(t,"{2,4}"),w=hi(t,"{4,6}"),O=I=>({regex:RegExp(Yv(I.val)),deser:([G])=>G,literal:!0}),v=(I=>{if(e.literal)return O(I);switch(I.val){case"G":return gi(t.eras("short"),0);case"GG":return gi(t.eras("long"),0);case"y":return ln(E);case"yy":return ln(S,od);case"yyyy":return ln(d);case"yyyyy":return ln(w);case"yyyyyy":return ln(f);case"M":return ln(p);case"MM":return ln(r);case"MMM":return gi(t.months("short",!0),1);case"MMMM":return gi(t.months("long",!0),1);case"L":return ln(p);case"LL":return ln(r);case"LLL":return gi(t.months("short",!1),1);case"LLLL":return gi(t.months("long",!1),1);case"d":return ln(p);case"dd":return ln(r);case"o":return ln(_);case"ooo":return ln(l);case"HH":return ln(r);case"H":return ln(p);case"hh":return ln(r);case"h":return ln(p);case"mm":return ln(r);case"m":return ln(p);case"q":return ln(p);case"qq":return ln(r);case"s":return ln(p);case"ss":return ln(r);case"S":return ln(_);case"SSS":return ln(l);case"u":return nc(T);case"uu":return nc(p);case"uuu":return ln(n);case"a":return gi(t.meridiems(),0);case"kkkk":return ln(d);case"kk":return ln(S,od);case"W":return ln(p);case"WW":return ln(r);case"E":case"c":return ln(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 nc(/[a-z_+-/]{1,256}?/i);case" ":return nc(/[^\S\n\r]/);default:return O(I)}})(e)||{invalidReason:zv};return v.token=e,v}const Vv={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 qv(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=Vv[f];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Zv(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 Xv(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=ts.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=$d(e.u)),[Object.keys(e).reduce((d,f)=>{const p=t(f);return p&&(d[p]=e[f]),d},{}),n,r]}let Fu=null;function Qv(){return Fu||(Fu=vt.fromMillis(1555555555555)),Fu}function eS(e,t){if(e.literal)return e;const n=_r.macroTokenToFormatOpts(e.val),r=i_(n,t);return r==null||r.includes(void 0)?e:r}function t_(e,t){return Array.prototype.concat(...e.map(n=>eS(n,t)))}class n_{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=t_(_r.parseFormat(n),t),this.units=this.tokens.map(r=>jv(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,l]=Zv(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?Xv(r):[null,null,void 0];if(el(r,"a")&&el(r,"H"))throw new Zo("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 r_(e,t,n){return new n_(e,n).explainFromTokens(t)}function tS(e,t,n){const{result:r,zone:l,specificOffset:d,invalidReason:f}=r_(e,t,n);return[r,l,d,f]}function i_(e,t){if(!e)return null;const r=_r.create(t,e).dtFormatter(Qv()),l=r.formatToParts(),d=r.resolvedOptions();return l.map(f=>qv(f,e,d))}const Bu="Invalid DateTime",nS=864e13;function na(e){return new pi("unsupported zone",`the zone "${e.name}" is not supported`)}function Hu(e){return e.weekData===null&&(e.weekData=pc(e.c)),e.weekData}function Wu(e){return e.localWeekData===null&&(e.localWeekData=pc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Qs(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new vt({...n,...t,old:n})}function s_(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 rc(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 lc(e,t,n){return s_(Sc(e),t,n)}function ep(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,mc(r,l))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},f=en.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=Sc(d);let[_,E]=s_(p,n,e.zone);return f!==0&&(_+=f,E=e.zone.offset(_)),{ts:_,o:E}}function jo(e,t,n,r,l,d){const{setZone:f,zone:p}=n;if(e&&Object.keys(e).length!==0||t){const _=t||p,E=vt.fromObject(e,{...n,zone:_,specificOffset:d});return f?E:E.setZone(p)}else return vt.invalid(new pi("unparsable",`the input "${l}" can't be parsed as ${r}`))}function ic(e,t,n=!0){return e.isValid?_r.create(un.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ku(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 tp(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 o_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},rS={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},l_=["year","month","day","hour","minute","second","millisecond"],sS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],oS=["year","ordinal","hour","minute","second","millisecond"];function lS(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 am(e);return t}function np(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return lS(e)}}function aS(e){return cc[e]||(ac===void 0&&(ac=Rn.now()),cc[e]=e.offset(ac)),cc[e]}function rp(e,t){const n=Cs(t.zone,Rn.defaultZone);if(!n.isValid)return vt.invalid(na(n));const r=un.fromObject(t);let l,d;if(Lt(e.year))l=Rn.now();else{for(const _ of l_)Lt(e[_])&&(e[_]=o_[_]);const f=bm(e)||Lm(e);if(f)return vt.invalid(f);const p=aS(n);[l,d]=lc(e,p,n)}return new vt({ts:l,zone:n,loc:r,o:d})}function ip(e,t,n){const r=Lt(n.round)?!0:n.round,l=(f,p)=>(f=Fd(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 sp(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 ac,cc={};class vt{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=Ts(t.o)&&!t.old?t.o:n.offset(this.ts);l=rc(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 vt({})}static local(){const[t,n]=sp(arguments),[r,l,d,f,p,_,E]=n;return rp({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:E},t)}static utc(){const[t,n]=sp(arguments),[r,l,d,f,p,_,E]=n;return t.zone=vr.utcInstance,rp({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:E},t)}static fromJSDate(t,n={}){const r=$x(t)?t.valueOf():NaN;if(Number.isNaN(r))return vt.invalid("invalid input");const l=Cs(n.zone,Rn.defaultZone);return l.isValid?new vt({ts:r,zone:l,loc:un.fromObject(n)}):vt.invalid(na(l))}static fromMillis(t,n={}){if(Ts(t))return t<-864e13||t>nS?vt.invalid("Timestamp out of range"):new vt({ts:t,zone:Cs(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(Ts(t))return new vt({ts:t*1e3,zone:Cs(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Cs(n.zone,Rn.defaultZone);if(!r.isValid)return vt.invalid(na(r));const l=un.fromObject(n),d=_c(t,np),{minDaysInFirstWeek:f,startOfWeek:p}=Ug(d,l),_=Rn.now(),E=Lt(n.specificOffset)?r.offset(_):n.specificOffset,T=!Lt(d.ordinal),S=!Lt(d.year),w=!Lt(d.month)||!Lt(d.day),O=S||w,m=d.weekYear||d.weekNumber;if((O||T)&&m)throw new Zo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&T)throw new Zo("Can't mix ordinal dates with month/day");const v=m||d.weekday&&!O;let I,G,k=rc(_,E);v?(I=sS,G=rS,k=pc(k,f,p)):T?(I=oS,G=iS,k=$u(k)):(I=l_,G=o_);let P=!1;for(const z of I){const q=d[z];Lt(q)?P?d[z]=G[z]:d[z]=k[z]:P=!0}const H=v?Ix(d,f,p):T?kx(d):bm(d),j=H||Lm(d);if(j)return vt.invalid(j);const re=v?Kg(d,f,p):T?zg(d):d,[te,ce]=lc(re,E,r),V=new vt({ts:te,zone:r,o:ce,loc:l});return d.weekday&&O&&t.weekday!==V.weekday?vt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${V.toISO()}`):V.isValid?V:vt.invalid(V.invalid)}static fromISO(t,n={}){const[r,l]=wv(t);return jo(r,l,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,l]=Ov(t);return jo(r,l,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,l]=Dv(t);return jo(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,_,E,T]=tS(f,t,n);return T?vt.invalid(T):jo(p,_,r,`format ${n}`,t,E)}static fromString(t,n,r={}){return vt.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,l]=kv(t);return jo(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 lx(r);return new vt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=i_(t,un.fromObject(n));return r?r.map(l=>l?l.val:null).join(""):null}static expandFormat(t,n={}){return t_(_r.parseFormat(t),un.fromObject(n)).map(l=>l.val).join("")}static resetCache(){ac=void 0,cc={}}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?Hu(this).weekYear:NaN}get weekNumber(){return this.isValid?Hu(this).weekNumber:NaN}get weekday(){return this.isValid?Hu(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Wu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Wu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Wu(this).weekYear:NaN}get ordinal(){return this.isValid?$u(this.c).ordinal:NaN}get monthShort(){return this.isValid?tc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?tc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?tc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?tc.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=Sc(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,E=r-p*n,T=rc(_,f),S=rc(E,p);return T.hour===S.hour&&T.minute===S.minute&&T.second===S.second&&T.millisecond===S.millisecond?[Qs(this,{ts:_}),Qs(this,{ts:E})]:[this]}get isInLeapYear(){return da(this.year)}get daysInMonth(){return mc(this.year,this.month)}get daysInYear(){return this.isValid?Jo(this.year):NaN}get weeksInWeekYear(){return this.isValid?ca(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ca(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=Cs(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]=lc(f,d,t)}return Qs(this,{ts:l,zone:t})}else return vt.invalid(na(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const l=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Qs(this,{loc:l})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=_c(t,np),{minDaysInFirstWeek:r,startOfWeek:l}=Ug(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),E=p||_,T=n.weekYear||n.weekNumber;if((E||f)&&T)throw new Zo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new Zo("Can't mix ordinal dates with month/day");let S;d?S=Kg({...pc(this.c,r,l),...n},r,l):Lt(n.ordinal)?(S={...this.toObject(),...n},Lt(n.day)&&(S.day=Math.min(mc(S.year,S.month),S.day))):S=zg({...$u(this.c),...n});const[w,O]=lc(S,this.o,this.zone);return Qs(this,{ts:w,o:O})}plus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t);return Qs(this,ep(this,n))}minus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t).negate();return Qs(this,ep(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},l=en.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):Bu}toLocaleString(t=gc,n={}){return this.isValid?_r.create(this.loc.clone(n),t).formatDateTime(this):Bu}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=Ku(this,f);return p+="T",p+=tp(this,f,n,r,l,d),p}toISODate({format:t="extended"}={}){return this.isValid?Ku(this,t==="extended"):null}toISOWeekDate(){return ic(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":"")+tp(this,f==="extended",n,t,r,d):null}toRFC2822(){return ic(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ic(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ku(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")),ic(this,l,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Bu}[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 en.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Fx(n).map(en.normalizeUnit),f=t.valueOf()>this.valueOf(),p=f?this:t,_=f?t:this,E=Kv(p,_,d,l);return f?E.negate():E}diffNow(t="milliseconds",n={}){return this.diff(vt.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||vt.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),ip(n,this.plus(r),{...t,numeric:"always",units:l,unit:d})}toRelativeCalendar(t={}){return this.isValid?ip(t.base||vt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(vt.isDateTime))throw new mr("min requires all arguments be DateTimes");return Gg(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(vt.isDateTime))throw new mr("max requires all arguments be DateTimes");return Gg(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 r_(f,t,n)}static fromStringExplain(t,n,r={}){return vt.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 n_(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:E,invalidReason:T}=n.explainFromTokens(t);return T?vt.invalid(T):jo(p,_,r,`format ${n.format}`,t,E)}static get DATE_SHORT(){return gc}static get DATE_MED(){return cm}static get DATE_MED_WITH_WEEKDAY(){return ux}static get DATE_FULL(){return um}static get DATE_HUGE(){return dm}static get TIME_SIMPLE(){return fm}static get TIME_WITH_SECONDS(){return hm}static get TIME_WITH_SHORT_OFFSET(){return gm}static get TIME_WITH_LONG_OFFSET(){return pm}static get TIME_24_SIMPLE(){return mm}static get TIME_24_WITH_SECONDS(){return _m}static get TIME_24_WITH_SHORT_OFFSET(){return ym}static get TIME_24_WITH_LONG_OFFSET(){return Nm}static get DATETIME_SHORT(){return Cm}static get DATETIME_SHORT_WITH_SECONDS(){return Em}static get DATETIME_MED(){return Tm}static get DATETIME_MED_WITH_SECONDS(){return xm}static get DATETIME_MED_WITH_WEEKDAY(){return dx}static get DATETIME_FULL(){return vm}static get DATETIME_FULL_WITH_SECONDS(){return Sm}static get DATETIME_HUGE(){return wm}static get DATETIME_HUGE_WITH_SECONDS(){return Om}}function Xl(e){if(vt.isDateTime(e))return e;if(e&&e.valueOf&&Ts(e.valueOf()))return vt.fromJSDate(e);if(e&&typeof e=="object")return vt.fromObject(e);throw new mr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var Yt=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(Yt||{});function Dc(e){const t={1:Yt.Monday,2:Yt.Tuesday,3:Yt.Wednesday,4:Yt.Thursday,5:Yt.Friday,6:Yt.Saturday,7:Yt.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function oo(e){return{[Yt.Monday]:"Monday",[Yt.Tuesday]:"Tuesday",[Yt.Wednesday]:"Wednesday",[Yt.Thursday]:"Thursday",[Yt.Friday]:"Friday",[Yt.Saturday]:"Saturday",[Yt.Sunday]:"Sunday"}[e]}const ld=[Yt.Monday,Yt.Tuesday,Yt.Wednesday,Yt.Thursday,Yt.Friday,Yt.Saturday,Yt.Sunday],ra={[Yt.Monday]:"monday",[Yt.Tuesday]:"tuesday",[Yt.Wednesday]:"wednesday",[Yt.Thursday]:"thursday",[Yt.Friday]:"friday",[Yt.Saturday]:"saturday",[Yt.Sunday]:"sunday"};class yc{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(E=>{if(E.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(":").map(Number),[f,p]=n.end.split(":").map(Number);let _=0;f<l&&(_=1),this.end=this.end.set({hour:f,minute:p,day:this.end.day+_}),this.start=this.start.set({hour:l,minute: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).replace(" "," ")}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r).replace(" "," ")}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 a_{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;const n=t.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 yc(r,d,this.timezone);if(f.contains(t))return f}}return null}getCurrentInterval(){return this.getInterval(vt.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!=null&&f.openIntervals&&!f.isClosed&&r.push(...f.openIntervals.map(p=>new yc(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=oo(Dc(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(vt.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=vt.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(vt.now())}}function cS(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function uS(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 ga(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 pa(e){return!e.futureInterval}function dS(e){return ga(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):pa(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):nt.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function fS(e){return ga(e)||pa(e)?null:nt.jsx("span",{className:"HoursStatus-separator",children:" • "})}function hS(e){return ga(e)||pa(e)?null:nt.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function gS(e){if(ga(e)||pa(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 nt.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function pS(e){var r,l;if(ga(e)||pa(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 nt.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function mS(e,t){const n=e.currentTemplate||dS,r=e.separatorTemplate||fS,l=e.futureTemplate||hS,d=e.timeTemplate||gS,f=e.dayOfWeekTemplate||pS;return nt.jsxs("div",{className:lo("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),l(e),d(e),f(e)]})}const _S={minHeight:`${1.5}em`},yS=e=>{const[t,n]=rt.useState(!1),[r,l]=rt.useState(!1);if(rt.useEffect(()=>{l(!0)},[]),!e.hours)return nt.jsx(nt.Fragment,{});const d=e.statusTemplate||mS,f=new a_(e.hours,e.timezone),p=f.isOpenNow(),_=f.getCurrentInterval(),E=f.getNextInterval(),T=(_==null?void 0:_.end)||(E==null?void 0:E.start);if(T&&!t){n(!0);const w=T.toMillis()-vt.now().toMillis();setTimeout(()=>n(!1),w)}const S={isOpen:p,currentInterval:_,futureInterval:E,...e};return nt.jsx(nt.Fragment,{children:r?d(S,e):nt.jsx("div",{style:_S,className:lo("HoursStatus",(e==null?void 0:e.className)||"")})})};function NS(e,t){const n=[];return e.forEach(r=>{const l=n[n.length-1];l?uS(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&&ra[r.startDay]in t?t[ra[r.startDay]]||"":oo(r.startDay),d=t&&ra[r.endDay]in t?t[ra[r.endDay]]||"":oo(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${l}`:`${l} - ${d}`}})}function CS(e,t,n){const r=[],l=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?r.push((n==null?void 0:n.isClosed)||"Closed"):l?r.push((n==null?void 0:n.open24Hours)||"Open 24 hours"):e.intervals.forEach(d=>{const f=d.getStartTime((n==null?void 0:n.timeFormatLocale)||"en-US",t),p=d.getEndTime((n==null?void 0:n.timeFormatLocale)||"en-US",t);r.push(`${f} - ${p}`)}),r}function ES(e,t,n){const r=[];for(let l=1;l<=7;l++){const d=vt.fromObject({weekday:l}),f=Dc(d);r.push({startDay:f,endDay:f,dayName:n&&oo(f).toLowerCase()in n?n[oo(f).toLowerCase()]||"":oo(f),intervals:e.filter(p=>p.start.weekday===l),isToday:(t==null?void 0:t.weekday)===l})}return r}const TS=e=>{const[t,n]=rt.useState(!1);return rt.useEffect(()=>{n(!0)},[]),e.hours?nt.jsx(nt.Fragment,{children:t?nt.jsx(xS,{...e}):nt.jsx(vS,{...e})}):nt.jsx(nt.Fragment,{})},xS=e=>{const t=new a_(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),n=vt.now(),r=t.getIntervalsForNDays(7,n),l=ES(r,n,e.dayOfWeekNames);return nt.jsx(ad,{...e,hoursData:l,isClient:!0})},vS=e=>{var f;const{hours:t,dayOfWeekNames:n,intervalTranslations:r}=e,l=ld.map(p=>{var E,T;const _=ra[p];return{dayName:(n==null?void 0:n[_])||oo(p),startDay:p,endDay:p,isToday:!1,intervals:((T=(E=t[_])==null?void 0:E.openIntervals)==null?void 0:T.map(S=>new yc(vt.now(),S,"UTC")))??[]}}),d=(f=t.holidayHours)==null?void 0:f.map(p=>{var T,S;const _=vt.fromFormat(p.date,"yyyy-MM-dd"),E=Dc(_);return{dayName:_.setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString(),isToday:!1,startDay:E,endDay:E,intervals:(p.isRegularHours?(T=p.openIntervals)==null?void 0:T.map(w=>new yc(_,w,"UTC")):(S=l.find(w=>w.startDay===E))==null?void 0:S.intervals)??[]}});return nt.jsxs(nt.Fragment,{children:[nt.jsx(ad,{...e,hoursData:l,isClient:!1}),d&&d.length>0&&nt.jsx(ad,{...e,hoursData:d,isClient:!1,isHolidayHours:!0}),t.reopenDate&&nt.jsxs("div",{className:"HoursTable-row",children:[nt.jsx("span",{className:"HoursTable-day",children:(r==null?void 0:r.reopenDate)||"Reopen Date"}),nt.jsx("span",{className:"HoursTable-intervals",children:vt.fromFormat(t.reopenDate,"yyyy-MM-dd").setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString()})]})]})},ad=e=>{const{intervalStringsBuilderFn:t,className:n,timeOptions:r,intervalTranslations:l,dayOfWeekNames:d,startOfWeek:f,isClient:p,isHolidayHours:_}=e;let E=e.hoursData;function T(O){return O?{today:Dc(vt.now()),monday:Yt.Monday,tuesday:Yt.Tuesday,wednesday:Yt.Wednesday,thursday:Yt.Thursday,friday:Yt.Friday,saturday:Yt.Saturday,sunday:Yt.Sunday}[O]:Yt.Sunday}const S=ld.indexOf(T(p||f!=="today"?f:"sunday")),w=cS(ld,7-S);return _||(E.sort((O,m)=>w.indexOf(O.startDay)-w.indexOf(m.startDay)),e.collapseDays&&(E=NS(E,d))),nt.jsx("div",{className:lo("HoursTable",n),children:E.map(O=>{const v=(t||CS)(O,r,l);return nt.jsxs("div",{className:lo("HoursTable-row",{"is-today":O.isToday}),children:[nt.jsx("span",{className:"HoursTable-day",children:O.dayName}),nt.jsx("span",{className:"HoursTable-intervals",children:v.map((I,G)=>nt.jsx("span",{className:"HoursTable-interval",children:I},G))})]},O.dayName)})})},SS=e=>`<script type="application/ld+json">
|
|
109
|
+
`}),n}const nx=(e,t)=>e(t,"i",rs(e,t)),rx=(e,t)=>e(t,"b",rs(e,t)),ix=(e,t)=>e(t,"u",rs(e,t)),sx=(e,t)=>e(t,"s",rs(e,t)),ox=(e,t)=>e(t,"sub",rs(e,t)),lx=(e,t)=>e(t,"sup",rs(e,t)),ax={emphasis:nx,strong:rx,underline:ix,strikethrough:sx,subscript:ox,superscript:lx},cx=e=>{const[t,n]=rt.useState();let r;return rt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-CFORd6Yp.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[hT],remarkRehypeOptions:{handlers:ax}});n(d)})()},[e.markdown]),t||null};class uo extends Error{}class ux extends uo{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class dx extends uo{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class fx extends uo{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Zo extends uo{}class dm extends uo{constructor(t){super(`Invalid unit ${t}`)}}class mr extends uo{}class ys extends uo{constructor(){super("Zone is an abstract class")}}const at="numeric",mi="short",Gr="long",pc={year:at,month:at,day:at},fm={year:at,month:mi,day:at},hx={year:at,month:mi,day:at,weekday:mi},hm={year:at,month:Gr,day:at},gm={year:at,month:Gr,day:at,weekday:Gr},pm={hour:at,minute:at},mm={hour:at,minute:at,second:at},_m={hour:at,minute:at,second:at,timeZoneName:mi},ym={hour:at,minute:at,second:at,timeZoneName:Gr},Nm={hour:at,minute:at,hourCycle:"h23"},Cm={hour:at,minute:at,second:at,hourCycle:"h23"},Em={hour:at,minute:at,second:at,hourCycle:"h23",timeZoneName:mi},Tm={hour:at,minute:at,second:at,hourCycle:"h23",timeZoneName:Gr},xm={year:at,month:at,day:at,hour:at,minute:at},vm={year:at,month:at,day:at,hour:at,minute:at,second:at},Sm={year:at,month:mi,day:at,hour:at,minute:at},wm={year:at,month:mi,day:at,hour:at,minute:at,second:at},gx={year:at,month:mi,day:at,weekday:mi,hour:at,minute:at},Om={year:at,month:Gr,day:at,hour:at,minute:at,timeZoneName:mi},Dm={year:at,month:Gr,day:at,hour:at,minute:at,second:at,timeZoneName:mi},Am={year:at,month:Gr,day:at,weekday:Gr,hour:at,minute:at,timeZoneName:Gr},Mm={year:at,month:Gr,day:at,weekday:Gr,hour:at,minute:at,second:at,timeZoneName:Gr};class ua{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 Pu=null;class vc extends ua{static get instance(){return Pu===null&&(Pu=new vc),Pu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Bm(t,n,r)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let oc={};function px(e){return oc[e]||(oc[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"})),oc[e]}const mx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function _x(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,_,E,T]=r;return[f,l,d,p,_,E,T]}function yx(e,t){const n=e.formatToParts(t),r=[];for(let l=0;l<n.length;l++){const{type:d,value:f}=n[l],p=mx[d];d==="era"?r[p]=f:Lt(p)||(r[p]=parseInt(f,10))}return r}let Qa={};class ns extends ua{static create(t){return Qa[t]||(Qa[t]=new ns(t)),Qa[t]}static resetCache(){Qa={},oc={}}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 Bm(t,n,r,this.name)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=px(this.name);let[l,d,f,p,_,E,T]=r.formatToParts?yx(r,n):_x(r,n);p==="BC"&&(l=-Math.abs(l)+1);const w=wc({year:l,month:d,day:f,hour:_===24?0:_,minute:E,second:T,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 Lg={};function Nx(e,t={}){const n=JSON.stringify([e,t]);let r=Lg[n];return r||(r=new Intl.ListFormat(e,t),Lg[n]=r),r}let nd={};function rd(e,t={}){const n=JSON.stringify([e,t]);let r=nd[n];return r||(r=new Intl.DateTimeFormat(e,t),nd[n]=r),r}let id={};function Cx(e,t={}){const n=JSON.stringify([e,t]);let r=id[n];return r||(r=new Intl.NumberFormat(e,t),id[n]=r),r}let sd={};function Ex(e,t={}){const{base:n,...r}=t,l=JSON.stringify([e,r]);let d=sd[l];return d||(d=new Intl.RelativeTimeFormat(e,t),sd[l]=d),d}let ta=null;function Tx(){return ta||(ta=new Intl.DateTimeFormat().resolvedOptions().locale,ta)}let Ig={};function xx(e){let t=Ig[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Ig[e]=t}return t}function vx(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=rd(e).resolvedOptions(),l=e}catch{const _=e.substring(0,n);r=rd(_).resolvedOptions(),l=_}const{numberingSystem:d,calendar:f}=r;return[l,d,f]}}function Sx(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function wx(e){const t=[];for(let n=1;n<=12;n++){const r=vt.utc(2009,n,1);t.push(e(r))}return t}function Ox(e){const t=[];for(let n=1;n<=7;n++){const r=vt.utc(2016,11,13+n);t.push(e(r))}return t}function ec(e,t,n,r){const l=e.listingMode();return l==="error"?null:l==="en"?n(t):r(t)}function Dx(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 Ax{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=Cx(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):Hd(t,3);return Kn(n,this.padTo)}}}class Mx{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=rd(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 Rx{constructor(t,n,r){this.opts={style:"long",...r},!n&&$m()&&(this.rtf=Ex(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):ev(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const bx={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":Tx()),_=n||Rn.defaultNumberingSystem,E=r||Rn.defaultOutputCalendar,T=od(l)||Rn.defaultWeekSettings;return new un(p,_,E,T,f)}static resetCache(){ta=null,nd={},id={},sd={}}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,_]=vx(t);this.locale=f,this.numberingSystem=n||p||null,this.outputCalendar=r||_||null,this.weekSettings=l,this.intl=Sx(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=Dx(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,od(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 ec(this,t,Km,()=>{const r=n?{month:t,day:"numeric"}:{month:t},l=n?"format":"standalone";return this.monthsCache[l][t]||(this.monthsCache[l][t]=wx(d=>this.extract(d,r,"month"))),this.monthsCache[l][t]})}weekdays(t,n=!1){return ec(this,t,Gm,()=>{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]=Ox(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[l][t]})}meridiems(){return ec(this,void 0,()=>Ym,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[vt.utc(2016,11,13,9),vt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return ec(this,t,jm,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[vt.utc(-40,1,1),vt.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 Ax(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Mx(t,this.intl,n)}relFormatter(t={}){return new Rx(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Nx(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:Fm()?xx(this.locale):bx}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 $u=null;class vr extends ua{static get utcInstance(){return $u===null&&($u=new vr(0)),$u}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(Oc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${oa(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${oa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return oa(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 Lx extends ua{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 ua)return e;if(Bx(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?vc.instance:n==="utc"||n==="gmt"?vr.utcInstance:vr.parseSpecifier(n)||ns.create(e)}else return Ts(e)?vr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Lx(e)}const Pd={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},kg={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]},Ix=Pd.hanidec.replace(/[\[|\]]/g,"").split("");function kx(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(Pd.hanidec)!==-1)t+=Ix.indexOf(e[n]);else for(const l in kg){const[d,f]=kg[l];r>=d&&r<=f&&(t+=r-d)}}return parseInt(t,10)}else return t}let qo={};function Px(){qo={}}function hi({numberingSystem:e},t=""){const n=e||"latn";return qo[n]||(qo[n]={}),qo[n][t]||(qo[n][t]=new RegExp(`${Pd[n]}${t}`)),qo[n][t]}let Pg=()=>Date.now(),$g="system",Fg=null,Bg=null,Hg=null,Wg=60,Kg,zg=null;class Rn{static get now(){return Pg}static set now(t){Pg=t}static set defaultZone(t){$g=t}static get defaultZone(){return Es($g,vc.instance)}static get defaultLocale(){return Fg}static set defaultLocale(t){Fg=t}static get defaultNumberingSystem(){return Bg}static set defaultNumberingSystem(t){Bg=t}static get defaultOutputCalendar(){return Hg}static set defaultOutputCalendar(t){Hg=t}static get defaultWeekSettings(){return zg}static set defaultWeekSettings(t){zg=od(t)}static get twoDigitCutoffYear(){return Wg}static set twoDigitCutoffYear(t){Wg=t%100}static get throwOnInvalid(){return Kg}static set throwOnInvalid(t){Kg=t}static resetCaches(){un.resetCache(),ns.resetCache(),vt.resetCache(),Px()}}class pi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Rm=[0,31,59,90,120,151,181,212,243,273,304,334],bm=[0,31,60,91,121,152,182,213,244,274,305,335];function Qr(e,t){return new pi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function $d(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 Lm(e,t,n){return n+(da(e)?bm:Rm)[t-1]}function Im(e,t){const n=da(e)?bm:Rm,r=n.findIndex(d=>d<t),l=t-n[r];return{month:r+1,day:l}}function Fd(e,t){return(e-t+7)%7+1}function mc(e,t=4,n=1){const{year:r,month:l,day:d}=e,f=Lm(r,l,d),p=Fd($d(r,l,d),n);let _=Math.floor((f-p+14-t)/7),E;return _<1?(E=r-1,_=ca(E,t,n)):_>ca(r,t,n)?(E=r+1,_=1):E=r,{weekYear:E,weekNumber:_,weekday:p,...Dc(e)}}function Ug(e,t=4,n=1){const{weekYear:r,weekNumber:l,weekday:d}=e,f=Fd($d(r,1,t),n),p=Jo(r);let _=l*7+d-f-7+t,E;_<1?(E=r-1,_+=Jo(E)):_>p?(E=r+1,_-=Jo(r)):E=r;const{month:T,day:S}=Im(E,_);return{year:E,month:T,day:S,...Dc(e)}}function Fu(e){const{year:t,month:n,day:r}=e,l=Lm(t,n,r);return{year:t,ordinal:l,...Dc(e)}}function Gg(e){const{year:t,ordinal:n}=e,{month:r,day:l}=Im(t,n);return{year:t,month:r,day:l,...Dc(e)}}function Yg(e,t){if(!Lt(e.localWeekday)||!Lt(e.localWeekNumber)||!Lt(e.localWeekYear)){if(!Lt(e.weekday)||!Lt(e.weekNumber)||!Lt(e.weekYear))throw new Zo("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 $x(e,t=4,n=1){const r=Sc(e.weekYear),l=ei(e.weekNumber,1,ca(e.weekYear,t,n)),d=ei(e.weekday,1,7);return r?l?d?!1:Qr("weekday",e.weekday):Qr("week",e.weekNumber):Qr("weekYear",e.weekYear)}function Fx(e){const t=Sc(e.year),n=ei(e.ordinal,1,Jo(e.year));return t?n?!1:Qr("ordinal",e.ordinal):Qr("year",e.year)}function km(e){const t=Sc(e.year),n=ei(e.month,1,12),r=ei(e.day,1,_c(e.year,e.month));return t?n?r?!1:Qr("day",e.day):Qr("month",e.month):Qr("year",e.year)}function Pm(e){const{hour:t,minute:n,second:r,millisecond:l}=e,d=ei(t,0,23)||t===24&&n===0&&r===0&&l===0,f=ei(n,0,59),p=ei(r,0,59),_=ei(l,0,999);return d?f?p?_?!1:Qr("millisecond",l):Qr("second",r):Qr("minute",n):Qr("hour",t)}function Lt(e){return typeof e>"u"}function Ts(e){return typeof e=="number"}function Sc(e){return typeof e=="number"&&e%1===0}function Bx(e){return typeof e=="string"}function Hx(e){return Object.prototype.toString.call(e)==="[object Date]"}function $m(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Fm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Wx(e){return Array.isArray(e)?e:[e]}function jg(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 od(e){if(e==null)return null;if(typeof e!="object")throw new mr("Week settings must be an object");if(!ei(e.firstDay,1,7)||!ei(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ei(t,1,7)))throw new mr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ei(e,t,n){return Sc(e)&&e>=t&&e<=n}function zx(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 Hd(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function da(e){return e%4===0&&(e%100!==0||e%400===0)}function Jo(e){return da(e)?366:365}function _c(e,t){const n=zx(t-1,12)+1,r=e+(t-n)/12;return n===2?da(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function wc(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 Vg(e,t,n){return-Fd($d(e,1,t),n)+t-1}function ca(e,t=4,n=1){const r=Vg(e,t,n),l=Vg(e+1,t,n);return(Jo(e)-r+l)/7}function ld(e){return e>99?e:e>Rn.twoDigitCutoffYear?1900+e:2e3+e}function Bm(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 Oc(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 Hm(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new mr(`Invalid unit value ${e}`);return t}function yc(e,t){const n={};for(const r in e)if(el(e,r)){const l=e[r];if(l==null)continue;n[t(r)]=Hm(l)}return n}function oa(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 Dc(e){return Kx(e,["hour","minute","second","millisecond"])}const Ux=["January","February","March","April","May","June","July","August","September","October","November","December"],Wm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Gx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Km(e){switch(e){case"narrow":return[...Gx];case"short":return[...Wm];case"long":return[...Ux];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 zm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Um=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Yx=["M","T","W","T","F","S","S"];function Gm(e){switch(e){case"narrow":return[...Yx];case"short":return[...Um];case"long":return[...zm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ym=["AM","PM"],jx=["Before Christ","Anno Domini"],Vx=["BC","AD"],qx=["B","A"];function jm(e){switch(e){case"narrow":return[...qx];case"short":return[...Vx];case"long":return[...jx];default:return null}}function Zx(e){return Ym[e.hour<12?0:1]}function Jx(e,t){return Gm(t)[e.weekday-1]}function Xx(e,t){return Km(t)[e.month-1]}function Qx(e,t){return jm(t)[e.year<0?0:1]}function ev(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,E=l[e],T=r?_?E[1]:E[2]||E[1]:_?l[e][0]:e;return f?`${p} ${T} ago`:`in ${p} ${T}`}function qg(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const tv={D:pc,DD:fm,DDD:hm,DDDD:gm,t:pm,tt:mm,ttt:_m,tttt:ym,T:Nm,TT:Cm,TTT:Em,TTTT:Tm,f:xm,ff:Sm,fff:Om,ffff:Am,F:vm,FF:wm,FFF:Dm,FFFF:Mm};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 tv[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?Xx(t,M):d(m?{month:M}:{month:M,day:"numeric"},"month"),E=(M,m)=>r?Jx(t,M):d(m?{weekday:M}:{weekday:M,month:"long",day:"numeric"},"weekday"),T=M=>{const m=_r.macroTokenToFormatOpts(M);return m?this.formatWithSystemDefault(t,m):M},S=M=>r?Qx(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 E("short",!0);case"cccc":return E("long",!0);case"ccccc":return E("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return E("short",!1);case"EEEE":return E("long",!1);case"EEEEE":return E("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 T(M)}};return qg(_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=_=>E=>{const T=r(E);return T?this.num(_.get(T),E.length):E},d=_r.parseFormat(n),f=d.reduce((_,{literal:E,val:T})=>E?_:_.concat(T),[]),p=t.shiftTo(...f.map(r).filter(_=>_));return qg(d,l(p))}}const Vm=/[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 qm(...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 Zm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,nv=`(?:${Zm.source}?(?:\\[(${Vm.source})\\])?)?`,Wd=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Jm=RegExp(`${Wd.source}${nv}`),Kd=RegExp(`(?:T${Jm.source})?`),rv=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,iv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,sv=/(\d{4})-?(\d{3})/,ov=qm("weekYear","weekNumber","weekDay"),lv=qm("year","ordinal"),av=/(\d{4})-(\d\d)-(\d\d)/,Xm=RegExp(`${Wd.source} ?(?:${Zm.source}|(${Vm.source}))?`),cv=RegExp(`(?: ${Xm.source})?`);function Xo(e,t,n){const r=e[t];return Lt(r)?n:Cs(r)}function uv(e,t){return[{year:Xo(e,t),month:Xo(e,t+1,1),day:Xo(e,t+2,1)},null,t+3]}function ul(e,t){return[{hours:Xo(e,t,0),minutes:Xo(e,t+1,0),seconds:Xo(e,t+2,0),milliseconds:Bd(e[t+3])},null,t+4]}function fa(e,t){const n=!e[t]&&!e[t+1],r=Oc(e[t+1],e[t+2]),l=n?null:vr.instance(r);return[{},l,t+3]}function ha(e,t){const n=e[t]?ns.create(e[t]):null;return[{},n,t+1]}const dv=RegExp(`^T?${Wd.source}$`),fv=/^-?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 hv(e){const[t,n,r,l,d,f,p,_,E]=e,T=t[0]==="-",S=_&&_[0]==="-",w=(M,m=!1)=>M!==void 0&&(m||M&&T)?-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(E),S)}]}const gv={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 zd(e,t,n,r,l,d,f){const p={year:t.length===2?ld(Cs(t)):Cs(t),month:Wm.indexOf(n)+1,day:Cs(r),hour:Cs(l),minute:Cs(d)};return f&&(p.second=Cs(f)),e&&(p.weekday=e.length>3?zm.indexOf(e)+1:Um.indexOf(e)+1),p}const pv=/^(?:(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 mv(e){const[,t,n,r,l,d,f,p,_,E,T,S]=e,w=zd(t,l,r,n,d,f,p);let M;return _?M=gv[_]:E?M=0:M=Oc(T,S),[w,new vr(M)]}function _v(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const yv=/^(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$/,Nv=/^(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$/,Cv=/^(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 Zg(e){const[,t,n,r,l,d,f,p]=e;return[zd(t,l,r,n,d,f,p),vr.utcInstance]}function Ev(e){const[,t,n,r,l,d,f,p]=e;return[zd(t,p,n,r,l,d,f),vr.utcInstance]}const Tv=ll(rv,Kd),xv=ll(iv,Kd),vv=ll(sv,Kd),Sv=ll(Jm),Qm=al(uv,ul,fa,ha),wv=al(ov,ul,fa,ha),Ov=al(lv,ul,fa,ha),Dv=al(ul,fa,ha);function Av(e){return cl(e,[Tv,Qm],[xv,wv],[vv,Ov],[Sv,Dv])}function Mv(e){return cl(_v(e),[pv,mv])}function Rv(e){return cl(e,[yv,Zg],[Nv,Zg],[Cv,Ev])}function bv(e){return cl(e,[fv,hv])}const Lv=al(ul);function Iv(e){return cl(e,[dv,Lv])}const kv=ll(av,cv),Pv=ll(Xm),$v=al(ul,fa,ha);function Fv(e){return cl(e,[kv,Qm],[Pv,$v])}const Jg="Invalid Duration",e_={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},...e_},Xr=146097/400,Go=146097/4800,Hv={years:{quarters:4,months:12,weeks:Xr/7,days:Xr,hours:Xr*24,minutes:Xr*24*60,seconds:Xr*24*60*60,milliseconds:Xr*24*60*60*1e3},quarters:{months:3,weeks:Xr/28,days:Xr/4,hours:Xr*24/4,minutes:Xr*24*60/4,seconds:Xr*24*60*60/4,milliseconds:Xr*24*60*60*1e3/4},months:{weeks:Go/7,days:Go,hours:Go*24,minutes:Go*24*60,seconds:Go*24*60*60,milliseconds:Go*24*60*60*1e3},...e_},so=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Wv=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 en(r)}function t_(e,t){let n=t.milliseconds??0;for(const r of Wv.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Xg(e,t){const n=t_(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 en{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?Hv: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 en.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 en({values:yc(t,en.normalizeUnit),loc:un.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Ts(t))return en.fromMillis(t);if(en.isDuration(t))return t;if(typeof t=="object")return en.fromObject(t);throw new mr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=bv(t);return r?en.fromObject(r,n):en.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Iv(t);return r?en.fromObject(r,n):en.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 fx(r);return new en({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 dm(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):Jg}toHuman(t={}){if(!this.isValid)return Jg;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+=Hd(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},vt.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?t_(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=en.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=en.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]=Hm(t(this.values[r],r));return Ns(this,{values:n},!0)}get(t){return this[en.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...yc(t,en.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 Xg(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=>en.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 E in r)p+=this.matrix[E][f]*r[E],r[E]=0;Ts(l[f])&&(p+=l[f]);const _=Math.trunc(p);n[f]=_,r[f]=(p*1e3-_*1e3)/1e3}else Ts(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 Xg(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 Yo="Invalid Interval";function zv(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 dx(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Xl(t),l=Xl(n),d=zv(r,l);return d??new Mn({start:r,end:l})}static after(t,n){const r=en.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l,l.plus(r))}static before(t,n){const r=en.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=vt.fromISO(r,n),f=d.isValid}catch{f=!1}let p,_;try{p=vt.fromISO(l,n),_=p.isValid}catch{_=!1}if(f&&_)return Mn.fromDateTimes(d,p);if(f){const E=en.fromISO(l,n);if(E.isValid)return Mn.after(d,E)}else if(_){const E=en.fromISO(r,n);if(E.isValid)return Mn.before(p,E)}}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=en.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((_,E)=>_.time-E.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()})`:Yo}[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=pc,n={}){return this.isValid?_r.create(this.s.loc.clone(n),t).formatInterval(this):Yo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Yo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Yo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Yo}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Yo}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):en.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class tc{static hasDST(t=Rn.defaultZone){const n=vt.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:$m(),localeWeek:Fm()}}}function Qg(e,t){const n=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(en.fromMillis(r).as("days"))}function Uv(e,t,n){const r=[["years",(_,E)=>E.year-_.year],["quarters",(_,E)=>E.quarter-_.quarter+(E.year-_.year)*4],["months",(_,E)=>E.month-_.month+(E.year-_.year)*12],["weeks",(_,E)=>{const T=Qg(_,E);return(T-T%7)/7}],["days",Qg]],l={},d=e;let f,p;for(const[_,E]of r)n.indexOf(_)>=0&&(f=_,l[_]=E(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 Gv(e,t,n,r){let[l,d,f,p]=Uv(e,t,n);const _=t-l,E=n.filter(S=>["hours","minutes","seconds","milliseconds"].indexOf(S)>=0);E.length===0&&(f<t&&(f=l.plus({[p]:1})),f!==l&&(d[p]=(d[p]||0)+_/(f-l)));const T=en.fromObject(d,r);return E.length>0?en.fromMillis(_,r).shiftTo(...E).plus(T):T}const Yv="missing Intl.DateTimeFormat.formatToParts support";function ln(e,t=n=>n){return{regex:e,deser:([n])=>t(kx(n))}}const jv=" ",n_=`[ ${jv}]`,r_=new RegExp(n_,"g");function Vv(e){return e.replace(/\./g,"\\.?").replace(r_,n_)}function ep(e){return e.replace(/\./g,"").replace(r_," ").toLowerCase()}function gi(e,t){return e===null?null:{regex:RegExp(e.map(Vv).join("|")),deser:([n])=>e.findIndex(r=>ep(n)===ep(r))+t}}function tp(e,t){return{regex:e,deser:([,n,r])=>Oc(n,r),groups:t}}function nc(e){return{regex:e,deser:([t])=>t}}function qv(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}"),E=hi(t,"{1,6}"),T=hi(t,"{1,9}"),S=hi(t,"{2,4}"),w=hi(t,"{4,6}"),M=I=>({regex:RegExp(qv(I.val)),deser:([G])=>G,literal:!0}),v=(I=>{if(e.literal)return M(I);switch(I.val){case"G":return gi(t.eras("short"),0);case"GG":return gi(t.eras("long"),0);case"y":return ln(E);case"yy":return ln(S,ld);case"yyyy":return ln(d);case"yyyyy":return ln(w);case"yyyyyy":return ln(f);case"M":return ln(p);case"MM":return ln(r);case"MMM":return gi(t.months("short",!0),1);case"MMMM":return gi(t.months("long",!0),1);case"L":return ln(p);case"LL":return ln(r);case"LLL":return gi(t.months("short",!1),1);case"LLLL":return gi(t.months("long",!1),1);case"d":return ln(p);case"dd":return ln(r);case"o":return ln(_);case"ooo":return ln(l);case"HH":return ln(r);case"H":return ln(p);case"hh":return ln(r);case"h":return ln(p);case"mm":return ln(r);case"m":return ln(p);case"q":return ln(p);case"qq":return ln(r);case"s":return ln(p);case"ss":return ln(r);case"S":return ln(_);case"SSS":return ln(l);case"u":return nc(T);case"uu":return nc(p);case"uuu":return ln(n);case"a":return gi(t.meridiems(),0);case"kkkk":return ln(d);case"kk":return ln(S,ld);case"W":return ln(p);case"WW":return ln(r);case"E":case"c":return ln(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 tp(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return tp(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return nc(/[a-z_+-/]{1,256}?/i);case" ":return nc(/[^\S\n\r]/);default:return M(I)}})(e)||{invalidReason:Yv};return v.token=e,v}const Jv={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 Xv(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=Jv[f];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Qv(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function eS(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 tS(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 Bu=null;function nS(){return Bu||(Bu=vt.fromMillis(1555555555555)),Bu}function rS(e,t){if(e.literal)return e;const n=_r.macroTokenToFormatOpts(e.val),r=l_(n,t);return r==null||r.includes(void 0)?e:r}function i_(e,t){return Array.prototype.concat(...e.map(n=>rS(n,t)))}class s_{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=i_(_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]=Qv(this.units);this.regex=RegExp(r,"i"),this.handlers=l}}explainFromTokens(t){if(this.isValid){const[n,r]=eS(t,this.regex,this.handlers),[l,d,f]=r?tS(r):[null,null,void 0];if(el(r,"a")&&el(r,"H"))throw new Zo("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 o_(e,t,n){return new s_(e,n).explainFromTokens(t)}function iS(e,t,n){const{result:r,zone:l,specificOffset:d,invalidReason:f}=o_(e,t,n);return[r,l,d,f]}function l_(e,t){if(!e)return null;const r=_r.create(t,e).dtFormatter(nS()),l=r.formatToParts(),d=r.resolvedOptions();return l.map(f=>Xv(f,e,d))}const Hu="Invalid DateTime",sS=864e13;function na(e){return new pi("unsupported zone",`the zone "${e.name}" is not supported`)}function Wu(e){return e.weekData===null&&(e.weekData=mc(e.c)),e.weekData}function Ku(e){return e.localWeekData===null&&(e.localWeekData=mc(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 vt({...n,...t,old:n})}function a_(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 rc(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 lc(e,t,n){return a_(wc(e),t,n)}function np(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,_c(r,l))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},f=en.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=wc(d);let[_,E]=a_(p,n,e.zone);return f!==0&&(_+=f,E=e.zone.offset(_)),{ts:_,o:E}}function jo(e,t,n,r,l,d){const{setZone:f,zone:p}=n;if(e&&Object.keys(e).length!==0||t){const _=t||p,E=vt.fromObject(e,{...n,zone:_,specificOffset:d});return f?E:E.setZone(p)}else return vt.invalid(new pi("unparsable",`the input "${l}" can't be parsed as ${r}`))}function ic(e,t,n=!0){return e.isValid?_r.create(un.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function zu(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 rp(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 c_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},oS={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},lS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},u_=["year","month","day","hour","minute","second","millisecond"],aS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],cS=["year","ordinal","hour","minute","second","millisecond"];function uS(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 dm(e);return t}function ip(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return uS(e)}}function dS(e){return cc[e]||(ac===void 0&&(ac=Rn.now()),cc[e]=e.offset(ac)),cc[e]}function sp(e,t){const n=Es(t.zone,Rn.defaultZone);if(!n.isValid)return vt.invalid(na(n));const r=un.fromObject(t);let l,d;if(Lt(e.year))l=Rn.now();else{for(const _ of u_)Lt(e[_])&&(e[_]=c_[_]);const f=km(e)||Pm(e);if(f)return vt.invalid(f);const p=dS(n);[l,d]=lc(e,p,n)}return new vt({ts:l,zone:n,loc:r,o:d})}function op(e,t,n){const r=Lt(n.round)?!0:n.round,l=(f,p)=>(f=Hd(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 lp(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 ac,cc={};class vt{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=Ts(t.o)&&!t.old?t.o:n.offset(this.ts);l=rc(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 vt({})}static local(){const[t,n]=lp(arguments),[r,l,d,f,p,_,E]=n;return sp({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:E},t)}static utc(){const[t,n]=lp(arguments),[r,l,d,f,p,_,E]=n;return t.zone=vr.utcInstance,sp({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:E},t)}static fromJSDate(t,n={}){const r=Hx(t)?t.valueOf():NaN;if(Number.isNaN(r))return vt.invalid("invalid input");const l=Es(n.zone,Rn.defaultZone);return l.isValid?new vt({ts:r,zone:l,loc:un.fromObject(n)}):vt.invalid(na(l))}static fromMillis(t,n={}){if(Ts(t))return t<-864e13||t>sS?vt.invalid("Timestamp out of range"):new vt({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(Ts(t))return new vt({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 vt.invalid(na(r));const l=un.fromObject(n),d=yc(t,ip),{minDaysInFirstWeek:f,startOfWeek:p}=Yg(d,l),_=Rn.now(),E=Lt(n.specificOffset)?r.offset(_):n.specificOffset,T=!Lt(d.ordinal),S=!Lt(d.year),w=!Lt(d.month)||!Lt(d.day),M=S||w,m=d.weekYear||d.weekNumber;if((M||T)&&m)throw new Zo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&T)throw new Zo("Can't mix ordinal dates with month/day");const v=m||d.weekday&&!M;let I,G,P=rc(_,E);v?(I=aS,G=oS,P=mc(P,f,p)):T?(I=cS,G=lS,P=Fu(P)):(I=u_,G=c_);let k=!1;for(const H of I){const V=d[H];Lt(V)?k?d[H]=G[H]:d[H]=P[H]:k=!0}const W=v?$x(d,f,p):T?Fx(d):km(d),Y=W||Pm(d);if(Y)return vt.invalid(Y);const re=v?Ug(d,f,p):T?Gg(d):d,[te,ue]=lc(re,E,r),q=new vt({ts:te,zone:r,o:ue,loc:l});return d.weekday&&M&&t.weekday!==q.weekday?vt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${q.toISO()}`):q.isValid?q:vt.invalid(q.invalid)}static fromISO(t,n={}){const[r,l]=Av(t);return jo(r,l,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,l]=Mv(t);return jo(r,l,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,l]=Rv(t);return jo(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,_,E,T]=iS(f,t,n);return T?vt.invalid(T):jo(p,_,r,`format ${n}`,t,E)}static fromString(t,n,r={}){return vt.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,l]=Fv(t);return jo(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 ux(r);return new vt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=l_(t,un.fromObject(n));return r?r.map(l=>l?l.val:null).join(""):null}static expandFormat(t,n={}){return i_(_r.parseFormat(t),un.fromObject(n)).map(l=>l.val).join("")}static resetCache(){ac=void 0,cc={}}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?Wu(this).weekYear:NaN}get weekNumber(){return this.isValid?Wu(this).weekNumber:NaN}get weekday(){return this.isValid?Wu(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Ku(this).weekday:NaN}get localWeekNumber(){return this.isValid?Ku(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Ku(this).weekYear:NaN}get ordinal(){return this.isValid?Fu(this.c).ordinal:NaN}get monthShort(){return this.isValid?tc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?tc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?tc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?tc.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=wc(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,E=r-p*n,T=rc(_,f),S=rc(E,p);return T.hour===S.hour&&T.minute===S.minute&&T.second===S.second&&T.millisecond===S.millisecond?[eo(this,{ts:_}),eo(this,{ts:E})]:[this]}get isInLeapYear(){return da(this.year)}get daysInMonth(){return _c(this.year,this.month)}get daysInYear(){return this.isValid?Jo(this.year):NaN}get weeksInWeekYear(){return this.isValid?ca(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ca(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]=lc(f,d,t)}return eo(this,{ts:l,zone:t})}else return vt.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=yc(t,ip),{minDaysInFirstWeek:r,startOfWeek:l}=Yg(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),E=p||_,T=n.weekYear||n.weekNumber;if((E||f)&&T)throw new Zo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new Zo("Can't mix ordinal dates with month/day");let S;d?S=Ug({...mc(this.c,r,l),...n},r,l):Lt(n.ordinal)?(S={...this.toObject(),...n},Lt(n.day)&&(S.day=Math.min(_c(S.year,S.month),S.day))):S=Gg({...Fu(this.c),...n});const[w,M]=lc(S,this.o,this.zone);return eo(this,{ts:w,o:M})}plus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t);return eo(this,np(this,n))}minus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t).negate();return eo(this,np(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},l=en.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):Hu}toLocaleString(t=pc,n={}){return this.isValid?_r.create(this.loc.clone(n),t).formatDateTime(this):Hu}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=zu(this,f);return p+="T",p+=rp(this,f,n,r,l,d),p}toISODate({format:t="extended"}={}){return this.isValid?zu(this,t==="extended"):null}toISOWeekDate(){return ic(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":"")+rp(this,f==="extended",n,t,r,d):null}toRFC2822(){return ic(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ic(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?zu(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")),ic(this,l,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Hu}[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 en.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Wx(n).map(en.normalizeUnit),f=t.valueOf()>this.valueOf(),p=f?this:t,_=f?t:this,E=Gv(p,_,d,l);return f?E.negate():E}diffNow(t="milliseconds",n={}){return this.diff(vt.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||vt.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),op(n,this.plus(r),{...t,numeric:"always",units:l,unit:d})}toRelativeCalendar(t={}){return this.isValid?op(t.base||vt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(vt.isDateTime))throw new mr("min requires all arguments be DateTimes");return jg(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(vt.isDateTime))throw new mr("max requires all arguments be DateTimes");return jg(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 o_(f,t,n)}static fromStringExplain(t,n,r={}){return vt.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 s_(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:E,invalidReason:T}=n.explainFromTokens(t);return T?vt.invalid(T):jo(p,_,r,`format ${n.format}`,t,E)}static get DATE_SHORT(){return pc}static get DATE_MED(){return fm}static get DATE_MED_WITH_WEEKDAY(){return hx}static get DATE_FULL(){return hm}static get DATE_HUGE(){return gm}static get TIME_SIMPLE(){return pm}static get TIME_WITH_SECONDS(){return mm}static get TIME_WITH_SHORT_OFFSET(){return _m}static get TIME_WITH_LONG_OFFSET(){return ym}static get TIME_24_SIMPLE(){return Nm}static get TIME_24_WITH_SECONDS(){return Cm}static get TIME_24_WITH_SHORT_OFFSET(){return Em}static get TIME_24_WITH_LONG_OFFSET(){return Tm}static get DATETIME_SHORT(){return xm}static get DATETIME_SHORT_WITH_SECONDS(){return vm}static get DATETIME_MED(){return Sm}static get DATETIME_MED_WITH_SECONDS(){return wm}static get DATETIME_MED_WITH_WEEKDAY(){return gx}static get DATETIME_FULL(){return Om}static get DATETIME_FULL_WITH_SECONDS(){return Dm}static get DATETIME_HUGE(){return Am}static get DATETIME_HUGE_WITH_SECONDS(){return Mm}}function Xl(e){if(vt.isDateTime(e))return e;if(e&&e.valueOf&&Ts(e.valueOf()))return vt.fromJSDate(e);if(e&&typeof e=="object")return vt.fromObject(e);throw new mr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var Yt=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(Yt||{});function Ac(e){const t={1:Yt.Monday,2:Yt.Tuesday,3:Yt.Wednesday,4:Yt.Thursday,5:Yt.Friday,6:Yt.Saturday,7:Yt.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function lo(e){return{[Yt.Monday]:"Monday",[Yt.Tuesday]:"Tuesday",[Yt.Wednesday]:"Wednesday",[Yt.Thursday]:"Thursday",[Yt.Friday]:"Friday",[Yt.Saturday]:"Saturday",[Yt.Sunday]:"Sunday"}[e]}const ad=[Yt.Monday,Yt.Tuesday,Yt.Wednesday,Yt.Thursday,Yt.Friday,Yt.Saturday,Yt.Sunday],ra={[Yt.Monday]:"monday",[Yt.Tuesday]:"tuesday",[Yt.Wednesday]:"wednesday",[Yt.Thursday]:"thursday",[Yt.Friday]:"friday",[Yt.Saturday]:"saturday",[Yt.Sunday]:"sunday"};class Nc{constructor(t,n,r){Le(this,"end");Le(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(E=>{if(E.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(":").map(Number),[f,p]=n.end.split(":").map(Number);let _=0;f<l&&(_=1),this.end=this.end.set({hour:f,minute:p,day:this.end.day+_}),this.start=this.start.set({hour:l,minute: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).replace(" "," ")}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r).replace(" "," ")}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 d_{constructor(t,n){Le(this,"holidayHoursByDate");Le(this,"hours");Le(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;const n=t.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 Nc(r,d,this.timezone);if(f.contains(t))return f}}return null}getCurrentInterval(){return this.getInterval(vt.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!=null&&f.openIntervals&&!f.isClosed&&r.push(...f.openIntervals.map(p=>new Nc(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=lo(Ac(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(vt.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=vt.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(vt.now())}}function fS(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function hS(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 ga(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 pa(e){return!e.futureInterval}function gS(e){return ga(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):pa(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):nt.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function pS(e){return ga(e)||pa(e)?null:nt.jsx("span",{className:"HoursStatus-separator",children:" • "})}function mS(e){return ga(e)||pa(e)?null:nt.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function _S(e){if(ga(e)||pa(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 nt.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function yS(e){var r,l;if(ga(e)||pa(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 nt.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function NS(e,t){const n=e.currentTemplate||gS,r=e.separatorTemplate||pS,l=e.futureTemplate||mS,d=e.timeTemplate||_S,f=e.dayOfWeekTemplate||yS;return nt.jsxs("div",{className:ao("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),l(e),d(e),f(e)]})}const CS={minHeight:`${1.5}em`},ES=e=>{const[t,n]=rt.useState(!1),[r,l]=rt.useState(!1);if(rt.useEffect(()=>{l(!0)},[]),!e.hours)return nt.jsx(nt.Fragment,{});const d=e.statusTemplate||NS,f=new d_(e.hours,e.timezone),p=f.isOpenNow(),_=f.getCurrentInterval(),E=f.getNextInterval(),T=(_==null?void 0:_.end)||(E==null?void 0:E.start);if(T&&!t){n(!0);const w=T.toMillis()-vt.now().toMillis();setTimeout(()=>n(!1),w)}const S={isOpen:p,currentInterval:_,futureInterval:E,...e};return nt.jsx(nt.Fragment,{children:r?d(S,e):nt.jsx("div",{style:CS,className:ao("HoursStatus",(e==null?void 0:e.className)||"")})})};function TS(e,t){const n=[];return e.forEach(r=>{const l=n[n.length-1];l?hS(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&&ra[r.startDay]in t?t[ra[r.startDay]]||"":lo(r.startDay),d=t&&ra[r.endDay]in t?t[ra[r.endDay]]||"":lo(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${l}`:`${l} - ${d}`}})}function xS(e,t,n){const r=[],l=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?r.push((n==null?void 0:n.isClosed)||"Closed"):l?r.push((n==null?void 0:n.open24Hours)||"Open 24 hours"):e.intervals.forEach(d=>{const f=d.getStartTime((n==null?void 0:n.timeFormatLocale)||"en-US",t),p=d.getEndTime((n==null?void 0:n.timeFormatLocale)||"en-US",t);r.push(`${f} - ${p}`)}),r}function vS(e,t,n){const r=[];for(let l=1;l<=7;l++){const d=vt.fromObject({weekday:l}),f=Ac(d);r.push({startDay:f,endDay:f,dayName:n&&lo(f).toLowerCase()in n?n[lo(f).toLowerCase()]||"":lo(f),intervals:e.filter(p=>p.start.weekday===l),isToday:(t==null?void 0:t.weekday)===l})}return r}const SS=e=>{const[t,n]=rt.useState(!1);return rt.useEffect(()=>{n(!0)},[]),e.hours?nt.jsx(nt.Fragment,{children:t?nt.jsx(wS,{...e}):nt.jsx(OS,{...e})}):nt.jsx(nt.Fragment,{})},wS=e=>{const t=new d_(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),n=vt.now(),r=t.getIntervalsForNDays(7,n),l=vS(r,n,e.dayOfWeekNames);return nt.jsx(cd,{...e,hoursData:l,isClient:!0})},OS=e=>{var f;const{hours:t,dayOfWeekNames:n,intervalTranslations:r}=e,l=ad.map(p=>{var E,T;const _=ra[p];return{dayName:(n==null?void 0:n[_])||lo(p),startDay:p,endDay:p,isToday:!1,intervals:((T=(E=t[_])==null?void 0:E.openIntervals)==null?void 0:T.map(S=>new Nc(vt.now(),S,"UTC")))??[]}}),d=(f=t.holidayHours)==null?void 0:f.map(p=>{var T,S;const _=vt.fromFormat(p.date,"yyyy-MM-dd"),E=Ac(_);return{dayName:_.setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString(),isToday:!1,startDay:E,endDay:E,intervals:(p.isRegularHours?(T=p.openIntervals)==null?void 0:T.map(w=>new Nc(_,w,"UTC")):(S=l.find(w=>w.startDay===E))==null?void 0:S.intervals)??[]}});return nt.jsxs(nt.Fragment,{children:[nt.jsx(cd,{...e,hoursData:l,isClient:!1}),d&&d.length>0&&nt.jsx(cd,{...e,hoursData:d,isClient:!1,isHolidayHours:!0}),t.reopenDate&&nt.jsxs("div",{className:"HoursTable-row",children:[nt.jsx("span",{className:"HoursTable-day",children:(r==null?void 0:r.reopenDate)||"Reopen Date"}),nt.jsx("span",{className:"HoursTable-intervals",children:vt.fromFormat(t.reopenDate,"yyyy-MM-dd").setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString()})]})]})},cd=e=>{const{intervalStringsBuilderFn:t,className:n,timeOptions:r,intervalTranslations:l,dayOfWeekNames:d,startOfWeek:f,isClient:p,isHolidayHours:_}=e;let E=e.hoursData;function T(M){return M?{today:Ac(vt.now()),monday:Yt.Monday,tuesday:Yt.Tuesday,wednesday:Yt.Wednesday,thursday:Yt.Thursday,friday:Yt.Friday,saturday:Yt.Saturday,sunday:Yt.Sunday}[M]:Yt.Sunday}const S=ad.indexOf(T(p||f!=="today"?f:"sunday")),w=fS(ad,7-S);return _||(E.sort((M,m)=>w.indexOf(M.startDay)-w.indexOf(m.startDay)),e.collapseDays&&(E=TS(E,d))),nt.jsx("div",{className:ao("HoursTable",n),children:E.map(M=>{const v=(t||xS)(M,r,l);return nt.jsxs("div",{className:ao("HoursTable-row",{"is-today":M.isToday}),children:[nt.jsx("span",{className:"HoursTable-day",children:M.dayName}),nt.jsx("span",{className:"HoursTable-intervals",children:v.map((I,G)=>nt.jsx("span",{className:"HoursTable-interval",children:I},G))})]},M.dayName)})})},DS=e=>`<script type="application/ld+json">
|
|
110
110
|
${JSON.stringify(e)}
|
|
111
|
-
<\/script>`,Ac=(e,t)=>{if(!(!e.name||typeof e.name!="string"))return{"@context":"https://schema.org","@type":t,name:e.name}},wS=e=>typeof e!="object"?!1:!!e.name||!!e.address,OS=e=>typeof e!="object"?!1:!!e.line1||!!e.city||!!e.region||!!e.postalCode||!!e.countryCode,Kd=e=>OS(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},c_=e=>wS(e)&&{"@type":"Place",name:e.name,...Kd(e.address)},u_=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image&&typeof e.image.url=="string",Mc=e=>{if(!e)return{};const t=new Array;for(const n of e)u_(n)&&t.push(n.image.url);return{image:t}},DS=e=>u_(e)&&{image:e.image.url},AS=e=>typeof e!="object"?!1:!!e.name,MS=e=>Array.isArray(e)&&e.length>0,d_=e=>MS(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},f_=e=>AS(e)&&{organizer:{"@type":"Organization",name:e.name,...e.url&&{url:e.url}}},RS=["BackOrder","Discontinued","InStock","InStoreOnly","LimitedAvailability","MadeToOrder","OnlineOnly","OutOfStock","PreOrder","PreSale","Reserved","SoldOut"],bS=e=>typeof e!="object"?!1:"priceCurrency"in e&&"price"in e&&"availability"in e&&RS.includes(e.availability),zd=e=>bS(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},LS=(e,t)=>{const n=c_({name:e.geomodifier,address:e.address});return{...Ac(e,t??"Event"),...Mc(e.photoGallery),...n&&{location:n},...d_(e.performers),...f_({name:e.organizerName}),...zd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),...e.c_startDate&&{startDate:e.c_startDate},...e.c_endDate&&{endDate:e.c_endDate},...e.description&&{description:e.description},...e.attendance&&{eventAttendanceMode:e.attendance},...e.eventStatus&&{eventStatus:e.eventStatus}}},IS=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,kS=e=>typeof e!="object"?!1:e.isClosed?!0:"openIntervals"in e&&Array.isArray(e.openIntervals)&&e.openIntervals.length?e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,h_=e=>{if(!IS(e))return{};let t=new Map;t=eo(e.monday,t,"Mo"),t=eo(e.tuesday,t,"Tu"),t=eo(e.wednesday,t,"We"),t=eo(e.thursday,t,"Th"),t=eo(e.friday,t,"Fr"),t=eo(e.saturday,t,"Sa"),t=eo(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}},eo=(e,t,n)=>{if(!kS(e))return t;if(e.isClosed||!e.openIntervals){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},PS=(e,t)=>({...Ac(e,t??"LocalBusiness"),...Kd(e.address),...h_(e.hours),...Mc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),$S=e=>typeof e!="object"?!1:"ratingValue"in e,FS=e=>typeof e!="object"?!1:"ratingValue"in e&&"reviewCount"in e,g_=e=>$S(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},...e.author&&{author:{"@type":"Person",name:e.author}}}},p_=e=>FS(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,BS=(e,t)=>({...Ac(e,t??"Product"),...Mc(e.photoGallery),...g_(e.c_reviews),...p_(e.c_aggregateRating),...zd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),description:e.description,sku:e.sku,mpn:e.mpn,...e.brand&&{brand:{"@type":"Brand",name:e.brand}}}),HS=e=>!e||typeof e!="object"?!1:"question"in e&&"answer"in e,WS=e=>!e||typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function cd(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++)cd(e[n][r],t);else cd(e[n],t);else n==="text"&&t.push(e[n])}function m_(e){if(e.json){const t=[];return cd(e.json,t),t.join("")}return""}const KS=e=>{const t=e.map(n=>{if(HS(n)||WS(n))return{"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:"answer"in n?n.answer:m_(n.answerV2)}}}).filter(Boolean);if(t.length)return{"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t}},ud=Math.log2(1.6745627884839434),zS=4,US=19,dd="js-baidu-neg-lng-fix";let __;const GS=new Promise(e=>__=e),YS="https://api.map.baidu.com/geoconv/v1/";let Ql=[];const jS="gcj02ToBD09Callback_b872c21c";let VS=0,op;async function y_(e){return await new Promise((t,n)=>{Ql.push({coordinates:e,resolve:t,reject:n}),Ql.length===1&&(op=setTimeout(r,100)),Ql.length>40&&(clearTimeout(op),r());function r(){const l=Ql;Ql=[];const d=[].concat(...l.map(_=>_.coordinates)),f=jS+"_"+VS++,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(O=>O.reject(w))}const E=_.result.map(w=>new dn(w.y,w.x));let T=0;l.forEach(w=>{w.resolve(E.slice(T,T+=w.coordinates.length))}),delete window[f],(S=p.parentNode)==null||S.removeChild(p)},GS.then(_=>{const E={ak:_,callback:f,coords:d.map(T=>`${T.longitude},${T.latitude}`).join(";"),from:3,to:5};p.src=YS+"?"+Object.entries(E).map(([T,S])=>T+"="+S).join("&"),document.head.appendChild(p)})}})}class qS 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()-ud}setCenter(n,r){this._centerReady=y_([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+ud)},{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=y_([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"](dd)})}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?dd:""} ${this._wrapperClass}`}}const JS="https://api.map.baidu.com/getscript";function XS(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};__(d);const p=document.createElement("script");p.src=JS+"?"+Object.entries(f).map(([T,S])=>T+"="+S).join("&"),p.onload=()=>e(),document.head.appendChild(p);let _="";for(let T=zS;T<=US;T++){const S=2**(T-ud+7);_+=`[data-baidu-zoom="${T}"] .${dd}{transform:translateX(-${S}px);}`}const E=document.createElement("style");E.appendChild(document.createTextNode(_)),document.head.appendChild(E)}const QS=new ao().withLoadFunction(XS).withMapClass(qS).withPinClass(ZS).withProviderName("Baidu").build();let N_;function ew(){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))}}N_=e}class tw 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 N_(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 C_ 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(C_,"_pinId");const lp="BingMapsCallback_593d7d33",nw="https://www.bing.com/api/maps/mapcontrol";function rw(e,t,n,{params:r={}}={}){window[lp]=()=>{ew(),e()};const l={callback:lp,key:n,...r};mp(nw+"?"+Object.entries(l).map(([d,f])=>d+"="+f).join("&"))}const iw=new ao().withLoadFunction(rw).withMapClass(tw).withPinClass(C_).withProviderName("Bing").build();class sw 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 ow 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 lw(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 aw=new ao().withLoadFunction(lw).withMapClass(sw).withPinClass(ow).withProviderName("Mapbox").build();var so;let E_=(so=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=so.apiKey,this.map&&L.tileLayer(l,d).addTo(this.map)}},Ie(so,"apiKey"),so),cw=class extends _d{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 uw(e,t,n,{version:r="1.7.1"}={}){const l=`https://unpkg.com/leaflet@${r}/dist/leaflet`;E_.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 Ud=new ao().withLoadFunction(uw).withMapClass(E_).withPinClass(cw).withProviderName("Leaflet").build(),dw=Ud.getMapClass(),fw=Ud.getPinClass();class hw extends dw{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 gw extends fw{}function pw(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 mw=new ao().withLoadFunction(pw).withMapClass(hw).withPinClass(gw).withProviderName("MapQuest").build();exports.Address=fy;exports.AddressSchema=Kd;exports.AggregateRatingSchema=p_;exports.Analytics=fp;exports.AnalyticsContext=pd;exports.AnalyticsProvider=Jy;exports.AnalyticsScopeProvider=Xy;exports.BaiduMaps=QS;exports.BaseSchema=Ac;exports.BingMaps=iw;exports.Clusterer=$N;exports.Coordinate=dn;exports.Day=Yt;exports.Event=LS;exports.FAQPage=KS;exports.GoogleMaps=Np;exports.HoursStatus=yS;exports.HoursTable=TS;exports.Image=oN;exports.ImageLayoutOption=Es;exports.LeafletMaps=Ud;exports.LegacyRichText=ox;exports.LexicalRichText=yE;exports.Link=pp;exports.ListingPublisherOption=ap;exports.LocalBusiness=PS;exports.LocationMap=HN;exports.LocationSchema=c_;exports.Map=Tp;exports.MapProviderOption=Uu;exports.MapQuestMaps=mw;exports.MapboxMaps=aw;exports.Marker=Cd;exports.OfferSchema=zd;exports.OpeningHoursSchema=h_;exports.OrganizationSchema=f_;exports.PerformerSchema=d_;exports.PhotoGallerySchema=Mc;exports.PhotoSchema=DS;exports.Product=BS;exports.ReviewSchema=g_;exports.SchemaWrapper=SS;exports.asciiAlpha=DE;exports.asciiAlphanumeric=ed;exports.asciiAtext=AE;exports.asciiControl=ME;exports.asciiDigit=RE;exports.asciiHexDigit=bE;exports.asciiPunctuation=LE;exports.c=lo;exports.classifyCharacter=aa;exports.combineExtensions=jp;exports.createState=VT;exports.debuggingParamDetected=uc;exports.getDefaultExportFromCjs=hd;exports.getDirections=uy;exports.getRichTextContent=m_;exports.getRuntime=Qo;exports.jsxRuntimeExports=nt;exports.markdownLineEnding=IE;exports.markdownLineEndingOrSpace=em;exports.markdownSpace=kE;exports.normalizeUri=ol;exports.push=Vo;exports.resolveAll=tm;exports.splice=Cc;exports.useAnalytics=nl;exports.useClusterContext=PN;exports.useIdentify=tN;exports.useMapContext=IN;exports.usePageView=eN;exports.useScope=md;exports.useTrack=Qy;exports.visit=Ld;
|
|
111
|
+
<\/script>`,Mc=(e,t)=>{if(!(!e.name||typeof e.name!="string"))return{"@context":"https://schema.org","@type":t,name:e.name}},AS=e=>typeof e!="object"?!1:!!e.name||!!e.address,MS=e=>typeof e!="object"?!1:!!e.line1||!!e.city||!!e.region||!!e.postalCode||!!e.countryCode,Ud=e=>MS(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},f_=e=>AS(e)&&{"@type":"Place",name:e.name,...Ud(e.address)},h_=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image&&typeof e.image.url=="string",Rc=e=>{if(!e)return{};const t=new Array;for(const n of e)h_(n)&&t.push(n.image.url);return{image:t}},RS=e=>h_(e)&&{image:e.image.url},bS=e=>typeof e!="object"?!1:!!e.name,LS=e=>Array.isArray(e)&&e.length>0,g_=e=>LS(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},p_=e=>bS(e)&&{organizer:{"@type":"Organization",name:e.name,...e.url&&{url:e.url}}},IS=["BackOrder","Discontinued","InStock","InStoreOnly","LimitedAvailability","MadeToOrder","OnlineOnly","OutOfStock","PreOrder","PreSale","Reserved","SoldOut"],kS=e=>typeof e!="object"?!1:"priceCurrency"in e&&"price"in e&&"availability"in e&&IS.includes(e.availability),Gd=e=>kS(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},PS=(e,t)=>{const n=f_({name:e.geomodifier,address:e.address});return{...Mc(e,t??"Event"),...Rc(e.photoGallery),...n&&{location:n},...g_(e.performers),...p_({name:e.organizerName}),...Gd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),...e.c_startDate&&{startDate:e.c_startDate},...e.c_endDate&&{endDate:e.c_endDate},...e.description&&{description:e.description},...e.attendance&&{eventAttendanceMode:e.attendance},...e.eventStatus&&{eventStatus:e.eventStatus}}},$S=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,FS=e=>typeof e!="object"?!1:e.isClosed?!0:"openIntervals"in e&&Array.isArray(e.openIntervals)&&e.openIntervals.length?e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,m_=e=>{if(!$S(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(!FS(e))return t;if(e.isClosed||!e.openIntervals){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},BS=(e,t)=>({...Mc(e,t??"LocalBusiness"),...Ud(e.address),...m_(e.hours),...Rc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),HS=e=>typeof e!="object"?!1:"ratingValue"in e,WS=e=>typeof e!="object"?!1:"ratingValue"in e&&"reviewCount"in e,__=e=>HS(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},...e.author&&{author:{"@type":"Person",name:e.author}}}},y_=e=>WS(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,KS=(e,t)=>({...Mc(e,t??"Product"),...Rc(e.photoGallery),...__(e.c_reviews),...y_(e.c_aggregateRating),...Gd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),description:e.description,sku:e.sku,mpn:e.mpn,...e.brand&&{brand:{"@type":"Brand",name:e.brand}}}),zS=e=>!e||typeof e!="object"?!1:"question"in e&&"answer"in e,US=e=>!e||typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function ud(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++)ud(e[n][r],t);else ud(e[n],t);else n==="text"&&t.push(e[n])}function N_(e){if(e.json){const t=[];return ud(e.json,t),t.join("")}return""}const GS=e=>{const t=e.map(n=>{if(zS(n)||US(n))return{"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:"answer"in n?n.answer:N_(n.answerV2)}}}).filter(Boolean);if(t.length)return{"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t}},dd=Math.log2(1.6745627884839434),YS=4,jS=19,fd="js-baidu-neg-lng-fix";let C_;const VS=new Promise(e=>C_=e),qS="https://api.map.baidu.com/geoconv/v1/";let Ql=[];const ZS="gcj02ToBD09Callback_b872c21c";let JS=0,ap;async function E_(e){return await new Promise((t,n)=>{Ql.push({coordinates:e,resolve:t,reject:n}),Ql.length===1&&(ap=setTimeout(r,100)),Ql.length>40&&(clearTimeout(ap),r());function r(){const l=Ql;Ql=[];const d=[].concat(...l.map(_=>_.coordinates)),f=ZS+"_"+JS++,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 E=_.result.map(w=>new dn(w.y,w.x));let T=0;l.forEach(w=>{w.resolve(E.slice(T,T+=w.coordinates.length))}),delete window[f],(S=p.parentNode)==null||S.removeChild(p)},VS.then(_=>{const E={ak:_,callback:f,coords:d.map(T=>`${T.longitude},${T.latitude}`).join(";"),from:3,to:5};p.src=qS+"?"+Object.entries(E).map(([T,S])=>T+"="+S).join("&"),document.head.appendChild(p)})}})}class XS extends rl{constructor(n){super(n);Le(this,"_wrapper");Le(this,"map");Le(this,"_panStartHandler");Le(this,"_panHandler");Le(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()-dd}setCenter(n,r){this._centerReady=E_([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+dd)},{enableAnimation:r})})}}class QS extends il{constructor(n){super(n);Le(this,"_wrapper");Le(this,"_zIndex");Le(this,"_wrapperClass");Le(this,"_originalWrapperClass");Le(this,"_element");Le(this,"_coordinateReady");Le(this,"_negativeLngFix");Le(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);Le(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=E_([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"](fd)})}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?fd:""} ${this._wrapperClass}`}}const ew="https://api.map.baidu.com/getscript";function tw(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};C_(d);const p=document.createElement("script");p.src=ew+"?"+Object.entries(f).map(([T,S])=>T+"="+S).join("&"),p.onload=()=>e(),document.head.appendChild(p);let _="";for(let T=YS;T<=jS;T++){const S=2**(T-dd+7);_+=`[data-baidu-zoom="${T}"] .${fd}{transform:translateX(-${S}px);}`}const E=document.createElement("style");E.appendChild(document.createTextNode(_)),document.head.appendChild(E)}const nw=new co().withLoadFunction(tw).withMapClass(XS).withPinClass(QS).withProviderName("Baidu").build();let T_;function rw(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});Le(this,"_container");Le(this,"_pins");Le(this,"_viewChangeEventHandler");Le(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))}}T_=e}class iw extends rl{constructor(n){super(n);Le(this,"wrapper");Le(this,"map");Le(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 T_(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 x_ extends il{constructor(n){super(n);Le(this,"_location");Le(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}}Le(x_,"_pinId");const cp="BingMapsCallback_593d7d33",sw="https://www.bing.com/api/maps/mapcontrol";function ow(e,t,n,{params:r={}}={}){window[cp]=()=>{rw(),e()};const l={callback:cp,key:n,...r};Np(sw+"?"+Object.entries(l).map(([d,f])=>d+"="+f).join("&"))}const lw=new co().withLoadFunction(ow).withMapClass(iw).withPinClass(x_).withProviderName("Bing").build();class aw extends rl{constructor(n){var l,d,f,p;super(n);Le(this,"instance");Le(this,"map");const r=((l=n==null?void 0:n.iframeWindow)==null?void 0:l.mapboxgl)??Uu;if(r.accessToken=(n==null?void 0:n.apiKey)??"",this.instance=r,n.wrapper&&(this.map=new this.instance.Map({container:n.wrapper,interactive:n.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...n.providerOptions})),n.controlEnabled){const _=new this.instance.NavigationControl({showCompass:!1});(d=this.map)==null||d.addControl(_)}(f=this.map)==null||f.on("movestart",()=>this._panStartHandler()),(p=this.map)==null||p.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 this.instance.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 this.instance.LngLat(r.longitude,r.latitude);this.map&&this.map[l?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class cw extends il{constructor(n){super(n);Le(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new Uu.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new Uu.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 uw(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=()=>{e()},document.head.appendChild(d),document.head.appendChild(f)}const dw=new co().withLoadFunction(uw).withMapClass(aw).withPinClass(cw).withProviderName("Mapbox").build();var oo;let v_=(oo=class extends rl{constructor(n){var r,l,d;super(n);Le(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)}},Le(oo,"apiKey"),oo),fw=class extends Nd{constructor(n){super(n);Le(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 hw(e,t,n,{version:r="1.7.1"}={}){const l=`https://unpkg.com/leaflet@${r}/dist/leaflet`;v_.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 Yd=new co().withLoadFunction(hw).withMapClass(v_).withPinClass(fw).withProviderName("Leaflet").build(),gw=Yd.getMapClass(),pw=Yd.getPinClass();class mw extends gw{constructor(){super(...arguments);Le(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 _w extends pw{}function yw(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 Nw=new co().withLoadFunction(yw).withMapClass(mw).withPinClass(_w).withProviderName("MapQuest").build();exports.Address=py;exports.AddressSchema=Ud;exports.AggregateRatingSchema=y_;exports.Analytics=gp;exports.AnalyticsContext=md;exports.AnalyticsProvider=eN;exports.AnalyticsScopeProvider=tN;exports.BaiduMaps=nw;exports.BaseSchema=Mc;exports.BingMaps=lw;exports.Clusterer=HN;exports.Coordinate=dn;exports.Day=Yt;exports.Event=PS;exports.FAQPage=GS;exports.GoogleMaps=Tp;exports.HoursStatus=ES;exports.HoursTable=SS;exports.Image=cN;exports.ImageLayoutOption=Qi;exports.LeafletMaps=Yd;exports.LegacyRichText=cx;exports.LexicalRichText=EE;exports.Link=yp;exports.ListingPublisherOption=up;exports.LocalBusiness=BS;exports.LocationMap=zN;exports.LocationSchema=f_;exports.Map=Sp;exports.MapProviderOption=Yu;exports.MapQuestMaps=Nw;exports.MapboxMaps=dw;exports.Marker=Td;exports.OfferSchema=Gd;exports.OpeningHoursSchema=m_;exports.OrganizationSchema=p_;exports.PerformerSchema=g_;exports.PhotoGallerySchema=Rc;exports.PhotoSchema=RS;exports.Product=KS;exports.ReviewSchema=__;exports.SchemaWrapper=DS;exports.asciiAlpha=RE;exports.asciiAlphanumeric=td;exports.asciiAtext=bE;exports.asciiControl=LE;exports.asciiDigit=IE;exports.asciiHexDigit=kE;exports.asciiPunctuation=PE;exports.c=ao;exports.classifyCharacter=aa;exports.combineExtensions=Zp;exports.createState=JT;exports.debuggingParamDetected=uc;exports.getDefaultExportFromCjs=gd;exports.getDirections=hy;exports.getImageUrl=dc;exports.getRichTextContent=N_;exports.getRuntime=Qo;exports.jsxRuntimeExports=nt;exports.markdownLineEnding=$E;exports.markdownLineEndingOrSpace=rm;exports.markdownSpace=FE;exports.normalizeUri=ol;exports.push=Vo;exports.resolveAll=im;exports.splice=Ec;exports.useAnalytics=nl;exports.useClusterContext=BN;exports.useIdentify=iN;exports.useMapContext=$N;exports.usePageView=rN;exports.useScope=_d;exports.useTrack=nN;exports.visit=kd;
|