@yext/pages-components 1.1.17 → 1.1.18
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-CvvqHRnJ.cjs → debugger-Ejo7K3er.cjs} +1 -1
- package/dist/{debugger-BsVvVLeg.js → debugger-cNF2RtP0.js} +1 -1
- package/dist/{index-DCXDGjOS.cjs → index-AuG-nSQo.cjs} +45 -45
- package/dist/{index-Dfylohx7.js → index-BhuWbpr2.js} +1 -1
- package/dist/{index-GjPmS5iw.cjs → index-BmUaz3pT.cjs} +1 -1
- package/dist/{index-AcuvLLAS.js → index-BzmYxqad.js} +1723 -1680
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/pages-components.cjs +1 -1
- package/dist/pages-components.js +26 -25
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Xm=Object.defineProperty;var Qm=(e,t,n)=>t in e?Xm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ke=(e,t,n)=>Qm(e,typeof t!="symbol"?t+"":t,n);const yt=require("react"),e_=require("react-dom"),gu=require("mapbox-gl");function t_(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 n_=t_(yt);var Hd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pu={exports:{}},Hl={};/**
|
|
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 Wd;function
|
|
9
|
+
*/var Wd;function r_(){if(Wd)return Hl;Wd=1;var e=yt,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,c=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function g(m,N,T){var R,b={},k=null,z=null;T!==void 0&&(k=""+T),N.key!==void 0&&(k=""+N.key),N.ref!==void 0&&(z=N.ref);for(R in N)r.call(N,R)&&!d.hasOwnProperty(R)&&(b[R]=N[R]);if(m&&m.defaultProps)for(R in N=m.defaultProps,N)b[R]===void 0&&(b[R]=N[R]);return{$$typeof:t,type:m,key:k,ref:z,props:b,_owner:c.current}}return Hl.Fragment=n,Hl.jsx=g,Hl.jsxs=g,Hl}var Wl={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
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 Kd;function
|
|
17
|
+
*/var Kd;function i_(){return Kd||(Kd=1,process.env.NODE_ENV!=="production"&&function(){var e=yt,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),m=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),E=Symbol.iterator,x="@@iterator";function U(pe){if(pe===null||typeof pe!="object")return null;var Ze=E&&pe[E]||pe[x];return typeof Ze=="function"?Ze:null}var Q=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function F(pe){{for(var Ze=arguments.length,ot=new Array(Ze>1?Ze-1:0),wt=1;wt<Ze;wt++)ot[wt-1]=arguments[wt];W("error",pe,ot)}}function W(pe,Ze,ot){{var wt=Q.ReactDebugCurrentFrame,Gt=wt.getStackAddendum();Gt!==""&&(Ze+="%s",ot=ot.concat([Gt]));var Bt=ot.map(function(Pt){return String(Pt)});Bt.unshift("Warning: "+Ze),Function.prototype.apply.call(console[pe],console,Bt)}}var G=!1,q=!1,le=!1,se=!1,ge=!1,j;j=Symbol.for("react.module.reference");function B(pe){return!!(typeof pe=="string"||typeof pe=="function"||pe===r||pe===d||ge||pe===c||pe===T||pe===R||se||pe===z||G||q||le||typeof pe=="object"&&pe!==null&&(pe.$$typeof===k||pe.$$typeof===b||pe.$$typeof===g||pe.$$typeof===m||pe.$$typeof===N||pe.$$typeof===j||pe.getModuleId!==void 0))}function V(pe,Ze,ot){var wt=pe.displayName;if(wt)return wt;var Gt=Ze.displayName||Ze.name||"";return Gt!==""?ot+"("+Gt+")":ot}function xe(pe){return pe.displayName||"Context"}function we(pe){if(pe==null)return null;if(typeof pe.tag=="number"&&F("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 c:return"StrictMode";case T:return"Suspense";case R:return"SuspenseList"}if(typeof pe=="object")switch(pe.$$typeof){case m:var Ze=pe;return xe(Ze)+".Consumer";case g:var ot=pe;return xe(ot._context)+".Provider";case N:return V(pe,pe.render,"ForwardRef");case b:var wt=pe.displayName||null;return wt!==null?wt:we(pe.type)||"Memo";case k:{var Gt=pe,Bt=Gt._payload,Pt=Gt._init;try{return we(Pt(Bt))}catch{return null}}}return null}var Ee=Object.assign,ue=0,$,S,Y,ie,K,P,Z;function O(){}O.__reactDisabledLog=!0;function H(){{if(ue===0){$=console.log,S=console.info,Y=console.warn,ie=console.error,K=console.group,P=console.groupCollapsed,Z=console.groupEnd;var pe={configurable:!0,enumerable:!0,value:O,writable:!0};Object.defineProperties(console,{info:pe,log:pe,warn:pe,error:pe,group:pe,groupCollapsed:pe,groupEnd:pe})}ue++}}function J(){{if(ue--,ue===0){var pe={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ee({},pe,{value:$}),info:Ee({},pe,{value:S}),warn:Ee({},pe,{value:Y}),error:Ee({},pe,{value:ie}),group:Ee({},pe,{value:K}),groupCollapsed:Ee({},pe,{value:P}),groupEnd:Ee({},pe,{value:Z})})}ue<0&&F("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=Q.ReactCurrentDispatcher,_e;function I(pe,Ze,ot){{if(_e===void 0)try{throw Error()}catch(Gt){var wt=Gt.stack.trim().match(/\n( *(at )?)/);_e=wt&&wt[1]||""}return`
|
|
18
18
|
`+_e+pe}}var w=!1,D;{var re=typeof WeakMap=="function"?WeakMap:Map;D=new re}function ye(pe,Ze){if(!pe||w)return"";{var ot=D.get(pe);if(ot!==void 0)return ot}var wt;w=!0;var Gt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Bt;Bt=de.current,de.current=null,H();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(dn){wt=dn}Reflect.construct(pe,[],Pt)}else{try{Pt.call()}catch(dn){wt=dn}pe.call(Pt.prototype)}}else{try{throw Error()}catch(dn){wt=dn}pe()}}catch(dn){if(dn&&wt&&typeof dn.stack=="string"){for(var Lt=dn.stack.split(`
|
|
19
19
|
`),Ht=wt.stack.split(`
|
|
20
20
|
`),sn=Lt.length-1,ln=Ht.length-1;sn>=1&&ln>=0&&Lt[sn]!==Ht[ln];)ln--;for(;sn>=1&&ln>=0;sn--,ln--)if(Lt[sn]!==Ht[ln]){if(sn!==1||ln!==1)do if(sn--,ln--,ln<0||Lt[sn]!==Ht[ln]){var Rn=`
|
|
@@ -22,58 +22,58 @@
|
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+pe+"`."}return""}}function Et(pe){return""}var ht={};function xt(pe){{var Ze=Nt();if(!Ze){var ot=typeof pe=="string"?pe:pe.displayName||pe.name;ot&&(Ze=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+ot+">.")}return Ze}}function pt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var ot=xt(Ze);if(ht[ot])return;ht[ot]=!0;var wt="";pe&&pe._owner&&pe._owner!==vt.current&&(wt=" It was passed a child from "+we(pe._owner.type)+"."),ze(pe),F('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ot,wt),ze(null)}}function $t(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var ot=0;ot<pe.length;ot++){var wt=pe[ot];_t(wt)&&pt(wt,Ze)}else if(_t(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Gt=U(pe);if(typeof Gt=="function"&&Gt!==pe.entries)for(var Bt=Gt.call(pe),Pt;!(Pt=Bt.next()).done;)_t(Pt.value)&&pt(Pt.value,Ze)}}}function Kt(pe){{var Ze=pe.type;if(Ze==null||typeof Ze=="string")return;var ot;if(typeof Ze=="function")ot=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===N||Ze.$$typeof===b))ot=Ze.propTypes;else return;if(ot){var wt=we(Ze);Le(ot,pe.props,"prop",wt,pe)}else if(Ze.PropTypes!==void 0&&!tt){tt=!0;var Gt=we(Ze);F("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Gt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&F("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function tn(pe){{for(var Ze=Object.keys(pe.props),ot=0;ot<Ze.length;ot++){var wt=Ze[ot];if(wt!=="children"&&wt!=="key"){ze(pe),F("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),F("Invalid attribute `ref` supplied to `React.Fragment`."),ze(null))}}var It={};function jt(pe,Ze,ot,wt,Gt,Bt){{var Pt=B(pe);if(!Pt){var Lt="";(pe===void 0||typeof pe=="object"&&pe!==null&&Object.keys(pe).length===0)&&(Lt+=" 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?Lt+=Ht:Lt+=Nt();var sn;pe===null?sn="null":qe(pe)?sn="array":pe!==void 0&&pe.$$typeof===t?(sn="<"+(we(pe.type)||"Unknown")+" />",Lt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof pe,F("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,Lt)}var ln=st(pe,Ze,ot,Gt,Bt);if(ln==null)return ln;if(Pt){var Rn=Ze.children;if(Rn!==void 0)if(wt)if(qe(Rn)){for(var mr=0;mr<Rn.length;mr++)$t(Rn[mr],pe);Object.freeze&&Object.freeze(Rn)}else F("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(Rn,pe)}if(ce.call(Ze,"key")){var jn=we(pe),dn=Object.keys(Ze).filter(function(
|
|
25
|
+
Check the top-level render call using <`+ot+">.")}return Ze}}function pt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var ot=xt(Ze);if(ht[ot])return;ht[ot]=!0;var wt="";pe&&pe._owner&&pe._owner!==vt.current&&(wt=" It was passed a child from "+we(pe._owner.type)+"."),ze(pe),F('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ot,wt),ze(null)}}function $t(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var ot=0;ot<pe.length;ot++){var wt=pe[ot];_t(wt)&&pt(wt,Ze)}else if(_t(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Gt=U(pe);if(typeof Gt=="function"&&Gt!==pe.entries)for(var Bt=Gt.call(pe),Pt;!(Pt=Bt.next()).done;)_t(Pt.value)&&pt(Pt.value,Ze)}}}function Kt(pe){{var Ze=pe.type;if(Ze==null||typeof Ze=="string")return;var ot;if(typeof Ze=="function")ot=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===N||Ze.$$typeof===b))ot=Ze.propTypes;else return;if(ot){var wt=we(Ze);Le(ot,pe.props,"prop",wt,pe)}else if(Ze.PropTypes!==void 0&&!tt){tt=!0;var Gt=we(Ze);F("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Gt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&F("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function tn(pe){{for(var Ze=Object.keys(pe.props),ot=0;ot<Ze.length;ot++){var wt=Ze[ot];if(wt!=="children"&&wt!=="key"){ze(pe),F("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),F("Invalid attribute `ref` supplied to `React.Fragment`."),ze(null))}}var It={};function jt(pe,Ze,ot,wt,Gt,Bt){{var Pt=B(pe);if(!Pt){var Lt="";(pe===void 0||typeof pe=="object"&&pe!==null&&Object.keys(pe).length===0)&&(Lt+=" 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?Lt+=Ht:Lt+=Nt();var sn;pe===null?sn="null":qe(pe)?sn="array":pe!==void 0&&pe.$$typeof===t?(sn="<"+(we(pe.type)||"Unknown")+" />",Lt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof pe,F("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,Lt)}var ln=st(pe,Ze,ot,Gt,Bt);if(ln==null)return ln;if(Pt){var Rn=Ze.children;if(Rn!==void 0)if(wt)if(qe(Rn)){for(var mr=0;mr<Rn.length;mr++)$t(Rn[mr],pe);Object.freeze&&Object.freeze(Rn)}else F("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(Rn,pe)}if(ce.call(Ze,"key")){var jn=we(pe),dn=Object.keys(Ze).filter(function(Ai){return Ai!=="key"}),rr=dn.length>0?"{key: someKey, "+dn.join(": ..., ")+": ...}":"{key: someKey}";if(!It[jn+rr]){var ir=dn.length>0?"{"+dn.join(": ..., ")+": ...}":"{}";F(`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} />`,rr,jn,ir,jn),It[jn+rr]=!0}}return pe===r?tn(ln):Kt(ln),ln}}function bt(pe,Ze,ot){return jt(pe,Ze,ot,!0)}function nn(pe,Ze,ot){return jt(pe,Ze,ot,!1)}var Sr=nn,pi=bt;Wl.Fragment=r,Wl.jsx=Sr,Wl.jsxs=pi}()),Wl}process.env.NODE_ENV==="production"?pu.exports=n_():pu.exports=r_();var nt=pu.exports;function i_(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 ag={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},mu={GOOGLE:"google",APPLE:"apple",BING:"bing"},s_=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},o_=(e,t=[],n,r={route:!1},c)=>{const d="Failed to construct query for maps service.";let g=e&&Yd([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case mu.APPLE:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return zd(`${c.latitude},${c.longitude}`,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return zd(g,r.route)}case mu.BING:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return Ud(`${c.latitude},${c.longitude}`,r.route);if(g=e&&Yd([e.line1,e.city,e.region,e.postalCode]),!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Ud(g,r.route)}default:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return Gd(`${c.latitude},${c.longitude}`,r.route);const m=t.find(N=>{var T;return((T=N==null?void 0:N.publisher)==null?void 0:T.toUpperCase())===ag.GOOGLEMYBUSINESS});if(m!=null&&m.listingUrl)return m.listingUrl;if(n)return l_(n,g,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return Gd(g,r.route)}}},zd=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,Ud=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,l_=(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`},Gd=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,Yd=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},a_=({address:e,lines:t,separator:n=",",...r})=>{const c=(t||i_(e.countryCode)).map(d=>nt.jsx(c_,{address:e,line:d,separator:n},d.toString()));return yt.createElement("div",{...r,key:e.toString()},c)},c_=({address:e,line:t,separator:n})=>{const r=[];let c=0;for(const d of t){if(d===","){r.push(nt.jsx("span",{children:n},`separator-${c++}`));continue}const g=e[d];if(!g)continue;const m=s_(d,e);if(m){r.push(nt.jsxs(t_.Fragment,{children:[" ",nt.jsx("abbr",{title:m,children:g})]},d));continue}r.push(nt.jsx("span",{children:" "+g},d))}return nt.jsx("div",{className:"address-line",children:r})};var Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});var u_=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},d_=typeof window<"u"&&typeof window.document<"u",f_=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,h_=(typeof self>"u"?"undefined":u_(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",g_=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),p_=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",jd=Zo.isBrowser=d_;Zo.isWebWorker=h_;var m_=Zo.isNode=f_;Zo.isJsDom=g_;var __=Zo.isDeno=p_;class y_{constructor(){ke(this,"name");ke(this,"isServerSide");ke(this,"version");var t;__?(this.name="deno",this.version="",jd&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):m_?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):jd?(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 Vo=()=>new y_,N_=(...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 Gc(e){if(!Ku(e))throw new Error("Parameter was not an error")}function Ku(e){return!!e&&typeof e=="object"&&C_(e)==="[object Error]"||e instanceof Error}function C_(e){return Object.prototype.toString.call(e)}const E_="Layerr";let T_=E_;function x_(){return T_}function S_(e){let t,n="";if(e.length===0)t={};else if(Ku(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 wi extends Error{constructor(t,n){const r=[...arguments],{options:c,shortMessage:d}=S_(r);let g=d;if(c.cause&&(g=`${g}: ${c.cause.message}`),super(g),this.message=g,c.name&&typeof c.name=="string"?this.name=c.name:this.name=x_(),c.cause&&Object.defineProperty(this,"_cause",{value:c.cause}),Object.defineProperty(this,"_info",{value:{}}),c.info&&typeof c.info=="object"&&Object.assign(this._info,c.info),Error.captureStackTrace){const m=c.constructorOpt||this.constructor;Error.captureStackTrace(this,m)}}static cause(t){return Gc(t),t._cause&&Ku(t._cause)?t._cause:null}static fullStack(t){Gc(t);const n=wi.cause(t);return n?`${t.stack}
|
|
31
|
-
caused by: ${
|
|
32
|
-
`,t),null}}const L_="1.0.0",Zd={version:L_};function P_(e,t,n){return n.debug?(ug(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function $_(e,t,n){return n.debug?(ug(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function F_(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function ug(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 _u=function(){return _u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c])}return e},_u.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 c=t[r];c==null?delete n[r]:typeof c!="object"?n[r]=c:n[r]=yu(n[r],c)}return _u({},n)},B_="yextevents.com/accounts/me/events";function H_(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")+"."+B_}var W_=function(e,t,n,r){function c(d){return d instanceof n?d:new n(function(g){g(d)})}return new(n||(n=Promise))(function(d,g){function m(R){try{T(r.next(R))}catch(b){g(b)}}function N(R){try{T(r.throw(R))}catch(b){g(b)}}function T(R){R.done?d(R.value):c(R.value).then(m,N)}T((r=r.apply(e,t||[])).next())})},K_=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,c,d,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(T){return function(R){return N([T,R])}}function N(T){if(r)throw new TypeError("Generator is already executing.");for(;g&&(g=0,T[0]&&(n=0)),n;)try{if(r=1,c&&(d=T[0]&2?c.return:T[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,T[1])).done)return d;switch(c=0,d&&(T=[T[0]&2,d.value]),T[0]){case 0:case 1:d=T;break;case 4:return n.label++,{value:T[1],done:!1};case 5:n.label++,c=T[1],T=[0];continue;case 7:T=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){n=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){n.label=T[1];break}if(T[0]===6&&n.label<d[1]){n.label=d[1],d=T;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(T);break}d[2]&&n.ops.pop(),n.trys.pop();continue}T=t.call(e,n)}catch(R){T=[6,R],c=0}finally{r=d=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},z_=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 W_(this,void 0,void 0,function(){var r,c,d,g,m=this;return K_(this,function(N){return r=yu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=I_()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Zd.version:r.clientSdk=(g={},g.ANALYTICS=Zd.version,g),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,c=F_(r,this.config.forceFetch),d=H_(this.config.env,this.config.region),c?[2,new Promise(function(T,R){P_(d,r,m.config)?T(""):R("Failed Beacon Call")})]:[2,$_(d,r,this.config).then(function(T){return T}).catch(function(T){return T})]})})},e}();function U_(e){return new z_(e)}function Nu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function dg(e,t){return[e,t].filter(n=>!!n).map(n=>Nu(n)).join("_")}const G_=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},zu=yt.createContext(null),Y_=yt.lazy(()=>Promise.resolve().then(()=>require("./debugger-CvvqHRnJ.cjs")));function j_(e){const{children:t,apiKey:n,currency:r,templateData:c,requireOptIn:d,disableSessionTracking:g,enableDebugging:m,productionDomains:N}=e;if(!n)throw new Error("API Key is required for AnalyticsProvider");const T=yt.useRef(null),[R,b]=yt.useState(!1);yt.useEffect(()=>{b(!0)},[]),T.current===null&&(T.current=new fg(n,r,c,d,g,N,m??rc()));const k=T.current;return yt.useEffect(()=>(window.enableYextAnalytics=()=>{k.optIn()},()=>{delete window.enableYextAnalytics}),[k]),nt.jsxs(nt.Fragment,{children:[nt.jsx(zu.Provider,{value:k,children:t}),R&&(m||rc())&&Vo().name==="browser"?nt.jsx(yt.Suspense,{fallback:nt.jsx(nt.Fragment,{}),children:nt.jsx(Y_,{})}):null]})}function rc(){return Vo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class fg{constructor(t,n,r,c,d,g,m=!1){ke(this,"_optedIn");ke(this,"_sessionTrackingEnabled");ke(this,"_analyticsEventService");ke(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.productionDomains=g,this.enableDebugging=m,this._optedIn=!c,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Vo().name!=="browser"||!this._optedIn)return;if(!N_(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=G_(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=U_(n).with(r)}canTrack(){return Vo().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 b;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:c,currency:d,amount:g,destinationUrl:m,customTags:N,customValues:T}=t;let R;g&&(R={amount:g,currency:d||this.defaultCurrency}),await((b=this._analyticsEventService)==null?void 0:b.report({action:n,pages:{scope:Nu(r)||void 0,originalEventName:dg(r||"",Nu(c)||"")},value:R,destinationUrl:m||void 0,customTags:N,customValues:T}))}getDebugEnabled(){return this.enableDebugging||rc()}}const Cu=yt.createContext({name:""}),Uu=()=>yt.useContext(Cu).name;function V_(e){var g;const t=Uu(),[n]=yt.useState({name:dg(t,e.name)}),r=(g=Jo())==null?void 0:g.getDebugEnabled(),[c,d]=yt.useState(!1);return yt.useEffect(()=>{d(!0)},[]),r&&c?nt.jsx("section",{"data-ya-scope":n.name,children:nt.jsx(Cu.Provider,{value:n,children:e.children})}):nt.jsx(Cu.Provider,{value:n,children:e.children})}function Jo(){const e=yt.useContext(zu);if(!e)return e;Vo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=Uu();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 q_=()=>{var e;return(e=Jo())==null?void 0:e.track},Z_=()=>{var e;return(e=Jo())==null?void 0:e.pageView},J_=()=>{var e;return(e=Jo())==null?void 0:e.identify},Zi={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},X_=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 c=e.pathname.replace(/^\//,"").split("/");if(c.length<2||c.length>3){console.error(`Invalid path: ${e}`);return}let d;if(c[0]==="f")d="prod";else switch(c[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 g;if(c.length===3&&(g=parseInt(c[1]),Number.isNaN(g))){console.error(`Invalid account id: ${e}`);return}const m=c[c.length-1].split("."),N=m.length===2?`.${m[1]}`:"",T=m[0];return{scheme:t,partition:r,env:d,accountId:g,contentHash:T,extension:N}},Q_=(e,t,n,r)=>{const c=`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 g=e.accountId!==void 0?`${e.accountId}/`:"",m=gg(r);return`${c}/${d}/${g}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}${m}`},ey=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 c=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 g=n[n.length-1].split("."),m=g.length===2?`.${g[1]}`:"",N=g[0];return{scheme:t,env:r,contentHash:c,aspectRatio:d,name:N,extension:m}},ty=(e,t,n,r)=>{const c="https://dyn.mktgcdn.com";let d="p";switch(e.env){case"prod":break;case"sbx":{d+="-sandbox";break}default:d+=`-${e.env.toString()}`}const g=gg(r);return`${c}/${d}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}${g}`},ny=e=>e.endsWith(".mktgcdn.com")||e==="mktgcdn.com",ic=(e,t,n,r)=>{if(!hg(e)){console.error(`Invalid image url: ${e}.`);return}const c=new URL(e);if(!ny(c.hostname))return e;if(c.pathname.startsWith("/p")){const d=ey(c);if(d)return ty(d,t,n,r)}else if(c.pathname.startsWith("/f")){const d=X_(c);if(d)return Q_(d,t,n,r)}return e},hg=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},gg=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}`:""},ry=({image:e,className:t,width:n,height:r,aspectRatio:c,layout:d=Zi.INTRINSIC,placeholder:g,imgOverrides:m,style:N={},imageTransformations:T,loading:R="lazy"})=>{const b=yt.useRef(null),[k,z]=yt.useState(!1),E="image"in e?e.image:e;yt.useEffect(()=>{var B;(B=b.current)!=null&&B.complete&&z(!0)},[]),iy(d,E.width,E.height,n,r,c);const x=Math.abs(E.width);x||console.warn("Invalid image width.");const U=Math.abs(E.height);if(U||console.warn("Invalid image height."),!hg(E.url))return console.error(`Invalid image url: ${E.url}`),nt.jsx(nt.Fragment,{children:g!=null&&g});const Q=n&&n>0?n:void 0,F=r&&r>0?r:void 0,{src:W,imgStyle:G,widths:q,updatedImageTransformations:le}=sy(d,x,U,N,E.url,Q,F,c,T),se=q.map(B=>`${ic(E.url,B,(d===Zi.ASPECT&&c?1/c:U/x)*B,le)} ${B}w`).join(", "),ge=[640,768,1024,1280,1536],j=q.map((B,V)=>V===q.length-1?`${B}px`:`(max-width: ${ge[V]}px) ${B}px`).join(", ");return nt.jsxs(nt.Fragment,{children:[!k&&g!=null&&g,nt.jsx("img",{ref:b,style:G,src:W,className:t,width:Q,height:F,srcSet:se,sizes:j,loading:R,alt:E.alternateText||"",...m})]})},iy=(e,t,n,r,c,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Zi.FIXED){if(!r&&!c){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}.`),c&&c<0&&console.warn(`Using fixed layout but height is invalid: ${c}.`);return}(r||c)&&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===Zi.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},sy=(e,t,n,r,c,d,g,m,N)=>{let T=[100,320,640,960,1280,1920],R=ic(c,500,m?500/m:500,N);const b={...r},k=N?{...N}:{};switch(b.objectFit=b.objectFit||"cover",b.objectPosition=b.objectPosition||"center",e){case Zi.INTRINSIC:b.maxWidth=t,b.width="100%",b.aspectRatio=m?`${m}`:`${t} / ${n}`;break;case Zi.FIXED:{const{fixedWidth:z,fixedHeight:E,fixedWidths:x}=oy(t,n,T,d,g);b.width=z,b.height=E,T=x,R=ic(c,z,E,k);break}case Zi.ASPECT:b.aspectRatio=m?`${m}`:`${t} / ${n}`,k&&(k.fit=(k==null?void 0:k.fit)||"cover");break;case Zi.FILL:b.width="100%",b.aspectRatio=m?`${m}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:R,imgStyle:b,widths:T,updatedImageTransformations:k}},oy=(e,t,n,r,c)=>r&&c?{fixedWidth:r,fixedHeight:c,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:c?{fixedWidth:c/t*e,fixedHeight:c,fixedWidths:[c/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var pg={exports:{}};/*!
|
|
30
|
+
<%s key={someKey} {...props} />`,rr,jn,ir,jn),It[jn+rr]=!0}}return pe===r?tn(ln):Kt(ln),ln}}function bt(pe,Ze,ot){return jt(pe,Ze,ot,!0)}function nn(pe,Ze,ot){return jt(pe,Ze,ot,!1)}var Sr=nn,mi=bt;Wl.Fragment=r,Wl.jsx=Sr,Wl.jsxs=mi}()),Wl}process.env.NODE_ENV==="production"?pu.exports=r_():pu.exports=i_();var nt=pu.exports;function s_(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 ag={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},mu={GOOGLE:"google",APPLE:"apple",BING:"bing"},o_=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},l_=(e,t=[],n,r={route:!1},c)=>{const d="Failed to construct query for maps service.";let g=e&&Yd([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case mu.APPLE:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return zd(`${c.latitude},${c.longitude}`,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return zd(g,r.route)}case mu.BING:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return Ud(`${c.latitude},${c.longitude}`,r.route);if(g=e&&Yd([e.line1,e.city,e.region,e.postalCode]),!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Ud(g,r.route)}default:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return Gd(`${c.latitude},${c.longitude}`,r.route);const m=t.find(N=>{var T;return((T=N==null?void 0:N.publisher)==null?void 0:T.toUpperCase())===ag.GOOGLEMYBUSINESS});if(m!=null&&m.listingUrl)return m.listingUrl;if(n)return a_(n,g,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return Gd(g,r.route)}}},zd=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,Ud=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,a_=(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`},Gd=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,Yd=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},c_=({address:e,lines:t,separator:n=",",...r})=>{const c=(t||s_(e.countryCode)).map(d=>nt.jsx(u_,{address:e,line:d,separator:n},d.toString()));return yt.createElement("div",{...r,key:e.toString()},c)},u_=({address:e,line:t,separator:n})=>{const r=[];let c=0;for(const d of t){if(d===","){r.push(nt.jsx("span",{children:n},`separator-${c++}`));continue}const g=e[d];if(!g)continue;const m=o_(d,e);if(m){r.push(nt.jsxs(n_.Fragment,{children:[" ",nt.jsx("abbr",{title:m,children:g})]},d));continue}r.push(nt.jsx("span",{children:" "+g},d))}return nt.jsx("div",{className:"address-line",children:r})};var Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});var d_=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},f_=typeof window<"u"&&typeof window.document<"u",h_=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,g_=(typeof self>"u"?"undefined":d_(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",p_=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),m_=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",jd=Zo.isBrowser=f_;Zo.isWebWorker=g_;var __=Zo.isNode=h_;Zo.isJsDom=p_;var y_=Zo.isDeno=m_;class N_{constructor(){ke(this,"name");ke(this,"isServerSide");ke(this,"version");var t;y_?(this.name="deno",this.version="",jd&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):__?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):jd?(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 Vo=()=>new N_,C_=(...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 Gc(e){if(!Ku(e))throw new Error("Parameter was not an error")}function Ku(e){return!!e&&typeof e=="object"&&E_(e)==="[object Error]"||e instanceof Error}function E_(e){return Object.prototype.toString.call(e)}const T_="Layerr";let x_=T_;function S_(){return x_}function v_(e){let t,n="";if(e.length===0)t={};else if(Ku(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 Oi extends Error{constructor(t,n){const r=[...arguments],{options:c,shortMessage:d}=v_(r);let g=d;if(c.cause&&(g=`${g}: ${c.cause.message}`),super(g),this.message=g,c.name&&typeof c.name=="string"?this.name=c.name:this.name=S_(),c.cause&&Object.defineProperty(this,"_cause",{value:c.cause}),Object.defineProperty(this,"_info",{value:{}}),c.info&&typeof c.info=="object"&&Object.assign(this._info,c.info),Error.captureStackTrace){const m=c.constructorOpt||this.constructor;Error.captureStackTrace(this,m)}}static cause(t){return Gc(t),t._cause&&Ku(t._cause)?t._cause:null}static fullStack(t){Gc(t);const n=Oi.cause(t);return n?`${t.stack}
|
|
31
|
+
caused by: ${Oi.fullStack(n)}`:t.stack??""}static info(t){Gc(t);const n={},r=Oi.cause(t);return r&&Object.assign(n,Oi.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 cg="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ql=32,Vd=0xffffffffffff,w_=10,O_=16,Vl=Object.freeze({source:"ulid"});function A_(e){const t=M_(),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 Oi({info:{code:"PRNG_DETECT",...Vl}},"Failed to find a reliable PRNG")}function M_(){return b_()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function D_(e,t){let n="";for(;e>0;e--)n=k_(t)+n;return n}function R_(e,t){if(isNaN(e))throw new Oi({info:{code:"ENC_TIME_NAN",...Vl}},`Time must be a number: ${e}`);if(e>Vd)throw new Oi({info:{code:"ENC_TIME_SIZE_EXCEED",...Vl}},`Cannot encode a time larger than ${Vd}: ${e}`);if(e<0)throw new Oi({info:{code:"ENC_TIME_NEG",...Vl}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Oi({info:{code:"ENC_TIME_TYPE",...Vl}},`Time must be an integer: ${e}`);let n,r="";for(let c=t;c>0;c--)n=e%Ql,r=cg.charAt(n)+r,e=(e-n)/Ql;return r}function b_(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function k_(e){let t=Math.floor(e()*Ql);return t===Ql&&(t=Ql-1),cg.charAt(t)}function I_(e,t){const n=A_(),r=isNaN(e)?Date.now():e;return R_(r,w_)+D_(O_,n)}var qd="yext_analytics_session_id";function L_(){if(typeof window>"u")return null;try{var e=window.sessionStorage.getItem(qd);return e||(e=I_(),window.sessionStorage.setItem(qd,e)),e}catch(t){return console.warn(`Unable to use browser sessionStorage for sessionId.
|
|
32
|
+
`,t),null}}const P_="1.0.0",Zd={version:P_};function $_(e,t,n){return n.debug?(ug(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function F_(e,t,n){return n.debug?(ug(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function B_(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function ug(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 _u=function(){return _u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c])}return e},_u.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 c=t[r];c==null?delete n[r]:typeof c!="object"?n[r]=c:n[r]=yu(n[r],c)}return _u({},n)},H_="yextevents.com/accounts/me/events";function W_(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")+"."+H_}var K_=function(e,t,n,r){function c(d){return d instanceof n?d:new n(function(g){g(d)})}return new(n||(n=Promise))(function(d,g){function m(R){try{T(r.next(R))}catch(b){g(b)}}function N(R){try{T(r.throw(R))}catch(b){g(b)}}function T(R){R.done?d(R.value):c(R.value).then(m,N)}T((r=r.apply(e,t||[])).next())})},z_=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,c,d,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(T){return function(R){return N([T,R])}}function N(T){if(r)throw new TypeError("Generator is already executing.");for(;g&&(g=0,T[0]&&(n=0)),n;)try{if(r=1,c&&(d=T[0]&2?c.return:T[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,T[1])).done)return d;switch(c=0,d&&(T=[T[0]&2,d.value]),T[0]){case 0:case 1:d=T;break;case 4:return n.label++,{value:T[1],done:!1};case 5:n.label++,c=T[1],T=[0];continue;case 7:T=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){n=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){n.label=T[1];break}if(T[0]===6&&n.label<d[1]){n.label=d[1],d=T;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(T);break}d[2]&&n.ops.pop(),n.trys.pop();continue}T=t.call(e,n)}catch(R){T=[6,R],c=0}finally{r=d=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},U_=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 K_(this,void 0,void 0,function(){var r,c,d,g,m=this;return z_(this,function(N){return r=yu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=L_()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Zd.version:r.clientSdk=(g={},g.ANALYTICS=Zd.version,g),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,c=B_(r,this.config.forceFetch),d=W_(this.config.env,this.config.region),c?[2,new Promise(function(T,R){$_(d,r,m.config)?T(""):R("Failed Beacon Call")})]:[2,F_(d,r,this.config).then(function(T){return T}).catch(function(T){return T})]})})},e}();function G_(e){return new U_(e)}function Nu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function dg(e,t){return[e,t].filter(n=>!!n).map(n=>Nu(n)).join("_")}const Y_=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},zu=yt.createContext(null),j_=yt.lazy(()=>Promise.resolve().then(()=>require("./debugger-Ejo7K3er.cjs")));function V_(e){const{children:t,apiKey:n,currency:r,templateData:c,requireOptIn:d,disableSessionTracking:g,enableDebugging:m,productionDomains:N}=e;if(!n)throw new Error("API Key is required for AnalyticsProvider");const T=yt.useRef(null),[R,b]=yt.useState(!1);yt.useEffect(()=>{b(!0)},[]),T.current===null&&(T.current=new fg(n,r,c,d,g,N,m??rc()));const k=T.current;return yt.useEffect(()=>(window.enableYextAnalytics=()=>{k.optIn()},()=>{delete window.enableYextAnalytics}),[k]),nt.jsxs(nt.Fragment,{children:[nt.jsx(zu.Provider,{value:k,children:t}),R&&(m||rc())&&Vo().name==="browser"?nt.jsx(yt.Suspense,{fallback:nt.jsx(nt.Fragment,{}),children:nt.jsx(j_,{})}):null]})}function rc(){return Vo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class fg{constructor(t,n,r,c,d,g,m=!1){ke(this,"_optedIn");ke(this,"_sessionTrackingEnabled");ke(this,"_analyticsEventService");ke(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.productionDomains=g,this.enableDebugging=m,this._optedIn=!c,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Vo().name!=="browser"||!this._optedIn)return;if(!C_(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=Y_(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=G_(n).with(r)}canTrack(){return Vo().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 b;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:c,currency:d,amount:g,destinationUrl:m,customTags:N,customValues:T}=t;let R;g&&(R={amount:g,currency:d||this.defaultCurrency}),await((b=this._analyticsEventService)==null?void 0:b.report({action:n,pages:{scope:Nu(r)||void 0,originalEventName:dg(r||"",Nu(c)||"")},value:R,destinationUrl:m||void 0,customTags:N,customValues:T}))}getDebugEnabled(){return this.enableDebugging||rc()}}const Cu=yt.createContext({name:""}),Uu=()=>yt.useContext(Cu).name;function q_(e){var g;const t=Uu(),[n]=yt.useState({name:dg(t,e.name)}),r=(g=Jo())==null?void 0:g.getDebugEnabled(),[c,d]=yt.useState(!1);return yt.useEffect(()=>{d(!0)},[]),r&&c?nt.jsx("section",{"data-ya-scope":n.name,children:nt.jsx(Cu.Provider,{value:n,children:e.children})}):nt.jsx(Cu.Provider,{value:n,children:e.children})}function Jo(){const e=yt.useContext(zu);if(!e)return e;Vo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=Uu();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 Z_=()=>{var e;return(e=Jo())==null?void 0:e.track},J_=()=>{var e;return(e=Jo())==null?void 0:e.pageView},X_=()=>{var e;return(e=Jo())==null?void 0:e.identify},Ji={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},Q_=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 c=e.pathname.replace(/^\//,"").split("/");if(c.length<2||c.length>3){console.error(`Invalid path: ${e}`);return}let d;if(c[0]==="f")d="prod";else switch(c[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 g;if(c.length===3&&(g=parseInt(c[1]),Number.isNaN(g))){console.error(`Invalid account id: ${e}`);return}const m=c[c.length-1].split("."),N=m.length===2?`.${m[1]}`:"",T=m[0];return{scheme:t,partition:r,env:d,accountId:g,contentHash:T,extension:N}},ey=(e,t,n,r)=>{const c=`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 g=e.accountId!==void 0?`${e.accountId}/`:"",m=gg(r);return`${c}/${d}/${g}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}${m}`},ty=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 c=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 g=n[n.length-1].split("."),m=g.length===2?`.${g[1]}`:"",N=g[0];return{scheme:t,env:r,contentHash:c,aspectRatio:d,name:N,extension:m}},ny=(e,t,n,r)=>{const c="https://dyn.mktgcdn.com";let d="p";switch(e.env){case"prod":break;case"sbx":{d+="-sandbox";break}default:d+=`-${e.env.toString()}`}const g=gg(r);return`${c}/${d}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}${g}`},ry=e=>e.endsWith(".mktgcdn.com")||e==="mktgcdn.com",ic=(e,t,n,r)=>{if(!hg(e)){console.error(`Invalid image url: ${e}.`);return}const c=new URL(e);if(!ry(c.hostname))return e;if(c.pathname.startsWith("/p")){const d=ty(c);if(d)return ny(d,t,n,r)}else if(c.pathname.startsWith("/f")){const d=Q_(c);if(d)return ey(d,t,n,r)}return e},hg=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},gg=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}`:""},iy=({image:e,className:t,width:n,height:r,aspectRatio:c,layout:d=Ji.INTRINSIC,placeholder:g,imgOverrides:m,style:N={},imageTransformations:T,loading:R="lazy"})=>{const b=yt.useRef(null),[k,z]=yt.useState(!1),E="image"in e?e.image:e;yt.useEffect(()=>{var B;(B=b.current)!=null&&B.complete&&z(!0)},[]),sy(d,E.width,E.height,n,r,c);const x=Math.abs(E.width);x||console.warn("Invalid image width.");const U=Math.abs(E.height);if(U||console.warn("Invalid image height."),!hg(E.url))return console.error(`Invalid image url: ${E.url}`),nt.jsx(nt.Fragment,{children:g!=null&&g});const Q=n&&n>0?n:void 0,F=r&&r>0?r:void 0,{src:W,imgStyle:G,widths:q,updatedImageTransformations:le}=oy(d,x,U,N,E.url,Q,F,c,T),se=q.map(B=>`${ic(E.url,B,(d===Ji.ASPECT&&c?1/c:U/x)*B,le)} ${B}w`).join(", "),ge=[640,768,1024,1280,1536],j=q.map((B,V)=>V===q.length-1?`${B}px`:`(max-width: ${ge[V]}px) ${B}px`).join(", ");return nt.jsxs(nt.Fragment,{children:[!k&&g!=null&&g,nt.jsx("img",{ref:b,style:G,src:W,className:t,width:Q,height:F,srcSet:se,sizes:j,loading:R,alt:E.alternateText||"",...m})]})},sy=(e,t,n,r,c,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Ji.FIXED){if(!r&&!c){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}.`),c&&c<0&&console.warn(`Using fixed layout but height is invalid: ${c}.`);return}(r||c)&&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===Ji.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},oy=(e,t,n,r,c,d,g,m,N)=>{let T=[100,320,640,960,1280,1920],R=ic(c,500,m?500/m:500,N);const b={...r},k=N?{...N}:{};switch(b.objectFit=b.objectFit||"cover",b.objectPosition=b.objectPosition||"center",e){case Ji.INTRINSIC:b.maxWidth=t,b.width="100%",b.aspectRatio=m?`${m}`:`${t} / ${n}`;break;case Ji.FIXED:{const{fixedWidth:z,fixedHeight:E,fixedWidths:x}=ly(t,n,T,d,g);b.width=z,b.height=E,T=x,R=ic(c,z,E,k);break}case Ji.ASPECT:b.aspectRatio=m?`${m}`:`${t} / ${n}`,k&&(k.fit=(k==null?void 0:k.fit)||"cover");break;case Ji.FILL:b.width="100%",b.aspectRatio=m?`${m}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:R,imgStyle:b,widths:T,updatedImageTransformations:k}},ly=(e,t,n,r,c)=>r&&c?{fixedWidth:r,fixedHeight:c,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:c?{fixedWidth:c/t*e,fixedHeight:c,fixedWidths:[c/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var pg={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="",g=0;g<arguments.length;g++){var m=arguments[g];m&&(d=c(d,r(m)))}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 g="";for(var m in d)t.call(d,m)&&d[m]&&(g=c(g,m));return g}function c(d,g){return g?d?d+" "+g:d+g:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(pg);var ly=pg.exports;const ro=lg(ly),ay="phonecall",cy="drivingdirection",Jd="calltoactionclick",uy="clicktowebsite",dy="other",Xd="link",fy="cta",hy=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=my(t.link)),t.link=_y(t),t},gy=(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"}},py=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return ay;case"EMAIL":return Jd;case"URL":return Xd;case"DRIVING_DIRECTIONS":return cy;case"CLICK_TO_WEBSITE":return uy;case"OTHER":return dy;default:return n?Jd:Xd}return fy},my=e=>yy(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",_y=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,yy=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),mg=yt.forwardRef(function(t,n){const{children:r,onClick:c,className:d,eventName:g,scope:m,currency:N,amount:T,cta:R,obfuscate:b,customTags:k,customValues:z,...E}=t,x=hy(t),U=gy(x,!!R),Q=py(g,x.linkType,!!R),F=Jo(),W=b||b!==!1&&x.linkType==="EMAIL",G=async se=>{const ge=se.currentTarget;let j="";if(W){se.preventDefault();const B=ge.href.split("/").at(-1);B&&(j=atob(B))}if(F!==null)try{await F.track({action:U,scope:m,eventName:Q,currency:N,amount:T,destinationUrl:j||ge.href,customTags:k,customValues:z})}catch{console.error("Failed to report click Analytics Event")}c&&c(se),j&&(window.location.href=j)},q=W?"Obfuscated, set a label or child":x.link,le={className:ro("Link",d),href:W?btoa(x.link):x.link,onClick:G,rel:t.target&&!t.rel?"noopener":t.rel,ref:n};return F!=null&&F.getDebugEnabled()&&(le["data-ya-action"]=U,le["data-ya-scopeoverride"]=m,le["data-ya-eventname"]=Q),nt.jsx("a",{...E,...le,suppressHydrationWarning:!0,children:r||x.label||q})});var yn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(yn||{}),Kr=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Kr||{});const Yc=3959,jc=6371,Ny=["latitude","lat"],Cy=["longitude","lon","lng","long"];function Qd(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function ef(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 Qs(e){return e*Math.PI/180}function Vi(e){return e/Math.PI*180}function Ey(e,t){const n=Qs(e.latitude),r=Qs(t.latitude),c=r-n,d=Qs(t.longitude-e.longitude),g=Math.pow(Math.sin(c/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g))}function Ty(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 xy(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 un{constructor(t,n){ke(this,"_lat");ke(this,"_lon");let r=t,c=n;this._lat=0,this._lon=0,typeof t=="object"?(r=Qd(t,Ny)??0,c=Qd(t,Cy)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof c=="function"?c():c):typeof r=="number"&&typeof c=="number"&&(this.latitude=r,this.longitude=c)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(ef(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=ef(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=yn.DEGREE,c=Kr.SPHERICAL){if(c===Kr.MERCATOR&&(r===yn.DEGREE||r===yn.RADIAN)){const d=r===yn.DEGREE?Qs(t):t,g=r===yn.DEGREE?n:Vi(n);this.latitude=xy(this.latitude,d),this.longitude+=g}else switch(r){case yn.DEGREE:this.latitude+=t,this.longitude+=n;break;case yn.KILOMETER:this.latitude+=Vi(t)*jc,this.longitude+=Vi(n)*jc*Math.cos(Qs(this.latitude));break;case yn.MILE:this.latitude+=Vi(t)*Yc,this.longitude+=Vi(n)*Yc*Math.cos(Qs(this.latitude));break;case yn.RADIAN:this.latitude+=Vi(t),this.longitude+=Vi(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=yn.MILE,r=Kr.SPHERICAL){if(r===Kr.MERCATOR&&(n===yn.DEGREE||n===yn.RADIAN)){const c=Ty(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),g=Qs(Math.min(d,360-d)),m=Math.sqrt(Math.pow(c,2)+Math.pow(g,2));switch(n){case yn.DEGREE:return Vi(m);case yn.RADIAN:return m;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const c=Ey(this,t);switch(n){case yn.DEGREE:return Vi(c);case yn.KILOMETER:return c*jc;case yn.MILE:return c*Yc;case yn.RADIAN:return c;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 _g(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var xr=(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))(xr||{});function br(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 Gu(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 Qr(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 yg{constructor(t,n){ke(this,"providerMapClass");ke(this,"wrapper");ke(this,"controlEnabled");ke(this,"panHandler");ke(this,"panStartHandler");ke(this,"providerOptions");ke(this,"iframeWindow");ke(this,"apiKey");Qr(t,Ns),n&&Gu(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 br(t,xr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return br(t,xr.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 Xo{constructor(t){ke(this,"_panHandler");ke(this,"_panStartHandler");Qr(t,yg),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 Ng{constructor(t){ke(this,"providerPinClass");ke(this,"clickHandler");ke(this,"focusHandler");ke(this,"hoverHandler");ke(this,"icons");ke(this,"hasPinUrl");Qr(t,Ns),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return br(t,xr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return br(t,xr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return br(t,xr.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 Yu{constructor(t){ke(this,"_clickHandler");ke(this,"_focusHandler");ke(this,"_hoverHandler");ke(this,"_icons");Qr(t,Ng),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 Sy=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class Qo extends Yu{constructor(n){super(n);ke(this,"_pinEl");ke(this,"_pinAlt");ke(this,"_wrapper");this._pinEl=n.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,Qo.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 Sy}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(),c=n.getElement()||this._pinEl,d=n.getZIndex();c.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),c!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(c)))}setElementProperties(n){const r=n.getAnchorX(),c=n.getAnchorY(),d=n.getHeight(),g=this._icons[n.getIcon()],m=n.getSRText(),N=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:g?`url("${g}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*c}%)`,width:N+"px"}),this._pinAlt.innerText=m}}class io{constructor(){ke(this,"loadFunction");ke(this,"mapClass");ke(this,"pinClass");ke(this,"providerName");this.loadFunction=(t,n,r,c)=>t(),this.mapClass=Xo,this.pinClass=Yu,this.providerName=""}withLoadFunction(t){return br(t,xr.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 Ns(this)}}class Ns{constructor(t){ke(this,"_loadFunction");ke(this,"_mapClass");ke(this,"_pinClass");ke(this,"_providerName");ke(this,"_loadPromise");ke(this,"_resolveLoad");ke(this,"_rejectLoad");ke(this,"_apiKey");ke(this,"_loadInvoked");ke(this,"_loaded");ke(this,"_options");Qr(t,io),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 vy extends Xo{constructor(n){super(n);ke(this,"map");ke(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 un(((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,g;const c=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(c):(g=this.map)==null||g.setCenter(c)}setZoom(n,r){var c;(c=this.map)==null||c.setZoom(Math.floor(n))}setZoomCenter(n,r,c){this.setCenter(r,c),this.setZoom(n,c)}}class wy extends Qo{constructor(n){super(n);ke(this,"_latLng");ke(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(g){super();ke(this,"pin");this.pin=g}draw(){var m;const g=(m=this.getProjection())==null?void 0:m.fromLatLngToDivPixel(this.pin._latLng??null);g&&this.pin._wrapper&&(this.pin._wrapper.style.left=g.x+"px",this.pin._wrapper.style.top=g.y+"px")}onAdd(){var g;this.pin._wrapper&&((g=this.getPanes())==null||g.floatPane.appendChild(this.pin._wrapper))}onRemove(){var g,m;(m=(g=this.pin._wrapper)==null?void 0:g.parentNode)==null||m.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 c=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(c??null)}}const tf="GoogleMapsCallback_b7d77ff2",Oy="https://maps.googleapis.com/maps/api/js";function Ay(e,t,n,{autocomplete:r=!1,channel:c=window.location.hostname,client:d,language:g,region:m,libraries:N=[],loading:T="async",params:R={}}={}){window[tf]=e,r&&N.push("geocoder","places");const b={callback:tf,channel:c,libraries:N.join(","),...R};n&&(b.key=n),d&&(b.client=d),g&&(b.language=g),m&&(b.region=m),T&&(b.loading=T),_g(Oy+"?"+Object.entries(b).map(([k,z])=>k+"="+z).join("&"))}const Cg=new io().withLoadFunction(Ay).withMapClass(vy).withPinClass(wy).withProviderName("Google").build();class Xs{constructor(t,n){ke(this,"_ne");ke(this,"_sw");this._ne=new un(n),this._sw=new un(t)}static fit(t){const n=t.map(T=>T.latitude),r=Math.max(...n),c=Math.min(...n),d=t.map(T=>T.normalLon).sort((T,R)=>T-R),g=d.map((T,R)=>({distance:(R<d.length-1?d[R+1]:d[0]+360)-T,index:R})).reduce((T,R)=>R.distance>T.distance?R:T).index,m=d[g],N=d[(g+1)%d.length];return new this(new un(c,N),new un(r,m))}get ne(){return this._ne}set ne(t){this._ne=new un(t)}get sw(){return this._sw}set sw(t){this._sw=new un(t)}contains(t){const n=this._sw.latitude<=t.latitude&&t.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,c=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||c)}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=Kr.SPHERICAL){const n=new un(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,yn.DEGREE,t),c=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,yn.DEGREE,t),n.longitude=c,n}}class My{constructor(){ke(this,"_anchorX");ke(this,"_anchorY");ke(this,"_height");ke(this,"_icon");ke(this,"_srText");ke(this,"_width");ke(this,"_zIndex");ke(this,"_class");ke(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 ju{constructor(){ke(this,"coordinate");ke(this,"hideOffscreen");ke(this,"icons");ke(this,"propertiesForStatus");ke(this,"provider");ke(this,"type");ke(this,"hasPinUrl");this.coordinate=new un(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new My,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(t){return this.coordinate=new un(t),this}withHideOffscreen(t){return this.hideOffscreen=t,this}withIcon(t,n){return this.icons[t]=n,this}withPropertiesForStatus(t){return br(t,xr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(Qr(t,Ns),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new Dy(this)}}class Dy{constructor(t){ke(this,"_coordinate");ke(this,"_hideOffscreen");ke(this,"_icons");ke(this,"_propertiesForStatus");ke(this,"_type");ke(this,"_clickHandler");ke(this,"_focusHandler");ke(this,"_hoverHandler");ke(this,"_hidden");ke(this,"_cancelHiddenUpdater");ke(this,"_map");ke(this,"_pin");ke(this,"_status");var n,r;if(Qr(t,ju),t.provider&&Qr(t.provider,Ns),!((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=c=>this._hoverHandler(c),this._hoverHandler=c=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new Ng(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(c=>this._focusHandler(c)).withHoverHandler(c=>this._hoverHandler(c)).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){br(t,xr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new un(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){br(t,xr.FUNCTION),this._focusHandler=t}setHoverHandler(t){br(t,xr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&Qr(t,Tg),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(c=>{this._cancelHiddenUpdater=()=>{n=!0,c()}});(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 gs=.98;function Ua(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class Eg{constructor(){ke(this,"controlEnabled");ke(this,"defaultCenter");ke(this,"defaultZoom");ke(this,"legendPins");ke(this,"padding");ke(this,"panHandler");ke(this,"panStartHandler");ke(this,"provider");ke(this,"providerOptions");ke(this,"singlePinZoom");ke(this,"wrapper");ke(this,"iframeWindow");ke(this,"apiKey");this.controlEnabled=!0,this.defaultCenter=new un(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 un(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 br(t,xr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return br(t,xr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return Qr(t,Ns),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(Gu(t),this.wrapper=t,this):this}withIframeWindow(t){return this.iframeWindow=t,this}withApiKey(t){return this.apiKey=t,this}build(){return new Tg(this)}}let Tg=class{constructor(t){ke(this,"_defaultCenter");ke(this,"_defaultZoom");ke(this,"_legendPins");ke(this,"_padding");ke(this,"_provider");ke(this,"_singlePinZoom");ke(this,"_wrapper");ke(this,"_cachedBounds");ke(this,"_resolveIdle");ke(this,"_resolveMoving");ke(this,"_idlePromise");ke(this,"_panHandlerRunning");ke(this,"_panStartHandlerRunning");ke(this,"_currentBounds");ke(this,"_movingPromise");ke(this,"_panHandler");ke(this,"_panStartHandler");ke(this,"_map");var n,r,c;if(Qr(t,Eg),t.provider&&Qr(t.provider,Ns),t.wrapper&&Gu(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);(c=this._wrapper)!=null&&c.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new yg(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(Xs.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,c=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),g=this.getCenter(),m=360/Math.pow(2,d+8),N=c*m,T=r*m;this._cachedBounds=new Xs(g,g),this._cachedBounds.ne.add(T/2,N/2,yn.DEGREE,Kr.MERCATOR),this._cachedBounds.sw.add(-T/2,-N/2,yn.DEGREE,Kr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new Xs(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 ju().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new Xs(new un(this._currentBounds.sw),new un(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler&&this._panStartHandler(new Xs(new un(this._currentBounds.sw),new un(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,c={},d=1/0){var B,V;const g=(B=this._wrapper)==null?void 0:B.offsetHeight,m=(V=this._wrapper)==null?void 0:V.offsetWidth;if(!g||!m)return;let N=Ua(c.bottom,g),T=Ua(c.left,m),R=Ua(c.right,m),b=Ua(c.top,g),k=T+R,z=N+b;k>gs&&(T*=gs/k,R*=gs/k,k=gs),z>gs&&(N*=gs/z,b*=gs/z,z=gs);const E=g*(1-z),x=m*(1-k),U=new Xs(n,t),Q=new un(U.ne.latitude,U.sw.longitude),F=U.sw.distanceTo(Q,yn.DEGREE,Kr.MERCATOR),W=(U.ne.longitude-Q.longitude+360)%360;let G=Math.max(F,W*E/x)/(1-z),q=Math.max(W,F*x/E)/(1-k),le=Math.log2(m*360/q)-8;le>d&&(le=d,q=m*360/2**(le+8),G=q*g/m);const se=U.getCenter(Kr.MERCATOR),ge=(b-N)/2*G,j=(R-T)/2*q;se.add(ge,j,yn.DEGREE,Kr.MERCATOR),this.setZoomCenter(le,se,r)}setCenter(t,n=!1){this._map.setCenter(new un(t),n)}setPadding({bottom:t=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:c=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:c},this}setPanHandler(t){br(t,xr.FUNCTION),this._panHandler=t}setPanStartHandler(t){br(t,xr.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 gc=yt.createContext(null);function Ry(){const e=yt.useContext(gc);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const xg=({apiKey:e,bounds:t,children:n,className:r,clientKey:c,controls:d=!0,defaultCenter:g={latitude:39.83,longitude:-98.58},defaultZoom:m=4,mapRef:N,padding:T={bottom:50,left:50,right:50,top:50},panHandler:R=()=>null,panStartHandler:b=()=>null,provider:k=Cg,providerOptions:z={},singleZoom:E=14,iframeId:x})=>{const U=yt.useRef(null),[Q,F]=yt.useState(new un(g)),[W,G]=yt.useState(!1),[q,le]=yt.useState(),[se,ge]=yt.useState(m),j=(B,V)=>{R(B,V),V&&F(V.getCenter())};return yt.useEffect(()=>{!W||!q||ge(q.getZoom())},[Q]),yt.useEffect(()=>{if(!t||!W||!q)return;const B=t.map(V=>new un(V));q.fitCoordinates(B)},[JSON.stringify(t),q]),yt.useEffect(()=>{var xe;if(!W||q)return;const B=x&&typeof document<"u"?((xe=document.getElementById(x))==null?void 0:xe.contentWindow)??void 0:void 0,V=new Eg().withControlEnabled(d).withDefaultCenter(Q).withDefaultZoom(se).withPadding(T).withPanHandler(j).withPanStartHandler(b).withProvider(k).withProviderOptions(z).withSinglePinZoom(E).withWrapper(U.current).withIframeWindow(B).withApiKey(e).build();le(V),N&&(N.current=V)},[W]),yt.useEffect(()=>{W||q||!U.current||k instanceof Ns&&k.load(e,{...z,...c&&{client:c}}).then(()=>G(!0))},[]),nt.jsx("div",{className:ro({"is-loaded":W},r),id:"map",ref:U,"data-testid":"map",children:q&&nt.jsx(gc.Provider,{value:{map:q,provider:k},children:n})})},by=({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})})]})}),Vu=yt.createContext(null);function ky(){const e=yt.useContext(Vu);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const Iy=({clusterRadius:e=50,children:t,ClusterTemplate:n=by})=>{const{map:r}=yt.useContext(gc),[c,d]=yt.useState([]),[g,m]=yt.useState(),[N,T]=yt.useState([]),[R,b]=yt.useState([]);return yt.useEffect(()=>{m(Ly(c,r.getZoom(),e))},[c,r.getZoom()]),yt.useEffect(()=>{b(()=>[]),T(()=>[]),(g==null?void 0:g.length)!==0&&(g==null||g.forEach(k=>{if(k.length===1){k[0].pin.setMap(r);return}if(k.length>1){const z=Xs.fit(k.map(x=>x.pin.getCoordinate())).getCenter(Kr.MERCATOR),E=`cluster-{${z._lat},${z._lon}}`;k.forEach(x=>x.pin.setMap(null)),T(x=>[...x,E]),b(x=>[...x,nt.jsx(qu,{coordinate:z,id:E,onClick:()=>r.fitCoordinates(k.map(U=>U.pin.getCoordinate()),!0,1/0),children:nt.jsx(n,{count:k.length})},E)])}}))},[g]),nt.jsx(Vu.Provider,{value:{clusters:g??[],clusterIds:N,setPinStore:d},children:nt.jsxs(nt.Fragment,{children:[R.map((k,z)=>nt.jsx(yt.Fragment,{children:k},z)),t]})})},Ly=(e,t,n)=>{const r=n*Math.PI/2**(t+7),c=e.map((m,N)=>[N]),d=[];e.forEach((m,N)=>{for(let T=N;T<e.length;T++)T!==N&&new un(m.pin.getCoordinate()).distanceTo(new un(e[T].pin.getCoordinate()),yn.RADIAN,Kr.MERCATOR)<=r&&(c[N].push(T),c[T].push(N))});let g=1;for(;g;){g=0;let m;if(c.forEach((R,b)=>{R.length>g&&(g=R.length,m=b)}),!g)break;const N=c[m??0],T=[];c[m??0]=[];for(const R of N){const b=c[R];T.push(e[R]),c[R]=[],b.forEach(k=>c[k].splice(c[k].indexOf(R),1))}d.push(T)}return d},Py=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"})}),qu=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:c=Py,onClick:d=()=>null,onFocus:g=()=>null,onHover:m=()=>null,zIndex:N,hasPinUrl:T=!1})=>{const{map:R,provider:b}=yt.useContext(gc),k=yt.useContext(Vu),z=yt.useMemo(()=>new ju().withCoordinate(t).withHideOffscreen(n).withProvider(b).withHasPinUrl(T).build(),[]);yt.useEffect(()=>{if(N!==0&&!N)return;const x=z.getProviderPin().getWrapperElement();x&&(x.style.zIndex=N.toString())},[N]),yt.useEffect(()=>{z.setMap(R),z.setClickHandler(()=>d(r)),z.setFocusHandler(U=>g(U,r)),z.setHoverHandler(U=>m(U,r));const x=k==null?void 0:k.clusterIds.includes(r);return k&&!x&&k.setPinStore(U=>[...U,{pin:z,id:r}]),()=>{z.setMap(null),k&&k.setPinStore(U=>U.filter(Q=>Q.id!==r))}},[]);const E=e||c;if(E){const x=z.getProviderPin().getPinElement();return Object.assign(x.style,{height:"auto",width:"auto"}),Qm.createPortal(E,x)}return null},$y=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:c=()=>null,onHover:d=()=>null,onFocus:g=()=>null,...m})=>{var N;return nt.jsx(xg,{bounds:[t],...m,children:nt.jsx(qu,{coordinate:t,id:"location-map-marker",onClick:c,onHover:d,onFocus:g,hasPinUrl:((N=r||"")==null?void 0:N.length)>0,children:r?nt.jsx(mg,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var Vc={},Kl={},nf;function Fy(){if(nf)return Kl;nf=1;var e=yt;const t=e.createContext(null);function n(c,d){let g=null;c!=null&&(g=c[1]);function m(){return d??(g!=null?g.getTheme():null)}return{getTheme:m}}function r(){const c=e.useContext(t);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}return Kl.LexicalComposerContext=t,Kl.createLexicalComposerContext=n,Kl.useLexicalComposerContext=r,Kl}var zl={},rf;function By(){if(rf)return zl;rf=1;var e=yt;function t(r){let c=new URLSearchParams;c.append("code",r);for(let d=1;d<arguments.length;d++)c.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${c} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return zl.LexicalComposerContext=n,zl.createLexicalComposerContext=function(r,c){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return c??(d!=null?d.getTheme():null)}}},zl.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},zl}const Hy=process.env.NODE_ENV==="development"?Fy():By();var so=Hy,He={},sf;function Wy(){if(sf)return He;sf=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),c=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),g=e("INSERT_PARAGRAPH_COMMAND"),m=e("CONTROLLED_TEXT_INSERTION_COMMAND"),N=e("PASTE_COMMAND"),T=e("REMOVE_TEXT_COMMAND"),R=e("DELETE_WORD_COMMAND"),b=e("DELETE_LINE_COMMAND"),k=e("FORMAT_TEXT_COMMAND"),z=e("UNDO_COMMAND"),E=e("REDO_COMMAND"),x=e("KEYDOWN_COMMAND"),U=e("KEY_ARROW_RIGHT_COMMAND"),Q=e("MOVE_TO_END"),F=e("KEY_ARROW_LEFT_COMMAND"),W=e("MOVE_TO_START"),G=e("KEY_ARROW_UP_COMMAND"),q=e("KEY_ARROW_DOWN_COMMAND"),le=e("KEY_ENTER_COMMAND"),se=e("KEY_SPACE_COMMAND"),ge=e("KEY_BACKSPACE_COMMAND"),j=e("KEY_ESCAPE_COMMAND"),B=e("KEY_DELETE_COMMAND"),V=e("KEY_TAB_COMMAND"),xe=e("INSERT_TAB_COMMAND"),we=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),ue=e("DROP_COMMAND"),$=e("FORMAT_ELEMENT_COMMAND"),S=e("DRAGSTART_COMMAND"),Y=e("DRAGOVER_COMMAND"),ie=e("DRAGEND_COMMAND"),K=e("COPY_COMMAND"),P=e("CUT_COMMAND"),Z=e("SELECT_ALL_COMMAND"),O=e("CLEAR_EDITOR_COMMAND"),H=e("CLEAR_HISTORY_COMMAND"),J=e("CAN_REDO_COMMAND"),de=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),I=e("BLUR_COMMAND"),w=e("KEY_MODIFIER_COMMAND"),D=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",re=D&&"documentMode"in document?document.documentMode:null,ye=D&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ae=D&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=D&&"InputEvent"in window&&!re?"getTargetRanges"in new window.InputEvent("input"):!1,te=D&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ce=D&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=D&&/Android/.test(navigator.userAgent),Ne=D&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=D&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,Le=1,Fe=3,qe=0,Be=1,ct=2,Mt=0,Ut=1,en=2,Oe=1,ne=2,oe=4,Se=8,Ie=16,De=32,je=64,rt=128,it=Oe|ne|oe|Se|Ie|De|je|rt,st=1,vt=2,Ge=1,ze=2,tt=3,_t=4,Nt=5,Et=6,ht=" ",pt=te||ce||Re?ht:"",$t=`
|
|
36
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var d="",g=0;g<arguments.length;g++){var m=arguments[g];m&&(d=c(d,r(m)))}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 g="";for(var m in d)t.call(d,m)&&d[m]&&(g=c(g,m));return g}function c(d,g){return g?d?d+" "+g:d+g:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(pg);var ay=pg.exports;const ro=lg(ay),cy="phonecall",uy="drivingdirection",Jd="calltoactionclick",dy="clicktowebsite",fy="other",Xd="link",hy="cta",gy=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=_y(t.link)),t.link=yy(t),t},py=(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"}},my=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return cy;case"EMAIL":return Jd;case"URL":return Xd;case"DRIVING_DIRECTIONS":return uy;case"CLICK_TO_WEBSITE":return dy;case"OTHER":return fy;default:return n?Jd:Xd}return hy},_y=e=>Ny(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",yy=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,Ny=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),mg=yt.forwardRef(function(t,n){const{children:r,onClick:c,className:d,eventName:g,scope:m,currency:N,amount:T,cta:R,obfuscate:b,customTags:k,customValues:z,...E}=t,x=gy(t),U=py(x,!!R),Q=my(g,x.linkType,!!R),F=Jo(),W=b||b!==!1&&x.linkType==="EMAIL",G=async se=>{const ge=se.currentTarget;let j="";if(W){se.preventDefault();const B=ge.href.split("/").at(-1);B&&(j=atob(B))}if(F!==null)try{await F.track({action:U,scope:m,eventName:Q,currency:N,amount:T,destinationUrl:j||ge.href,customTags:k,customValues:z})}catch{console.error("Failed to report click Analytics Event")}c&&c(se),j&&(window.location.href=j)},q=W?"Obfuscated, set a label or child":x.link,le={className:ro("Link",d),href:W?btoa(x.link):x.link,onClick:G,rel:t.target&&!t.rel?"noopener":t.rel,ref:n};return F!=null&&F.getDebugEnabled()&&(le["data-ya-action"]=U,le["data-ya-scopeoverride"]=m,le["data-ya-eventname"]=Q),nt.jsx("a",{...E,...le,suppressHydrationWarning:!0,children:r||x.label||q})});var yn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(yn||{}),zr=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(zr||{});const Yc=3959,jc=6371,Cy=["latitude","lat"],Ey=["longitude","lon","lng","long"];function Qd(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function ef(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 Qs(e){return e*Math.PI/180}function qi(e){return e/Math.PI*180}function Ty(e,t){const n=Qs(e.latitude),r=Qs(t.latitude),c=r-n,d=Qs(t.longitude-e.longitude),g=Math.pow(Math.sin(c/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g))}function xy(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 Sy(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 un{constructor(t,n){ke(this,"_lat");ke(this,"_lon");let r=t,c=n;this._lat=0,this._lon=0,typeof t=="object"?(r=Qd(t,Cy)??0,c=Qd(t,Ey)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof c=="function"?c():c):typeof r=="number"&&typeof c=="number"&&(this.latitude=r,this.longitude=c)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(ef(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=ef(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=yn.DEGREE,c=zr.SPHERICAL){if(c===zr.MERCATOR&&(r===yn.DEGREE||r===yn.RADIAN)){const d=r===yn.DEGREE?Qs(t):t,g=r===yn.DEGREE?n:qi(n);this.latitude=Sy(this.latitude,d),this.longitude+=g}else switch(r){case yn.DEGREE:this.latitude+=t,this.longitude+=n;break;case yn.KILOMETER:this.latitude+=qi(t)*jc,this.longitude+=qi(n)*jc*Math.cos(Qs(this.latitude));break;case yn.MILE:this.latitude+=qi(t)*Yc,this.longitude+=qi(n)*Yc*Math.cos(Qs(this.latitude));break;case yn.RADIAN:this.latitude+=qi(t),this.longitude+=qi(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=yn.MILE,r=zr.SPHERICAL){if(r===zr.MERCATOR&&(n===yn.DEGREE||n===yn.RADIAN)){const c=xy(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),g=Qs(Math.min(d,360-d)),m=Math.sqrt(Math.pow(c,2)+Math.pow(g,2));switch(n){case yn.DEGREE:return qi(m);case yn.RADIAN:return m;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const c=Ty(this,t);switch(n){case yn.DEGREE:return qi(c);case yn.KILOMETER:return c*jc;case yn.MILE:return c*Yc;case yn.RADIAN:return c;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 _g(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var xr=(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))(xr||{});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 Gu(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 ei(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 yg{constructor(t,n){ke(this,"providerMapClass");ke(this,"wrapper");ke(this,"controlEnabled");ke(this,"panHandler");ke(this,"panStartHandler");ke(this,"providerOptions");ke(this,"iframeWindow");ke(this,"apiKey");ei(t,Cs),n&&Gu(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 kr(t,xr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,xr.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 Xo{constructor(t){ke(this,"_panHandler");ke(this,"_panStartHandler");ei(t,yg),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 Ng{constructor(t){ke(this,"providerPinClass");ke(this,"clickHandler");ke(this,"focusHandler");ke(this,"hoverHandler");ke(this,"icons");ke(this,"hasPinUrl");ei(t,Cs),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,xr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return kr(t,xr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return kr(t,xr.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 Yu{constructor(t){ke(this,"_clickHandler");ke(this,"_focusHandler");ke(this,"_hoverHandler");ke(this,"_icons");ei(t,Ng),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 vy=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class Qo extends Yu{constructor(n){super(n);ke(this,"_pinEl");ke(this,"_pinAlt");ke(this,"_wrapper");this._pinEl=n.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,Qo.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 vy}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(),c=n.getElement()||this._pinEl,d=n.getZIndex();c.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),c!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(c)))}setElementProperties(n){const r=n.getAnchorX(),c=n.getAnchorY(),d=n.getHeight(),g=this._icons[n.getIcon()],m=n.getSRText(),N=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:g?`url("${g}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*c}%)`,width:N+"px"}),this._pinAlt.innerText=m}}class io{constructor(){ke(this,"loadFunction");ke(this,"mapClass");ke(this,"pinClass");ke(this,"providerName");this.loadFunction=(t,n,r,c)=>t(),this.mapClass=Xo,this.pinClass=Yu,this.providerName=""}withLoadFunction(t){return kr(t,xr.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 Cs(this)}}class Cs{constructor(t){ke(this,"_loadFunction");ke(this,"_mapClass");ke(this,"_pinClass");ke(this,"_providerName");ke(this,"_loadPromise");ke(this,"_resolveLoad");ke(this,"_rejectLoad");ke(this,"_apiKey");ke(this,"_loadInvoked");ke(this,"_loaded");ke(this,"_options");ei(t,io),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 wy extends Xo{constructor(n){super(n);ke(this,"map");ke(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 un(((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,g;const c=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(c):(g=this.map)==null||g.setCenter(c)}setZoom(n,r){var c;(c=this.map)==null||c.setZoom(Math.floor(n))}setZoomCenter(n,r,c){this.setCenter(r,c),this.setZoom(n,c)}}class Oy extends Qo{constructor(n){super(n);ke(this,"_latLng");ke(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(g){super();ke(this,"pin");this.pin=g}draw(){var m;const g=(m=this.getProjection())==null?void 0:m.fromLatLngToDivPixel(this.pin._latLng??null);g&&this.pin._wrapper&&(this.pin._wrapper.style.left=g.x+"px",this.pin._wrapper.style.top=g.y+"px")}onAdd(){var g;this.pin._wrapper&&((g=this.getPanes())==null||g.floatPane.appendChild(this.pin._wrapper))}onRemove(){var g,m;(m=(g=this.pin._wrapper)==null?void 0:g.parentNode)==null||m.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 c=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(c??null)}}const tf="GoogleMapsCallback_b7d77ff2",Ay="https://maps.googleapis.com/maps/api/js";function My(e,t,n,{autocomplete:r=!1,channel:c=window.location.hostname,client:d,language:g,region:m,libraries:N=[],loading:T="async",params:R={}}={}){window[tf]=e,r&&N.push("geocoder","places");const b={callback:tf,channel:c,libraries:N.join(","),...R};n&&(b.key=n),d&&(b.client=d),g&&(b.language=g),m&&(b.region=m),T&&(b.loading=T),_g(Ay+"?"+Object.entries(b).map(([k,z])=>k+"="+z).join("&"))}const Cg=new io().withLoadFunction(My).withMapClass(wy).withPinClass(Oy).withProviderName("Google").build();class Xs{constructor(t,n){ke(this,"_ne");ke(this,"_sw");this._ne=new un(n),this._sw=new un(t)}static fit(t){const n=t.map(T=>T.latitude),r=Math.max(...n),c=Math.min(...n),d=t.map(T=>T.normalLon).sort((T,R)=>T-R),g=d.map((T,R)=>({distance:(R<d.length-1?d[R+1]:d[0]+360)-T,index:R})).reduce((T,R)=>R.distance>T.distance?R:T).index,m=d[g],N=d[(g+1)%d.length];return new this(new un(c,N),new un(r,m))}get ne(){return this._ne}set ne(t){this._ne=new un(t)}get sw(){return this._sw}set sw(t){this._sw=new un(t)}contains(t){const n=this._sw.latitude<=t.latitude&&t.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,c=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||c)}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=zr.SPHERICAL){const n=new un(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,yn.DEGREE,t),c=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,yn.DEGREE,t),n.longitude=c,n}}class Dy{constructor(){ke(this,"_anchorX");ke(this,"_anchorY");ke(this,"_height");ke(this,"_icon");ke(this,"_srText");ke(this,"_width");ke(this,"_zIndex");ke(this,"_class");ke(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 ju{constructor(){ke(this,"coordinate");ke(this,"hideOffscreen");ke(this,"icons");ke(this,"propertiesForStatus");ke(this,"provider");ke(this,"type");ke(this,"hasPinUrl");this.coordinate=new un(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new Dy,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(t){return this.coordinate=new un(t),this}withHideOffscreen(t){return this.hideOffscreen=t,this}withIcon(t,n){return this.icons[t]=n,this}withPropertiesForStatus(t){return kr(t,xr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(ei(t,Cs),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new Ry(this)}}class Ry{constructor(t){ke(this,"_coordinate");ke(this,"_hideOffscreen");ke(this,"_icons");ke(this,"_propertiesForStatus");ke(this,"_type");ke(this,"_clickHandler");ke(this,"_focusHandler");ke(this,"_hoverHandler");ke(this,"_hidden");ke(this,"_cancelHiddenUpdater");ke(this,"_map");ke(this,"_pin");ke(this,"_status");var n,r;if(ei(t,ju),t.provider&&ei(t.provider,Cs),!((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=c=>this._hoverHandler(c),this._hoverHandler=c=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new Ng(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(c=>this._focusHandler(c)).withHoverHandler(c=>this._hoverHandler(c)).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,xr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new un(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){kr(t,xr.FUNCTION),this._focusHandler=t}setHoverHandler(t){kr(t,xr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&ei(t,Tg),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(c=>{this._cancelHiddenUpdater=()=>{n=!0,c()}});(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 ps=.98;function Ua(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class Eg{constructor(){ke(this,"controlEnabled");ke(this,"defaultCenter");ke(this,"defaultZoom");ke(this,"legendPins");ke(this,"padding");ke(this,"panHandler");ke(this,"panStartHandler");ke(this,"provider");ke(this,"providerOptions");ke(this,"singlePinZoom");ke(this,"wrapper");ke(this,"iframeWindow");ke(this,"apiKey");this.controlEnabled=!0,this.defaultCenter=new un(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 un(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,xr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,xr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return ei(t,Cs),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(Gu(t),this.wrapper=t,this):this}withIframeWindow(t){return this.iframeWindow=t,this}withApiKey(t){return this.apiKey=t,this}build(){return new Tg(this)}}let Tg=class{constructor(t){ke(this,"_defaultCenter");ke(this,"_defaultZoom");ke(this,"_legendPins");ke(this,"_padding");ke(this,"_provider");ke(this,"_singlePinZoom");ke(this,"_wrapper");ke(this,"_cachedBounds");ke(this,"_resolveIdle");ke(this,"_resolveMoving");ke(this,"_idlePromise");ke(this,"_panHandlerRunning");ke(this,"_panStartHandlerRunning");ke(this,"_currentBounds");ke(this,"_movingPromise");ke(this,"_panHandler");ke(this,"_panStartHandler");ke(this,"_map");var n,r,c;if(ei(t,Eg),t.provider&&ei(t.provider,Cs),t.wrapper&&Gu(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);(c=this._wrapper)!=null&&c.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new yg(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(Xs.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,c=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),g=this.getCenter(),m=360/Math.pow(2,d+8),N=c*m,T=r*m;this._cachedBounds=new Xs(g,g),this._cachedBounds.ne.add(T/2,N/2,yn.DEGREE,zr.MERCATOR),this._cachedBounds.sw.add(-T/2,-N/2,yn.DEGREE,zr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new Xs(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 ju().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new Xs(new un(this._currentBounds.sw),new un(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler&&this._panStartHandler(new Xs(new un(this._currentBounds.sw),new un(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,c={},d=1/0){var B,V;const g=(B=this._wrapper)==null?void 0:B.offsetHeight,m=(V=this._wrapper)==null?void 0:V.offsetWidth;if(!g||!m)return;let N=Ua(c.bottom,g),T=Ua(c.left,m),R=Ua(c.right,m),b=Ua(c.top,g),k=T+R,z=N+b;k>ps&&(T*=ps/k,R*=ps/k,k=ps),z>ps&&(N*=ps/z,b*=ps/z,z=ps);const E=g*(1-z),x=m*(1-k),U=new Xs(n,t),Q=new un(U.ne.latitude,U.sw.longitude),F=U.sw.distanceTo(Q,yn.DEGREE,zr.MERCATOR),W=(U.ne.longitude-Q.longitude+360)%360;let G=Math.max(F,W*E/x)/(1-z),q=Math.max(W,F*x/E)/(1-k),le=Math.log2(m*360/q)-8;le>d&&(le=d,q=m*360/2**(le+8),G=q*g/m);const se=U.getCenter(zr.MERCATOR),ge=(b-N)/2*G,j=(R-T)/2*q;se.add(ge,j,yn.DEGREE,zr.MERCATOR),this.setZoomCenter(le,se,r)}setCenter(t,n=!1){this._map.setCenter(new un(t),n)}setPadding({bottom:t=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:c=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:c},this}setPanHandler(t){kr(t,xr.FUNCTION),this._panHandler=t}setPanStartHandler(t){kr(t,xr.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 gc=yt.createContext(null);function by(){const e=yt.useContext(gc);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const xg=({apiKey:e,bounds:t,children:n,className:r,clientKey:c,controls:d=!0,defaultCenter:g={latitude:39.83,longitude:-98.58},defaultZoom:m=4,mapRef:N,padding:T={bottom:50,left:50,right:50,top:50},panHandler:R=()=>null,panStartHandler:b=()=>null,provider:k=Cg,providerOptions:z={},singleZoom:E=14,iframeId:x})=>{const U=yt.useRef(null),[Q,F]=yt.useState(new un(g)),[W,G]=yt.useState(!1),[q,le]=yt.useState(),[se,ge]=yt.useState(m),j=(B,V)=>{R(B,V),V&&F(V.getCenter())};return yt.useEffect(()=>{!W||!q||ge(q.getZoom())},[Q]),yt.useEffect(()=>{if(!t||!W||!q)return;const B=t.map(V=>new un(V));q.fitCoordinates(B)},[JSON.stringify(t),q]),yt.useEffect(()=>{var xe;if(!W||q)return;const B=x&&typeof document<"u"?((xe=document.getElementById(x))==null?void 0:xe.contentWindow)??void 0:void 0,V=new Eg().withControlEnabled(d).withDefaultCenter(Q).withDefaultZoom(se).withPadding(T).withPanHandler(j).withPanStartHandler(b).withProvider(k).withProviderOptions(z).withSinglePinZoom(E).withWrapper(U.current).withIframeWindow(B).withApiKey(e).build();le(V),N&&(N.current=V)},[W]),yt.useEffect(()=>{W||q||!U.current||k instanceof Cs&&k.load(e,{...z,...c&&{client:c}}).then(()=>G(!0))},[]),nt.jsx("div",{className:ro({"is-loaded":W},r),id:"map",ref:U,"data-testid":"map",children:q&&nt.jsx(gc.Provider,{value:{map:q,provider:k},children:n})})},ky=({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})})]})}),Vu=yt.createContext(null);function Iy(){const e=yt.useContext(Vu);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const Ly=({clusterRadius:e=50,children:t,ClusterTemplate:n=ky})=>{const{map:r}=yt.useContext(gc),[c,d]=yt.useState([]),[g,m]=yt.useState(),[N,T]=yt.useState([]),[R,b]=yt.useState([]);return yt.useEffect(()=>{m(Py(c,r.getZoom(),e))},[c,r.getZoom()]),yt.useEffect(()=>{b(()=>[]),T(()=>[]),(g==null?void 0:g.length)!==0&&(g==null||g.forEach(k=>{if(k.length===1){k[0].pin.setMap(r);return}if(k.length>1){const z=Xs.fit(k.map(x=>x.pin.getCoordinate())).getCenter(zr.MERCATOR),E=`cluster-{${z._lat},${z._lon}}`;k.forEach(x=>x.pin.setMap(null)),T(x=>[...x,E]),b(x=>[...x,nt.jsx(qu,{coordinate:z,id:E,onClick:()=>r.fitCoordinates(k.map(U=>U.pin.getCoordinate()),!0,1/0),children:nt.jsx(n,{count:k.length})},E)])}}))},[g]),nt.jsx(Vu.Provider,{value:{clusters:g??[],clusterIds:N,setPinStore:d},children:nt.jsxs(nt.Fragment,{children:[R.map((k,z)=>nt.jsx(yt.Fragment,{children:k},z)),t]})})},Py=(e,t,n)=>{const r=n*Math.PI/2**(t+7),c=e.map((m,N)=>[N]),d=[];e.forEach((m,N)=>{for(let T=N;T<e.length;T++)T!==N&&new un(m.pin.getCoordinate()).distanceTo(new un(e[T].pin.getCoordinate()),yn.RADIAN,zr.MERCATOR)<=r&&(c[N].push(T),c[T].push(N))});let g=1;for(;g;){g=0;let m;if(c.forEach((R,b)=>{R.length>g&&(g=R.length,m=b)}),!g)break;const N=c[m??0],T=[];c[m??0]=[];for(const R of N){const b=c[R];T.push(e[R]),c[R]=[],b.forEach(k=>c[k].splice(c[k].indexOf(R),1))}d.push(T)}return d},$y=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"})}),qu=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:c=$y,onClick:d=()=>null,onFocus:g=()=>null,onHover:m=()=>null,zIndex:N,hasPinUrl:T=!1})=>{const{map:R,provider:b}=yt.useContext(gc),k=yt.useContext(Vu),z=yt.useMemo(()=>new ju().withCoordinate(t).withHideOffscreen(n).withProvider(b).withHasPinUrl(T).build(),[]);yt.useEffect(()=>{if(N!==0&&!N)return;const x=z.getProviderPin().getWrapperElement();x&&(x.style.zIndex=N.toString())},[N]),yt.useEffect(()=>{z.setMap(R),z.setClickHandler(()=>d(r)),z.setFocusHandler(U=>g(U,r)),z.setHoverHandler(U=>m(U,r));const x=k==null?void 0:k.clusterIds.includes(r);return k&&!x&&k.setPinStore(U=>[...U,{pin:z,id:r}]),()=>{z.setMap(null),k&&k.setPinStore(U=>U.filter(Q=>Q.id!==r))}},[]);const E=e||c;if(E){const x=z.getProviderPin().getPinElement();return Object.assign(x.style,{height:"auto",width:"auto"}),e_.createPortal(E,x)}return null},Fy=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:c=()=>null,onHover:d=()=>null,onFocus:g=()=>null,...m})=>{var N;return nt.jsx(xg,{bounds:[t],...m,children:nt.jsx(qu,{coordinate:t,id:"location-map-marker",onClick:c,onHover:d,onFocus:g,hasPinUrl:((N=r||"")==null?void 0:N.length)>0,children:r?nt.jsx(mg,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var Vc={},Kl={},nf;function By(){if(nf)return Kl;nf=1;var e=yt;const t=e.createContext(null);function n(c,d){let g=null;c!=null&&(g=c[1]);function m(){return d??(g!=null?g.getTheme():null)}return{getTheme:m}}function r(){const c=e.useContext(t);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}return Kl.LexicalComposerContext=t,Kl.createLexicalComposerContext=n,Kl.useLexicalComposerContext=r,Kl}var zl={},rf;function Hy(){if(rf)return zl;rf=1;var e=yt;function t(r){let c=new URLSearchParams;c.append("code",r);for(let d=1;d<arguments.length;d++)c.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${c} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return zl.LexicalComposerContext=n,zl.createLexicalComposerContext=function(r,c){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return c??(d!=null?d.getTheme():null)}}},zl.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},zl}const Wy=process.env.NODE_ENV==="development"?By():Hy();var so=Wy,He={},sf;function Ky(){if(sf)return He;sf=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),c=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),g=e("INSERT_PARAGRAPH_COMMAND"),m=e("CONTROLLED_TEXT_INSERTION_COMMAND"),N=e("PASTE_COMMAND"),T=e("REMOVE_TEXT_COMMAND"),R=e("DELETE_WORD_COMMAND"),b=e("DELETE_LINE_COMMAND"),k=e("FORMAT_TEXT_COMMAND"),z=e("UNDO_COMMAND"),E=e("REDO_COMMAND"),x=e("KEYDOWN_COMMAND"),U=e("KEY_ARROW_RIGHT_COMMAND"),Q=e("MOVE_TO_END"),F=e("KEY_ARROW_LEFT_COMMAND"),W=e("MOVE_TO_START"),G=e("KEY_ARROW_UP_COMMAND"),q=e("KEY_ARROW_DOWN_COMMAND"),le=e("KEY_ENTER_COMMAND"),se=e("KEY_SPACE_COMMAND"),ge=e("KEY_BACKSPACE_COMMAND"),j=e("KEY_ESCAPE_COMMAND"),B=e("KEY_DELETE_COMMAND"),V=e("KEY_TAB_COMMAND"),xe=e("INSERT_TAB_COMMAND"),we=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),ue=e("DROP_COMMAND"),$=e("FORMAT_ELEMENT_COMMAND"),S=e("DRAGSTART_COMMAND"),Y=e("DRAGOVER_COMMAND"),ie=e("DRAGEND_COMMAND"),K=e("COPY_COMMAND"),P=e("CUT_COMMAND"),Z=e("SELECT_ALL_COMMAND"),O=e("CLEAR_EDITOR_COMMAND"),H=e("CLEAR_HISTORY_COMMAND"),J=e("CAN_REDO_COMMAND"),de=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),I=e("BLUR_COMMAND"),w=e("KEY_MODIFIER_COMMAND"),D=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",re=D&&"documentMode"in document?document.documentMode:null,ye=D&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ae=D&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=D&&"InputEvent"in window&&!re?"getTargetRanges"in new window.InputEvent("input"):!1,te=D&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ce=D&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=D&&/Android/.test(navigator.userAgent),Ne=D&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=D&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,Le=1,Fe=3,qe=0,Be=1,ct=2,Mt=0,Ut=1,en=2,Oe=1,ne=2,oe=4,Se=8,Ie=16,De=32,je=64,rt=128,it=Oe|ne|oe|Se|Ie|De|je|rt,st=1,vt=2,Ge=1,ze=2,tt=3,_t=4,Nt=5,Et=6,ht=" ",pt=te||ce||Re?ht:"",$t=`
|
|
37
37
|
|
|
38
|
-
`,Kt=Ae?ht:pt,tn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",jt=new RegExp("^[^"+It+"]*["+tn+"]"),bt=new RegExp("^[^"+tn+"]*["+It+"]"),nn={bold:Oe,code:Ie,highlight:rt,italic:ne,strikethrough:oe,subscript:De,superscript:je,underline:Se},Sr={directionless:st,unmergeable:vt},pi={center:ze,end:Et,justify:_t,left:Ge,right:tt,start:Nt},pe={[ze]:"center",[Et]:"end",[_t]:"justify",[Ge]:"left",[tt]:"right",[Nt]:"start"},Ze={normal:Mt,segmented:en,token:Ut},ot={[Mt]:"normal",[en]:"segmented",[Ut]:"token"},wt=100;let Gt=!1,Bt=0;function Pt(){return Gt}function Lt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&mo(u).addEventListener("textInput",Lt,!0)}function sn(u,s,a){return s.__lexicalLineBreak===u||u[`__lexicalKey_${a._key}`]!==void 0}function ln(u){return u.getEditorState().read(()=>{const s=mn();return s!==null?s.clone():null})}function Rn(u,s,a){const f=or(a._window);let p=null,_=null;f!==null&&f.anchorNode===u&&(p=f.anchorOffset,_=f.focusOffset);const A=u.nodeValue;A!==null&&Ir(s,A,p,_,!1)}function mr(u,s,a){if(Tt(u)){const f=u.anchor.getNode();if(f.is(a)&&u.format!==f.getFormat())return!1}return s.nodeType===Fe&&a.isAttached()}function jn(u,s,a){Gt=!0;const f=performance.now()-Bt>wt;try{Hr(u,()=>{const p=mn()||ln(u),_=new Map,A=u.getRootElement(),M=u._editorState,ae=u._blockCursorElement;let fe=!1,me="";for(let ve=0;ve<s.length;ve++){const Ce=s[ve],Ve=Ce.type,Ue=Ce.target;let $e=ni(Ue,M);if(!($e===null&&Ue!==A||An($e))){if(Ve==="characterData")f&&mt($e)&&mr(p,Ue,$e)&&Rn(Ue,$e,u);else if(Ve==="childList"){fe=!0;const Rt=Ce.addedNodes;for(let qt=0;qt<Rt.length;qt++){const Wt=Rt[qt],At=co(Wt),an=Wt.parentNode;if(an!=null&&Wt!==ae&&At===null&&(Wt.nodeName!=="BR"||!sn(Wt,an,u))){if(Ae){const nr=Wt.innerText||Wt.nodeValue;nr&&(me+=nr)}an.removeChild(Wt)}}const Qe=Ce.removedNodes,ft=Qe.length;if(ft>0){let qt=0;for(let Wt=0;Wt<ft;Wt++){const At=Qe[Wt];(At.nodeName==="BR"&&sn(At,Ue,u)||ae===At)&&(Ue.appendChild(At),qt++)}ft!==qt&&(Ue===A&&($e=ul(M)),_.set(Ue,$e))}}}}if(_.size>0)for(const[ve,Ce]of _)if(et(Ce)){const Ve=Ce.getChildrenKeys();let Ue=ve.firstChild;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=u.getElementByKey(Rt);Qe!==null&&(Ue==null?(ve.appendChild(Qe),Ue=Qe):Ue!==Qe&&ve.replaceChild(Qe,Ue),Ue=Ue.nextSibling)}}else mt(Ce)&&Ce.markDirty();const Te=a.takeRecords();if(Te.length>0){for(let ve=0;ve<Te.length;ve++){const Ce=Te[ve],Ve=Ce.addedNodes,Ue=Ce.target;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=Rt.parentNode;Qe!=null&&Rt.nodeName==="BR"&&!sn(Rt,Ue,u)&&Qe.removeChild(Rt)}}a.takeRecords()}p!==null&&(fe&&(p.dirty=!0,yr(p)),Ae&&El(u)&&p.insertRawText(me))})}finally{Gt=!1}}function dn(u){const s=u._observer;if(s!==null){const a=s.takeRecords();jn(u,a,s)}}function rr(u){Ht(u),u._observer=new MutationObserver((s,a)=>{jn(u,s,a)})}function ir(u,s){const a=u.__mode,f=u.__format,p=u.__style,_=s.__mode,A=s.__format,M=s.__style;return(a===null||a===_)&&(f===null||f===A)&&(p===null||p===M)}function Oi(u,s){const a=u.mergeWithSibling(s),f=Tn()._normalizedNodes;return f.add(u.__key),f.add(s.__key),a}function _r(u){let s=u;if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable()){s.remove();return}let a;for(;(a=s.getPreviousSibling())!==null&&mt(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else if(ir(a,s)){s=Oi(a,s);break}else break;let f;for(;(f=s.getNextSibling())!==null&&mt(f)&&f.isSimpleText()&&!f.isUnmergeable();)if(f.__text==="")f.remove();else if(ir(s,f)){s=Oi(s,f);break}else break}function xs(u){return lo(u.anchor),lo(u.focus),u}function lo(u){for(;u.type==="element";){const s=u.getNode(),a=u.offset;let f,p;if(a===s.getChildrenSize()?(f=s.getChildAtIndex(a-1),p=!0):(f=s.getChildAtIndex(a),p=!1),mt(f)){u.set(f.__key,p?f.getTextContentSize():0,"text");break}else if(!et(f))break;u.set(f.__key,p?f.getChildrenSize():0,"element")}}let sl=1;function Ur(){return""+sl++}function da(u,s){const a=u._nodes.get(s);if(a===void 0)throw Error(`registeredNode: Type ${s} not found`);return a}const ao=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function ts(u){return An(ni(u))}function Ss(u){const s=document.activeElement;if(s===null)return!1;const a=s.nodeName;return An(ni(u))&&(a==="INPUT"||a==="TEXTAREA"||s.contentEditable==="true"&&s.__lexicalEditor==null)}function ns(u,s,a){const f=u.getRootElement();try{return f!==null&&f.contains(s)&&f.contains(a)&&s!==null&&!Ss(s)&&ol(s)===u}catch{return!1}}function ol(u){let s=u;for(;s!=null;){const a=s.__lexicalEditor;if(a!=null)return a;s=po(s)}return null}function bn(u){return jt.test(u)?"rtl":bt.test(u)?"ltr":null}function Wn(u){return u.isToken()||u.isSegmented()}function ti(u){return u.nodeType===Fe}function kr(u){let s=u;for(;s!=null;){if(ti(s))return s;s=s.firstChild}return null}function $n(u,s,a){const f=nn[s];if(a!==null&&(u&f)===(a&f))return u;let p=u^f;return s==="subscript"?p&=-65:s==="superscript"&&(p&=-33),p}function vs(u){return mt(u)||oi(u)||An(u)}function ll(u,s){if(s!=null){u.__key=s;return}ur(),wd();const a=Tn(),f=Ei(),p=Ur();f._nodeMap.set(p,u),et(u)?a._dirtyElements.set(p,!0):a._dirtyLeaves.add(p),a._cloneNotNeeded.add(p),a._dirtyType=Be,u.__key=p}function al(u,s,a){let f=u;for(;f!==null;){if(a.has(f))return;const p=s.get(f);if(p===void 0)break;a.set(f,!1),f=p.__parent}}function Gr(u){const s=u.getParent();if(s!==null){const a=u.getWritable(),f=s.getWritable(),p=u.getPreviousSibling(),_=u.getNextSibling();if(p===null)if(_!==null){const A=_.getWritable();f.__first=_.__key,A.__prev=null}else f.__first=null;else{const A=p.getWritable();if(_!==null){const M=_.getWritable();M.__prev=A.__key,A.__next=M.__key}else A.__next=null;a.__prev=null}if(_===null)if(p!==null){const A=p.getWritable();f.__last=p.__key,A.__next=null}else f.__last=null;else{const A=_.getWritable();if(p!==null){const M=p.getWritable();M.__next=A.__key,A.__prev=M.__key}else A.__prev=null;a.__next=null}f.__size--,a.__parent=null}}function Ai(u){wd();const s=u.getLatest(),a=s.__parent,f=Ei(),p=Tn(),_=f._nodeMap,A=p._dirtyElements;a!==null&&al(a,_,A);const M=s.__key;p._dirtyType=Be,et(u)?A.set(M,!0):p._dirtyLeaves.add(M)}function cl(u){const s=u.getPreviousSibling(),a=u.getNextSibling();s!==null&&Ai(s),a!==null&&Ai(a)}function xn(u){ur();const s=Tn(),a=s._compositionKey;if(u!==a){if(s._compositionKey=u,a!==null){const f=Nn(a);f!==null&&f.getWritable()}if(u!==null){const f=Nn(u);f!==null&&f.getWritable()}}}function sr(){return Lo()?null:Tn()._compositionKey}function Nn(u,s){const f=(s||Ei())._nodeMap.get(u);return f===void 0?null:f}function co(u,s){const a=Tn(),f=u[`__lexicalKey_${a._key}`];return f!==void 0?Nn(f,s):null}function ni(u,s){let a=u;for(;a!=null;){const f=co(a,s);if(f!==null)return f;a=po(a)}return null}function ws(u){const s=u._decorators,a=Object.assign({},s);return u._pendingDecorators=a,a}function uo(u){return u.read(()=>Qn().getTextContent())}function Mi(u,s){Hr(u,()=>{const a=Ei();if(a.isEmpty())return;if(s==="root"){Qn().markDirty();return}const f=a._nodeMap;for(const[,p]of f)p.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Qn(){return ul(Ei())}function ul(u){return u._nodeMap.get("root")}function yr(u){ur();const s=Ei();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 dl(){ur();const u=Tn();dn(u)}function Di(u){const s=Tn(),a=fa(u,s);if(a===null){const f=s.getRootElement();return u===f?Nn("root"):null}return Nn(a)}function fl(u,s){return s?u.getTextContentSize():0}function fa(u,s){let a=u;for(;a!=null;){const f=a[`__lexicalKey_${s._key}`];if(f!==void 0)return f;a=po(a)}return null}function Os(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Ri(u){const s=[];let a=u;for(;a!==null;)s.push(a),a=a._parentEditor;return s}function hl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function fo(u){return u.nodeType===Fe?u.nodeValue:null}function As(u,s,a){const f=or(s._window);if(f===null)return;const p=f.anchorNode;let{anchorOffset:_,focusOffset:A}=f;if(p!==null){let M=fo(p);const ae=ni(p);if(M!==null&&mt(ae)){if(M===pt&&a){const fe=a.length;M=a,_=fe,A=fe}M!==null&&Ir(ae,M,_,A,u)}}}function Ir(u,s,a,f,p){let _=u;if(_.isAttached()&&(p||!_.isDirty())){const A=_.isComposing();let M=s;(A||p)&&s[s.length-1]===pt&&(M=s.slice(0,-1));const ae=_.getTextContent();if(p||M!==ae){if(M===""){if(xn(null),!te&&!ce&&!Re){const Ue=Tn();setTimeout(()=>{Ue.update(()=>{_.isAttached()&&_.remove()})},20)}else _.remove();return}const fe=_.getParent(),me=Io(),Te=_.getTextContentSize(),ve=sr(),Ce=_.getKey();if(_.isToken()||ve!==null&&Ce===ve&&!A||Tt(me)&&(fe!==null&&!fe.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!_.canInsertTextBefore()&&!A||me.focus.key===u.__key&&me.focus.offset===Te&&!_.canInsertTextAfter()&&!A)){_.markDirty();return}const Ve=mn();if(!Tt(Ve)||a===null||f===null){_.setTextContent(M);return}if(Ve.setTextNodeRange(_,a,_,f),_.isSegmented()){const Ue=_.getTextContent(),$e=On(Ue);_.replace($e),_=$e}_.setTextContent(M)}}}function gl(u){const s=u.getPreviousSibling();return(mt(s)||et(s)&&s.isInline())&&!s.canInsertTextAfter()}function Ms(u,s){if(s.isSegmented())return!0;if(!u.isCollapsed())return!1;const a=u.anchor.offset,f=s.getParentOrThrow(),p=s.isToken();return a===0?!s.canInsertTextBefore()||!f.canInsertTextBefore()||p||gl(s):a===s.getTextContentSize()?!s.canInsertTextAfter()||!f.canInsertTextAfter()||p:!1}function ha(u,s,a,f){return u===9&&!s&&!a&&!f}function ga(u,s,a,f){return u===66&&!s&&Yr(a,f)}function rs(u,s,a,f){return u===73&&!s&&Yr(a,f)}function Ds(u,s,a,f){return u===85&&!s&&Yr(a,f)}function pl(u,s){return Sa(u)&&!s}function ml(u,s){return Sa(u)&&s}function Rs(u,s){return ye&&s&&u===79}function bs(u,s,a){return jr(u)&&(ye?s:a)}function pa(u,s,a){return ki(u)&&(ye?s:a)}function ma(u,s){return ye&&s&&jr(u)}function _a(u,s){return ye&&s&&ki(u)}function ya(u,s,a,f){return ye?s||a?!1:jr(u)||u===72&&f:f||s||a?!1:jr(u)}function Oc(u,s,a,f,p){return ye?a||f||p?!1:ki(u)||u===68&&s:s||f||p?!1:ki(u)}function Ac(u,s,a,f){return u===90&&!s&&Yr(a,f)}function Na(u,s,a,f){return ye?u===90&&a&&s:u===89&&f||u===90&&f&&s}function Mc(u,s,a,f){return s?!1:u===67?ye?a:f:!1}function Dc(u,s,a,f){return s?!1:u===88?ye?a:f:!1}function Ca(u){return u===37}function Ea(u){return u===39}function _l(u){return u===38}function Rc(u){return u===40}function bc(u,s,a,f){return Ca(u)&&!s&&!f&&!a}function Ta(u,s,a,f,p){return Ca(u)&&!f&&!a&&(s||p)}function is(u,s,a,f){return Ea(u)&&!s&&!f&&!a}function xa(u,s,a,f,p){return Ea(u)&&!f&&!a&&(s||p)}function kc(u,s,a){return _l(u)&&!s&&!a}function yl(u,s,a){return Rc(u)&&!s&&!a}function ks(u,s,a,f){return u||s||a||f}function Ic(u){return u===32}function Yr(u,s){return ye?u:s}function Sa(u){return u===13}function jr(u){return u===8}function bi(u){return u===27}function ki(u){return u===46}function ho(u,s,a){return u===65&&Yr(s,a)}function Nl(){const u=Qn(),s=u.select(0,u.getChildrenSize());yr(xs(s))}function Ii(u,s){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const a=u.__lexicalClassNameCache,f=a[s];if(f!==void 0)return f;const p=u[s];if(typeof p=="string"){const _=p.split(" ");return a[s]=_,_}return p}function ss(u,s,a,f,p){if(a.size===0)return;const _=f.__type,A=f.__key,M=s.get(_);if(M===void 0)throw Error(`Type ${_} not in registeredNodes`);const ae=M.klass;let fe=u.get(ae);fe===void 0&&(fe=new Map,u.set(ae,fe));const me=fe.get(A),Te=me==="destroyed"&&p==="created";(me===void 0||Te)&&fe.set(A,Te?"updated":p)}function Li(u){const s=Ei(),a=s._readOnly,f=u.getType(),p=s._nodeMap,_=[];for(const[,A]of p)A instanceof u&&A.__type===f&&(a||A.isAttached())&&_.push(A);return _}function va(u,s,a){const f=u.getParent();let p=a,_=u;return f!==null&&(s&&a===0?(p=_.getIndexWithinParent(),_=f):!s&&a===_.getChildrenSize()&&(p=_.getIndexWithinParent()+1,_=f)),_.getChildAtIndex(s?p-1:p)}function Cl(u,s){const a=u.offset;if(u.type==="element"){const f=u.getNode();return va(f,s,a)}else{const f=u.getNode();if(s&&a===0||!s&&a===f.getTextContentSize()){const p=s?f.getPreviousSibling():f.getNextSibling();return p===null?va(f.getParentOrThrow(),s,f.getIndexWithinParent()+(s?0:1)):p}}return null}function El(u){const s=mo(u).event,a=s&&s.inputType;return a==="insertFromPaste"||a==="insertFromPasteAsQuotation"}function ut(u,s,a){return Rd(u,s,a)}function go(u){return!Wr(u)&&!u.isLastChild()&&!u.isInline()}function Is(u,s){const a=u._keyToDOMMap.get(s);if(a===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${s}`);return a}function po(u){const s=u.assignedSlot||u.parentElement;return s!==null&&s.nodeType===11?s.host:s}function mi(u,s,a){const f=a.ownerDocument,p=f.defaultView;if(p===null)return;let{top:_,bottom:A}=s,M=0,ae=0,fe=a;for(;fe!==null;){const me=fe===f.body;if(me)M=0,ae=mo(u).innerHeight;else{const ve=fe.getBoundingClientRect();M=ve.top,ae=ve.bottom}let Te=0;if(_<M?Te=-(M-_):A>ae&&(Te=A-ae),Te!==0)if(me)p.scrollBy(0,Te);else{const ve=fe.scrollTop;fe.scrollTop+=Te;const Ce=fe.scrollTop-ve;_-=Ce,A-=Ce}if(me)break;fe=po(fe)}}function Kn(u){return Tn()._updateTags.has(u)}function Ct(u){ur(),Tn()._updateTags.add(u)}function os(u){const s=mn();if(!Tt(s)||!et(u))return s;const{anchor:a,focus:f}=s,p=a.getNode(),_=f.getNode();return Pi(p,u)&&a.set(u.__key,0,"element"),Pi(_,u)&&f.set(u.__key,0,"element"),s}function Pi(u,s){let a=u.getParent();for(;a!==null;){if(a.is(s))return!0;a=a.getParent()}return!1}function wa(u){const s=u.ownerDocument;return s&&s.defaultView||null}function mo(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function Lr(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function _o(u){let s=u.getParentOrThrow();for(;s!==null;){if(ri(s))return s;s=s.getParentOrThrow()}return s}function ri(u){return Wr(u)||et(u)&&u.isShadowRoot()}function Tl(u){const s=u.constructor.clone(u);return ll(s,null),s}function vr(u){const s=Tn(),a=u.constructor.getType(),f=s._nodes.get(a);if(f===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 p=f.replace;if(p!==null){const _=p(u);if(!(_ instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return _}return u}function Ls(u,s){const a=u.getParent();if(Wr(a)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function yo(u){const s=u.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let f=s.blockCursor;if(f!==void 0){if(typeof f=="string"){const p=f.split(" ");f=s.blockCursor=p}f!==void 0&&a.classList.add(...f)}return a}function Dt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function Ps(u,s,a){a.style.removeProperty("caret-color"),s._blockCursorElement=null;const f=u.parentElement;f!==null&&f.removeChild(u)}function _i(u,s,a){let f=u._blockCursorElement;if(Tt(a)&&a.isCollapsed()&&a.anchor.type==="element"&&s.contains(document.activeElement)){const p=a.anchor,_=p.getNode(),A=p.offset,M=_.getChildrenSize();let ae=!1,fe=null;if(A===M){const me=_.getChildAtIndex(A-1);Dt(me)&&(ae=!0)}else{const me=_.getChildAtIndex(A);if(Dt(me)){const Te=me.getPreviousSibling();(Te===null||Dt(Te))&&(ae=!0,fe=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(_.__key);f===null&&(u._blockCursorElement=f=yo(u._config)),s.style.caretColor="transparent",fe===null?me.appendChild(f):me.insertBefore(f,fe);return}}f!==null&&Ps(f,u,s)}function or(u){return D?(u||window).getSelection():null}function Oa(u,s){let a=u.getChildAtIndex(s);if(a==null&&(a=u),ri(u))throw Error("Can not call $splitNode() on root element");const f=A=>{const M=A.getParentOrThrow(),ae=ri(M),fe=A===a&&!ae?A:Tl(A);if(ae){if(!(et(A)&&et(fe)))throw Error("Children of a root must be ElementNode");return A.insertAfter(fe),[A,fe,fe]}else{const[me,Te,ve]=f(M),Ce=A.getNextSiblings();return ve.append(fe,...Ce),[me,Te,fe]}},[p,_]=f(a);return[p,_]}function No(u,s){let a=u;for(;a!==Qn()&&a!=null;){if(s(a))return a;a=a.getParent()}return null}function Aa(u){return $s(u)&&u.tagName==="A"}function $s(u){return u.nodeType===1}function $i(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||ri(u))return!1;const s=u.getFirstChild(),a=s===null||oi(s)||mt(s)||s.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&a}function Co(u,s){let a=u;for(;a!==null&&a.getParent()!==null&&!s(a);)a=a.getParentOrThrow();return s(a)?a:null}function Ma(u,s){const a=u._decorators;let p=u._pendingDecorators||a;const _=s._nodeMap;let A;for(A in p)_.has(A)||(p===a&&(p=ws(u)),delete p[A])}function xl(u,s,a,f,p,_){let A=u.getFirstChild();for(;A!==null;){const M=A.__key;A.__parent===s&&(et(A)&&xl(A,M,a,f,p,_),a.has(M)||_.delete(M),p.push(M)),A=A.getNextSibling()}}function Sl(u,s,a,f){const p=u._nodeMap,_=s._nodeMap,A=[];for(const[M]of f){const ae=_.get(M);ae!==void 0&&(ae.isAttached()||(et(ae)&&xl(ae,M,p,_,A,f),p.has(M)||f.delete(M),A.push(M)))}for(const M of A)_.delete(M);for(const M of a){const ae=_.get(M);ae!==void 0&&!ae.isAttached()&&(p.has(M)||a.delete(M),_.delete(M))}}let kn="",zn="",Vt="",Nr,Fn,ls,Da=!1,as=!1,Fs,Bs=null,Hs,vl,Fi,hn,wn,Bn;function cs(u,s){const a=Fi.get(u);if(s!==null){const f=xo(u);f.parentNode===s&&s.removeChild(f)}if(hn.has(u)||Fn._keyToDOMMap.delete(u),et(a)){const f=Ni(a,Fi);Bi(f,0,f.length-1,null)}a!==void 0&&ss(Bn,ls,Fs,a,"destroyed")}function Bi(u,s,a,f){let p=s;for(;p<=a;++p){const _=u[p];_!==void 0&&cs(_,f)}}function yi(u,s){u.setProperty("text-align",s)}const us="40px";function Vn(u,s){const a=Nr.theme.indent;if(typeof a=="string"){const p=u.classList.contains(a);s>0&&!p?u.classList.add(a):s<1&&p&&u.classList.remove(a)}const f=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||us;u.style.setProperty("padding-inline-start",s===0?"":`calc(${s} * ${f})`)}function Pr(u,s){const a=u.style;s===0?yi(a,""):s===Ge?yi(a,"left"):s===ze?yi(a,"center"):s===tt?yi(a,"right"):s===_t?yi(a,"justify"):s===Nt?yi(a,"start"):s===Et&&yi(a,"end")}function fn(u,s,a){const f=hn.get(u);if(f===void 0)throw Error("createNode: node does not exist in nodeMap");const p=f.createDOM(Nr,Fn);if(Je(u,p,Fn),mt(f)?p.setAttribute("data-lexical-text","true"):An(f)&&p.setAttribute("data-lexical-decorator","true"),et(f)){const _=f.__indent,A=f.__size;if(_!==0&&Vn(p,_),A!==0){const ae=A-1,fe=Ni(f,hn);Ra(fe,ae,f,p)}const M=f.__format;M!==0&&Pr(p,M),f.isInline()||Eo(null,f,p),go(f)&&(kn+=$t,Vt+=$t)}else{const _=f.getTextContent();if(An(f)){const A=f.decorate(Fn,Nr);A!==null&&Al(u,A),p.contentEditable="false"}else mt(f)&&(f.isDirectionless()||(zn+=_));kn+=_,Vt+=_}if(s!==null)if(a!=null)s.insertBefore(p,a);else{const _=s.__lexicalLineBreak;_!=null?s.insertBefore(p,_):s.appendChild(p)}return Object.freeze(f),ss(Bn,ls,Fs,f,"created"),p}function Ra(u,s,a,f){const p=zn;zn="",wl(u,a,0,s,f,null),Ol(a,f),zn=p}function wl(u,s,a,f,p,_){const A=kn;kn="";let M=a;for(;M<=f;++M)fn(u[M],p,_);go(s)&&(kn+=$t),p.__lexicalTextContent=kn,kn=A+kn}function ba(u,s){const a=s.get(u);return oi(a)||An(a)&&a.isInline()}function Eo(u,s,a){const f=u!==null&&(u.__size===0||ba(u.__last,Fi)),p=s.__size===0||ba(s.__last,hn);if(f){if(!p){const _=a.__lexicalLineBreak;_!=null&&a.removeChild(_),a.__lexicalLineBreak=null}}else if(p){const _=document.createElement("br");a.__lexicalLineBreak=_,a.appendChild(_)}}function Ol(u,s){const a=s.__lexicalDirTextContent,f=s.__lexicalDir;if(a!==zn||f!==Bs){const p=zn==="",_=p?Bs:bn(zn);if(_!==f){const A=s.classList,M=Nr.theme;let ae=f!==null?M[f]:void 0,fe=_!==null?M[_]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=M[f]=me}A.remove(...ae)}if(_===null||p&&_==="ltr")s.removeAttribute("dir");else{if(fe!==void 0){if(typeof fe=="string"){const me=fe.split(" ");fe=M[_]=me}fe!==void 0&&A.add(...fe)}s.dir=_}if(!as){const me=u.getWritable();me.__dir=_}}Bs=_,s.__lexicalDirTextContent=zn,s.__lexicalDir=_}}function Hi(u,s,a){const f=zn;zn="",at(u,s,a),Ol(s,a),zn=f}function Ni(u,s){const a=[];let f=u.__first;for(;f!==null;){const p=s.get(f);if(p===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");a.push(f),f=p.__next}return a}function at(u,s,a){const f=kn,p=u.__size,_=s.__size;if(kn="",p===1&&_===1){const A=u.__first,M=s.__first;if(A===M)ds(A,a);else{const ae=xo(A),fe=fn(M,null,null);a.replaceChild(fe,ae),cs(A,null)}}else{const A=Ni(u,Fi),M=Ni(s,hn);if(p===0)_!==0&&wl(M,s,0,_-1,a,null);else if(_===0){if(p!==0){const fe=a.__lexicalLineBreak==null;Bi(A,0,p-1,fe?null:a),fe&&(a.textContent="")}}else Cn(s,A,M,p,_,a)}go(s)&&(kn+=$t),a.__lexicalTextContent=kn,kn=f+kn}function ds(u,s){const a=Fi.get(u);let f=hn.get(u);if(a===void 0||f===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const p=Da||vl.has(u)||Hs.has(u),_=Is(Fn,u);if(a===f&&!p){if(et(a)){const A=_.__lexicalTextContent;A!==void 0&&(kn+=A,Vt+=A);const M=_.__lexicalDirTextContent;M!==void 0&&(zn+=M)}else{const A=a.getTextContent();mt(a)&&!a.isDirectionless()&&(zn+=A),Vt+=A,kn+=A}return _}if(a!==f&&p&&ss(Bn,ls,Fs,f,"updated"),f.updateDOM(a,_,Nr)){const A=fn(u,null,null);if(s===null)throw Error("reconcileNode: parentDOM is null");return s.replaceChild(A,_),cs(u,null),A}if(et(a)&&et(f)){const A=f.__indent;A!==a.__indent&&Vn(_,A);const M=f.__format;M!==a.__format&&Pr(_,M),p&&(Hi(a,f,_),!Wr(f)&&!f.isInline()&&Eo(a,f,_)),go(f)&&(kn+=$t,Vt+=$t)}else{const A=f.getTextContent();if(An(f)){const M=f.decorate(Fn,Nr);M!==null&&Al(u,M)}else mt(f)&&!f.isDirectionless()&&(zn+=A);kn+=A,Vt+=A}if(!as&&Wr(f)&&f.__cachedText!==Vt){const A=f.getWritable();A.__cachedText=Vt,f=A}return Object.freeze(f),_}function Al(u,s){let a=Fn._pendingDecorators;const f=Fn._decorators;if(a===null){if(f[u]===s)return;a=ws(Fn)}a[u]=s}function Cr(u){return u.firstChild}function To(u){let s=u.nextSibling;return s!==null&&s===Fn._blockCursorElement&&(s=s.nextSibling),s}function Cn(u,s,a,f,p,_){const A=f-1,M=p-1;let ae,fe,me=Cr(_),Te=0,ve=0;for(;Te<=A&&ve<=M;){const Ue=s[Te],$e=a[ve];if(Ue===$e)me=To(ds($e,_)),Te++,ve++;else{ae===void 0&&(ae=new Set(s)),fe===void 0&&(fe=new Set(a));const Rt=fe.has(Ue),Qe=ae.has($e);if(!Rt)me=To(xo(Ue)),cs(Ue,_),Te++;else if(!Qe)fn($e,_,me),ve++;else{const ft=Is(Fn,$e);ft===me?me=To(ds($e,_)):(me!=null?_.insertBefore(ft,me):_.appendChild(ft),ds($e,_)),Te++,ve++}}}const Ce=Te>A,Ve=ve>M;if(Ce&&!Ve){const Ue=a[M+1],$e=Ue===void 0?null:Fn.getElementByKey(Ue);wl(a,u,ve,M,_,$e)}else Ve&&!Ce&&Bi(s,Te,A,_)}function Wi(u,s,a,f,p,_){kn="",Vt="",zn="",Da=f===ct,Bs=null,Fn=a,Nr=a._config,ls=a._nodes,Fs=Fn._listeners.mutation,Hs=p,vl=_,Fi=u._nodeMap,hn=s._nodeMap,as=s._readOnly,wn=new Map(a._keyToDOMMap);const A=new Map;return Bn=A,ds("root",null),Fn=void 0,ls=void 0,Hs=void 0,vl=void 0,Fi=void 0,hn=void 0,Nr=void 0,wn=void 0,Bn=void 0,A}function Je(u,s,a){const f=a._keyToDOMMap;s["__lexicalKey_"+a._key]=u,f.set(u,s)}function xo(u){const s=wn.get(u);if(s===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return s}const lr=Object.freeze({}),er=30,Ml=[["keydown",he],["pointerdown",kl],["compositionstart",C],["compositionend",X],["input",y],["click",ka],["cut",lr],["copy",lr],["dragstart",lr],["dragover",lr],["dragend",lr],["paste",lr],["focus",lr],["blur",lr],["drop",lr]];ee&&Ml.push(["beforeinput",(u,s)=>h(u,s)]);let Ki=0,Dl=0,Ws=0,$r=null,Ks=0,Fr=!1,So=!1,zs=!1,Us=!1,vo=[0,"",0,"root",0];function zi(u,s,a,f,p){const _=u.anchor,A=u.focus,M=_.getNode(),ae=Tn(),fe=or(ae._window),me=fe!==null?fe.anchorNode:null,Te=_.key,ve=ae.getElementByKey(Te),Ce=a.length;return Te!==A.key||!mt(M)||(!p&&(!ee||Ws<f+50)||M.isDirty()&&Ce<2||Os(a))&&_.offset!==A.offset&&!M.isComposing()||Wn(M)||M.isDirty()&&Ce>1||(p||!ee)&&ve!==null&&!M.isComposing()&&me!==kr(ve)||fe!==null&&s!==null&&(!s.collapsed||s.startContainer!==fe.anchorNode||s.startOffset!==fe.anchorOffset)||M.getFormat()!==u.format||M.getStyle()!==u.style||Ms(u,M)}function Rl(u,s){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&s!==0&&s!==u.nodeValue.length}function bl(u,s,a){const{anchorNode:f,anchorOffset:p,focusNode:_,focusOffset:A}=u;Fr&&(Fr=!1,Rl(f,p)&&Rl(_,A))||Hr(s,()=>{if(!a){yr(null);return}if(!ns(s,f,_))return;const M=mn();if(Tt(M)){const ae=M.anchor,fe=ae.getNode();if(M.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&(M.dirty=!0);const me=mo(s).event,Te=me?me.timeStamp:performance.now(),[ve,Ce,Ve,Ue,$e]=vo,Rt=Qn(),Qe=s.isComposing()===!1&&Rt.getTextContent()==="";if(Te<$e+200&&ae.offset===Ve&&ae.key===Ue)M.format=ve,M.style=Ce;else if(ae.type==="text"){if(!mt(fe))throw Error("Point.getNode() must return TextNode when type is text");M.format=fe.getFormat(),M.style=fe.getStyle()}else ae.type==="element"&&!Qe&&(M.format=0,M.style="")}else{let me=it,Te=!1;const ve=M.getNodes(),Ce=ve.length;for(let Ve=0;Ve<Ce;Ve++){const Ue=ve[Ve];if(mt(Ue)&&(Te=!0,me&=Ue.getFormat(),me===0))break}M.format=Te?me:0}}ut(s,t,void 0)})}function ka(u,s){Hr(s,()=>{const a=mn(),f=or(s._window),p=Io();if(f){if(Tt(a)){const _=a.anchor,A=_.getNode();if(_.type==="element"&&_.offset===0&&a.isCollapsed()&&!Wr(A)&&Qn().getChildrenSize()===1&&A.getTopLevelElementOrThrow().isEmpty()&&p!==null&&a.is(p))f.removeAllRanges(),a.dirty=!0;else if(u.detail===3&&!a.isCollapsed()){const ae=a.focus.getNode();A!==ae&&(et(A)?A.select(0):A.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const _=f.anchorNode;if(_!==null){const A=_.nodeType;if(A===Le||A===Fe){const M=$c(p,f,s,u);yr(M)}}}}ut(s,r,u)})}function kl(u,s){const a=u.target,f=u.pointerType;a instanceof Node&&f!=="touch"&&Hr(s,()=>{ts(a)||(So=!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 l(u){return Dl===229&&u<Ki+er}function h(u,s){const a=u.inputType,f=o(u);a==="deleteCompositionText"||Ae&&El(s)||a!=="insertCompositionText"&&Hr(s,()=>{const p=mn();if(a==="deleteContentBackward"){if(p===null){const me=Io();if(!Tt(me))return;yr(me.clone())}if(Tt(p)){if(be&&xn(p.anchor.key),l(u.timeStamp)&&s.isComposing()&&p.anchor.key===p.focus.key){if(xn(null),Ki=0,setTimeout(()=>{Hr(s,()=>{xn(null)})},er),Tt(p)){const Te=p.anchor.getNode();if(Te.markDirty(),p.format=Te.getFormat(),!mt(Te))throw Error("Anchor node must be a TextNode");p.style=Te.getStyle()}p.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),ut(s,c,!0))}else xn(null),u.preventDefault(),ut(s,c,!0);return}}if(!Tt(p))return;const _=u.data;$r!==null&&As(!1,s,$r),(!p.dirty||$r!==null)&&p.isCollapsed()&&!Wr(p.anchor.getNode())&&f!==null&&p.applyDOMRange(f),$r=null;const A=p.anchor,M=p.focus,ae=A.getNode(),fe=M.getNode();if(a==="insertText"||a==="insertTranspose"){if(_===`
|
|
39
|
-
`)u.preventDefault(),ut(s,d,!1);else if(_===$t)u.preventDefault(),ut(s,g,void 0);else if(_==null&&u.dataTransfer){const me=u.dataTransfer.getData("text/plain");u.preventDefault(),p.insertRawText(me)}else _!=null&&
|
|
40
|
-
`){const f=mn();if(Tt(f)){const p=f.focus;f.anchor.set(p.key,p.offset,p.type),ut(u,le,null);return}}}As(!0,u,s)}function X(u,s){Ae?Us=!0:Hr(s,()=>{v(s,u.data)})}function he(u,s){if(Ki=u.timeStamp,Dl=u.keyCode,s.isComposing())return;const{keyCode:a,shiftKey:f,ctrlKey:p,metaKey:_,altKey:A}=u;if(!ut(s,x,u)){if(is(a,p,A,_))ut(s,U,u);else if(xa(a,p,f,A,_))ut(s,Q,u);else if(bc(a,p,A,_))ut(s,F,u);else if(Ta(a,p,f,A,_))ut(s,W,u);else if(kc(a,p,_))ut(s,G,u);else if(yl(a,p,_))ut(s,q,u);else if(ml(a,f))zs=!0,ut(s,le,u);else if(Ic(a))ut(s,se,u);else if(Rs(a,p))u.preventDefault(),zs=!0,ut(s,d,!0);else if(pl(a,f))zs=!1,ut(s,le,u);else if(ya(a,A,_,p))jr(a)?ut(s,ge,u):(u.preventDefault(),ut(s,c,!0));else if(bi(a))ut(s,j,u);else if(Oc(a,p,f,A,_))ki(a)?ut(s,B,u):(u.preventDefault(),ut(s,c,!1));else if(bs(a,A,p))u.preventDefault(),ut(s,R,!0);else if(pa(a,A,p))u.preventDefault(),ut(s,R,!1);else if(ma(a,_))u.preventDefault(),ut(s,b,!0);else if(_a(a,_))u.preventDefault(),ut(s,b,!1);else if(ga(a,A,_,p))u.preventDefault(),ut(s,k,"bold");else if(Ds(a,A,_,p))u.preventDefault(),ut(s,k,"underline");else if(rs(a,A,_,p))u.preventDefault(),ut(s,k,"italic");else if(ha(a,A,p,_))ut(s,V,u);else if(Ac(a,f,_,p))u.preventDefault(),ut(s,z,void 0);else if(Na(a,f,_,p))u.preventDefault(),ut(s,E,void 0);else{const M=s._editorState._selection;Br(M)?Mc(a,f,_,p)?(u.preventDefault(),ut(s,K,u)):Dc(a,f,_,p)?(u.preventDefault(),ut(s,P,u)):ho(a,_,p)&&(u.preventDefault(),ut(s,Z,u)):!Ae&&ho(a,_,p)&&(u.preventDefault(),ut(s,Z,u))}ks(p,f,A,_)&&ut(s,w,u)}}function Me(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,a=s==null?null:s.nodeType===9?s.defaultView:s.ownerDocument.defaultView,f=or(a);if(f===null)return;const p=ol(f.anchorNode);if(p===null)return;So&&(So=!1,Hr(p,()=>{const me=Io(),Te=f.anchorNode;if(Te===null)return;const ve=Te.nodeType;if(ve!==Le&&ve!==Fe)return;const Ce=$c(me,f,p,u);yr(Ce)}));const _=Ri(p),A=_[_.length-1],M=A._key,ae=Ye.get(M),fe=ae||A;fe!==p&&bl(f,fe,!1),bl(f,p,!0),p!==A?Ye.set(M,p):ae&&Ye.delete(M)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function gt(u,s){Ks===0&&u.ownerDocument.addEventListener("selectionchange",Xe),Ks++,u.__lexicalEditor=s;const a=Me(u);for(let f=0;f<Ml.length;f++){const[p,_]=Ml[f],A=typeof _=="function"?M=>{Pe(M)||(Ke(M),s.isEditable()&&_(M,s))}:M=>{if(!Pe(M)&&(Ke(M),s.isEditable()))switch(p){case"cut":return ut(s,P,M);case"copy":return ut(s,K,M);case"paste":return ut(s,N,M);case"dragstart":return ut(s,S,M);case"dragover":return ut(s,Y,M);case"dragend":return ut(s,ie,M);case"focus":return ut(s,_e,M);case"blur":return ut(s,I,M);case"drop":return ut(s,ue,M)}};u.addEventListener(p,A),a.push(()=>{u.removeEventListener(p,A)})}}function Ot(u){Ks!==0&&(Ks--,Ks===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const s=u.__lexicalEditor;s!=null&&(Ft(s),u.__lexicalEditor=null);const a=Me(u);for(let f=0;f<a.length;f++)a[f]();u.__lexicalEventHandles=[]}function Ft(u){if(u._parentEditor!==null){const s=Ri(u),f=s[s.length-1]._key;Ye.get(f)===u&&Ye.delete(f)}else Ye.delete(u._key)}function zt(){Fr=!0}function Un(u,s,a,f,p){vo=[u,s,a,f,p]}function wr(u,s,a){ur();const f=u.__key,p=u.getParent();if(p===null)return;const _=os(u);let A=!1;if(Tt(_)&&s){const M=_.anchor,ae=_.focus;M.key===f&&(Wa(M,u,p,u.getPreviousSibling(),u.getNextSibling()),A=!0),ae.key===f&&(Wa(ae,u,p,u.getPreviousSibling(),u.getNextSibling()),A=!0)}else Br(_)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(_)&&s&&!A){const M=u.getIndexWithinParent();Gr(u),Ha(_,p,M,-1)}else Gr(u);!a&&!ri(p)&&!p.canBeEmpty()&&p.isEmpty()&&wr(p,s),s&&Wr(p)&&p.isEmpty()&&p.selectEnd()}class ii{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,ll(this,s),this.__type!=="root"&&(ur(),si(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 a=Nn(s);if(a===null)break;s=a.__parent}return!1}isSelected(s){const a=s||mn();if(a==null)return!1;const f=a.getNodes().some(p=>p.__key===this.__key);return mt(this)?f:Tt(a)&&a.anchor.type==="element"&&a.focus.type==="element"&&a.anchor.key===a.focus.key&&a.anchor.offset===a.focus.offset?!1:f}getKey(){return this.__key}getIndexWithinParent(){const s=this.getParent();if(s===null)return-1;let a=s.getFirstChild(),f=0;for(;a!==null;){if(this.is(a))return f;f++,a=a.getNextSibling()}return-1}getParent(){const s=this.getLatest().__parent;return s===null?null:Nn(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 a=s.getParent();if(ri(a)){if(!et(s))throw Error("Children of root nodes must be elements");return s}s=a}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 a=this.getParent();for(;a!==null;)s.push(a),a=a.getParent();return s}getParentKeys(){const s=[];let a=this.getParent();for(;a!==null;)s.push(a.__key),a=a.getParent();return s}getPreviousSibling(){const a=this.getLatest().__prev;return a===null?null:Nn(a)}getPreviousSiblings(){const s=[],a=this.getParent();if(a===null)return s;let f=a.getFirstChild();for(;f!==null&&!f.is(this);)s.push(f),f=f.getNextSibling();return s}getNextSibling(){const a=this.getLatest().__next;return a===null?null:Nn(a)}getNextSiblings(){const s=[];let a=this.getNextSibling();for(;a!==null;)s.push(a),a=a.getNextSibling();return s}getCommonAncestor(s){const a=this.getParents(),f=s.getParents();et(this)&&a.unshift(this),et(s)&&f.unshift(s);const p=a.length,_=f.length;if(p===0||_===0||a[p-1]!==f[_-1])return null;const A=new Set(f);for(let M=0;M<p;M++){const ae=a[M];if(A.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 a=this.getCommonAncestor(s);let f=0,p=0,_=this;for(;;){const A=_.getParentOrThrow();if(A===a){f=_.getIndexWithinParent();break}_=A}for(_=s;;){const A=_.getParentOrThrow();if(A===a){p=_.getIndexWithinParent();break}_=A}return f<p}isParentOf(s){const a=this.__key;if(a===s.__key)return!1;let f=s;for(;f!==null;){if(f.__key===a)return!0;f=f.getParent()}return!1}getNodesBetween(s){const a=this.isBefore(s),f=[],p=new Set;let _=this;for(;;){const A=_.__key;if(p.has(A)||(p.add(A),f.push(_)),_===s)break;const M=et(_)?a?_.getFirstChild():_.getLastChild():null;if(M!==null){_=M;continue}const ae=a?_.getNextSibling():_.getPreviousSibling();if(ae!==null){_=ae;continue}const fe=_.getParentOrThrow();if(p.has(fe.__key)||f.push(fe),fe===s)break;let me=null,Te=fe;do{if(Te===null)throw Error("getNodesBetween: ancestor is null");me=a?Te.getNextSibling():Te.getPreviousSibling(),Te=Te.getParent(),Te!==null&&me===null&&!p.has(Te.__key)&&f.push(Te)}while(me===null);_=me}return a||f.reverse(),f}isDirty(){const a=Tn()._dirtyLeaves;return a!==null&&a.has(this.__key)}getLatest(){const s=Nn(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(){ur();const s=Ei(),a=Tn(),f=s._nodeMap,p=this.__key,_=this.getLatest(),A=_.__parent,M=a._cloneNotNeeded,ae=mn();if(ar(ae)&&ae.setCachedNodes(null),M.has(p))return Ai(_),_;const me=_.constructor.clone(_);return me.__parent=A,me.__next=_.__next,me.__prev=_.__prev,et(_)&&et(me)?(me.__first=_.__first,me.__last=_.__last,me.__size=_.__size,me.__indent=_.__indent,me.__format=_.__format,me.__dir=_.__dir):mt(_)&&mt(me)&&(me.__format=_.__format,me.__style=_.__style,me.__mode=_.__mode,me.__detail=_.__detail),M.add(p),me.__key=p,Ai(me),f.set(p,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(s,a){throw Error("createDOM: base method not extended")}updateDOM(s,a,f){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){wr(this,!0,s)}replace(s,a){ur();let f=mn();f!==null&&(f=f.clone()),Ls(this,s);const p=this.getLatest(),_=this.__key,A=s.__key,M=s.getWritable(),ae=this.getParentOrThrow().getWritable(),fe=ae.__size;Gr(M);const me=p.getPreviousSibling(),Te=p.getNextSibling(),ve=p.__prev,Ce=p.__next,Ve=p.__parent;if(wr(p,!1,!0),me===null)ae.__first=A;else{const Ue=me.getWritable();Ue.__next=A}if(M.__prev=ve,Te===null)ae.__last=A;else{const Ue=Te.getWritable();Ue.__prev=A}if(M.__next=Ce,M.__parent=Ve,ae.__size=fe,a){if(!(et(this)&&et(M)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Ue=>{M.append(Ue)})}if(Tt(f)){yr(f);const Ue=f.anchor,$e=f.focus;Ue.key===_&&pn(Ue,M),$e.key===_&&pn($e,M)}return sr()===_&&xn(A),M}insertAfter(s,a=!0){ur(),Ls(this,s);const f=this.getWritable(),p=s.getWritable(),_=p.getParent(),A=mn();let M=!1,ae=!1;if(_!==null){const Ce=s.getIndexWithinParent();if(Gr(p),Tt(A)){const Ve=_.__key,Ue=A.anchor,$e=A.focus;M=Ue.type==="element"&&Ue.key===Ve&&Ue.offset===Ce+1,ae=$e.type==="element"&&$e.key===Ve&&$e.offset===Ce+1}}const fe=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),Te=p.__key,ve=f.__next;if(fe===null)me.__last=Te;else{const Ce=fe.getWritable();Ce.__prev=Te}if(me.__size++,f.__next=Te,p.__next=ve,p.__prev=f.__key,p.__parent=f.__parent,a&&Tt(A)){const Ce=this.getIndexWithinParent();Ha(A,me,Ce+1);const Ve=me.__key;M&&A.anchor.set(Ve,Ce+2,"element"),ae&&A.focus.set(Ve,Ce+2,"element")}return s}insertBefore(s,a=!0){ur(),Ls(this,s);const f=this.getWritable(),p=s.getWritable(),_=p.__key;Gr(p);const A=this.getPreviousSibling(),M=this.getParentOrThrow().getWritable(),ae=f.__prev,fe=this.getIndexWithinParent();if(A===null)M.__first=_;else{const Te=A.getWritable();Te.__next=_}M.__size++,f.__prev=_,p.__prev=ae,p.__next=f.__key,p.__parent=f.__parent;const me=mn();if(a&&Tt(me)){const Te=this.getParentOrThrow();Ha(me,Te,fe)}return s}isParentRequired(){return!1}createParentElementNode(){return Yi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(s,a){ur();const f=this.getPreviousSibling(),p=this.getParentOrThrow();if(f===null)return p.select(0,0);if(et(f))return f.select();if(!mt(f)){const _=f.getIndexWithinParent()+1;return p.select(_,_)}return f.select(s,a)}selectNext(s,a){ur();const f=this.getNextSibling(),p=this.getParentOrThrow();if(f===null)return p.select();if(et(f))return f.select(0,0);if(!mt(f)){const _=f.getIndexWithinParent();return p.select(_,_)}return f.select(s,a)}markDirty(){this.getWritable()}}function si(u,s){const a=Tn()._nodes.get(u);if(a===void 0)throw Error(`Create node: Attempted to create node ${s.name} that was not configured to be used on the editor.`);const f=a.klass;if(f!==s)throw Error(`Create node: Type ${u} in node ${s.name} does not match registered node ${f.name} with the same type`)}function Il(u,s,a){const f=s.getParentOrThrow().getLastChild();let p=s;const _=[s];for(;p!==f;){if(!p.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");p=p.getNextSibling(),_.push(p)}let A=u;for(const M of _)A=A.insertAfter(M)}class Ui extends ii{static getType(){return"linebreak"}static clone(s){return new Ui(s.__key)}constructor(s){super(s)}getTextContent(){return`
|
|
41
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:s=>{const a=s.parentElement;let f,p;return a!==null&&((f=a.firstChild)===s||f.nextSibling===s&&f.nodeType===Fe&&(f.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((p=a.lastChild)===s||p.previousSibling===s&&p.nodeType===Fe&&(p.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:wo,priority:0}}}}static importJSON(s){return
|
|
38
|
+
`,Kt=Ae?ht:pt,tn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",jt=new RegExp("^[^"+It+"]*["+tn+"]"),bt=new RegExp("^[^"+tn+"]*["+It+"]"),nn={bold:Oe,code:Ie,highlight:rt,italic:ne,strikethrough:oe,subscript:De,superscript:je,underline:Se},Sr={directionless:st,unmergeable:vt},mi={center:ze,end:Et,justify:_t,left:Ge,right:tt,start:Nt},pe={[ze]:"center",[Et]:"end",[_t]:"justify",[Ge]:"left",[tt]:"right",[Nt]:"start"},Ze={normal:Mt,segmented:en,token:Ut},ot={[Mt]:"normal",[en]:"segmented",[Ut]:"token"},wt=100;let Gt=!1,Bt=0;function Pt(){return Gt}function Lt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&mo(u).addEventListener("textInput",Lt,!0)}function sn(u,s,a){return s.__lexicalLineBreak===u||u[`__lexicalKey_${a._key}`]!==void 0}function ln(u){return u.getEditorState().read(()=>{const s=mn();return s!==null?s.clone():null})}function Rn(u,s,a){const f=or(a._window);let p=null,_=null;f!==null&&f.anchorNode===u&&(p=f.anchorOffset,_=f.focusOffset);const A=u.nodeValue;A!==null&&Lr(s,A,p,_,!1)}function mr(u,s,a){if(Tt(u)){const f=u.anchor.getNode();if(f.is(a)&&u.format!==f.getFormat())return!1}return s.nodeType===Fe&&a.isAttached()}function jn(u,s,a){Gt=!0;const f=performance.now()-Bt>wt;try{Wr(u,()=>{const p=mn()||ln(u),_=new Map,A=u.getRootElement(),M=u._editorState,ae=u._blockCursorElement;let fe=!1,me="";for(let ve=0;ve<s.length;ve++){const Ce=s[ve],Ve=Ce.type,Ue=Ce.target;let $e=ri(Ue,M);if(!($e===null&&Ue!==A||An($e))){if(Ve==="characterData")f&&mt($e)&&mr(p,Ue,$e)&&Rn(Ue,$e,u);else if(Ve==="childList"){fe=!0;const Rt=Ce.addedNodes;for(let qt=0;qt<Rt.length;qt++){const Wt=Rt[qt],At=co(Wt),an=Wt.parentNode;if(an!=null&&Wt!==ae&&At===null&&(Wt.nodeName!=="BR"||!sn(Wt,an,u))){if(Ae){const nr=Wt.innerText||Wt.nodeValue;nr&&(me+=nr)}an.removeChild(Wt)}}const Qe=Ce.removedNodes,ft=Qe.length;if(ft>0){let qt=0;for(let Wt=0;Wt<ft;Wt++){const At=Qe[Wt];(At.nodeName==="BR"&&sn(At,Ue,u)||ae===At)&&(Ue.appendChild(At),qt++)}ft!==qt&&(Ue===A&&($e=ul(M)),_.set(Ue,$e))}}}}if(_.size>0)for(const[ve,Ce]of _)if(et(Ce)){const Ve=Ce.getChildrenKeys();let Ue=ve.firstChild;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=u.getElementByKey(Rt);Qe!==null&&(Ue==null?(ve.appendChild(Qe),Ue=Qe):Ue!==Qe&&ve.replaceChild(Qe,Ue),Ue=Ue.nextSibling)}}else mt(Ce)&&Ce.markDirty();const Te=a.takeRecords();if(Te.length>0){for(let ve=0;ve<Te.length;ve++){const Ce=Te[ve],Ve=Ce.addedNodes,Ue=Ce.target;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=Rt.parentNode;Qe!=null&&Rt.nodeName==="BR"&&!sn(Rt,Ue,u)&&Qe.removeChild(Rt)}}a.takeRecords()}p!==null&&(fe&&(p.dirty=!0,yr(p)),Ae&&El(u)&&p.insertRawText(me))})}finally{Gt=!1}}function dn(u){const s=u._observer;if(s!==null){const a=s.takeRecords();jn(u,a,s)}}function rr(u){Ht(u),u._observer=new MutationObserver((s,a)=>{jn(u,s,a)})}function ir(u,s){const a=u.__mode,f=u.__format,p=u.__style,_=s.__mode,A=s.__format,M=s.__style;return(a===null||a===_)&&(f===null||f===A)&&(p===null||p===M)}function Ai(u,s){const a=u.mergeWithSibling(s),f=Tn()._normalizedNodes;return f.add(u.__key),f.add(s.__key),a}function _r(u){let s=u;if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable()){s.remove();return}let a;for(;(a=s.getPreviousSibling())!==null&&mt(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else if(ir(a,s)){s=Ai(a,s);break}else break;let f;for(;(f=s.getNextSibling())!==null&&mt(f)&&f.isSimpleText()&&!f.isUnmergeable();)if(f.__text==="")f.remove();else if(ir(s,f)){s=Ai(s,f);break}else break}function Ss(u){return lo(u.anchor),lo(u.focus),u}function lo(u){for(;u.type==="element";){const s=u.getNode(),a=u.offset;let f,p;if(a===s.getChildrenSize()?(f=s.getChildAtIndex(a-1),p=!0):(f=s.getChildAtIndex(a),p=!1),mt(f)){u.set(f.__key,p?f.getTextContentSize():0,"text");break}else if(!et(f))break;u.set(f.__key,p?f.getChildrenSize():0,"element")}}let sl=1;function Gr(){return""+sl++}function da(u,s){const a=u._nodes.get(s);if(a===void 0)throw Error(`registeredNode: Type ${s} not found`);return a}const ao=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function ns(u){return An(ri(u))}function vs(u){const s=document.activeElement;if(s===null)return!1;const a=s.nodeName;return An(ri(u))&&(a==="INPUT"||a==="TEXTAREA"||s.contentEditable==="true"&&s.__lexicalEditor==null)}function rs(u,s,a){const f=u.getRootElement();try{return f!==null&&f.contains(s)&&f.contains(a)&&s!==null&&!vs(s)&&ol(s)===u}catch{return!1}}function ol(u){let s=u;for(;s!=null;){const a=s.__lexicalEditor;if(a!=null)return a;s=po(s)}return null}function bn(u){return jt.test(u)?"rtl":bt.test(u)?"ltr":null}function Wn(u){return u.isToken()||u.isSegmented()}function ni(u){return u.nodeType===Fe}function Ir(u){let s=u;for(;s!=null;){if(ni(s))return s;s=s.firstChild}return null}function $n(u,s,a){const f=nn[s];if(a!==null&&(u&f)===(a&f))return u;let p=u^f;return s==="subscript"?p&=-65:s==="superscript"&&(p&=-33),p}function ws(u){return mt(u)||li(u)||An(u)}function ll(u,s){if(s!=null){u.__key=s;return}ur(),wd();const a=Tn(),f=Ti(),p=Gr();f._nodeMap.set(p,u),et(u)?a._dirtyElements.set(p,!0):a._dirtyLeaves.add(p),a._cloneNotNeeded.add(p),a._dirtyType=Be,u.__key=p}function al(u,s,a){let f=u;for(;f!==null;){if(a.has(f))return;const p=s.get(f);if(p===void 0)break;a.set(f,!1),f=p.__parent}}function Yr(u){const s=u.getParent();if(s!==null){const a=u.getWritable(),f=s.getWritable(),p=u.getPreviousSibling(),_=u.getNextSibling();if(p===null)if(_!==null){const A=_.getWritable();f.__first=_.__key,A.__prev=null}else f.__first=null;else{const A=p.getWritable();if(_!==null){const M=_.getWritable();M.__prev=A.__key,A.__next=M.__key}else A.__next=null;a.__prev=null}if(_===null)if(p!==null){const A=p.getWritable();f.__last=p.__key,A.__next=null}else f.__last=null;else{const A=_.getWritable();if(p!==null){const M=p.getWritable();M.__next=A.__key,A.__prev=M.__key}else A.__prev=null;a.__next=null}f.__size--,a.__parent=null}}function Mi(u){wd();const s=u.getLatest(),a=s.__parent,f=Ti(),p=Tn(),_=f._nodeMap,A=p._dirtyElements;a!==null&&al(a,_,A);const M=s.__key;p._dirtyType=Be,et(u)?A.set(M,!0):p._dirtyLeaves.add(M)}function cl(u){const s=u.getPreviousSibling(),a=u.getNextSibling();s!==null&&Mi(s),a!==null&&Mi(a)}function xn(u){ur();const s=Tn(),a=s._compositionKey;if(u!==a){if(s._compositionKey=u,a!==null){const f=Nn(a);f!==null&&f.getWritable()}if(u!==null){const f=Nn(u);f!==null&&f.getWritable()}}}function sr(){return Lo()?null:Tn()._compositionKey}function Nn(u,s){const f=(s||Ti())._nodeMap.get(u);return f===void 0?null:f}function co(u,s){const a=Tn(),f=u[`__lexicalKey_${a._key}`];return f!==void 0?Nn(f,s):null}function ri(u,s){let a=u;for(;a!=null;){const f=co(a,s);if(f!==null)return f;a=po(a)}return null}function Os(u){const s=u._decorators,a=Object.assign({},s);return u._pendingDecorators=a,a}function uo(u){return u.read(()=>Qn().getTextContent())}function Di(u,s){Wr(u,()=>{const a=Ti();if(a.isEmpty())return;if(s==="root"){Qn().markDirty();return}const f=a._nodeMap;for(const[,p]of f)p.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Qn(){return ul(Ti())}function ul(u){return u._nodeMap.get("root")}function yr(u){ur();const s=Ti();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 dl(){ur();const u=Tn();dn(u)}function Ri(u){const s=Tn(),a=fa(u,s);if(a===null){const f=s.getRootElement();return u===f?Nn("root"):null}return Nn(a)}function fl(u,s){return s?u.getTextContentSize():0}function fa(u,s){let a=u;for(;a!=null;){const f=a[`__lexicalKey_${s._key}`];if(f!==void 0)return f;a=po(a)}return null}function As(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function bi(u){const s=[];let a=u;for(;a!==null;)s.push(a),a=a._parentEditor;return s}function hl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function fo(u){return u.nodeType===Fe?u.nodeValue:null}function Ms(u,s,a){const f=or(s._window);if(f===null)return;const p=f.anchorNode;let{anchorOffset:_,focusOffset:A}=f;if(p!==null){let M=fo(p);const ae=ri(p);if(M!==null&&mt(ae)){if(M===pt&&a){const fe=a.length;M=a,_=fe,A=fe}M!==null&&Lr(ae,M,_,A,u)}}}function Lr(u,s,a,f,p){let _=u;if(_.isAttached()&&(p||!_.isDirty())){const A=_.isComposing();let M=s;(A||p)&&s[s.length-1]===pt&&(M=s.slice(0,-1));const ae=_.getTextContent();if(p||M!==ae){if(M===""){if(xn(null),!te&&!ce&&!Re){const Ue=Tn();setTimeout(()=>{Ue.update(()=>{_.isAttached()&&_.remove()})},20)}else _.remove();return}const fe=_.getParent(),me=Io(),Te=_.getTextContentSize(),ve=sr(),Ce=_.getKey();if(_.isToken()||ve!==null&&Ce===ve&&!A||Tt(me)&&(fe!==null&&!fe.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!_.canInsertTextBefore()&&!A||me.focus.key===u.__key&&me.focus.offset===Te&&!_.canInsertTextAfter()&&!A)){_.markDirty();return}const Ve=mn();if(!Tt(Ve)||a===null||f===null){_.setTextContent(M);return}if(Ve.setTextNodeRange(_,a,_,f),_.isSegmented()){const Ue=_.getTextContent(),$e=On(Ue);_.replace($e),_=$e}_.setTextContent(M)}}}function gl(u){const s=u.getPreviousSibling();return(mt(s)||et(s)&&s.isInline())&&!s.canInsertTextAfter()}function Ds(u,s){if(s.isSegmented())return!0;if(!u.isCollapsed())return!1;const a=u.anchor.offset,f=s.getParentOrThrow(),p=s.isToken();return a===0?!s.canInsertTextBefore()||!f.canInsertTextBefore()||p||gl(s):a===s.getTextContentSize()?!s.canInsertTextAfter()||!f.canInsertTextAfter()||p:!1}function ha(u,s,a,f){return u===9&&!s&&!a&&!f}function ga(u,s,a,f){return u===66&&!s&&jr(a,f)}function is(u,s,a,f){return u===73&&!s&&jr(a,f)}function Rs(u,s,a,f){return u===85&&!s&&jr(a,f)}function pl(u,s){return Sa(u)&&!s}function ml(u,s){return Sa(u)&&s}function bs(u,s){return ye&&s&&u===79}function ks(u,s,a){return Vr(u)&&(ye?s:a)}function pa(u,s,a){return Ii(u)&&(ye?s:a)}function ma(u,s){return ye&&s&&Vr(u)}function _a(u,s){return ye&&s&&Ii(u)}function ya(u,s,a,f){return ye?s||a?!1:Vr(u)||u===72&&f:f||s||a?!1:Vr(u)}function Oc(u,s,a,f,p){return ye?a||f||p?!1:Ii(u)||u===68&&s:s||f||p?!1:Ii(u)}function Ac(u,s,a,f){return u===90&&!s&&jr(a,f)}function Na(u,s,a,f){return ye?u===90&&a&&s:u===89&&f||u===90&&f&&s}function Mc(u,s,a,f){return s?!1:u===67?ye?a:f:!1}function Dc(u,s,a,f){return s?!1:u===88?ye?a:f:!1}function Ca(u){return u===37}function Ea(u){return u===39}function _l(u){return u===38}function Rc(u){return u===40}function bc(u,s,a,f){return Ca(u)&&!s&&!f&&!a}function Ta(u,s,a,f,p){return Ca(u)&&!f&&!a&&(s||p)}function ss(u,s,a,f){return Ea(u)&&!s&&!f&&!a}function xa(u,s,a,f,p){return Ea(u)&&!f&&!a&&(s||p)}function kc(u,s,a){return _l(u)&&!s&&!a}function yl(u,s,a){return Rc(u)&&!s&&!a}function Is(u,s,a,f){return u||s||a||f}function Ic(u){return u===32}function jr(u,s){return ye?u:s}function Sa(u){return u===13}function Vr(u){return u===8}function ki(u){return u===27}function Ii(u){return u===46}function ho(u,s,a){return u===65&&jr(s,a)}function Nl(){const u=Qn(),s=u.select(0,u.getChildrenSize());yr(Ss(s))}function Li(u,s){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const a=u.__lexicalClassNameCache,f=a[s];if(f!==void 0)return f;const p=u[s];if(typeof p=="string"){const _=p.split(" ");return a[s]=_,_}return p}function os(u,s,a,f,p){if(a.size===0)return;const _=f.__type,A=f.__key,M=s.get(_);if(M===void 0)throw Error(`Type ${_} not in registeredNodes`);const ae=M.klass;let fe=u.get(ae);fe===void 0&&(fe=new Map,u.set(ae,fe));const me=fe.get(A),Te=me==="destroyed"&&p==="created";(me===void 0||Te)&&fe.set(A,Te?"updated":p)}function Pi(u){const s=Ti(),a=s._readOnly,f=u.getType(),p=s._nodeMap,_=[];for(const[,A]of p)A instanceof u&&A.__type===f&&(a||A.isAttached())&&_.push(A);return _}function va(u,s,a){const f=u.getParent();let p=a,_=u;return f!==null&&(s&&a===0?(p=_.getIndexWithinParent(),_=f):!s&&a===_.getChildrenSize()&&(p=_.getIndexWithinParent()+1,_=f)),_.getChildAtIndex(s?p-1:p)}function Cl(u,s){const a=u.offset;if(u.type==="element"){const f=u.getNode();return va(f,s,a)}else{const f=u.getNode();if(s&&a===0||!s&&a===f.getTextContentSize()){const p=s?f.getPreviousSibling():f.getNextSibling();return p===null?va(f.getParentOrThrow(),s,f.getIndexWithinParent()+(s?0:1)):p}}return null}function El(u){const s=mo(u).event,a=s&&s.inputType;return a==="insertFromPaste"||a==="insertFromPasteAsQuotation"}function ut(u,s,a){return Rd(u,s,a)}function go(u){return!Kr(u)&&!u.isLastChild()&&!u.isInline()}function Ls(u,s){const a=u._keyToDOMMap.get(s);if(a===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${s}`);return a}function po(u){const s=u.assignedSlot||u.parentElement;return s!==null&&s.nodeType===11?s.host:s}function _i(u,s,a){const f=a.ownerDocument,p=f.defaultView;if(p===null)return;let{top:_,bottom:A}=s,M=0,ae=0,fe=a;for(;fe!==null;){const me=fe===f.body;if(me)M=0,ae=mo(u).innerHeight;else{const ve=fe.getBoundingClientRect();M=ve.top,ae=ve.bottom}let Te=0;if(_<M?Te=-(M-_):A>ae&&(Te=A-ae),Te!==0)if(me)p.scrollBy(0,Te);else{const ve=fe.scrollTop;fe.scrollTop+=Te;const Ce=fe.scrollTop-ve;_-=Ce,A-=Ce}if(me)break;fe=po(fe)}}function Kn(u){return Tn()._updateTags.has(u)}function Ct(u){ur(),Tn()._updateTags.add(u)}function ls(u){const s=mn();if(!Tt(s)||!et(u))return s;const{anchor:a,focus:f}=s,p=a.getNode(),_=f.getNode();return $i(p,u)&&a.set(u.__key,0,"element"),$i(_,u)&&f.set(u.__key,0,"element"),s}function $i(u,s){let a=u.getParent();for(;a!==null;){if(a.is(s))return!0;a=a.getParent()}return!1}function wa(u){const s=u.ownerDocument;return s&&s.defaultView||null}function mo(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function Pr(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function _o(u){let s=u.getParentOrThrow();for(;s!==null;){if(ii(s))return s;s=s.getParentOrThrow()}return s}function ii(u){return Kr(u)||et(u)&&u.isShadowRoot()}function Tl(u){const s=u.constructor.clone(u);return ll(s,null),s}function vr(u){const s=Tn(),a=u.constructor.getType(),f=s._nodes.get(a);if(f===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 p=f.replace;if(p!==null){const _=p(u);if(!(_ instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return _}return u}function Ps(u,s){const a=u.getParent();if(Kr(a)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function yo(u){const s=u.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let f=s.blockCursor;if(f!==void 0){if(typeof f=="string"){const p=f.split(" ");f=s.blockCursor=p}f!==void 0&&a.classList.add(...f)}return a}function Dt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function $s(u,s,a){a.style.removeProperty("caret-color"),s._blockCursorElement=null;const f=u.parentElement;f!==null&&f.removeChild(u)}function yi(u,s,a){let f=u._blockCursorElement;if(Tt(a)&&a.isCollapsed()&&a.anchor.type==="element"&&s.contains(document.activeElement)){const p=a.anchor,_=p.getNode(),A=p.offset,M=_.getChildrenSize();let ae=!1,fe=null;if(A===M){const me=_.getChildAtIndex(A-1);Dt(me)&&(ae=!0)}else{const me=_.getChildAtIndex(A);if(Dt(me)){const Te=me.getPreviousSibling();(Te===null||Dt(Te))&&(ae=!0,fe=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(_.__key);f===null&&(u._blockCursorElement=f=yo(u._config)),s.style.caretColor="transparent",fe===null?me.appendChild(f):me.insertBefore(f,fe);return}}f!==null&&$s(f,u,s)}function or(u){return D?(u||window).getSelection():null}function Oa(u,s){let a=u.getChildAtIndex(s);if(a==null&&(a=u),ii(u))throw Error("Can not call $splitNode() on root element");const f=A=>{const M=A.getParentOrThrow(),ae=ii(M),fe=A===a&&!ae?A:Tl(A);if(ae){if(!(et(A)&&et(fe)))throw Error("Children of a root must be ElementNode");return A.insertAfter(fe),[A,fe,fe]}else{const[me,Te,ve]=f(M),Ce=A.getNextSiblings();return ve.append(fe,...Ce),[me,Te,fe]}},[p,_]=f(a);return[p,_]}function No(u,s){let a=u;for(;a!==Qn()&&a!=null;){if(s(a))return a;a=a.getParent()}return null}function Aa(u){return Fs(u)&&u.tagName==="A"}function Fs(u){return u.nodeType===1}function Fi(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||ii(u))return!1;const s=u.getFirstChild(),a=s===null||li(s)||mt(s)||s.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&a}function Co(u,s){let a=u;for(;a!==null&&a.getParent()!==null&&!s(a);)a=a.getParentOrThrow();return s(a)?a:null}function Ma(u,s){const a=u._decorators;let p=u._pendingDecorators||a;const _=s._nodeMap;let A;for(A in p)_.has(A)||(p===a&&(p=Os(u)),delete p[A])}function xl(u,s,a,f,p,_){let A=u.getFirstChild();for(;A!==null;){const M=A.__key;A.__parent===s&&(et(A)&&xl(A,M,a,f,p,_),a.has(M)||_.delete(M),p.push(M)),A=A.getNextSibling()}}function Sl(u,s,a,f){const p=u._nodeMap,_=s._nodeMap,A=[];for(const[M]of f){const ae=_.get(M);ae!==void 0&&(ae.isAttached()||(et(ae)&&xl(ae,M,p,_,A,f),p.has(M)||f.delete(M),A.push(M)))}for(const M of A)_.delete(M);for(const M of a){const ae=_.get(M);ae!==void 0&&!ae.isAttached()&&(p.has(M)||a.delete(M),_.delete(M))}}let kn="",zn="",Vt="",Nr,Fn,as,Da=!1,cs=!1,Bs,Hs=null,Ws,vl,Bi,hn,wn,Bn;function us(u,s){const a=Bi.get(u);if(s!==null){const f=xo(u);f.parentNode===s&&s.removeChild(f)}if(hn.has(u)||Fn._keyToDOMMap.delete(u),et(a)){const f=Ci(a,Bi);Hi(f,0,f.length-1,null)}a!==void 0&&os(Bn,as,Bs,a,"destroyed")}function Hi(u,s,a,f){let p=s;for(;p<=a;++p){const _=u[p];_!==void 0&&us(_,f)}}function Ni(u,s){u.setProperty("text-align",s)}const ds="40px";function Vn(u,s){const a=Nr.theme.indent;if(typeof a=="string"){const p=u.classList.contains(a);s>0&&!p?u.classList.add(a):s<1&&p&&u.classList.remove(a)}const f=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||ds;u.style.setProperty("padding-inline-start",s===0?"":`calc(${s} * ${f})`)}function $r(u,s){const a=u.style;s===0?Ni(a,""):s===Ge?Ni(a,"left"):s===ze?Ni(a,"center"):s===tt?Ni(a,"right"):s===_t?Ni(a,"justify"):s===Nt?Ni(a,"start"):s===Et&&Ni(a,"end")}function fn(u,s,a){const f=hn.get(u);if(f===void 0)throw Error("createNode: node does not exist in nodeMap");const p=f.createDOM(Nr,Fn);if(Je(u,p,Fn),mt(f)?p.setAttribute("data-lexical-text","true"):An(f)&&p.setAttribute("data-lexical-decorator","true"),et(f)){const _=f.__indent,A=f.__size;if(_!==0&&Vn(p,_),A!==0){const ae=A-1,fe=Ci(f,hn);Ra(fe,ae,f,p)}const M=f.__format;M!==0&&$r(p,M),f.isInline()||Eo(null,f,p),go(f)&&(kn+=$t,Vt+=$t)}else{const _=f.getTextContent();if(An(f)){const A=f.decorate(Fn,Nr);A!==null&&Al(u,A),p.contentEditable="false"}else mt(f)&&(f.isDirectionless()||(zn+=_));kn+=_,Vt+=_}if(s!==null)if(a!=null)s.insertBefore(p,a);else{const _=s.__lexicalLineBreak;_!=null?s.insertBefore(p,_):s.appendChild(p)}return Object.freeze(f),os(Bn,as,Bs,f,"created"),p}function Ra(u,s,a,f){const p=zn;zn="",wl(u,a,0,s,f,null),Ol(a,f),zn=p}function wl(u,s,a,f,p,_){const A=kn;kn="";let M=a;for(;M<=f;++M)fn(u[M],p,_);go(s)&&(kn+=$t),p.__lexicalTextContent=kn,kn=A+kn}function ba(u,s){const a=s.get(u);return li(a)||An(a)&&a.isInline()}function Eo(u,s,a){const f=u!==null&&(u.__size===0||ba(u.__last,Bi)),p=s.__size===0||ba(s.__last,hn);if(f){if(!p){const _=a.__lexicalLineBreak;_!=null&&a.removeChild(_),a.__lexicalLineBreak=null}}else if(p){const _=document.createElement("br");a.__lexicalLineBreak=_,a.appendChild(_)}}function Ol(u,s){const a=s.__lexicalDirTextContent,f=s.__lexicalDir;if(a!==zn||f!==Hs){const p=zn==="",_=p?Hs:bn(zn);if(_!==f){const A=s.classList,M=Nr.theme;let ae=f!==null?M[f]:void 0,fe=_!==null?M[_]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=M[f]=me}A.remove(...ae)}if(_===null||p&&_==="ltr")s.removeAttribute("dir");else{if(fe!==void 0){if(typeof fe=="string"){const me=fe.split(" ");fe=M[_]=me}fe!==void 0&&A.add(...fe)}s.dir=_}if(!cs){const me=u.getWritable();me.__dir=_}}Hs=_,s.__lexicalDirTextContent=zn,s.__lexicalDir=_}}function Wi(u,s,a){const f=zn;zn="",at(u,s,a),Ol(s,a),zn=f}function Ci(u,s){const a=[];let f=u.__first;for(;f!==null;){const p=s.get(f);if(p===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");a.push(f),f=p.__next}return a}function at(u,s,a){const f=kn,p=u.__size,_=s.__size;if(kn="",p===1&&_===1){const A=u.__first,M=s.__first;if(A===M)fs(A,a);else{const ae=xo(A),fe=fn(M,null,null);a.replaceChild(fe,ae),us(A,null)}}else{const A=Ci(u,Bi),M=Ci(s,hn);if(p===0)_!==0&&wl(M,s,0,_-1,a,null);else if(_===0){if(p!==0){const fe=a.__lexicalLineBreak==null;Hi(A,0,p-1,fe?null:a),fe&&(a.textContent="")}}else Cn(s,A,M,p,_,a)}go(s)&&(kn+=$t),a.__lexicalTextContent=kn,kn=f+kn}function fs(u,s){const a=Bi.get(u);let f=hn.get(u);if(a===void 0||f===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const p=Da||vl.has(u)||Ws.has(u),_=Ls(Fn,u);if(a===f&&!p){if(et(a)){const A=_.__lexicalTextContent;A!==void 0&&(kn+=A,Vt+=A);const M=_.__lexicalDirTextContent;M!==void 0&&(zn+=M)}else{const A=a.getTextContent();mt(a)&&!a.isDirectionless()&&(zn+=A),Vt+=A,kn+=A}return _}if(a!==f&&p&&os(Bn,as,Bs,f,"updated"),f.updateDOM(a,_,Nr)){const A=fn(u,null,null);if(s===null)throw Error("reconcileNode: parentDOM is null");return s.replaceChild(A,_),us(u,null),A}if(et(a)&&et(f)){const A=f.__indent;A!==a.__indent&&Vn(_,A);const M=f.__format;M!==a.__format&&$r(_,M),p&&(Wi(a,f,_),!Kr(f)&&!f.isInline()&&Eo(a,f,_)),go(f)&&(kn+=$t,Vt+=$t)}else{const A=f.getTextContent();if(An(f)){const M=f.decorate(Fn,Nr);M!==null&&Al(u,M)}else mt(f)&&!f.isDirectionless()&&(zn+=A);kn+=A,Vt+=A}if(!cs&&Kr(f)&&f.__cachedText!==Vt){const A=f.getWritable();A.__cachedText=Vt,f=A}return Object.freeze(f),_}function Al(u,s){let a=Fn._pendingDecorators;const f=Fn._decorators;if(a===null){if(f[u]===s)return;a=Os(Fn)}a[u]=s}function Cr(u){return u.firstChild}function To(u){let s=u.nextSibling;return s!==null&&s===Fn._blockCursorElement&&(s=s.nextSibling),s}function Cn(u,s,a,f,p,_){const A=f-1,M=p-1;let ae,fe,me=Cr(_),Te=0,ve=0;for(;Te<=A&&ve<=M;){const Ue=s[Te],$e=a[ve];if(Ue===$e)me=To(fs($e,_)),Te++,ve++;else{ae===void 0&&(ae=new Set(s)),fe===void 0&&(fe=new Set(a));const Rt=fe.has(Ue),Qe=ae.has($e);if(!Rt)me=To(xo(Ue)),us(Ue,_),Te++;else if(!Qe)fn($e,_,me),ve++;else{const ft=Ls(Fn,$e);ft===me?me=To(fs($e,_)):(me!=null?_.insertBefore(ft,me):_.appendChild(ft),fs($e,_)),Te++,ve++}}}const Ce=Te>A,Ve=ve>M;if(Ce&&!Ve){const Ue=a[M+1],$e=Ue===void 0?null:Fn.getElementByKey(Ue);wl(a,u,ve,M,_,$e)}else Ve&&!Ce&&Hi(s,Te,A,_)}function Ki(u,s,a,f,p,_){kn="",Vt="",zn="",Da=f===ct,Hs=null,Fn=a,Nr=a._config,as=a._nodes,Bs=Fn._listeners.mutation,Ws=p,vl=_,Bi=u._nodeMap,hn=s._nodeMap,cs=s._readOnly,wn=new Map(a._keyToDOMMap);const A=new Map;return Bn=A,fs("root",null),Fn=void 0,as=void 0,Ws=void 0,vl=void 0,Bi=void 0,hn=void 0,Nr=void 0,wn=void 0,Bn=void 0,A}function Je(u,s,a){const f=a._keyToDOMMap;s["__lexicalKey_"+a._key]=u,f.set(u,s)}function xo(u){const s=wn.get(u);if(s===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return s}const lr=Object.freeze({}),er=30,Ml=[["keydown",he],["pointerdown",kl],["compositionstart",C],["compositionend",X],["input",y],["click",ka],["cut",lr],["copy",lr],["dragstart",lr],["dragover",lr],["dragend",lr],["paste",lr],["focus",lr],["blur",lr],["drop",lr]];ee&&Ml.push(["beforeinput",(u,s)=>h(u,s)]);let zi=0,Dl=0,Ks=0,Fr=null,zs=0,Br=!1,So=!1,Us=!1,Gs=!1,vo=[0,"",0,"root",0];function Ui(u,s,a,f,p){const _=u.anchor,A=u.focus,M=_.getNode(),ae=Tn(),fe=or(ae._window),me=fe!==null?fe.anchorNode:null,Te=_.key,ve=ae.getElementByKey(Te),Ce=a.length;return Te!==A.key||!mt(M)||(!p&&(!ee||Ks<f+50)||M.isDirty()&&Ce<2||As(a))&&_.offset!==A.offset&&!M.isComposing()||Wn(M)||M.isDirty()&&Ce>1||(p||!ee)&&ve!==null&&!M.isComposing()&&me!==Ir(ve)||fe!==null&&s!==null&&(!s.collapsed||s.startContainer!==fe.anchorNode||s.startOffset!==fe.anchorOffset)||M.getFormat()!==u.format||M.getStyle()!==u.style||Ds(u,M)}function Rl(u,s){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&s!==0&&s!==u.nodeValue.length}function bl(u,s,a){const{anchorNode:f,anchorOffset:p,focusNode:_,focusOffset:A}=u;Br&&(Br=!1,Rl(f,p)&&Rl(_,A))||Wr(s,()=>{if(!a){yr(null);return}if(!rs(s,f,_))return;const M=mn();if(Tt(M)){const ae=M.anchor,fe=ae.getNode();if(M.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&(M.dirty=!0);const me=mo(s).event,Te=me?me.timeStamp:performance.now(),[ve,Ce,Ve,Ue,$e]=vo,Rt=Qn(),Qe=s.isComposing()===!1&&Rt.getTextContent()==="";if(Te<$e+200&&ae.offset===Ve&&ae.key===Ue)M.format=ve,M.style=Ce;else if(ae.type==="text"){if(!mt(fe))throw Error("Point.getNode() must return TextNode when type is text");M.format=fe.getFormat(),M.style=fe.getStyle()}else ae.type==="element"&&!Qe&&(M.format=0,M.style="")}else{let me=it,Te=!1;const ve=M.getNodes(),Ce=ve.length;for(let Ve=0;Ve<Ce;Ve++){const Ue=ve[Ve];if(mt(Ue)&&(Te=!0,me&=Ue.getFormat(),me===0))break}M.format=Te?me:0}}ut(s,t,void 0)})}function ka(u,s){Wr(s,()=>{const a=mn(),f=or(s._window),p=Io();if(f){if(Tt(a)){const _=a.anchor,A=_.getNode();if(_.type==="element"&&_.offset===0&&a.isCollapsed()&&!Kr(A)&&Qn().getChildrenSize()===1&&A.getTopLevelElementOrThrow().isEmpty()&&p!==null&&a.is(p))f.removeAllRanges(),a.dirty=!0;else if(u.detail===3&&!a.isCollapsed()){const ae=a.focus.getNode();A!==ae&&(et(A)?A.select(0):A.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const _=f.anchorNode;if(_!==null){const A=_.nodeType;if(A===Le||A===Fe){const M=$c(p,f,s,u);yr(M)}}}}ut(s,r,u)})}function kl(u,s){const a=u.target,f=u.pointerType;a instanceof Node&&f!=="touch"&&Wr(s,()=>{ns(a)||(So=!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 l(u){return Dl===229&&u<zi+er}function h(u,s){const a=u.inputType,f=o(u);a==="deleteCompositionText"||Ae&&El(s)||a!=="insertCompositionText"&&Wr(s,()=>{const p=mn();if(a==="deleteContentBackward"){if(p===null){const me=Io();if(!Tt(me))return;yr(me.clone())}if(Tt(p)){if(be&&xn(p.anchor.key),l(u.timeStamp)&&s.isComposing()&&p.anchor.key===p.focus.key){if(xn(null),zi=0,setTimeout(()=>{Wr(s,()=>{xn(null)})},er),Tt(p)){const Te=p.anchor.getNode();if(Te.markDirty(),p.format=Te.getFormat(),!mt(Te))throw Error("Anchor node must be a TextNode");p.style=Te.getStyle()}p.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),ut(s,c,!0))}else xn(null),u.preventDefault(),ut(s,c,!0);return}}if(!Tt(p))return;const _=u.data;Fr!==null&&Ms(!1,s,Fr),(!p.dirty||Fr!==null)&&p.isCollapsed()&&!Kr(p.anchor.getNode())&&f!==null&&p.applyDOMRange(f),Fr=null;const A=p.anchor,M=p.focus,ae=A.getNode(),fe=M.getNode();if(a==="insertText"||a==="insertTranspose"){if(_===`
|
|
39
|
+
`)u.preventDefault(),ut(s,d,!1);else if(_===$t)u.preventDefault(),ut(s,g,void 0);else if(_==null&&u.dataTransfer){const me=u.dataTransfer.getData("text/plain");u.preventDefault(),p.insertRawText(me)}else _!=null&&Ui(p,f,_,u.timeStamp,!0)?(u.preventDefault(),ut(s,m,_)):Fr=_;Ks=u.timeStamp;return}switch(u.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{ut(s,m,u);break}case"insertFromComposition":{xn(null),ut(s,m,u);break}case"insertLineBreak":{xn(null),ut(s,d,!1);break}case"insertParagraph":{xn(null),Us&&!ce?(Us=!1,ut(s,d,!1)):ut(s,g,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{ut(s,N,u);break}case"deleteByComposition":{i(ae,fe)&&ut(s,T,u);break}case"deleteByDrag":case"deleteByCut":{ut(s,T,u);break}case"deleteContent":{ut(s,c,!1);break}case"deleteWordBackward":{ut(s,R,!0);break}case"deleteWordForward":{ut(s,R,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{ut(s,b,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{ut(s,b,!1);break}case"formatStrikeThrough":{ut(s,k,"strikethrough");break}case"formatBold":{ut(s,k,"bold");break}case"formatItalic":{ut(s,k,"italic");break}case"formatUnderline":{ut(s,k,"underline");break}case"historyUndo":{ut(s,z,void 0);break}case"historyRedo":{ut(s,E,void 0);break}}})}function y(u,s){u.stopPropagation(),Wr(s,()=>{const a=mn(),f=u.data,p=o(u);if(f!=null&&Tt(a)&&Ui(a,p,f,u.timeStamp,!1)){Gs&&(v(s,f),Gs=!1);const _=a.anchor,A=_.getNode(),M=or(s._window);if(M===null)return;const ae=_.offset;(!ee||a.isCollapsed()||!mt(A)||M.anchorNode===null||A.getTextContent().slice(0,ae)+f+A.getTextContent().slice(ae+a.focus.offset)!==fo(M.anchorNode))&&ut(s,m,f);const fe=f.length;Ae&&fe>1&&u.inputType==="insertCompositionText"&&!s.isComposing()&&(a.anchor.offset-=fe),!te&&!ce&&!Re&&s.isComposing()&&(zi=0,xn(null))}else Ms(!1,s,f!==null?f:void 0),Gs&&(v(s,f||void 0),Gs=!1);dl()}),Fr=null}function C(u,s){Wr(s,()=>{const a=mn();if(Tt(a)&&!s.isComposing()){const f=a.anchor,p=a.anchor.getNode();xn(f.key),(u.timeStamp<zi+er||f.type==="element"||!a.isCollapsed()||p.getFormat()!==a.format||mt(p)&&p.getStyle()!==a.style)&&ut(s,m,Kt)}})}function v(u,s){const a=u._compositionKey;if(xn(null),a!==null&&s!=null){if(s===""){const f=Nn(a),p=Ir(u.getElementByKey(a));p!==null&&p.nodeValue!==null&&mt(f)&&Lr(f,p.nodeValue,null,null,!0);return}if(s[s.length-1]===`
|
|
40
|
+
`){const f=mn();if(Tt(f)){const p=f.focus;f.anchor.set(p.key,p.offset,p.type),ut(u,le,null);return}}}Ms(!0,u,s)}function X(u,s){Ae?Gs=!0:Wr(s,()=>{v(s,u.data)})}function he(u,s){if(zi=u.timeStamp,Dl=u.keyCode,s.isComposing())return;const{keyCode:a,shiftKey:f,ctrlKey:p,metaKey:_,altKey:A}=u;if(!ut(s,x,u)){if(ss(a,p,A,_))ut(s,U,u);else if(xa(a,p,f,A,_))ut(s,Q,u);else if(bc(a,p,A,_))ut(s,F,u);else if(Ta(a,p,f,A,_))ut(s,W,u);else if(kc(a,p,_))ut(s,G,u);else if(yl(a,p,_))ut(s,q,u);else if(ml(a,f))Us=!0,ut(s,le,u);else if(Ic(a))ut(s,se,u);else if(bs(a,p))u.preventDefault(),Us=!0,ut(s,d,!0);else if(pl(a,f))Us=!1,ut(s,le,u);else if(ya(a,A,_,p))Vr(a)?ut(s,ge,u):(u.preventDefault(),ut(s,c,!0));else if(ki(a))ut(s,j,u);else if(Oc(a,p,f,A,_))Ii(a)?ut(s,B,u):(u.preventDefault(),ut(s,c,!1));else if(ks(a,A,p))u.preventDefault(),ut(s,R,!0);else if(pa(a,A,p))u.preventDefault(),ut(s,R,!1);else if(ma(a,_))u.preventDefault(),ut(s,b,!0);else if(_a(a,_))u.preventDefault(),ut(s,b,!1);else if(ga(a,A,_,p))u.preventDefault(),ut(s,k,"bold");else if(Rs(a,A,_,p))u.preventDefault(),ut(s,k,"underline");else if(is(a,A,_,p))u.preventDefault(),ut(s,k,"italic");else if(ha(a,A,p,_))ut(s,V,u);else if(Ac(a,f,_,p))u.preventDefault(),ut(s,z,void 0);else if(Na(a,f,_,p))u.preventDefault(),ut(s,E,void 0);else{const M=s._editorState._selection;Hr(M)?Mc(a,f,_,p)?(u.preventDefault(),ut(s,K,u)):Dc(a,f,_,p)?(u.preventDefault(),ut(s,P,u)):ho(a,_,p)&&(u.preventDefault(),ut(s,Z,u)):!Ae&&ho(a,_,p)&&(u.preventDefault(),ut(s,Z,u))}Is(p,f,A,_)&&ut(s,w,u)}}function Me(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,a=s==null?null:s.nodeType===9?s.defaultView:s.ownerDocument.defaultView,f=or(a);if(f===null)return;const p=ol(f.anchorNode);if(p===null)return;So&&(So=!1,Wr(p,()=>{const me=Io(),Te=f.anchorNode;if(Te===null)return;const ve=Te.nodeType;if(ve!==Le&&ve!==Fe)return;const Ce=$c(me,f,p,u);yr(Ce)}));const _=bi(p),A=_[_.length-1],M=A._key,ae=Ye.get(M),fe=ae||A;fe!==p&&bl(f,fe,!1),bl(f,p,!0),p!==A?Ye.set(M,p):ae&&Ye.delete(M)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function gt(u,s){zs===0&&u.ownerDocument.addEventListener("selectionchange",Xe),zs++,u.__lexicalEditor=s;const a=Me(u);for(let f=0;f<Ml.length;f++){const[p,_]=Ml[f],A=typeof _=="function"?M=>{Pe(M)||(Ke(M),s.isEditable()&&_(M,s))}:M=>{if(!Pe(M)&&(Ke(M),s.isEditable()))switch(p){case"cut":return ut(s,P,M);case"copy":return ut(s,K,M);case"paste":return ut(s,N,M);case"dragstart":return ut(s,S,M);case"dragover":return ut(s,Y,M);case"dragend":return ut(s,ie,M);case"focus":return ut(s,_e,M);case"blur":return ut(s,I,M);case"drop":return ut(s,ue,M)}};u.addEventListener(p,A),a.push(()=>{u.removeEventListener(p,A)})}}function Ot(u){zs!==0&&(zs--,zs===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const s=u.__lexicalEditor;s!=null&&(Ft(s),u.__lexicalEditor=null);const a=Me(u);for(let f=0;f<a.length;f++)a[f]();u.__lexicalEventHandles=[]}function Ft(u){if(u._parentEditor!==null){const s=bi(u),f=s[s.length-1]._key;Ye.get(f)===u&&Ye.delete(f)}else Ye.delete(u._key)}function zt(){Br=!0}function Un(u,s,a,f,p){vo=[u,s,a,f,p]}function wr(u,s,a){ur();const f=u.__key,p=u.getParent();if(p===null)return;const _=ls(u);let A=!1;if(Tt(_)&&s){const M=_.anchor,ae=_.focus;M.key===f&&(Wa(M,u,p,u.getPreviousSibling(),u.getNextSibling()),A=!0),ae.key===f&&(Wa(ae,u,p,u.getPreviousSibling(),u.getNextSibling()),A=!0)}else Hr(_)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(_)&&s&&!A){const M=u.getIndexWithinParent();Yr(u),Ha(_,p,M,-1)}else Yr(u);!a&&!ii(p)&&!p.canBeEmpty()&&p.isEmpty()&&wr(p,s),s&&Kr(p)&&p.isEmpty()&&p.selectEnd()}class si{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,ll(this,s),this.__type!=="root"&&(ur(),oi(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 a=Nn(s);if(a===null)break;s=a.__parent}return!1}isSelected(s){const a=s||mn();if(a==null)return!1;const f=a.getNodes().some(p=>p.__key===this.__key);return mt(this)?f:Tt(a)&&a.anchor.type==="element"&&a.focus.type==="element"&&a.anchor.key===a.focus.key&&a.anchor.offset===a.focus.offset?!1:f}getKey(){return this.__key}getIndexWithinParent(){const s=this.getParent();if(s===null)return-1;let a=s.getFirstChild(),f=0;for(;a!==null;){if(this.is(a))return f;f++,a=a.getNextSibling()}return-1}getParent(){const s=this.getLatest().__parent;return s===null?null:Nn(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 a=s.getParent();if(ii(a)){if(!et(s))throw Error("Children of root nodes must be elements");return s}s=a}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 a=this.getParent();for(;a!==null;)s.push(a),a=a.getParent();return s}getParentKeys(){const s=[];let a=this.getParent();for(;a!==null;)s.push(a.__key),a=a.getParent();return s}getPreviousSibling(){const a=this.getLatest().__prev;return a===null?null:Nn(a)}getPreviousSiblings(){const s=[],a=this.getParent();if(a===null)return s;let f=a.getFirstChild();for(;f!==null&&!f.is(this);)s.push(f),f=f.getNextSibling();return s}getNextSibling(){const a=this.getLatest().__next;return a===null?null:Nn(a)}getNextSiblings(){const s=[];let a=this.getNextSibling();for(;a!==null;)s.push(a),a=a.getNextSibling();return s}getCommonAncestor(s){const a=this.getParents(),f=s.getParents();et(this)&&a.unshift(this),et(s)&&f.unshift(s);const p=a.length,_=f.length;if(p===0||_===0||a[p-1]!==f[_-1])return null;const A=new Set(f);for(let M=0;M<p;M++){const ae=a[M];if(A.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 a=this.getCommonAncestor(s);let f=0,p=0,_=this;for(;;){const A=_.getParentOrThrow();if(A===a){f=_.getIndexWithinParent();break}_=A}for(_=s;;){const A=_.getParentOrThrow();if(A===a){p=_.getIndexWithinParent();break}_=A}return f<p}isParentOf(s){const a=this.__key;if(a===s.__key)return!1;let f=s;for(;f!==null;){if(f.__key===a)return!0;f=f.getParent()}return!1}getNodesBetween(s){const a=this.isBefore(s),f=[],p=new Set;let _=this;for(;;){const A=_.__key;if(p.has(A)||(p.add(A),f.push(_)),_===s)break;const M=et(_)?a?_.getFirstChild():_.getLastChild():null;if(M!==null){_=M;continue}const ae=a?_.getNextSibling():_.getPreviousSibling();if(ae!==null){_=ae;continue}const fe=_.getParentOrThrow();if(p.has(fe.__key)||f.push(fe),fe===s)break;let me=null,Te=fe;do{if(Te===null)throw Error("getNodesBetween: ancestor is null");me=a?Te.getNextSibling():Te.getPreviousSibling(),Te=Te.getParent(),Te!==null&&me===null&&!p.has(Te.__key)&&f.push(Te)}while(me===null);_=me}return a||f.reverse(),f}isDirty(){const a=Tn()._dirtyLeaves;return a!==null&&a.has(this.__key)}getLatest(){const s=Nn(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(){ur();const s=Ti(),a=Tn(),f=s._nodeMap,p=this.__key,_=this.getLatest(),A=_.__parent,M=a._cloneNotNeeded,ae=mn();if(ar(ae)&&ae.setCachedNodes(null),M.has(p))return Mi(_),_;const me=_.constructor.clone(_);return me.__parent=A,me.__next=_.__next,me.__prev=_.__prev,et(_)&&et(me)?(me.__first=_.__first,me.__last=_.__last,me.__size=_.__size,me.__indent=_.__indent,me.__format=_.__format,me.__dir=_.__dir):mt(_)&&mt(me)&&(me.__format=_.__format,me.__style=_.__style,me.__mode=_.__mode,me.__detail=_.__detail),M.add(p),me.__key=p,Mi(me),f.set(p,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(s,a){throw Error("createDOM: base method not extended")}updateDOM(s,a,f){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){wr(this,!0,s)}replace(s,a){ur();let f=mn();f!==null&&(f=f.clone()),Ps(this,s);const p=this.getLatest(),_=this.__key,A=s.__key,M=s.getWritable(),ae=this.getParentOrThrow().getWritable(),fe=ae.__size;Yr(M);const me=p.getPreviousSibling(),Te=p.getNextSibling(),ve=p.__prev,Ce=p.__next,Ve=p.__parent;if(wr(p,!1,!0),me===null)ae.__first=A;else{const Ue=me.getWritable();Ue.__next=A}if(M.__prev=ve,Te===null)ae.__last=A;else{const Ue=Te.getWritable();Ue.__prev=A}if(M.__next=Ce,M.__parent=Ve,ae.__size=fe,a){if(!(et(this)&&et(M)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Ue=>{M.append(Ue)})}if(Tt(f)){yr(f);const Ue=f.anchor,$e=f.focus;Ue.key===_&&pn(Ue,M),$e.key===_&&pn($e,M)}return sr()===_&&xn(A),M}insertAfter(s,a=!0){ur(),Ps(this,s);const f=this.getWritable(),p=s.getWritable(),_=p.getParent(),A=mn();let M=!1,ae=!1;if(_!==null){const Ce=s.getIndexWithinParent();if(Yr(p),Tt(A)){const Ve=_.__key,Ue=A.anchor,$e=A.focus;M=Ue.type==="element"&&Ue.key===Ve&&Ue.offset===Ce+1,ae=$e.type==="element"&&$e.key===Ve&&$e.offset===Ce+1}}const fe=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),Te=p.__key,ve=f.__next;if(fe===null)me.__last=Te;else{const Ce=fe.getWritable();Ce.__prev=Te}if(me.__size++,f.__next=Te,p.__next=ve,p.__prev=f.__key,p.__parent=f.__parent,a&&Tt(A)){const Ce=this.getIndexWithinParent();Ha(A,me,Ce+1);const Ve=me.__key;M&&A.anchor.set(Ve,Ce+2,"element"),ae&&A.focus.set(Ve,Ce+2,"element")}return s}insertBefore(s,a=!0){ur(),Ps(this,s);const f=this.getWritable(),p=s.getWritable(),_=p.__key;Yr(p);const A=this.getPreviousSibling(),M=this.getParentOrThrow().getWritable(),ae=f.__prev,fe=this.getIndexWithinParent();if(A===null)M.__first=_;else{const Te=A.getWritable();Te.__next=_}M.__size++,f.__prev=_,p.__prev=ae,p.__next=f.__key,p.__parent=f.__parent;const me=mn();if(a&&Tt(me)){const Te=this.getParentOrThrow();Ha(me,Te,fe)}return s}isParentRequired(){return!1}createParentElementNode(){return ji()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(s,a){ur();const f=this.getPreviousSibling(),p=this.getParentOrThrow();if(f===null)return p.select(0,0);if(et(f))return f.select();if(!mt(f)){const _=f.getIndexWithinParent()+1;return p.select(_,_)}return f.select(s,a)}selectNext(s,a){ur();const f=this.getNextSibling(),p=this.getParentOrThrow();if(f===null)return p.select();if(et(f))return f.select(0,0);if(!mt(f)){const _=f.getIndexWithinParent();return p.select(_,_)}return f.select(s,a)}markDirty(){this.getWritable()}}function oi(u,s){const a=Tn()._nodes.get(u);if(a===void 0)throw Error(`Create node: Attempted to create node ${s.name} that was not configured to be used on the editor.`);const f=a.klass;if(f!==s)throw Error(`Create node: Type ${u} in node ${s.name} does not match registered node ${f.name} with the same type`)}function Il(u,s,a){const f=s.getParentOrThrow().getLastChild();let p=s;const _=[s];for(;p!==f;){if(!p.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");p=p.getNextSibling(),_.push(p)}let A=u;for(const M of _)A=A.insertAfter(M)}class Gi extends si{static getType(){return"linebreak"}static clone(s){return new Gi(s.__key)}constructor(s){super(s)}getTextContent(){return`
|
|
41
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:s=>{const a=s.parentElement;let f,p;return a!==null&&((f=a.firstChild)===s||f.nextSibling===s&&f.nodeType===Fe&&(f.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((p=a.lastChild)===s||p.previousSibling===s&&p.nodeType===Fe&&(p.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:wo,priority:0}}}}static importJSON(s){return hs()}exportJSON(){return{type:"linebreak",version:1}}}function wo(u){return{node:hs()}}function hs(){return vr(new Gi)}function li(u){return u instanceof Gi}function Or(u,s){return s&Ie?"code":s&rt?"mark":s&De?"sub":s&je?"sup":null}function Yi(u,s){return s&Oe?"strong":s&ne?"em":"span"}function Oo(u,s,a,f,p){const _=f.classList;let A=Li(p,"base");A!==void 0&&_.add(...A),A=Li(p,"underlineStrikethrough");let M=!1;const ae=s&Se&&s&oe,fe=a&Se&&a&oe;A!==void 0&&(fe?(M=!0,ae||_.add(...A)):ae&&_.remove(...A));for(const me in nn){const ve=nn[me];if(A=Li(p,me),A!==void 0)if(a&ve){if(M&&(me==="underline"||me==="strikethrough")){s&ve&&_.remove(...A);continue}(!(s&ve)||ae&&me==="underline"||me==="strikethrough")&&_.add(...A)}else s&ve&&_.remove(...A)}}function Ia(u,s){const a=u.length,f=s.length;let p=0,_=0;for(;p<a&&p<f&&u[p]===s[p];)p++;for(;_+p<a&&_+p<f&&u[a-_-1]===s[f-_-1];)_++;return[p,a-p-_,s.slice(p,f-_)]}function La(u,s,a){const f=s.firstChild,p=a.isComposing(),A=u+(p?pt:"");if(f==null)s.textContent=A;else{const M=f.nodeValue;if(M!==A)if(p||Ae){const[ae,fe,me]=Ia(M,A);fe!==0&&f.deleteData(ae,fe),f.insertData(ae,me)}else f.nodeValue=A}}function Ll(u,s,a,f,p,_){La(p,u,s);const M=_.theme.text;M!==void 0&&Oo(a,0,f,u,M)}function Ys(u,s){const a=document.createElement(s);return a.appendChild(u),a}class qr extends si{static getType(){return"text"}static clone(s){return new qr(s.__text,s.__key)}constructor(s,a){super(a),this.__text=s,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const s=this.getLatest();return ot[s.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===Ut}isComposing(){return this.__key===sr()}isSegmented(){return this.getLatest().__mode===en}isDirectionless(){return(this.getLatest().__detail&st)!==0}isUnmergeable(){return(this.getLatest().__detail&vt)!==0}hasFormat(s){const a=nn[s];return(this.getFormat()&a)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(s,a){const p=this.getLatest().__format;return $n(p,s,a)}createDOM(s,a){const f=this.__format,p=Or(this,f),_=Yi(this,f),A=p===null?_:p,M=document.createElement(A);let ae=M;this.hasFormat("code")&&M.setAttribute("spellcheck","false"),p!==null&&(ae=document.createElement(_),M.appendChild(ae));const fe=this.__text;Ll(ae,this,_,f,fe,s);const me=this.__style;return me!==""&&(M.style.cssText=me),M}updateDOM(s,a,f){const p=this.__text,_=s.__format,A=this.__format,M=Or(this,_),ae=Or(this,A),fe=Yi(this,_),me=Yi(this,A);if((M===null?fe:M)!==(ae===null?me:ae))return!0;if(M===ae&&fe!==me){const Qe=a.firstChild;if(Qe==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const ft=document.createElement(me);return Ll(ft,this,me,A,p,f),a.replaceChild(ft,Qe),!1}let Ce=a;if(ae!==null&&M!==null&&(Ce=a.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");La(p,Ce,this);const Ue=f.theme.text;Ue!==void 0&&_!==A&&Oo(me,_,A,Ce,Ue);const $e=s.__style,Rt=this.__style;return $e!==Rt&&(a.style.cssText=Rt),!1}static importDOM(){return{"#text":()=>({conversion:Mo,priority:0}),b:()=>({conversion:Pl,priority:0}),code:()=>({conversion:Zr,priority:0}),em:()=>({conversion:Zr,priority:0}),i:()=>({conversion:Zr,priority:0}),s:()=>({conversion:Zr,priority:0}),span:()=>({conversion:Pa,priority:0}),strong:()=>({conversion:Zr,priority:0}),sub:()=>({conversion:Zr,priority:0}),sup:()=>({conversion:Zr,priority:0}),u:()=>({conversion:Zr,priority:0})}}static importJSON(s){const a=On(s.text);return a.setFormat(s.format),a.setDetail(s.detail),a.setMode(s.mode),a.setStyle(s.style),a}exportDOM(s){let{element:a}=super.exportDOM(s);if(!(a!==null&&Fs(a)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return a.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(a=Ys(a,"b")),this.hasFormat("italic")&&(a=Ys(a,"i")),this.hasFormat("strikethrough")&&(a=Ys(a,"s")),this.hasFormat("underline")&&(a=Ys(a,"u")),{element:a}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(s,a){}setFormat(s){const a=this.getWritable();return a.__format=typeof s=="string"?nn[s]:s,a}setDetail(s){const a=this.getWritable();return a.__detail=typeof s=="string"?Sr[s]:s,a}setStyle(s){const a=this.getWritable();return a.__style=s,a}toggleFormat(s){const a=this.getFormat(),f=$n(a,s,null);return this.setFormat(f)}toggleDirectionless(){const s=this.getWritable();return s.__detail^=st,s}toggleUnmergeable(){const s=this.getWritable();return s.__detail^=vt,s}setMode(s){const a=Ze[s];if(this.__mode===a)return this;const f=this.getWritable();return f.__mode=a,f}setTextContent(s){if(this.__text===s)return this;const a=this.getWritable();return a.__text=s,a}select(s,a){ur();let f=s,p=a;const _=mn(),A=this.getTextContent(),M=this.__key;if(typeof A=="string"){const ae=A.length;f===void 0&&(f=ae),p===void 0&&(p=ae)}else f=0,p=0;if(Tt(_)){const ae=sr();(ae===_.anchor.key||ae===_.focus.key)&&xn(M),_.setTextNodeRange(this,f,this,p)}else return Ed(M,f,M,p,"text","text");return _}selectStart(){return this.select(0,0)}selectEnd(){const s=this.getTextContentSize();return this.select(s,s)}spliceText(s,a,f,p){const _=this.getWritable(),A=_.__text,M=f.length;let ae=s;ae<0&&(ae=M+ae,ae<0&&(ae=0));const fe=mn();if(p&&Tt(fe)){const Te=s+M;fe.setTextNodeRange(_,Te,_,Te)}const me=A.slice(0,ae)+f+A.slice(ae+a);return _.__text=me,_}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...s){ur();const a=this.getLatest(),f=a.getTextContent(),p=a.__key,_=sr(),A=new Set(s),M=[],ae=f.length;let fe="";for(let an=0;an<ae;an++)fe!==""&&A.has(an)&&(M.push(fe),fe=""),fe+=f[an];fe!==""&&M.push(fe);const me=M.length;if(me===0)return[];if(M[0]===f)return[a];const Te=M[0],ve=a.getParentOrThrow();let Ce;const Ve=a.getFormat(),Ue=a.getStyle(),$e=a.__detail;let Rt=!1;a.isSegmented()?(Ce=On(Te),Ce.__format=Ve,Ce.__style=Ue,Ce.__detail=$e,Rt=!0):(Ce=a.getWritable(),Ce.__text=Te);const Qe=mn(),ft=[Ce];let qt=Te.length;for(let an=1;an<me;an++){const nr=M[an],gs=nr.length,dr=On(nr).getWritable();dr.__format=Ve,dr.__style=Ue,dr.__detail=$e;const rn=dr.__key,In=qt+gs;if(Tt(Qe)){const ci=Qe.anchor,Vi=Qe.focus;ci.key===p&&ci.type==="text"&&ci.offset>qt&&ci.offset<=In&&(ci.key=rn,ci.offset-=qt,Qe.dirty=!0),Vi.key===p&&Vi.type==="text"&&Vi.offset>qt&&Vi.offset<=In&&(Vi.key=rn,Vi.offset-=qt,Qe.dirty=!0)}_===p&&xn(rn),qt=In,ft.push(dr)}cl(this);const Wt=ve.getWritable(),At=this.getIndexWithinParent();return Rt?(Wt.splice(At,0,ft),this.remove()):Wt.splice(At,1,ft),Tt(Qe)&&Ha(Qe,ve,At,me-1),ft}mergeWithSibling(s){const a=s===this.getPreviousSibling();if(!a&&s!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const f=this.__key,p=s.__key,_=this.__text,A=_.length;sr()===p&&xn(f);const ae=mn();if(Tt(ae)){const ve=ae.anchor,Ce=ae.focus;ve!==null&&ve.key===p&&(xd(ve,a,f,s,A),ae.dirty=!0),Ce!==null&&Ce.key===p&&(xd(Ce,a,f,s,A),ae.dirty=!0)}const fe=s.__text,me=a?fe+_:_+fe;this.setTextContent(me);const Te=this.getWritable();return s.remove(),Te}isTextEntity(){return!1}}function Pa(u){const s=u,a=s.style.fontWeight==="700",f=s.style.textDecoration==="line-through",p=s.style.fontStyle==="italic",_=s.style.textDecoration==="underline",A=s.style.verticalAlign;return{forChild:M=>(mt(M)&&(a&&M.toggleFormat("bold"),f&&M.toggleFormat("strikethrough"),p&&M.toggleFormat("italic"),_&&M.toggleFormat("underline"),A==="sub"&&M.toggleFormat("subscript"),A==="super"&&M.toggleFormat("superscript")),M),node:null}}function Pl(u){const a=u.style.fontWeight==="normal";return{forChild:f=>(mt(f)&&!a&&f.toggleFormat("bold"),f),node:null}}const Ao=new WeakMap;function $a(u){return u.nodeName==="PRE"||u.nodeType===Le&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function js(u){let s,a=u.parentNode;const f=[u];for(;a!==null&&(s=Ao.get(a))===void 0&&!$a(a);)f.push(a),a=a.parentNode;const p=s===void 0?a:s;for(let _=0;_<f.length;_++)Ao.set(f[_],p);return p}function Mo(u){const s=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let f=s.textContent||"";if(js(s)!==null){const p=f.split(/(\r?\n|\t)/),_=[],A=p.length;for(let M=0;M<A;M++){const ae=p[M];ae===`
|
|
42
42
|
`||ae===`\r
|
|
43
|
-
`?_.push(
|
|
44
|
-
`),ve.isEmpty()?me=!1:me=!0;else if(me=!1,mt(ve)){let Ce=ve.getTextContent();ve===a?ve===f?(p.type!=="element"||_.type!=="element"||_.offset===p.offset)&&(Ce=M<ae?Ce.slice(M,ae):Ce.slice(ae,M)):Ce=A?Ce.slice(M):Ce.slice(ae):ve===f&&(Ce=A?Ce.slice(0,ae):Ce.slice(0,M)),fe+=Ce}else(An(ve)||
|
|
43
|
+
`?_.push(hs()):ae===" "?_.push(Do()):ae!==""&&_.push(On(ae))}return{node:_}}if(f=f.replace(/\r/g,"").replace(/[ \t\n]+/g," "),f==="")return{node:null};if(f[0]===" "){let p=s,_=!0;for(;p!==null&&(p=Fa(p,!1))!==null;){const A=p.textContent||"";if(A.length>0){/[ \t\n]$/.test(A)&&(f=f.slice(1)),_=!1;break}}_&&(f=f.slice(1))}if(f[f.length-1]===" "){let p=s,_=!0;for(;p!==null&&(p=Fa(p,!0))!==null;)if((p.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){_=!1;break}_&&(f=f.slice(0,f.length-1))}return f===""?{node:null}:{node:On(f)}}const $l=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 Fa(u,s){let a=u;for(;;){let f;for(;(f=s?a.nextSibling:a.previousSibling)===null;){const _=a.parentElement;if(_===null)return null;a=_}if(a=f,a.nodeType===Le){const _=a.style.display;if(_===""&&a.nodeName.match($l)===null||_!==""&&!_.startsWith("inline"))return null}let p=a;for(;(p=s?a.firstChild:a.lastChild)!==null;)a=p;if(a.nodeType===Fe)return a;if(a.nodeName==="BR")return null}}const Fl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Zr(u){const s=Fl[u.nodeName.toLowerCase()];return s===void 0?{node:null}:{forChild:a=>(mt(a)&&!a.hasFormat(s)&&a.toggleFormat(s),a),node:null}}function On(u=""){return vr(new qr(u))}function mt(u){return u instanceof qr}class Er extends qr{static getType(){return"tab"}static clone(s){const a=new Er(s.__key);return a.__text=s.__text,a.__format=s.__format,a.__style=s.__style,a}constructor(s){super(" ",s),this.__detail=vt}static importDOM(){return null}static importJSON(s){const a=Do();return a.setFormat(s.format),a.setStyle(s.style),a}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 Do(){return vr(new Er)}function Ro(u){return u instanceof Er}class Lc{constructor(s,a,f){this._selection=null,this.key=s,this.offset=a,this.type=f}is(s){return this.key===s.key&&this.offset===s.offset&&this.type===s.type}isBefore(s){let a=this.getNode(),f=s.getNode();const p=this.offset,_=s.offset;if(et(a)){const A=a.getDescendantByIndex(p);a=A??a}if(et(f)){const A=f.getDescendantByIndex(_);f=A??f}return a===f?p<_:a.isBefore(f)}getNode(){const s=this.key,a=Nn(s);if(a===null)throw Error("Point.getNode: node not found");return a}set(s,a,f){const p=this._selection,_=this.key;this.key=s,this.offset=a,this.type=f,Lo()||(sr()===_&&xn(s),p!==null&&(p.setCachedNodes(null),p.dirty=!0))}}function Ar(u,s,a){return new Lc(u,s,a)}function bo(u,s){let a=s.__key,f=u.offset,p="element";if(mt(s)){p="text";const _=s.getTextContentSize();f>_&&(f=_)}else if(!et(s)){const _=s.getNextSibling();if(mt(_))a=_.__key,f=0,p="text";else{const A=s.getParent();A&&(a=A.__key,f=s.getIndexWithinParent()+1)}}u.set(a,f,p)}function pn(u,s){if(et(s)){const a=s.getLastDescendant();et(a)||mt(a)?bo(u,a):bo(u,s)}else bo(u,s)}function qn(u,s,a,f){const p=u.getNode(),_=p.getChildAtIndex(u.offset),A=On(),M=Kr(p)?ji().append(A):A;A.setFormat(a),A.setStyle(f),_===null?p.append(M):_.insertBefore(M),u.is(s)&&s.set(A.__key,0,"text"),u.set(A.__key,0,"text")}function En(u,s,a,f){u.key=s,u.offset=a,u.type=f}class Mr{constructor(s,a){this.anchor=s,this.focus=a,s._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){return ar(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 ai(this)}}class Ei{constructor(s){this.dirty=!1,this._nodes=s,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){if(!Hr(s))return!1;const a=this._nodes,f=s._nodes;return a.size===f.size&&Array.from(a).every(p=>f.has(p))}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 Ei(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(s){}insertText(){}insertNodes(s){const a=this.getNodes(),f=a.length,p=a[f-1];let _;if(mt(p))_=p.select();else{const A=p.getIndexWithinParent()+1;_=p.getParentOrThrow().select(A,A)}_.insertNodes(s);for(let A=0;A<f;A++)a[A].remove()}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const a=this._nodes,f=[];for(const p of a){const _=Nn(p);_!==null&&f.push(_)}return Lo()||(this._cachedNodes=f),f}getTextContent(){const s=this.getNodes();let a="";for(let f=0;f<s.length;f++)a+=s[f].getTextContent();return a}}function Tt(u){return u instanceof tr}function ar(u){return u instanceof Mr}function Dr(u){const[s,,a]=Sd(u),f=a.getChildren(),p=f.length,_=f[0].getChildren().length,A=new Array(p);for(let M=0;M<p;M++)A[M]=new Array(_);for(let M=0;M<p;M++){const fe=f[M].getChildren();let me=0;for(let Te=0;Te<fe.length;Te++){for(;A[M][me];)me++;const ve=fe[Te],Ce=ve.__rowSpan||1,Ve=ve.__colSpan||1;for(let Ue=0;Ue<Ce;Ue++)for(let $e=0;$e<Ve;$e++)A[M+Ue][me+$e]=ve;if(s===ve)return{colSpan:Ve,columnIndex:me,rowIndex:M,rowSpan:Ce};me+=Ve}}return null}class tr extends Mr{constructor(s,a,f,p){super(s,a),this.format=f,this.style=p}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 a=this.anchor,f=this.focus,p=a.isBefore(f),_=p?a:f,A=p?f:a;let M=_.getNode(),ae=A.getNode();const fe=_.offset,me=A.offset;if(et(M)){const ve=M.getDescendantByIndex(fe);M=ve??M}if(et(ae)){let ve=ae.getDescendantByIndex(me);ve!==null&&ve!==M&&ae.getChildAtIndex(me)===ve&&(ve=ve.getPreviousSibling()),ae=ve??ae}let Te;return M.is(ae)?et(M)&&M.getChildrenSize()>0?Te=[]:Te=[M]:Te=M.getNodesBetween(ae),Lo()||(this._cachedNodes=Te),Te}setTextNodeRange(s,a,f,p){En(this.anchor,s.__key,a,"text"),En(this.focus,f.__key,p,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const s=this.getNodes();if(s.length===0)return"";const a=s[0],f=s[s.length-1],p=this.anchor,_=this.focus,A=p.isBefore(_),[M,ae]=ai(this);let fe="",me=!0;for(let Te=0;Te<s.length;Te++){const ve=s[Te];if(et(ve)&&!ve.isInline())me||(fe+=`
|
|
44
|
+
`),ve.isEmpty()?me=!1:me=!0;else if(me=!1,mt(ve)){let Ce=ve.getTextContent();ve===a?ve===f?(p.type!=="element"||_.type!=="element"||_.offset===p.offset)&&(Ce=M<ae?Ce.slice(M,ae):Ce.slice(ae,M)):Ce=A?Ce.slice(M):Ce.slice(ae):ve===f&&(Ce=A?Ce.slice(0,ae):Ce.slice(0,M)),fe+=Ce}else(An(ve)||li(ve))&&(ve!==f||!this.isCollapsed())&&(fe+=ve.getTextContent())}return fe}applyDOMRange(s){const a=Tn(),p=a.getEditorState()._selection,_=Cd(s.startContainer,s.startOffset,s.endContainer,s.endOffset,a,p);if(_===null)return;const[A,M]=_;En(this.anchor,A.key,A.offset,A.type),En(this.focus,M.key,M.offset,M.type),this._cachedNodes=null}clone(){const s=this.anchor,a=this.focus;return new tr(Ar(s.key,s.offset,s.type),Ar(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(s){this.format=$n(this.format,s,null),this.dirty=!0}setStyle(s){this.style=s,this.dirty=!0}hasFormat(s){const a=nn[s];return(this.format&a)!==0}insertRawText(s){const a=s.split(/(\r?\n|\t)/),f=[],p=a.length;for(let _=0;_<p;_++){const A=a[_];A===`
|
|
45
45
|
`||A===`\r
|
|
46
|
-
`?f.push(fs()):A===" "?f.push(Do()):f.push(On(A))}this.insertNodes(f)}insertText(s){const a=this.anchor,f=this.focus,p=this.isCollapsed()||a.isBefore(f),_=this.format,A=this.style;p&&a.type==="element"?qn(a,f,_,A):!p&&f.type==="element"&&qn(f,a,_,A);const M=this.getNodes(),ae=M.length,fe=p?a:f,me=p?f:a,Te=fe.offset,ve=me.offset;let Ce=M[0];if(!mt(Ce))throw Error("insertText: first node is not a text node");const Ue=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Rt=ae-1;let Qe=M[Rt];if(this.isCollapsed()&&Te===Ue&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ft=Ce.getNextSibling();if((!mt(ft)||!ft.canInsertTextBefore()||Wn(ft))&&(ft=On(),ft.setFormat(_),$e.canInsertTextAfter()?Ce.insertAfter(ft):$e.insertAfter(ft)),ft.select(0,0),Ce=ft,s!==""){this.insertText(s);return}}else if(this.isCollapsed()&&Te===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ft=Ce.getPreviousSibling();if((!mt(ft)||Wn(ft))&&(ft=On(),ft.setFormat(_),$e.canInsertTextBefore()?Ce.insertBefore(ft):$e.insertBefore(ft)),ft.select(),Ce=ft,s!==""){this.insertText(s);return}}else if(Ce.isSegmented()&&Te!==Ue){const ft=On(Ce.getTextContent());ft.setFormat(_),Ce.replace(ft),Ce=ft}else if(!this.isCollapsed()&&s!==""){const ft=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ft)&&(!ft.canInsertTextBefore()||!ft.canInsertTextAfter())){this.insertText(""),Nd(this.anchor,this.focus,null),this.insertText(s);return}}if(ae===1){if(Ce.isToken()){const At=On(s);At.select(),Ce.replace(At);return}const ft=Ce.getFormat(),qt=Ce.getStyle();if(Te===ve&&(ft!==_||qt!==A))if(Ce.getTextContent()==="")Ce.setFormat(_),Ce.setStyle(A);else{const At=On(s);if(At.setFormat(_),At.setStyle(A),At.select(),Te===0)Ce.insertBefore(At,!1);else{const[an]=Ce.splitText(Te);an.insertAfter(At,!1)}At.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);return}else if(Ro(Ce)){const At=On(s);At.setFormat(_),At.setStyle(A),At.select(),Ce.replace(At);return}const Wt=ve-Te;Ce=Ce.spliceText(Te,Wt,s,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=s.length:(this.format=ft,this.style=qt))}else{const ft=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),qt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),At=Qe;if(!qt.is(Wt)&&Wt.isInline())do At=Wt,Wt=Wt.getParentOrThrow();while(Wt.isInline());if(me.type==="text"&&(ve!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<ve)if(mt(Qe)&&!Qe.isToken()&&ve!==Qe.getTextContentSize()){if(Qe.isSegmented()){const rn=On(Qe.getTextContent());Qe.replace(rn),Qe=rn}!Wr(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,ve,"")),ft.add(Qe.__key)}else{const rn=Qe.getParentOrThrow();!rn.canBeEmpty()&&rn.getChildrenSize()===1?rn.remove():Qe.remove()}else ft.add(Qe.__key);const an=Wt.getChildren(),nr=new Set(M),hs=qt.is(Wt),dr=qt.isInline()&&Ce.getNextSibling()===null?qt:Ce;for(let rn=an.length-1;rn>=0;rn--){const In=an[rn];if(In.is(Ce)||et(In)&&In.isParentOf(Ce))break;In.isAttached()&&(!nr.has(In)||In.is(At)?hs||dr.insertAfter(In,!1):In.remove())}if(!hs){let rn=Wt,In=null;for(;rn!==null;){const ai=rn.getChildren(),ji=ai.length;(ji===0||ai[ji-1].is(In))&&(ft.delete(rn.__key),In=rn),rn=rn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(Te,Ue-Te,s,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);else if(Te===Ue)Ce.select();else{const rn=On(s);rn.select(),Ce.replace(rn)}for(let rn=1;rn<ae;rn++){const In=M[rn],ai=In.__key;ft.has(ai)||In.remove()}}}removeText(){this.insertText("")}formatText(s){if(this.isCollapsed()){this.toggleFormat(s),xn(null);return}const a=this.getNodes(),f=[];for(const Qe of a)mt(Qe)&&f.push(Qe);const p=f.length;if(p===0){this.toggleFormat(s),xn(null);return}const _=this.anchor,A=this.focus,M=this.isBackward(),ae=M?A:_,fe=M?_:A;let me=0,Te=f[0],ve=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&ve===Te.getTextContentSize()&&(me=1,Te=f[1],ve=0),Te==null)return;const Ce=Te.getFormatFlags(s,null),Ve=p-1;let Ue=f[Ve];const $e=fe.type==="text"?fe.offset:Ue.getTextContentSize();if(Te.is(Ue)){if(ve===$e)return;if(ve===0&&$e===Te.getTextContentSize())Te.setFormat(Ce);else{const Qe=Te.splitText(ve,$e),ft=ve===0?Qe[0]:Qe[1];ft.setFormat(Ce),ae.type==="text"&&ae.set(ft.__key,0,"text"),fe.type==="text"&&fe.set(ft.__key,$e-ve,"text")}this.format=Ce;return}ve!==0&&([,Te]=Te.splitText(ve),ve=0),Te.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 ft=f[Qe];if(!ft.isToken()){const qt=ft.getFormatFlags(s,Rt);ft.setFormat(qt)}}ae.type==="text"&&ae.set(Te.__key,ve,"text"),fe.type==="text"&&fe.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=mn();if(!Tt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(s)}const a=Co(this.anchor.getNode(),$i),f=s[s.length-1];if("__language"in a&&et(a)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Fc(this);a.splice($e,0,s),f.selectEnd()}return}const p=$e=>(et($e)||An($e))&&!$e.isInline();if(!s.some(p)){if(!et(a))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Fc(this);a.splice($e,0,s),f.selectEnd();return}const _=Am(s),A=_.getLastDescendant(),M=_.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,fe=$e=>et($e)&&$i($e)&&!$e.isEmpty()&&et(a)&&(!a.isEmpty()||ae(a)),Te=!et(a)||!a.isEmpty()?this.insertParagraph():null,ve=M[M.length-1];let Ce=M[0];if(fe(Ce)){if(!et(a))throw Error("Expected 'firstBlock' to be an ElementNode");a.append(...Ce.getChildren()),Ce=M[1]}Ce&&Il(a,Ce);const Ve=Co(A,$i);Te&&et(Ve)&&(ae(Te)||$i(ve))&&(Ve.append(...Te.getChildren()),Te.remove()),et(a)&&a.isEmpty()&&a.remove(),A.selectEnd();const Ue=et(a)?a.getLastChild():null;oi(Ue)&&Ve!==a&&Ue.remove()}insertParagraph(){if(this.anchor.key==="root"){const A=Yi();return Qn().splice(this.anchor.offset,0,[A]),A.select(),A}const s=Fc(this),a=Co(this.anchor.getNode(),$i);if(!et(a))throw Error("Expected ancestor to be an ElementNode");const f=a.getChildAtIndex(s),p=f?[f,...f.getNextSiblings()]:[],_=a.insertNewAfter(this,!1);return _?(_.append(...p),_.selectStart(),_):null}insertLineBreak(s){const a=fs();if(this.insertNodes([a]),s){const f=a.getParentOrThrow(),p=a.getIndexWithinParent();f.select(p,p)}}extract(){const s=this.getNodes(),a=s.length,f=a-1,p=this.anchor,_=this.focus;let A=s[0],M=s[f];const[ae,fe]=li(this);if(a===0)return[];if(a===1){if(mt(A)&&!this.isCollapsed()){const Te=ae>fe?fe:ae,ve=ae>fe?ae:fe,Ce=A.splitText(Te,ve),Ve=Te===0?Ce[0]:Ce[1];return Ve!=null?[Ve]:[]}return[A]}const me=p.isBefore(_);if(mt(A)){const Te=me?ae:fe;Te===A.getTextContentSize()?s.shift():Te!==0&&([,A]=A.splitText(Te),s[0]=A)}if(mt(M)){const ve=M.getTextContent().length,Ce=me?fe:ae;Ce===0?s.pop():Ce!==ve&&([M]=M.splitText(Ce),s[f]=M)}return s}modify(s,a,f){const p=this.focus,_=this.anchor,A=s==="move",M=Cl(p,a);if(An(M)&&!M.isIsolated()){if(A&&M.isKeyboardSelectable()){const Ce=Pc();Ce.add(M.__key),yr(Ce);return}const ve=a?M.getPreviousSibling():M.getNextSibling();if(mt(ve)){const Ce=ve.__key,Ve=a?ve.getTextContent().length:0;p.set(Ce,Ve,"text"),A&&_.set(Ce,Ve,"text");return}else{const Ce=M.getParentOrThrow();let Ve,Ue;et(ve)?(Ue=ve.__key,Ve=a?ve.getChildrenSize():0):(Ve=M.getIndexWithinParent(),Ue=Ce.__key,a||Ve++),p.set(Ue,Ve,"element"),A&&_.set(Ue,Ve,"element");return}}const ae=Tn(),fe=or(ae._window);if(!fe)return;const me=ae._blockCursorElement,Te=ae._rootElement;if(Te!==null&&me!==null&&et(M)&&!M.isInline()&&!M.canBeEmpty()&&Ps(me,ae,Te),Ba(fe,s,a?"backward":"forward",f),fe.rangeCount>0){const ve=fe.getRangeAt(0),Ce=this.anchor.getNode(),Ve=Wr(Ce)?Ce:_o(Ce);if(this.applyDOMRange(ve),this.dirty=!0,!A){const Ue=this.getNodes(),$e=[];let Rt=!1;for(let Qe=0;Qe<Ue.length;Qe++){const ft=Ue[Qe];Pi(ft,Ve)?$e.push(ft):Rt=!0}if(Rt&&$e.length>0)if(a){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()}(fe.anchorNode!==ve.startContainer||fe.anchorOffset!==ve.startOffset)&&ko(this)}}}deleteCharacter(s){const a=this.isCollapsed();if(this.isCollapsed()){const f=this.anchor,p=this.focus;let _=f.getNode();if(!s&&(f.type==="element"&&et(_)&&f.offset===_.getChildrenSize()||f.type==="text"&&f.offset===_.getTextContentSize())){const M=_.getParent(),ae=_.getNextSibling()||(M===null?null:M.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const A=Cl(p,s);if(An(A)&&!A.isIsolated()){if(A.isKeyboardSelectable()&&et(_)&&_.getChildrenSize()===0){_.remove();const M=Pc();M.add(A.__key),yr(M)}else A.remove(),Tn().dispatchCommand(t,void 0);return}else if(!s&&et(A)&&et(_)&&_.isEmpty()){_.remove(),A.selectStart();return}if(this.modify("extend",s,"character"),this.isCollapsed()){if(s&&f.offset===0&&(f.type==="element"?f.getNode():f.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const M=p.type==="text"?p.getNode():null;if(_=f.type==="text"?f.getNode():null,M!==null&&M.isSegmented()){const ae=p.offset,fe=M.getTextContentSize();if(M.is(_)||s&&ae!==fe||!s&&ae!==0){md(M,s,ae);return}}else if(_!==null&&_.isSegmented()){const ae=f.offset,fe=_.getTextContentSize();if(_.is(M)||s&&ae!==0||!s&&ae!==fe){md(_,s,ae);return}}_m(this,s)}}if(this.removeText(),s&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const f=this.anchor.getNode();f.isEmpty()&&Wr(f.getParent())&&f.getIndexWithinParent()===0&&f.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 Br(u){return u instanceof Ci}function cr(u){const s=u.offset;if(u.type==="text")return s;const a=u.getNode();return s===a.getChildrenSize()?a.getTextContent().length:0}function li(u){const s=u.anchor,a=u.focus;return s.type==="element"&&a.type==="element"&&s.key===a.key&&s.offset===a.offset?[0,0]:[cr(s),cr(a)]}function ko(u){const s=u.focus,a=u.anchor,f=a.key,p=a.offset,_=a.type;En(a,s.key,s.offset,s.type),En(s,f,p,_),u._cachedNodes=null}function Ba(u,s,a,f){u.modify(s,a,f)}function _m(u,s){const a=u.anchor,f=u.focus,p=a.getNode(),_=f.getNode();if(p===_&&a.type==="text"&&f.type==="text"){const A=a.offset,M=f.offset,ae=A<M,fe=ae?A:M,me=ae?M:A,Te=me-1;if(fe!==Te){const ve=p.getTextContent().slice(fe,me);Os(ve)||(s?f.offset=Te:a.offset=Te)}}}function md(u,s,a){const f=u,_=f.getTextContent().split(/(?=\s)/g),A=_.length;let M=0,ae=0;for(let me=0;me<A;me++){const Te=_[me],ve=me===A-1;if(ae=M,M+=Te.length,s&&M===a||M>a||ve){_.splice(me,1),ve&&(ae=void 0);break}}const fe=_.join("").trim();fe===""?f.remove():(f.setTextContent(fe),f.select(ae,ae))}function ym(u,s,a){const f=u.getParent();return a===null||f===null||!f.canBeEmpty()||f!==a.getNode()}function _d(u,s,a,f){let p=s,_;if(u.nodeType===Le){let A=!1;const M=u.childNodes,ae=M.length;p===ae&&(A=!0,p=ae-1);let fe=M[p],me=!1;if(fe===f._blockCursorElement?(fe=M[p+1],me=!0):f._blockCursorElement!==null&&p--,_=Di(fe),mt(_))p=fl(_,A);else{let Te=Di(u);if(Te===null)return null;if(et(Te)){let ve=Te.getChildAtIndex(p);if(et(ve)&&ym(ve,p,a)){const Ce=A?ve.getLastDescendant():ve.getFirstDescendant();Ce===null?(Te=ve,p=0):(ve=Ce,Te=et(ve)?ve:ve.getParentOrThrow())}mt(ve)?(_=ve,Te=null,p=fl(ve,A)):ve!==Te&&A&&!me&&p++}else{const ve=Te.getIndexWithinParent();s===0&&An(Te)&&Di(u)===Te?p=ve:p=ve+1,Te=Te.getParentOrThrow()}if(et(Te))return Ar(Te.__key,p,"element")}}else _=Di(u);return mt(_)?Ar(_.__key,p,"text"):null}function yd(u,s,a){const f=u.offset,p=u.getNode();if(f===0){const _=p.getPreviousSibling(),A=p.getParent();if(!s)et(_)&&!a&&_.isInline()?(u.key=_.__key,u.offset=_.getChildrenSize(),u.type="element"):mt(_)&&(u.key=_.__key,u.offset=_.getTextContent().length);else if((a||!s)&&_===null&&et(A)&&A.isInline()){const M=A.getPreviousSibling();mt(M)&&(u.key=M.__key,u.offset=M.getTextContent().length)}}else if(f===p.getTextContent().length){const _=p.getNextSibling(),A=p.getParent();if(s&&et(_)&&_.isInline())u.key=_.__key,u.offset=0,u.type="element";else if((a||s)&&_===null&&et(A)&&A.isInline()&&!A.canInsertTextAfter()){const M=A.getNextSibling();mt(M)&&(u.key=M.__key,u.offset=0)}}}function Nd(u,s,a){if(u.type==="text"&&s.type==="text"){const f=u.isBefore(s),p=u.is(s);yd(u,f,p),yd(s,!f,p),p&&(s.key=u.key,s.offset=u.offset,s.type=u.type);const _=Tn();if(_.isComposing()&&_._compositionKey!==u.key&&Tt(a)){const A=a.anchor,M=a.focus;En(u,A.key,A.offset,A.type),En(s,M.key,M.offset,M.type)}}}function Cd(u,s,a,f,p,_){if(u===null||a===null||!ns(p,u,a))return null;const A=_d(u,s,Tt(_)?_.anchor:null,p);if(A===null)return null;const M=_d(a,f,Tt(_)?_.focus:null,p);if(M===null)return null;if(A.type==="element"&&M.type==="element"){const ae=Di(u),fe=Di(a);if(An(ae)&&An(fe))return null}return Nd(A,M,_),[A,M]}function Nm(u){return et(u)&&!u.isInline()}function Ed(u,s,a,f,p,_){const A=Ei(),M=new tr(Ar(u,s,p),Ar(a,f,_),0,"");return M.dirty=!0,A._selection=M,M}function Cm(){const u=Ar("root",0,"element"),s=Ar("root",0,"element");return new tr(u,s,0,"")}function Pc(){return new Ci(new Set)}function Em(u){const a=u.getEditorState()._selection,f=or(u._window);return Tt(a)||a==null?$c(a,f,u,null):a.clone()}function $c(u,s,a,f){const p=a._window;if(p===null)return null;const _=f||p.event,A=_?_.type:void 0,M=A==="selectionchange",ae=!Pt()&&(M||A==="beforeinput"||A==="compositionstart"||A==="compositionend"||A==="click"&&_&&_.detail===3||A==="drop"||A===void 0);let fe,me,Te,ve;if(!Tt(u)||ae){if(s===null)return null;if(fe=s.anchorNode,me=s.focusNode,Te=s.anchorOffset,ve=s.focusOffset,M&&Tt(u)&&!ns(a,fe,me))return u.clone()}else return u.clone();const Ce=Cd(fe,Te,me,ve,a,u);if(Ce===null)return null;const[Ve,Ue]=Ce;return new tr(Ve,Ue,Tt(u)?u.format:0,Tt(u)?u.style:"")}function mn(){return Ei()._selection}function Io(){return Tn()._editorState._selection}function Ha(u,s,a,f=1){const p=u.anchor,_=u.focus,A=p.getNode(),M=_.getNode();if(!s.is(A)&&!s.is(M))return;const ae=s.__key;if(u.isCollapsed()){const fe=p.offset;if(a<=fe&&f>0||a<fe&&f<0){const me=Math.max(0,fe+f);p.set(ae,me,"element"),_.set(ae,me,"element"),Td(u)}}else{const fe=u.isBackward(),me=fe?_:p,Te=me.getNode(),ve=fe?p:_,Ce=ve.getNode();if(s.is(Te)){const Ve=me.offset;(a<=Ve&&f>0||a<Ve&&f<0)&&me.set(ae,Math.max(0,Ve+f),"element")}if(s.is(Ce)){const Ve=ve.offset;(a<=Ve&&f>0||a<Ve&&f<0)&&ve.set(ae,Math.max(0,Ve+f),"element")}}Td(u)}function Td(u){const s=u.anchor,a=s.offset,f=u.focus,p=f.offset,_=s.getNode(),A=f.getNode();if(u.isCollapsed()){if(!et(_))return;const M=_.getChildrenSize(),ae=a>=M,fe=ae?_.getChildAtIndex(M-1):_.getChildAtIndex(a);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),s.set(fe.__key,me,"text"),f.set(fe.__key,me,"text")}return}if(et(_)){const M=_.getChildrenSize(),ae=a>=M,fe=ae?_.getChildAtIndex(M-1):_.getChildAtIndex(a);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),s.set(fe.__key,me,"text")}}if(et(A)){const M=A.getChildrenSize(),ae=p>=M,fe=ae?A.getChildAtIndex(M-1):A.getChildAtIndex(p);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),f.set(fe.__key,me,"text")}}}function Tm(u,s){const f=s.getEditorState()._selection,p=u._selection;if(Tt(p)){const _=p.anchor,A=p.focus;let M;if(_.type==="text"&&(M=_.getNode(),M.selectionTransform(f,p)),A.type==="text"){const ae=A.getNode();M!==ae&&ae.selectionTransform(f,p)}}}function Wa(u,s,a,f,p){let _=null,A=0,M=null;f!==null?(_=f.__key,mt(f)?(A=f.getTextContentSize(),M="text"):et(f)&&(A=f.getChildrenSize(),M="element")):p!==null&&(_=p.__key,mt(p)?M="text":et(p)&&(M="element")),_!==null&&M!==null?u.set(_,A,M):(A=s.getIndexWithinParent(),A===-1&&(A=a.getChildrenSize()),u.set(a.__key,A,"element"))}function xd(u,s,a,f,p){u.type==="text"?(u.key=a,s||(u.offset+=p)):u.offset>f.getIndexWithinParent()&&(u.offset-=1)}function xm(u,s,a,f,p,_,A){const M=f.anchorNode,ae=f.focusNode,fe=f.anchorOffset,me=f.focusOffset,Te=document.activeElement;if(p.has("collaboration")&&Te!==_||Te!==null&&Ss(Te))return;if(!Tt(s)){u!==null&&ns(a,M,ae)&&f.removeAllRanges();return}const ve=s.anchor,Ce=s.focus,Ve=ve.key,Ue=Ce.key,$e=Is(a,Ve),Rt=Is(a,Ue),Qe=ve.offset,ft=Ce.offset,qt=s.format,Wt=s.style,At=s.isCollapsed();let an=$e,nr=Rt,hs=!1;if(ve.type==="text"){an=kr($e);const dr=ve.getNode();hs=dr.getFormat()!==qt||dr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(hs=!0);if(Ce.type==="text"&&(nr=kr(Rt)),!(an===null||nr===null)&&(At&&(u===null||hs||Tt(u)&&(u.format!==qt||u.style!==Wt))&&Un(qt,Wt,Qe,Ve,performance.now()),!(fe===Qe&&me===ft&&M===an&&ae===nr&&!(f.type==="Range"&&At)&&((Te===null||!_.contains(Te))&&_.focus({preventScroll:!0}),ve.type!=="element")))){try{f.setBaseAndExtent(an,Qe,nr,ft)}catch{}if(!p.has("skip-scroll-into-view")&&s.isCollapsed()&&_!==null&&_===document.activeElement){const dr=s instanceof tr&&s.anchor.type==="element"?an.childNodes[Qe]||null:f.rangeCount>0?f.getRangeAt(0):null;if(dr!==null){let rn;if(dr instanceof Text){const In=document.createRange();In.selectNode(dr),rn=In.getBoundingClientRect()}else rn=dr.getBoundingClientRect();mi(a,rn,_)}}zt()}}function Sm(u){let s=mn()||Io();s===null&&(s=Qn().selectEnd()),s.insertNodes(u)}function vm(){const u=mn();return u===null?"":u.getTextContent()}function wm(u,s,a){const f=[];let p=null,_=null;function A(fe,me,Te){const ve={cell:Te,startColumn:me,startRow:fe},Ce=Te.__rowSpan,Ve=Te.__colSpan;for(let Ue=0;Ue<Ce;Ue++){f[fe+Ue]===void 0&&(f[fe+Ue]=[]);for(let $e=0;$e<Ve;$e++)f[fe+Ue][me+$e]=ve}s.is(Te)&&(p=ve),a.is(Te)&&(_=ve)}function M(fe,me){return f[fe]===void 0||f[fe][me]===void 0}const ae=u.getChildren();for(let fe=0;fe<ae.length;fe++){const me=ae[fe];if(!Uc(me))throw Error("Expected GridNode children to be GridRowNode");const Te=me.getChildren();let ve=0;for(const Ce of Te){if(!Fo(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!M(fe,ve);)ve++;A(fe,ve,Ce),ve+=Ce.__colSpan}}if(p===null)throw Error("Anchor not found in Grid");if(_===null)throw Error("Focus not found in Grid");return[f,p,_]}function Sd(u){let s;if(u instanceof zc)s=u;else if(u instanceof ii){const p=No(u,Fo);if(!Fo(p))throw Error("Expected to find a parent GridCellNode");s=p}else{const p=No(u.getNode(),Fo);if(!Fo(p))throw Error("Expected to find a parent GridCellNode");s=p}const a=s.getParent();if(!Uc(a))throw Error("Expected GridCellNode to have a parent GridRowNode");const f=a.getParent();if(!Fd(f))throw Error("Expected GridRowNode to have a parent GridNode");return[s,a,f]}function Fc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let a=s.getNode(),f=s.offset;for(;!$i(a);)[a,f]=Om(a,f);return f}function Om(u,s){const a=u.getParent();if(!a){const p=Yi();return Qn().append(p),p.select(),[Qn(),0]}if(mt(u)){const p=u.splitText(s);if(p.length===0)return[a,u.getIndexWithinParent()];const _=s===0?0:1,A=p[0].getIndexWithinParent()+_;return[a,A]}if(!et(u)||s===0)return[a,u.getIndexWithinParent()];const f=u.getChildAtIndex(s);if(f){const p=new tr(Ar(u.__key,s,"element"),Ar(u.__key,s,"element"),0,""),_=u.insertNewAfter(p);_&&_.append(f,...f.getNextSiblings())}return[a,u.getIndexWithinParent()+1]}function Am(u){const s=Yi();let a=null;for(let f=0;f<u.length;f++){const p=u[f],_=oi(p);if(_||An(p)&&p.isInline()||et(p)&&p.isInline()||mt(p)||p.isParentRequired()){if(a===null&&(a=p.createParentElementNode(),s.append(a),_))continue;a!==null&&a.append(p)}else s.append(p),a=null}return s}let Zn=null,Jn=null,Rr=!1,Bc=!1,Ka=0;const vd={characterData:!0,childList:!0,subtree:!0};function Lo(){return Rr||Zn!==null&&Zn._readOnly}function ur(){if(Rr)throw Error("Cannot use method in read-only mode.")}function wd(){if(Ka>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 Ei(){if(Zn===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 Zn}function Tn(){if(Jn===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return Jn}function Mm(){return Jn}function Od(u,s,a){const f=s.__type,p=da(u,f);let _=a.get(f);_===void 0&&(_=Array.from(p.transforms),a.set(f,_));const A=_.length;for(let M=0;M<A&&(_[M](s),!!s.isAttached());M++);}function Ad(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function Dm(u,s){const a=s._dirtyLeaves,f=u._nodeMap;for(const p of a){const _=f.get(p);mt(_)&&_.isAttached()&&_.isSimpleText()&&!_.isUnmergeable()&&_r(_)}}function Rm(u,s){const a=s._dirtyLeaves,f=s._dirtyElements,p=u._nodeMap,_=sr(),A=new Map;let M=a,ae=M.size,fe=f,me=fe.size;for(;ae>0||me>0;){if(ae>0){s._dirtyLeaves=new Set;for(const Te of M){const ve=p.get(Te);mt(ve)&&ve.isAttached()&&ve.isSimpleText()&&!ve.isUnmergeable()&&_r(ve),ve!==void 0&&Ad(ve,_)&&Od(s,ve,A),a.add(Te)}if(M=s._dirtyLeaves,ae=M.size,ae>0){Ka++;continue}}s._dirtyLeaves=new Set,s._dirtyElements=new Map;for(const Te of fe){const ve=Te[0],Ce=Te[1];if(ve!=="root"&&!Ce)continue;const Ve=p.get(ve);Ve!==void 0&&Ad(Ve,_)&&Od(s,Ve,A),f.set(ve,Ce)}M=s._dirtyLeaves,ae=M.size,fe=s._dirtyElements,me=fe.size,Ka++}s._dirtyLeaves=a,s._dirtyElements=f}function bm(u){return Hc(u,Tn()._nodes)}function Hc(u,s){const a=u.type,f=s.get(a);if(f===void 0)throw Error(`parseEditorState: type "${a}" + not found`);const p=f.klass;if(u.type!==p.getType())throw Error(`LexicalNode: Node ${p.name} does not implement .importJSON().`);const _=p.importJSON(u),A=u.children;if(et(_)&&Array.isArray(A))for(let M=0;M<A.length;M++){const ae=A[M],fe=Hc(ae,s);_.append(fe)}return _}function km(u,s,a){const f=Kc(),p=Zn,_=Rr,A=Jn,M=s._dirtyElements,ae=s._dirtyLeaves,fe=s._cloneNotNeeded,me=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Zn=f,Rr=!1,Jn=s;try{const Te=s._nodes,ve=u.root;Hc(ve,Te),a&&a(),f._readOnly=!0,Dd(f)}catch(Te){Te instanceof Error&&s._onError(Te)}finally{s._dirtyElements=M,s._dirtyLeaves=ae,s._cloneNotNeeded=fe,s._dirtyType=me,Zn=p,Rr=_,Jn=A}return f}function Md(u,s){const a=Zn,f=Rr,p=Jn;Zn=u,Rr=!0,Jn=null;try{return s()}finally{Zn=a,Rr=f,Jn=p}}function Dd(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 a=u._pendingEditorState,f=u._rootElement,p=u._headless||f===null;if(a===null)return;const _=u._editorState,A=_._selection,M=a._selection,ae=u._dirtyType!==qe,fe=Zn,me=Rr,Te=Jn,ve=u._updating,Ce=u._observer;let Ve=null;if(u._pendingEditorState=null,u._editorState=a,!p&&ae&&Ce!==null){Jn=u,Zn=a,Rr=!1,u._updating=!0;try{const At=u._dirtyType,an=u._dirtyElements,nr=u._dirtyLeaves;Ce.disconnect(),Ve=Wi(_,a,u,At,an,nr)}catch(At){if(At instanceof Error&&u._onError(At),!Bc)Pd(u,null,f,a),rr(u),u._dirtyType=ct,Bc=!0,js(u,_),Bc=!1;else throw At;return}finally{Ce.observe(f,vd),u._updating=ve,Zn=fe,Rr=me,Jn=Te}}a._readOnly||(a._readOnly=!0,Dd(a),Tt(M)&&(Object.freeze(M.anchor),Object.freeze(M.focus)),Object.freeze(M));const Ue=u._dirtyLeaves,$e=u._dirtyElements,Rt=u._normalizedNodes,Qe=u._updateTags,ft=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),Ma(u,a);const qt=p?null:or(u._window);if(u._editable&&qt!==null&&(ae||M===null||M.dirty)){Jn=u,Zn=a;try{if(Ce!==null&&Ce.disconnect(),ae||M===null||M.dirty){const At=u._blockCursorElement;At!==null&&Ps(At,u,f),xm(A,M,u,qt,Qe,f)}_i(u,f,M),Ce!==null&&Ce.observe(f,vd)}finally{Jn=Te,Zn=fe}}Ve!==null&&Lm(u,Ve,Qe,Ue,_),!Tt(M)&&M!==null&&(A===null||!A.is(M))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Bl("decorator",u,!0,Wt)),Im(u,s||_,a),Bl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:a,normalizedNodes:Rt,prevEditorState:s||_,tags:Qe}),$m(u,ft),Pm(u)}function Im(u,s,a){const f=uo(s),p=uo(a);f!==p&&Bl("textcontent",u,!0,p)}function Lm(u,s,a,f,p){const _=Array.from(u._listeners.mutation),A=_.length;for(let M=0;M<A;M++){const[ae,fe]=_[M],me=s.get(fe);me!==void 0&&ae(me,{dirtyLeaves:f,prevEditorState:p,updateTags:a})}}function Bl(u,s,a,...f){const p=s._updating;s._updating=a;try{const _=Array.from(s._listeners[u]);for(let A=0;A<_.length;A++)_[A].apply(null,f)}finally{s._updating=p}}function Rd(u,s,a){if(u._updating===!1||Jn!==u){let p=!1;return u.update(()=>{p=Rd(u,s,a)}),p}const f=Ri(u);for(let p=4;p>=0;p--)for(let _=0;_<f.length;_++){const ae=f[_]._commands.get(s);if(ae!==void 0){const fe=ae[p];if(fe!==void 0){const me=Array.from(fe),Te=me.length;for(let ve=0;ve<Te;ve++)if(me[ve](a,u)===!0)return!0}}}return!1}function Pm(u){const s=u._updates;if(s.length!==0){const a=s.shift();if(a){const[f,p]=a;kd(u,f,p)}}}function $m(u,s){if(u._deferred=[],s.length!==0){const a=u._updating;u._updating=!0;try{for(let f=0;f<s.length;f++)s[f]()}finally{u._updating=a}}}function bd(u,s){const a=u._updates;let f=s||!1;for(;a.length!==0;){const p=a.shift();if(p){const[_,A]=p;let M,ae;A!==void 0&&(M=A.onUpdate,ae=A.tag,A.skipTransforms&&(f=!0),M&&u._deferred.push(M),ae&&u._updateTags.add(ae)),_()}}return f}function kd(u,s,a){const f=u._updateTags;let p,_,A=!1,M=!1;a!==void 0&&(p=a.onUpdate,_=a.tag,_!=null&&f.add(_),A=a.skipTransforms||!1,M=a.discrete||!1),p&&u._deferred.push(p);const ae=u._editorState;let fe=u._pendingEditorState,me=!1;(fe===null||fe._readOnly)&&(fe=u._pendingEditorState=Hm(fe||ae),me=!0),fe._flushSync=M;const Te=Zn,ve=Rr,Ce=Jn,Ve=u._updating;Zn=fe,Rr=!1,u._updating=!0,Jn=u;try{me&&(u._headless?ae._selection!=null&&(fe._selection=ae._selection.clone()):fe._selection=Em(u));const $e=u._compositionKey;s(),A=bd(u,A),Tm(fe,u),u._dirtyType!==qe&&(A?Dm(fe,u):Rm(fe,u),bd(u),Sl(ae,fe,u._dirtyLeaves,u._dirtyElements));const Rt=u._compositionKey;$e!==Rt&&(fe._flushSync=!0);const Qe=fe._selection;if(Tt(Qe)){const ft=fe._nodeMap,qt=Qe.anchor.key,Wt=Qe.focus.key;if(ft.get(qt)===void 0||ft.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 Br(Qe)&&Qe._nodes.size===0&&(fe._selection=null)}catch($e){$e instanceof Error&&u._onError($e),u._pendingEditorState=ae,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),js(u);return}finally{Zn=Te,Rr=ve,Jn=Ce,u._updating=Ve,Ka=0}u._dirtyType!==qe||Bm(fe,u)?fe._flushSync?(fe._flushSync=!1,js(u)):me&&ao(()=>{js(u)}):(fe._flushSync=!1,me&&(f.clear(),u._deferred=[],u._pendingEditorState=null))}function Hr(u,s,a){u._updating?u._updates.push([s,a]):kd(u,s,a)}class Wc extends ii{constructor(s){super(s)}decorate(s,a){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof Wc}class Vs extends ii{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 a=this.getFirstChild();for(;a!==null;)s.push(a),a=a.getNextSibling();return s}getChildrenKeys(){const s=[];let a=this.getFirstChild();for(;a!==null;)s.push(a.__key),a=a.getNextSibling();return s}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const a=Tn()._dirtyElements;return a!==null&&a.has(this.__key)}isLastChild(){const s=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(s)}getAllTextNodes(){const s=[];let a=this.getFirstChild();for(;a!==null;){if(mt(a)&&s.push(a),et(a)){const f=a.getAllTextNodes();s.push(...f)}a=a.getNextSibling()}return s}getFirstDescendant(){let s=this.getFirstChild();for(;s!==null;){if(et(s)){const a=s.getFirstChild();if(a!==null){s=a;continue}}break}return s}getLastDescendant(){let s=this.getLastChild();for(;s!==null;){if(et(s)){const a=s.getLastChild();if(a!==null){s=a;continue}}break}return s}getDescendantByIndex(s){const a=this.getChildren(),f=a.length;if(s>=f){const _=a[f-1];return et(_)&&_.getLastDescendant()||_||null}const p=a[s];return et(p)&&p.getFirstDescendant()||p||null}getFirstChild(){const a=this.getLatest().__first;return a===null?null:Nn(a)}getFirstChildOrThrow(){const s=this.getFirstChild();if(s===null)throw Error(`Expected node ${this.__key} to have a first child.`);return s}getLastChild(){const a=this.getLatest().__last;return a===null?null:Nn(a)}getLastChildOrThrow(){const s=this.getLastChild();if(s===null)throw Error(`Expected node ${this.__key} to have a last child.`);return s}getChildAtIndex(s){const a=this.getChildrenSize();let f,p;if(s<a/2){for(f=this.getFirstChild(),p=0;f!==null&&p<=s;){if(p===s)return f;f=f.getNextSibling(),p++}return null}for(f=this.getLastChild(),p=a-1;f!==null&&p>=s;){if(p===s)return f;f=f.getPreviousSibling(),p--}return null}getTextContent(){let s="";const a=this.getChildren(),f=a.length;for(let p=0;p<f;p++){const _=a[p];s+=_.getTextContent(),et(_)&&p!==f-1&&!_.isInline()&&(s+=$t)}return s}getTextContentSize(){let s=0;const a=this.getChildren(),f=a.length;for(let p=0;p<f;p++){const _=a[p];s+=_.getTextContentSize(),et(_)&&p!==f-1&&!_.isInline()&&(s+=$t.length)}return s}getDirection(){return this.getLatest().__dir}hasFormat(s){if(s!==""){const a=pi[s];return(this.getFormat()&a)!==0}return!1}select(s,a){ur();const f=mn();let p=s,_=a;const A=this.getChildrenSize();if(!this.canBeEmpty()){if(s===0&&a===0){const ae=this.getFirstChild();if(mt(ae)||et(ae))return ae.select(0,0)}else if((s===void 0||s===A)&&(a===void 0||a===A)){const ae=this.getLastChild();if(mt(ae)||et(ae))return ae.select()}}p===void 0&&(p=A),_===void 0&&(_=A);const M=this.__key;if(Tt(f))f.anchor.set(M,p,"element"),f.focus.set(M,_,"element"),f.dirty=!0;else return Ed(M,p,M,_,"element","element");return f}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(f=>f.remove()),s}append(...s){return this.splice(this.getChildrenSize(),0,s)}setDirection(s){const a=this.getWritable();return a.__dir=s,a}setFormat(s){const a=this.getWritable();return a.__format=s!==""?pi[s]:0,this}setIndent(s){const a=this.getWritable();return a.__indent=s,this}splice(s,a,f){const p=f.length,_=this.getChildrenSize(),A=this.getWritable(),M=A.__key,ae=[],fe=[],me=this.getChildAtIndex(s+a);let Te=null,ve=_-a+p;if(s!==0)if(s===_)Te=this.getLastChild();else{const Ve=this.getChildAtIndex(s);Ve!==null&&(Te=Ve.getPreviousSibling())}if(a>0){let Ve=Te===null?this.getFirstChild():Te.getNextSibling();for(let Ue=0;Ue<a;Ue++){if(Ve===null)throw Error("splice: sibling not found");const $e=Ve.getNextSibling(),Rt=Ve.__key,Qe=Ve.getWritable();Gr(Qe),fe.push(Rt),Ve=$e}}let Ce=Te;for(let Ve=0;Ve<p;Ve++){const Ue=f[Ve];Ce!==null&&Ue.is(Ce)&&(Te=Ce=Ce.getPreviousSibling());const $e=Ue.getWritable();$e.__parent===M&&ve--,Gr($e);const Rt=Ue.__key;if(Ce===null)A.__first=Rt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Rt,$e.__prev=Qe.__key}if(Ue.__key===M)throw Error("append: attempting to append self");$e.__parent=M,ae.push(Rt),Ce=Ue}if(s+a===_){if(Ce!==null){const Ve=Ce.getWritable();Ve.__next=null,A.__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(A.__size=ve,fe.length){const Ve=mn();if(Tt(Ve)){const Ue=new Set(fe),$e=new Set(ae),{anchor:Rt,focus:Qe}=Ve;Id(Rt,Ue,$e)&&Wa(Rt,Rt.getNode(),this,Te,me),Id(Qe,Ue,$e)&&Wa(Qe,Qe.getNode(),this,Te,me),ve===0&&!this.canBeEmpty()&&!ri(this)&&this.remove()}}return A}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(s,a){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,a,f){return!1}}function et(u){return u instanceof Vs}function Id(u,s,a){let f=u.getNode();for(;f;){const p=f.__key;if(s.has(p)&&!a.has(p))return!0;f=f.getParent()}return!1}class Po extends Vs{static getType(){return"root"}static clone(){return new Po}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Lo()||Tn()._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,a){return!1}append(...s){for(let a=0;a<s.length;a++){const f=s[a];if(!et(f)&&!An(f))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...s)}static importJSON(s){const a=Qn();return a.setFormat(s.format),a.setIndent(s.indent),a.setDirection(s.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Fm(){return new Po}function Wr(u){return u instanceof Po}function Bm(u,s){const a=s.getEditorState()._selection,f=u._selection;if(f!==null){if(f.dirty||!f.is(a))return!0}else if(a!==null)return!0;return!1}function Hm(u){return new za(new Map(u._nodeMap))}function Kc(){return new za(new Map([["root",Fm()]]))}function Ld(u){const s=u.exportJSON(),a=u.constructor;if(s.type!==a.getType())throw Error(`LexicalNode: Node ${a.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const f=s.children;if(!Array.isArray(f))throw Error(`LexicalNode: Node ${a.name} is an element but .exportJSON() does not have a children array.`);const p=u.getChildren();for(let _=0;_<p.length;_++){const A=p[_],M=Ld(A);f.push(M)}}return s}class za{constructor(s,a){this._nodeMap=s,this._selection=a||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(s){return Md(this,s)}clone(s){const a=new za(this._nodeMap,s===void 0?this._selection:s);return a._readOnly=!0,a}toJSON(){return Md(this,()=>({root:Ld(Qn())}))}}class $o extends Vs{static getType(){return"paragraph"}static clone(s){return new $o(s.__key)}createDOM(s){const a=document.createElement("p"),f=Ii(s.theme,"paragraph");return f!==void 0&&a.classList.add(...f),a}updateDOM(s,a,f){return!1}static importDOM(){return{p:s=>({conversion:Wm,priority:0})}}exportDOM(s){const{element:a}=super.exportDOM(s);if(a&&$s(a)){this.isEmpty()&&a.append(document.createElement("br"));const f=this.getFormatType();a.style.textAlign=f;const p=this.getDirection();p&&(a.dir=p);const _=this.getIndent();_>0&&(a.style.textIndent=`${_*20}px`)}return{element:a}}static importJSON(s){const a=Yi();return a.setFormat(s.format),a.setIndent(s.indent),a.setDirection(s.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(s,a){const f=Yi(),p=this.getDirection();return f.setDirection(p),this.insertAfter(f,a),f}collapseAtStart(){const s=this.getChildren();if(s.length===0||mt(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 Wm(u){const s=Yi();if(u.style){s.setFormat(u.style.textAlign);const a=parseInt(u.style.textIndent,10)/20;a>0&&s.setIndent(a)}return{node:s}}function Yi(){return vr(new $o)}function Km(u){return u instanceof $o}const zm=0,Um=1,Gm=2,Ym=3,jm=4;function Pd(u,s,a,f){const p=u._keyToDOMMap;p.clear(),u._editorState=Kc(),u._pendingEditorState=f,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 _=u._observer;_!==null&&(_.disconnect(),u._observer=null),s!==null&&(s.textContent=""),a!==null&&(a.textContent="",p.set("root",a))}function Vm(u,s){const a=new Map,f=new Set,p=_=>{Object.keys(_).forEach(A=>{let M=a.get(A);M===void 0&&(M=[],a.set(A,M)),M.push(_[A])})};return u.forEach(_=>{const A=_.klass.importDOM!=null?_.klass.importDOM.bind(_.klass):null;if(A==null||f.has(A))return;f.add(A);const M=A();M!==null&&p(M)}),s&&p(s),a}function qm(u){const s=u||{},a=Mm(),f=s.theme||{},p=u===void 0?a:s.parentEditor||null,_=s.disableEvents||!1,A=Kc(),M=s.namespace||(p!==null?p._config.namespace:hl()),ae=s.editorState,fe=[Po,Vr,Ui,Er,$o,...s.nodes||[]],{onError:me,html:Te}=s,ve=s.editable!==void 0?s.editable:!0;let Ce;if(u===void 0&&a!==null)Ce=a._nodes;else{Ce=new Map;for(let Ue=0;Ue<fe.length;Ue++){let $e=fe[Ue],Rt=null,Qe=null;if(typeof $e!="function"){const At=$e;$e=At.replace,Rt=At.with,Qe=At.withKlass||null}{const At=$e.name;if(At!=="RootNode"){const an=$e.prototype;["getType","clone"].forEach(nr=>{$e.hasOwnProperty(nr)||console.warn(`${At} must implement static "${nr}" method`)}),!$e.hasOwnProperty("importDOM")&&$e.hasOwnProperty("exportDOM")&&console.warn(`${At} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),an instanceof Wc&&(an.hasOwnProperty("decorate")||console.warn(`${an.constructor.name} must implement "decorate" method`)),$e.hasOwnProperty("importJSON")||console.warn(`${At} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),an.hasOwnProperty("exportJSON")||console.warn(`${At} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ft=$e.getType(),qt=$e.transform(),Wt=new Set;qt!==null&&Wt.add(qt),Ce.set(ft,{exportDOM:Te&&Te.export?Te.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new Zm(A,p,Ce,{disableEvents:_,namespace:M,theme:f},me||console.error,Vm(Ce,Te?Te.import:void 0),ve);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ct),Ve}class Zm{constructor(s,a,f,p,_,A,M){this._parentEditor=a,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=p,this._nodes=f,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=hl(),this._onError=_,this._htmlConversions=A,this._editable=M,this._headless=a!==null&&a._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(s){const a=this._listeners.update;return a.add(s),()=>{a.delete(s)}}registerEditableListener(s){const a=this._listeners.editable;return a.add(s),()=>{a.delete(s)}}registerDecoratorListener(s){const a=this._listeners.decorator;return a.add(s),()=>{a.delete(s)}}registerTextContentListener(s){const a=this._listeners.textcontent;return a.add(s),()=>{a.delete(s)}}registerRootListener(s){const a=this._listeners.root;return s(this._rootElement,null),a.add(s),()=>{s(null,this._rootElement),a.delete(s)}}registerCommand(s,a,f){if(f===void 0)throw Error('Listener for type "command" requires a "priority".');const p=this._commands;p.has(s)||p.set(s,[new Set,new Set,new Set,new Set,new Set]);const _=p.get(s);if(_===void 0)throw Error(`registerCommand: Command ${String(s)} not found in command map`);const A=_[f];return A.add(a),()=>{A.delete(a),_.every(M=>M.size===0)&&p.delete(s)}}registerMutationListener(s,a){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 p=this._listeners.mutation;return p.set(a,s),()=>{p.delete(a)}}registerNodeTransformToKlass(s,a){const f=s.getType(),p=this._nodes.get(f);if(p===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);return p.transforms.add(a),p}registerNodeTransform(s,a){const f=this.registerNodeTransformToKlass(s,a),p=[f],_=f.replaceWithKlass;if(_!=null){const A=this.registerNodeTransformToKlass(_,a);p.push(A)}return Mi(this,s.getType()),()=>{p.forEach(A=>A.transforms.delete(a))}}hasNode(s){return this._nodes.has(s.getType())}hasNodes(s){return s.every(this.hasNode.bind(this))}dispatchCommand(s,a){return ut(this,s,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(s){const a=this._rootElement;if(s!==a){const f=Ii(this._config.theme,"root"),p=this._pendingEditorState||this._editorState;if(this._rootElement=s,Pd(this,a,s,p),a!==null&&(this._config.disableEvents||Ot(a),f!=null&&a.classList.remove(...f)),s!==null){const _=wa(s),A=s.style;A.userSelect="text",A.whiteSpace="pre-wrap",A.wordBreak="break-word",s.setAttribute("data-lexical-editor","true"),this._window=_,this._dirtyType=ct,rr(this),this._updateTags.add("history-merge"),js(this),this._config.disableEvents||gt(s,this),f!=null&&s.classList.add(...f)}else this._editorState=p,this._pendingEditorState=null,this._window=null;Bl("root",this,!1,s,a)}}getElementByKey(s){return this._keyToDOMMap.get(s)||null}getEditorState(){return this._editorState}setEditorState(s,a){if(s.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");dn(this);const f=this._pendingEditorState,p=this._updateTags,_=a!==void 0?a.tag:null;f!==null&&!f.isEmpty()&&(_!=null&&p.add(_),js(this)),this._pendingEditorState=s,this._dirtyType=ct,this._dirtyElements.set("root",!1),this._compositionKey=null,_!=null&&p.add(_),js(this)}parseEditorState(s,a){const f=typeof s=="string"?JSON.parse(s):s;return km(f,this,a)}update(s,a){Hr(this,s,a)}focus(s,a={}){const f=this._rootElement;f!==null&&(f.setAttribute("autocapitalize","off"),Hr(this,()=>{const p=mn(),_=Qn();p!==null?p.dirty=!0:_.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?_.selectStart():_.selectEnd())},{onUpdate:()=>{f.removeAttribute("autocapitalize"),s&&s()},tag:"focus"}),this._pendingEditorState===null&&f.removeAttribute("autocapitalize"))}blur(){const s=this._rootElement;s!==null&&s.blur();const a=or(this._window);a!==null&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(s){this._editable!==s&&(this._editable=s,Bl("editable",this,!0,s))}toJSON(){return{editorState:this._editorState.toJSON()}}}class zc extends Vs{constructor(s,a){super(a),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 Fo(u){return u instanceof zc}class $d extends Vs{}function Fd(u){return u instanceof $d}class Bd extends Vs{}function Uc(u){return u instanceof Bd}return He.$INTERNAL_isPointSelection=ar,He.$addUpdateTag=Ct,He.$applyNodeReplacement=vr,He.$copyNode=Tl,He.$createLineBreakNode=fs,He.$createNodeSelection=Pc,He.$createParagraphNode=Yi,He.$createPoint=Ar,He.$createRangeSelection=Cm,He.$createTabNode=Do,He.$createTextNode=On,He.$getAdjacentNode=Cl,He.$getNearestNodeFromDOMNode=ni,He.$getNearestRootOrShadowRoot=_o,He.$getNodeByKey=Nn,He.$getPreviousSelection=Io,He.$getRoot=Qn,He.$getSelection=mn,He.$getTextContent=vm,He.$hasAncestor=Pi,He.$hasUpdateTag=Kn,He.$insertNodes=Sm,He.$isBlockElementNode=Nm,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Lr,He.$isLeafNode=vs,He.$isLineBreakNode=oi,He.$isNodeSelection=Br,He.$isParagraphNode=Km,He.$isRangeSelection=Tt,He.$isRootNode=Wr,He.$isRootOrShadowRoot=ri,He.$isTabNode=Ro,He.$isTextNode=mt,He.$nodesOfType=Li,He.$normalizeSelection__EXPERIMENTAL=xs,He.$parseSerializedNode=bm,He.$selectAll=Nl,He.$setCompositionKey=xn,He.$setSelection=yr,He.$splitNode=Oa,He.BLUR_COMMAND=I,He.CAN_REDO_COMMAND=J,He.CAN_UNDO_COMMAND=de,He.CLEAR_EDITOR_COMMAND=O,He.CLEAR_HISTORY_COMMAND=H,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=jm,He.COMMAND_PRIORITY_EDITOR=zm,He.COMMAND_PRIORITY_HIGH=Ym,He.COMMAND_PRIORITY_LOW=Um,He.COMMAND_PRIORITY_NORMAL=Gm,He.CONTROLLED_TEXT_INSERTION_COMMAND=m,He.COPY_COMMAND=K,He.CUT_COMMAND=P,He.DELETE_CHARACTER_COMMAND=c,He.DELETE_LINE_COMMAND=b,He.DELETE_WORD_COMMAND=R,He.DEPRECATED_$computeGridMap=wm,He.DEPRECATED_$getGridCellNodeRect=Dr,He.DEPRECATED_$getNodeTriplet=Sd,He.DEPRECATED_$isGridCellNode=Fo,He.DEPRECATED_$isGridNode=Fd,He.DEPRECATED_$isGridRowNode=Uc,He.DEPRECATED_GridCellNode=zc,He.DEPRECATED_GridNode=$d,He.DEPRECATED_GridRowNode=Bd,He.DRAGEND_COMMAND=ie,He.DRAGOVER_COMMAND=Y,He.DRAGSTART_COMMAND=S,He.DROP_COMMAND=ue,He.DecoratorNode=Wc,He.ElementNode=Vs,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=$,He.FORMAT_TEXT_COMMAND=k,He.INDENT_CONTENT_COMMAND=we,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=g,He.INSERT_TAB_COMMAND=xe,He.INTERNAL_PointSelection=Mr,He.KEY_ARROW_DOWN_COMMAND=q,He.KEY_ARROW_LEFT_COMMAND=F,He.KEY_ARROW_RIGHT_COMMAND=U,He.KEY_ARROW_UP_COMMAND=G,He.KEY_BACKSPACE_COMMAND=ge,He.KEY_DELETE_COMMAND=B,He.KEY_DOWN_COMMAND=x,He.KEY_ENTER_COMMAND=le,He.KEY_ESCAPE_COMMAND=j,He.KEY_MODIFIER_COMMAND=w,He.KEY_SPACE_COMMAND=se,He.KEY_TAB_COMMAND=V,He.LineBreakNode=Ui,He.MOVE_TO_END=Q,He.MOVE_TO_START=W,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=N,He.ParagraphNode=$o,He.REDO_COMMAND=E,He.REMOVE_TEXT_COMMAND=T,He.RootNode=Po,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=Z,He.TabNode=Er,He.TextNode=Vr,He.UNDO_COMMAND=z,He.createCommand=e,He.createEditor=qm,He.getNearestEditorFromDOMNode=ol,He.isCurrentlyReadOnlyMode=Lo,He.isHTMLAnchorElement=Aa,He.isHTMLElement=$s,He.isSelectionCapturedInDecoratorInput=Ss,He.isSelectionWithinEditor=ns,He}var We={},of;function Ky(){if(of)return We;of=1;let e={},t={},n={},r={},c={},d={},g={},m={},N={},T={},R={},b={},k={},z={},E={},x={},U={},Q={},F={},W={},G={},q={},le={},se={},ge={},j={},B={},V={},xe={},we={},Ee={},ue={},$={},S={},Y={},ie={};function K(o){let i=new URLSearchParams;i.append("code",o);for(let l=1;l<arguments.length;l++)i.append("v",arguments[l]);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 P=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Z=P&&"documentMode"in document?document.documentMode:null,O=P&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),H=P&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),J=P&&"InputEvent"in window&&!Z?"getTargetRanges"in new window.InputEvent("input"):!1,de=P&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=P&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,I=P&&/Android/.test(navigator.userAgent),w=P&&/^(?=.*Chrome).*/i.test(navigator.userAgent),D=P&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!w,re=de||_e||D?" ":"",ye=H?" ":re,Ae=/^[^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]/,te={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},Le={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(o){qe=o.timeStamp}function ct(o,i,l){return i.__lexicalLineBreak===o||o[`__lexicalKey_${l._key}`]!==void 0}function Mt(o){return o.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function Ut(o,i,l){Fe=!0;let h=100<performance.now()-qe;try{Cr(o,()=>{let y=Vt()||Mt(o);var C=new Map,v=o.getRootElement(),X=o._editorState,he=o._blockCursorElement;let Me=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,gt=Ke.target,Ot=Kt(gt,X);if(!(Ot===null&>!==v||Cn(Ot))){if(Pe==="characterData"){if(Ke=h&&Ct(Ot))e:{Ke=y,Pe=gt;var Ft=Ot;if(Dt(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=Ur(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===gt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),gt=gt.nodeValue,gt!==null&&wt(Ot,gt,Ke,Pe,!1))}else if(Pe==="childList"){for(Me=!0,Pe=Ke.addedNodes,Ft=0;Ft<Pe.length;Ft++){zt=Pe[Ft];var Un=$t(zt),wr=zt.parentNode;wr==null||zt===he||Un!==null||zt.nodeName==="BR"&&ct(zt,wr,o)||(H&&(Un=zt.innerText||zt.nodeValue)&&(Ye+=Un),wr.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)wr=Ke[zt],(wr.nodeName==="BR"&&ct(wr,gt,o)||he===wr)&&(gt.appendChild(wr),Ft++);Pe!==Ft&&(gt===v&&(Ot=X._nodeMap.get("root")),C.set(gt,Ot))}}}}if(0<C.size)for(let[ii,si]of C)if(Je(si))for(C=si.getChildrenKeys(),v=ii.firstChild,X=0;X<C.length;X++)he=o.getElementByKey(C[X]),he!==null&&(v==null?(ii.appendChild(he),v=he):v!==he&&ii.replaceChild(he,v),v=v.nextSibling);else Ct(si)&&si.markDirty();if(C=l.takeRecords(),0<C.length){for(v=0;v<C.length;v++)for(he=C[v],X=he.addedNodes,he=he.target,Xe=0;Xe<X.length;Xe++)Ot=X[Xe],gt=Ot.parentNode,gt==null||Ot.nodeName!=="BR"||ct(Ot,he,o)||gt.removeChild(Ot);l.takeRecords()}y!==null&&(Me&&(y.dirty=!0,nn(y)),H&&sn(o)&&y.insertRawText(Ye))})}finally{Fe=!1}}function en(o){let i=o._observer;if(i!==null){let l=i.takeRecords();Ut(o,l,i)}}function Oe(o){qe===0&&dn(o).addEventListener("textInput",Be,!0),o._observer=new MutationObserver((i,l)=>{Ut(o,i,l)})}function ne(o,i){let l=o.__mode,h=o.__format;o=o.__style;let y=i.__mode,C=i.__format;return i=i.__style,(l===null||l===y)&&(h===null||h===C)&&(o===null||o===i)}function oe(o,i){let l=o.mergeWithSibling(i),h=fn()._normalizedNodes;return h.add(o.__key),h.add(i.__key),l}function Se(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{ne(i,o)&&(o=oe(i,o));break}for(var l;(l=o.getNextSibling())!==null&&Ct(l)&&l.isSimpleText()&&!l.isUnmergeable();)if(l.__text==="")l.remove();else{ne(o,l)&&oe(o,l);break}}}function Ie(o){return De(o.anchor),De(o.focus),o}function De(o){for(;o.type==="element";){var i=o.getNode(),l=o.offset;if(l===i.getChildrenSize()?(i=i.getChildAtIndex(l-1),l=!0):(i=i.getChildAtIndex(l),l=!1),Ct(i)){o.set(i.__key,l?i.getTextContentSize():0,"text");break}else if(!Je(i))break;o.set(i.__key,l?i.getChildrenSize():0,"element")}}let je=1,rt=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function it(o){let i=document.activeElement;if(i===null)return!1;let l=i.nodeName;return Cn(Kt(o))&&(l==="INPUT"||l==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function st(o,i,l){let h=o.getRootElement();try{return h!==null&&h.contains(i)&&h.contains(l)&&i!==null&&!it(i)&&vt(i)===o}catch{return!1}}function vt(o){for(;o!=null;){let i=o.__lexicalEditor;if(i!=null)return i;o=mr(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,l){let h=te[i];return l!==null&&(o&h)===(l&h)||(o^=h,i==="subscript"?o&=-65:i==="superscript"&&(o&=-33)),o}function _t(o,i){if(i!=null)o.__key=i;else{Vn(),99<Bi&&K(14),i=fn();var l=Pr(),h=""+je++;l._nodeMap.set(h,o),Je(o)?i._dirtyElements.set(h,!0):i._dirtyLeaves.add(h),i._cloneNotNeeded.add(h),i._dirtyType=1,o.__key=h}}function Nt(o){var i=o.getParent();if(i!==null){let y=o.getWritable();i=i.getWritable();var l=o.getPreviousSibling();if(o=o.getNextSibling(),l===null)if(o!==null){var h=o.getWritable();i.__first=o.__key,h.__prev=null}else i.__first=null;else{if(h=l.getWritable(),o!==null){let C=o.getWritable();C.__prev=h.__key,h.__next=C.__key}else h.__next=null;y.__prev=null}o===null?l!==null?(o=l.getWritable(),i.__last=l.__key,o.__next=null):i.__last=null:(o=o.getWritable(),l!==null?(l=l.getWritable(),l.__next=o.__key,o.__prev=l.__key):o.__prev=null,y.__next=null),i.__size--,y.__parent=null}}function Et(o){99<Bi&&K(14);var i=o.getLatest(),l=i.__parent,h=Pr();let y=fn(),C=h._nodeMap;if(h=y._dirtyElements,l!==null)e:for(;l!==null;){if(h.has(l))break e;let v=C.get(l);if(v===void 0)break;h.set(l,!1),l=v.__parent}i=i.__key,y._dirtyType=1,Je(o)?h.set(i,!0):y._dirtyLeaves.add(i)}function ht(o){Vn();var i=fn();let l=i._compositionKey;o!==l&&(i._compositionKey=o,l!==null&&(i=pt(l),i!==null&&i.getWritable()),o!==null&&(o=pt(o),o!==null&&o.getWritable()))}function xt(){return us()?null:fn()._compositionKey}function pt(o,i){return o=(i||Pr())._nodeMap.get(o),o===void 0?null:o}function $t(o,i){let l=fn();return o=o[`__lexicalKey_${l._key}`],o!==void 0?pt(o,i):null}function Kt(o,i){for(;o!=null;){let l=$t(o,i);if(l!==null)return l;o=mr(o)}return null}function tn(o){let i=Object.assign({},o._decorators);return o._pendingDecorators=i}function It(o){return o.read(()=>bt().getTextContent())}function jt(o,i){Cr(o,()=>{var l=Pr();if(!l.isEmpty())if(i==="root")bt().markDirty();else{l=l._nodeMap;for(let[,h]of l)h.markDirty()}},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return Pr()._nodeMap.get("root")}function nn(o){Vn();let i=Pr();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function Sr(o){var i=fn(),l;e:{for(l=o;l!=null;){let h=l[`__lexicalKey_${i._key}`];if(h!==void 0){l=h;break e}l=mr(l)}l=null}return l===null?(i=i.getRootElement(),o===i?pt("root"):null):pt(l)}function pi(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function pe(o){let i=[];for(;o!==null;)i.push(o),o=o._parentEditor;return i}function Ze(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ot(o,i,l){if(i=Ur(i._window),i!==null){var h=i.anchorNode,{anchorOffset:y,focusOffset:C}=i;if(h!==null&&(i=h.nodeType===3?h.nodeValue:null,h=Kt(h),i!==null&&Ct(h))){if(i===re&&l){let v=l.length;i=l,C=y=v}i!==null&&wt(h,i,y,C,o)}}}function wt(o,i,l,h,y){let C=o;if(C.isAttached()&&(y||!C.isDirty())){let Me=C.isComposing(),Ye=i;if((Me||y)&&i[i.length-1]===re&&(Ye=i.slice(0,-1)),i=C.getTextContent(),y||Ye!==i)if(Ye==="")if(ht(null),de||_e||D)C.remove();else{let Xe=fn();setTimeout(()=>{Xe.update(()=>{C.isAttached()&&C.remove()})},20)}else{y=C.getParent(),i=Nr();var v=C.getTextContentSize(),X=xt(),he=C.getKey();C.isToken()||X!==null&&he===X&&!Me||Dt(i)&&(y!==null&&!y.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===o.__key&&i.anchor.offset===0&&!C.canInsertTextBefore()&&!Me||i.focus.key===o.__key&&i.focus.offset===v&&!C.canInsertTextAfter()&&!Me)?C.markDirty():(o=Vt(),Dt(o)&&l!==null&&h!==null&&(o.setTextNodeRange(C,l,C,h),C.isSegmented()&&(l=C.getTextContent(),l=Kn(l),C.replace(l),C=l)),C.setTextContent(Ye))}}}function Gt(o,i){if(i.isSegmented())return!0;if(!o.isCollapsed())return!1;o=o.anchor.offset;let l=i.getParentOrThrow(),h=i.isToken();return o===0?((o=!i.canInsertTextBefore()||!l.canInsertTextBefore()||h)||(i=i.getPreviousSibling(),o=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),o):o===i.getTextContentSize()?!i.canInsertTextAfter()||!l.canInsertTextAfter()||h:!1}function Bt(o,i){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let l=o.__lexicalClassNameCache,h=l[i];return h!==void 0?h:(o=o[i],typeof o=="string"?(o=o.split(" "),l[i]=o):o)}function Pt(o,i,l,h,y){l.size!==0&&(l=h.__type,h=h.__key,i=i.get(l),i===void 0&&K(33,l),l=i.klass,i=o.get(l),i===void 0&&(i=new Map,o.set(l,i)),o=i.get(h),l=o==="destroyed"&&y==="created",(o===void 0||l)&&i.set(h,l?"updated":y))}function Lt(o,i,l){let h=o.getParent(),y=l;return h!==null&&(i&&l===0?(y=o.getIndexWithinParent(),o=h):i||l!==o.getChildrenSize()||(y=o.getIndexWithinParent()+1,o=h)),o.getChildAtIndex(i?y-1:y)}function Ht(o,i){var l=o.offset;return o.type==="element"?(o=o.getNode(),Lt(o,i,l)):(o=o.getNode(),i&&l===0||!i&&l===o.getTextContentSize()?(l=i?o.getPreviousSibling():o.getNextSibling(),l===null?Lt(o.getParentOrThrow(),i,o.getIndexWithinParent()+(i?0:1)):l):null)}function sn(o){return o=(o=dn(o).event)&&o.inputType,o==="insertFromPaste"||o==="insertFromPasteAsQuotation"}function ln(o){return!er(o)&&!o.isLastChild()&&!o.isInline()}function Rn(o,i){return o=o._keyToDOMMap.get(i),o===void 0&&K(75,i),o}function mr(o){return o=o.assignedSlot||o.parentElement,o!==null&&o.nodeType===11?o.host:o}function jn(o,i){for(o=o.getParent();o!==null;){if(o.is(i))return!0;o=o.getParent()}return!1}function dn(o){return o=o._window,o===null&&K(78),o}function rr(o){for(o=o.getParentOrThrow();o!==null&&!ir(o);)o=o.getParentOrThrow();return o}function ir(o){return er(o)||Je(o)&&o.isShadowRoot()}function Oi(o){return o=o.constructor.clone(o),_t(o,null),o}function _r(o){var i=fn();let l=o.constructor.getType();return i=i._nodes.get(l),i===void 0&&K(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||K(98),i):o}function xs(o,i){o=o.getParent(),!er(o)||Je(i)||Cn(i)||K(99)}function lo(o){return(Cn(o)||Je(o)&&!o.canBeEmpty())&&!o.isInline()}function sl(o,i,l){l.style.removeProperty("caret-color"),i._blockCursorElement=null,i=o.parentElement,i!==null&&i.removeChild(o)}function Ur(o){return P?(o||window).getSelection():null}function da(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function ao(o){return o.nodeType===1}function ts(o){if(Cn(o)&&!o.isInline())return!0;if(!Je(o)||ir(o))return!1;var i=o.getFirstChild();return i=i===null||bi(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function Ss(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function ns(o,i,l,h,y,C){for(o=o.getFirstChild();o!==null;){let v=o.__key;o.__parent===i&&(Je(o)&&ns(o,v,l,h,y,C),l.has(v)||C.delete(v),y.push(v)),o=o.getNextSibling()}}function ol(o,i,l,h){o=o._nodeMap,i=i._nodeMap;let y=[];for(let[C]of h){let v=i.get(C);v===void 0||v.isAttached()||(Je(v)&&ns(v,C,o,i,y,h),o.has(C)||h.delete(C),y.push(C))}for(let C of y)i.delete(C);for(let C of l)h=i.get(C),h===void 0||h.isAttached()||(o.has(C)||l.delete(C),i.delete(C))}let bn="",Wn="",ti="",kr,$n,vs,ll=!1,al=!1,Gr,Ai=null,cl,xn,sr,Nn,co,ni;function ws(o,i){let l=sr.get(o);if(i!==null){let h=As(o);h.parentNode===i&&i.removeChild(h)}Nn.has(o)||$n._keyToDOMMap.delete(o),Je(l)&&(o=Os(l,sr),uo(o,0,o.length-1,null)),l!==void 0&&Pt(ni,vs,Gr,l,"destroyed")}function uo(o,i,l,h){for(;i<=l;++i){let y=o[i];y!==void 0&&ws(y,h)}}function Mi(o,i){o.setProperty("text-align",i)}function Qn(o,i){var l=kr.theme.indent;if(typeof l=="string"){let h=o.classList.contains(l);0<i&&!h?o.classList.add(l):1>i&&h&&o.classList.remove(l)}l=getComputedStyle(o).getPropertyValue("--lexical-indent-base-value")||"40px",o.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${l})`)}function ul(o,i){o=o.style,i===0?Mi(o,""):i===1?Mi(o,"left"):i===2?Mi(o,"center"):i===3?Mi(o,"right"):i===4?Mi(o,"justify"):i===5?Mi(o,"start"):i===6&&Mi(o,"end")}function yr(o,i,l){let h=Nn.get(o);h===void 0&&K(60);let y=h.createDOM(kr,$n);var C=$n._keyToDOMMap;if(y["__lexicalKey_"+$n._key]=o,C.set(o,y),Ct(h)?y.setAttribute("data-lexical-text","true"):Cn(h)&&y.setAttribute("data-lexical-decorator","true"),Je(h)){if(o=h.__indent,C=h.__size,o!==0&&Qn(y,o),C!==0){--C,o=Os(h,Nn);var v=Wn;Wn="",dl(o,h,0,C,y,null),fa(h,y),Wn=v}o=h.__format,o!==0&&ul(y,o),h.isInline()||fl(null,h,y),ln(h)&&(bn+=`
|
|
46
|
+
`?f.push(hs()):A===" "?f.push(Do()):f.push(On(A))}this.insertNodes(f)}insertText(s){const a=this.anchor,f=this.focus,p=this.isCollapsed()||a.isBefore(f),_=this.format,A=this.style;p&&a.type==="element"?qn(a,f,_,A):!p&&f.type==="element"&&qn(f,a,_,A);const M=this.getNodes(),ae=M.length,fe=p?a:f,me=p?f:a,Te=fe.offset,ve=me.offset;let Ce=M[0];if(!mt(Ce))throw Error("insertText: first node is not a text node");const Ue=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Rt=ae-1;let Qe=M[Rt];if(this.isCollapsed()&&Te===Ue&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ft=Ce.getNextSibling();if((!mt(ft)||!ft.canInsertTextBefore()||Wn(ft))&&(ft=On(),ft.setFormat(_),$e.canInsertTextAfter()?Ce.insertAfter(ft):$e.insertAfter(ft)),ft.select(0,0),Ce=ft,s!==""){this.insertText(s);return}}else if(this.isCollapsed()&&Te===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ft=Ce.getPreviousSibling();if((!mt(ft)||Wn(ft))&&(ft=On(),ft.setFormat(_),$e.canInsertTextBefore()?Ce.insertBefore(ft):$e.insertBefore(ft)),ft.select(),Ce=ft,s!==""){this.insertText(s);return}}else if(Ce.isSegmented()&&Te!==Ue){const ft=On(Ce.getTextContent());ft.setFormat(_),Ce.replace(ft),Ce=ft}else if(!this.isCollapsed()&&s!==""){const ft=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ft)&&(!ft.canInsertTextBefore()||!ft.canInsertTextAfter())){this.insertText(""),Nd(this.anchor,this.focus,null),this.insertText(s);return}}if(ae===1){if(Ce.isToken()){const At=On(s);At.select(),Ce.replace(At);return}const ft=Ce.getFormat(),qt=Ce.getStyle();if(Te===ve&&(ft!==_||qt!==A))if(Ce.getTextContent()==="")Ce.setFormat(_),Ce.setStyle(A);else{const At=On(s);if(At.setFormat(_),At.setStyle(A),At.select(),Te===0)Ce.insertBefore(At,!1);else{const[an]=Ce.splitText(Te);an.insertAfter(At,!1)}At.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);return}else if(Ro(Ce)){const At=On(s);At.setFormat(_),At.setStyle(A),At.select(),Ce.replace(At);return}const Wt=ve-Te;Ce=Ce.spliceText(Te,Wt,s,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=s.length:(this.format=ft,this.style=qt))}else{const ft=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),qt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),At=Qe;if(!qt.is(Wt)&&Wt.isInline())do At=Wt,Wt=Wt.getParentOrThrow();while(Wt.isInline());if(me.type==="text"&&(ve!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<ve)if(mt(Qe)&&!Qe.isToken()&&ve!==Qe.getTextContentSize()){if(Qe.isSegmented()){const rn=On(Qe.getTextContent());Qe.replace(rn),Qe=rn}!Kr(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,ve,"")),ft.add(Qe.__key)}else{const rn=Qe.getParentOrThrow();!rn.canBeEmpty()&&rn.getChildrenSize()===1?rn.remove():Qe.remove()}else ft.add(Qe.__key);const an=Wt.getChildren(),nr=new Set(M),gs=qt.is(Wt),dr=qt.isInline()&&Ce.getNextSibling()===null?qt:Ce;for(let rn=an.length-1;rn>=0;rn--){const In=an[rn];if(In.is(Ce)||et(In)&&In.isParentOf(Ce))break;In.isAttached()&&(!nr.has(In)||In.is(At)?gs||dr.insertAfter(In,!1):In.remove())}if(!gs){let rn=Wt,In=null;for(;rn!==null;){const ci=rn.getChildren(),Vi=ci.length;(Vi===0||ci[Vi-1].is(In))&&(ft.delete(rn.__key),In=rn),rn=rn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(Te,Ue-Te,s,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);else if(Te===Ue)Ce.select();else{const rn=On(s);rn.select(),Ce.replace(rn)}for(let rn=1;rn<ae;rn++){const In=M[rn],ci=In.__key;ft.has(ci)||In.remove()}}}removeText(){this.insertText("")}formatText(s){if(this.isCollapsed()){this.toggleFormat(s),xn(null);return}const a=this.getNodes(),f=[];for(const Qe of a)mt(Qe)&&f.push(Qe);const p=f.length;if(p===0){this.toggleFormat(s),xn(null);return}const _=this.anchor,A=this.focus,M=this.isBackward(),ae=M?A:_,fe=M?_:A;let me=0,Te=f[0],ve=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&ve===Te.getTextContentSize()&&(me=1,Te=f[1],ve=0),Te==null)return;const Ce=Te.getFormatFlags(s,null),Ve=p-1;let Ue=f[Ve];const $e=fe.type==="text"?fe.offset:Ue.getTextContentSize();if(Te.is(Ue)){if(ve===$e)return;if(ve===0&&$e===Te.getTextContentSize())Te.setFormat(Ce);else{const Qe=Te.splitText(ve,$e),ft=ve===0?Qe[0]:Qe[1];ft.setFormat(Ce),ae.type==="text"&&ae.set(ft.__key,0,"text"),fe.type==="text"&&fe.set(ft.__key,$e-ve,"text")}this.format=Ce;return}ve!==0&&([,Te]=Te.splitText(ve),ve=0),Te.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 ft=f[Qe];if(!ft.isToken()){const qt=ft.getFormatFlags(s,Rt);ft.setFormat(qt)}}ae.type==="text"&&ae.set(Te.__key,ve,"text"),fe.type==="text"&&fe.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=mn();if(!Tt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(s)}const a=Co(this.anchor.getNode(),Fi),f=s[s.length-1];if("__language"in a&&et(a)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Fc(this);a.splice($e,0,s),f.selectEnd()}return}const p=$e=>(et($e)||An($e))&&!$e.isInline();if(!s.some(p)){if(!et(a))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Fc(this);a.splice($e,0,s),f.selectEnd();return}const _=Mm(s),A=_.getLastDescendant(),M=_.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,fe=$e=>et($e)&&Fi($e)&&!$e.isEmpty()&&et(a)&&(!a.isEmpty()||ae(a)),Te=!et(a)||!a.isEmpty()?this.insertParagraph():null,ve=M[M.length-1];let Ce=M[0];if(fe(Ce)){if(!et(a))throw Error("Expected 'firstBlock' to be an ElementNode");a.append(...Ce.getChildren()),Ce=M[1]}Ce&&Il(a,Ce);const Ve=Co(A,Fi);Te&&et(Ve)&&(ae(Te)||Fi(ve))&&(Ve.append(...Te.getChildren()),Te.remove()),et(a)&&a.isEmpty()&&a.remove(),A.selectEnd();const Ue=et(a)?a.getLastChild():null;li(Ue)&&Ve!==a&&Ue.remove()}insertParagraph(){if(this.anchor.key==="root"){const A=ji();return Qn().splice(this.anchor.offset,0,[A]),A.select(),A}const s=Fc(this),a=Co(this.anchor.getNode(),Fi);if(!et(a))throw Error("Expected ancestor to be an ElementNode");const f=a.getChildAtIndex(s),p=f?[f,...f.getNextSiblings()]:[],_=a.insertNewAfter(this,!1);return _?(_.append(...p),_.selectStart(),_):null}insertLineBreak(s){const a=hs();if(this.insertNodes([a]),s){const f=a.getParentOrThrow(),p=a.getIndexWithinParent();f.select(p,p)}}extract(){const s=this.getNodes(),a=s.length,f=a-1,p=this.anchor,_=this.focus;let A=s[0],M=s[f];const[ae,fe]=ai(this);if(a===0)return[];if(a===1){if(mt(A)&&!this.isCollapsed()){const Te=ae>fe?fe:ae,ve=ae>fe?ae:fe,Ce=A.splitText(Te,ve),Ve=Te===0?Ce[0]:Ce[1];return Ve!=null?[Ve]:[]}return[A]}const me=p.isBefore(_);if(mt(A)){const Te=me?ae:fe;Te===A.getTextContentSize()?s.shift():Te!==0&&([,A]=A.splitText(Te),s[0]=A)}if(mt(M)){const ve=M.getTextContent().length,Ce=me?fe:ae;Ce===0?s.pop():Ce!==ve&&([M]=M.splitText(Ce),s[f]=M)}return s}modify(s,a,f){const p=this.focus,_=this.anchor,A=s==="move",M=Cl(p,a);if(An(M)&&!M.isIsolated()){if(A&&M.isKeyboardSelectable()){const Ce=Pc();Ce.add(M.__key),yr(Ce);return}const ve=a?M.getPreviousSibling():M.getNextSibling();if(mt(ve)){const Ce=ve.__key,Ve=a?ve.getTextContent().length:0;p.set(Ce,Ve,"text"),A&&_.set(Ce,Ve,"text");return}else{const Ce=M.getParentOrThrow();let Ve,Ue;et(ve)?(Ue=ve.__key,Ve=a?ve.getChildrenSize():0):(Ve=M.getIndexWithinParent(),Ue=Ce.__key,a||Ve++),p.set(Ue,Ve,"element"),A&&_.set(Ue,Ve,"element");return}}const ae=Tn(),fe=or(ae._window);if(!fe)return;const me=ae._blockCursorElement,Te=ae._rootElement;if(Te!==null&&me!==null&&et(M)&&!M.isInline()&&!M.canBeEmpty()&&$s(me,ae,Te),Ba(fe,s,a?"backward":"forward",f),fe.rangeCount>0){const ve=fe.getRangeAt(0),Ce=this.anchor.getNode(),Ve=Kr(Ce)?Ce:_o(Ce);if(this.applyDOMRange(ve),this.dirty=!0,!A){const Ue=this.getNodes(),$e=[];let Rt=!1;for(let Qe=0;Qe<Ue.length;Qe++){const ft=Ue[Qe];$i(ft,Ve)?$e.push(ft):Rt=!0}if(Rt&&$e.length>0)if(a){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()}(fe.anchorNode!==ve.startContainer||fe.anchorOffset!==ve.startOffset)&&ko(this)}}}deleteCharacter(s){const a=this.isCollapsed();if(this.isCollapsed()){const f=this.anchor,p=this.focus;let _=f.getNode();if(!s&&(f.type==="element"&&et(_)&&f.offset===_.getChildrenSize()||f.type==="text"&&f.offset===_.getTextContentSize())){const M=_.getParent(),ae=_.getNextSibling()||(M===null?null:M.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const A=Cl(p,s);if(An(A)&&!A.isIsolated()){if(A.isKeyboardSelectable()&&et(_)&&_.getChildrenSize()===0){_.remove();const M=Pc();M.add(A.__key),yr(M)}else A.remove(),Tn().dispatchCommand(t,void 0);return}else if(!s&&et(A)&&et(_)&&_.isEmpty()){_.remove(),A.selectStart();return}if(this.modify("extend",s,"character"),this.isCollapsed()){if(s&&f.offset===0&&(f.type==="element"?f.getNode():f.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const M=p.type==="text"?p.getNode():null;if(_=f.type==="text"?f.getNode():null,M!==null&&M.isSegmented()){const ae=p.offset,fe=M.getTextContentSize();if(M.is(_)||s&&ae!==fe||!s&&ae!==0){md(M,s,ae);return}}else if(_!==null&&_.isSegmented()){const ae=f.offset,fe=_.getTextContentSize();if(_.is(M)||s&&ae!==0||!s&&ae!==fe){md(_,s,ae);return}}ym(this,s)}}if(this.removeText(),s&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const f=this.anchor.getNode();f.isEmpty()&&Kr(f.getParent())&&f.getIndexWithinParent()===0&&f.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 Hr(u){return u instanceof Ei}function cr(u){const s=u.offset;if(u.type==="text")return s;const a=u.getNode();return s===a.getChildrenSize()?a.getTextContent().length:0}function ai(u){const s=u.anchor,a=u.focus;return s.type==="element"&&a.type==="element"&&s.key===a.key&&s.offset===a.offset?[0,0]:[cr(s),cr(a)]}function ko(u){const s=u.focus,a=u.anchor,f=a.key,p=a.offset,_=a.type;En(a,s.key,s.offset,s.type),En(s,f,p,_),u._cachedNodes=null}function Ba(u,s,a,f){u.modify(s,a,f)}function ym(u,s){const a=u.anchor,f=u.focus,p=a.getNode(),_=f.getNode();if(p===_&&a.type==="text"&&f.type==="text"){const A=a.offset,M=f.offset,ae=A<M,fe=ae?A:M,me=ae?M:A,Te=me-1;if(fe!==Te){const ve=p.getTextContent().slice(fe,me);As(ve)||(s?f.offset=Te:a.offset=Te)}}}function md(u,s,a){const f=u,_=f.getTextContent().split(/(?=\s)/g),A=_.length;let M=0,ae=0;for(let me=0;me<A;me++){const Te=_[me],ve=me===A-1;if(ae=M,M+=Te.length,s&&M===a||M>a||ve){_.splice(me,1),ve&&(ae=void 0);break}}const fe=_.join("").trim();fe===""?f.remove():(f.setTextContent(fe),f.select(ae,ae))}function Nm(u,s,a){const f=u.getParent();return a===null||f===null||!f.canBeEmpty()||f!==a.getNode()}function _d(u,s,a,f){let p=s,_;if(u.nodeType===Le){let A=!1;const M=u.childNodes,ae=M.length;p===ae&&(A=!0,p=ae-1);let fe=M[p],me=!1;if(fe===f._blockCursorElement?(fe=M[p+1],me=!0):f._blockCursorElement!==null&&p--,_=Ri(fe),mt(_))p=fl(_,A);else{let Te=Ri(u);if(Te===null)return null;if(et(Te)){let ve=Te.getChildAtIndex(p);if(et(ve)&&Nm(ve,p,a)){const Ce=A?ve.getLastDescendant():ve.getFirstDescendant();Ce===null?(Te=ve,p=0):(ve=Ce,Te=et(ve)?ve:ve.getParentOrThrow())}mt(ve)?(_=ve,Te=null,p=fl(ve,A)):ve!==Te&&A&&!me&&p++}else{const ve=Te.getIndexWithinParent();s===0&&An(Te)&&Ri(u)===Te?p=ve:p=ve+1,Te=Te.getParentOrThrow()}if(et(Te))return Ar(Te.__key,p,"element")}}else _=Ri(u);return mt(_)?Ar(_.__key,p,"text"):null}function yd(u,s,a){const f=u.offset,p=u.getNode();if(f===0){const _=p.getPreviousSibling(),A=p.getParent();if(!s)et(_)&&!a&&_.isInline()?(u.key=_.__key,u.offset=_.getChildrenSize(),u.type="element"):mt(_)&&(u.key=_.__key,u.offset=_.getTextContent().length);else if((a||!s)&&_===null&&et(A)&&A.isInline()){const M=A.getPreviousSibling();mt(M)&&(u.key=M.__key,u.offset=M.getTextContent().length)}}else if(f===p.getTextContent().length){const _=p.getNextSibling(),A=p.getParent();if(s&&et(_)&&_.isInline())u.key=_.__key,u.offset=0,u.type="element";else if((a||s)&&_===null&&et(A)&&A.isInline()&&!A.canInsertTextAfter()){const M=A.getNextSibling();mt(M)&&(u.key=M.__key,u.offset=0)}}}function Nd(u,s,a){if(u.type==="text"&&s.type==="text"){const f=u.isBefore(s),p=u.is(s);yd(u,f,p),yd(s,!f,p),p&&(s.key=u.key,s.offset=u.offset,s.type=u.type);const _=Tn();if(_.isComposing()&&_._compositionKey!==u.key&&Tt(a)){const A=a.anchor,M=a.focus;En(u,A.key,A.offset,A.type),En(s,M.key,M.offset,M.type)}}}function Cd(u,s,a,f,p,_){if(u===null||a===null||!rs(p,u,a))return null;const A=_d(u,s,Tt(_)?_.anchor:null,p);if(A===null)return null;const M=_d(a,f,Tt(_)?_.focus:null,p);if(M===null)return null;if(A.type==="element"&&M.type==="element"){const ae=Ri(u),fe=Ri(a);if(An(ae)&&An(fe))return null}return Nd(A,M,_),[A,M]}function Cm(u){return et(u)&&!u.isInline()}function Ed(u,s,a,f,p,_){const A=Ti(),M=new tr(Ar(u,s,p),Ar(a,f,_),0,"");return M.dirty=!0,A._selection=M,M}function Em(){const u=Ar("root",0,"element"),s=Ar("root",0,"element");return new tr(u,s,0,"")}function Pc(){return new Ei(new Set)}function Tm(u){const a=u.getEditorState()._selection,f=or(u._window);return Tt(a)||a==null?$c(a,f,u,null):a.clone()}function $c(u,s,a,f){const p=a._window;if(p===null)return null;const _=f||p.event,A=_?_.type:void 0,M=A==="selectionchange",ae=!Pt()&&(M||A==="beforeinput"||A==="compositionstart"||A==="compositionend"||A==="click"&&_&&_.detail===3||A==="drop"||A===void 0);let fe,me,Te,ve;if(!Tt(u)||ae){if(s===null)return null;if(fe=s.anchorNode,me=s.focusNode,Te=s.anchorOffset,ve=s.focusOffset,M&&Tt(u)&&!rs(a,fe,me))return u.clone()}else return u.clone();const Ce=Cd(fe,Te,me,ve,a,u);if(Ce===null)return null;const[Ve,Ue]=Ce;return new tr(Ve,Ue,Tt(u)?u.format:0,Tt(u)?u.style:"")}function mn(){return Ti()._selection}function Io(){return Tn()._editorState._selection}function Ha(u,s,a,f=1){const p=u.anchor,_=u.focus,A=p.getNode(),M=_.getNode();if(!s.is(A)&&!s.is(M))return;const ae=s.__key;if(u.isCollapsed()){const fe=p.offset;if(a<=fe&&f>0||a<fe&&f<0){const me=Math.max(0,fe+f);p.set(ae,me,"element"),_.set(ae,me,"element"),Td(u)}}else{const fe=u.isBackward(),me=fe?_:p,Te=me.getNode(),ve=fe?p:_,Ce=ve.getNode();if(s.is(Te)){const Ve=me.offset;(a<=Ve&&f>0||a<Ve&&f<0)&&me.set(ae,Math.max(0,Ve+f),"element")}if(s.is(Ce)){const Ve=ve.offset;(a<=Ve&&f>0||a<Ve&&f<0)&&ve.set(ae,Math.max(0,Ve+f),"element")}}Td(u)}function Td(u){const s=u.anchor,a=s.offset,f=u.focus,p=f.offset,_=s.getNode(),A=f.getNode();if(u.isCollapsed()){if(!et(_))return;const M=_.getChildrenSize(),ae=a>=M,fe=ae?_.getChildAtIndex(M-1):_.getChildAtIndex(a);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),s.set(fe.__key,me,"text"),f.set(fe.__key,me,"text")}return}if(et(_)){const M=_.getChildrenSize(),ae=a>=M,fe=ae?_.getChildAtIndex(M-1):_.getChildAtIndex(a);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),s.set(fe.__key,me,"text")}}if(et(A)){const M=A.getChildrenSize(),ae=p>=M,fe=ae?A.getChildAtIndex(M-1):A.getChildAtIndex(p);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),f.set(fe.__key,me,"text")}}}function xm(u,s){const f=s.getEditorState()._selection,p=u._selection;if(Tt(p)){const _=p.anchor,A=p.focus;let M;if(_.type==="text"&&(M=_.getNode(),M.selectionTransform(f,p)),A.type==="text"){const ae=A.getNode();M!==ae&&ae.selectionTransform(f,p)}}}function Wa(u,s,a,f,p){let _=null,A=0,M=null;f!==null?(_=f.__key,mt(f)?(A=f.getTextContentSize(),M="text"):et(f)&&(A=f.getChildrenSize(),M="element")):p!==null&&(_=p.__key,mt(p)?M="text":et(p)&&(M="element")),_!==null&&M!==null?u.set(_,A,M):(A=s.getIndexWithinParent(),A===-1&&(A=a.getChildrenSize()),u.set(a.__key,A,"element"))}function xd(u,s,a,f,p){u.type==="text"?(u.key=a,s||(u.offset+=p)):u.offset>f.getIndexWithinParent()&&(u.offset-=1)}function Sm(u,s,a,f,p,_,A){const M=f.anchorNode,ae=f.focusNode,fe=f.anchorOffset,me=f.focusOffset,Te=document.activeElement;if(p.has("collaboration")&&Te!==_||Te!==null&&vs(Te))return;if(!Tt(s)){u!==null&&rs(a,M,ae)&&f.removeAllRanges();return}const ve=s.anchor,Ce=s.focus,Ve=ve.key,Ue=Ce.key,$e=Ls(a,Ve),Rt=Ls(a,Ue),Qe=ve.offset,ft=Ce.offset,qt=s.format,Wt=s.style,At=s.isCollapsed();let an=$e,nr=Rt,gs=!1;if(ve.type==="text"){an=Ir($e);const dr=ve.getNode();gs=dr.getFormat()!==qt||dr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(gs=!0);if(Ce.type==="text"&&(nr=Ir(Rt)),!(an===null||nr===null)&&(At&&(u===null||gs||Tt(u)&&(u.format!==qt||u.style!==Wt))&&Un(qt,Wt,Qe,Ve,performance.now()),!(fe===Qe&&me===ft&&M===an&&ae===nr&&!(f.type==="Range"&&At)&&((Te===null||!_.contains(Te))&&_.focus({preventScroll:!0}),ve.type!=="element")))){try{f.setBaseAndExtent(an,Qe,nr,ft)}catch{}if(!p.has("skip-scroll-into-view")&&s.isCollapsed()&&_!==null&&_===document.activeElement){const dr=s instanceof tr&&s.anchor.type==="element"?an.childNodes[Qe]||null:f.rangeCount>0?f.getRangeAt(0):null;if(dr!==null){let rn;if(dr instanceof Text){const In=document.createRange();In.selectNode(dr),rn=In.getBoundingClientRect()}else rn=dr.getBoundingClientRect();_i(a,rn,_)}}zt()}}function vm(u){let s=mn()||Io();s===null&&(s=Qn().selectEnd()),s.insertNodes(u)}function wm(){const u=mn();return u===null?"":u.getTextContent()}function Om(u,s,a){const f=[];let p=null,_=null;function A(fe,me,Te){const ve={cell:Te,startColumn:me,startRow:fe},Ce=Te.__rowSpan,Ve=Te.__colSpan;for(let Ue=0;Ue<Ce;Ue++){f[fe+Ue]===void 0&&(f[fe+Ue]=[]);for(let $e=0;$e<Ve;$e++)f[fe+Ue][me+$e]=ve}s.is(Te)&&(p=ve),a.is(Te)&&(_=ve)}function M(fe,me){return f[fe]===void 0||f[fe][me]===void 0}const ae=u.getChildren();for(let fe=0;fe<ae.length;fe++){const me=ae[fe];if(!Uc(me))throw Error("Expected GridNode children to be GridRowNode");const Te=me.getChildren();let ve=0;for(const Ce of Te){if(!Fo(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!M(fe,ve);)ve++;A(fe,ve,Ce),ve+=Ce.__colSpan}}if(p===null)throw Error("Anchor not found in Grid");if(_===null)throw Error("Focus not found in Grid");return[f,p,_]}function Sd(u){let s;if(u instanceof zc)s=u;else if(u instanceof si){const p=No(u,Fo);if(!Fo(p))throw Error("Expected to find a parent GridCellNode");s=p}else{const p=No(u.getNode(),Fo);if(!Fo(p))throw Error("Expected to find a parent GridCellNode");s=p}const a=s.getParent();if(!Uc(a))throw Error("Expected GridCellNode to have a parent GridRowNode");const f=a.getParent();if(!Fd(f))throw Error("Expected GridRowNode to have a parent GridNode");return[s,a,f]}function Fc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let a=s.getNode(),f=s.offset;for(;!Fi(a);)[a,f]=Am(a,f);return f}function Am(u,s){const a=u.getParent();if(!a){const p=ji();return Qn().append(p),p.select(),[Qn(),0]}if(mt(u)){const p=u.splitText(s);if(p.length===0)return[a,u.getIndexWithinParent()];const _=s===0?0:1,A=p[0].getIndexWithinParent()+_;return[a,A]}if(!et(u)||s===0)return[a,u.getIndexWithinParent()];const f=u.getChildAtIndex(s);if(f){const p=new tr(Ar(u.__key,s,"element"),Ar(u.__key,s,"element"),0,""),_=u.insertNewAfter(p);_&&_.append(f,...f.getNextSiblings())}return[a,u.getIndexWithinParent()+1]}function Mm(u){const s=ji();let a=null;for(let f=0;f<u.length;f++){const p=u[f],_=li(p);if(_||An(p)&&p.isInline()||et(p)&&p.isInline()||mt(p)||p.isParentRequired()){if(a===null&&(a=p.createParentElementNode(),s.append(a),_))continue;a!==null&&a.append(p)}else s.append(p),a=null}return s}let Zn=null,Jn=null,Rr=!1,Bc=!1,Ka=0;const vd={characterData:!0,childList:!0,subtree:!0};function Lo(){return Rr||Zn!==null&&Zn._readOnly}function ur(){if(Rr)throw Error("Cannot use method in read-only mode.")}function wd(){if(Ka>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 Ti(){if(Zn===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 Zn}function Tn(){if(Jn===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return Jn}function Dm(){return Jn}function Od(u,s,a){const f=s.__type,p=da(u,f);let _=a.get(f);_===void 0&&(_=Array.from(p.transforms),a.set(f,_));const A=_.length;for(let M=0;M<A&&(_[M](s),!!s.isAttached());M++);}function Ad(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function Rm(u,s){const a=s._dirtyLeaves,f=u._nodeMap;for(const p of a){const _=f.get(p);mt(_)&&_.isAttached()&&_.isSimpleText()&&!_.isUnmergeable()&&_r(_)}}function bm(u,s){const a=s._dirtyLeaves,f=s._dirtyElements,p=u._nodeMap,_=sr(),A=new Map;let M=a,ae=M.size,fe=f,me=fe.size;for(;ae>0||me>0;){if(ae>0){s._dirtyLeaves=new Set;for(const Te of M){const ve=p.get(Te);mt(ve)&&ve.isAttached()&&ve.isSimpleText()&&!ve.isUnmergeable()&&_r(ve),ve!==void 0&&Ad(ve,_)&&Od(s,ve,A),a.add(Te)}if(M=s._dirtyLeaves,ae=M.size,ae>0){Ka++;continue}}s._dirtyLeaves=new Set,s._dirtyElements=new Map;for(const Te of fe){const ve=Te[0],Ce=Te[1];if(ve!=="root"&&!Ce)continue;const Ve=p.get(ve);Ve!==void 0&&Ad(Ve,_)&&Od(s,Ve,A),f.set(ve,Ce)}M=s._dirtyLeaves,ae=M.size,fe=s._dirtyElements,me=fe.size,Ka++}s._dirtyLeaves=a,s._dirtyElements=f}function km(u){return Hc(u,Tn()._nodes)}function Hc(u,s){const a=u.type,f=s.get(a);if(f===void 0)throw Error(`parseEditorState: type "${a}" + not found`);const p=f.klass;if(u.type!==p.getType())throw Error(`LexicalNode: Node ${p.name} does not implement .importJSON().`);const _=p.importJSON(u),A=u.children;if(et(_)&&Array.isArray(A))for(let M=0;M<A.length;M++){const ae=A[M],fe=Hc(ae,s);_.append(fe)}return _}function Im(u,s,a){const f=Kc(),p=Zn,_=Rr,A=Jn,M=s._dirtyElements,ae=s._dirtyLeaves,fe=s._cloneNotNeeded,me=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Zn=f,Rr=!1,Jn=s;try{const Te=s._nodes,ve=u.root;Hc(ve,Te),a&&a(),f._readOnly=!0,Dd(f)}catch(Te){Te instanceof Error&&s._onError(Te)}finally{s._dirtyElements=M,s._dirtyLeaves=ae,s._cloneNotNeeded=fe,s._dirtyType=me,Zn=p,Rr=_,Jn=A}return f}function Md(u,s){const a=Zn,f=Rr,p=Jn;Zn=u,Rr=!0,Jn=null;try{return s()}finally{Zn=a,Rr=f,Jn=p}}function Dd(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 Vs(u,s){const a=u._pendingEditorState,f=u._rootElement,p=u._headless||f===null;if(a===null)return;const _=u._editorState,A=_._selection,M=a._selection,ae=u._dirtyType!==qe,fe=Zn,me=Rr,Te=Jn,ve=u._updating,Ce=u._observer;let Ve=null;if(u._pendingEditorState=null,u._editorState=a,!p&&ae&&Ce!==null){Jn=u,Zn=a,Rr=!1,u._updating=!0;try{const At=u._dirtyType,an=u._dirtyElements,nr=u._dirtyLeaves;Ce.disconnect(),Ve=Ki(_,a,u,At,an,nr)}catch(At){if(At instanceof Error&&u._onError(At),!Bc)Pd(u,null,f,a),rr(u),u._dirtyType=ct,Bc=!0,Vs(u,_),Bc=!1;else throw At;return}finally{Ce.observe(f,vd),u._updating=ve,Zn=fe,Rr=me,Jn=Te}}a._readOnly||(a._readOnly=!0,Dd(a),Tt(M)&&(Object.freeze(M.anchor),Object.freeze(M.focus)),Object.freeze(M));const Ue=u._dirtyLeaves,$e=u._dirtyElements,Rt=u._normalizedNodes,Qe=u._updateTags,ft=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),Ma(u,a);const qt=p?null:or(u._window);if(u._editable&&qt!==null&&(ae||M===null||M.dirty)){Jn=u,Zn=a;try{if(Ce!==null&&Ce.disconnect(),ae||M===null||M.dirty){const At=u._blockCursorElement;At!==null&&$s(At,u,f),Sm(A,M,u,qt,Qe,f)}yi(u,f,M),Ce!==null&&Ce.observe(f,vd)}finally{Jn=Te,Zn=fe}}Ve!==null&&Pm(u,Ve,Qe,Ue,_),!Tt(M)&&M!==null&&(A===null||!A.is(M))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Bl("decorator",u,!0,Wt)),Lm(u,s||_,a),Bl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:a,normalizedNodes:Rt,prevEditorState:s||_,tags:Qe}),Fm(u,ft),$m(u)}function Lm(u,s,a){const f=uo(s),p=uo(a);f!==p&&Bl("textcontent",u,!0,p)}function Pm(u,s,a,f,p){const _=Array.from(u._listeners.mutation),A=_.length;for(let M=0;M<A;M++){const[ae,fe]=_[M],me=s.get(fe);me!==void 0&&ae(me,{dirtyLeaves:f,prevEditorState:p,updateTags:a})}}function Bl(u,s,a,...f){const p=s._updating;s._updating=a;try{const _=Array.from(s._listeners[u]);for(let A=0;A<_.length;A++)_[A].apply(null,f)}finally{s._updating=p}}function Rd(u,s,a){if(u._updating===!1||Jn!==u){let p=!1;return u.update(()=>{p=Rd(u,s,a)}),p}const f=bi(u);for(let p=4;p>=0;p--)for(let _=0;_<f.length;_++){const ae=f[_]._commands.get(s);if(ae!==void 0){const fe=ae[p];if(fe!==void 0){const me=Array.from(fe),Te=me.length;for(let ve=0;ve<Te;ve++)if(me[ve](a,u)===!0)return!0}}}return!1}function $m(u){const s=u._updates;if(s.length!==0){const a=s.shift();if(a){const[f,p]=a;kd(u,f,p)}}}function Fm(u,s){if(u._deferred=[],s.length!==0){const a=u._updating;u._updating=!0;try{for(let f=0;f<s.length;f++)s[f]()}finally{u._updating=a}}}function bd(u,s){const a=u._updates;let f=s||!1;for(;a.length!==0;){const p=a.shift();if(p){const[_,A]=p;let M,ae;A!==void 0&&(M=A.onUpdate,ae=A.tag,A.skipTransforms&&(f=!0),M&&u._deferred.push(M),ae&&u._updateTags.add(ae)),_()}}return f}function kd(u,s,a){const f=u._updateTags;let p,_,A=!1,M=!1;a!==void 0&&(p=a.onUpdate,_=a.tag,_!=null&&f.add(_),A=a.skipTransforms||!1,M=a.discrete||!1),p&&u._deferred.push(p);const ae=u._editorState;let fe=u._pendingEditorState,me=!1;(fe===null||fe._readOnly)&&(fe=u._pendingEditorState=Wm(fe||ae),me=!0),fe._flushSync=M;const Te=Zn,ve=Rr,Ce=Jn,Ve=u._updating;Zn=fe,Rr=!1,u._updating=!0,Jn=u;try{me&&(u._headless?ae._selection!=null&&(fe._selection=ae._selection.clone()):fe._selection=Tm(u));const $e=u._compositionKey;s(),A=bd(u,A),xm(fe,u),u._dirtyType!==qe&&(A?Rm(fe,u):bm(fe,u),bd(u),Sl(ae,fe,u._dirtyLeaves,u._dirtyElements));const Rt=u._compositionKey;$e!==Rt&&(fe._flushSync=!0);const Qe=fe._selection;if(Tt(Qe)){const ft=fe._nodeMap,qt=Qe.anchor.key,Wt=Qe.focus.key;if(ft.get(qt)===void 0||ft.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 Hr(Qe)&&Qe._nodes.size===0&&(fe._selection=null)}catch($e){$e instanceof Error&&u._onError($e),u._pendingEditorState=ae,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),Vs(u);return}finally{Zn=Te,Rr=ve,Jn=Ce,u._updating=Ve,Ka=0}u._dirtyType!==qe||Hm(fe,u)?fe._flushSync?(fe._flushSync=!1,Vs(u)):me&&ao(()=>{Vs(u)}):(fe._flushSync=!1,me&&(f.clear(),u._deferred=[],u._pendingEditorState=null))}function Wr(u,s,a){u._updating?u._updates.push([s,a]):kd(u,s,a)}class Wc extends si{constructor(s){super(s)}decorate(s,a){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof Wc}class qs extends si{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 a=this.getFirstChild();for(;a!==null;)s.push(a),a=a.getNextSibling();return s}getChildrenKeys(){const s=[];let a=this.getFirstChild();for(;a!==null;)s.push(a.__key),a=a.getNextSibling();return s}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const a=Tn()._dirtyElements;return a!==null&&a.has(this.__key)}isLastChild(){const s=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(s)}getAllTextNodes(){const s=[];let a=this.getFirstChild();for(;a!==null;){if(mt(a)&&s.push(a),et(a)){const f=a.getAllTextNodes();s.push(...f)}a=a.getNextSibling()}return s}getFirstDescendant(){let s=this.getFirstChild();for(;s!==null;){if(et(s)){const a=s.getFirstChild();if(a!==null){s=a;continue}}break}return s}getLastDescendant(){let s=this.getLastChild();for(;s!==null;){if(et(s)){const a=s.getLastChild();if(a!==null){s=a;continue}}break}return s}getDescendantByIndex(s){const a=this.getChildren(),f=a.length;if(s>=f){const _=a[f-1];return et(_)&&_.getLastDescendant()||_||null}const p=a[s];return et(p)&&p.getFirstDescendant()||p||null}getFirstChild(){const a=this.getLatest().__first;return a===null?null:Nn(a)}getFirstChildOrThrow(){const s=this.getFirstChild();if(s===null)throw Error(`Expected node ${this.__key} to have a first child.`);return s}getLastChild(){const a=this.getLatest().__last;return a===null?null:Nn(a)}getLastChildOrThrow(){const s=this.getLastChild();if(s===null)throw Error(`Expected node ${this.__key} to have a last child.`);return s}getChildAtIndex(s){const a=this.getChildrenSize();let f,p;if(s<a/2){for(f=this.getFirstChild(),p=0;f!==null&&p<=s;){if(p===s)return f;f=f.getNextSibling(),p++}return null}for(f=this.getLastChild(),p=a-1;f!==null&&p>=s;){if(p===s)return f;f=f.getPreviousSibling(),p--}return null}getTextContent(){let s="";const a=this.getChildren(),f=a.length;for(let p=0;p<f;p++){const _=a[p];s+=_.getTextContent(),et(_)&&p!==f-1&&!_.isInline()&&(s+=$t)}return s}getTextContentSize(){let s=0;const a=this.getChildren(),f=a.length;for(let p=0;p<f;p++){const _=a[p];s+=_.getTextContentSize(),et(_)&&p!==f-1&&!_.isInline()&&(s+=$t.length)}return s}getDirection(){return this.getLatest().__dir}hasFormat(s){if(s!==""){const a=mi[s];return(this.getFormat()&a)!==0}return!1}select(s,a){ur();const f=mn();let p=s,_=a;const A=this.getChildrenSize();if(!this.canBeEmpty()){if(s===0&&a===0){const ae=this.getFirstChild();if(mt(ae)||et(ae))return ae.select(0,0)}else if((s===void 0||s===A)&&(a===void 0||a===A)){const ae=this.getLastChild();if(mt(ae)||et(ae))return ae.select()}}p===void 0&&(p=A),_===void 0&&(_=A);const M=this.__key;if(Tt(f))f.anchor.set(M,p,"element"),f.focus.set(M,_,"element"),f.dirty=!0;else return Ed(M,p,M,_,"element","element");return f}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(f=>f.remove()),s}append(...s){return this.splice(this.getChildrenSize(),0,s)}setDirection(s){const a=this.getWritable();return a.__dir=s,a}setFormat(s){const a=this.getWritable();return a.__format=s!==""?mi[s]:0,this}setIndent(s){const a=this.getWritable();return a.__indent=s,this}splice(s,a,f){const p=f.length,_=this.getChildrenSize(),A=this.getWritable(),M=A.__key,ae=[],fe=[],me=this.getChildAtIndex(s+a);let Te=null,ve=_-a+p;if(s!==0)if(s===_)Te=this.getLastChild();else{const Ve=this.getChildAtIndex(s);Ve!==null&&(Te=Ve.getPreviousSibling())}if(a>0){let Ve=Te===null?this.getFirstChild():Te.getNextSibling();for(let Ue=0;Ue<a;Ue++){if(Ve===null)throw Error("splice: sibling not found");const $e=Ve.getNextSibling(),Rt=Ve.__key,Qe=Ve.getWritable();Yr(Qe),fe.push(Rt),Ve=$e}}let Ce=Te;for(let Ve=0;Ve<p;Ve++){const Ue=f[Ve];Ce!==null&&Ue.is(Ce)&&(Te=Ce=Ce.getPreviousSibling());const $e=Ue.getWritable();$e.__parent===M&&ve--,Yr($e);const Rt=Ue.__key;if(Ce===null)A.__first=Rt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Rt,$e.__prev=Qe.__key}if(Ue.__key===M)throw Error("append: attempting to append self");$e.__parent=M,ae.push(Rt),Ce=Ue}if(s+a===_){if(Ce!==null){const Ve=Ce.getWritable();Ve.__next=null,A.__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(A.__size=ve,fe.length){const Ve=mn();if(Tt(Ve)){const Ue=new Set(fe),$e=new Set(ae),{anchor:Rt,focus:Qe}=Ve;Id(Rt,Ue,$e)&&Wa(Rt,Rt.getNode(),this,Te,me),Id(Qe,Ue,$e)&&Wa(Qe,Qe.getNode(),this,Te,me),ve===0&&!this.canBeEmpty()&&!ii(this)&&this.remove()}}return A}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(s,a){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,a,f){return!1}}function et(u){return u instanceof qs}function Id(u,s,a){let f=u.getNode();for(;f;){const p=f.__key;if(s.has(p)&&!a.has(p))return!0;f=f.getParent()}return!1}class Po extends qs{static getType(){return"root"}static clone(){return new Po}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Lo()||Tn()._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,a){return!1}append(...s){for(let a=0;a<s.length;a++){const f=s[a];if(!et(f)&&!An(f))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...s)}static importJSON(s){const a=Qn();return a.setFormat(s.format),a.setIndent(s.indent),a.setDirection(s.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Bm(){return new Po}function Kr(u){return u instanceof Po}function Hm(u,s){const a=s.getEditorState()._selection,f=u._selection;if(f!==null){if(f.dirty||!f.is(a))return!0}else if(a!==null)return!0;return!1}function Wm(u){return new za(new Map(u._nodeMap))}function Kc(){return new za(new Map([["root",Bm()]]))}function Ld(u){const s=u.exportJSON(),a=u.constructor;if(s.type!==a.getType())throw Error(`LexicalNode: Node ${a.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const f=s.children;if(!Array.isArray(f))throw Error(`LexicalNode: Node ${a.name} is an element but .exportJSON() does not have a children array.`);const p=u.getChildren();for(let _=0;_<p.length;_++){const A=p[_],M=Ld(A);f.push(M)}}return s}class za{constructor(s,a){this._nodeMap=s,this._selection=a||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(s){return Md(this,s)}clone(s){const a=new za(this._nodeMap,s===void 0?this._selection:s);return a._readOnly=!0,a}toJSON(){return Md(this,()=>({root:Ld(Qn())}))}}class $o extends qs{static getType(){return"paragraph"}static clone(s){return new $o(s.__key)}createDOM(s){const a=document.createElement("p"),f=Li(s.theme,"paragraph");return f!==void 0&&a.classList.add(...f),a}updateDOM(s,a,f){return!1}static importDOM(){return{p:s=>({conversion:Km,priority:0})}}exportDOM(s){const{element:a}=super.exportDOM(s);if(a&&Fs(a)){this.isEmpty()&&a.append(document.createElement("br"));const f=this.getFormatType();a.style.textAlign=f;const p=this.getDirection();p&&(a.dir=p);const _=this.getIndent();_>0&&(a.style.textIndent=`${_*20}px`)}return{element:a}}static importJSON(s){const a=ji();return a.setFormat(s.format),a.setIndent(s.indent),a.setDirection(s.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(s,a){const f=ji(),p=this.getDirection();return f.setDirection(p),this.insertAfter(f,a),f}collapseAtStart(){const s=this.getChildren();if(s.length===0||mt(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 Km(u){const s=ji();if(u.style){s.setFormat(u.style.textAlign);const a=parseInt(u.style.textIndent,10)/20;a>0&&s.setIndent(a)}return{node:s}}function ji(){return vr(new $o)}function zm(u){return u instanceof $o}const Um=0,Gm=1,Ym=2,jm=3,Vm=4;function Pd(u,s,a,f){const p=u._keyToDOMMap;p.clear(),u._editorState=Kc(),u._pendingEditorState=f,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 _=u._observer;_!==null&&(_.disconnect(),u._observer=null),s!==null&&(s.textContent=""),a!==null&&(a.textContent="",p.set("root",a))}function qm(u,s){const a=new Map,f=new Set,p=_=>{Object.keys(_).forEach(A=>{let M=a.get(A);M===void 0&&(M=[],a.set(A,M)),M.push(_[A])})};return u.forEach(_=>{const A=_.klass.importDOM!=null?_.klass.importDOM.bind(_.klass):null;if(A==null||f.has(A))return;f.add(A);const M=A();M!==null&&p(M)}),s&&p(s),a}function Zm(u){const s=u||{},a=Dm(),f=s.theme||{},p=u===void 0?a:s.parentEditor||null,_=s.disableEvents||!1,A=Kc(),M=s.namespace||(p!==null?p._config.namespace:hl()),ae=s.editorState,fe=[Po,qr,Gi,Er,$o,...s.nodes||[]],{onError:me,html:Te}=s,ve=s.editable!==void 0?s.editable:!0;let Ce;if(u===void 0&&a!==null)Ce=a._nodes;else{Ce=new Map;for(let Ue=0;Ue<fe.length;Ue++){let $e=fe[Ue],Rt=null,Qe=null;if(typeof $e!="function"){const At=$e;$e=At.replace,Rt=At.with,Qe=At.withKlass||null}{const At=$e.name;if(At!=="RootNode"){const an=$e.prototype;["getType","clone"].forEach(nr=>{$e.hasOwnProperty(nr)||console.warn(`${At} must implement static "${nr}" method`)}),!$e.hasOwnProperty("importDOM")&&$e.hasOwnProperty("exportDOM")&&console.warn(`${At} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),an instanceof Wc&&(an.hasOwnProperty("decorate")||console.warn(`${an.constructor.name} must implement "decorate" method`)),$e.hasOwnProperty("importJSON")||console.warn(`${At} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),an.hasOwnProperty("exportJSON")||console.warn(`${At} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ft=$e.getType(),qt=$e.transform(),Wt=new Set;qt!==null&&Wt.add(qt),Ce.set(ft,{exportDOM:Te&&Te.export?Te.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new Jm(A,p,Ce,{disableEvents:_,namespace:M,theme:f},me||console.error,qm(Ce,Te?Te.import:void 0),ve);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ct),Ve}class Jm{constructor(s,a,f,p,_,A,M){this._parentEditor=a,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=p,this._nodes=f,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=hl(),this._onError=_,this._htmlConversions=A,this._editable=M,this._headless=a!==null&&a._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(s){const a=this._listeners.update;return a.add(s),()=>{a.delete(s)}}registerEditableListener(s){const a=this._listeners.editable;return a.add(s),()=>{a.delete(s)}}registerDecoratorListener(s){const a=this._listeners.decorator;return a.add(s),()=>{a.delete(s)}}registerTextContentListener(s){const a=this._listeners.textcontent;return a.add(s),()=>{a.delete(s)}}registerRootListener(s){const a=this._listeners.root;return s(this._rootElement,null),a.add(s),()=>{s(null,this._rootElement),a.delete(s)}}registerCommand(s,a,f){if(f===void 0)throw Error('Listener for type "command" requires a "priority".');const p=this._commands;p.has(s)||p.set(s,[new Set,new Set,new Set,new Set,new Set]);const _=p.get(s);if(_===void 0)throw Error(`registerCommand: Command ${String(s)} not found in command map`);const A=_[f];return A.add(a),()=>{A.delete(a),_.every(M=>M.size===0)&&p.delete(s)}}registerMutationListener(s,a){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 p=this._listeners.mutation;return p.set(a,s),()=>{p.delete(a)}}registerNodeTransformToKlass(s,a){const f=s.getType(),p=this._nodes.get(f);if(p===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);return p.transforms.add(a),p}registerNodeTransform(s,a){const f=this.registerNodeTransformToKlass(s,a),p=[f],_=f.replaceWithKlass;if(_!=null){const A=this.registerNodeTransformToKlass(_,a);p.push(A)}return Di(this,s.getType()),()=>{p.forEach(A=>A.transforms.delete(a))}}hasNode(s){return this._nodes.has(s.getType())}hasNodes(s){return s.every(this.hasNode.bind(this))}dispatchCommand(s,a){return ut(this,s,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(s){const a=this._rootElement;if(s!==a){const f=Li(this._config.theme,"root"),p=this._pendingEditorState||this._editorState;if(this._rootElement=s,Pd(this,a,s,p),a!==null&&(this._config.disableEvents||Ot(a),f!=null&&a.classList.remove(...f)),s!==null){const _=wa(s),A=s.style;A.userSelect="text",A.whiteSpace="pre-wrap",A.wordBreak="break-word",s.setAttribute("data-lexical-editor","true"),this._window=_,this._dirtyType=ct,rr(this),this._updateTags.add("history-merge"),Vs(this),this._config.disableEvents||gt(s,this),f!=null&&s.classList.add(...f)}else this._editorState=p,this._pendingEditorState=null,this._window=null;Bl("root",this,!1,s,a)}}getElementByKey(s){return this._keyToDOMMap.get(s)||null}getEditorState(){return this._editorState}setEditorState(s,a){if(s.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");dn(this);const f=this._pendingEditorState,p=this._updateTags,_=a!==void 0?a.tag:null;f!==null&&!f.isEmpty()&&(_!=null&&p.add(_),Vs(this)),this._pendingEditorState=s,this._dirtyType=ct,this._dirtyElements.set("root",!1),this._compositionKey=null,_!=null&&p.add(_),Vs(this)}parseEditorState(s,a){const f=typeof s=="string"?JSON.parse(s):s;return Im(f,this,a)}update(s,a){Wr(this,s,a)}focus(s,a={}){const f=this._rootElement;f!==null&&(f.setAttribute("autocapitalize","off"),Wr(this,()=>{const p=mn(),_=Qn();p!==null?p.dirty=!0:_.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?_.selectStart():_.selectEnd())},{onUpdate:()=>{f.removeAttribute("autocapitalize"),s&&s()},tag:"focus"}),this._pendingEditorState===null&&f.removeAttribute("autocapitalize"))}blur(){const s=this._rootElement;s!==null&&s.blur();const a=or(this._window);a!==null&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(s){this._editable!==s&&(this._editable=s,Bl("editable",this,!0,s))}toJSON(){return{editorState:this._editorState.toJSON()}}}class zc extends qs{constructor(s,a){super(a),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 Fo(u){return u instanceof zc}class $d extends qs{}function Fd(u){return u instanceof $d}class Bd extends qs{}function Uc(u){return u instanceof Bd}return He.$INTERNAL_isPointSelection=ar,He.$addUpdateTag=Ct,He.$applyNodeReplacement=vr,He.$copyNode=Tl,He.$createLineBreakNode=hs,He.$createNodeSelection=Pc,He.$createParagraphNode=ji,He.$createPoint=Ar,He.$createRangeSelection=Em,He.$createTabNode=Do,He.$createTextNode=On,He.$getAdjacentNode=Cl,He.$getNearestNodeFromDOMNode=ri,He.$getNearestRootOrShadowRoot=_o,He.$getNodeByKey=Nn,He.$getPreviousSelection=Io,He.$getRoot=Qn,He.$getSelection=mn,He.$getTextContent=wm,He.$hasAncestor=$i,He.$hasUpdateTag=Kn,He.$insertNodes=vm,He.$isBlockElementNode=Cm,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Pr,He.$isLeafNode=ws,He.$isLineBreakNode=li,He.$isNodeSelection=Hr,He.$isParagraphNode=zm,He.$isRangeSelection=Tt,He.$isRootNode=Kr,He.$isRootOrShadowRoot=ii,He.$isTabNode=Ro,He.$isTextNode=mt,He.$nodesOfType=Pi,He.$normalizeSelection__EXPERIMENTAL=Ss,He.$parseSerializedNode=km,He.$selectAll=Nl,He.$setCompositionKey=xn,He.$setSelection=yr,He.$splitNode=Oa,He.BLUR_COMMAND=I,He.CAN_REDO_COMMAND=J,He.CAN_UNDO_COMMAND=de,He.CLEAR_EDITOR_COMMAND=O,He.CLEAR_HISTORY_COMMAND=H,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=Vm,He.COMMAND_PRIORITY_EDITOR=Um,He.COMMAND_PRIORITY_HIGH=jm,He.COMMAND_PRIORITY_LOW=Gm,He.COMMAND_PRIORITY_NORMAL=Ym,He.CONTROLLED_TEXT_INSERTION_COMMAND=m,He.COPY_COMMAND=K,He.CUT_COMMAND=P,He.DELETE_CHARACTER_COMMAND=c,He.DELETE_LINE_COMMAND=b,He.DELETE_WORD_COMMAND=R,He.DEPRECATED_$computeGridMap=Om,He.DEPRECATED_$getGridCellNodeRect=Dr,He.DEPRECATED_$getNodeTriplet=Sd,He.DEPRECATED_$isGridCellNode=Fo,He.DEPRECATED_$isGridNode=Fd,He.DEPRECATED_$isGridRowNode=Uc,He.DEPRECATED_GridCellNode=zc,He.DEPRECATED_GridNode=$d,He.DEPRECATED_GridRowNode=Bd,He.DRAGEND_COMMAND=ie,He.DRAGOVER_COMMAND=Y,He.DRAGSTART_COMMAND=S,He.DROP_COMMAND=ue,He.DecoratorNode=Wc,He.ElementNode=qs,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=$,He.FORMAT_TEXT_COMMAND=k,He.INDENT_CONTENT_COMMAND=we,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=g,He.INSERT_TAB_COMMAND=xe,He.INTERNAL_PointSelection=Mr,He.KEY_ARROW_DOWN_COMMAND=q,He.KEY_ARROW_LEFT_COMMAND=F,He.KEY_ARROW_RIGHT_COMMAND=U,He.KEY_ARROW_UP_COMMAND=G,He.KEY_BACKSPACE_COMMAND=ge,He.KEY_DELETE_COMMAND=B,He.KEY_DOWN_COMMAND=x,He.KEY_ENTER_COMMAND=le,He.KEY_ESCAPE_COMMAND=j,He.KEY_MODIFIER_COMMAND=w,He.KEY_SPACE_COMMAND=se,He.KEY_TAB_COMMAND=V,He.LineBreakNode=Gi,He.MOVE_TO_END=Q,He.MOVE_TO_START=W,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=N,He.ParagraphNode=$o,He.REDO_COMMAND=E,He.REMOVE_TEXT_COMMAND=T,He.RootNode=Po,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=Z,He.TabNode=Er,He.TextNode=qr,He.UNDO_COMMAND=z,He.createCommand=e,He.createEditor=Zm,He.getNearestEditorFromDOMNode=ol,He.isCurrentlyReadOnlyMode=Lo,He.isHTMLAnchorElement=Aa,He.isHTMLElement=Fs,He.isSelectionCapturedInDecoratorInput=vs,He.isSelectionWithinEditor=rs,He}var We={},of;function zy(){if(of)return We;of=1;let e={},t={},n={},r={},c={},d={},g={},m={},N={},T={},R={},b={},k={},z={},E={},x={},U={},Q={},F={},W={},G={},q={},le={},se={},ge={},j={},B={},V={},xe={},we={},Ee={},ue={},$={},S={},Y={},ie={};function K(o){let i=new URLSearchParams;i.append("code",o);for(let l=1;l<arguments.length;l++)i.append("v",arguments[l]);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 P=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Z=P&&"documentMode"in document?document.documentMode:null,O=P&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),H=P&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),J=P&&"InputEvent"in window&&!Z?"getTargetRanges"in new window.InputEvent("input"):!1,de=P&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=P&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,I=P&&/Android/.test(navigator.userAgent),w=P&&/^(?=.*Chrome).*/i.test(navigator.userAgent),D=P&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!w,re=de||_e||D?" ":"",ye=H?" ":re,Ae=/^[^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]/,te={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},Le={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(o){qe=o.timeStamp}function ct(o,i,l){return i.__lexicalLineBreak===o||o[`__lexicalKey_${l._key}`]!==void 0}function Mt(o){return o.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function Ut(o,i,l){Fe=!0;let h=100<performance.now()-qe;try{Cr(o,()=>{let y=Vt()||Mt(o);var C=new Map,v=o.getRootElement(),X=o._editorState,he=o._blockCursorElement;let Me=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,gt=Ke.target,Ot=Kt(gt,X);if(!(Ot===null&>!==v||Cn(Ot))){if(Pe==="characterData"){if(Ke=h&&Ct(Ot))e:{Ke=y,Pe=gt;var Ft=Ot;if(Dt(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=Gr(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===gt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),gt=gt.nodeValue,gt!==null&&wt(Ot,gt,Ke,Pe,!1))}else if(Pe==="childList"){for(Me=!0,Pe=Ke.addedNodes,Ft=0;Ft<Pe.length;Ft++){zt=Pe[Ft];var Un=$t(zt),wr=zt.parentNode;wr==null||zt===he||Un!==null||zt.nodeName==="BR"&&ct(zt,wr,o)||(H&&(Un=zt.innerText||zt.nodeValue)&&(Ye+=Un),wr.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)wr=Ke[zt],(wr.nodeName==="BR"&&ct(wr,gt,o)||he===wr)&&(gt.appendChild(wr),Ft++);Pe!==Ft&&(gt===v&&(Ot=X._nodeMap.get("root")),C.set(gt,Ot))}}}}if(0<C.size)for(let[si,oi]of C)if(Je(oi))for(C=oi.getChildrenKeys(),v=si.firstChild,X=0;X<C.length;X++)he=o.getElementByKey(C[X]),he!==null&&(v==null?(si.appendChild(he),v=he):v!==he&&si.replaceChild(he,v),v=v.nextSibling);else Ct(oi)&&oi.markDirty();if(C=l.takeRecords(),0<C.length){for(v=0;v<C.length;v++)for(he=C[v],X=he.addedNodes,he=he.target,Xe=0;Xe<X.length;Xe++)Ot=X[Xe],gt=Ot.parentNode,gt==null||Ot.nodeName!=="BR"||ct(Ot,he,o)||gt.removeChild(Ot);l.takeRecords()}y!==null&&(Me&&(y.dirty=!0,nn(y)),H&&sn(o)&&y.insertRawText(Ye))})}finally{Fe=!1}}function en(o){let i=o._observer;if(i!==null){let l=i.takeRecords();Ut(o,l,i)}}function Oe(o){qe===0&&dn(o).addEventListener("textInput",Be,!0),o._observer=new MutationObserver((i,l)=>{Ut(o,i,l)})}function ne(o,i){let l=o.__mode,h=o.__format;o=o.__style;let y=i.__mode,C=i.__format;return i=i.__style,(l===null||l===y)&&(h===null||h===C)&&(o===null||o===i)}function oe(o,i){let l=o.mergeWithSibling(i),h=fn()._normalizedNodes;return h.add(o.__key),h.add(i.__key),l}function Se(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{ne(i,o)&&(o=oe(i,o));break}for(var l;(l=o.getNextSibling())!==null&&Ct(l)&&l.isSimpleText()&&!l.isUnmergeable();)if(l.__text==="")l.remove();else{ne(o,l)&&oe(o,l);break}}}function Ie(o){return De(o.anchor),De(o.focus),o}function De(o){for(;o.type==="element";){var i=o.getNode(),l=o.offset;if(l===i.getChildrenSize()?(i=i.getChildAtIndex(l-1),l=!0):(i=i.getChildAtIndex(l),l=!1),Ct(i)){o.set(i.__key,l?i.getTextContentSize():0,"text");break}else if(!Je(i))break;o.set(i.__key,l?i.getChildrenSize():0,"element")}}let je=1,rt=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function it(o){let i=document.activeElement;if(i===null)return!1;let l=i.nodeName;return Cn(Kt(o))&&(l==="INPUT"||l==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function st(o,i,l){let h=o.getRootElement();try{return h!==null&&h.contains(i)&&h.contains(l)&&i!==null&&!it(i)&&vt(i)===o}catch{return!1}}function vt(o){for(;o!=null;){let i=o.__lexicalEditor;if(i!=null)return i;o=mr(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,l){let h=te[i];return l!==null&&(o&h)===(l&h)||(o^=h,i==="subscript"?o&=-65:i==="superscript"&&(o&=-33)),o}function _t(o,i){if(i!=null)o.__key=i;else{Vn(),99<Hi&&K(14),i=fn();var l=$r(),h=""+je++;l._nodeMap.set(h,o),Je(o)?i._dirtyElements.set(h,!0):i._dirtyLeaves.add(h),i._cloneNotNeeded.add(h),i._dirtyType=1,o.__key=h}}function Nt(o){var i=o.getParent();if(i!==null){let y=o.getWritable();i=i.getWritable();var l=o.getPreviousSibling();if(o=o.getNextSibling(),l===null)if(o!==null){var h=o.getWritable();i.__first=o.__key,h.__prev=null}else i.__first=null;else{if(h=l.getWritable(),o!==null){let C=o.getWritable();C.__prev=h.__key,h.__next=C.__key}else h.__next=null;y.__prev=null}o===null?l!==null?(o=l.getWritable(),i.__last=l.__key,o.__next=null):i.__last=null:(o=o.getWritable(),l!==null?(l=l.getWritable(),l.__next=o.__key,o.__prev=l.__key):o.__prev=null,y.__next=null),i.__size--,y.__parent=null}}function Et(o){99<Hi&&K(14);var i=o.getLatest(),l=i.__parent,h=$r();let y=fn(),C=h._nodeMap;if(h=y._dirtyElements,l!==null)e:for(;l!==null;){if(h.has(l))break e;let v=C.get(l);if(v===void 0)break;h.set(l,!1),l=v.__parent}i=i.__key,y._dirtyType=1,Je(o)?h.set(i,!0):y._dirtyLeaves.add(i)}function ht(o){Vn();var i=fn();let l=i._compositionKey;o!==l&&(i._compositionKey=o,l!==null&&(i=pt(l),i!==null&&i.getWritable()),o!==null&&(o=pt(o),o!==null&&o.getWritable()))}function xt(){return ds()?null:fn()._compositionKey}function pt(o,i){return o=(i||$r())._nodeMap.get(o),o===void 0?null:o}function $t(o,i){let l=fn();return o=o[`__lexicalKey_${l._key}`],o!==void 0?pt(o,i):null}function Kt(o,i){for(;o!=null;){let l=$t(o,i);if(l!==null)return l;o=mr(o)}return null}function tn(o){let i=Object.assign({},o._decorators);return o._pendingDecorators=i}function It(o){return o.read(()=>bt().getTextContent())}function jt(o,i){Cr(o,()=>{var l=$r();if(!l.isEmpty())if(i==="root")bt().markDirty();else{l=l._nodeMap;for(let[,h]of l)h.markDirty()}},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return $r()._nodeMap.get("root")}function nn(o){Vn();let i=$r();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function Sr(o){var i=fn(),l;e:{for(l=o;l!=null;){let h=l[`__lexicalKey_${i._key}`];if(h!==void 0){l=h;break e}l=mr(l)}l=null}return l===null?(i=i.getRootElement(),o===i?pt("root"):null):pt(l)}function mi(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function pe(o){let i=[];for(;o!==null;)i.push(o),o=o._parentEditor;return i}function Ze(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ot(o,i,l){if(i=Gr(i._window),i!==null){var h=i.anchorNode,{anchorOffset:y,focusOffset:C}=i;if(h!==null&&(i=h.nodeType===3?h.nodeValue:null,h=Kt(h),i!==null&&Ct(h))){if(i===re&&l){let v=l.length;i=l,C=y=v}i!==null&&wt(h,i,y,C,o)}}}function wt(o,i,l,h,y){let C=o;if(C.isAttached()&&(y||!C.isDirty())){let Me=C.isComposing(),Ye=i;if((Me||y)&&i[i.length-1]===re&&(Ye=i.slice(0,-1)),i=C.getTextContent(),y||Ye!==i)if(Ye==="")if(ht(null),de||_e||D)C.remove();else{let Xe=fn();setTimeout(()=>{Xe.update(()=>{C.isAttached()&&C.remove()})},20)}else{y=C.getParent(),i=Nr();var v=C.getTextContentSize(),X=xt(),he=C.getKey();C.isToken()||X!==null&&he===X&&!Me||Dt(i)&&(y!==null&&!y.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===o.__key&&i.anchor.offset===0&&!C.canInsertTextBefore()&&!Me||i.focus.key===o.__key&&i.focus.offset===v&&!C.canInsertTextAfter()&&!Me)?C.markDirty():(o=Vt(),Dt(o)&&l!==null&&h!==null&&(o.setTextNodeRange(C,l,C,h),C.isSegmented()&&(l=C.getTextContent(),l=Kn(l),C.replace(l),C=l)),C.setTextContent(Ye))}}}function Gt(o,i){if(i.isSegmented())return!0;if(!o.isCollapsed())return!1;o=o.anchor.offset;let l=i.getParentOrThrow(),h=i.isToken();return o===0?((o=!i.canInsertTextBefore()||!l.canInsertTextBefore()||h)||(i=i.getPreviousSibling(),o=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),o):o===i.getTextContentSize()?!i.canInsertTextAfter()||!l.canInsertTextAfter()||h:!1}function Bt(o,i){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let l=o.__lexicalClassNameCache,h=l[i];return h!==void 0?h:(o=o[i],typeof o=="string"?(o=o.split(" "),l[i]=o):o)}function Pt(o,i,l,h,y){l.size!==0&&(l=h.__type,h=h.__key,i=i.get(l),i===void 0&&K(33,l),l=i.klass,i=o.get(l),i===void 0&&(i=new Map,o.set(l,i)),o=i.get(h),l=o==="destroyed"&&y==="created",(o===void 0||l)&&i.set(h,l?"updated":y))}function Lt(o,i,l){let h=o.getParent(),y=l;return h!==null&&(i&&l===0?(y=o.getIndexWithinParent(),o=h):i||l!==o.getChildrenSize()||(y=o.getIndexWithinParent()+1,o=h)),o.getChildAtIndex(i?y-1:y)}function Ht(o,i){var l=o.offset;return o.type==="element"?(o=o.getNode(),Lt(o,i,l)):(o=o.getNode(),i&&l===0||!i&&l===o.getTextContentSize()?(l=i?o.getPreviousSibling():o.getNextSibling(),l===null?Lt(o.getParentOrThrow(),i,o.getIndexWithinParent()+(i?0:1)):l):null)}function sn(o){return o=(o=dn(o).event)&&o.inputType,o==="insertFromPaste"||o==="insertFromPasteAsQuotation"}function ln(o){return!er(o)&&!o.isLastChild()&&!o.isInline()}function Rn(o,i){return o=o._keyToDOMMap.get(i),o===void 0&&K(75,i),o}function mr(o){return o=o.assignedSlot||o.parentElement,o!==null&&o.nodeType===11?o.host:o}function jn(o,i){for(o=o.getParent();o!==null;){if(o.is(i))return!0;o=o.getParent()}return!1}function dn(o){return o=o._window,o===null&&K(78),o}function rr(o){for(o=o.getParentOrThrow();o!==null&&!ir(o);)o=o.getParentOrThrow();return o}function ir(o){return er(o)||Je(o)&&o.isShadowRoot()}function Ai(o){return o=o.constructor.clone(o),_t(o,null),o}function _r(o){var i=fn();let l=o.constructor.getType();return i=i._nodes.get(l),i===void 0&&K(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||K(98),i):o}function Ss(o,i){o=o.getParent(),!er(o)||Je(i)||Cn(i)||K(99)}function lo(o){return(Cn(o)||Je(o)&&!o.canBeEmpty())&&!o.isInline()}function sl(o,i,l){l.style.removeProperty("caret-color"),i._blockCursorElement=null,i=o.parentElement,i!==null&&i.removeChild(o)}function Gr(o){return P?(o||window).getSelection():null}function da(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function ao(o){return o.nodeType===1}function ns(o){if(Cn(o)&&!o.isInline())return!0;if(!Je(o)||ir(o))return!1;var i=o.getFirstChild();return i=i===null||ki(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function vs(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function rs(o,i,l,h,y,C){for(o=o.getFirstChild();o!==null;){let v=o.__key;o.__parent===i&&(Je(o)&&rs(o,v,l,h,y,C),l.has(v)||C.delete(v),y.push(v)),o=o.getNextSibling()}}function ol(o,i,l,h){o=o._nodeMap,i=i._nodeMap;let y=[];for(let[C]of h){let v=i.get(C);v===void 0||v.isAttached()||(Je(v)&&rs(v,C,o,i,y,h),o.has(C)||h.delete(C),y.push(C))}for(let C of y)i.delete(C);for(let C of l)h=i.get(C),h===void 0||h.isAttached()||(o.has(C)||l.delete(C),i.delete(C))}let bn="",Wn="",ni="",Ir,$n,ws,ll=!1,al=!1,Yr,Mi=null,cl,xn,sr,Nn,co,ri;function Os(o,i){let l=sr.get(o);if(i!==null){let h=Ms(o);h.parentNode===i&&i.removeChild(h)}Nn.has(o)||$n._keyToDOMMap.delete(o),Je(l)&&(o=As(l,sr),uo(o,0,o.length-1,null)),l!==void 0&&Pt(ri,ws,Yr,l,"destroyed")}function uo(o,i,l,h){for(;i<=l;++i){let y=o[i];y!==void 0&&Os(y,h)}}function Di(o,i){o.setProperty("text-align",i)}function Qn(o,i){var l=Ir.theme.indent;if(typeof l=="string"){let h=o.classList.contains(l);0<i&&!h?o.classList.add(l):1>i&&h&&o.classList.remove(l)}l=getComputedStyle(o).getPropertyValue("--lexical-indent-base-value")||"40px",o.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${l})`)}function ul(o,i){o=o.style,i===0?Di(o,""):i===1?Di(o,"left"):i===2?Di(o,"center"):i===3?Di(o,"right"):i===4?Di(o,"justify"):i===5?Di(o,"start"):i===6&&Di(o,"end")}function yr(o,i,l){let h=Nn.get(o);h===void 0&&K(60);let y=h.createDOM(Ir,$n);var C=$n._keyToDOMMap;if(y["__lexicalKey_"+$n._key]=o,C.set(o,y),Ct(h)?y.setAttribute("data-lexical-text","true"):Cn(h)&&y.setAttribute("data-lexical-decorator","true"),Je(h)){if(o=h.__indent,C=h.__size,o!==0&&Qn(y,o),C!==0){--C,o=As(h,Nn);var v=Wn;Wn="",dl(o,h,0,C,y,null),fa(h,y),Wn=v}o=h.__format,o!==0&&ul(y,o),h.isInline()||fl(null,h,y),ln(h)&&(bn+=`
|
|
47
47
|
|
|
48
|
-
`,
|
|
48
|
+
`,ni+=`
|
|
49
49
|
|
|
50
|
-
`)}else C=h.getTextContent(),Cn(h)?(v=h.decorate($n,
|
|
50
|
+
`)}else C=h.getTextContent(),Cn(h)?(v=h.decorate($n,Ir),v!==null&&hl(o,v),y.contentEditable="false"):Ct(h)&&(h.isDirectionless()||(Wn+=C)),bn+=C,ni+=C;return i!==null&&(l!=null?i.insertBefore(y,l):(l=i.__lexicalLineBreak,l!=null?i.insertBefore(y,l):i.appendChild(y))),Pt(ri,ws,Yr,h,"created"),y}function dl(o,i,l,h,y,C){let v=bn;for(bn="";l<=h;++l)yr(o[l],y,C);ln(i)&&(bn+=`
|
|
51
51
|
|
|
52
|
-
`),y.__lexicalTextContent=bn,bn=v+bn}function
|
|
52
|
+
`),y.__lexicalTextContent=bn,bn=v+bn}function Ri(o,i){return o=i.get(o),ki(o)||Cn(o)&&o.isInline()}function fl(o,i,l){o=o!==null&&(o.__size===0||Ri(o.__last,sr)),i=i.__size===0||Ri(i.__last,Nn),o?i||(i=l.__lexicalLineBreak,i!=null&&l.removeChild(i),l.__lexicalLineBreak=null):i&&(i=document.createElement("br"),l.__lexicalLineBreak=i,l.appendChild(i))}function fa(o,i){var l=i.__lexicalDir;if(i.__lexicalDirTextContent!==Wn||l!==Mi){let C=Wn==="";if(C)var h=Mi;else h=Wn,h=Ae.test(h)?"rtl":ee.test(h)?"ltr":null;if(h!==l){let v=i.classList,X=Ir.theme;var y=l!==null?X[l]:void 0;let he=h!==null?X[h]:void 0;y!==void 0&&(typeof y=="string"&&(y=y.split(" "),y=X[l]=y),v.remove(...y)),h===null||C&&h==="ltr"?i.removeAttribute("dir"):(he!==void 0&&(typeof he=="string"&&(l=he.split(" "),he=X[h]=l),he!==void 0&&v.add(...he)),i.dir=h),al||(o.getWritable().__dir=h)}Mi=h,i.__lexicalDirTextContent=Wn,i.__lexicalDir=h}}function As(o,i){let l=[];for(o=o.__first;o!==null;){let h=i.get(o);h===void 0&&K(101),l.push(o),o=h.__next}return l}function bi(o,i){var l=sr.get(o),h=Nn.get(o);l!==void 0&&h!==void 0||K(61);var y=ll||xn.has(o)||cl.has(o);let C=Rn($n,o);if(l===h&&!y)return Je(l)?(h=C.__lexicalTextContent,h!==void 0&&(bn+=h,ni+=h),h=C.__lexicalDirTextContent,h!==void 0&&(Wn+=h)):(h=l.getTextContent(),Ct(l)&&!l.isDirectionless()&&(Wn+=h),ni+=h,bn+=h),C;if(l!==h&&y&&Pt(ri,ws,Yr,h,"updated"),h.updateDOM(l,C,Ir))return h=yr(o,null,null),i===null&&K(62),i.replaceChild(h,C),Os(o,null),h;if(Je(l)&&Je(h)){if(o=h.__indent,o!==l.__indent&&Qn(C,o),o=h.__format,o!==l.__format&&ul(C,o),y){o=Wn,Wn="",y=bn;var v=l.__size,X=h.__size;if(bn="",v===1&&X===1){var he=l.__first;if(i=h.__first,he===i)bi(he,C);else{var Me=Ms(he);i=yr(i,null,null),C.replaceChild(i,Me),Os(he,null)}}else{i=As(l,sr);var Ye=As(h,Nn);if(v===0)X!==0&&dl(Ye,h,0,X-1,C,null);else if(X===0)v!==0&&(he=C.__lexicalLineBreak==null,uo(i,0,v-1,he?null:C),he&&(C.textContent=""));else{var Xe=i;i=Ye,Ye=v-1,v=X-1;let Pe=C.firstChild,gt=0;for(X=0;gt<=Ye&&X<=v;){var Ke=Xe[gt];let Ot=i[X];if(Ke===Ot)Pe=fo(bi(Ot,C)),gt++,X++;else{he===void 0&&(he=new Set(Xe)),Me===void 0&&(Me=new Set(i));let Ft=Me.has(Ke),zt=he.has(Ot);Ft?(zt?(Ke=Rn($n,Ot),Ke===Pe?Pe=fo(bi(Ot,C)):(Pe!=null?C.insertBefore(Ke,Pe):C.appendChild(Ke),bi(Ot,C)),gt++):yr(Ot,C,Pe),X++):(Pe=fo(Ms(Ke)),Os(Ke,C),gt++)}}he=gt>Ye,Me=X>v,he&&!Me?(he=i[v+1],he=he===void 0?null:$n.getElementByKey(he),dl(i,h,X,v,C,he)):Me&&!he&&uo(Xe,gt,Ye,C)}}ln(h)&&(bn+=`
|
|
53
53
|
|
|
54
54
|
`),C.__lexicalTextContent=bn,bn=y+bn,fa(h,C),Wn=o,er(h)||h.isInline()||fl(l,h,C)}ln(h)&&(bn+=`
|
|
55
55
|
|
|
56
|
-
`,
|
|
56
|
+
`,ni+=`
|
|
57
57
|
|
|
58
|
-
`)}else l=h.getTextContent(),Cn(h)?(y=h.decorate($n,
|
|
58
|
+
`)}else l=h.getTextContent(),Cn(h)?(y=h.decorate($n,Ir),y!==null&&hl(o,y)):Ct(h)&&!h.isDirectionless()&&(Wn+=l),bn+=l,ni+=l;return!al&&er(h)&&h.__cachedText!==ni&&(h.getWritable().__cachedText=ni),C}function hl(o,i){let l=$n._pendingDecorators,h=$n._decorators;if(l===null){if(h[o]===i)return;l=tn($n)}l[o]=i}function fo(o){return o=o.nextSibling,o!==null&&o===$n._blockCursorElement&&(o=o.nextSibling),o}function Ms(o){let i=co.get(o);return i===void 0&&K(75,o),i}let Lr=Object.freeze({}),gl=[["keydown",bc],["pointerdown",Ac],["compositionstart",Ea],["compositionend",Rc],["input",Ca],["click",Oc],["cut",Lr],["copy",Lr],["dragstart",Lr],["dragover",Lr],["dragend",Lr],["paste",Lr],["focus",Lr],["blur",Lr],["drop",Lr]];J&&gl.push(["beforeinput",(o,i)=>Dc(o,i)]);let Ds=0,ha=0,ga=0,is=null,Rs=0,pl=!1,ml=!1,bs=!1,ks=!1,pa=[0,"",0,"root",0];function ma(o,i,l,h,y){let C=o.anchor,v=o.focus,X=C.getNode();var he=fn();let Me=Gr(he._window),Ye=Me!==null?Me.anchorNode:null,Xe=C.key;he=he.getElementByKey(Xe);let Ke=l.length;return Xe!==v.key||!Ct(X)||(!y&&(!J||ga<h+50)||X.isDirty()&&2>Ke||mi(l))&&C.offset!==v.offset&&!X.isComposing()||Ge(X)||X.isDirty()&&1<Ke||(y||!J)&&he!==null&&!X.isComposing()&&Ye!==ze(he)||Me!==null&&i!==null&&(!i.collapsed||i.startContainer!==Me.anchorNode||i.startOffset!==Me.anchorOffset)||X.getFormat()!==o.format||X.getStyle()!==o.style||Gt(o,X)}function _a(o,i){return o!==null&&o.nodeValue!==null&&o.nodeType===3&&i!==0&&i!==o.nodeValue.length}function ya(o,i,l){let{anchorNode:h,anchorOffset:y,focusNode:C,focusOffset:v}=o;pl&&(pl=!1,_a(h,y)&&_a(C,v))||Cr(i,()=>{if(!l)nn(null);else if(st(i,h,C)){var X=Vt();if(Dt(X)){var he=X.anchor,Me=he.getNode();if(X.isCollapsed()){o.type==="Range"&&o.anchorNode===o.focusNode&&(X.dirty=!0);var Ye=dn(i).event;Ye=Ye?Ye.timeStamp:performance.now();let[Ke,Pe,gt,Ot,Ft]=pa;var Xe=bt();if(Xe=i.isComposing()===!1&&Xe.getTextContent()==="",Ye<Ft+200&&he.offset===gt&&he.key===Ot)X.format=Ke,X.style=Pe;else if(he.type==="text"){if(!Ct(Me))throw Error("Point.getNode() must return TextNode when type is text");X.format=Me.getFormat(),X.style=Me.getStyle()}else he.type!=="element"||Xe||(X.format=0,X.style="")}else{he=255,Me=!1,Ye=X.getNodes(),Xe=Ye.length;for(let Ke=0;Ke<Xe;Ke++){let Pe=Ye[Ke];if(Ct(Pe)&&(Me=!0,he&=Pe.getFormat(),he===0))break}X.format=Me?he:0}}at(i,e,void 0)}})}function Oc(o,i){Cr(i,()=>{let l=Vt();var h=Gr(i._window);let y=Nr();if(h)if(Dt(l)){let v=l.anchor;var C=v.getNode();v.type==="element"&&v.offset===0&&l.isCollapsed()&&!er(C)&&bt().getChildrenSize()===1&&C.getTopLevelElementOrThrow().isEmpty()&&y!==null&&l.is(y)?(h.removeAllRanges(),l.dirty=!0):o.detail!==3||l.isCollapsed()||(h=l.focus.getNode(),C!==h&&(Je(C)?C.select(0):C.getParentOrThrow().select(0)))}else o.pointerType==="touch"&&(C=h.anchorNode,C!==null&&(C=C.nodeType,C===1||C===3))&&(h=zn(y,h,i,o),nn(h));at(i,t,o)})}function Ac(o,i){let l=o.target;o=o.pointerType,l instanceof Node&&o!=="touch"&&Cr(i,()=>{Cn(Kt(l))||(ml=!0)})}function Na(o){return o.getTargetRanges?(o=o.getTargetRanges(),o.length===0?null:o[0]):null}function Mc(o,i){return o!==i||Je(o)||Je(i)||!o.isToken()||!i.isToken()}function Dc(o,i){let l=o.inputType,h=Na(o);l==="deleteCompositionText"||H&&sn(i)||l!=="insertCompositionText"&&Cr(i,()=>{let y=Vt();if(l==="deleteContentBackward"){if(y===null){var C=Nr();if(!Dt(C))return;nn(C.clone())}if(Dt(y)){if(I&&ht(y.anchor.key),ha===229&&o.timeStamp<Ds+30&&i.isComposing()&&y.anchor.key===y.focus.key){if(ht(null),Ds=0,setTimeout(()=>{Cr(i,()=>{ht(null)})},30),Dt(y)){if(C=y.anchor.getNode(),C.markDirty(),y.format=C.getFormat(),!Ct(C))throw Error("Anchor node must be a TextNode");y.style=C.getStyle()}1>=y.anchor.getNode().getTextContent().length&&(o.preventDefault(),at(i,n,!0))}else ht(null),o.preventDefault(),at(i,n,!0);return}}if(Dt(y)){C=o.data,is!==null&&ot(!1,i,is),y.dirty&&is===null||!y.isCollapsed()||er(y.anchor.getNode())||h===null||y.applyDOMRange(h),is=null;var v=y.focus,X=y.anchor.getNode();if(v=v.getNode(),l==="insertText"||l==="insertTranspose")C===`
|
|
59
59
|
`?(o.preventDefault(),at(i,r,!1)):C===`
|
|
60
60
|
|
|
61
|
-
`?(o.preventDefault(),at(i,c,void 0)):C==null&&o.dataTransfer?(C=o.dataTransfer.getData("text/plain"),o.preventDefault(),y.insertRawText(C)):C!=null&&ma(y,h,C,o.timeStamp,!0)?(o.preventDefault(),at(i,d,C)):
|
|
62
|
-
`&&(l=Vt(),Dt(l))){i=l.focus,l.anchor.set(i.key,i.offset,i.type),at(o,G,null);return}}ot(!0,o,i)}function Rc(o,i){H?bs=!0:Cr(i,()=>{_l(i,o.data)})}function bc(o,i){if(Ms=o.timeStamp,ha=o.keyCode,!i.isComposing()){var{keyCode:l,shiftKey:h,ctrlKey:y,metaKey:C,altKey:v}=o;if(!at(i,z,o)){if(l!==39||y||C||v)if(l!==39||v||h||!y&&!C)if(l!==37||y||C||v)if(l!==37||v||h||!y&&!C)if(l!==38||y||C)if(l!==40||y||C)if(l===13&&h)Rs=!0,at(i,G,o);else if(l===32)at(i,q,o);else if(O&&y&&l===79)o.preventDefault(),Rs=!0,at(i,r,!0);else if(l!==13||h){var X=O?v||C?!1:l===8||l===72&&y:y||v||C?!1:l===8;X?l===8?at(i,le,o):(o.preventDefault(),at(i,n,!0)):l===27?at(i,se,o):(X=O?h||v||C?!1:l===46||l===68&&y:y||v||C?!1:l===46,X?l===46?at(i,ge,o):(o.preventDefault(),at(i,n,!1)):l===8&&(O?v:y)?(o.preventDefault(),at(i,N,!0)):l===46&&(O?v:y)?(o.preventDefault(),at(i,N,!1)):O&&C&&l===8?(o.preventDefault(),at(i,T,!0)):O&&C&&l===46?(o.preventDefault(),at(i,T,!1)):l===66&&!v&&(O?C:y)?(o.preventDefault(),at(i,R,"bold")):l===85&&!v&&(O?C:y)?(o.preventDefault(),at(i,R,"underline")):l===73&&!v&&(O?C:y)?(o.preventDefault(),at(i,R,"italic")):l!==9||v||y||C?l===90&&!h&&(O?C:y)?(o.preventDefault(),at(i,b,void 0)):(X=O?l===90&&C&&h:l===89&&y||l===90&&y&&h,X?(o.preventDefault(),at(i,k,void 0)):or(i._editorState._selection)?(X=h?!1:l===67?O?C:y:!1,X?(o.preventDefault(),at(i,Ee,o)):(X=h?!1:l===88?O?C:y:!1,X?(o.preventDefault(),at(i,ue,o)):l===65&&(O?C:y)&&(o.preventDefault(),at(i,$,o)))):!H&&l===65&&(O?C:y)&&(o.preventDefault(),at(i,$,o))):at(i,j,o))}else Rs=!1,at(i,G,o);else at(i,W,o);else at(i,F,o);else at(i,Q,o);else at(i,U,o);else at(i,x,o);else at(i,E,o);(y||h||v||C)&&at(i,ie,o)}}}function Ta(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let is=new Map;function xa(o){var i=o.target;let l=Ur(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(l!==null){var h=vt(l.anchorNode);if(h!==null){ml&&(ml=!1,Cr(h,()=>{var X=Nr(),he=l.anchorNode;he!==null&&(he=he.nodeType,he===1||he===3)&&(X=zn(X,l,h,o),nn(X))})),i=pe(h),i=i[i.length-1];var y=i._key,C=is.get(y),v=C||i;v!==h&&ya(l,v,!1),ya(l,h,!0),h!==i?is.set(y,h):C&&is.delete(y)}}}function kc(o,i){Ds===0&&o.ownerDocument.addEventListener("selectionchange",xa),Ds++,o.__lexicalEditor=i;let l=Ta(o);for(let h=0;h<gl.length;h++){let[y,C]=gl[h],v=typeof C=="function"?X=>{X._lexicalHandled!==!0&&(X._lexicalHandled=!0,i.isEditable()&&C(X,i))}:X=>{if(X._lexicalHandled!==!0&&(X._lexicalHandled=!0,i.isEditable()))switch(y){case"cut":return at(i,ue,X);case"copy":return at(i,Ee,X);case"paste":return at(i,g,X);case"dragstart":return at(i,V,X);case"dragover":return at(i,xe,X);case"dragend":return at(i,we,X);case"focus":return at(i,S,X);case"blur":return at(i,Y,X);case"drop":return at(i,B,X)}};o.addEventListener(y,v),l.push(()=>{o.removeEventListener(y,v)})}}function yl(o,i,l){Vn();var h=o.__key;let y=o.getParent();if(y!==null){var C=Vt();if(Dt(C)&&Je(o)){var{anchor:v,focus:X}=C,he=v.getNode(),Me=X.getNode();jn(he,o)&&v.set(o.__key,0,"element"),jn(Me,o)&&X.set(o.__key,0,"element")}if(he=C,Me=!1,Dt(he)&&i){C=he.anchor;let Ye=he.focus;C.key===h&&(as(C,o,y,o.getPreviousSibling(),o.getNextSibling()),Me=!0),Ye.key===h&&(as(Ye,o,y,o.getPreviousSibling(),o.getNextSibling()),Me=!0)}else or(he)&&i&&o.isSelected()&&o.selectPrevious();Dt(he)&&i&&!Me?(h=o.getIndexWithinParent(),Nt(o),Fn(he,y,h,-1)):Nt(o),l||ir(y)||y.canBeEmpty()||!y.isEmpty()||yl(y,i),i&&er(y)&&y.isEmpty()&&y.selectEnd()}}class ks{static getType(){K(64,this.name)}static clone(){K(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,_t(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=pt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let l=i.getNodes().some(h=>h.__key===this.__key);return Ct(this)?l:Dt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:l}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let l=0;for(;i!==null;){if(this.is(i))return l;l++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:pt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&K(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let l=i.getParent();if(ir(l)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=l}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&K(67,this.__key),i}getParents(){let i=[],l=this.getParent();for(;l!==null;)i.push(l),l=l.getParent();return i}getParentKeys(){let i=[],l=this.getParent();for(;l!==null;)i.push(l.__key),l=l.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:pt(i)}getPreviousSiblings(){let i=[];var l=this.getParent();if(l===null)return i;for(l=l.getFirstChild();l!==null&&!l.is(this);)i.push(l),l=l.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:pt(i)}getNextSiblings(){let i=[],l=this.getNextSibling();for(;l!==null;)i.push(l),l=l.getNextSibling();return i}getCommonAncestor(i){let l=this.getParents();var h=i.getParents();Je(this)&&l.unshift(this),Je(i)&&h.unshift(i),i=l.length;var y=h.length;if(i===0||y===0||l[i-1]!==h[y-1])return null;for(h=new Set(h),y=0;y<i;y++){let C=l[y];if(h.has(C))return C}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 l=this.getCommonAncestor(i);let h=this;for(;;){var y=h.getParentOrThrow();if(y===l){y=h.getIndexWithinParent();break}h=y}for(h=i;;){if(i=h.getParentOrThrow(),i===l){l=h.getIndexWithinParent();break}h=i}return y<l}isParentOf(i){let l=this.__key;if(l===i.__key)return!1;for(;i!==null;){if(i.__key===l)return!0;i=i.getParent()}return!1}getNodesBetween(i){let l=this.isBefore(i),h=[],y=new Set;for(var C=this;;){var v=C.__key;if(y.has(v)||(y.add(v),h.push(C)),C===i)break;if(v=Je(C)?l?C.getFirstChild():C.getLastChild():null,v!==null)C=v;else if(v=l?C.getNextSibling():C.getPreviousSibling(),v!==null)C=v;else{if(C=C.getParentOrThrow(),y.has(C.__key)||h.push(C),C===i)break;v=C;do v===null&&K(68),C=l?v.getNextSibling():v.getPreviousSibling(),v=v.getParent(),v!==null&&(C!==null||y.has(v.__key)||h.push(v));while(C===null)}}return l||h.reverse(),h}isDirty(){let i=fn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=pt(this.__key);return i===null&&K(113),i}getWritable(){Vn();var i=Pr(),l=fn();i=i._nodeMap;let h=this.__key,y=this.getLatest(),C=y.__parent;l=l._cloneNotNeeded;var v=Vt();return Ps(v)&&v.setCachedNodes(null),l.has(h)?(Et(y),y):(v=y.constructor.clone(y),v.__parent=C,v.__next=y.__next,v.__prev=y.__prev,Je(y)&&Je(v)?(v.__first=y.__first,v.__last=y.__last,v.__size=y.__size,v.__indent=y.__indent,v.__format=y.__format,v.__dir=y.__dir):Ct(y)&&Ct(v)&&(v.__format=y.__format,v.__style=y.__style,v.__mode=y.__mode,v.__detail=y.__detail),l.add(h),v.__key=h,Et(v),i.set(h,v),v)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){K(70)}updateDOM(){K(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){K(72)}static importJSON(){K(18,this.name)}static transform(){return null}remove(i){yl(this,!0,i)}replace(i,l){Vn();var h=Vt();h!==null&&(h=h.clone()),xs(this,i);let y=this.getLatest(),C=this.__key,v=i.__key,X=i.getWritable();i=this.getParentOrThrow().getWritable();let he=i.__size;Nt(X);let Me=y.getPreviousSibling(),Ye=y.getNextSibling(),Xe=y.__prev,Ke=y.__next,Pe=y.__parent;if(yl(y,!1,!0),Me===null?i.__first=v:Me.getWritable().__next=v,X.__prev=Xe,Ye===null?i.__last=v:Ye.getWritable().__prev=v,X.__next=Ke,X.__parent=Pe,i.__size=he,l){if(!Je(this)||!Je(X))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(gt=>{X.append(gt)})}return Dt(h)&&(nn(h),l=h.anchor,h=h.focus,l.key===C&&ri(l,X),h.key===C&&ri(h,X)),xt()===C&&ht(v),X}insertAfter(i,l=!0){Vn(),xs(this,i);var h=this.getWritable();let y=i.getWritable();var C=y.getParent();let v=Vt();var X=!1,he=!1;if(C!==null){var Me=i.getIndexWithinParent();Nt(y),Dt(v)&&(he=C.__key,X=v.anchor,C=v.focus,X=X.type==="element"&&X.key===he&&X.offset===Me+1,he=C.type==="element"&&C.key===he&&C.offset===Me+1)}C=this.getNextSibling(),Me=this.getParentOrThrow().getWritable();let Ye=y.__key,Xe=h.__next;return C===null?Me.__last=Ye:C.getWritable().__prev=Ye,Me.__size++,h.__next=Ye,y.__next=Xe,y.__prev=h.__key,y.__parent=h.__parent,l&&Dt(v)&&(l=this.getIndexWithinParent(),Fn(v,Me,l+1),h=Me.__key,X&&v.anchor.set(h,l+2,"element"),he&&v.focus.set(h,l+2,"element")),i}insertBefore(i,l=!0){Vn(),xs(this,i);var h=this.getWritable();let y=i.getWritable(),C=y.__key;Nt(y);let v=this.getPreviousSibling(),X=this.getParentOrThrow().getWritable(),he=h.__prev,Me=this.getIndexWithinParent();return v===null?X.__first=C:v.getWritable().__next=C,X.__size++,h.__prev=C,y.__prev=he,y.__next=h.__key,y.__parent=h.__parent,h=Vt(),l&&Dt(h)&&(l=this.getParentOrThrow(),Fn(h,l,Me)),i}isParentRequired(){return!1}createParentElementNode(){return Fr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,l){Vn();let h=this.getPreviousSibling(),y=this.getParentOrThrow();return h===null?y.select(0,0):Je(h)?h.select():Ct(h)?h.select(i,l):(i=h.getIndexWithinParent()+1,y.select(i,i))}selectNext(i,l){Vn();let h=this.getNextSibling(),y=this.getParentOrThrow();return h===null?y.select():Je(h)?h.select(0,0):Ct(h)?h.select(i,l):(i=h.getIndexWithinParent(),y.select(i,i))}markDirty(){this.getWritable()}}function Ic(o,i,l){l=l||i.getParentOrThrow().getLastChild();let h=i;for(i=[i];h!==l;){if(!h.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");h=h.getNextSibling(),i.push(h)}for(let y of i)o=o.insertAfter(y)}class Yr extends ks{static getType(){return"linebreak"}static clone(i){return new Yr(i.__key)}constructor(i){super(i)}getTextContent(){return`
|
|
63
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let l=i.parentElement,h,y;return l!==null&&((h=l.firstChild)===i||h.nextSibling===i&&h.nodeType===3&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((y=l.lastChild)===i||y.previousSibling===i&&y.nodeType===3&&(y.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Sa,priority:0}}}}static importJSON(){return
|
|
61
|
+
`?(o.preventDefault(),at(i,c,void 0)):C==null&&o.dataTransfer?(C=o.dataTransfer.getData("text/plain"),o.preventDefault(),y.insertRawText(C)):C!=null&&ma(y,h,C,o.timeStamp,!0)?(o.preventDefault(),at(i,d,C)):is=C,ga=o.timeStamp;else switch(o.preventDefault(),l){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":at(i,d,o);break;case"insertFromComposition":ht(null),at(i,d,o);break;case"insertLineBreak":ht(null),at(i,r,!1);break;case"insertParagraph":ht(null),bs&&!_e?(bs=!1,at(i,r,!1)):at(i,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":at(i,g,o);break;case"deleteByComposition":Mc(X,v)&&at(i,m,o);break;case"deleteByDrag":case"deleteByCut":at(i,m,o);break;case"deleteContent":at(i,n,!1);break;case"deleteWordBackward":at(i,N,!0);break;case"deleteWordForward":at(i,N,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":at(i,T,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":at(i,T,!1);break;case"formatStrikeThrough":at(i,R,"strikethrough");break;case"formatBold":at(i,R,"bold");break;case"formatItalic":at(i,R,"italic");break;case"formatUnderline":at(i,R,"underline");break;case"historyUndo":at(i,b,void 0);break;case"historyRedo":at(i,k,void 0)}}})}function Ca(o,i){o.stopPropagation(),Cr(i,()=>{var l=Vt(),h=o.data,y=Na(o);if(h!=null&&Dt(l)&&ma(l,y,h,o.timeStamp,!1)){ks&&(_l(i,h),ks=!1);var C=l.anchor,v=C.getNode();if(y=Gr(i._window),y===null)return;let X=C.offset;(C=J&&!l.isCollapsed()&&Ct(v)&&y.anchorNode!==null)&&(v=v.getTextContent().slice(0,X)+h+v.getTextContent().slice(X+l.focus.offset),y=y.anchorNode,C=v===(y.nodeType===3?y.nodeValue:null)),C||at(i,d,h),h=h.length,H&&1<h&&o.inputType==="insertCompositionText"&&!i.isComposing()&&(l.anchor.offset-=h),de||_e||D||!i.isComposing()||(Ds=0,ht(null))}else ot(!1,i,h!==null?h:void 0),ks&&(_l(i,h||void 0),ks=!1);Vn(),l=fn(),en(l)}),is=null}function Ea(o,i){Cr(i,()=>{let l=Vt();if(Dt(l)&&!i.isComposing()){let h=l.anchor,y=l.anchor.getNode();ht(h.key),(o.timeStamp<Ds+30||h.type==="element"||!l.isCollapsed()||y.getFormat()!==l.format||Ct(y)&&y.getStyle()!==l.style)&&at(i,d,ye)}})}function _l(o,i){var l=o._compositionKey;if(ht(null),l!==null&&i!=null){if(i===""){i=pt(l),o=ze(o.getElementByKey(l)),o!==null&&o.nodeValue!==null&&Ct(i)&&wt(i,o.nodeValue,null,null,!0);return}if(i[i.length-1]===`
|
|
62
|
+
`&&(l=Vt(),Dt(l))){i=l.focus,l.anchor.set(i.key,i.offset,i.type),at(o,G,null);return}}ot(!0,o,i)}function Rc(o,i){H?ks=!0:Cr(i,()=>{_l(i,o.data)})}function bc(o,i){if(Ds=o.timeStamp,ha=o.keyCode,!i.isComposing()){var{keyCode:l,shiftKey:h,ctrlKey:y,metaKey:C,altKey:v}=o;if(!at(i,z,o)){if(l!==39||y||C||v)if(l!==39||v||h||!y&&!C)if(l!==37||y||C||v)if(l!==37||v||h||!y&&!C)if(l!==38||y||C)if(l!==40||y||C)if(l===13&&h)bs=!0,at(i,G,o);else if(l===32)at(i,q,o);else if(O&&y&&l===79)o.preventDefault(),bs=!0,at(i,r,!0);else if(l!==13||h){var X=O?v||C?!1:l===8||l===72&&y:y||v||C?!1:l===8;X?l===8?at(i,le,o):(o.preventDefault(),at(i,n,!0)):l===27?at(i,se,o):(X=O?h||v||C?!1:l===46||l===68&&y:y||v||C?!1:l===46,X?l===46?at(i,ge,o):(o.preventDefault(),at(i,n,!1)):l===8&&(O?v:y)?(o.preventDefault(),at(i,N,!0)):l===46&&(O?v:y)?(o.preventDefault(),at(i,N,!1)):O&&C&&l===8?(o.preventDefault(),at(i,T,!0)):O&&C&&l===46?(o.preventDefault(),at(i,T,!1)):l===66&&!v&&(O?C:y)?(o.preventDefault(),at(i,R,"bold")):l===85&&!v&&(O?C:y)?(o.preventDefault(),at(i,R,"underline")):l===73&&!v&&(O?C:y)?(o.preventDefault(),at(i,R,"italic")):l!==9||v||y||C?l===90&&!h&&(O?C:y)?(o.preventDefault(),at(i,b,void 0)):(X=O?l===90&&C&&h:l===89&&y||l===90&&y&&h,X?(o.preventDefault(),at(i,k,void 0)):or(i._editorState._selection)?(X=h?!1:l===67?O?C:y:!1,X?(o.preventDefault(),at(i,Ee,o)):(X=h?!1:l===88?O?C:y:!1,X?(o.preventDefault(),at(i,ue,o)):l===65&&(O?C:y)&&(o.preventDefault(),at(i,$,o)))):!H&&l===65&&(O?C:y)&&(o.preventDefault(),at(i,$,o))):at(i,j,o))}else bs=!1,at(i,G,o);else at(i,W,o);else at(i,F,o);else at(i,Q,o);else at(i,U,o);else at(i,x,o);else at(i,E,o);(y||h||v||C)&&at(i,ie,o)}}}function Ta(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let ss=new Map;function xa(o){var i=o.target;let l=Gr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(l!==null){var h=vt(l.anchorNode);if(h!==null){ml&&(ml=!1,Cr(h,()=>{var X=Nr(),he=l.anchorNode;he!==null&&(he=he.nodeType,he===1||he===3)&&(X=zn(X,l,h,o),nn(X))})),i=pe(h),i=i[i.length-1];var y=i._key,C=ss.get(y),v=C||i;v!==h&&ya(l,v,!1),ya(l,h,!0),h!==i?ss.set(y,h):C&&ss.delete(y)}}}function kc(o,i){Rs===0&&o.ownerDocument.addEventListener("selectionchange",xa),Rs++,o.__lexicalEditor=i;let l=Ta(o);for(let h=0;h<gl.length;h++){let[y,C]=gl[h],v=typeof C=="function"?X=>{X._lexicalHandled!==!0&&(X._lexicalHandled=!0,i.isEditable()&&C(X,i))}:X=>{if(X._lexicalHandled!==!0&&(X._lexicalHandled=!0,i.isEditable()))switch(y){case"cut":return at(i,ue,X);case"copy":return at(i,Ee,X);case"paste":return at(i,g,X);case"dragstart":return at(i,V,X);case"dragover":return at(i,xe,X);case"dragend":return at(i,we,X);case"focus":return at(i,S,X);case"blur":return at(i,Y,X);case"drop":return at(i,B,X)}};o.addEventListener(y,v),l.push(()=>{o.removeEventListener(y,v)})}}function yl(o,i,l){Vn();var h=o.__key;let y=o.getParent();if(y!==null){var C=Vt();if(Dt(C)&&Je(o)){var{anchor:v,focus:X}=C,he=v.getNode(),Me=X.getNode();jn(he,o)&&v.set(o.__key,0,"element"),jn(Me,o)&&X.set(o.__key,0,"element")}if(he=C,Me=!1,Dt(he)&&i){C=he.anchor;let Ye=he.focus;C.key===h&&(cs(C,o,y,o.getPreviousSibling(),o.getNextSibling()),Me=!0),Ye.key===h&&(cs(Ye,o,y,o.getPreviousSibling(),o.getNextSibling()),Me=!0)}else or(he)&&i&&o.isSelected()&&o.selectPrevious();Dt(he)&&i&&!Me?(h=o.getIndexWithinParent(),Nt(o),Fn(he,y,h,-1)):Nt(o),l||ir(y)||y.canBeEmpty()||!y.isEmpty()||yl(y,i),i&&er(y)&&y.isEmpty()&&y.selectEnd()}}class Is{static getType(){K(64,this.name)}static clone(){K(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,_t(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=pt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let l=i.getNodes().some(h=>h.__key===this.__key);return Ct(this)?l:Dt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:l}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let l=0;for(;i!==null;){if(this.is(i))return l;l++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:pt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&K(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let l=i.getParent();if(ir(l)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=l}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&K(67,this.__key),i}getParents(){let i=[],l=this.getParent();for(;l!==null;)i.push(l),l=l.getParent();return i}getParentKeys(){let i=[],l=this.getParent();for(;l!==null;)i.push(l.__key),l=l.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:pt(i)}getPreviousSiblings(){let i=[];var l=this.getParent();if(l===null)return i;for(l=l.getFirstChild();l!==null&&!l.is(this);)i.push(l),l=l.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:pt(i)}getNextSiblings(){let i=[],l=this.getNextSibling();for(;l!==null;)i.push(l),l=l.getNextSibling();return i}getCommonAncestor(i){let l=this.getParents();var h=i.getParents();Je(this)&&l.unshift(this),Je(i)&&h.unshift(i),i=l.length;var y=h.length;if(i===0||y===0||l[i-1]!==h[y-1])return null;for(h=new Set(h),y=0;y<i;y++){let C=l[y];if(h.has(C))return C}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 l=this.getCommonAncestor(i);let h=this;for(;;){var y=h.getParentOrThrow();if(y===l){y=h.getIndexWithinParent();break}h=y}for(h=i;;){if(i=h.getParentOrThrow(),i===l){l=h.getIndexWithinParent();break}h=i}return y<l}isParentOf(i){let l=this.__key;if(l===i.__key)return!1;for(;i!==null;){if(i.__key===l)return!0;i=i.getParent()}return!1}getNodesBetween(i){let l=this.isBefore(i),h=[],y=new Set;for(var C=this;;){var v=C.__key;if(y.has(v)||(y.add(v),h.push(C)),C===i)break;if(v=Je(C)?l?C.getFirstChild():C.getLastChild():null,v!==null)C=v;else if(v=l?C.getNextSibling():C.getPreviousSibling(),v!==null)C=v;else{if(C=C.getParentOrThrow(),y.has(C.__key)||h.push(C),C===i)break;v=C;do v===null&&K(68),C=l?v.getNextSibling():v.getPreviousSibling(),v=v.getParent(),v!==null&&(C!==null||y.has(v.__key)||h.push(v));while(C===null)}}return l||h.reverse(),h}isDirty(){let i=fn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=pt(this.__key);return i===null&&K(113),i}getWritable(){Vn();var i=$r(),l=fn();i=i._nodeMap;let h=this.__key,y=this.getLatest(),C=y.__parent;l=l._cloneNotNeeded;var v=Vt();return $s(v)&&v.setCachedNodes(null),l.has(h)?(Et(y),y):(v=y.constructor.clone(y),v.__parent=C,v.__next=y.__next,v.__prev=y.__prev,Je(y)&&Je(v)?(v.__first=y.__first,v.__last=y.__last,v.__size=y.__size,v.__indent=y.__indent,v.__format=y.__format,v.__dir=y.__dir):Ct(y)&&Ct(v)&&(v.__format=y.__format,v.__style=y.__style,v.__mode=y.__mode,v.__detail=y.__detail),l.add(h),v.__key=h,Et(v),i.set(h,v),v)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){K(70)}updateDOM(){K(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){K(72)}static importJSON(){K(18,this.name)}static transform(){return null}remove(i){yl(this,!0,i)}replace(i,l){Vn();var h=Vt();h!==null&&(h=h.clone()),Ss(this,i);let y=this.getLatest(),C=this.__key,v=i.__key,X=i.getWritable();i=this.getParentOrThrow().getWritable();let he=i.__size;Nt(X);let Me=y.getPreviousSibling(),Ye=y.getNextSibling(),Xe=y.__prev,Ke=y.__next,Pe=y.__parent;if(yl(y,!1,!0),Me===null?i.__first=v:Me.getWritable().__next=v,X.__prev=Xe,Ye===null?i.__last=v:Ye.getWritable().__prev=v,X.__next=Ke,X.__parent=Pe,i.__size=he,l){if(!Je(this)||!Je(X))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(gt=>{X.append(gt)})}return Dt(h)&&(nn(h),l=h.anchor,h=h.focus,l.key===C&&ii(l,X),h.key===C&&ii(h,X)),xt()===C&&ht(v),X}insertAfter(i,l=!0){Vn(),Ss(this,i);var h=this.getWritable();let y=i.getWritable();var C=y.getParent();let v=Vt();var X=!1,he=!1;if(C!==null){var Me=i.getIndexWithinParent();Nt(y),Dt(v)&&(he=C.__key,X=v.anchor,C=v.focus,X=X.type==="element"&&X.key===he&&X.offset===Me+1,he=C.type==="element"&&C.key===he&&C.offset===Me+1)}C=this.getNextSibling(),Me=this.getParentOrThrow().getWritable();let Ye=y.__key,Xe=h.__next;return C===null?Me.__last=Ye:C.getWritable().__prev=Ye,Me.__size++,h.__next=Ye,y.__next=Xe,y.__prev=h.__key,y.__parent=h.__parent,l&&Dt(v)&&(l=this.getIndexWithinParent(),Fn(v,Me,l+1),h=Me.__key,X&&v.anchor.set(h,l+2,"element"),he&&v.focus.set(h,l+2,"element")),i}insertBefore(i,l=!0){Vn(),Ss(this,i);var h=this.getWritable();let y=i.getWritable(),C=y.__key;Nt(y);let v=this.getPreviousSibling(),X=this.getParentOrThrow().getWritable(),he=h.__prev,Me=this.getIndexWithinParent();return v===null?X.__first=C:v.getWritable().__next=C,X.__size++,h.__prev=C,y.__prev=he,y.__next=h.__key,y.__parent=h.__parent,h=Vt(),l&&Dt(h)&&(l=this.getParentOrThrow(),Fn(h,l,Me)),i}isParentRequired(){return!1}createParentElementNode(){return Br()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,l){Vn();let h=this.getPreviousSibling(),y=this.getParentOrThrow();return h===null?y.select(0,0):Je(h)?h.select():Ct(h)?h.select(i,l):(i=h.getIndexWithinParent()+1,y.select(i,i))}selectNext(i,l){Vn();let h=this.getNextSibling(),y=this.getParentOrThrow();return h===null?y.select():Je(h)?h.select(0,0):Ct(h)?h.select(i,l):(i=h.getIndexWithinParent(),y.select(i,i))}markDirty(){this.getWritable()}}function Ic(o,i,l){l=l||i.getParentOrThrow().getLastChild();let h=i;for(i=[i];h!==l;){if(!h.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");h=h.getNextSibling(),i.push(h)}for(let y of i)o=o.insertAfter(y)}class jr extends Is{static getType(){return"linebreak"}static clone(i){return new jr(i.__key)}constructor(i){super(i)}getTextContent(){return`
|
|
63
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let l=i.parentElement,h,y;return l!==null&&((h=l.firstChild)===i||h.nextSibling===i&&h.nodeType===3&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((y=l.lastChild)===i||y.previousSibling===i&&y.nodeType===3&&(y.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Sa,priority:0}}}}static importJSON(){return Vr()}exportJSON(){return{type:"linebreak",version:1}}}function Sa(){return{node:Vr()}}function Vr(){return _r(new jr)}function ki(o){return o instanceof jr}function Ii(o,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function ho(o,i){return i&1?"strong":i&2?"em":"span"}function Nl(o,i,l,h,y){o=h.classList,h=Bt(y,"base"),h!==void 0&&o.add(...h),h=Bt(y,"underlineStrikethrough");let C=!1,v=i&8&&i&4;var X=l&8&&l&4;h!==void 0&&(X?(C=!0,v||o.add(...h)):v&&o.remove(...h));for(let he in te)X=te[he],h=Bt(y,he),h!==void 0&&(l&X?!C||he!=="underline"&&he!=="strikethrough"?(!(i&X)||v&&he==="underline"||he==="strikethrough")&&o.add(...h):i&X&&o.remove(...h):i&X&&o.remove(...h))}function Li(o,i,l){let h=i.firstChild;if(l=l.isComposing(),o+=l?re:"",h==null)i.textContent=o;else if(i=h.nodeValue,i!==o)if(l||H){l=i.length;let y=o.length,C=0,v=0;for(;C<l&&C<y&&i[C]===o[C];)C++;for(;v+C<l&&v+C<y&&i[l-v-1]===o[y-v-1];)v++;o=[C,l-C-v,o.slice(C,y-v)];let[X,he,Me]=o;he!==0&&h.deleteData(X,he),h.insertData(X,Me)}else h.nodeValue=o}function os(o,i){return i=document.createElement(i),i.appendChild(o),i}class Pi extends Is{static getType(){return"text"}static clone(i){return new Pi(i.__text,i.__key)}constructor(i,l){super(l),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 Le[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=te[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,l){let h=this.getLatest().__format;return tt(h,i,l)}createDOM(i){var l=this.__format,h=Ii(this,l);let y=ho(this,l),C=document.createElement(h===null?y:h),v=C;return this.hasFormat("code")&&C.setAttribute("spellcheck","false"),h!==null&&(v=document.createElement(y),C.appendChild(v)),h=v,Li(this.__text,h,this),i=i.theme.text,i!==void 0&&Nl(y,0,l,h,i),l=this.__style,l!==""&&(C.style.cssText=l),C}updateDOM(i,l,h){let y=this.__text;var C=i.__format,v=this.__format,X=Ii(this,C);let he=Ii(this,v);var Me=ho(this,C);let Ye=ho(this,v);return(X===null?Me:X)!==(he===null?Ye:he)?!0:X===he&&Me!==Ye?(C=l.firstChild,C==null&&K(48),i=X=document.createElement(Ye),Li(y,i,this),h=h.theme.text,h!==void 0&&Nl(Ye,0,v,i,h),l.replaceChild(X,C),!1):(Me=l,he!==null&&X!==null&&(Me=l.firstChild,Me==null&&K(49)),Li(y,Me,this),h=h.theme.text,h!==void 0&&C!==v&&Nl(Ye,C,v,Me,h),v=this.__style,i.__style!==v&&(l.style.cssText=v),!1)}static importDOM(){return{"#text":()=>({conversion:ut,priority:0}),b:()=>({conversion:Cl,priority:0}),code:()=>({conversion:_i,priority:0}),em:()=>({conversion:_i,priority:0}),i:()=>({conversion:_i,priority:0}),s:()=>({conversion:_i,priority:0}),span:()=>({conversion:va,priority:0}),strong:()=>({conversion:_i,priority:0}),sub:()=>({conversion:_i,priority:0}),sup:()=>({conversion:_i,priority:0}),u:()=>({conversion:_i,priority:0})}}static importJSON(i){let l=Kn(i.text);return l.setFormat(i.format),l.setDetail(i.detail),l.setMode(i.mode),l.setStyle(i.style),l}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&ao(i)||K(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=os(i,"b")),this.hasFormat("italic")&&(i=os(i,"i")),this.hasFormat("strikethrough")&&(i=os(i,"s")),this.hasFormat("underline")&&(i=os(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 l=this.getWritable();return l.__format=typeof i=="string"?te[i]:i,l}setDetail(i){let l=this.getWritable();return l.__detail=typeof i=="string"?ce[i]:i,l}setStyle(i){let l=this.getWritable();return l.__style=i,l}toggleFormat(i){let l=this.getFormat();return i=tt(l,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 l=this.getWritable();return l.__mode=i,l}setTextContent(i){if(this.__text===i)return this;let l=this.getWritable();return l.__text=i,l}select(i,l){Vn();let h=Vt();var y=this.getTextContent();let C=this.__key;if(typeof y=="string"?(y=y.length,i===void 0&&(i=y),l===void 0&&(l=y)):l=i=0,Dt(h))y=xt(),y!==h.anchor.key&&y!==h.focus.key||ht(C),h.setTextNodeRange(this,i,this,l);else return xl(C,i,C,l,"text","text");return h}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,l,h,y){let C=this.getWritable(),v=C.__text,X=h.length,he=i;0>he&&(he=X+he,0>he&&(he=0));let Me=Vt();return y&&Dt(Me)&&(i+=X,Me.setTextNodeRange(C,i,C,i)),l=v.slice(0,he)+h+v.slice(he+l),C.__text=l,C}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Vn();var l=this.getLatest(),h=l.getTextContent(),y=l.__key,C=xt(),v=new Set(i);i=[];for(var X=h.length,he="",Me=0;Me<X;Me++)he!==""&&v.has(Me)&&(i.push(he),he=""),he+=h[Me];if(he!==""&&i.push(he),v=i.length,v===0)return[];if(i[0]===h)return[l];var Ye=i[0];h=l.getParentOrThrow(),Me=l.getFormat();let Xe=l.getStyle(),Ke=l.__detail;X=!1,l.isSegmented()?(he=Kn(Ye),he.__format=Me,he.__style=Xe,he.__detail=Ke,X=!0):(he=l.getWritable(),he.__text=Ye),l=Vt(),he=[he],Ye=Ye.length;for(let Ot=1;Ot<v;Ot++){var Pe=i[Ot],gt=Pe.length;Pe=Kn(Pe).getWritable(),Pe.__format=Me,Pe.__style=Xe,Pe.__detail=Ke;let Ft=Pe.__key;if(gt=Ye+gt,Dt(l)){let zt=l.anchor,Un=l.focus;zt.key===y&&zt.type==="text"&&zt.offset>Ye&&zt.offset<=gt&&(zt.key=Ft,zt.offset-=Ye,l.dirty=!0),Un.key===y&&Un.type==="text"&&Un.offset>Ye&&Un.offset<=gt&&(Un.key=Ft,Un.offset-=Ye,l.dirty=!0)}C===y&&ht(Ft),Ye=gt,he.push(Pe)}return y=this.getPreviousSibling(),C=this.getNextSibling(),y!==null&&Et(y),C!==null&&Et(C),y=h.getWritable(),C=this.getIndexWithinParent(),X?(y.splice(C,0,he),this.remove()):y.splice(C,1,he),Dt(l)&&Fn(l,h,C,v-1),he}mergeWithSibling(i){var l=i===this.getPreviousSibling();l||i===this.getNextSibling()||K(50);var h=this.__key;let y=i.__key,C=this.__text,v=C.length;xt()===y&&ht(h);let X=Vt();if(Dt(X)){let he=X.anchor,Me=X.focus;he!==null&&he.key===y&&(Bs(he,l,h,i,v),X.dirty=!0),Me!==null&&Me.key===y&&(Bs(Me,l,h,i,v),X.dirty=!0)}return h=i.__text,this.setTextContent(l?h+C:C+h),l=this.getWritable(),i.remove(),l}isTextEntity(){return!1}}function va(o){let i=o.style.fontWeight==="700",l=o.style.textDecoration==="line-through",h=o.style.fontStyle==="italic",y=o.style.textDecoration==="underline",C=o.style.verticalAlign;return{forChild:v=>(Ct(v)&&(i&&v.toggleFormat("bold"),l&&v.toggleFormat("strikethrough"),h&&v.toggleFormat("italic"),y&&v.toggleFormat("underline"),C==="sub"&&v.toggleFormat("subscript"),C==="super"&&v.toggleFormat("superscript")),v),node:null}}function Cl(o){let i=o.style.fontWeight==="normal";return{forChild:l=>(Ct(l)&&!i&&l.toggleFormat("bold"),l),node:null}}let El=new WeakMap;function ut(o){o.parentElement===null&&K(129);for(var i=o.textContent||"",l,h=o.parentNode,y=[o];h!==null&&(l=El.get(h))===void 0&&!(h.nodeName==="PRE"||h.nodeType===1&&h.style!==void 0&&h.style.whiteSpace!==void 0&&h.style.whiteSpace.startsWith("pre"));)y.push(h),h=h.parentNode;for(l=l===void 0?h:l,h=0;h<y.length;h++)El.set(y[h],l);if(l!==null){for(i=i.split(/(\r?\n|\t)/),o=[],y=i.length,l=0;l<y;l++)h=i[l],h===`
|
|
64
64
|
`||h===`\r
|
|
65
|
-
`?o.push(
|
|
66
|
-
`),Ye=!Ke.isEmpty();else if(Ye=!1,Ct(Ke)){let Pe=Ke.getTextContent();Ke===l?Ke===h?(y.type!=="element"||C.type!=="element"||C.offset===y.offset)&&(Pe=X<he?Pe.slice(X,he):Pe.slice(he,X)):Pe=v?Pe.slice(X):Pe.slice(he):Ke===h&&(Pe=v?Pe.slice(0,he):Pe.slice(0,X)),Me+=Pe}else!Cn(Ke)&&!
|
|
65
|
+
`?o.push(Vr()):h===" "?o.push($i()):h!==""&&o.push(Kn(h));return{node:o}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(y=o,l=!0;y!==null&&(y=Ls(y,!1))!==null;)if(h=y.textContent||"",0<h.length){/[ \t\n]$/.test(h)&&(i=i.slice(1)),l=!1;break}l&&(i=i.slice(1))}if(i[i.length-1]===" "){for(y=!0;o!==null&&(o=Ls(o,!0))!==null;)if(0<(o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){y=!1;break}y&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Kn(i)}}let go=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 Ls(o,i){for(;;){for(var l=void 0;(l=i?o.nextSibling:o.previousSibling)===null;)if(o=o.parentElement,o===null)return null;if(o=l,o.nodeType===1&&(l=o.style.display,l===""&&o.nodeName.match(go)===null||l!==""&&!l.startsWith("inline")))return null;for(;(l=i?o.firstChild:o.lastChild)!==null;)o=l;if(o.nodeType===3)return o;if(o.nodeName==="BR")return null}}let po={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function _i(o){let i=po[o.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:l=>(Ct(l)&&!l.hasFormat(i)&&l.toggleFormat(i),l),node:null}}function Kn(o=""){return _r(new Pi(o))}function Ct(o){return o instanceof Pi}class ls extends Pi{static getType(){return"tab"}static clone(i){let l=new ls(i.__key);return l.__text=i.__text,l.__format=i.__format,l.__style=i.__style,l}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let l=$i();return l.setFormat(i.format),l.setStyle(i.style),l}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){K(126)}setDetail(){K(127)}setMode(){K(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function $i(){return _r(new ls)}function wa(o){return o instanceof ls}class mo{constructor(i,l,h){this._selection=null,this.key=i,this.offset=l,this.type=h}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let l=this.getNode(),h=i.getNode(),y=this.offset;if(i=i.offset,Je(l)){var C=l.getDescendantByIndex(y);l=C??l}return Je(h)&&(C=h.getDescendantByIndex(i),h=C??h),l===h?y<i:l.isBefore(h)}getNode(){let i=pt(this.key);return i===null&&K(20),i}set(i,l,h){let y=this._selection,C=this.key;this.key=i,this.offset=l,this.type=h,ds()||(xt()===C&&ht(i),y!==null&&(y.setCachedNodes(null),y.dirty=!0))}}function Pr(o,i,l){return new mo(o,i,l)}function _o(o,i){let l=i.__key,h=o.offset,y="element";if(Ct(i))y="text",i=i.getTextContentSize(),h>i&&(h=i);else if(!Je(i)){var C=i.getNextSibling();Ct(C)?(l=C.__key,h=0,y="text"):(C=i.getParent())&&(l=C.__key,h=i.getIndexWithinParent()+1)}o.set(l,h,y)}function ii(o,i){if(Je(i)){let l=i.getLastDescendant();Je(l)||Ct(l)?_o(o,l):_o(o,i)}else _o(o,i)}function Tl(o,i,l,h){let y=o.getNode(),C=y.getChildAtIndex(o.offset),v=Kn(),X=er(y)?Br().append(v):v;v.setFormat(l),v.setStyle(h),C===null?y.append(X):C.insertBefore(X),o.is(i)&&i.set(v.__key,0,"text"),o.set(v.__key,0,"text")}function vr(o,i,l,h){o.key=i,o.offset=l,o.type=h}class Ps{constructor(i,l){this.anchor=i,this.focus=l,i._selection=this,l._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return $s(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 No(this)}}class yo{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!or(i))return!1;let l=this._nodes,h=i._nodes;return l.size===h.size&&Array.from(l).every(y=>h.has(y))}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 yo(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let l=this.getNodes(),h=l.length;var y=l[h-1];if(Ct(y))y=y.select();else{let C=y.getIndexWithinParent()+1;y=y.getParentOrThrow().select(C,C)}for(y.insertNodes(i),i=0;i<h;i++)l[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var l=this._nodes;i=[];for(let h of l)l=pt(h),l!==null&&i.push(l);return ds()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),l="";for(let h=0;h<i.length;h++)l+=i[h].getTextContent();return l}}function Dt(o){return o instanceof yi}function $s(o){return o instanceof Ps}class yi extends Ps{constructor(i,l,h,y){super(i,l),this.format=h,this.style=y}is(i){return Dt(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 l=this.focus,h=i.isBefore(l),y=h?i:l;h=h?l:i,i=y.getNode(),l=h.getNode();let C=y.offset;return y=h.offset,Je(i)&&(h=i.getDescendantByIndex(C),i=h??i),Je(l)&&(h=l.getDescendantByIndex(y),h!==null&&h!==i&&l.getChildAtIndex(y)===h&&(h=h.getPreviousSibling()),l=h??l),i=i.is(l)?Je(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(l),ds()||(this._cachedNodes=i),i}setTextNodeRange(i,l,h,y){vr(this.anchor,i.__key,l,"text"),vr(this.focus,h.__key,y,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let l=i[0],h=i[i.length-1],y=this.anchor,C=this.focus,v=y.isBefore(C),[X,he]=No(this),Me="",Ye=!0;for(let Xe=0;Xe<i.length;Xe++){let Ke=i[Xe];if(Je(Ke)&&!Ke.isInline())Ye||(Me+=`
|
|
66
|
+
`),Ye=!Ke.isEmpty();else if(Ye=!1,Ct(Ke)){let Pe=Ke.getTextContent();Ke===l?Ke===h?(y.type!=="element"||C.type!=="element"||C.offset===y.offset)&&(Pe=X<he?Pe.slice(X,he):Pe.slice(he,X)):Pe=v?Pe.slice(X):Pe.slice(he):Ke===h&&(Pe=v?Pe.slice(0,he):Pe.slice(0,X)),Me+=Pe}else!Cn(Ke)&&!ki(Ke)||Ke===h&&this.isCollapsed()||(Me+=Ke.getTextContent())}return Me}applyDOMRange(i){let l=fn(),h=l.getEditorState()._selection;if(i=Ma(i.startContainer,i.startOffset,i.endContainer,i.endOffset,l,h),i!==null){var[y,C]=i;vr(this.anchor,y.key,y.offset,y.type),vr(this.focus,C.key,C.offset,C.type),this._cachedNodes=null}}clone(){let i=this.anchor,l=this.focus;return new yi(Pr(i.key,i.offset,i.type),Pr(l.key,l.offset,l.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&te[i])!==0}insertRawText(i){i=i.split(/(\r?\n|\t)/);let l=[],h=i.length;for(let y=0;y<h;y++){let C=i[y];C===`
|
|
67
67
|
`||C===`\r
|
|
68
|
-
`?l.push(jr()):C===" "?l.push(Pi()):l.push(Kn(C))}this.insertNodes(l)}insertText(i){var l=this.anchor,h=this.focus,y=this.isCollapsed()||l.isBefore(h),C=this.format,v=this.style;y&&l.type==="element"?Tl(l,h,C,v):y||h.type!=="element"||Tl(h,l,C,v);var X=this.getNodes(),he=X.length,Me=y?h:l;h=(y?l:h).offset;var Ye=Me.offset;l=X[0],Ct(l)||K(26),y=l.getTextContent().length;var Xe=l.getParentOrThrow(),Ke=X[he-1];if(this.isCollapsed()&&h===y&&(l.isSegmented()||l.isToken()||!l.canInsertTextAfter()||!Xe.canInsertTextAfter()&&l.getNextSibling()===null)){var Pe=l.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ge(Pe)||(Pe=Kn(),Pe.setFormat(C),Xe.canInsertTextAfter()?l.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),l=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&h===0&&(l.isSegmented()||l.isToken()||!l.canInsertTextBefore()||!Xe.canInsertTextBefore()&&l.getPreviousSibling()===null)){if(Pe=l.getPreviousSibling(),(!Ct(Pe)||Ge(Pe))&&(Pe=Kn(),Pe.setFormat(C),Xe.canInsertTextBefore()?l.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),l=Pe,i!==""){this.insertText(i);return}}else if(l.isSegmented()&&h!==y)Xe=Kn(l.getTextContent()),Xe.setFormat(C),l.replace(Xe),l=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),Co(this.anchor,this.focus,null),this.insertText(i);return}if(he===1)if(l.isToken())i=Kn(i),i.select(),l.replace(i);else{if(X=l.getFormat(),he=l.getStyle(),h===Ye&&(X!==C||he!==v))if(l.getTextContent()==="")l.setFormat(C),l.setStyle(v);else{X=Kn(i),X.setFormat(C),X.setStyle(v),X.select(),h===0?l.insertBefore(X,!1):([he]=l.splitText(h),he.insertAfter(X,!1)),X.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(wa(l)){i=Kn(i),i.setFormat(C),i.setStyle(v),i.select(),l.replace(i);return}l=l.spliceText(h,Ye-h,i,!0),l.getTextContent()===""?l.remove():this.anchor.type==="text"&&(l.isComposing()?this.anchor.offset-=i.length:(this.format=X,this.style=he))}else{if(C=new Set([...l.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(l)?l:l.getParentOrThrow(),v=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(v)&&v.isInline())do Xe=v,v=v.getParentOrThrow();while(v.isInline());if(Me.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||Me.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var gt=Kn(Ke.getTextContent());Ke.replace(gt),Ke=gt}er(Me.getNode())||Me.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),C.add(Ke.__key)}else Me=Ke.getParentOrThrow(),Me.canBeEmpty()||Me.getChildrenSize()!==1?Ke.remove():Me.remove();else C.add(Ke.__key);for(Me=v.getChildren(),Ye=new Set(X),Ke=Pe.is(v),Pe=Pe.isInline()&&l.getNextSibling()===null?Pe:l,gt=Me.length-1;0<=gt;gt--){let Ot=Me[gt];if(Ot.is(l)||Je(Ot)&&Ot.isParentOf(l))break;Ot.isAttached()&&(!Ye.has(Ot)||Ot.is(Xe)?Ke||Pe.insertAfter(Ot,!1):Ot.remove())}if(!Ke)for(Me=v,v=null;Me!==null;)Ye=Me.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(v))&&(C.delete(Me.__key),v=Me),Me=Me.getParent();for(l.isToken()?h===y?l.select():(i=Kn(i),i.select(),l.replace(i)):(l=l.spliceText(h,y-h,i,!0),l.getTextContent()===""?l.remove():l.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<he;i++)l=X[i],C.has(l.__key)||l.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),ht(null);else{var l=this.getNodes(),h=[];for(var y of l)Ct(y)&&h.push(y);var C=h.length;if(C===0)this.toggleFormat(i),ht(null);else{y=this.anchor;var v=this.focus,X=this.isBackward();l=X?v:y,y=X?y:v;var he=0,Me=h[0];if(v=l.type==="element"?0:l.offset,l.type==="text"&&v===Me.getTextContentSize()&&(he=1,Me=h[1],v=0),Me!=null){X=Me.getFormatFlags(i,null);var Ye=C-1,Xe=h[Ye];if(C=y.type==="text"?y.offset:Xe.getTextContentSize(),Me.is(Xe))v!==C&&(v===0&&C===Me.getTextContentSize()?Me.setFormat(X):(i=Me.splitText(v,C),i=v===0?i[0]:i[1],i.setFormat(X),l.type==="text"&&l.set(i.__key,0,"text"),y.type==="text"&&y.set(i.__key,C-v,"text")),this.format=X);else{v!==0&&([,Me]=Me.splitText(v),v=0),Me.setFormat(X);var Ke=Xe.getFormatFlags(i,X);for(0<C&&(C!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(C)),Xe.setFormat(Ke)),he+=1;he<Ye;he++){let Pe=h[he];if(!Pe.isToken()){let gt=Pe.getFormatFlags(i,Ke);Pe.setFormat(gt)}}l.type==="text"&&l.set(Me.__key,v,"text"),y.type==="text"&&y.set(Xe.__key,C,"text"),this.format=X|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var l=Vt();if(!Dt(l))throw Error("Expected RangeSelection after insertParagraph");return l.insertNodes(i)}var h=Ss(this.anchor.getNode(),ts);if(l=i[i.length-1],"__language"in h&&Je(h))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var y=Hs(this);h.splice(y,0,i),l.selectEnd()}else if(i.some(X=>(Je(X)||Cn(X))&&!X.isInline())){l=Fi(i),i=l.getLastDescendant();var C=l.getChildren();l=Je(h)&&h.isEmpty()?null:this.insertParagraph(),y=C[C.length-1];var v=C[0];if((X=>Je(X)&&ts(X)&&!X.isEmpty()&&Je(h)&&(!h.isEmpty()||"__value"in h&&"__checked"in h))(v)){if(!Je(h))throw Error("Expected 'firstBlock' to be an ElementNode");h.append(...v.getChildren()),v=C[1]}v&&Ic(h,v),C=Ss(i,ts),l&&Je(C)&&("__value"in l&&"__checked"in l||ts(y))&&(C.append(...l.getChildren()),l.remove()),Je(h)&&h.isEmpty()&&h.remove(),i.selectEnd(),i=Je(h)?h.getLastChild():null,bi(i)&&C!==h&&i.remove()}else{if(!Je(h))throw Error("Expected 'firstBlock' to be an ElementNode");y=Hs(this),h.splice(y,0,i),l.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Fr();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var l=Hs(this);if(i=Ss(this.anchor.getNode(),ts),!Je(i))throw Error("Expected ancestor to be an ElementNode");return l=(l=i.getChildAtIndex(l))?[l,...l.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...l),i.selectStart(),i):null}insertLineBreak(i){var l=jr();this.insertNodes([l]),i&&(i=l.getParentOrThrow(),l=l.getIndexWithinParent(),i.select(l,l))}extract(){var i=this.getNodes(),l=i.length,h=l-1,y=this.anchor;let C=this.focus;var v=i[0];let X=i[h],[he,Me]=No(this);return l===0?[]:l===1?Ct(v)&&!this.isCollapsed()?(i=he>Me?Me:he,h=v.splitText(i,he>Me?he:Me),i=i===0?h[0]:h[1],i!=null?[i]:[]):[v]:(l=y.isBefore(C),Ct(v)&&(y=l?he:Me,y===v.getTextContentSize()?i.shift():y!==0&&([,v]=v.splitText(y),i[0]=v)),Ct(X)&&(v=X.getTextContent().length,l=l?Me:he,l===0?i.pop():l!==v&&([X]=X.splitText(l),i[h]=X)),i)}modify(i,l,h){var y=this.focus,C=this.anchor,v=i==="move",X=Ht(y,l);if(Cn(X)&&!X.isIsolated())v&&X.isKeyboardSelectable()?(l=Sl(),l.add(X.__key),nn(l)):(i=l?X.getPreviousSibling():X.getNextSibling(),Ct(i)?(X=i.__key,l=l?i.getTextContent().length:0,y.set(X,l,"text"),v&&C.set(X,l,"text")):(h=X.getParentOrThrow(),Je(i)?(h=i.__key,X=l?i.getChildrenSize():0):(X=X.getIndexWithinParent(),h=h.__key,l||X++),y.set(h,X,"element"),v&&C.set(h,X,"element")));else if(C=fn(),y=Ur(C._window)){var he=C._blockCursorElement,Me=C._rootElement;if(Me===null||he===null||!Je(X)||X.isInline()||X.canBeEmpty()||sl(he,C,Me),y.modify(i,l?"backward":"forward",h),0<y.rangeCount&&(X=y.getRangeAt(0),C=this.anchor.getNode(),C=er(C)?C:rr(C),this.applyDOMRange(X),this.dirty=!0,!v)){for(v=this.getNodes(),i=[],h=!1,he=0;he<v.length;he++)Me=v[he],jn(Me,C)?i.push(Me):h=!0;h&&0<i.length&&(l?(l=i[0],Je(l)?l.selectStart():l.getParentOrThrow().selectStart()):(l=i[i.length-1],Je(l)?l.selectEnd():l.getParentOrThrow().selectEnd())),(y.anchorNode!==X.startContainer||y.anchorOffset!==X.startOffset)&&(l=this.focus,v=this.anchor,y=v.key,X=v.offset,C=v.type,vr(v,l.key,l.offset,l.type),vr(l,y,X,C),this._cachedNodes=null)}}}deleteCharacter(i){let l=this.isCollapsed();if(this.isCollapsed()){var h=this.anchor,y=this.focus,C=h.getNode();if(!i&&(h.type==="element"&&Je(C)&&h.offset===C.getChildrenSize()||h.type==="text"&&h.offset===C.getTextContentSize())){var v=C.getParent();if(v=C.getNextSibling()||(v===null?null:v.getNextSibling()),Je(v)&&v.isShadowRoot())return}if(v=Ht(y,i),Cn(v)&&!v.isIsolated()){v.isKeyboardSelectable()&&Je(C)&&C.getChildrenSize()===0?(C.remove(),i=Sl(),i.add(v.__key),nn(i)):(v.remove(),fn().dispatchCommand(e,void 0));return}if(!i&&Je(v)&&Je(C)&&C.isEmpty()){C.remove(),v.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(v=y.type==="text"?y.getNode():null,C=h.type==="text"?h.getNode():null,v!==null&&v.isSegmented()){if(h=y.offset,y=v.getTextContentSize(),v.is(C)||i&&h!==y||!i&&h!==0){Aa(v,i,h);return}}else if(C!==null&&C.isSegmented()&&(h=h.offset,y=C.getTextContentSize(),C.is(v)||i&&h!==0||!i&&h!==y)){Aa(C,i,h);return}if(C=this.anchor,v=this.focus,h=C.getNode(),y=v.getNode(),h===y&&C.type==="text"&&v.type==="text"){var X=C.offset,he=v.offset;let Me=X<he;y=Me?X:he,he=Me?he:X,X=he-1,y!==X&&(h=h.getTextContent().slice(y,he),pi(h)||(i?v.offset=X:C.offset=X))}}}this.removeText(),i&&!l&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&er(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 or(o){return o instanceof yo}function Oa(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function No(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]:[Oa(i),Oa(o)]}function Aa(o,i,l){let h=o.getTextContent().split(/(?=\s)/g),y=h.length,C=0,v=0;for(let X=0;X<y;X++){let he=h[X],Me=X===y-1;if(v=C,C+=he.length,i&&C===l||C>l||Me){h.splice(X,1),Me&&(v=void 0);break}}i=h.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(v,v))}function $s(o,i,l,h){var y=i;if(o.nodeType===1){let X=!1;var C=o.childNodes,v=C.length;y===v&&(X=!0,y=v-1);let he=C[y];if(v=!1,he===h._blockCursorElement?(he=C[y+1],v=!0):h._blockCursorElement!==null&&y--,h=Sr(he),Ct(h))y=X?h.getTextContentSize():0;else{if(C=Sr(o),C===null)return null;if(Je(C)?(o=C.getChildAtIndex(y),(i=Je(o))&&(i=o.getParent(),i=l===null||i===null||!i.canBeEmpty()||i!==l.getNode()),i&&(l=X?o.getLastDescendant():o.getFirstDescendant(),l===null?(C=o,y=0):(o=l,C=Je(o)?o:o.getParentOrThrow())),Ct(o)?(h=o,C=null,y=X?o.getTextContentSize():0):o!==C&&X&&!v&&y++):(y=C.getIndexWithinParent(),y=i===0&&Cn(C)&&Sr(o)===C?y:y+1,C=C.getParentOrThrow()),Je(C))return Lr(C.__key,y,"element")}}else h=Sr(o);return Ct(h)?Lr(h.__key,y,"text"):null}function $i(o,i,l){var h=o.offset,y=o.getNode();h===0?(h=y.getPreviousSibling(),y=y.getParent(),i?(l||!i)&&h===null&&Je(y)&&y.isInline()&&(i=y.getPreviousSibling(),Ct(i)&&(o.key=i.__key,o.offset=i.getTextContent().length)):Je(h)&&!l&&h.isInline()?(o.key=h.__key,o.offset=h.getChildrenSize(),o.type="element"):Ct(h)&&(o.key=h.__key,o.offset=h.getTextContent().length)):h===y.getTextContent().length&&(h=y.getNextSibling(),y=y.getParent(),i&&Je(h)&&h.isInline()?(o.key=h.__key,o.offset=0,o.type="element"):(l||i)&&h===null&&Je(y)&&y.isInline()&&!y.canInsertTextAfter()&&(i=y.getNextSibling(),Ct(i)&&(o.key=i.__key,o.offset=0)))}function Co(o,i,l){if(o.type==="text"&&i.type==="text"){var h=o.isBefore(i);let y=o.is(i);$i(o,h,y),$i(i,!h,y),y&&(i.key=o.key,i.offset=o.offset,i.type=o.type),h=fn(),h.isComposing()&&h._compositionKey!==o.key&&Dt(l)&&(h=l.anchor,l=l.focus,vr(o,h.key,h.offset,h.type),vr(i,l.key,l.offset,l.type))}}function Ma(o,i,l,h,y,C){return o===null||l===null||!st(y,o,l)||(i=$s(o,i,Dt(C)?C.anchor:null,y),i===null)||(h=$s(l,h,Dt(C)?C.focus:null,y),h===null||i.type==="element"&&h.type==="element"&&(o=Sr(o),l=Sr(l),Cn(o)&&Cn(l)))?null:(Co(i,h,C),[i,h])}function xl(o,i,l,h,y,C){let v=Pr();return o=new _i(Lr(o,i,y),Lr(l,h,C),0,""),o.dirty=!0,v._selection=o}function Sl(){return new yo(new Set)}function kn(o){let i=o.getEditorState()._selection,l=Ur(o._window);return Dt(i)||i==null?zn(i,l,o,null):i.clone()}function zn(o,i,l,h){var y=l._window;if(y===null)return null;var C=(y=h||y.event)?y.type:void 0;h=C==="selectionchange",y=!Fe&&(h||C==="beforeinput"||C==="compositionstart"||C==="compositionend"||C==="click"&&y&&y.detail===3||C==="drop"||C===void 0);let v;if(!Dt(o)||y){if(i===null)return null;if(y=i.anchorNode,C=i.focusNode,v=i.anchorOffset,i=i.focusOffset,h&&Dt(o)&&!st(l,y,C))return o.clone()}else return o.clone();if(l=Ma(y,v,C,i,l,o),l===null)return null;let[X,he]=l;return new _i(X,he,Dt(o)?o.format:0,Dt(o)?o.style:"")}function Vt(){return Pr()._selection}function Nr(){return fn()._editorState._selection}function Fn(o,i,l,h=1){var y=o.anchor,C=o.focus,v=y.getNode(),X=C.getNode();if(i.is(v)||i.is(X)){if(v=i.__key,o.isCollapsed())i=y.offset,(l<=i&&0<h||l<i&&0>h)&&(l=Math.max(0,i+h),y.set(v,l,"element"),C.set(v,l,"element"),ls(o));else{let Me=o.isBackward();X=Me?C:y;var he=X.getNode();y=Me?y:C,C=y.getNode(),i.is(he)&&(he=X.offset,(l<=he&&0<h||l<he&&0>h)&&X.set(v,Math.max(0,he+h),"element")),i.is(C)&&(i=y.offset,(l<=i&&0<h||l<i&&0>h)&&y.set(v,Math.max(0,i+h),"element"))}ls(o)}}function ls(o){var i=o.anchor,l=i.offset;let h=o.focus;var y=h.offset,C=i.getNode(),v=h.getNode();if(o.isCollapsed())Je(C)&&(v=C.getChildrenSize(),v=(y=l>=v)?C.getChildAtIndex(v-1):C.getChildAtIndex(l),Ct(v)&&(l=0,y&&(l=v.getTextContentSize()),i.set(v.__key,l,"text"),h.set(v.__key,l,"text")));else{if(Je(C)){let X=C.getChildrenSize();l=(o=l>=X)?C.getChildAtIndex(X-1):C.getChildAtIndex(l),Ct(l)&&(C=0,o&&(C=l.getTextContentSize()),i.set(l.__key,C,"text"))}Je(v)&&(l=v.getChildrenSize(),y=(i=y>=l)?v.getChildAtIndex(l-1):v.getChildAtIndex(y),Ct(y)&&(v=0,i&&(v=y.getTextContentSize()),h.set(y.__key,v,"text")))}}function Da(o,i){if(i=i.getEditorState()._selection,o=o._selection,Dt(o)){var l=o.anchor;let h=o.focus,y;l.type==="text"&&(y=l.getNode(),y.selectionTransform(i,o)),h.type==="text"&&(l=h.getNode(),y!==l&&l.selectionTransform(i,o))}}function as(o,i,l,h,y){let C=null,v=0,X=null;h!==null?(C=h.__key,Ct(h)?(v=h.getTextContentSize(),X="text"):Je(h)&&(v=h.getChildrenSize(),X="element")):y!==null&&(C=y.__key,Ct(y)?X="text":Je(y)&&(X="element")),C!==null&&X!==null?o.set(C,v,X):(v=i.getIndexWithinParent(),v===-1&&(v=l.getChildrenSize()),o.set(l.__key,v,"element"))}function Fs(o,i,l,h,y){o.type==="text"?(o.key=l,i||(o.offset+=y)):o.offset>h.getIndexWithinParent()&&--o.offset}function Bs(o){o instanceof vo||(o instanceof ks?(o=da(o,zi),zi(o)||K(114)):(o=da(o.getNode(),zi),zi(o)||K(114)));let i=o.getParent();kl(i)||K(115);let l=i.getParent();return bl(l)||K(116),[o,i,l]}function Hs(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!ts(o);)[o,i]=vl(o,i);return i}function vl(o,i){var l=o.getParent();if(!l)return l=Fr(),bt().append(l),l.select(),[bt(),0];if(Ct(o)){var h=o.splitText(i);return h.length===0?[l,o.getIndexWithinParent()]:(o=i===0?0:1,o=h[0].getIndexWithinParent()+o,[l,o])}return!Je(o)||i===0?[l,o.getIndexWithinParent()]:((h=o.getChildAtIndex(i))&&(i=new _i(Lr(o.__key,i,"element"),Lr(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(h,...h.getNextSiblings())),[l,o.getIndexWithinParent()+1])}function Fi(o){let i=Fr(),l=null;for(let h=0;h<o.length;h++){let y=o[h],C=bi(y);if(C||Cn(y)&&y.isInline()||Je(y)&&y.isInline()||Ct(y)||y.isParentRequired()){if(l===null&&(l=y.createParentElementNode(),i.append(l),C))continue;l!==null&&l.append(y)}else i.append(y),l=null}return i}let hn=null,wn=null,Bn=!1,cs=!1,Bi=0,yi={characterData:!0,childList:!0,subtree:!0};function us(){return Bn||hn!==null&&hn._readOnly}function Vn(){Bn&&K(13)}function Pr(){return hn===null&&K(15),hn}function fn(){return wn===null&&K(16),wn}function Ra(o,i,l){var h=i.__type;let y=o._nodes.get(h);for(y===void 0&&K(30,h),o=l.get(h),o===void 0&&(o=Array.from(y.transforms),l.set(h,o)),l=o.length,h=0;h<l&&(o[h](i),i.isAttached());h++);}function wl(o,i){i=i._dirtyLeaves,o=o._nodeMap;for(let l of i)i=o.get(l),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&Se(i)}function ba(o,i){let l=i._dirtyLeaves,h=i._dirtyElements;o=o._nodeMap;let y=xt(),C=new Map;var v=l;let X=v.size;for(var he=h,Me=he.size;0<X||0<Me;){if(0<X){i._dirtyLeaves=new Set;for(let Ye of v)v=o.get(Ye),Ct(v)&&v.isAttached()&&v.isSimpleText()&&!v.isUnmergeable()&&Se(v),v!==void 0&&v!==void 0&&v.__key!==y&&v.isAttached()&&Ra(i,v,C),l.add(Ye);if(v=i._dirtyLeaves,X=v.size,0<X){Bi++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of he)he=Ye[0],Me=Ye[1],(he==="root"||Me)&&(v=o.get(he),v!==void 0&&v!==void 0&&v.__key!==y&&v.isAttached()&&Ra(i,v,C),h.set(he,Me));v=i._dirtyLeaves,X=v.size,he=i._dirtyElements,Me=he.size,Bi++}i._dirtyLeaves=l,i._dirtyElements=h}function Eo(o,i){var l=o.type,h=i.get(l);if(h===void 0&&K(17,l),l=h.klass,o.type!==l.getType()&&K(18,l.name),l=l.importJSON(o),o=o.children,Je(l)&&Array.isArray(o))for(h=0;h<o.length;h++){let y=Eo(o[h],i);l.append(y)}return l}function Ol(o,i){let l=hn,h=Bn,y=wn;hn=o,Bn=!0,wn=null;try{return i()}finally{hn=l,Bn=h,wn=y}}function Hi(o,i){let l=o._pendingEditorState,h=o._rootElement,y=o._headless||h===null;if(l!==null){var C=o._editorState,v=C._selection,X=l._selection,he=o._dirtyType!==0,Me=hn,Ye=Bn,Xe=wn,Ke=o._updating,Pe=o._observer,gt=null;if(o._pendingEditorState=null,o._editorState=l,!y&&he&&Pe!==null){wn=o,hn=l,Bn=!1,o._updating=!0;try{let pn=o._dirtyType,qn=o._dirtyElements,En=o._dirtyLeaves;Pe.disconnect();var Ot=pn,Ft=qn,zt=En;Wn=ti=bn="",ll=Ot===2,Ai=null,$n=o,kr=o._config,vs=o._nodes,Gr=$n._listeners.mutation,cl=Ft,xn=zt,sr=C._nodeMap,Nn=l._nodeMap,al=l._readOnly,co=new Map(o._keyToDOMMap);let Mr=new Map;ni=Mr,Ri("root",null),ni=co=kr=Nn=sr=xn=cl=vs=$n=void 0,gt=Mr}catch(pn){if(pn instanceof Error&&o._onError(pn),cs)throw pn;So(o,null,h,l),Oe(o),o._dirtyType=2,cs=!0,Hi(o,C),cs=!1;return}finally{Pe.observe(h,yi),o._updating=Ke,hn=Me,Bn=Ye,wn=Xe}}l._readOnly||(l._readOnly=!0);var Un=o._dirtyLeaves,wr=o._dirtyElements,ii=o._normalizedNodes,si=o._updateTags,Il=o._deferred;he&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set);var Ui=o._decorators,wo=o._pendingDecorators||Ui,fs=l._nodeMap,oi;for(oi in wo)fs.has(oi)||(wo===Ui&&(wo=tn(o)),delete wo[oi]);var Or=y?null:Ur(o._window);if(o._editable&&Or!==null&&(he||X===null||X.dirty)){wn=o,hn=l;try{if(Pe!==null&&Pe.disconnect(),he||X===null||X.dirty){let pn=o._blockCursorElement;pn!==null&&sl(pn,o,h);e:{let qn=Or.anchorNode,En=Or.focusNode,Mr=Or.anchorOffset,Ci=Or.focusOffset,Tt=document.activeElement;if(!(si.has("collaboration")&&Tt!==h||Tt!==null&&it(Tt)))if(Dt(X)){var Gi=X.anchor,Oo=X.focus,Ia=Gi.key,La=Oo.key,Ll=Rn(o,Ia),Gs=Rn(o,La),Vr=Gi.offset,Pa=Oo.offset,Pl=X.format,Ao=X.style,$a=X.isCollapsed(),Ys=Ll,Mo=Gs,$l=!1;if(Gi.type==="text"){Ys=ze(Ll);let ar=Gi.getNode();$l=ar.getFormat()!==Pl||ar.getStyle()!==Ao}else Dt(v)&&v.anchor.type==="text"&&($l=!0);if(Oo.type==="text"&&(Mo=ze(Gs)),Ys!==null&&Mo!==null){if($a&&(v===null||$l||Dt(v)&&(v.format!==Pl||v.style!==Ao))){var Fa=performance.now();pa=[Pl,Ao,Vr,Ia,Fa]}if(Mr===Vr&&Ci===Pa&&qn===Ys&&En===Mo&&(Or.type!=="Range"||!$a)&&(Tt!==null&&h.contains(Tt)||h.focus({preventScroll:!0}),Gi.type!=="element"))break e;try{Or.setBaseAndExtent(Ys,Vr,Mo,Pa)}catch{}if(!si.has("skip-scroll-into-view")&&X.isCollapsed()&&h!==null&&h===document.activeElement){let ar=X instanceof _i&&X.anchor.type==="element"?Ys.childNodes[Vr]||null:0<Or.rangeCount?Or.getRangeAt(0):null;if(ar!==null){let Dr;if(ar instanceof Text){let cr=document.createRange();cr.selectNode(ar),Dr=cr.getBoundingClientRect()}else Dr=ar.getBoundingClientRect();let tr=h.ownerDocument,Br=tr.defaultView;if(Br!==null)for(var{top:Fl,bottom:qr}=Dr,On,mt,Er=h;Er!==null;){let cr=Er===tr.body;if(cr)On=0,mt=dn(o).innerHeight;else{let ko=Er.getBoundingClientRect();On=ko.top,mt=ko.bottom}let li=0;if(Fl<On?li=-(On-Fl):qr>mt&&(li=qr-mt),li!==0)if(cr)Br.scrollBy(0,li);else{let ko=Er.scrollTop;Er.scrollTop+=li;let Ba=Er.scrollTop-ko;Fl-=Ba,qr-=Ba}if(cr)break;Er=mr(Er)}}}pl=!0}}else v!==null&&st(o,qn,En)&&Or.removeAllRanges()}}e:{let pn=o._blockCursorElement;if(Dt(X)&&X.isCollapsed()&&X.anchor.type==="element"&&h.contains(document.activeElement)){let qn=X.anchor,En=qn.getNode(),Mr=qn.offset,Ci=En.getChildrenSize(),Tt=!1,ar=null;if(Mr===Ci){let Dr=En.getChildAtIndex(Mr-1);lo(Dr)&&(Tt=!0)}else{let Dr=En.getChildAtIndex(Mr);if(lo(Dr)){let tr=Dr.getPreviousSibling();(tr===null||lo(tr))&&(Tt=!0,ar=o.getElementByKey(Dr.__key))}}if(Tt){let Dr=o.getElementByKey(En.__key);if(pn===null){let tr=o._config.theme,Br=document.createElement("div");Br.contentEditable="false",Br.setAttribute("data-lexical-cursor","true");let cr=tr.blockCursor;if(cr!==void 0){if(typeof cr=="string"){let li=cr.split(" ");cr=tr.blockCursor=li}cr!==void 0&&Br.classList.add(...cr)}o._blockCursorElement=pn=Br}h.style.caretColor="transparent",ar===null?Dr.appendChild(pn):Dr.insertBefore(pn,ar);break e}}pn!==null&&sl(pn,o,h)}Pe!==null&&Pe.observe(h,yi)}finally{wn=Xe,hn=Me}}if(gt!==null){var Do=gt;let pn=Array.from(o._listeners.mutation),qn=pn.length;for(let En=0;En<qn;En++){let[Mr,Ci]=pn[En],Tt=Do.get(Ci);Tt!==void 0&&Mr(Tt,{dirtyLeaves:Un,prevEditorState:C,updateTags:si})}}Dt(X)||X===null||v!==null&&v.is(X)||o.dispatchCommand(e,void 0);var Ro=o._pendingDecorators;Ro!==null&&(o._decorators=Ro,o._pendingDecorators=null,Ni("decorator",o,!0,Ro));var Lc=It(i||C),Ar=It(l);if(Lc!==Ar&&Ni("textcontent",o,!0,Ar),Ni("update",o,!0,{dirtyElements:wr,dirtyLeaves:Un,editorState:l,normalizedNodes:ii,prevEditorState:i||C,tags:si}),o._deferred=[],Il.length!==0){let pn=o._updating;o._updating=!0;try{for(let qn=0;qn<Il.length;qn++)Il[qn]()}finally{o._updating=pn}}var bo=o._updates;if(bo.length!==0){let pn=bo.shift();if(pn){let[qn,En]=pn;Al(o,qn,En)}}}}function Ni(o,i,l,...h){let y=i._updating;i._updating=l;try{let C=Array.from(i._listeners[o]);for(o=0;o<C.length;o++)C[o].apply(null,h)}finally{i._updating=y}}function at(o,i,l){if(o._updating===!1||wn!==o){let C=!1;return o.update(()=>{C=at(o,i,l)}),C}let h=pe(o);for(let C=4;0<=C;C--)for(let v=0;v<h.length;v++){var y=h[v]._commands.get(i);if(y!==void 0&&(y=y[C],y!==void 0)){y=Array.from(y);let X=y.length;for(let he=0;he<X;he++)if(y[he](l,o)===!0)return!0}}return!1}function ds(o,i){let l=o._updates;for(i=i||!1;l.length!==0;){var h=l.shift();if(h){let[y,C]=h,v;C!==void 0&&(h=C.onUpdate,v=C.tag,C.skipTransforms&&(i=!0),h&&o._deferred.push(h),v&&o._updateTags.add(v)),y()}}return i}function Al(o,i,l){let h=o._updateTags;var y,C=y=!1;if(l!==void 0){var v=l.onUpdate;y=l.tag,y!=null&&h.add(y),y=l.skipTransforms||!1,C=l.discrete||!1}v&&o._deferred.push(v),l=o._editorState,v=o._pendingEditorState;let X=!1;(v===null||v._readOnly)&&(v=o._pendingEditorState=new Ws(new Map((v||l)._nodeMap)),X=!0),v._flushSync=C,C=hn;let he=Bn,Me=wn,Ye=o._updating;hn=v,Bn=!1,o._updating=!0,wn=o;try{X&&(o._headless?l._selection!=null&&(v._selection=l._selection.clone()):v._selection=kn(o));let Xe=o._compositionKey;i(),y=ds(o,y),Da(v,o),o._dirtyType!==0&&(y?wl(v,o):ba(v,o),ds(o),ol(l,v,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(v._flushSync=!0);let Ke=v._selection;if(Dt(Ke)){let Pe=v._nodeMap,gt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(gt)!==void 0||K(19)}else or(Ke)&&Ke._nodes.size===0&&(v._selection=null)}catch(Xe){Xe instanceof Error&&o._onError(Xe),o._pendingEditorState=l,o._dirtyType=2,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),Hi(o);return}finally{hn=C,Bn=he,wn=Me,o._updating=Ye,Bi=0}o._dirtyType!==0||Ml(v,o)?v._flushSync?(v._flushSync=!1,Hi(o)):X&&rt(()=>{Hi(o)}):(v._flushSync=!1,X&&(h.clear(),o._deferred=[],o._pendingEditorState=null))}function Cr(o,i,l){o._updating?o._updates.push([i,l]):Al(o,i,l)}class To extends ks{constructor(i){super(i)}decorate(){K(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Cn(o){return o instanceof To}class Wi extends ks{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=[],l=this.getFirstChild();for(;l!==null;)i.push(l),l=l.getNextSibling();return i}getChildrenKeys(){let i=[],l=this.getFirstChild();for(;l!==null;)i.push(l.__key),l=l.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=fn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),l=this.getParentOrThrow().getLastChild();return l!==null&&l.is(i)}getAllTextNodes(){let i=[],l=this.getFirstChild();for(;l!==null;){if(Ct(l)&&i.push(l),Je(l)){let h=l.getAllTextNodes();i.push(...h)}l=l.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let l=i.getFirstChild();if(l!==null){i=l;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let l=i.getLastChild();if(l!==null){i=l;continue}}break}return i}getDescendantByIndex(i){let l=this.getChildren(),h=l.length;return i>=h?(i=l[h-1],Je(i)&&i.getLastDescendant()||i||null):(i=l[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:pt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&K(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:pt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&K(96,this.__key),i}getChildAtIndex(i){var l=this.getChildrenSize();let h;if(i<l/2){for(h=this.getFirstChild(),l=0;h!==null&&l<=i;){if(l===i)return h;h=h.getNextSibling(),l++}return null}for(h=this.getLastChild(),--l;h!==null&&l>=i;){if(l===i)return h;h=h.getPreviousSibling(),l--}return null}getTextContent(){let i="",l=this.getChildren(),h=l.length;for(let y=0;y<h;y++){let C=l[y];i+=C.getTextContent(),Je(C)&&y!==h-1&&!C.isInline()&&(i+=`
|
|
68
|
+
`?l.push(Vr()):C===" "?l.push($i()):l.push(Kn(C))}this.insertNodes(l)}insertText(i){var l=this.anchor,h=this.focus,y=this.isCollapsed()||l.isBefore(h),C=this.format,v=this.style;y&&l.type==="element"?Tl(l,h,C,v):y||h.type!=="element"||Tl(h,l,C,v);var X=this.getNodes(),he=X.length,Me=y?h:l;h=(y?l:h).offset;var Ye=Me.offset;l=X[0],Ct(l)||K(26),y=l.getTextContent().length;var Xe=l.getParentOrThrow(),Ke=X[he-1];if(this.isCollapsed()&&h===y&&(l.isSegmented()||l.isToken()||!l.canInsertTextAfter()||!Xe.canInsertTextAfter()&&l.getNextSibling()===null)){var Pe=l.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ge(Pe)||(Pe=Kn(),Pe.setFormat(C),Xe.canInsertTextAfter()?l.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),l=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&h===0&&(l.isSegmented()||l.isToken()||!l.canInsertTextBefore()||!Xe.canInsertTextBefore()&&l.getPreviousSibling()===null)){if(Pe=l.getPreviousSibling(),(!Ct(Pe)||Ge(Pe))&&(Pe=Kn(),Pe.setFormat(C),Xe.canInsertTextBefore()?l.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),l=Pe,i!==""){this.insertText(i);return}}else if(l.isSegmented()&&h!==y)Xe=Kn(l.getTextContent()),Xe.setFormat(C),l.replace(Xe),l=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),Co(this.anchor,this.focus,null),this.insertText(i);return}if(he===1)if(l.isToken())i=Kn(i),i.select(),l.replace(i);else{if(X=l.getFormat(),he=l.getStyle(),h===Ye&&(X!==C||he!==v))if(l.getTextContent()==="")l.setFormat(C),l.setStyle(v);else{X=Kn(i),X.setFormat(C),X.setStyle(v),X.select(),h===0?l.insertBefore(X,!1):([he]=l.splitText(h),he.insertAfter(X,!1)),X.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(wa(l)){i=Kn(i),i.setFormat(C),i.setStyle(v),i.select(),l.replace(i);return}l=l.spliceText(h,Ye-h,i,!0),l.getTextContent()===""?l.remove():this.anchor.type==="text"&&(l.isComposing()?this.anchor.offset-=i.length:(this.format=X,this.style=he))}else{if(C=new Set([...l.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(l)?l:l.getParentOrThrow(),v=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(v)&&v.isInline())do Xe=v,v=v.getParentOrThrow();while(v.isInline());if(Me.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||Me.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var gt=Kn(Ke.getTextContent());Ke.replace(gt),Ke=gt}er(Me.getNode())||Me.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),C.add(Ke.__key)}else Me=Ke.getParentOrThrow(),Me.canBeEmpty()||Me.getChildrenSize()!==1?Ke.remove():Me.remove();else C.add(Ke.__key);for(Me=v.getChildren(),Ye=new Set(X),Ke=Pe.is(v),Pe=Pe.isInline()&&l.getNextSibling()===null?Pe:l,gt=Me.length-1;0<=gt;gt--){let Ot=Me[gt];if(Ot.is(l)||Je(Ot)&&Ot.isParentOf(l))break;Ot.isAttached()&&(!Ye.has(Ot)||Ot.is(Xe)?Ke||Pe.insertAfter(Ot,!1):Ot.remove())}if(!Ke)for(Me=v,v=null;Me!==null;)Ye=Me.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(v))&&(C.delete(Me.__key),v=Me),Me=Me.getParent();for(l.isToken()?h===y?l.select():(i=Kn(i),i.select(),l.replace(i)):(l=l.spliceText(h,y-h,i,!0),l.getTextContent()===""?l.remove():l.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<he;i++)l=X[i],C.has(l.__key)||l.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),ht(null);else{var l=this.getNodes(),h=[];for(var y of l)Ct(y)&&h.push(y);var C=h.length;if(C===0)this.toggleFormat(i),ht(null);else{y=this.anchor;var v=this.focus,X=this.isBackward();l=X?v:y,y=X?y:v;var he=0,Me=h[0];if(v=l.type==="element"?0:l.offset,l.type==="text"&&v===Me.getTextContentSize()&&(he=1,Me=h[1],v=0),Me!=null){X=Me.getFormatFlags(i,null);var Ye=C-1,Xe=h[Ye];if(C=y.type==="text"?y.offset:Xe.getTextContentSize(),Me.is(Xe))v!==C&&(v===0&&C===Me.getTextContentSize()?Me.setFormat(X):(i=Me.splitText(v,C),i=v===0?i[0]:i[1],i.setFormat(X),l.type==="text"&&l.set(i.__key,0,"text"),y.type==="text"&&y.set(i.__key,C-v,"text")),this.format=X);else{v!==0&&([,Me]=Me.splitText(v),v=0),Me.setFormat(X);var Ke=Xe.getFormatFlags(i,X);for(0<C&&(C!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(C)),Xe.setFormat(Ke)),he+=1;he<Ye;he++){let Pe=h[he];if(!Pe.isToken()){let gt=Pe.getFormatFlags(i,Ke);Pe.setFormat(gt)}}l.type==="text"&&l.set(Me.__key,v,"text"),y.type==="text"&&y.set(Xe.__key,C,"text"),this.format=X|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var l=Vt();if(!Dt(l))throw Error("Expected RangeSelection after insertParagraph");return l.insertNodes(i)}var h=vs(this.anchor.getNode(),ns);if(l=i[i.length-1],"__language"in h&&Je(h))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var y=Ws(this);h.splice(y,0,i),l.selectEnd()}else if(i.some(X=>(Je(X)||Cn(X))&&!X.isInline())){l=Bi(i),i=l.getLastDescendant();var C=l.getChildren();l=Je(h)&&h.isEmpty()?null:this.insertParagraph(),y=C[C.length-1];var v=C[0];if((X=>Je(X)&&ns(X)&&!X.isEmpty()&&Je(h)&&(!h.isEmpty()||"__value"in h&&"__checked"in h))(v)){if(!Je(h))throw Error("Expected 'firstBlock' to be an ElementNode");h.append(...v.getChildren()),v=C[1]}v&&Ic(h,v),C=vs(i,ns),l&&Je(C)&&("__value"in l&&"__checked"in l||ns(y))&&(C.append(...l.getChildren()),l.remove()),Je(h)&&h.isEmpty()&&h.remove(),i.selectEnd(),i=Je(h)?h.getLastChild():null,ki(i)&&C!==h&&i.remove()}else{if(!Je(h))throw Error("Expected 'firstBlock' to be an ElementNode");y=Ws(this),h.splice(y,0,i),l.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Br();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var l=Ws(this);if(i=vs(this.anchor.getNode(),ns),!Je(i))throw Error("Expected ancestor to be an ElementNode");return l=(l=i.getChildAtIndex(l))?[l,...l.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...l),i.selectStart(),i):null}insertLineBreak(i){var l=Vr();this.insertNodes([l]),i&&(i=l.getParentOrThrow(),l=l.getIndexWithinParent(),i.select(l,l))}extract(){var i=this.getNodes(),l=i.length,h=l-1,y=this.anchor;let C=this.focus;var v=i[0];let X=i[h],[he,Me]=No(this);return l===0?[]:l===1?Ct(v)&&!this.isCollapsed()?(i=he>Me?Me:he,h=v.splitText(i,he>Me?he:Me),i=i===0?h[0]:h[1],i!=null?[i]:[]):[v]:(l=y.isBefore(C),Ct(v)&&(y=l?he:Me,y===v.getTextContentSize()?i.shift():y!==0&&([,v]=v.splitText(y),i[0]=v)),Ct(X)&&(v=X.getTextContent().length,l=l?Me:he,l===0?i.pop():l!==v&&([X]=X.splitText(l),i[h]=X)),i)}modify(i,l,h){var y=this.focus,C=this.anchor,v=i==="move",X=Ht(y,l);if(Cn(X)&&!X.isIsolated())v&&X.isKeyboardSelectable()?(l=Sl(),l.add(X.__key),nn(l)):(i=l?X.getPreviousSibling():X.getNextSibling(),Ct(i)?(X=i.__key,l=l?i.getTextContent().length:0,y.set(X,l,"text"),v&&C.set(X,l,"text")):(h=X.getParentOrThrow(),Je(i)?(h=i.__key,X=l?i.getChildrenSize():0):(X=X.getIndexWithinParent(),h=h.__key,l||X++),y.set(h,X,"element"),v&&C.set(h,X,"element")));else if(C=fn(),y=Gr(C._window)){var he=C._blockCursorElement,Me=C._rootElement;if(Me===null||he===null||!Je(X)||X.isInline()||X.canBeEmpty()||sl(he,C,Me),y.modify(i,l?"backward":"forward",h),0<y.rangeCount&&(X=y.getRangeAt(0),C=this.anchor.getNode(),C=er(C)?C:rr(C),this.applyDOMRange(X),this.dirty=!0,!v)){for(v=this.getNodes(),i=[],h=!1,he=0;he<v.length;he++)Me=v[he],jn(Me,C)?i.push(Me):h=!0;h&&0<i.length&&(l?(l=i[0],Je(l)?l.selectStart():l.getParentOrThrow().selectStart()):(l=i[i.length-1],Je(l)?l.selectEnd():l.getParentOrThrow().selectEnd())),(y.anchorNode!==X.startContainer||y.anchorOffset!==X.startOffset)&&(l=this.focus,v=this.anchor,y=v.key,X=v.offset,C=v.type,vr(v,l.key,l.offset,l.type),vr(l,y,X,C),this._cachedNodes=null)}}}deleteCharacter(i){let l=this.isCollapsed();if(this.isCollapsed()){var h=this.anchor,y=this.focus,C=h.getNode();if(!i&&(h.type==="element"&&Je(C)&&h.offset===C.getChildrenSize()||h.type==="text"&&h.offset===C.getTextContentSize())){var v=C.getParent();if(v=C.getNextSibling()||(v===null?null:v.getNextSibling()),Je(v)&&v.isShadowRoot())return}if(v=Ht(y,i),Cn(v)&&!v.isIsolated()){v.isKeyboardSelectable()&&Je(C)&&C.getChildrenSize()===0?(C.remove(),i=Sl(),i.add(v.__key),nn(i)):(v.remove(),fn().dispatchCommand(e,void 0));return}if(!i&&Je(v)&&Je(C)&&C.isEmpty()){C.remove(),v.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(v=y.type==="text"?y.getNode():null,C=h.type==="text"?h.getNode():null,v!==null&&v.isSegmented()){if(h=y.offset,y=v.getTextContentSize(),v.is(C)||i&&h!==y||!i&&h!==0){Aa(v,i,h);return}}else if(C!==null&&C.isSegmented()&&(h=h.offset,y=C.getTextContentSize(),C.is(v)||i&&h!==0||!i&&h!==y)){Aa(C,i,h);return}if(C=this.anchor,v=this.focus,h=C.getNode(),y=v.getNode(),h===y&&C.type==="text"&&v.type==="text"){var X=C.offset,he=v.offset;let Me=X<he;y=Me?X:he,he=Me?he:X,X=he-1,y!==X&&(h=h.getTextContent().slice(y,he),mi(h)||(i?v.offset=X:C.offset=X))}}}this.removeText(),i&&!l&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&er(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 or(o){return o instanceof yo}function Oa(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function No(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]:[Oa(i),Oa(o)]}function Aa(o,i,l){let h=o.getTextContent().split(/(?=\s)/g),y=h.length,C=0,v=0;for(let X=0;X<y;X++){let he=h[X],Me=X===y-1;if(v=C,C+=he.length,i&&C===l||C>l||Me){h.splice(X,1),Me&&(v=void 0);break}}i=h.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(v,v))}function Fs(o,i,l,h){var y=i;if(o.nodeType===1){let X=!1;var C=o.childNodes,v=C.length;y===v&&(X=!0,y=v-1);let he=C[y];if(v=!1,he===h._blockCursorElement?(he=C[y+1],v=!0):h._blockCursorElement!==null&&y--,h=Sr(he),Ct(h))y=X?h.getTextContentSize():0;else{if(C=Sr(o),C===null)return null;if(Je(C)?(o=C.getChildAtIndex(y),(i=Je(o))&&(i=o.getParent(),i=l===null||i===null||!i.canBeEmpty()||i!==l.getNode()),i&&(l=X?o.getLastDescendant():o.getFirstDescendant(),l===null?(C=o,y=0):(o=l,C=Je(o)?o:o.getParentOrThrow())),Ct(o)?(h=o,C=null,y=X?o.getTextContentSize():0):o!==C&&X&&!v&&y++):(y=C.getIndexWithinParent(),y=i===0&&Cn(C)&&Sr(o)===C?y:y+1,C=C.getParentOrThrow()),Je(C))return Pr(C.__key,y,"element")}}else h=Sr(o);return Ct(h)?Pr(h.__key,y,"text"):null}function Fi(o,i,l){var h=o.offset,y=o.getNode();h===0?(h=y.getPreviousSibling(),y=y.getParent(),i?(l||!i)&&h===null&&Je(y)&&y.isInline()&&(i=y.getPreviousSibling(),Ct(i)&&(o.key=i.__key,o.offset=i.getTextContent().length)):Je(h)&&!l&&h.isInline()?(o.key=h.__key,o.offset=h.getChildrenSize(),o.type="element"):Ct(h)&&(o.key=h.__key,o.offset=h.getTextContent().length)):h===y.getTextContent().length&&(h=y.getNextSibling(),y=y.getParent(),i&&Je(h)&&h.isInline()?(o.key=h.__key,o.offset=0,o.type="element"):(l||i)&&h===null&&Je(y)&&y.isInline()&&!y.canInsertTextAfter()&&(i=y.getNextSibling(),Ct(i)&&(o.key=i.__key,o.offset=0)))}function Co(o,i,l){if(o.type==="text"&&i.type==="text"){var h=o.isBefore(i);let y=o.is(i);Fi(o,h,y),Fi(i,!h,y),y&&(i.key=o.key,i.offset=o.offset,i.type=o.type),h=fn(),h.isComposing()&&h._compositionKey!==o.key&&Dt(l)&&(h=l.anchor,l=l.focus,vr(o,h.key,h.offset,h.type),vr(i,l.key,l.offset,l.type))}}function Ma(o,i,l,h,y,C){return o===null||l===null||!st(y,o,l)||(i=Fs(o,i,Dt(C)?C.anchor:null,y),i===null)||(h=Fs(l,h,Dt(C)?C.focus:null,y),h===null||i.type==="element"&&h.type==="element"&&(o=Sr(o),l=Sr(l),Cn(o)&&Cn(l)))?null:(Co(i,h,C),[i,h])}function xl(o,i,l,h,y,C){let v=$r();return o=new yi(Pr(o,i,y),Pr(l,h,C),0,""),o.dirty=!0,v._selection=o}function Sl(){return new yo(new Set)}function kn(o){let i=o.getEditorState()._selection,l=Gr(o._window);return Dt(i)||i==null?zn(i,l,o,null):i.clone()}function zn(o,i,l,h){var y=l._window;if(y===null)return null;var C=(y=h||y.event)?y.type:void 0;h=C==="selectionchange",y=!Fe&&(h||C==="beforeinput"||C==="compositionstart"||C==="compositionend"||C==="click"&&y&&y.detail===3||C==="drop"||C===void 0);let v;if(!Dt(o)||y){if(i===null)return null;if(y=i.anchorNode,C=i.focusNode,v=i.anchorOffset,i=i.focusOffset,h&&Dt(o)&&!st(l,y,C))return o.clone()}else return o.clone();if(l=Ma(y,v,C,i,l,o),l===null)return null;let[X,he]=l;return new yi(X,he,Dt(o)?o.format:0,Dt(o)?o.style:"")}function Vt(){return $r()._selection}function Nr(){return fn()._editorState._selection}function Fn(o,i,l,h=1){var y=o.anchor,C=o.focus,v=y.getNode(),X=C.getNode();if(i.is(v)||i.is(X)){if(v=i.__key,o.isCollapsed())i=y.offset,(l<=i&&0<h||l<i&&0>h)&&(l=Math.max(0,i+h),y.set(v,l,"element"),C.set(v,l,"element"),as(o));else{let Me=o.isBackward();X=Me?C:y;var he=X.getNode();y=Me?y:C,C=y.getNode(),i.is(he)&&(he=X.offset,(l<=he&&0<h||l<he&&0>h)&&X.set(v,Math.max(0,he+h),"element")),i.is(C)&&(i=y.offset,(l<=i&&0<h||l<i&&0>h)&&y.set(v,Math.max(0,i+h),"element"))}as(o)}}function as(o){var i=o.anchor,l=i.offset;let h=o.focus;var y=h.offset,C=i.getNode(),v=h.getNode();if(o.isCollapsed())Je(C)&&(v=C.getChildrenSize(),v=(y=l>=v)?C.getChildAtIndex(v-1):C.getChildAtIndex(l),Ct(v)&&(l=0,y&&(l=v.getTextContentSize()),i.set(v.__key,l,"text"),h.set(v.__key,l,"text")));else{if(Je(C)){let X=C.getChildrenSize();l=(o=l>=X)?C.getChildAtIndex(X-1):C.getChildAtIndex(l),Ct(l)&&(C=0,o&&(C=l.getTextContentSize()),i.set(l.__key,C,"text"))}Je(v)&&(l=v.getChildrenSize(),y=(i=y>=l)?v.getChildAtIndex(l-1):v.getChildAtIndex(y),Ct(y)&&(v=0,i&&(v=y.getTextContentSize()),h.set(y.__key,v,"text")))}}function Da(o,i){if(i=i.getEditorState()._selection,o=o._selection,Dt(o)){var l=o.anchor;let h=o.focus,y;l.type==="text"&&(y=l.getNode(),y.selectionTransform(i,o)),h.type==="text"&&(l=h.getNode(),y!==l&&l.selectionTransform(i,o))}}function cs(o,i,l,h,y){let C=null,v=0,X=null;h!==null?(C=h.__key,Ct(h)?(v=h.getTextContentSize(),X="text"):Je(h)&&(v=h.getChildrenSize(),X="element")):y!==null&&(C=y.__key,Ct(y)?X="text":Je(y)&&(X="element")),C!==null&&X!==null?o.set(C,v,X):(v=i.getIndexWithinParent(),v===-1&&(v=l.getChildrenSize()),o.set(l.__key,v,"element"))}function Bs(o,i,l,h,y){o.type==="text"?(o.key=l,i||(o.offset+=y)):o.offset>h.getIndexWithinParent()&&--o.offset}function Hs(o){o instanceof vo||(o instanceof Is?(o=da(o,Ui),Ui(o)||K(114)):(o=da(o.getNode(),Ui),Ui(o)||K(114)));let i=o.getParent();kl(i)||K(115);let l=i.getParent();return bl(l)||K(116),[o,i,l]}function Ws(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!ns(o);)[o,i]=vl(o,i);return i}function vl(o,i){var l=o.getParent();if(!l)return l=Br(),bt().append(l),l.select(),[bt(),0];if(Ct(o)){var h=o.splitText(i);return h.length===0?[l,o.getIndexWithinParent()]:(o=i===0?0:1,o=h[0].getIndexWithinParent()+o,[l,o])}return!Je(o)||i===0?[l,o.getIndexWithinParent()]:((h=o.getChildAtIndex(i))&&(i=new yi(Pr(o.__key,i,"element"),Pr(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(h,...h.getNextSiblings())),[l,o.getIndexWithinParent()+1])}function Bi(o){let i=Br(),l=null;for(let h=0;h<o.length;h++){let y=o[h],C=ki(y);if(C||Cn(y)&&y.isInline()||Je(y)&&y.isInline()||Ct(y)||y.isParentRequired()){if(l===null&&(l=y.createParentElementNode(),i.append(l),C))continue;l!==null&&l.append(y)}else i.append(y),l=null}return i}let hn=null,wn=null,Bn=!1,us=!1,Hi=0,Ni={characterData:!0,childList:!0,subtree:!0};function ds(){return Bn||hn!==null&&hn._readOnly}function Vn(){Bn&&K(13)}function $r(){return hn===null&&K(15),hn}function fn(){return wn===null&&K(16),wn}function Ra(o,i,l){var h=i.__type;let y=o._nodes.get(h);for(y===void 0&&K(30,h),o=l.get(h),o===void 0&&(o=Array.from(y.transforms),l.set(h,o)),l=o.length,h=0;h<l&&(o[h](i),i.isAttached());h++);}function wl(o,i){i=i._dirtyLeaves,o=o._nodeMap;for(let l of i)i=o.get(l),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&Se(i)}function ba(o,i){let l=i._dirtyLeaves,h=i._dirtyElements;o=o._nodeMap;let y=xt(),C=new Map;var v=l;let X=v.size;for(var he=h,Me=he.size;0<X||0<Me;){if(0<X){i._dirtyLeaves=new Set;for(let Ye of v)v=o.get(Ye),Ct(v)&&v.isAttached()&&v.isSimpleText()&&!v.isUnmergeable()&&Se(v),v!==void 0&&v!==void 0&&v.__key!==y&&v.isAttached()&&Ra(i,v,C),l.add(Ye);if(v=i._dirtyLeaves,X=v.size,0<X){Hi++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of he)he=Ye[0],Me=Ye[1],(he==="root"||Me)&&(v=o.get(he),v!==void 0&&v!==void 0&&v.__key!==y&&v.isAttached()&&Ra(i,v,C),h.set(he,Me));v=i._dirtyLeaves,X=v.size,he=i._dirtyElements,Me=he.size,Hi++}i._dirtyLeaves=l,i._dirtyElements=h}function Eo(o,i){var l=o.type,h=i.get(l);if(h===void 0&&K(17,l),l=h.klass,o.type!==l.getType()&&K(18,l.name),l=l.importJSON(o),o=o.children,Je(l)&&Array.isArray(o))for(h=0;h<o.length;h++){let y=Eo(o[h],i);l.append(y)}return l}function Ol(o,i){let l=hn,h=Bn,y=wn;hn=o,Bn=!0,wn=null;try{return i()}finally{hn=l,Bn=h,wn=y}}function Wi(o,i){let l=o._pendingEditorState,h=o._rootElement,y=o._headless||h===null;if(l!==null){var C=o._editorState,v=C._selection,X=l._selection,he=o._dirtyType!==0,Me=hn,Ye=Bn,Xe=wn,Ke=o._updating,Pe=o._observer,gt=null;if(o._pendingEditorState=null,o._editorState=l,!y&&he&&Pe!==null){wn=o,hn=l,Bn=!1,o._updating=!0;try{let pn=o._dirtyType,qn=o._dirtyElements,En=o._dirtyLeaves;Pe.disconnect();var Ot=pn,Ft=qn,zt=En;Wn=ni=bn="",ll=Ot===2,Mi=null,$n=o,Ir=o._config,ws=o._nodes,Yr=$n._listeners.mutation,cl=Ft,xn=zt,sr=C._nodeMap,Nn=l._nodeMap,al=l._readOnly,co=new Map(o._keyToDOMMap);let Mr=new Map;ri=Mr,bi("root",null),ri=co=Ir=Nn=sr=xn=cl=ws=$n=void 0,gt=Mr}catch(pn){if(pn instanceof Error&&o._onError(pn),us)throw pn;So(o,null,h,l),Oe(o),o._dirtyType=2,us=!0,Wi(o,C),us=!1;return}finally{Pe.observe(h,Ni),o._updating=Ke,hn=Me,Bn=Ye,wn=Xe}}l._readOnly||(l._readOnly=!0);var Un=o._dirtyLeaves,wr=o._dirtyElements,si=o._normalizedNodes,oi=o._updateTags,Il=o._deferred;he&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set);var Gi=o._decorators,wo=o._pendingDecorators||Gi,hs=l._nodeMap,li;for(li in wo)hs.has(li)||(wo===Gi&&(wo=tn(o)),delete wo[li]);var Or=y?null:Gr(o._window);if(o._editable&&Or!==null&&(he||X===null||X.dirty)){wn=o,hn=l;try{if(Pe!==null&&Pe.disconnect(),he||X===null||X.dirty){let pn=o._blockCursorElement;pn!==null&&sl(pn,o,h);e:{let qn=Or.anchorNode,En=Or.focusNode,Mr=Or.anchorOffset,Ei=Or.focusOffset,Tt=document.activeElement;if(!(oi.has("collaboration")&&Tt!==h||Tt!==null&&it(Tt)))if(Dt(X)){var Yi=X.anchor,Oo=X.focus,Ia=Yi.key,La=Oo.key,Ll=Rn(o,Ia),Ys=Rn(o,La),qr=Yi.offset,Pa=Oo.offset,Pl=X.format,Ao=X.style,$a=X.isCollapsed(),js=Ll,Mo=Ys,$l=!1;if(Yi.type==="text"){js=ze(Ll);let ar=Yi.getNode();$l=ar.getFormat()!==Pl||ar.getStyle()!==Ao}else Dt(v)&&v.anchor.type==="text"&&($l=!0);if(Oo.type==="text"&&(Mo=ze(Ys)),js!==null&&Mo!==null){if($a&&(v===null||$l||Dt(v)&&(v.format!==Pl||v.style!==Ao))){var Fa=performance.now();pa=[Pl,Ao,qr,Ia,Fa]}if(Mr===qr&&Ei===Pa&&qn===js&&En===Mo&&(Or.type!=="Range"||!$a)&&(Tt!==null&&h.contains(Tt)||h.focus({preventScroll:!0}),Yi.type!=="element"))break e;try{Or.setBaseAndExtent(js,qr,Mo,Pa)}catch{}if(!oi.has("skip-scroll-into-view")&&X.isCollapsed()&&h!==null&&h===document.activeElement){let ar=X instanceof yi&&X.anchor.type==="element"?js.childNodes[qr]||null:0<Or.rangeCount?Or.getRangeAt(0):null;if(ar!==null){let Dr;if(ar instanceof Text){let cr=document.createRange();cr.selectNode(ar),Dr=cr.getBoundingClientRect()}else Dr=ar.getBoundingClientRect();let tr=h.ownerDocument,Hr=tr.defaultView;if(Hr!==null)for(var{top:Fl,bottom:Zr}=Dr,On,mt,Er=h;Er!==null;){let cr=Er===tr.body;if(cr)On=0,mt=dn(o).innerHeight;else{let ko=Er.getBoundingClientRect();On=ko.top,mt=ko.bottom}let ai=0;if(Fl<On?ai=-(On-Fl):Zr>mt&&(ai=Zr-mt),ai!==0)if(cr)Hr.scrollBy(0,ai);else{let ko=Er.scrollTop;Er.scrollTop+=ai;let Ba=Er.scrollTop-ko;Fl-=Ba,Zr-=Ba}if(cr)break;Er=mr(Er)}}}pl=!0}}else v!==null&&st(o,qn,En)&&Or.removeAllRanges()}}e:{let pn=o._blockCursorElement;if(Dt(X)&&X.isCollapsed()&&X.anchor.type==="element"&&h.contains(document.activeElement)){let qn=X.anchor,En=qn.getNode(),Mr=qn.offset,Ei=En.getChildrenSize(),Tt=!1,ar=null;if(Mr===Ei){let Dr=En.getChildAtIndex(Mr-1);lo(Dr)&&(Tt=!0)}else{let Dr=En.getChildAtIndex(Mr);if(lo(Dr)){let tr=Dr.getPreviousSibling();(tr===null||lo(tr))&&(Tt=!0,ar=o.getElementByKey(Dr.__key))}}if(Tt){let Dr=o.getElementByKey(En.__key);if(pn===null){let tr=o._config.theme,Hr=document.createElement("div");Hr.contentEditable="false",Hr.setAttribute("data-lexical-cursor","true");let cr=tr.blockCursor;if(cr!==void 0){if(typeof cr=="string"){let ai=cr.split(" ");cr=tr.blockCursor=ai}cr!==void 0&&Hr.classList.add(...cr)}o._blockCursorElement=pn=Hr}h.style.caretColor="transparent",ar===null?Dr.appendChild(pn):Dr.insertBefore(pn,ar);break e}}pn!==null&&sl(pn,o,h)}Pe!==null&&Pe.observe(h,Ni)}finally{wn=Xe,hn=Me}}if(gt!==null){var Do=gt;let pn=Array.from(o._listeners.mutation),qn=pn.length;for(let En=0;En<qn;En++){let[Mr,Ei]=pn[En],Tt=Do.get(Ei);Tt!==void 0&&Mr(Tt,{dirtyLeaves:Un,prevEditorState:C,updateTags:oi})}}Dt(X)||X===null||v!==null&&v.is(X)||o.dispatchCommand(e,void 0);var Ro=o._pendingDecorators;Ro!==null&&(o._decorators=Ro,o._pendingDecorators=null,Ci("decorator",o,!0,Ro));var Lc=It(i||C),Ar=It(l);if(Lc!==Ar&&Ci("textcontent",o,!0,Ar),Ci("update",o,!0,{dirtyElements:wr,dirtyLeaves:Un,editorState:l,normalizedNodes:si,prevEditorState:i||C,tags:oi}),o._deferred=[],Il.length!==0){let pn=o._updating;o._updating=!0;try{for(let qn=0;qn<Il.length;qn++)Il[qn]()}finally{o._updating=pn}}var bo=o._updates;if(bo.length!==0){let pn=bo.shift();if(pn){let[qn,En]=pn;Al(o,qn,En)}}}}function Ci(o,i,l,...h){let y=i._updating;i._updating=l;try{let C=Array.from(i._listeners[o]);for(o=0;o<C.length;o++)C[o].apply(null,h)}finally{i._updating=y}}function at(o,i,l){if(o._updating===!1||wn!==o){let C=!1;return o.update(()=>{C=at(o,i,l)}),C}let h=pe(o);for(let C=4;0<=C;C--)for(let v=0;v<h.length;v++){var y=h[v]._commands.get(i);if(y!==void 0&&(y=y[C],y!==void 0)){y=Array.from(y);let X=y.length;for(let he=0;he<X;he++)if(y[he](l,o)===!0)return!0}}return!1}function fs(o,i){let l=o._updates;for(i=i||!1;l.length!==0;){var h=l.shift();if(h){let[y,C]=h,v;C!==void 0&&(h=C.onUpdate,v=C.tag,C.skipTransforms&&(i=!0),h&&o._deferred.push(h),v&&o._updateTags.add(v)),y()}}return i}function Al(o,i,l){let h=o._updateTags;var y,C=y=!1;if(l!==void 0){var v=l.onUpdate;y=l.tag,y!=null&&h.add(y),y=l.skipTransforms||!1,C=l.discrete||!1}v&&o._deferred.push(v),l=o._editorState,v=o._pendingEditorState;let X=!1;(v===null||v._readOnly)&&(v=o._pendingEditorState=new Ks(new Map((v||l)._nodeMap)),X=!0),v._flushSync=C,C=hn;let he=Bn,Me=wn,Ye=o._updating;hn=v,Bn=!1,o._updating=!0,wn=o;try{X&&(o._headless?l._selection!=null&&(v._selection=l._selection.clone()):v._selection=kn(o));let Xe=o._compositionKey;i(),y=fs(o,y),Da(v,o),o._dirtyType!==0&&(y?wl(v,o):ba(v,o),fs(o),ol(l,v,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(v._flushSync=!0);let Ke=v._selection;if(Dt(Ke)){let Pe=v._nodeMap,gt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(gt)!==void 0||K(19)}else or(Ke)&&Ke._nodes.size===0&&(v._selection=null)}catch(Xe){Xe instanceof Error&&o._onError(Xe),o._pendingEditorState=l,o._dirtyType=2,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),Wi(o);return}finally{hn=C,Bn=he,wn=Me,o._updating=Ye,Hi=0}o._dirtyType!==0||Ml(v,o)?v._flushSync?(v._flushSync=!1,Wi(o)):X&&rt(()=>{Wi(o)}):(v._flushSync=!1,X&&(h.clear(),o._deferred=[],o._pendingEditorState=null))}function Cr(o,i,l){o._updating?o._updates.push([i,l]):Al(o,i,l)}class To extends Is{constructor(i){super(i)}decorate(){K(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Cn(o){return o instanceof To}class Ki extends Is{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=[],l=this.getFirstChild();for(;l!==null;)i.push(l),l=l.getNextSibling();return i}getChildrenKeys(){let i=[],l=this.getFirstChild();for(;l!==null;)i.push(l.__key),l=l.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=fn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),l=this.getParentOrThrow().getLastChild();return l!==null&&l.is(i)}getAllTextNodes(){let i=[],l=this.getFirstChild();for(;l!==null;){if(Ct(l)&&i.push(l),Je(l)){let h=l.getAllTextNodes();i.push(...h)}l=l.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let l=i.getFirstChild();if(l!==null){i=l;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let l=i.getLastChild();if(l!==null){i=l;continue}}break}return i}getDescendantByIndex(i){let l=this.getChildren(),h=l.length;return i>=h?(i=l[h-1],Je(i)&&i.getLastDescendant()||i||null):(i=l[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:pt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&K(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:pt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&K(96,this.__key),i}getChildAtIndex(i){var l=this.getChildrenSize();let h;if(i<l/2){for(h=this.getFirstChild(),l=0;h!==null&&l<=i;){if(l===i)return h;h=h.getNextSibling(),l++}return null}for(h=this.getLastChild(),--l;h!==null&&l>=i;){if(l===i)return h;h=h.getPreviousSibling(),l--}return null}getTextContent(){let i="",l=this.getChildren(),h=l.length;for(let y=0;y<h;y++){let C=l[y];i+=C.getTextContent(),Je(C)&&y!==h-1&&!C.isInline()&&(i+=`
|
|
69
69
|
|
|
70
|
-
`)}return i}getTextContentSize(){let i=0,l=this.getChildren(),h=l.length;for(let y=0;y<h;y++){let C=l[y];i+=C.getTextContentSize(),Je(C)&&y!==h-1&&!C.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,l){Vn();let h=Vt(),y=i,C=l;var v=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&l===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==v||l!==void 0&&l!==v)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(y===void 0&&(y=v),C===void 0&&(C=v),v=this.__key,Dt(h))h.anchor.set(v,y,"element"),h.focus.set(v,C,"element"),h.dirty=!0;else return xl(v,y,v,C,"element","element");return h}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(l=>l.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let l=this.getWritable();return l.__dir=i,l}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,l,h){let y=h.length,C=this.getChildrenSize(),v=this.getWritable(),X=v.__key;var he=[],Me=[];let Ye=this.getChildAtIndex(i+l),Xe=null,Ke=C-l+y;if(i!==0)if(i===C)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<l){var gt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<l;Pe++){gt===null&&K(100);var Ot=gt.getNextSibling(),Ft=gt.__key;gt=gt.getWritable(),Nt(gt),Me.push(Ft),gt=Ot}}for(Pe=Xe,Ot=0;Ot<y;Ot++){Ft=h[Ot],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),gt=Ft.getWritable(),gt.__parent===X&&Ke--,Nt(gt);let zt=Ft.__key;Pe===null?(v.__first=zt,gt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=zt,gt.__prev=Pe.__key),Ft.__key===X&&K(76),gt.__parent=X,he.push(zt),Pe=Ft}if(i+l===C?Pe!==null&&(Pe.getWritable().__next=null,v.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(l=Pe.getWritable(),i.__prev=Pe.__key,l.__next=Ye.__key):i.__prev=null),v.__size=Ke,Me.length&&(i=Vt(),Dt(i))){Me=new Set(Me),he=new Set(he);let{anchor:zt,focus:Un}=i;xo(zt,Me,he)&&as(zt,zt.getNode(),this,Xe,Ye),xo(Un,Me,he)&&as(Un,Un.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||ir(this)||this.remove()}return v}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 Wi}function xo(o,i,l){for(o=o.getNode();o;){let h=o.__key;if(i.has(h)&&!l.has(h))return!0;o=o.getParent()}return!1}class lr extends Wi{static getType(){return"root"}static clone(){return new lr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){K(51)}getTextContent(){let i=this.__cachedText;return!us()&&fn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){K(52)}replace(){K(53)}insertBefore(){K(54)}insertAfter(){K(55)}updateDOM(){return!1}append(...i){for(let l=0;l<i.length;l++){let h=i[l];Je(h)||Cn(h)||K(56)}return super.append(...i)}static importJSON(i){let l=bt();return l.setFormat(i.format),l.setIndent(i.indent),l.setDirection(i.direction),l}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function er(o){return o instanceof lr}function Ml(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 Ki(){return new Ws(new Map([["root",new lr]]))}function Dl(o){let i=o.exportJSON();var l=o.constructor;if(i.type!==l.getType()&&K(130,l.name),Je(o)){let h=i.children;for(Array.isArray(h)||K(59,l.name),o=o.getChildren(),l=0;l<o.length;l++){let y=Dl(o[l]);h.push(y)}}return i}class Ws{constructor(i,l){this._nodeMap=i,this._selection=l||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Ol(this,i)}clone(i){return i=new Ws(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ol(this,()=>({root:Dl(bt())}))}}class $r extends Wi{static getType(){return"paragraph"}static clone(i){return new $r(i.__key)}createDOM(i){let l=document.createElement("p");return i=Bt(i.theme,"paragraph"),i!==void 0&&l.classList.add(...i),l}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Ks,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&ao(i)){this.isEmpty()&&i.append(document.createElement("br"));var l=this.getFormatType();i.style.textAlign=l,(l=this.getDirection())&&(i.dir=l),l=this.getIndent(),0<l&&(i.style.textIndent=`${20*l}px`)}return{element:i}}static importJSON(i){let l=Fr();return l.setFormat(i.format),l.setIndent(i.indent),l.setDirection(i.direction),l}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,l){i=Fr();let h=this.getDirection();return i.setDirection(h),this.insertAfter(i,l),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 Ks(o){let i=Fr();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Fr(){return _r(new $r)}function So(o,i,l,h){let y=o._keyToDOMMap;y.clear(),o._editorState=Ki(),o._pendingEditorState=h,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,h=o._observer,h!==null&&(h.disconnect(),o._observer=null),i!==null&&(i.textContent=""),l!==null&&(l.textContent="",y.set("root",l))}function zs(o,i){let l=new Map,h=new Set,y=C=>{Object.keys(C).forEach(v=>{let X=l.get(v);X===void 0&&(X=[],l.set(v,X)),X.push(C[v])})};return o.forEach(C=>{C=C.klass.importDOM!=null?C.klass.importDOM.bind(C.klass):null,C==null||h.has(C)||(h.add(C),C=C(),C!==null&&y(C))}),i&&y(i),l}class Us{constructor(i,l,h,y,C,v,X){this._parentEditor=l,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=y,this._nodes=h,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=C,this._htmlConversions=v,this._editable=X,this._headless=l!==null&&l._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let l=this._listeners.update;return l.add(i),()=>{l.delete(i)}}registerEditableListener(i){let l=this._listeners.editable;return l.add(i),()=>{l.delete(i)}}registerDecoratorListener(i){let l=this._listeners.decorator;return l.add(i),()=>{l.delete(i)}}registerTextContentListener(i){let l=this._listeners.textcontent;return l.add(i),()=>{l.delete(i)}}registerRootListener(i){let l=this._listeners.root;return i(this._rootElement,null),l.add(i),()=>{i(null,this._rootElement),l.delete(i)}}registerCommand(i,l,h){h===void 0&&K(35);let y=this._commands;y.has(i)||y.set(i,[new Set,new Set,new Set,new Set,new Set]);let C=y.get(i);C===void 0&&K(36,String(i));let v=C[h];return v.add(l),()=>{v.delete(l),C.every(X=>X.size===0)&&y.delete(i)}}registerMutationListener(i,l){this._nodes.get(i.getType())===void 0&&K(37,i.name);let h=this._listeners.mutation;return h.set(l,i),()=>{h.delete(l)}}registerNodeTransformToKlass(i,l){var h=i.getType();return h=this._nodes.get(h),h===void 0&&K(37,i.name),h.transforms.add(l),h}registerNodeTransform(i,l){var h=this.registerNodeTransformToKlass(i,l);let y=[h];return h=h.replaceWithKlass,h!=null&&(h=this.registerNodeTransformToKlass(h,l),y.push(h)),jt(this,i.getType()),()=>{y.forEach(C=>C.transforms.delete(l))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,l){return at(this,i,l)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let l=this._rootElement;if(i!==l){let v=Bt(this._config.theme,"root");var h=this._pendingEditorState||this._editorState;if(this._rootElement=i,So(this,l,i,h),l!==null){if(!this._config.disableEvents){Ds!==0&&(Ds--,Ds===0&&l.ownerDocument.removeEventListener("selectionchange",xa));var y=l.__lexicalEditor;if(y!=null){if(y._parentEditor!==null){var C=pe(y);C=C[C.length-1]._key,is.get(C)===y&&is.delete(C)}else is.delete(y._key);l.__lexicalEditor=null}for(y=Ta(l),C=0;C<y.length;C++)y[C]();l.__lexicalEventHandles=[]}v!=null&&l.classList.remove(...v)}i!==null?(h=(h=i.ownerDocument)&&h.defaultView||null,y=i.style,y.userSelect="text",y.whiteSpace="pre-wrap",y.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=h,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),Hi(this),this._config.disableEvents||kc(i,this),v!=null&&i.classList.add(...v)):(this._editorState=h,this._window=this._pendingEditorState=null),Ni("root",this,!1,i,l)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,l){i.isEmpty()&&K(38),en(this);let h=this._pendingEditorState,y=this._updateTags;l=l!==void 0?l.tag:null,h===null||h.isEmpty()||(l!=null&&y.add(l),Hi(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,l!=null&&y.add(l),Hi(this)}parseEditorState(i,l){i=typeof i=="string"?JSON.parse(i):i;let h=Ki(),y=hn,C=Bn,v=wn,X=this._dirtyElements,he=this._dirtyLeaves,Me=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,hn=h,Bn=!1,wn=this;try{Eo(i.root,this._nodes),l&&l(),h._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=X,this._dirtyLeaves=he,this._cloneNotNeeded=Me,this._dirtyType=Ye,hn=y,Bn=C,wn=v}return h}update(i,l){Cr(this,i,l)}focus(i,l={}){let h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),Cr(this,()=>{let y=Vt(),C=bt();y!==null?y.dirty=!0:C.getChildrenSize()!==0&&(l.defaultSelection==="rootStart"?C.selectStart():C.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=Ur(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ni("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class vo extends Wi{constructor(i,l){super(l),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 zi(o){return o instanceof vo}class Rl extends Wi{}function bl(o){return o instanceof Rl}class ka extends Wi{}function kl(o){return o instanceof ka}return We.$INTERNAL_isPointSelection=Ps,We.$addUpdateTag=function(o){Vn(),fn()._updateTags.add(o)},We.$applyNodeReplacement=_r,We.$copyNode=Oi,We.$createLineBreakNode=jr,We.$createNodeSelection=Sl,We.$createParagraphNode=Fr,We.$createPoint=Lr,We.$createRangeSelection=function(){let o=Lr("root",0,"element"),i=Lr("root",0,"element");return new _i(o,i,0,"")},We.$createTabNode=Pi,We.$createTextNode=Kn,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=rr,We.$getNodeByKey=pt,We.$getPreviousSelection=Nr,We.$getRoot=bt,We.$getSelection=Vt,We.$getTextContent=function(){let o=Vt();return o===null?"":o.getTextContent()},We.$hasAncestor=jn,We.$hasUpdateTag=function(o){return fn()._updateTags.has(o)},We.$insertNodes=function(o){let i=Vt()||Nr();i===null&&(i=bt().selectEnd()),i.insertNodes(o)},We.$isBlockElementNode=function(o){return Je(o)&&!o.isInline()},We.$isDecoratorNode=Cn,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(o){return Je(o)&&o.isInline()||Cn(o)&&o.isInline()},We.$isLeafNode=function(o){return Ct(o)||bi(o)||Cn(o)},We.$isLineBreakNode=bi,We.$isNodeSelection=or,We.$isParagraphNode=function(o){return o instanceof $r},We.$isRangeSelection=Dt,We.$isRootNode=er,We.$isRootOrShadowRoot=ir,We.$isTabNode=wa,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=Pr();let l=i._readOnly,h=o.getType();i=i._nodeMap;let y=[];for(let[,C]of i)C instanceof o&&C.__type===h&&(l||C.isAttached())&&y.push(C);return y},We.$normalizeSelection__EXPERIMENTAL=Ie,We.$parseSerializedNode=function(o){return Eo(o,fn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),nn(Ie(o))},We.$setCompositionKey=ht,We.$setSelection=nn,We.$splitNode=function(o,i){let l=o.getChildAtIndex(i);l==null&&(l=o),ir(o)&&K(102);let h=v=>{const X=v.getParentOrThrow(),he=ir(X),Me=v!==l||he?Oi(v):v;if(he){if(!Je(v)||!Je(Me))throw Error("Children of a root must be ElementNode");return v.insertAfter(Me),[v,Me,Me]}const[Ye,Xe,Ke]=h(X);return v=v.getNextSiblings(),Ke.append(Me,...v),[Ye,Xe,Me]},[y,C]=h(l);return[y,C]},We.BLUR_COMMAND=Y,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=ue,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=T,We.DELETE_WORD_COMMAND=N,We.DEPRECATED_$computeGridMap=function(o,i,l){let h=[],y=null,C=null;o=o.getChildren();for(let Ye=0;Ye<o.length;Ye++){var v=o[Ye];kl(v)||K(108);var X=v.getChildren();v=0;for(let Xe of X){for(zi(Xe)||K(109);h[Ye]!==void 0&&h[Ye][v]!==void 0;)v++;X=Ye;var he=v,Me=Xe;let Ke={cell:Me,startColumn:he,startRow:X},Pe=Me.__rowSpan,gt=Me.__colSpan;for(let Ot=0;Ot<Pe;Ot++){h[X+Ot]===void 0&&(h[X+Ot]=[]);for(let Ft=0;Ft<gt;Ft++)h[X+Ot][he+Ft]=Ke}i.is(Me)&&(y=Ke),l.is(Me)&&(C=Ke),v+=Xe.__colSpan}}return y===null&&K(110),C===null&&K(111),[h,y,C]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,l]=Bs(o);o=l.getChildren();let h=o.length;var y=o[0].getChildren().length;let C=Array(h);for(var v=0;v<h;v++)C[v]=Array(y);for(y=0;y<h;y++){v=o[y].getChildren();let X=0;for(let he=0;he<v.length;he++){for(;C[y][X];)X++;let Me=v[he],Ye=Me.__rowSpan||1,Xe=Me.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)C[y+Ke][X+Pe]=Me;if(i===Me)return{colSpan:Xe,columnIndex:X,rowIndex:y,rowSpan:Ye};X+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=Bs,We.DEPRECATED_$isGridCellNode=zi,We.DEPRECATED_$isGridNode=bl,We.DEPRECATED_$isGridRowNode=kl,We.DEPRECATED_GridCellNode=vo,We.DEPRECATED_GridNode=Rl,We.DEPRECATED_GridRowNode=ka,We.DRAGEND_COMMAND=we,We.DRAGOVER_COMMAND=xe,We.DRAGSTART_COMMAND=V,We.DROP_COMMAND=B,We.DecoratorNode=To,We.ElementNode=Wi,We.FOCUS_COMMAND=S,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=R,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=c,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Ls,We.KEY_ARROW_DOWN_COMMAND=W,We.KEY_ARROW_LEFT_COMMAND=U,We.KEY_ARROW_RIGHT_COMMAND=E,We.KEY_ARROW_UP_COMMAND=F,We.KEY_BACKSPACE_COMMAND=le,We.KEY_DELETE_COMMAND=ge,We.KEY_DOWN_COMMAND=z,We.KEY_ENTER_COMMAND=G,We.KEY_ESCAPE_COMMAND=se,We.KEY_MODIFIER_COMMAND=ie,We.KEY_SPACE_COMMAND=q,We.KEY_TAB_COMMAND=j,We.LineBreakNode=Yr,We.MOVE_TO_END=x,We.MOVE_TO_START=Q,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=g,We.ParagraphNode=$r,We.REDO_COMMAND=k,We.REMOVE_TEXT_COMMAND=m,We.RootNode=lr,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=$,We.TabNode=os,We.TextNode=Li,We.UNDO_COMMAND=b,We.createCommand=function(){return{}},We.createEditor=function(o){var i=o||{},l=wn,h=i.theme||{};let y=o===void 0?l:i.parentEditor||null,C=i.disableEvents||!1,v=Ki(),X=i.namespace||(y!==null?y._config.namespace:Ze()),he=i.editorState,Me=[lr,Li,Yr,os,$r,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,o===void 0&&l!==null)o=l._nodes;else for(o=new Map,l=0;l<Me.length;l++){let Pe=Me[l],gt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,gt=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:gt,replaceWithKlass:Ke,transforms:zt})}return h=new Us(v,y,o,{disableEvents:C,namespace:X,theme:h},Ye||console.error,zs(o,Xe?Xe.import:void 0),i),he!==void 0&&(h._pendingEditorState=he,h._dirtyType=2),h},We.getNearestEditorFromDOMNode=vt,We.isCurrentlyReadOnlyMode=us,We.isHTMLAnchorElement=function(o){return ao(o)&&o.tagName==="A"},We.isHTMLElement=ao,We.isSelectionCapturedInDecoratorInput=it,We.isSelectionWithinEditor=st,We}var qc,lf;function gn(){return lf||(lf=1,qc=process.env.NODE_ENV==="development"?Wy():Ky()),qc}var af;function zy(){if(af)return Vc;af=1;var e=so,t=gn(),n=yt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const g={tag:"history-merge"};function m({initialConfig:T,children:R}){const b=n.useMemo(()=>{const{theme:k,namespace:z,editor__DEPRECATED:E,nodes:x,onError:U,editorState:Q,html:F}=T,W=e.createLexicalComposerContext(null,k);let G=E||null;if(G===null){const q=t.createEditor({editable:T.editable,html:F,namespace:z,nodes:x,onError:le=>U(le,q),theme:k});N(q,Q),G=q}return[G,W]},[]);return d(()=>{const k=T.editable,[z]=b;z.setEditable(k!==void 0?k:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:b},R)}function N(T,R){if(R!==null){if(R===void 0)T.update(()=>{const b=t.$getRoot();if(b.isEmpty()){const k=t.$createParagraphNode();b.append(k);const z=r?document.activeElement:null;(t.$getSelection()!==null||z!==null&&z===T.getRootElement())&&k.select()}},g);else if(R!==null)switch(typeof R){case"string":{const b=T.parseEditorState(R);T.setEditorState(b,g);break}case"object":{T.setEditorState(R,g);break}case"function":{T.update(()=>{t.$getRoot().isEmpty()&&R(T)},g);break}}}}return Vc.LexicalComposer=m,Vc}var Zc={},cf;function Uy(){if(cf)return Zc;cf=1;var e=so,t=gn(),n=yt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var c=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function g(m,N){if(N!==null){if(N===void 0)m.update(()=>{var T=t.$getRoot();if(T.isEmpty()){let R=t.$createParagraphNode();T.append(R),T=r?document.activeElement:null,(t.$getSelection()!==null||T!==null&&T===m.getRootElement())&&R.select()}},d);else if(N!==null)switch(typeof N){case"string":let T=m.parseEditorState(N);m.setEditorState(T,d);break;case"object":m.setEditorState(N,d);break;case"function":m.update(()=>{t.$getRoot().isEmpty()&&N(m)},d)}}}return Zc.LexicalComposer=function({initialConfig:m,children:N}){let T=n.useMemo(()=>{const{theme:R,namespace:b,editor__DEPRECATED:k,nodes:z,onError:E,editorState:x,html:U}=m,Q=e.createLexicalComposerContext(null,R);let F=k||null;if(F===null){const W=t.createEditor({editable:m.editable,html:U,namespace:b,nodes:z,onError:G=>E(G,W),theme:R});g(W,x),F=W}return[F,Q]},[]);return c(()=>{let R=m.editable,[b]=T;b.setEditable(R!==void 0?R:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:T},N)},Zc}const Gy=process.env.NODE_ENV==="development"?zy():Uy();var Yy=Gy,Zt={},Sn={},Gn={},uf;function jy(){if(uf)return Gn;uf=1;var e=gn();const t=new Map;function n($){let S=$;for(;S!=null;){if(S.nodeType===Node.TEXT_NODE)return S;S=S.firstChild}return null}function r($){const S=$.parentNode;if(S==null)throw new Error("Should never happen");return[S,Array.from(S.childNodes).indexOf($)]}function c($,S,Y,ie,K){const P=S.getKey(),Z=ie.getKey(),O=document.createRange();let H=$.getElementByKey(P),J=$.getElementByKey(Z),de=Y,_e=K;if(e.$isTextNode(S)&&(H=n(H)),e.$isTextNode(ie)&&(J=n(J)),S===void 0||ie===void 0||H===null||J===null)return null;H.nodeName==="BR"&&([H,de]=r(H)),J.nodeName==="BR"&&([J,_e]=r(J));const I=H.firstChild;H===J&&I!=null&&I.nodeName==="BR"&&de===0&&_e===0&&(_e=1);try{O.setStart(H,de),O.setEnd(J,_e)}catch{return null}return O.collapsed&&(de!==_e||P!==Z)&&(O.setStart(J,_e),O.setEnd(H,de)),O}function d($,S){const Y=$.getRootElement();if(Y===null)return[];const ie=Y.getBoundingClientRect(),K=getComputedStyle(Y),P=parseFloat(K.paddingLeft)+parseFloat(K.paddingRight),Z=Array.from(S.getClientRects());let O=Z.length;Z.sort((J,de)=>{const _e=J.top-de.top;return Math.abs(_e)<=3?J.left-de.left:_e});let H;for(let J=0;J<O;J++){const de=Z[J],_e=H&&H.top<=de.top&&H.top+H.height>de.top&&H.left+H.width>de.left,I=de.width+P===ie.width;if(_e||I){Z.splice(J--,1),O--;continue}H=de}return Z}function g($){const S={},Y=$.split(";");for(const ie of Y)if(ie!==""){const[K,P]=ie.split(/:([^]+)/);K&&P&&(S[K.trim()]=P.trim())}return S}function m($){let S=t.get($);return S===void 0&&(S=g($),t.set($,S)),Object.freeze(S),S}function N($){let S="";for(const Y in $)Y&&(S+=`${Y}: ${$[Y]};`);return S}function T($,S){return $.__first=S.__first,$.__last=S.__last,$.__size=S.__size,$.__format=S.__format,$.__indent=S.__indent,$.__dir=S.__dir,$}function R($,S){return $.__format=S.__format,$.__style=S.__style,$.__mode=S.__mode,$.__detail=S.__detail,$}function b($){const Y=$.constructor.clone($);return Y.__parent=$.__parent,Y.__next=$.__next,Y.__prev=$.__prev,e.$isElementNode($)&&e.$isElementNode(Y)?T(Y,$):e.$isTextNode($)&&e.$isTextNode(Y)?R(Y,$):Y}function k($,S){if(S.isSelected($)&&!S.isSegmented()&&!S.isToken()&&e.$INTERNAL_isPointSelection($)){const Y=$.anchor.getNode(),ie=$.focus.getNode(),K=S.is(Y),P=S.is(ie);if(K||P){const Z=$.isBackward(),[O,H]=$.getCharacterOffsets(),J=Y.is(ie),de=S.is(Z?ie:Y),_e=S.is(Z?Y:ie);let I=0,w;if(J)I=O>H?H:O,w=O>H?O:H;else if(de)I=Z?H:O,w=void 0;else if(_e){const D=Z?O:H;I=0,w=D}return S.__text=S.__text.slice(I,w),S}}return S}function z($){if($.type==="text")return $.offset===$.getNode().getTextContentSize();const S=$.getNode();if(!e.$isElementNode(S))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return $.offset===S.getChildrenSize()}function E($,S,Y){let ie=S.getNode(),K=Y;if(e.$isElementNode(ie)){const P=ie.getDescendantByIndex(S.offset);P!==null&&(ie=P)}for(;K>0&&ie!==null;){if(e.$isElementNode(ie)){const J=ie.getLastDescendant();J!==null&&(ie=J)}let P=ie.getPreviousSibling(),Z=0;if(P===null){let J=ie.getParentOrThrow(),de=J.getPreviousSibling();for(;de===null;){if(J=J.getParent(),J===null){P=null;break}de=J.getPreviousSibling()}J!==null&&(Z=J.isInline()?0:2,P=de)}let O=ie.getTextContent();O===""&&e.$isElementNode(ie)&&!ie.isInline()&&(O=`
|
|
70
|
+
`)}return i}getTextContentSize(){let i=0,l=this.getChildren(),h=l.length;for(let y=0;y<h;y++){let C=l[y];i+=C.getTextContentSize(),Je(C)&&y!==h-1&&!C.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,l){Vn();let h=Vt(),y=i,C=l;var v=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&l===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==v||l!==void 0&&l!==v)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(y===void 0&&(y=v),C===void 0&&(C=v),v=this.__key,Dt(h))h.anchor.set(v,y,"element"),h.focus.set(v,C,"element"),h.dirty=!0;else return xl(v,y,v,C,"element","element");return h}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(l=>l.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let l=this.getWritable();return l.__dir=i,l}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,l,h){let y=h.length,C=this.getChildrenSize(),v=this.getWritable(),X=v.__key;var he=[],Me=[];let Ye=this.getChildAtIndex(i+l),Xe=null,Ke=C-l+y;if(i!==0)if(i===C)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<l){var gt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<l;Pe++){gt===null&&K(100);var Ot=gt.getNextSibling(),Ft=gt.__key;gt=gt.getWritable(),Nt(gt),Me.push(Ft),gt=Ot}}for(Pe=Xe,Ot=0;Ot<y;Ot++){Ft=h[Ot],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),gt=Ft.getWritable(),gt.__parent===X&&Ke--,Nt(gt);let zt=Ft.__key;Pe===null?(v.__first=zt,gt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=zt,gt.__prev=Pe.__key),Ft.__key===X&&K(76),gt.__parent=X,he.push(zt),Pe=Ft}if(i+l===C?Pe!==null&&(Pe.getWritable().__next=null,v.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(l=Pe.getWritable(),i.__prev=Pe.__key,l.__next=Ye.__key):i.__prev=null),v.__size=Ke,Me.length&&(i=Vt(),Dt(i))){Me=new Set(Me),he=new Set(he);let{anchor:zt,focus:Un}=i;xo(zt,Me,he)&&cs(zt,zt.getNode(),this,Xe,Ye),xo(Un,Me,he)&&cs(Un,Un.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||ir(this)||this.remove()}return v}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 Ki}function xo(o,i,l){for(o=o.getNode();o;){let h=o.__key;if(i.has(h)&&!l.has(h))return!0;o=o.getParent()}return!1}class lr extends Ki{static getType(){return"root"}static clone(){return new lr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){K(51)}getTextContent(){let i=this.__cachedText;return!ds()&&fn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){K(52)}replace(){K(53)}insertBefore(){K(54)}insertAfter(){K(55)}updateDOM(){return!1}append(...i){for(let l=0;l<i.length;l++){let h=i[l];Je(h)||Cn(h)||K(56)}return super.append(...i)}static importJSON(i){let l=bt();return l.setFormat(i.format),l.setIndent(i.indent),l.setDirection(i.direction),l}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function er(o){return o instanceof lr}function Ml(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 zi(){return new Ks(new Map([["root",new lr]]))}function Dl(o){let i=o.exportJSON();var l=o.constructor;if(i.type!==l.getType()&&K(130,l.name),Je(o)){let h=i.children;for(Array.isArray(h)||K(59,l.name),o=o.getChildren(),l=0;l<o.length;l++){let y=Dl(o[l]);h.push(y)}}return i}class Ks{constructor(i,l){this._nodeMap=i,this._selection=l||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Ol(this,i)}clone(i){return i=new Ks(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ol(this,()=>({root:Dl(bt())}))}}class Fr extends Ki{static getType(){return"paragraph"}static clone(i){return new Fr(i.__key)}createDOM(i){let l=document.createElement("p");return i=Bt(i.theme,"paragraph"),i!==void 0&&l.classList.add(...i),l}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:zs,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&ao(i)){this.isEmpty()&&i.append(document.createElement("br"));var l=this.getFormatType();i.style.textAlign=l,(l=this.getDirection())&&(i.dir=l),l=this.getIndent(),0<l&&(i.style.textIndent=`${20*l}px`)}return{element:i}}static importJSON(i){let l=Br();return l.setFormat(i.format),l.setIndent(i.indent),l.setDirection(i.direction),l}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,l){i=Br();let h=this.getDirection();return i.setDirection(h),this.insertAfter(i,l),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 zs(o){let i=Br();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Br(){return _r(new Fr)}function So(o,i,l,h){let y=o._keyToDOMMap;y.clear(),o._editorState=zi(),o._pendingEditorState=h,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,h=o._observer,h!==null&&(h.disconnect(),o._observer=null),i!==null&&(i.textContent=""),l!==null&&(l.textContent="",y.set("root",l))}function Us(o,i){let l=new Map,h=new Set,y=C=>{Object.keys(C).forEach(v=>{let X=l.get(v);X===void 0&&(X=[],l.set(v,X)),X.push(C[v])})};return o.forEach(C=>{C=C.klass.importDOM!=null?C.klass.importDOM.bind(C.klass):null,C==null||h.has(C)||(h.add(C),C=C(),C!==null&&y(C))}),i&&y(i),l}class Gs{constructor(i,l,h,y,C,v,X){this._parentEditor=l,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=y,this._nodes=h,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=C,this._htmlConversions=v,this._editable=X,this._headless=l!==null&&l._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let l=this._listeners.update;return l.add(i),()=>{l.delete(i)}}registerEditableListener(i){let l=this._listeners.editable;return l.add(i),()=>{l.delete(i)}}registerDecoratorListener(i){let l=this._listeners.decorator;return l.add(i),()=>{l.delete(i)}}registerTextContentListener(i){let l=this._listeners.textcontent;return l.add(i),()=>{l.delete(i)}}registerRootListener(i){let l=this._listeners.root;return i(this._rootElement,null),l.add(i),()=>{i(null,this._rootElement),l.delete(i)}}registerCommand(i,l,h){h===void 0&&K(35);let y=this._commands;y.has(i)||y.set(i,[new Set,new Set,new Set,new Set,new Set]);let C=y.get(i);C===void 0&&K(36,String(i));let v=C[h];return v.add(l),()=>{v.delete(l),C.every(X=>X.size===0)&&y.delete(i)}}registerMutationListener(i,l){this._nodes.get(i.getType())===void 0&&K(37,i.name);let h=this._listeners.mutation;return h.set(l,i),()=>{h.delete(l)}}registerNodeTransformToKlass(i,l){var h=i.getType();return h=this._nodes.get(h),h===void 0&&K(37,i.name),h.transforms.add(l),h}registerNodeTransform(i,l){var h=this.registerNodeTransformToKlass(i,l);let y=[h];return h=h.replaceWithKlass,h!=null&&(h=this.registerNodeTransformToKlass(h,l),y.push(h)),jt(this,i.getType()),()=>{y.forEach(C=>C.transforms.delete(l))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,l){return at(this,i,l)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let l=this._rootElement;if(i!==l){let v=Bt(this._config.theme,"root");var h=this._pendingEditorState||this._editorState;if(this._rootElement=i,So(this,l,i,h),l!==null){if(!this._config.disableEvents){Rs!==0&&(Rs--,Rs===0&&l.ownerDocument.removeEventListener("selectionchange",xa));var y=l.__lexicalEditor;if(y!=null){if(y._parentEditor!==null){var C=pe(y);C=C[C.length-1]._key,ss.get(C)===y&&ss.delete(C)}else ss.delete(y._key);l.__lexicalEditor=null}for(y=Ta(l),C=0;C<y.length;C++)y[C]();l.__lexicalEventHandles=[]}v!=null&&l.classList.remove(...v)}i!==null?(h=(h=i.ownerDocument)&&h.defaultView||null,y=i.style,y.userSelect="text",y.whiteSpace="pre-wrap",y.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=h,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),Wi(this),this._config.disableEvents||kc(i,this),v!=null&&i.classList.add(...v)):(this._editorState=h,this._window=this._pendingEditorState=null),Ci("root",this,!1,i,l)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,l){i.isEmpty()&&K(38),en(this);let h=this._pendingEditorState,y=this._updateTags;l=l!==void 0?l.tag:null,h===null||h.isEmpty()||(l!=null&&y.add(l),Wi(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,l!=null&&y.add(l),Wi(this)}parseEditorState(i,l){i=typeof i=="string"?JSON.parse(i):i;let h=zi(),y=hn,C=Bn,v=wn,X=this._dirtyElements,he=this._dirtyLeaves,Me=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,hn=h,Bn=!1,wn=this;try{Eo(i.root,this._nodes),l&&l(),h._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=X,this._dirtyLeaves=he,this._cloneNotNeeded=Me,this._dirtyType=Ye,hn=y,Bn=C,wn=v}return h}update(i,l){Cr(this,i,l)}focus(i,l={}){let h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),Cr(this,()=>{let y=Vt(),C=bt();y!==null?y.dirty=!0:C.getChildrenSize()!==0&&(l.defaultSelection==="rootStart"?C.selectStart():C.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=Gr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ci("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class vo extends Ki{constructor(i,l){super(l),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 Ui(o){return o instanceof vo}class Rl extends Ki{}function bl(o){return o instanceof Rl}class ka extends Ki{}function kl(o){return o instanceof ka}return We.$INTERNAL_isPointSelection=$s,We.$addUpdateTag=function(o){Vn(),fn()._updateTags.add(o)},We.$applyNodeReplacement=_r,We.$copyNode=Ai,We.$createLineBreakNode=Vr,We.$createNodeSelection=Sl,We.$createParagraphNode=Br,We.$createPoint=Pr,We.$createRangeSelection=function(){let o=Pr("root",0,"element"),i=Pr("root",0,"element");return new yi(o,i,0,"")},We.$createTabNode=$i,We.$createTextNode=Kn,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=rr,We.$getNodeByKey=pt,We.$getPreviousSelection=Nr,We.$getRoot=bt,We.$getSelection=Vt,We.$getTextContent=function(){let o=Vt();return o===null?"":o.getTextContent()},We.$hasAncestor=jn,We.$hasUpdateTag=function(o){return fn()._updateTags.has(o)},We.$insertNodes=function(o){let i=Vt()||Nr();i===null&&(i=bt().selectEnd()),i.insertNodes(o)},We.$isBlockElementNode=function(o){return Je(o)&&!o.isInline()},We.$isDecoratorNode=Cn,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(o){return Je(o)&&o.isInline()||Cn(o)&&o.isInline()},We.$isLeafNode=function(o){return Ct(o)||ki(o)||Cn(o)},We.$isLineBreakNode=ki,We.$isNodeSelection=or,We.$isParagraphNode=function(o){return o instanceof Fr},We.$isRangeSelection=Dt,We.$isRootNode=er,We.$isRootOrShadowRoot=ir,We.$isTabNode=wa,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=$r();let l=i._readOnly,h=o.getType();i=i._nodeMap;let y=[];for(let[,C]of i)C instanceof o&&C.__type===h&&(l||C.isAttached())&&y.push(C);return y},We.$normalizeSelection__EXPERIMENTAL=Ie,We.$parseSerializedNode=function(o){return Eo(o,fn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),nn(Ie(o))},We.$setCompositionKey=ht,We.$setSelection=nn,We.$splitNode=function(o,i){let l=o.getChildAtIndex(i);l==null&&(l=o),ir(o)&&K(102);let h=v=>{const X=v.getParentOrThrow(),he=ir(X),Me=v!==l||he?Ai(v):v;if(he){if(!Je(v)||!Je(Me))throw Error("Children of a root must be ElementNode");return v.insertAfter(Me),[v,Me,Me]}const[Ye,Xe,Ke]=h(X);return v=v.getNextSiblings(),Ke.append(Me,...v),[Ye,Xe,Me]},[y,C]=h(l);return[y,C]},We.BLUR_COMMAND=Y,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=ue,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=T,We.DELETE_WORD_COMMAND=N,We.DEPRECATED_$computeGridMap=function(o,i,l){let h=[],y=null,C=null;o=o.getChildren();for(let Ye=0;Ye<o.length;Ye++){var v=o[Ye];kl(v)||K(108);var X=v.getChildren();v=0;for(let Xe of X){for(Ui(Xe)||K(109);h[Ye]!==void 0&&h[Ye][v]!==void 0;)v++;X=Ye;var he=v,Me=Xe;let Ke={cell:Me,startColumn:he,startRow:X},Pe=Me.__rowSpan,gt=Me.__colSpan;for(let Ot=0;Ot<Pe;Ot++){h[X+Ot]===void 0&&(h[X+Ot]=[]);for(let Ft=0;Ft<gt;Ft++)h[X+Ot][he+Ft]=Ke}i.is(Me)&&(y=Ke),l.is(Me)&&(C=Ke),v+=Xe.__colSpan}}return y===null&&K(110),C===null&&K(111),[h,y,C]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,l]=Hs(o);o=l.getChildren();let h=o.length;var y=o[0].getChildren().length;let C=Array(h);for(var v=0;v<h;v++)C[v]=Array(y);for(y=0;y<h;y++){v=o[y].getChildren();let X=0;for(let he=0;he<v.length;he++){for(;C[y][X];)X++;let Me=v[he],Ye=Me.__rowSpan||1,Xe=Me.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)C[y+Ke][X+Pe]=Me;if(i===Me)return{colSpan:Xe,columnIndex:X,rowIndex:y,rowSpan:Ye};X+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=Hs,We.DEPRECATED_$isGridCellNode=Ui,We.DEPRECATED_$isGridNode=bl,We.DEPRECATED_$isGridRowNode=kl,We.DEPRECATED_GridCellNode=vo,We.DEPRECATED_GridNode=Rl,We.DEPRECATED_GridRowNode=ka,We.DRAGEND_COMMAND=we,We.DRAGOVER_COMMAND=xe,We.DRAGSTART_COMMAND=V,We.DROP_COMMAND=B,We.DecoratorNode=To,We.ElementNode=Ki,We.FOCUS_COMMAND=S,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=R,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=c,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Ps,We.KEY_ARROW_DOWN_COMMAND=W,We.KEY_ARROW_LEFT_COMMAND=U,We.KEY_ARROW_RIGHT_COMMAND=E,We.KEY_ARROW_UP_COMMAND=F,We.KEY_BACKSPACE_COMMAND=le,We.KEY_DELETE_COMMAND=ge,We.KEY_DOWN_COMMAND=z,We.KEY_ENTER_COMMAND=G,We.KEY_ESCAPE_COMMAND=se,We.KEY_MODIFIER_COMMAND=ie,We.KEY_SPACE_COMMAND=q,We.KEY_TAB_COMMAND=j,We.LineBreakNode=jr,We.MOVE_TO_END=x,We.MOVE_TO_START=Q,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=g,We.ParagraphNode=Fr,We.REDO_COMMAND=k,We.REMOVE_TEXT_COMMAND=m,We.RootNode=lr,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=$,We.TabNode=ls,We.TextNode=Pi,We.UNDO_COMMAND=b,We.createCommand=function(){return{}},We.createEditor=function(o){var i=o||{},l=wn,h=i.theme||{};let y=o===void 0?l:i.parentEditor||null,C=i.disableEvents||!1,v=zi(),X=i.namespace||(y!==null?y._config.namespace:Ze()),he=i.editorState,Me=[lr,Pi,jr,ls,Fr,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,o===void 0&&l!==null)o=l._nodes;else for(o=new Map,l=0;l<Me.length;l++){let Pe=Me[l],gt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,gt=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:gt,replaceWithKlass:Ke,transforms:zt})}return h=new Gs(v,y,o,{disableEvents:C,namespace:X,theme:h},Ye||console.error,Us(o,Xe?Xe.import:void 0),i),he!==void 0&&(h._pendingEditorState=he,h._dirtyType=2),h},We.getNearestEditorFromDOMNode=vt,We.isCurrentlyReadOnlyMode=ds,We.isHTMLAnchorElement=function(o){return ao(o)&&o.tagName==="A"},We.isHTMLElement=ao,We.isSelectionCapturedInDecoratorInput=it,We.isSelectionWithinEditor=st,We}var qc,lf;function gn(){return lf||(lf=1,qc=process.env.NODE_ENV==="development"?Ky():zy()),qc}var af;function Uy(){if(af)return Vc;af=1;var e=so,t=gn(),n=yt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const g={tag:"history-merge"};function m({initialConfig:T,children:R}){const b=n.useMemo(()=>{const{theme:k,namespace:z,editor__DEPRECATED:E,nodes:x,onError:U,editorState:Q,html:F}=T,W=e.createLexicalComposerContext(null,k);let G=E||null;if(G===null){const q=t.createEditor({editable:T.editable,html:F,namespace:z,nodes:x,onError:le=>U(le,q),theme:k});N(q,Q),G=q}return[G,W]},[]);return d(()=>{const k=T.editable,[z]=b;z.setEditable(k!==void 0?k:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:b},R)}function N(T,R){if(R!==null){if(R===void 0)T.update(()=>{const b=t.$getRoot();if(b.isEmpty()){const k=t.$createParagraphNode();b.append(k);const z=r?document.activeElement:null;(t.$getSelection()!==null||z!==null&&z===T.getRootElement())&&k.select()}},g);else if(R!==null)switch(typeof R){case"string":{const b=T.parseEditorState(R);T.setEditorState(b,g);break}case"object":{T.setEditorState(R,g);break}case"function":{T.update(()=>{t.$getRoot().isEmpty()&&R(T)},g);break}}}}return Vc.LexicalComposer=m,Vc}var Zc={},cf;function Gy(){if(cf)return Zc;cf=1;var e=so,t=gn(),n=yt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var c=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function g(m,N){if(N!==null){if(N===void 0)m.update(()=>{var T=t.$getRoot();if(T.isEmpty()){let R=t.$createParagraphNode();T.append(R),T=r?document.activeElement:null,(t.$getSelection()!==null||T!==null&&T===m.getRootElement())&&R.select()}},d);else if(N!==null)switch(typeof N){case"string":let T=m.parseEditorState(N);m.setEditorState(T,d);break;case"object":m.setEditorState(N,d);break;case"function":m.update(()=>{t.$getRoot().isEmpty()&&N(m)},d)}}}return Zc.LexicalComposer=function({initialConfig:m,children:N}){let T=n.useMemo(()=>{const{theme:R,namespace:b,editor__DEPRECATED:k,nodes:z,onError:E,editorState:x,html:U}=m,Q=e.createLexicalComposerContext(null,R);let F=k||null;if(F===null){const W=t.createEditor({editable:m.editable,html:U,namespace:b,nodes:z,onError:G=>E(G,W),theme:R});g(W,x),F=W}return[F,Q]},[]);return c(()=>{let R=m.editable,[b]=T;b.setEditable(R!==void 0?R:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:T},N)},Zc}const Yy=process.env.NODE_ENV==="development"?Uy():Gy();var jy=Yy,Zt={},Sn={},Gn={},uf;function Vy(){if(uf)return Gn;uf=1;var e=gn();const t=new Map;function n($){let S=$;for(;S!=null;){if(S.nodeType===Node.TEXT_NODE)return S;S=S.firstChild}return null}function r($){const S=$.parentNode;if(S==null)throw new Error("Should never happen");return[S,Array.from(S.childNodes).indexOf($)]}function c($,S,Y,ie,K){const P=S.getKey(),Z=ie.getKey(),O=document.createRange();let H=$.getElementByKey(P),J=$.getElementByKey(Z),de=Y,_e=K;if(e.$isTextNode(S)&&(H=n(H)),e.$isTextNode(ie)&&(J=n(J)),S===void 0||ie===void 0||H===null||J===null)return null;H.nodeName==="BR"&&([H,de]=r(H)),J.nodeName==="BR"&&([J,_e]=r(J));const I=H.firstChild;H===J&&I!=null&&I.nodeName==="BR"&&de===0&&_e===0&&(_e=1);try{O.setStart(H,de),O.setEnd(J,_e)}catch{return null}return O.collapsed&&(de!==_e||P!==Z)&&(O.setStart(J,_e),O.setEnd(H,de)),O}function d($,S){const Y=$.getRootElement();if(Y===null)return[];const ie=Y.getBoundingClientRect(),K=getComputedStyle(Y),P=parseFloat(K.paddingLeft)+parseFloat(K.paddingRight),Z=Array.from(S.getClientRects());let O=Z.length;Z.sort((J,de)=>{const _e=J.top-de.top;return Math.abs(_e)<=3?J.left-de.left:_e});let H;for(let J=0;J<O;J++){const de=Z[J],_e=H&&H.top<=de.top&&H.top+H.height>de.top&&H.left+H.width>de.left,I=de.width+P===ie.width;if(_e||I){Z.splice(J--,1),O--;continue}H=de}return Z}function g($){const S={},Y=$.split(";");for(const ie of Y)if(ie!==""){const[K,P]=ie.split(/:([^]+)/);K&&P&&(S[K.trim()]=P.trim())}return S}function m($){let S=t.get($);return S===void 0&&(S=g($),t.set($,S)),Object.freeze(S),S}function N($){let S="";for(const Y in $)Y&&(S+=`${Y}: ${$[Y]};`);return S}function T($,S){return $.__first=S.__first,$.__last=S.__last,$.__size=S.__size,$.__format=S.__format,$.__indent=S.__indent,$.__dir=S.__dir,$}function R($,S){return $.__format=S.__format,$.__style=S.__style,$.__mode=S.__mode,$.__detail=S.__detail,$}function b($){const Y=$.constructor.clone($);return Y.__parent=$.__parent,Y.__next=$.__next,Y.__prev=$.__prev,e.$isElementNode($)&&e.$isElementNode(Y)?T(Y,$):e.$isTextNode($)&&e.$isTextNode(Y)?R(Y,$):Y}function k($,S){if(S.isSelected($)&&!S.isSegmented()&&!S.isToken()&&e.$INTERNAL_isPointSelection($)){const Y=$.anchor.getNode(),ie=$.focus.getNode(),K=S.is(Y),P=S.is(ie);if(K||P){const Z=$.isBackward(),[O,H]=$.getCharacterOffsets(),J=Y.is(ie),de=S.is(Z?ie:Y),_e=S.is(Z?Y:ie);let I=0,w;if(J)I=O>H?H:O,w=O>H?O:H;else if(de)I=Z?H:O,w=void 0;else if(_e){const D=Z?O:H;I=0,w=D}return S.__text=S.__text.slice(I,w),S}}return S}function z($){if($.type==="text")return $.offset===$.getNode().getTextContentSize();const S=$.getNode();if(!e.$isElementNode(S))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return $.offset===S.getChildrenSize()}function E($,S,Y){let ie=S.getNode(),K=Y;if(e.$isElementNode(ie)){const P=ie.getDescendantByIndex(S.offset);P!==null&&(ie=P)}for(;K>0&&ie!==null;){if(e.$isElementNode(ie)){const J=ie.getLastDescendant();J!==null&&(ie=J)}let P=ie.getPreviousSibling(),Z=0;if(P===null){let J=ie.getParentOrThrow(),de=J.getPreviousSibling();for(;de===null;){if(J=J.getParent(),J===null){P=null;break}de=J.getPreviousSibling()}J!==null&&(Z=J.isInline()?0:2,P=de)}let O=ie.getTextContent();O===""&&e.$isElementNode(ie)&&!ie.isInline()&&(O=`
|
|
71
71
|
|
|
72
|
-
`);const H=O.length;if(!e.$isTextNode(ie)||K>=H){const J=ie.getParent();ie.remove(),J!=null&&J.getChildrenSize()===0&&!e.$isRootNode(J)&&J.remove(),K-=H+Z,ie=P}else{const J=ie.getKey(),de=$.getEditorState().read(()=>{const w=e.$getNodeByKey(J);return e.$isTextNode(w)&&w.isSimpleText()?w.getTextContent():null}),_e=H-K,I=O.slice(0,_e);if(de!==null&&de!==O){const w=e.$getPreviousSelection();let D=ie;if(ie.isSimpleText())ie.setTextContent(de);else{const re=e.$createTextNode(de);ie.replace(re),D=re}if(e.$isRangeSelection(w)&&w.isCollapsed()){const re=w.anchor.offset;D.select(re,re)}}else if(ie.isSimpleText()){const w=S.key===J;let D=S.offset;D<K&&(D=H);const re=w?D-K:0,ye=w?D:_e;if(w&&re===0){const[Ae]=ie.splitText(re,ye);Ae.remove()}else{const[,Ae]=ie.splitText(re,ye);Ae.remove()}}else{const w=e.$createTextNode(I);ie.replace(w)}K=0}}}function x($){const S=$.getStyle(),Y=g(S);t.set(S,Y)}function U($,S){const Y=m("getStyle"in $?$.getStyle():$.style),ie=Object.entries(S).reduce((P,[Z,O])=>(O===null?delete P[Z]:P[Z]=O,P),{...Y}),K=N(ie);$.setStyle(K),t.set(K,ie)}function Q($,S){const Y=$.getNodes(),ie=Y.length;if(!e.$isRangeSelection($)){const te=e.$createRangeSelection(),ce=te.anchor,be=te.focus;for(let Ne=0;Ne<ie;Ne++){const Re=Y[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ce.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),Q(e.$normalizeSelection__EXPERIMENTAL(te),S))}e.$setSelection($);return}const K=ie-1;let P=Y[0],Z=Y[K];if($.isCollapsed()&&e.$isRangeSelection($)){U($,S);return}const O=$.anchor,H=$.focus,de=P.getTextContent().length,_e=H.offset;let I=O.offset;const w=O.isBefore(H);let D=w?I:_e,re=w?_e:I;const ye=w?O.type:H.type,Ae=w?H.type:O.type,ee=w?H.key:O.key;if(e.$isTextNode(P)&&D===de){const te=P.getNextSibling();e.$isTextNode(te)&&(I=0,D=0,P=te)}if(Y.length===1){if(e.$isTextNode(P)){if(D=ye==="element"?0:I>_e?_e:I,re=Ae==="element"?de:I>_e?I:_e,D===re)return;if(D===0&&re===de)U(P,S),P.select(D,re);else{const te=P.splitText(D,re),ce=D===0?te[0]:te[1];U(ce,S),ce.select(0,re-D)}}}else{if(e.$isTextNode(P)&&D<P.getTextContentSize()&&(D!==0&&(P=P.splitText(D)[1],D=0,O.set(P.getKey(),D,"text")),U(P,S)),e.$isTextNode(Z)){const ce=Z.getTextContent().length;Z.__key!==ee&&re!==0&&(re=ce),re!==ce&&([Z]=Z.splitText(re)),re!==0&&U(Z,S)}for(let te=1;te<K;te++){const ce=Y[te],be=ce.getKey();e.$isTextNode(ce)&&be!==P.getKey()&&be!==Z.getKey()&&!ce.isToken()&&U(ce,S)}}}function F($,S){if($.anchor.key==="root"){const K=S(),P=e.$getRoot(),Z=P.getFirstChild();Z?Z.replace(K,!0):P.append(K);return}const Y=$.getNodes(),ie=ue($.anchor.getNode(),Ee);ie&&Y.indexOf(ie)===-1&&Y.push(ie);for(let K=0;K<Y.length;K++){const P=Y[K];if(!Ee(P))continue;if(!e.$isElementNode(P))throw Error("Expected block node to be an ElementNode");const Z=S();Z.setFormat(P.getFormatType()),Z.setIndent(P.getIndent()),P.replace(Z,!0)}}function W($){return $.getNode().isAttached()}function G($){let S=$;for(;S!==null&&!e.$isRootOrShadowRoot(S);){const Y=S.getLatest(),ie=S.getParent();Y.getChildrenSize()===0&&S.remove(!0),S=ie}}function q($,S,Y=null){const ie=$.getNodes(),K=ie.length,P=$.anchor;if(K===0||K===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){const H=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),J=H.getChildren();let de=S();de.setFormat(H.getFormatType()),de.setIndent(H.getIndent()),J.forEach(_e=>de.append(_e)),Y&&(de=Y.append(de)),H.replace(de);return}let Z=null,O=[];for(let H=0;H<K;H++){const J=ie[H];e.$isRootOrShadowRoot(J)?(le($,O,O.length,S,Y),O=[],Z=J):Z===null||Z!==null&&e.$hasAncestor(J,Z)?O.push(J):(le($,O,O.length,S,Y),O=[J])}le($,O,O.length,S,Y)}function le($,S,Y,ie,K=null){if(S.length===0)return;const P=S[0],Z=new Map,O=[];let H=e.$isElementNode(P)?P:P.getParentOrThrow();H.isInline()&&(H=H.getParentOrThrow());let J=!1;for(;H!==null;){const D=H.getPreviousSibling();if(D!==null){H=D,J=!0;break}if(H=H.getParentOrThrow(),e.$isRootOrShadowRoot(H))break}const de=new Set;for(let D=0;D<Y;D++){const re=S[D];e.$isElementNode(re)&&re.getChildrenSize()===0&&de.add(re.getKey())}const _e=new Set;for(let D=0;D<Y;D++){const re=S[D];let ye=re.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(re)&&!_e.has(re.getKey())){const Ae=ye.getKey();if(Z.get(Ae)===void 0){const ee=ie();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),O.push(ee),Z.set(Ae,ee),ye.getChildren().forEach(te=>{ee.append(te),_e.add(te.getKey()),e.$isElementNode(te)&&te.getChildrenKeys().forEach(ce=>_e.add(ce))}),G(ye)}}else if(de.has(re.getKey())){if(!e.$isElementNode(re))throw Error("Expected node in emptyElements to be an ElementNode");const Ae=ie();Ae.setFormat(re.getFormatType()),Ae.setIndent(re.getIndent()),O.push(Ae),re.remove(!0)}}if(K!==null)for(let D=0;D<O.length;D++){const re=O[D];K.append(re)}let I=null;if(e.$isRootOrShadowRoot(H))if(J)if(K!==null)H.insertAfter(K);else for(let D=O.length-1;D>=0;D--){const re=O[D];H.insertAfter(re)}else{const D=H.getFirstChild();if(e.$isElementNode(D)&&(H=D),D===null)if(K)H.append(K);else for(let re=0;re<O.length;re++){const ye=O[re];H.append(ye),I=ye}else if(K!==null)D.insertBefore(K);else for(let re=0;re<O.length;re++){const ye=O[re];D.insertBefore(ye),I=ye}}else if(K)H.insertAfter(K);else for(let D=O.length-1;D>=0;D--){const re=O[D];H.insertAfter(re),I=re}const w=e.$getPreviousSelection();e.$isRangeSelection(w)&&W(w.anchor)&&W(w.focus)?e.$setSelection(w.clone()):I!==null?I.selectEnd():$.dirty=!0}function se($,S){const Y=e.$getAdjacentNode($.focus,S);return e.$isDecoratorNode(Y)&&!Y.isIsolated()||e.$isElementNode(Y)&&!Y.isInline()&&!Y.canBeEmpty()}function ge($,S,Y,ie){$.modify(S?"extend":"move",Y,ie)}function j($){const S=$.anchor.getNode();return(e.$isRootNode(S)?S:S.getParentOrThrow()).getDirection()==="rtl"}function B($,S,Y){const ie=j($);ge($,S,Y?!ie:ie,"character")}function V($){const S=$.anchor,Y=$.focus,P=S.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Z=P.getFirstDescendant(),O=P.getLastDescendant(),H="element",J="element",de=0;e.$isTextNode(Z)?H="text":!e.$isElementNode(Z)&&Z!==null&&(Z=Z.getParentOrThrow()),e.$isTextNode(O)?(J="text",de=O.getTextContentSize()):!e.$isElementNode(O)&&O!==null&&(O=O.getParentOrThrow()),Z&&O&&(S.set(Z.getKey(),0,H),Y.set(O.getKey(),de,J))}function xe($,S,Y){const ie=$.getStyle(),K=m(ie);return K!==null&&K[S]||Y}function we($,S,Y=""){let ie=null;const K=$.getNodes(),P=$.anchor,Z=$.focus,O=$.isBackward(),H=O?Z.offset:P.offset,J=O?Z.getNode():P.getNode();if($.isCollapsed()&&$.style!==""){const de=$.style,_e=m(de);if(_e!==null&&S in _e)return _e[S]}for(let de=0;de<K.length;de++){const _e=K[de];if(!(de!==0&&H===0&&_e.is(J))&&e.$isTextNode(_e)){const I=xe(_e,S,Y);if(ie===null)ie=I;else if(ie!==I){ie="";break}}}return ie===null?Y:ie}function Ee($){if(e.$isDecoratorNode($)&&!$.isInline())return!0;if(!e.$isElementNode($)||e.$isRootOrShadowRoot($))return!1;const S=$.getFirstChild(),Y=S===null||e.$isLineBreakNode(S)||e.$isTextNode(S)||S.isInline();return!$.isInline()&&$.canBeEmpty()!==!1&&Y}function ue($,S){let Y=$;for(;Y!==null&&Y.getParent()!==null&&!S(Y);)Y=Y.getParentOrThrow();return S(Y)?Y:null}return Gn.$addNodeStyle=x,Gn.$cloneWithProperties=b,Gn.$getSelectionStyleValueForProperty=we,Gn.$isAtNodeEnd=z,Gn.$isParentElementRTL=j,Gn.$moveCaretSelection=ge,Gn.$moveCharacter=B,Gn.$patchStyleText=Q,Gn.$selectAll=V,Gn.$setBlocksType=F,Gn.$shouldOverrideDefaultCharacterSelection=se,Gn.$sliceSelectedTextNodeContent=k,Gn.$wrapNodes=q,Gn.createDOMRange=c,Gn.createRectsFromDOMRange=d,Gn.getStyleObjectFromCSS=m,Gn.trimTextContentFromAnchor=E,Gn}var Yn={},df;function Vy(){if(df)return Yn;df=1;var e=gn();let t=new Map;function n(E){for(;E!=null;){if(E.nodeType===Node.TEXT_NODE)return E;E=E.firstChild}return null}function r(E){let x=E.parentNode;if(x==null)throw Error("Should never happen");return[x,Array.from(x.childNodes).indexOf(E)]}function c(E){let x={};E=E.split(";");for(let U of E)if(U!==""){let[Q,F]=U.split(/:([^]+)/);Q&&F&&(x[Q.trim()]=F.trim())}return x}function d(E){let x=t.get(E);return x===void 0&&(x=c(E),t.set(E,x)),x}function g(E){let x="";for(let U in E)U&&(x+=`${U}: ${E[U]};`);return x}function m(E,x){var U=d("getStyle"in E?E.getStyle():E.style);x=Object.entries(x).reduce((Q,[F,W])=>(W===null?delete Q[F]:Q[F]=W,Q),{...U}),U=g(x),E.setStyle(U),t.set(U,x)}function N(E,x){var U=E.getNodes(),Q=U.length;if(e.$isRangeSelection(E)){--Q;var F=U[0],W=U[Q];if(E.isCollapsed()&&e.$isRangeSelection(E))m(E,x);else{var G=E.anchor,q=E.focus,le=F.getTextContent().length,se=q.offset,ge=G.offset,j=G.isBefore(q),B=j?ge:se;E=j?se:ge;var V=j?G.type:q.type,xe=j?q.type:G.type;if(q=j?q.key:G.key,e.$isTextNode(F)&&B===le&&(j=F.getNextSibling(),e.$isTextNode(j)&&(B=ge=0,F=j)),U.length===1)e.$isTextNode(F)&&(B=V==="element"?0:ge>se?se:ge,E=xe==="element"?le:ge>se?ge:se,B!==E&&(B===0&&E===le?(m(F,x),F.select(B,E)):(U=F.splitText(B,E),U=B===0?U[0]:U[1],m(U,x),U.select(0,E-B))));else for(e.$isTextNode(F)&&B<F.getTextContentSize()&&(B!==0&&(F=F.splitText(B)[1],B=0,G.set(F.getKey(),B,"text")),m(F,x)),e.$isTextNode(W)&&(B=W.getTextContent().length,W.__key!==q&&E!==0&&(E=B),E!==B&&([W]=W.splitText(E)),E!==0&&m(W,x)),E=1;E<Q;E++)B=U[E],G=B.getKey(),e.$isTextNode(B)&&G!==F.getKey()&&G!==W.getKey()&&!B.isToken()&&m(B,x)}}else{for(F=e.$createRangeSelection(),W=F.anchor,B=F.focus,G=0;G<Q;G++)le=U[G],e.DEPRECATED_$isGridCellNode(le)&&(W.set(le.getKey(),0,"element"),B.set(le.getKey(),le.getChildrenSize(),"element"),N(e.$normalizeSelection__EXPERIMENTAL(F),x));e.$setSelection(E)}}function T(E){for(;E!==null&&!e.$isRootOrShadowRoot(E);){let x=E.getLatest(),U=E.getParent();x.getChildrenSize()===0&&E.remove(!0),E=U}}function R(E,x,U,Q,F=null){if(x.length!==0){var W=x[0],G=new Map,q=[];W=e.$isElementNode(W)?W:W.getParentOrThrow(),W.isInline()&&(W=W.getParentOrThrow());for(var le=!1;W!==null;){var se=W.getPreviousSibling();if(se!==null){W=se,le=!0;break}if(W=W.getParentOrThrow(),e.$isRootOrShadowRoot(W))break}se=new Set;for(var ge=0;ge<U;ge++){var j=x[ge];e.$isElementNode(j)&&j.getChildrenSize()===0&&se.add(j.getKey())}var B=new Set;for(ge=0;ge<U;ge++){j=x[ge];var V=j.getParent();if(V!==null&&V.isInline()&&(V=V.getParent()),V!==null&&e.$isLeafNode(j)&&!B.has(j.getKey())){if(j=V.getKey(),G.get(j)===void 0){let xe=Q();xe.setFormat(V.getFormatType()),xe.setIndent(V.getIndent()),q.push(xe),G.set(j,xe),V.getChildren().forEach(we=>{xe.append(we),B.add(we.getKey()),e.$isElementNode(we)&&we.getChildrenKeys().forEach(Ee=>B.add(Ee))}),T(V)}}else if(se.has(j.getKey())){if(!e.$isElementNode(j))throw Error("Expected node in emptyElements to be an ElementNode");V=Q(),V.setFormat(j.getFormatType()),V.setIndent(j.getIndent()),q.push(V),j.remove(!0)}}if(F!==null)for(x=0;x<q.length;x++)F.append(q[x]);if(x=null,e.$isRootOrShadowRoot(W))if(le)if(F!==null)W.insertAfter(F);else for(F=q.length-1;0<=F;F--)W.insertAfter(q[F]);else if(le=W.getFirstChild(),e.$isElementNode(le)&&(W=le),le===null)if(F)W.append(F);else for(F=0;F<q.length;F++)le=q[F],W.append(le),x=le;else if(F!==null)le.insertBefore(F);else for(W=0;W<q.length;W++)F=q[W],le.insertBefore(F),x=F;else if(F)W.insertAfter(F);else for(F=q.length-1;0<=F;F--)le=q[F],W.insertAfter(le),x=le;q=e.$getPreviousSelection(),e.$isRangeSelection(q)&&q.anchor.getNode().isAttached()&&q.focus.getNode().isAttached()?e.$setSelection(q.clone()):x!==null?x.selectEnd():E.dirty=!0}}function b(E,x,U,Q){E.modify(x?"extend":"move",U,Q)}function k(E){return E=E.anchor.getNode(),(e.$isRootNode(E)?E:E.getParentOrThrow()).getDirection()==="rtl"}function z(E){if(e.$isDecoratorNode(E)&&!E.isInline())return!0;if(!e.$isElementNode(E)||e.$isRootOrShadowRoot(E))return!1;var x=E.getFirstChild();return x=x===null||e.$isLineBreakNode(x)||e.$isTextNode(x)||x.isInline(),!E.isInline()&&E.canBeEmpty()!==!1&&x}return Yn.$addNodeStyle=function(E){E=E.getStyle();let x=c(E);t.set(E,x)},Yn.$cloneWithProperties=function(E){let x=E.constructor.clone(E);return x.__parent=E.__parent,x.__next=E.__next,x.__prev=E.__prev,e.$isElementNode(E)&&e.$isElementNode(x)?(x.__first=E.__first,x.__last=E.__last,x.__size=E.__size,x.__format=E.__format,x.__indent=E.__indent,x.__dir=E.__dir,x):(e.$isTextNode(E)&&e.$isTextNode(x)&&(x.__format=E.__format,x.__style=E.__style,x.__mode=E.__mode,x.__detail=E.__detail),x)},Yn.$getSelectionStyleValueForProperty=function(E,x,U=""){let Q=null,F=E.getNodes();var W=E.anchor,G=E.focus,q=E.isBackward();let le=q?G.offset:W.offset;if(W=q?G.getNode():W.getNode(),E.isCollapsed()&&E.style!==""&&(E=d(E.style),E!==null&&x in E))return E[x];for(E=0;E<F.length;E++){var se=F[E];if((E===0||le!==0||!se.is(W))&&e.$isTextNode(se)){if(G=x,q=U,se=se.getStyle(),se=d(se),G=se!==null&&se[G]||q,Q===null)Q=G;else if(Q!==G){Q="";break}}}return Q===null?U:Q},Yn.$isAtNodeEnd=function(E){if(E.type==="text")return E.offset===E.getNode().getTextContentSize();let x=E.getNode();if(!e.$isElementNode(x))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return E.offset===x.getChildrenSize()},Yn.$isParentElementRTL=k,Yn.$moveCaretSelection=b,Yn.$moveCharacter=function(E,x,U){let Q=k(E);b(E,x,U?!Q:Q,"character")},Yn.$patchStyleText=N,Yn.$selectAll=function(E){let x=E.anchor;E=E.focus;var U=x.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Q=U.getFirstDescendant();U=U.getLastDescendant();let F="element",W="element",G=0;e.$isTextNode(Q)?F="text":e.$isElementNode(Q)||Q===null||(Q=Q.getParentOrThrow()),e.$isTextNode(U)?(W="text",G=U.getTextContentSize()):e.$isElementNode(U)||U===null||(U=U.getParentOrThrow()),Q&&U&&(x.set(Q.getKey(),0,F),E.set(U.getKey(),G,W))},Yn.$setBlocksType=function(E,x){if(E.anchor.key==="root"){x=x();var U=e.$getRoot();(E=U.getFirstChild())?E.replace(x,!0):U.append(x)}else{for(U=E.getNodes(),E=E.anchor.getNode();E!==null&&E.getParent()!==null&&!z(E);)E=E.getParentOrThrow();for((E=z(E)?E:null)&&U.indexOf(E)===-1&&U.push(E),E=0;E<U.length;E++){let Q=U[E];if(!z(Q))continue;if(!e.$isElementNode(Q))throw Error("Expected block node to be an ElementNode");let F=x();F.setFormat(Q.getFormatType()),F.setIndent(Q.getIndent()),Q.replace(F,!0)}}},Yn.$shouldOverrideDefaultCharacterSelection=function(E,x){return E=e.$getAdjacentNode(E.focus,x),e.$isDecoratorNode(E)&&!E.isIsolated()||e.$isElementNode(E)&&!E.isInline()&&!E.canBeEmpty()},Yn.$sliceSelectedTextNodeContent=function(E,x){if(x.isSelected(E)&&!x.isSegmented()&&!x.isToken()&&e.$INTERNAL_isPointSelection(E)){var U=E.anchor.getNode(),Q=E.focus.getNode(),F=x.is(U),W=x.is(Q);if(F||W){F=E.isBackward();let[G,q]=E.getCharacterOffsets();E=U.is(Q),W=x.is(F?Q:U),Q=x.is(F?U:Q),U=0;let le;E?(U=G>q?q:G,le=G>q?G:q):W?(U=F?q:G,le=void 0):Q&&(F=F?G:q,U=0,le=F),x.__text=x.__text.slice(U,le)}}return x},Yn.$wrapNodes=function(E,x,U=null){var Q=E.getNodes();let F=Q.length;var W=E.anchor;if(F===0||F===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){E=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),Q=E.getChildren();let q=x();q.setFormat(E.getFormatType()),q.setIndent(E.getIndent()),Q.forEach(le=>q.append(le)),U&&(q=U.append(q)),E.replace(q)}else{W=null;var G=[];for(let q=0;q<F;q++){let le=Q[q];e.$isRootOrShadowRoot(le)?(R(E,G,G.length,x,U),G=[],W=le):W===null||W!==null&&e.$hasAncestor(le,W)?G.push(le):(R(E,G,G.length,x,U),G=[le])}R(E,G,G.length,x,U)}},Yn.createDOMRange=function(E,x,U,Q,F){let W=x.getKey(),G=Q.getKey(),q=document.createRange(),le=E.getElementByKey(W);if(E=E.getElementByKey(G),e.$isTextNode(x)&&(le=n(le)),e.$isTextNode(Q)&&(E=n(E)),x===void 0||Q===void 0||le===null||E===null)return null;le.nodeName==="BR"&&([le,U]=r(le)),E.nodeName==="BR"&&([E,F]=r(E)),x=le.firstChild,le===E&&x!=null&&x.nodeName==="BR"&&U===0&&F===0&&(F=1);try{q.setStart(le,U),q.setEnd(E,F)}catch{return null}return!q.collapsed||U===F&&W===G||(q.setStart(E,F),q.setEnd(le,U)),q},Yn.createRectsFromDOMRange=function(E,x){var U=E.getRootElement();if(U===null)return[];E=U.getBoundingClientRect(),U=getComputedStyle(U),U=parseFloat(U.paddingLeft)+parseFloat(U.paddingRight),x=Array.from(x.getClientRects());let Q=x.length;x.sort((W,G)=>{let q=W.top-G.top;return 3>=Math.abs(q)?W.left-G.left:q});let F;for(let W=0;W<Q;W++){let G=x[W],q=G.width+U===E.width;F&&F.top<=G.top&&F.top+F.height>G.top&&F.left+F.width>G.left||q?(x.splice(W--,1),Q--):F=G}return x},Yn.getStyleObjectFromCSS=d,Yn.trimTextContentFromAnchor=function(E,x,U){let Q=x.getNode();if(e.$isElementNode(Q)){var F=Q.getDescendantByIndex(x.offset);F!==null&&(Q=F)}for(;0<U&&Q!==null;){e.$isElementNode(Q)&&(F=Q.getLastDescendant(),F!==null&&(Q=F));var W=Q.getPreviousSibling(),G=0;if(W===null){F=Q.getParentOrThrow();for(var q=F.getPreviousSibling();q===null;){if(F=F.getParent(),F===null){W=null;break}q=F.getPreviousSibling()}F!==null&&(G=F.isInline()?0:2,W=q)}if(q=Q.getTextContent(),q===""&&e.$isElementNode(Q)&&!Q.isInline()&&(q=`
|
|
72
|
+
`);const H=O.length;if(!e.$isTextNode(ie)||K>=H){const J=ie.getParent();ie.remove(),J!=null&&J.getChildrenSize()===0&&!e.$isRootNode(J)&&J.remove(),K-=H+Z,ie=P}else{const J=ie.getKey(),de=$.getEditorState().read(()=>{const w=e.$getNodeByKey(J);return e.$isTextNode(w)&&w.isSimpleText()?w.getTextContent():null}),_e=H-K,I=O.slice(0,_e);if(de!==null&&de!==O){const w=e.$getPreviousSelection();let D=ie;if(ie.isSimpleText())ie.setTextContent(de);else{const re=e.$createTextNode(de);ie.replace(re),D=re}if(e.$isRangeSelection(w)&&w.isCollapsed()){const re=w.anchor.offset;D.select(re,re)}}else if(ie.isSimpleText()){const w=S.key===J;let D=S.offset;D<K&&(D=H);const re=w?D-K:0,ye=w?D:_e;if(w&&re===0){const[Ae]=ie.splitText(re,ye);Ae.remove()}else{const[,Ae]=ie.splitText(re,ye);Ae.remove()}}else{const w=e.$createTextNode(I);ie.replace(w)}K=0}}}function x($){const S=$.getStyle(),Y=g(S);t.set(S,Y)}function U($,S){const Y=m("getStyle"in $?$.getStyle():$.style),ie=Object.entries(S).reduce((P,[Z,O])=>(O===null?delete P[Z]:P[Z]=O,P),{...Y}),K=N(ie);$.setStyle(K),t.set(K,ie)}function Q($,S){const Y=$.getNodes(),ie=Y.length;if(!e.$isRangeSelection($)){const te=e.$createRangeSelection(),ce=te.anchor,be=te.focus;for(let Ne=0;Ne<ie;Ne++){const Re=Y[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ce.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),Q(e.$normalizeSelection__EXPERIMENTAL(te),S))}e.$setSelection($);return}const K=ie-1;let P=Y[0],Z=Y[K];if($.isCollapsed()&&e.$isRangeSelection($)){U($,S);return}const O=$.anchor,H=$.focus,de=P.getTextContent().length,_e=H.offset;let I=O.offset;const w=O.isBefore(H);let D=w?I:_e,re=w?_e:I;const ye=w?O.type:H.type,Ae=w?H.type:O.type,ee=w?H.key:O.key;if(e.$isTextNode(P)&&D===de){const te=P.getNextSibling();e.$isTextNode(te)&&(I=0,D=0,P=te)}if(Y.length===1){if(e.$isTextNode(P)){if(D=ye==="element"?0:I>_e?_e:I,re=Ae==="element"?de:I>_e?I:_e,D===re)return;if(D===0&&re===de)U(P,S),P.select(D,re);else{const te=P.splitText(D,re),ce=D===0?te[0]:te[1];U(ce,S),ce.select(0,re-D)}}}else{if(e.$isTextNode(P)&&D<P.getTextContentSize()&&(D!==0&&(P=P.splitText(D)[1],D=0,O.set(P.getKey(),D,"text")),U(P,S)),e.$isTextNode(Z)){const ce=Z.getTextContent().length;Z.__key!==ee&&re!==0&&(re=ce),re!==ce&&([Z]=Z.splitText(re)),re!==0&&U(Z,S)}for(let te=1;te<K;te++){const ce=Y[te],be=ce.getKey();e.$isTextNode(ce)&&be!==P.getKey()&&be!==Z.getKey()&&!ce.isToken()&&U(ce,S)}}}function F($,S){if($.anchor.key==="root"){const K=S(),P=e.$getRoot(),Z=P.getFirstChild();Z?Z.replace(K,!0):P.append(K);return}const Y=$.getNodes(),ie=ue($.anchor.getNode(),Ee);ie&&Y.indexOf(ie)===-1&&Y.push(ie);for(let K=0;K<Y.length;K++){const P=Y[K];if(!Ee(P))continue;if(!e.$isElementNode(P))throw Error("Expected block node to be an ElementNode");const Z=S();Z.setFormat(P.getFormatType()),Z.setIndent(P.getIndent()),P.replace(Z,!0)}}function W($){return $.getNode().isAttached()}function G($){let S=$;for(;S!==null&&!e.$isRootOrShadowRoot(S);){const Y=S.getLatest(),ie=S.getParent();Y.getChildrenSize()===0&&S.remove(!0),S=ie}}function q($,S,Y=null){const ie=$.getNodes(),K=ie.length,P=$.anchor;if(K===0||K===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){const H=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),J=H.getChildren();let de=S();de.setFormat(H.getFormatType()),de.setIndent(H.getIndent()),J.forEach(_e=>de.append(_e)),Y&&(de=Y.append(de)),H.replace(de);return}let Z=null,O=[];for(let H=0;H<K;H++){const J=ie[H];e.$isRootOrShadowRoot(J)?(le($,O,O.length,S,Y),O=[],Z=J):Z===null||Z!==null&&e.$hasAncestor(J,Z)?O.push(J):(le($,O,O.length,S,Y),O=[J])}le($,O,O.length,S,Y)}function le($,S,Y,ie,K=null){if(S.length===0)return;const P=S[0],Z=new Map,O=[];let H=e.$isElementNode(P)?P:P.getParentOrThrow();H.isInline()&&(H=H.getParentOrThrow());let J=!1;for(;H!==null;){const D=H.getPreviousSibling();if(D!==null){H=D,J=!0;break}if(H=H.getParentOrThrow(),e.$isRootOrShadowRoot(H))break}const de=new Set;for(let D=0;D<Y;D++){const re=S[D];e.$isElementNode(re)&&re.getChildrenSize()===0&&de.add(re.getKey())}const _e=new Set;for(let D=0;D<Y;D++){const re=S[D];let ye=re.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(re)&&!_e.has(re.getKey())){const Ae=ye.getKey();if(Z.get(Ae)===void 0){const ee=ie();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),O.push(ee),Z.set(Ae,ee),ye.getChildren().forEach(te=>{ee.append(te),_e.add(te.getKey()),e.$isElementNode(te)&&te.getChildrenKeys().forEach(ce=>_e.add(ce))}),G(ye)}}else if(de.has(re.getKey())){if(!e.$isElementNode(re))throw Error("Expected node in emptyElements to be an ElementNode");const Ae=ie();Ae.setFormat(re.getFormatType()),Ae.setIndent(re.getIndent()),O.push(Ae),re.remove(!0)}}if(K!==null)for(let D=0;D<O.length;D++){const re=O[D];K.append(re)}let I=null;if(e.$isRootOrShadowRoot(H))if(J)if(K!==null)H.insertAfter(K);else for(let D=O.length-1;D>=0;D--){const re=O[D];H.insertAfter(re)}else{const D=H.getFirstChild();if(e.$isElementNode(D)&&(H=D),D===null)if(K)H.append(K);else for(let re=0;re<O.length;re++){const ye=O[re];H.append(ye),I=ye}else if(K!==null)D.insertBefore(K);else for(let re=0;re<O.length;re++){const ye=O[re];D.insertBefore(ye),I=ye}}else if(K)H.insertAfter(K);else for(let D=O.length-1;D>=0;D--){const re=O[D];H.insertAfter(re),I=re}const w=e.$getPreviousSelection();e.$isRangeSelection(w)&&W(w.anchor)&&W(w.focus)?e.$setSelection(w.clone()):I!==null?I.selectEnd():$.dirty=!0}function se($,S){const Y=e.$getAdjacentNode($.focus,S);return e.$isDecoratorNode(Y)&&!Y.isIsolated()||e.$isElementNode(Y)&&!Y.isInline()&&!Y.canBeEmpty()}function ge($,S,Y,ie){$.modify(S?"extend":"move",Y,ie)}function j($){const S=$.anchor.getNode();return(e.$isRootNode(S)?S:S.getParentOrThrow()).getDirection()==="rtl"}function B($,S,Y){const ie=j($);ge($,S,Y?!ie:ie,"character")}function V($){const S=$.anchor,Y=$.focus,P=S.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Z=P.getFirstDescendant(),O=P.getLastDescendant(),H="element",J="element",de=0;e.$isTextNode(Z)?H="text":!e.$isElementNode(Z)&&Z!==null&&(Z=Z.getParentOrThrow()),e.$isTextNode(O)?(J="text",de=O.getTextContentSize()):!e.$isElementNode(O)&&O!==null&&(O=O.getParentOrThrow()),Z&&O&&(S.set(Z.getKey(),0,H),Y.set(O.getKey(),de,J))}function xe($,S,Y){const ie=$.getStyle(),K=m(ie);return K!==null&&K[S]||Y}function we($,S,Y=""){let ie=null;const K=$.getNodes(),P=$.anchor,Z=$.focus,O=$.isBackward(),H=O?Z.offset:P.offset,J=O?Z.getNode():P.getNode();if($.isCollapsed()&&$.style!==""){const de=$.style,_e=m(de);if(_e!==null&&S in _e)return _e[S]}for(let de=0;de<K.length;de++){const _e=K[de];if(!(de!==0&&H===0&&_e.is(J))&&e.$isTextNode(_e)){const I=xe(_e,S,Y);if(ie===null)ie=I;else if(ie!==I){ie="";break}}}return ie===null?Y:ie}function Ee($){if(e.$isDecoratorNode($)&&!$.isInline())return!0;if(!e.$isElementNode($)||e.$isRootOrShadowRoot($))return!1;const S=$.getFirstChild(),Y=S===null||e.$isLineBreakNode(S)||e.$isTextNode(S)||S.isInline();return!$.isInline()&&$.canBeEmpty()!==!1&&Y}function ue($,S){let Y=$;for(;Y!==null&&Y.getParent()!==null&&!S(Y);)Y=Y.getParentOrThrow();return S(Y)?Y:null}return Gn.$addNodeStyle=x,Gn.$cloneWithProperties=b,Gn.$getSelectionStyleValueForProperty=we,Gn.$isAtNodeEnd=z,Gn.$isParentElementRTL=j,Gn.$moveCaretSelection=ge,Gn.$moveCharacter=B,Gn.$patchStyleText=Q,Gn.$selectAll=V,Gn.$setBlocksType=F,Gn.$shouldOverrideDefaultCharacterSelection=se,Gn.$sliceSelectedTextNodeContent=k,Gn.$wrapNodes=q,Gn.createDOMRange=c,Gn.createRectsFromDOMRange=d,Gn.getStyleObjectFromCSS=m,Gn.trimTextContentFromAnchor=E,Gn}var Yn={},df;function qy(){if(df)return Yn;df=1;var e=gn();let t=new Map;function n(E){for(;E!=null;){if(E.nodeType===Node.TEXT_NODE)return E;E=E.firstChild}return null}function r(E){let x=E.parentNode;if(x==null)throw Error("Should never happen");return[x,Array.from(x.childNodes).indexOf(E)]}function c(E){let x={};E=E.split(";");for(let U of E)if(U!==""){let[Q,F]=U.split(/:([^]+)/);Q&&F&&(x[Q.trim()]=F.trim())}return x}function d(E){let x=t.get(E);return x===void 0&&(x=c(E),t.set(E,x)),x}function g(E){let x="";for(let U in E)U&&(x+=`${U}: ${E[U]};`);return x}function m(E,x){var U=d("getStyle"in E?E.getStyle():E.style);x=Object.entries(x).reduce((Q,[F,W])=>(W===null?delete Q[F]:Q[F]=W,Q),{...U}),U=g(x),E.setStyle(U),t.set(U,x)}function N(E,x){var U=E.getNodes(),Q=U.length;if(e.$isRangeSelection(E)){--Q;var F=U[0],W=U[Q];if(E.isCollapsed()&&e.$isRangeSelection(E))m(E,x);else{var G=E.anchor,q=E.focus,le=F.getTextContent().length,se=q.offset,ge=G.offset,j=G.isBefore(q),B=j?ge:se;E=j?se:ge;var V=j?G.type:q.type,xe=j?q.type:G.type;if(q=j?q.key:G.key,e.$isTextNode(F)&&B===le&&(j=F.getNextSibling(),e.$isTextNode(j)&&(B=ge=0,F=j)),U.length===1)e.$isTextNode(F)&&(B=V==="element"?0:ge>se?se:ge,E=xe==="element"?le:ge>se?ge:se,B!==E&&(B===0&&E===le?(m(F,x),F.select(B,E)):(U=F.splitText(B,E),U=B===0?U[0]:U[1],m(U,x),U.select(0,E-B))));else for(e.$isTextNode(F)&&B<F.getTextContentSize()&&(B!==0&&(F=F.splitText(B)[1],B=0,G.set(F.getKey(),B,"text")),m(F,x)),e.$isTextNode(W)&&(B=W.getTextContent().length,W.__key!==q&&E!==0&&(E=B),E!==B&&([W]=W.splitText(E)),E!==0&&m(W,x)),E=1;E<Q;E++)B=U[E],G=B.getKey(),e.$isTextNode(B)&&G!==F.getKey()&&G!==W.getKey()&&!B.isToken()&&m(B,x)}}else{for(F=e.$createRangeSelection(),W=F.anchor,B=F.focus,G=0;G<Q;G++)le=U[G],e.DEPRECATED_$isGridCellNode(le)&&(W.set(le.getKey(),0,"element"),B.set(le.getKey(),le.getChildrenSize(),"element"),N(e.$normalizeSelection__EXPERIMENTAL(F),x));e.$setSelection(E)}}function T(E){for(;E!==null&&!e.$isRootOrShadowRoot(E);){let x=E.getLatest(),U=E.getParent();x.getChildrenSize()===0&&E.remove(!0),E=U}}function R(E,x,U,Q,F=null){if(x.length!==0){var W=x[0],G=new Map,q=[];W=e.$isElementNode(W)?W:W.getParentOrThrow(),W.isInline()&&(W=W.getParentOrThrow());for(var le=!1;W!==null;){var se=W.getPreviousSibling();if(se!==null){W=se,le=!0;break}if(W=W.getParentOrThrow(),e.$isRootOrShadowRoot(W))break}se=new Set;for(var ge=0;ge<U;ge++){var j=x[ge];e.$isElementNode(j)&&j.getChildrenSize()===0&&se.add(j.getKey())}var B=new Set;for(ge=0;ge<U;ge++){j=x[ge];var V=j.getParent();if(V!==null&&V.isInline()&&(V=V.getParent()),V!==null&&e.$isLeafNode(j)&&!B.has(j.getKey())){if(j=V.getKey(),G.get(j)===void 0){let xe=Q();xe.setFormat(V.getFormatType()),xe.setIndent(V.getIndent()),q.push(xe),G.set(j,xe),V.getChildren().forEach(we=>{xe.append(we),B.add(we.getKey()),e.$isElementNode(we)&&we.getChildrenKeys().forEach(Ee=>B.add(Ee))}),T(V)}}else if(se.has(j.getKey())){if(!e.$isElementNode(j))throw Error("Expected node in emptyElements to be an ElementNode");V=Q(),V.setFormat(j.getFormatType()),V.setIndent(j.getIndent()),q.push(V),j.remove(!0)}}if(F!==null)for(x=0;x<q.length;x++)F.append(q[x]);if(x=null,e.$isRootOrShadowRoot(W))if(le)if(F!==null)W.insertAfter(F);else for(F=q.length-1;0<=F;F--)W.insertAfter(q[F]);else if(le=W.getFirstChild(),e.$isElementNode(le)&&(W=le),le===null)if(F)W.append(F);else for(F=0;F<q.length;F++)le=q[F],W.append(le),x=le;else if(F!==null)le.insertBefore(F);else for(W=0;W<q.length;W++)F=q[W],le.insertBefore(F),x=F;else if(F)W.insertAfter(F);else for(F=q.length-1;0<=F;F--)le=q[F],W.insertAfter(le),x=le;q=e.$getPreviousSelection(),e.$isRangeSelection(q)&&q.anchor.getNode().isAttached()&&q.focus.getNode().isAttached()?e.$setSelection(q.clone()):x!==null?x.selectEnd():E.dirty=!0}}function b(E,x,U,Q){E.modify(x?"extend":"move",U,Q)}function k(E){return E=E.anchor.getNode(),(e.$isRootNode(E)?E:E.getParentOrThrow()).getDirection()==="rtl"}function z(E){if(e.$isDecoratorNode(E)&&!E.isInline())return!0;if(!e.$isElementNode(E)||e.$isRootOrShadowRoot(E))return!1;var x=E.getFirstChild();return x=x===null||e.$isLineBreakNode(x)||e.$isTextNode(x)||x.isInline(),!E.isInline()&&E.canBeEmpty()!==!1&&x}return Yn.$addNodeStyle=function(E){E=E.getStyle();let x=c(E);t.set(E,x)},Yn.$cloneWithProperties=function(E){let x=E.constructor.clone(E);return x.__parent=E.__parent,x.__next=E.__next,x.__prev=E.__prev,e.$isElementNode(E)&&e.$isElementNode(x)?(x.__first=E.__first,x.__last=E.__last,x.__size=E.__size,x.__format=E.__format,x.__indent=E.__indent,x.__dir=E.__dir,x):(e.$isTextNode(E)&&e.$isTextNode(x)&&(x.__format=E.__format,x.__style=E.__style,x.__mode=E.__mode,x.__detail=E.__detail),x)},Yn.$getSelectionStyleValueForProperty=function(E,x,U=""){let Q=null,F=E.getNodes();var W=E.anchor,G=E.focus,q=E.isBackward();let le=q?G.offset:W.offset;if(W=q?G.getNode():W.getNode(),E.isCollapsed()&&E.style!==""&&(E=d(E.style),E!==null&&x in E))return E[x];for(E=0;E<F.length;E++){var se=F[E];if((E===0||le!==0||!se.is(W))&&e.$isTextNode(se)){if(G=x,q=U,se=se.getStyle(),se=d(se),G=se!==null&&se[G]||q,Q===null)Q=G;else if(Q!==G){Q="";break}}}return Q===null?U:Q},Yn.$isAtNodeEnd=function(E){if(E.type==="text")return E.offset===E.getNode().getTextContentSize();let x=E.getNode();if(!e.$isElementNode(x))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return E.offset===x.getChildrenSize()},Yn.$isParentElementRTL=k,Yn.$moveCaretSelection=b,Yn.$moveCharacter=function(E,x,U){let Q=k(E);b(E,x,U?!Q:Q,"character")},Yn.$patchStyleText=N,Yn.$selectAll=function(E){let x=E.anchor;E=E.focus;var U=x.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Q=U.getFirstDescendant();U=U.getLastDescendant();let F="element",W="element",G=0;e.$isTextNode(Q)?F="text":e.$isElementNode(Q)||Q===null||(Q=Q.getParentOrThrow()),e.$isTextNode(U)?(W="text",G=U.getTextContentSize()):e.$isElementNode(U)||U===null||(U=U.getParentOrThrow()),Q&&U&&(x.set(Q.getKey(),0,F),E.set(U.getKey(),G,W))},Yn.$setBlocksType=function(E,x){if(E.anchor.key==="root"){x=x();var U=e.$getRoot();(E=U.getFirstChild())?E.replace(x,!0):U.append(x)}else{for(U=E.getNodes(),E=E.anchor.getNode();E!==null&&E.getParent()!==null&&!z(E);)E=E.getParentOrThrow();for((E=z(E)?E:null)&&U.indexOf(E)===-1&&U.push(E),E=0;E<U.length;E++){let Q=U[E];if(!z(Q))continue;if(!e.$isElementNode(Q))throw Error("Expected block node to be an ElementNode");let F=x();F.setFormat(Q.getFormatType()),F.setIndent(Q.getIndent()),Q.replace(F,!0)}}},Yn.$shouldOverrideDefaultCharacterSelection=function(E,x){return E=e.$getAdjacentNode(E.focus,x),e.$isDecoratorNode(E)&&!E.isIsolated()||e.$isElementNode(E)&&!E.isInline()&&!E.canBeEmpty()},Yn.$sliceSelectedTextNodeContent=function(E,x){if(x.isSelected(E)&&!x.isSegmented()&&!x.isToken()&&e.$INTERNAL_isPointSelection(E)){var U=E.anchor.getNode(),Q=E.focus.getNode(),F=x.is(U),W=x.is(Q);if(F||W){F=E.isBackward();let[G,q]=E.getCharacterOffsets();E=U.is(Q),W=x.is(F?Q:U),Q=x.is(F?U:Q),U=0;let le;E?(U=G>q?q:G,le=G>q?G:q):W?(U=F?q:G,le=void 0):Q&&(F=F?G:q,U=0,le=F),x.__text=x.__text.slice(U,le)}}return x},Yn.$wrapNodes=function(E,x,U=null){var Q=E.getNodes();let F=Q.length;var W=E.anchor;if(F===0||F===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){E=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),Q=E.getChildren();let q=x();q.setFormat(E.getFormatType()),q.setIndent(E.getIndent()),Q.forEach(le=>q.append(le)),U&&(q=U.append(q)),E.replace(q)}else{W=null;var G=[];for(let q=0;q<F;q++){let le=Q[q];e.$isRootOrShadowRoot(le)?(R(E,G,G.length,x,U),G=[],W=le):W===null||W!==null&&e.$hasAncestor(le,W)?G.push(le):(R(E,G,G.length,x,U),G=[le])}R(E,G,G.length,x,U)}},Yn.createDOMRange=function(E,x,U,Q,F){let W=x.getKey(),G=Q.getKey(),q=document.createRange(),le=E.getElementByKey(W);if(E=E.getElementByKey(G),e.$isTextNode(x)&&(le=n(le)),e.$isTextNode(Q)&&(E=n(E)),x===void 0||Q===void 0||le===null||E===null)return null;le.nodeName==="BR"&&([le,U]=r(le)),E.nodeName==="BR"&&([E,F]=r(E)),x=le.firstChild,le===E&&x!=null&&x.nodeName==="BR"&&U===0&&F===0&&(F=1);try{q.setStart(le,U),q.setEnd(E,F)}catch{return null}return!q.collapsed||U===F&&W===G||(q.setStart(E,F),q.setEnd(le,U)),q},Yn.createRectsFromDOMRange=function(E,x){var U=E.getRootElement();if(U===null)return[];E=U.getBoundingClientRect(),U=getComputedStyle(U),U=parseFloat(U.paddingLeft)+parseFloat(U.paddingRight),x=Array.from(x.getClientRects());let Q=x.length;x.sort((W,G)=>{let q=W.top-G.top;return 3>=Math.abs(q)?W.left-G.left:q});let F;for(let W=0;W<Q;W++){let G=x[W],q=G.width+U===E.width;F&&F.top<=G.top&&F.top+F.height>G.top&&F.left+F.width>G.left||q?(x.splice(W--,1),Q--):F=G}return x},Yn.getStyleObjectFromCSS=d,Yn.trimTextContentFromAnchor=function(E,x,U){let Q=x.getNode();if(e.$isElementNode(Q)){var F=Q.getDescendantByIndex(x.offset);F!==null&&(Q=F)}for(;0<U&&Q!==null;){e.$isElementNode(Q)&&(F=Q.getLastDescendant(),F!==null&&(Q=F));var W=Q.getPreviousSibling(),G=0;if(W===null){F=Q.getParentOrThrow();for(var q=F.getPreviousSibling();q===null;){if(F=F.getParent(),F===null){W=null;break}q=F.getPreviousSibling()}F!==null&&(G=F.isInline()?0:2,W=q)}if(q=Q.getTextContent(),q===""&&e.$isElementNode(Q)&&!Q.isInline()&&(q=`
|
|
73
73
|
|
|
74
|
-
`),F=q.length,!e.$isTextNode(Q)||U>=F)q=Q.getParent(),Q.remove(),q==null||q.getChildrenSize()!==0||e.$isRootNode(q)||q.remove(),U-=F+G,Q=W;else{let le=Q.getKey();G=E.getEditorState().read(()=>{const ge=e.$getNodeByKey(le);return e.$isTextNode(ge)&&ge.isSimpleText()?ge.getTextContent():null}),W=F-U;let se=q.slice(0,W);G!==null&&G!==q?(U=e.$getPreviousSelection(),F=Q,Q.isSimpleText()?Q.setTextContent(G):(F=e.$createTextNode(G),Q.replace(F)),e.$isRangeSelection(U)&&U.isCollapsed()&&(U=U.anchor.offset,F.select(U,U))):Q.isSimpleText()?(G=x.key===le,q=x.offset,q<U&&(q=F),U=G?q-U:0,F=G?q:W,G&&U===0?([U]=Q.splitText(U,F),U.remove()):([,U]=Q.splitText(U,F),U.remove())):(U=e.$createTextNode(se),Q.replace(U)),U=0}}},Yn}var Jc,ff;function Cs(){return ff||(ff=1,Jc=process.env.NODE_ENV==="development"?jy():Vy()),Jc}var hf;function qy(){if(hf)return Sn;hf=1;var e=Cs(),t=gn();function n(...se){return()=>{se.forEach(ge=>ge())}}function r(se){return`${se}px`}const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(se,ge,j){let B=null,V=null,xe=null,we=[];const Ee=document.createElement("div");function ue(){if(B===null)throw Error("Unexpected null rootDOMNode");if(V===null)throw Error("Unexpected null parentDOMNode");const{left:ie,top:K}=B.getBoundingClientRect(),P=V,Z=e.createRectsFromDOMRange(se,ge);Ee.isConnected||P.append(Ee);let O=!1;for(let H=0;H<Z.length;H++){const J=Z[H],de=we[H]||document.createElement("div"),_e=de.style;_e.position!=="absolute"&&(_e.position="absolute",O=!0);const I=r(J.left-ie);_e.left!==I&&(_e.left=I,O=!0);const w=r(J.top-K);_e.top!==w&&(de.style.top=w,O=!0);const D=r(J.width);_e.width!==D&&(de.style.width=D,O=!0);const re=r(J.height);_e.height!==re&&(de.style.height=re,O=!0),de.parentNode!==Ee&&(Ee.append(de),O=!0),we[H]=de}for(;we.length>Z.length;)we.pop();O&&j(we)}function $(){V=null,B=null,xe!==null&&xe.disconnect(),xe=null,Ee.remove();for(const ie of we)ie.remove();we=[]}function S(){const ie=se.getRootElement();if(ie===null)return $();const K=ie.parentElement;if(!(K instanceof HTMLElement))return $();$(),B=ie,V=K,xe=new MutationObserver(P=>{const Z=se.getRootElement(),O=Z&&Z.parentElement;if(Z!==B||O!==V)return S();for(const H of P)if(!Ee.contains(H.target))return ue()}),xe.observe(K,c),ue()}const Y=se.registerRootListener(S);return()=>{Y(),$()}}function g(se,ge){let j=null,B=null,V=null,xe=null,we=()=>{};function Ee(ue){ue.read(()=>{const $=t.$getSelection();if(!t.$isRangeSelection($)){j=null,B=null,V=null,xe=null,we(),we=()=>{};return}const{anchor:S,focus:Y}=$,ie=S.getNode(),K=ie.getKey(),P=S.offset,Z=Y.getNode(),O=Z.getKey(),H=Y.offset,J=se.getElementByKey(K),de=se.getElementByKey(O),_e=j===null||J===null||P!==B||K!==j.getKey()||ie!==j&&(!(j instanceof t.TextNode)||ie.updateDOM(j,J,se._config)),I=V===null||de===null||H!==xe||O!==V.getKey()||Z!==V&&(!(V instanceof t.TextNode)||Z.updateDOM(V,de,se._config));if(_e||I){const w=se.getElementByKey(S.getNode().getKey()),D=se.getElementByKey(Y.getNode().getKey());if(w!==null&&D!==null&&w.tagName==="SPAN"&&D.tagName==="SPAN"){const re=document.createRange();let ye,Ae,ee,te;Y.isBefore(S)?(ye=D,Ae=Y.offset,ee=w,te=S.offset):(ye=w,Ae=S.offset,ee=D,te=Y.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");re.setStart(ce,Ae),re.setEnd(be,te),we(),we=d(se,re,Ne=>{for(const Re of Ne){const Le=Re.style;Le.background!=="Highlight"&&(Le.background="Highlight"),Le.color!=="HighlightText"&&(Le.color="HighlightText"),Le.zIndex!=="-1"&&(Le.zIndex="-1"),Le.pointerEvents!=="none"&&(Le.pointerEvents="none"),Le.marginTop!==r(-1.5)&&(Le.marginTop=r(-1.5)),Le.paddingTop!==r(4)&&(Le.paddingTop=r(4)),Le.paddingBottom!==r(0)&&(Le.paddingBottom=r(0))}ge!==void 0&&ge(Ne)})}}j=ie,B=P,V=Z,xe=H})}return Ee(se.getEditorState()),n(se.registerUpdateListener(({editorState:ue})=>Ee(ue)),we,()=>{we()})}function m(se,...ge){ge.forEach(j=>{if(typeof j=="string"){const B=j.split(" ").filter(V=>V!=="");se.classList.add(...B)}})}function N(se,...ge){ge.forEach(j=>{typeof j=="string"&&se.classList.remove(...j.split(" "))})}function T(se,ge){for(const j of ge)if(se.type.startsWith(j))return!0;return!1}function R(se,ge){const j=se[Symbol.iterator]();return new Promise((B,V)=>{const xe=[],we=()=>{const{done:Ee,value:ue}=j.next();if(Ee)return B(xe);const $=new FileReader;$.addEventListener("error",V),$.addEventListener("load",()=>{const S=$.result;typeof S=="string"&&xe.push({file:ue,result:S}),we()}),T(ue,ge)?$.readAsDataURL(ue):we()};we()})}function b(se,ge){const j=[],B=(se||t.$getRoot()).getLatest(),V=ge||(t.$isElementNode(B)?B.getLastDescendant():B);let xe=B,we=k(xe);for(;xe!==null&&!xe.is(V);)if(j.push({depth:we,node:xe}),t.$isElementNode(xe)&&xe.getChildrenSize()>0)xe=xe.getFirstChild(),we++;else{let Ee=null;for(;Ee===null&&xe!==null;)Ee=xe.getNextSibling(),Ee===null?(xe=xe.getParent(),we--):xe=Ee}return xe!==null&&xe.is(V)&&j.push({depth:we,node:xe}),j}function k(se){let ge=se,j=0;for(;(ge=ge.getParent())!==null;)j++;return j}function z(se,ge){let j=se;for(;j!=null;){if(j instanceof ge)return j;j=j.getParent()}return null}function E(se){const ge=x(se,j=>t.$isElementNode(j)&&!j.isInline());if(!t.$isElementNode(ge))throw Error(`Expected node ${se.__key} to have closest block element node.`);return ge}const x=(se,ge)=>{let j=se;for(;j!==t.$getRoot()&&j!=null;){if(ge(j))return j;j=j.getParent()}return null};function U(se,ge,j,B){const V=Ee=>Ee instanceof ge,xe=Ee=>{const ue=Ee.getChildren();for(let Y=0;Y<ue.length;Y++){const ie=ue[Y];if(V(ie))return null}let $=Ee,S=Ee;for(;$!==null;)if(S=$,$=$.getParent(),V($))return{child:S,parent:$};return null},we=Ee=>{const ue=xe(Ee);if(ue!==null){const{child:$,parent:S}=ue;if($.is(Ee)){B(S,Ee);const Y=$.getNextSiblings(),ie=Y.length;if(S.insertAfter($),ie!==0){const K=j(S);$.insertAfter(K);for(let P=0;P<ie;P++)K.append(Y[P])}!S.canBeEmpty()&&S.getChildrenSize()===0&&S.remove()}}};return se.registerNodeTransform(ge,we)}function Q(se,ge){const B=new Map,V=se._pendingEditorState;for(const[we,Ee]of ge._nodeMap){const ue=e.$cloneWithProperties(Ee);if(t.$isTextNode(ue)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");ue.__text=Ee.__text}B.set(we,ue)}V&&(V._nodeMap=B),se._dirtyType=2;const xe=ge._selection;t.$setSelection(xe===null?null:xe.clone())}function F(se){const ge=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ge)){const{focus:j}=ge,B=j.getNode(),V=j.offset;if(t.$isRootOrShadowRoot(B)){const xe=B.getChildAtIndex(V);xe==null?B.append(se):xe.insertBefore(se),se.selectNext()}else{let xe,we;t.$isTextNode(B)?(xe=B.getParentOrThrow(),we=B.getIndexWithinParent(),V>0&&(we+=1,B.splitText(V))):(xe=B,we=V);const[,Ee]=t.$splitNode(xe,we);Ee.insertBefore(se),Ee.selectStart()}}else{if(ge!=null){const B=ge.getNodes();B[B.length-1].getTopLevelElementOrThrow().insertAfter(se)}else t.$getRoot().append(se);const j=t.$createParagraphNode();se.insertAfter(j),j.select()}return se.getLatest()}function W(se,ge){const j=ge();return se.replace(j),j.append(se),j}function G(se,ge){return se!==null?Object.getPrototypeOf(se).constructor.name===ge.name:!1}function q(se,ge){const j=[];for(let B=0;B<se.length;B++){const V=ge(se[B]);V!==null&&j.push(V)}return j}function le(se,ge){const j=se.getFirstChild();j!==null?j.insertBefore(ge):se.append(ge)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=b,Sn.$filter=q,Sn.$findMatchingParent=x,Sn.$getNearestBlockElementAncestorOrThrow=E,Sn.$getNearestNodeOfType=z,Sn.$insertFirst=le,Sn.$insertNodeToNearestRoot=F,Sn.$restoreEditorState=Q,Sn.$wrapNodeInElement=W,Sn.addClassNamesToElement=m,Sn.isMimeType=T,Sn.markSelection=g,Sn.mediaFileReader=R,Sn.mergeRegister=n,Sn.objectKlassEquals=G,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=U,Sn.removeClassNamesFromElement=N,Sn}var vn={},gf;function Zy(){if(gf)return vn;gf=1;var e=Cs(),t=gn();function n(N){let T=new URLSearchParams;T.append("code",N);for(let R=1;R<arguments.length;R++)T.append("v",arguments[R]);throw Error(`Minified Lexical error #${N}; visit https://lexical.dev/docs/error?${T} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(...N){return()=>{N.forEach(T=>T())}}let c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(N,T,R){function b(){if(E===null)throw Error("Unexpected null rootDOMNode");if(x===null)throw Error("Unexpected null parentDOMNode");let{left:G,top:q}=E.getBoundingClientRect();var le=x;let se=e.createRectsFromDOMRange(N,T);F.isConnected||le.append(F),le=!1;for(let B=0;B<se.length;B++){var ge=se[B];let V=Q[B]||document.createElement("div"),xe=V.style;xe.position!=="absolute"&&(xe.position="absolute",le=!0);var j=`${ge.left-G}px`;xe.left!==j&&(xe.left=j,le=!0),j=`${ge.top-q}px`,xe.top!==j&&(V.style.top=j,le=!0),j=`${ge.width}px`,xe.width!==j&&(V.style.width=j,le=!0),ge=`${ge.height}px`,xe.height!==ge&&(V.style.height=ge,le=!0),V.parentNode!==F&&(F.append(V),le=!0),Q[B]=V}for(;Q.length>se.length;)Q.pop();le&&R(Q)}function k(){E=x=null,U!==null&&U.disconnect(),U=null,F.remove();for(let G of Q)G.remove();Q=[]}function z(){let G=N.getRootElement();if(G===null)return k();let q=G.parentElement;if(!(q instanceof HTMLElement))return k();k(),E=G,x=q,U=new MutationObserver(le=>{let se=N.getRootElement(),ge=se&&se.parentElement;if(se!==E||ge!==x)return z();for(let j of le)if(!F.contains(j.target))return b()}),U.observe(q,c),b()}let E=null,x=null,U=null,Q=[],F=document.createElement("div"),W=N.registerRootListener(z);return()=>{W(),k()}}function g(N,T){for(let R of T)if(N.type.startsWith(R))return!0;return!1}let m=(N,T)=>{for(;N!==t.$getRoot()&&N!=null;){if(T(N))return N;N=N.getParent()}return null};return vn.$splitNode=t.$splitNode,vn.isHTMLAnchorElement=t.isHTMLAnchorElement,vn.isHTMLElement=t.isHTMLElement,vn.$dfs=function(N,T){let R=[];N=(N||t.$getRoot()).getLatest(),T=T||(t.$isElementNode(N)?N.getLastDescendant():N);for(var b=N,k=0;(b=b.getParent())!==null;)k++;for(b=k;N!==null&&!N.is(T);)if(R.push({depth:b,node:N}),t.$isElementNode(N)&&0<N.getChildrenSize())N=N.getFirstChild(),b++;else for(k=null;k===null&&N!==null;)k=N.getNextSibling(),k===null?(N=N.getParent(),b--):N=k;return N!==null&&N.is(T)&&R.push({depth:b,node:N}),R},vn.$filter=function(N,T){let R=[];for(let b=0;b<N.length;b++){let k=T(N[b]);k!==null&&R.push(k)}return R},vn.$findMatchingParent=m,vn.$getNearestBlockElementAncestorOrThrow=function(N){let T=m(N,R=>t.$isElementNode(R)&&!R.isInline());return t.$isElementNode(T)||n(4,N.__key),T},vn.$getNearestNodeOfType=function(N,T){for(;N!=null;){if(N instanceof T)return N;N=N.getParent()}return null},vn.$insertFirst=function(N,T){let R=N.getFirstChild();R!==null?R.insertBefore(T):N.append(T)},vn.$insertNodeToNearestRoot=function(N){var T=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(T)){var{focus:R}=T;if(T=R.getNode(),R=R.offset,t.$isRootOrShadowRoot(T))R=T.getChildAtIndex(R),R==null?T.append(N):R.insertBefore(N),N.selectNext();else{let b,k;t.$isTextNode(T)?(b=T.getParentOrThrow(),k=T.getIndexWithinParent(),0<R&&(k+=1,T.splitText(R))):(b=T,k=R),[,T]=t.$splitNode(b,k),T.insertBefore(N),T.selectStart()}}else T!=null?(T=T.getNodes(),T[T.length-1].getTopLevelElementOrThrow().insertAfter(N)):t.$getRoot().append(N),T=t.$createParagraphNode(),N.insertAfter(T),T.select();return N.getLatest()},vn.$restoreEditorState=function(N,T){let R=new Map,b=N._pendingEditorState;for(let[k,z]of T._nodeMap){let E=e.$cloneWithProperties(z);if(t.$isTextNode(E)){if(!t.$isTextNode(z))throw Error("Expected node be a TextNode");E.__text=z.__text}R.set(k,E)}b&&(b._nodeMap=R),N._dirtyType=2,N=T._selection,t.$setSelection(N===null?null:N.clone())},vn.$wrapNodeInElement=function(N,T){return T=T(),N.replace(T),T.append(N),T},vn.addClassNamesToElement=function(N,...T){T.forEach(R=>{typeof R=="string"&&(R=R.split(" ").filter(b=>b!==""),N.classList.add(...R))})},vn.isMimeType=g,vn.markSelection=function(N,T){function R(U){U.read(()=>{var Q=t.$getSelection();if(t.$isRangeSelection(Q)){var{anchor:F,focus:W}=Q;Q=F.getNode();var G=Q.getKey(),q=F.offset,le=W.getNode(),se=le.getKey(),ge=W.offset,j=N.getElementByKey(G),B=N.getElementByKey(se);if(G=b===null||j===null||q!==k||G!==b.getKey()||Q!==b&&(!(b instanceof t.TextNode)||Q.updateDOM(b,j,N._config)),se=z===null||B===null||ge!==E||se!==z.getKey()||le!==z&&(!(z instanceof t.TextNode)||le.updateDOM(z,B,N._config)),G||se){j=N.getElementByKey(F.getNode().getKey());var V=N.getElementByKey(W.getNode().getKey());if(j!==null&&V!==null&&j.tagName==="SPAN"&&V.tagName==="SPAN"){if(se=document.createRange(),W.isBefore(F)?(G=V,B=W.offset,V=j,j=F.offset):(G=j,B=F.offset,j=W.offset),G=G.firstChild,G===null||(V=V.firstChild,V===null))throw Error("Expected text node to be first child of span");se.setStart(G,B),se.setEnd(V,j),x(),x=d(N,se,xe=>{for(let we of xe){let Ee=we.style;Ee.background!=="Highlight"&&(Ee.background="Highlight"),Ee.color!=="HighlightText"&&(Ee.color="HighlightText"),Ee.zIndex!=="-1"&&(Ee.zIndex="-1"),Ee.pointerEvents!=="none"&&(Ee.pointerEvents="none"),Ee.marginTop!=="-1.5px"&&(Ee.marginTop="-1.5px"),Ee.paddingTop!=="4px"&&(Ee.paddingTop="4px"),Ee.paddingBottom!=="0px"&&(Ee.paddingBottom="0px")}T!==void 0&&T(xe)})}}b=Q,k=q,z=le,E=ge}else E=z=k=b=null,x(),x=()=>{}})}let b=null,k=null,z=null,E=null,x=()=>{};return R(N.getEditorState()),r(N.registerUpdateListener(({editorState:U})=>R(U)),x,()=>{x()})},vn.mediaFileReader=function(N,T){let R=N[Symbol.iterator]();return new Promise((b,k)=>{let z=[],E=()=>{const{done:x,value:U}=R.next();if(x)return b(z);const Q=new FileReader;Q.addEventListener("error",k),Q.addEventListener("load",()=>{const F=Q.result;typeof F=="string"&&z.push({file:U,result:F}),E()}),g(U,T)?Q.readAsDataURL(U):E()};E()})},vn.mergeRegister=r,vn.objectKlassEquals=function(N,T){return N!==null?Object.getPrototypeOf(N).constructor.name===T.name:!1},vn.positionNodeOnRange=d,vn.registerNestedElementResolver=function(N,T,R,b){return N.registerNodeTransform(T,k=>{e:{for(var z=k.getChildren(),E=0;E<z.length;E++)if(z[E]instanceof T){z=null;break e}for(z=k;z!==null;)if(E=z,z=z.getParent(),z instanceof T){z={child:E,parent:z};break e}z=null}if(z!==null){const{child:x,parent:U}=z;if(x.is(k)){if(b(U,k),k=x.getNextSiblings(),z=k.length,U.insertAfter(x),z!==0){E=R(U),x.insertAfter(E);for(let Q=0;Q<z;Q++)E.append(k[Q])}U.canBeEmpty()||U.getChildrenSize()!==0||U.remove()}}})},vn.removeClassNamesFromElement=function(N,...T){T.forEach(R=>{typeof R=="string"&&N.classList.remove(...R.split(" "))})},vn}var Xc,pf;function Xn(){return pf||(pf=1,Xc=process.env.NODE_ENV==="development"?qy():Zy()),Xc}var mf;function Jy(){if(mf)return Zt;mf=1;var e=gn(),t=Xn();class n extends e.INTERNAL_PointSelection{constructor(ne,oe,Se){super(oe,Se),this.gridKey=ne}getCachedNodes(){return this._cachedNodes}setCachedNodes(ne){this._cachedNodes=ne}is(ne){return r(ne)?this.gridKey===ne.gridKey&&this.anchor.is(ne.anchor)&&this.focus.is(ne.focus):!1}set(ne,oe,Se){this.dirty=!0,this.gridKey=ne,this.anchor.key=oe,this.focus.key=Se,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ne){}insertText(){}insertNodes(ne){const oe=this.focus.getNode();if(!e.$isElementNode(oe))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(oe.select(0,oe.getChildrenSize())).insertNodes(ne)}getShape(){const ne=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ne))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const oe=e.DEPRECATED_$getGridCellNodeRect(ne);if(oe===null)throw Error("getCellRect: expected to find AnchorNode");const Se=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(Se))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Ie=e.DEPRECATED_$getGridCellNodeRect(Se);if(Ie===null)throw Error("getCellRect: expected to find focusCellNode");const De=Math.min(oe.columnIndex,Ie.columnIndex),je=Math.max(oe.columnIndex,Ie.columnIndex),rt=Math.min(oe.rowIndex,Ie.rowIndex),it=Math.max(oe.rowIndex,Ie.rowIndex);return{fromX:Math.min(De,je),fromY:Math.min(rt,it),toX:Math.max(De,je),toY:Math.max(rt,it)}}getNodes(){const ne=this._cachedNodes;if(ne!==null)return ne;const oe=this.anchor.getNode(),Se=this.focus.getNode(),Ie=t.$findMatchingParent(oe,e.DEPRECATED_$isGridCellNode),De=t.$findMatchingParent(Se,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Ie))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!e.DEPRECATED_$isGridCellNode(De))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 rt=je.getParent();if(!e.DEPRECATED_$isGridNode(rt))throw Error("Expected tableNode to have a parent GridNode");const it=De.getParents()[1];if(it!==rt){if(rt.isParentOf(De)){const It=it.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,De.getKey(),It.getKey())}else{const It=rt.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),De.getKey())}return this.getNodes()}const[st,vt,Ge]=e.DEPRECATED_$computeGridMap(rt,Ie,De);let ze=Math.min(vt.startColumn,Ge.startColumn),tt=Math.min(vt.startRow,Ge.startRow),_t=Math.max(vt.startColumn+vt.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(vt.startRow+vt.cell.__rowSpan-1,Ge.startRow+Ge.cell.__rowSpan-1),Et=ze,ht=tt,xt=ze,pt=tt;function $t(It){const{cell:jt,startColumn:bt,startRow:nn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,nn),_t=Math.max(_t,bt+jt.__colSpan-1),Nt=Math.max(Nt,nn+jt.__rowSpan-1)}for(;ze<Et||tt<ht||_t>xt||Nt>pt;){if(ze<Et){const It=pt-ht,jt=Et-1;for(let bt=0;bt<=It;bt++)$t(st[ht+bt][jt]);Et=jt}if(tt<ht){const It=xt-Et,jt=ht-1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);ht=jt}if(_t>xt){const It=pt-ht,jt=xt+1;for(let bt=0;bt<=It;bt++)$t(st[ht+bt][jt]);xt=jt}if(Nt>pt){const It=xt-Et,jt=pt+1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);pt=jt}}const Kt=[rt];let tn=null;for(let It=tt;It<=Nt;It++)for(let jt=ze;jt<=_t;jt++){const{cell:bt}=st[It][jt],nn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected GridCellNode parent to be a GridRowNode");nn!==tn&&Kt.push(nn),Kt.push(bt,...d(bt)),tn=nn}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Kt),Kt}getTextContent(){const ne=this.getNodes();let oe="";for(let Se=0;Se<ne.length;Se++)oe+=ne[Se].getTextContent();return oe}}function r(Oe){return Oe instanceof n}function c(){const Oe=e.$createPoint("root",0,"element"),ne=e.$createPoint("root",0,"element");return new n("root",Oe,ne)}function d(Oe){const ne=[],oe=[Oe];for(;oe.length>0;){const Se=oe.pop();if(Se===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(Se)&&oe.unshift(...Se.getChildren()),Se!==Oe&&ne.push(Se)}return ne}const g=/^(\d+(?:\.\d+)?)px$/,m={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class N extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ne){const oe=new N(ne.__headerState,ne.__colSpan,ne.__width,ne.__key);return oe.__rowSpan=ne.__rowSpan,oe.__backgroundColor=ne.__backgroundColor,oe}static importDOM(){return{td:ne=>({conversion:T,priority:0}),th:ne=>({conversion:T,priority:0})}}static importJSON(ne){const oe=ne.colSpan||1,Se=ne.rowSpan||1,Ie=R(ne.headerState,oe,ne.width||void 0);return Ie.__rowSpan=Se,Ie.__backgroundColor=ne.backgroundColor||null,Ie}constructor(ne=m.NO_STATUS,oe=1,Se,Ie){super(oe,Ie),this.__headerState=ne,this.__width=Se,this.__backgroundColor=null}createDOM(ne){const oe=document.createElement(this.getTag());return this.__width&&(oe.style.width=`${this.__width}px`),this.__colSpan>1&&(oe.colSpan=this.__colSpan),this.__rowSpan>1&&(oe.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(oe.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(oe,ne.theme.tableCell,this.hasHeader()&&ne.theme.tableCellHeader),oe}exportDOM(ne){const{element:oe}=super.exportDOM(ne);if(oe){const Se=oe,Ie=700,De=this.getParentOrThrow().getChildrenSize();Se.style.border="1px solid black",this.__colSpan>1&&(Se.colSpan=this.__colSpan),this.__rowSpan>1&&(Se.rowSpan=this.__rowSpan),Se.style.width=`${this.getWidth()||Math.max(90,Ie/De)}px`,Se.style.verticalAlign="top",Se.style.textAlign="start";const je=this.getBackgroundColor();je!==null?Se.style.backgroundColor=je:this.hasHeader()&&(Se.style.backgroundColor="#f2f3f5")}return{element:oe}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ne){const oe=this.getWritable();return oe.__headerState=ne,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ne){const oe=this.getWritable();return oe.__width=ne,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ne){this.getWritable().__backgroundColor=ne}toggleHeaderStyle(ne){const oe=this.getWritable();return(oe.__headerState&ne)===ne?oe.__headerState-=ne:oe.__headerState+=ne,oe}hasHeaderState(ne){return(this.getHeaderStyles()&ne)===ne}hasHeader(){return this.getLatest().__headerState!==m.NO_STATUS}updateDOM(ne){return ne.__headerState!==this.__headerState||ne.__width!==this.__width||ne.__colSpan!==this.__colSpan||ne.__rowSpan!==this.__rowSpan||ne.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(Oe){const ne=Oe,oe=Oe.nodeName.toLowerCase();let Se;g.test(ne.style.width)&&(Se=parseFloat(ne.style.width));const Ie=R(oe==="th"?m.ROW:m.NO_STATUS,ne.colSpan,Se);Ie.__rowSpan=ne.rowSpan;const De=ne.style.backgroundColor;return De!==""&&(Ie.__backgroundColor=De),{forChild:(je,rt)=>{if(b(rt)&&!e.$isElementNode(je)){const it=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
75
|
-
`?null:(it.append(je),it)}return je},node:Ie}}function R(Oe,ne=1,oe){return e.$applyNodeReplacement(new N(Oe,ne,oe))}function b(Oe){return Oe instanceof N}class k extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ne){return new k(ne.__height,ne.__key)}static importDOM(){return{tr:ne=>({conversion:z,priority:0})}}static importJSON(ne){return E(ne.height)}constructor(ne,oe){super(oe),this.__height=ne}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ne){const oe=document.createElement("tr");return this.__height&&(oe.style.height=`${this.__height}px`),t.addClassNamesToElement(oe,ne.theme.tableRow),oe}isShadowRoot(){return!0}setHeight(ne){const oe=this.getWritable();return oe.__height=ne,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ne){return ne.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function z(Oe){const ne=Oe;let oe;return g.test(ne.style.height)&&(oe=parseFloat(ne.style.height)),{node:E(oe)}}function E(Oe){return e.$applyNodeReplacement(new k(Oe))}function x(Oe){return Oe instanceof k}const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q=Oe=>U?(Oe||window).getSelection():null;class F{constructor(ne,oe){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=oe,this.editor=ne,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(ne=>ne())}trackTableGrid(){const ne=new MutationObserver(oe=>{this.editor.update(()=>{let Se=!1;for(let De=0;De<oe.length;De++){const it=oe[De].target.nodeName;if(it==="TABLE"||it==="TR"){Se=!0;break}}if(!Se)return;const Ie=this.editor.getElementByKey(this.tableNodeKey);if(!Ie)throw new Error("Expected to find TableElement in DOM");this.grid=ge(Ie)})});this.editor.update(()=>{const oe=this.editor.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");this.grid=ge(oe),ne.observe(oe,{childList:!0,subtree:!0})})}clearHighlight(){const ne=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(),ne.update(()=>{const oe=e.$getNodeByKey(this.tableNodeKey);if(!I(oe))throw new Error("Expected TableNode.");const Se=ne.getElementByKey(this.tableNodeKey);if(!Se)throw new Error("Expected to find TableElement in DOM");const Ie=ge(Se);j(ne,Ie,null),e.$setSelection(null),ne.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ne=this.editor;ne.update(()=>{const oe=ne.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(oe,ne._config.theme.tableSelection),oe.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ne=this.editor;ne.update(()=>{const oe=ne.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(oe,ne._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ne){if(ne!=null&&ne.gridKey===this.tableNodeKey){const oe=this.editor;this.gridSelection=ne,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(oe,this.grid,this.gridSelection)}else ne==null?this.clearHighlight():(this.tableNodeKey=ne.gridKey,this.updateTableGridSelection(ne))}setFocusCellForSelection(ne,oe=!1){const Se=this.editor;Se.update(()=>{const Ie=e.$getNodeByKey(this.tableNodeKey);if(!I(Ie))throw new Error("Expected TableNode.");if(!Se.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ne.x,rt=ne.y;if(this.focusCell=ne,this.anchorCell!==null){const it=Q(Se._window);it&&it.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==rt||oe))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&rt===this.focusY)return;if(this.focusX=je,this.focusY=rt,this.isHighlightingCells){const it=e.$getNearestNodeFromDOMNode(ne.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&b(it)){const st=it.getKey();this.gridSelection=this.gridSelection.clone()||c(),this.focusCellNodeKey=st,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(ne){this.isHighlightingCells=!1,this.anchorCell=ne,this.anchorX=ne.x,this.anchorY=ne.y,this.editor.update(()=>{const oe=e.$getNearestNodeFromDOMNode(ne.elem);if(b(oe)){const Se=oe.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():c(),this.anchorCellNodeKey=Se}})}formatCells(ne){this.editor.update(()=>{const oe=e.$getSelection();if(!r(oe))throw Error("Expected grid selection");const Se=e.$createRangeSelection(),Ie=Se.anchor,De=Se.focus;oe.getNodes().forEach(je=>{b(je)&&je.getTextContentSize()!==0&&(Ie.set(je.getKey(),0,"element"),De.set(je.getKey(),je.getChildrenSize(),"element"),Se.formatText(ne))}),e.$setSelection(oe),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ne=this.editor;ne.update(()=>{const oe=e.$getNodeByKey(this.tableNodeKey);if(!I(oe))throw new Error("Expected TableNode.");const Se=e.$getSelection();if(!r(Se))throw Error("Expected grid selection");const Ie=Se.getNodes().filter(b);if(Ie.length===this.grid.columns*this.grid.rows){oe.selectPrevious(),oe.remove(),e.$getRoot().selectStart();return}Ie.forEach(De=>{if(e.$isElementNode(De)){const je=e.$createParagraphNode(),rt=e.$createTextNode();je.append(rt),De.append(je),De.getChildren().forEach(it=>{it!==je&&it.remove()})}}),j(ne,this.grid,null),e.$setSelection(null),ne.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const W="__lexicalTableSelection";function G(Oe,ne,oe,Se){const Ie=oe.getRootElement();if(Ie===null)throw new Error("No root element.");const De=new F(oe,Oe.getKey()),je=oe._window||window;q(ne,De),ne.addEventListener("mousedown",Ge=>{setTimeout(()=>{if(Ge.button!==0||!je)return;const ze=se(Ge.target);ze!==null&&(O(Ge),De.setAnchorCellForSelection(ze));const tt=()=>{je.removeEventListener("mouseup",tt),je.removeEventListener("mousemove",_t)},_t=Nt=>{const Et=se(Nt.target);Et!==null&&(De.anchorX!==Et.x||De.anchorY!==Et.y)&&(Nt.preventDefault(),De.setFocusCellForSelection(Et))};je.addEventListener("mouseup",tt),je.addEventListener("mousemove",_t)},0)});const rt=Ge=>{Ge.button===0&&oe.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===De.tableNodeKey&&Ie.contains(tt)&&De.clearHighlight()})};je.addEventListener("mousedown",rt),De.listenersToRemove.add(()=>je.removeEventListener("mousedown",rt)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ge=>Z(oe,Ge,"down",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_UP_COMMAND,Ge=>Z(oe,Ge,"up",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ge=>Z(oe,Ge,"backward",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ge=>Z(oe,Ge,"forward",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ESCAPE_COMMAND,Ge=>{const ze=e.$getSelection();if(r(ze)){const tt=t.$findMatchingParent(ze.focus.getNode(),b);if(b(tt))return O(Ge),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const it=Ge=>()=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return De.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>b(Kt));if(!b(tt))return!1;const _t=ze.anchor.getNode(),Nt=ze.focus.getNode(),Et=Oe.isParentOf(_t),ht=Oe.isParentOf(Nt);if(Et&&!ht||ht&&!Et)return De.clearText(),!0;const pt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>e.$isElementNode(Kt)),$t=pt&&t.$findMatchingParent(pt,Kt=>e.$isElementNode(Kt)&&b(Kt.getParent()));if(!e.$isElementNode($t)||!e.$isElementNode(pt))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&&pt!==$t){const Kt=pt.getChildren(),tn=e.$createParagraphNode();return Kt.forEach(It=>tn.append(It)),pt.replace(tn),pt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ge=>{De.listenersToRemove.add(oe.registerCommand(Ge,it(Ge),e.COMMAND_PRIORITY_CRITICAL))});const st=Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return Ge.preventDefault(),Ge.stopPropagation(),De.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>b(_t));if(!b(tt))return!1}return!1};De.listenersToRemove.add(oe.registerCommand(e.KEY_BACKSPACE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.KEY_DELETE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.FORMAT_TEXT_COMMAND,Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return De.formatCells(Ge),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>b(_t));if(!b(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return De.clearHighlight(),!1;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>b(_t));if(!b(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Se&&De.listenersToRemove.add(oe.registerCommand(e.KEY_TAB_COMMAND,Ge=>{const ze=e.$getSelection();if(!e.$isRangeSelection(ze)||!ze.isCollapsed()||!ue(ze,Oe))return!1;const tt=K(ze.anchor.getNode());if(tt===null)return!1;O(Ge);const _t=Oe.getCordsFromCellNode(tt,De.grid);return we(De,Oe,_t.x,_t.y,Ge.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.FOCUS_COMMAND,Ge=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function vt(Ge){const ze=Oe.getCordsFromCellNode(Ge,De.grid);return Oe.getCellFromCordsOrThrow(ze.x,ze.y,De.grid)}return De.listenersToRemove.add(oe.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ge=>{const{nodes:ze,selection:tt}=Ge,_t=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||_t&&!Nt;if(ze.length!==1||!e.DEPRECATED_$isGridNode(ze[0])||!Et)return!1;const{anchor:ht}=tt,xt=ze[0],pt=xt.getChildren(),$t=xt.getFirstChildOrThrow().getChildrenSize(),Kt=xt.getChildrenSize(),tn=t.$findMatchingParent(ht.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=tn&&t.$findMatchingParent(tn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),jt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(tn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(jt))return!1;const bt=It.getIndexWithinParent(),nn=Math.min(jt.getChildrenSize()-1,bt+Kt-1),Sr=tn.getIndexWithinParent(),pi=Math.min(It.getChildrenSize()-1,Sr+$t-1),pe=Math.min(Sr,pi),Ze=Math.min(bt,nn),ot=Math.max(Sr,pi),wt=Math.max(bt,nn),Gt=jt.getChildren();let Bt=0,Pt,Lt;for(let Ht=Ze;Ht<=wt;Ht++){const sn=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(sn))return!1;const ln=pt[Bt];if(!e.DEPRECATED_$isGridRowNode(ln))return!1;const Rn=sn.getChildren(),mr=ln.getChildren();let jn=0;for(let dn=pe;dn<=ot;dn++){const rr=Rn[dn];if(!e.DEPRECATED_$isGridCellNode(rr))return!1;const ir=mr[jn];if(!e.DEPRECATED_$isGridCellNode(ir))return!1;Ht===Ze&&dn===pe?Pt=rr.getKey():Ht===wt&&dn===ot&&(Lt=rr.getKey());const Oi=rr.getChildren();ir.getChildren().forEach(_r=>{e.$isTextNode(_r)&&e.$createParagraphNode().append(_r),rr.append(_r)}),Oi.forEach(_r=>_r.remove()),jn++}Bt++}if(Pt&&Lt){const Ht=c();Ht.set(ze[0].getKey(),Pt,Lt),e.$setSelection(Ht)}return!0},e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ge=e.$getSelection(),ze=e.$getPreviousSelection();if(e.$isRangeSelection(Ge)){const{anchor:tt,focus:_t}=Ge,Nt=tt.getNode(),Et=_t.getNode(),ht=K(Nt),xt=K(Et),pt=ht&&Oe.is(P(ht)),$t=xt&&Oe.is(P(xt)),Kt=pt!==$t,tn=pt&&$t,It=Ge.isBackward();if(Kt){const jt=Ge.clone();jt.focus.set(Oe.getKey(),It?0:Oe.getChildrenSize(),"element"),e.$setSelection(jt),V(oe,De)}else tn&&(ht.is(xt)||(De.setAnchorCellForSelection(vt(ht)),De.setFocusCellForSelection(vt(xt),!0)))}return Ge&&!Ge.is(ze)&&(r(Ge)||r(ze))&&De.gridSelection&&!De.gridSelection.is(ze)?(r(Ge)&&Ge.gridKey===De.tableNodeKey?De.updateTableGridSelection(Ge):!r(Ge)&&r(ze)&&ze.gridKey===De.tableNodeKey&&De.updateTableGridSelection(null),!1):(De.hasHijackedSelectionStyles&&!Oe.isSelected()?xe(oe,De):!De.hasHijackedSelectionStyles&&Oe.isSelected()&&V(oe,De),!1)},e.COMMAND_PRIORITY_CRITICAL)),De}function q(Oe,ne){Oe[W]=ne}function le(Oe){return Oe[W]}function se(Oe){let ne=Oe;for(;ne!=null;){const oe=ne.nodeName;if(oe==="TD"||oe==="TH"){const Se=ne._cell;return Se===void 0?null:Se}ne=ne.parentNode}return null}function ge(Oe){const ne=[],oe={cells:ne,columns:0,rows:0};let Se=Oe.firstChild,Ie=0,De=0;for(ne.length=0;Se!=null;){const je=Se.nodeName;if(je==="TD"||je==="TH"){const st=Se,vt={elem:st,hasBackgroundColor:st.style.backgroundColor!=="",highlighted:!1,x:Ie,y:De};Se._cell=vt;let Ge=ne[De];Ge===void 0&&(Ge=ne[De]=[]),Ge[Ie]=vt}else{const st=Se.firstChild;if(st!=null){Se=st;continue}}const rt=Se.nextSibling;if(rt!=null){Ie++,Se=rt;continue}const it=Se.parentNode;if(it!=null){const st=it.nextSibling;if(st==null)break;De++,Ie=0,Se=st}}return oe.columns=Ie+1,oe.rows=De+1,oe}function j(Oe,ne,oe){const Se=new Set(oe?oe.getNodes():[]);B(ne,(Ie,De)=>{const je=Ie.elem;Se.has(De)?(Ie.highlighted=!0,Y(Oe,Ie)):(Ie.highlighted=!1,ie(Oe,Ie),je.getAttribute("style")||je.removeAttribute("style"))})}function B(Oe,ne){const{cells:oe}=Oe;for(let Se=0;Se<oe.length;Se++){const Ie=oe[Se];if(Ie)for(let De=0;De<Ie.length;De++){const je=Ie[De];if(!je)continue;const rt=e.$getNearestNodeFromDOMNode(je.elem);rt!==null&&ne(je,rt,{x:De,y:Se})}}}function V(Oe,ne){ne.disableHighlightStyle(),B(ne.grid,oe=>{oe.highlighted=!0,Y(Oe,oe)})}function xe(Oe,ne){ne.enableHighlightStyle(),B(ne.grid,oe=>{const Se=oe.elem;oe.highlighted=!1,ie(Oe,oe),Se.getAttribute("style")||Se.removeAttribute("style")})}const we=(Oe,ne,oe,Se,Ie)=>{const De=Ie==="forward";switch(Ie){case"backward":case"forward":return oe!==(De?Oe.grid.columns-1:0)?$(ne.getCellNodeFromCordsOrThrow(oe+(De?1:-1),Se,Oe.grid),De):Se!==(De?Oe.grid.rows-1:0)?$(ne.getCellNodeFromCordsOrThrow(De?0:Oe.grid.columns-1,Se+(De?1:-1),Oe.grid),De):De?ne.selectNext():ne.selectPrevious(),!0;case"up":return Se!==0?$(ne.getCellNodeFromCordsOrThrow(oe,Se-1,Oe.grid),!1):ne.selectPrevious(),!0;case"down":return Se!==Oe.grid.rows-1?$(ne.getCellNodeFromCordsOrThrow(oe,Se+1,Oe.grid),!0):ne.selectNext(),!0;default:return!1}},Ee=(Oe,ne,oe,Se,Ie)=>{const De=Ie==="forward";switch(Ie){case"backward":case"forward":return oe!==(De?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe+(De?1:-1),Se,Oe.grid)),!0;case"up":return Se!==0?(Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe,Se-1,Oe.grid)),!0):!1;case"down":return Se!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe,Se+1,Oe.grid)),!0):!1;default:return!1}};function ue(Oe,ne){if(e.$isRangeSelection(Oe)||r(Oe)){const oe=ne.isParentOf(Oe.anchor.getNode()),Se=ne.isParentOf(Oe.focus.getNode());return oe&&Se}return!1}function $(Oe,ne){ne?Oe.selectStart():Oe.selectEnd()}const S="172,206,247";function Y(Oe,ne){const oe=ne.elem,Se=e.$getNearestNodeFromDOMNode(oe);if(!b(Se))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Se.getBackgroundColor()===null?oe.style.setProperty("background-color",`rgb(${S})`):oe.style.setProperty("background-image",`linear-gradient(to right, rgba(${S},0.85), rgba(${S},0.85))`),oe.style.setProperty("caret-color","transparent")}function ie(Oe,ne){const oe=ne.elem,Se=e.$getNearestNodeFromDOMNode(oe);if(!b(Se))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Se.getBackgroundColor()===null&&oe.style.removeProperty("background-color"),oe.style.removeProperty("background-image"),oe.style.removeProperty("caret-color")}function K(Oe){const ne=t.$findMatchingParent(Oe,b);return b(ne)?ne:null}function P(Oe){const ne=t.$findMatchingParent(Oe,I);return I(ne)?ne:null}function Z(Oe,ne,oe,Se,Ie){const De=e.$getSelection();if(!ue(De,Se))return!1;if(e.$isRangeSelection(De)&&De.isCollapsed()){if(oe==="backward"||oe==="forward")return!1;const{anchor:je,focus:rt}=De,it=t.$findMatchingParent(je.getNode(),b),st=t.$findMatchingParent(rt.getNode(),b);if(!b(it)||!it.is(st))return!1;const vt=P(it);if(vt!==Se&&vt!=null){const xt=Oe.getElementByKey(vt.getKey());if(xt!=null)return Ie.grid=ge(xt),Z(Oe,ne,oe,vt,Ie)}const Ge=Oe.getElementByKey(it.__key),ze=Oe.getElementByKey(je.key);if(ze==null||Ge==null)return!1;let tt;if(je.type==="element")tt=ze.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const _t=oe==="up"?it.getFirstChild():it.getLastChild();if(_t==null)return!1;const Nt=Oe.getElementByKey(_t.__key);if(Nt==null)return!1;const Et=Nt.getBoundingClientRect();if(oe==="up"?Et.top>tt.top-tt.height:tt.bottom+tt.height>Et.bottom){O(ne);const xt=Se.getCordsFromCellNode(it,Ie.grid);if(ne.shiftKey){const pt=Se.getCellFromCordsOrThrow(xt.x,xt.y,Ie.grid);Ie.setAnchorCellForSelection(pt),Ie.setFocusCellForSelection(pt,!0)}else return we(Ie,Se,xt.x,xt.y,oe);return!0}}else if(r(De)){const{anchor:je,focus:rt}=De,it=t.$findMatchingParent(je.getNode(),b),st=t.$findMatchingParent(rt.getNode(),b),[vt]=De.getNodes(),Ge=Oe.getElementByKey(vt.getKey());if(!b(it)||!b(st)||!I(vt)||Ge==null)return!1;Ie.updateTableGridSelection(De);const ze=ge(Ge),tt=Se.getCordsFromCellNode(it,ze),_t=Se.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Ie.setAnchorCellForSelection(_t),O(ne),ne.shiftKey){const Nt=Se.getCordsFromCellNode(st,ze);return Ee(Ie,vt,Nt.x,Nt.y,oe)}else st.selectEnd();return!0}return!1}function O(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class H extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ne){return new H(ne.__key)}static importDOM(){return{table:ne=>({conversion:de,priority:1})}}static importJSON(ne){return _e()}constructor(ne){super(ne)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ne,oe){const Se=document.createElement("table");return t.addClassNamesToElement(Se,ne.theme.table),Se}updateDOM(){return!1}exportDOM(ne){return{...super.exportDOM(ne),after:oe=>{if(oe){const Se=oe.cloneNode(),Ie=document.createElement("colgroup"),De=document.createElement("tbody");t.isHTMLElement(oe)&&De.append(...oe.children);const je=this.getFirstChildOrThrow();if(!x(je))throw new Error("Expected to find row node.");const rt=je.getChildrenSize();for(let it=0;it<rt;it++){const st=document.createElement("col");Ie.append(st)}return Se.replaceChildren(Ie,De),Se}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ne,oe){const{rows:Se,cells:Ie}=oe;for(let De=0;De<Se;De++){const je=Ie[De];if(je==null)continue;const rt=je.findIndex(it=>{if(!it)return;const{elem:st}=it;return e.$getNearestNodeFromDOMNode(st)===ne});if(rt!==-1)return{x:rt,y:De}}throw new Error("Cell not found in table.")}getCellFromCords(ne,oe,Se){const{cells:Ie}=Se,De=Ie[oe];if(De==null)return null;const je=De[ne];return je??null}getCellFromCordsOrThrow(ne,oe,Se){const Ie=this.getCellFromCords(ne,oe,Se);if(!Ie)throw new Error("Cell not found at cords.");return Ie}getCellNodeFromCords(ne,oe,Se){const Ie=this.getCellFromCords(ne,oe,Se);if(Ie==null)return null;const De=e.$getNearestNodeFromDOMNode(Ie.elem);return b(De)?De:null}getCellNodeFromCordsOrThrow(ne,oe,Se){const Ie=this.getCellNodeFromCords(ne,oe,Se);if(!Ie)throw new Error("Node at cords not TableCellNode.");return Ie}canSelectBefore(){return!0}canIndent(){return!1}}function J(Oe,ne){const oe=Oe.getElementByKey(ne.getKey());if(oe==null)throw new Error("Table Element Not Found");return ge(oe)}function de(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new H)}function I(Oe){return Oe instanceof H}function w(Oe,ne,oe=!0){const Se=_e();for(let Ie=0;Ie<Oe;Ie++){const De=E();for(let je=0;je<ne;je++){let rt=m.NO_STATUS;typeof oe=="object"?(Ie===0&&oe.rows&&(rt|=m.ROW),je===0&&oe.columns&&(rt|=m.COLUMN)):oe&&(Ie===0&&(rt|=m.ROW),je===0&&(rt|=m.COLUMN));const it=R(rt),st=e.$createParagraphNode();st.append(e.$createTextNode()),it.append(st),De.append(it)}Se.append(De)}return Se}function D(Oe){const ne=t.$findMatchingParent(Oe,oe=>b(oe));return b(ne)?ne:null}function re(Oe){const ne=t.$findMatchingParent(Oe,oe=>x(oe));if(x(ne))return ne;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ne=t.$findMatchingParent(Oe,oe=>I(oe));if(I(ne))return ne;throw new Error("Expected table cell to be inside of table.")}function Ae(Oe){const ne=re(Oe);return ye(ne).getChildren().findIndex(Se=>Se.is(ne))}function ee(Oe){return re(Oe).getChildren().findIndex(oe=>oe.is(Oe))}function te(Oe,ne){const oe=ye(Oe),{x:Se,y:Ie}=oe.getCordsFromCellNode(Oe,ne);return{above:oe.getCellNodeFromCords(Se,Ie-1,ne),below:oe.getCellNodeFromCords(Se,Ie+1,ne),left:oe.getCellNodeFromCords(Se-1,Ie,ne),right:oe.getCellNodeFromCords(Se+1,Ie,ne)}}function ce(Oe,ne){const oe=Oe.getChildren();if(ne>=oe.length||ne<0)throw new Error("Expected table cell to be inside of table row.");return oe[ne].remove(),Oe}function be(Oe,ne,oe=!0,Se,Ie){const De=Oe.getChildren();if(ne>=De.length||ne<0)throw new Error("Table row target index out of range");const je=De[ne];if(x(je))for(let rt=0;rt<Se;rt++){const it=je.getChildren(),st=it.length,vt=E();for(let Ge=0;Ge<st;Ge++){const ze=it[Ge];if(!b(ze))throw Error("Expected table cell");const{above:tt,below:_t}=te(ze,Ie);let Nt=m.NO_STATUS;const Et=tt&&tt.getWidth()||_t&&_t.getWidth()||void 0;(tt&&tt.hasHeaderState(m.COLUMN)||_t&&_t.hasHeaderState(m.COLUMN))&&(Nt|=m.COLUMN);const ht=R(Nt,1,Et);ht.append(e.$createParagraphNode()),vt.append(ht)}oe?je.insertAfter(vt):je.insertBefore(vt)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ne=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ne))throw Error("Expected a INTERNAL_PointSelection");const oe=ne.focus.getNode(),[Se,,Ie]=e.DEPRECATED_$getNodeTriplet(oe),[De,je]=e.DEPRECATED_$computeGridMap(Ie,Se,Se),rt=De[0].length,{startRow:it}=je;if(Oe){const st=it+Se.__rowSpan-1,vt=De[st],Ge=E();for(let tt=0;tt<rt;tt++){const{cell:_t,startRow:Nt}=vt[tt];Nt+_t.__rowSpan-1<=st?Ge.append(R(m.NO_STATUS).append(e.$createParagraphNode())):_t.setRowSpan(_t.__rowSpan+1)}const ze=Ie.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const st=De[it],vt=E();for(let ze=0;ze<rt;ze++){const{cell:tt,startRow:_t}=st[ze];_t===it?vt.append(R(m.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Ie.getChildAtIndex(it);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(vt)}}function Re(Oe,ne,oe=!0,Se,Ie){const De=Oe.getChildren(),je=[];for(let rt=0;rt<De.length;rt++){const it=De[rt];if(x(it))for(let st=0;st<Se;st++){const vt=it.getChildren();if(ne>=vt.length||ne<0)throw new Error("Table column target index out of range");const Ge=vt[ne];if(!b(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=te(Ge,Ie);let _t=m.NO_STATUS;(ze&&ze.hasHeaderState(m.ROW)||tt&&tt.hasHeaderState(m.ROW))&&(_t|=m.ROW);const Nt=R(_t);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:rt,targetCell:it})=>{oe?it.insertAfter(rt):it.insertBefore(rt)}),Oe}function Le(Oe=!0){const ne=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ne))throw Error("Expected a PointSeleciton");const oe=ne.anchor.getNode(),Se=ne.focus.getNode(),[Ie]=e.DEPRECATED_$getNodeTriplet(oe),[De,,je]=e.DEPRECATED_$getNodeTriplet(Se),[rt,it,st]=e.DEPRECATED_$computeGridMap(je,De,Ie),vt=rt.length,Ge=Oe?Math.max(it.startColumn,st.startColumn):Math.min(it.startColumn,st.startColumn),ze=Oe?Ge+De.__colSpan-1:Ge-1,tt=je.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let _t=null;function Nt(){const ht=R(m.NO_STATUS).append(e.$createParagraphNode());return _t===null&&(_t=ht),ht}let Et=tt;e:for(let ht=0;ht<vt;ht++){if(ht!==0){const tn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(tn))throw Error("Expected row nextSibling to be a row");Et=tn}const xt=rt[ht];if(ze<0){Mt(Et,Nt());continue}const{cell:pt,startColumn:$t,startRow:Kt}=xt[ze];if($t+pt.__colSpan-1<=ze){let tn=pt,It=Kt,jt=ze;for(;It!==ht&&tn.__rowSpan>1;)if(jt-=pt.__colSpan,jt>=0){const{cell:bt,startRow:nn}=xt[jt];tn=bt,It=nn}else{Et.append(Nt());continue e}tn.insertAfter(Nt())}else pt.setColSpan(pt.__colSpan+1)}_t!==null&&ct(_t)}function Fe(Oe,ne){const oe=Oe.getChildren();for(let Se=0;Se<oe.length;Se++){const Ie=oe[Se];if(x(Ie)){const De=Ie.getChildren();if(ne>=De.length||ne<0)throw new Error("Table column target index out of range");De[ne].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),oe=Oe.focus.getNode(),[Se,,Ie]=e.DEPRECATED_$getNodeTriplet(ne),[De]=e.DEPRECATED_$getNodeTriplet(oe),[je,rt,it]=e.DEPRECATED_$computeGridMap(Ie,Se,De),{startRow:st}=rt,{startRow:vt}=it,Ge=vt+De.__rowSpan-1;if(je.length===Ge-st+1){Ie.remove();return}const ze=je[0].length,tt=je[Ge+1],_t=Ie.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=st;Nt--){for(let ht=ze-1;ht>=0;ht--){const{cell:xt,startRow:pt,startColumn:$t}=je[Nt][ht];if($t===ht&&(Nt===st&&pt<st&&xt.setRowSpan(xt.__rowSpan-(pt-st)),pt>=st&&pt+xt.__rowSpan-1>Ge)){if(xt.setRowSpan(xt.__rowSpan-(Ge-pt+1)),_t===null)throw Error("Expected nextRowNode not to be null");if(ht===0)Mt(_t,xt);else{const{cell:Kt}=tt[ht-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];ct(Nt)}else{const Nt=je[st-1],{cell:Et}=Nt[0];ct(Et)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),oe=Oe.focus.getNode(),[Se,,Ie]=e.DEPRECATED_$getNodeTriplet(ne),[De]=e.DEPRECATED_$getNodeTriplet(oe),[je,rt,it]=e.DEPRECATED_$computeGridMap(Ie,Se,De),{startColumn:st}=rt,{startRow:vt,startColumn:Ge}=it,ze=Math.min(st,Ge),tt=Math.max(st+Se.__colSpan-1,Ge+De.__colSpan-1),_t=tt-ze+1;if(je[0].length===tt-ze+1){Ie.selectPrevious(),Ie.remove();return}const Et=je.length;for(let pt=0;pt<Et;pt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:tn}=je[pt][$t];if(tn<ze){if($t===ze){const It=ze-tn;Kt.setColSpan(Kt.__colSpan-Math.min(_t,Kt.__colSpan-It))}}else if(tn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-tn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const ht=je[vt],xt=ht[Ge+De.__colSpan];if(xt!==void 0){const{cell:pt}=xt;ct(pt)}else{const pt=ht[Ge-1],{cell:$t}=pt;ct($t)}}function ct(Oe){const ne=Oe.getFirstDescendant();ne==null?Oe.selectStart():ne.getParentOrThrow().selectStart()}function Mt(Oe,ne){const oe=Oe.getFirstChild();oe!==null?oe.insertBefore(ne):Oe.append(ne)}function Ut(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),[oe,Se,Ie]=e.DEPRECATED_$getNodeTriplet(ne),De=oe.__colSpan,je=oe.__rowSpan;if(De>1){for(let rt=1;rt<De;rt++)oe.insertAfter(R(m.NO_STATUS));oe.setColSpan(1)}if(je>1){const[rt,it]=e.DEPRECATED_$computeGridMap(Ie,oe,oe),{startColumn:st,startRow:vt}=it;let Ge;for(let ze=1;ze<je;ze++){const tt=vt+ze,_t=rt[tt];if(Ge=(Ge||Se).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ge))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Et=0;Et<st;Et++){const ht=_t[Et],xt=ht.cell;ht.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Et+=xt.__colSpan-1)}if(Nt===null)for(let Et=0;Et<De;Et++)Mt(Ge,R(m.NO_STATUS));else for(let Et=0;Et<De;Et++)Nt.insertAfter(R(m.NO_STATUS))}oe.setRowSpan(1)}}const en=e.createCommand("INSERT_TABLE_COMMAND");return Zt.$createGridSelection=c,Zt.$createTableCellNode=R,Zt.$createTableNode=_e,Zt.$createTableNodeWithDimensions=w,Zt.$createTableRowNode=E,Zt.$deleteTableColumn=Fe,Zt.$deleteTableColumn__EXPERIMENTAL=Be,Zt.$deleteTableRow__EXPERIMENTAL=qe,Zt.$getElementGridForTableNode=J,Zt.$getTableCellNodeFromLexicalNode=D,Zt.$getTableColumnIndexFromTableCellNode=ee,Zt.$getTableNodeFromLexicalNodeOrThrow=ye,Zt.$getTableRowIndexFromTableCellNode=Ae,Zt.$getTableRowNodeFromTableCellNodeOrThrow=re,Zt.$insertTableColumn=Re,Zt.$insertTableColumn__EXPERIMENTAL=Le,Zt.$insertTableRow=be,Zt.$insertTableRow__EXPERIMENTAL=Ne,Zt.$isGridSelection=r,Zt.$isTableCellNode=b,Zt.$isTableNode=I,Zt.$isTableRowNode=x,Zt.$removeTableRowAtIndex=ce,Zt.$unmergeCell=Ut,Zt.INSERT_TABLE_COMMAND=en,Zt.TableCellHeaderStates=m,Zt.TableCellNode=N,Zt.TableNode=H,Zt.TableRowNode=k,Zt.TableSelection=F,Zt.applyTableHandlers=G,Zt.getCellFromTarget=se,Zt.getTableSelectionFromTableElement=le,Zt}var Jt={},_f;function Xy(){if(_f)return Jt;_f=1;var e=gn(),t=Xn();function n(I){let w=new URLSearchParams;w.append("code",I);for(let D=1;D<arguments.length;D++)w.append("v",arguments[D]);throw Error(`Minified Lexical error #${I}; visit https://lexical.dev/docs/error?${w} 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(w,D,re){super(D,re),this.gridKey=w}getCachedNodes(){return this._cachedNodes}setCachedNodes(w){this._cachedNodes=w}is(w){return c(w)?this.gridKey===w.gridKey&&this.anchor.is(w.anchor)&&this.focus.is(w.focus):!1}set(w,D,re){this.dirty=!0,this.gridKey=w,this.anchor.key=D,this.focus.key=re,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(w){let D=this.focus.getNode();if(!e.$isElementNode(D))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(D.select(0,D.getChildrenSize())).insertNodes(w)}getShape(){var w=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(w)||n(103),w=e.DEPRECATED_$getGridCellNodeRect(w),w===null)throw Error("getCellRect: expected to find AnchorNode");var D=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(D)||n(104);let re=e.DEPRECATED_$getGridCellNodeRect(D);if(re===null)throw Error("getCellRect: expected to find focusCellNode");D=Math.min(w.columnIndex,re.columnIndex);let ye=Math.max(w.columnIndex,re.columnIndex),Ae=Math.min(w.rowIndex,re.rowIndex);return w=Math.max(w.rowIndex,re.rowIndex),{fromX:Math.min(D,ye),fromY:Math.min(Ae,w),toX:Math.max(D,ye),toY:Math.max(Ae,w)}}getNodes(){function w(ct){let{cell:Mt,startColumn:Ut,startRow:en}=ct;be=Math.min(be,Ut),Ne=Math.min(Ne,en),Re=Math.max(Re,Ut+Mt.__colSpan-1),Le=Math.max(Le,en+Mt.__rowSpan-1)}var D=this._cachedNodes;if(D!==null)return D;var re=this.anchor.getNode();D=this.focus.getNode();var ye=t.$findMatchingParent(re,e.DEPRECATED_$isGridCellNode);re=t.$findMatchingParent(D,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(re)||n(104),D=ye.getParent(),e.DEPRECATED_$isGridRowNode(D)||n(105),D=D.getParent(),e.DEPRECATED_$isGridNode(D)||n(106);var Ae=re.getParents()[1];if(Ae!==D){if(D.isParentOf(re)){if(D=Ae.getParent(),D==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,re.getKey(),D.getKey())}else{if(D=D.getParent(),D==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,D.getKey(),re.getKey())}return this.getNodes()}let[ee,te,ce]=e.DEPRECATED_$computeGridMap(D,ye,re),be=Math.min(te.startColumn,ce.startColumn),Ne=Math.min(te.startRow,ce.startRow),Re=Math.max(te.startColumn+te.cell.__colSpan-1,ce.startColumn+ce.cell.__colSpan-1),Le=Math.max(te.startRow+te.cell.__rowSpan-1,ce.startRow+ce.cell.__rowSpan-1);re=be,ye=Ne,Ae=be;for(var Fe=Ne;be<re||Ne<ye||Re>Ae||Le>Fe;){if(be<re){var qe=Fe-ye;--re;for(var Be=0;Be<=qe;Be++)w(ee[ye+Be][re])}if(Ne<ye)for(qe=Ae-re,--ye,Be=0;Be<=qe;Be++)w(ee[ye][re+Be]);if(Re>Ae)for(qe=Fe-ye,Ae+=1,Be=0;Be<=qe;Be++)w(ee[ye+Be][Ae]);if(Le>Fe)for(qe=Ae-re,Fe+=1,Be=0;Be<=qe;Be++)w(ee[Fe][re+Be])}for(D=[D],re=null,ye=Ne;ye<=Le;ye++)for(Ae=be;Ae<=Re;Ae++)({cell:Fe}=ee[ye][Ae]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==re&&D.push(qe),D.push(Fe,...g(Fe)),re=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=D),D}getTextContent(){let w=this.getNodes(),D="";for(let re=0;re<w.length;re++)D+=w[re].getTextContent();return D}}function c(I){return I instanceof r}function d(){let I=e.$createPoint("root",0,"element"),w=e.$createPoint("root",0,"element");return new r("root",I,w)}function g(I){let w=[],D=[I];for(;0<D.length;){let re=D.pop();re===void 0&&n(112),e.$isElementNode(re)&&D.unshift(...re.getChildren()),re!==I&&w.push(re)}return w}let m=/^(\d+(?:\.\d+)?)px$/,N={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class T extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(w){let D=new T(w.__headerState,w.__colSpan,w.__width,w.__key);return D.__rowSpan=w.__rowSpan,D.__backgroundColor=w.__backgroundColor,D}static importDOM(){return{td:()=>({conversion:R,priority:0}),th:()=>({conversion:R,priority:0})}}static importJSON(w){let D=w.rowSpan||1,re=b(w.headerState,w.colSpan||1,w.width||void 0);return re.__rowSpan=D,re.__backgroundColor=w.backgroundColor||null,re}constructor(w=N.NO_STATUS,D=1,re,ye){super(D,ye),this.__headerState=w,this.__width=re,this.__backgroundColor=null}createDOM(w){let D=document.createElement(this.getTag());return this.__width&&(D.style.width=`${this.__width}px`),1<this.__colSpan&&(D.colSpan=this.__colSpan),1<this.__rowSpan&&(D.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(D.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(D,w.theme.tableCell,this.hasHeader()&&w.theme.tableCellHeader),D}exportDOM(w){if({element:w}=super.exportDOM(w),w){var D=this.getParentOrThrow().getChildrenSize();w.style.border="1px solid black",1<this.__colSpan&&(w.colSpan=this.__colSpan),1<this.__rowSpan&&(w.rowSpan=this.__rowSpan),w.style.width=`${this.getWidth()||Math.max(90,700/D)}px`,w.style.verticalAlign="top",w.style.textAlign="start",D=this.getBackgroundColor(),D!==null?w.style.backgroundColor=D:this.hasHeader()&&(w.style.backgroundColor="#f2f3f5")}return{element:w}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(w){return this.getWritable().__headerState=w,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(w){return this.getWritable().__width=w,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(w){this.getWritable().__backgroundColor=w}toggleHeaderStyle(w){let D=this.getWritable();return D.__headerState=(D.__headerState&w)===w?D.__headerState-w:D.__headerState+w,D}hasHeaderState(w){return(this.getHeaderStyles()&w)===w}hasHeader(){return this.getLatest().__headerState!==N.NO_STATUS}updateDOM(w){return w.__headerState!==this.__headerState||w.__width!==this.__width||w.__colSpan!==this.__colSpan||w.__rowSpan!==this.__rowSpan||w.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function R(I){var w=I.nodeName.toLowerCase();let D;return m.test(I.style.width)&&(D=parseFloat(I.style.width)),w=b(w==="th"?N.ROW:N.NO_STATUS,I.colSpan,D),w.__rowSpan=I.rowSpan,I=I.style.backgroundColor,I!==""&&(w.__backgroundColor=I),{forChild:(re,ye)=>k(ye)&&!e.$isElementNode(re)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(re)&&re.getTextContent()===`
|
|
76
|
-
`?null:(ye.append(re),ye)):re,node:w}}function b(I,w=1,D){return e.$applyNodeReplacement(new T(I,w,D))}function k(I){return I instanceof T}class z extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(w){return new z(w.__height,w.__key)}static importDOM(){return{tr:()=>({conversion:E,priority:0})}}static importJSON(w){return x(w.height)}constructor(w,D){super(D),this.__height=w}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(w){let D=document.createElement("tr");return this.__height&&(D.style.height=`${this.__height}px`),t.addClassNamesToElement(D,w.theme.tableRow),D}isShadowRoot(){return!0}setHeight(w){return this.getWritable().__height=w,this.__height}getHeight(){return this.getLatest().__height}updateDOM(w){return w.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function E(I){let w;return m.test(I.style.height)&&(w=parseFloat(I.style.height)),{node:x(w)}}function x(I){return e.$applyNodeReplacement(new z(I))}function U(I){return I instanceof z}let Q=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class F{constructor(w,D){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=D,this.editor=w,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(w=>w())}trackTableGrid(){let w=new MutationObserver(D=>{this.editor.update(()=>{var re=!1;for(let ye=0;ye<D.length;ye++){const Ae=D[ye].target.nodeName;if(Ae==="TABLE"||Ae==="TR"){re=!0;break}}if(re){if(re=this.editor.getElementByKey(this.tableNodeKey),!re)throw Error("Expected to find TableElement in DOM");this.grid=G(re)}})});this.editor.update(()=>{let D=this.editor.getElementByKey(this.tableNodeKey);if(!D)throw Error("Expected to find TableElement in DOM");this.grid=G(D),w.observe(D,{childList:!0,subtree:!0})})}clearHighlight(){let w=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(),w.update(()=>{var D=e.$getNodeByKey(this.tableNodeKey);if(!P(D))throw Error("Expected TableNode.");if(D=w.getElementByKey(this.tableNodeKey),!D)throw Error("Expected to find TableElement in DOM");D=G(D),q(w,D,null),e.$setSelection(null),w.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let w=this.editor;w.update(()=>{let D=w.getElementByKey(this.tableNodeKey);if(!D)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(D,w._config.theme.tableSelection),D.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let w=this.editor;w.update(()=>{let D=w.getElementByKey(this.tableNodeKey);if(!D)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(D,w._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(w){if(w!=null&&w.gridKey===this.tableNodeKey){let D=this.editor;this.gridSelection=w,this.isHighlightingCells=!0,this.disableHighlightStyle(),q(D,this.grid,this.gridSelection)}else w==null?this.clearHighlight():(this.tableNodeKey=w.gridKey,this.updateTableGridSelection(w))}setFocusCellForSelection(w,D=!1){let re=this.editor;re.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!P(ye))throw Error("Expected TableNode.");if(!re.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=w.x;let Ae=w.y;if(this.focusCell=w,this.anchorCell!==null){let ee=Q?(re._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==Ae||D))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&Ae===this.focusY)return;this.focusX=ye,this.focusY=Ae,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(w.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&k(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),re.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),q(re,this.grid,this.gridSelection)))})}setAnchorCellForSelection(w){this.isHighlightingCells=!1,this.anchorCell=w,this.anchorX=w.x,this.anchorY=w.y,this.editor.update(()=>{var D=e.$getNearestNodeFromDOMNode(w.elem);k(D)&&(D=D.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=D)})}formatCells(w){this.editor.update(()=>{let D=e.$getSelection();c(D)||n(11);let re=e.$createRangeSelection(),ye=re.anchor,Ae=re.focus;D.getNodes().forEach(ee=>{k(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),Ae.set(ee.getKey(),ee.getChildrenSize(),"element"),re.formatText(w))}),e.$setSelection(D),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let w=this.editor;w.update(()=>{let D=e.$getNodeByKey(this.tableNodeKey);if(!P(D))throw Error("Expected TableNode.");var re=e.$getSelection();c(re)||n(11),re=re.getNodes().filter(k),re.length===this.grid.columns*this.grid.rows?(D.selectPrevious(),D.remove(),e.$getRoot().selectStart()):(re.forEach(ye=>{if(e.$isElementNode(ye)){let Ae=e.$createParagraphNode(),ee=e.$createTextNode();Ae.append(ee),ye.append(Ae),ye.getChildren().forEach(te=>{te!==Ae&&te.remove()})}}),q(w,this.grid,null),e.$setSelection(null),w.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function W(I){for(;I!=null;){let w=I.nodeName;if(w==="TD"||w==="TH"){if(I=I._cell,I===void 0)break;return I}I=I.parentNode}return null}function G(I){let w=[],D={cells:w,columns:0,rows:0};var re=I.firstChild;let ye=I=0;for(w.length=0;re!=null;){var Ae=re.nodeName;if(Ae==="TD"||Ae==="TH"){Ae=re,Ae={elem:Ae,hasBackgroundColor:Ae.style.backgroundColor!=="",highlighted:!1,x:I,y:ye},re._cell=Ae;let ee=w[ye];ee===void 0&&(ee=w[ye]=[]),ee[I]=Ae}else if(Ae=re.firstChild,Ae!=null){re=Ae;continue}if(Ae=re.nextSibling,Ae!=null)I++,re=Ae;else if(Ae=re.parentNode,Ae!=null){if(re=Ae.nextSibling,re==null)break;ye++,I=0}}return D.columns=I+1,D.rows=ye+1,D}function q(I,w,D){let re=new Set(D?D.getNodes():[]);le(w,(ye,Ae)=>{let ee=ye.elem;re.has(Ae)?(ye.highlighted=!0,xe(I,ye)):(ye.highlighted=!1,we(I,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function le(I,w){({cells:I}=I);for(let D=0;D<I.length;D++){let re=I[D];if(re)for(let ye=0;ye<re.length;ye++){let Ae=re[ye];if(!Ae)continue;let ee=e.$getNearestNodeFromDOMNode(Ae.elem);ee!==null&&w(Ae,ee,{x:ye,y:D})}}}function se(I,w){w.disableHighlightStyle(),le(w.grid,D=>{D.highlighted=!0,xe(I,D)})}function ge(I,w){w.enableHighlightStyle(),le(w.grid,D=>{let re=D.elem;D.highlighted=!1,we(I,D),re.getAttribute("style")||re.removeAttribute("style")})}let j=(I,w,D,re,ye)=>{const Ae=ye==="forward";switch(ye){case"backward":case"forward":return D!==(Ae?I.grid.columns-1:0)?(I=w.getCellNodeFromCordsOrThrow(D+(Ae?1:-1),re,I.grid),Ae?I.selectStart():I.selectEnd()):re!==(Ae?I.grid.rows-1:0)?(I=w.getCellNodeFromCordsOrThrow(Ae?0:I.grid.columns-1,re+(Ae?1:-1),I.grid),Ae?I.selectStart():I.selectEnd()):Ae?w.selectNext():w.selectPrevious(),!0;case"up":return re!==0?w.getCellNodeFromCordsOrThrow(D,re-1,I.grid).selectEnd():w.selectPrevious(),!0;case"down":return re!==I.grid.rows-1?w.getCellNodeFromCordsOrThrow(D,re+1,I.grid).selectStart():w.selectNext(),!0;default:return!1}},B=(I,w,D,re,ye)=>{const Ae=ye==="forward";switch(ye){case"backward":case"forward":return D!==(Ae?I.grid.columns-1:0)&&I.setFocusCellForSelection(w.getCellFromCordsOrThrow(D+(Ae?1:-1),re,I.grid)),!0;case"up":return re!==0?(I.setFocusCellForSelection(w.getCellFromCordsOrThrow(D,re-1,I.grid)),!0):!1;case"down":return re!==I.grid.rows-1?(I.setFocusCellForSelection(w.getCellFromCordsOrThrow(D,re+1,I.grid)),!0):!1;default:return!1}};function V(I,w){if(e.$isRangeSelection(I)||c(I)){let D=w.isParentOf(I.anchor.getNode());return I=w.isParentOf(I.focus.getNode()),D&&I}return!1}function xe(I,w){I=w.elem,w=e.$getNearestNodeFromDOMNode(I),k(w)||n(131),w.getBackgroundColor()===null?I.style.setProperty("background-color","rgb(172,206,247)"):I.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),I.style.setProperty("caret-color","transparent")}function we(I,w){I=w.elem,w=e.$getNearestNodeFromDOMNode(I),k(w)||n(131),w.getBackgroundColor()===null&&I.style.removeProperty("background-color"),I.style.removeProperty("background-image"),I.style.removeProperty("caret-color")}function Ee(I){return I=t.$findMatchingParent(I,k),k(I)?I:null}function ue(I){return I=t.$findMatchingParent(I,P),P(I)?I:null}function $(I,w,D,re,ye){let Ae=e.$getSelection();if(!V(Ae,re))return!1;if(e.$isRangeSelection(Ae)&&Ae.isCollapsed()){if(D==="backward"||D==="forward")return!1;let{anchor:be,focus:Ne}=Ae;var ee=t.$findMatchingParent(be.getNode(),k),te=t.$findMatchingParent(Ne.getNode(),k);if(!k(ee)||!ee.is(te))return!1;if(te=ue(ee),te!==re&&te!=null){var ce=I.getElementByKey(te.getKey());if(ce!=null)return ye.grid=G(ce),$(I,w,D,te,ye)}if(te=I.getElementByKey(ee.__key),ce=I.getElementByKey(be.key),ce==null||te==null)return!1;if(be.type==="element")te=ce.getBoundingClientRect();else{if(te=window.getSelection(),te===null||te.rangeCount===0)return!1;te=te.getRangeAt(0).getBoundingClientRect()}if(ce=D==="up"?ee.getFirstChild():ee.getLastChild(),ce==null||(I=I.getElementByKey(ce.__key),I==null))return!1;if(I=I.getBoundingClientRect(),D==="up"?I.top>te.top-te.height:te.bottom+te.height>I.bottom){if(S(w),I=re.getCordsFromCellNode(ee,ye.grid),w.shiftKey)D=re.getCellFromCordsOrThrow(I.x,I.y,ye.grid),ye.setAnchorCellForSelection(D),ye.setFocusCellForSelection(D,!0);else return j(ye,re,I.x,I.y,D);return!0}}else if(c(Ae)){let{anchor:be,focus:Ne}=Ae;return ce=t.$findMatchingParent(be.getNode(),k),te=t.$findMatchingParent(Ne.getNode(),k),[ee]=Ae.getNodes(),I=I.getElementByKey(ee.getKey()),!k(ce)||!k(te)||!P(ee)||I==null?!1:(ye.updateTableGridSelection(Ae),I=G(I),ce=re.getCordsFromCellNode(ce,I),ce=re.getCellFromCordsOrThrow(ce.x,ce.y,I),ye.setAnchorCellForSelection(ce),S(w),w.shiftKey?(w=re.getCordsFromCellNode(te,I),B(ye,ee,w.x,w.y,D)):(te.selectEnd(),!0))}return!1}function S(I){I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation()}class Y extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(w){return new Y(w.__key)}static importDOM(){return{table:()=>({conversion:ie,priority:1})}}static importJSON(){return K()}constructor(w){super(w)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(w){let D=document.createElement("table");return t.addClassNamesToElement(D,w.theme.table),D}updateDOM(){return!1}exportDOM(w){return{...super.exportDOM(w),after:D=>{if(D){let re=D.cloneNode(),ye=document.createElement("colgroup"),Ae=document.createElement("tbody");if(t.isHTMLElement(D)&&Ae.append(...D.children),D=this.getFirstChildOrThrow(),!U(D))throw Error("Expected to find row node.");D=D.getChildrenSize();for(let ee=0;ee<D;ee++){let te=document.createElement("col");ye.append(te)}return re.replaceChildren(ye,Ae),re}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(w,D){let{rows:re,cells:ye}=D;for(D=0;D<re;D++){var Ae=ye[D];if(Ae!=null&&(Ae=Ae.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===w}),Ae!==-1))return{x:Ae,y:D}}throw Error("Cell not found in table.")}getCellFromCords(w,D,re){return{cells:re}=re,D=re[D],D==null?null:(w=D[w],w??null)}getCellFromCordsOrThrow(w,D,re){if(w=this.getCellFromCords(w,D,re),!w)throw Error("Cell not found at cords.");return w}getCellNodeFromCords(w,D,re){return w=this.getCellFromCords(w,D,re),w==null?null:(w=e.$getNearestNodeFromDOMNode(w.elem),k(w)?w:null)}getCellNodeFromCordsOrThrow(w,D,re){if(w=this.getCellNodeFromCords(w,D,re),!w)throw Error("Node at cords not TableCellNode.");return w}canSelectBefore(){return!0}canIndent(){return!1}}function ie(){return{node:K()}}function K(){return e.$applyNodeReplacement(new Y)}function P(I){return I instanceof Y}function Z(I){if(I=t.$findMatchingParent(I,w=>U(w)),U(I))return I;throw Error("Expected table cell to be inside of table row.")}function O(I){if(I=t.$findMatchingParent(I,w=>P(w)),P(I))return I;throw Error("Expected table cell to be inside of table.")}function H(I,w){let D=O(I),{x:re,y:ye}=D.getCordsFromCellNode(I,w);return{above:D.getCellNodeFromCords(re,ye-1,w),below:D.getCellNodeFromCords(re,ye+1,w),left:D.getCellNodeFromCords(re-1,ye,w),right:D.getCellNodeFromCords(re+1,ye,w)}}function J(I){let w=I.getFirstDescendant();w==null?I.selectStart():w.getParentOrThrow().selectStart()}function de(I,w){let D=I.getFirstChild();D!==null?D.insertBefore(w):I.append(w)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=d,Jt.$createTableCellNode=b,Jt.$createTableNode=K,Jt.$createTableNodeWithDimensions=function(I,w,D=!0){let re=K();for(let Ae=0;Ae<I;Ae++){let ee=x();for(let te=0;te<w;te++){var ye=N.NO_STATUS;typeof D=="object"?(Ae===0&&D.rows&&(ye|=N.ROW),te===0&&D.columns&&(ye|=N.COLUMN)):D&&(Ae===0&&(ye|=N.ROW),te===0&&(ye|=N.COLUMN)),ye=b(ye);let ce=e.$createParagraphNode();ce.append(e.$createTextNode()),ye.append(ce),ee.append(ye)}re.append(ee)}return re},Jt.$createTableRowNode=x,Jt.$deleteTableColumn=function(I,w){let D=I.getChildren();for(let ye=0;ye<D.length;ye++){var re=D[ye];if(U(re)){if(re=re.getChildren(),w>=re.length||0>w)throw Error("Table column target index out of range");re[w].remove()}}return I},Jt.$deleteTableColumn__EXPERIMENTAL=function(){var I=e.$getSelection();if(!e.$INTERNAL_isPointSelection(I))throw Error("Expected a INTERNAL_PointSelection");var w=I.anchor.getNode();I=I.focus.getNode();let[D,,re]=e.DEPRECATED_$getNodeTriplet(w);[w]=e.DEPRECATED_$getNodeTriplet(I);let[ye,Ae,ee]=e.DEPRECATED_$computeGridMap(re,D,w);var{startColumn:te}=Ae;let{startRow:ce,startColumn:be}=ee;I=Math.min(te,be),te=Math.max(te+D.__colSpan-1,be+w.__colSpan-1);let Ne=te-I+1;if(ye[0].length===te-I+1)re.selectPrevious(),re.remove();else{var Re=ye.length;for(let Le=0;Le<Re;Le++)for(let Fe=I;Fe<=te;Fe++){let{cell:qe,startColumn:Be}=ye[Le][Fe];Be<I?Fe===I&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(I-Be))):Be+qe.__colSpan-1>te?Fe===te&&qe.setColSpan(qe.__colSpan-(te-Be+1)):qe.remove()}I=ye[ce],w=I[be+w.__colSpan],w!==void 0?({cell:w}=w,J(w)):({cell:w}=I[be-1],J(w))}},Jt.$deleteTableRow__EXPERIMENTAL=function(){var I=e.$getSelection();if(!e.$INTERNAL_isPointSelection(I))throw Error("Expected a INTERNAL_PointSelection");var w=I.anchor.getNode();I=I.focus.getNode();let[D,,re]=e.DEPRECATED_$getNodeTriplet(w);[I]=e.DEPRECATED_$getNodeTriplet(I);let[ye,Ae,ee]=e.DEPRECATED_$computeGridMap(re,D,I);({startRow:w}=Ae);var{startRow:te}=ee;if(I=te+I.__rowSpan-1,ye.length===I-w+1)re.remove();else{te=ye[0].length;var ce=ye[I+1],be=re.getChildAtIndex(I+1);for(let Re=I;Re>=w;Re--){for(var Ne=te-1;0<=Ne;Ne--){let{cell:Le,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===w&&Fe<w&&Le.setRowSpan(Le.__rowSpan-(Fe-w)),Fe>=w&&Fe+Le.__rowSpan-1>I))if(Le.setRowSpan(Le.__rowSpan-(I-Fe+1)),be===null&&n(122),Ne===0)de(be,Le);else{let{cell:Be}=ce[Ne-1];Be.insertAfter(Le)}}Ne=re.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ce!==void 0?({cell:w}=ce[0],J(w)):({cell:w}=ye[w-1][0],J(w))}},Jt.$getElementGridForTableNode=function(I,w){if(I=I.getElementByKey(w.getKey()),I==null)throw Error("Table Element Not Found");return G(I)},Jt.$getTableCellNodeFromLexicalNode=function(I){return I=t.$findMatchingParent(I,w=>k(w)),k(I)?I:null},Jt.$getTableColumnIndexFromTableCellNode=function(I){return Z(I).getChildren().findIndex(w=>w.is(I))},Jt.$getTableNodeFromLexicalNodeOrThrow=O,Jt.$getTableRowIndexFromTableCellNode=function(I){let w=Z(I);return O(w).getChildren().findIndex(D=>D.is(w))},Jt.$getTableRowNodeFromTableCellNodeOrThrow=Z,Jt.$insertTableColumn=function(I,w,D=!0,re,ye){let Ae=I.getChildren(),ee=[];for(let be=0;be<Ae.length;be++){let Ne=Ae[be];if(U(Ne))for(let Re=0;Re<re;Re++){var te=Ne.getChildren();if(w>=te.length||0>w)throw Error("Table column target index out of range");te=te[w],k(te)||n(12);let{left:Le,right:Fe}=H(te,ye);var ce=N.NO_STATUS;(Le&&Le.hasHeaderState(N.ROW)||Fe&&Fe.hasHeaderState(N.ROW))&&(ce|=N.ROW),ce=b(ce),ce.append(e.$createParagraphNode()),ee.push({newTableCell:ce,targetCell:te})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{D?Ne.insertAfter(be):Ne.insertBefore(be)}),I},Jt.$insertTableColumn__EXPERIMENTAL=function(I=!0){function w(){let Re=b(N.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var D=e.$getSelection();if(!e.$INTERNAL_isPointSelection(D))throw Error("Expected a PointSeleciton");var re=D.anchor.getNode();D=D.focus.getNode(),[re]=e.DEPRECATED_$getNodeTriplet(re);let[ye,,Ae]=e.DEPRECATED_$getNodeTriplet(D),[ee,te,ce]=e.DEPRECATED_$computeGridMap(Ae,ye,re);re=ee.length,D=I?Math.max(te.startColumn,ce.startColumn):Math.min(te.startColumn,ce.startColumn),I=I?D+ye.__colSpan-1:D-1,D=Ae.getFirstChild(),e.DEPRECATED_$isGridRowNode(D)||n(120);let be=null;var Ne=D;e:for(D=0;D<re;D++){D!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[D];if(0>I){de(Ne,w());continue}let{cell:Le,startColumn:Fe,startRow:qe}=Re[I];if(Fe+Le.__colSpan-1<=I){let Be=Le,ct=qe,Mt=I;for(;ct!==D&&1<Be.__rowSpan;)if(Mt-=Le.__colSpan,0<=Mt){let{cell:Ut,startRow:en}=Re[Mt];Be=Ut,ct=en}else{Ne.append(w());continue e}Be.insertAfter(w())}else Le.setColSpan(Le.__colSpan+1)}be!==null&&J(be)},Jt.$insertTableRow=function(I,w,D=!0,re,ye){var Ae=I.getChildren();if(w>=Ae.length||0>w)throw Error("Table row target index out of range");if(w=Ae[w],U(w))for(Ae=0;Ae<re;Ae++){let te=w.getChildren(),ce=te.length,be=x();for(let Ne=0;Ne<ce;Ne++){var ee=te[Ne];k(ee)||n(12);let{above:Re,below:Le}=H(ee,ye);ee=N.NO_STATUS;let Fe=Re&&Re.getWidth()||Le&&Le.getWidth()||void 0;(Re&&Re.hasHeaderState(N.COLUMN)||Le&&Le.hasHeaderState(N.COLUMN))&&(ee|=N.COLUMN),ee=b(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}D?w.insertAfter(be):w.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return I},Jt.$insertTableRow__EXPERIMENTAL=function(I=!0){var w=e.$getSelection();if(!e.$INTERNAL_isPointSelection(w))throw Error("Expected a INTERNAL_PointSelection");w=w.focus.getNode();let[D,,re]=e.DEPRECATED_$getNodeTriplet(w),[ye,Ae]=e.DEPRECATED_$computeGridMap(re,D,D);w=ye[0].length;var{startRow:ee}=Ae;if(I){I=ee+D.__rowSpan-1;var te=ye[I];ee=x();for(var ce=0;ce<w;ce++){let{cell:be,startRow:Ne}=te[ce];Ne+be.__rowSpan-1<=I?ee.append(b(N.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}w=re.getChildAtIndex(I),e.DEPRECATED_$isGridRowNode(w)||n(119),w.insertAfter(ee)}else{for(te=ye[ee],I=x(),ce=0;ce<w;ce++){let{cell:be,startRow:Ne}=te[ce];Ne===ee?I.append(b(N.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}w=re.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(w)||n(119),w.insertBefore(I)}},Jt.$isGridSelection=c,Jt.$isTableCellNode=k,Jt.$isTableNode=P,Jt.$isTableRowNode=U,Jt.$removeTableRowAtIndex=function(I,w){let D=I.getChildren();if(w>=D.length||0>w)throw Error("Expected table cell to be inside of table row.");return D[w].remove(),I},Jt.$unmergeCell=function(){var I=e.$getSelection();if(!e.$INTERNAL_isPointSelection(I))throw Error("Expected a INTERNAL_PointSelection");I=I.anchor.getNode();let[w,D,re]=e.DEPRECATED_$getNodeTriplet(I);I=w.__colSpan;let ye=w.__rowSpan;if(1<I){for(var Ae=1;Ae<I;Ae++)w.insertAfter(b(N.NO_STATUS));w.setColSpan(1)}if(1<ye){let[ce,be]=e.DEPRECATED_$computeGridMap(re,w,w),{startColumn:Ne,startRow:Re}=be,Le;for(Ae=1;Ae<ye;Ae++){var ee=Re+Ae;let Fe=ce[ee];Le=(Le||D).getNextSibling(),e.DEPRECATED_$isGridRowNode(Le)||n(125);var te=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ct=Be.cell;Be.startRow===ee&&(te=ct),1<ct.__colSpan&&(qe+=ct.__colSpan-1)}if(te===null)for(te=0;te<I;te++)de(Le,b(N.NO_STATUS));else for(ee=0;ee<I;ee++)te.insertAfter(b(N.NO_STATUS))}w.setRowSpan(1)}},Jt.INSERT_TABLE_COMMAND=_e,Jt.TableCellHeaderStates=N,Jt.TableCellNode=T,Jt.TableNode=Y,Jt.TableRowNode=z,Jt.TableSelection=F,Jt.applyTableHandlers=function(I,w,D,re){function ye(Ne){return Ne=I.getCordsFromCellNode(Ne,ee.grid),I.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let Ae=D.getRootElement();if(Ae===null)throw Error("No root element.");let ee=new F(D,I.getKey()),te=D._window||window;w.__lexicalTableSelection=ee,w.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&te){var Re=W(Ne.target);Re!==null&&(S(Ne),ee.setAnchorCellForSelection(Re));var Le=()=>{te.removeEventListener("mouseup",Le),te.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=W(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};te.addEventListener("mouseup",Le),te.addEventListener("mousemove",Fe)}},0)});let ce=Ne=>{Ne.button===0&&D.update(()=>{const Re=e.$getSelection(),Le=Ne.target;c(Re)&&Re.gridKey===ee.tableNodeKey&&Ae.contains(Le)&&ee.clearHighlight()})};te.addEventListener("mousedown",ce),ee.listenersToRemove.add(()=>te.removeEventListener("mousedown",ce)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>$(D,Ne,"down",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>$(D,Ne,"up",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>$(D,Ne,"backward",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>$(D,Ne,"forward",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return c(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),k),k(Re))?(S(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!V(Re,I))return!1;if(c(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>k(Be));if(!k(qe))return!1;var Le=Re.anchor.getNode(),Fe=Re.focus.getNode();if(Le=I.isParentOf(Le),Fe=I.isParentOf(Fe),Le&&!Fe||Fe&&!Le)return ee.clearText(),!0;if(Le=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&k(Be.getParent())),!e.$isElementNode(Le)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&Le.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==Le){Re=Fe.getChildren();const Be=e.$createParagraphNode();return Re.forEach(ct=>Be.append(ct)),Fe.replace(Be),Fe.getWritable().__parent=qe.getKey(),!0}}return!1};return[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ne=>{ee.listenersToRemove.add(D.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),w=Ne=>{const Re=e.$getSelection();return V(Re,I)?c(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),Le=>k(Le)),k(Ne)),!1):!1},ee.listenersToRemove.add(D.registerCommand(e.KEY_BACKSPACE_COMMAND,w,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.KEY_DELETE_COMMAND,w,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return V(Re,I)?c(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),Le=>k(Le)),k(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return V(Ne,I)&&(c(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>k(Re)),k(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),re&&ee.listenersToRemove.add(D.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!V(Re,I)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(S(Ne),Re=I.getCordsFromCellNode(Re,ee.grid),j(ee,I,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.FOCUS_COMMAND,()=>I.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:Le}=Ne;Ne=e.$INTERNAL_isPointSelection(Le);var Fe=e.$isRangeSelection(Le);if(Ne=Fe&&t.$findMatchingParent(Le.anchor.getNode(),Ie=>e.DEPRECATED_$isGridCellNode(Ie))!==null&&t.$findMatchingParent(Le.focus.getNode(),Ie=>e.DEPRECATED_$isGridCellNode(Ie))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=Le,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ct=t.$findMatchingParent(qe.getNode(),Ie=>e.DEPRECATED_$isGridCellNode(Ie)),Mt=(qe=ct&&t.$findMatchingParent(ct,Ie=>e.DEPRECATED_$isGridRowNode(Ie)))&&t.$findMatchingParent(qe,Ie=>e.DEPRECATED_$isGridNode(Ie));if(!e.DEPRECATED_$isGridCellNode(ct)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(Mt))return!1;var Ut=qe.getIndexWithinParent(),en=Math.min(Mt.getChildrenSize()-1,Ut+Be-1);Be=ct.getIndexWithinParent(),ct=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ct),qe=Math.min(Ut,en),Be=Math.max(Be,ct),Ut=Math.max(Ut,en),Mt=Mt.getChildren(),en=0;let Oe,ne;for(ct=qe;ct<=Ut;ct++){var oe=Mt[ct];if(!e.DEPRECATED_$isGridRowNode(oe))return!1;var Se=Ne[en];if(!e.DEPRECATED_$isGridRowNode(Se))return!1;oe=oe.getChildren(),Se=Se.getChildren();let Ie=0;for(let De=Fe;De<=Be;De++){let je=oe[De];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let rt=Se[Ie];if(!e.DEPRECATED_$isGridCellNode(rt))return!1;ct===qe&&De===Fe?Oe=je.getKey():ct===Ut&&De===Be&&(ne=je.getKey());let it=je.getChildren();rt.getChildren().forEach(st=>{e.$isTextNode(st)&&e.$createParagraphNode().append(st),je.append(st)}),it.forEach(st=>st.remove()),Ie++}en++}return Oe&&ne&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ne),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ct,focus:Mt}=Ne;var Le=ct.getNode(),Fe=Mt.getNode();Le=Ee(Le),Fe=Ee(Fe);var qe=Le&&I.is(ue(Le)),Be=Fe&&I.is(ue(Fe));let Ut=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),Ut?(Le=Ne.clone(),Le.focus.set(I.getKey(),qe?0:I.getChildrenSize(),"element"),e.$setSelection(Le),se(D,ee)):Be&&!Le.is(Fe)&&(ee.setAnchorCellForSelection(ye(Le)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(c(Ne)||c(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(c(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!c(Ne)&&c(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!I.isSelected()?ge(D,ee):!ee.hasHijackedSelectionStyles&&I.isSelected()&&se(D,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Jt.getCellFromTarget=W,Jt.getTableSelectionFromTableElement=function(I){return I.__lexicalTableSelection},Jt}const Qy=process.env.NODE_ENV==="development"?Jy():Xy();var Eu=Qy,fr={},yf;function eN(){if(yf)return fr;yf=1;var e=gn(),t=Xn();function n(K){let P=1,Z=K.getParent();for(;Z!=null;){if(ge(Z)){const O=Z.getParent();if(ue(O)){P++,Z=O.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return P}return P}function r(K){let P=K.getParent();if(!ue(P))throw Error("A ListItemNode must have a ListNode for a parent.");let Z=P;for(;Z!==null;)Z=Z.getParent(),ue(Z)&&(P=Z);return P}function c(K){let P=[];const Z=K.getChildren().filter(ge);for(let O=0;O<Z.length;O++){const H=Z[O],J=H.getFirstChild();ue(J)?P=P.concat(c(J)):P.push(H)}return P}function d(K){return ge(K)&&ue(K.getFirstChild())}function g(K){let P=K;for(;P.getNextSibling()==null&&P.getPreviousSibling()==null;){const Z=P.getParent();if(Z==null||!(ge(P)||ue(P)))break;P=Z}P.remove()}function m(K){return se().append(K)}function N(K,P){return ge(K)&&(P.length===0||P.length===1&&K.is(P[0])&&K.getChildrenSize()===0)}function T(K){const P=K.getParent();let Z=1;if(P!=null)if(ue(P))Z=P.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const O=K.getPreviousSiblings();for(let H=0;H<O.length;H++){const J=O[H];ge(J)&&!ue(J.getFirstChild())&&Z++}return Z}function R(K,P){K.update(()=>{const Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){const O=Z.getNodes(),J=Z.anchor.getNode(),de=J.getParent();if(N(J,O)){const _e=Ee(P);if(e.$isRootOrShadowRoot(de)){J.replace(_e);const I=se();e.$isElementNode(J)&&(I.setFormat(J.getFormatType()),I.setIndent(J.getIndent())),_e.append(I)}else if(ge(J)){const I=J.getParentOrThrow();b(_e,I.getChildren()),I.replace(_e)}return}else{const _e=new Set;for(let I=0;I<O.length;I++){const w=O[I];if(e.$isElementNode(w)&&w.isEmpty()&&!ge(w)&&!_e.has(w.getKey())){k(w,P);continue}if(e.$isLeafNode(w)){let D=w.getParent();for(;D!=null;){const re=D.getKey();if(ue(D)){if(!_e.has(re)){const ye=Ee(P);b(ye,D.getChildren()),D.replace(ye),x(ye),_e.add(re)}break}else{const ye=D.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(re)){_e.add(re),k(D,P);break}D=ye}}}}}}})}function b(K,P){K.splice(K.getChildrenSize(),0,P)}function k(K,P){if(ue(K))return K;const Z=K.getPreviousSibling(),O=K.getNextSibling(),H=se();if(H.setFormat(K.getFormatType()),H.setIndent(K.getIndent()),b(H,K.getChildren()),ue(Z)&&P===Z.getListType())return Z.append(H),K.remove(),ue(O)&&P===O.getListType()&&(b(Z,O.getChildren()),O.remove()),Z;if(ue(O)&&P===O.getListType())return O.getFirstChildOrThrow().insertBefore(H),K.remove(),O;{const J=Ee(P);return J.append(H),K.replace(J),x(J),J}}function z(K,P){const Z=K.getLastChild(),O=P.getFirstChild();Z&&O&&d(Z)&&d(O)&&(z(Z.getFirstChild(),O.getFirstChild()),O.remove());const H=P.getChildren();H.length>0&&(K.append(...H),x(K)),P.remove()}function E(K){K.update(()=>{const P=e.$getSelection();if(e.$isRangeSelection(P)){const Z=new Set,O=P.getNodes(),H=P.anchor.getNode();if(N(H,O))Z.add(r(H));else for(let J=0;J<O.length;J++){const de=O[J];if(e.$isLeafNode(de)){const _e=t.$getNearestNodeOfType(de,W);_e!=null&&Z.add(r(_e))}}for(const J of Z){let de=J;const _e=c(J);for(const I of _e){const w=e.$createParagraphNode();b(w,I.getChildren()),de.insertAfter(w),de=w,I.__key===P.anchor.key&&P.anchor.set(w.getKey(),0,"element"),I.__key===P.focus.key&&P.focus.set(w.getKey(),0,"element"),I.remove()}J.remove()}}})}function x(K,P){const Z=P||K.getChildren();if(Z!==void 0)for(let O=0;O<Z.length;O++){const H=Z[O];if(ge(H)){const J=H.getValue(),de=T(H);J!==de&&H.setValue(de)}}}function U(K){const P=new Set;if(d(K)||P.has(K.getKey()))return;const Z=K.getParent(),O=K.getNextSibling(),H=K.getPreviousSibling();if(d(O)&&d(H)){const J=H.getFirstChild();if(ue(J)){J.append(K);const de=O.getFirstChild();if(ue(de)){const _e=de.getChildren();b(J,_e),O.remove(),P.add(O.getKey())}x(J)}}else if(d(O)){const J=O.getFirstChild();if(ue(J)){const de=J.getFirstChild();de!==null&&de.insertBefore(K),x(J)}}else if(d(H)){const J=H.getFirstChild();ue(J)&&(J.append(K),x(J))}else if(ue(Z)){const J=se(),de=Ee(Z.getListType());J.append(de),de.append(K),H?H.insertAfter(J):O?O.insertBefore(J):Z.append(J),x(de)}ue(Z)&&x(Z)}function Q(K){if(d(K))return;const P=K.getParent(),Z=P?P.getParent():void 0,O=Z?Z.getParent():void 0;if(ue(O)&&ge(Z)&&ue(P)){const H=P?P.getFirstChild():void 0,J=P?P.getLastChild():void 0;if(K.is(H))Z.insertBefore(K),P.isEmpty()&&Z.remove();else if(K.is(J))Z.insertAfter(K),P.isEmpty()&&Z.remove();else{const de=P.getListType(),_e=se(),I=Ee(de);_e.append(I),K.getPreviousSiblings().forEach(re=>I.append(re));const w=se(),D=Ee(de);w.append(D),b(D,K.getNextSiblings()),Z.insertBefore(_e),Z.insertAfter(w),Z.replace(K)}x(P),x(O)}}function F(){const K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed())return!1;const P=K.anchor.getNode();if(!ge(P)||P.getChildrenSize()!==0)return!1;const Z=r(P),O=P.getParent();if(!ue(O))throw Error("A ListItemNode must have a ListNode for a parent.");const H=O.getParent();let J;if(e.$isRootOrShadowRoot(H))J=e.$createParagraphNode(),Z.insertAfter(J);else if(ge(H))J=se(),H.insertAfter(J);else return!1;J.select();const de=P.getNextSiblings();if(de.length>0){const _e=Ee(O.getListType());if(e.$isParagraphNode(J))J.insertAfter(_e);else{const I=se();I.append(_e),J.insertAfter(I)}de.forEach(I=>{I.remove(),_e.append(I)})}return g(P),!0}class W extends e.ElementNode{static getType(){return"listitem"}static clone(P){return new W(P.__value,P.__checked,P.__key)}constructor(P,Z,O){super(O),this.__value=P===void 0?1:P,this.__checked=Z}createDOM(P){const Z=document.createElement("li"),O=this.getParent();return ue(O)&&O.getListType()==="check"&&q(Z,this,null),Z.value=this.__value,G(Z,P.theme,this),Z}updateDOM(P,Z,O){const H=this.getParent();return ue(H)&&H.getListType()==="check"&&q(Z,this,P),Z.value=this.__value,G(Z,O.theme,this),!1}static transform(){return P=>{const Z=P.getParent();if(ue(Z)){if(x(Z),!ge(P))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&P.getChecked()!=null&&P.setChecked(void 0)}}}static importDOM(){return{li:P=>({conversion:le,priority:0})}}static importJSON(P){const Z=se();return Z.setChecked(P.checked),Z.setValue(P.value),Z.setFormat(P.format),Z.setDirection(P.direction),Z}exportDOM(P){const Z=this.createDOM(P._config);return Z.style.textAlign=this.getFormatType(),{element:Z}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...P){for(let Z=0;Z<P.length;Z++){const O=P[Z];if(e.$isElementNode(O)&&this.canMergeWith(O)){const H=O.getChildren();this.append(...H),O.remove()}else super.append(O)}return this}replace(P,Z){if(ge(P))return super.replace(P);this.setIndent(0);const O=this.getParentOrThrow();if(!ue(O))return P;if(O.__first===this.getKey())O.insertBefore(P);else if(O.__last===this.getKey())O.insertAfter(P);else{const H=Ee(O.getListType());let J=this.getNextSibling();for(;J;){const de=J;J=J.getNextSibling(),H.append(de)}O.insertAfter(P),P.insertAfter(H)}if(Z){if(!e.$isElementNode(P))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(H=>{P.append(H)})}return this.remove(),O.getChildrenSize()===0&&O.remove(),P}insertAfter(P,Z=!0){const O=this.getParentOrThrow();if(!ue(O))throw Error("insertAfter: list node is not parent of list item node");const H=this.getNextSiblings();if(ge(P)){const J=super.insertAfter(P,Z),de=P.getParentOrThrow();return ue(de)&&x(de),J}if(ue(P)){let J=P;const de=P.getChildren();for(let _e=de.length-1;_e>=0;_e--)J=de[_e],this.insertAfter(J,Z);return J}if(O.insertAfter(P,Z),H.length!==0){const J=Ee(O.getListType());H.forEach(de=>J.append(de)),P.insertAfter(J,Z)}return P}remove(P){const Z=this.getPreviousSibling(),O=this.getNextSibling();if(super.remove(P),Z&&O&&d(Z)&&d(O))z(Z.getFirstChild(),O.getFirstChild()),O.remove();else if(O){const H=O.getParent();ue(H)&&x(H)}}insertNewAfter(P,Z=!0){const O=se(this.__checked==null?void 0:!1);return this.insertAfter(O,Z),O}collapseAtStart(P){const Z=e.$createParagraphNode();this.getChildren().forEach(_e=>Z.append(_e));const H=this.getParentOrThrow(),J=H.getParentOrThrow(),de=ge(J);if(H.getChildrenSize()===1)if(de)H.remove(),J.select();else{H.insertBefore(Z),H.remove();const _e=P.anchor,I=P.focus,w=Z.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(w,_e.offset,"element"),I.type==="element"&&I.getNode().is(this)&&I.set(w,I.offset,"element")}else H.insertBefore(Z),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(P){const Z=this.getWritable();Z.__value=P}getChecked(){return this.getLatest().__checked}setChecked(P){const Z=this.getWritable();Z.__checked=P}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const P=this.getParent();if(P===null)return this.getLatest().__indent;let Z=P.getParentOrThrow(),O=0;for(;ge(Z);)Z=Z.getParentOrThrow().getParentOrThrow(),O++;return O}setIndent(P){if(!(typeof P=="number"&&P>-1))throw Error("Invalid indent value.");let Z=this.getIndent();for(;Z!==P;)Z<P?(U(this),Z++):(Q(this),Z--);return this}insertBefore(P){if(ge(P)){const Z=this.getParentOrThrow();if(ue(Z)){const O=this.getNextSiblings();x(Z,O)}}return super.insertBefore(P)}canInsertAfter(P){return ge(P)}canReplaceWith(P){return ge(P)}canMergeWith(P){return e.$isParagraphNode(P)||ge(P)}extractWithChild(P,Z){if(!e.$isRangeSelection(Z))return!1;const O=Z.anchor.getNode(),H=Z.focus.getNode();return this.isParentOf(O)&&this.isParentOf(H)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function G(K,P,Z){const O=[],H=[],J=P.list,de=J?J.listitem:void 0;let _e;if(J&&J.nested&&(_e=J.nested.listitem),de!==void 0){const I=de.split(" ");O.push(...I)}if(J){const I=Z.getParent(),w=ue(I)&&I.getListType()==="check",D=Z.getChecked();(!w||D)&&H.push(J.listitemUnchecked),(!w||!D)&&H.push(J.listitemChecked),w&&O.push(D?J.listitemChecked:J.listitemUnchecked)}if(_e!==void 0){const I=_e.split(" ");Z.getChildren().some(w=>ue(w))?O.push(...I):H.push(...I)}H.length>0&&t.removeClassNamesFromElement(K,...H),O.length>0&&t.addClassNamesToElement(K,...O)}function q(K,P,Z,O){ue(P.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),(!Z||P.__checked!==Z.__checked)&&K.setAttribute("aria-checked",P.getChecked()?"true":"false"))}function le(K){const P=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true";return{node:se(P)}}function se(K){return e.$applyNodeReplacement(new W(void 0,K))}function ge(K){return K instanceof W}class j extends e.ElementNode{static getType(){return"list"}static clone(P){const Z=P.__listType||we[P.__tag];return new j(Z,P.__start,P.__key)}constructor(P,Z,O){super(O);const H=we[P]||P;this.__listType=H,this.__tag=H==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(P){const Z=this.getWritable();Z.__listType=P,Z.__tag=P==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(P,Z){const O=this.__tag,H=document.createElement(O);return this.__start!==1&&H.setAttribute("start",String(this.__start)),H.__lexicalListType=this.__listType,B(H,P.theme,this),H}updateDOM(P,Z,O){return P.__tag!==this.__tag?!0:(B(Z,O.theme,this),!1)}static importDOM(){return{ol:P=>({conversion:xe,priority:0}),ul:P=>({conversion:xe,priority:0})}}static importJSON(P){const Z=Ee(P.listType,P.start);return Z.setFormat(P.format),Z.setIndent(P.indent),Z.setDirection(P.direction),Z}exportDOM(P){const{element:Z}=super.exportDOM(P);return Z&&t.isHTMLElement(Z)&&(this.__start!==1&&Z.setAttribute("start",String(this.__start)),this.__listType==="check"&&Z.setAttribute("__lexicalListType","check")),{element:Z}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...P){for(let Z=0;Z<P.length;Z++){const O=P[Z];if(ge(O))super.append(O);else{const H=se();if(ue(O))H.append(O);else if(e.$isElementNode(O)){const J=e.$createTextNode(O.getTextContent());H.append(J)}else H.append(O);super.append(H)}}return x(this),this}extractWithChild(P){return ge(P)}}function B(K,P,Z){const O=[],H=[],J=P.list;if(J!==void 0){const de=J[`${Z.__tag}Depth`]||[],_e=n(Z)-1,I=_e%de.length,w=de[I],D=J[Z.__tag];let re;const ye=J.nested;if(ye!==void 0&&ye.list&&(re=ye.list),D!==void 0&&O.push(D),w!==void 0){const Ae=w.split(" ");O.push(...Ae);for(let ee=0;ee<de.length;ee++)ee!==I&&H.push(Z.__tag+ee)}if(re!==void 0){const Ae=re.split(" ");_e>1?O.push(...Ae):H.push(...Ae)}}H.length>0&&t.removeClassNamesFromElement(K,...H),O.length>0&&t.addClassNamesToElement(K,...O)}function V(K){const P=[];for(let Z=0;Z<K.length;Z++){const O=K[Z];if(ge(O)){P.push(O);const H=O.getChildren();H.length>1&&H.forEach(J=>{ue(J)&&P.push(m(J))})}else P.push(m(O))}return P}function xe(K){const P=K.nodeName.toLowerCase();let Z=null;if(P==="ol"){const O=K.start;Z=Ee("number",O)}else P==="ul"&&(t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?Z=Ee("check"):Z=Ee("bullet"));return{after:V,node:Z}}const we={ol:"number",ul:"bullet"};function Ee(K,P=1){return e.$applyNodeReplacement(new j(K,P))}function ue(K){return K instanceof j}const $=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),S=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Y=e.createCommand("INSERT_CHECK_LIST_COMMAND"),ie=e.createCommand("REMOVE_LIST_COMMAND");return fr.$createListItemNode=se,fr.$createListNode=Ee,fr.$getListDepth=n,fr.$handleListInsertParagraph=F,fr.$isListItemNode=ge,fr.$isListNode=ue,fr.INSERT_CHECK_LIST_COMMAND=Y,fr.INSERT_ORDERED_LIST_COMMAND=S,fr.INSERT_UNORDERED_LIST_COMMAND=$,fr.ListItemNode=W,fr.ListNode=j,fr.REMOVE_LIST_COMMAND=ie,fr.insertList=R,fr.removeList=E,fr}var hr={},Nf;function tN(){if(Nf)return hr;Nf=1;var e=gn(),t=Xn();function n($){let S=new URLSearchParams;S.append("code",$);for(let Y=1;Y<arguments.length;Y++)S.append("v",arguments[Y]);throw Error(`Minified Lexical error #${$}; visit https://lexical.dev/docs/error?${S} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r($){let S=1;for($=$.getParent();$!=null;){if(G($)){if($=$.getParent(),V($)){S++,$=$.getParent();continue}n(40)}break}return S}function c($){$=$.getParent(),V($)||n(40);let S=$;for(;S!==null;)S=S.getParent(),V(S)&&($=S);return $}function d($){let S=[];$=$.getChildren().filter(G);for(let Y=0;Y<$.length;Y++){let ie=$[Y],K=ie.getFirstChild();V(K)?S=S.concat(d(K)):S.push(ie)}return S}function g($){return G($)&&V($.getFirstChild())}function m($){for(;$.getNextSibling()==null&&$.getPreviousSibling()==null;){let S=$.getParent();if(S==null||!G($)&&!V($))break;$=S}$.remove()}function N($){return W().append($)}function T($,S){return G($)&&(S.length===0||S.length===1&&$.is(S[0])&&$.getChildrenSize()===0)}function R($,S){$.splice($.getChildrenSize(),0,S)}function b($,S){if(V($))return $;let Y=$.getPreviousSibling(),ie=$.getNextSibling(),K=W();return K.setFormat($.getFormatType()),K.setIndent($.getIndent()),R(K,$.getChildren()),V(Y)&&S===Y.getListType()?(Y.append(K),$.remove(),V(ie)&&S===ie.getListType()&&(R(Y,ie.getChildren()),ie.remove()),Y):V(ie)&&S===ie.getListType()?(ie.getFirstChildOrThrow().insertBefore(K),$.remove(),ie):(S=B(S),S.append(K),$.replace(S),z(S),S)}function k($,S){var Y=$.getLastChild();let ie=S.getFirstChild();Y&&ie&&g(Y)&&g(ie)&&(k(Y.getFirstChild(),ie.getFirstChild()),ie.remove()),Y=S.getChildren(),0<Y.length&&($.append(...Y),z($)),S.remove()}function z($,S){if($=S||$.getChildren(),$!==void 0)for(S=0;S<$.length;S++){let P=$[S];if(G(P)){let Z=P.getValue();var Y=P,ie=Y.getParent(),K=1;for(ie!=null&&(V(ie)?K=ie.getStart():n(44)),Y=Y.getPreviousSiblings(),ie=0;ie<Y.length;ie++){let O=Y[ie];G(O)&&!V(O.getFirstChild())&&K++}Z!==K&&P.setValue(K)}}}function E($){if(!g($)){var S=$.getParent(),Y=S?S.getParent():void 0,ie=Y?Y.getParent():void 0;if(V(ie)&&G(Y)&&V(S)){var K=S?S.getFirstChild():void 0,P=S?S.getLastChild():void 0;if($.is(K))Y.insertBefore($),S.isEmpty()&&Y.remove();else if($.is(P))Y.insertAfter($),S.isEmpty()&&Y.remove();else{var Z=S.getListType();K=W();let O=B(Z);K.append(O),$.getPreviousSiblings().forEach(H=>O.append(H)),P=W(),Z=B(Z),P.append(Z),R(Z,$.getNextSiblings()),Y.insertBefore(K),Y.insertAfter(P),Y.replace($)}z(S),z(ie)}}}class x extends e.ElementNode{static getType(){return"listitem"}static clone(S){return new x(S.__value,S.__checked,S.__key)}constructor(S,Y,ie){super(ie),this.__value=S===void 0?1:S,this.__checked=Y}createDOM(S){let Y=document.createElement("li"),ie=this.getParent();return V(ie)&&ie.getListType()==="check"&&Q(Y,this,null),Y.value=this.__value,U(Y,S.theme,this),Y}updateDOM(S,Y,ie){let K=this.getParent();return V(K)&&K.getListType()==="check"&&Q(Y,this,S),Y.value=this.__value,U(Y,ie.theme,this),!1}static transform(){return S=>{let Y=S.getParent();if(V(Y)){if(z(Y),!G(S))throw Error("node is not a ListItemNode");Y.getListType()!=="check"&&S.getChecked()!=null&&S.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:F,priority:0})}}static importJSON(S){let Y=W();return Y.setChecked(S.checked),Y.setValue(S.value),Y.setFormat(S.format),Y.setDirection(S.direction),Y}exportDOM(S){return S=this.createDOM(S._config),S.style.textAlign=this.getFormatType(),{element:S}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...S){for(let Y=0;Y<S.length;Y++){let ie=S[Y];if(e.$isElementNode(ie)&&this.canMergeWith(ie)){let K=ie.getChildren();this.append(...K),ie.remove()}else super.append(ie)}return this}replace(S,Y){if(G(S))return super.replace(S);this.setIndent(0);let ie=this.getParentOrThrow();if(!V(ie))return S;if(ie.__first===this.getKey())ie.insertBefore(S);else if(ie.__last===this.getKey())ie.insertAfter(S);else{let K=B(ie.getListType()),P=this.getNextSibling();for(;P;){let Z=P;P=P.getNextSibling(),K.append(Z)}ie.insertAfter(S),S.insertAfter(K)}if(Y){if(!e.$isElementNode(S))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(K=>{S.append(K)})}return this.remove(),ie.getChildrenSize()===0&&ie.remove(),S}insertAfter(S,Y=!0){var ie=this.getParentOrThrow();V(ie)||n(39);var K=this.getNextSiblings();if(G(S))return Y=super.insertAfter(S,Y),S=S.getParentOrThrow(),V(S)&&z(S),Y;if(V(S)){for(ie=S,S=S.getChildren(),K=S.length-1;0<=K;K--)ie=S[K],this.insertAfter(ie,Y);return ie}if(ie.insertAfter(S,Y),K.length!==0){let P=B(ie.getListType());K.forEach(Z=>P.append(Z)),S.insertAfter(P,Y)}return S}remove(S){let Y=this.getPreviousSibling(),ie=this.getNextSibling();super.remove(S),Y&&ie&&g(Y)&&g(ie)?(k(Y.getFirstChild(),ie.getFirstChild()),ie.remove()):ie&&(S=ie.getParent(),V(S)&&z(S))}insertNewAfter(S,Y=!0){return S=W(this.__checked==null?void 0:!1),this.insertAfter(S,Y),S}collapseAtStart(S){let Y=e.$createParagraphNode();this.getChildren().forEach(Z=>Y.append(Z));var ie=this.getParentOrThrow(),K=ie.getParentOrThrow();let P=G(K);return ie.getChildrenSize()===1?P?(ie.remove(),K.select()):(ie.insertBefore(Y),ie.remove(),ie=S.anchor,S=S.focus,K=Y.getKey(),ie.type==="element"&&ie.getNode().is(this)&&ie.set(K,ie.offset,"element"),S.type==="element"&&S.getNode().is(this)&&S.set(K,S.offset,"element")):(ie.insertBefore(Y),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(S){this.getWritable().__value=S}getChecked(){return this.getLatest().__checked}setChecked(S){this.getWritable().__checked=S}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var S=this.getParent();if(S===null)return this.getLatest().__indent;S=S.getParentOrThrow();let Y=0;for(;G(S);)S=S.getParentOrThrow().getParentOrThrow(),Y++;return Y}setIndent(S){typeof S=="number"&&-1<S||n(117);let Y=this.getIndent();for(;Y!==S;)if(Y<S){e:{var ie=new Set;if(g(this)||ie.has(this.getKey()))break e;let O=this.getParent();var K=this.getNextSibling(),P=this.getPreviousSibling();if(g(K)&&g(P)){if(P=P.getFirstChild(),V(P)){P.append(this);var Z=K.getFirstChild();V(Z)&&(Z=Z.getChildren(),R(P,Z),K.remove(),ie.add(K.getKey())),z(P)}}else g(K)?(K=K.getFirstChild(),V(K)&&(ie=K.getFirstChild(),ie!==null&&ie.insertBefore(this),z(K))):g(P)?(K=P.getFirstChild(),V(K)&&(K.append(this),z(K))):V(O)&&(ie=W(),Z=B(O.getListType()),ie.append(Z),Z.append(this),P?P.insertAfter(ie):K?K.insertBefore(ie):O.append(ie),z(Z));V(O)&&z(O)}Y++}else E(this),Y--;return this}insertBefore(S){if(G(S)){let Y=this.getParentOrThrow();if(V(Y)){let ie=this.getNextSiblings();z(Y,ie)}}return super.insertBefore(S)}canInsertAfter(S){return G(S)}canReplaceWith(S){return G(S)}canMergeWith(S){return e.$isParagraphNode(S)||G(S)}extractWithChild(S,Y){if(!e.$isRangeSelection(Y))return!1;S=Y.anchor.getNode();let ie=Y.focus.getNode();return this.isParentOf(S)&&this.isParentOf(ie)&&this.getTextContent().length===Y.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return B("bullet")}}function U($,S,Y){let ie=[],K=[];var P=(S=S.list)?S.listitem:void 0;if(S&&S.nested)var Z=S.nested.listitem;if(P!==void 0&&(P=P.split(" "),ie.push(...P)),S){P=Y.getParent(),P=V(P)&&P.getListType()==="check";let O=Y.getChecked();P&&!O||K.push(S.listitemUnchecked),P&&O||K.push(S.listitemChecked),P&&ie.push(O?S.listitemChecked:S.listitemUnchecked)}Z!==void 0&&(Z=Z.split(" "),Y.getChildren().some(O=>V(O))?ie.push(...Z):K.push(...Z)),0<K.length&&t.removeClassNamesFromElement($,...K),0<ie.length&&t.addClassNamesToElement($,...ie)}function Q($,S,Y){V(S.getFirstChild())?($.removeAttribute("role"),$.removeAttribute("tabIndex"),$.removeAttribute("aria-checked")):($.setAttribute("role","checkbox"),$.setAttribute("tabIndex","-1"),Y&&S.__checked===Y.__checked||$.setAttribute("aria-checked",S.getChecked()?"true":"false"))}function F($){return $=t.isHTMLElement($)&&$.getAttribute("aria-checked")==="true",{node:W($)}}function W($){return e.$applyNodeReplacement(new x(void 0,$))}function G($){return $ instanceof x}class q extends e.ElementNode{static getType(){return"list"}static clone(S){return new q(S.__listType||j[S.__tag],S.__start,S.__key)}constructor(S,Y,ie){super(ie),this.__listType=S=j[S]||S,this.__tag=S==="number"?"ol":"ul",this.__start=Y}getTag(){return this.__tag}setListType(S){let Y=this.getWritable();Y.__listType=S,Y.__tag=S==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(S){let Y=document.createElement(this.__tag);return this.__start!==1&&Y.setAttribute("start",String(this.__start)),Y.__lexicalListType=this.__listType,le(Y,S.theme,this),Y}updateDOM(S,Y,ie){return S.__tag!==this.__tag?!0:(le(Y,ie.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ge,priority:0}),ul:()=>({conversion:ge,priority:0})}}static importJSON(S){let Y=B(S.listType,S.start);return Y.setFormat(S.format),Y.setIndent(S.indent),Y.setDirection(S.direction),Y}exportDOM(S){return{element:S}=super.exportDOM(S),S&&t.isHTMLElement(S)&&(this.__start!==1&&S.setAttribute("start",String(this.__start)),this.__listType==="check"&&S.setAttribute("__lexicalListType","check")),{element:S}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...S){for(let ie=0;ie<S.length;ie++){var Y=S[ie];if(G(Y))super.append(Y);else{let K=W();V(Y)||e.$isElementNode(Y)&&(Y=e.$createTextNode(Y.getTextContent())),K.append(Y),super.append(K)}}return z(this),this}extractWithChild(S){return G(S)}}function le($,S,Y){let ie=[],K=[];var P=S.list;if(P!==void 0){let O=P[`${Y.__tag}Depth`]||[];S=r(Y)-1;let H=S%O.length;var Z=O[H];let J=P[Y.__tag],de;if(P=P.nested,P!==void 0&&P.list&&(de=P.list),J!==void 0&&ie.push(J),Z!==void 0)for(Z=Z.split(" "),ie.push(...Z),Z=0;Z<O.length;Z++)Z!==H&&K.push(Y.__tag+Z);de!==void 0&&(Y=de.split(" "),1<S?ie.push(...Y):K.push(...Y))}0<K.length&&t.removeClassNamesFromElement($,...K),0<ie.length&&t.addClassNamesToElement($,...ie)}function se($){let S=[];for(let ie=0;ie<$.length;ie++){var Y=$[ie];G(Y)?(S.push(Y),Y=Y.getChildren(),1<Y.length&&Y.forEach(K=>{V(K)&&S.push(N(K))})):S.push(N(Y))}return S}function ge($){let S=$.nodeName.toLowerCase(),Y=null;return S==="ol"?Y=B("number",$.start):S==="ul"&&(Y=t.isHTMLElement($)&&$.getAttribute("__lexicallisttype")==="check"?B("check"):B("bullet")),{after:se,node:Y}}let j={ol:"number",ul:"bullet"};function B($,S=1){return e.$applyNodeReplacement(new q($,S))}function V($){return $ instanceof q}let xe=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),we=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),ue=e.createCommand("REMOVE_LIST_COMMAND");return hr.$createListItemNode=W,hr.$createListNode=B,hr.$getListDepth=r,hr.$handleListInsertParagraph=function(){var $=e.$getSelection();if(!e.$isRangeSelection($)||!$.isCollapsed()||($=$.anchor.getNode(),!G($)||$.getChildrenSize()!==0))return!1;var S=c($),Y=$.getParent();V(Y)||n(40);let ie=Y.getParent(),K;if(e.$isRootOrShadowRoot(ie))K=e.$createParagraphNode(),S.insertAfter(K);else if(G(ie))K=W(),ie.insertAfter(K);else return!1;if(K.select(),S=$.getNextSiblings(),0<S.length){let P=B(Y.getListType());e.$isParagraphNode(K)?K.insertAfter(P):(Y=W(),Y.append(P),K.insertAfter(Y)),S.forEach(Z=>{Z.remove(),P.append(Z)})}return m($),!0},hr.$isListItemNode=G,hr.$isListNode=V,hr.INSERT_CHECK_LIST_COMMAND=Ee,hr.INSERT_ORDERED_LIST_COMMAND=we,hr.INSERT_UNORDERED_LIST_COMMAND=xe,hr.ListItemNode=x,hr.ListNode=q,hr.REMOVE_LIST_COMMAND=ue,hr.insertList=function($,S){$.update(()=>{var Y=e.$getSelection();if(e.$INTERNAL_isPointSelection(Y)){var ie=Y.getNodes();Y=Y.anchor.getNode();var K=Y.getParent();if(T(Y,ie))ie=B(S),e.$isRootOrShadowRoot(K)?(Y.replace(ie),K=W(),e.$isElementNode(Y)&&(K.setFormat(Y.getFormatType()),K.setIndent(Y.getIndent())),ie.append(K)):G(Y)&&(Y=Y.getParentOrThrow(),R(ie,Y.getChildren()),Y.replace(ie));else for(Y=new Set,K=0;K<ie.length;K++){var P=ie[K];if(e.$isElementNode(P)&&P.isEmpty()&&!G(P)&&!Y.has(P.getKey()))b(P,S);else if(e.$isLeafNode(P))for(P=P.getParent();P!=null;){let O=P.getKey();if(V(P)){if(!Y.has(O)){var Z=B(S);R(Z,P.getChildren()),P.replace(Z),z(Z),Y.add(O)}break}else{if(Z=P.getParent(),e.$isRootOrShadowRoot(Z)&&!Y.has(O)){Y.add(O),b(P,S);break}P=Z}}}}})},hr.removeList=function($){$.update(()=>{let S=e.$getSelection();if(e.$isRangeSelection(S)){var Y=new Set,ie=S.getNodes(),K=S.anchor.getNode();if(T(K,ie))Y.add(c(K));else for(K=0;K<ie.length;K++){var P=ie[K];e.$isLeafNode(P)&&(P=t.$getNearestNodeOfType(P,x),P!=null&&Y.add(c(P)))}for(let Z of Y){Y=Z,ie=d(Z);for(let O of ie)ie=e.$createParagraphNode(),R(ie,O.getChildren()),Y.insertAfter(ie),Y=ie,O.__key===S.anchor.key&&S.anchor.set(ie.getKey(),0,"element"),O.__key===S.focus.key&&S.focus.set(ie.getKey(),0,"element"),O.remove();Z.remove()}}})},hr}const nN=process.env.NODE_ENV==="development"?eN():tN();var Cf=nN,Ln={},Qc={exports:{}},Ef;function Sg(){return Ef||(Ef=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
74
|
+
`),F=q.length,!e.$isTextNode(Q)||U>=F)q=Q.getParent(),Q.remove(),q==null||q.getChildrenSize()!==0||e.$isRootNode(q)||q.remove(),U-=F+G,Q=W;else{let le=Q.getKey();G=E.getEditorState().read(()=>{const ge=e.$getNodeByKey(le);return e.$isTextNode(ge)&&ge.isSimpleText()?ge.getTextContent():null}),W=F-U;let se=q.slice(0,W);G!==null&&G!==q?(U=e.$getPreviousSelection(),F=Q,Q.isSimpleText()?Q.setTextContent(G):(F=e.$createTextNode(G),Q.replace(F)),e.$isRangeSelection(U)&&U.isCollapsed()&&(U=U.anchor.offset,F.select(U,U))):Q.isSimpleText()?(G=x.key===le,q=x.offset,q<U&&(q=F),U=G?q-U:0,F=G?q:W,G&&U===0?([U]=Q.splitText(U,F),U.remove()):([,U]=Q.splitText(U,F),U.remove())):(U=e.$createTextNode(se),Q.replace(U)),U=0}}},Yn}var Jc,ff;function Es(){return ff||(ff=1,Jc=process.env.NODE_ENV==="development"?Vy():qy()),Jc}var hf;function Zy(){if(hf)return Sn;hf=1;var e=Es(),t=gn();function n(...se){return()=>{se.forEach(ge=>ge())}}function r(se){return`${se}px`}const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(se,ge,j){let B=null,V=null,xe=null,we=[];const Ee=document.createElement("div");function ue(){if(B===null)throw Error("Unexpected null rootDOMNode");if(V===null)throw Error("Unexpected null parentDOMNode");const{left:ie,top:K}=B.getBoundingClientRect(),P=V,Z=e.createRectsFromDOMRange(se,ge);Ee.isConnected||P.append(Ee);let O=!1;for(let H=0;H<Z.length;H++){const J=Z[H],de=we[H]||document.createElement("div"),_e=de.style;_e.position!=="absolute"&&(_e.position="absolute",O=!0);const I=r(J.left-ie);_e.left!==I&&(_e.left=I,O=!0);const w=r(J.top-K);_e.top!==w&&(de.style.top=w,O=!0);const D=r(J.width);_e.width!==D&&(de.style.width=D,O=!0);const re=r(J.height);_e.height!==re&&(de.style.height=re,O=!0),de.parentNode!==Ee&&(Ee.append(de),O=!0),we[H]=de}for(;we.length>Z.length;)we.pop();O&&j(we)}function $(){V=null,B=null,xe!==null&&xe.disconnect(),xe=null,Ee.remove();for(const ie of we)ie.remove();we=[]}function S(){const ie=se.getRootElement();if(ie===null)return $();const K=ie.parentElement;if(!(K instanceof HTMLElement))return $();$(),B=ie,V=K,xe=new MutationObserver(P=>{const Z=se.getRootElement(),O=Z&&Z.parentElement;if(Z!==B||O!==V)return S();for(const H of P)if(!Ee.contains(H.target))return ue()}),xe.observe(K,c),ue()}const Y=se.registerRootListener(S);return()=>{Y(),$()}}function g(se,ge){let j=null,B=null,V=null,xe=null,we=()=>{};function Ee(ue){ue.read(()=>{const $=t.$getSelection();if(!t.$isRangeSelection($)){j=null,B=null,V=null,xe=null,we(),we=()=>{};return}const{anchor:S,focus:Y}=$,ie=S.getNode(),K=ie.getKey(),P=S.offset,Z=Y.getNode(),O=Z.getKey(),H=Y.offset,J=se.getElementByKey(K),de=se.getElementByKey(O),_e=j===null||J===null||P!==B||K!==j.getKey()||ie!==j&&(!(j instanceof t.TextNode)||ie.updateDOM(j,J,se._config)),I=V===null||de===null||H!==xe||O!==V.getKey()||Z!==V&&(!(V instanceof t.TextNode)||Z.updateDOM(V,de,se._config));if(_e||I){const w=se.getElementByKey(S.getNode().getKey()),D=se.getElementByKey(Y.getNode().getKey());if(w!==null&&D!==null&&w.tagName==="SPAN"&&D.tagName==="SPAN"){const re=document.createRange();let ye,Ae,ee,te;Y.isBefore(S)?(ye=D,Ae=Y.offset,ee=w,te=S.offset):(ye=w,Ae=S.offset,ee=D,te=Y.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");re.setStart(ce,Ae),re.setEnd(be,te),we(),we=d(se,re,Ne=>{for(const Re of Ne){const Le=Re.style;Le.background!=="Highlight"&&(Le.background="Highlight"),Le.color!=="HighlightText"&&(Le.color="HighlightText"),Le.zIndex!=="-1"&&(Le.zIndex="-1"),Le.pointerEvents!=="none"&&(Le.pointerEvents="none"),Le.marginTop!==r(-1.5)&&(Le.marginTop=r(-1.5)),Le.paddingTop!==r(4)&&(Le.paddingTop=r(4)),Le.paddingBottom!==r(0)&&(Le.paddingBottom=r(0))}ge!==void 0&&ge(Ne)})}}j=ie,B=P,V=Z,xe=H})}return Ee(se.getEditorState()),n(se.registerUpdateListener(({editorState:ue})=>Ee(ue)),we,()=>{we()})}function m(se,...ge){ge.forEach(j=>{if(typeof j=="string"){const B=j.split(" ").filter(V=>V!=="");se.classList.add(...B)}})}function N(se,...ge){ge.forEach(j=>{typeof j=="string"&&se.classList.remove(...j.split(" "))})}function T(se,ge){for(const j of ge)if(se.type.startsWith(j))return!0;return!1}function R(se,ge){const j=se[Symbol.iterator]();return new Promise((B,V)=>{const xe=[],we=()=>{const{done:Ee,value:ue}=j.next();if(Ee)return B(xe);const $=new FileReader;$.addEventListener("error",V),$.addEventListener("load",()=>{const S=$.result;typeof S=="string"&&xe.push({file:ue,result:S}),we()}),T(ue,ge)?$.readAsDataURL(ue):we()};we()})}function b(se,ge){const j=[],B=(se||t.$getRoot()).getLatest(),V=ge||(t.$isElementNode(B)?B.getLastDescendant():B);let xe=B,we=k(xe);for(;xe!==null&&!xe.is(V);)if(j.push({depth:we,node:xe}),t.$isElementNode(xe)&&xe.getChildrenSize()>0)xe=xe.getFirstChild(),we++;else{let Ee=null;for(;Ee===null&&xe!==null;)Ee=xe.getNextSibling(),Ee===null?(xe=xe.getParent(),we--):xe=Ee}return xe!==null&&xe.is(V)&&j.push({depth:we,node:xe}),j}function k(se){let ge=se,j=0;for(;(ge=ge.getParent())!==null;)j++;return j}function z(se,ge){let j=se;for(;j!=null;){if(j instanceof ge)return j;j=j.getParent()}return null}function E(se){const ge=x(se,j=>t.$isElementNode(j)&&!j.isInline());if(!t.$isElementNode(ge))throw Error(`Expected node ${se.__key} to have closest block element node.`);return ge}const x=(se,ge)=>{let j=se;for(;j!==t.$getRoot()&&j!=null;){if(ge(j))return j;j=j.getParent()}return null};function U(se,ge,j,B){const V=Ee=>Ee instanceof ge,xe=Ee=>{const ue=Ee.getChildren();for(let Y=0;Y<ue.length;Y++){const ie=ue[Y];if(V(ie))return null}let $=Ee,S=Ee;for(;$!==null;)if(S=$,$=$.getParent(),V($))return{child:S,parent:$};return null},we=Ee=>{const ue=xe(Ee);if(ue!==null){const{child:$,parent:S}=ue;if($.is(Ee)){B(S,Ee);const Y=$.getNextSiblings(),ie=Y.length;if(S.insertAfter($),ie!==0){const K=j(S);$.insertAfter(K);for(let P=0;P<ie;P++)K.append(Y[P])}!S.canBeEmpty()&&S.getChildrenSize()===0&&S.remove()}}};return se.registerNodeTransform(ge,we)}function Q(se,ge){const B=new Map,V=se._pendingEditorState;for(const[we,Ee]of ge._nodeMap){const ue=e.$cloneWithProperties(Ee);if(t.$isTextNode(ue)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");ue.__text=Ee.__text}B.set(we,ue)}V&&(V._nodeMap=B),se._dirtyType=2;const xe=ge._selection;t.$setSelection(xe===null?null:xe.clone())}function F(se){const ge=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ge)){const{focus:j}=ge,B=j.getNode(),V=j.offset;if(t.$isRootOrShadowRoot(B)){const xe=B.getChildAtIndex(V);xe==null?B.append(se):xe.insertBefore(se),se.selectNext()}else{let xe,we;t.$isTextNode(B)?(xe=B.getParentOrThrow(),we=B.getIndexWithinParent(),V>0&&(we+=1,B.splitText(V))):(xe=B,we=V);const[,Ee]=t.$splitNode(xe,we);Ee.insertBefore(se),Ee.selectStart()}}else{if(ge!=null){const B=ge.getNodes();B[B.length-1].getTopLevelElementOrThrow().insertAfter(se)}else t.$getRoot().append(se);const j=t.$createParagraphNode();se.insertAfter(j),j.select()}return se.getLatest()}function W(se,ge){const j=ge();return se.replace(j),j.append(se),j}function G(se,ge){return se!==null?Object.getPrototypeOf(se).constructor.name===ge.name:!1}function q(se,ge){const j=[];for(let B=0;B<se.length;B++){const V=ge(se[B]);V!==null&&j.push(V)}return j}function le(se,ge){const j=se.getFirstChild();j!==null?j.insertBefore(ge):se.append(ge)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=b,Sn.$filter=q,Sn.$findMatchingParent=x,Sn.$getNearestBlockElementAncestorOrThrow=E,Sn.$getNearestNodeOfType=z,Sn.$insertFirst=le,Sn.$insertNodeToNearestRoot=F,Sn.$restoreEditorState=Q,Sn.$wrapNodeInElement=W,Sn.addClassNamesToElement=m,Sn.isMimeType=T,Sn.markSelection=g,Sn.mediaFileReader=R,Sn.mergeRegister=n,Sn.objectKlassEquals=G,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=U,Sn.removeClassNamesFromElement=N,Sn}var vn={},gf;function Jy(){if(gf)return vn;gf=1;var e=Es(),t=gn();function n(N){let T=new URLSearchParams;T.append("code",N);for(let R=1;R<arguments.length;R++)T.append("v",arguments[R]);throw Error(`Minified Lexical error #${N}; visit https://lexical.dev/docs/error?${T} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(...N){return()=>{N.forEach(T=>T())}}let c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(N,T,R){function b(){if(E===null)throw Error("Unexpected null rootDOMNode");if(x===null)throw Error("Unexpected null parentDOMNode");let{left:G,top:q}=E.getBoundingClientRect();var le=x;let se=e.createRectsFromDOMRange(N,T);F.isConnected||le.append(F),le=!1;for(let B=0;B<se.length;B++){var ge=se[B];let V=Q[B]||document.createElement("div"),xe=V.style;xe.position!=="absolute"&&(xe.position="absolute",le=!0);var j=`${ge.left-G}px`;xe.left!==j&&(xe.left=j,le=!0),j=`${ge.top-q}px`,xe.top!==j&&(V.style.top=j,le=!0),j=`${ge.width}px`,xe.width!==j&&(V.style.width=j,le=!0),ge=`${ge.height}px`,xe.height!==ge&&(V.style.height=ge,le=!0),V.parentNode!==F&&(F.append(V),le=!0),Q[B]=V}for(;Q.length>se.length;)Q.pop();le&&R(Q)}function k(){E=x=null,U!==null&&U.disconnect(),U=null,F.remove();for(let G of Q)G.remove();Q=[]}function z(){let G=N.getRootElement();if(G===null)return k();let q=G.parentElement;if(!(q instanceof HTMLElement))return k();k(),E=G,x=q,U=new MutationObserver(le=>{let se=N.getRootElement(),ge=se&&se.parentElement;if(se!==E||ge!==x)return z();for(let j of le)if(!F.contains(j.target))return b()}),U.observe(q,c),b()}let E=null,x=null,U=null,Q=[],F=document.createElement("div"),W=N.registerRootListener(z);return()=>{W(),k()}}function g(N,T){for(let R of T)if(N.type.startsWith(R))return!0;return!1}let m=(N,T)=>{for(;N!==t.$getRoot()&&N!=null;){if(T(N))return N;N=N.getParent()}return null};return vn.$splitNode=t.$splitNode,vn.isHTMLAnchorElement=t.isHTMLAnchorElement,vn.isHTMLElement=t.isHTMLElement,vn.$dfs=function(N,T){let R=[];N=(N||t.$getRoot()).getLatest(),T=T||(t.$isElementNode(N)?N.getLastDescendant():N);for(var b=N,k=0;(b=b.getParent())!==null;)k++;for(b=k;N!==null&&!N.is(T);)if(R.push({depth:b,node:N}),t.$isElementNode(N)&&0<N.getChildrenSize())N=N.getFirstChild(),b++;else for(k=null;k===null&&N!==null;)k=N.getNextSibling(),k===null?(N=N.getParent(),b--):N=k;return N!==null&&N.is(T)&&R.push({depth:b,node:N}),R},vn.$filter=function(N,T){let R=[];for(let b=0;b<N.length;b++){let k=T(N[b]);k!==null&&R.push(k)}return R},vn.$findMatchingParent=m,vn.$getNearestBlockElementAncestorOrThrow=function(N){let T=m(N,R=>t.$isElementNode(R)&&!R.isInline());return t.$isElementNode(T)||n(4,N.__key),T},vn.$getNearestNodeOfType=function(N,T){for(;N!=null;){if(N instanceof T)return N;N=N.getParent()}return null},vn.$insertFirst=function(N,T){let R=N.getFirstChild();R!==null?R.insertBefore(T):N.append(T)},vn.$insertNodeToNearestRoot=function(N){var T=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(T)){var{focus:R}=T;if(T=R.getNode(),R=R.offset,t.$isRootOrShadowRoot(T))R=T.getChildAtIndex(R),R==null?T.append(N):R.insertBefore(N),N.selectNext();else{let b,k;t.$isTextNode(T)?(b=T.getParentOrThrow(),k=T.getIndexWithinParent(),0<R&&(k+=1,T.splitText(R))):(b=T,k=R),[,T]=t.$splitNode(b,k),T.insertBefore(N),T.selectStart()}}else T!=null?(T=T.getNodes(),T[T.length-1].getTopLevelElementOrThrow().insertAfter(N)):t.$getRoot().append(N),T=t.$createParagraphNode(),N.insertAfter(T),T.select();return N.getLatest()},vn.$restoreEditorState=function(N,T){let R=new Map,b=N._pendingEditorState;for(let[k,z]of T._nodeMap){let E=e.$cloneWithProperties(z);if(t.$isTextNode(E)){if(!t.$isTextNode(z))throw Error("Expected node be a TextNode");E.__text=z.__text}R.set(k,E)}b&&(b._nodeMap=R),N._dirtyType=2,N=T._selection,t.$setSelection(N===null?null:N.clone())},vn.$wrapNodeInElement=function(N,T){return T=T(),N.replace(T),T.append(N),T},vn.addClassNamesToElement=function(N,...T){T.forEach(R=>{typeof R=="string"&&(R=R.split(" ").filter(b=>b!==""),N.classList.add(...R))})},vn.isMimeType=g,vn.markSelection=function(N,T){function R(U){U.read(()=>{var Q=t.$getSelection();if(t.$isRangeSelection(Q)){var{anchor:F,focus:W}=Q;Q=F.getNode();var G=Q.getKey(),q=F.offset,le=W.getNode(),se=le.getKey(),ge=W.offset,j=N.getElementByKey(G),B=N.getElementByKey(se);if(G=b===null||j===null||q!==k||G!==b.getKey()||Q!==b&&(!(b instanceof t.TextNode)||Q.updateDOM(b,j,N._config)),se=z===null||B===null||ge!==E||se!==z.getKey()||le!==z&&(!(z instanceof t.TextNode)||le.updateDOM(z,B,N._config)),G||se){j=N.getElementByKey(F.getNode().getKey());var V=N.getElementByKey(W.getNode().getKey());if(j!==null&&V!==null&&j.tagName==="SPAN"&&V.tagName==="SPAN"){if(se=document.createRange(),W.isBefore(F)?(G=V,B=W.offset,V=j,j=F.offset):(G=j,B=F.offset,j=W.offset),G=G.firstChild,G===null||(V=V.firstChild,V===null))throw Error("Expected text node to be first child of span");se.setStart(G,B),se.setEnd(V,j),x(),x=d(N,se,xe=>{for(let we of xe){let Ee=we.style;Ee.background!=="Highlight"&&(Ee.background="Highlight"),Ee.color!=="HighlightText"&&(Ee.color="HighlightText"),Ee.zIndex!=="-1"&&(Ee.zIndex="-1"),Ee.pointerEvents!=="none"&&(Ee.pointerEvents="none"),Ee.marginTop!=="-1.5px"&&(Ee.marginTop="-1.5px"),Ee.paddingTop!=="4px"&&(Ee.paddingTop="4px"),Ee.paddingBottom!=="0px"&&(Ee.paddingBottom="0px")}T!==void 0&&T(xe)})}}b=Q,k=q,z=le,E=ge}else E=z=k=b=null,x(),x=()=>{}})}let b=null,k=null,z=null,E=null,x=()=>{};return R(N.getEditorState()),r(N.registerUpdateListener(({editorState:U})=>R(U)),x,()=>{x()})},vn.mediaFileReader=function(N,T){let R=N[Symbol.iterator]();return new Promise((b,k)=>{let z=[],E=()=>{const{done:x,value:U}=R.next();if(x)return b(z);const Q=new FileReader;Q.addEventListener("error",k),Q.addEventListener("load",()=>{const F=Q.result;typeof F=="string"&&z.push({file:U,result:F}),E()}),g(U,T)?Q.readAsDataURL(U):E()};E()})},vn.mergeRegister=r,vn.objectKlassEquals=function(N,T){return N!==null?Object.getPrototypeOf(N).constructor.name===T.name:!1},vn.positionNodeOnRange=d,vn.registerNestedElementResolver=function(N,T,R,b){return N.registerNodeTransform(T,k=>{e:{for(var z=k.getChildren(),E=0;E<z.length;E++)if(z[E]instanceof T){z=null;break e}for(z=k;z!==null;)if(E=z,z=z.getParent(),z instanceof T){z={child:E,parent:z};break e}z=null}if(z!==null){const{child:x,parent:U}=z;if(x.is(k)){if(b(U,k),k=x.getNextSiblings(),z=k.length,U.insertAfter(x),z!==0){E=R(U),x.insertAfter(E);for(let Q=0;Q<z;Q++)E.append(k[Q])}U.canBeEmpty()||U.getChildrenSize()!==0||U.remove()}}})},vn.removeClassNamesFromElement=function(N,...T){T.forEach(R=>{typeof R=="string"&&N.classList.remove(...R.split(" "))})},vn}var Xc,pf;function Xn(){return pf||(pf=1,Xc=process.env.NODE_ENV==="development"?Zy():Jy()),Xc}var mf;function Xy(){if(mf)return Zt;mf=1;var e=gn(),t=Xn();class n extends e.INTERNAL_PointSelection{constructor(ne,oe,Se){super(oe,Se),this.gridKey=ne}getCachedNodes(){return this._cachedNodes}setCachedNodes(ne){this._cachedNodes=ne}is(ne){return r(ne)?this.gridKey===ne.gridKey&&this.anchor.is(ne.anchor)&&this.focus.is(ne.focus):!1}set(ne,oe,Se){this.dirty=!0,this.gridKey=ne,this.anchor.key=oe,this.focus.key=Se,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ne){}insertText(){}insertNodes(ne){const oe=this.focus.getNode();if(!e.$isElementNode(oe))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(oe.select(0,oe.getChildrenSize())).insertNodes(ne)}getShape(){const ne=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ne))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const oe=e.DEPRECATED_$getGridCellNodeRect(ne);if(oe===null)throw Error("getCellRect: expected to find AnchorNode");const Se=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(Se))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Ie=e.DEPRECATED_$getGridCellNodeRect(Se);if(Ie===null)throw Error("getCellRect: expected to find focusCellNode");const De=Math.min(oe.columnIndex,Ie.columnIndex),je=Math.max(oe.columnIndex,Ie.columnIndex),rt=Math.min(oe.rowIndex,Ie.rowIndex),it=Math.max(oe.rowIndex,Ie.rowIndex);return{fromX:Math.min(De,je),fromY:Math.min(rt,it),toX:Math.max(De,je),toY:Math.max(rt,it)}}getNodes(){const ne=this._cachedNodes;if(ne!==null)return ne;const oe=this.anchor.getNode(),Se=this.focus.getNode(),Ie=t.$findMatchingParent(oe,e.DEPRECATED_$isGridCellNode),De=t.$findMatchingParent(Se,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Ie))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!e.DEPRECATED_$isGridCellNode(De))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 rt=je.getParent();if(!e.DEPRECATED_$isGridNode(rt))throw Error("Expected tableNode to have a parent GridNode");const it=De.getParents()[1];if(it!==rt){if(rt.isParentOf(De)){const It=it.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,De.getKey(),It.getKey())}else{const It=rt.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),De.getKey())}return this.getNodes()}const[st,vt,Ge]=e.DEPRECATED_$computeGridMap(rt,Ie,De);let ze=Math.min(vt.startColumn,Ge.startColumn),tt=Math.min(vt.startRow,Ge.startRow),_t=Math.max(vt.startColumn+vt.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(vt.startRow+vt.cell.__rowSpan-1,Ge.startRow+Ge.cell.__rowSpan-1),Et=ze,ht=tt,xt=ze,pt=tt;function $t(It){const{cell:jt,startColumn:bt,startRow:nn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,nn),_t=Math.max(_t,bt+jt.__colSpan-1),Nt=Math.max(Nt,nn+jt.__rowSpan-1)}for(;ze<Et||tt<ht||_t>xt||Nt>pt;){if(ze<Et){const It=pt-ht,jt=Et-1;for(let bt=0;bt<=It;bt++)$t(st[ht+bt][jt]);Et=jt}if(tt<ht){const It=xt-Et,jt=ht-1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);ht=jt}if(_t>xt){const It=pt-ht,jt=xt+1;for(let bt=0;bt<=It;bt++)$t(st[ht+bt][jt]);xt=jt}if(Nt>pt){const It=xt-Et,jt=pt+1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);pt=jt}}const Kt=[rt];let tn=null;for(let It=tt;It<=Nt;It++)for(let jt=ze;jt<=_t;jt++){const{cell:bt}=st[It][jt],nn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected GridCellNode parent to be a GridRowNode");nn!==tn&&Kt.push(nn),Kt.push(bt,...d(bt)),tn=nn}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Kt),Kt}getTextContent(){const ne=this.getNodes();let oe="";for(let Se=0;Se<ne.length;Se++)oe+=ne[Se].getTextContent();return oe}}function r(Oe){return Oe instanceof n}function c(){const Oe=e.$createPoint("root",0,"element"),ne=e.$createPoint("root",0,"element");return new n("root",Oe,ne)}function d(Oe){const ne=[],oe=[Oe];for(;oe.length>0;){const Se=oe.pop();if(Se===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(Se)&&oe.unshift(...Se.getChildren()),Se!==Oe&&ne.push(Se)}return ne}const g=/^(\d+(?:\.\d+)?)px$/,m={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class N extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ne){const oe=new N(ne.__headerState,ne.__colSpan,ne.__width,ne.__key);return oe.__rowSpan=ne.__rowSpan,oe.__backgroundColor=ne.__backgroundColor,oe}static importDOM(){return{td:ne=>({conversion:T,priority:0}),th:ne=>({conversion:T,priority:0})}}static importJSON(ne){const oe=ne.colSpan||1,Se=ne.rowSpan||1,Ie=R(ne.headerState,oe,ne.width||void 0);return Ie.__rowSpan=Se,Ie.__backgroundColor=ne.backgroundColor||null,Ie}constructor(ne=m.NO_STATUS,oe=1,Se,Ie){super(oe,Ie),this.__headerState=ne,this.__width=Se,this.__backgroundColor=null}createDOM(ne){const oe=document.createElement(this.getTag());return this.__width&&(oe.style.width=`${this.__width}px`),this.__colSpan>1&&(oe.colSpan=this.__colSpan),this.__rowSpan>1&&(oe.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(oe.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(oe,ne.theme.tableCell,this.hasHeader()&&ne.theme.tableCellHeader),oe}exportDOM(ne){const{element:oe}=super.exportDOM(ne);if(oe){const Se=oe,Ie=700,De=this.getParentOrThrow().getChildrenSize();Se.style.border="1px solid black",this.__colSpan>1&&(Se.colSpan=this.__colSpan),this.__rowSpan>1&&(Se.rowSpan=this.__rowSpan),Se.style.width=`${this.getWidth()||Math.max(90,Ie/De)}px`,Se.style.verticalAlign="top",Se.style.textAlign="start";const je=this.getBackgroundColor();je!==null?Se.style.backgroundColor=je:this.hasHeader()&&(Se.style.backgroundColor="#f2f3f5")}return{element:oe}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ne){const oe=this.getWritable();return oe.__headerState=ne,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ne){const oe=this.getWritable();return oe.__width=ne,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ne){this.getWritable().__backgroundColor=ne}toggleHeaderStyle(ne){const oe=this.getWritable();return(oe.__headerState&ne)===ne?oe.__headerState-=ne:oe.__headerState+=ne,oe}hasHeaderState(ne){return(this.getHeaderStyles()&ne)===ne}hasHeader(){return this.getLatest().__headerState!==m.NO_STATUS}updateDOM(ne){return ne.__headerState!==this.__headerState||ne.__width!==this.__width||ne.__colSpan!==this.__colSpan||ne.__rowSpan!==this.__rowSpan||ne.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(Oe){const ne=Oe,oe=Oe.nodeName.toLowerCase();let Se;g.test(ne.style.width)&&(Se=parseFloat(ne.style.width));const Ie=R(oe==="th"?m.ROW:m.NO_STATUS,ne.colSpan,Se);Ie.__rowSpan=ne.rowSpan;const De=ne.style.backgroundColor;return De!==""&&(Ie.__backgroundColor=De),{forChild:(je,rt)=>{if(b(rt)&&!e.$isElementNode(je)){const it=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
75
|
+
`?null:(it.append(je),it)}return je},node:Ie}}function R(Oe,ne=1,oe){return e.$applyNodeReplacement(new N(Oe,ne,oe))}function b(Oe){return Oe instanceof N}class k extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ne){return new k(ne.__height,ne.__key)}static importDOM(){return{tr:ne=>({conversion:z,priority:0})}}static importJSON(ne){return E(ne.height)}constructor(ne,oe){super(oe),this.__height=ne}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ne){const oe=document.createElement("tr");return this.__height&&(oe.style.height=`${this.__height}px`),t.addClassNamesToElement(oe,ne.theme.tableRow),oe}isShadowRoot(){return!0}setHeight(ne){const oe=this.getWritable();return oe.__height=ne,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ne){return ne.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function z(Oe){const ne=Oe;let oe;return g.test(ne.style.height)&&(oe=parseFloat(ne.style.height)),{node:E(oe)}}function E(Oe){return e.$applyNodeReplacement(new k(Oe))}function x(Oe){return Oe instanceof k}const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q=Oe=>U?(Oe||window).getSelection():null;class F{constructor(ne,oe){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=oe,this.editor=ne,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(ne=>ne())}trackTableGrid(){const ne=new MutationObserver(oe=>{this.editor.update(()=>{let Se=!1;for(let De=0;De<oe.length;De++){const it=oe[De].target.nodeName;if(it==="TABLE"||it==="TR"){Se=!0;break}}if(!Se)return;const Ie=this.editor.getElementByKey(this.tableNodeKey);if(!Ie)throw new Error("Expected to find TableElement in DOM");this.grid=ge(Ie)})});this.editor.update(()=>{const oe=this.editor.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");this.grid=ge(oe),ne.observe(oe,{childList:!0,subtree:!0})})}clearHighlight(){const ne=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(),ne.update(()=>{const oe=e.$getNodeByKey(this.tableNodeKey);if(!I(oe))throw new Error("Expected TableNode.");const Se=ne.getElementByKey(this.tableNodeKey);if(!Se)throw new Error("Expected to find TableElement in DOM");const Ie=ge(Se);j(ne,Ie,null),e.$setSelection(null),ne.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ne=this.editor;ne.update(()=>{const oe=ne.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(oe,ne._config.theme.tableSelection),oe.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ne=this.editor;ne.update(()=>{const oe=ne.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(oe,ne._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ne){if(ne!=null&&ne.gridKey===this.tableNodeKey){const oe=this.editor;this.gridSelection=ne,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(oe,this.grid,this.gridSelection)}else ne==null?this.clearHighlight():(this.tableNodeKey=ne.gridKey,this.updateTableGridSelection(ne))}setFocusCellForSelection(ne,oe=!1){const Se=this.editor;Se.update(()=>{const Ie=e.$getNodeByKey(this.tableNodeKey);if(!I(Ie))throw new Error("Expected TableNode.");if(!Se.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ne.x,rt=ne.y;if(this.focusCell=ne,this.anchorCell!==null){const it=Q(Se._window);it&&it.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==rt||oe))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&rt===this.focusY)return;if(this.focusX=je,this.focusY=rt,this.isHighlightingCells){const it=e.$getNearestNodeFromDOMNode(ne.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&b(it)){const st=it.getKey();this.gridSelection=this.gridSelection.clone()||c(),this.focusCellNodeKey=st,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(ne){this.isHighlightingCells=!1,this.anchorCell=ne,this.anchorX=ne.x,this.anchorY=ne.y,this.editor.update(()=>{const oe=e.$getNearestNodeFromDOMNode(ne.elem);if(b(oe)){const Se=oe.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():c(),this.anchorCellNodeKey=Se}})}formatCells(ne){this.editor.update(()=>{const oe=e.$getSelection();if(!r(oe))throw Error("Expected grid selection");const Se=e.$createRangeSelection(),Ie=Se.anchor,De=Se.focus;oe.getNodes().forEach(je=>{b(je)&&je.getTextContentSize()!==0&&(Ie.set(je.getKey(),0,"element"),De.set(je.getKey(),je.getChildrenSize(),"element"),Se.formatText(ne))}),e.$setSelection(oe),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ne=this.editor;ne.update(()=>{const oe=e.$getNodeByKey(this.tableNodeKey);if(!I(oe))throw new Error("Expected TableNode.");const Se=e.$getSelection();if(!r(Se))throw Error("Expected grid selection");const Ie=Se.getNodes().filter(b);if(Ie.length===this.grid.columns*this.grid.rows){oe.selectPrevious(),oe.remove(),e.$getRoot().selectStart();return}Ie.forEach(De=>{if(e.$isElementNode(De)){const je=e.$createParagraphNode(),rt=e.$createTextNode();je.append(rt),De.append(je),De.getChildren().forEach(it=>{it!==je&&it.remove()})}}),j(ne,this.grid,null),e.$setSelection(null),ne.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const W="__lexicalTableSelection";function G(Oe,ne,oe,Se){const Ie=oe.getRootElement();if(Ie===null)throw new Error("No root element.");const De=new F(oe,Oe.getKey()),je=oe._window||window;q(ne,De),ne.addEventListener("mousedown",Ge=>{setTimeout(()=>{if(Ge.button!==0||!je)return;const ze=se(Ge.target);ze!==null&&(O(Ge),De.setAnchorCellForSelection(ze));const tt=()=>{je.removeEventListener("mouseup",tt),je.removeEventListener("mousemove",_t)},_t=Nt=>{const Et=se(Nt.target);Et!==null&&(De.anchorX!==Et.x||De.anchorY!==Et.y)&&(Nt.preventDefault(),De.setFocusCellForSelection(Et))};je.addEventListener("mouseup",tt),je.addEventListener("mousemove",_t)},0)});const rt=Ge=>{Ge.button===0&&oe.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===De.tableNodeKey&&Ie.contains(tt)&&De.clearHighlight()})};je.addEventListener("mousedown",rt),De.listenersToRemove.add(()=>je.removeEventListener("mousedown",rt)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ge=>Z(oe,Ge,"down",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_UP_COMMAND,Ge=>Z(oe,Ge,"up",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ge=>Z(oe,Ge,"backward",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ge=>Z(oe,Ge,"forward",Oe,De),e.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(oe.registerCommand(e.KEY_ESCAPE_COMMAND,Ge=>{const ze=e.$getSelection();if(r(ze)){const tt=t.$findMatchingParent(ze.focus.getNode(),b);if(b(tt))return O(Ge),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const it=Ge=>()=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return De.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>b(Kt));if(!b(tt))return!1;const _t=ze.anchor.getNode(),Nt=ze.focus.getNode(),Et=Oe.isParentOf(_t),ht=Oe.isParentOf(Nt);if(Et&&!ht||ht&&!Et)return De.clearText(),!0;const pt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>e.$isElementNode(Kt)),$t=pt&&t.$findMatchingParent(pt,Kt=>e.$isElementNode(Kt)&&b(Kt.getParent()));if(!e.$isElementNode($t)||!e.$isElementNode(pt))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&&pt!==$t){const Kt=pt.getChildren(),tn=e.$createParagraphNode();return Kt.forEach(It=>tn.append(It)),pt.replace(tn),pt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ge=>{De.listenersToRemove.add(oe.registerCommand(Ge,it(Ge),e.COMMAND_PRIORITY_CRITICAL))});const st=Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return Ge.preventDefault(),Ge.stopPropagation(),De.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>b(_t));if(!b(tt))return!1}return!1};De.listenersToRemove.add(oe.registerCommand(e.KEY_BACKSPACE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.KEY_DELETE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.FORMAT_TEXT_COMMAND,Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return De.formatCells(Ge),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>b(_t));if(!b(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return De.clearHighlight(),!1;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>b(_t));if(!b(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Se&&De.listenersToRemove.add(oe.registerCommand(e.KEY_TAB_COMMAND,Ge=>{const ze=e.$getSelection();if(!e.$isRangeSelection(ze)||!ze.isCollapsed()||!ue(ze,Oe))return!1;const tt=K(ze.anchor.getNode());if(tt===null)return!1;O(Ge);const _t=Oe.getCordsFromCellNode(tt,De.grid);return we(De,Oe,_t.x,_t.y,Ge.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.FOCUS_COMMAND,Ge=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function vt(Ge){const ze=Oe.getCordsFromCellNode(Ge,De.grid);return Oe.getCellFromCordsOrThrow(ze.x,ze.y,De.grid)}return De.listenersToRemove.add(oe.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ge=>{const{nodes:ze,selection:tt}=Ge,_t=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||_t&&!Nt;if(ze.length!==1||!e.DEPRECATED_$isGridNode(ze[0])||!Et)return!1;const{anchor:ht}=tt,xt=ze[0],pt=xt.getChildren(),$t=xt.getFirstChildOrThrow().getChildrenSize(),Kt=xt.getChildrenSize(),tn=t.$findMatchingParent(ht.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=tn&&t.$findMatchingParent(tn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),jt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(tn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(jt))return!1;const bt=It.getIndexWithinParent(),nn=Math.min(jt.getChildrenSize()-1,bt+Kt-1),Sr=tn.getIndexWithinParent(),mi=Math.min(It.getChildrenSize()-1,Sr+$t-1),pe=Math.min(Sr,mi),Ze=Math.min(bt,nn),ot=Math.max(Sr,mi),wt=Math.max(bt,nn),Gt=jt.getChildren();let Bt=0,Pt,Lt;for(let Ht=Ze;Ht<=wt;Ht++){const sn=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(sn))return!1;const ln=pt[Bt];if(!e.DEPRECATED_$isGridRowNode(ln))return!1;const Rn=sn.getChildren(),mr=ln.getChildren();let jn=0;for(let dn=pe;dn<=ot;dn++){const rr=Rn[dn];if(!e.DEPRECATED_$isGridCellNode(rr))return!1;const ir=mr[jn];if(!e.DEPRECATED_$isGridCellNode(ir))return!1;Ht===Ze&&dn===pe?Pt=rr.getKey():Ht===wt&&dn===ot&&(Lt=rr.getKey());const Ai=rr.getChildren();ir.getChildren().forEach(_r=>{e.$isTextNode(_r)&&e.$createParagraphNode().append(_r),rr.append(_r)}),Ai.forEach(_r=>_r.remove()),jn++}Bt++}if(Pt&&Lt){const Ht=c();Ht.set(ze[0].getKey(),Pt,Lt),e.$setSelection(Ht)}return!0},e.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(oe.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ge=e.$getSelection(),ze=e.$getPreviousSelection();if(e.$isRangeSelection(Ge)){const{anchor:tt,focus:_t}=Ge,Nt=tt.getNode(),Et=_t.getNode(),ht=K(Nt),xt=K(Et),pt=ht&&Oe.is(P(ht)),$t=xt&&Oe.is(P(xt)),Kt=pt!==$t,tn=pt&&$t,It=Ge.isBackward();if(Kt){const jt=Ge.clone();jt.focus.set(Oe.getKey(),It?0:Oe.getChildrenSize(),"element"),e.$setSelection(jt),V(oe,De)}else tn&&(ht.is(xt)||(De.setAnchorCellForSelection(vt(ht)),De.setFocusCellForSelection(vt(xt),!0)))}return Ge&&!Ge.is(ze)&&(r(Ge)||r(ze))&&De.gridSelection&&!De.gridSelection.is(ze)?(r(Ge)&&Ge.gridKey===De.tableNodeKey?De.updateTableGridSelection(Ge):!r(Ge)&&r(ze)&&ze.gridKey===De.tableNodeKey&&De.updateTableGridSelection(null),!1):(De.hasHijackedSelectionStyles&&!Oe.isSelected()?xe(oe,De):!De.hasHijackedSelectionStyles&&Oe.isSelected()&&V(oe,De),!1)},e.COMMAND_PRIORITY_CRITICAL)),De}function q(Oe,ne){Oe[W]=ne}function le(Oe){return Oe[W]}function se(Oe){let ne=Oe;for(;ne!=null;){const oe=ne.nodeName;if(oe==="TD"||oe==="TH"){const Se=ne._cell;return Se===void 0?null:Se}ne=ne.parentNode}return null}function ge(Oe){const ne=[],oe={cells:ne,columns:0,rows:0};let Se=Oe.firstChild,Ie=0,De=0;for(ne.length=0;Se!=null;){const je=Se.nodeName;if(je==="TD"||je==="TH"){const st=Se,vt={elem:st,hasBackgroundColor:st.style.backgroundColor!=="",highlighted:!1,x:Ie,y:De};Se._cell=vt;let Ge=ne[De];Ge===void 0&&(Ge=ne[De]=[]),Ge[Ie]=vt}else{const st=Se.firstChild;if(st!=null){Se=st;continue}}const rt=Se.nextSibling;if(rt!=null){Ie++,Se=rt;continue}const it=Se.parentNode;if(it!=null){const st=it.nextSibling;if(st==null)break;De++,Ie=0,Se=st}}return oe.columns=Ie+1,oe.rows=De+1,oe}function j(Oe,ne,oe){const Se=new Set(oe?oe.getNodes():[]);B(ne,(Ie,De)=>{const je=Ie.elem;Se.has(De)?(Ie.highlighted=!0,Y(Oe,Ie)):(Ie.highlighted=!1,ie(Oe,Ie),je.getAttribute("style")||je.removeAttribute("style"))})}function B(Oe,ne){const{cells:oe}=Oe;for(let Se=0;Se<oe.length;Se++){const Ie=oe[Se];if(Ie)for(let De=0;De<Ie.length;De++){const je=Ie[De];if(!je)continue;const rt=e.$getNearestNodeFromDOMNode(je.elem);rt!==null&&ne(je,rt,{x:De,y:Se})}}}function V(Oe,ne){ne.disableHighlightStyle(),B(ne.grid,oe=>{oe.highlighted=!0,Y(Oe,oe)})}function xe(Oe,ne){ne.enableHighlightStyle(),B(ne.grid,oe=>{const Se=oe.elem;oe.highlighted=!1,ie(Oe,oe),Se.getAttribute("style")||Se.removeAttribute("style")})}const we=(Oe,ne,oe,Se,Ie)=>{const De=Ie==="forward";switch(Ie){case"backward":case"forward":return oe!==(De?Oe.grid.columns-1:0)?$(ne.getCellNodeFromCordsOrThrow(oe+(De?1:-1),Se,Oe.grid),De):Se!==(De?Oe.grid.rows-1:0)?$(ne.getCellNodeFromCordsOrThrow(De?0:Oe.grid.columns-1,Se+(De?1:-1),Oe.grid),De):De?ne.selectNext():ne.selectPrevious(),!0;case"up":return Se!==0?$(ne.getCellNodeFromCordsOrThrow(oe,Se-1,Oe.grid),!1):ne.selectPrevious(),!0;case"down":return Se!==Oe.grid.rows-1?$(ne.getCellNodeFromCordsOrThrow(oe,Se+1,Oe.grid),!0):ne.selectNext(),!0;default:return!1}},Ee=(Oe,ne,oe,Se,Ie)=>{const De=Ie==="forward";switch(Ie){case"backward":case"forward":return oe!==(De?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe+(De?1:-1),Se,Oe.grid)),!0;case"up":return Se!==0?(Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe,Se-1,Oe.grid)),!0):!1;case"down":return Se!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe,Se+1,Oe.grid)),!0):!1;default:return!1}};function ue(Oe,ne){if(e.$isRangeSelection(Oe)||r(Oe)){const oe=ne.isParentOf(Oe.anchor.getNode()),Se=ne.isParentOf(Oe.focus.getNode());return oe&&Se}return!1}function $(Oe,ne){ne?Oe.selectStart():Oe.selectEnd()}const S="172,206,247";function Y(Oe,ne){const oe=ne.elem,Se=e.$getNearestNodeFromDOMNode(oe);if(!b(Se))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Se.getBackgroundColor()===null?oe.style.setProperty("background-color",`rgb(${S})`):oe.style.setProperty("background-image",`linear-gradient(to right, rgba(${S},0.85), rgba(${S},0.85))`),oe.style.setProperty("caret-color","transparent")}function ie(Oe,ne){const oe=ne.elem,Se=e.$getNearestNodeFromDOMNode(oe);if(!b(Se))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Se.getBackgroundColor()===null&&oe.style.removeProperty("background-color"),oe.style.removeProperty("background-image"),oe.style.removeProperty("caret-color")}function K(Oe){const ne=t.$findMatchingParent(Oe,b);return b(ne)?ne:null}function P(Oe){const ne=t.$findMatchingParent(Oe,I);return I(ne)?ne:null}function Z(Oe,ne,oe,Se,Ie){const De=e.$getSelection();if(!ue(De,Se))return!1;if(e.$isRangeSelection(De)&&De.isCollapsed()){if(oe==="backward"||oe==="forward")return!1;const{anchor:je,focus:rt}=De,it=t.$findMatchingParent(je.getNode(),b),st=t.$findMatchingParent(rt.getNode(),b);if(!b(it)||!it.is(st))return!1;const vt=P(it);if(vt!==Se&&vt!=null){const xt=Oe.getElementByKey(vt.getKey());if(xt!=null)return Ie.grid=ge(xt),Z(Oe,ne,oe,vt,Ie)}const Ge=Oe.getElementByKey(it.__key),ze=Oe.getElementByKey(je.key);if(ze==null||Ge==null)return!1;let tt;if(je.type==="element")tt=ze.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const _t=oe==="up"?it.getFirstChild():it.getLastChild();if(_t==null)return!1;const Nt=Oe.getElementByKey(_t.__key);if(Nt==null)return!1;const Et=Nt.getBoundingClientRect();if(oe==="up"?Et.top>tt.top-tt.height:tt.bottom+tt.height>Et.bottom){O(ne);const xt=Se.getCordsFromCellNode(it,Ie.grid);if(ne.shiftKey){const pt=Se.getCellFromCordsOrThrow(xt.x,xt.y,Ie.grid);Ie.setAnchorCellForSelection(pt),Ie.setFocusCellForSelection(pt,!0)}else return we(Ie,Se,xt.x,xt.y,oe);return!0}}else if(r(De)){const{anchor:je,focus:rt}=De,it=t.$findMatchingParent(je.getNode(),b),st=t.$findMatchingParent(rt.getNode(),b),[vt]=De.getNodes(),Ge=Oe.getElementByKey(vt.getKey());if(!b(it)||!b(st)||!I(vt)||Ge==null)return!1;Ie.updateTableGridSelection(De);const ze=ge(Ge),tt=Se.getCordsFromCellNode(it,ze),_t=Se.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Ie.setAnchorCellForSelection(_t),O(ne),ne.shiftKey){const Nt=Se.getCordsFromCellNode(st,ze);return Ee(Ie,vt,Nt.x,Nt.y,oe)}else st.selectEnd();return!0}return!1}function O(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class H extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ne){return new H(ne.__key)}static importDOM(){return{table:ne=>({conversion:de,priority:1})}}static importJSON(ne){return _e()}constructor(ne){super(ne)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ne,oe){const Se=document.createElement("table");return t.addClassNamesToElement(Se,ne.theme.table),Se}updateDOM(){return!1}exportDOM(ne){return{...super.exportDOM(ne),after:oe=>{if(oe){const Se=oe.cloneNode(),Ie=document.createElement("colgroup"),De=document.createElement("tbody");t.isHTMLElement(oe)&&De.append(...oe.children);const je=this.getFirstChildOrThrow();if(!x(je))throw new Error("Expected to find row node.");const rt=je.getChildrenSize();for(let it=0;it<rt;it++){const st=document.createElement("col");Ie.append(st)}return Se.replaceChildren(Ie,De),Se}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ne,oe){const{rows:Se,cells:Ie}=oe;for(let De=0;De<Se;De++){const je=Ie[De];if(je==null)continue;const rt=je.findIndex(it=>{if(!it)return;const{elem:st}=it;return e.$getNearestNodeFromDOMNode(st)===ne});if(rt!==-1)return{x:rt,y:De}}throw new Error("Cell not found in table.")}getCellFromCords(ne,oe,Se){const{cells:Ie}=Se,De=Ie[oe];if(De==null)return null;const je=De[ne];return je??null}getCellFromCordsOrThrow(ne,oe,Se){const Ie=this.getCellFromCords(ne,oe,Se);if(!Ie)throw new Error("Cell not found at cords.");return Ie}getCellNodeFromCords(ne,oe,Se){const Ie=this.getCellFromCords(ne,oe,Se);if(Ie==null)return null;const De=e.$getNearestNodeFromDOMNode(Ie.elem);return b(De)?De:null}getCellNodeFromCordsOrThrow(ne,oe,Se){const Ie=this.getCellNodeFromCords(ne,oe,Se);if(!Ie)throw new Error("Node at cords not TableCellNode.");return Ie}canSelectBefore(){return!0}canIndent(){return!1}}function J(Oe,ne){const oe=Oe.getElementByKey(ne.getKey());if(oe==null)throw new Error("Table Element Not Found");return ge(oe)}function de(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new H)}function I(Oe){return Oe instanceof H}function w(Oe,ne,oe=!0){const Se=_e();for(let Ie=0;Ie<Oe;Ie++){const De=E();for(let je=0;je<ne;je++){let rt=m.NO_STATUS;typeof oe=="object"?(Ie===0&&oe.rows&&(rt|=m.ROW),je===0&&oe.columns&&(rt|=m.COLUMN)):oe&&(Ie===0&&(rt|=m.ROW),je===0&&(rt|=m.COLUMN));const it=R(rt),st=e.$createParagraphNode();st.append(e.$createTextNode()),it.append(st),De.append(it)}Se.append(De)}return Se}function D(Oe){const ne=t.$findMatchingParent(Oe,oe=>b(oe));return b(ne)?ne:null}function re(Oe){const ne=t.$findMatchingParent(Oe,oe=>x(oe));if(x(ne))return ne;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ne=t.$findMatchingParent(Oe,oe=>I(oe));if(I(ne))return ne;throw new Error("Expected table cell to be inside of table.")}function Ae(Oe){const ne=re(Oe);return ye(ne).getChildren().findIndex(Se=>Se.is(ne))}function ee(Oe){return re(Oe).getChildren().findIndex(oe=>oe.is(Oe))}function te(Oe,ne){const oe=ye(Oe),{x:Se,y:Ie}=oe.getCordsFromCellNode(Oe,ne);return{above:oe.getCellNodeFromCords(Se,Ie-1,ne),below:oe.getCellNodeFromCords(Se,Ie+1,ne),left:oe.getCellNodeFromCords(Se-1,Ie,ne),right:oe.getCellNodeFromCords(Se+1,Ie,ne)}}function ce(Oe,ne){const oe=Oe.getChildren();if(ne>=oe.length||ne<0)throw new Error("Expected table cell to be inside of table row.");return oe[ne].remove(),Oe}function be(Oe,ne,oe=!0,Se,Ie){const De=Oe.getChildren();if(ne>=De.length||ne<0)throw new Error("Table row target index out of range");const je=De[ne];if(x(je))for(let rt=0;rt<Se;rt++){const it=je.getChildren(),st=it.length,vt=E();for(let Ge=0;Ge<st;Ge++){const ze=it[Ge];if(!b(ze))throw Error("Expected table cell");const{above:tt,below:_t}=te(ze,Ie);let Nt=m.NO_STATUS;const Et=tt&&tt.getWidth()||_t&&_t.getWidth()||void 0;(tt&&tt.hasHeaderState(m.COLUMN)||_t&&_t.hasHeaderState(m.COLUMN))&&(Nt|=m.COLUMN);const ht=R(Nt,1,Et);ht.append(e.$createParagraphNode()),vt.append(ht)}oe?je.insertAfter(vt):je.insertBefore(vt)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ne=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ne))throw Error("Expected a INTERNAL_PointSelection");const oe=ne.focus.getNode(),[Se,,Ie]=e.DEPRECATED_$getNodeTriplet(oe),[De,je]=e.DEPRECATED_$computeGridMap(Ie,Se,Se),rt=De[0].length,{startRow:it}=je;if(Oe){const st=it+Se.__rowSpan-1,vt=De[st],Ge=E();for(let tt=0;tt<rt;tt++){const{cell:_t,startRow:Nt}=vt[tt];Nt+_t.__rowSpan-1<=st?Ge.append(R(m.NO_STATUS).append(e.$createParagraphNode())):_t.setRowSpan(_t.__rowSpan+1)}const ze=Ie.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const st=De[it],vt=E();for(let ze=0;ze<rt;ze++){const{cell:tt,startRow:_t}=st[ze];_t===it?vt.append(R(m.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Ie.getChildAtIndex(it);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(vt)}}function Re(Oe,ne,oe=!0,Se,Ie){const De=Oe.getChildren(),je=[];for(let rt=0;rt<De.length;rt++){const it=De[rt];if(x(it))for(let st=0;st<Se;st++){const vt=it.getChildren();if(ne>=vt.length||ne<0)throw new Error("Table column target index out of range");const Ge=vt[ne];if(!b(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=te(Ge,Ie);let _t=m.NO_STATUS;(ze&&ze.hasHeaderState(m.ROW)||tt&&tt.hasHeaderState(m.ROW))&&(_t|=m.ROW);const Nt=R(_t);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:rt,targetCell:it})=>{oe?it.insertAfter(rt):it.insertBefore(rt)}),Oe}function Le(Oe=!0){const ne=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ne))throw Error("Expected a PointSeleciton");const oe=ne.anchor.getNode(),Se=ne.focus.getNode(),[Ie]=e.DEPRECATED_$getNodeTriplet(oe),[De,,je]=e.DEPRECATED_$getNodeTriplet(Se),[rt,it,st]=e.DEPRECATED_$computeGridMap(je,De,Ie),vt=rt.length,Ge=Oe?Math.max(it.startColumn,st.startColumn):Math.min(it.startColumn,st.startColumn),ze=Oe?Ge+De.__colSpan-1:Ge-1,tt=je.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let _t=null;function Nt(){const ht=R(m.NO_STATUS).append(e.$createParagraphNode());return _t===null&&(_t=ht),ht}let Et=tt;e:for(let ht=0;ht<vt;ht++){if(ht!==0){const tn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(tn))throw Error("Expected row nextSibling to be a row");Et=tn}const xt=rt[ht];if(ze<0){Mt(Et,Nt());continue}const{cell:pt,startColumn:$t,startRow:Kt}=xt[ze];if($t+pt.__colSpan-1<=ze){let tn=pt,It=Kt,jt=ze;for(;It!==ht&&tn.__rowSpan>1;)if(jt-=pt.__colSpan,jt>=0){const{cell:bt,startRow:nn}=xt[jt];tn=bt,It=nn}else{Et.append(Nt());continue e}tn.insertAfter(Nt())}else pt.setColSpan(pt.__colSpan+1)}_t!==null&&ct(_t)}function Fe(Oe,ne){const oe=Oe.getChildren();for(let Se=0;Se<oe.length;Se++){const Ie=oe[Se];if(x(Ie)){const De=Ie.getChildren();if(ne>=De.length||ne<0)throw new Error("Table column target index out of range");De[ne].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),oe=Oe.focus.getNode(),[Se,,Ie]=e.DEPRECATED_$getNodeTriplet(ne),[De]=e.DEPRECATED_$getNodeTriplet(oe),[je,rt,it]=e.DEPRECATED_$computeGridMap(Ie,Se,De),{startRow:st}=rt,{startRow:vt}=it,Ge=vt+De.__rowSpan-1;if(je.length===Ge-st+1){Ie.remove();return}const ze=je[0].length,tt=je[Ge+1],_t=Ie.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=st;Nt--){for(let ht=ze-1;ht>=0;ht--){const{cell:xt,startRow:pt,startColumn:$t}=je[Nt][ht];if($t===ht&&(Nt===st&&pt<st&&xt.setRowSpan(xt.__rowSpan-(pt-st)),pt>=st&&pt+xt.__rowSpan-1>Ge)){if(xt.setRowSpan(xt.__rowSpan-(Ge-pt+1)),_t===null)throw Error("Expected nextRowNode not to be null");if(ht===0)Mt(_t,xt);else{const{cell:Kt}=tt[ht-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];ct(Nt)}else{const Nt=je[st-1],{cell:Et}=Nt[0];ct(Et)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),oe=Oe.focus.getNode(),[Se,,Ie]=e.DEPRECATED_$getNodeTriplet(ne),[De]=e.DEPRECATED_$getNodeTriplet(oe),[je,rt,it]=e.DEPRECATED_$computeGridMap(Ie,Se,De),{startColumn:st}=rt,{startRow:vt,startColumn:Ge}=it,ze=Math.min(st,Ge),tt=Math.max(st+Se.__colSpan-1,Ge+De.__colSpan-1),_t=tt-ze+1;if(je[0].length===tt-ze+1){Ie.selectPrevious(),Ie.remove();return}const Et=je.length;for(let pt=0;pt<Et;pt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:tn}=je[pt][$t];if(tn<ze){if($t===ze){const It=ze-tn;Kt.setColSpan(Kt.__colSpan-Math.min(_t,Kt.__colSpan-It))}}else if(tn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-tn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const ht=je[vt],xt=ht[Ge+De.__colSpan];if(xt!==void 0){const{cell:pt}=xt;ct(pt)}else{const pt=ht[Ge-1],{cell:$t}=pt;ct($t)}}function ct(Oe){const ne=Oe.getFirstDescendant();ne==null?Oe.selectStart():ne.getParentOrThrow().selectStart()}function Mt(Oe,ne){const oe=Oe.getFirstChild();oe!==null?oe.insertBefore(ne):Oe.append(ne)}function Ut(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),[oe,Se,Ie]=e.DEPRECATED_$getNodeTriplet(ne),De=oe.__colSpan,je=oe.__rowSpan;if(De>1){for(let rt=1;rt<De;rt++)oe.insertAfter(R(m.NO_STATUS));oe.setColSpan(1)}if(je>1){const[rt,it]=e.DEPRECATED_$computeGridMap(Ie,oe,oe),{startColumn:st,startRow:vt}=it;let Ge;for(let ze=1;ze<je;ze++){const tt=vt+ze,_t=rt[tt];if(Ge=(Ge||Se).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ge))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Et=0;Et<st;Et++){const ht=_t[Et],xt=ht.cell;ht.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Et+=xt.__colSpan-1)}if(Nt===null)for(let Et=0;Et<De;Et++)Mt(Ge,R(m.NO_STATUS));else for(let Et=0;Et<De;Et++)Nt.insertAfter(R(m.NO_STATUS))}oe.setRowSpan(1)}}const en=e.createCommand("INSERT_TABLE_COMMAND");return Zt.$createGridSelection=c,Zt.$createTableCellNode=R,Zt.$createTableNode=_e,Zt.$createTableNodeWithDimensions=w,Zt.$createTableRowNode=E,Zt.$deleteTableColumn=Fe,Zt.$deleteTableColumn__EXPERIMENTAL=Be,Zt.$deleteTableRow__EXPERIMENTAL=qe,Zt.$getElementGridForTableNode=J,Zt.$getTableCellNodeFromLexicalNode=D,Zt.$getTableColumnIndexFromTableCellNode=ee,Zt.$getTableNodeFromLexicalNodeOrThrow=ye,Zt.$getTableRowIndexFromTableCellNode=Ae,Zt.$getTableRowNodeFromTableCellNodeOrThrow=re,Zt.$insertTableColumn=Re,Zt.$insertTableColumn__EXPERIMENTAL=Le,Zt.$insertTableRow=be,Zt.$insertTableRow__EXPERIMENTAL=Ne,Zt.$isGridSelection=r,Zt.$isTableCellNode=b,Zt.$isTableNode=I,Zt.$isTableRowNode=x,Zt.$removeTableRowAtIndex=ce,Zt.$unmergeCell=Ut,Zt.INSERT_TABLE_COMMAND=en,Zt.TableCellHeaderStates=m,Zt.TableCellNode=N,Zt.TableNode=H,Zt.TableRowNode=k,Zt.TableSelection=F,Zt.applyTableHandlers=G,Zt.getCellFromTarget=se,Zt.getTableSelectionFromTableElement=le,Zt}var Jt={},_f;function Qy(){if(_f)return Jt;_f=1;var e=gn(),t=Xn();function n(I){let w=new URLSearchParams;w.append("code",I);for(let D=1;D<arguments.length;D++)w.append("v",arguments[D]);throw Error(`Minified Lexical error #${I}; visit https://lexical.dev/docs/error?${w} 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(w,D,re){super(D,re),this.gridKey=w}getCachedNodes(){return this._cachedNodes}setCachedNodes(w){this._cachedNodes=w}is(w){return c(w)?this.gridKey===w.gridKey&&this.anchor.is(w.anchor)&&this.focus.is(w.focus):!1}set(w,D,re){this.dirty=!0,this.gridKey=w,this.anchor.key=D,this.focus.key=re,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(w){let D=this.focus.getNode();if(!e.$isElementNode(D))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(D.select(0,D.getChildrenSize())).insertNodes(w)}getShape(){var w=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(w)||n(103),w=e.DEPRECATED_$getGridCellNodeRect(w),w===null)throw Error("getCellRect: expected to find AnchorNode");var D=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(D)||n(104);let re=e.DEPRECATED_$getGridCellNodeRect(D);if(re===null)throw Error("getCellRect: expected to find focusCellNode");D=Math.min(w.columnIndex,re.columnIndex);let ye=Math.max(w.columnIndex,re.columnIndex),Ae=Math.min(w.rowIndex,re.rowIndex);return w=Math.max(w.rowIndex,re.rowIndex),{fromX:Math.min(D,ye),fromY:Math.min(Ae,w),toX:Math.max(D,ye),toY:Math.max(Ae,w)}}getNodes(){function w(ct){let{cell:Mt,startColumn:Ut,startRow:en}=ct;be=Math.min(be,Ut),Ne=Math.min(Ne,en),Re=Math.max(Re,Ut+Mt.__colSpan-1),Le=Math.max(Le,en+Mt.__rowSpan-1)}var D=this._cachedNodes;if(D!==null)return D;var re=this.anchor.getNode();D=this.focus.getNode();var ye=t.$findMatchingParent(re,e.DEPRECATED_$isGridCellNode);re=t.$findMatchingParent(D,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(re)||n(104),D=ye.getParent(),e.DEPRECATED_$isGridRowNode(D)||n(105),D=D.getParent(),e.DEPRECATED_$isGridNode(D)||n(106);var Ae=re.getParents()[1];if(Ae!==D){if(D.isParentOf(re)){if(D=Ae.getParent(),D==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,re.getKey(),D.getKey())}else{if(D=D.getParent(),D==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,D.getKey(),re.getKey())}return this.getNodes()}let[ee,te,ce]=e.DEPRECATED_$computeGridMap(D,ye,re),be=Math.min(te.startColumn,ce.startColumn),Ne=Math.min(te.startRow,ce.startRow),Re=Math.max(te.startColumn+te.cell.__colSpan-1,ce.startColumn+ce.cell.__colSpan-1),Le=Math.max(te.startRow+te.cell.__rowSpan-1,ce.startRow+ce.cell.__rowSpan-1);re=be,ye=Ne,Ae=be;for(var Fe=Ne;be<re||Ne<ye||Re>Ae||Le>Fe;){if(be<re){var qe=Fe-ye;--re;for(var Be=0;Be<=qe;Be++)w(ee[ye+Be][re])}if(Ne<ye)for(qe=Ae-re,--ye,Be=0;Be<=qe;Be++)w(ee[ye][re+Be]);if(Re>Ae)for(qe=Fe-ye,Ae+=1,Be=0;Be<=qe;Be++)w(ee[ye+Be][Ae]);if(Le>Fe)for(qe=Ae-re,Fe+=1,Be=0;Be<=qe;Be++)w(ee[Fe][re+Be])}for(D=[D],re=null,ye=Ne;ye<=Le;ye++)for(Ae=be;Ae<=Re;Ae++)({cell:Fe}=ee[ye][Ae]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==re&&D.push(qe),D.push(Fe,...g(Fe)),re=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=D),D}getTextContent(){let w=this.getNodes(),D="";for(let re=0;re<w.length;re++)D+=w[re].getTextContent();return D}}function c(I){return I instanceof r}function d(){let I=e.$createPoint("root",0,"element"),w=e.$createPoint("root",0,"element");return new r("root",I,w)}function g(I){let w=[],D=[I];for(;0<D.length;){let re=D.pop();re===void 0&&n(112),e.$isElementNode(re)&&D.unshift(...re.getChildren()),re!==I&&w.push(re)}return w}let m=/^(\d+(?:\.\d+)?)px$/,N={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class T extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(w){let D=new T(w.__headerState,w.__colSpan,w.__width,w.__key);return D.__rowSpan=w.__rowSpan,D.__backgroundColor=w.__backgroundColor,D}static importDOM(){return{td:()=>({conversion:R,priority:0}),th:()=>({conversion:R,priority:0})}}static importJSON(w){let D=w.rowSpan||1,re=b(w.headerState,w.colSpan||1,w.width||void 0);return re.__rowSpan=D,re.__backgroundColor=w.backgroundColor||null,re}constructor(w=N.NO_STATUS,D=1,re,ye){super(D,ye),this.__headerState=w,this.__width=re,this.__backgroundColor=null}createDOM(w){let D=document.createElement(this.getTag());return this.__width&&(D.style.width=`${this.__width}px`),1<this.__colSpan&&(D.colSpan=this.__colSpan),1<this.__rowSpan&&(D.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(D.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(D,w.theme.tableCell,this.hasHeader()&&w.theme.tableCellHeader),D}exportDOM(w){if({element:w}=super.exportDOM(w),w){var D=this.getParentOrThrow().getChildrenSize();w.style.border="1px solid black",1<this.__colSpan&&(w.colSpan=this.__colSpan),1<this.__rowSpan&&(w.rowSpan=this.__rowSpan),w.style.width=`${this.getWidth()||Math.max(90,700/D)}px`,w.style.verticalAlign="top",w.style.textAlign="start",D=this.getBackgroundColor(),D!==null?w.style.backgroundColor=D:this.hasHeader()&&(w.style.backgroundColor="#f2f3f5")}return{element:w}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(w){return this.getWritable().__headerState=w,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(w){return this.getWritable().__width=w,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(w){this.getWritable().__backgroundColor=w}toggleHeaderStyle(w){let D=this.getWritable();return D.__headerState=(D.__headerState&w)===w?D.__headerState-w:D.__headerState+w,D}hasHeaderState(w){return(this.getHeaderStyles()&w)===w}hasHeader(){return this.getLatest().__headerState!==N.NO_STATUS}updateDOM(w){return w.__headerState!==this.__headerState||w.__width!==this.__width||w.__colSpan!==this.__colSpan||w.__rowSpan!==this.__rowSpan||w.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function R(I){var w=I.nodeName.toLowerCase();let D;return m.test(I.style.width)&&(D=parseFloat(I.style.width)),w=b(w==="th"?N.ROW:N.NO_STATUS,I.colSpan,D),w.__rowSpan=I.rowSpan,I=I.style.backgroundColor,I!==""&&(w.__backgroundColor=I),{forChild:(re,ye)=>k(ye)&&!e.$isElementNode(re)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(re)&&re.getTextContent()===`
|
|
76
|
+
`?null:(ye.append(re),ye)):re,node:w}}function b(I,w=1,D){return e.$applyNodeReplacement(new T(I,w,D))}function k(I){return I instanceof T}class z extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(w){return new z(w.__height,w.__key)}static importDOM(){return{tr:()=>({conversion:E,priority:0})}}static importJSON(w){return x(w.height)}constructor(w,D){super(D),this.__height=w}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(w){let D=document.createElement("tr");return this.__height&&(D.style.height=`${this.__height}px`),t.addClassNamesToElement(D,w.theme.tableRow),D}isShadowRoot(){return!0}setHeight(w){return this.getWritable().__height=w,this.__height}getHeight(){return this.getLatest().__height}updateDOM(w){return w.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function E(I){let w;return m.test(I.style.height)&&(w=parseFloat(I.style.height)),{node:x(w)}}function x(I){return e.$applyNodeReplacement(new z(I))}function U(I){return I instanceof z}let Q=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class F{constructor(w,D){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=D,this.editor=w,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(w=>w())}trackTableGrid(){let w=new MutationObserver(D=>{this.editor.update(()=>{var re=!1;for(let ye=0;ye<D.length;ye++){const Ae=D[ye].target.nodeName;if(Ae==="TABLE"||Ae==="TR"){re=!0;break}}if(re){if(re=this.editor.getElementByKey(this.tableNodeKey),!re)throw Error("Expected to find TableElement in DOM");this.grid=G(re)}})});this.editor.update(()=>{let D=this.editor.getElementByKey(this.tableNodeKey);if(!D)throw Error("Expected to find TableElement in DOM");this.grid=G(D),w.observe(D,{childList:!0,subtree:!0})})}clearHighlight(){let w=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(),w.update(()=>{var D=e.$getNodeByKey(this.tableNodeKey);if(!P(D))throw Error("Expected TableNode.");if(D=w.getElementByKey(this.tableNodeKey),!D)throw Error("Expected to find TableElement in DOM");D=G(D),q(w,D,null),e.$setSelection(null),w.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let w=this.editor;w.update(()=>{let D=w.getElementByKey(this.tableNodeKey);if(!D)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(D,w._config.theme.tableSelection),D.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let w=this.editor;w.update(()=>{let D=w.getElementByKey(this.tableNodeKey);if(!D)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(D,w._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(w){if(w!=null&&w.gridKey===this.tableNodeKey){let D=this.editor;this.gridSelection=w,this.isHighlightingCells=!0,this.disableHighlightStyle(),q(D,this.grid,this.gridSelection)}else w==null?this.clearHighlight():(this.tableNodeKey=w.gridKey,this.updateTableGridSelection(w))}setFocusCellForSelection(w,D=!1){let re=this.editor;re.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!P(ye))throw Error("Expected TableNode.");if(!re.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=w.x;let Ae=w.y;if(this.focusCell=w,this.anchorCell!==null){let ee=Q?(re._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==Ae||D))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&Ae===this.focusY)return;this.focusX=ye,this.focusY=Ae,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(w.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&k(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),re.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),q(re,this.grid,this.gridSelection)))})}setAnchorCellForSelection(w){this.isHighlightingCells=!1,this.anchorCell=w,this.anchorX=w.x,this.anchorY=w.y,this.editor.update(()=>{var D=e.$getNearestNodeFromDOMNode(w.elem);k(D)&&(D=D.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=D)})}formatCells(w){this.editor.update(()=>{let D=e.$getSelection();c(D)||n(11);let re=e.$createRangeSelection(),ye=re.anchor,Ae=re.focus;D.getNodes().forEach(ee=>{k(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),Ae.set(ee.getKey(),ee.getChildrenSize(),"element"),re.formatText(w))}),e.$setSelection(D),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let w=this.editor;w.update(()=>{let D=e.$getNodeByKey(this.tableNodeKey);if(!P(D))throw Error("Expected TableNode.");var re=e.$getSelection();c(re)||n(11),re=re.getNodes().filter(k),re.length===this.grid.columns*this.grid.rows?(D.selectPrevious(),D.remove(),e.$getRoot().selectStart()):(re.forEach(ye=>{if(e.$isElementNode(ye)){let Ae=e.$createParagraphNode(),ee=e.$createTextNode();Ae.append(ee),ye.append(Ae),ye.getChildren().forEach(te=>{te!==Ae&&te.remove()})}}),q(w,this.grid,null),e.$setSelection(null),w.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function W(I){for(;I!=null;){let w=I.nodeName;if(w==="TD"||w==="TH"){if(I=I._cell,I===void 0)break;return I}I=I.parentNode}return null}function G(I){let w=[],D={cells:w,columns:0,rows:0};var re=I.firstChild;let ye=I=0;for(w.length=0;re!=null;){var Ae=re.nodeName;if(Ae==="TD"||Ae==="TH"){Ae=re,Ae={elem:Ae,hasBackgroundColor:Ae.style.backgroundColor!=="",highlighted:!1,x:I,y:ye},re._cell=Ae;let ee=w[ye];ee===void 0&&(ee=w[ye]=[]),ee[I]=Ae}else if(Ae=re.firstChild,Ae!=null){re=Ae;continue}if(Ae=re.nextSibling,Ae!=null)I++,re=Ae;else if(Ae=re.parentNode,Ae!=null){if(re=Ae.nextSibling,re==null)break;ye++,I=0}}return D.columns=I+1,D.rows=ye+1,D}function q(I,w,D){let re=new Set(D?D.getNodes():[]);le(w,(ye,Ae)=>{let ee=ye.elem;re.has(Ae)?(ye.highlighted=!0,xe(I,ye)):(ye.highlighted=!1,we(I,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function le(I,w){({cells:I}=I);for(let D=0;D<I.length;D++){let re=I[D];if(re)for(let ye=0;ye<re.length;ye++){let Ae=re[ye];if(!Ae)continue;let ee=e.$getNearestNodeFromDOMNode(Ae.elem);ee!==null&&w(Ae,ee,{x:ye,y:D})}}}function se(I,w){w.disableHighlightStyle(),le(w.grid,D=>{D.highlighted=!0,xe(I,D)})}function ge(I,w){w.enableHighlightStyle(),le(w.grid,D=>{let re=D.elem;D.highlighted=!1,we(I,D),re.getAttribute("style")||re.removeAttribute("style")})}let j=(I,w,D,re,ye)=>{const Ae=ye==="forward";switch(ye){case"backward":case"forward":return D!==(Ae?I.grid.columns-1:0)?(I=w.getCellNodeFromCordsOrThrow(D+(Ae?1:-1),re,I.grid),Ae?I.selectStart():I.selectEnd()):re!==(Ae?I.grid.rows-1:0)?(I=w.getCellNodeFromCordsOrThrow(Ae?0:I.grid.columns-1,re+(Ae?1:-1),I.grid),Ae?I.selectStart():I.selectEnd()):Ae?w.selectNext():w.selectPrevious(),!0;case"up":return re!==0?w.getCellNodeFromCordsOrThrow(D,re-1,I.grid).selectEnd():w.selectPrevious(),!0;case"down":return re!==I.grid.rows-1?w.getCellNodeFromCordsOrThrow(D,re+1,I.grid).selectStart():w.selectNext(),!0;default:return!1}},B=(I,w,D,re,ye)=>{const Ae=ye==="forward";switch(ye){case"backward":case"forward":return D!==(Ae?I.grid.columns-1:0)&&I.setFocusCellForSelection(w.getCellFromCordsOrThrow(D+(Ae?1:-1),re,I.grid)),!0;case"up":return re!==0?(I.setFocusCellForSelection(w.getCellFromCordsOrThrow(D,re-1,I.grid)),!0):!1;case"down":return re!==I.grid.rows-1?(I.setFocusCellForSelection(w.getCellFromCordsOrThrow(D,re+1,I.grid)),!0):!1;default:return!1}};function V(I,w){if(e.$isRangeSelection(I)||c(I)){let D=w.isParentOf(I.anchor.getNode());return I=w.isParentOf(I.focus.getNode()),D&&I}return!1}function xe(I,w){I=w.elem,w=e.$getNearestNodeFromDOMNode(I),k(w)||n(131),w.getBackgroundColor()===null?I.style.setProperty("background-color","rgb(172,206,247)"):I.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),I.style.setProperty("caret-color","transparent")}function we(I,w){I=w.elem,w=e.$getNearestNodeFromDOMNode(I),k(w)||n(131),w.getBackgroundColor()===null&&I.style.removeProperty("background-color"),I.style.removeProperty("background-image"),I.style.removeProperty("caret-color")}function Ee(I){return I=t.$findMatchingParent(I,k),k(I)?I:null}function ue(I){return I=t.$findMatchingParent(I,P),P(I)?I:null}function $(I,w,D,re,ye){let Ae=e.$getSelection();if(!V(Ae,re))return!1;if(e.$isRangeSelection(Ae)&&Ae.isCollapsed()){if(D==="backward"||D==="forward")return!1;let{anchor:be,focus:Ne}=Ae;var ee=t.$findMatchingParent(be.getNode(),k),te=t.$findMatchingParent(Ne.getNode(),k);if(!k(ee)||!ee.is(te))return!1;if(te=ue(ee),te!==re&&te!=null){var ce=I.getElementByKey(te.getKey());if(ce!=null)return ye.grid=G(ce),$(I,w,D,te,ye)}if(te=I.getElementByKey(ee.__key),ce=I.getElementByKey(be.key),ce==null||te==null)return!1;if(be.type==="element")te=ce.getBoundingClientRect();else{if(te=window.getSelection(),te===null||te.rangeCount===0)return!1;te=te.getRangeAt(0).getBoundingClientRect()}if(ce=D==="up"?ee.getFirstChild():ee.getLastChild(),ce==null||(I=I.getElementByKey(ce.__key),I==null))return!1;if(I=I.getBoundingClientRect(),D==="up"?I.top>te.top-te.height:te.bottom+te.height>I.bottom){if(S(w),I=re.getCordsFromCellNode(ee,ye.grid),w.shiftKey)D=re.getCellFromCordsOrThrow(I.x,I.y,ye.grid),ye.setAnchorCellForSelection(D),ye.setFocusCellForSelection(D,!0);else return j(ye,re,I.x,I.y,D);return!0}}else if(c(Ae)){let{anchor:be,focus:Ne}=Ae;return ce=t.$findMatchingParent(be.getNode(),k),te=t.$findMatchingParent(Ne.getNode(),k),[ee]=Ae.getNodes(),I=I.getElementByKey(ee.getKey()),!k(ce)||!k(te)||!P(ee)||I==null?!1:(ye.updateTableGridSelection(Ae),I=G(I),ce=re.getCordsFromCellNode(ce,I),ce=re.getCellFromCordsOrThrow(ce.x,ce.y,I),ye.setAnchorCellForSelection(ce),S(w),w.shiftKey?(w=re.getCordsFromCellNode(te,I),B(ye,ee,w.x,w.y,D)):(te.selectEnd(),!0))}return!1}function S(I){I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation()}class Y extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(w){return new Y(w.__key)}static importDOM(){return{table:()=>({conversion:ie,priority:1})}}static importJSON(){return K()}constructor(w){super(w)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(w){let D=document.createElement("table");return t.addClassNamesToElement(D,w.theme.table),D}updateDOM(){return!1}exportDOM(w){return{...super.exportDOM(w),after:D=>{if(D){let re=D.cloneNode(),ye=document.createElement("colgroup"),Ae=document.createElement("tbody");if(t.isHTMLElement(D)&&Ae.append(...D.children),D=this.getFirstChildOrThrow(),!U(D))throw Error("Expected to find row node.");D=D.getChildrenSize();for(let ee=0;ee<D;ee++){let te=document.createElement("col");ye.append(te)}return re.replaceChildren(ye,Ae),re}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(w,D){let{rows:re,cells:ye}=D;for(D=0;D<re;D++){var Ae=ye[D];if(Ae!=null&&(Ae=Ae.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===w}),Ae!==-1))return{x:Ae,y:D}}throw Error("Cell not found in table.")}getCellFromCords(w,D,re){return{cells:re}=re,D=re[D],D==null?null:(w=D[w],w??null)}getCellFromCordsOrThrow(w,D,re){if(w=this.getCellFromCords(w,D,re),!w)throw Error("Cell not found at cords.");return w}getCellNodeFromCords(w,D,re){return w=this.getCellFromCords(w,D,re),w==null?null:(w=e.$getNearestNodeFromDOMNode(w.elem),k(w)?w:null)}getCellNodeFromCordsOrThrow(w,D,re){if(w=this.getCellNodeFromCords(w,D,re),!w)throw Error("Node at cords not TableCellNode.");return w}canSelectBefore(){return!0}canIndent(){return!1}}function ie(){return{node:K()}}function K(){return e.$applyNodeReplacement(new Y)}function P(I){return I instanceof Y}function Z(I){if(I=t.$findMatchingParent(I,w=>U(w)),U(I))return I;throw Error("Expected table cell to be inside of table row.")}function O(I){if(I=t.$findMatchingParent(I,w=>P(w)),P(I))return I;throw Error("Expected table cell to be inside of table.")}function H(I,w){let D=O(I),{x:re,y:ye}=D.getCordsFromCellNode(I,w);return{above:D.getCellNodeFromCords(re,ye-1,w),below:D.getCellNodeFromCords(re,ye+1,w),left:D.getCellNodeFromCords(re-1,ye,w),right:D.getCellNodeFromCords(re+1,ye,w)}}function J(I){let w=I.getFirstDescendant();w==null?I.selectStart():w.getParentOrThrow().selectStart()}function de(I,w){let D=I.getFirstChild();D!==null?D.insertBefore(w):I.append(w)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=d,Jt.$createTableCellNode=b,Jt.$createTableNode=K,Jt.$createTableNodeWithDimensions=function(I,w,D=!0){let re=K();for(let Ae=0;Ae<I;Ae++){let ee=x();for(let te=0;te<w;te++){var ye=N.NO_STATUS;typeof D=="object"?(Ae===0&&D.rows&&(ye|=N.ROW),te===0&&D.columns&&(ye|=N.COLUMN)):D&&(Ae===0&&(ye|=N.ROW),te===0&&(ye|=N.COLUMN)),ye=b(ye);let ce=e.$createParagraphNode();ce.append(e.$createTextNode()),ye.append(ce),ee.append(ye)}re.append(ee)}return re},Jt.$createTableRowNode=x,Jt.$deleteTableColumn=function(I,w){let D=I.getChildren();for(let ye=0;ye<D.length;ye++){var re=D[ye];if(U(re)){if(re=re.getChildren(),w>=re.length||0>w)throw Error("Table column target index out of range");re[w].remove()}}return I},Jt.$deleteTableColumn__EXPERIMENTAL=function(){var I=e.$getSelection();if(!e.$INTERNAL_isPointSelection(I))throw Error("Expected a INTERNAL_PointSelection");var w=I.anchor.getNode();I=I.focus.getNode();let[D,,re]=e.DEPRECATED_$getNodeTriplet(w);[w]=e.DEPRECATED_$getNodeTriplet(I);let[ye,Ae,ee]=e.DEPRECATED_$computeGridMap(re,D,w);var{startColumn:te}=Ae;let{startRow:ce,startColumn:be}=ee;I=Math.min(te,be),te=Math.max(te+D.__colSpan-1,be+w.__colSpan-1);let Ne=te-I+1;if(ye[0].length===te-I+1)re.selectPrevious(),re.remove();else{var Re=ye.length;for(let Le=0;Le<Re;Le++)for(let Fe=I;Fe<=te;Fe++){let{cell:qe,startColumn:Be}=ye[Le][Fe];Be<I?Fe===I&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(I-Be))):Be+qe.__colSpan-1>te?Fe===te&&qe.setColSpan(qe.__colSpan-(te-Be+1)):qe.remove()}I=ye[ce],w=I[be+w.__colSpan],w!==void 0?({cell:w}=w,J(w)):({cell:w}=I[be-1],J(w))}},Jt.$deleteTableRow__EXPERIMENTAL=function(){var I=e.$getSelection();if(!e.$INTERNAL_isPointSelection(I))throw Error("Expected a INTERNAL_PointSelection");var w=I.anchor.getNode();I=I.focus.getNode();let[D,,re]=e.DEPRECATED_$getNodeTriplet(w);[I]=e.DEPRECATED_$getNodeTriplet(I);let[ye,Ae,ee]=e.DEPRECATED_$computeGridMap(re,D,I);({startRow:w}=Ae);var{startRow:te}=ee;if(I=te+I.__rowSpan-1,ye.length===I-w+1)re.remove();else{te=ye[0].length;var ce=ye[I+1],be=re.getChildAtIndex(I+1);for(let Re=I;Re>=w;Re--){for(var Ne=te-1;0<=Ne;Ne--){let{cell:Le,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===w&&Fe<w&&Le.setRowSpan(Le.__rowSpan-(Fe-w)),Fe>=w&&Fe+Le.__rowSpan-1>I))if(Le.setRowSpan(Le.__rowSpan-(I-Fe+1)),be===null&&n(122),Ne===0)de(be,Le);else{let{cell:Be}=ce[Ne-1];Be.insertAfter(Le)}}Ne=re.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ce!==void 0?({cell:w}=ce[0],J(w)):({cell:w}=ye[w-1][0],J(w))}},Jt.$getElementGridForTableNode=function(I,w){if(I=I.getElementByKey(w.getKey()),I==null)throw Error("Table Element Not Found");return G(I)},Jt.$getTableCellNodeFromLexicalNode=function(I){return I=t.$findMatchingParent(I,w=>k(w)),k(I)?I:null},Jt.$getTableColumnIndexFromTableCellNode=function(I){return Z(I).getChildren().findIndex(w=>w.is(I))},Jt.$getTableNodeFromLexicalNodeOrThrow=O,Jt.$getTableRowIndexFromTableCellNode=function(I){let w=Z(I);return O(w).getChildren().findIndex(D=>D.is(w))},Jt.$getTableRowNodeFromTableCellNodeOrThrow=Z,Jt.$insertTableColumn=function(I,w,D=!0,re,ye){let Ae=I.getChildren(),ee=[];for(let be=0;be<Ae.length;be++){let Ne=Ae[be];if(U(Ne))for(let Re=0;Re<re;Re++){var te=Ne.getChildren();if(w>=te.length||0>w)throw Error("Table column target index out of range");te=te[w],k(te)||n(12);let{left:Le,right:Fe}=H(te,ye);var ce=N.NO_STATUS;(Le&&Le.hasHeaderState(N.ROW)||Fe&&Fe.hasHeaderState(N.ROW))&&(ce|=N.ROW),ce=b(ce),ce.append(e.$createParagraphNode()),ee.push({newTableCell:ce,targetCell:te})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{D?Ne.insertAfter(be):Ne.insertBefore(be)}),I},Jt.$insertTableColumn__EXPERIMENTAL=function(I=!0){function w(){let Re=b(N.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var D=e.$getSelection();if(!e.$INTERNAL_isPointSelection(D))throw Error("Expected a PointSeleciton");var re=D.anchor.getNode();D=D.focus.getNode(),[re]=e.DEPRECATED_$getNodeTriplet(re);let[ye,,Ae]=e.DEPRECATED_$getNodeTriplet(D),[ee,te,ce]=e.DEPRECATED_$computeGridMap(Ae,ye,re);re=ee.length,D=I?Math.max(te.startColumn,ce.startColumn):Math.min(te.startColumn,ce.startColumn),I=I?D+ye.__colSpan-1:D-1,D=Ae.getFirstChild(),e.DEPRECATED_$isGridRowNode(D)||n(120);let be=null;var Ne=D;e:for(D=0;D<re;D++){D!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[D];if(0>I){de(Ne,w());continue}let{cell:Le,startColumn:Fe,startRow:qe}=Re[I];if(Fe+Le.__colSpan-1<=I){let Be=Le,ct=qe,Mt=I;for(;ct!==D&&1<Be.__rowSpan;)if(Mt-=Le.__colSpan,0<=Mt){let{cell:Ut,startRow:en}=Re[Mt];Be=Ut,ct=en}else{Ne.append(w());continue e}Be.insertAfter(w())}else Le.setColSpan(Le.__colSpan+1)}be!==null&&J(be)},Jt.$insertTableRow=function(I,w,D=!0,re,ye){var Ae=I.getChildren();if(w>=Ae.length||0>w)throw Error("Table row target index out of range");if(w=Ae[w],U(w))for(Ae=0;Ae<re;Ae++){let te=w.getChildren(),ce=te.length,be=x();for(let Ne=0;Ne<ce;Ne++){var ee=te[Ne];k(ee)||n(12);let{above:Re,below:Le}=H(ee,ye);ee=N.NO_STATUS;let Fe=Re&&Re.getWidth()||Le&&Le.getWidth()||void 0;(Re&&Re.hasHeaderState(N.COLUMN)||Le&&Le.hasHeaderState(N.COLUMN))&&(ee|=N.COLUMN),ee=b(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}D?w.insertAfter(be):w.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return I},Jt.$insertTableRow__EXPERIMENTAL=function(I=!0){var w=e.$getSelection();if(!e.$INTERNAL_isPointSelection(w))throw Error("Expected a INTERNAL_PointSelection");w=w.focus.getNode();let[D,,re]=e.DEPRECATED_$getNodeTriplet(w),[ye,Ae]=e.DEPRECATED_$computeGridMap(re,D,D);w=ye[0].length;var{startRow:ee}=Ae;if(I){I=ee+D.__rowSpan-1;var te=ye[I];ee=x();for(var ce=0;ce<w;ce++){let{cell:be,startRow:Ne}=te[ce];Ne+be.__rowSpan-1<=I?ee.append(b(N.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}w=re.getChildAtIndex(I),e.DEPRECATED_$isGridRowNode(w)||n(119),w.insertAfter(ee)}else{for(te=ye[ee],I=x(),ce=0;ce<w;ce++){let{cell:be,startRow:Ne}=te[ce];Ne===ee?I.append(b(N.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}w=re.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(w)||n(119),w.insertBefore(I)}},Jt.$isGridSelection=c,Jt.$isTableCellNode=k,Jt.$isTableNode=P,Jt.$isTableRowNode=U,Jt.$removeTableRowAtIndex=function(I,w){let D=I.getChildren();if(w>=D.length||0>w)throw Error("Expected table cell to be inside of table row.");return D[w].remove(),I},Jt.$unmergeCell=function(){var I=e.$getSelection();if(!e.$INTERNAL_isPointSelection(I))throw Error("Expected a INTERNAL_PointSelection");I=I.anchor.getNode();let[w,D,re]=e.DEPRECATED_$getNodeTriplet(I);I=w.__colSpan;let ye=w.__rowSpan;if(1<I){for(var Ae=1;Ae<I;Ae++)w.insertAfter(b(N.NO_STATUS));w.setColSpan(1)}if(1<ye){let[ce,be]=e.DEPRECATED_$computeGridMap(re,w,w),{startColumn:Ne,startRow:Re}=be,Le;for(Ae=1;Ae<ye;Ae++){var ee=Re+Ae;let Fe=ce[ee];Le=(Le||D).getNextSibling(),e.DEPRECATED_$isGridRowNode(Le)||n(125);var te=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ct=Be.cell;Be.startRow===ee&&(te=ct),1<ct.__colSpan&&(qe+=ct.__colSpan-1)}if(te===null)for(te=0;te<I;te++)de(Le,b(N.NO_STATUS));else for(ee=0;ee<I;ee++)te.insertAfter(b(N.NO_STATUS))}w.setRowSpan(1)}},Jt.INSERT_TABLE_COMMAND=_e,Jt.TableCellHeaderStates=N,Jt.TableCellNode=T,Jt.TableNode=Y,Jt.TableRowNode=z,Jt.TableSelection=F,Jt.applyTableHandlers=function(I,w,D,re){function ye(Ne){return Ne=I.getCordsFromCellNode(Ne,ee.grid),I.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let Ae=D.getRootElement();if(Ae===null)throw Error("No root element.");let ee=new F(D,I.getKey()),te=D._window||window;w.__lexicalTableSelection=ee,w.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&te){var Re=W(Ne.target);Re!==null&&(S(Ne),ee.setAnchorCellForSelection(Re));var Le=()=>{te.removeEventListener("mouseup",Le),te.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=W(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};te.addEventListener("mouseup",Le),te.addEventListener("mousemove",Fe)}},0)});let ce=Ne=>{Ne.button===0&&D.update(()=>{const Re=e.$getSelection(),Le=Ne.target;c(Re)&&Re.gridKey===ee.tableNodeKey&&Ae.contains(Le)&&ee.clearHighlight()})};te.addEventListener("mousedown",ce),ee.listenersToRemove.add(()=>te.removeEventListener("mousedown",ce)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>$(D,Ne,"down",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>$(D,Ne,"up",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>$(D,Ne,"backward",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>$(D,Ne,"forward",I,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return c(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),k),k(Re))?(S(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!V(Re,I))return!1;if(c(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>k(Be));if(!k(qe))return!1;var Le=Re.anchor.getNode(),Fe=Re.focus.getNode();if(Le=I.isParentOf(Le),Fe=I.isParentOf(Fe),Le&&!Fe||Fe&&!Le)return ee.clearText(),!0;if(Le=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&k(Be.getParent())),!e.$isElementNode(Le)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&Le.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==Le){Re=Fe.getChildren();const Be=e.$createParagraphNode();return Re.forEach(ct=>Be.append(ct)),Fe.replace(Be),Fe.getWritable().__parent=qe.getKey(),!0}}return!1};return[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ne=>{ee.listenersToRemove.add(D.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),w=Ne=>{const Re=e.$getSelection();return V(Re,I)?c(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),Le=>k(Le)),k(Ne)),!1):!1},ee.listenersToRemove.add(D.registerCommand(e.KEY_BACKSPACE_COMMAND,w,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.KEY_DELETE_COMMAND,w,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return V(Re,I)?c(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),Le=>k(Le)),k(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return V(Ne,I)&&(c(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>k(Re)),k(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),re&&ee.listenersToRemove.add(D.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!V(Re,I)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(S(Ne),Re=I.getCordsFromCellNode(Re,ee.grid),j(ee,I,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.FOCUS_COMMAND,()=>I.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(D.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:Le}=Ne;Ne=e.$INTERNAL_isPointSelection(Le);var Fe=e.$isRangeSelection(Le);if(Ne=Fe&&t.$findMatchingParent(Le.anchor.getNode(),Ie=>e.DEPRECATED_$isGridCellNode(Ie))!==null&&t.$findMatchingParent(Le.focus.getNode(),Ie=>e.DEPRECATED_$isGridCellNode(Ie))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=Le,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ct=t.$findMatchingParent(qe.getNode(),Ie=>e.DEPRECATED_$isGridCellNode(Ie)),Mt=(qe=ct&&t.$findMatchingParent(ct,Ie=>e.DEPRECATED_$isGridRowNode(Ie)))&&t.$findMatchingParent(qe,Ie=>e.DEPRECATED_$isGridNode(Ie));if(!e.DEPRECATED_$isGridCellNode(ct)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(Mt))return!1;var Ut=qe.getIndexWithinParent(),en=Math.min(Mt.getChildrenSize()-1,Ut+Be-1);Be=ct.getIndexWithinParent(),ct=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ct),qe=Math.min(Ut,en),Be=Math.max(Be,ct),Ut=Math.max(Ut,en),Mt=Mt.getChildren(),en=0;let Oe,ne;for(ct=qe;ct<=Ut;ct++){var oe=Mt[ct];if(!e.DEPRECATED_$isGridRowNode(oe))return!1;var Se=Ne[en];if(!e.DEPRECATED_$isGridRowNode(Se))return!1;oe=oe.getChildren(),Se=Se.getChildren();let Ie=0;for(let De=Fe;De<=Be;De++){let je=oe[De];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let rt=Se[Ie];if(!e.DEPRECATED_$isGridCellNode(rt))return!1;ct===qe&&De===Fe?Oe=je.getKey():ct===Ut&&De===Be&&(ne=je.getKey());let it=je.getChildren();rt.getChildren().forEach(st=>{e.$isTextNode(st)&&e.$createParagraphNode().append(st),je.append(st)}),it.forEach(st=>st.remove()),Ie++}en++}return Oe&&ne&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ne),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(D.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ct,focus:Mt}=Ne;var Le=ct.getNode(),Fe=Mt.getNode();Le=Ee(Le),Fe=Ee(Fe);var qe=Le&&I.is(ue(Le)),Be=Fe&&I.is(ue(Fe));let Ut=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),Ut?(Le=Ne.clone(),Le.focus.set(I.getKey(),qe?0:I.getChildrenSize(),"element"),e.$setSelection(Le),se(D,ee)):Be&&!Le.is(Fe)&&(ee.setAnchorCellForSelection(ye(Le)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(c(Ne)||c(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(c(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!c(Ne)&&c(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!I.isSelected()?ge(D,ee):!ee.hasHijackedSelectionStyles&&I.isSelected()&&se(D,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Jt.getCellFromTarget=W,Jt.getTableSelectionFromTableElement=function(I){return I.__lexicalTableSelection},Jt}const eN=process.env.NODE_ENV==="development"?Xy():Qy();var Eu=eN,fr={},yf;function tN(){if(yf)return fr;yf=1;var e=gn(),t=Xn();function n(K){let P=1,Z=K.getParent();for(;Z!=null;){if(ge(Z)){const O=Z.getParent();if(ue(O)){P++,Z=O.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return P}return P}function r(K){let P=K.getParent();if(!ue(P))throw Error("A ListItemNode must have a ListNode for a parent.");let Z=P;for(;Z!==null;)Z=Z.getParent(),ue(Z)&&(P=Z);return P}function c(K){let P=[];const Z=K.getChildren().filter(ge);for(let O=0;O<Z.length;O++){const H=Z[O],J=H.getFirstChild();ue(J)?P=P.concat(c(J)):P.push(H)}return P}function d(K){return ge(K)&&ue(K.getFirstChild())}function g(K){let P=K;for(;P.getNextSibling()==null&&P.getPreviousSibling()==null;){const Z=P.getParent();if(Z==null||!(ge(P)||ue(P)))break;P=Z}P.remove()}function m(K){return se().append(K)}function N(K,P){return ge(K)&&(P.length===0||P.length===1&&K.is(P[0])&&K.getChildrenSize()===0)}function T(K){const P=K.getParent();let Z=1;if(P!=null)if(ue(P))Z=P.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const O=K.getPreviousSiblings();for(let H=0;H<O.length;H++){const J=O[H];ge(J)&&!ue(J.getFirstChild())&&Z++}return Z}function R(K,P){K.update(()=>{const Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){const O=Z.getNodes(),J=Z.anchor.getNode(),de=J.getParent();if(N(J,O)){const _e=Ee(P);if(e.$isRootOrShadowRoot(de)){J.replace(_e);const I=se();e.$isElementNode(J)&&(I.setFormat(J.getFormatType()),I.setIndent(J.getIndent())),_e.append(I)}else if(ge(J)){const I=J.getParentOrThrow();b(_e,I.getChildren()),I.replace(_e)}return}else{const _e=new Set;for(let I=0;I<O.length;I++){const w=O[I];if(e.$isElementNode(w)&&w.isEmpty()&&!ge(w)&&!_e.has(w.getKey())){k(w,P);continue}if(e.$isLeafNode(w)){let D=w.getParent();for(;D!=null;){const re=D.getKey();if(ue(D)){if(!_e.has(re)){const ye=Ee(P);b(ye,D.getChildren()),D.replace(ye),x(ye),_e.add(re)}break}else{const ye=D.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(re)){_e.add(re),k(D,P);break}D=ye}}}}}}})}function b(K,P){K.splice(K.getChildrenSize(),0,P)}function k(K,P){if(ue(K))return K;const Z=K.getPreviousSibling(),O=K.getNextSibling(),H=se();if(H.setFormat(K.getFormatType()),H.setIndent(K.getIndent()),b(H,K.getChildren()),ue(Z)&&P===Z.getListType())return Z.append(H),K.remove(),ue(O)&&P===O.getListType()&&(b(Z,O.getChildren()),O.remove()),Z;if(ue(O)&&P===O.getListType())return O.getFirstChildOrThrow().insertBefore(H),K.remove(),O;{const J=Ee(P);return J.append(H),K.replace(J),x(J),J}}function z(K,P){const Z=K.getLastChild(),O=P.getFirstChild();Z&&O&&d(Z)&&d(O)&&(z(Z.getFirstChild(),O.getFirstChild()),O.remove());const H=P.getChildren();H.length>0&&(K.append(...H),x(K)),P.remove()}function E(K){K.update(()=>{const P=e.$getSelection();if(e.$isRangeSelection(P)){const Z=new Set,O=P.getNodes(),H=P.anchor.getNode();if(N(H,O))Z.add(r(H));else for(let J=0;J<O.length;J++){const de=O[J];if(e.$isLeafNode(de)){const _e=t.$getNearestNodeOfType(de,W);_e!=null&&Z.add(r(_e))}}for(const J of Z){let de=J;const _e=c(J);for(const I of _e){const w=e.$createParagraphNode();b(w,I.getChildren()),de.insertAfter(w),de=w,I.__key===P.anchor.key&&P.anchor.set(w.getKey(),0,"element"),I.__key===P.focus.key&&P.focus.set(w.getKey(),0,"element"),I.remove()}J.remove()}}})}function x(K,P){const Z=P||K.getChildren();if(Z!==void 0)for(let O=0;O<Z.length;O++){const H=Z[O];if(ge(H)){const J=H.getValue(),de=T(H);J!==de&&H.setValue(de)}}}function U(K){const P=new Set;if(d(K)||P.has(K.getKey()))return;const Z=K.getParent(),O=K.getNextSibling(),H=K.getPreviousSibling();if(d(O)&&d(H)){const J=H.getFirstChild();if(ue(J)){J.append(K);const de=O.getFirstChild();if(ue(de)){const _e=de.getChildren();b(J,_e),O.remove(),P.add(O.getKey())}x(J)}}else if(d(O)){const J=O.getFirstChild();if(ue(J)){const de=J.getFirstChild();de!==null&&de.insertBefore(K),x(J)}}else if(d(H)){const J=H.getFirstChild();ue(J)&&(J.append(K),x(J))}else if(ue(Z)){const J=se(),de=Ee(Z.getListType());J.append(de),de.append(K),H?H.insertAfter(J):O?O.insertBefore(J):Z.append(J),x(de)}ue(Z)&&x(Z)}function Q(K){if(d(K))return;const P=K.getParent(),Z=P?P.getParent():void 0,O=Z?Z.getParent():void 0;if(ue(O)&&ge(Z)&&ue(P)){const H=P?P.getFirstChild():void 0,J=P?P.getLastChild():void 0;if(K.is(H))Z.insertBefore(K),P.isEmpty()&&Z.remove();else if(K.is(J))Z.insertAfter(K),P.isEmpty()&&Z.remove();else{const de=P.getListType(),_e=se(),I=Ee(de);_e.append(I),K.getPreviousSiblings().forEach(re=>I.append(re));const w=se(),D=Ee(de);w.append(D),b(D,K.getNextSiblings()),Z.insertBefore(_e),Z.insertAfter(w),Z.replace(K)}x(P),x(O)}}function F(){const K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed())return!1;const P=K.anchor.getNode();if(!ge(P)||P.getChildrenSize()!==0)return!1;const Z=r(P),O=P.getParent();if(!ue(O))throw Error("A ListItemNode must have a ListNode for a parent.");const H=O.getParent();let J;if(e.$isRootOrShadowRoot(H))J=e.$createParagraphNode(),Z.insertAfter(J);else if(ge(H))J=se(),H.insertAfter(J);else return!1;J.select();const de=P.getNextSiblings();if(de.length>0){const _e=Ee(O.getListType());if(e.$isParagraphNode(J))J.insertAfter(_e);else{const I=se();I.append(_e),J.insertAfter(I)}de.forEach(I=>{I.remove(),_e.append(I)})}return g(P),!0}class W extends e.ElementNode{static getType(){return"listitem"}static clone(P){return new W(P.__value,P.__checked,P.__key)}constructor(P,Z,O){super(O),this.__value=P===void 0?1:P,this.__checked=Z}createDOM(P){const Z=document.createElement("li"),O=this.getParent();return ue(O)&&O.getListType()==="check"&&q(Z,this,null),Z.value=this.__value,G(Z,P.theme,this),Z}updateDOM(P,Z,O){const H=this.getParent();return ue(H)&&H.getListType()==="check"&&q(Z,this,P),Z.value=this.__value,G(Z,O.theme,this),!1}static transform(){return P=>{const Z=P.getParent();if(ue(Z)){if(x(Z),!ge(P))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&P.getChecked()!=null&&P.setChecked(void 0)}}}static importDOM(){return{li:P=>({conversion:le,priority:0})}}static importJSON(P){const Z=se();return Z.setChecked(P.checked),Z.setValue(P.value),Z.setFormat(P.format),Z.setDirection(P.direction),Z}exportDOM(P){const Z=this.createDOM(P._config);return Z.style.textAlign=this.getFormatType(),{element:Z}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...P){for(let Z=0;Z<P.length;Z++){const O=P[Z];if(e.$isElementNode(O)&&this.canMergeWith(O)){const H=O.getChildren();this.append(...H),O.remove()}else super.append(O)}return this}replace(P,Z){if(ge(P))return super.replace(P);this.setIndent(0);const O=this.getParentOrThrow();if(!ue(O))return P;if(O.__first===this.getKey())O.insertBefore(P);else if(O.__last===this.getKey())O.insertAfter(P);else{const H=Ee(O.getListType());let J=this.getNextSibling();for(;J;){const de=J;J=J.getNextSibling(),H.append(de)}O.insertAfter(P),P.insertAfter(H)}if(Z){if(!e.$isElementNode(P))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(H=>{P.append(H)})}return this.remove(),O.getChildrenSize()===0&&O.remove(),P}insertAfter(P,Z=!0){const O=this.getParentOrThrow();if(!ue(O))throw Error("insertAfter: list node is not parent of list item node");const H=this.getNextSiblings();if(ge(P)){const J=super.insertAfter(P,Z),de=P.getParentOrThrow();return ue(de)&&x(de),J}if(ue(P)){let J=P;const de=P.getChildren();for(let _e=de.length-1;_e>=0;_e--)J=de[_e],this.insertAfter(J,Z);return J}if(O.insertAfter(P,Z),H.length!==0){const J=Ee(O.getListType());H.forEach(de=>J.append(de)),P.insertAfter(J,Z)}return P}remove(P){const Z=this.getPreviousSibling(),O=this.getNextSibling();if(super.remove(P),Z&&O&&d(Z)&&d(O))z(Z.getFirstChild(),O.getFirstChild()),O.remove();else if(O){const H=O.getParent();ue(H)&&x(H)}}insertNewAfter(P,Z=!0){const O=se(this.__checked==null?void 0:!1);return this.insertAfter(O,Z),O}collapseAtStart(P){const Z=e.$createParagraphNode();this.getChildren().forEach(_e=>Z.append(_e));const H=this.getParentOrThrow(),J=H.getParentOrThrow(),de=ge(J);if(H.getChildrenSize()===1)if(de)H.remove(),J.select();else{H.insertBefore(Z),H.remove();const _e=P.anchor,I=P.focus,w=Z.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(w,_e.offset,"element"),I.type==="element"&&I.getNode().is(this)&&I.set(w,I.offset,"element")}else H.insertBefore(Z),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(P){const Z=this.getWritable();Z.__value=P}getChecked(){return this.getLatest().__checked}setChecked(P){const Z=this.getWritable();Z.__checked=P}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const P=this.getParent();if(P===null)return this.getLatest().__indent;let Z=P.getParentOrThrow(),O=0;for(;ge(Z);)Z=Z.getParentOrThrow().getParentOrThrow(),O++;return O}setIndent(P){if(!(typeof P=="number"&&P>-1))throw Error("Invalid indent value.");let Z=this.getIndent();for(;Z!==P;)Z<P?(U(this),Z++):(Q(this),Z--);return this}insertBefore(P){if(ge(P)){const Z=this.getParentOrThrow();if(ue(Z)){const O=this.getNextSiblings();x(Z,O)}}return super.insertBefore(P)}canInsertAfter(P){return ge(P)}canReplaceWith(P){return ge(P)}canMergeWith(P){return e.$isParagraphNode(P)||ge(P)}extractWithChild(P,Z){if(!e.$isRangeSelection(Z))return!1;const O=Z.anchor.getNode(),H=Z.focus.getNode();return this.isParentOf(O)&&this.isParentOf(H)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function G(K,P,Z){const O=[],H=[],J=P.list,de=J?J.listitem:void 0;let _e;if(J&&J.nested&&(_e=J.nested.listitem),de!==void 0){const I=de.split(" ");O.push(...I)}if(J){const I=Z.getParent(),w=ue(I)&&I.getListType()==="check",D=Z.getChecked();(!w||D)&&H.push(J.listitemUnchecked),(!w||!D)&&H.push(J.listitemChecked),w&&O.push(D?J.listitemChecked:J.listitemUnchecked)}if(_e!==void 0){const I=_e.split(" ");Z.getChildren().some(w=>ue(w))?O.push(...I):H.push(...I)}H.length>0&&t.removeClassNamesFromElement(K,...H),O.length>0&&t.addClassNamesToElement(K,...O)}function q(K,P,Z,O){ue(P.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),(!Z||P.__checked!==Z.__checked)&&K.setAttribute("aria-checked",P.getChecked()?"true":"false"))}function le(K){const P=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true";return{node:se(P)}}function se(K){return e.$applyNodeReplacement(new W(void 0,K))}function ge(K){return K instanceof W}class j extends e.ElementNode{static getType(){return"list"}static clone(P){const Z=P.__listType||we[P.__tag];return new j(Z,P.__start,P.__key)}constructor(P,Z,O){super(O);const H=we[P]||P;this.__listType=H,this.__tag=H==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(P){const Z=this.getWritable();Z.__listType=P,Z.__tag=P==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(P,Z){const O=this.__tag,H=document.createElement(O);return this.__start!==1&&H.setAttribute("start",String(this.__start)),H.__lexicalListType=this.__listType,B(H,P.theme,this),H}updateDOM(P,Z,O){return P.__tag!==this.__tag?!0:(B(Z,O.theme,this),!1)}static importDOM(){return{ol:P=>({conversion:xe,priority:0}),ul:P=>({conversion:xe,priority:0})}}static importJSON(P){const Z=Ee(P.listType,P.start);return Z.setFormat(P.format),Z.setIndent(P.indent),Z.setDirection(P.direction),Z}exportDOM(P){const{element:Z}=super.exportDOM(P);return Z&&t.isHTMLElement(Z)&&(this.__start!==1&&Z.setAttribute("start",String(this.__start)),this.__listType==="check"&&Z.setAttribute("__lexicalListType","check")),{element:Z}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...P){for(let Z=0;Z<P.length;Z++){const O=P[Z];if(ge(O))super.append(O);else{const H=se();if(ue(O))H.append(O);else if(e.$isElementNode(O)){const J=e.$createTextNode(O.getTextContent());H.append(J)}else H.append(O);super.append(H)}}return x(this),this}extractWithChild(P){return ge(P)}}function B(K,P,Z){const O=[],H=[],J=P.list;if(J!==void 0){const de=J[`${Z.__tag}Depth`]||[],_e=n(Z)-1,I=_e%de.length,w=de[I],D=J[Z.__tag];let re;const ye=J.nested;if(ye!==void 0&&ye.list&&(re=ye.list),D!==void 0&&O.push(D),w!==void 0){const Ae=w.split(" ");O.push(...Ae);for(let ee=0;ee<de.length;ee++)ee!==I&&H.push(Z.__tag+ee)}if(re!==void 0){const Ae=re.split(" ");_e>1?O.push(...Ae):H.push(...Ae)}}H.length>0&&t.removeClassNamesFromElement(K,...H),O.length>0&&t.addClassNamesToElement(K,...O)}function V(K){const P=[];for(let Z=0;Z<K.length;Z++){const O=K[Z];if(ge(O)){P.push(O);const H=O.getChildren();H.length>1&&H.forEach(J=>{ue(J)&&P.push(m(J))})}else P.push(m(O))}return P}function xe(K){const P=K.nodeName.toLowerCase();let Z=null;if(P==="ol"){const O=K.start;Z=Ee("number",O)}else P==="ul"&&(t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?Z=Ee("check"):Z=Ee("bullet"));return{after:V,node:Z}}const we={ol:"number",ul:"bullet"};function Ee(K,P=1){return e.$applyNodeReplacement(new j(K,P))}function ue(K){return K instanceof j}const $=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),S=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Y=e.createCommand("INSERT_CHECK_LIST_COMMAND"),ie=e.createCommand("REMOVE_LIST_COMMAND");return fr.$createListItemNode=se,fr.$createListNode=Ee,fr.$getListDepth=n,fr.$handleListInsertParagraph=F,fr.$isListItemNode=ge,fr.$isListNode=ue,fr.INSERT_CHECK_LIST_COMMAND=Y,fr.INSERT_ORDERED_LIST_COMMAND=S,fr.INSERT_UNORDERED_LIST_COMMAND=$,fr.ListItemNode=W,fr.ListNode=j,fr.REMOVE_LIST_COMMAND=ie,fr.insertList=R,fr.removeList=E,fr}var hr={},Nf;function nN(){if(Nf)return hr;Nf=1;var e=gn(),t=Xn();function n($){let S=new URLSearchParams;S.append("code",$);for(let Y=1;Y<arguments.length;Y++)S.append("v",arguments[Y]);throw Error(`Minified Lexical error #${$}; visit https://lexical.dev/docs/error?${S} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r($){let S=1;for($=$.getParent();$!=null;){if(G($)){if($=$.getParent(),V($)){S++,$=$.getParent();continue}n(40)}break}return S}function c($){$=$.getParent(),V($)||n(40);let S=$;for(;S!==null;)S=S.getParent(),V(S)&&($=S);return $}function d($){let S=[];$=$.getChildren().filter(G);for(let Y=0;Y<$.length;Y++){let ie=$[Y],K=ie.getFirstChild();V(K)?S=S.concat(d(K)):S.push(ie)}return S}function g($){return G($)&&V($.getFirstChild())}function m($){for(;$.getNextSibling()==null&&$.getPreviousSibling()==null;){let S=$.getParent();if(S==null||!G($)&&!V($))break;$=S}$.remove()}function N($){return W().append($)}function T($,S){return G($)&&(S.length===0||S.length===1&&$.is(S[0])&&$.getChildrenSize()===0)}function R($,S){$.splice($.getChildrenSize(),0,S)}function b($,S){if(V($))return $;let Y=$.getPreviousSibling(),ie=$.getNextSibling(),K=W();return K.setFormat($.getFormatType()),K.setIndent($.getIndent()),R(K,$.getChildren()),V(Y)&&S===Y.getListType()?(Y.append(K),$.remove(),V(ie)&&S===ie.getListType()&&(R(Y,ie.getChildren()),ie.remove()),Y):V(ie)&&S===ie.getListType()?(ie.getFirstChildOrThrow().insertBefore(K),$.remove(),ie):(S=B(S),S.append(K),$.replace(S),z(S),S)}function k($,S){var Y=$.getLastChild();let ie=S.getFirstChild();Y&&ie&&g(Y)&&g(ie)&&(k(Y.getFirstChild(),ie.getFirstChild()),ie.remove()),Y=S.getChildren(),0<Y.length&&($.append(...Y),z($)),S.remove()}function z($,S){if($=S||$.getChildren(),$!==void 0)for(S=0;S<$.length;S++){let P=$[S];if(G(P)){let Z=P.getValue();var Y=P,ie=Y.getParent(),K=1;for(ie!=null&&(V(ie)?K=ie.getStart():n(44)),Y=Y.getPreviousSiblings(),ie=0;ie<Y.length;ie++){let O=Y[ie];G(O)&&!V(O.getFirstChild())&&K++}Z!==K&&P.setValue(K)}}}function E($){if(!g($)){var S=$.getParent(),Y=S?S.getParent():void 0,ie=Y?Y.getParent():void 0;if(V(ie)&&G(Y)&&V(S)){var K=S?S.getFirstChild():void 0,P=S?S.getLastChild():void 0;if($.is(K))Y.insertBefore($),S.isEmpty()&&Y.remove();else if($.is(P))Y.insertAfter($),S.isEmpty()&&Y.remove();else{var Z=S.getListType();K=W();let O=B(Z);K.append(O),$.getPreviousSiblings().forEach(H=>O.append(H)),P=W(),Z=B(Z),P.append(Z),R(Z,$.getNextSiblings()),Y.insertBefore(K),Y.insertAfter(P),Y.replace($)}z(S),z(ie)}}}class x extends e.ElementNode{static getType(){return"listitem"}static clone(S){return new x(S.__value,S.__checked,S.__key)}constructor(S,Y,ie){super(ie),this.__value=S===void 0?1:S,this.__checked=Y}createDOM(S){let Y=document.createElement("li"),ie=this.getParent();return V(ie)&&ie.getListType()==="check"&&Q(Y,this,null),Y.value=this.__value,U(Y,S.theme,this),Y}updateDOM(S,Y,ie){let K=this.getParent();return V(K)&&K.getListType()==="check"&&Q(Y,this,S),Y.value=this.__value,U(Y,ie.theme,this),!1}static transform(){return S=>{let Y=S.getParent();if(V(Y)){if(z(Y),!G(S))throw Error("node is not a ListItemNode");Y.getListType()!=="check"&&S.getChecked()!=null&&S.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:F,priority:0})}}static importJSON(S){let Y=W();return Y.setChecked(S.checked),Y.setValue(S.value),Y.setFormat(S.format),Y.setDirection(S.direction),Y}exportDOM(S){return S=this.createDOM(S._config),S.style.textAlign=this.getFormatType(),{element:S}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...S){for(let Y=0;Y<S.length;Y++){let ie=S[Y];if(e.$isElementNode(ie)&&this.canMergeWith(ie)){let K=ie.getChildren();this.append(...K),ie.remove()}else super.append(ie)}return this}replace(S,Y){if(G(S))return super.replace(S);this.setIndent(0);let ie=this.getParentOrThrow();if(!V(ie))return S;if(ie.__first===this.getKey())ie.insertBefore(S);else if(ie.__last===this.getKey())ie.insertAfter(S);else{let K=B(ie.getListType()),P=this.getNextSibling();for(;P;){let Z=P;P=P.getNextSibling(),K.append(Z)}ie.insertAfter(S),S.insertAfter(K)}if(Y){if(!e.$isElementNode(S))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(K=>{S.append(K)})}return this.remove(),ie.getChildrenSize()===0&&ie.remove(),S}insertAfter(S,Y=!0){var ie=this.getParentOrThrow();V(ie)||n(39);var K=this.getNextSiblings();if(G(S))return Y=super.insertAfter(S,Y),S=S.getParentOrThrow(),V(S)&&z(S),Y;if(V(S)){for(ie=S,S=S.getChildren(),K=S.length-1;0<=K;K--)ie=S[K],this.insertAfter(ie,Y);return ie}if(ie.insertAfter(S,Y),K.length!==0){let P=B(ie.getListType());K.forEach(Z=>P.append(Z)),S.insertAfter(P,Y)}return S}remove(S){let Y=this.getPreviousSibling(),ie=this.getNextSibling();super.remove(S),Y&&ie&&g(Y)&&g(ie)?(k(Y.getFirstChild(),ie.getFirstChild()),ie.remove()):ie&&(S=ie.getParent(),V(S)&&z(S))}insertNewAfter(S,Y=!0){return S=W(this.__checked==null?void 0:!1),this.insertAfter(S,Y),S}collapseAtStart(S){let Y=e.$createParagraphNode();this.getChildren().forEach(Z=>Y.append(Z));var ie=this.getParentOrThrow(),K=ie.getParentOrThrow();let P=G(K);return ie.getChildrenSize()===1?P?(ie.remove(),K.select()):(ie.insertBefore(Y),ie.remove(),ie=S.anchor,S=S.focus,K=Y.getKey(),ie.type==="element"&&ie.getNode().is(this)&&ie.set(K,ie.offset,"element"),S.type==="element"&&S.getNode().is(this)&&S.set(K,S.offset,"element")):(ie.insertBefore(Y),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(S){this.getWritable().__value=S}getChecked(){return this.getLatest().__checked}setChecked(S){this.getWritable().__checked=S}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var S=this.getParent();if(S===null)return this.getLatest().__indent;S=S.getParentOrThrow();let Y=0;for(;G(S);)S=S.getParentOrThrow().getParentOrThrow(),Y++;return Y}setIndent(S){typeof S=="number"&&-1<S||n(117);let Y=this.getIndent();for(;Y!==S;)if(Y<S){e:{var ie=new Set;if(g(this)||ie.has(this.getKey()))break e;let O=this.getParent();var K=this.getNextSibling(),P=this.getPreviousSibling();if(g(K)&&g(P)){if(P=P.getFirstChild(),V(P)){P.append(this);var Z=K.getFirstChild();V(Z)&&(Z=Z.getChildren(),R(P,Z),K.remove(),ie.add(K.getKey())),z(P)}}else g(K)?(K=K.getFirstChild(),V(K)&&(ie=K.getFirstChild(),ie!==null&&ie.insertBefore(this),z(K))):g(P)?(K=P.getFirstChild(),V(K)&&(K.append(this),z(K))):V(O)&&(ie=W(),Z=B(O.getListType()),ie.append(Z),Z.append(this),P?P.insertAfter(ie):K?K.insertBefore(ie):O.append(ie),z(Z));V(O)&&z(O)}Y++}else E(this),Y--;return this}insertBefore(S){if(G(S)){let Y=this.getParentOrThrow();if(V(Y)){let ie=this.getNextSiblings();z(Y,ie)}}return super.insertBefore(S)}canInsertAfter(S){return G(S)}canReplaceWith(S){return G(S)}canMergeWith(S){return e.$isParagraphNode(S)||G(S)}extractWithChild(S,Y){if(!e.$isRangeSelection(Y))return!1;S=Y.anchor.getNode();let ie=Y.focus.getNode();return this.isParentOf(S)&&this.isParentOf(ie)&&this.getTextContent().length===Y.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return B("bullet")}}function U($,S,Y){let ie=[],K=[];var P=(S=S.list)?S.listitem:void 0;if(S&&S.nested)var Z=S.nested.listitem;if(P!==void 0&&(P=P.split(" "),ie.push(...P)),S){P=Y.getParent(),P=V(P)&&P.getListType()==="check";let O=Y.getChecked();P&&!O||K.push(S.listitemUnchecked),P&&O||K.push(S.listitemChecked),P&&ie.push(O?S.listitemChecked:S.listitemUnchecked)}Z!==void 0&&(Z=Z.split(" "),Y.getChildren().some(O=>V(O))?ie.push(...Z):K.push(...Z)),0<K.length&&t.removeClassNamesFromElement($,...K),0<ie.length&&t.addClassNamesToElement($,...ie)}function Q($,S,Y){V(S.getFirstChild())?($.removeAttribute("role"),$.removeAttribute("tabIndex"),$.removeAttribute("aria-checked")):($.setAttribute("role","checkbox"),$.setAttribute("tabIndex","-1"),Y&&S.__checked===Y.__checked||$.setAttribute("aria-checked",S.getChecked()?"true":"false"))}function F($){return $=t.isHTMLElement($)&&$.getAttribute("aria-checked")==="true",{node:W($)}}function W($){return e.$applyNodeReplacement(new x(void 0,$))}function G($){return $ instanceof x}class q extends e.ElementNode{static getType(){return"list"}static clone(S){return new q(S.__listType||j[S.__tag],S.__start,S.__key)}constructor(S,Y,ie){super(ie),this.__listType=S=j[S]||S,this.__tag=S==="number"?"ol":"ul",this.__start=Y}getTag(){return this.__tag}setListType(S){let Y=this.getWritable();Y.__listType=S,Y.__tag=S==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(S){let Y=document.createElement(this.__tag);return this.__start!==1&&Y.setAttribute("start",String(this.__start)),Y.__lexicalListType=this.__listType,le(Y,S.theme,this),Y}updateDOM(S,Y,ie){return S.__tag!==this.__tag?!0:(le(Y,ie.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ge,priority:0}),ul:()=>({conversion:ge,priority:0})}}static importJSON(S){let Y=B(S.listType,S.start);return Y.setFormat(S.format),Y.setIndent(S.indent),Y.setDirection(S.direction),Y}exportDOM(S){return{element:S}=super.exportDOM(S),S&&t.isHTMLElement(S)&&(this.__start!==1&&S.setAttribute("start",String(this.__start)),this.__listType==="check"&&S.setAttribute("__lexicalListType","check")),{element:S}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...S){for(let ie=0;ie<S.length;ie++){var Y=S[ie];if(G(Y))super.append(Y);else{let K=W();V(Y)||e.$isElementNode(Y)&&(Y=e.$createTextNode(Y.getTextContent())),K.append(Y),super.append(K)}}return z(this),this}extractWithChild(S){return G(S)}}function le($,S,Y){let ie=[],K=[];var P=S.list;if(P!==void 0){let O=P[`${Y.__tag}Depth`]||[];S=r(Y)-1;let H=S%O.length;var Z=O[H];let J=P[Y.__tag],de;if(P=P.nested,P!==void 0&&P.list&&(de=P.list),J!==void 0&&ie.push(J),Z!==void 0)for(Z=Z.split(" "),ie.push(...Z),Z=0;Z<O.length;Z++)Z!==H&&K.push(Y.__tag+Z);de!==void 0&&(Y=de.split(" "),1<S?ie.push(...Y):K.push(...Y))}0<K.length&&t.removeClassNamesFromElement($,...K),0<ie.length&&t.addClassNamesToElement($,...ie)}function se($){let S=[];for(let ie=0;ie<$.length;ie++){var Y=$[ie];G(Y)?(S.push(Y),Y=Y.getChildren(),1<Y.length&&Y.forEach(K=>{V(K)&&S.push(N(K))})):S.push(N(Y))}return S}function ge($){let S=$.nodeName.toLowerCase(),Y=null;return S==="ol"?Y=B("number",$.start):S==="ul"&&(Y=t.isHTMLElement($)&&$.getAttribute("__lexicallisttype")==="check"?B("check"):B("bullet")),{after:se,node:Y}}let j={ol:"number",ul:"bullet"};function B($,S=1){return e.$applyNodeReplacement(new q($,S))}function V($){return $ instanceof q}let xe=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),we=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),ue=e.createCommand("REMOVE_LIST_COMMAND");return hr.$createListItemNode=W,hr.$createListNode=B,hr.$getListDepth=r,hr.$handleListInsertParagraph=function(){var $=e.$getSelection();if(!e.$isRangeSelection($)||!$.isCollapsed()||($=$.anchor.getNode(),!G($)||$.getChildrenSize()!==0))return!1;var S=c($),Y=$.getParent();V(Y)||n(40);let ie=Y.getParent(),K;if(e.$isRootOrShadowRoot(ie))K=e.$createParagraphNode(),S.insertAfter(K);else if(G(ie))K=W(),ie.insertAfter(K);else return!1;if(K.select(),S=$.getNextSiblings(),0<S.length){let P=B(Y.getListType());e.$isParagraphNode(K)?K.insertAfter(P):(Y=W(),Y.append(P),K.insertAfter(Y)),S.forEach(Z=>{Z.remove(),P.append(Z)})}return m($),!0},hr.$isListItemNode=G,hr.$isListNode=V,hr.INSERT_CHECK_LIST_COMMAND=Ee,hr.INSERT_ORDERED_LIST_COMMAND=we,hr.INSERT_UNORDERED_LIST_COMMAND=xe,hr.ListItemNode=x,hr.ListNode=q,hr.REMOVE_LIST_COMMAND=ue,hr.insertList=function($,S){$.update(()=>{var Y=e.$getSelection();if(e.$INTERNAL_isPointSelection(Y)){var ie=Y.getNodes();Y=Y.anchor.getNode();var K=Y.getParent();if(T(Y,ie))ie=B(S),e.$isRootOrShadowRoot(K)?(Y.replace(ie),K=W(),e.$isElementNode(Y)&&(K.setFormat(Y.getFormatType()),K.setIndent(Y.getIndent())),ie.append(K)):G(Y)&&(Y=Y.getParentOrThrow(),R(ie,Y.getChildren()),Y.replace(ie));else for(Y=new Set,K=0;K<ie.length;K++){var P=ie[K];if(e.$isElementNode(P)&&P.isEmpty()&&!G(P)&&!Y.has(P.getKey()))b(P,S);else if(e.$isLeafNode(P))for(P=P.getParent();P!=null;){let O=P.getKey();if(V(P)){if(!Y.has(O)){var Z=B(S);R(Z,P.getChildren()),P.replace(Z),z(Z),Y.add(O)}break}else{if(Z=P.getParent(),e.$isRootOrShadowRoot(Z)&&!Y.has(O)){Y.add(O),b(P,S);break}P=Z}}}}})},hr.removeList=function($){$.update(()=>{let S=e.$getSelection();if(e.$isRangeSelection(S)){var Y=new Set,ie=S.getNodes(),K=S.anchor.getNode();if(T(K,ie))Y.add(c(K));else for(K=0;K<ie.length;K++){var P=ie[K];e.$isLeafNode(P)&&(P=t.$getNearestNodeOfType(P,x),P!=null&&Y.add(c(P)))}for(let Z of Y){Y=Z,ie=d(Z);for(let O of ie)ie=e.$createParagraphNode(),R(ie,O.getChildren()),Y.insertAfter(ie),Y=ie,O.__key===S.anchor.key&&S.anchor.set(ie.getKey(),0,"element"),O.__key===S.focus.key&&S.focus.set(ie.getKey(),0,"element"),O.remove();Z.remove()}}})},hr}const rN=process.env.NODE_ENV==="development"?tN():nN();var Cf=rN,Ln={},Qc={exports:{}},Ef;function Sg(){return Ef||(Ef=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
77
77
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
78
78
|
*
|
|
79
79
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
@@ -81,31 +81,31 @@ caused by: ${wi.fullStack(n)}`:t.stack??""}static info(t){Gc(t);const n={},r=wi.
|
|
|
81
81
|
* @namespace
|
|
82
82
|
* @public
|
|
83
83
|
*/var n=function(r){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,g={},m={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function F(W){return W instanceof N?new N(W.type,F(W.content),W.alias):Array.isArray(W)?W.map(F):W.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(F){return Object.prototype.toString.call(F).slice(8,-1)},objId:function(F){return F.__id||Object.defineProperty(F,"__id",{value:++d}),F.__id},clone:function F(W,G){G=G||{};var q,le;switch(m.util.type(W)){case"Object":if(le=m.util.objId(W),G[le])return G[le];q={},G[le]=q;for(var se in W)W.hasOwnProperty(se)&&(q[se]=F(W[se],G));return q;case"Array":return le=m.util.objId(W),G[le]?G[le]:(q=[],G[le]=q,W.forEach(function(ge,j){q[j]=F(ge,G)}),q);default:return W}},getLanguage:function(F){for(;F;){var W=c.exec(F.className);if(W)return W[1].toLowerCase();F=F.parentElement}return"none"},setLanguage:function(F,W){F.className=F.className.replace(RegExp(c,"gi"),""),F.classList.add("language-"+W)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(q){var F=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(q.stack)||[])[1];if(F){var W=document.getElementsByTagName("script");for(var G in W)if(W[G].src==F)return W[G]}return null}},isActive:function(F,W,G){for(var q="no-"+W;F;){var le=F.classList;if(le.contains(W))return!0;if(le.contains(q))return!1;F=F.parentElement}return!!G}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function(F,W){var G=m.util.clone(m.languages[F]);for(var q in W)G[q]=W[q];return G},insertBefore:function(F,W,G,q){q=q||m.languages;var le=q[F],se={};for(var ge in le)if(le.hasOwnProperty(ge)){if(ge==W)for(var j in G)G.hasOwnProperty(j)&&(se[j]=G[j]);G.hasOwnProperty(ge)||(se[ge]=le[ge])}var B=q[F];return q[F]=se,m.languages.DFS(m.languages,function(V,xe){xe===B&&V!=F&&(this[V]=se)}),se},DFS:function F(W,G,q,le){le=le||{};var se=m.util.objId;for(var ge in W)if(W.hasOwnProperty(ge)){G.call(W,ge,W[ge],q||ge);var j=W[ge],B=m.util.type(j);B==="Object"&&!le[se(j)]?(le[se(j)]=!0,F(j,G,null,le)):B==="Array"&&!le[se(j)]&&(le[se(j)]=!0,F(j,G,ge,le))}}},plugins:{},highlightAll:function(F,W){m.highlightAllUnder(document,F,W)},highlightAllUnder:function(F,W,G){var q={callback:G,container:F,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};m.hooks.run("before-highlightall",q),q.elements=Array.prototype.slice.apply(q.container.querySelectorAll(q.selector)),m.hooks.run("before-all-elements-highlight",q);for(var le=0,se;se=q.elements[le++];)m.highlightElement(se,W===!0,q.callback)},highlightElement:function(F,W,G){var q=m.util.getLanguage(F),le=m.languages[q];m.util.setLanguage(F,q);var se=F.parentElement;se&&se.nodeName.toLowerCase()==="pre"&&m.util.setLanguage(se,q);var ge=F.textContent,j={element:F,language:q,grammar:le,code:ge};function B(xe){j.highlightedCode=xe,m.hooks.run("before-insert",j),j.element.innerHTML=j.highlightedCode,m.hooks.run("after-highlight",j),m.hooks.run("complete",j),G&&G.call(j.element)}if(m.hooks.run("before-sanity-check",j),se=j.element.parentElement,se&&se.nodeName.toLowerCase()==="pre"&&!se.hasAttribute("tabindex")&&se.setAttribute("tabindex","0"),!j.code){m.hooks.run("complete",j),G&&G.call(j.element);return}if(m.hooks.run("before-highlight",j),!j.grammar){B(m.util.encode(j.code));return}if(W&&r.Worker){var V=new Worker(m.filename);V.onmessage=function(xe){B(xe.data)},V.postMessage(JSON.stringify({language:j.language,code:j.code,immediateClose:!0}))}else B(m.highlight(j.code,j.grammar,j.language))},highlight:function(F,W,G){var q={code:F,grammar:W,language:G};if(m.hooks.run("before-tokenize",q),!q.grammar)throw new Error('The language "'+q.language+'" has no grammar.');return q.tokens=m.tokenize(q.code,q.grammar),m.hooks.run("after-tokenize",q),N.stringify(m.util.encode(q.tokens),q.language)},tokenize:function(F,W){var G=W.rest;if(G){for(var q in G)W[q]=G[q];delete W.rest}var le=new b;return k(le,le.head,F),R(F,le,W,le.head,0),E(le)},hooks:{all:{},add:function(F,W){var G=m.hooks.all;G[F]=G[F]||[],G[F].push(W)},run:function(F,W){var G=m.hooks.all[F];if(!(!G||!G.length))for(var q=0,le;le=G[q++];)le(W)}},Token:N};r.Prism=m;function N(F,W,G,q){this.type=F,this.content=W,this.alias=G,this.length=(q||"").length|0}N.stringify=function F(W,G){if(typeof W=="string")return W;if(Array.isArray(W)){var q="";return W.forEach(function(B){q+=F(B,G)}),q}var le={type:W.type,content:F(W.content,G),tag:"span",classes:["token",W.type],attributes:{},language:G},se=W.alias;se&&(Array.isArray(se)?Array.prototype.push.apply(le.classes,se):le.classes.push(se)),m.hooks.run("wrap",le);var ge="";for(var j in le.attributes)ge+=" "+j+'="'+(le.attributes[j]||"").replace(/"/g,""")+'"';return"<"+le.tag+' class="'+le.classes.join(" ")+'"'+ge+">"+le.content+"</"+le.tag+">"};function T(F,W,G,q){F.lastIndex=W;var le=F.exec(G);if(le&&q&&le[1]){var se=le[1].length;le.index+=se,le[0]=le[0].slice(se)}return le}function R(F,W,G,q,le,se){for(var ge in G)if(!(!G.hasOwnProperty(ge)||!G[ge])){var j=G[ge];j=Array.isArray(j)?j:[j];for(var B=0;B<j.length;++B){if(se&&se.cause==ge+","+B)return;var V=j[B],xe=V.inside,we=!!V.lookbehind,Ee=!!V.greedy,ue=V.alias;if(Ee&&!V.pattern.global){var $=V.pattern.toString().match(/[imsuy]*$/)[0];V.pattern=RegExp(V.pattern.source,$+"g")}for(var S=V.pattern||V,Y=q.next,ie=le;Y!==W.tail&&!(se&&ie>=se.reach);ie+=Y.value.length,Y=Y.next){var K=Y.value;if(W.length>F.length)return;if(!(K instanceof N)){var P=1,Z;if(Ee){if(Z=T(S,ie,F,we),!Z||Z.index>=F.length)break;var de=Z.index,O=Z.index+Z[0].length,H=ie;for(H+=Y.value.length;de>=H;)Y=Y.next,H+=Y.value.length;if(H-=Y.value.length,ie=H,Y.value instanceof N)continue;for(var J=Y;J!==W.tail&&(H<O||typeof J.value=="string");J=J.next)P++,H+=J.value.length;P--,K=F.slice(ie,H),Z.index-=ie}else if(Z=T(S,0,K,we),!Z)continue;var de=Z.index,_e=Z[0],I=K.slice(0,de),w=K.slice(de+_e.length),D=ie+K.length;se&&D>se.reach&&(se.reach=D);var re=Y.prev;I&&(re=k(W,re,I),ie+=I.length),z(W,re,P);var ye=new N(ge,xe?m.tokenize(_e,xe):_e,ue,_e);if(Y=k(W,re,ye),w&&k(W,Y,w),P>1){var Ae={cause:ge+","+B,reach:D};R(F,W,G,Y.prev,ie,Ae),se&&Ae.reach>se.reach&&(se.reach=Ae.reach)}}}}}}function b(){var F={value:null,prev:null,next:null},W={value:null,prev:F,next:null};F.next=W,this.head=F,this.tail=W,this.length=0}function k(F,W,G){var q=W.next,le={value:G,prev:W,next:q};return W.next=le,q.prev=le,F.length++,le}function z(F,W,G){for(var q=W.next,le=0;le<G&&q!==F.tail;le++)q=q.next;W.next=q,q.prev=W,F.length-=le}function E(F){for(var W=[],G=F.head.next;G!==F.tail;)W.push(G.value),G=G.next;return W}if(!r.document)return r.addEventListener&&(m.disableWorkerMessageHandler||r.addEventListener("message",function(F){var W=JSON.parse(F.data),G=W.language,q=W.code,le=W.immediateClose;r.postMessage(m.highlight(q,m.languages[G],G)),le&&r.close()},!1)),m;var x=m.util.currentScript();x&&(m.filename=x.src,x.hasAttribute("data-manual")&&(m.manual=!0));function U(){m.manual||m.highlightAll()}if(!m.manual){var Q=document.readyState;Q==="loading"||Q==="interactive"&&x&&x.defer?document.addEventListener("DOMContentLoaded",U):window.requestAnimationFrame?window.requestAnimationFrame(U):window.setTimeout(U,16)}return m}(t);e.exports&&(e.exports=n),typeof Hd<"u"&&(Hd.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(c,d){var g={};g["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},g.cdata=/^<!\[CDATA\[|\]\]>$/i;var m={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};m["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var N={};N[c]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return c}),"i"),lookbehind:!0,greedy:!0,inside:m},n.languages.insertBefore("markup","cdata",N)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,c){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:[c,"language-"+c],inside:n.languages[c]},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 c=/(?:"(?:\\(?:\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+"|"+c.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\\((?:"+c.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+c.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+c.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:c,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…",c=function(x,U){return"✖ Error "+x+" while fetching file: "+U},d="✖ Error: File does not exist or is empty",g={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},m="data-src-status",N="loading",T="loaded",R="failed",b="pre[data-src]:not(["+m+'="'+T+'"]):not(['+m+'="'+N+'"])';function k(x,U,Q){var F=new XMLHttpRequest;F.open("GET",x,!0),F.onreadystatechange=function(){F.readyState==4&&(F.status<400&&F.responseText?U(F.responseText):F.status>=400?Q(c(F.status,F.statusText)):Q(d))},F.send(null)}function z(x){var U=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(x||"");if(U){var Q=Number(U[1]),F=U[2],W=U[3];return F?W?[Q,Number(W)]:[Q,void 0]:[Q,Q]}}n.hooks.add("before-highlightall",function(x){x.selector+=", "+b}),n.hooks.add("before-sanity-check",function(x){var U=x.element;if(U.matches(b)){x.code="",U.setAttribute(m,N);var Q=U.appendChild(document.createElement("CODE"));Q.textContent=r;var F=U.getAttribute("data-src"),W=x.language;if(W==="none"){var G=(/\.(\w+)$/.exec(F)||[,"none"])[1];W=g[G]||G}n.util.setLanguage(Q,W),n.util.setLanguage(U,W);var q=n.plugins.autoloader;q&&q.loadLanguages(W),k(F,function(le){U.setAttribute(m,T);var se=z(U.getAttribute("data-range"));if(se){var ge=le.split(/\r\n?|\n/g),j=se[0],B=se[1]==null?ge.length:se[1];j<0&&(j+=ge.length),j=Math.max(0,Math.min(j-1,ge.length)),B<0&&(B+=ge.length),B=Math.max(0,Math.min(B,ge.length)),le=ge.slice(j,B).join(`
|
|
84
|
-
`),U.hasAttribute("data-start")||U.setAttribute("data-start",String(j+1))}Q.textContent=le,n.highlightElement(Q)},function(le){U.setAttribute(m,R),Q.textContent=le})}}),n.plugins.fileHighlight={highlight:function(U){for(var Q=(U||document).querySelectorAll(b),F=0,W;W=Q[F++];)n.highlightElement(W)}};var E=!1;n.fileHighlight=function(){E||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),E=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(Qc)),Qc.exports}var Tf={},xf;function vg(){return xf||(xf=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:/[{}[\];(),.:]/}),Tf}var Sf={},vf;function wg(){return vf||(vf=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),Sf}var wf={},Of;function Og(){return Of||(Of=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 c={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};c["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:c},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),wf}var Af={},Mf;function Ag(){return Mf||(Mf=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(R){return R=R.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+R+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,c=/\|?__(?:\|__)+\|?(?:(?:\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("^"+c+d+"(?:"+c+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+c+d+")(?:"+c+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+c+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+c+"$"),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(R){["url","bold","italic","strike","code-snippet"].forEach(function(b){R!==b&&(e.languages.markdown[R].inside.content.inside[b]=e.languages.markdown[b])})}),e.hooks.add("after-tokenize",function(R){if(R.language!=="markdown"&&R.language!=="md")return;function b(k){if(!(!k||typeof k=="string"))for(var z=0,E=k.length;z<E;z++){var x=k[z];if(x.type!=="code"){b(x.content);continue}var U=x.content[1],Q=x.content[3];if(U&&Q&&U.type==="code-language"&&Q.type==="code-block"&&typeof U.content=="string"){var F=U.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");F=(/[a-z][\w-]*/i.exec(F)||[""])[0].toLowerCase();var W="language-"+F;Q.alias?typeof Q.alias=="string"?Q.alias=[Q.alias,W]:Q.alias.push(W):Q.alias=[W]}}}b(R.tokens)}),e.hooks.add("wrap",function(R){if(R.type==="code-block"){for(var b="",k=0,z=R.classes.length;k<z;k++){var E=R.classes[k],x=/language-(.+)/.exec(E);if(x){b=x[1];break}}var U=e.languages[b];if(U)R.content=e.highlight(T(R.content),U,b);else if(b&&b!=="none"&&e.plugins.autoloader){var Q="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);R.attributes.id=Q,e.plugins.autoloader.loadLanguages(b,function(){var F=document.getElementById(Q);F&&(F.innerHTML=e.highlight(F.textContent,e.languages[b],b))})}}});var g=RegExp(e.languages.markup.tag.pattern.source,"gi"),m={amp:"&",lt:"<",gt:">",quot:'"'},N=String.fromCodePoint||String.fromCharCode;function T(R){var b=R.replace(g,"");return b=b.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(k,z){if(z=z.toLowerCase(),z[0]==="#"){var E;return z[1]==="x"?E=parseInt(z.slice(2),16):E=Number(z.slice(1)),N(E)}else{var x=m[z];return x||k}}),b}e.languages.md=e.languages.markdown}(Prism)),Af}var Df={},Rf;function Mg(){return Rf||(Rf=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),Df}var bf={},kf;function Dg(){return kf||(kf=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)),bf}var If={},Lf;function Rg(){return Lf||(Lf=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),If}var Pf={},$f;function bg(){return $f||($f=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:/[;[\]()`,.]/}),Pf}var Ff={},Bf;function kg(){return Bf||(Bf=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),Ff}var Hf={},Wf;function Ig(){return Wf||(Wf=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)),Hf}var Kf={},zf;function Lg(){return zf||(zf=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})),Kf}var Uf={},Gf;function Pg(){return Gf||(Gf=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)),Uf}var Yf={},jf;function $g(){return jf||(jf=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)),Yf}var Vf={},qf;function Fg(){return qf||(qf=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)),Vf}var Zf;function rN(){if(Zf)return Ln;Zf=1;var e=Sg();vg(),wg(),Og(),Ag(),Mg(),Dg(),Rg(),bg(),kg(),Ig(),Lg(),Pg(),$g(),Fg();var t=Xn(),n=gn();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function c(ee,te){for(const ce of ee.childNodes){if(t.isHTMLElement(ce)&&ce.tagName===te)return!0;c(ce,te)}return!1}const d="data-highlight-language";class g extends n.ElementNode{static getType(){return"code"}static clone(te){return new g(te.__language,te.__key)}constructor(te,ce){super(ce),this.__language=r(te)}createDOM(te){const ce=document.createElement("code");t.addClassNamesToElement(ce,te.theme.code),ce.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ce.setAttribute(d,be),ce}updateDOM(te,ce,be){const Ne=this.__language,Re=te.__language;return Ne?Ne!==Re&&ce.setAttribute(d,Ne):Re&&ce.removeAttribute(d),!1}exportDOM(){const te=document.createElement("pre");te.setAttribute("spellcheck","false");const ce=this.getLanguage();return ce&&te.setAttribute(d,ce),{element:te}}static importDOM(){return{code:te=>te.textContent!=null&&(/\r?\n/.test(te.textContent)||c(te,"BR"))?{conversion:T,priority:1}:null,div:te=>({conversion:R,priority:1}),pre:te=>({conversion:T,priority:0}),table:te=>Q(te)?{conversion:b,priority:3}:null,td:te=>{const ce=te,be=ce.closest("table");return U(ce)?{conversion:z,priority:3}:be&&Q(be)?{conversion:k,priority:3}:null},tr:te=>{const be=te.closest("table");return be&&Q(be)?{conversion:k,priority:3}:null}}}static importJSON(te){const ce=m(te.language);return ce.setFormat(te.format),ce.setIndent(te.indent),ce.setDirection(te.direction),ce}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(te,ce=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
|
|
84
|
+
`),U.hasAttribute("data-start")||U.setAttribute("data-start",String(j+1))}Q.textContent=le,n.highlightElement(Q)},function(le){U.setAttribute(m,R),Q.textContent=le})}}),n.plugins.fileHighlight={highlight:function(U){for(var Q=(U||document).querySelectorAll(b),F=0,W;W=Q[F++];)n.highlightElement(W)}};var E=!1;n.fileHighlight=function(){E||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),E=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(Qc)),Qc.exports}var Tf={},xf;function vg(){return xf||(xf=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:/[{}[\];(),.:]/}),Tf}var Sf={},vf;function wg(){return vf||(vf=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),Sf}var wf={},Of;function Og(){return Of||(Of=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 c={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};c["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:c},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),wf}var Af={},Mf;function Ag(){return Mf||(Mf=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(R){return R=R.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+R+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,c=/\|?__(?:\|__)+\|?(?:(?:\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("^"+c+d+"(?:"+c+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+c+d+")(?:"+c+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+c+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+c+"$"),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(R){["url","bold","italic","strike","code-snippet"].forEach(function(b){R!==b&&(e.languages.markdown[R].inside.content.inside[b]=e.languages.markdown[b])})}),e.hooks.add("after-tokenize",function(R){if(R.language!=="markdown"&&R.language!=="md")return;function b(k){if(!(!k||typeof k=="string"))for(var z=0,E=k.length;z<E;z++){var x=k[z];if(x.type!=="code"){b(x.content);continue}var U=x.content[1],Q=x.content[3];if(U&&Q&&U.type==="code-language"&&Q.type==="code-block"&&typeof U.content=="string"){var F=U.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");F=(/[a-z][\w-]*/i.exec(F)||[""])[0].toLowerCase();var W="language-"+F;Q.alias?typeof Q.alias=="string"?Q.alias=[Q.alias,W]:Q.alias.push(W):Q.alias=[W]}}}b(R.tokens)}),e.hooks.add("wrap",function(R){if(R.type==="code-block"){for(var b="",k=0,z=R.classes.length;k<z;k++){var E=R.classes[k],x=/language-(.+)/.exec(E);if(x){b=x[1];break}}var U=e.languages[b];if(U)R.content=e.highlight(T(R.content),U,b);else if(b&&b!=="none"&&e.plugins.autoloader){var Q="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);R.attributes.id=Q,e.plugins.autoloader.loadLanguages(b,function(){var F=document.getElementById(Q);F&&(F.innerHTML=e.highlight(F.textContent,e.languages[b],b))})}}});var g=RegExp(e.languages.markup.tag.pattern.source,"gi"),m={amp:"&",lt:"<",gt:">",quot:'"'},N=String.fromCodePoint||String.fromCharCode;function T(R){var b=R.replace(g,"");return b=b.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(k,z){if(z=z.toLowerCase(),z[0]==="#"){var E;return z[1]==="x"?E=parseInt(z.slice(2),16):E=Number(z.slice(1)),N(E)}else{var x=m[z];return x||k}}),b}e.languages.md=e.languages.markdown}(Prism)),Af}var Df={},Rf;function Mg(){return Rf||(Rf=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),Df}var bf={},kf;function Dg(){return kf||(kf=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)),bf}var If={},Lf;function Rg(){return Lf||(Lf=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),If}var Pf={},$f;function bg(){return $f||($f=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:/[;[\]()`,.]/}),Pf}var Ff={},Bf;function kg(){return Bf||(Bf=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),Ff}var Hf={},Wf;function Ig(){return Wf||(Wf=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)),Hf}var Kf={},zf;function Lg(){return zf||(zf=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})),Kf}var Uf={},Gf;function Pg(){return Gf||(Gf=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)),Uf}var Yf={},jf;function $g(){return jf||(jf=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)),Yf}var Vf={},qf;function Fg(){return qf||(qf=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)),Vf}var Zf;function iN(){if(Zf)return Ln;Zf=1;var e=Sg();vg(),wg(),Og(),Ag(),Mg(),Dg(),Rg(),bg(),kg(),Ig(),Lg(),Pg(),$g(),Fg();var t=Xn(),n=gn();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function c(ee,te){for(const ce of ee.childNodes){if(t.isHTMLElement(ce)&&ce.tagName===te)return!0;c(ce,te)}return!1}const d="data-highlight-language";class g extends n.ElementNode{static getType(){return"code"}static clone(te){return new g(te.__language,te.__key)}constructor(te,ce){super(ce),this.__language=r(te)}createDOM(te){const ce=document.createElement("code");t.addClassNamesToElement(ce,te.theme.code),ce.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ce.setAttribute(d,be),ce}updateDOM(te,ce,be){const Ne=this.__language,Re=te.__language;return Ne?Ne!==Re&&ce.setAttribute(d,Ne):Re&&ce.removeAttribute(d),!1}exportDOM(){const te=document.createElement("pre");te.setAttribute("spellcheck","false");const ce=this.getLanguage();return ce&&te.setAttribute(d,ce),{element:te}}static importDOM(){return{code:te=>te.textContent!=null&&(/\r?\n/.test(te.textContent)||c(te,"BR"))?{conversion:T,priority:1}:null,div:te=>({conversion:R,priority:1}),pre:te=>({conversion:T,priority:0}),table:te=>Q(te)?{conversion:b,priority:3}:null,td:te=>{const ce=te,be=ce.closest("table");return U(ce)?{conversion:z,priority:3}:be&&Q(be)?{conversion:k,priority:3}:null},tr:te=>{const be=te.closest("table");return be&&Q(be)?{conversion:k,priority:3}:null}}}static importJSON(te){const ce=m(te.language);return ce.setFormat(te.format),ce.setIndent(te.indent),ce.setDirection(te.direction),ce}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(te,ce=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
|
|
85
85
|
`&&be[Ne-2].getTextContent()===`
|
|
86
86
|
`&&te.isCollapsed()&&te.anchor.key===this.__key&&te.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:Le}=te,qe=(Re.isBefore(Le)?Re:Le).getNode();if(n.$isTextNode(qe)){let Be=we(qe);const ct=[];for(;;)if(n.$isTabNode(Be))ct.push(n.$createTabNode()),Be=Be.getNextSibling();else if(xe(Be)){let Se=0;const Ie=Be.getTextContent(),De=Be.getTextContentSize();for(;Se<De&&Ie[Se]===" ";Se++);if(Se!==0&&ct.push(V(" ".repeat(Se))),Se!==De)break;Be=Be.getNextSibling()}else break;const Mt=qe.splitText(Re.offset)[0],Ut=Re.offset===0?0:1,en=Mt.getIndexWithinParent()+Ut,Oe=qe.getParentOrThrow(),ne=[n.$createLineBreakNode(),...ct];Oe.splice(en,0,ne);const oe=ct[ct.length-1];oe?oe.select():Re.offset===0?Mt.selectPrevious():Mt.getNextSibling().selectNext(0,0)}if(N(qe)){const{offset:Be}=te.anchor;qe.splice(Be,0,[n.$createLineBreakNode()]),qe.select(Be+1,Be+1)}return null}canIndent(){return!1}collapseAtStart(){const te=n.$createParagraphNode();return this.getChildren().forEach(be=>te.append(be)),this.replace(te),!0}setLanguage(te){const ce=this.getWritable();ce.__language=r(te)}getLanguage(){return this.getLatest().__language}}function m(ee){return n.$applyNodeReplacement(new g(ee))}function N(ee){return ee instanceof g}function T(ee){let te;return t.isHTMLElement(ee)&&(te=ee.getAttribute(d)),{node:m(te)}}function R(ee){const te=ee,ce=E(te);return!ce&&!x(te)?{node:null}:{after:be=>{const Ne=ee.parentNode;return Ne!=null&&ee!==Ne.lastChild&&be.push(n.$createLineBreakNode()),be},node:ce?m():null}}function b(){return{node:m()}}function k(){return{node:null}}function z(ee){const te=ee;return{after:ce=>(te.parentNode&&te.parentNode.nextSibling&&ce.push(n.$createLineBreakNode()),ce),node:null}}function E(ee){return ee.style.fontFamily.match("monospace")!==null}function x(ee){let te=ee.parentElement;for(;te!==null;){if(E(te))return!0;te=te.parentElement}return!1}function U(ee){return ee.classList.contains("js-file-line")}function Q(ee){return ee.classList.contains("js-file-line-container")}const F="javascript",W={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"},G={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function q(ee){return G[ee]||ee}function le(ee){const te=q(ee);return W[te]||te}const se=()=>F,ge=()=>Object.keys(e.languages).filter(ee=>typeof e.languages[ee]!="function").sort();class j extends n.TextNode{constructor(te,ce,be){super(te,be),this.__highlightType=ce}static getType(){return"code-highlight"}static clone(te){return new j(te.__text,te.__highlightType||void 0,te.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(te){const ce=super.createDOM(te),be=B(te.theme,this.__highlightType);return t.addClassNamesToElement(ce,be),ce}updateDOM(te,ce,be){const Ne=super.updateDOM(te,ce,be),Re=B(be.theme,te.__highlightType),Le=B(be.theme,this.__highlightType);return Re!==Le&&(Re&&t.removeClassNamesFromElement(ce,Re),Le&&t.addClassNamesToElement(ce,Le)),Ne}static importJSON(te){const ce=V(te.text,te.highlightType);return ce.setFormat(te.format),ce.setDetail(te.detail),ce.setMode(te.mode),ce.setStyle(te.style),ce}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(te){return this}isParentRequired(){return!0}createParentElementNode(){return m()}}function B(ee,te){return te&&ee&&ee.codeHighlight&&ee.codeHighlight[te]}function V(ee,te){return n.$applyNodeReplacement(new j(ee,te))}function xe(ee){return ee instanceof j}function we(ee){let te=ee,ce=ee;for(;xe(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getPreviousSibling();return te}function Ee(ee){let te=ee,ce=ee;for(;xe(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getNextSibling();return te}const ue={defaultLanguage:F,tokenize(ee,te){return e.tokenize(ee,e.languages[te||""]||e.languages[this.defaultLanguage])}};function $(ee,te){let ce=null,be=null,Ne=ee,Re=te,Le=ee.getTextContent();for(;;){if(Re===0){if(Ne=Ne.getPreviousSibling(),Ne===null)break;if(!(xe(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),Le=Ne.getTextContent()}else Re--;const qe=Le[Re];xe(Ne)&&qe!==" "&&(be={node:Ne,offset:Re})}if(be!==null)return be;let Fe=null;if(te<ee.getTextContentSize())xe(ee)&&(Fe=ee.getTextContent()[te]);else{const qe=ee.getNextSibling();xe(qe)&&(Fe=qe.getTextContent()[0])}if(Fe!==null&&Fe!==" ")return ce;{const qe=S(ee,te);return qe!==null?qe:ce}}function S(ee,te){let ce=ee,be=te,Ne=ee.getTextContent(),Re=ee.getTextContentSize();for(;;){if(!xe(ce)||be===Re){if(ce=ce.getNextSibling(),ce===null||n.$isLineBreakNode(ce))return null;xe(ce)&&(be=0,Ne=ce.getTextContent(),Re=ce.getTextContentSize())}if(xe(ce)){if(Ne[be]!==" ")return{node:ce,offset:be};be++}}}function Y(ee){const te=Ee(ee);if(n.$isLineBreakNode(te))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return te}function ie(ee,te,ce){const be=ee.getParent();N(be)?Z(be,te,ce):xe(ee)&&ee.replace(n.$createTextNode(ee.__text))}function K(ee,te){const ce=te.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",Le=1;for(let Fe=0;Fe<Ne;Fe++)n.$isLineBreakNode(be[Fe])&&(Re+=`
|
|
87
87
|
`+ ++Le);ce.setAttribute("data-gutter",Re)}const P=new Set;function Z(ee,te,ce){const be=ee.getKey();P.has(be)||(P.add(be),ee.getLanguage()===void 0&&ee.setLanguage(ce.defaultLanguage),te.update(()=>{H(be,()=>{const Ne=n.$getNodeByKey(be);if(!N(Ne)||!Ne.isAttached())return!1;const Re=Ne.getTextContent(),Le=ce.tokenize(Re,Ne.getLanguage()||ce.defaultLanguage),Fe=O(Le),qe=J(Ne.getChildren(),Fe),{from:Be,to:ct,nodesForReplacement:Mt}=qe;return Be!==ct||Mt.length?(ee.splice(Be,ct-Be,Mt),!0):!1})},{onUpdate:()=>{P.delete(be)},skipTransforms:!0}))}function O(ee,te){const ce=[];for(const be of ee)if(typeof be=="string"){const Ne=be.split(/(\n|\t)/),Re=Ne.length;for(let Le=0;Le<Re;Le++){const Fe=Ne[Le];Fe===`
|
|
88
88
|
`||Fe===`\r
|
|
89
|
-
`?ce.push(n.$createLineBreakNode()):Fe===" "?ce.push(n.$createTabNode()):Fe.length>0&&ce.push(V(Fe,te))}}else{const{content:Ne}=be;typeof Ne=="string"?ce.push(...O([Ne],be.type)):Array.isArray(Ne)&&ce.push(...O(Ne,be.type))}return ce}function H(ee,te){const ce=n.$getNodeByKey(ee);if(!N(ce)||!ce.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){te();return}const Ne=be.anchor,Re=Ne.offset,Le=Ne.type==="element"&&n.$isLineBreakNode(ce.getChildAtIndex(Ne.offset-1));let Fe=0;if(!Le){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((ct,Mt)=>ct+Mt.getTextContentSize(),0)}if(te()){if(Le){Ne.getNode().select(Re,Re);return}ce.getChildren().some(Be=>{const ct=n.$isTextNode(Be);if(ct||n.$isLineBreakNode(Be)){const Mt=Be.getTextContentSize();if(ct&&Mt>=Fe)return Be.select(Fe,Fe),!0;Fe-=Mt}return!1})}}function J(ee,te){let ce=0;for(;ce<ee.length&&de(ee[ce],te[ce]);)ce++;const be=ee.length,Ne=te.length,Re=Math.min(be,Ne)-ce;let Le=0;for(;Le<Re;)if(Le++,!de(ee[be-Le],te[Ne-Le])){Le--;break}const Fe=ce,qe=be-Le,Be=te.slice(ce,Ne-Le);return{from:Fe,nodesForReplacement:Be,to:qe}}function de(ee,te){return xe(ee)&&xe(te)&&ee.__text===te.__text&&ee.__highlightType===te.__highlightType||n.$isTabNode(ee)&&n.$isTabNode(te)||n.$isLineBreakNode(ee)&&n.$isLineBreakNode(te)}function _e(ee){if(!n.$isRangeSelection(ee))return!1;const te=ee.anchor.getNode(),ce=ee.focus.getNode();if(te.is(ce)&&N(te))return!0;const be=te.getParent();return N(be)&&be.is(ce.getParent())}function I(ee){const te=ee.getNodes(),ce=[[]];if(te.length===1&&N(te[0]))return ce;let be=ce[0];for(let Ne=0;Ne<te.length;Ne++){const Re=te[Ne];if(!(xe(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 w(ee){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!_e(te))return null;const ce=ee?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,be=ee?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(I(te).length>1)return ce;const Le=te.getNodes()[0];if(!(N(Le)||xe(Le)||n.$isTabNode(Le)||n.$isLineBreakNode(Le)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(N(Le))return ce;const Fe=we(Le),qe=Ee(Le),Be=te.anchor,ct=te.focus;let Mt,Ut;return ct.isBefore(Be)?(Mt=ct,Ut=Be):(Mt=Be,Ut=ct),Fe!==null&&qe!==null&&Mt.key===Fe.getKey()&&Mt.offset===0&&Ut.key===qe.getKey()&&Ut.offset===qe.getTextContentSize()?ce:be}function D(ee){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!_e(te))return!1;const ce=I(te),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=we(Be)),Be!==null&&(ee===n.INDENT_CONTENT_COMMAND?Be.insertBefore(n.$createTabNode()):n.$isTabNode(Be)&&Be.remove())}}return!0}const Re=te.getNodes()[0];if(!(N(Re)||xe(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(N(Re))return ee===n.INDENT_CONTENT_COMMAND&&te.insertNodes([n.$createTabNode()]),!0;const Le=we(Re);if(Le===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return ee===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(Le)?Le.insertAfter(n.$createTabNode()):Le.insertBefore(n.$createTabNode()):n.$isTabNode(Le)&&Le.remove(),!0}function re(ee,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.offset,Le=Ne.offset,Fe=be.getNode(),qe=Ne.getNode(),Be=ee===n.KEY_ARROW_UP_COMMAND;if(!_e(ce)||!(xe(Fe)||n.$isTabNode(Fe))||!(xe(qe)||n.$isTabNode(qe)))return!1;if(!te.altKey){if(ce.isCollapsed()){const Se=Fe.getParentOrThrow();if(Be&&Re===0&&Fe.getPreviousSibling()===null){if(Se.getPreviousSibling()===null)return Se.selectPrevious(),te.preventDefault(),!0}else if(!Be&&Re===Fe.getTextContentSize()&&Fe.getNextSibling()===null&&Se.getNextSibling()===null)return Se.selectNext(),te.preventDefault(),!0}return!1}let ct,Mt;if(Fe.isBefore(qe)?(ct=we(Fe),Mt=Ee(qe)):(ct=we(qe),Mt=Ee(Fe)),ct==null||Mt==null)return!1;const Ut=ct.getNodesBetween(Mt);for(let Se=0;Se<Ut.length;Se++){const Ie=Ut[Se];if(!xe(Ie)&&!n.$isTabNode(Ie)&&!n.$isLineBreakNode(Ie))return!1}te.preventDefault(),te.stopPropagation();const en=Be?ct.getPreviousSibling():Mt.getNextSibling();if(!n.$isLineBreakNode(en))return!0;const Oe=Be?en.getPreviousSibling():en.getNextSibling();if(Oe==null)return!0;const ne=xe(Oe)||n.$isTabNode(Oe)||n.$isLineBreakNode(Oe)?Be?we(Oe):Ee(Oe):null;let oe=ne??Oe;return en.remove(),Ut.forEach(Se=>Se.remove()),ee===n.KEY_ARROW_UP_COMMAND?(Ut.forEach(Se=>oe.insertBefore(Se)),oe.insertBefore(en)):(oe.insertAfter(en),oe=en,Ut.forEach(Se=>{oe.insertAfter(Se),oe=Se})),ce.setTextNodeRange(Fe,Re,qe,Le),!0}function ye(ee,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.getNode(),Le=Ne.getNode(),Fe=ee===n.MOVE_TO_START;if(!(xe(Re)||n.$isTabNode(Re))||!(xe(Le)||n.$isTabNode(Le)))return!1;if(Fe){const qe=$(Le,Ne.offset);if(qe!==null){const{node:Be,offset:ct}=qe;n.$isLineBreakNode(Be)?Be.selectNext(0,0):ce.setTextNodeRange(Be,ct,Be,ct)}else Le.getParentOrThrow().selectStart()}else Y(Le).select();return te.preventDefault(),te.stopPropagation(),!0}function Ae(ee,te){if(!ee.hasNodes([g,j]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return te==null&&(te=ue),t.mergeRegister(ee.registerMutationListener(g,ce=>{ee.update(()=>{for(const[be,Ne]of ce)if(Ne!=="destroyed"){const Re=n.$getNodeByKey(be);Re!==null&&K(Re,ee)}})}),ee.registerNodeTransform(g,ce=>Z(ce,ee,te)),ee.registerNodeTransform(n.TextNode,ce=>ie(ce,ee,te)),ee.registerNodeTransform(j,ce=>ie(ce,ee,te)),ee.registerCommand(n.KEY_TAB_COMMAND,ce=>{const be=w(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=>D(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>D(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>re(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>re(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 Ln.$createCodeHighlightNode=V,Ln.$createCodeNode=m,Ln.$isCodeHighlightNode=xe,Ln.$isCodeNode=N,Ln.CODE_LANGUAGE_FRIENDLY_NAME_MAP=W,Ln.CODE_LANGUAGE_MAP=G,Ln.CodeHighlightNode=j,Ln.CodeNode=g,Ln.DEFAULT_CODE_LANGUAGE=F,Ln.PrismTokenizer=ue,Ln.getCodeLanguages=ge,Ln.getDefaultCodeLanguage=se,Ln.getEndOfCodeInLine=Y,Ln.getFirstCodeNodeOfLine=we,Ln.getLanguageFriendlyName=le,Ln.getLastCodeNodeOfLine=Ee,Ln.getStartOfCodeInLine=$,Ln.normalizeCodeLang=q,Ln.registerCodeHighlighting=Ae,Ln}var Pn={},Jf;function
|
|
89
|
+
`?ce.push(n.$createLineBreakNode()):Fe===" "?ce.push(n.$createTabNode()):Fe.length>0&&ce.push(V(Fe,te))}}else{const{content:Ne}=be;typeof Ne=="string"?ce.push(...O([Ne],be.type)):Array.isArray(Ne)&&ce.push(...O(Ne,be.type))}return ce}function H(ee,te){const ce=n.$getNodeByKey(ee);if(!N(ce)||!ce.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){te();return}const Ne=be.anchor,Re=Ne.offset,Le=Ne.type==="element"&&n.$isLineBreakNode(ce.getChildAtIndex(Ne.offset-1));let Fe=0;if(!Le){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((ct,Mt)=>ct+Mt.getTextContentSize(),0)}if(te()){if(Le){Ne.getNode().select(Re,Re);return}ce.getChildren().some(Be=>{const ct=n.$isTextNode(Be);if(ct||n.$isLineBreakNode(Be)){const Mt=Be.getTextContentSize();if(ct&&Mt>=Fe)return Be.select(Fe,Fe),!0;Fe-=Mt}return!1})}}function J(ee,te){let ce=0;for(;ce<ee.length&&de(ee[ce],te[ce]);)ce++;const be=ee.length,Ne=te.length,Re=Math.min(be,Ne)-ce;let Le=0;for(;Le<Re;)if(Le++,!de(ee[be-Le],te[Ne-Le])){Le--;break}const Fe=ce,qe=be-Le,Be=te.slice(ce,Ne-Le);return{from:Fe,nodesForReplacement:Be,to:qe}}function de(ee,te){return xe(ee)&&xe(te)&&ee.__text===te.__text&&ee.__highlightType===te.__highlightType||n.$isTabNode(ee)&&n.$isTabNode(te)||n.$isLineBreakNode(ee)&&n.$isLineBreakNode(te)}function _e(ee){if(!n.$isRangeSelection(ee))return!1;const te=ee.anchor.getNode(),ce=ee.focus.getNode();if(te.is(ce)&&N(te))return!0;const be=te.getParent();return N(be)&&be.is(ce.getParent())}function I(ee){const te=ee.getNodes(),ce=[[]];if(te.length===1&&N(te[0]))return ce;let be=ce[0];for(let Ne=0;Ne<te.length;Ne++){const Re=te[Ne];if(!(xe(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 w(ee){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!_e(te))return null;const ce=ee?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,be=ee?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(I(te).length>1)return ce;const Le=te.getNodes()[0];if(!(N(Le)||xe(Le)||n.$isTabNode(Le)||n.$isLineBreakNode(Le)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(N(Le))return ce;const Fe=we(Le),qe=Ee(Le),Be=te.anchor,ct=te.focus;let Mt,Ut;return ct.isBefore(Be)?(Mt=ct,Ut=Be):(Mt=Be,Ut=ct),Fe!==null&&qe!==null&&Mt.key===Fe.getKey()&&Mt.offset===0&&Ut.key===qe.getKey()&&Ut.offset===qe.getTextContentSize()?ce:be}function D(ee){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!_e(te))return!1;const ce=I(te),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=we(Be)),Be!==null&&(ee===n.INDENT_CONTENT_COMMAND?Be.insertBefore(n.$createTabNode()):n.$isTabNode(Be)&&Be.remove())}}return!0}const Re=te.getNodes()[0];if(!(N(Re)||xe(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(N(Re))return ee===n.INDENT_CONTENT_COMMAND&&te.insertNodes([n.$createTabNode()]),!0;const Le=we(Re);if(Le===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return ee===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(Le)?Le.insertAfter(n.$createTabNode()):Le.insertBefore(n.$createTabNode()):n.$isTabNode(Le)&&Le.remove(),!0}function re(ee,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.offset,Le=Ne.offset,Fe=be.getNode(),qe=Ne.getNode(),Be=ee===n.KEY_ARROW_UP_COMMAND;if(!_e(ce)||!(xe(Fe)||n.$isTabNode(Fe))||!(xe(qe)||n.$isTabNode(qe)))return!1;if(!te.altKey){if(ce.isCollapsed()){const Se=Fe.getParentOrThrow();if(Be&&Re===0&&Fe.getPreviousSibling()===null){if(Se.getPreviousSibling()===null)return Se.selectPrevious(),te.preventDefault(),!0}else if(!Be&&Re===Fe.getTextContentSize()&&Fe.getNextSibling()===null&&Se.getNextSibling()===null)return Se.selectNext(),te.preventDefault(),!0}return!1}let ct,Mt;if(Fe.isBefore(qe)?(ct=we(Fe),Mt=Ee(qe)):(ct=we(qe),Mt=Ee(Fe)),ct==null||Mt==null)return!1;const Ut=ct.getNodesBetween(Mt);for(let Se=0;Se<Ut.length;Se++){const Ie=Ut[Se];if(!xe(Ie)&&!n.$isTabNode(Ie)&&!n.$isLineBreakNode(Ie))return!1}te.preventDefault(),te.stopPropagation();const en=Be?ct.getPreviousSibling():Mt.getNextSibling();if(!n.$isLineBreakNode(en))return!0;const Oe=Be?en.getPreviousSibling():en.getNextSibling();if(Oe==null)return!0;const ne=xe(Oe)||n.$isTabNode(Oe)||n.$isLineBreakNode(Oe)?Be?we(Oe):Ee(Oe):null;let oe=ne??Oe;return en.remove(),Ut.forEach(Se=>Se.remove()),ee===n.KEY_ARROW_UP_COMMAND?(Ut.forEach(Se=>oe.insertBefore(Se)),oe.insertBefore(en)):(oe.insertAfter(en),oe=en,Ut.forEach(Se=>{oe.insertAfter(Se),oe=Se})),ce.setTextNodeRange(Fe,Re,qe,Le),!0}function ye(ee,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.getNode(),Le=Ne.getNode(),Fe=ee===n.MOVE_TO_START;if(!(xe(Re)||n.$isTabNode(Re))||!(xe(Le)||n.$isTabNode(Le)))return!1;if(Fe){const qe=$(Le,Ne.offset);if(qe!==null){const{node:Be,offset:ct}=qe;n.$isLineBreakNode(Be)?Be.selectNext(0,0):ce.setTextNodeRange(Be,ct,Be,ct)}else Le.getParentOrThrow().selectStart()}else Y(Le).select();return te.preventDefault(),te.stopPropagation(),!0}function Ae(ee,te){if(!ee.hasNodes([g,j]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return te==null&&(te=ue),t.mergeRegister(ee.registerMutationListener(g,ce=>{ee.update(()=>{for(const[be,Ne]of ce)if(Ne!=="destroyed"){const Re=n.$getNodeByKey(be);Re!==null&&K(Re,ee)}})}),ee.registerNodeTransform(g,ce=>Z(ce,ee,te)),ee.registerNodeTransform(n.TextNode,ce=>ie(ce,ee,te)),ee.registerNodeTransform(j,ce=>ie(ce,ee,te)),ee.registerCommand(n.KEY_TAB_COMMAND,ce=>{const be=w(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=>D(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>D(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>re(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>re(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 Ln.$createCodeHighlightNode=V,Ln.$createCodeNode=m,Ln.$isCodeHighlightNode=xe,Ln.$isCodeNode=N,Ln.CODE_LANGUAGE_FRIENDLY_NAME_MAP=W,Ln.CODE_LANGUAGE_MAP=G,Ln.CodeHighlightNode=j,Ln.CodeNode=g,Ln.DEFAULT_CODE_LANGUAGE=F,Ln.PrismTokenizer=ue,Ln.getCodeLanguages=ge,Ln.getDefaultCodeLanguage=se,Ln.getEndOfCodeInLine=Y,Ln.getFirstCodeNodeOfLine=we,Ln.getLanguageFriendlyName=le,Ln.getLastCodeNodeOfLine=Ee,Ln.getStartOfCodeInLine=$,Ln.normalizeCodeLang=q,Ln.registerCodeHighlighting=Ae,Ln}var Pn={},Jf;function sN(){if(Jf)return Pn;Jf=1;var e=Sg();vg(),wg(),Og(),Ag(),Mg(),Dg(),Rg(),bg(),kg(),Ig(),Lg(),Pg(),$g(),Fg();var t=Xn(),n=gn();let r=O=>O!=null&&e.languages.hasOwnProperty(O)?O:void 0;function c(O,H){for(let J of O.childNodes){if(t.isHTMLElement(J)&&J.tagName===H)return!0;c(J,H)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(H){return new d(H.__language,H.__key)}constructor(H,J){super(J),this.__language=r(H)}createDOM(H){let J=document.createElement("code");return t.addClassNamesToElement(J,H.theme.code),J.setAttribute("spellcheck","false"),(H=this.getLanguage())&&J.setAttribute("data-highlight-language",H),J}updateDOM(H,J){let de=this.__language;return H=H.__language,de?de!==H&&J.setAttribute("data-highlight-language",de):H&&J.removeAttribute("data-highlight-language"),!1}exportDOM(){let H=document.createElement("pre");H.setAttribute("spellcheck","false");let J=this.getLanguage();return J&&H.setAttribute("data-highlight-language",J),{element:H}}static importDOM(){return{code:H=>H.textContent!=null&&(/\r?\n/.test(H.textContent)||c(H,"BR"))?{conversion:N,priority:1}:null,div:()=>({conversion:T,priority:1}),pre:()=>({conversion:N,priority:0}),table:H=>E(H)?{conversion:R,priority:3}:null,td:H=>{let J=H.closest("table");return H.classList.contains("js-file-line")?{conversion:k,priority:3}:J&&E(J)?{conversion:b,priority:3}:null},tr:H=>(H=H.closest("table"))&&E(H)?{conversion:b,priority:3}:null}}static importJSON(H){let J=g(H.language);return J.setFormat(H.format),J.setIndent(H.indent),J.setDirection(H.direction),J}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(H,J=!0){var de=this.getChildren(),_e=de.length;if(2<=_e&&de[_e-1].getTextContent()===`
|
|
90
90
|
`&&de[_e-2].getTextContent()===`
|
|
91
91
|
`&&H.isCollapsed()&&H.anchor.key===this.__key&&H.anchor.offset===_e)return de[_e-1].remove(),de[_e-2].remove(),H=n.$createParagraphNode(),this.insertAfter(H,J),H;let{anchor:I,focus:w}=H;if(J=(I.isBefore(w)?I:w).getNode(),n.$isTextNode(J)){for(_e=le(J),de=[];;)if(n.$isTabNode(_e))de.push(n.$createTabNode()),_e=_e.getNextSibling();else if(q(_e)){for(var D=0,re=_e.getTextContent(),ye=_e.getTextContentSize();D<ye&&re[D]===" ";D++);if(D!==0&&de.push(G(" ".repeat(D))),D!==ye)break;_e=_e.getNextSibling()}else break;_e=J.splitText(I.offset)[0],D=I.offset===0?0:1,D=_e.getIndexWithinParent()+D,re=J.getParentOrThrow(),ye=[n.$createLineBreakNode(),...de],re.splice(D,0,ye),(de=de[de.length-1])?de.select():I.offset===0?_e.selectPrevious():_e.getNextSibling().selectNext(0,0)}return m(J)&&({offset:H}=H.anchor,J.splice(H,0,[n.$createLineBreakNode()]),J.select(H+1,H+1)),null}canIndent(){return!1}collapseAtStart(){let H=n.$createParagraphNode();return this.getChildren().forEach(J=>H.append(J)),this.replace(H),!0}setLanguage(H){this.getWritable().__language=r(H)}getLanguage(){return this.getLatest().__language}}function g(O){return n.$applyNodeReplacement(new d(O))}function m(O){return O instanceof d}function N(O){let H;return t.isHTMLElement(O)&&(H=O.getAttribute("data-highlight-language")),{node:g(H)}}function T(O){let H=O.style.fontFamily.match("monospace")!==null;return H||z(O)?{after:J=>{let de=O.parentNode;return de!=null&&O!==de.lastChild&&J.push(n.$createLineBreakNode()),J},node:H?g():null}:{node:null}}function R(){return{node:g()}}function b(){return{node:null}}function k(O){return{after:H=>(O.parentNode&&O.parentNode.nextSibling&&H.push(n.$createLineBreakNode()),H),node:null}}function z(O){for(O=O.parentElement;O!==null;){if(O.style.fontFamily.match("monospace")!==null)return!0;O=O.parentElement}return!1}function E(O){return O.classList.contains("js-file-line-container")}let x={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"},U={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Q(O){return U[O]||O}class F extends n.TextNode{constructor(H,J,de){super(H,de),this.__highlightType=J}static getType(){return"code-highlight"}static clone(H){return new F(H.__text,H.__highlightType||void 0,H.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(H){let J=super.createDOM(H);return H=W(H.theme,this.__highlightType),t.addClassNamesToElement(J,H),J}updateDOM(H,J,de){let _e=super.updateDOM(H,J,de);return H=W(de.theme,H.__highlightType),de=W(de.theme,this.__highlightType),H!==de&&(H&&t.removeClassNamesFromElement(J,H),de&&t.addClassNamesToElement(J,de)),_e}static importJSON(H){let J=G(H.text,H.highlightType);return J.setFormat(H.format),J.setDetail(H.detail),J.setMode(H.mode),J.setStyle(H.style),J}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return g()}}function W(O,H){return H&&O&&O.codeHighlight&&O.codeHighlight[H]}function G(O,H){return n.$applyNodeReplacement(new F(O,H))}function q(O){return O instanceof F}function le(O){let H=O;for(;q(O)||n.$isTabNode(O);)H=O,O=O.getPreviousSibling();return H}function se(O){let H=O;for(;q(O)||n.$isTabNode(O);)H=O,O=O.getNextSibling();return H}let ge={defaultLanguage:"javascript",tokenize(O,H){return e.tokenize(O,e.languages[H||""]||e.languages[this.defaultLanguage])}};function j(O,H){let J=null;var de=null,_e=O;let I=H,w=O.getTextContent();for(;;){if(I===0){if(_e=_e.getPreviousSibling(),_e===null)break;if(!(q(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(_e)){J={node:_e,offset:1};break}I=Math.max(0,_e.getTextContentSize()-1),w=_e.getTextContent()}else I--;let D=w[I];q(_e)&&D!==" "&&(de={node:_e,offset:I})}if(de!==null)return de;if(de=null,H<O.getTextContentSize()?q(O)&&(de=O.getTextContent()[H]):(_e=O.getNextSibling(),q(_e)&&(de=_e.getTextContent()[0])),de!==null&&de!==" ")return J;e:for(de=O,_e=O.getTextContent(),O=O.getTextContentSize();;){if(!q(de)||H===O){if(de=de.getNextSibling(),de===null||n.$isLineBreakNode(de)){O=null;break e}q(de)&&(H=0,_e=de.getTextContent(),O=de.getTextContentSize())}if(q(de)){if(_e[H]!==" "){O={node:de,offset:H};break e}H++}}return O!==null?O:J}function B(O){if(O=se(O),n.$isLineBreakNode(O))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return O}function V(O,H,J){let de=O.getParent();m(de)?we(de,H,J):q(O)&&O.replace(n.$createTextNode(O.__text))}let xe=new Set;function we(O,H,J){let de=O.getKey();xe.has(de)||(xe.add(de),O.getLanguage()===void 0&&O.setLanguage(J.defaultLanguage),H.update(()=>{ue(de,()=>{var _e=n.$getNodeByKey(de);if(!m(_e)||!_e.isAttached())return!1;var I=_e.getTextContent();I=J.tokenize(I,_e.getLanguage()||J.defaultLanguage),I=Ee(I);var w=_e.getChildren();for(_e=0;_e<w.length&&$(w[_e],I[_e]);)_e++;var D=w.length;let re=I.length,ye=Math.min(D,re)-_e,Ae=0;for(;Ae<ye;)if(Ae++,!$(w[D-Ae],I[re-Ae])){Ae--;break}w=_e,D-=Ae,I=I.slice(_e,re-Ae);let{from:ee,to:te,nodesForReplacement:ce}={from:w,nodesForReplacement:I,to:D};return ee!==te||ce.length?(O.splice(ee,te-ee,ce),!0):!1})},{onUpdate:()=>{xe.delete(de)},skipTransforms:!0}))}function Ee(O,H){let J=[];for(let de of O)if(typeof de=="string"){O=de.split(/(\n|\t)/);let _e=O.length;for(let I=0;I<_e;I++){let w=O[I];w===`
|
|
92
92
|
`||w===`\r
|
|
93
93
|
`?J.push(n.$createLineBreakNode()):w===" "?J.push(n.$createTabNode()):0<w.length&&J.push(G(w,H))}}else({content:O}=de),typeof O=="string"?J.push(...Ee([O],de.type)):Array.isArray(O)&&J.push(...Ee(O,de.type));return J}function ue(O,H){if(O=n.$getNodeByKey(O),m(O)&&O.isAttached()){var J=n.$getSelection();if(n.$isRangeSelection(J)){J=J.anchor;var de=J.offset,_e=J.type==="element"&&n.$isLineBreakNode(O.getChildAtIndex(J.offset-1)),I=0;if(!_e){let w=J.getNode();I=de+w.getPreviousSiblings().reduce((D,re)=>D+re.getTextContentSize(),0)}H()&&(_e?J.getNode().select(de,de):O.getChildren().some(w=>{let D=n.$isTextNode(w);if(D||n.$isLineBreakNode(w)){let re=w.getTextContentSize();if(D&&re>=I)return w.select(I,I),!0;I-=re}return!1}))}else H()}}function $(O,H){return q(O)&&q(H)&&O.__text===H.__text&&O.__highlightType===H.__highlightType||n.$isTabNode(O)&&n.$isTabNode(H)||n.$isLineBreakNode(O)&&n.$isLineBreakNode(H)}function S(O){if(!n.$isRangeSelection(O))return!1;var H=O.anchor.getNode();return O=O.focus.getNode(),H.is(O)&&m(H)?!0:(H=H.getParent(),m(H)&&H.is(O.getParent()))}function Y(O){O=O.getNodes();let H=[[]];if(O.length===1&&m(O[0]))return H;let J=H[0];for(let de=0;de<O.length;de++){let _e=O[de];if(!(q(_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)?de!==0&&0<J.length&&(J=[],H.push(J)):J.push(_e)}return H}function ie(O){var H=n.$getSelection();if(!n.$isRangeSelection(H)||!S(H))return null;let J=O?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(O=O?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<Y(H).length)return J;var de=H.getNodes()[0];if(!(m(de)||q(de)||n.$isTabNode(de)||n.$isLineBreakNode(de)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(m(de))return J;let _e=le(de);de=se(de);var I=H.anchor;let w=H.focus;return w.isBefore(I)?H=w:(H=I,I=w),_e!==null&&de!==null&&H.key===_e.getKey()&&H.offset===0&&I.key===de.getKey()&&I.offset===de.getTextContentSize()?J:O}function K(O){var H=n.$getSelection();if(!n.$isRangeSelection(H)||!S(H))return!1;var J=Y(H);let de=J.length;if(1<J.length){for(H=0;H<de;H++){var _e=J[H];0<_e.length&&(_e=_e[0],H===0&&(_e=le(_e)),_e!==null&&(O===n.INDENT_CONTENT_COMMAND?_e.insertBefore(n.$createTabNode()):n.$isTabNode(_e)&&_e.remove()))}return!0}if(J=H.getNodes()[0],!(m(J)||q(J)||n.$isTabNode(J)||n.$isLineBreakNode(J)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(m(J))return O===n.INDENT_CONTENT_COMMAND&&H.insertNodes([n.$createTabNode()]),!0;if(J=le(J),J===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return O===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(J)?J.insertAfter(n.$createTabNode()):J.insertBefore(n.$createTabNode()):n.$isTabNode(J)&&J.remove(),!0}function P(O,H){let J=n.$getSelection();if(!n.$isRangeSelection(J))return!1;let{anchor:de,focus:_e}=J,I=de.offset,w=_e.offset,D=de.getNode(),re=_e.getNode();var ye=O===n.KEY_ARROW_UP_COMMAND;if(!S(J)||!q(D)&&!n.$isTabNode(D)||!q(re)&&!n.$isTabNode(re))return!1;if(!H.altKey){if(J.isCollapsed()){if(O=D.getParentOrThrow(),ye&&I===0&&D.getPreviousSibling()===null){if(O.getPreviousSibling()===null)return O.selectPrevious(),H.preventDefault(),!0}else if(!ye&&I===D.getTextContentSize()&&D.getNextSibling()===null&&O.getNextSibling()===null)return O.selectNext(),H.preventDefault(),!0}return!1}let Ae;if(D.isBefore(re)){var ee=le(D);Ae=se(re)}else ee=le(re),Ae=se(D);if(ee==null||Ae==null)return!1;let te=ee.getNodesBetween(Ae);for(let be=0;be<te.length;be++){let Ne=te[be];if(!q(Ne)&&!n.$isTabNode(Ne)&&!n.$isLineBreakNode(Ne))return!1}if(H.preventDefault(),H.stopPropagation(),H=ye?ee.getPreviousSibling():Ae.getNextSibling(),!n.$isLineBreakNode(H)||(ee=ye?H.getPreviousSibling():H.getNextSibling(),ee==null))return!0;ye=q(ee)||n.$isTabNode(ee)||n.$isLineBreakNode(ee)?ye?le(ee):se(ee):null;let ce=ye??ee;return H.remove(),te.forEach(be=>be.remove()),O===n.KEY_ARROW_UP_COMMAND?(te.forEach(be=>ce.insertBefore(be)),ce.insertBefore(H)):(ce.insertAfter(H),ce=H,te.forEach(be=>{ce.insertAfter(be),ce=be})),J.setTextNodeRange(D,I,re,w),!0}function Z(O,H){let J=n.$getSelection();if(!n.$isRangeSelection(J))return!1;let{anchor:de,focus:_e}=J;var I=de.getNode();let w=_e.getNode();if(O=O===n.MOVE_TO_START,!q(I)&&!n.$isTabNode(I)||!q(w)&&!n.$isTabNode(w))return!1;if(O)if(I=j(w,_e.offset),I!==null){let{node:D,offset:re}=I;n.$isLineBreakNode(D)?D.selectNext(0,0):J.setTextNodeRange(D,re,D,re)}else w.getParentOrThrow().selectStart();else B(w).select();return H.preventDefault(),H.stopPropagation(),!0}return Pn.$createCodeHighlightNode=G,Pn.$createCodeNode=g,Pn.$isCodeHighlightNode=q,Pn.$isCodeNode=m,Pn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=x,Pn.CODE_LANGUAGE_MAP=U,Pn.CodeHighlightNode=F,Pn.CodeNode=d,Pn.DEFAULT_CODE_LANGUAGE="javascript",Pn.PrismTokenizer=ge,Pn.getCodeLanguages=()=>Object.keys(e.languages).filter(O=>typeof e.languages[O]!="function").sort(),Pn.getDefaultCodeLanguage=()=>"javascript",Pn.getEndOfCodeInLine=B,Pn.getFirstCodeNodeOfLine=le,Pn.getLanguageFriendlyName=function(O){return O=Q(O),x[O]||O},Pn.getLastCodeNodeOfLine=se,Pn.getStartOfCodeInLine=j,Pn.normalizeCodeLang=Q,Pn.registerCodeHighlighting=function(O,H){if(!O.hasNodes([d,F]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return H==null&&(H=ge),t.mergeRegister(O.registerMutationListener(d,J=>{O.update(()=>{for(let[I,w]of J)if(w!=="destroyed"){var de=n.$getNodeByKey(I);if(de!==null)e:{var _e=de;if(de=O.getElementByKey(_e.getKey()),de===null)break e;_e=_e.getChildren();let D=_e.length;if(D===de.__cachedChildrenLength)break e;de.__cachedChildrenLength=D;let re="1",ye=1;for(let Ae=0;Ae<D;Ae++)n.$isLineBreakNode(_e[Ae])&&(re+=`
|
|
94
|
-
`+ ++ye);de.setAttribute("data-gutter",re)}}})}),O.registerNodeTransform(d,J=>we(J,O,H)),O.registerNodeTransform(n.TextNode,J=>V(J,O,H)),O.registerNodeTransform(F,J=>V(J,O,H)),O.registerCommand(n.KEY_TAB_COMMAND,J=>{let de=ie(J.shiftKey);return de===null?!1:(J.preventDefault(),O.dispatchCommand(de,void 0),!0)},n.COMMAND_PRIORITY_LOW),O.registerCommand(n.INSERT_TAB_COMMAND,()=>{let J=n.$getSelection();return S(J)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),O.registerCommand(n.INDENT_CONTENT_COMMAND,()=>K(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>K(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.KEY_ARROW_UP_COMMAND,J=>P(n.KEY_ARROW_UP_COMMAND,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.KEY_ARROW_DOWN_COMMAND,J=>P(n.KEY_ARROW_DOWN_COMMAND,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.MOVE_TO_END,J=>Z(n.MOVE_TO_END,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.MOVE_TO_START,J=>Z(n.MOVE_TO_START,J),n.COMMAND_PRIORITY_LOW))},Pn}const sN=process.env.NODE_ENV==="development"?rN():iN();var Xf=sN,Ti={},Qf;function oN(){if(Qf)return Ti;Qf=1;var e=Xn(),t=gn();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(E){return new r(E.__url,{rel:E.__rel,target:E.__target,title:E.__title},E.__key)}constructor(E,x={},U){super(U);const{target:Q=null,rel:F=null,title:W=null}=x;this.__url=E,this.__target=Q,this.__rel=F,this.__title=W}createDOM(E){const x=document.createElement("a");return x.href=this.sanitizeUrl(this.__url),this.__target!==null&&(x.target=this.__target),this.__rel!==null&&(x.rel=this.__rel),this.__title!==null&&(x.title=this.__title),e.addClassNamesToElement(x,E.theme.link),x}updateDOM(E,x,U){const Q=this.__url,F=this.__target,W=this.__rel,G=this.__title;return Q!==E.__url&&(x.href=Q),F!==E.__target&&(F?x.target=F:x.removeAttribute("target")),W!==E.__rel&&(W?x.rel=W:x.removeAttribute("rel")),G!==E.__title&&(G?x.title=G:x.removeAttribute("title")),!1}static importDOM(){return{a:E=>({conversion:c,priority:1})}}static importJSON(E){const x=d(E.url,{rel:E.rel,target:E.target,title:E.title});return x.setFormat(E.format),x.setIndent(E.indent),x.setDirection(E.direction),x}sanitizeUrl(E){try{const x=new URL(E);if(!n.has(x.protocol))return"about:blank"}catch{return E}return E}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(E){const x=this.getWritable();x.__url=E}getTarget(){return this.getLatest().__target}setTarget(E){const x=this.getWritable();x.__target=E}getRel(){return this.getLatest().__rel}setRel(E){const x=this.getWritable();x.__rel=E}getTitle(){return this.getLatest().__title}setTitle(E){const x=this.getWritable();x.__title=E}insertNewAfter(E,x=!0){const U=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(U,x),U}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(E,x,U){if(!t.$isRangeSelection(x))return!1;const Q=x.anchor.getNode(),F=x.focus.getNode();return this.isParentOf(Q)&&this.isParentOf(F)&&x.getTextContent().length>0}}function c(z){let E=null;if(e.isHTMLAnchorElement(z)){const x=z.textContent;(x!==null&&x!==""||z.children.length>0)&&(E=d(z.getAttribute("href")||"",{rel:z.getAttribute("rel"),target:z.getAttribute("target"),title:z.getAttribute("title")}))}return{node:E}}function d(z,E){return t.$applyNodeReplacement(new r(z,E))}function g(z){return z instanceof r}class m extends r{static getType(){return"autolink"}static clone(E){return new m(E.__url,{rel:E.__rel,target:E.__target,title:E.__title},E.__key)}static importJSON(E){const x=N(E.url,{rel:E.rel,target:E.target,title:E.title});return x.setFormat(E.format),x.setIndent(E.indent),x.setDirection(E.direction),x}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(E,x=!0){const U=this.getParentOrThrow().insertNewAfter(E,x);if(t.$isElementNode(U)){const Q=N(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return U.append(Q),Q}return null}}function N(z,E){return t.$applyNodeReplacement(new m(z,E))}function T(z){return z instanceof m}const R=t.createCommand("TOGGLE_LINK_COMMAND");function b(z,E={}){const{target:x,title:U}=E,Q=E.rel===void 0?"noreferrer":E.rel,F=t.$getSelection();if(!t.$isRangeSelection(F))return;const W=F.extract();if(z===null)W.forEach(G=>{const q=G.getParent();if(g(q)){const le=q.getChildren();for(let se=0;se<le.length;se++)q.insertBefore(le[se]);q.remove()}});else{if(W.length===1){const le=W[0],se=k(le,g);if(se!==null){se.setURL(z),x!==void 0&&se.setTarget(x),Q!==null&&se.setRel(Q),U!==void 0&&se.setTitle(U);return}}let G=null,q=null;W.forEach(le=>{const se=le.getParent();if(!(se===q||se===null||t.$isElementNode(le)&&!le.isInline())){if(g(se)){q=se,se.setURL(z),x!==void 0&&se.setTarget(x),Q!==null&&q.setRel(Q),U!==void 0&&q.setTitle(U);return}if(se.is(G)||(G=se,q=d(z,{rel:Q,target:x,title:U}),g(se)?le.getPreviousSibling()===null?se.insertBefore(q):se.insertAfter(q):le.insertBefore(q)),g(le)){if(le.is(q))return;if(q!==null){const ge=le.getChildren();for(let j=0;j<ge.length;j++)q.append(ge[j])}le.remove();return}q!==null&&q.append(le)}})}}function k(z,E){let x=z;for(;x!==null&&x.getParent()!==null&&!E(x);)x=x.getParentOrThrow();return E(x)?x:null}return Ti.$createAutoLinkNode=N,Ti.$createLinkNode=d,Ti.$isAutoLinkNode=T,Ti.$isLinkNode=g,Ti.AutoLinkNode=m,Ti.LinkNode=r,Ti.TOGGLE_LINK_COMMAND=R,Ti.toggleLink=b,Ti}var xi={},eh;function lN(){if(eh)return xi;eh=1;var e=Xn(),t=gn();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(k){return new r(k.__url,{rel:k.__rel,target:k.__target,title:k.__title},k.__key)}constructor(k,z={},E){super(E);let{target:x=null,rel:U=null,title:Q=null}=z;this.__url=k,this.__target=x,this.__rel=U,this.__title=Q}createDOM(k){let z=document.createElement("a");return z.href=this.sanitizeUrl(this.__url),this.__target!==null&&(z.target=this.__target),this.__rel!==null&&(z.rel=this.__rel),this.__title!==null&&(z.title=this.__title),e.addClassNamesToElement(z,k.theme.link),z}updateDOM(k,z){let E=this.__url,x=this.__target,U=this.__rel,Q=this.__title;return E!==k.__url&&(z.href=E),x!==k.__target&&(x?z.target=x:z.removeAttribute("target")),U!==k.__rel&&(U?z.rel=U:z.removeAttribute("rel")),Q!==k.__title&&(Q?z.title=Q:z.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:c,priority:1})}}static importJSON(k){let z=d(k.url,{rel:k.rel,target:k.target,title:k.title});return z.setFormat(k.format),z.setIndent(k.indent),z.setDirection(k.direction),z}sanitizeUrl(k){try{let z=new URL(k);if(!n.has(z.protocol))return"about:blank"}catch{}return k}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(k){this.getWritable().__url=k}getTarget(){return this.getLatest().__target}setTarget(k){this.getWritable().__target=k}getRel(){return this.getLatest().__rel}setRel(k){this.getWritable().__rel=k}getTitle(){return this.getLatest().__title}setTitle(k){this.getWritable().__title=k}insertNewAfter(k,z=!0){return k=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(k,z),k}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(k,z){if(!t.$isRangeSelection(z))return!1;k=z.anchor.getNode();let E=z.focus.getNode();return this.isParentOf(k)&&this.isParentOf(E)&&0<z.getTextContent().length}}function c(b){let k=null;if(e.isHTMLAnchorElement(b)){let z=b.textContent;(z!==null&&z!==""||0<b.children.length)&&(k=d(b.getAttribute("href")||"",{rel:b.getAttribute("rel"),target:b.getAttribute("target"),title:b.getAttribute("title")}))}return{node:k}}function d(b,k){return t.$applyNodeReplacement(new r(b,k))}function g(b){return b instanceof r}class m extends r{static getType(){return"autolink"}static clone(k){return new m(k.__url,{rel:k.__rel,target:k.__target,title:k.__title},k.__key)}static importJSON(k){let z=N(k.url,{rel:k.rel,target:k.target,title:k.title});return z.setFormat(k.format),z.setIndent(k.indent),z.setDirection(k.direction),z}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(k,z=!0){return k=this.getParentOrThrow().insertNewAfter(k,z),t.$isElementNode(k)?(z=N(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),k.append(z),z):null}}function N(b,k){return t.$applyNodeReplacement(new m(b,k))}let T=t.createCommand("TOGGLE_LINK_COMMAND");function R(b,k){for(;b!==null&&b.getParent()!==null&&!k(b);)b=b.getParentOrThrow();return k(b)?b:null}return xi.$createAutoLinkNode=N,xi.$createLinkNode=d,xi.$isAutoLinkNode=function(b){return b instanceof m},xi.$isLinkNode=g,xi.AutoLinkNode=m,xi.LinkNode=r,xi.TOGGLE_LINK_COMMAND=T,xi.toggleLink=function(b,k={}){let{target:z,title:E}=k,x=k.rel===void 0?"noreferrer":k.rel;if(k=t.$getSelection(),t.$isRangeSelection(k))if(k=k.extract(),b===null)k.forEach(U=>{if(U=U.getParent(),g(U)){let Q=U.getChildren();for(let F=0;F<Q.length;F++)U.insertBefore(Q[F]);U.remove()}});else{if(k.length===1){let F=R(k[0],g);if(F!==null){F.setURL(b),z!==void 0&&F.setTarget(z),x!==null&&F.setRel(x),E!==void 0&&F.setTitle(E);return}}let U=null,Q=null;k.forEach(F=>{var W=F.getParent();if(W!==Q&&W!==null&&(!t.$isElementNode(F)||F.isInline()))if(g(W))Q=W,W.setURL(b),z!==void 0&&W.setTarget(z),x!==null&&Q.setRel(x),E!==void 0&&Q.setTitle(E);else if(W.is(U)||(U=W,Q=d(b,{rel:x,target:z,title:E}),g(W)?F.getPreviousSibling()===null?W.insertBefore(Q):W.insertAfter(Q):F.insertBefore(Q)),g(F)){if(!F.is(Q)){if(Q!==null){W=F.getChildren();for(let G=0;G<W.length;G++)Q.append(W[G])}F.remove()}}else Q!==null&&Q.append(F)})}},xi}const aN=process.env.NODE_ENV==="development"?oN():lN();var th=aN,ci={},Si={},Ga={},nh;function cN(){if(nh)return Ga;nh=1;var e=Cs(),t=Xn(),n=gn();function r(T,R){const b=R.body?R.body.childNodes:[];let k=[];for(let z=0;z<b.length;z++){const E=b[z];if(!m.has(E.nodeName)){const x=N(E,T);x!==null&&(k=k.concat(x))}}return k}function c(T,R){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 b=document.createElement("div"),z=n.$getRoot().getChildren();for(let E=0;E<z.length;E++){const x=z[E];d(T,x,b,R)}return b.innerHTML}function d(T,R,b,k=null){let z=k!=null?R.isSelected(k):!0;const E=n.$isElementNode(R)&&R.excludeFromCopy("html");let x=R;if(k!==null){let le=e.$cloneWithProperties(R);le=n.$isTextNode(le)&&k!=null?e.$sliceSelectedTextNodeContent(k,le):le,x=le}const U=n.$isElementNode(x)?x.getChildren():[],Q=T._nodes.get(x.getType());let F;Q&&Q.exportDOM!==void 0?F=Q.exportDOM(T,x):F=x.exportDOM(T);const{element:W,after:G}=F;if(!W)return!1;const q=document.createDocumentFragment();for(let le=0;le<U.length;le++){const se=U[le],ge=d(T,se,q,k);!z&&n.$isElementNode(R)&&ge&&R.extractWithChild(se,k,"html")&&(z=!0)}if(z&&!E){if(t.isHTMLElement(W)&&W.append(q),b.append(W),G){const le=G.call(x,W);le&&W.replaceWith(le)}}else b.append(q);return z}function g(T,R){const{nodeName:b}=T,k=R._htmlConversions.get(b.toLowerCase());let z=null;if(k!==void 0)for(const E of k){const x=E(T);x!==null&&(z===null||(z.priority||0)<(x.priority||0))&&(z=x)}return z!==null?z.conversion:null}const m=new Set(["STYLE","SCRIPT"]);function N(T,R,b=new Map,k){let z=[];if(m.has(T.nodeName))return z;let E=null;const x=g(T,R),U=x?x(T):null;let Q=null;if(U!==null){Q=U.after;const G=U.node;if(E=Array.isArray(G)?G[G.length-1]:G,E!==null){for(const[,q]of b)if(E=q(E,k),!E)break;E&&z.push(...Array.isArray(G)?G:[E])}U.forChild!=null&&b.set(T.nodeName,U.forChild)}const F=T.childNodes;let W=[];for(let G=0;G<F.length;G++)W.push(...N(F[G],R,new Map(b),E));return Q!=null&&(W=Q(W)),E==null?z=z.concat(W):n.$isElementNode(E)&&E.append(...W),z}return Ga.$generateHtmlFromNodes=c,Ga.$generateNodesFromDOM=r,Ga}var Ya={},rh;function uN(){if(rh)return Ya;rh=1;var e=Cs(),t=Xn(),n=gn();function r(g,m,N,T=null){let R=T!=null?m.isSelected(T):!0,b=n.$isElementNode(m)&&m.excludeFromCopy("html");var k=m;T!==null&&(k=e.$cloneWithProperties(m),k=n.$isTextNode(k)&&T!=null?e.$sliceSelectedTextNodeContent(T,k):k);let z=n.$isElementNode(k)?k.getChildren():[];var E=g._nodes.get(k.getType());E=E&&E.exportDOM!==void 0?E.exportDOM(g,k):k.exportDOM(g);let{element:x,after:U}=E;if(!x)return!1;E=document.createDocumentFragment();for(let Q=0;Q<z.length;Q++){let F=z[Q],W=r(g,F,E,T);!R&&n.$isElementNode(m)&&W&&m.extractWithChild(F,T,"html")&&(R=!0)}return R&&!b?(t.isHTMLElement(x)&&x.append(E),N.append(x),U&&(g=U.call(k,x))&&x.replaceWith(g)):N.append(E),R}let c=new Set(["STYLE","SCRIPT"]);function d(g,m,N=new Map,T){let R=[];if(c.has(g.nodeName))return R;let b=null;var k,{nodeName:z}=g,E=m._htmlConversions.get(z.toLowerCase());if(z=null,E!==void 0)for(k of E)E=k(g),E!==null&&(z===null||(z.priority||0)<(E.priority||0))&&(z=E);if(z=(k=z!==null?z.conversion:null)?k(g):null,k=null,z!==null){if(k=z.after,E=z.node,b=Array.isArray(E)?E[E.length-1]:E,b!==null){for(var[,x]of N)if(b=x(b,T),!b)break;b&&R.push(...Array.isArray(E)?E:[b])}z.forChild!=null&&N.set(g.nodeName,z.forChild)}for(g=g.childNodes,T=[],x=0;x<g.length;x++)T.push(...d(g[x],m,new Map(N),b));return k!=null&&(T=k(T)),b==null?R=R.concat(T):n.$isElementNode(b)&&b.append(...T),R}return Ya.$generateHtmlFromNodes=function(g,m){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 N=document.createElement("div"),T=n.$getRoot().getChildren();for(let R=0;R<T.length;R++)r(g,T[R],N,m);return N.innerHTML},Ya.$generateNodesFromDOM=function(g,m){m=m.body?m.body.childNodes:[];let N=[];for(let R=0;R<m.length;R++){var T=m[R];c.has(T.nodeName)||(T=d(T,g),T!==null&&(N=N.concat(T)))}return N},Ya}const dN=process.env.NODE_ENV==="development"?cN():uN();var Zu=dN,ih;function fN(){if(ih)return Si;ih=1;var e=Zu,t=Cs(),n=Xn(),r=gn();const c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=W=>c?(W||window).getSelection():null;function g(W){const G=r.$getSelection();if(G==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(G)&&G.isCollapsed()||G.getNodes().length===0?"":e.$generateHtmlFromNodes(W,G)}function m(W){const G=r.$getSelection();if(G==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(G)&&G.isCollapsed()||G.getNodes().length===0?null:JSON.stringify(z(W,G))}function N(W,G){const q=W.getData("text/plain")||W.getData("text/uri-list");q!=null&&G.insertRawText(q)}function T(W,G,q){const le=W.getData("application/x-lexical-editor");if(le)try{const j=JSON.parse(le);if(j.namespace===q._config.namespace&&Array.isArray(j.nodes)){const B=E(j.nodes);return R(q,B,G)}}catch{}const se=W.getData("text/html");if(se)try{const B=new DOMParser().parseFromString(se,"text/html"),V=e.$generateNodesFromDOM(q,B);return R(q,V,G)}catch{}const ge=W.getData("text/plain")||W.getData("text/uri-list");if(ge!=null)if(r.$isRangeSelection(G)){const j=ge.split(/(\r?\n|\t)/);j[j.length-1]===""&&j.pop();for(let B=0;B<j.length;B++){const V=j[B];V===`
|
|
94
|
+
`+ ++ye);de.setAttribute("data-gutter",re)}}})}),O.registerNodeTransform(d,J=>we(J,O,H)),O.registerNodeTransform(n.TextNode,J=>V(J,O,H)),O.registerNodeTransform(F,J=>V(J,O,H)),O.registerCommand(n.KEY_TAB_COMMAND,J=>{let de=ie(J.shiftKey);return de===null?!1:(J.preventDefault(),O.dispatchCommand(de,void 0),!0)},n.COMMAND_PRIORITY_LOW),O.registerCommand(n.INSERT_TAB_COMMAND,()=>{let J=n.$getSelection();return S(J)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),O.registerCommand(n.INDENT_CONTENT_COMMAND,()=>K(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>K(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.KEY_ARROW_UP_COMMAND,J=>P(n.KEY_ARROW_UP_COMMAND,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.KEY_ARROW_DOWN_COMMAND,J=>P(n.KEY_ARROW_DOWN_COMMAND,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.MOVE_TO_END,J=>Z(n.MOVE_TO_END,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.MOVE_TO_START,J=>Z(n.MOVE_TO_START,J),n.COMMAND_PRIORITY_LOW))},Pn}const oN=process.env.NODE_ENV==="development"?iN():sN();var Xf=oN,xi={},Qf;function lN(){if(Qf)return xi;Qf=1;var e=Xn(),t=gn();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(E){return new r(E.__url,{rel:E.__rel,target:E.__target,title:E.__title},E.__key)}constructor(E,x={},U){super(U);const{target:Q=null,rel:F=null,title:W=null}=x;this.__url=E,this.__target=Q,this.__rel=F,this.__title=W}createDOM(E){const x=document.createElement("a");return x.href=this.sanitizeUrl(this.__url),this.__target!==null&&(x.target=this.__target),this.__rel!==null&&(x.rel=this.__rel),this.__title!==null&&(x.title=this.__title),e.addClassNamesToElement(x,E.theme.link),x}updateDOM(E,x,U){const Q=this.__url,F=this.__target,W=this.__rel,G=this.__title;return Q!==E.__url&&(x.href=Q),F!==E.__target&&(F?x.target=F:x.removeAttribute("target")),W!==E.__rel&&(W?x.rel=W:x.removeAttribute("rel")),G!==E.__title&&(G?x.title=G:x.removeAttribute("title")),!1}static importDOM(){return{a:E=>({conversion:c,priority:1})}}static importJSON(E){const x=d(E.url,{rel:E.rel,target:E.target,title:E.title});return x.setFormat(E.format),x.setIndent(E.indent),x.setDirection(E.direction),x}sanitizeUrl(E){try{const x=new URL(E);if(!n.has(x.protocol))return"about:blank"}catch{return E}return E}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(E){const x=this.getWritable();x.__url=E}getTarget(){return this.getLatest().__target}setTarget(E){const x=this.getWritable();x.__target=E}getRel(){return this.getLatest().__rel}setRel(E){const x=this.getWritable();x.__rel=E}getTitle(){return this.getLatest().__title}setTitle(E){const x=this.getWritable();x.__title=E}insertNewAfter(E,x=!0){const U=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(U,x),U}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(E,x,U){if(!t.$isRangeSelection(x))return!1;const Q=x.anchor.getNode(),F=x.focus.getNode();return this.isParentOf(Q)&&this.isParentOf(F)&&x.getTextContent().length>0}}function c(z){let E=null;if(e.isHTMLAnchorElement(z)){const x=z.textContent;(x!==null&&x!==""||z.children.length>0)&&(E=d(z.getAttribute("href")||"",{rel:z.getAttribute("rel"),target:z.getAttribute("target"),title:z.getAttribute("title")}))}return{node:E}}function d(z,E){return t.$applyNodeReplacement(new r(z,E))}function g(z){return z instanceof r}class m extends r{static getType(){return"autolink"}static clone(E){return new m(E.__url,{rel:E.__rel,target:E.__target,title:E.__title},E.__key)}static importJSON(E){const x=N(E.url,{rel:E.rel,target:E.target,title:E.title});return x.setFormat(E.format),x.setIndent(E.indent),x.setDirection(E.direction),x}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(E,x=!0){const U=this.getParentOrThrow().insertNewAfter(E,x);if(t.$isElementNode(U)){const Q=N(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return U.append(Q),Q}return null}}function N(z,E){return t.$applyNodeReplacement(new m(z,E))}function T(z){return z instanceof m}const R=t.createCommand("TOGGLE_LINK_COMMAND");function b(z,E={}){const{target:x,title:U}=E,Q=E.rel===void 0?"noreferrer":E.rel,F=t.$getSelection();if(!t.$isRangeSelection(F))return;const W=F.extract();if(z===null)W.forEach(G=>{const q=G.getParent();if(g(q)){const le=q.getChildren();for(let se=0;se<le.length;se++)q.insertBefore(le[se]);q.remove()}});else{if(W.length===1){const le=W[0],se=k(le,g);if(se!==null){se.setURL(z),x!==void 0&&se.setTarget(x),Q!==null&&se.setRel(Q),U!==void 0&&se.setTitle(U);return}}let G=null,q=null;W.forEach(le=>{const se=le.getParent();if(!(se===q||se===null||t.$isElementNode(le)&&!le.isInline())){if(g(se)){q=se,se.setURL(z),x!==void 0&&se.setTarget(x),Q!==null&&q.setRel(Q),U!==void 0&&q.setTitle(U);return}if(se.is(G)||(G=se,q=d(z,{rel:Q,target:x,title:U}),g(se)?le.getPreviousSibling()===null?se.insertBefore(q):se.insertAfter(q):le.insertBefore(q)),g(le)){if(le.is(q))return;if(q!==null){const ge=le.getChildren();for(let j=0;j<ge.length;j++)q.append(ge[j])}le.remove();return}q!==null&&q.append(le)}})}}function k(z,E){let x=z;for(;x!==null&&x.getParent()!==null&&!E(x);)x=x.getParentOrThrow();return E(x)?x:null}return xi.$createAutoLinkNode=N,xi.$createLinkNode=d,xi.$isAutoLinkNode=T,xi.$isLinkNode=g,xi.AutoLinkNode=m,xi.LinkNode=r,xi.TOGGLE_LINK_COMMAND=R,xi.toggleLink=b,xi}var Si={},eh;function aN(){if(eh)return Si;eh=1;var e=Xn(),t=gn();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(k){return new r(k.__url,{rel:k.__rel,target:k.__target,title:k.__title},k.__key)}constructor(k,z={},E){super(E);let{target:x=null,rel:U=null,title:Q=null}=z;this.__url=k,this.__target=x,this.__rel=U,this.__title=Q}createDOM(k){let z=document.createElement("a");return z.href=this.sanitizeUrl(this.__url),this.__target!==null&&(z.target=this.__target),this.__rel!==null&&(z.rel=this.__rel),this.__title!==null&&(z.title=this.__title),e.addClassNamesToElement(z,k.theme.link),z}updateDOM(k,z){let E=this.__url,x=this.__target,U=this.__rel,Q=this.__title;return E!==k.__url&&(z.href=E),x!==k.__target&&(x?z.target=x:z.removeAttribute("target")),U!==k.__rel&&(U?z.rel=U:z.removeAttribute("rel")),Q!==k.__title&&(Q?z.title=Q:z.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:c,priority:1})}}static importJSON(k){let z=d(k.url,{rel:k.rel,target:k.target,title:k.title});return z.setFormat(k.format),z.setIndent(k.indent),z.setDirection(k.direction),z}sanitizeUrl(k){try{let z=new URL(k);if(!n.has(z.protocol))return"about:blank"}catch{}return k}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(k){this.getWritable().__url=k}getTarget(){return this.getLatest().__target}setTarget(k){this.getWritable().__target=k}getRel(){return this.getLatest().__rel}setRel(k){this.getWritable().__rel=k}getTitle(){return this.getLatest().__title}setTitle(k){this.getWritable().__title=k}insertNewAfter(k,z=!0){return k=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(k,z),k}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(k,z){if(!t.$isRangeSelection(z))return!1;k=z.anchor.getNode();let E=z.focus.getNode();return this.isParentOf(k)&&this.isParentOf(E)&&0<z.getTextContent().length}}function c(b){let k=null;if(e.isHTMLAnchorElement(b)){let z=b.textContent;(z!==null&&z!==""||0<b.children.length)&&(k=d(b.getAttribute("href")||"",{rel:b.getAttribute("rel"),target:b.getAttribute("target"),title:b.getAttribute("title")}))}return{node:k}}function d(b,k){return t.$applyNodeReplacement(new r(b,k))}function g(b){return b instanceof r}class m extends r{static getType(){return"autolink"}static clone(k){return new m(k.__url,{rel:k.__rel,target:k.__target,title:k.__title},k.__key)}static importJSON(k){let z=N(k.url,{rel:k.rel,target:k.target,title:k.title});return z.setFormat(k.format),z.setIndent(k.indent),z.setDirection(k.direction),z}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(k,z=!0){return k=this.getParentOrThrow().insertNewAfter(k,z),t.$isElementNode(k)?(z=N(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),k.append(z),z):null}}function N(b,k){return t.$applyNodeReplacement(new m(b,k))}let T=t.createCommand("TOGGLE_LINK_COMMAND");function R(b,k){for(;b!==null&&b.getParent()!==null&&!k(b);)b=b.getParentOrThrow();return k(b)?b:null}return Si.$createAutoLinkNode=N,Si.$createLinkNode=d,Si.$isAutoLinkNode=function(b){return b instanceof m},Si.$isLinkNode=g,Si.AutoLinkNode=m,Si.LinkNode=r,Si.TOGGLE_LINK_COMMAND=T,Si.toggleLink=function(b,k={}){let{target:z,title:E}=k,x=k.rel===void 0?"noreferrer":k.rel;if(k=t.$getSelection(),t.$isRangeSelection(k))if(k=k.extract(),b===null)k.forEach(U=>{if(U=U.getParent(),g(U)){let Q=U.getChildren();for(let F=0;F<Q.length;F++)U.insertBefore(Q[F]);U.remove()}});else{if(k.length===1){let F=R(k[0],g);if(F!==null){F.setURL(b),z!==void 0&&F.setTarget(z),x!==null&&F.setRel(x),E!==void 0&&F.setTitle(E);return}}let U=null,Q=null;k.forEach(F=>{var W=F.getParent();if(W!==Q&&W!==null&&(!t.$isElementNode(F)||F.isInline()))if(g(W))Q=W,W.setURL(b),z!==void 0&&W.setTarget(z),x!==null&&Q.setRel(x),E!==void 0&&Q.setTitle(E);else if(W.is(U)||(U=W,Q=d(b,{rel:x,target:z,title:E}),g(W)?F.getPreviousSibling()===null?W.insertBefore(Q):W.insertAfter(Q):F.insertBefore(Q)),g(F)){if(!F.is(Q)){if(Q!==null){W=F.getChildren();for(let G=0;G<W.length;G++)Q.append(W[G])}F.remove()}}else Q!==null&&Q.append(F)})}},Si}const cN=process.env.NODE_ENV==="development"?lN():aN();var th=cN,ui={},vi={},Ga={},nh;function uN(){if(nh)return Ga;nh=1;var e=Es(),t=Xn(),n=gn();function r(T,R){const b=R.body?R.body.childNodes:[];let k=[];for(let z=0;z<b.length;z++){const E=b[z];if(!m.has(E.nodeName)){const x=N(E,T);x!==null&&(k=k.concat(x))}}return k}function c(T,R){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 b=document.createElement("div"),z=n.$getRoot().getChildren();for(let E=0;E<z.length;E++){const x=z[E];d(T,x,b,R)}return b.innerHTML}function d(T,R,b,k=null){let z=k!=null?R.isSelected(k):!0;const E=n.$isElementNode(R)&&R.excludeFromCopy("html");let x=R;if(k!==null){let le=e.$cloneWithProperties(R);le=n.$isTextNode(le)&&k!=null?e.$sliceSelectedTextNodeContent(k,le):le,x=le}const U=n.$isElementNode(x)?x.getChildren():[],Q=T._nodes.get(x.getType());let F;Q&&Q.exportDOM!==void 0?F=Q.exportDOM(T,x):F=x.exportDOM(T);const{element:W,after:G}=F;if(!W)return!1;const q=document.createDocumentFragment();for(let le=0;le<U.length;le++){const se=U[le],ge=d(T,se,q,k);!z&&n.$isElementNode(R)&&ge&&R.extractWithChild(se,k,"html")&&(z=!0)}if(z&&!E){if(t.isHTMLElement(W)&&W.append(q),b.append(W),G){const le=G.call(x,W);le&&W.replaceWith(le)}}else b.append(q);return z}function g(T,R){const{nodeName:b}=T,k=R._htmlConversions.get(b.toLowerCase());let z=null;if(k!==void 0)for(const E of k){const x=E(T);x!==null&&(z===null||(z.priority||0)<(x.priority||0))&&(z=x)}return z!==null?z.conversion:null}const m=new Set(["STYLE","SCRIPT"]);function N(T,R,b=new Map,k){let z=[];if(m.has(T.nodeName))return z;let E=null;const x=g(T,R),U=x?x(T):null;let Q=null;if(U!==null){Q=U.after;const G=U.node;if(E=Array.isArray(G)?G[G.length-1]:G,E!==null){for(const[,q]of b)if(E=q(E,k),!E)break;E&&z.push(...Array.isArray(G)?G:[E])}U.forChild!=null&&b.set(T.nodeName,U.forChild)}const F=T.childNodes;let W=[];for(let G=0;G<F.length;G++)W.push(...N(F[G],R,new Map(b),E));return Q!=null&&(W=Q(W)),E==null?z=z.concat(W):n.$isElementNode(E)&&E.append(...W),z}return Ga.$generateHtmlFromNodes=c,Ga.$generateNodesFromDOM=r,Ga}var Ya={},rh;function dN(){if(rh)return Ya;rh=1;var e=Es(),t=Xn(),n=gn();function r(g,m,N,T=null){let R=T!=null?m.isSelected(T):!0,b=n.$isElementNode(m)&&m.excludeFromCopy("html");var k=m;T!==null&&(k=e.$cloneWithProperties(m),k=n.$isTextNode(k)&&T!=null?e.$sliceSelectedTextNodeContent(T,k):k);let z=n.$isElementNode(k)?k.getChildren():[];var E=g._nodes.get(k.getType());E=E&&E.exportDOM!==void 0?E.exportDOM(g,k):k.exportDOM(g);let{element:x,after:U}=E;if(!x)return!1;E=document.createDocumentFragment();for(let Q=0;Q<z.length;Q++){let F=z[Q],W=r(g,F,E,T);!R&&n.$isElementNode(m)&&W&&m.extractWithChild(F,T,"html")&&(R=!0)}return R&&!b?(t.isHTMLElement(x)&&x.append(E),N.append(x),U&&(g=U.call(k,x))&&x.replaceWith(g)):N.append(E),R}let c=new Set(["STYLE","SCRIPT"]);function d(g,m,N=new Map,T){let R=[];if(c.has(g.nodeName))return R;let b=null;var k,{nodeName:z}=g,E=m._htmlConversions.get(z.toLowerCase());if(z=null,E!==void 0)for(k of E)E=k(g),E!==null&&(z===null||(z.priority||0)<(E.priority||0))&&(z=E);if(z=(k=z!==null?z.conversion:null)?k(g):null,k=null,z!==null){if(k=z.after,E=z.node,b=Array.isArray(E)?E[E.length-1]:E,b!==null){for(var[,x]of N)if(b=x(b,T),!b)break;b&&R.push(...Array.isArray(E)?E:[b])}z.forChild!=null&&N.set(g.nodeName,z.forChild)}for(g=g.childNodes,T=[],x=0;x<g.length;x++)T.push(...d(g[x],m,new Map(N),b));return k!=null&&(T=k(T)),b==null?R=R.concat(T):n.$isElementNode(b)&&b.append(...T),R}return Ya.$generateHtmlFromNodes=function(g,m){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 N=document.createElement("div"),T=n.$getRoot().getChildren();for(let R=0;R<T.length;R++)r(g,T[R],N,m);return N.innerHTML},Ya.$generateNodesFromDOM=function(g,m){m=m.body?m.body.childNodes:[];let N=[];for(let R=0;R<m.length;R++){var T=m[R];c.has(T.nodeName)||(T=d(T,g),T!==null&&(N=N.concat(T)))}return N},Ya}const fN=process.env.NODE_ENV==="development"?uN():dN();var Zu=fN,ih;function hN(){if(ih)return vi;ih=1;var e=Zu,t=Es(),n=Xn(),r=gn();const c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=W=>c?(W||window).getSelection():null;function g(W){const G=r.$getSelection();if(G==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(G)&&G.isCollapsed()||G.getNodes().length===0?"":e.$generateHtmlFromNodes(W,G)}function m(W){const G=r.$getSelection();if(G==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(G)&&G.isCollapsed()||G.getNodes().length===0?null:JSON.stringify(z(W,G))}function N(W,G){const q=W.getData("text/plain")||W.getData("text/uri-list");q!=null&&G.insertRawText(q)}function T(W,G,q){const le=W.getData("application/x-lexical-editor");if(le)try{const j=JSON.parse(le);if(j.namespace===q._config.namespace&&Array.isArray(j.nodes)){const B=E(j.nodes);return R(q,B,G)}}catch{}const se=W.getData("text/html");if(se)try{const B=new DOMParser().parseFromString(se,"text/html"),V=e.$generateNodesFromDOM(q,B);return R(q,V,G)}catch{}const ge=W.getData("text/plain")||W.getData("text/uri-list");if(ge!=null)if(r.$isRangeSelection(G)){const j=ge.split(/(\r?\n|\t)/);j[j.length-1]===""&&j.pop();for(let B=0;B<j.length;B++){const V=j[B];V===`
|
|
95
95
|
`||V===`\r
|
|
96
|
-
`?G.insertParagraph():V===" "?G.insertNodes([r.$createTabNode()]):G.insertText(V)}}else G.insertRawText(ge)}function R(W,G,q){W.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:G,selection:q})||q.insertNodes(G)}function b(W){const G=W.exportJSON(),q=W.constructor;if(G.type!==q.getType())throw Error(`LexicalNode: Node ${q.name} does not implement .exportJSON().`);if(r.$isElementNode(W)){const le=G.children;if(!Array.isArray(le))throw Error(`LexicalNode: Node ${q.name} is an element but .exportJSON() does not have a children array.`)}return G}function k(W,G,q,le=[]){let se=G!=null?q.isSelected(G):!0;const ge=r.$isElementNode(q)&&q.excludeFromCopy("html");let j=q;if(G!==null){let xe=t.$cloneWithProperties(q);xe=r.$isTextNode(xe)&&G!=null?t.$sliceSelectedTextNodeContent(G,xe):xe,j=xe}const B=r.$isElementNode(j)?j.getChildren():[],V=b(j);if(r.$isTextNode(j)){const xe=j.__text;xe.length>0?V.text=xe:se=!1}for(let xe=0;xe<B.length;xe++){const we=B[xe],Ee=k(W,G,we,V.children);!se&&r.$isElementNode(q)&&Ee&&q.extractWithChild(we,G,"clone")&&(se=!0)}if(se&&!ge)le.push(V);else if(Array.isArray(V.children))for(let xe=0;xe<V.children.length;xe++){const we=V.children[xe];le.push(we)}return se}function z(W,G){const q=[],se=r.$getRoot().getChildren();for(let ge=0;ge<se.length;ge++){const j=se[ge];k(W,G,j,q)}return{namespace:W._config.namespace,nodes:q}}function E(W){const G=[];for(let q=0;q<W.length;q++){const le=W[q],se=r.$parseSerializedNode(le);r.$isTextNode(se)&&t.$addNodeStyle(se),G.push(se)}return G}const x=50;let U=null;async function Q(W,G){if(U!==null)return!1;if(G!==null)return new Promise((B,V)=>{W.update(()=>{B(F(W,G))})});const q=W.getRootElement(),le=W._window==null?window.document:W._window.document,se=d(W._window);if(q===null||se===null)return!1;const ge=le.createElement("span");ge.style.cssText="position: fixed; top: -1000px;",ge.append(le.createTextNode("#")),q.append(ge);const j=new Range;return j.setStart(ge,0),j.setEnd(ge,1),se.removeAllRanges(),se.addRange(j),new Promise((B,V)=>{const xe=W.registerCommand(r.COPY_COMMAND,we=>(n.objectKlassEquals(we,ClipboardEvent)&&(xe(),U!==null&&(window.clearTimeout(U),U=null),B(F(W,we))),!0),r.COMMAND_PRIORITY_CRITICAL);U=window.setTimeout(()=>{xe(),U=null,B(!1)},x),le.execCommand("copy"),ge.remove()})}function F(W,G){const q=d(W._window);if(!q)return!1;const le=q.anchorNode,se=q.focusNode;if(le!==null&&se!==null&&!r.isSelectionWithinEditor(W,le,se))return!1;G.preventDefault();const ge=G.clipboardData,j=r.$getSelection();if(ge===null||j===null)return!1;const B=g(W),V=m(W);let xe="";return j!==null&&(xe=j.getTextContent()),B!==null&&ge.setData("text/html",B),V!==null&&ge.setData("application/x-lexical-editor",V),ge.setData("text/plain",xe),!0}return
|
|
96
|
+
`?G.insertParagraph():V===" "?G.insertNodes([r.$createTabNode()]):G.insertText(V)}}else G.insertRawText(ge)}function R(W,G,q){W.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:G,selection:q})||q.insertNodes(G)}function b(W){const G=W.exportJSON(),q=W.constructor;if(G.type!==q.getType())throw Error(`LexicalNode: Node ${q.name} does not implement .exportJSON().`);if(r.$isElementNode(W)){const le=G.children;if(!Array.isArray(le))throw Error(`LexicalNode: Node ${q.name} is an element but .exportJSON() does not have a children array.`)}return G}function k(W,G,q,le=[]){let se=G!=null?q.isSelected(G):!0;const ge=r.$isElementNode(q)&&q.excludeFromCopy("html");let j=q;if(G!==null){let xe=t.$cloneWithProperties(q);xe=r.$isTextNode(xe)&&G!=null?t.$sliceSelectedTextNodeContent(G,xe):xe,j=xe}const B=r.$isElementNode(j)?j.getChildren():[],V=b(j);if(r.$isTextNode(j)){const xe=j.__text;xe.length>0?V.text=xe:se=!1}for(let xe=0;xe<B.length;xe++){const we=B[xe],Ee=k(W,G,we,V.children);!se&&r.$isElementNode(q)&&Ee&&q.extractWithChild(we,G,"clone")&&(se=!0)}if(se&&!ge)le.push(V);else if(Array.isArray(V.children))for(let xe=0;xe<V.children.length;xe++){const we=V.children[xe];le.push(we)}return se}function z(W,G){const q=[],se=r.$getRoot().getChildren();for(let ge=0;ge<se.length;ge++){const j=se[ge];k(W,G,j,q)}return{namespace:W._config.namespace,nodes:q}}function E(W){const G=[];for(let q=0;q<W.length;q++){const le=W[q],se=r.$parseSerializedNode(le);r.$isTextNode(se)&&t.$addNodeStyle(se),G.push(se)}return G}const x=50;let U=null;async function Q(W,G){if(U!==null)return!1;if(G!==null)return new Promise((B,V)=>{W.update(()=>{B(F(W,G))})});const q=W.getRootElement(),le=W._window==null?window.document:W._window.document,se=d(W._window);if(q===null||se===null)return!1;const ge=le.createElement("span");ge.style.cssText="position: fixed; top: -1000px;",ge.append(le.createTextNode("#")),q.append(ge);const j=new Range;return j.setStart(ge,0),j.setEnd(ge,1),se.removeAllRanges(),se.addRange(j),new Promise((B,V)=>{const xe=W.registerCommand(r.COPY_COMMAND,we=>(n.objectKlassEquals(we,ClipboardEvent)&&(xe(),U!==null&&(window.clearTimeout(U),U=null),B(F(W,we))),!0),r.COMMAND_PRIORITY_CRITICAL);U=window.setTimeout(()=>{xe(),U=null,B(!1)},x),le.execCommand("copy"),ge.remove()})}function F(W,G){const q=d(W._window);if(!q)return!1;const le=q.anchorNode,se=q.focusNode;if(le!==null&&se!==null&&!r.isSelectionWithinEditor(W,le,se))return!1;G.preventDefault();const ge=G.clipboardData,j=r.$getSelection();if(ge===null||j===null)return!1;const B=g(W),V=m(W);let xe="";return j!==null&&(xe=j.getTextContent()),B!==null&&ge.setData("text/html",B),V!==null&&ge.setData("application/x-lexical-editor",V),ge.setData("text/plain",xe),!0}return vi.$generateJSONFromSelectedNodes=z,vi.$generateNodesFromSerializedNodes=E,vi.$getHtmlContent=g,vi.$getLexicalContent=m,vi.$insertDataTransferForPlainText=N,vi.$insertDataTransferForRichText=T,vi.$insertGeneratedNodes=R,vi.copyToClipboard=Q,vi}var wi={},sh;function gN(){if(sh)return wi;sh=1;var e=Zu,t=Es(),n=Xn(),r=gn();function c(E){let x=new URLSearchParams;x.append("code",E);for(let U=1;U<arguments.length;U++)x.append("v",arguments[U]);throw Error(`Minified Lexical error #${E}; visit https://lexical.dev/docs/error?${x} 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 g(E){let x=r.$getSelection();if(x==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(x)&&x.isCollapsed()||x.getNodes().length===0?"":e.$generateHtmlFromNodes(E,x)}function m(E){let x=r.$getSelection();if(x==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(x)&&x.isCollapsed()||x.getNodes().length===0?null:JSON.stringify(R(E,x))}function N(E,x,U){E.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:x,selection:U})||U.insertNodes(x)}function T(E,x,U,Q=[]){let F=x!=null?U.isSelected(x):!0,W=r.$isElementNode(U)&&U.excludeFromCopy("html");var G=U;if(x!==null){var q=t.$cloneWithProperties(U);G=q=r.$isTextNode(q)&&x!=null?t.$sliceSelectedTextNodeContent(x,q):q}let le=r.$isElementNode(G)?G.getChildren():[];var se=G;q=se.exportJSON();var ge=se.constructor;for(q.type!==ge.getType()&&c(58,ge.name),r.$isElementNode(se)&&(Array.isArray(q.children)||c(59,ge.name)),r.$isTextNode(G)&&(G=G.__text,0<G.length?q.text=G:F=!1),G=0;G<le.length;G++)se=le[G],ge=T(E,x,se,q.children),!F&&r.$isElementNode(U)&&ge&&U.extractWithChild(se,x,"clone")&&(F=!0);if(F&&!W)Q.push(q);else if(Array.isArray(q.children))for(E=0;E<q.children.length;E++)Q.push(q.children[E]);return F}function R(E,x){let U=[],Q=r.$getRoot().getChildren();for(let F=0;F<Q.length;F++)T(E,x,Q[F],U);return{namespace:E._config.namespace,nodes:U}}function b(E){let x=[];for(let U=0;U<E.length;U++){let Q=r.$parseSerializedNode(E[U]);r.$isTextNode(Q)&&t.$addNodeStyle(Q),x.push(Q)}return x}let k=null;function z(E,x){var U=d?(E._window||window).getSelection():null;if(!U)return!1;var Q=U.anchorNode;if(U=U.focusNode,Q!==null&&U!==null&&!r.isSelectionWithinEditor(E,Q,U)||(x.preventDefault(),x=x.clipboardData,Q=r.$getSelection(),x===null||Q===null))return!1;U=g(E),E=m(E);let F="";return Q!==null&&(F=Q.getTextContent()),U!==null&&x.setData("text/html",U),E!==null&&x.setData("application/x-lexical-editor",E),x.setData("text/plain",F),!0}return wi.$generateJSONFromSelectedNodes=R,wi.$generateNodesFromSerializedNodes=b,wi.$getHtmlContent=g,wi.$getLexicalContent=m,wi.$insertDataTransferForPlainText=function(E,x){E=E.getData("text/plain")||E.getData("text/uri-list"),E!=null&&x.insertRawText(E)},wi.$insertDataTransferForRichText=function(E,x,U){var Q=E.getData("application/x-lexical-editor");if(Q)try{let W=JSON.parse(Q);if(W.namespace===U._config.namespace&&Array.isArray(W.nodes)){let G=b(W.nodes);return N(U,G,x)}}catch{}if(Q=E.getData("text/html"))try{var F=new DOMParser().parseFromString(Q,"text/html");let W=e.$generateNodesFromDOM(U,F);return N(U,W,x)}catch{}if(E=E.getData("text/plain")||E.getData("text/uri-list"),E!=null)if(r.$isRangeSelection(x))for(E=E.split(/(\r?\n|\t)/),E[E.length-1]===""&&E.pop(),U=0;U<E.length;U++)F=E[U],F===`
|
|
97
97
|
`||F===`\r
|
|
98
|
-
`?x.insertParagraph():F===" "?x.insertNodes([r.$createTabNode()]):x.insertText(F);else x.insertRawText(E)},vi.$insertGeneratedNodes=N,vi.copyToClipboard=async function(E,x){if(k!==null)return!1;if(x!==null)return new Promise(G=>{E.update(()=>{G(z(E,x))})});var U=E.getRootElement();let Q=E._window==null?window.document:E._window.document,F=d?(E._window||window).getSelection():null;if(U===null||F===null)return!1;let W=Q.createElement("span");return W.style.cssText="position: fixed; top: -1000px;",W.append(Q.createTextNode("#")),U.append(W),U=new Range,U.setStart(W,0),U.setEnd(W,1),F.removeAllRanges(),F.addRange(U),new Promise(G=>{let q=E.registerCommand(r.COPY_COMMAND,le=>(n.objectKlassEquals(le,ClipboardEvent)&&(q(),k!==null&&(window.clearTimeout(k),k=null),G(z(E,le))),!0),r.COMMAND_PRIORITY_CRITICAL);k=window.setTimeout(()=>{q(),k=null,G(!1)},50),Q.execCommand("copy"),W.remove()})},vi}var eu,oh;function Bg(){return oh||(oh=1,eu=process.env.NODE_ENV==="development"?fN():hN()),eu}var lh;function gN(){if(lh)return ci;lh=1;var e=Bg(),t=Cs(),n=Xn(),r=gn();function c(we,Ee){if(typeof document.caretRangeFromPoint<"u"){const ue=document.caretRangeFromPoint(we,Ee);return ue===null?null:{node:ue.startContainer,offset:ue.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const ue=document.caretPositionFromPoint(we,Ee);return ue===null?null:{node:ue.offsetNode,offset:ue.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,m=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,N=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,R=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),b=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!R,k=r.createCommand("DRAG_DROP_PASTE_FILE");class z extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new z(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const ue=document.createElement("blockquote");return n.addClassNamesToElement(ue,Ee.theme.quote),ue}updateDOM(Ee,ue){return!1}static importDOM(){return{blockquote:Ee=>({conversion:W,priority:0})}}exportDOM(Ee){const{element:ue}=super.exportDOM(Ee);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const $=this.getFormatType();ue.style.textAlign=$;const S=this.getDirection();S&&(ue.dir=S)}return{element:ue}}static importJSON(Ee){const ue=E();return ue.setFormat(Ee.format),ue.setIndent(Ee.indent),ue.setDirection(Ee.direction),ue}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,ue){const $=r.$createParagraphNode(),S=this.getDirection();return $.setDirection(S),this.insertAfter($,ue),$}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach($=>Ee.append($)),this.replace(Ee),!0}}function E(){return r.$applyNodeReplacement(new z)}function x(we){return we instanceof z}class U extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new U(Ee.__tag,Ee.__key)}constructor(Ee,ue){super(ue),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const ue=this.__tag,$=document.createElement(ue),Y=Ee.theme.heading;if(Y!==void 0){const ie=Y[ue];n.addClassNamesToElement($,ie)}return $}updateDOM(Ee,ue){return!1}static importDOM(){return{h1:Ee=>({conversion:F,priority:0}),h2:Ee=>({conversion:F,priority:0}),h3:Ee=>({conversion:F,priority:0}),h4:Ee=>({conversion:F,priority:0}),h5:Ee=>({conversion:F,priority:0}),h6:Ee=>({conversion:F,priority:0}),p:Ee=>{const $=Ee.firstChild;return $!==null&&Q($)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>Q(Ee)?{conversion:ue=>({node:G("h1")}),priority:3}:null}}exportDOM(Ee){const{element:ue}=super.exportDOM(Ee);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const $=this.getFormatType();ue.style.textAlign=$;const S=this.getDirection();S&&(ue.dir=S)}return{element:ue}}static importJSON(Ee){const ue=G(Ee.tag);return ue.setFormat(Ee.format),ue.setIndent(Ee.indent),ue.setDirection(Ee.direction),ue}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,ue=!0){const $=Ee?Ee.anchor.offset:0,S=$===this.getTextContentSize()||!Ee?r.$createParagraphNode():G(this.getTag()),Y=this.getDirection();if(S.setDirection(Y),this.insertAfter(S,ue),$===0&&!this.isEmpty()&&Ee){const ie=r.$createParagraphNode();ie.select(),this.replace(ie,!0)}return S}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():G(this.getTag());return this.getChildren().forEach($=>Ee.append($)),this.replace(Ee),!0}extractWithChild(){return!0}}function Q(we){return we.nodeName.toLowerCase()==="span"?we.style.fontSize==="26pt":!1}function F(we){const Ee=we.nodeName.toLowerCase();let ue=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(ue=G(Ee),we.style!==null&&ue.setFormat(we.style.textAlign)),{node:ue}}function W(we){const Ee=E();return we.style!==null&&Ee.setFormat(we.style.textAlign),{node:Ee}}function G(we){return r.$applyNodeReplacement(new U(we))}function q(we){return we instanceof U}function le(we,Ee){we.preventDefault(),Ee.update(()=>{const ue=r.$getSelection(),$=we instanceof InputEvent||we instanceof KeyboardEvent?null:we.clipboardData;$!=null&&r.$INTERNAL_isPointSelection(ue)&&e.$insertDataTransferForRichText($,ue,Ee)},{tag:"paste"})}async function se(we,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(we,ClipboardEvent)?we:null),Ee.update(()=>{const ue=r.$getSelection();r.$isRangeSelection(ue)?ue.removeText():r.$isNodeSelection(ue)&&ue.getNodes().forEach($=>$.remove())})}function ge(we){let Ee=null;if(we instanceof DragEvent?Ee=we.dataTransfer:we instanceof ClipboardEvent&&(Ee=we.clipboardData),Ee===null)return[!1,[],!1];const ue=Ee.types,$=ue.includes("Files"),S=ue.includes("text/html")||ue.includes("text/plain");return[$,Array.from(Ee.files),S]}function j(we){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const ue=new Set,$=Ee.getNodes();for(let S=0;S<$.length;S++){const Y=$[S],ie=Y.getKey();if(ue.has(ie))continue;const K=n.$getNearestBlockElementAncestorOrThrow(Y),P=K.getKey();K.canIndent()&&!ue.has(P)&&(ue.add(P),we(K))}return ue.size>0}function B(we){const Ee=r.$getNearestNodeFromDOMNode(we);return r.$isDecoratorNode(Ee)}function V(we){const Ee=we.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function xe(we){return n.mergeRegister(we.registerCommand(r.CLICK_COMMAND,ue=>{const $=r.$getSelection();return r.$isNodeSelection($)?($.clear(),!0):!1},0),we.registerCommand(r.DELETE_CHARACTER_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteCharacter(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DELETE_WORD_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteWord(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DELETE_LINE_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteLine(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,ue=>{const $=r.$getSelection();if(typeof ue=="string")r.$INTERNAL_isPointSelection($)&&$.insertText(ue);else{if(!r.$INTERNAL_isPointSelection($))return!1;const S=ue.dataTransfer;if(S!=null)e.$insertDataTransferForRichText(S,$,we);else if(r.$isRangeSelection($)){const Y=ue.data;return Y&&$.insertText(Y),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.FORMAT_TEXT_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.formatText(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.FORMAT_ELEMENT_COMMAND,ue=>{const $=r.$getSelection();if(!r.$isRangeSelection($)&&!r.$isNodeSelection($))return!1;const S=$.getNodes();for(const Y of S){const ie=n.$findMatchingParent(Y,K=>r.$isElementNode(K)&&!K.isInline());ie!==null&&ie.setFormat(ue)}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_LINE_BREAK_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.insertLineBreak(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INDENT_CONTENT_COMMAND,()=>j(ue=>{const $=ue.getIndent();ue.setIndent($+1)}),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>j(ue=>{const $=ue.getIndent();$>0&&ue.setIndent($-1)}),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_UP_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)&&!B(ue.target)){const S=$.getNodes();if(S.length>0)return S[0].selectPrevious(),!0}else if(r.$isRangeSelection($)){const S=r.$getAdjacentNode($.focus,!0);if(!ue.shiftKey&&r.$isDecoratorNode(S)&&!S.isIsolated()&&!S.isInline())return S.selectPrevious(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_DOWN_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)){const S=$.getNodes();if(S.length>0)return S[0].selectNext(0,0),!0}else if(r.$isRangeSelection($)){if(V($))return ue.preventDefault(),!0;const S=r.$getAdjacentNode($.focus,!1);if(!ue.shiftKey&&r.$isDecoratorNode(S)&&!S.isIsolated()&&!S.isInline())return S.selectNext(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_LEFT_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)){const S=$.getNodes();if(S.length>0)return ue.preventDefault(),S[0].selectPrevious(),!0}if(!r.$isRangeSelection($))return!1;if(t.$shouldOverrideDefaultCharacterSelection($,!0)){const S=ue.shiftKey;return ue.preventDefault(),t.$moveCharacter($,S,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)&&!B(ue.target)){const Y=$.getNodes();if(Y.length>0)return ue.preventDefault(),Y[0].selectNext(0,0),!0}if(!r.$isRangeSelection($))return!1;const S=ue.shiftKey;return t.$shouldOverrideDefaultCharacterSelection($,!1)?(ue.preventDefault(),t.$moveCharacter($,S,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_BACKSPACE_COMMAND,ue=>{if(B(ue.target))return!1;const $=r.$getSelection();if(!r.$isRangeSelection($))return!1;ue.preventDefault();const{anchor:S}=$,Y=S.getNode();return $.isCollapsed()&&S.offset===0&&!r.$isRootNode(Y)&&n.$getNearestBlockElementAncestorOrThrow(Y).getIndent()>0?we.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):we.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_DELETE_COMMAND,ue=>{if(B(ue.target))return!1;const $=r.$getSelection();return r.$isRangeSelection($)?(ue.preventDefault(),we.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ENTER_COMMAND,ue=>{const $=r.$getSelection();if(!r.$isRangeSelection($))return!1;if(ue!==null){if((T||N||b)&&m)return!1;if(ue.preventDefault(),ue.shiftKey)return we.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return we.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(we.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DROP_COMMAND,ue=>{const[,$]=ge(ue);if($.length>0){const Y=ue.clientX,ie=ue.clientY,K=c(Y,ie);if(K!==null){const{offset:P,node:Z}=K,O=r.$getNearestNodeFromDOMNode(Z);if(O!==null){const H=r.$createRangeSelection();if(r.$isTextNode(O))H.anchor.set(O.getKey(),P,"text"),H.focus.set(O.getKey(),P,"text");else{const de=O.getParentOrThrow().getKey(),_e=O.getIndexWithinParent()+1;H.anchor.set(de,_e,"element"),H.focus.set(de,_e,"element")}const J=r.$normalizeSelection__EXPERIMENTAL(H);r.$setSelection(J)}we.dispatchCommand(k,$)}return ue.preventDefault(),!0}const S=r.$getSelection();return!!r.$isRangeSelection(S)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DRAGSTART_COMMAND,ue=>{const[$]=ge(ue),S=r.$getSelection();return!($&&!r.$isRangeSelection(S))},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DRAGOVER_COMMAND,ue=>{const[$]=ge(ue),S=r.$getSelection();if($&&!r.$isRangeSelection(S))return!1;const Y=ue.clientX,ie=ue.clientY,K=c(Y,ie);if(K!==null){const P=r.$getNearestNodeFromDOMNode(K.node);r.$isDecoratorNode(P)&&ue.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.COPY_COMMAND,ue=>(e.copyToClipboard(we,n.objectKlassEquals(ue,ClipboardEvent)?ue:null),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.CUT_COMMAND,ue=>(se(ue,we),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.PASTE_COMMAND,ue=>{const[,$,S]=ge(ue);if($.length>0&&!S)return we.dispatchCommand(k,$),!0;if(r.isSelectionCapturedInDecoratorInput(ue.target))return!1;const Y=r.$getSelection();return r.$INTERNAL_isPointSelection(Y)?(le(ue,we),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ci.$createHeadingNode=G,ci.$createQuoteNode=E,ci.$isHeadingNode=q,ci.$isQuoteNode=x,ci.DRAG_DROP_PASTE=k,ci.HeadingNode=U,ci.QuoteNode=z,ci.eventFiles=ge,ci.registerRichText=xe,ci}var ui={},ah;function pN(){if(ah)return ui;ah=1;var e=Bg(),t=Cs(),n=Xn(),r=gn();function c(j,B){return typeof document.caretRangeFromPoint<"u"?(j=document.caretRangeFromPoint(j,B),j===null?null:{node:j.startContainer,offset:j.startOffset}):document.caretPositionFromPoint!=="undefined"?(j=document.caretPositionFromPoint(j,B),j===null?null:{node:j.offsetNode,offset:j.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,m=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,N=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,R=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),b=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!R,k=r.createCommand("DRAG_DROP_PASTE_FILE");class z extends r.ElementNode{static getType(){return"quote"}static clone(B){return new z(B.__key)}constructor(B){super(B)}createDOM(B){let V=document.createElement("blockquote");return n.addClassNamesToElement(V,B.theme.quote),V}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:F,priority:0})}}exportDOM(B){if({element:B}=super.exportDOM(B),B&&n.isHTMLElement(B)){this.isEmpty()&&B.append(document.createElement("br"));var V=this.getFormatType();B.style.textAlign=V,(V=this.getDirection())&&(B.dir=V)}return{element:B}}static importJSON(B){let V=E();return V.setFormat(B.format),V.setIndent(B.indent),V.setDirection(B.direction),V}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(B,V){B=r.$createParagraphNode();let xe=this.getDirection();return B.setDirection(xe),this.insertAfter(B,V),B}collapseAtStart(){let B=r.$createParagraphNode();return this.getChildren().forEach(V=>B.append(V)),this.replace(B),!0}}function E(){return r.$applyNodeReplacement(new z)}class x extends r.ElementNode{static getType(){return"heading"}static clone(B){return new x(B.__tag,B.__key)}constructor(B,V){super(V),this.__tag=B}getTag(){return this.__tag}createDOM(B){let V=this.__tag,xe=document.createElement(V);return B=B.theme.heading,B!==void 0&&n.addClassNamesToElement(xe,B[V]),xe}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:Q,priority:0}),h2:()=>({conversion:Q,priority:0}),h3:()=>({conversion:Q,priority:0}),h4:()=>({conversion:Q,priority:0}),h5:()=>({conversion:Q,priority:0}),h6:()=>({conversion:Q,priority:0}),p:B=>(B=B.firstChild,B!==null&&U(B)?{conversion:()=>({node:null}),priority:3}:null),span:B=>U(B)?{conversion:()=>({node:W("h1")}),priority:3}:null}}exportDOM(B){if({element:B}=super.exportDOM(B),B&&n.isHTMLElement(B)){this.isEmpty()&&B.append(document.createElement("br"));var V=this.getFormatType();B.style.textAlign=V,(V=this.getDirection())&&(B.dir=V)}return{element:B}}static importJSON(B){let V=W(B.tag);return V.setFormat(B.format),V.setIndent(B.indent),V.setDirection(B.direction),V}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(B,V=!0){let xe=B?B.anchor.offset:0,we=xe!==this.getTextContentSize()&&B?W(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return we.setDirection(Ee),this.insertAfter(we,V),xe===0&&!this.isEmpty()&&B&&(B=r.$createParagraphNode(),B.select(),this.replace(B,!0)),we}collapseAtStart(){let B=this.isEmpty()?r.$createParagraphNode():W(this.getTag());return this.getChildren().forEach(V=>B.append(V)),this.replace(B),!0}extractWithChild(){return!0}}function U(j){return j.nodeName.toLowerCase()==="span"?j.style.fontSize==="26pt":!1}function Q(j){let B=j.nodeName.toLowerCase(),V=null;return(B==="h1"||B==="h2"||B==="h3"||B==="h4"||B==="h5"||B==="h6")&&(V=W(B),j.style!==null&&V.setFormat(j.style.textAlign)),{node:V}}function F(j){let B=E();return j.style!==null&&B.setFormat(j.style.textAlign),{node:B}}function W(j){return r.$applyNodeReplacement(new x(j))}function G(j,B){j.preventDefault(),B.update(()=>{let V=r.$getSelection(),xe=j instanceof InputEvent||j instanceof KeyboardEvent?null:j.clipboardData;xe!=null&&r.$INTERNAL_isPointSelection(V)&&e.$insertDataTransferForRichText(xe,V,B)},{tag:"paste"})}async function q(j,B){await e.copyToClipboard(B,n.objectKlassEquals(j,ClipboardEvent)?j:null),B.update(()=>{let V=r.$getSelection();r.$isRangeSelection(V)?V.removeText():r.$isNodeSelection(V)&&V.getNodes().forEach(xe=>xe.remove())})}function le(j){let B=null;if(j instanceof DragEvent?B=j.dataTransfer:j instanceof ClipboardEvent&&(B=j.clipboardData),B===null)return[!1,[],!1];var V=B.types;return j=V.includes("Files"),V=V.includes("text/html")||V.includes("text/plain"),[j,Array.from(B.files),V]}function se(j){var B=r.$getSelection();if(!r.$isRangeSelection(B))return!1;let V=new Set;B=B.getNodes();for(let Ee=0;Ee<B.length;Ee++){var xe=B[Ee],we=xe.getKey();V.has(we)||(xe=n.$getNearestBlockElementAncestorOrThrow(xe),we=xe.getKey(),xe.canIndent()&&!V.has(we)&&(V.add(we),j(xe)))}return 0<V.size}function ge(j){return j=r.$getNearestNodeFromDOMNode(j),r.$isDecoratorNode(j)}return ui.$createHeadingNode=W,ui.$createQuoteNode=E,ui.$isHeadingNode=function(j){return j instanceof x},ui.$isQuoteNode=function(j){return j instanceof z},ui.DRAG_DROP_PASTE=k,ui.HeadingNode=x,ui.QuoteNode=z,ui.eventFiles=le,ui.registerRichText=function(j){return n.mergeRegister(j.registerCommand(r.CLICK_COMMAND,()=>{const B=r.$getSelection();return r.$isNodeSelection(B)?(B.clear(),!0):!1},0),j.registerCommand(r.DELETE_CHARACTER_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteCharacter(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_WORD_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteWord(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_LINE_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteLine(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,B=>{const V=r.$getSelection();if(typeof B=="string")r.$INTERNAL_isPointSelection(V)&&V.insertText(B);else{if(!r.$INTERNAL_isPointSelection(V))return!1;const xe=B.dataTransfer;xe!=null?e.$insertDataTransferForRichText(xe,V,j):r.$isRangeSelection(V)&&(B=B.data)&&V.insertText(B)}return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(B.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_TEXT_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.formatText(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_ELEMENT_COMMAND,B=>{var V=r.$getSelection();if(!r.$isRangeSelection(V)&&!r.$isNodeSelection(V))return!1;V=V.getNodes();for(const xe of V)V=n.$findMatchingParent(xe,we=>r.$isElementNode(we)&&!we.isInline()),V!==null&&V.setFormat(B);return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_LINE_BREAK_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.insertLineBreak(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(B.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INDENT_CONTENT_COMMAND,()=>se(B=>{const V=B.getIndent();B.setIndent(V+1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>se(B=>{const V=B.getIndent();0<V&&B.setIndent(V-1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_UP_COMMAND,B=>{var V=r.$getSelection();if(r.$isNodeSelection(V)&&!ge(B.target)){if(B=V.getNodes(),0<B.length)return B[0].selectPrevious(),!0}else if(r.$isRangeSelection(V)&&(V=r.$getAdjacentNode(V.focus,!0),!B.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline()))return V.selectPrevious(),B.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_DOWN_COMMAND,B=>{var V=r.$getSelection();if(r.$isNodeSelection(V)){if(B=V.getNodes(),0<B.length)return B[0].selectNext(0,0),!0}else if(r.$isRangeSelection(V)){let xe=V.focus;if(xe.key==="root"&&xe.offset===r.$getRoot().getChildrenSize())return B.preventDefault(),!0;if(V=r.$getAdjacentNode(V.focus,!1),!B.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline())return V.selectNext(),B.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_LEFT_COMMAND,B=>{const V=r.$getSelection();if(r.$isNodeSelection(V)){var xe=V.getNodes();if(0<xe.length)return B.preventDefault(),xe[0].selectPrevious(),!0}return r.$isRangeSelection(V)&&t.$shouldOverrideDefaultCharacterSelection(V,!0)?(xe=B.shiftKey,B.preventDefault(),t.$moveCharacter(V,xe,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,B=>{const V=r.$getSelection();if(r.$isNodeSelection(V)&&!ge(B.target)){var xe=V.getNodes();if(0<xe.length)return B.preventDefault(),xe[0].selectNext(0,0),!0}return r.$isRangeSelection(V)?(xe=B.shiftKey,t.$shouldOverrideDefaultCharacterSelection(V,!1)?(B.preventDefault(),t.$moveCharacter(V,xe,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_BACKSPACE_COMMAND,B=>{if(ge(B.target))return!1;const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;B.preventDefault(),{anchor:B}=V;const xe=B.getNode();return V.isCollapsed()&&B.offset===0&&!r.$isRootNode(xe)&&0<n.$getNearestBlockElementAncestorOrThrow(xe).getIndent()?j.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_DELETE_COMMAND,B=>{if(ge(B.target))return!1;const V=r.$getSelection();return r.$isRangeSelection(V)?(B.preventDefault(),j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ENTER_COMMAND,B=>{const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;if(B!==null){if((T||N||b)&&m)return!1;if(B.preventDefault(),B.shiftKey)return j.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return j.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(j.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DROP_COMMAND,B=>{const[,V]=le(B);if(0<V.length){var xe=c(B.clientX,B.clientY);if(xe!==null){const{offset:Ee,node:ue}=xe;var we=r.$getNearestNodeFromDOMNode(ue);if(we!==null){if(xe=r.$createRangeSelection(),r.$isTextNode(we))xe.anchor.set(we.getKey(),Ee,"text"),xe.focus.set(we.getKey(),Ee,"text");else{const $=we.getParentOrThrow().getKey();we=we.getIndexWithinParent()+1,xe.anchor.set($,we,"element"),xe.focus.set($,we,"element")}xe=r.$normalizeSelection__EXPERIMENTAL(xe),r.$setSelection(xe)}j.dispatchCommand(k,V)}return B.preventDefault(),!0}return B=r.$getSelection(),!!r.$isRangeSelection(B)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGSTART_COMMAND,B=>{[B]=le(B);const V=r.$getSelection();return!(B&&!r.$isRangeSelection(V))},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGOVER_COMMAND,B=>{var[V]=le(B);const xe=r.$getSelection();return V&&!r.$isRangeSelection(xe)?!1:(V=c(B.clientX,B.clientY),V!==null&&(V=r.$getNearestNodeFromDOMNode(V.node),r.$isDecoratorNode(V)&&B.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.COPY_COMMAND,B=>(e.copyToClipboard(j,n.objectKlassEquals(B,ClipboardEvent)?B:null),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CUT_COMMAND,B=>(q(B,j),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.PASTE_COMMAND,B=>{const[,V,xe]=le(B);if(0<V.length&&!xe)return j.dispatchCommand(k,V),!0;if(r.isSelectionCapturedInDecoratorInput(B.target))return!1;const we=r.$getSelection();return r.$INTERNAL_isPointSelection(we)?(G(B,j),!0):!1},r.COMMAND_PRIORITY_EDITOR))},ui}const mN=process.env.NODE_ENV==="development"?gN():pN();var ch=mN,Ul={},uh;function _N(){if(uh)return Ul;uh=1;var e=Xn(),t=gn();class n extends t.TextNode{static getType(){return"hashtag"}static clone(g){return new n(g.__text,g.__key)}constructor(g,m){super(g,m)}createDOM(g){const m=super.createDOM(g);return e.addClassNamesToElement(m,g.theme.hashtag),m}static importJSON(g){const m=r(g.text);return m.setFormat(g.format),m.setDetail(g.detail),m.setMode(g.mode),m.setStyle(g.style),m}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function c(d){return d instanceof n}return Ul.$createHashtagNode=r,Ul.$isHashtagNode=c,Ul.HashtagNode=n,Ul}var Gl={},dh;function yN(){if(dh)return Gl;dh=1;var e=Xn(),t=gn();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,g){super(d,g)}createDOM(d){let g=super.createDOM(d);return e.addClassNamesToElement(g,d.theme.hashtag),g}static importJSON(d){let g=r(d.text);return g.setFormat(d.format),g.setDetail(d.detail),g.setMode(d.mode),g.setStyle(d.style),g}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(c=""){return t.$applyNodeReplacement(new n(c))}return Gl.$createHashtagNode=r,Gl.$isHashtagNode=function(c){return c instanceof n},Gl.HashtagNode=n,Gl}const NN=process.env.NODE_ENV==="development"?_N():yN();var CN=NN;const dt={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271","yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366","yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},EN={characterLimit:dt["yext-default-richtextv2-theme__characterLimit"],code:dt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:dt["yext-default-richtextv2-theme__tokenAttr"],attr:dt["yext-default-richtextv2-theme__tokenAttr"],boolean:dt["yext-default-richtextv2-theme__tokenProperty"],builtin:dt["yext-default-richtextv2-theme__tokenSelector"],cdata:dt["yext-default-richtextv2-theme__tokenComment"],char:dt["yext-default-richtextv2-theme__tokenSelector"],class:dt["yext-default-richtextv2-theme__tokenFunction"],"class-name":dt["yext-default-richtextv2-theme__tokenFunction"],comment:dt["yext-default-richtextv2-theme__tokenComment"],constant:dt["yext-default-richtextv2-theme__tokenProperty"],deleted:dt["yext-default-richtextv2-theme__tokenProperty"],doctype:dt["yext-default-richtextv2-theme__tokenComment"],entity:dt["yext-default-richtextv2-theme__tokenOperator"],function:dt["yext-default-richtextv2-theme__tokenFunction"],important:dt["yext-default-richtextv2-theme__tokenVariable"],inserted:dt["yext-default-richtextv2-theme__tokenSelector"],keyword:dt["yext-default-richtextv2-theme__tokenAttr"],namespace:dt["yext-default-richtextv2-theme__tokenVariable"],number:dt["yext-default-richtextv2-theme__tokenProperty"],operator:dt["yext-default-richtextv2-theme__tokenOperator"],prolog:dt["yext-default-richtextv2-theme__tokenComment"],property:dt["yext-default-richtextv2-theme__tokenProperty"],punctuation:dt["yext-default-richtextv2-theme__tokenPunctuation"],regex:dt["yext-default-richtextv2-theme__tokenVariable"],selector:dt["yext-default-richtextv2-theme__tokenSelector"],string:dt["yext-default-richtextv2-theme__tokenSelector"],symbol:dt["yext-default-richtextv2-theme__tokenProperty"],tag:dt["yext-default-richtextv2-theme__tokenProperty"],url:dt["yext-default-richtextv2-theme__tokenOperator"],variable:dt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:dt["yext-default-richtextv2-theme__embedBlock"],focus:dt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:dt["yext-default-richtextv2-theme__hashtag"],heading:{h1:dt["yext-default-richtextv2-theme__h1"],h2:dt["yext-default-richtextv2-theme__h2"],h3:dt["yext-default-richtextv2-theme__h3"],h4:dt["yext-default-richtextv2-theme__h4"],h5:dt["yext-default-richtextv2-theme__h5"],h6:dt["yext-default-richtextv2-theme__h6"]},image:dt["yext-default-richtextv2-theme__image"],link:dt["yext-default-richtextv2-theme__link"],list:{listitem:dt["yext-default-richtextv2-theme__listItem"],listitemChecked:dt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:dt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:dt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[dt["yext-default-richtextv2-theme__ol1"],dt["yext-default-richtextv2-theme__ol2"],dt["yext-default-richtextv2-theme__ol3"],dt["yext-default-richtextv2-theme__ol4"],dt["yext-default-richtextv2-theme__ol5"]],ulDepth:[dt["yext-default-richtextv2-theme__ul1"],dt["yext-default-richtextv2-theme__ul2"],dt["yext-default-richtextv2-theme__ul3"]]},ltr:dt["yext-default-richtextv2-theme__ltr"],mark:dt["yext-default-richtextv2-theme__mark"],markOverlap:dt["yext-default-richtextv2-theme__markOverlap"],paragraph:dt["yext-default-richtextv2-theme__paragraph"],quote:dt["yext-default-richtextv2-theme__quote"],rtl:dt["yext-default-richtextv2-theme__rtl"],table:dt["yext-default-richtextv2-theme__table"],tableCell:dt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:dt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:dt["yext-default-richtextv2-theme__textBold"],code:dt["yext-default-richtextv2-theme__textCode"],italic:dt["yext-default-richtextv2-theme__textItalic"],strikethrough:dt["yext-default-richtextv2-theme__textStrikethrough"],subscript:dt["yext-default-richtextv2-theme__textSubscript"],superscript:dt["yext-default-richtextv2-theme__textSuperscript"],underline:dt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:dt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Ju=gn();function TN({src:e,altText:t,width:n,height:r,maxWidth:c}){const d=yt.useMemo(()=>({height:r,width:n,maxWidth:c}),[r,n,c]);return nt.jsx("img",{src:e,alt:t,style:d})}function xN({altText:e,height:t,maxWidth:n=500,src:r,width:c,key:d}){return Ju.$applyNodeReplacement(new pc(r,e,n,c,t,d))}class pc extends Ju.DecoratorNode{constructor(n,r,c,d,g,m){super(m);ke(this,"__src");ke(this,"__altText");ke(this,"__width");ke(this,"__height");ke(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=c,this.__width=d||"inherit",this.__height=g||"inherit"}static getType(){return"image"}static clone(n){return new pc(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 xN(n)}createDOM(n){const r=document.createElement("span"),c=n.theme.image;return c&&(r.className=c),r}exportDOM(n){const r=document.createElement("span"),c=n._config.theme.image;c&&(r.className=c);const d=document.createElement("img");return d.src=this.__src,this.__altText&&(d.alt=this.__altText),this.__width!=="inherit"&&this.__width&&(d.width=Number(this.__width)),this.__height!=="inherit"&&this.__height&&(d.height=Number(this.__height)),this.__maxWidth&&(d.style.maxWidth=`${this.__maxWidth}px`),d.loading="lazy",d.decoding="async",r.appendChild(d),{element:r}}updateDOM(){return!1}decorate(){return nt.jsx(TN,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}var Bo={},tu={},fh;function SN(){if(fh)return tu;fh=1;var e=so,t=gn(),n=yt;function r(d,g){return d.getEditorState().read(()=>{const m=t.$getNodeByKey(g);return m===null?!1:m.isSelected()})}function c(d){const[g]=e.useLexicalComposerContext(),[m,N]=n.useState(()=>r(g,d));n.useEffect(()=>{let b=!0;const k=g.registerUpdateListener(()=>{b&&N(r(g,d))});return()=>{b=!1,k()}},[g,d]);const T=n.useCallback(b=>{g.update(()=>{let k=t.$getSelection();t.$isNodeSelection(k)||(k=t.$createNodeSelection(),t.$setSelection(k)),t.$isNodeSelection(k)&&(b?k.add(d):k.delete(d))})},[g,d]),R=n.useCallback(()=>{g.update(()=>{const b=t.$getSelection();t.$isNodeSelection(b)&&b.clear()})},[g]);return[m,T,R]}return tu.useLexicalNodeSelection=c,tu}var nu={},hh;function vN(){if(hh)return nu;hh=1;var e=so,t=gn(),n=yt;function r(c,d){return c.getEditorState().read(()=>{let g=t.$getNodeByKey(d);return g===null?!1:g.isSelected()})}return nu.useLexicalNodeSelection=function(c){let[d]=e.useLexicalComposerContext(),[g,m]=n.useState(()=>r(d,c));n.useEffect(()=>{let R=!0,b=d.registerUpdateListener(()=>{R&&m(r(d,c))});return()=>{R=!1,b()}},[d,c]);let N=n.useCallback(R=>{d.update(()=>{let b=t.$getSelection();t.$isNodeSelection(b)||(b=t.$createNodeSelection(),t.$setSelection(b)),t.$isNodeSelection(b)&&(R?b.add(c):b.delete(c))})},[d,c]),T=n.useCallback(()=>{d.update(()=>{const R=t.$getSelection();t.$isNodeSelection(R)&&R.clear()})},[d]);return[g,N,T]},nu}var ru,gh;function Hg(){return gh||(gh=1,ru=process.env.NODE_ENV==="development"?SN():vN()),ru}var ph;function wN(){if(ph)return Bo;ph=1;var e=so,t=Hg(),n=Xn(),r=gn(),c=yt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:b}){const[k]=e.useLexicalComposerContext(),[z,E,x]=t.useLexicalNodeSelection(b),U=c.useCallback(Q=>{if(z&&r.$isNodeSelection(r.$getSelection())){Q.preventDefault();const F=r.$getNodeByKey(b);R(F)&&F.remove()}return!1},[z,b]);return c.useEffect(()=>n.mergeRegister(k.registerCommand(r.CLICK_COMMAND,Q=>{const F=k.getElementByKey(b);return Q.target===F?(Q.shiftKey||x(),E(!z),!0):!1},r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_DELETE_COMMAND,U,r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_BACKSPACE_COMMAND,U,r.COMMAND_PRIORITY_LOW)),[x,k,z,b,U,E]),c.useEffect(()=>{const Q=k.getElementByKey(b);Q!==null&&(Q.className=z?"selected":"")},[k,z,b]),null}class m extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(k){return new m(k.__key)}static importJSON(k){return T()}static importDOM(){return{hr:()=>({conversion:N,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 c.createElement(g,{nodeKey:this.__key})}}function N(){return{node:T()}}function T(){return r.$applyNodeReplacement(new m)}function R(b){return b instanceof m}return Bo.$createHorizontalRuleNode=T,Bo.$isHorizontalRuleNode=R,Bo.HorizontalRuleNode=m,Bo.INSERT_HORIZONTAL_RULE_COMMAND=d,Bo}var Ho={},mh;function
|
|
100
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function N(){return{node:T()}}function T(){return r.$applyNodeReplacement(new m)}function R(b){return b instanceof m}return Ho.$createHorizontalRuleNode=T,Ho.$isHorizontalRuleNode=R,Ho.HorizontalRuleNode=m,Ho.INSERT_HORIZONTAL_RULE_COMMAND=d,Ho}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 c=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),t.push(c))}return t};var
|
|
102
|
-
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,c=(t||[]).length;for(;n<c;n++)r=Math.min(r,t[n].length);return c&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class
|
|
103
|
-
`}]}function
|
|
104
|
-
`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,c={};r&&(c.className=["language-"+r]);let d={type:"element",tagName:"code",properties:c,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
|
|
98
|
+
`?x.insertParagraph():F===" "?x.insertNodes([r.$createTabNode()]):x.insertText(F);else x.insertRawText(E)},wi.$insertGeneratedNodes=N,wi.copyToClipboard=async function(E,x){if(k!==null)return!1;if(x!==null)return new Promise(G=>{E.update(()=>{G(z(E,x))})});var U=E.getRootElement();let Q=E._window==null?window.document:E._window.document,F=d?(E._window||window).getSelection():null;if(U===null||F===null)return!1;let W=Q.createElement("span");return W.style.cssText="position: fixed; top: -1000px;",W.append(Q.createTextNode("#")),U.append(W),U=new Range,U.setStart(W,0),U.setEnd(W,1),F.removeAllRanges(),F.addRange(U),new Promise(G=>{let q=E.registerCommand(r.COPY_COMMAND,le=>(n.objectKlassEquals(le,ClipboardEvent)&&(q(),k!==null&&(window.clearTimeout(k),k=null),G(z(E,le))),!0),r.COMMAND_PRIORITY_CRITICAL);k=window.setTimeout(()=>{q(),k=null,G(!1)},50),Q.execCommand("copy"),W.remove()})},wi}var eu,oh;function Bg(){return oh||(oh=1,eu=process.env.NODE_ENV==="development"?hN():gN()),eu}var lh;function pN(){if(lh)return ui;lh=1;var e=Bg(),t=Es(),n=Xn(),r=gn();function c(we,Ee){if(typeof document.caretRangeFromPoint<"u"){const ue=document.caretRangeFromPoint(we,Ee);return ue===null?null:{node:ue.startContainer,offset:ue.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const ue=document.caretPositionFromPoint(we,Ee);return ue===null?null:{node:ue.offsetNode,offset:ue.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,m=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,N=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,R=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),b=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!R,k=r.createCommand("DRAG_DROP_PASTE_FILE");class z extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new z(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const ue=document.createElement("blockquote");return n.addClassNamesToElement(ue,Ee.theme.quote),ue}updateDOM(Ee,ue){return!1}static importDOM(){return{blockquote:Ee=>({conversion:W,priority:0})}}exportDOM(Ee){const{element:ue}=super.exportDOM(Ee);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const $=this.getFormatType();ue.style.textAlign=$;const S=this.getDirection();S&&(ue.dir=S)}return{element:ue}}static importJSON(Ee){const ue=E();return ue.setFormat(Ee.format),ue.setIndent(Ee.indent),ue.setDirection(Ee.direction),ue}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,ue){const $=r.$createParagraphNode(),S=this.getDirection();return $.setDirection(S),this.insertAfter($,ue),$}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach($=>Ee.append($)),this.replace(Ee),!0}}function E(){return r.$applyNodeReplacement(new z)}function x(we){return we instanceof z}class U extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new U(Ee.__tag,Ee.__key)}constructor(Ee,ue){super(ue),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const ue=this.__tag,$=document.createElement(ue),Y=Ee.theme.heading;if(Y!==void 0){const ie=Y[ue];n.addClassNamesToElement($,ie)}return $}updateDOM(Ee,ue){return!1}static importDOM(){return{h1:Ee=>({conversion:F,priority:0}),h2:Ee=>({conversion:F,priority:0}),h3:Ee=>({conversion:F,priority:0}),h4:Ee=>({conversion:F,priority:0}),h5:Ee=>({conversion:F,priority:0}),h6:Ee=>({conversion:F,priority:0}),p:Ee=>{const $=Ee.firstChild;return $!==null&&Q($)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>Q(Ee)?{conversion:ue=>({node:G("h1")}),priority:3}:null}}exportDOM(Ee){const{element:ue}=super.exportDOM(Ee);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const $=this.getFormatType();ue.style.textAlign=$;const S=this.getDirection();S&&(ue.dir=S)}return{element:ue}}static importJSON(Ee){const ue=G(Ee.tag);return ue.setFormat(Ee.format),ue.setIndent(Ee.indent),ue.setDirection(Ee.direction),ue}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,ue=!0){const $=Ee?Ee.anchor.offset:0,S=$===this.getTextContentSize()||!Ee?r.$createParagraphNode():G(this.getTag()),Y=this.getDirection();if(S.setDirection(Y),this.insertAfter(S,ue),$===0&&!this.isEmpty()&&Ee){const ie=r.$createParagraphNode();ie.select(),this.replace(ie,!0)}return S}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():G(this.getTag());return this.getChildren().forEach($=>Ee.append($)),this.replace(Ee),!0}extractWithChild(){return!0}}function Q(we){return we.nodeName.toLowerCase()==="span"?we.style.fontSize==="26pt":!1}function F(we){const Ee=we.nodeName.toLowerCase();let ue=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(ue=G(Ee),we.style!==null&&ue.setFormat(we.style.textAlign)),{node:ue}}function W(we){const Ee=E();return we.style!==null&&Ee.setFormat(we.style.textAlign),{node:Ee}}function G(we){return r.$applyNodeReplacement(new U(we))}function q(we){return we instanceof U}function le(we,Ee){we.preventDefault(),Ee.update(()=>{const ue=r.$getSelection(),$=we instanceof InputEvent||we instanceof KeyboardEvent?null:we.clipboardData;$!=null&&r.$INTERNAL_isPointSelection(ue)&&e.$insertDataTransferForRichText($,ue,Ee)},{tag:"paste"})}async function se(we,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(we,ClipboardEvent)?we:null),Ee.update(()=>{const ue=r.$getSelection();r.$isRangeSelection(ue)?ue.removeText():r.$isNodeSelection(ue)&&ue.getNodes().forEach($=>$.remove())})}function ge(we){let Ee=null;if(we instanceof DragEvent?Ee=we.dataTransfer:we instanceof ClipboardEvent&&(Ee=we.clipboardData),Ee===null)return[!1,[],!1];const ue=Ee.types,$=ue.includes("Files"),S=ue.includes("text/html")||ue.includes("text/plain");return[$,Array.from(Ee.files),S]}function j(we){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const ue=new Set,$=Ee.getNodes();for(let S=0;S<$.length;S++){const Y=$[S],ie=Y.getKey();if(ue.has(ie))continue;const K=n.$getNearestBlockElementAncestorOrThrow(Y),P=K.getKey();K.canIndent()&&!ue.has(P)&&(ue.add(P),we(K))}return ue.size>0}function B(we){const Ee=r.$getNearestNodeFromDOMNode(we);return r.$isDecoratorNode(Ee)}function V(we){const Ee=we.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function xe(we){return n.mergeRegister(we.registerCommand(r.CLICK_COMMAND,ue=>{const $=r.$getSelection();return r.$isNodeSelection($)?($.clear(),!0):!1},0),we.registerCommand(r.DELETE_CHARACTER_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteCharacter(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DELETE_WORD_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteWord(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DELETE_LINE_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteLine(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,ue=>{const $=r.$getSelection();if(typeof ue=="string")r.$INTERNAL_isPointSelection($)&&$.insertText(ue);else{if(!r.$INTERNAL_isPointSelection($))return!1;const S=ue.dataTransfer;if(S!=null)e.$insertDataTransferForRichText(S,$,we);else if(r.$isRangeSelection($)){const Y=ue.data;return Y&&$.insertText(Y),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.FORMAT_TEXT_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.formatText(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.FORMAT_ELEMENT_COMMAND,ue=>{const $=r.$getSelection();if(!r.$isRangeSelection($)&&!r.$isNodeSelection($))return!1;const S=$.getNodes();for(const Y of S){const ie=n.$findMatchingParent(Y,K=>r.$isElementNode(K)&&!K.isInline());ie!==null&&ie.setFormat(ue)}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_LINE_BREAK_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.insertLineBreak(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INDENT_CONTENT_COMMAND,()=>j(ue=>{const $=ue.getIndent();ue.setIndent($+1)}),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>j(ue=>{const $=ue.getIndent();$>0&&ue.setIndent($-1)}),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_UP_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)&&!B(ue.target)){const S=$.getNodes();if(S.length>0)return S[0].selectPrevious(),!0}else if(r.$isRangeSelection($)){const S=r.$getAdjacentNode($.focus,!0);if(!ue.shiftKey&&r.$isDecoratorNode(S)&&!S.isIsolated()&&!S.isInline())return S.selectPrevious(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_DOWN_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)){const S=$.getNodes();if(S.length>0)return S[0].selectNext(0,0),!0}else if(r.$isRangeSelection($)){if(V($))return ue.preventDefault(),!0;const S=r.$getAdjacentNode($.focus,!1);if(!ue.shiftKey&&r.$isDecoratorNode(S)&&!S.isIsolated()&&!S.isInline())return S.selectNext(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_LEFT_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)){const S=$.getNodes();if(S.length>0)return ue.preventDefault(),S[0].selectPrevious(),!0}if(!r.$isRangeSelection($))return!1;if(t.$shouldOverrideDefaultCharacterSelection($,!0)){const S=ue.shiftKey;return ue.preventDefault(),t.$moveCharacter($,S,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)&&!B(ue.target)){const Y=$.getNodes();if(Y.length>0)return ue.preventDefault(),Y[0].selectNext(0,0),!0}if(!r.$isRangeSelection($))return!1;const S=ue.shiftKey;return t.$shouldOverrideDefaultCharacterSelection($,!1)?(ue.preventDefault(),t.$moveCharacter($,S,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_BACKSPACE_COMMAND,ue=>{if(B(ue.target))return!1;const $=r.$getSelection();if(!r.$isRangeSelection($))return!1;ue.preventDefault();const{anchor:S}=$,Y=S.getNode();return $.isCollapsed()&&S.offset===0&&!r.$isRootNode(Y)&&n.$getNearestBlockElementAncestorOrThrow(Y).getIndent()>0?we.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):we.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_DELETE_COMMAND,ue=>{if(B(ue.target))return!1;const $=r.$getSelection();return r.$isRangeSelection($)?(ue.preventDefault(),we.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ENTER_COMMAND,ue=>{const $=r.$getSelection();if(!r.$isRangeSelection($))return!1;if(ue!==null){if((T||N||b)&&m)return!1;if(ue.preventDefault(),ue.shiftKey)return we.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return we.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(we.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DROP_COMMAND,ue=>{const[,$]=ge(ue);if($.length>0){const Y=ue.clientX,ie=ue.clientY,K=c(Y,ie);if(K!==null){const{offset:P,node:Z}=K,O=r.$getNearestNodeFromDOMNode(Z);if(O!==null){const H=r.$createRangeSelection();if(r.$isTextNode(O))H.anchor.set(O.getKey(),P,"text"),H.focus.set(O.getKey(),P,"text");else{const de=O.getParentOrThrow().getKey(),_e=O.getIndexWithinParent()+1;H.anchor.set(de,_e,"element"),H.focus.set(de,_e,"element")}const J=r.$normalizeSelection__EXPERIMENTAL(H);r.$setSelection(J)}we.dispatchCommand(k,$)}return ue.preventDefault(),!0}const S=r.$getSelection();return!!r.$isRangeSelection(S)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DRAGSTART_COMMAND,ue=>{const[$]=ge(ue),S=r.$getSelection();return!($&&!r.$isRangeSelection(S))},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DRAGOVER_COMMAND,ue=>{const[$]=ge(ue),S=r.$getSelection();if($&&!r.$isRangeSelection(S))return!1;const Y=ue.clientX,ie=ue.clientY,K=c(Y,ie);if(K!==null){const P=r.$getNearestNodeFromDOMNode(K.node);r.$isDecoratorNode(P)&&ue.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.COPY_COMMAND,ue=>(e.copyToClipboard(we,n.objectKlassEquals(ue,ClipboardEvent)?ue:null),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.CUT_COMMAND,ue=>(se(ue,we),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.PASTE_COMMAND,ue=>{const[,$,S]=ge(ue);if($.length>0&&!S)return we.dispatchCommand(k,$),!0;if(r.isSelectionCapturedInDecoratorInput(ue.target))return!1;const Y=r.$getSelection();return r.$INTERNAL_isPointSelection(Y)?(le(ue,we),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ui.$createHeadingNode=G,ui.$createQuoteNode=E,ui.$isHeadingNode=q,ui.$isQuoteNode=x,ui.DRAG_DROP_PASTE=k,ui.HeadingNode=U,ui.QuoteNode=z,ui.eventFiles=ge,ui.registerRichText=xe,ui}var di={},ah;function mN(){if(ah)return di;ah=1;var e=Bg(),t=Es(),n=Xn(),r=gn();function c(j,B){return typeof document.caretRangeFromPoint<"u"?(j=document.caretRangeFromPoint(j,B),j===null?null:{node:j.startContainer,offset:j.startOffset}):document.caretPositionFromPoint!=="undefined"?(j=document.caretPositionFromPoint(j,B),j===null?null:{node:j.offsetNode,offset:j.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,m=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,N=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,R=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),b=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!R,k=r.createCommand("DRAG_DROP_PASTE_FILE");class z extends r.ElementNode{static getType(){return"quote"}static clone(B){return new z(B.__key)}constructor(B){super(B)}createDOM(B){let V=document.createElement("blockquote");return n.addClassNamesToElement(V,B.theme.quote),V}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:F,priority:0})}}exportDOM(B){if({element:B}=super.exportDOM(B),B&&n.isHTMLElement(B)){this.isEmpty()&&B.append(document.createElement("br"));var V=this.getFormatType();B.style.textAlign=V,(V=this.getDirection())&&(B.dir=V)}return{element:B}}static importJSON(B){let V=E();return V.setFormat(B.format),V.setIndent(B.indent),V.setDirection(B.direction),V}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(B,V){B=r.$createParagraphNode();let xe=this.getDirection();return B.setDirection(xe),this.insertAfter(B,V),B}collapseAtStart(){let B=r.$createParagraphNode();return this.getChildren().forEach(V=>B.append(V)),this.replace(B),!0}}function E(){return r.$applyNodeReplacement(new z)}class x extends r.ElementNode{static getType(){return"heading"}static clone(B){return new x(B.__tag,B.__key)}constructor(B,V){super(V),this.__tag=B}getTag(){return this.__tag}createDOM(B){let V=this.__tag,xe=document.createElement(V);return B=B.theme.heading,B!==void 0&&n.addClassNamesToElement(xe,B[V]),xe}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:Q,priority:0}),h2:()=>({conversion:Q,priority:0}),h3:()=>({conversion:Q,priority:0}),h4:()=>({conversion:Q,priority:0}),h5:()=>({conversion:Q,priority:0}),h6:()=>({conversion:Q,priority:0}),p:B=>(B=B.firstChild,B!==null&&U(B)?{conversion:()=>({node:null}),priority:3}:null),span:B=>U(B)?{conversion:()=>({node:W("h1")}),priority:3}:null}}exportDOM(B){if({element:B}=super.exportDOM(B),B&&n.isHTMLElement(B)){this.isEmpty()&&B.append(document.createElement("br"));var V=this.getFormatType();B.style.textAlign=V,(V=this.getDirection())&&(B.dir=V)}return{element:B}}static importJSON(B){let V=W(B.tag);return V.setFormat(B.format),V.setIndent(B.indent),V.setDirection(B.direction),V}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(B,V=!0){let xe=B?B.anchor.offset:0,we=xe!==this.getTextContentSize()&&B?W(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return we.setDirection(Ee),this.insertAfter(we,V),xe===0&&!this.isEmpty()&&B&&(B=r.$createParagraphNode(),B.select(),this.replace(B,!0)),we}collapseAtStart(){let B=this.isEmpty()?r.$createParagraphNode():W(this.getTag());return this.getChildren().forEach(V=>B.append(V)),this.replace(B),!0}extractWithChild(){return!0}}function U(j){return j.nodeName.toLowerCase()==="span"?j.style.fontSize==="26pt":!1}function Q(j){let B=j.nodeName.toLowerCase(),V=null;return(B==="h1"||B==="h2"||B==="h3"||B==="h4"||B==="h5"||B==="h6")&&(V=W(B),j.style!==null&&V.setFormat(j.style.textAlign)),{node:V}}function F(j){let B=E();return j.style!==null&&B.setFormat(j.style.textAlign),{node:B}}function W(j){return r.$applyNodeReplacement(new x(j))}function G(j,B){j.preventDefault(),B.update(()=>{let V=r.$getSelection(),xe=j instanceof InputEvent||j instanceof KeyboardEvent?null:j.clipboardData;xe!=null&&r.$INTERNAL_isPointSelection(V)&&e.$insertDataTransferForRichText(xe,V,B)},{tag:"paste"})}async function q(j,B){await e.copyToClipboard(B,n.objectKlassEquals(j,ClipboardEvent)?j:null),B.update(()=>{let V=r.$getSelection();r.$isRangeSelection(V)?V.removeText():r.$isNodeSelection(V)&&V.getNodes().forEach(xe=>xe.remove())})}function le(j){let B=null;if(j instanceof DragEvent?B=j.dataTransfer:j instanceof ClipboardEvent&&(B=j.clipboardData),B===null)return[!1,[],!1];var V=B.types;return j=V.includes("Files"),V=V.includes("text/html")||V.includes("text/plain"),[j,Array.from(B.files),V]}function se(j){var B=r.$getSelection();if(!r.$isRangeSelection(B))return!1;let V=new Set;B=B.getNodes();for(let Ee=0;Ee<B.length;Ee++){var xe=B[Ee],we=xe.getKey();V.has(we)||(xe=n.$getNearestBlockElementAncestorOrThrow(xe),we=xe.getKey(),xe.canIndent()&&!V.has(we)&&(V.add(we),j(xe)))}return 0<V.size}function ge(j){return j=r.$getNearestNodeFromDOMNode(j),r.$isDecoratorNode(j)}return di.$createHeadingNode=W,di.$createQuoteNode=E,di.$isHeadingNode=function(j){return j instanceof x},di.$isQuoteNode=function(j){return j instanceof z},di.DRAG_DROP_PASTE=k,di.HeadingNode=x,di.QuoteNode=z,di.eventFiles=le,di.registerRichText=function(j){return n.mergeRegister(j.registerCommand(r.CLICK_COMMAND,()=>{const B=r.$getSelection();return r.$isNodeSelection(B)?(B.clear(),!0):!1},0),j.registerCommand(r.DELETE_CHARACTER_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteCharacter(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_WORD_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteWord(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_LINE_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteLine(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,B=>{const V=r.$getSelection();if(typeof B=="string")r.$INTERNAL_isPointSelection(V)&&V.insertText(B);else{if(!r.$INTERNAL_isPointSelection(V))return!1;const xe=B.dataTransfer;xe!=null?e.$insertDataTransferForRichText(xe,V,j):r.$isRangeSelection(V)&&(B=B.data)&&V.insertText(B)}return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(B.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_TEXT_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.formatText(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_ELEMENT_COMMAND,B=>{var V=r.$getSelection();if(!r.$isRangeSelection(V)&&!r.$isNodeSelection(V))return!1;V=V.getNodes();for(const xe of V)V=n.$findMatchingParent(xe,we=>r.$isElementNode(we)&&!we.isInline()),V!==null&&V.setFormat(B);return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_LINE_BREAK_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.insertLineBreak(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(B.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INDENT_CONTENT_COMMAND,()=>se(B=>{const V=B.getIndent();B.setIndent(V+1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>se(B=>{const V=B.getIndent();0<V&&B.setIndent(V-1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_UP_COMMAND,B=>{var V=r.$getSelection();if(r.$isNodeSelection(V)&&!ge(B.target)){if(B=V.getNodes(),0<B.length)return B[0].selectPrevious(),!0}else if(r.$isRangeSelection(V)&&(V=r.$getAdjacentNode(V.focus,!0),!B.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline()))return V.selectPrevious(),B.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_DOWN_COMMAND,B=>{var V=r.$getSelection();if(r.$isNodeSelection(V)){if(B=V.getNodes(),0<B.length)return B[0].selectNext(0,0),!0}else if(r.$isRangeSelection(V)){let xe=V.focus;if(xe.key==="root"&&xe.offset===r.$getRoot().getChildrenSize())return B.preventDefault(),!0;if(V=r.$getAdjacentNode(V.focus,!1),!B.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline())return V.selectNext(),B.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_LEFT_COMMAND,B=>{const V=r.$getSelection();if(r.$isNodeSelection(V)){var xe=V.getNodes();if(0<xe.length)return B.preventDefault(),xe[0].selectPrevious(),!0}return r.$isRangeSelection(V)&&t.$shouldOverrideDefaultCharacterSelection(V,!0)?(xe=B.shiftKey,B.preventDefault(),t.$moveCharacter(V,xe,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,B=>{const V=r.$getSelection();if(r.$isNodeSelection(V)&&!ge(B.target)){var xe=V.getNodes();if(0<xe.length)return B.preventDefault(),xe[0].selectNext(0,0),!0}return r.$isRangeSelection(V)?(xe=B.shiftKey,t.$shouldOverrideDefaultCharacterSelection(V,!1)?(B.preventDefault(),t.$moveCharacter(V,xe,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_BACKSPACE_COMMAND,B=>{if(ge(B.target))return!1;const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;B.preventDefault(),{anchor:B}=V;const xe=B.getNode();return V.isCollapsed()&&B.offset===0&&!r.$isRootNode(xe)&&0<n.$getNearestBlockElementAncestorOrThrow(xe).getIndent()?j.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_DELETE_COMMAND,B=>{if(ge(B.target))return!1;const V=r.$getSelection();return r.$isRangeSelection(V)?(B.preventDefault(),j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ENTER_COMMAND,B=>{const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;if(B!==null){if((T||N||b)&&m)return!1;if(B.preventDefault(),B.shiftKey)return j.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return j.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(j.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DROP_COMMAND,B=>{const[,V]=le(B);if(0<V.length){var xe=c(B.clientX,B.clientY);if(xe!==null){const{offset:Ee,node:ue}=xe;var we=r.$getNearestNodeFromDOMNode(ue);if(we!==null){if(xe=r.$createRangeSelection(),r.$isTextNode(we))xe.anchor.set(we.getKey(),Ee,"text"),xe.focus.set(we.getKey(),Ee,"text");else{const $=we.getParentOrThrow().getKey();we=we.getIndexWithinParent()+1,xe.anchor.set($,we,"element"),xe.focus.set($,we,"element")}xe=r.$normalizeSelection__EXPERIMENTAL(xe),r.$setSelection(xe)}j.dispatchCommand(k,V)}return B.preventDefault(),!0}return B=r.$getSelection(),!!r.$isRangeSelection(B)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGSTART_COMMAND,B=>{[B]=le(B);const V=r.$getSelection();return!(B&&!r.$isRangeSelection(V))},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGOVER_COMMAND,B=>{var[V]=le(B);const xe=r.$getSelection();return V&&!r.$isRangeSelection(xe)?!1:(V=c(B.clientX,B.clientY),V!==null&&(V=r.$getNearestNodeFromDOMNode(V.node),r.$isDecoratorNode(V)&&B.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.COPY_COMMAND,B=>(e.copyToClipboard(j,n.objectKlassEquals(B,ClipboardEvent)?B:null),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CUT_COMMAND,B=>(q(B,j),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.PASTE_COMMAND,B=>{const[,V,xe]=le(B);if(0<V.length&&!xe)return j.dispatchCommand(k,V),!0;if(r.isSelectionCapturedInDecoratorInput(B.target))return!1;const we=r.$getSelection();return r.$INTERNAL_isPointSelection(we)?(G(B,j),!0):!1},r.COMMAND_PRIORITY_EDITOR))},di}const _N=process.env.NODE_ENV==="development"?pN():mN();var ch=_N,Ul={},uh;function yN(){if(uh)return Ul;uh=1;var e=Xn(),t=gn();class n extends t.TextNode{static getType(){return"hashtag"}static clone(g){return new n(g.__text,g.__key)}constructor(g,m){super(g,m)}createDOM(g){const m=super.createDOM(g);return e.addClassNamesToElement(m,g.theme.hashtag),m}static importJSON(g){const m=r(g.text);return m.setFormat(g.format),m.setDetail(g.detail),m.setMode(g.mode),m.setStyle(g.style),m}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function c(d){return d instanceof n}return Ul.$createHashtagNode=r,Ul.$isHashtagNode=c,Ul.HashtagNode=n,Ul}var Gl={},dh;function NN(){if(dh)return Gl;dh=1;var e=Xn(),t=gn();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,g){super(d,g)}createDOM(d){let g=super.createDOM(d);return e.addClassNamesToElement(g,d.theme.hashtag),g}static importJSON(d){let g=r(d.text);return g.setFormat(d.format),g.setDetail(d.detail),g.setMode(d.mode),g.setStyle(d.style),g}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(c=""){return t.$applyNodeReplacement(new n(c))}return Gl.$createHashtagNode=r,Gl.$isHashtagNode=function(c){return c instanceof n},Gl.HashtagNode=n,Gl}const CN=process.env.NODE_ENV==="development"?yN():NN();var EN=CN;const dt={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271","yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366","yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},TN={characterLimit:dt["yext-default-richtextv2-theme__characterLimit"],code:dt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:dt["yext-default-richtextv2-theme__tokenAttr"],attr:dt["yext-default-richtextv2-theme__tokenAttr"],boolean:dt["yext-default-richtextv2-theme__tokenProperty"],builtin:dt["yext-default-richtextv2-theme__tokenSelector"],cdata:dt["yext-default-richtextv2-theme__tokenComment"],char:dt["yext-default-richtextv2-theme__tokenSelector"],class:dt["yext-default-richtextv2-theme__tokenFunction"],"class-name":dt["yext-default-richtextv2-theme__tokenFunction"],comment:dt["yext-default-richtextv2-theme__tokenComment"],constant:dt["yext-default-richtextv2-theme__tokenProperty"],deleted:dt["yext-default-richtextv2-theme__tokenProperty"],doctype:dt["yext-default-richtextv2-theme__tokenComment"],entity:dt["yext-default-richtextv2-theme__tokenOperator"],function:dt["yext-default-richtextv2-theme__tokenFunction"],important:dt["yext-default-richtextv2-theme__tokenVariable"],inserted:dt["yext-default-richtextv2-theme__tokenSelector"],keyword:dt["yext-default-richtextv2-theme__tokenAttr"],namespace:dt["yext-default-richtextv2-theme__tokenVariable"],number:dt["yext-default-richtextv2-theme__tokenProperty"],operator:dt["yext-default-richtextv2-theme__tokenOperator"],prolog:dt["yext-default-richtextv2-theme__tokenComment"],property:dt["yext-default-richtextv2-theme__tokenProperty"],punctuation:dt["yext-default-richtextv2-theme__tokenPunctuation"],regex:dt["yext-default-richtextv2-theme__tokenVariable"],selector:dt["yext-default-richtextv2-theme__tokenSelector"],string:dt["yext-default-richtextv2-theme__tokenSelector"],symbol:dt["yext-default-richtextv2-theme__tokenProperty"],tag:dt["yext-default-richtextv2-theme__tokenProperty"],url:dt["yext-default-richtextv2-theme__tokenOperator"],variable:dt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:dt["yext-default-richtextv2-theme__embedBlock"],focus:dt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:dt["yext-default-richtextv2-theme__hashtag"],heading:{h1:dt["yext-default-richtextv2-theme__h1"],h2:dt["yext-default-richtextv2-theme__h2"],h3:dt["yext-default-richtextv2-theme__h3"],h4:dt["yext-default-richtextv2-theme__h4"],h5:dt["yext-default-richtextv2-theme__h5"],h6:dt["yext-default-richtextv2-theme__h6"]},image:dt["yext-default-richtextv2-theme__image"],link:dt["yext-default-richtextv2-theme__link"],list:{listitem:dt["yext-default-richtextv2-theme__listItem"],listitemChecked:dt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:dt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:dt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[dt["yext-default-richtextv2-theme__ol1"],dt["yext-default-richtextv2-theme__ol2"],dt["yext-default-richtextv2-theme__ol3"],dt["yext-default-richtextv2-theme__ol4"],dt["yext-default-richtextv2-theme__ol5"]],ulDepth:[dt["yext-default-richtextv2-theme__ul1"],dt["yext-default-richtextv2-theme__ul2"],dt["yext-default-richtextv2-theme__ul3"]]},ltr:dt["yext-default-richtextv2-theme__ltr"],mark:dt["yext-default-richtextv2-theme__mark"],markOverlap:dt["yext-default-richtextv2-theme__markOverlap"],paragraph:dt["yext-default-richtextv2-theme__paragraph"],quote:dt["yext-default-richtextv2-theme__quote"],rtl:dt["yext-default-richtextv2-theme__rtl"],table:dt["yext-default-richtextv2-theme__table"],tableCell:dt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:dt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:dt["yext-default-richtextv2-theme__textBold"],code:dt["yext-default-richtextv2-theme__textCode"],italic:dt["yext-default-richtextv2-theme__textItalic"],strikethrough:dt["yext-default-richtextv2-theme__textStrikethrough"],subscript:dt["yext-default-richtextv2-theme__textSubscript"],superscript:dt["yext-default-richtextv2-theme__textSuperscript"],underline:dt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:dt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Ju=gn();function xN({src:e,altText:t,width:n,height:r,maxWidth:c}){const d=yt.useMemo(()=>({height:r,width:n,maxWidth:c}),[r,n,c]);return nt.jsx("img",{src:e,alt:t,style:d})}function SN({altText:e,height:t,maxWidth:n=500,src:r,width:c,key:d}){return Ju.$applyNodeReplacement(new pc(r,e,n,c,t,d))}class pc extends Ju.DecoratorNode{constructor(n,r,c,d,g,m){super(m);ke(this,"__src");ke(this,"__altText");ke(this,"__width");ke(this,"__height");ke(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=c,this.__width=d||"inherit",this.__height=g||"inherit"}static getType(){return"image"}static clone(n){return new pc(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 SN(n)}createDOM(n){const r=document.createElement("span"),c=n.theme.image;return c&&(r.className=c),r}exportDOM(n){const r=document.createElement("span"),c=n._config.theme.image;c&&(r.className=c);const d=document.createElement("img");return d.src=this.__src,this.__altText&&(d.alt=this.__altText),this.__width!=="inherit"&&this.__width&&(d.width=Number(this.__width)),this.__height!=="inherit"&&this.__height&&(d.height=Number(this.__height)),this.__maxWidth&&(d.style.maxWidth=`${this.__maxWidth}px`),d.loading="lazy",d.decoding="async",r.appendChild(d),{element:r}}updateDOM(){return!1}decorate(){return nt.jsx(xN,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}var Bo={},tu={},fh;function vN(){if(fh)return tu;fh=1;var e=so,t=gn(),n=yt;function r(d,g){return d.getEditorState().read(()=>{const m=t.$getNodeByKey(g);return m===null?!1:m.isSelected()})}function c(d){const[g]=e.useLexicalComposerContext(),[m,N]=n.useState(()=>r(g,d));n.useEffect(()=>{let b=!0;const k=g.registerUpdateListener(()=>{b&&N(r(g,d))});return()=>{b=!1,k()}},[g,d]);const T=n.useCallback(b=>{g.update(()=>{let k=t.$getSelection();t.$isNodeSelection(k)||(k=t.$createNodeSelection(),t.$setSelection(k)),t.$isNodeSelection(k)&&(b?k.add(d):k.delete(d))})},[g,d]),R=n.useCallback(()=>{g.update(()=>{const b=t.$getSelection();t.$isNodeSelection(b)&&b.clear()})},[g]);return[m,T,R]}return tu.useLexicalNodeSelection=c,tu}var nu={},hh;function wN(){if(hh)return nu;hh=1;var e=so,t=gn(),n=yt;function r(c,d){return c.getEditorState().read(()=>{let g=t.$getNodeByKey(d);return g===null?!1:g.isSelected()})}return nu.useLexicalNodeSelection=function(c){let[d]=e.useLexicalComposerContext(),[g,m]=n.useState(()=>r(d,c));n.useEffect(()=>{let R=!0,b=d.registerUpdateListener(()=>{R&&m(r(d,c))});return()=>{R=!1,b()}},[d,c]);let N=n.useCallback(R=>{d.update(()=>{let b=t.$getSelection();t.$isNodeSelection(b)||(b=t.$createNodeSelection(),t.$setSelection(b)),t.$isNodeSelection(b)&&(R?b.add(c):b.delete(c))})},[d,c]),T=n.useCallback(()=>{d.update(()=>{const R=t.$getSelection();t.$isNodeSelection(R)&&R.clear()})},[d]);return[g,N,T]},nu}var ru,gh;function Hg(){return gh||(gh=1,ru=process.env.NODE_ENV==="development"?vN():wN()),ru}var ph;function ON(){if(ph)return Bo;ph=1;var e=so,t=Hg(),n=Xn(),r=gn(),c=yt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:b}){const[k]=e.useLexicalComposerContext(),[z,E,x]=t.useLexicalNodeSelection(b),U=c.useCallback(Q=>{if(z&&r.$isNodeSelection(r.$getSelection())){Q.preventDefault();const F=r.$getNodeByKey(b);R(F)&&F.remove()}return!1},[z,b]);return c.useEffect(()=>n.mergeRegister(k.registerCommand(r.CLICK_COMMAND,Q=>{const F=k.getElementByKey(b);return Q.target===F?(Q.shiftKey||x(),E(!z),!0):!1},r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_DELETE_COMMAND,U,r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_BACKSPACE_COMMAND,U,r.COMMAND_PRIORITY_LOW)),[x,k,z,b,U,E]),c.useEffect(()=>{const Q=k.getElementByKey(b);Q!==null&&(Q.className=z?"selected":"")},[k,z,b]),null}class m extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(k){return new m(k.__key)}static importJSON(k){return T()}static importDOM(){return{hr:()=>({conversion:N,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 c.createElement(g,{nodeKey:this.__key})}}function N(){return{node:T()}}function T(){return r.$applyNodeReplacement(new m)}function R(b){return b instanceof m}return Bo.$createHorizontalRuleNode=T,Bo.$isHorizontalRuleNode=R,Bo.HorizontalRuleNode=m,Bo.INSERT_HORIZONTAL_RULE_COMMAND=d,Bo}var Ho={},mh;function AN(){if(mh)return Ho;mh=1;var e=so,t=Hg(),n=Xn(),r=gn(),c=yt;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:b}){let[k]=e.useLexicalComposerContext(),[z,E,x]=t.useLexicalNodeSelection(b),U=c.useCallback(Q=>(z&&r.$isNodeSelection(r.$getSelection())&&(Q.preventDefault(),Q=r.$getNodeByKey(b),R(Q)&&Q.remove()),!1),[z,b]);return c.useEffect(()=>n.mergeRegister(k.registerCommand(r.CLICK_COMMAND,Q=>{let F=k.getElementByKey(b);return Q.target===F?(Q.shiftKey||x(),E(!z),!0):!1},r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_DELETE_COMMAND,U,r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_BACKSPACE_COMMAND,U,r.COMMAND_PRIORITY_LOW)),[x,k,z,b,U,E]),c.useEffect(()=>{let Q=k.getElementByKey(b);Q!==null&&(Q.className=z?"selected":"")},[k,z,b]),null}class m extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(k){return new m(k.__key)}static importJSON(){return T()}static importDOM(){return{hr:()=>({conversion:N,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 c.createElement(g,{nodeKey:this.__key})}}function N(){return{node:T()}}function T(){return r.$applyNodeReplacement(new m)}function R(b){return b instanceof m}return Ho.$createHorizontalRuleNode=T,Ho.$isHorizontalRuleNode=R,Ho.HorizontalRuleNode=m,Ho.INSERT_HORIZONTAL_RULE_COMMAND=d,Ho}const MN=process.env.NODE_ENV==="development"?ON():AN();var DN=MN;class sc extends Eu.TableCellNode{static getType(){return"tablecell"}static clone(t){const n=new sc(t.__headerState,t.__colSpan,t.__width,t.__key);return n.__rowSpan=t.__rowSpan,n.__backgroundColor=t.__backgroundColor,n}static importJSON(t){const n=t.colSpan||1,r=t.rowSpan||1,c=Ju.$applyNodeReplacement(new sc(t.headerState,n,t.width||void 0));return c.__rowSpan=r,c.__backgroundColor=t.backgroundColor||null,c}exportJSON(){return super.exportJSON()}exportDOM(t){const n=super.exportDOM(t);if(n.element){const r=n.element;return r.removeAttribute("style"),r.style.width=this.getWidth()?`${this.getWidth()}px`:"",{...n,element:r}}return n}}function RN(e,t){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:e,theme:t??TN,nodes:[ch.HeadingNode,EN.HashtagNode,pc,Cf.ListNode,Cf.ListItemNode,ch.QuoteNode,Xf.CodeNode,Xf.CodeHighlightNode,Eu.TableNode,sc,Eu.TableRowNode,th.AutoLinkNode,th.LinkNode,DN.HorizontalRuleNode]}}const iu={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function bN({serializedAST:e,nodeClassNames:t}){const[n,r]=yt.useState("");return nt.jsx(nt.Fragment,{children:nt.jsxs(jy.LexicalComposer,{initialConfig:RN(e,t),children:[nt.jsx(kN,{onHTML:r}),nt.jsx("div",{className:`${iu["editor-inner"]} ${iu["no-border"]}`,children:nt.jsx("div",{className:iu["editor-inner"],children:nt.jsx("div",{dangerouslySetInnerHTML:{__html:n}})})})]})})}function kN({onHTML:e}){const[t]=so.useLexicalComposerContext();return yt.useEffect(()=>{t.update(()=>{const n=Zu.$generateHtmlFromNodes(t);e(n)})},[t,e]),null}function mc(e,t,n,r){const c=e.length;let d=0,g;if(t<0?t=-t>c?0:c+t:t=t>c?c:t,n=n>0?n:0,r.length<1e4)g=Array.from(r),g.unshift(t,n),[].splice.apply(e,g);else for(n&&[].splice.apply(e,[t,n]);d<r.length;)g=r.slice(d,d+1e4),g.unshift(t,0),[].splice.apply(e,g),d+=1e4,t+=1e4}function Uo(e,t){return e.length>0?(mc(e,e.length,0,t),e):t}const _h={}.hasOwnProperty;function Wg(e){const t={};let n=-1;for(;++n<e.length;)IN(t,e[n]);return t}function IN(e,t){let n;for(n in t){const c=(_h.call(e,n)?e[n]:void 0)||(e[n]={}),d=t[n];let g;for(g in d){_h.call(c,g)||(c[g]=[]);const m=d[g];LN(c[g],Array.isArray(m)?m:m?[m]:[])}}}function LN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mc(e,0,0,r)}const Xi={plusSign:43,caret:94,tilde:126};var yh=Object.prototype.hasOwnProperty;function Nh(e,t,n){for(n of e.keys())if(ea(n,t))return n}function ea(e,t){var n,r,c;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--&&ea(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(c=r,c&&typeof c=="object"&&(c=Nh(t,c),!c)||!t.has(c))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(c=r[0],c&&typeof c=="object"&&(c=Nh(t,c),!c)||!ea(r[1],t.get(c)))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(yh.call(e,n)&&++r&&!yh.call(t,n)||!(n in t)||!ea(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}let Tu,Kg,zg,Ug,Gg=!0;typeof process<"u"&&({FORCE_COLOR:Tu,NODE_DISABLE_COLORS:Kg,NO_COLOR:zg,TERM:Ug}=process.env||{},Gg=process.stdout&&process.stdout.isTTY);const Xt={enabled:!Kg&&zg==null&&Ug!=="dumb"&&(Tu!=null&&Tu!=="0"||Gg),reset:_n(0,0),bold:_n(1,22),dim:_n(2,22),italic:_n(3,23),underline:_n(4,24),inverse:_n(7,27),hidden:_n(8,28),strikethrough:_n(9,29),black:_n(30,39),red:_n(31,39),green:_n(32,39),yellow:_n(33,39),blue:_n(34,39),magenta:_n(35,39),cyan:_n(36,39),white:_n(37,39),gray:_n(90,39),grey:_n(90,39),bgBlack:_n(40,49),bgRed:_n(41,49),bgGreen:_n(42,49),bgYellow:_n(43,49),bgBlue:_n(44,49),bgMagenta:_n(45,49),bgCyan:_n(46,49),bgWhite:_n(47,49)};function Ch(e,t){let n=0,r,c="",d="";for(;n<e.length;n++)r=e[n],c+=r.open,d+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return c+t+d}function PN(e,t){let n={has:e,keys:t};return n.reset=Xt.reset.bind(n),n.bold=Xt.bold.bind(n),n.dim=Xt.dim.bind(n),n.italic=Xt.italic.bind(n),n.underline=Xt.underline.bind(n),n.inverse=Xt.inverse.bind(n),n.hidden=Xt.hidden.bind(n),n.strikethrough=Xt.strikethrough.bind(n),n.black=Xt.black.bind(n),n.red=Xt.red.bind(n),n.green=Xt.green.bind(n),n.yellow=Xt.yellow.bind(n),n.blue=Xt.blue.bind(n),n.magenta=Xt.magenta.bind(n),n.cyan=Xt.cyan.bind(n),n.white=Xt.white.bind(n),n.gray=Xt.gray.bind(n),n.grey=Xt.grey.bind(n),n.bgBlack=Xt.bgBlack.bind(n),n.bgRed=Xt.bgRed.bind(n),n.bgGreen=Xt.bgGreen.bind(n),n.bgYellow=Xt.bgYellow.bind(n),n.bgBlue=Xt.bgBlue.bind(n),n.bgMagenta=Xt.bgMagenta.bind(n),n.bgCyan=Xt.bgCyan.bind(n),n.bgWhite=Xt.bgWhite.bind(n),n}function _n(e,t){let n={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),r===void 0?this:Xt.enabled?Ch(this.keys,r+""):r+""):r===void 0?PN([e],[n]):Xt.enabled?Ch([n],r+""):r+""}}function Ts(){}Ts.prototype={diff:function(t,n){var r,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=c.callback;typeof c=="function"&&(d=c,c={}),this.options=c;var g=this;function m(G){return d?(setTimeout(function(){d(void 0,G)},0),!0):G}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var N=n.length,T=t.length,R=1,b=N+T;c.maxEditLength&&(b=Math.min(b,c.maxEditLength));var k=(r=c.timeout)!==null&&r!==void 0?r:1/0,z=Date.now()+k,E=[{oldPos:-1,lastComponent:void 0}],x=this.extractCommon(E[0],n,t,0);if(E[0].oldPos+1>=T&&x+1>=N)return m([{value:this.join(n),count:n.length}]);var U=-1/0,Q=1/0;function F(){for(var G=Math.max(U,-R);G<=Math.min(Q,R);G+=2){var q=void 0,le=E[G-1],se=E[G+1];le&&(E[G-1]=void 0);var ge=!1;if(se){var j=se.oldPos-G;ge=se&&0<=j&&j<N}var B=le&&le.oldPos+1<T;if(!ge&&!B){E[G]=void 0;continue}if(!B||ge&&le.oldPos+1<se.oldPos?q=g.addToPath(se,!0,void 0,0):q=g.addToPath(le,void 0,!0,1),x=g.extractCommon(q,n,t,G),q.oldPos+1>=T&&x+1>=N)return m($N(g,q.lastComponent,n,t,g.useLongestToken));E[G]=q,q.oldPos+1>=T&&(Q=Math.min(Q,G-1)),x+1>=N&&(U=Math.max(U,G+1))}R++}if(d)(function G(){setTimeout(function(){if(R>b||Date.now()>z)return d();F()||G()},0)})();else for(;R<=b&&Date.now()<=z;){var W=F();if(W)return W}},addToPath:function(t,n,r,c){var d=t.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:t.oldPos+c,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:t.oldPos+c,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(t,n,r,c){for(var d=n.length,g=r.length,m=t.oldPos,N=m-c,T=0;N+1<d&&m+1<g&&this.equals(n[N+1],r[m+1]);)N++,m++,T++;return T&&(t.lastComponent={count:T,previousComponent:t.lastComponent}),t.oldPos=m,N},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 $N(e,t,n,r,c){for(var d=[],g;t;)d.push(t),g=t.previousComponent,delete t.previousComponent,t=g;d.reverse();for(var m=0,N=d.length,T=0,R=0;m<N;m++){var b=d[m];if(b.removed){if(b.value=e.join(r.slice(R,R+b.count)),R+=b.count,m&&d[m-1].added){var z=d[m-1];d[m-1]=d[m],d[m]=z}}else{if(!b.added&&c){var k=n.slice(T,T+b.count);k=k.map(function(x,U){var Q=r[R+U];return Q.length>x.length?Q:x}),b.value=e.join(k)}else b.value=e.join(n.slice(T,T+b.count));T+=b.count,b.added||(R+=b.count)}}var E=d[N-1];return N>1&&typeof E.value=="string"&&(E.added||E.removed)&&e.equals("",E.value)&&(d[N-2].value+=E.value,d.pop()),d}var Eh=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Th=/\S/,Yg=new Ts;Yg.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Th.test(e)&&!Th.test(t)};Yg.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]&&Eh.test(t[n])&&Eh.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var jg=new Ts;jg.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 c=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),t.push(c))}return t};var FN=new Ts;FN.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var BN=new Ts;BN.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Qa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qa=function(t){return typeof t}:Qa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qa(e)}var HN=Object.prototype.toString,na=new Ts;na.useLongestToken=!0;na.tokenize=jg.tokenize;na.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,c=r===void 0?function(d,g){return typeof g>"u"?n:g}:r;return typeof e=="string"?e:JSON.stringify(xu(e,null,null,c),c," ")};na.equals=function(e,t){return Ts.prototype.equals.call(na,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function xu(e,t,n,r,c){t=t||[],n=n||[],r&&(e=r(c,e));var d;for(d=0;d<t.length;d+=1)if(t[d]===e)return n[d];var g;if(HN.call(e)==="[object Array]"){for(t.push(e),g=new Array(e.length),n.push(g),d=0;d<e.length;d+=1)g[d]=xu(e[d],t,n,r,c);return t.pop(),n.pop(),g}if(e&&e.toJSON&&(e=e.toJSON()),Qa(e)==="object"&&e!==null){t.push(e),g={},n.push(g);var m=[],N;for(N in e)e.hasOwnProperty(N)&&m.push(N);for(m.sort(),d=0;d<m.length;d+=1)N=m[d],g[N]=xu(e[N],t,n,r,N);t.pop(),n.pop()}else g=e;return g}var Su=new Ts;Su.tokenize=function(e){return e.slice()};Su.join=Su.removeEmpty=function(e){return e};Xt.red,Xt.grey,Xt.green;Xt.dim().italic;Xt.dim("→");Xt.dim("·");Xt.dim("↵");function oc(e){e=e.replace(/\r?\n/g,`
|
|
102
|
+
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,c=(t||[]).length;for(;n<c;n++)r=Math.min(r,t[n].length);return c&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class WN 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 ti(e,t,n,r,c,d,g){if(e)return;let m=g||d;if(g instanceof Error)throw g;let N=c;throw new WN({actual:t,expects:n,operator:r,message:m,details:N,generated:!g})}function _c(e,t){ti(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}function Qi(e,t){ti(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}Qi.ok=Qi;Qi.equal=function(e,t,n){ti(!ea(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};Qi.type=function(e,t,n){let r=typeof e;ti(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};Qi.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";ti(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};Qi.snapshot=function(e,t,n){e=oc(e),t=oc(t),ti(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};Qi.fixture=function(e,t,n){e=oc(e),t=oc(t),ti(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};Qi.match=function(e,t,n){typeof t=="string"?ti(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):ti(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};Qi.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?ti(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?ti(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||ti(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const KN=/[!-\/:-@\[-`\{-~\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]/,zN=xs(/[A-Za-z]/),vu=xs(/[\dA-Za-z]/),UN=xs(/[#-'*+\--9=?A-Z^-~]/);function GN(e){return e!==null&&(e<32||e===127)}const YN=xs(/\d/),jN=xs(/[\dA-Fa-f]/),VN=xs(/[!-/:-@[-`{-~]/);function qN(e){return e!==null&&e<-2}function Vg(e){return e!==null&&(e<0||e===32)}function ZN(e){return e===-2||e===-1||e===32}const JN=xs(KN),XN=xs(/\s/);function xs(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function ra(e){if(e===null||Vg(e)||XN(e))return 1;if(JN(e))return 2}const lc={characterGroupPunctuation:2};function QN(e,t){const n=this.previous,r=ra(n);return c;function c(g){return _c(g===Xi.tilde,"expected `~`"),e.enter("tildeSequenceTemporary"),d(g)}function d(g){if(g===Xi.tilde)return e.consume(g),d;const m=e.exit("tildeSequenceTemporary"),N=ra(g);return m._open=!N||N===lc.characterGroupPunctuation&&!!r,m._close=!r||r===lc.characterGroupPunctuation&&!!N,t(g)}}function qg(e,t,n){const r=[];let c=-1;for(;++c<e.length;){const d=e[c].resolveAll;d&&!r.includes(d)&&(t=d(t,n),r.push(d))}return t}const eC={data:"data"};function Xu(e,t){return!!(e[0]==="enter"&&e[1].type===`${t}SequenceTemporary`&&e[1]._close)}function Qu(e,t){return!!(e[0]==="exit"&&e[1].type===`${t}SequenceTemporary`&&e[1]._open)}function ed(e,t,n,r,c,d){const[g,m,N,T]=tC(e[t],e[n],c,d);e[t][1].end=Object.assign({},g.start),e[n][1].start=Object.assign({},m.end);let R=[];e[t][1].end.offset-e[t][1].start.offset&&(R=Uo(R,[["enter",e[t][1],r],["exit",e[t][1],r]])),R=Uo(R,[["enter",T,r],["enter",g,r],["exit",g,r],["enter",N,r]]),R=Uo(R,qg(r.parser.constructs.insideSpan.null,e.slice(t+1,n),r)),R=Uo(R,[["exit",N,r],["enter",m,r],["exit",m,r],["exit",T,r]]);let b=0;return e[n][1].end.offset-e[n][1].start.offset&&(b=2,R=Uo(R,[["enter",e[n][1],r],["exit",e[n][1],r]])),mc(e,t-1,n-t+3,R),t+R.length-b-2}function tC(e,t,n,r){const c=Object.assign({},e[1].end),d=Object.assign({},t[1].start);xh(c,-r),xh(d,r);const g={type:`${n}Sequence`,start:c,end:Object.assign({},e[1].end)},m={type:`${n}Sequence`,start:Object.assign({},t[1].start),end:d},N={type:`${n}Text`,start:Object.assign({},e[1].end),end:Object.assign({},t[1].start)},T={type:`${n}`,start:Object.assign({},g.start),end:Object.assign({},m.end)};return[g,m,N,T]}function xh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function td(e,t){e.forEach(n=>{n[1].type===`${t}SequenceTemporary`&&(n[1].type=eC.data)})}function nC(e,t){let n=-1;for(;++n<e.length;)if(Xu(e[n],"tilde")){let r=n;for(;r--;)if(Qu(e[r],"tilde")){const c=rC(e[r],e[n]);n=ed(e,r,n,t,c===1?"subscript":"strikethrough",c);break}}return td(e,"tilde"),e}function rC(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 iC(){const e={tokenize:QN,resolveAll:nC};return{text:{[Xi.tilde]:e},insideSpan:{null:[e]}}}function sC(e,t){let n=-1;for(;++n<e.length;)if(Xu(e[n],"superscript")){let r=n;for(;r--;)if(Qu(e[r],"superscript")){n=ed(e,r,n,t,"superscript",1);break}}return td(e,"superscript"),e}function oC(e,t){return n;function n(c){return _c(c===Xi.caret,"expected `^`"),e.enter("superscriptSequenceTemporary"),r(c)}function r(c){if(c===Xi.caret)return e.consume(c),r;const d=e.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,t(c)}}function lC(){const e={tokenize:oC,resolveAll:sC};return{text:{[Xi.caret]:e},insideSpan:{null:[e]}}}function aC(e,t,n){const r=this.previous,c=ra(r);let d=0;return g;function g(N){return _c(N===Xi.plusSign,"expected `+`"),e.enter("underlineSequenceTemporary"),m(N)}function m(N){if(N===Xi.plusSign)return e.consume(N),d++,m;if(d<2)return n(N);const T=e.exit("underlineSequenceTemporary"),R=ra(N);return T._open=!R||R===lc.characterGroupPunctuation&&!!c,T._close=!c||c===lc.characterGroupPunctuation&&!!R,t(N)}}function cC(e,t){let n=-1;for(;++n<e.length;)if(Xu(e[n],"underline")&&e[n][1].end.offset-e[n][1].start.offset>1){let r=n;for(;r--;)if(Qu(e[r],"underline")&&e[r][1].end.offset-e[r][1].start.offset>1){n=ed(e,r,n,t,"underline",2);break}}return td(e,"underline"),e}function uC(){const e={tokenize:aC,resolveAll:cC};return{text:{[Xi.plusSign]:e},insideSpan:{null:[e]}}}function dC(){return Wg([uC(),lC(),iC()])}const fC={canContainEols:["strikethrough"],enter:{strikethrough:hC},exit:{strikethrough:gC}};function hC(e){this.enter({type:"strikethrough",children:[]},e)}function gC(e){this.exit(e)}const pC={canContainEols:["subscript"],enter:{subscript:mC},exit:{subscript:_C}};function mC(e){this.enter({type:"subscript",children:[]},e)}function _C(e){this.exit(e)}const yC={canContainEols:["superscript"],enter:{superscript:NC},exit:{superscript:CC}};function NC(e){this.enter({type:"superscript",children:[]},e)}function CC(e){this.exit(e)}const EC={canContainEols:["underline"],enter:{underline:TC},exit:{underline:xC}};function TC(e){this.enter({type:"underline",children:[]},e)}function xC(e){this.exit(e)}function SC(){return[EC,fC,pC,yC]}function vC(){const e=this.data();t("micromarkExtensions",dC()),t("fromMarkdownExtensions",SC());function t(n,r){const c=e[n];c?(_c(Array.isArray(c)),c.push(r)):e[n]=[r]}}function wC(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 OC(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
103
|
+
`}]}function AC(e,t){const n=t.value?t.value+`
|
|
104
|
+
`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,c={};r&&(c.className=["language-"+r]);let d={type:"element",tagName:"code",properties:c,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 MC(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DC(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function el(e){const t=[];let n=-1,r=0,c=0;for(;++n<e.length;){const d=e.charCodeAt(n);let g="";if(d===37&&vu(e.charCodeAt(n+1))&&vu(e.charCodeAt(n+2)))c=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(g=String.fromCharCode(d));else if(d>55295&&d<57344){const m=e.charCodeAt(n+1);d<56320&&m>56319&&m<57344?(g=String.fromCharCode(d,m),c=1):g="�"}else g=String.fromCharCode(d);g&&(t.push(e.slice(r,n),encodeURIComponent(g)),r=n+c+1,g=""),c&&(n+=c,c=0)}return t.join("")+e.slice(r)}function Zg(e,t){const n=String(t.identifier).toUpperCase(),r=el(n.toLowerCase()),c=e.footnoteOrder.indexOf(n);let d;c===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,d=e.footnoteOrder.length):(e.footnoteCounts[n]++,d=c+1);const g=e.footnoteCounts[n],m={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(g>1?"-"+g:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,m);const N={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,N),e.applyData(t,N)}function RC(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const c=String(r);return n[c]={type:"footnoteDefinition",identifier:c,children:[{type:"paragraph",children:t.children}],position:t.position},Zg(e,{type:"footnoteReference",identifier:c,position:t.position})}function bC(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 kC(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function Jg(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 c=e.all(t),d=c[0];d&&d.type==="text"?d.value="["+d.value:c.unshift({type:"text",value:"["});const g=c[c.length-1];return g&&g.type==="text"?g.value+=r:c.push({type:"text",value:r}),c}function IC(e,t){const n=e.definition(t.identifier);if(!n)return Jg(e,t);const r={src:el(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,c),e.applyData(t,c)}function LC(e,t){const n={src:el(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 PC(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 $C(e,t){const n=e.definition(t.identifier);if(!n)return Jg(e,t);const r={href:el(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function FC(e,t){const n={href:el(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 BC(e,t,n){const r=e.all(t),c=n?HC(n):Xg(t),d={},g=[];if(typeof t.checked=="boolean"){const R=r[0];let b;R&&R.type==="element"&&R.tagName==="p"?b=R:(b={type:"element",tagName:"p",properties:{},children:[]},r.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m<r.length;){const R=r[m];(c||m!==0||R.type!=="element"||R.tagName!=="p")&&g.push({type:"text",value:`
|
|
105
105
|
`}),R.type==="element"&&R.tagName==="p"&&!c?g.push(...R.children):g.push(R)}const N=r[r.length-1];N&&(c||N.type!=="element"||N.tagName!=="p")&&g.push({type:"text",value:`
|
|
106
|
-
`});const T={type:"element",tagName:"li",properties:d,children:g};return e.patch(t,T),e.applyData(t,T)}function
|
|
106
|
+
`});const T={type:"element",tagName:"li",properties:d,children:g};return e.patch(t,T),e.applyData(t,T)}function HC(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=Xg(n[r])}return t}function Xg(e){const t=e.spread;return t??e.children.length>1}function WC(e,t){const n={},r=e.all(t);let c=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++c<r.length;){const g=r[c];if(g.type==="element"&&g.tagName==="li"&&g.properties&&Array.isArray(g.properties.className)&&g.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 KC(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zC(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function UC(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const nd=Qg("start"),rd=Qg("end");function GC(e){return{start:nd(e),end:rd(e)}}function Qg(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 YC(e,t){const n=e.all(t),r=n.shift(),c=[];if(r){const g={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],g),c.push(g)}if(n.length>0){const g={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},m=nd(t.children[1]),N=rd(t.children[t.children.length-1]);m.line&&N.line&&(g.position={start:m,end:N}),c.push(g)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function jC(e,t,n){const r=n?n.children:void 0,d=(r?r.indexOf(t):1)===0?"th":"td",g=n&&n.type==="table"?n.align:void 0,m=g?g.length:t.children.length;let N=-1;const T=[];for(;++N<m;){const b=t.children[N],k={},z=g?g[N]:void 0;z&&(k.align=z);let E={type:"element",tagName:d,properties:k,children:[]};b&&(E.children=e.all(b),e.patch(b,E),E=e.applyData(t,E)),T.push(E)}const R={type:"element",tagName:"tr",properties:{},children:e.wrap(T,!0)};return e.patch(t,R),e.applyData(t,R)}function VC(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Sh=9,vh=32;function qC(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),c=0;const d=[];for(;r;)d.push(wh(t.slice(c,r.index),c>0,!0),r[0]),c=r.index+r[0].length,r=n.exec(t);return d.push(wh(t.slice(c),c>0,!1)),d.join("")}function wh(e,t,n){let r=0,c=e.length;if(t){let d=e.codePointAt(r);for(;d===Sh||d===vh;)r++,d=e.codePointAt(r)}if(n){let d=e.codePointAt(c-1);for(;d===Sh||d===vh;)c--,d=e.codePointAt(c-1)}return c>r?e.slice(r,c):""}function ZC(e,t){const n={type:"text",value:qC(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const XC={blockquote:wC,break:OC,code:AC,delete:MC,emphasis:DC,footnoteReference:Zg,footnote:RC,heading:bC,html:kC,imageReference:IC,image:LC,inlineCode:PC,linkReference:$C,link:FC,listItem:BC,list:WC,paragraph:KC,root:zC,strong:UC,table:YC,tableCell:VC,tableRow:jC,text:ZC,thematicBreak:JC,toml:ja,yaml:ja,definition:ja,footnoteDefinition:ja};function ja(){return null}const ep=function(e){if(e==null)return nE;if(typeof e=="string")return tE(e);if(typeof e=="object")return Array.isArray(e)?QC(e):eE(e);if(typeof e=="function")return yc(e);throw new Error("Expected function, string, or object as test")};function QC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ep(e[n]);return yc(r);function r(...c){let d=-1;for(;++d<t.length;)if(t[d].call(this,...c))return!0;return!1}}function eE(e){return yc(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function tE(e){return yc(t);function t(n){return n&&n.type===e}}function yc(e){return t;function t(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&e.call(this,n,...r))}}function nE(){return!0}const rE=!0,Oh=!1,iE="skip",sE=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const c=ep(t),d=r?-1:1;g(e,void 0,[])();function g(m,N,T){const R=m&&typeof m=="object"?m:{};if(typeof R.type=="string"){const k=typeof R.tagName=="string"?R.tagName:typeof R.name=="string"?R.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(k?"<"+k+">":""))+")"})}return b;function b(){let k=[],z,E,x;if((!t||c(m,N,T[T.length-1]||null))&&(k=oE(n(m,T)),k[0]===Oh))return k;if(m.children&&k[0]!==iE)for(E=(r?m.children.length:-1)+d,x=T.concat(m);E>-1&&E<m.children.length;){if(z=g(m.children[E],E,x)(),z[0]===Oh)return z;E=typeof z[1]=="number"?z[1]:E+d}return k}}};function oE(e){return Array.isArray(e)?e:typeof e=="number"?[rE,e]:[e]}const id=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),sE(e,t,c,r);function c(d,g){const m=g[g.length-1];return n(d,m?m.children.indexOf(d):null,m)}};function lE(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 Ah={}.hasOwnProperty;function aE(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return id(e,"definition",r=>{const c=Mh(r.identifier);c&&!Ah.call(t,c)&&(t[c]=r)}),n;function n(r){const c=Mh(r);return c&&Ah.call(t,c)?t[c]:null}}function Mh(e){return String(e||"").toUpperCase()}const ac={}.hasOwnProperty;function cE(e,t){const n=t||{},r=n.allowDangerousHtml||!1,c={};return g.dangerous=r,g.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,g.footnoteLabel=n.footnoteLabel||"Footnotes",g.footnoteLabelTagName=n.footnoteLabelTagName||"h2",g.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},g.footnoteBackLabel=n.footnoteBackLabel||"Back to content",g.unknownHandler=n.unknownHandler,g.passThrough=n.passThrough,g.handlers={...XC,...n.handlers},g.definition=aE(e),g.footnoteById=c,g.footnoteOrder=[],g.footnoteCounts={},g.patch=uE,g.applyData=dE,g.one=m,g.all=N,g.wrap=hE,g.augment=d,id(e,"footnoteDefinition",T=>{const R=String(T.identifier).toUpperCase();ac.call(c,R)||(c[R]=T)}),g;function d(T,R){if(T&&"data"in T&&T.data){const b=T.data;b.hName&&(R.type!=="element"&&(R={type:"element",tagName:"",properties:{},children:[]}),R.tagName=b.hName),R.type==="element"&&b.hProperties&&(R.properties={...R.properties,...b.hProperties}),"children"in R&&R.children&&b.hChildren&&(R.children=b.hChildren)}if(T){const b="type"in T?T:{position:T};lE(b)||(R.position={start:nd(b),end:rd(b)})}return R}function g(T,R,b,k){return Array.isArray(b)&&(k=b,b={}),d(T,{type:"element",tagName:R,properties:b||{},children:k||[]})}function m(T,R){return tp(g,T,R)}function N(T){return ts(g,T)}}function uE(e,t){e.position&&(t.position=GC(e))}function dE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,c=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&&c!==null&&c!==void 0&&(n.children=c)}return n}function tp(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return ac.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:ts(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):fE(e,t)}function ts(e,t){const n=[];if("children"in t){const r=t.children;let c=-1;for(;++c<r.length;){const d=tp(e,r[c],t);if(d){if(c&&r[c-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=d.value.replace(/^\s+/,"")),!Array.isArray(d)&&d.type==="element")){const g=d.children[0];g&&g.type==="text"&&(g.value=g.value.replace(/^\s+/,""))}Array.isArray(d)?n.push(...d):n.push(d)}}}return n}function fE(e,t){const n=t.data||{},r="value"in t&&!(ac.call(n,"hProperties")||ac.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:ts(e,t)};return e.patch(t,r),e.applyData(t,r)}function hE(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 hE=(e,t)=>e(t,"i",es(e,t)),gE=(e,t)=>e(t,"b",es(e,t)),pE=(e,t)=>e(t,"u",es(e,t)),mE=(e,t)=>e(t,"s",es(e,t)),_E=(e,t)=>e(t,"sub",es(e,t)),yE=(e,t)=>e(t,"sup",es(e,t)),NE={emphasis:hE,strong:gE,underline:pE,strikethrough:mE,subscript:_E,superscript:yE},CE=e=>{const[t,n]=yt.useState();let r;return yt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-GjPmS5iw.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[SC],remarkRehypeOptions:{handlers:NE}});n(d)})()},[e.markdown]),t||null};class oo extends Error{}class EE extends oo{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class TE extends oo{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class xE extends oo{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Go extends oo{}class np extends oo{constructor(t){super(`Invalid unit ${t}`)}}class gr extends oo{}class ps extends oo{constructor(){super("Zone is an abstract class")}}const lt="numeric",gi="short",zr="long",cc={year:lt,month:lt,day:lt},rp={year:lt,month:gi,day:lt},SE={year:lt,month:gi,day:lt,weekday:gi},ip={year:lt,month:zr,day:lt},sp={year:lt,month:zr,day:lt,weekday:zr},op={hour:lt,minute:lt},lp={hour:lt,minute:lt,second:lt},ap={hour:lt,minute:lt,second:lt,timeZoneName:gi},cp={hour:lt,minute:lt,second:lt,timeZoneName:zr},up={hour:lt,minute:lt,hourCycle:"h23"},dp={hour:lt,minute:lt,second:lt,hourCycle:"h23"},fp={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:gi},hp={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:zr},gp={year:lt,month:lt,day:lt,hour:lt,minute:lt},pp={year:lt,month:lt,day:lt,hour:lt,minute:lt,second:lt},mp={year:lt,month:gi,day:lt,hour:lt,minute:lt},_p={year:lt,month:gi,day:lt,hour:lt,minute:lt,second:lt},vE={year:lt,month:gi,day:lt,weekday:gi,hour:lt,minute:lt},yp={year:lt,month:zr,day:lt,hour:lt,minute:lt,timeZoneName:gi},Np={year:lt,month:zr,day:lt,hour:lt,minute:lt,second:lt,timeZoneName:gi},Cp={year:lt,month:zr,day:lt,weekday:zr,hour:lt,minute:lt,timeZoneName:zr},Ep={year:lt,month:zr,day:lt,weekday:zr,hour:lt,minute:lt,second:lt,timeZoneName:zr};class sa{get type(){throw new ps}get name(){throw new ps}get ianaName(){return this.name}get isUniversal(){throw new ps}offsetName(t,n){throw new ps}formatOffset(t,n){throw new ps}offset(t){throw new ps}equals(t){throw new ps}get isValid(){throw new ps}}let su=null;class Nc extends sa{static get instance(){return su===null&&(su=new Nc),su}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return bp(t,n,r)}formatOffset(t,n){return ta(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const wu=new Map;function wE(e){let t=wu.get(e);return t===void 0&&(t=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"}),wu.set(e,t)),t}const OE={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function AE(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,c,d,g,m,N,T,R]=r;return[g,c,d,m,N,T,R]}function ME(e,t){const n=e.formatToParts(t),r=[];for(let c=0;c<n.length;c++){const{type:d,value:g}=n[c],m=OE[d];d==="era"?r[m]=g:kt(m)||(r[m]=parseInt(g,10))}return r}const ou=new Map;class Qi extends sa{static create(t){let n=ou.get(t);return n===void 0&&ou.set(t,n=new Qi(t)),n}static resetCache(){ou.clear(),wu.clear()}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=Qi.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return bp(t,n,r,this.name)}formatOffset(t,n){return ta(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=wE(this.name);let[c,d,g,m,N,T,R]=r.formatToParts?ME(r,n):AE(r,n);m==="BC"&&(c=-Math.abs(c)+1);const k=Ec({year:c,month:d,day:g,hour:N===24?0:N,minute:T,second:R,millisecond:0});let z=+n;const E=z%1e3;return z-=E>=0?E:1e3+E,(k-z)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Dh={};function DE(e,t={}){const n=JSON.stringify([e,t]);let r=Dh[n];return r||(r=new Intl.ListFormat(e,t),Dh[n]=r),r}const Ou=new Map;function Au(e,t={}){const n=JSON.stringify([e,t]);let r=Ou.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),Ou.set(n,r)),r}const Mu=new Map;function RE(e,t={}){const n=JSON.stringify([e,t]);let r=Mu.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),Mu.set(n,r)),r}const Du=new Map;function bE(e,t={}){const{base:n,...r}=t,c=JSON.stringify([e,r]);let d=Du.get(c);return d===void 0&&(d=new Intl.RelativeTimeFormat(e,t),Du.set(c,d)),d}let ql=null;function kE(){return ql||(ql=new Intl.DateTimeFormat().resolvedOptions().locale,ql)}const Ru=new Map;function Tp(e){let t=Ru.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Ru.set(e,t)),t}const bu=new Map;function IE(e){let t=bu.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...xp,...t}),bu.set(e,t)}return t}function LE(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,c;try{r=Au(e).resolvedOptions(),c=e}catch{const N=e.substring(0,n);r=Au(N).resolvedOptions(),c=N}const{numberingSystem:d,calendar:g}=r;return[c,d,g]}}function PE(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function $E(e){const t=[];for(let n=1;n<=12;n++){const r=St.utc(2009,n,1);t.push(e(r))}return t}function FE(e){const t=[];for(let n=1;n<=7;n++){const r=St.utc(2016,11,13+n);t.push(e(r))}return t}function Va(e,t,n,r){const c=e.listingMode();return c==="error"?null:c==="en"?n(t):r(t)}function BE(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||Tp(e.locale).numberingSystem==="latn"}class HE{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:c,floor:d,...g}=r;if(!n||Object.keys(g).length>0){const m={useGrouping:!1,...r};r.padTo>0&&(m.minimumIntegerDigits=r.padTo),this.inf=RE(t,m)}}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):cd(t,3);return Hn(n,this.padTo)}}}class WE{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let c;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const g=-1*(t.offset/60),m=g>=0?`Etc/GMT+${g}`:`Etc/GMT${g}`;t.offset!==0&&Qi.create(m).valid?(c=m,this.dt=t):(c="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,c=t.zone.name):(c="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||c,this.dtf=Au(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 KE{constructor(t,n,r){this.opts={style:"long",...r},!n&&Dp()&&(this.rtf=bE(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):uT(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const xp={firstDay:1,minimalDays:4,weekend:[6,7]};class cn{static fromOpts(t){return cn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,c,d=!1){const g=t||Dn.defaultLocale,m=g||(d?"en-US":kE()),N=n||Dn.defaultNumberingSystem,T=r||Dn.defaultOutputCalendar,R=Iu(c)||Dn.defaultWeekSettings;return new cn(m,N,T,R,g)}static resetCache(){ql=null,Ou.clear(),Mu.clear(),Du.clear(),Ru.clear(),bu.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:c}={}){return cn.create(t,n,r,c)}constructor(t,n,r,c,d){const[g,m,N]=LE(t);this.locale=g,this.numberingSystem=n||m||null,this.outputCalendar=r||N||null,this.weekSettings=c,this.intl=PE(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=BE(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:cn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Iu(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 Va(this,t,Lp,()=>{const r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;const c=n?{month:t,day:"numeric"}:{month:t},d=n?"format":"standalone";if(!this.monthsCache[d][t]){const g=r?m=>this.dtFormatter(m,c).format():m=>this.extract(m,c,"month");this.monthsCache[d][t]=$E(g)}return this.monthsCache[d][t]})}weekdays(t,n=!1){return Va(this,t,Fp,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},c=n?"format":"standalone";return this.weekdaysCache[c][t]||(this.weekdaysCache[c][t]=FE(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[c][t]})}meridiems(){return Va(this,void 0,()=>Bp,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[St.utc(2016,11,13,9),St.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Va(this,t,Hp,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[St.utc(-40,1,1),St.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const c=this.dtFormatter(t,n),d=c.formatToParts(),g=d.find(m=>m.type.toLowerCase()===r);return g?g.value:null}numberFormatter(t={}){return new HE(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new WE(t,this.intl,n)}relFormatter(t={}){return new KE(this.intl,this.isEnglish(),t)}listFormatter(t={}){return DE(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Tp(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Rp()?IE(this.locale):xp}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let lu=null;class Tr extends sa{static get utcInstance(){return lu===null&&(lu=new Tr(0)),lu}static instance(t){return t===0?Tr.utcInstance:new Tr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tr(Tc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ta(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ta(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ta(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 zE extends sa{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 _s(e,t){if(kt(e)||e===null)return t;if(e instanceof sa)return e;if(qE(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Nc.instance:n==="utc"||n==="gmt"?Tr.utcInstance:Tr.parseSpecifier(n)||Qi.create(e)}else return ys(e)?Tr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new zE(e)}const sd={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Rh={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]},UE=sd.hanidec.replace(/[\[|\]]/g,"").split("");function GE(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(sd.hanidec)!==-1)t+=UE.indexOf(e[n]);else for(const c in Rh){const[d,g]=Rh[c];r>=d&&r<=g&&(t+=r-d)}}return parseInt(t,10)}else return t}const ku=new Map;function YE(){ku.clear()}function di({numberingSystem:e},t=""){const n=e||"latn";let r=ku.get(n);r===void 0&&(r=new Map,ku.set(n,r));let c=r.get(t);return c===void 0&&(c=new RegExp(`${sd[n]}${t}`),r.set(t,c)),c}let bh=()=>Date.now(),kh="system",Ih=null,Lh=null,Ph=null,$h=60,Fh,Bh=null;class Dn{static get now(){return bh}static set now(t){bh=t}static set defaultZone(t){kh=t}static get defaultZone(){return _s(kh,Nc.instance)}static get defaultLocale(){return Ih}static set defaultLocale(t){Ih=t}static get defaultNumberingSystem(){return Lh}static set defaultNumberingSystem(t){Lh=t}static get defaultOutputCalendar(){return Ph}static set defaultOutputCalendar(t){Ph=t}static get defaultWeekSettings(){return Bh}static set defaultWeekSettings(t){Bh=Iu(t)}static get twoDigitCutoffYear(){return $h}static set twoDigitCutoffYear(t){$h=t%100}static get throwOnInvalid(){return Fh}static set throwOnInvalid(t){Fh=t}static resetCaches(){cn.resetCache(),Qi.resetCache(),St.resetCache(),YE()}}class hi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Sp=[0,31,59,90,120,151,181,212,243,273,304,334],vp=[0,31,60,91,121,152,182,213,244,274,305,335];function Jr(e,t){return new hi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function od(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const c=r.getUTCDay();return c===0?7:c}function wp(e,t,n){return n+(oa(e)?vp:Sp)[t-1]}function Op(e,t){const n=oa(e)?vp:Sp,r=n.findIndex(d=>d<t),c=t-n[r];return{month:r+1,day:c}}function ld(e,t){return(e-t+7)%7+1}function uc(e,t=4,n=1){const{year:r,month:c,day:d}=e,g=wp(r,c,d),m=ld(od(r,c,d),n);let N=Math.floor((g-m+14-t)/7),T;return N<1?(T=r-1,N=ia(T,t,n)):N>ia(r,t,n)?(T=r+1,N=1):T=r,{weekYear:T,weekNumber:N,weekday:m,...xc(e)}}function Hh(e,t=4,n=1){const{weekYear:r,weekNumber:c,weekday:d}=e,g=ld(od(r,1,t),n),m=Yo(r);let N=c*7+d-g-7+t,T;N<1?(T=r-1,N+=Yo(T)):N>m?(T=r+1,N-=Yo(r)):T=r;const{month:R,day:b}=Op(T,N);return{year:T,month:R,day:b,...xc(e)}}function au(e){const{year:t,month:n,day:r}=e,c=wp(t,n,r);return{year:t,ordinal:c,...xc(e)}}function Wh(e){const{year:t,ordinal:n}=e,{month:r,day:c}=Op(t,n);return{year:t,month:r,day:c,...xc(e)}}function Kh(e,t){if(!kt(e.localWeekday)||!kt(e.localWeekNumber)||!kt(e.localWeekYear)){if(!kt(e.weekday)||!kt(e.weekNumber)||!kt(e.weekYear))throw new Go("Cannot mix locale-based week fields with ISO-based week fields");return kt(e.localWeekday)||(e.weekday=e.localWeekday),kt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),kt(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 jE(e,t=4,n=1){const r=Cc(e.weekYear),c=Xr(e.weekNumber,1,ia(e.weekYear,t,n)),d=Xr(e.weekday,1,7);return r?c?d?!1:Jr("weekday",e.weekday):Jr("week",e.weekNumber):Jr("weekYear",e.weekYear)}function VE(e){const t=Cc(e.year),n=Xr(e.ordinal,1,Yo(e.year));return t?n?!1:Jr("ordinal",e.ordinal):Jr("year",e.year)}function Ap(e){const t=Cc(e.year),n=Xr(e.month,1,12),r=Xr(e.day,1,dc(e.year,e.month));return t?n?r?!1:Jr("day",e.day):Jr("month",e.month):Jr("year",e.year)}function Mp(e){const{hour:t,minute:n,second:r,millisecond:c}=e,d=Xr(t,0,23)||t===24&&n===0&&r===0&&c===0,g=Xr(n,0,59),m=Xr(r,0,59),N=Xr(c,0,999);return d?g?m?N?!1:Jr("millisecond",c):Jr("second",r):Jr("minute",n):Jr("hour",t)}function kt(e){return typeof e>"u"}function ys(e){return typeof e=="number"}function Cc(e){return typeof e=="number"&&e%1===0}function qE(e){return typeof e=="string"}function ZE(e){return Object.prototype.toString.call(e)==="[object Date]"}function Dp(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Rp(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function JE(e){return Array.isArray(e)?e:[e]}function zh(e,t,n){if(e.length!==0)return e.reduce((r,c)=>{const d=[t(c),c];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function XE(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function qo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Iu(e){if(e==null)return null;if(typeof e!="object")throw new gr("Week settings must be an object");if(!Xr(e.firstDay,1,7)||!Xr(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!Xr(t,1,7)))throw new gr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Xr(e,t,n){return Cc(e)&&e>=t&&e<=n}function QE(e,t){return e-t*Math.floor(e/t)}function Hn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function ms(e){if(!(kt(e)||e===null||e===""))return parseInt(e,10)}function qs(e){if(!(kt(e)||e===null||e===""))return parseFloat(e)}function ad(e){if(!(kt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function cd(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function oa(e){return e%4===0&&(e%100!==0||e%400===0)}function Yo(e){return oa(e)?366:365}function dc(e,t){const n=QE(t-1,12)+1,r=e+(t-n)/12;return n===2?oa(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Ec(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 Uh(e,t,n){return-ld(od(e,1,t),n)+t-1}function ia(e,t=4,n=1){const r=Uh(e,t,n),c=Uh(e+1,t,n);return(Yo(e)-r+c)/7}function Lu(e){return e>99?e:e>Dn.twoDigitCutoffYear?1900+e:2e3+e}function bp(e,t,n,r=null){const c=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 g={timeZoneName:t,...d},m=new Intl.DateTimeFormat(n,g).formatToParts(c).find(N=>N.type.toLowerCase()==="timezonename");return m?m.value:null}function Tc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,c=n<0||Object.is(n,-0)?-r:r;return n*60+c}function kp(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new gr(`Invalid unit value ${e}`);return t}function fc(e,t){const n={};for(const r in e)if(qo(e,r)){const c=e[r];if(c==null)continue;n[t(r)]=kp(c)}return n}function ta(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),c=e>=0?"+":"-";switch(t){case"short":return`${c}${Hn(n,2)}:${Hn(r,2)}`;case"narrow":return`${c}${n}${r>0?`:${r}`:""}`;case"techie":return`${c}${Hn(n,2)}${Hn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function xc(e){return XE(e,["hour","minute","second","millisecond"])}const eT=["January","February","March","April","May","June","July","August","September","October","November","December"],Ip=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tT=["J","F","M","A","M","J","J","A","S","O","N","D"];function Lp(e){switch(e){case"narrow":return[...tT];case"short":return[...Ip];case"long":return[...eT];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 Pp=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$p=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],nT=["M","T","W","T","F","S","S"];function Fp(e){switch(e){case"narrow":return[...nT];case"short":return[...$p];case"long":return[...Pp];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Bp=["AM","PM"],rT=["Before Christ","Anno Domini"],iT=["BC","AD"],sT=["B","A"];function Hp(e){switch(e){case"narrow":return[...sT];case"short":return[...iT];case"long":return[...rT];default:return null}}function oT(e){return Bp[e.hour<12?0:1]}function lT(e,t){return Fp(t)[e.weekday-1]}function aT(e,t){return Lp(t)[e.month-1]}function cT(e,t){return Hp(t)[e.year<0?0:1]}function uT(e,t,n="always",r=!1){const c={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 b=e==="days";switch(t){case 1:return b?"tomorrow":`next ${c[e][0]}`;case-1:return b?"yesterday":`last ${c[e][0]}`;case 0:return b?"today":`this ${c[e][0]}`}}const g=Object.is(t,-0)||t<0,m=Math.abs(t),N=m===1,T=c[e],R=r?N?T[1]:T[2]||T[1]:N?c[e][0]:e;return g?`${m} ${R} ago`:`in ${m} ${R}`}function Gh(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const dT={D:cc,DD:rp,DDD:ip,DDDD:sp,t:op,tt:lp,ttt:ap,tttt:cp,T:up,TT:dp,TTT:fp,TTTT:hp,f:gp,ff:mp,fff:yp,ffff:Cp,F:pp,FF:_p,FFF:Np,FFFF:Ep};class pr{static create(t,n={}){return new pr(t,n)}static parseFormat(t){let n=null,r="",c=!1;const d=[];for(let g=0;g<t.length;g++){const m=t.charAt(g);m==="'"?((r.length>0||c)&&d.push({literal:c||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",c=!c):c||m===n?r+=m:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=m,n=m)}return r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return dT[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,r=void 0){if(this.opts.forceSimple)return Hn(t,n);const c={...this.opts};return n>0&&(c.padTo=n),r&&(c.signDisplay=r),this.loc.numberFormatter(c).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(z,E)=>this.loc.extract(t,z,E),g=z=>t.isOffsetFixed&&t.offset===0&&z.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,z.format):"",m=()=>r?oT(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),N=(z,E)=>r?aT(t,z):d(E?{month:z}:{month:z,day:"numeric"},"month"),T=(z,E)=>r?lT(t,z):d(E?{weekday:z}:{weekday:z,month:"long",day:"numeric"},"weekday"),R=z=>{const E=pr.macroTokenToFormatOpts(z);return E?this.formatWithSystemDefault(t,E):z},b=z=>r?cT(t,z):d({era:z},"era"),k=z=>{switch(z){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 g({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return g({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return g({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 m();case"d":return c?d({day:"numeric"},"day"):this.num(t.day);case"dd":return c?d({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return T("short",!0);case"cccc":return T("long",!0);case"ccccc":return T("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return T("short",!1);case"EEEE":return T("long",!1);case"EEEEE":return T("narrow",!1);case"L":return c?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return c?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return N("short",!0);case"LLLL":return N("long",!0);case"LLLLL":return N("narrow",!0);case"M":return c?d({month:"numeric"},"month"):this.num(t.month);case"MM":return c?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return N("short",!1);case"MMMM":return N("long",!1);case"MMMMM":return N("narrow",!1);case"y":return c?d({year:"numeric"},"year"):this.num(t.year);case"yy":return c?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return c?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return c?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return b("short");case"GG":return b("long");case"GGGGG":return b("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 R(z)}};return Gh(pr.parseFormat(n),k)}formatDurationFromString(t,n){const r=this.opts.signMode==="negativeLargestOnly"?-1:1,c=R=>{switch(R[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},d=(R,b)=>k=>{const z=c(k);if(z){const E=b.isNegativeDuration&&z!==b.largestUnit?r:1;let x;return this.opts.signMode==="negativeLargestOnly"&&z!==b.largestUnit?x="never":this.opts.signMode==="all"?x="always":x="auto",this.num(R.get(z)*E,k.length,x)}else return k},g=pr.parseFormat(n),m=g.reduce((R,{literal:b,val:k})=>b?R:R.concat(k),[]),N=t.shiftTo(...m.map(c).filter(R=>R)),T={isNegativeDuration:N<0,largestUnit:Object.keys(N.values)[0]};return Gh(g,d(N,T))}}const Wp=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function tl(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function nl(...e){return t=>e.reduce(([n,r,c],d)=>{const[g,m,N]=d(t,c);return[{...n,...g},m||r,N]},[{},null,1]).slice(0,2)}function rl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const c=n.exec(e);if(c)return r(c)}return[null,null]}function Kp(...e){return(t,n)=>{const r={};let c;for(c=0;c<e.length;c++)r[e[c]]=ms(t[n+c]);return[r,null,n+c]}}const zp=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,fT=`(?:${zp.source}?(?:\\[(${Wp.source})\\])?)?`,ud=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Up=RegExp(`${ud.source}${fT}`),dd=RegExp(`(?:[Tt]${Up.source})?`),hT=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,gT=/(\d{4})-?W(\d\d)(?:-?(\d))?/,pT=/(\d{4})-?(\d{3})/,mT=Kp("weekYear","weekNumber","weekDay"),_T=Kp("year","ordinal"),yT=/(\d{4})-(\d\d)-(\d\d)/,Gp=RegExp(`${ud.source} ?(?:${zp.source}|(${Wp.source}))?`),NT=RegExp(`(?: ${Gp.source})?`);function jo(e,t,n){const r=e[t];return kt(r)?n:ms(r)}function CT(e,t){return[{year:jo(e,t),month:jo(e,t+1,1),day:jo(e,t+2,1)},null,t+3]}function il(e,t){return[{hours:jo(e,t,0),minutes:jo(e,t+1,0),seconds:jo(e,t+2,0),milliseconds:ad(e[t+3])},null,t+4]}function la(e,t){const n=!e[t]&&!e[t+1],r=Tc(e[t+1],e[t+2]),c=n?null:Tr.instance(r);return[{},c,t+3]}function aa(e,t){const n=e[t]?Qi.create(e[t]):null;return[{},n,t+1]}const ET=RegExp(`^T?${ud.source}$`),TT=/^-?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 xT(e){const[t,n,r,c,d,g,m,N,T]=e,R=t[0]==="-",b=N&&N[0]==="-",k=(z,E=!1)=>z!==void 0&&(E||z&&R)?-z:z;return[{years:k(qs(n)),months:k(qs(r)),weeks:k(qs(c)),days:k(qs(d)),hours:k(qs(g)),minutes:k(qs(m)),seconds:k(qs(N),N==="-0"),milliseconds:k(ad(T),b)}]}const ST={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 fd(e,t,n,r,c,d,g){const m={year:t.length===2?Lu(ms(t)):ms(t),month:Ip.indexOf(n)+1,day:ms(r),hour:ms(c),minute:ms(d)};return g&&(m.second=ms(g)),e&&(m.weekday=e.length>3?Pp.indexOf(e)+1:$p.indexOf(e)+1),m}const vT=/^(?:(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 wT(e){const[,t,n,r,c,d,g,m,N,T,R,b]=e,k=fd(t,c,r,n,d,g,m);let z;return N?z=ST[N]:T?z=0:z=Tc(R,b),[k,new Tr(z)]}function OT(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const AT=/^(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$/,MT=/^(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$/,DT=/^(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 Yh(e){const[,t,n,r,c,d,g,m]=e;return[fd(t,c,r,n,d,g,m),Tr.utcInstance]}function RT(e){const[,t,n,r,c,d,g,m]=e;return[fd(t,m,n,r,c,d,g),Tr.utcInstance]}const bT=tl(hT,dd),kT=tl(gT,dd),IT=tl(pT,dd),LT=tl(Up),Yp=nl(CT,il,la,aa),PT=nl(mT,il,la,aa),$T=nl(_T,il,la,aa),FT=nl(il,la,aa);function BT(e){return rl(e,[bT,Yp],[kT,PT],[IT,$T],[LT,FT])}function HT(e){return rl(OT(e),[vT,wT])}function WT(e){return rl(e,[AT,Yh],[MT,Yh],[DT,RT])}function KT(e){return rl(e,[TT,xT])}const zT=nl(il);function UT(e){return rl(e,[ET,zT])}const GT=tl(yT,NT),YT=tl(Gp),jT=nl(il,la,aa);function VT(e){return rl(e,[GT,Yp],[YT,jT])}const jh="Invalid Duration",jp={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}},qT={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},...jp},Zr=146097/400,Wo=146097/4800,ZT={years:{quarters:4,months:12,weeks:Zr/7,days:Zr,hours:Zr*24,minutes:Zr*24*60,seconds:Zr*24*60*60,milliseconds:Zr*24*60*60*1e3},quarters:{months:3,weeks:Zr/28,days:Zr/4,hours:Zr*24/4,minutes:Zr*24*60/4,seconds:Zr*24*60*60/4,milliseconds:Zr*24*60*60*1e3/4},months:{weeks:Wo/7,days:Wo,hours:Wo*24,minutes:Wo*24*60,seconds:Wo*24*60*60,milliseconds:Wo*24*60*60*1e3},...jp},eo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],JT=eo.slice(0).reverse();function qi(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Qt(r)}function Vp(e,t){let n=t.milliseconds??0;for(const r of JT.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Vh(e,t){const n=Vp(e,t)<0?-1:1;eo.reduceRight((r,c)=>{if(kt(t[c]))return r;if(r){const d=t[r]*n,g=e[c][r],m=Math.floor(d/g);t[c]+=m*n,t[r]-=m*g*n}return c},null),eo.reduce((r,c)=>{if(kt(t[c]))return r;if(r){const d=t[r]%1;t[r]-=d,t[c]+=d*e[r][c]}return c},null)}function qh(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Qt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?ZT:qT;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||cn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Qt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new gr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Qt({values:fc(t,Qt.normalizeUnit),loc:cn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(ys(t))return Qt.fromMillis(t);if(Qt.isDuration(t))return t;if(typeof t=="object")return Qt.fromObject(t);throw new gr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=KT(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=UT(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new gr("need to specify a reason the Duration is invalid");const r=t instanceof hi?t:new hi(t,n);if(Dn.throwOnInvalid)throw new xE(r);return new Qt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new np(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?pr.create(this.loc,r).formatDurationFromString(this,t):jh}toHuman(t={}){if(!this.isValid)return jh;const n=t.showZeros!==!1,r=eo.map(c=>{const d=this.values[c];return kt(d)||d===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:c.slice(0,-1)}).format(d)}).filter(c=>c);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}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+=cd(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},St.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?Vp(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t),r={};for(const c of eo)(qo(n.values,c)||qo(this.values,c))&&(r[c]=n.get(c)+this.get(c));return qi(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=kp(t(this.values[r],r));return qi(this,{values:n},!0)}get(t){return this[Qt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...fc(t,Qt.normalizeUnit)};return qi(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:c}={}){const g={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:c,conversionAccuracy:r};return qi(this,g)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Vh(this.matrix,t),qi(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=qh(this.normalize().shiftToAll().toObject());return qi(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(g=>Qt.normalizeUnit(g));const n={},r={},c=this.toObject();let d;for(const g of eo)if(t.indexOf(g)>=0){d=g;let m=0;for(const T in r)m+=this.matrix[T][g]*r[T],r[T]=0;ys(c[g])&&(m+=c[g]);const N=Math.trunc(m);n[g]=N,r[g]=(m*1e3-N*1e3)/1e3}else ys(c[g])&&(r[g]=c[g]);for(const g in r)r[g]!==0&&(n[d]+=g===d?r[g]:r[g]/this.matrix[d][g]);return Vh(this.matrix,n),qi(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 qi(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=qh(this.values);return qi(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,c){return r===void 0||r===0?c===void 0||c===0:r===c}for(const r of eo)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Ko="Invalid Interval";function XT(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 gr("need to specify a reason the Interval is invalid");const r=t instanceof hi?t:new hi(t,n);if(Dn.throwOnInvalid)throw new TE(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Yl(t),c=Yl(n),d=XT(r,c);return d??new Mn({start:r,end:c})}static after(t,n){const r=Qt.fromDurationLike(n),c=Yl(t);return Mn.fromDateTimes(c,c.plus(r))}static before(t,n){const r=Qt.fromDurationLike(n),c=Yl(t);return Mn.fromDateTimes(c.minus(r),c)}static fromISO(t,n){const[r,c]=(t||"").split("/",2);if(r&&c){let d,g;try{d=St.fromISO(r,n),g=d.isValid}catch{g=!1}let m,N;try{m=St.fromISO(c,n),N=m.isValid}catch{N=!1}if(g&&N)return Mn.fromDateTimes(d,m);if(g){const T=Qt.fromISO(c,n);if(T.isValid)return Mn.after(d,T)}else if(N){const T=Qt.fromISO(r,n);if(T.isValid)return Mn.before(m,T)}}return Mn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):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 c;return n!=null&&n.useLocaleWeeks?c=this.end.reconfigure({locale:r.locale}):c=this.end,c=c.startOf(t,n),Math.floor(c.diff(r,t).get(t))+(c.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(Yl).filter(g=>this.contains(g)).sort((g,m)=>g.toMillis()-m.toMillis()),r=[];let{s:c}=this,d=0;for(;c<this.e;){const g=n[d]||this.e,m=+g>+this.e?this.e:g;r.push(Mn.fromDateTimes(c,m)),c=m,d+=1}return r}splitBy(t){const n=Qt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,c=1,d;const g=[];for(;r<this.e;){const m=this.start.plus(n.mapUnits(N=>N*c));d=+m>+this.e?this.e:m,g.push(Mn.fromDateTimes(r,d)),r=d,c+=1}return g}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((c,d)=>c.s-d.s).reduce(([c,d],g)=>d?d.overlaps(g)||d.abutsStart(g)?[c,d.union(g)]:[c.concat([d]),g]:[c,g],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const c=[],d=t.map(N=>[{time:N.s,type:"s"},{time:N.e,type:"e"}]),g=Array.prototype.concat(...d),m=g.sort((N,T)=>N.time-T.time);for(const N of m)r+=N.type==="s"?1:-1,r===1?n=N.time:(n&&+n!=+N.time&&c.push(Mn.fromDateTimes(n,N.time)),n=null);return Mn.merge(c)}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()})`:Ko}[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=cc,n={}){return this.isValid?pr.create(this.s.loc.clone(n),t).formatInterval(this):Ko}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ko}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ko}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ko}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Ko}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Qt.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class qa{static hasDST(t=Dn.defaultZone){const n=St.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Qi.isValidZone(t)}static normalizeZone(t){return _s(t,Dn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||cn.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||cn.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||cn.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||cn.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return cn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return cn.create(n,null,"gregory").eras(t)}static features(){return{relative:Dp(),localeWeek:Rp()}}}function Zh(e,t){const n=c=>c.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Qt.fromMillis(r).as("days"))}function QT(e,t,n){const r=[["years",(N,T)=>T.year-N.year],["quarters",(N,T)=>T.quarter-N.quarter+(T.year-N.year)*4],["months",(N,T)=>T.month-N.month+(T.year-N.year)*12],["weeks",(N,T)=>{const R=Zh(N,T);return(R-R%7)/7}],["days",Zh]],c={},d=e;let g,m;for(const[N,T]of r)n.indexOf(N)>=0&&(g=N,c[N]=T(e,t),m=d.plus(c),m>t?(c[N]--,e=d.plus(c),e>t&&(m=e,c[N]--,e=d.plus(c))):e=m);return[e,c,m,g]}function ex(e,t,n,r){let[c,d,g,m]=QT(e,t,n);const N=t-c,T=n.filter(b=>["hours","minutes","seconds","milliseconds"].indexOf(b)>=0);T.length===0&&(g<t&&(g=c.plus({[m]:1})),g!==c&&(d[m]=(d[m]||0)+N/(g-c)));const R=Qt.fromObject(d,r);return T.length>0?Qt.fromMillis(N,r).shiftTo(...T).plus(R):R}const tx="missing Intl.DateTimeFormat.formatToParts support";function on(e,t=n=>n){return{regex:e,deser:([n])=>t(GE(n))}}const nx=" ",qp=`[ ${nx}]`,Zp=new RegExp(qp,"g");function rx(e){return e.replace(/\./g,"\\.?").replace(Zp,qp)}function Jh(e){return e.replace(/\./g,"").replace(Zp," ").toLowerCase()}function fi(e,t){return e===null?null:{regex:RegExp(e.map(rx).join("|")),deser:([n])=>e.findIndex(r=>Jh(n)===Jh(r))+t}}function Xh(e,t){return{regex:e,deser:([,n,r])=>Tc(n,r),groups:t}}function Za(e){return{regex:e,deser:([t])=>t}}function ix(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function sx(e,t){const n=di(t),r=di(t,"{2}"),c=di(t,"{3}"),d=di(t,"{4}"),g=di(t,"{6}"),m=di(t,"{1,2}"),N=di(t,"{1,3}"),T=di(t,"{1,6}"),R=di(t,"{1,9}"),b=di(t,"{2,4}"),k=di(t,"{4,6}"),z=U=>({regex:RegExp(ix(U.val)),deser:([Q])=>Q,literal:!0}),x=(U=>{if(e.literal)return z(U);switch(U.val){case"G":return fi(t.eras("short"),0);case"GG":return fi(t.eras("long"),0);case"y":return on(T);case"yy":return on(b,Lu);case"yyyy":return on(d);case"yyyyy":return on(k);case"yyyyyy":return on(g);case"M":return on(m);case"MM":return on(r);case"MMM":return fi(t.months("short",!0),1);case"MMMM":return fi(t.months("long",!0),1);case"L":return on(m);case"LL":return on(r);case"LLL":return fi(t.months("short",!1),1);case"LLLL":return fi(t.months("long",!1),1);case"d":return on(m);case"dd":return on(r);case"o":return on(N);case"ooo":return on(c);case"HH":return on(r);case"H":return on(m);case"hh":return on(r);case"h":return on(m);case"mm":return on(r);case"m":return on(m);case"q":return on(m);case"qq":return on(r);case"s":return on(m);case"ss":return on(r);case"S":return on(N);case"SSS":return on(c);case"u":return Za(R);case"uu":return Za(m);case"uuu":return on(n);case"a":return fi(t.meridiems(),0);case"kkkk":return on(d);case"kk":return on(b,Lu);case"W":return on(m);case"WW":return on(r);case"E":case"c":return on(n);case"EEE":return fi(t.weekdays("short",!1),1);case"EEEE":return fi(t.weekdays("long",!1),1);case"ccc":return fi(t.weekdays("short",!0),1);case"cccc":return fi(t.weekdays("long",!0),1);case"Z":case"ZZ":return Xh(new RegExp(`([+-]${m.source})(?::(${r.source}))?`),2);case"ZZZ":return Xh(new RegExp(`([+-]${m.source})(${r.source})?`),2);case"z":return Za(/[a-z_+-/]{1,256}?/i);case" ":return Za(/[^\S\n\r]/);default:return z(U)}})(e)||{invalidReason:tx};return x.token=e,x}const ox={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 lx(e,t,n){const{type:r,value:c}=e;if(r==="literal"){const N=/^\s+$/.test(c);return{literal:!N,val:N?" ":c}}const d=t[r];let g=r;r==="hour"&&(t.hour12!=null?g=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?g="hour12":g="hour24":g=n.hour12?"hour12":"hour24");let m=ox[g];if(typeof m=="object"&&(m=m[d]),m)return{literal:!1,val:m}}function ax(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function cx(e,t,n){const r=e.match(t);if(r){const c={};let d=1;for(const g in n)if(qo(n,g)){const m=n[g],N=m.groups?m.groups+1:1;!m.literal&&m.token&&(c[m.token.val[0]]=m.deser(r.slice(d,d+N))),d+=N}return[r,c]}else return[r,{}]}function ux(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 kt(e.z)||(n=Qi.create(e.z)),kt(e.Z)||(n||(n=new Tr(e.Z)),r=e.Z),kt(e.q)||(e.M=(e.q-1)*3+1),kt(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),kt(e.u)||(e.S=ad(e.u)),[Object.keys(e).reduce((d,g)=>{const m=t(g);return m&&(d[m]=e[g]),d},{}),n,r]}let cu=null;function dx(){return cu||(cu=St.fromMillis(1555555555555)),cu}function fx(e,t){if(e.literal)return e;const n=pr.macroTokenToFormatOpts(e.val),r=em(n,t);return r==null||r.includes(void 0)?e:r}function Jp(e,t){return Array.prototype.concat(...e.map(n=>fx(n,t)))}class Xp{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Jp(pr.parseFormat(n),t),this.units=this.tokens.map(r=>sx(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,c]=ax(this.units);this.regex=RegExp(r,"i"),this.handlers=c}}explainFromTokens(t){if(this.isValid){const[n,r]=cx(t,this.regex,this.handlers),[c,d,g]=r?ux(r):[null,null,void 0];if(qo(r,"a")&&qo(r,"H"))throw new Go("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:c,zone:d,specificOffset:g}}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 Qp(e,t,n){return new Xp(e,n).explainFromTokens(t)}function hx(e,t,n){const{result:r,zone:c,specificOffset:d,invalidReason:g}=Qp(e,t,n);return[r,c,d,g]}function em(e,t){if(!e)return null;const r=pr.create(t,e).dtFormatter(dx()),c=r.formatToParts(),d=r.resolvedOptions();return c.map(g=>lx(g,e,d))}const uu="Invalid DateTime",gx=864e13;function Zl(e){return new hi("unsupported zone",`the zone "${e.name}" is not supported`)}function du(e){return e.weekData===null&&(e.weekData=uc(e.c)),e.weekData}function fu(e){return e.localWeekData===null&&(e.localWeekData=uc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Zs(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new St({...n,...t,old:n})}function tm(e,t,n){let r=e-t*60*1e3;const c=n.offset(r);if(t===c)return[r,t];r-=(c-t)*60*1e3;const d=n.offset(r);return c===d?[r,c]:[e-Math.min(c,d)*60*1e3,Math.max(c,d)]}function Ja(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 ec(e,t,n){return tm(Ec(e),t,n)}function Qh(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),c=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:c,day:Math.min(e.c.day,dc(r,c))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},g=Qt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),m=Ec(d);let[N,T]=tm(m,n,e.zone);return g!==0&&(N+=g,T=e.zone.offset(N)),{ts:N,o:T}}function zo(e,t,n,r,c,d){const{setZone:g,zone:m}=n;if(e&&Object.keys(e).length!==0||t){const N=t||m,T=St.fromObject(e,{...n,zone:N,specificOffset:d});return g?T:T.setZone(m)}else return St.invalid(new hi("unparsable",`the input "${c}" can't be parsed as ${r}`))}function Xa(e,t,n=!0){return e.isValid?pr.create(cn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function hu(e,t,n){const r=e.c.year>9999||e.c.year<0;let c="";if(r&&e.c.year>=0&&(c+="+"),c+=Hn(e.c.year,r?6:4),n==="year")return c;if(t){if(c+="-",c+=Hn(e.c.month),n==="month")return c;c+="-"}else if(c+=Hn(e.c.month),n==="month")return c;return c+=Hn(e.c.day),c}function eg(e,t,n,r,c,d,g){let m=!n||e.c.millisecond!==0||e.c.second!==0,N="";switch(g){case"day":case"month":case"year":break;default:if(N+=Hn(e.c.hour),g==="hour")break;if(t){if(N+=":",N+=Hn(e.c.minute),g==="minute")break;m&&(N+=":",N+=Hn(e.c.second))}else{if(N+=Hn(e.c.minute),g==="minute")break;m&&(N+=Hn(e.c.second))}if(g==="second")break;m&&(!r||e.c.millisecond!==0)&&(N+=".",N+=Hn(e.c.millisecond,3))}return c&&(e.isOffsetFixed&&e.offset===0&&!d?N+="Z":e.o<0?(N+="-",N+=Hn(Math.trunc(-e.o/60)),N+=":",N+=Hn(Math.trunc(-e.o%60))):(N+="+",N+=Hn(Math.trunc(e.o/60)),N+=":",N+=Hn(Math.trunc(e.o%60)))),d&&(N+="["+e.zone.ianaName+"]"),N}const nm={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},px={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},mx={ordinal:1,hour:0,minute:0,second:0,millisecond:0},tc=["year","month","day","hour","minute","second","millisecond"],_x=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],yx=["year","ordinal","hour","minute","second","millisecond"];function nc(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 np(e);return t}function tg(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return nc(e)}}function Nx(e){if(Jl===void 0&&(Jl=Dn.now()),e.type!=="iana")return e.offset(Jl);const t=e.name;let n=Pu.get(t);return n===void 0&&(n=e.offset(Jl),Pu.set(t,n)),n}function ng(e,t){const n=_s(t.zone,Dn.defaultZone);if(!n.isValid)return St.invalid(Zl(n));const r=cn.fromObject(t);let c,d;if(kt(e.year))c=Dn.now();else{for(const N of tc)kt(e[N])&&(e[N]=nm[N]);const g=Ap(e)||Mp(e);if(g)return St.invalid(g);const m=Nx(n);[c,d]=ec(e,m,n)}return new St({ts:c,zone:n,loc:r,o:d})}function rg(e,t,n){const r=kt(n.round)?!0:n.round,c=kt(n.rounding)?"trunc":n.rounding,d=(m,N)=>(m=cd(m,r||n.calendary?0:2,n.calendary?"round":c),t.loc.clone(n).relFormatter(n).format(m,N)),g=m=>n.calendary?t.hasSame(e,m)?0:t.startOf(m).diff(e.startOf(m),m).get(m):t.diff(e,m).get(m);if(n.unit)return d(g(n.unit),n.unit);for(const m of n.units){const N=g(m);if(Math.abs(N)>=1)return d(N,m)}return d(e>t?-0:0,n.units[n.units.length-1])}function ig(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 Jl;const Pu=new Map;class St{constructor(t){const n=t.zone||Dn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new hi("invalid input"):null)||(n.isValid?null:Zl(n));this.ts=kt(t.ts)?Dn.now():t.ts;let c=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[c,d]=[t.old.c,t.old.o];else{const m=ys(t.o)&&!t.old?t.o:n.offset(this.ts);c=Ja(this.ts,m),r=Number.isNaN(c.year)?new hi("invalid input"):null,c=r?null:c,d=r?null:m}this._zone=n,this.loc=t.loc||cn.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=c,this.o=d,this.isLuxonDateTime=!0}static now(){return new St({})}static local(){const[t,n]=ig(arguments),[r,c,d,g,m,N,T]=n;return ng({year:r,month:c,day:d,hour:g,minute:m,second:N,millisecond:T},t)}static utc(){const[t,n]=ig(arguments),[r,c,d,g,m,N,T]=n;return t.zone=Tr.utcInstance,ng({year:r,month:c,day:d,hour:g,minute:m,second:N,millisecond:T},t)}static fromJSDate(t,n={}){const r=ZE(t)?t.valueOf():NaN;if(Number.isNaN(r))return St.invalid("invalid input");const c=_s(n.zone,Dn.defaultZone);return c.isValid?new St({ts:r,zone:c,loc:cn.fromObject(n)}):St.invalid(Zl(c))}static fromMillis(t,n={}){if(ys(t))return t<-864e13||t>gx?St.invalid("Timestamp out of range"):new St({ts:t,zone:_s(n.zone,Dn.defaultZone),loc:cn.fromObject(n)});throw new gr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(ys(t))return new St({ts:t*1e3,zone:_s(n.zone,Dn.defaultZone),loc:cn.fromObject(n)});throw new gr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=_s(n.zone,Dn.defaultZone);if(!r.isValid)return St.invalid(Zl(r));const c=cn.fromObject(n),d=fc(t,tg),{minDaysInFirstWeek:g,startOfWeek:m}=Kh(d,c),N=Dn.now(),T=kt(n.specificOffset)?r.offset(N):n.specificOffset,R=!kt(d.ordinal),b=!kt(d.year),k=!kt(d.month)||!kt(d.day),z=b||k,E=d.weekYear||d.weekNumber;if((z||R)&&E)throw new Go("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(k&&R)throw new Go("Can't mix ordinal dates with month/day");const x=E||d.weekday&&!z;let U,Q,F=Ja(N,T);x?(U=_x,Q=px,F=uc(F,g,m)):R?(U=yx,Q=mx,F=au(F)):(U=tc,Q=nm);let W=!1;for(const B of U){const V=d[B];kt(V)?W?d[B]=Q[B]:d[B]=F[B]:W=!0}const G=x?jE(d,g,m):R?VE(d):Ap(d),q=G||Mp(d);if(q)return St.invalid(q);const le=x?Hh(d,g,m):R?Wh(d):d,[se,ge]=ec(le,T,r),j=new St({ts:se,zone:r,o:ge,loc:c});return d.weekday&&z&&t.weekday!==j.weekday?St.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${j.toISO()}`):j.isValid?j:St.invalid(j.invalid)}static fromISO(t,n={}){const[r,c]=BT(t);return zo(r,c,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,c]=HT(t);return zo(r,c,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,c]=WT(t);return zo(r,c,n,"HTTP",n)}static fromFormat(t,n,r={}){if(kt(t)||kt(n))throw new gr("fromFormat requires an input string and a format");const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0}),[m,N,T,R]=hx(g,t,n);return R?St.invalid(R):zo(m,N,r,`format ${n}`,t,T)}static fromString(t,n,r={}){return St.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,c]=VT(t);return zo(r,c,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new gr("need to specify a reason the DateTime is invalid");const r=t instanceof hi?t:new hi(t,n);if(Dn.throwOnInvalid)throw new EE(r);return new St({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=em(t,cn.fromObject(n));return r?r.map(c=>c?c.val:null).join(""):null}static expandFormat(t,n={}){return Jp(pr.parseFormat(t),cn.fromObject(n)).map(c=>c.val).join("")}static resetCache(){Jl=void 0,Pu.clear()}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?du(this).weekYear:NaN}get weekNumber(){return this.isValid?du(this).weekNumber:NaN}get weekday(){return this.isValid?du(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?fu(this).weekday:NaN}get localWeekNumber(){return this.isValid?fu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?fu(this).weekYear:NaN}get ordinal(){return this.isValid?au(this.c).ordinal:NaN}get monthShort(){return this.isValid?qa.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qa.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qa.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qa.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=Ec(this.c),c=this.zone.offset(r-t),d=this.zone.offset(r+t),g=this.zone.offset(r-c*n),m=this.zone.offset(r-d*n);if(g===m)return[this];const N=r-g*n,T=r-m*n,R=Ja(N,g),b=Ja(T,m);return R.hour===b.hour&&R.minute===b.minute&&R.second===b.second&&R.millisecond===b.millisecond?[Zs(this,{ts:N}),Zs(this,{ts:T})]:[this]}get isInLeapYear(){return oa(this.year)}get daysInMonth(){return dc(this.year,this.month)}get daysInYear(){return this.isValid?Yo(this.year):NaN}get weeksInWeekYear(){return this.isValid?ia(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ia(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:c}=pr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:c}}toUTC(t=0,n={}){return this.setZone(Tr.instance(t),n)}toLocal(){return this.setZone(Dn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=_s(t,Dn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let c=this.ts;if(n||r){const d=t.offset(this.ts),g=this.toObject();[c]=ec(g,d,t)}return Zs(this,{ts:c,zone:t})}else return St.invalid(Zl(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const c=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Zs(this,{loc:c})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=fc(t,tg),{minDaysInFirstWeek:r,startOfWeek:c}=Kh(n,this.loc),d=!kt(n.weekYear)||!kt(n.weekNumber)||!kt(n.weekday),g=!kt(n.ordinal),m=!kt(n.year),N=!kt(n.month)||!kt(n.day),T=m||N,R=n.weekYear||n.weekNumber;if((T||g)&&R)throw new Go("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(N&&g)throw new Go("Can't mix ordinal dates with month/day");let b;d?b=Hh({...uc(this.c,r,c),...n},r,c):kt(n.ordinal)?(b={...this.toObject(),...n},kt(n.day)&&(b.day=Math.min(dc(b.year,b.month),b.day))):b=Wh({...au(this.c),...n});const[k,z]=ec(b,this.o,this.zone);return Zs(this,{ts:k,o:z})}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return Zs(this,Qh(this,n))}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t).negate();return Zs(this,Qh(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},c=Qt.normalizeUnit(t);switch(c){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(c==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:g}=this;g<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(c==="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?pr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):uu}toLocaleString(t=cc,n={}){return this.isValid?pr.create(this.loc.clone(n),t).formatDateTime(this):uu}toLocaleParts(t={}){return this.isValid?pr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:c=!0,extendedZone:d=!1,precision:g="milliseconds"}={}){if(!this.isValid)return null;g=nc(g);const m=t==="extended";let N=hu(this,m,g);return tc.indexOf(g)>=3&&(N+="T"),N+=eg(this,m,n,r,c,d,g),N}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?hu(this,t==="extended",nc(n)):null}toISOWeekDate(){return Xa(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:c=!1,extendedZone:d=!1,format:g="extended",precision:m="milliseconds"}={}){return this.isValid?(m=nc(m),(c&&tc.indexOf(m)>=3?"T":"")+eg(this,g==="extended",n,t,r,d,m)):null}toRFC2822(){return Xa(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Xa(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?hu(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let c="HH:mm:ss.SSS";return(n||t)&&(r&&(c+=" "),n?c+="z":t&&(c+="ZZ")),Xa(this,c,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():uu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Qt.invalid("created by diffing an invalid DateTime");const c={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=JE(n).map(Qt.normalizeUnit),g=t.valueOf()>this.valueOf(),m=g?this:t,N=g?t:this,T=ex(m,N,d,c);return g?T.negate():T}diffNow(t="milliseconds",n={}){return this.diff(St.now(),t,n)}until(t){return this.isValid?Mn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const c=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=c&&c<=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||St.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let c=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(c=t.unit,d=void 0),rg(n,this.plus(r),{...t,numeric:"always",units:c,unit:d})}toRelativeCalendar(t={}){return this.isValid?rg(t.base||St.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(St.isDateTime))throw new gr("min requires all arguments be DateTimes");return zh(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(St.isDateTime))throw new gr("max requires all arguments be DateTimes");return zh(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});return Qp(g,t,n)}static fromStringExplain(t,n,r={}){return St.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:c=null}=n,d=cn.fromOpts({locale:r,numberingSystem:c,defaultToEN:!0});return new Xp(d,t)}static fromFormatParser(t,n,r={}){if(kt(t)||kt(n))throw new gr("fromFormatParser requires an input string and a format parser");const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});if(!g.equals(n.locale))throw new gr(`fromFormatParser called with a locale of ${g}, but the format parser was created for ${n.locale}`);const{result:m,zone:N,specificOffset:T,invalidReason:R}=n.explainFromTokens(t);return R?St.invalid(R):zo(m,N,r,`format ${n.format}`,t,T)}static get DATE_SHORT(){return cc}static get DATE_MED(){return rp}static get DATE_MED_WITH_WEEKDAY(){return SE}static get DATE_FULL(){return ip}static get DATE_HUGE(){return sp}static get TIME_SIMPLE(){return op}static get TIME_WITH_SECONDS(){return lp}static get TIME_WITH_SHORT_OFFSET(){return ap}static get TIME_WITH_LONG_OFFSET(){return cp}static get TIME_24_SIMPLE(){return up}static get TIME_24_WITH_SECONDS(){return dp}static get TIME_24_WITH_SHORT_OFFSET(){return fp}static get TIME_24_WITH_LONG_OFFSET(){return hp}static get DATETIME_SHORT(){return gp}static get DATETIME_SHORT_WITH_SECONDS(){return pp}static get DATETIME_MED(){return mp}static get DATETIME_MED_WITH_SECONDS(){return _p}static get DATETIME_MED_WITH_WEEKDAY(){return vE}static get DATETIME_FULL(){return yp}static get DATETIME_FULL_WITH_SECONDS(){return Np}static get DATETIME_HUGE(){return Cp}static get DATETIME_HUGE_WITH_SECONDS(){return Ep}}function Yl(e){if(St.isDateTime(e))return e;if(e&&e.valueOf&&ys(e.valueOf()))return St.fromJSDate(e);if(e&&typeof e=="object")return St.fromObject(e);throw new gr(`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 Sc(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 no(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 $u=[Yt.Monday,Yt.Tuesday,Yt.Wednesday,Yt.Thursday,Yt.Friday,Yt.Saturday,Yt.Sunday],Xl={[Yt.Monday]:"monday",[Yt.Tuesday]:"tuesday",[Yt.Wednesday]:"wednesday",[Yt.Thursday]:"thursday",[Yt.Friday]:"friday",[Yt.Saturday]:"saturday",[Yt.Sunday]:"sunday"};class hc{constructor(t,n,r){ke(this,"end");ke(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(T=>{if(T.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[c,d]=n.start.split(":").map(Number),[g,m]=n.end.split(":").map(Number);let N=0;g<c&&(N=1),this.end=this.end.set({hour:g,minute:m,day:this.end.day+N}),this.start=this.start.set({hour:c,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 rm{constructor(t,n){ke(this,"holidayHoursByDate");ke(this,"hours");ke(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 c=this.getHours(r);if(c&&!c.isClosed)for(const d of c.openIntervals||[]){const g=new hc(r,d,this.timezone);if(g.contains(t))return g}}return null}getCurrentInterval(){return this.getInterval(St.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,g)=>d.start===g.start?0:d.start>g.start?1:-1,c=n.sort(r);for(const[d,g]of c.entries())if(g.contains(t)&&c.length>d+1)return c[d+1];for(const d of c)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let c=0;c<t;c++){let d=n;d=d.plus({days:c});const g=this.getHours(d);g!=null&&g.openIntervals&&!g.isClosed&&r.push(...g.openIntervals.map(m=>new hc(d,m,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=no(Sc(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(St.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,c,d]=n,g=St.fromObject({year:Number(r),month:Number(c),day:Number(d)},{zone:this.timezone});if(t<g)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(St.now())}}function Cx(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function Ex(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 ca(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 ua(e){return!e.futureInterval}function Tx(e){return ca(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):ua(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):nt.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function xx(e){return ca(e)||ua(e)?null:nt.jsx("span",{className:"HoursStatus-separator",children:" • "})}function Sx(e){return ca(e)||ua(e)?null:nt.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function vx(e){if(ca(e)||ua(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 wx(e){var r,c;if(ca(e)||ua(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+=((c=d==null?void 0:d.start)==null?void 0:c.setLocale("en-US").toLocaleString(t))||""}return nt.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function Ox(e,t){const n=e.currentTemplate||Tx,r=e.separatorTemplate||xx,c=e.futureTemplate||Sx,d=e.timeTemplate||vx,g=e.dayOfWeekTemplate||wx;return nt.jsxs("div",{className:ro("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),c(e),d(e),g(e)]})}const Ax={minHeight:`${1.5}em`},Mx=e=>{const[t,n]=yt.useState(!1),[r,c]=yt.useState(!1);if(yt.useEffect(()=>{c(!0)},[]),!e.hours)return nt.jsx(nt.Fragment,{});const d=e.statusTemplate||Ox,g=new rm(e.hours,e.timezone),m=g.isOpenNow(),N=g.getCurrentInterval(),T=g.getNextInterval(),R=(N==null?void 0:N.end)||(T==null?void 0:T.start);if(R&&!t){n(!0);const k=R.toMillis()-St.now().toMillis();setTimeout(()=>n(!1),k)}const b={isOpen:m,currentInterval:N,futureInterval:T,...e};return nt.jsx(nt.Fragment,{children:r?d(b,e):nt.jsx("div",{style:Ax,className:ro("HoursStatus",(e==null?void 0:e.className)||"")})})};function Dx(e,t){const n=[];return e.forEach(r=>{const c=n[n.length-1];c?Ex(c.intervals,r.intervals)?(c.endDay=r.endDay,c.isToday=c.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const c=t&&Xl[r.startDay]in t?t[Xl[r.startDay]]||"":no(r.startDay),d=t&&Xl[r.endDay]in t?t[Xl[r.endDay]]||"":no(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${c}`:`${c} - ${d}`}})}function Rx(e,t,n){const r=[],c=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?r.push((n==null?void 0:n.isClosed)||"Closed"):c?r.push((n==null?void 0:n.open24Hours)||"Open 24 hours"):e.intervals.forEach(d=>{const g=d.getStartTime((n==null?void 0:n.timeFormatLocale)||"en-US",t),m=d.getEndTime((n==null?void 0:n.timeFormatLocale)||"en-US",t);r.push(`${g} - ${m}`)}),r}function bx(e,t,n){const r=[];for(let c=1;c<=7;c++){const d=St.fromObject({weekday:c}),g=Sc(d);r.push({startDay:g,endDay:g,dayName:n&&no(g).toLowerCase()in n?n[no(g).toLowerCase()]||"":no(g),intervals:e.filter(m=>m.start.weekday===c),isToday:(t==null?void 0:t.weekday)===c})}return r}const kx=e=>{const[t,n]=yt.useState(!1);return yt.useEffect(()=>{n(!0)},[]),e.hours?nt.jsx(nt.Fragment,{children:t?nt.jsx(Ix,{...e}):nt.jsx(Lx,{...e})}):nt.jsx(nt.Fragment,{})},Ix=e=>{const t=new rm(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),n=St.now(),r=t.getIntervalsForNDays(7,n),c=bx(r,n,e.dayOfWeekNames);return nt.jsx(Fu,{...e,hoursData:c,isClient:!0})},Lx=e=>{var g;const{hours:t,dayOfWeekNames:n,intervalTranslations:r}=e,c=$u.map(m=>{var T,R;const N=Xl[m];return{dayName:(n==null?void 0:n[N])||no(m),startDay:m,endDay:m,isToday:!1,intervals:((R=(T=t[N])==null?void 0:T.openIntervals)==null?void 0:R.map(b=>new hc(St.now(),b,"UTC")))??[]}}),d=(g=t.holidayHours)==null?void 0:g.map(m=>{var R,b;const N=St.fromFormat(m.date,"yyyy-MM-dd"),T=Sc(N);return{dayName:N.setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString(),isToday:!1,startDay:T,endDay:T,intervals:(m.isRegularHours?(R=m.openIntervals)==null?void 0:R.map(k=>new hc(N,k,"UTC")):(b=c.find(k=>k.startDay===T))==null?void 0:b.intervals)??[]}});return nt.jsxs(nt.Fragment,{children:[nt.jsx(Fu,{...e,hoursData:c,isClient:!1}),d&&d.length>0&&nt.jsx(Fu,{...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:St.fromFormat(t.reopenDate,"yyyy-MM-dd").setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString()})]})]})},Fu=e=>{const{intervalStringsBuilderFn:t,className:n,timeOptions:r,intervalTranslations:c,dayOfWeekNames:d,startOfWeek:g,isClient:m,isHolidayHours:N}=e;let T=e.hoursData;function R(z){return z?{today:Sc(St.now()),monday:Yt.Monday,tuesday:Yt.Tuesday,wednesday:Yt.Wednesday,thursday:Yt.Thursday,friday:Yt.Friday,saturday:Yt.Saturday,sunday:Yt.Sunday}[z]:Yt.Sunday}const b=$u.indexOf(R(m||g!=="today"?g:"sunday")),k=Cx($u,7-b);return N||(T.sort((z,E)=>k.indexOf(z.startDay)-k.indexOf(E.startDay)),e.collapseDays&&(T=Dx(T,d))),nt.jsx("div",{className:ro("HoursTable",n),children:T.map(z=>{const x=(t||Rx)(z,r,c);return nt.jsxs("div",{className:ro("HoursTable-row",{"is-today":z.isToday}),children:[nt.jsx("span",{className:"HoursTable-day",children:z.dayName}),nt.jsx("span",{className:"HoursTable-intervals",children:x.map((U,Q)=>nt.jsx("span",{className:"HoursTable-interval",children:U},Q))})]},z.dayName)})})},Px=e=>`<script type="application/ld+json">
|
|
109
|
+
`}),n}const gE=(e,t)=>e(t,"i",ts(e,t)),pE=(e,t)=>e(t,"b",ts(e,t)),mE=(e,t)=>e(t,"u",ts(e,t)),_E=(e,t)=>e(t,"s",ts(e,t)),yE=(e,t)=>e(t,"sub",ts(e,t)),NE=(e,t)=>e(t,"sup",ts(e,t)),CE={emphasis:gE,strong:pE,underline:mE,strikethrough:_E,subscript:yE,superscript:NE},EE=e=>{const[t,n]=yt.useState();let r;return yt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-BmUaz3pT.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[vC],remarkRehypeOptions:{handlers:CE}});n(d)})()},[e.markdown]),t||null};class oo extends Error{}class TE extends oo{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class xE extends oo{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class SE extends oo{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Go extends oo{}class np extends oo{constructor(t){super(`Invalid unit ${t}`)}}class gr extends oo{}class ms extends oo{constructor(){super("Zone is an abstract class")}}const lt="numeric",pi="short",Ur="long",cc={year:lt,month:lt,day:lt},rp={year:lt,month:pi,day:lt},vE={year:lt,month:pi,day:lt,weekday:pi},ip={year:lt,month:Ur,day:lt},sp={year:lt,month:Ur,day:lt,weekday:Ur},op={hour:lt,minute:lt},lp={hour:lt,minute:lt,second:lt},ap={hour:lt,minute:lt,second:lt,timeZoneName:pi},cp={hour:lt,minute:lt,second:lt,timeZoneName:Ur},up={hour:lt,minute:lt,hourCycle:"h23"},dp={hour:lt,minute:lt,second:lt,hourCycle:"h23"},fp={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:pi},hp={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:Ur},gp={year:lt,month:lt,day:lt,hour:lt,minute:lt},pp={year:lt,month:lt,day:lt,hour:lt,minute:lt,second:lt},mp={year:lt,month:pi,day:lt,hour:lt,minute:lt},_p={year:lt,month:pi,day:lt,hour:lt,minute:lt,second:lt},wE={year:lt,month:pi,day:lt,weekday:pi,hour:lt,minute:lt},yp={year:lt,month:Ur,day:lt,hour:lt,minute:lt,timeZoneName:pi},Np={year:lt,month:Ur,day:lt,hour:lt,minute:lt,second:lt,timeZoneName:pi},Cp={year:lt,month:Ur,day:lt,weekday:Ur,hour:lt,minute:lt,timeZoneName:Ur},Ep={year:lt,month:Ur,day:lt,weekday:Ur,hour:lt,minute:lt,second:lt,timeZoneName:Ur};class sa{get type(){throw new ms}get name(){throw new ms}get ianaName(){return this.name}get isUniversal(){throw new ms}offsetName(t,n){throw new ms}formatOffset(t,n){throw new ms}offset(t){throw new ms}equals(t){throw new ms}get isValid(){throw new ms}}let su=null;class Nc extends sa{static get instance(){return su===null&&(su=new Nc),su}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return bp(t,n,r)}formatOffset(t,n){return ta(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const wu=new Map;function OE(e){let t=wu.get(e);return t===void 0&&(t=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"}),wu.set(e,t)),t}const AE={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ME(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,c,d,g,m,N,T,R]=r;return[g,c,d,m,N,T,R]}function DE(e,t){const n=e.formatToParts(t),r=[];for(let c=0;c<n.length;c++){const{type:d,value:g}=n[c],m=AE[d];d==="era"?r[m]=g:kt(m)||(r[m]=parseInt(g,10))}return r}const ou=new Map;class es extends sa{static create(t){let n=ou.get(t);return n===void 0&&ou.set(t,n=new es(t)),n}static resetCache(){ou.clear(),wu.clear()}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=es.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return bp(t,n,r,this.name)}formatOffset(t,n){return ta(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=OE(this.name);let[c,d,g,m,N,T,R]=r.formatToParts?DE(r,n):ME(r,n);m==="BC"&&(c=-Math.abs(c)+1);const k=Ec({year:c,month:d,day:g,hour:N===24?0:N,minute:T,second:R,millisecond:0});let z=+n;const E=z%1e3;return z-=E>=0?E:1e3+E,(k-z)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Dh={};function RE(e,t={}){const n=JSON.stringify([e,t]);let r=Dh[n];return r||(r=new Intl.ListFormat(e,t),Dh[n]=r),r}const Ou=new Map;function Au(e,t={}){const n=JSON.stringify([e,t]);let r=Ou.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),Ou.set(n,r)),r}const Mu=new Map;function bE(e,t={}){const n=JSON.stringify([e,t]);let r=Mu.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),Mu.set(n,r)),r}const Du=new Map;function kE(e,t={}){const{base:n,...r}=t,c=JSON.stringify([e,r]);let d=Du.get(c);return d===void 0&&(d=new Intl.RelativeTimeFormat(e,t),Du.set(c,d)),d}let ql=null;function IE(){return ql||(ql=new Intl.DateTimeFormat().resolvedOptions().locale,ql)}const Ru=new Map;function Tp(e){let t=Ru.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Ru.set(e,t)),t}const bu=new Map;function LE(e){let t=bu.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...xp,...t}),bu.set(e,t)}return t}function PE(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,c;try{r=Au(e).resolvedOptions(),c=e}catch{const N=e.substring(0,n);r=Au(N).resolvedOptions(),c=N}const{numberingSystem:d,calendar:g}=r;return[c,d,g]}}function $E(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function FE(e){const t=[];for(let n=1;n<=12;n++){const r=St.utc(2009,n,1);t.push(e(r))}return t}function BE(e){const t=[];for(let n=1;n<=7;n++){const r=St.utc(2016,11,13+n);t.push(e(r))}return t}function Va(e,t,n,r){const c=e.listingMode();return c==="error"?null:c==="en"?n(t):r(t)}function HE(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||Tp(e.locale).numberingSystem==="latn"}class WE{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:c,floor:d,...g}=r;if(!n||Object.keys(g).length>0){const m={useGrouping:!1,...r};r.padTo>0&&(m.minimumIntegerDigits=r.padTo),this.inf=bE(t,m)}}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):cd(t,3);return Hn(n,this.padTo)}}}class KE{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let c;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const g=-1*(t.offset/60),m=g>=0?`Etc/GMT+${g}`:`Etc/GMT${g}`;t.offset!==0&&es.create(m).valid?(c=m,this.dt=t):(c="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,c=t.zone.name):(c="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||c,this.dtf=Au(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 zE{constructor(t,n,r){this.opts={style:"long",...r},!n&&Dp()&&(this.rtf=kE(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):dT(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const xp={firstDay:1,minimalDays:4,weekend:[6,7]};class cn{static fromOpts(t){return cn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,c,d=!1){const g=t||Dn.defaultLocale,m=g||(d?"en-US":IE()),N=n||Dn.defaultNumberingSystem,T=r||Dn.defaultOutputCalendar,R=Iu(c)||Dn.defaultWeekSettings;return new cn(m,N,T,R,g)}static resetCache(){ql=null,Ou.clear(),Mu.clear(),Du.clear(),Ru.clear(),bu.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:c}={}){return cn.create(t,n,r,c)}constructor(t,n,r,c,d){const[g,m,N]=PE(t);this.locale=g,this.numberingSystem=n||m||null,this.outputCalendar=r||N||null,this.weekSettings=c,this.intl=$E(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=HE(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:cn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Iu(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 Va(this,t,Lp,()=>{const r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;const c=n?{month:t,day:"numeric"}:{month:t},d=n?"format":"standalone";if(!this.monthsCache[d][t]){const g=r?m=>this.dtFormatter(m,c).format():m=>this.extract(m,c,"month");this.monthsCache[d][t]=FE(g)}return this.monthsCache[d][t]})}weekdays(t,n=!1){return Va(this,t,Fp,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},c=n?"format":"standalone";return this.weekdaysCache[c][t]||(this.weekdaysCache[c][t]=BE(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[c][t]})}meridiems(){return Va(this,void 0,()=>Bp,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[St.utc(2016,11,13,9),St.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Va(this,t,Hp,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[St.utc(-40,1,1),St.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const c=this.dtFormatter(t,n),d=c.formatToParts(),g=d.find(m=>m.type.toLowerCase()===r);return g?g.value:null}numberFormatter(t={}){return new WE(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new KE(t,this.intl,n)}relFormatter(t={}){return new zE(this.intl,this.isEnglish(),t)}listFormatter(t={}){return RE(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Tp(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Rp()?LE(this.locale):xp}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let lu=null;class Tr extends sa{static get utcInstance(){return lu===null&&(lu=new Tr(0)),lu}static instance(t){return t===0?Tr.utcInstance:new Tr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tr(Tc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ta(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ta(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ta(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 UE extends sa{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 ys(e,t){if(kt(e)||e===null)return t;if(e instanceof sa)return e;if(ZE(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Nc.instance:n==="utc"||n==="gmt"?Tr.utcInstance:Tr.parseSpecifier(n)||es.create(e)}else return Ns(e)?Tr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new UE(e)}const sd={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Rh={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]},GE=sd.hanidec.replace(/[\[|\]]/g,"").split("");function YE(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(sd.hanidec)!==-1)t+=GE.indexOf(e[n]);else for(const c in Rh){const[d,g]=Rh[c];r>=d&&r<=g&&(t+=r-d)}}return parseInt(t,10)}else return t}const ku=new Map;function jE(){ku.clear()}function fi({numberingSystem:e},t=""){const n=e||"latn";let r=ku.get(n);r===void 0&&(r=new Map,ku.set(n,r));let c=r.get(t);return c===void 0&&(c=new RegExp(`${sd[n]}${t}`),r.set(t,c)),c}let bh=()=>Date.now(),kh="system",Ih=null,Lh=null,Ph=null,$h=60,Fh,Bh=null;class Dn{static get now(){return bh}static set now(t){bh=t}static set defaultZone(t){kh=t}static get defaultZone(){return ys(kh,Nc.instance)}static get defaultLocale(){return Ih}static set defaultLocale(t){Ih=t}static get defaultNumberingSystem(){return Lh}static set defaultNumberingSystem(t){Lh=t}static get defaultOutputCalendar(){return Ph}static set defaultOutputCalendar(t){Ph=t}static get defaultWeekSettings(){return Bh}static set defaultWeekSettings(t){Bh=Iu(t)}static get twoDigitCutoffYear(){return $h}static set twoDigitCutoffYear(t){$h=t%100}static get throwOnInvalid(){return Fh}static set throwOnInvalid(t){Fh=t}static resetCaches(){cn.resetCache(),es.resetCache(),St.resetCache(),jE()}}class gi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Sp=[0,31,59,90,120,151,181,212,243,273,304,334],vp=[0,31,60,91,121,152,182,213,244,274,305,335];function Xr(e,t){return new gi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function od(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const c=r.getUTCDay();return c===0?7:c}function wp(e,t,n){return n+(oa(e)?vp:Sp)[t-1]}function Op(e,t){const n=oa(e)?vp:Sp,r=n.findIndex(d=>d<t),c=t-n[r];return{month:r+1,day:c}}function ld(e,t){return(e-t+7)%7+1}function uc(e,t=4,n=1){const{year:r,month:c,day:d}=e,g=wp(r,c,d),m=ld(od(r,c,d),n);let N=Math.floor((g-m+14-t)/7),T;return N<1?(T=r-1,N=ia(T,t,n)):N>ia(r,t,n)?(T=r+1,N=1):T=r,{weekYear:T,weekNumber:N,weekday:m,...xc(e)}}function Hh(e,t=4,n=1){const{weekYear:r,weekNumber:c,weekday:d}=e,g=ld(od(r,1,t),n),m=Yo(r);let N=c*7+d-g-7+t,T;N<1?(T=r-1,N+=Yo(T)):N>m?(T=r+1,N-=Yo(r)):T=r;const{month:R,day:b}=Op(T,N);return{year:T,month:R,day:b,...xc(e)}}function au(e){const{year:t,month:n,day:r}=e,c=wp(t,n,r);return{year:t,ordinal:c,...xc(e)}}function Wh(e){const{year:t,ordinal:n}=e,{month:r,day:c}=Op(t,n);return{year:t,month:r,day:c,...xc(e)}}function Kh(e,t){if(!kt(e.localWeekday)||!kt(e.localWeekNumber)||!kt(e.localWeekYear)){if(!kt(e.weekday)||!kt(e.weekNumber)||!kt(e.weekYear))throw new Go("Cannot mix locale-based week fields with ISO-based week fields");return kt(e.localWeekday)||(e.weekday=e.localWeekday),kt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),kt(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 VE(e,t=4,n=1){const r=Cc(e.weekYear),c=Qr(e.weekNumber,1,ia(e.weekYear,t,n)),d=Qr(e.weekday,1,7);return r?c?d?!1:Xr("weekday",e.weekday):Xr("week",e.weekNumber):Xr("weekYear",e.weekYear)}function qE(e){const t=Cc(e.year),n=Qr(e.ordinal,1,Yo(e.year));return t?n?!1:Xr("ordinal",e.ordinal):Xr("year",e.year)}function Ap(e){const t=Cc(e.year),n=Qr(e.month,1,12),r=Qr(e.day,1,dc(e.year,e.month));return t?n?r?!1:Xr("day",e.day):Xr("month",e.month):Xr("year",e.year)}function Mp(e){const{hour:t,minute:n,second:r,millisecond:c}=e,d=Qr(t,0,23)||t===24&&n===0&&r===0&&c===0,g=Qr(n,0,59),m=Qr(r,0,59),N=Qr(c,0,999);return d?g?m?N?!1:Xr("millisecond",c):Xr("second",r):Xr("minute",n):Xr("hour",t)}function kt(e){return typeof e>"u"}function Ns(e){return typeof e=="number"}function Cc(e){return typeof e=="number"&&e%1===0}function ZE(e){return typeof e=="string"}function JE(e){return Object.prototype.toString.call(e)==="[object Date]"}function Dp(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Rp(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function XE(e){return Array.isArray(e)?e:[e]}function zh(e,t,n){if(e.length!==0)return e.reduce((r,c)=>{const d=[t(c),c];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function QE(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function qo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Iu(e){if(e==null)return null;if(typeof e!="object")throw new gr("Week settings must be an object");if(!Qr(e.firstDay,1,7)||!Qr(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!Qr(t,1,7)))throw new gr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Qr(e,t,n){return Cc(e)&&e>=t&&e<=n}function eT(e,t){return e-t*Math.floor(e/t)}function Hn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function _s(e){if(!(kt(e)||e===null||e===""))return parseInt(e,10)}function Zs(e){if(!(kt(e)||e===null||e===""))return parseFloat(e)}function ad(e){if(!(kt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function cd(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function oa(e){return e%4===0&&(e%100!==0||e%400===0)}function Yo(e){return oa(e)?366:365}function dc(e,t){const n=eT(t-1,12)+1,r=e+(t-n)/12;return n===2?oa(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Ec(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 Uh(e,t,n){return-ld(od(e,1,t),n)+t-1}function ia(e,t=4,n=1){const r=Uh(e,t,n),c=Uh(e+1,t,n);return(Yo(e)-r+c)/7}function Lu(e){return e>99?e:e>Dn.twoDigitCutoffYear?1900+e:2e3+e}function bp(e,t,n,r=null){const c=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 g={timeZoneName:t,...d},m=new Intl.DateTimeFormat(n,g).formatToParts(c).find(N=>N.type.toLowerCase()==="timezonename");return m?m.value:null}function Tc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,c=n<0||Object.is(n,-0)?-r:r;return n*60+c}function kp(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new gr(`Invalid unit value ${e}`);return t}function fc(e,t){const n={};for(const r in e)if(qo(e,r)){const c=e[r];if(c==null)continue;n[t(r)]=kp(c)}return n}function ta(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),c=e>=0?"+":"-";switch(t){case"short":return`${c}${Hn(n,2)}:${Hn(r,2)}`;case"narrow":return`${c}${n}${r>0?`:${r}`:""}`;case"techie":return`${c}${Hn(n,2)}${Hn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function xc(e){return QE(e,["hour","minute","second","millisecond"])}const tT=["January","February","March","April","May","June","July","August","September","October","November","December"],Ip=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nT=["J","F","M","A","M","J","J","A","S","O","N","D"];function Lp(e){switch(e){case"narrow":return[...nT];case"short":return[...Ip];case"long":return[...tT];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 Pp=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$p=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],rT=["M","T","W","T","F","S","S"];function Fp(e){switch(e){case"narrow":return[...rT];case"short":return[...$p];case"long":return[...Pp];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Bp=["AM","PM"],iT=["Before Christ","Anno Domini"],sT=["BC","AD"],oT=["B","A"];function Hp(e){switch(e){case"narrow":return[...oT];case"short":return[...sT];case"long":return[...iT];default:return null}}function lT(e){return Bp[e.hour<12?0:1]}function aT(e,t){return Fp(t)[e.weekday-1]}function cT(e,t){return Lp(t)[e.month-1]}function uT(e,t){return Hp(t)[e.year<0?0:1]}function dT(e,t,n="always",r=!1){const c={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 b=e==="days";switch(t){case 1:return b?"tomorrow":`next ${c[e][0]}`;case-1:return b?"yesterday":`last ${c[e][0]}`;case 0:return b?"today":`this ${c[e][0]}`}}const g=Object.is(t,-0)||t<0,m=Math.abs(t),N=m===1,T=c[e],R=r?N?T[1]:T[2]||T[1]:N?c[e][0]:e;return g?`${m} ${R} ago`:`in ${m} ${R}`}function Gh(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const fT={D:cc,DD:rp,DDD:ip,DDDD:sp,t:op,tt:lp,ttt:ap,tttt:cp,T:up,TT:dp,TTT:fp,TTTT:hp,f:gp,ff:mp,fff:yp,ffff:Cp,F:pp,FF:_p,FFF:Np,FFFF:Ep};class pr{static create(t,n={}){return new pr(t,n)}static parseFormat(t){let n=null,r="",c=!1;const d=[];for(let g=0;g<t.length;g++){const m=t.charAt(g);m==="'"?((r.length>0||c)&&d.push({literal:c||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",c=!c):c||m===n?r+=m:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=m,n=m)}return r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return fT[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,r=void 0){if(this.opts.forceSimple)return Hn(t,n);const c={...this.opts};return n>0&&(c.padTo=n),r&&(c.signDisplay=r),this.loc.numberFormatter(c).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(z,E)=>this.loc.extract(t,z,E),g=z=>t.isOffsetFixed&&t.offset===0&&z.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,z.format):"",m=()=>r?lT(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),N=(z,E)=>r?cT(t,z):d(E?{month:z}:{month:z,day:"numeric"},"month"),T=(z,E)=>r?aT(t,z):d(E?{weekday:z}:{weekday:z,month:"long",day:"numeric"},"weekday"),R=z=>{const E=pr.macroTokenToFormatOpts(z);return E?this.formatWithSystemDefault(t,E):z},b=z=>r?uT(t,z):d({era:z},"era"),k=z=>{switch(z){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 g({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return g({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return g({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 m();case"d":return c?d({day:"numeric"},"day"):this.num(t.day);case"dd":return c?d({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return T("short",!0);case"cccc":return T("long",!0);case"ccccc":return T("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return T("short",!1);case"EEEE":return T("long",!1);case"EEEEE":return T("narrow",!1);case"L":return c?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return c?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return N("short",!0);case"LLLL":return N("long",!0);case"LLLLL":return N("narrow",!0);case"M":return c?d({month:"numeric"},"month"):this.num(t.month);case"MM":return c?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return N("short",!1);case"MMMM":return N("long",!1);case"MMMMM":return N("narrow",!1);case"y":return c?d({year:"numeric"},"year"):this.num(t.year);case"yy":return c?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return c?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return c?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return b("short");case"GG":return b("long");case"GGGGG":return b("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 R(z)}};return Gh(pr.parseFormat(n),k)}formatDurationFromString(t,n){const r=this.opts.signMode==="negativeLargestOnly"?-1:1,c=R=>{switch(R[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},d=(R,b)=>k=>{const z=c(k);if(z){const E=b.isNegativeDuration&&z!==b.largestUnit?r:1;let x;return this.opts.signMode==="negativeLargestOnly"&&z!==b.largestUnit?x="never":this.opts.signMode==="all"?x="always":x="auto",this.num(R.get(z)*E,k.length,x)}else return k},g=pr.parseFormat(n),m=g.reduce((R,{literal:b,val:k})=>b?R:R.concat(k),[]),N=t.shiftTo(...m.map(c).filter(R=>R)),T={isNegativeDuration:N<0,largestUnit:Object.keys(N.values)[0]};return Gh(g,d(N,T))}}const Wp=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function tl(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function nl(...e){return t=>e.reduce(([n,r,c],d)=>{const[g,m,N]=d(t,c);return[{...n,...g},m||r,N]},[{},null,1]).slice(0,2)}function rl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const c=n.exec(e);if(c)return r(c)}return[null,null]}function Kp(...e){return(t,n)=>{const r={};let c;for(c=0;c<e.length;c++)r[e[c]]=_s(t[n+c]);return[r,null,n+c]}}const zp=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,hT=`(?:${zp.source}?(?:\\[(${Wp.source})\\])?)?`,ud=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Up=RegExp(`${ud.source}${hT}`),dd=RegExp(`(?:[Tt]${Up.source})?`),gT=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,pT=/(\d{4})-?W(\d\d)(?:-?(\d))?/,mT=/(\d{4})-?(\d{3})/,_T=Kp("weekYear","weekNumber","weekDay"),yT=Kp("year","ordinal"),NT=/(\d{4})-(\d\d)-(\d\d)/,Gp=RegExp(`${ud.source} ?(?:${zp.source}|(${Wp.source}))?`),CT=RegExp(`(?: ${Gp.source})?`);function jo(e,t,n){const r=e[t];return kt(r)?n:_s(r)}function ET(e,t){return[{year:jo(e,t),month:jo(e,t+1,1),day:jo(e,t+2,1)},null,t+3]}function il(e,t){return[{hours:jo(e,t,0),minutes:jo(e,t+1,0),seconds:jo(e,t+2,0),milliseconds:ad(e[t+3])},null,t+4]}function la(e,t){const n=!e[t]&&!e[t+1],r=Tc(e[t+1],e[t+2]),c=n?null:Tr.instance(r);return[{},c,t+3]}function aa(e,t){const n=e[t]?es.create(e[t]):null;return[{},n,t+1]}const TT=RegExp(`^T?${ud.source}$`),xT=/^-?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 ST(e){const[t,n,r,c,d,g,m,N,T]=e,R=t[0]==="-",b=N&&N[0]==="-",k=(z,E=!1)=>z!==void 0&&(E||z&&R)?-z:z;return[{years:k(Zs(n)),months:k(Zs(r)),weeks:k(Zs(c)),days:k(Zs(d)),hours:k(Zs(g)),minutes:k(Zs(m)),seconds:k(Zs(N),N==="-0"),milliseconds:k(ad(T),b)}]}const vT={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 fd(e,t,n,r,c,d,g){const m={year:t.length===2?Lu(_s(t)):_s(t),month:Ip.indexOf(n)+1,day:_s(r),hour:_s(c),minute:_s(d)};return g&&(m.second=_s(g)),e&&(m.weekday=e.length>3?Pp.indexOf(e)+1:$p.indexOf(e)+1),m}const wT=/^(?:(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 OT(e){const[,t,n,r,c,d,g,m,N,T,R,b]=e,k=fd(t,c,r,n,d,g,m);let z;return N?z=vT[N]:T?z=0:z=Tc(R,b),[k,new Tr(z)]}function AT(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const MT=/^(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$/,DT=/^(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$/,RT=/^(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 Yh(e){const[,t,n,r,c,d,g,m]=e;return[fd(t,c,r,n,d,g,m),Tr.utcInstance]}function bT(e){const[,t,n,r,c,d,g,m]=e;return[fd(t,m,n,r,c,d,g),Tr.utcInstance]}const kT=tl(gT,dd),IT=tl(pT,dd),LT=tl(mT,dd),PT=tl(Up),Yp=nl(ET,il,la,aa),$T=nl(_T,il,la,aa),FT=nl(yT,il,la,aa),BT=nl(il,la,aa);function HT(e){return rl(e,[kT,Yp],[IT,$T],[LT,FT],[PT,BT])}function WT(e){return rl(AT(e),[wT,OT])}function KT(e){return rl(e,[MT,Yh],[DT,Yh],[RT,bT])}function zT(e){return rl(e,[xT,ST])}const UT=nl(il);function GT(e){return rl(e,[TT,UT])}const YT=tl(NT,CT),jT=tl(Gp),VT=nl(il,la,aa);function qT(e){return rl(e,[YT,Yp],[jT,VT])}const jh="Invalid Duration",jp={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}},ZT={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},...jp},Jr=146097/400,Wo=146097/4800,JT={years:{quarters:4,months:12,weeks:Jr/7,days:Jr,hours:Jr*24,minutes:Jr*24*60,seconds:Jr*24*60*60,milliseconds:Jr*24*60*60*1e3},quarters:{months:3,weeks:Jr/28,days:Jr/4,hours:Jr*24/4,minutes:Jr*24*60/4,seconds:Jr*24*60*60/4,milliseconds:Jr*24*60*60*1e3/4},months:{weeks:Wo/7,days:Wo,hours:Wo*24,minutes:Wo*24*60,seconds:Wo*24*60*60,milliseconds:Wo*24*60*60*1e3},...jp},eo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],XT=eo.slice(0).reverse();function Zi(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Qt(r)}function Vp(e,t){let n=t.milliseconds??0;for(const r of XT.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Vh(e,t){const n=Vp(e,t)<0?-1:1;eo.reduceRight((r,c)=>{if(kt(t[c]))return r;if(r){const d=t[r]*n,g=e[c][r],m=Math.floor(d/g);t[c]+=m*n,t[r]-=m*g*n}return c},null),eo.reduce((r,c)=>{if(kt(t[c]))return r;if(r){const d=t[r]%1;t[r]-=d,t[c]+=d*e[r][c]}return c},null)}function qh(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Qt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?JT:ZT;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||cn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Qt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new gr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Qt({values:fc(t,Qt.normalizeUnit),loc:cn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Ns(t))return Qt.fromMillis(t);if(Qt.isDuration(t))return t;if(typeof t=="object")return Qt.fromObject(t);throw new gr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=zT(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=GT(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new gr("need to specify a reason the Duration is invalid");const r=t instanceof gi?t:new gi(t,n);if(Dn.throwOnInvalid)throw new SE(r);return new Qt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new np(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?pr.create(this.loc,r).formatDurationFromString(this,t):jh}toHuman(t={}){if(!this.isValid)return jh;const n=t.showZeros!==!1,r=eo.map(c=>{const d=this.values[c];return kt(d)||d===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:c.slice(0,-1)}).format(d)}).filter(c=>c);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}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+=cd(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},St.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?Vp(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t),r={};for(const c of eo)(qo(n.values,c)||qo(this.values,c))&&(r[c]=n.get(c)+this.get(c));return Zi(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=kp(t(this.values[r],r));return Zi(this,{values:n},!0)}get(t){return this[Qt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...fc(t,Qt.normalizeUnit)};return Zi(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:c}={}){const g={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:c,conversionAccuracy:r};return Zi(this,g)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Vh(this.matrix,t),Zi(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=qh(this.normalize().shiftToAll().toObject());return Zi(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(g=>Qt.normalizeUnit(g));const n={},r={},c=this.toObject();let d;for(const g of eo)if(t.indexOf(g)>=0){d=g;let m=0;for(const T in r)m+=this.matrix[T][g]*r[T],r[T]=0;Ns(c[g])&&(m+=c[g]);const N=Math.trunc(m);n[g]=N,r[g]=(m*1e3-N*1e3)/1e3}else Ns(c[g])&&(r[g]=c[g]);for(const g in r)r[g]!==0&&(n[d]+=g===d?r[g]:r[g]/this.matrix[d][g]);return Vh(this.matrix,n),Zi(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 Zi(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=qh(this.values);return Zi(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,c){return r===void 0||r===0?c===void 0||c===0:r===c}for(const r of eo)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Ko="Invalid Interval";function QT(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 gr("need to specify a reason the Interval is invalid");const r=t instanceof gi?t:new gi(t,n);if(Dn.throwOnInvalid)throw new xE(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Yl(t),c=Yl(n),d=QT(r,c);return d??new Mn({start:r,end:c})}static after(t,n){const r=Qt.fromDurationLike(n),c=Yl(t);return Mn.fromDateTimes(c,c.plus(r))}static before(t,n){const r=Qt.fromDurationLike(n),c=Yl(t);return Mn.fromDateTimes(c.minus(r),c)}static fromISO(t,n){const[r,c]=(t||"").split("/",2);if(r&&c){let d,g;try{d=St.fromISO(r,n),g=d.isValid}catch{g=!1}let m,N;try{m=St.fromISO(c,n),N=m.isValid}catch{N=!1}if(g&&N)return Mn.fromDateTimes(d,m);if(g){const T=Qt.fromISO(c,n);if(T.isValid)return Mn.after(d,T)}else if(N){const T=Qt.fromISO(r,n);if(T.isValid)return Mn.before(m,T)}}return Mn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):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 c;return n!=null&&n.useLocaleWeeks?c=this.end.reconfigure({locale:r.locale}):c=this.end,c=c.startOf(t,n),Math.floor(c.diff(r,t).get(t))+(c.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(Yl).filter(g=>this.contains(g)).sort((g,m)=>g.toMillis()-m.toMillis()),r=[];let{s:c}=this,d=0;for(;c<this.e;){const g=n[d]||this.e,m=+g>+this.e?this.e:g;r.push(Mn.fromDateTimes(c,m)),c=m,d+=1}return r}splitBy(t){const n=Qt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,c=1,d;const g=[];for(;r<this.e;){const m=this.start.plus(n.mapUnits(N=>N*c));d=+m>+this.e?this.e:m,g.push(Mn.fromDateTimes(r,d)),r=d,c+=1}return g}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((c,d)=>c.s-d.s).reduce(([c,d],g)=>d?d.overlaps(g)||d.abutsStart(g)?[c,d.union(g)]:[c.concat([d]),g]:[c,g],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const c=[],d=t.map(N=>[{time:N.s,type:"s"},{time:N.e,type:"e"}]),g=Array.prototype.concat(...d),m=g.sort((N,T)=>N.time-T.time);for(const N of m)r+=N.type==="s"?1:-1,r===1?n=N.time:(n&&+n!=+N.time&&c.push(Mn.fromDateTimes(n,N.time)),n=null);return Mn.merge(c)}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()})`:Ko}[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=cc,n={}){return this.isValid?pr.create(this.s.loc.clone(n),t).formatInterval(this):Ko}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ko}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ko}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ko}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Ko}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Qt.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class qa{static hasDST(t=Dn.defaultZone){const n=St.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return es.isValidZone(t)}static normalizeZone(t){return ys(t,Dn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||cn.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||cn.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||cn.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||cn.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return cn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return cn.create(n,null,"gregory").eras(t)}static features(){return{relative:Dp(),localeWeek:Rp()}}}function Zh(e,t){const n=c=>c.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Qt.fromMillis(r).as("days"))}function ex(e,t,n){const r=[["years",(N,T)=>T.year-N.year],["quarters",(N,T)=>T.quarter-N.quarter+(T.year-N.year)*4],["months",(N,T)=>T.month-N.month+(T.year-N.year)*12],["weeks",(N,T)=>{const R=Zh(N,T);return(R-R%7)/7}],["days",Zh]],c={},d=e;let g,m;for(const[N,T]of r)n.indexOf(N)>=0&&(g=N,c[N]=T(e,t),m=d.plus(c),m>t?(c[N]--,e=d.plus(c),e>t&&(m=e,c[N]--,e=d.plus(c))):e=m);return[e,c,m,g]}function tx(e,t,n,r){let[c,d,g,m]=ex(e,t,n);const N=t-c,T=n.filter(b=>["hours","minutes","seconds","milliseconds"].indexOf(b)>=0);T.length===0&&(g<t&&(g=c.plus({[m]:1})),g!==c&&(d[m]=(d[m]||0)+N/(g-c)));const R=Qt.fromObject(d,r);return T.length>0?Qt.fromMillis(N,r).shiftTo(...T).plus(R):R}const nx="missing Intl.DateTimeFormat.formatToParts support";function on(e,t=n=>n){return{regex:e,deser:([n])=>t(YE(n))}}const rx=" ",qp=`[ ${rx}]`,Zp=new RegExp(qp,"g");function ix(e){return e.replace(/\./g,"\\.?").replace(Zp,qp)}function Jh(e){return e.replace(/\./g,"").replace(Zp," ").toLowerCase()}function hi(e,t){return e===null?null:{regex:RegExp(e.map(ix).join("|")),deser:([n])=>e.findIndex(r=>Jh(n)===Jh(r))+t}}function Xh(e,t){return{regex:e,deser:([,n,r])=>Tc(n,r),groups:t}}function Za(e){return{regex:e,deser:([t])=>t}}function sx(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ox(e,t){const n=fi(t),r=fi(t,"{2}"),c=fi(t,"{3}"),d=fi(t,"{4}"),g=fi(t,"{6}"),m=fi(t,"{1,2}"),N=fi(t,"{1,3}"),T=fi(t,"{1,6}"),R=fi(t,"{1,9}"),b=fi(t,"{2,4}"),k=fi(t,"{4,6}"),z=U=>({regex:RegExp(sx(U.val)),deser:([Q])=>Q,literal:!0}),x=(U=>{if(e.literal)return z(U);switch(U.val){case"G":return hi(t.eras("short"),0);case"GG":return hi(t.eras("long"),0);case"y":return on(T);case"yy":return on(b,Lu);case"yyyy":return on(d);case"yyyyy":return on(k);case"yyyyyy":return on(g);case"M":return on(m);case"MM":return on(r);case"MMM":return hi(t.months("short",!0),1);case"MMMM":return hi(t.months("long",!0),1);case"L":return on(m);case"LL":return on(r);case"LLL":return hi(t.months("short",!1),1);case"LLLL":return hi(t.months("long",!1),1);case"d":return on(m);case"dd":return on(r);case"o":return on(N);case"ooo":return on(c);case"HH":return on(r);case"H":return on(m);case"hh":return on(r);case"h":return on(m);case"mm":return on(r);case"m":return on(m);case"q":return on(m);case"qq":return on(r);case"s":return on(m);case"ss":return on(r);case"S":return on(N);case"SSS":return on(c);case"u":return Za(R);case"uu":return Za(m);case"uuu":return on(n);case"a":return hi(t.meridiems(),0);case"kkkk":return on(d);case"kk":return on(b,Lu);case"W":return on(m);case"WW":return on(r);case"E":case"c":return on(n);case"EEE":return hi(t.weekdays("short",!1),1);case"EEEE":return hi(t.weekdays("long",!1),1);case"ccc":return hi(t.weekdays("short",!0),1);case"cccc":return hi(t.weekdays("long",!0),1);case"Z":case"ZZ":return Xh(new RegExp(`([+-]${m.source})(?::(${r.source}))?`),2);case"ZZZ":return Xh(new RegExp(`([+-]${m.source})(${r.source})?`),2);case"z":return Za(/[a-z_+-/]{1,256}?/i);case" ":return Za(/[^\S\n\r]/);default:return z(U)}})(e)||{invalidReason:nx};return x.token=e,x}const lx={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 ax(e,t,n){const{type:r,value:c}=e;if(r==="literal"){const N=/^\s+$/.test(c);return{literal:!N,val:N?" ":c}}const d=t[r];let g=r;r==="hour"&&(t.hour12!=null?g=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?g="hour12":g="hour24":g=n.hour12?"hour12":"hour24");let m=lx[g];if(typeof m=="object"&&(m=m[d]),m)return{literal:!1,val:m}}function cx(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function ux(e,t,n){const r=e.match(t);if(r){const c={};let d=1;for(const g in n)if(qo(n,g)){const m=n[g],N=m.groups?m.groups+1:1;!m.literal&&m.token&&(c[m.token.val[0]]=m.deser(r.slice(d,d+N))),d+=N}return[r,c]}else return[r,{}]}function dx(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 kt(e.z)||(n=es.create(e.z)),kt(e.Z)||(n||(n=new Tr(e.Z)),r=e.Z),kt(e.q)||(e.M=(e.q-1)*3+1),kt(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),kt(e.u)||(e.S=ad(e.u)),[Object.keys(e).reduce((d,g)=>{const m=t(g);return m&&(d[m]=e[g]),d},{}),n,r]}let cu=null;function fx(){return cu||(cu=St.fromMillis(1555555555555)),cu}function hx(e,t){if(e.literal)return e;const n=pr.macroTokenToFormatOpts(e.val),r=em(n,t);return r==null||r.includes(void 0)?e:r}function Jp(e,t){return Array.prototype.concat(...e.map(n=>hx(n,t)))}class Xp{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Jp(pr.parseFormat(n),t),this.units=this.tokens.map(r=>ox(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,c]=cx(this.units);this.regex=RegExp(r,"i"),this.handlers=c}}explainFromTokens(t){if(this.isValid){const[n,r]=ux(t,this.regex,this.handlers),[c,d,g]=r?dx(r):[null,null,void 0];if(qo(r,"a")&&qo(r,"H"))throw new Go("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:c,zone:d,specificOffset:g}}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 Qp(e,t,n){return new Xp(e,n).explainFromTokens(t)}function gx(e,t,n){const{result:r,zone:c,specificOffset:d,invalidReason:g}=Qp(e,t,n);return[r,c,d,g]}function em(e,t){if(!e)return null;const r=pr.create(t,e).dtFormatter(fx()),c=r.formatToParts(),d=r.resolvedOptions();return c.map(g=>ax(g,e,d))}const uu="Invalid DateTime",px=864e13;function Zl(e){return new gi("unsupported zone",`the zone "${e.name}" is not supported`)}function du(e){return e.weekData===null&&(e.weekData=uc(e.c)),e.weekData}function fu(e){return e.localWeekData===null&&(e.localWeekData=uc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Js(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new St({...n,...t,old:n})}function tm(e,t,n){let r=e-t*60*1e3;const c=n.offset(r);if(t===c)return[r,t];r-=(c-t)*60*1e3;const d=n.offset(r);return c===d?[r,c]:[e-Math.min(c,d)*60*1e3,Math.max(c,d)]}function Ja(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 ec(e,t,n){return tm(Ec(e),t,n)}function Qh(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),c=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:c,day:Math.min(e.c.day,dc(r,c))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},g=Qt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),m=Ec(d);let[N,T]=tm(m,n,e.zone);return g!==0&&(N+=g,T=e.zone.offset(N)),{ts:N,o:T}}function zo(e,t,n,r,c,d){const{setZone:g,zone:m}=n;if(e&&Object.keys(e).length!==0||t){const N=t||m,T=St.fromObject(e,{...n,zone:N,specificOffset:d});return g?T:T.setZone(m)}else return St.invalid(new gi("unparsable",`the input "${c}" can't be parsed as ${r}`))}function Xa(e,t,n=!0){return e.isValid?pr.create(cn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function hu(e,t,n){const r=e.c.year>9999||e.c.year<0;let c="";if(r&&e.c.year>=0&&(c+="+"),c+=Hn(e.c.year,r?6:4),n==="year")return c;if(t){if(c+="-",c+=Hn(e.c.month),n==="month")return c;c+="-"}else if(c+=Hn(e.c.month),n==="month")return c;return c+=Hn(e.c.day),c}function eg(e,t,n,r,c,d,g){let m=!n||e.c.millisecond!==0||e.c.second!==0,N="";switch(g){case"day":case"month":case"year":break;default:if(N+=Hn(e.c.hour),g==="hour")break;if(t){if(N+=":",N+=Hn(e.c.minute),g==="minute")break;m&&(N+=":",N+=Hn(e.c.second))}else{if(N+=Hn(e.c.minute),g==="minute")break;m&&(N+=Hn(e.c.second))}if(g==="second")break;m&&(!r||e.c.millisecond!==0)&&(N+=".",N+=Hn(e.c.millisecond,3))}return c&&(e.isOffsetFixed&&e.offset===0&&!d?N+="Z":e.o<0?(N+="-",N+=Hn(Math.trunc(-e.o/60)),N+=":",N+=Hn(Math.trunc(-e.o%60))):(N+="+",N+=Hn(Math.trunc(e.o/60)),N+=":",N+=Hn(Math.trunc(e.o%60)))),d&&(N+="["+e.zone.ianaName+"]"),N}const nm={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},mx={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_x={ordinal:1,hour:0,minute:0,second:0,millisecond:0},tc=["year","month","day","hour","minute","second","millisecond"],yx=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Nx=["year","ordinal","hour","minute","second","millisecond"];function nc(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 np(e);return t}function tg(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return nc(e)}}function Cx(e){if(Jl===void 0&&(Jl=Dn.now()),e.type!=="iana")return e.offset(Jl);const t=e.name;let n=Pu.get(t);return n===void 0&&(n=e.offset(Jl),Pu.set(t,n)),n}function ng(e,t){const n=ys(t.zone,Dn.defaultZone);if(!n.isValid)return St.invalid(Zl(n));const r=cn.fromObject(t);let c,d;if(kt(e.year))c=Dn.now();else{for(const N of tc)kt(e[N])&&(e[N]=nm[N]);const g=Ap(e)||Mp(e);if(g)return St.invalid(g);const m=Cx(n);[c,d]=ec(e,m,n)}return new St({ts:c,zone:n,loc:r,o:d})}function rg(e,t,n){const r=kt(n.round)?!0:n.round,c=kt(n.rounding)?"trunc":n.rounding,d=(m,N)=>(m=cd(m,r||n.calendary?0:2,n.calendary?"round":c),t.loc.clone(n).relFormatter(n).format(m,N)),g=m=>n.calendary?t.hasSame(e,m)?0:t.startOf(m).diff(e.startOf(m),m).get(m):t.diff(e,m).get(m);if(n.unit)return d(g(n.unit),n.unit);for(const m of n.units){const N=g(m);if(Math.abs(N)>=1)return d(N,m)}return d(e>t?-0:0,n.units[n.units.length-1])}function ig(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 Jl;const Pu=new Map;class St{constructor(t){const n=t.zone||Dn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new gi("invalid input"):null)||(n.isValid?null:Zl(n));this.ts=kt(t.ts)?Dn.now():t.ts;let c=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[c,d]=[t.old.c,t.old.o];else{const m=Ns(t.o)&&!t.old?t.o:n.offset(this.ts);c=Ja(this.ts,m),r=Number.isNaN(c.year)?new gi("invalid input"):null,c=r?null:c,d=r?null:m}this._zone=n,this.loc=t.loc||cn.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=c,this.o=d,this.isLuxonDateTime=!0}static now(){return new St({})}static local(){const[t,n]=ig(arguments),[r,c,d,g,m,N,T]=n;return ng({year:r,month:c,day:d,hour:g,minute:m,second:N,millisecond:T},t)}static utc(){const[t,n]=ig(arguments),[r,c,d,g,m,N,T]=n;return t.zone=Tr.utcInstance,ng({year:r,month:c,day:d,hour:g,minute:m,second:N,millisecond:T},t)}static fromJSDate(t,n={}){const r=JE(t)?t.valueOf():NaN;if(Number.isNaN(r))return St.invalid("invalid input");const c=ys(n.zone,Dn.defaultZone);return c.isValid?new St({ts:r,zone:c,loc:cn.fromObject(n)}):St.invalid(Zl(c))}static fromMillis(t,n={}){if(Ns(t))return t<-864e13||t>px?St.invalid("Timestamp out of range"):new St({ts:t,zone:ys(n.zone,Dn.defaultZone),loc:cn.fromObject(n)});throw new gr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Ns(t))return new St({ts:t*1e3,zone:ys(n.zone,Dn.defaultZone),loc:cn.fromObject(n)});throw new gr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=ys(n.zone,Dn.defaultZone);if(!r.isValid)return St.invalid(Zl(r));const c=cn.fromObject(n),d=fc(t,tg),{minDaysInFirstWeek:g,startOfWeek:m}=Kh(d,c),N=Dn.now(),T=kt(n.specificOffset)?r.offset(N):n.specificOffset,R=!kt(d.ordinal),b=!kt(d.year),k=!kt(d.month)||!kt(d.day),z=b||k,E=d.weekYear||d.weekNumber;if((z||R)&&E)throw new Go("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(k&&R)throw new Go("Can't mix ordinal dates with month/day");const x=E||d.weekday&&!z;let U,Q,F=Ja(N,T);x?(U=yx,Q=mx,F=uc(F,g,m)):R?(U=Nx,Q=_x,F=au(F)):(U=tc,Q=nm);let W=!1;for(const B of U){const V=d[B];kt(V)?W?d[B]=Q[B]:d[B]=F[B]:W=!0}const G=x?VE(d,g,m):R?qE(d):Ap(d),q=G||Mp(d);if(q)return St.invalid(q);const le=x?Hh(d,g,m):R?Wh(d):d,[se,ge]=ec(le,T,r),j=new St({ts:se,zone:r,o:ge,loc:c});return d.weekday&&z&&t.weekday!==j.weekday?St.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${j.toISO()}`):j.isValid?j:St.invalid(j.invalid)}static fromISO(t,n={}){const[r,c]=HT(t);return zo(r,c,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,c]=WT(t);return zo(r,c,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,c]=KT(t);return zo(r,c,n,"HTTP",n)}static fromFormat(t,n,r={}){if(kt(t)||kt(n))throw new gr("fromFormat requires an input string and a format");const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0}),[m,N,T,R]=gx(g,t,n);return R?St.invalid(R):zo(m,N,r,`format ${n}`,t,T)}static fromString(t,n,r={}){return St.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,c]=qT(t);return zo(r,c,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new gr("need to specify a reason the DateTime is invalid");const r=t instanceof gi?t:new gi(t,n);if(Dn.throwOnInvalid)throw new TE(r);return new St({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=em(t,cn.fromObject(n));return r?r.map(c=>c?c.val:null).join(""):null}static expandFormat(t,n={}){return Jp(pr.parseFormat(t),cn.fromObject(n)).map(c=>c.val).join("")}static resetCache(){Jl=void 0,Pu.clear()}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?du(this).weekYear:NaN}get weekNumber(){return this.isValid?du(this).weekNumber:NaN}get weekday(){return this.isValid?du(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?fu(this).weekday:NaN}get localWeekNumber(){return this.isValid?fu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?fu(this).weekYear:NaN}get ordinal(){return this.isValid?au(this.c).ordinal:NaN}get monthShort(){return this.isValid?qa.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qa.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qa.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qa.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=Ec(this.c),c=this.zone.offset(r-t),d=this.zone.offset(r+t),g=this.zone.offset(r-c*n),m=this.zone.offset(r-d*n);if(g===m)return[this];const N=r-g*n,T=r-m*n,R=Ja(N,g),b=Ja(T,m);return R.hour===b.hour&&R.minute===b.minute&&R.second===b.second&&R.millisecond===b.millisecond?[Js(this,{ts:N}),Js(this,{ts:T})]:[this]}get isInLeapYear(){return oa(this.year)}get daysInMonth(){return dc(this.year,this.month)}get daysInYear(){return this.isValid?Yo(this.year):NaN}get weeksInWeekYear(){return this.isValid?ia(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ia(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:c}=pr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:c}}toUTC(t=0,n={}){return this.setZone(Tr.instance(t),n)}toLocal(){return this.setZone(Dn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=ys(t,Dn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let c=this.ts;if(n||r){const d=t.offset(this.ts),g=this.toObject();[c]=ec(g,d,t)}return Js(this,{ts:c,zone:t})}else return St.invalid(Zl(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const c=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Js(this,{loc:c})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=fc(t,tg),{minDaysInFirstWeek:r,startOfWeek:c}=Kh(n,this.loc),d=!kt(n.weekYear)||!kt(n.weekNumber)||!kt(n.weekday),g=!kt(n.ordinal),m=!kt(n.year),N=!kt(n.month)||!kt(n.day),T=m||N,R=n.weekYear||n.weekNumber;if((T||g)&&R)throw new Go("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(N&&g)throw new Go("Can't mix ordinal dates with month/day");let b;d?b=Hh({...uc(this.c,r,c),...n},r,c):kt(n.ordinal)?(b={...this.toObject(),...n},kt(n.day)&&(b.day=Math.min(dc(b.year,b.month),b.day))):b=Wh({...au(this.c),...n});const[k,z]=ec(b,this.o,this.zone);return Js(this,{ts:k,o:z})}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return Js(this,Qh(this,n))}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t).negate();return Js(this,Qh(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},c=Qt.normalizeUnit(t);switch(c){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(c==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:g}=this;g<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(c==="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?pr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):uu}toLocaleString(t=cc,n={}){return this.isValid?pr.create(this.loc.clone(n),t).formatDateTime(this):uu}toLocaleParts(t={}){return this.isValid?pr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:c=!0,extendedZone:d=!1,precision:g="milliseconds"}={}){if(!this.isValid)return null;g=nc(g);const m=t==="extended";let N=hu(this,m,g);return tc.indexOf(g)>=3&&(N+="T"),N+=eg(this,m,n,r,c,d,g),N}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?hu(this,t==="extended",nc(n)):null}toISOWeekDate(){return Xa(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:c=!1,extendedZone:d=!1,format:g="extended",precision:m="milliseconds"}={}){return this.isValid?(m=nc(m),(c&&tc.indexOf(m)>=3?"T":"")+eg(this,g==="extended",n,t,r,d,m)):null}toRFC2822(){return Xa(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Xa(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?hu(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let c="HH:mm:ss.SSS";return(n||t)&&(r&&(c+=" "),n?c+="z":t&&(c+="ZZ")),Xa(this,c,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():uu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Qt.invalid("created by diffing an invalid DateTime");const c={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=XE(n).map(Qt.normalizeUnit),g=t.valueOf()>this.valueOf(),m=g?this:t,N=g?t:this,T=tx(m,N,d,c);return g?T.negate():T}diffNow(t="milliseconds",n={}){return this.diff(St.now(),t,n)}until(t){return this.isValid?Mn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const c=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=c&&c<=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||St.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let c=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(c=t.unit,d=void 0),rg(n,this.plus(r),{...t,numeric:"always",units:c,unit:d})}toRelativeCalendar(t={}){return this.isValid?rg(t.base||St.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(St.isDateTime))throw new gr("min requires all arguments be DateTimes");return zh(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(St.isDateTime))throw new gr("max requires all arguments be DateTimes");return zh(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});return Qp(g,t,n)}static fromStringExplain(t,n,r={}){return St.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:c=null}=n,d=cn.fromOpts({locale:r,numberingSystem:c,defaultToEN:!0});return new Xp(d,t)}static fromFormatParser(t,n,r={}){if(kt(t)||kt(n))throw new gr("fromFormatParser requires an input string and a format parser");const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});if(!g.equals(n.locale))throw new gr(`fromFormatParser called with a locale of ${g}, but the format parser was created for ${n.locale}`);const{result:m,zone:N,specificOffset:T,invalidReason:R}=n.explainFromTokens(t);return R?St.invalid(R):zo(m,N,r,`format ${n.format}`,t,T)}static get DATE_SHORT(){return cc}static get DATE_MED(){return rp}static get DATE_MED_WITH_WEEKDAY(){return vE}static get DATE_FULL(){return ip}static get DATE_HUGE(){return sp}static get TIME_SIMPLE(){return op}static get TIME_WITH_SECONDS(){return lp}static get TIME_WITH_SHORT_OFFSET(){return ap}static get TIME_WITH_LONG_OFFSET(){return cp}static get TIME_24_SIMPLE(){return up}static get TIME_24_WITH_SECONDS(){return dp}static get TIME_24_WITH_SHORT_OFFSET(){return fp}static get TIME_24_WITH_LONG_OFFSET(){return hp}static get DATETIME_SHORT(){return gp}static get DATETIME_SHORT_WITH_SECONDS(){return pp}static get DATETIME_MED(){return mp}static get DATETIME_MED_WITH_SECONDS(){return _p}static get DATETIME_MED_WITH_WEEKDAY(){return wE}static get DATETIME_FULL(){return yp}static get DATETIME_FULL_WITH_SECONDS(){return Np}static get DATETIME_HUGE(){return Cp}static get DATETIME_HUGE_WITH_SECONDS(){return Ep}}function Yl(e){if(St.isDateTime(e))return e;if(e&&e.valueOf&&Ns(e.valueOf()))return St.fromJSDate(e);if(e&&typeof e=="object")return St.fromObject(e);throw new gr(`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 Sc(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 no(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 $u=[Yt.Monday,Yt.Tuesday,Yt.Wednesday,Yt.Thursday,Yt.Friday,Yt.Saturday,Yt.Sunday],Xl={[Yt.Monday]:"monday",[Yt.Tuesday]:"tuesday",[Yt.Wednesday]:"wednesday",[Yt.Thursday]:"thursday",[Yt.Friday]:"friday",[Yt.Saturday]:"saturday",[Yt.Sunday]:"sunday"};class hc{constructor(t,n,r){ke(this,"end");ke(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(T=>{if(T.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[c,d]=n.start.split(":").map(Number),[g,m]=n.end.split(":").map(Number);let N=0;g<c&&(N=1),this.end=this.end.set({hour:g,minute:m,day:this.end.day+N}),this.start=this.start.set({hour:c,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 rm{constructor(t,n){ke(this,"holidayHoursByDate");ke(this,"hours");ke(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 c=this.getHours(r);if(c&&!c.isClosed)for(const d of c.openIntervals||[]){const g=new hc(r,d,this.timezone);if(g.contains(t))return g}}return null}getCurrentInterval(){return this.getInterval(St.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,g)=>d.start===g.start?0:d.start>g.start?1:-1,c=n.sort(r);for(const[d,g]of c.entries())if(g.contains(t)&&c.length>d+1)return c[d+1];for(const d of c)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let c=0;c<t;c++){let d=n;d=d.plus({days:c});const g=this.getHours(d);g!=null&&g.openIntervals&&!g.isClosed&&r.push(...g.openIntervals.map(m=>new hc(d,m,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=no(Sc(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(St.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,c,d]=n,g=St.fromObject({year:Number(r),month:Number(c),day:Number(d)},{zone:this.timezone});if(t<g)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(St.now())}}function Ex(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function Tx(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 ca(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 ua(e){return!e.futureInterval}function xx(e){return ca(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):ua(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):nt.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function Sx(e){return ca(e)||ua(e)?null:nt.jsx("span",{className:"HoursStatus-separator",children:" • "})}function vx(e){return ca(e)||ua(e)?null:nt.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function wx(e){if(ca(e)||ua(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 Ox(e){var r,c;if(ca(e)||ua(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+=((c=d==null?void 0:d.start)==null?void 0:c.setLocale("en-US").toLocaleString(t))||""}return nt.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function Ax(e,t){const n=e.currentTemplate||xx,r=e.separatorTemplate||Sx,c=e.futureTemplate||vx,d=e.timeTemplate||wx,g=e.dayOfWeekTemplate||Ox;return nt.jsxs("div",{className:ro("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),c(e),d(e),g(e)]})}const Mx={minHeight:`${1.5}em`},Dx=e=>{const[t,n]=yt.useState(!1),[r,c]=yt.useState(!1);if(yt.useEffect(()=>{c(!0)},[]),!e.hours)return nt.jsx(nt.Fragment,{});const d=e.statusTemplate||Ax,g=new rm(e.hours,e.timezone),m=g.isOpenNow(),N=g.getCurrentInterval(),T=g.getNextInterval(),R=(N==null?void 0:N.end)||(T==null?void 0:T.start);if(R&&!t){n(!0);const k=R.toMillis()-St.now().toMillis();setTimeout(()=>n(!1),k)}const b={isOpen:m,currentInterval:N,futureInterval:T,...e};return nt.jsx(nt.Fragment,{children:r?d(b,e):nt.jsx("div",{style:Mx,className:ro("HoursStatus",(e==null?void 0:e.className)||"")})})};function Rx(e,t){const n=[];return e.forEach(r=>{const c=n[n.length-1];c?Tx(c.intervals,r.intervals)?(c.endDay=r.endDay,c.isToday=c.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const c=t&&Xl[r.startDay]in t?t[Xl[r.startDay]]||"":no(r.startDay),d=t&&Xl[r.endDay]in t?t[Xl[r.endDay]]||"":no(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${c}`:`${c} - ${d}`}})}function bx(e,t,n){const r=[],c=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?r.push((n==null?void 0:n.isClosed)||"Closed"):c?r.push((n==null?void 0:n.open24Hours)||"Open 24 hours"):e.intervals.forEach(d=>{const g=d.getStartTime((n==null?void 0:n.timeFormatLocale)||"en-US",t),m=d.getEndTime((n==null?void 0:n.timeFormatLocale)||"en-US",t);r.push(`${g} - ${m}`)}),r}function kx(e,t,n){const r=[];for(let c=1;c<=7;c++){const d=St.fromObject({weekday:c}),g=Sc(d);r.push({startDay:g,endDay:g,dayName:n&&no(g).toLowerCase()in n?n[no(g).toLowerCase()]||"":no(g),intervals:e.filter(m=>m.start.weekday===c),isToday:(t==null?void 0:t.weekday)===c})}return r}const Ix=e=>{const[t,n]=yt.useState(!1);return yt.useEffect(()=>{n(!0)},[]),e.hours?nt.jsx(nt.Fragment,{children:t?nt.jsx(Lx,{...e}):nt.jsx(Px,{...e})}):nt.jsx(nt.Fragment,{})},Lx=e=>{const t=new rm(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),n=St.now(),r=t.getIntervalsForNDays(7,n),c=kx(r,n,e.dayOfWeekNames);return nt.jsx(Fu,{...e,hoursData:c,isClient:!0})},Px=e=>{var g;const{hours:t,dayOfWeekNames:n,intervalTranslations:r}=e,c=$u.map(m=>{var T,R;const N=Xl[m];return{dayName:(n==null?void 0:n[N])||no(m),startDay:m,endDay:m,isToday:!1,intervals:((R=(T=t[N])==null?void 0:T.openIntervals)==null?void 0:R.map(b=>new hc(St.now(),b,"UTC")))??[]}}),d=(g=t.holidayHours)==null?void 0:g.map(m=>{var R,b;const N=St.fromFormat(m.date,"yyyy-MM-dd"),T=Sc(N);return{dayName:N.setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString(),isToday:!1,startDay:T,endDay:T,intervals:(m.isRegularHours?(R=m.openIntervals)==null?void 0:R.map(k=>new hc(N,k,"UTC")):(b=c.find(k=>k.startDay===T))==null?void 0:b.intervals)??[]}});return nt.jsxs(nt.Fragment,{children:[nt.jsx(Fu,{...e,hoursData:c,isClient:!1}),d&&d.length>0&&nt.jsx(Fu,{...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:St.fromFormat(t.reopenDate,"yyyy-MM-dd").setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString()})]})]})},Fu=e=>{const{intervalStringsBuilderFn:t,className:n,timeOptions:r,intervalTranslations:c,dayOfWeekNames:d,startOfWeek:g,isClient:m,isHolidayHours:N}=e;let T=e.hoursData;function R(z){return z?{today:Sc(St.now()),monday:Yt.Monday,tuesday:Yt.Tuesday,wednesday:Yt.Wednesday,thursday:Yt.Thursday,friday:Yt.Friday,saturday:Yt.Saturday,sunday:Yt.Sunday}[z]:Yt.Sunday}const b=$u.indexOf(R(m||g!=="today"?g:"sunday")),k=Ex($u,7-b);return N||(T.sort((z,E)=>k.indexOf(z.startDay)-k.indexOf(E.startDay)),e.collapseDays&&(T=Rx(T,d))),nt.jsx("div",{className:ro("HoursTable",n),children:T.map(z=>{const x=(t||bx)(z,r,c);return nt.jsxs("div",{className:ro("HoursTable-row",{"is-today":z.isToday}),children:[nt.jsx("span",{className:"HoursTable-day",children:z.dayName}),nt.jsx("span",{className:"HoursTable-intervals",children:x.map((U,Q)=>nt.jsx("span",{className:"HoursTable-interval",children:U},Q))})]},z.dayName)})})},$x=e=>`<script type="application/ld+json">
|
|
110
110
|
${JSON.stringify(e)}
|
|
111
|
-
<\/script>`,vc=(e,t)=>{if(!(!e.name||typeof e.name!="string"))return{"@context":"https://schema.org","@type":t,name:e.name}},$x=e=>typeof e!="object"?!1:!!e.name||!!e.address,Fx=e=>typeof e!="object"?!1:!!e.line1||!!e.city||!!e.region||!!e.postalCode||!!e.countryCode,hd=e=>Fx(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},im=e=>$x(e)&&{"@type":"Place",name:e.name,...hd(e.address)},sm=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image&&typeof e.image.url=="string",wc=e=>{if(!e)return{};const t=new Array;for(const n of e)sm(n)&&t.push(n.image.url);return{image:t}},Bx=e=>sm(e)&&{image:e.image.url},Hx=e=>typeof e!="object"?!1:!!e.name,Wx=e=>Array.isArray(e)&&e.length>0,om=e=>Wx(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},lm=e=>Hx(e)&&{organizer:{"@type":"Organization",name:e.name,...e.url&&{url:e.url}}},Kx=["BackOrder","Discontinued","InStock","InStoreOnly","LimitedAvailability","MadeToOrder","OnlineOnly","OutOfStock","PreOrder","PreSale","Reserved","SoldOut"],zx=e=>typeof e!="object"?!1:"priceCurrency"in e&&"price"in e&&"availability"in e&&Kx.includes(e.availability),gd=e=>zx(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},Ux=(e,t)=>{const n=im({name:e.geomodifier,address:e.address});return{...vc(e,t??"Event"),...wc(e.photoGallery),...n&&{location:n},...om(e.performers),...lm({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}}},Gx=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,Yx=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,am=e=>{if(!Gx(e))return{};let t=new Map;t=Js(e.monday,t,"Mo"),t=Js(e.tuesday,t,"Tu"),t=Js(e.wednesday,t,"We"),t=Js(e.thursday,t,"Th"),t=Js(e.friday,t,"Fr"),t=Js(e.saturday,t,"Sa"),t=Js(e.sunday,t,"Su");const n=new Array;for(const[r,c]of t){const d=c.join(",");n.push(d+" "+r)}return{openingHours:n}},Js=(e,t,n)=>{if(!Yx(e))return t;if(e.isClosed||!e.openIntervals){const r="00:00-00:00",c=t.get(r)??[];return c.push(n),t.set(r,c),t}for(let r=0;r<e.openIntervals.length;r++){const c=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(c)??[];d.push(n),t.set(c,d)}return t},jx=(e,t)=>({...vc(e,t??"LocalBusiness"),...hd(e.address),...am(e.hours),...wc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),Vx=e=>typeof e!="object"?!1:"ratingValue"in e,qx=e=>typeof e!="object"?!1:"ratingValue"in e&&"reviewCount"in e,cm=e=>Vx(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},...e.author&&{author:{"@type":"Person",name:e.author}}}},um=e=>qx(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,Zx=(e,t)=>({...vc(e,t??"Product"),...wc(e.photoGallery),...cm(e.c_reviews),...um(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}}}),Jx=e=>!e||typeof e!="object"?!1:"question"in e&&"answer"in e,Xx=e=>!e||typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function Bu(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++)Bu(e[n][r],t);else Bu(e[n],t);else n==="text"&&t.push(e[n])}function dm(e){if(e.json){const t=[];return Bu(e.json,t),t.join("")}return""}const Qx=e=>{const t=e.map(n=>{if(Jx(n)||Xx(n))return{"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:"answer"in n?n.answer:dm(n.answerV2)}}}).filter(Boolean);if(t.length)return{"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t}},Hu=Math.log2(1.6745627884839434),eS=4,tS=19,Wu="js-baidu-neg-lng-fix";let fm;const nS=new Promise(e=>fm=e),rS="https://api.map.baidu.com/geoconv/v1/";let jl=[];const iS="gcj02ToBD09Callback_b872c21c";let sS=0,sg;async function hm(e){return await new Promise((t,n)=>{jl.push({coordinates:e,resolve:t,reject:n}),jl.length===1&&(sg=setTimeout(r,100)),jl.length>40&&(clearTimeout(sg),r());function r(){const c=jl;jl=[];const d=[].concat(...c.map(N=>N.coordinates)),g=iS+"_"+sS++,m=document.createElement("script");window[g]=N=>{var b;if(N.status){const k=new Error(`Unable to convert coordinates to BD-09: Received status code ${N.status}${N.message?": "+N.message:""}`);c.forEach(z=>z.reject(k))}const T=N.result.map(k=>new un(k.y,k.x));let R=0;c.forEach(k=>{k.resolve(T.slice(R,R+=k.coordinates.length))}),delete window[g],(b=m.parentNode)==null||b.removeChild(m)},nS.then(N=>{const T={ak:N,callback:g,coords:d.map(R=>`${R.longitude},${R.latitude}`).join(";"),from:3,to:5};m.src=rS+"?"+Object.entries(T).map(([R,b])=>R+"="+b).join("&"),document.head.appendChild(m)})}})}class oS extends Xo{constructor(n){super(n);ke(this,"_wrapper");ke(this,"map");ke(this,"_panStartHandler");ke(this,"_panHandler");ke(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 un(this.map.getCenter())}getZoom(){return this.map.getZoom()-Hu}setCenter(n,r){this._centerReady=hm([n]).then(([c])=>{const d=new BMap.Point(c.longitude,c.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+Hu)},{enableAnimation:r})})}}class lS extends Qo{constructor(n){super(n);ke(this,"_wrapper");ke(this,"_zIndex");ke(this,"_wrapperClass");ke(this,"_originalWrapperClass");ke(this,"_element");ke(this,"_coordinateReady");ke(this,"_negativeLngFix");ke(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(m,N){super(m);ke(this,"pin");this.pin=N}initialize(m){return this.pin._wrapper=super.initialize(m),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 m=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=m}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const c=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(c),this.pin.setShadow(c)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=hm([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"](Wu)})}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?Wu:""} ${this._wrapperClass}`}}const aS="https://api.map.baidu.com/getscript";function cS(e,t,n,{params:r={},version:c="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,g={ak:d,v:c,...r};fm(d);const m=document.createElement("script");m.src=aS+"?"+Object.entries(g).map(([R,b])=>R+"="+b).join("&"),m.onload=()=>e(),document.head.appendChild(m);let N="";for(let R=eS;R<=tS;R++){const b=2**(R-Hu+7);N+=`[data-baidu-zoom="${R}"] .${Wu}{transform:translateX(-${b}px);}`}const T=document.createElement("style");T.appendChild(document.createTextNode(N)),document.head.appendChild(T)}const uS=new io().withLoadFunction(cS).withMapClass(oS).withPinClass(lS).withProviderName("Baidu").build();let gm;function dS(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});ke(this,"_container");ke(this,"_pins");ke(this,"_viewChangeEventHandler");ke(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 c=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&c instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=c.x+"px",r._wrapper.style.top=c.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}gm=e}class fS extends Xo{constructor(n){super(n);ke(this,"wrapper");ke(this,"map");ke(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 gm(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 un(((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 c=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:c}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var c;(c=this.map)==null||c.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class pm extends Qo{constructor(n){super(n);ke(this,"_location");ke(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}}ke(pm,"_pinId");const og="BingMapsCallback_593d7d33",hS="https://www.bing.com/api/maps/mapcontrol";function gS(e,t,n,{params:r={}}={}){window[og]=()=>{dS(),e()};const c={callback:og,key:n,...r};_g(hS+"?"+Object.entries(c).map(([d,g])=>d+"="+g).join("&"))}const pS=new io().withLoadFunction(gS).withMapClass(fS).withPinClass(pm).withProviderName("Bing").build();class mS extends Xo{constructor(n){var c,d,g,m;super(n);ke(this,"instance");ke(this,"map");const r=((c=n==null?void 0:n.iframeWindow)==null?void 0:c.mapboxgl)??gu;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 N=new this.instance.NavigationControl({showCompass:!1});(d=this.map)==null||d.addControl(N)}(g=this.map)==null||g.on("movestart",()=>this._panStartHandler()),(m=this.map)==null||m.on("moveend",()=>this._panHandler())}getCenter(){var n;return new un(((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 c=new this.instance.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](c)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,c){const d=new this.instance.LngLat(r.longitude,r.latitude);this.map&&this.map[c?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class _S extends Qo{constructor(n){super(n);ke(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new gu.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new gu.LngLat(n.longitude,n.latitude))}setMap(n,r){var c,d;if(n){const g=n.getProviderMap().map;g&&((c=this.pin)==null||c.addTo(g))}else(d=this.pin)==null||d.remove()}}function yS(e,t,n,{version:r="v1.13.0"}={}){const c=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{e()},document.head.appendChild(d),document.head.appendChild(g)}const NS=new io().withLoadFunction(yS).withMapClass(mS).withPinClass(_S).withProviderName("Mapbox").build();var to;let mm=(to=class extends Xo{constructor(n){var r,c,d;super(n);ke(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(c=this.map)==null||c.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new un(((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 c=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(c,{animate:r})}setZoom(n,r){var c;(c=this.map)==null||c.setZoom(n,{animate:r})}setZoomCenter(n,r,c){var g;const d=new L.LatLng(r.latitude,r.longitude);(g=this.map)==null||g.setView(d,n,{animate:c})}_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,c=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=to.apiKey,this.map&&L.tileLayer(c,d).addTo(this.map)}},ke(to,"apiKey"),to),CS=class extends Yu{constructor(n){super(n);ke(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 c=n.getProviderMap().map;c&&this.pin.addTo(c)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),c=n.getHeight(),d=n.getAnchorX(),g=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,c],iconAnchor:[d*r,g*c],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function ES(e,t,n,{version:r="1.7.1"}={}){const c=`https://unpkg.com/leaflet@${r}/dist/leaflet`;mm.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(g)}const pd=new io().withLoadFunction(ES).withMapClass(mm).withPinClass(CS).withProviderName("Leaflet").build(),TS=pd.getMapClass(),xS=pd.getPinClass();class SS extends TS{constructor(){super(...arguments);ke(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 vS extends xS{}function wS(e,t,n,{version:r="v1.3.2"}={}){const c=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(g)}const OS=new io().withLoadFunction(wS).withMapClass(SS).withPinClass(vS).withProviderName("MapQuest").build();exports.Address=a_;exports.AddressSchema=hd;exports.AggregateRatingSchema=um;exports.Analytics=fg;exports.AnalyticsContext=zu;exports.AnalyticsProvider=j_;exports.AnalyticsScopeProvider=V_;exports.BaiduMaps=uS;exports.BaseSchema=vc;exports.BingMaps=pS;exports.Clusterer=Iy;exports.Coordinate=un;exports.Day=Yt;exports.Event=Ux;exports.FAQPage=Qx;exports.GoogleMaps=Cg;exports.HoursStatus=Mx;exports.HoursTable=kx;exports.Image=ry;exports.ImageLayoutOption=Zi;exports.LeafletMaps=pd;exports.LegacyRichText=CE;exports.LexicalRichText=RN;exports.Link=mg;exports.ListingPublisherOption=ag;exports.LocalBusiness=jx;exports.LocationMap=$y;exports.LocationSchema=im;exports.Map=xg;exports.MapProviderOption=mu;exports.MapQuestMaps=OS;exports.MapboxMaps=NS;exports.Marker=qu;exports.OfferSchema=gd;exports.OpeningHoursSchema=am;exports.OrganizationSchema=lm;exports.PerformerSchema=om;exports.PhotoGallerySchema=wc;exports.PhotoSchema=Bx;exports.Product=Zx;exports.ReviewSchema=cm;exports.SchemaWrapper=Px;exports.asciiAlpha=KN;exports.asciiAlphanumeric=vu;exports.asciiAtext=zN;exports.asciiControl=UN;exports.asciiDigit=GN;exports.asciiHexDigit=YN;exports.asciiPunctuation=jN;exports.c=ro;exports.classifyCharacter=ra;exports.combineExtensions=Wg;exports.createState=aE;exports.debuggingParamDetected=rc;exports.getDefaultExportFromCjs=lg;exports.getDirections=o_;exports.getImageUrl=ic;exports.getRichTextContent=dm;exports.getRuntime=Vo;exports.jsxRuntimeExports=nt;exports.markdownLineEnding=VN;exports.markdownLineEndingOrSpace=Vg;exports.markdownSpace=qN;exports.normalizeUri=el;exports.push=Uo;exports.resolveAll=qg;exports.splice=mc;exports.useAnalytics=Jo;exports.useClusterContext=ky;exports.useIdentify=J_;exports.useMapContext=Ry;exports.usePageView=Z_;exports.useScope=Uu;exports.useTrack=q_;exports.visit=id;
|
|
111
|
+
<\/script>`,vc=(e,t)=>{if(!(!e.name||typeof e.name!="string"))return{"@context":"https://schema.org","@type":t,name:e.name}},Fx=e=>typeof e!="object"?!1:!!e.name||!!e.address,Bx=e=>typeof e!="object"?!1:!!e.line1||!!e.city||!!e.region||!!e.postalCode||!!e.countryCode,hd=e=>Bx(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},im=e=>Fx(e)&&{"@type":"Place",name:e.name,...hd(e.address)},sm=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image&&typeof e.image.url=="string",wc=e=>{if(!e)return{};const t=new Array;for(const n of e)sm(n)&&t.push(n.image.url);return{image:t}},Hx=e=>sm(e)&&{image:e.image.url},Wx=e=>typeof e!="object"?!1:!!e.name,Kx=e=>Array.isArray(e)&&e.length>0,om=e=>Kx(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},lm=e=>Wx(e)&&{organizer:{"@type":"Organization",name:e.name,...e.url&&{url:e.url}}},zx=["BackOrder","Discontinued","InStock","InStoreOnly","LimitedAvailability","MadeToOrder","OnlineOnly","OutOfStock","PreOrder","PreSale","Reserved","SoldOut"],Ux=e=>typeof e!="object"?!1:"priceCurrency"in e&&"price"in e&&"availability"in e&&zx.includes(e.availability),gd=e=>Ux(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},Gx=(e,t)=>{const n=im({name:e.geomodifier,address:e.address});return{...vc(e,t??"Event"),...wc(e.photoGallery),...n&&{location:n},...om(e.performers),...lm({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}}},am=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,Yx=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,cm=e=>{if(!am(e))return{};let t=new Map;t=br(e.monday,t,"Mo"),t=br(e.tuesday,t,"Tu"),t=br(e.wednesday,t,"We"),t=br(e.thursday,t,"Th"),t=br(e.friday,t,"Fr"),t=br(e.saturday,t,"Sa"),t=br(e.sunday,t,"Su");const n=new Array;for(const[r,c]of t){const d=c.join(",");n.push(d+" "+r)}return{openingHours:n}},jx=e=>{if(!am(e))return{};let t=new Map;t=br(e.monday,t,"Monday"),t=br(e.tuesday,t,"Tuesday"),t=br(e.wednesday,t,"Wednesday"),t=br(e.thursday,t,"Thursday"),t=br(e.friday,t,"Friday"),t=br(e.saturday,t,"Saturday"),t=br(e.sunday,t,"Sunday");const n=[];t.forEach((d,g)=>{g.split("-").length===2&&n.push({"@type":"OpeningHoursSpecification",dayOfWeek:d.length===1?`https://schema.org/${d[0]}`:d.map(m=>`https://schema.org/${m}`),opens:g.split("-")[0],closes:g.split("-")[1]})});const r={openingHoursSpecification:n},c=Vx(e.holidayHours);return c!=null&&c.length&&(r.specialOpeningHoursSpecification=c),r},Vx=e=>{var n;if(!e||!Array.isArray(e))return[];const t=[];for(const r of e)r.isRegularHours||!r.date||(r.isClosed?t.push({"@type":"OpeningHoursSpecification",validFrom:r.date,validThrough:r.date,opens:"00:00",closes:"00:00"}):(n=r.openIntervals)==null||n.forEach(c=>{!c.start||!c.end||t.push({"@type":"OpeningHoursSpecification",validFrom:r.date,validThrough:r.date,opens:c.start,closes:c.end})}));return t},br=(e,t,n)=>{if(!Yx(e))return t;if(e.isClosed||!e.openIntervals){const r="00:00-00:00",c=t.get(r)??[];return c.push(n),t.set(r,c),t}for(let r=0;r<e.openIntervals.length;r++){const c=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(c)??[];d.push(n),t.set(c,d)}return t},qx=(e,t)=>({...vc(e,t??"LocalBusiness"),...hd(e.address),...cm(e.hours),...wc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),Zx=e=>typeof e!="object"?!1:"ratingValue"in e,Jx=e=>typeof e!="object"?!1:"ratingValue"in e&&"reviewCount"in e,um=e=>Zx(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},...e.author&&{author:{"@type":"Person",name:e.author}}}},dm=e=>Jx(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,Xx=(e,t)=>({...vc(e,t??"Product"),...wc(e.photoGallery),...um(e.c_reviews),...dm(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}}}),Qx=e=>!e||typeof e!="object"?!1:"question"in e&&"answer"in e,eS=e=>!e||typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function Bu(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++)Bu(e[n][r],t);else Bu(e[n],t);else n==="text"&&t.push(e[n])}function fm(e){if(e.json){const t=[];return Bu(e.json,t),t.join("")}return""}const tS=e=>{const t=e.map(n=>{if(Qx(n)||eS(n))return{"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:"answer"in n?n.answer:fm(n.answerV2)}}}).filter(Boolean);if(t.length)return{"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t}},Hu=Math.log2(1.6745627884839434),nS=4,rS=19,Wu="js-baidu-neg-lng-fix";let hm;const iS=new Promise(e=>hm=e),sS="https://api.map.baidu.com/geoconv/v1/";let jl=[];const oS="gcj02ToBD09Callback_b872c21c";let lS=0,sg;async function gm(e){return await new Promise((t,n)=>{jl.push({coordinates:e,resolve:t,reject:n}),jl.length===1&&(sg=setTimeout(r,100)),jl.length>40&&(clearTimeout(sg),r());function r(){const c=jl;jl=[];const d=[].concat(...c.map(N=>N.coordinates)),g=oS+"_"+lS++,m=document.createElement("script");window[g]=N=>{var b;if(N.status){const k=new Error(`Unable to convert coordinates to BD-09: Received status code ${N.status}${N.message?": "+N.message:""}`);c.forEach(z=>z.reject(k))}const T=N.result.map(k=>new un(k.y,k.x));let R=0;c.forEach(k=>{k.resolve(T.slice(R,R+=k.coordinates.length))}),delete window[g],(b=m.parentNode)==null||b.removeChild(m)},iS.then(N=>{const T={ak:N,callback:g,coords:d.map(R=>`${R.longitude},${R.latitude}`).join(";"),from:3,to:5};m.src=sS+"?"+Object.entries(T).map(([R,b])=>R+"="+b).join("&"),document.head.appendChild(m)})}})}class aS extends Xo{constructor(n){super(n);ke(this,"_wrapper");ke(this,"map");ke(this,"_panStartHandler");ke(this,"_panHandler");ke(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 un(this.map.getCenter())}getZoom(){return this.map.getZoom()-Hu}setCenter(n,r){this._centerReady=gm([n]).then(([c])=>{const d=new BMap.Point(c.longitude,c.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+Hu)},{enableAnimation:r})})}}class cS extends Qo{constructor(n){super(n);ke(this,"_wrapper");ke(this,"_zIndex");ke(this,"_wrapperClass");ke(this,"_originalWrapperClass");ke(this,"_element");ke(this,"_coordinateReady");ke(this,"_negativeLngFix");ke(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(m,N){super(m);ke(this,"pin");this.pin=N}initialize(m){return this.pin._wrapper=super.initialize(m),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 m=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=m}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const c=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(c),this.pin.setShadow(c)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=gm([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"](Wu)})}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?Wu:""} ${this._wrapperClass}`}}const uS="https://api.map.baidu.com/getscript";function dS(e,t,n,{params:r={},version:c="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,g={ak:d,v:c,...r};hm(d);const m=document.createElement("script");m.src=uS+"?"+Object.entries(g).map(([R,b])=>R+"="+b).join("&"),m.onload=()=>e(),document.head.appendChild(m);let N="";for(let R=nS;R<=rS;R++){const b=2**(R-Hu+7);N+=`[data-baidu-zoom="${R}"] .${Wu}{transform:translateX(-${b}px);}`}const T=document.createElement("style");T.appendChild(document.createTextNode(N)),document.head.appendChild(T)}const fS=new io().withLoadFunction(dS).withMapClass(aS).withPinClass(cS).withProviderName("Baidu").build();let pm;function hS(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});ke(this,"_container");ke(this,"_pins");ke(this,"_viewChangeEventHandler");ke(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 c=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&c instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=c.x+"px",r._wrapper.style.top=c.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}pm=e}class gS extends Xo{constructor(n){super(n);ke(this,"wrapper");ke(this,"map");ke(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 pm(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 un(((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 c=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:c}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var c;(c=this.map)==null||c.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class mm extends Qo{constructor(n){super(n);ke(this,"_location");ke(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}}ke(mm,"_pinId");const og="BingMapsCallback_593d7d33",pS="https://www.bing.com/api/maps/mapcontrol";function mS(e,t,n,{params:r={}}={}){window[og]=()=>{hS(),e()};const c={callback:og,key:n,...r};_g(pS+"?"+Object.entries(c).map(([d,g])=>d+"="+g).join("&"))}const _S=new io().withLoadFunction(mS).withMapClass(gS).withPinClass(mm).withProviderName("Bing").build();class yS extends Xo{constructor(n){var c,d,g,m;super(n);ke(this,"instance");ke(this,"map");const r=((c=n==null?void 0:n.iframeWindow)==null?void 0:c.mapboxgl)??gu;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 N=new this.instance.NavigationControl({showCompass:!1});(d=this.map)==null||d.addControl(N)}(g=this.map)==null||g.on("movestart",()=>this._panStartHandler()),(m=this.map)==null||m.on("moveend",()=>this._panHandler())}getCenter(){var n;return new un(((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 c=new this.instance.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](c)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,c){const d=new this.instance.LngLat(r.longitude,r.latitude);this.map&&this.map[c?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class NS extends Qo{constructor(n){super(n);ke(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new gu.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new gu.LngLat(n.longitude,n.latitude))}setMap(n,r){var c,d;if(n){const g=n.getProviderMap().map;g&&((c=this.pin)==null||c.addTo(g))}else(d=this.pin)==null||d.remove()}}function CS(e,t,n,{version:r="v1.13.0"}={}){const c=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{e()},document.head.appendChild(d),document.head.appendChild(g)}const ES=new io().withLoadFunction(CS).withMapClass(yS).withPinClass(NS).withProviderName("Mapbox").build();var to;let _m=(to=class extends Xo{constructor(n){var r,c,d;super(n);ke(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(c=this.map)==null||c.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new un(((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 c=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(c,{animate:r})}setZoom(n,r){var c;(c=this.map)==null||c.setZoom(n,{animate:r})}setZoomCenter(n,r,c){var g;const d=new L.LatLng(r.latitude,r.longitude);(g=this.map)==null||g.setView(d,n,{animate:c})}_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,c=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=to.apiKey,this.map&&L.tileLayer(c,d).addTo(this.map)}},ke(to,"apiKey"),to),TS=class extends Yu{constructor(n){super(n);ke(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 c=n.getProviderMap().map;c&&this.pin.addTo(c)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),c=n.getHeight(),d=n.getAnchorX(),g=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,c],iconAnchor:[d*r,g*c],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function xS(e,t,n,{version:r="1.7.1"}={}){const c=`https://unpkg.com/leaflet@${r}/dist/leaflet`;_m.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(g)}const pd=new io().withLoadFunction(xS).withMapClass(_m).withPinClass(TS).withProviderName("Leaflet").build(),SS=pd.getMapClass(),vS=pd.getPinClass();class wS extends SS{constructor(){super(...arguments);ke(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 OS extends vS{}function AS(e,t,n,{version:r="v1.3.2"}={}){const c=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(g)}const MS=new io().withLoadFunction(AS).withMapClass(wS).withPinClass(OS).withProviderName("MapQuest").build();exports.Address=c_;exports.AddressSchema=hd;exports.AggregateRatingSchema=dm;exports.Analytics=fg;exports.AnalyticsContext=zu;exports.AnalyticsProvider=V_;exports.AnalyticsScopeProvider=q_;exports.BaiduMaps=fS;exports.BaseSchema=vc;exports.BingMaps=_S;exports.Clusterer=Ly;exports.Coordinate=un;exports.Day=Yt;exports.Event=Gx;exports.FAQPage=tS;exports.GoogleMaps=Cg;exports.HoursStatus=Dx;exports.HoursTable=Ix;exports.Image=iy;exports.ImageLayoutOption=Ji;exports.LeafletMaps=pd;exports.LegacyRichText=EE;exports.LexicalRichText=bN;exports.Link=mg;exports.ListingPublisherOption=ag;exports.LocalBusiness=qx;exports.LocationMap=Fy;exports.LocationSchema=im;exports.Map=xg;exports.MapProviderOption=mu;exports.MapQuestMaps=MS;exports.MapboxMaps=ES;exports.Marker=qu;exports.OfferSchema=gd;exports.OpeningHoursSchema=cm;exports.OpeningHoursSpecificationSchema=jx;exports.OrganizationSchema=lm;exports.PerformerSchema=om;exports.PhotoGallerySchema=wc;exports.PhotoSchema=Hx;exports.Product=Xx;exports.ReviewSchema=um;exports.SchemaWrapper=$x;exports.asciiAlpha=zN;exports.asciiAlphanumeric=vu;exports.asciiAtext=UN;exports.asciiControl=GN;exports.asciiDigit=YN;exports.asciiHexDigit=jN;exports.asciiPunctuation=VN;exports.c=ro;exports.classifyCharacter=ra;exports.combineExtensions=Wg;exports.createState=cE;exports.debuggingParamDetected=rc;exports.getDefaultExportFromCjs=lg;exports.getDirections=l_;exports.getImageUrl=ic;exports.getRichTextContent=fm;exports.getRuntime=Vo;exports.jsxRuntimeExports=nt;exports.markdownLineEnding=qN;exports.markdownLineEndingOrSpace=Vg;exports.markdownSpace=ZN;exports.normalizeUri=el;exports.push=Uo;exports.resolveAll=qg;exports.splice=mc;exports.useAnalytics=Jo;exports.useClusterContext=Iy;exports.useIdentify=X_;exports.useMapContext=by;exports.usePageView=J_;exports.useScope=Uu;exports.useTrack=Z_;exports.visit=id;
|