@yext/pages-components 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var k_=Object.defineProperty;var I_=(t,e,n)=>e in t?k_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Vn=(t,e,n)=>I_(t,typeof e!="symbol"?e+"":e,n);const et=require("react"),nd=require("react-dom");function P_(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const $_=P_(et);var of=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pu={exports:{}},$l={};/**
1
+ "use strict";var $_=Object.defineProperty;var F_=(t,e,n)=>e in t?$_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Vn=(t,e,n)=>F_(t,typeof e!="symbol"?e+"":e,n);const et=require("react"),rd=require("react-dom");function B_(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const H_=B_(et);var sf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function id(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $u={exports:{}},$l={};/**
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 sf;function F_(){if(sf)return $l;sf=1;var t=et,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function g(p,C,S){var x,O={},R=null,b=null;S!==void 0&&(R=""+S),C.key!==void 0&&(R=""+C.key),C.ref!==void 0&&(b=C.ref);for(x in C)r.call(C,x)&&!d.hasOwnProperty(x)&&(O[x]=C[x]);if(p&&p.defaultProps)for(x in C=p.defaultProps,C)O[x]===void 0&&(O[x]=C[x]);return{$$typeof:e,type:p,key:R,ref:b,props:O,_owner:c.current}}return $l.Fragment=n,$l.jsx=g,$l.jsxs=g,$l}var Fl={};/**
9
+ */var lf;function W_(){if(lf)return $l;lf=1;var t=et,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function g(p,C,S){var T,O={},R=null,b=null;S!==void 0&&(R=""+S),C.key!==void 0&&(R=""+C.key),C.ref!==void 0&&(b=C.ref);for(T in C)r.call(C,T)&&!d.hasOwnProperty(T)&&(O[T]=C[T]);if(p&&p.defaultProps)for(T in C=p.defaultProps,C)O[T]===void 0&&(O[T]=C[T]);return{$$typeof:e,type:p,key:R,ref:b,props:O,_owner:c.current}}return $l.Fragment=n,$l.jsx=g,$l.jsxs=g,$l}var Fl={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,31 +14,31 @@
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 lf;function B_(){return lf||(lf=1,process.env.NODE_ENV!=="production"&&function(){var t=et,e=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"),p=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),T=Symbol.iterator,w="@@iterator";function P(ye){if(ye===null||typeof ye!="object")return null;var Ge=T&&ye[T]||ye[w];return typeof Ge=="function"?Ge:null}var H=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(ye){{for(var Ge=arguments.length,nt=new Array(Ge>1?Ge-1:0),Nt=1;Nt<Ge;Nt++)nt[Nt-1]=arguments[Nt];W("error",ye,nt)}}function W(ye,Ge,nt){{var Nt=H.ReactDebugCurrentFrame,Ht=Nt.getStackAddendum();Ht!==""&&(Ge+="%s",nt=nt.concat([Ht]));var Kt=nt.map(function($t){return String($t)});Kt.unshift("Warning: "+Ge),Function.prototype.apply.call(console[ye],console,Kt)}}var B=!1,K=!1,X=!1,ee=!1,le=!1,V;V=Symbol.for("react.module.reference");function U(ye){return!!(typeof ye=="string"||typeof ye=="function"||ye===r||ye===d||le||ye===c||ye===S||ye===x||ee||ye===b||B||K||X||typeof ye=="object"&&ye!==null&&(ye.$$typeof===R||ye.$$typeof===O||ye.$$typeof===g||ye.$$typeof===p||ye.$$typeof===C||ye.$$typeof===V||ye.getModuleId!==void 0))}function q(ye,Ge,nt){var Nt=ye.displayName;if(Nt)return Nt;var Ht=Ge.displayName||Ge.name||"";return Ht!==""?nt+"("+Ht+")":nt}function me(ye){return ye.displayName||"Context"}function _e(ye){if(ye==null)return null;if(typeof ye.tag=="number"&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof ye=="function")return ye.displayName||ye.name||null;if(typeof ye=="string")return ye;switch(ye){case r:return"Fragment";case n:return"Portal";case d:return"Profiler";case c:return"StrictMode";case S:return"Suspense";case x:return"SuspenseList"}if(typeof ye=="object")switch(ye.$$typeof){case p:var Ge=ye;return me(Ge)+".Consumer";case g:var nt=ye;return me(nt._context)+".Provider";case C:return q(ye,ye.render,"ForwardRef");case O:var Nt=ye.displayName||null;return Nt!==null?Nt:_e(ye.type)||"Memo";case R:{var Ht=ye,Kt=Ht._payload,$t=Ht._init;try{return _e($t(Kt))}catch{return null}}}return null}var pe=Object.assign,ue=0,z,D,j,ne,Y,G,Q;function k(){}k.__reactDisabledLog=!0;function m(){{if(ue===0){z=console.log,D=console.info,j=console.warn,ne=console.error,Y=console.group,G=console.groupCollapsed,Q=console.groupEnd;var ye={configurable:!0,enumerable:!0,value:k,writable:!0};Object.defineProperties(console,{info:ye,log:ye,warn:ye,error:ye,group:ye,groupCollapsed:ye,groupEnd:ye})}ue++}}function y(){{if(ue--,ue===0){var ye={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:pe({},ye,{value:z}),info:pe({},ye,{value:D}),warn:pe({},ye,{value:j}),error:pe({},ye,{value:ne}),group:pe({},ye,{value:Y}),groupCollapsed:pe({},ye,{value:G}),groupEnd:pe({},ye,{value:Q})})}ue<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var A=H.ReactCurrentDispatcher,Z;function ae(ye,Ge,nt){{if(Z===void 0)try{throw Error()}catch(Ht){var Nt=Ht.stack.trim().match(/\n( *(at )?)/);Z=Nt&&Nt[1]||""}return`
17
+ */var af;function K_(){return af||(af=1,process.env.NODE_ENV!=="production"&&function(){var t=et,e=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"),p=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),x=Symbol.iterator,w="@@iterator";function $(ye){if(ye===null||typeof ye!="object")return null;var Ge=x&&ye[x]||ye[w];return typeof Ge=="function"?Ge:null}var W=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(ye){{for(var Ge=arguments.length,nt=new Array(Ge>1?Ge-1:0),Nt=1;Nt<Ge;Nt++)nt[Nt-1]=arguments[Nt];H("error",ye,nt)}}function H(ye,Ge,nt){{var Nt=W.ReactDebugCurrentFrame,Ht=Nt.getStackAddendum();Ht!==""&&(Ge+="%s",nt=nt.concat([Ht]));var Kt=nt.map(function($t){return String($t)});Kt.unshift("Warning: "+Ge),Function.prototype.apply.call(console[ye],console,Kt)}}var B=!1,z=!1,X=!1,ee=!1,le=!1,j;j=Symbol.for("react.module.reference");function U(ye){return!!(typeof ye=="string"||typeof ye=="function"||ye===r||ye===d||le||ye===c||ye===S||ye===T||ee||ye===b||B||z||X||typeof ye=="object"&&ye!==null&&(ye.$$typeof===R||ye.$$typeof===O||ye.$$typeof===g||ye.$$typeof===p||ye.$$typeof===C||ye.$$typeof===j||ye.getModuleId!==void 0))}function q(ye,Ge,nt){var Nt=ye.displayName;if(Nt)return Nt;var Ht=Ge.displayName||Ge.name||"";return Ht!==""?nt+"("+Ht+")":nt}function me(ye){return ye.displayName||"Context"}function _e(ye){if(ye==null)return null;if(typeof ye.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof ye=="function")return ye.displayName||ye.name||null;if(typeof ye=="string")return ye;switch(ye){case r:return"Fragment";case n:return"Portal";case d:return"Profiler";case c:return"StrictMode";case S:return"Suspense";case T:return"SuspenseList"}if(typeof ye=="object")switch(ye.$$typeof){case p:var Ge=ye;return me(Ge)+".Consumer";case g:var nt=ye;return me(nt._context)+".Provider";case C:return q(ye,ye.render,"ForwardRef");case O:var Nt=ye.displayName||null;return Nt!==null?Nt:_e(ye.type)||"Memo";case R:{var Ht=ye,Kt=Ht._payload,$t=Ht._init;try{return _e($t(Kt))}catch{return null}}}return null}var pe=Object.assign,ue=0,K,D,V,ne,Y,G,Q;function k(){}k.__reactDisabledLog=!0;function m(){{if(ue===0){K=console.log,D=console.info,V=console.warn,ne=console.error,Y=console.group,G=console.groupCollapsed,Q=console.groupEnd;var ye={configurable:!0,enumerable:!0,value:k,writable:!0};Object.defineProperties(console,{info:ye,log:ye,warn:ye,error:ye,group:ye,groupCollapsed:ye,groupEnd:ye})}ue++}}function y(){{if(ue--,ue===0){var ye={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:pe({},ye,{value:K}),info:pe({},ye,{value:D}),warn:pe({},ye,{value:V}),error:pe({},ye,{value:ne}),group:pe({},ye,{value:Y}),groupCollapsed:pe({},ye,{value:G}),groupEnd:pe({},ye,{value:Q})})}ue<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var A=W.ReactCurrentDispatcher,Z;function ae(ye,Ge,nt){{if(Z===void 0)try{throw Error()}catch(Ht){var Nt=Ht.stack.trim().match(/\n( *(at )?)/);Z=Nt&&Nt[1]||""}return`
18
18
  `+Z+ye}}var he=!1,se;{var Te=typeof WeakMap=="function"?WeakMap:Map;se=new Te}function be(ye,Ge){if(!ye||he)return"";{var nt=se.get(ye);if(nt!==void 0)return nt}var Nt;he=!0;var Ht=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Kt;Kt=A.current,A.current=null,m();try{if(Ge){var $t=function(){throw Error()};if(Object.defineProperty($t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($t,[])}catch(qn){Nt=qn}Reflect.construct(ye,[],$t)}else{try{$t.call()}catch(qn){Nt=qn}ye.call($t.prototype)}}else{try{throw Error()}catch(qn){Nt=qn}ye()}}catch(qn){if(qn&&Nt&&typeof qn.stack=="string"){for(var Pt=qn.stack.split(`
19
19
  `),mn=Nt.stack.split(`
20
20
  `),sn=Pt.length-1,nn=mn.length-1;sn>=1&&nn>=0&&Pt[sn]!==mn[nn];)nn--;for(;sn>=1&&nn>=0;sn--,nn--)if(Pt[sn]!==mn[nn]){if(sn!==1||nn!==1)do if(sn--,nn--,nn<0||Pt[sn]!==mn[nn]){var $n=`
21
- `+Pt[sn].replace(" at new "," at ");return ye.displayName&&$n.includes("<anonymous>")&&($n=$n.replace("<anonymous>",ye.displayName)),typeof ye=="function"&&se.set(ye,$n),$n}while(sn>=1&&nn>=0);break}}}finally{he=!1,A.current=Kt,y(),Error.prepareStackTrace=Ht}var pr=ye?ye.displayName||ye.name:"",mi=pr?ae(pr):"";return typeof ye=="function"&&se.set(ye,mi),mi}function Ue(ye,Ge,nt){return be(ye,!1)}function re(ye){var Ge=ye.prototype;return!!(Ge&&Ge.isReactComponent)}function te(ye,Ge,nt){if(ye==null)return"";if(typeof ye=="function")return be(ye,re(ye));if(typeof ye=="string")return ae(ye);switch(ye){case S:return ae("Suspense");case x:return ae("SuspenseList")}if(typeof ye=="object")switch(ye.$$typeof){case C:return Ue(ye.render);case O:return te(ye.type,Ge,nt);case R:{var Nt=ye,Ht=Nt._payload,Kt=Nt._init;try{return te(Kt(Ht),Ge,nt)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,we={},Le=H.ReactDebugCurrentFrame;function Be(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);Le.setExtraStackFrame(nt)}else Le.setExtraStackFrame(null)}function Ye(ye,Ge,nt,Nt,Ht){{var Kt=Function.call.bind(ce);for(var $t in ye)if(Kt(ye,$t)){var Pt=void 0;try{if(typeof ye[$t]!="function"){var mn=Error((Nt||"React class")+": "+nt+" type `"+$t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof ye[$t]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw mn.name="Invariant Violation",mn}Pt=ye[$t](Ge,$t,Nt,nt,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(sn){Pt=sn}Pt&&!(Pt instanceof Error)&&(Be(Ht),$("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Nt||"React class",nt,$t,typeof Pt),Be(null)),Pt instanceof Error&&!(Pt.message in we)&&(we[Pt.message]=!0,Be(Ht),$("Failed %s type: %s",nt,Pt.message),Be(null))}}}var ct=Array.isArray;function yt(ye){return ct(ye)}function dt(ye){{var Ge=typeof Symbol=="function"&&Symbol.toStringTag,nt=Ge&&ye[Symbol.toStringTag]||ye.constructor.name||"Object";return nt}}function Se(ye){try{return ie(ye),!1}catch{return!0}}function ie(ye){return""+ye}function fe(ye){if(Se(ye))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dt(ye)),ie(ye)}var Oe=H.ReactCurrentOwner,Re={key:!0,ref:!0,__self:!0,__source:!0},De,We,qe;qe={};function Qe(ye){if(ce.call(ye,"ref")){var Ge=Object.getOwnPropertyDescriptor(ye,"ref").get;if(Ge&&Ge.isReactWarning)return!1}return ye.ref!==void 0}function ft(ye){if(ce.call(ye,"key")){var Ge=Object.getOwnPropertyDescriptor(ye,"key").get;if(Ge&&Ge.isReactWarning)return!1}return ye.key!==void 0}function kt(ye,Ge){if(typeof ye.ref=="string"&&Oe.current&&Ge&&Oe.current.stateNode!==Ge){var nt=_e(Oe.current.type);qe[nt]||($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_e(Oe.current.type),ye.ref),qe[nt]=!0)}}function je(ye,Ge){{var nt=function(){De||(De=!0,$("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"key",{get:nt,configurable:!0})}}function Ve(ye,Ge){{var nt=function(){We||(We=!0,$("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"ref",{get:nt,configurable:!0})}}var rt=function(ye,Ge,nt,Nt,Ht,Kt,$t){var Pt={$$typeof:e,type:ye,key:Ge,ref:nt,props:$t,_owner:Kt};return Pt._store={},Object.defineProperty(Pt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Pt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Nt}),Object.defineProperty(Pt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ht}),Object.freeze&&(Object.freeze(Pt.props),Object.freeze(Pt)),Pt};function _t(ye,Ge,nt,Nt,Ht){{var Kt,$t={},Pt=null,mn=null;nt!==void 0&&(fe(nt),Pt=""+nt),ft(Ge)&&(fe(Ge.key),Pt=""+Ge.key),Qe(Ge)&&(mn=Ge.ref,kt(Ge,Ht));for(Kt in Ge)ce.call(Ge,Kt)&&!Re.hasOwnProperty(Kt)&&($t[Kt]=Ge[Kt]);if(ye&&ye.defaultProps){var sn=ye.defaultProps;for(Kt in sn)$t[Kt]===void 0&&($t[Kt]=sn[Kt])}if(Pt||mn){var nn=typeof ye=="function"?ye.displayName||ye.name||"Unknown":ye;Pt&&je($t,nn),mn&&Ve($t,nn)}return rt(ye,Pt,mn,Ht,Nt,Oe.current,$t)}}var Et=H.ReactCurrentOwner,vt=H.ReactDebugCurrentFrame;function Ot(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);vt.setExtraStackFrame(nt)}else vt.setExtraStackFrame(null)}var Mt;Mt=!1;function xt(ye){return typeof ye=="object"&&ye!==null&&ye.$$typeof===e}function Qt(){{if(Et.current){var ye=_e(Et.current.type);if(ye)return`
21
+ `+Pt[sn].replace(" at new "," at ");return ye.displayName&&$n.includes("<anonymous>")&&($n=$n.replace("<anonymous>",ye.displayName)),typeof ye=="function"&&se.set(ye,$n),$n}while(sn>=1&&nn>=0);break}}}finally{he=!1,A.current=Kt,y(),Error.prepareStackTrace=Ht}var pr=ye?ye.displayName||ye.name:"",mi=pr?ae(pr):"";return typeof ye=="function"&&se.set(ye,mi),mi}function Ue(ye,Ge,nt){return be(ye,!1)}function re(ye){var Ge=ye.prototype;return!!(Ge&&Ge.isReactComponent)}function te(ye,Ge,nt){if(ye==null)return"";if(typeof ye=="function")return be(ye,re(ye));if(typeof ye=="string")return ae(ye);switch(ye){case S:return ae("Suspense");case T:return ae("SuspenseList")}if(typeof ye=="object")switch(ye.$$typeof){case C:return Ue(ye.render);case O:return te(ye.type,Ge,nt);case R:{var Nt=ye,Ht=Nt._payload,Kt=Nt._init;try{return te(Kt(Ht),Ge,nt)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,we={},Le=W.ReactDebugCurrentFrame;function Be(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);Le.setExtraStackFrame(nt)}else Le.setExtraStackFrame(null)}function Ye(ye,Ge,nt,Nt,Ht){{var Kt=Function.call.bind(ce);for(var $t in ye)if(Kt(ye,$t)){var Pt=void 0;try{if(typeof ye[$t]!="function"){var mn=Error((Nt||"React class")+": "+nt+" type `"+$t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof ye[$t]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw mn.name="Invariant Violation",mn}Pt=ye[$t](Ge,$t,Nt,nt,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(sn){Pt=sn}Pt&&!(Pt instanceof Error)&&(Be(Ht),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Nt||"React class",nt,$t,typeof Pt),Be(null)),Pt instanceof Error&&!(Pt.message in we)&&(we[Pt.message]=!0,Be(Ht),P("Failed %s type: %s",nt,Pt.message),Be(null))}}}var ct=Array.isArray;function yt(ye){return ct(ye)}function dt(ye){{var Ge=typeof Symbol=="function"&&Symbol.toStringTag,nt=Ge&&ye[Symbol.toStringTag]||ye.constructor.name||"Object";return nt}}function Se(ye){try{return ie(ye),!1}catch{return!0}}function ie(ye){return""+ye}function fe(ye){if(Se(ye))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dt(ye)),ie(ye)}var Oe=W.ReactCurrentOwner,Re={key:!0,ref:!0,__self:!0,__source:!0},De,We,qe;qe={};function Qe(ye){if(ce.call(ye,"ref")){var Ge=Object.getOwnPropertyDescriptor(ye,"ref").get;if(Ge&&Ge.isReactWarning)return!1}return ye.ref!==void 0}function ft(ye){if(ce.call(ye,"key")){var Ge=Object.getOwnPropertyDescriptor(ye,"key").get;if(Ge&&Ge.isReactWarning)return!1}return ye.key!==void 0}function kt(ye,Ge){if(typeof ye.ref=="string"&&Oe.current&&Ge&&Oe.current.stateNode!==Ge){var nt=_e(Oe.current.type);qe[nt]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_e(Oe.current.type),ye.ref),qe[nt]=!0)}}function je(ye,Ge){{var nt=function(){De||(De=!0,P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"key",{get:nt,configurable:!0})}}function Ve(ye,Ge){{var nt=function(){We||(We=!0,P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"ref",{get:nt,configurable:!0})}}var rt=function(ye,Ge,nt,Nt,Ht,Kt,$t){var Pt={$$typeof:e,type:ye,key:Ge,ref:nt,props:$t,_owner:Kt};return Pt._store={},Object.defineProperty(Pt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Pt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Nt}),Object.defineProperty(Pt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ht}),Object.freeze&&(Object.freeze(Pt.props),Object.freeze(Pt)),Pt};function _t(ye,Ge,nt,Nt,Ht){{var Kt,$t={},Pt=null,mn=null;nt!==void 0&&(fe(nt),Pt=""+nt),ft(Ge)&&(fe(Ge.key),Pt=""+Ge.key),Qe(Ge)&&(mn=Ge.ref,kt(Ge,Ht));for(Kt in Ge)ce.call(Ge,Kt)&&!Re.hasOwnProperty(Kt)&&($t[Kt]=Ge[Kt]);if(ye&&ye.defaultProps){var sn=ye.defaultProps;for(Kt in sn)$t[Kt]===void 0&&($t[Kt]=sn[Kt])}if(Pt||mn){var nn=typeof ye=="function"?ye.displayName||ye.name||"Unknown":ye;Pt&&je($t,nn),mn&&Ve($t,nn)}return rt(ye,Pt,mn,Ht,Nt,Oe.current,$t)}}var Et=W.ReactCurrentOwner,vt=W.ReactDebugCurrentFrame;function Ot(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);vt.setExtraStackFrame(nt)}else vt.setExtraStackFrame(null)}var Mt;Mt=!1;function xt(ye){return typeof ye=="object"&&ye!==null&&ye.$$typeof===e}function Qt(){{if(Et.current){var ye=_e(Et.current.type);if(ye)return`
22
22
 
23
23
  Check the render method of \``+ye+"`."}return""}}function bt(ye){return""}var Ut={};function It(ye){{var Ge=Qt();if(!Ge){var nt=typeof ye=="string"?ye:ye.displayName||ye.name;nt&&(Ge=`
24
24
 
25
- Check the top-level render call using <`+nt+">.")}return Ge}}function hr(ye,Ge){{if(!ye._store||ye._store.validated||ye.key!=null)return;ye._store.validated=!0;var nt=It(Ge);if(Ut[nt])return;Ut[nt]=!0;var Nt="";ye&&ye._owner&&ye._owner!==Et.current&&(Nt=" It was passed a child from "+_e(ye._owner.type)+"."),Ot(ye),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',nt,Nt),Ot(null)}}function vr(ye,Ge){{if(typeof ye!="object")return;if(yt(ye))for(var nt=0;nt<ye.length;nt++){var Nt=ye[nt];xt(Nt)&&hr(Nt,Ge)}else if(xt(ye))ye._store&&(ye._store.validated=!0);else if(ye){var Ht=P(ye);if(typeof Ht=="function"&&Ht!==ye.entries)for(var Kt=Ht.call(ye),$t;!($t=Kt.next()).done;)xt($t.value)&&hr($t.value,Ge)}}}function Fi(ye){{var Ge=ye.type;if(Ge==null||typeof Ge=="string")return;var nt;if(typeof Ge=="function")nt=Ge.propTypes;else if(typeof Ge=="object"&&(Ge.$$typeof===C||Ge.$$typeof===O))nt=Ge.propTypes;else return;if(nt){var Nt=_e(Ge);Ye(nt,ye.props,"prop",Nt,ye)}else if(Ge.PropTypes!==void 0&&!Mt){Mt=!0;var Ht=_e(Ge);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ht||"Unknown")}typeof Ge.getDefaultProps=="function"&&!Ge.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gs(ye){{for(var Ge=Object.keys(ye.props),nt=0;nt<Ge.length;nt++){var Nt=Ge[nt];if(Nt!=="children"&&Nt!=="key"){Ot(ye),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Nt),Ot(null);break}}ye.ref!==null&&(Ot(ye),$("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function ps(ye,Ge,nt,Nt,Ht,Kt){{var $t=U(ye);if(!$t){var Pt="";(ye===void 0||typeof ye=="object"&&ye!==null&&Object.keys(ye).length===0)&&(Pt+=" 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 mn=bt();mn?Pt+=mn:Pt+=Qt();var sn;ye===null?sn="null":yt(ye)?sn="array":ye!==void 0&&ye.$$typeof===e?(sn="<"+(_e(ye.type)||"Unknown")+" />",Pt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof ye,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,Pt)}var nn=_t(ye,Ge,nt,Ht,Kt);if(nn==null)return nn;if($t){var $n=Ge.children;if($n!==void 0)if(Nt)if(yt($n)){for(var pr=0;pr<$n.length;pr++)vr($n[pr],ye);Object.freeze&&Object.freeze($n)}else $("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 vr($n,ye)}return ye===r?gs(nn):Fi(nn),nn}}function fn(ye,Ge,nt){return ps(ye,Ge,nt,!0)}function gr(ye,Ge,nt){return ps(ye,Ge,nt,!1)}var Jr=gr,ms=fn;Fl.Fragment=r,Fl.jsx=Jr,Fl.jsxs=ms}()),Fl}process.env.NODE_ENV==="production"?Pu.exports=F_():Pu.exports=B_();var at=Pu.exports;function H_(t){switch(t){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 Jg={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},$u={GOOGLE:"google",APPLE:"apple",BING:"bing"},W_=(t,e)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[t];return r&&e[r]},K_=(t,e=[],n,r={route:!1})=>{const c="Failed to construct query for maps service.";let d=t&&af([t.line1,t.line2,t.city,t.region,t.postalCode,t.countryCode]);switch(r.provider){case $u.APPLE:{if(!d){console.warn(`${c} Check that you've provided a valid Yext Address.`);break}return z_(d,r.route)}case $u.BING:{if(d=t&&af([t.line1,t.city,t.region,t.postalCode]),!d){console.warn(`${c} Check that you've provided a valid Yext Address.`);break}return U_(d,r.route)}default:{const g=e.find(p=>{var C;return((C=p==null?void 0:p.publisher)==null?void 0:C.toUpperCase())===Jg.GOOGLEMYBUSINESS});if(g!=null&&g.listingUrl)return g.listingUrl;if(n)return G_(n,d,r.route);if(!d){console.warn(`${c} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return Y_(d,r.route)}}},z_=(t,e)=>e?`https://maps.apple.com/?daddr=${t}`:`https://maps.apple.com/?address=${t}`,U_=(t,e)=>e?`https://bing.com/maps/default.aspx?rtp=adr.${t}`:`https://bing.com/maps/default.aspx?where1=${t}`,G_=(t,e,n)=>{const r=e?`&query=${e}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${t}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${t}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${t}&destination=direct`},Y_=(t,e)=>e?`https://maps.google.com/maps/dir/?api=1&destination=${t}`:`https://maps.google.com/maps/search/?api=1&query=${t}`,af=(t=[])=>{if(!t.length)return"";const e=t.filter(Boolean).join(", ");return encodeURI(e)},j_=({address:t,lines:e,separator:n=",",...r})=>{const c=(e||H_(t.countryCode)).map(d=>at.jsx(V_,{address:t,line:d,separator:n},d.toString()));return et.createElement("div",{...r,key:t.toString()},c)},V_=({address:t,line:e,separator:n})=>{const r=[];for(const c of e){if(c===","){r.push(at.jsx("span",{children:n},c));continue}const d=t[c];if(!d)continue;const g=W_(c,t);if(g){r.push(at.jsxs($_.Fragment,{children:[" ",at.jsx("abbr",{title:g,children:d})]},c));continue}r.push(at.jsx("span",{children:" "+d},c))}return at.jsx("div",{className:"address-line",children:r})};var el={};Object.defineProperty(el,"__esModule",{value:!0});var q_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z_=typeof window<"u"&&typeof window.document<"u",J_=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,X_=(typeof self>"u"?"undefined":q_(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",Q_=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ey=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",cf=el.isBrowser=Z_;el.isWebWorker=X_;var ty=el.isNode=J_;el.isJsDom=Q_;var ny=el.isDeno=ey;class ry{constructor(){Vn(this,"name");Vn(this,"isServerSide");Vn(this,"version");var e;ny?(this.name="deno",this.version="",cf&&(this.version=((e=window.Deno)==null?void 0:e.version.deno)||""),this.isServerSide=!0):ty?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):cf?(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 Js=()=>new ry,iy=(...t)=>typeof window<"u"&&window.IS_PRODUCTION||!1;function Kc(t){if(!id(t))throw new Error("Parameter was not an error")}function id(t){return oy(t)==="[object Error]"||t instanceof Error}function oy(t){return Object.prototype.toString.call(t)}function sy(t){let e,n="";if(t.length===0)e={};else if(id(t[0]))e={cause:t[0]},n=t.slice(1).join(" ")||"";else if(t[0]&&typeof t[0]=="object")e=Object.assign({},t[0]),n=t.slice(1).join(" ")||"";else if(typeof t[0]=="string")e={},n=n=t.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:e,shortMessage:n}}class hi extends Error{constructor(e,n){const r=[...arguments],{options:c,shortMessage:d}=sy(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="Layerr",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 p=c.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(e){return Kc(e),e._cause&&id(e._cause)?e._cause:null}static fullStack(e){Kc(e);const n=hi.cause(e);return n?`${e.stack}
26
- caused by: ${hi.fullStack(n)}`:e.stack}static info(e){Kc(e);const n={},r=hi.cause(e);return r&&Object.assign(n,hi.info(r)),e._info&&Object.assign(n,e._info),n}cause(){return hi.cause(this)}toString(){let e=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e=`${e}: ${this.message}`),e}}const Xg="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Vl=32,uf=0xffffffffffff,ly=10,ay=16,Yl=Object.freeze({source:"ulid"});function cy(t){const e=uy(),n=e&&(e.crypto||e.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 hi({info:{code:"PRNG_DETECT",...Yl}},"Failed to find a reliable PRNG")}function uy(){return hy()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function dy(t,e){let n="";for(;t>0;t--)n=gy(e)+n;return n}function fy(t,e){if(isNaN(t))throw new hi({info:{code:"ENC_TIME_NAN",...Yl}},`Time must be a number: ${t}`);if(t>uf)throw new hi({info:{code:"ENC_TIME_SIZE_EXCEED",...Yl}},`Cannot encode a time larger than ${uf}: ${t}`);if(t<0)throw new hi({info:{code:"ENC_TIME_NEG",...Yl}},`Time must be positive: ${t}`);if(Number.isInteger(t)===!1)throw new hi({info:{code:"ENC_TIME_TYPE",...Yl}},`Time must be an integer: ${t}`);let n,r="";for(let c=e;c>0;c--)n=t%Vl,r=Xg.charAt(n)+r,t=(t-n)/Vl;return r}function hy(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function gy(t){let e=Math.floor(t()*Vl);return e===Vl&&(e=Vl-1),Xg.charAt(e)}function py(t,e){const n=cy(),r=isNaN(t)?Date.now():t;return fy(r,ly)+dy(ay,n)}var df="yext_analytics_session_id";function my(){if(typeof window>"u")return null;try{var t=window.sessionStorage.getItem(df);return t||(t=py(),window.sessionStorage.setItem(df,t)),t}catch(e){return console.warn(`Unable to use browser sessionStorage for sessionId.
27
- `,e),null}}const _y="@yext/analytics",yy="1.0.0-beta.5",Ny="An analytics library for Yext",Cy="fusion@yext.com",Ey="BSD-3-Clause",Ty="./lib/commonjs/src/index.js",xy="./lib/esm/src/index.js",Sy="./lib/analytics.d.ts",vy=["analytics","report","events","yext"],wy=["src","lib","THIRD-PARTY-NOTICES"],Oy={build:"rm -rf lib/** && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && npm run format-check && npm run api-extractor && npm run generate-docs && npm run generate-notices && vite build",prepare:"husky install","format-check":"prettier --check . && eslint .","format-fix":"prettier --write . && eslint . --fix","api-extractor":"api-extractor run --local --verbose","generate-docs":"api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",prepublishOnly:"npm run build",test:"jest && playwright test",dev:"tsc -p tsconfig.esm.json --watch","generate-notices":"generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"},Dy={"@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@microsoft/api-documenter":"^7.15.3","@microsoft/api-extractor":"^7.19.4","@playwright/test":"^1.38.0","@types/jest":"^29.5.12","@types/node":"^20.6.0","@typescript-eslint/eslint-plugin":"^6.19.1","@typescript-eslint/parser":"^6.19.1",eslint:"^7.32.0","fetch-mock-jest":"^1.5.1","generate-license-file":"^1.3.0",husky:"^8.0.3",jest:"^27.0.6","jest-fetch-mock":"^3.0.3",prettier:"^3.0.3",typescript:"^4.1.5",vite:"^4.4.9"},My={bail:!1,verbose:!0,collectCoverage:!0,testEnvironment:"jsdom",collectCoverageFrom:["src/**","!src/utils/**"],moduleFileExtensions:["js","ts"],moduleDirectories:["node_modules","<rootDir>"],testMatch:["<rootDir>/tests/**/*.ts"],resetMocks:!0,restoreMocks:!0,clearMocks:!0,passWithNoTests:!0},Ay={ulidx:"^2.0.0"},ff={name:_y,version:yy,description:Ny,author:Cy,license:Ey,main:Ty,module:xy,types:Sy,keywords:vy,files:wy,scripts:Oy,devDependencies:Dy,jest:My,dependencies:Ay};function Ry(t,e,n){return n.debug?(Qg(!0,e,n),!0):navigator.sendBeacon(t,JSON.stringify(e))}function by(t,e,n){return n.debug?(Qg(!1,e,n),Promise.resolve(new Response)):fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0})}function Ly(t,e){return!e&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function Qg(t,e,n){var r=t?"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,":"),e)}var Fu=function(){return Fu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(t[c]=e[c])}return t},Fu.apply(this,arguments)},Bu=function(t,e){if(!e||Object.keys(e).length===0)return t;if(!t||Object.keys(t).length===0)return e;var n=JSON.parse(JSON.stringify(t));for(var r in e)if(e.hasOwnProperty(r)){var c=e[r];c==null?delete n[r]:typeof c!="object"?n[r]=c:n[r]=Bu(n[r],c)}return Fu({},n)},ky="yextevents.com/accounts/me/events";function Iy(t,e){var n=t==="SANDBOX",r=e==null?void 0:e.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+ky}var Py=function(t,e,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 p(x){try{S(r.next(x))}catch(O){g(O)}}function C(x){try{S(r.throw(x))}catch(O){g(O)}}function S(x){x.done?d(x.value):c(x.value).then(p,C)}S((r=r.apply(t,e||[])).next())})},$y=function(t,e){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:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function p(S){return function(x){return C([S,x])}}function C(S){if(r)throw new TypeError("Generator is already executing.");for(;g&&(g=0,S[0]&&(n=0)),n;)try{if(r=1,c&&(d=S[0]&2?c.return:S[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,S[1])).done)return d;switch(c=0,d&&(S=[S[0]&2,d.value]),S[0]){case 0:case 1:d=S;break;case 4:return n.label++,{value:S[1],done:!1};case 5:n.label++,c=S[1],S=[0];continue;case 7:S=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(S[0]===6||S[0]===2)){n=0;continue}if(S[0]===3&&(!d||S[1]>d[0]&&S[1]<d[3])){n.label=S[1];break}if(S[0]===6&&n.label<d[1]){n.label=d[1],d=S;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(S);break}d[2]&&n.ops.pop(),n.trys.pop();continue}S=e.call(t,n)}catch(x){S=[6,x],c=0}finally{r=d=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},Fy=function(){function t(e,n){if(e.authorizationType!=="apiKey"&&e.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!e.authorization)throw new Error("Authorization must be provided.");this.config=e,this.payload=n}return t.prototype.with=function(e){var n=this.payload===void 0?e:Bu(this.payload,e);return new t(this.config,n)},t.prototype.report=function(e){var n;return Py(this,void 0,void 0,function(){var r,c,d,g,p=this;return $y(this,function(C){return r=Bu((n=this.payload)!==null&&n!==void 0?n:{},e??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=my()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=ff.version:r.clientSdk=(g={},g.ANALYTICS=ff.version,g),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,c=Ly(r,this.config.forceFetch),d=Iy(this.config.env,this.config.region),c?[2,new Promise(function(S,x){Ry(d,r,p.config)?S(""):x("Failed Beacon Call")})]:[2,by(d,r,this.config).then(function(S){return S}).catch(function(S){return S})]})})},t}();function By(t){return new Fy(t)}function Hu(t){return t?t.toLowerCase().trim().replace(/\s/g,""):""}function ep(t,e){return[t,e].filter(n=>!!n).map(n=>Hu(n)).join("_")}const Hy=t=>{switch(Math.floor(t/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}};class tp{constructor(e,n,r,c,d,g=!1){Vn(this,"_optedIn");Vn(this,"_sessionTrackingEnabled");Vn(this,"_analyticsEventService");Vn(this,"_pageViewFired",!1);this.apiKey=e,this.defaultCurrency=n,this.templateData=r,this.enableDebugging=g,this._optedIn=!c,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Js().name!=="browser"||!this._optedIn)return;if(!iy()&&!this.enableDebugging){console.warn("Yext Analytics disabled for non-production domains");return}const e=Hy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:e||"US",sessionTrackingEnabled:this._sessionTrackingEnabled,debug:this.enableDebugging},r={pages:{siteUid:this.templateData.document.siteId,template:this.templateData.document.__.name},entity:this.templateData.document.uid||void 0};this._analyticsEventService=By(n).with(r)}canTrack(){return Js().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(e){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:e}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var e;if(!this.canTrack())return Promise.resolve(void 0);await((e=this._analyticsEventService)==null?void 0:e.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(e){var S;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:c,currency:d,amount:g,destinationUrl:p}=e;let C;g&&(C={amount:g,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:Hu(r)||void 0,originalEventName:ep(r||"",Hu(c)||"")},value:C,destinationUrl:p}))}getDebugEnabled(){return this.enableDebugging}}const od=et.createContext(null),Wu=et.createContext({name:""}),sd=()=>et.useContext(Wu).name;function Wy(t){var g;const e=sd(),[n]=et.useState({name:ep(e,t.name)}),r=(g=tl())==null?void 0:g.getDebugEnabled(),[c,d]=et.useState(!1);return et.useEffect(()=>{d(!0)},[]),r&&c?at.jsx("section",{"data-ya-scope":n.name,children:at.jsx(Wu.Provider,{value:n,children:t.children})}):at.jsx(Wu.Provider,{value:n,children:t.children})}function tl(){const t=et.useContext(od);if(!t)return t;Js().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await t.optIn()});const e=sd();return{getDebugEnabled(){return t.getDebugEnabled()},identify(n){return t.identify(n)},optIn(){return t.optIn()},pageView(){return t.pageView()},track(n){return t.track({...n,scope:n.scope??e})}}}const Ky=()=>{var t;return(t=tl())==null?void 0:t.track},zy=()=>{var t;return(t=tl())==null?void 0:t.pageView},Uy=()=>{var t;return(t=tl())==null?void 0:t.identify},Gy=et.lazy(()=>Promise.resolve().then(()=>require("./debugger-B7hxI1lw.cjs")));function Yy(t){const{children:e,apiKey:n,currency:r,templateData:c,requireOptIn:d,disableSessionTracking:g,enableDebugging:p}=t,C=et.useRef(null),[S,x]=et.useState(!1);et.useEffect(()=>{x(!0)},[]),C.current===null&&(C.current=new tp(n,r,c,d,g,p??hf()));const O=C.current;return at.jsxs(at.Fragment,{children:[at.jsx(od.Provider,{value:O,children:e}),S&&(p??hf())&&Js().name==="browser"?at.jsx(et.Suspense,{fallback:at.jsx(at.Fragment,{}),children:at.jsx(Gy,{})}):null]})}function hf(){return Js().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}const Mo={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},jy=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}const n=t.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${t}`);return}r="eu"}if(!t.pathname.startsWith("/f")){console.error(`Invalid path: ${t}`);return}const c=t.pathname.replace(/^\//,"").split("/");if(c.length<2||c.length>3){console.error(`Invalid path: ${t}`);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: ${t}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${t}`);return}let g;if(c.length===3&&(g=parseInt(c[1]),Number.isNaN(g))){console.error(`Invalid account id: ${t}`);return}const p=c[c.length-1].split("."),C=p.length===2?`.${p[1]}`:"",S=p[0];return{scheme:e,partition:r,env:d,accountId:g,contentHash:S,extension:C}},Vy=(t,e,n)=>{const r=`https://dyn${t.partition==="us"?"":`.${t.partition}`}.mktgcdn.com`;let c="f";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}const d=t.accountId!==void 0?`${t.accountId}/`:"";return`${r}/${c}/${d}${t.contentHash}${t.extension}/width=${Math.round(e)},height=${Math.round(n)}`},qy=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}if(t.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${t}`);return}if(!t.pathname.startsWith("/p")){console.error(`Invalid path: ${t}`);return}const n=t.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${t}`);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: ${t}`);return}}const c=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${t}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${t}`);return}}const g=n[n.length-1].split("."),p=g.length===2?`.${g[1]}`:"",C=g[0];return{scheme:e,env:r,contentHash:c,aspectRatio:d,name:C,extension:p}},Zy=(t,e,n)=>{const r="https://dyn.mktgcdn.com";let c="p";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}return`${r}/${c}/${t.contentHash}/width=${Math.round(e)},height=${Math.round(n)}`},Ku=(t,e,n)=>{if(!np(t)){console.error(`Invalid image url: ${t}.`);return}const r=new URL(t);if(r.pathname.startsWith("/p")){const c=qy(r);if(c)return Zy(c,e,n)}else if(r.pathname.startsWith("/f")){const c=jy(r);if(c)return Vy(c,e,n)}return t},np=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"},Jy=({image:t,className:e,width:n,height:r,aspectRatio:c,layout:d=Mo.INTRINSIC,placeholder:g,imgOverrides:p,style:C={},loading:S="lazy"})=>{const x=et.useRef(null),[O,R]=et.useState(!1),b="image"in t?t.image:t;et.useEffect(()=>{var le;(le=x.current)!=null&&le.complete&&R(!0)},[]),Xy(d,b.width,b.height,n,r,c);const T=Math.abs(b.width);T||console.warn("Invalid image width.");const w=Math.abs(b.height);if(w||console.warn("Invalid image height."),!np(b.url))return console.error(`Invalid image url: ${b.url}`),at.jsx(at.Fragment,{children:g!=null&&g});const P=n&&n>0?n:void 0,H=r&&r>0?r:void 0,{src:$,imgStyle:W,widths:B}=Qy(d,T,w,C,b.url,P,H,c),K=B.map(le=>`${Ku(b.url,le,w/T*le)} ${le}w`).join(", "),X=[640,768,1024,1280,1536],ee=B.map((le,V)=>V===B.length-1?`${le}px`:`(max-width: ${X[V]}px) ${le}px`).join(", ");return at.jsxs(at.Fragment,{children:[!O&&g!=null&&g,at.jsx("img",{ref:x,style:W,src:$,className:e,width:P,height:H,srcSet:K,sizes:ee,loading:S,alt:b.alternateText||"",...p})]})},Xy=(t,e,n,r,c,d)=>{if(e<0&&console.warn(`Invalid image width: ${e}.`),n<0&&console.warn(`Invalid image height: ${n}.`),t===Mo.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."),t===Mo.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},Qy=(t,e,n,r,c,d,g,p)=>{let C=[100,320,640,960,1280,1920],S=Ku(c,500,500);const x={...r};switch(x.objectFit=x.objectFit||"cover",x.objectPosition=x.objectPosition||"center",t){case Mo.INTRINSIC:x.maxWidth=e,x.width="100%",x.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Mo.FIXED:{const{fixedWidth:O,fixedHeight:R,fixedWidths:b}=eN(e,n,C,d,g);x.width=O,x.height=R,C=b,S=Ku(c,O,R);break}case Mo.ASPECT:x.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Mo.FILL:x.width="100%",x.aspectRatio=p?`${p}`:`${e} / ${n}`;break;default:console.warn(`Unrecognized layout: ${t}.`);break}return{src:S,imgStyle:x,widths:C}},eN=(t,e,n,r,c)=>r&&c?{fixedWidth:r,fixedHeight:c,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*e/t,fixedWidths:[r]}:c?{fixedWidth:c/e*t,fixedHeight:c,fixedWidths:[c/e*t]}:{fixedWidth:t,fixedHeight:e,fixedWidths:n};var rp={exports:{}};/*!
25
+ Check the top-level render call using <`+nt+">.")}return Ge}}function hr(ye,Ge){{if(!ye._store||ye._store.validated||ye.key!=null)return;ye._store.validated=!0;var nt=It(Ge);if(Ut[nt])return;Ut[nt]=!0;var Nt="";ye&&ye._owner&&ye._owner!==Et.current&&(Nt=" It was passed a child from "+_e(ye._owner.type)+"."),Ot(ye),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',nt,Nt),Ot(null)}}function vr(ye,Ge){{if(typeof ye!="object")return;if(yt(ye))for(var nt=0;nt<ye.length;nt++){var Nt=ye[nt];xt(Nt)&&hr(Nt,Ge)}else if(xt(ye))ye._store&&(ye._store.validated=!0);else if(ye){var Ht=$(ye);if(typeof Ht=="function"&&Ht!==ye.entries)for(var Kt=Ht.call(ye),$t;!($t=Kt.next()).done;)xt($t.value)&&hr($t.value,Ge)}}}function Fi(ye){{var Ge=ye.type;if(Ge==null||typeof Ge=="string")return;var nt;if(typeof Ge=="function")nt=Ge.propTypes;else if(typeof Ge=="object"&&(Ge.$$typeof===C||Ge.$$typeof===O))nt=Ge.propTypes;else return;if(nt){var Nt=_e(Ge);Ye(nt,ye.props,"prop",Nt,ye)}else if(Ge.PropTypes!==void 0&&!Mt){Mt=!0;var Ht=_e(Ge);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ht||"Unknown")}typeof Ge.getDefaultProps=="function"&&!Ge.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gs(ye){{for(var Ge=Object.keys(ye.props),nt=0;nt<Ge.length;nt++){var Nt=Ge[nt];if(Nt!=="children"&&Nt!=="key"){Ot(ye),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Nt),Ot(null);break}}ye.ref!==null&&(Ot(ye),P("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function ps(ye,Ge,nt,Nt,Ht,Kt){{var $t=U(ye);if(!$t){var Pt="";(ye===void 0||typeof ye=="object"&&ye!==null&&Object.keys(ye).length===0)&&(Pt+=" 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 mn=bt();mn?Pt+=mn:Pt+=Qt();var sn;ye===null?sn="null":yt(ye)?sn="array":ye!==void 0&&ye.$$typeof===e?(sn="<"+(_e(ye.type)||"Unknown")+" />",Pt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof ye,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,Pt)}var nn=_t(ye,Ge,nt,Ht,Kt);if(nn==null)return nn;if($t){var $n=Ge.children;if($n!==void 0)if(Nt)if(yt($n)){for(var pr=0;pr<$n.length;pr++)vr($n[pr],ye);Object.freeze&&Object.freeze($n)}else P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else vr($n,ye)}return ye===r?gs(nn):Fi(nn),nn}}function fn(ye,Ge,nt){return ps(ye,Ge,nt,!0)}function gr(ye,Ge,nt){return ps(ye,Ge,nt,!1)}var Jr=gr,ms=fn;Fl.Fragment=r,Fl.jsx=Jr,Fl.jsxs=ms}()),Fl}process.env.NODE_ENV==="production"?$u.exports=W_():$u.exports=K_();var at=$u.exports;function z_(t){switch(t){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 ep={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Fu={GOOGLE:"google",APPLE:"apple",BING:"bing"},U_=(t,e)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[t];return r&&e[r]},G_=(t,e=[],n,r={route:!1},c)=>{const d="Failed to construct query for maps service.";let g=t&&ff([t.line1,t.line2,t.city,t.region,t.postalCode,t.countryCode]);switch(r.provider){case Fu.APPLE:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return cf(`${c.latitude},${c.longitude}`,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return cf(g,r.route)}case Fu.BING:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return uf(`${c.latitude},${c.longitude}`,r.route);if(g=t&&ff([t.line1,t.city,t.region,t.postalCode]),!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return uf(g,r.route)}default:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return df(`${c.latitude},${c.longitude}`,r.route);const p=e.find(C=>{var S;return((S=C==null?void 0:C.publisher)==null?void 0:S.toUpperCase())===ep.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return Y_(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 df(g,r.route)}}},cf=(t,e)=>e?`https://maps.apple.com/?daddr=${t}`:`https://maps.apple.com/?address=${t}`,uf=(t,e)=>e?`https://bing.com/maps/default.aspx?rtp=adr.${t}`:`https://bing.com/maps/default.aspx?where1=${t}`,Y_=(t,e,n)=>{const r=e?`&query=${e}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${t}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${t}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${t}&destination=direct`},df=(t,e)=>e?`https://maps.google.com/maps/dir/?api=1&destination=${t}`:`https://maps.google.com/maps/search/?api=1&query=${t}`,ff=(t=[])=>{if(!t.length)return"";const e=t.filter(Boolean).join(", ");return encodeURI(e)},j_=({address:t,lines:e,separator:n=",",...r})=>{const c=(e||z_(t.countryCode)).map(d=>at.jsx(V_,{address:t,line:d,separator:n},d.toString()));return et.createElement("div",{...r,key:t.toString()},c)},V_=({address:t,line:e,separator:n})=>{const r=[];for(const c of e){if(c===","){r.push(at.jsx("span",{children:n},c));continue}const d=t[c];if(!d)continue;const g=U_(c,t);if(g){r.push(at.jsxs(H_.Fragment,{children:[" ",at.jsx("abbr",{title:g,children:d})]},c));continue}r.push(at.jsx("span",{children:" "+d},c))}return at.jsx("div",{className:"address-line",children:r})};var el={};Object.defineProperty(el,"__esModule",{value:!0});var q_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z_=typeof window<"u"&&typeof window.document<"u",J_=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,X_=(typeof self>"u"?"undefined":q_(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",Q_=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ey=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",hf=el.isBrowser=Z_;el.isWebWorker=X_;var ty=el.isNode=J_;el.isJsDom=Q_;var ny=el.isDeno=ey;class ry{constructor(){Vn(this,"name");Vn(this,"isServerSide");Vn(this,"version");var e;ny?(this.name="deno",this.version="",hf&&(this.version=((e=window.Deno)==null?void 0:e.version.deno)||""),this.isServerSide=!0):ty?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):hf?(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 Js=()=>new ry,iy=(...t)=>typeof window<"u"&&window.IS_PRODUCTION||!1;function zc(t){if(!od(t))throw new Error("Parameter was not an error")}function od(t){return oy(t)==="[object Error]"||t instanceof Error}function oy(t){return Object.prototype.toString.call(t)}function sy(t){let e,n="";if(t.length===0)e={};else if(od(t[0]))e={cause:t[0]},n=t.slice(1).join(" ")||"";else if(t[0]&&typeof t[0]=="object")e=Object.assign({},t[0]),n=t.slice(1).join(" ")||"";else if(typeof t[0]=="string")e={},n=n=t.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:e,shortMessage:n}}class hi extends Error{constructor(e,n){const r=[...arguments],{options:c,shortMessage:d}=sy(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="Layerr",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 p=c.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(e){return zc(e),e._cause&&od(e._cause)?e._cause:null}static fullStack(e){zc(e);const n=hi.cause(e);return n?`${e.stack}
26
+ caused by: ${hi.fullStack(n)}`:e.stack}static info(e){zc(e);const n={},r=hi.cause(e);return r&&Object.assign(n,hi.info(r)),e._info&&Object.assign(n,e._info),n}cause(){return hi.cause(this)}toString(){let e=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e=`${e}: ${this.message}`),e}}const tp="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Vl=32,gf=0xffffffffffff,ly=10,ay=16,Yl=Object.freeze({source:"ulid"});function cy(t){const e=uy(),n=e&&(e.crypto||e.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 hi({info:{code:"PRNG_DETECT",...Yl}},"Failed to find a reliable PRNG")}function uy(){return hy()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function dy(t,e){let n="";for(;t>0;t--)n=gy(e)+n;return n}function fy(t,e){if(isNaN(t))throw new hi({info:{code:"ENC_TIME_NAN",...Yl}},`Time must be a number: ${t}`);if(t>gf)throw new hi({info:{code:"ENC_TIME_SIZE_EXCEED",...Yl}},`Cannot encode a time larger than ${gf}: ${t}`);if(t<0)throw new hi({info:{code:"ENC_TIME_NEG",...Yl}},`Time must be positive: ${t}`);if(Number.isInteger(t)===!1)throw new hi({info:{code:"ENC_TIME_TYPE",...Yl}},`Time must be an integer: ${t}`);let n,r="";for(let c=e;c>0;c--)n=t%Vl,r=tp.charAt(n)+r,t=(t-n)/Vl;return r}function hy(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function gy(t){let e=Math.floor(t()*Vl);return e===Vl&&(e=Vl-1),tp.charAt(e)}function py(t,e){const n=cy(),r=isNaN(t)?Date.now():t;return fy(r,ly)+dy(ay,n)}var pf="yext_analytics_session_id";function my(){if(typeof window>"u")return null;try{var t=window.sessionStorage.getItem(pf);return t||(t=py(),window.sessionStorage.setItem(pf,t)),t}catch(e){return console.warn(`Unable to use browser sessionStorage for sessionId.
27
+ `,e),null}}const _y="@yext/analytics",yy="1.0.0-beta.5",Ny="An analytics library for Yext",Cy="fusion@yext.com",Ey="BSD-3-Clause",Ty="./lib/commonjs/src/index.js",xy="./lib/esm/src/index.js",Sy="./lib/analytics.d.ts",vy=["analytics","report","events","yext"],wy=["src","lib","THIRD-PARTY-NOTICES"],Oy={build:"rm -rf lib/** && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && npm run format-check && npm run api-extractor && npm run generate-docs && npm run generate-notices && vite build",prepare:"husky install","format-check":"prettier --check . && eslint .","format-fix":"prettier --write . && eslint . --fix","api-extractor":"api-extractor run --local --verbose","generate-docs":"api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",prepublishOnly:"npm run build",test:"jest && playwright test",dev:"tsc -p tsconfig.esm.json --watch","generate-notices":"generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"},Dy={"@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@microsoft/api-documenter":"^7.15.3","@microsoft/api-extractor":"^7.19.4","@playwright/test":"^1.38.0","@types/jest":"^29.5.12","@types/node":"^20.6.0","@typescript-eslint/eslint-plugin":"^6.19.1","@typescript-eslint/parser":"^6.19.1",eslint:"^7.32.0","fetch-mock-jest":"^1.5.1","generate-license-file":"^1.3.0",husky:"^8.0.3",jest:"^27.0.6","jest-fetch-mock":"^3.0.3",prettier:"^3.0.3",typescript:"^4.1.5",vite:"^4.4.9"},My={bail:!1,verbose:!0,collectCoverage:!0,testEnvironment:"jsdom",collectCoverageFrom:["src/**","!src/utils/**"],moduleFileExtensions:["js","ts"],moduleDirectories:["node_modules","<rootDir>"],testMatch:["<rootDir>/tests/**/*.ts"],resetMocks:!0,restoreMocks:!0,clearMocks:!0,passWithNoTests:!0},Ay={ulidx:"^2.0.0"},mf={name:_y,version:yy,description:Ny,author:Cy,license:Ey,main:Ty,module:xy,types:Sy,keywords:vy,files:wy,scripts:Oy,devDependencies:Dy,jest:My,dependencies:Ay};function Ry(t,e,n){return n.debug?(np(!0,e,n),!0):navigator.sendBeacon(t,JSON.stringify(e))}function by(t,e,n){return n.debug?(np(!1,e,n),Promise.resolve(new Response)):fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0})}function Ly(t,e){return!e&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function np(t,e,n){var r=t?"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,":"),e)}var Bu=function(){return Bu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(t[c]=e[c])}return t},Bu.apply(this,arguments)},Hu=function(t,e){if(!e||Object.keys(e).length===0)return t;if(!t||Object.keys(t).length===0)return e;var n=JSON.parse(JSON.stringify(t));for(var r in e)if(e.hasOwnProperty(r)){var c=e[r];c==null?delete n[r]:typeof c!="object"?n[r]=c:n[r]=Hu(n[r],c)}return Bu({},n)},ky="yextevents.com/accounts/me/events";function Iy(t,e){var n=t==="SANDBOX",r=e==null?void 0:e.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+ky}var Py=function(t,e,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 p(T){try{S(r.next(T))}catch(O){g(O)}}function C(T){try{S(r.throw(T))}catch(O){g(O)}}function S(T){T.done?d(T.value):c(T.value).then(p,C)}S((r=r.apply(t,e||[])).next())})},$y=function(t,e){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:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function p(S){return function(T){return C([S,T])}}function C(S){if(r)throw new TypeError("Generator is already executing.");for(;g&&(g=0,S[0]&&(n=0)),n;)try{if(r=1,c&&(d=S[0]&2?c.return:S[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,S[1])).done)return d;switch(c=0,d&&(S=[S[0]&2,d.value]),S[0]){case 0:case 1:d=S;break;case 4:return n.label++,{value:S[1],done:!1};case 5:n.label++,c=S[1],S=[0];continue;case 7:S=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(S[0]===6||S[0]===2)){n=0;continue}if(S[0]===3&&(!d||S[1]>d[0]&&S[1]<d[3])){n.label=S[1];break}if(S[0]===6&&n.label<d[1]){n.label=d[1],d=S;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(S);break}d[2]&&n.ops.pop(),n.trys.pop();continue}S=e.call(t,n)}catch(T){S=[6,T],c=0}finally{r=d=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},Fy=function(){function t(e,n){if(e.authorizationType!=="apiKey"&&e.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!e.authorization)throw new Error("Authorization must be provided.");this.config=e,this.payload=n}return t.prototype.with=function(e){var n=this.payload===void 0?e:Hu(this.payload,e);return new t(this.config,n)},t.prototype.report=function(e){var n;return Py(this,void 0,void 0,function(){var r,c,d,g,p=this;return $y(this,function(C){return r=Hu((n=this.payload)!==null&&n!==void 0?n:{},e??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=my()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=mf.version:r.clientSdk=(g={},g.ANALYTICS=mf.version,g),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,c=Ly(r,this.config.forceFetch),d=Iy(this.config.env,this.config.region),c?[2,new Promise(function(S,T){Ry(d,r,p.config)?S(""):T("Failed Beacon Call")})]:[2,by(d,r,this.config).then(function(S){return S}).catch(function(S){return S})]})})},t}();function By(t){return new Fy(t)}function Wu(t){return t?t.toLowerCase().trim().replace(/\s/g,""):""}function rp(t,e){return[t,e].filter(n=>!!n).map(n=>Wu(n)).join("_")}const Hy=t=>{switch(Math.floor(t/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},sd=et.createContext(null),Wy=et.lazy(()=>Promise.resolve().then(()=>require("./debugger-DxMCz_HF.cjs")));function Ky(t){const{children:e,apiKey:n,currency:r,templateData:c,requireOptIn:d,disableSessionTracking:g,enableDebugging:p}=t,C=et.useRef(null),[S,T]=et.useState(!1);et.useEffect(()=>{T(!0)},[]),C.current===null&&(C.current=new ip(n,r,c,d,g,p??oc()));const O=C.current;return at.jsxs(at.Fragment,{children:[at.jsx(sd.Provider,{value:O,children:e}),S&&(p||oc())&&Js().name==="browser"?at.jsx(et.Suspense,{fallback:at.jsx(at.Fragment,{}),children:at.jsx(Wy,{})}):null]})}function oc(){return Js().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class ip{constructor(e,n,r,c,d,g=!1){Vn(this,"_optedIn");Vn(this,"_sessionTrackingEnabled");Vn(this,"_analyticsEventService");Vn(this,"_pageViewFired",!1);this.apiKey=e,this.defaultCurrency=n,this.templateData=r,this.enableDebugging=g,this._optedIn=!c,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Js().name!=="browser"||!this._optedIn)return;if(!iy()&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const e=Hy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:e||"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};this._analyticsEventService=By(n).with(r)}canTrack(){return Js().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(e){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:e}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var e;if(!this.canTrack())return Promise.resolve(void 0);await((e=this._analyticsEventService)==null?void 0:e.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(e){var O;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:c,currency:d,amount:g,destinationUrl:p,customTags:C,customValues:S}=e;let T;g&&(T={amount:g,currency:d||this.defaultCurrency}),await((O=this._analyticsEventService)==null?void 0:O.report({action:n,pages:{scope:Wu(r)||void 0,originalEventName:rp(r||"",Wu(c)||"")},value:T,destinationUrl:p,customTags:C,customValues:S}))}getDebugEnabled(){return this.enableDebugging||oc()}}const Ku=et.createContext({name:""}),ld=()=>et.useContext(Ku).name;function zy(t){var g;const e=ld(),[n]=et.useState({name:rp(e,t.name)}),r=(g=tl())==null?void 0:g.getDebugEnabled(),[c,d]=et.useState(!1);return et.useEffect(()=>{d(!0)},[]),r&&c?at.jsx("section",{"data-ya-scope":n.name,children:at.jsx(Ku.Provider,{value:n,children:t.children})}):at.jsx(Ku.Provider,{value:n,children:t.children})}function tl(){const t=et.useContext(sd);if(!t)return t;Js().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await t.optIn()});const e=ld();return{getDebugEnabled(){return t.getDebugEnabled()},identify(n){return t.identify(n)},optIn(){return t.optIn()},pageView(){return t.pageView()},track(n){return t.track({...n,scope:n.scope??e})}}}const Uy=()=>{var t;return(t=tl())==null?void 0:t.track},Gy=()=>{var t;return(t=tl())==null?void 0:t.pageView},Yy=()=>{var t;return(t=tl())==null?void 0:t.identify},Mo={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},jy=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}const n=t.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${t}`);return}r="eu"}if(!t.pathname.startsWith("/f")){console.error(`Invalid path: ${t}`);return}const c=t.pathname.replace(/^\//,"").split("/");if(c.length<2||c.length>3){console.error(`Invalid path: ${t}`);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: ${t}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${t}`);return}let g;if(c.length===3&&(g=parseInt(c[1]),Number.isNaN(g))){console.error(`Invalid account id: ${t}`);return}const p=c[c.length-1].split("."),C=p.length===2?`.${p[1]}`:"",S=p[0];return{scheme:e,partition:r,env:d,accountId:g,contentHash:S,extension:C}},Vy=(t,e,n)=>{const r=`https://dyn${t.partition==="us"?"":`.${t.partition}`}.mktgcdn.com`;let c="f";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}const d=t.accountId!==void 0?`${t.accountId}/`:"";return`${r}/${c}/${d}${t.contentHash}${t.extension}/width=${Math.round(e)},height=${Math.round(n)}`},qy=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}if(t.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${t}`);return}if(!t.pathname.startsWith("/p")){console.error(`Invalid path: ${t}`);return}const n=t.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${t}`);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: ${t}`);return}}const c=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${t}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${t}`);return}}const g=n[n.length-1].split("."),p=g.length===2?`.${g[1]}`:"",C=g[0];return{scheme:e,env:r,contentHash:c,aspectRatio:d,name:C,extension:p}},Zy=(t,e,n)=>{const r="https://dyn.mktgcdn.com";let c="p";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}return`${r}/${c}/${t.contentHash}/width=${Math.round(e)},height=${Math.round(n)}`},zu=(t,e,n)=>{if(!op(t)){console.error(`Invalid image url: ${t}.`);return}const r=new URL(t);if(r.pathname.startsWith("/p")){const c=qy(r);if(c)return Zy(c,e,n)}else if(r.pathname.startsWith("/f")){const c=jy(r);if(c)return Vy(c,e,n)}return t},op=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"},Jy=({image:t,className:e,width:n,height:r,aspectRatio:c,layout:d=Mo.INTRINSIC,placeholder:g,imgOverrides:p,style:C={},loading:S="lazy"})=>{const T=et.useRef(null),[O,R]=et.useState(!1),b="image"in t?t.image:t;et.useEffect(()=>{var le;(le=T.current)!=null&&le.complete&&R(!0)},[]),Xy(d,b.width,b.height,n,r,c);const x=Math.abs(b.width);x||console.warn("Invalid image width.");const w=Math.abs(b.height);if(w||console.warn("Invalid image height."),!op(b.url))return console.error(`Invalid image url: ${b.url}`),at.jsx(at.Fragment,{children:g!=null&&g});const $=n&&n>0?n:void 0,W=r&&r>0?r:void 0,{src:P,imgStyle:H,widths:B}=Qy(d,x,w,C,b.url,$,W,c),z=B.map(le=>`${zu(b.url,le,w/x*le)} ${le}w`).join(", "),X=[640,768,1024,1280,1536],ee=B.map((le,j)=>j===B.length-1?`${le}px`:`(max-width: ${X[j]}px) ${le}px`).join(", ");return at.jsxs(at.Fragment,{children:[!O&&g!=null&&g,at.jsx("img",{ref:T,style:H,src:P,className:e,width:$,height:W,srcSet:z,sizes:ee,loading:S,alt:b.alternateText||"",...p})]})},Xy=(t,e,n,r,c,d)=>{if(e<0&&console.warn(`Invalid image width: ${e}.`),n<0&&console.warn(`Invalid image height: ${n}.`),t===Mo.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."),t===Mo.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},Qy=(t,e,n,r,c,d,g,p)=>{let C=[100,320,640,960,1280,1920],S=zu(c,500,500);const T={...r};switch(T.objectFit=T.objectFit||"cover",T.objectPosition=T.objectPosition||"center",t){case Mo.INTRINSIC:T.maxWidth=e,T.width="100%",T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Mo.FIXED:{const{fixedWidth:O,fixedHeight:R,fixedWidths:b}=eN(e,n,C,d,g);T.width=O,T.height=R,C=b,S=zu(c,O,R);break}case Mo.ASPECT:T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Mo.FILL:T.width="100%",T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;default:console.warn(`Unrecognized layout: ${t}.`);break}return{src:S,imgStyle:T,widths:C}},eN=(t,e,n,r,c)=>r&&c?{fixedWidth:r,fixedHeight:c,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*e/t,fixedWidths:[r]}:c?{fixedWidth:c/e*t,fixedHeight:c,fixedWidths:[c/e*t]}:{fixedWidth:t,fixedHeight:e,fixedWidths:n};var sp={exports:{}};/*!
28
28
  Copyright (c) 2018 Jed Watson.
29
29
  Licensed under the MIT License (MIT), see
30
30
  http://jedwatson.github.io/classnames
31
- */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],c=0;c<arguments.length;c++){var d=arguments[c];if(d){var g=typeof d;if(g==="string"||g==="number")r.push(d);else if(Array.isArray(d)){if(d.length){var p=n.apply(null,d);p&&r.push(p)}}else if(g==="object"){if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]")){r.push(d.toString());continue}for(var C in d)e.call(d,C)&&d[C]&&r.push(C)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(rp);var tN=rp.exports;const Xs=rd(tN),gf=t=>t.linkType==="Email"||!t.linkType&&ip(t.link)?t.link.startsWith("mailto:")?t.link:`mailto:${t.link}`:t.linkType==="Phone"?t.link.startsWith("tel:")?t.link:`tel:${t.link}`:t.link,ip=t=>t.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(t),nN=t=>"href"in t,op=et.forwardRef(function(e,n){const r=nN(e)?{link:e.href}:e.cta,{children:c,onClick:d,className:g,eventName:p,scope:C,currency:S,amount:x,cta:O,obfuscate:R,...b}=e,T=O?"CTA_CLICK":"LINK",w=p||(O?"cta":"link"),P=tl(),H=R||R!==!1&&ip(r.link),$=async K=>{const X=K.currentTarget;let ee="";if(H){K.preventDefault();const le=X.href.split("/").at(-1);le&&(ee=atob(le))}if(P!==null)try{await P.track({action:T,scope:e.scope,eventName:w,currency:S,amount:x,destinationUrl:ee||X.href})}catch{console.error("Failed to report click Analytics Event")}d&&d(K),ee&&(window.location.href=ee)},W=H?"Obfuscated, set a label or child":r.link,B={className:Xs("Link",g),href:H?btoa(gf(r)):gf(r),onClick:$,rel:e.target&&!e.rel?"noopener":void 0,ref:n};return P!=null&&P.getDebugEnabled()&&(B["data-ya-action"]=T,B["data-ya-scopeoverride"]=C,B["data-ya-eventname"]=w),at.jsx("a",{...B,...b,children:c||r.label||W})}),rN={URL:"URL",Email:"Email",Phone:"Phone"},dn=Object.freeze({DEGREE:Symbol("deg"),KILOMETER:Symbol("km"),MILE:Symbol("mi"),RADIAN:Symbol("r")}),jr=Object.freeze({MERCATOR:Symbol("mercator"),SPHERICAL:Symbol("spherical")}),zc=3959,Uc=6371,iN=["latitude","lat"],oN=["longitude","lon","lng","long"];function pf(t,e){for(const n of e)if(t[n]||t[n]===0)return t[n]}function mf(t){switch(typeof t){case"string":case"number":const e=Number.parseFloat(t);if(Number.isNaN(e))throw new Error(`'${t}' must be convertible to a Number'`);return e;default:throw new Error(`typeof '${t}' must be a number or a string that can be converted to a number, is '${typeof t}'`)}}function as(t){return t*Math.PI/180}function Ji(t){return t/Math.PI*180}function sN(t,e){const n=as(t.latitude),r=as(e.latitude),c=r-n,d=as(e.longitude-t.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 lN(t,e){const n=Math.tan(Math.PI/360*(t+90)),r=Math.tan(Math.PI/360*(e+90));return Math.log(r/n)}function aN(t,e){const r=Math.tan(Math.PI/360*(t+90))*Math.pow(Math.E,e);return Math.atan(r)*360/Math.PI-90}class tn{constructor(e,n){let r=e;typeof e=="object"&&(r=pf(e,iN),n=pf(e,oN),r=typeof r=="function"?r():r,n=typeof n=="function"?n():n),this.latitude=r,this.longitude=n}get latitude(){return this._lat}get longitude(){return this._lon}get normalLon(){return((this._lon+180)%360+360)%360-180}set latitude(e){this._lat=Math.max(-90,Math.min(mf(e),90))}set longitude(e){this._lon=mf(e)}add(e,n,r=dn.DEGREE,c=jr.SPHERICAL){if(c===jr.MERCATOR&&(r===dn.DEGREE||r===dn.RADIAN)){const d=r===dn.DEGREE?as(e):e,g=r===dn.DEGREE?n:Ji(n);this.latitude=aN(this.latitude,d),this.longitude+=g}else switch(r){case dn.DEGREE:this.latitude+=e,this.longitude+=n;break;case dn.KILOMETER:this.latitude+=Ji(e)*Uc,this.longitude+=Ji(n)*Uc*Math.cos(as(this.latitude));break;case dn.MILE:this.latitude+=Ji(e)*zc,this.longitude+=Ji(n)*zc*Math.cos(as(this.latitude));break;case dn.RADIAN:this.latitude+=Ji(e),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${r}`)}}distanceTo(e,n=dn.MILE,r=jr.SPHERICAL){if(r===jr.MERCATOR&&(n===dn.DEGREE||n===dn.RADIAN)){const c=lN(this.latitude,e.latitude),d=Math.abs(e.normalLon-this.normalLon),g=as(Math.min(d,360-d)),p=Math.sqrt(Math.pow(c,2)+Math.pow(g,2));switch(n){case dn.DEGREE:return Ji(p);case dn.RADIAN:return p;default:throw new Error(`unit unhandled: ${n}`)}}else{const c=sN(this,e);switch(n){case dn.DEGREE:return Ji(c);case dn.KILOMETER:return c*Uc;case dn.MILE:return c*zc;case dn.RADIAN:return c;default:throw new Error(`unit unhandled: ${n}`)}}}equals(e){return e&&e.latitude===this.latitude&&e.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function sp(t,e=()=>null){const n=document.createElement("script");n.async=!0,n.onload=e,n.src=t,document.head.appendChild(n)}const dr={UNDEFINED:"undefined",NULL:"object",BOOLEAN:"boolean",NUMBER:"number",BIGINT:"bigint",STRING:"string",SYMBOL:"symbol",FUNCTION:"function",OBJECT:"object"};function Sr(t,e){if(typeof t!==e)throw new Error(`Expected an object of type '${e}' but received '${typeof t}'`)}function fr(t,e){let n;try{n=t instanceof e}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${e.name}' but received '${t.constructor.name}'`)}class lp{constructor(e,n){fr(e,fs),fr(n,HTMLElement),this.providerMapClass=e.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(e){return this.controlEnabled=e,this}withPanHandler(e){return Sr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return Sr(e,dr.FUNCTION),this.panStartHandler=e,this}withProviderOptions(e){return this.providerOptions=e,this}build(){const e=this.providerMapClass;return new e(this)}}class nl{constructor(e){fr(e,lp),this._panHandler=e.panHandler,this._panStartHandler=e.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(e,n){throw new Error("not implemented")}setZoom(e,n){throw new Error("not implemented")}setZoomCenter(e,n,r){this.setZoom(e,r),this.setCenter(n,r)}}class ap{constructor(e){fr(e,fs),this.providerPinClass=e.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={}}withClickHandler(e){return Sr(e,dr.FUNCTION),this.clickHandler=e,this}withFocusHandler(e){return Sr(e,dr.FUNCTION),this.focusHandler=e,this}withHoverHandler(e){return Sr(e,dr.FUNCTION),this.hoverHandler=e,this}withIcons(e){return this.icons=e,this}build(){const e=this.providerPinClass;return new e(this)}}class ld{constructor(e){fr(e,ap),this._clickHandler=e.clickHandler,this._focusHandler=e.focusHandler,this._hoverHandler=e.hoverHandler,this._icons=e.icons}setCoordinate(e){throw new Error("not implemented")}setMap(e,n){throw new Error("not implemented")}setProperties(e){throw new Error("not implemented")}}const cN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class fc extends ld{static get baseStyle(){return cN}constructor(e){super(e),this._pinEl=document.createElement("button"),Object.assign(this._pinEl.style,this.constructor.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()}addListeners(){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(e){this.setElementProperties(e);const n=e.getClass(),r=e.getElement()||this._pinEl,c=e.getZIndex();r.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=c,this._wrapper.setAttribute("class",n),r!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(r)))}setElementProperties(e){const n=e.getAnchorX(),r=e.getAnchorY(),c=e.getHeight(),d=this._icons[e.getIcon()],g=e.getSRText(),p=e.getWidth();Object.assign(this._pinEl.style,{backgroundImage:d?`url("${d}")`:"",height:c+"px",transform:`translate(${-100*n}%, ${-100*r}%)`,width:p+"px"}),this._pinAlt.innerText=g}}class ds{constructor(){this.loadFunction=(e,n,r,c)=>e(),this.mapClass=nl,this.pinClass=ld,this.providerName=""}withLoadFunction(e){return Sr(e,dr.FUNCTION),this.loadFunction=e,this}withMapClass(e){return this.mapClass=e,this}withPinClass(e){return this.pinClass=e,this}withProviderName(e){return this.providerName=e,this}build(){return new fs(this)}}class fs{constructor(e){fr(e,ds),this._loadFunction=e.loadFunction,this._mapClass=e.mapClass,this._pinClass=e.pinClass,this._providerName=e.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(e=this._apiKey,n=this._options){this._loadInvoked||(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,e,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(e,n=null){this._loadInvoked||(this._apiKey=e,this._options=n||this._options)}}const _f={GEOCODER:"geocoder",PLACES:"places"};class uN extends nl{constructor(e){super(e),this.map=new google.maps.Map(e.wrapper,{disableDefaultUI:!e.controlEnabled,fullscreenControl:!1,gestureHandling:e.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:e.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...e.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(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new google.maps.LatLng(e.latitude,e.longitude);n?this.map.panTo(r):this.map.setCenter(r)}setZoom(e,n){this.map.setZoom(Math.floor(e))}setZoomCenter(e,n,r){this.setCenter(n,r),this.setZoom(e,r)}}class dN extends fc{constructor(e){super(e),this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper);const n=this;class r extends google.maps.OverlayView{draw(){var g;const d=(g=this.getProjection())==null?void 0:g.fromLatLngToDivPixel(n._latLng);d&&(n._wrapper.style.left=d.x+"px",n._wrapper.style.top=d.y+"px")}onAdd(){this.getPanes().floatPane.appendChild(n._wrapper)}onRemove(){var d;(d=n._wrapper.parentNode)==null||d.removeChild(n._wrapper)}}this.pin=new r}setCoordinate(e){this._latLng=new google.maps.LatLng(e.latitude,e.longitude),this.pin.draw()}setMap(e,n){this.pin.setMap(e?e.getProviderMap().map:null)}}const yf="GoogleMapsCallback_b7d77ff2",fN="https://maps.googleapis.com/maps/api/js";function hN(t,e,n,{autocomplete:r=!1,channel:c=window.location.hostname,client:d,language:g,region:p,libraries:C=[],loading:S="async",params:x={}}={}){window[yf]=t,r&&C.push(_f.GEOCODER,_f.PLACES);const O={callback:yf,channel:c,libraries:C.join(","),...x};n&&(O.key=n),d&&(O.client=d),g&&(O.language=g),p&&(O.region=p),S&&(O.loading=S),sp(fN+"?"+Object.entries(O).map(([R,b])=>R+"="+b).join("&"))}const cp=new ds().withLoadFunction(hN).withMapClass(uN).withPinClass(dN).withProviderName("Google").build();class ss{static fit(e){const n=e.map(S=>S.latitude),r=Math.max(...n),c=Math.min(...n),d=e.map(S=>S.normalLon).sort((S,x)=>S-x),g=d.map((S,x)=>({distance:(x<d.length-1?d[x+1]:d[0]+360)-S,index:x})).reduce((S,x)=>x.distance>S.distance?x:S).index,p=d[g],C=d[(g+1)%d.length];return new this(new tn(c,C),new tn(r,p))}constructor(e,n){this._ne=new tn(n),this._sw=new tn(e)}get ne(){return this._ne}get sw(){return this._sw}set ne(e){this._ne=new tn(e)}set sw(e){this._sw=new tn(e)}contains(e){const n=this._sw.latitude<=e.latitude&&e.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,c=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=e.normalLon&&e.normalLon<=this._ne.normalLon:this._sw.normalLon<=e.normalLon||e.normalLon<=this._ne.normalLon;return n&&(r||c)}extend(e){if(this._ne.latitude=Math.max(this._ne.latitude,e.latitude),this._sw.latitude=Math.min(this._sw.latitude,e.latitude),!this.contains(e)){const n=((e.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-e.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(e=jr.SPHERICAL){const n=new tn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,dn.DEGREE,e),c=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,dn.DEGREE,e),n.longitude=c,n}}class gN{constructor(){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(e){return this._anchorX=e,this}setAnchorY(e){return this._anchorY=e,this}setClass(e){return this._class=e,this}setElement(e){return this._element=e,this}setHeight(e){return this._height=e,this}setIcon(e){return this._icon=e,this}setSRText(e){return this._srText=e,this}setWidth(e){return this._width=e,this}setZIndex(e){return this._zIndex=e,this}}class ad{constructor(){this.coordinate=new tn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=e=>new gN,this.provider=null,this.type=""}withCoordinate(e){return this.coordinate=new tn(e),this}withHideOffscreen(e){return this.hideOffscreen=e,this}withIcon(e,n){return this.icons[e]=n,this}withPropertiesForStatus(e){return Sr(e,dr.FUNCTION),this.propertiesForStatus=e,this}withProvider(e){return fr(e,fs),this.provider=e,this}withType(e){return this.type=e,this}build(){return new pN(this)}}class pN{constructor(e){if(fr(e,ad),fr(e.provider,fs),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=e.coordinate,this._hideOffscreen=e.hideOffscreen,this._icons={...e.icons},this._propertiesForStatus=e.propertiesForStatus,this._type=e.type,this._clickHandler=()=>null,this._focusHandler=n=>this._hoverHandler(n),this._hoverHandler=n=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new ap(e.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(n=>this._focusHandler(n)).withHoverHandler(n=>this._hoverHandler(n)).build(),this._pin.setCoordinate(e.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(e){return this._icons[e]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(e){Sr(e,dr.FUNCTION),this._clickHandler=e}setCoordinate(e){this._coordinate=new tn(e),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(e){Sr(e,dr.FUNCTION),this._focusHandler=e}setHoverHandler(e){Sr(e,dr.FUNCTION),this._hoverHandler=e}setMap(e){if(e!==this._map&&(e!==null&&fr(e,dp),this._pin.setMap(e,this._hidden?null:this._map),this._map=e,this._hidden=!1,this._cancelHiddenUpdater(),e&&this._hideOffscreen)){let n=!1;const r=new Promise(c=>{this._cancelHiddenUpdater=()=>{n=!0,c()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,e.moving()]),await Promise.race([r,e.idle()])})()}}setStatus(e){Object.assign(this._status,e),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const e=this._map.getBounds().contains(this._coordinate);this._hidden&&e?this._pin.setMap(this._map,null):!this._hidden&&!e&&this._pin.setMap(null,this._map),this._hidden=!e}}}const So=.98;function Ga(t,e){return Math.max(typeof t==dr.FUNCTION?t():t||0,0)/e}class up{constructor(){this.controlEnabled=!0,this.defaultCenter=new tn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(e,n)=>null,this.panStartHandler=e=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(e){return this.controlEnabled=e,this}withDefaultCenter(e){return this.defaultCenter=new tn(e),this}withDefaultZoom(e){return this.defaultZoom=e,this}withLegendPins(e){return this.legendPins=Array.from(e),this}withPadding(e){return this.padding=e,this}withPanHandler(e){return Sr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return Sr(e,dr.FUNCTION),this.panStartHandler=e,this}withProvider(e){return fr(e,fs),this.provider=e,this}withProviderOptions(e){return this.providerOptions=e,this}withSinglePinZoom(e){return this.singlePinZoom=e,this}withWrapper(e){return fr(e,HTMLElement),this.wrapper=e,this}build(){return new dp(this)}}let dp=class{constructor(e){if(fr(e,up),fr(e.provider,fs),fr(e.wrapper,HTMLElement),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=e.defaultCenter,this._defaultZoom=e.defaultZoom,this._legendPins=e.legendPins,this._provider=e.provider,this._singlePinZoom=e.singlePinZoom,this._wrapper=e.wrapper,this._padding={},this.setPadding(e.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(e.panHandler),this.setPanStartHandler(e.panStartHandler);this._wrapper.firstChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new lp(e.provider,this._wrapper).withControlEnabled(e.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(e.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(e,n=!1,r=this._singlePinZoom){e.length?this.setBounds(ss.fit(e),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){if(!this._cachedBounds){const e=this._wrapper.offsetHeight,n=this._wrapper.offsetWidth,r=this.getZoom(),c=this.getCenter(),d=360/Math.pow(2,r+8),g=n*d,p=e*d;this._cachedBounds=new ss(c,c),this._cachedBounds.ne.add(p/2,g/2,dn.DEGREE,jr.MERCATOR),this._cachedBounds.sw.add(-p/2,-g/2,dn.DEGREE,jr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new ss(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 ad().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const e=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler(e,new ss(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler(new ss(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:e,sw:n},r=!1,c={},d=1/0){const g=this._wrapper.offsetHeight,p=this._wrapper.offsetWidth;if(!g||!p)return;let C=Ga(c.bottom,g),S=Ga(c.left,p),x=Ga(c.right,p),O=Ga(c.top,g),R=S+x,b=C+O;R>So&&(S*=So/R,x*=So/R,R=So),b>So&&(C*=So/b,O*=So/b,b=So);const T=g*(1-b),w=p*(1-R),P=new ss(n,e),H=new tn(P.ne.latitude,P.sw.longitude),$=P.sw.distanceTo(H,dn.DEGREE,jr.MERCATOR),W=(P.ne.longitude-H.longitude+360)%360;let B=Math.max($,W*T/w)/(1-b),K=Math.max(W,$*w/T)/(1-R),X=Math.log2(p*360/K)-8;X>d&&(X=d,K=p*360/2**(X+8),B=K*g/p);const ee=P.getCenter(jr.MERCATOR),le=(O-C)/2*B,V=(x-S)/2*K;ee.add(le,V,dn.DEGREE,jr.MERCATOR),this.setZoomCenter(X,ee,r)}setCenter(e,n=!1){this._map.setCenter(new tn(e),n)}setPadding({bottom:e=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:c=this._padding.top}){return this._padding={bottom:e,left:n,right:r,top:c},this}setPanHandler(e){Sr(e,dr.FUNCTION),this._panHandler=e}setPanStartHandler(e){Sr(e,dr.FUNCTION),this._panStartHandler=e}setZoom(e,n=!1){this._map.setZoom(e,n)}setZoomCenter(e,n,r=!1){this._map.setZoomCenter(e,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(e=>this._resolveMoving=e),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(e=>this._resolveIdle=e),this._resolveMoving()}};const hc=et.createContext(null);function mN(){const t=et.useContext(hc);if(!t||t.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return t.map}const fp=({apiKey:t,bounds:e,children:n,className:r,clientKey:c,controls:d=!0,defaultCenter:g={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:C,padding:S={bottom:50,left:50,right:50,top:50},panHandler:x=()=>null,panStartHandler:O=()=>null,provider:R=cp,providerOptions:b={},singleZoom:T=14})=>{const w=et.useRef(null),[P,H]=et.useState(g),[$,W]=et.useState(!1),[B,K]=et.useState(),[X,ee]=et.useState(p),le=(V,U)=>{x(V,U),H(U.getCenter())};return et.useEffect(()=>{!$||!B||ee(B.getZoom())},[P]),et.useEffect(()=>{if(!e||!$||!B)return;const V=e.map(U=>new tn(U));B.fitCoordinates(V)},[JSON.stringify(e),B]),et.useEffect(()=>{if(!$||B)return;const V=new up().withControlEnabled(d).withDefaultCenter(P).withDefaultZoom(X).withPadding(S).withPanHandler(le).withPanStartHandler(O).withProvider(R).withProviderOptions(b).withSinglePinZoom(T).withWrapper(w.current).build();K(V),C&&(C.current=V)},[$]),et.useEffect(()=>{$||B||!w.current||R.load(t,{...b,...c&&{client:c}}).then(()=>W(!0))},[]),at.jsx("div",{className:Xs({"is-loaded":$},r),id:"map",ref:w,"data-testid":"map",children:B&&at.jsx(hc.Provider,{value:{map:B,provider:R},children:n})})},_N=({count:t})=>at.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:at.jsxs("g",{fill:"none",fillRule:"evenodd",children:[at.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),at.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:at.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:t})})]})}),cd=et.createContext(null);function yN(){const t=et.useContext(cd);if(!t)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return t}const NN=({clusterRadius:t=50,children:e,ClusterTemplate:n=_N})=>{const{map:r}=et.useContext(hc),[c,d]=et.useState([]),[g,p]=et.useState(),[C,S]=et.useState([]),[x,O]=et.useState([]);return et.useEffect(()=>{p(CN(c,r.getZoom(),t))},[c,r.getZoom()]),et.useEffect(()=>{O(()=>[]),S(()=>[]),(g==null?void 0:g.length)!==0&&(g==null||g.forEach(R=>{if(R.length===1){R[0].pin.setMap(r);return}if(R.length>1){const b=ss.fit(R.map(w=>w.pin.getCoordinate())).getCenter(jr.MERCATOR),T=`cluster-{${b._lat},${b._lon}}`;R.forEach(w=>w.pin.setMap(null)),S(w=>[...w,T]),O(w=>[...w,at.jsx(ud,{coordinate:b,id:T,onClick:()=>r.fitCoordinates(R.map(P=>P.pin.getCoordinate()),!0,1/0),children:at.jsx(n,{count:R.length})},T)])}}))},[g]),at.jsx(cd.Provider,{value:{clusters:g??[],clusterIds:C,setPinStore:d},children:at.jsxs(at.Fragment,{children:[x.map((R,b)=>at.jsx(et.Fragment,{children:R},b)),e]})})},CN=(t,e,n)=>{const r=n*Math.PI/2**(e+7),c=t.map((p,C)=>[C]),d=[];t.forEach((p,C)=>{for(let S=C;S<t.length;S++)S!==C&&new tn(p.pin.getCoordinate()).distanceTo(new tn(t[S].pin.getCoordinate()),dn.RADIAN,jr.MERCATOR)<=r&&(c[C].push(S),c[S].push(C))});let g=1;for(;g;){g=0;let p;if(c.forEach((x,O)=>{x.length>g&&(g=x.length,p=O)}),!g)break;const C=c[p??0],S=[];c[p??0]=[];for(const x of C){const O=c[x];S.push(t[x]),c[x]=[],O.forEach(R=>c[R].splice(c[R].indexOf(x),1))}d.push(S)}return d},EN=at.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),ud=({children:t,coordinate:e,hideOffscreen:n=!1,id:r,icon:c=EN,onClick:d=()=>null,onFocus:g=()=>null,onHover:p=()=>null,zIndex:C})=>{const{map:S,provider:x}=et.useContext(hc),O=et.useContext(cd),R=et.useMemo(()=>new ad().withCoordinate(e).withHideOffscreen(n).withProvider(x).build(),[]);et.useEffect(()=>{if(C!==0&&!C)return;const T=R.getProviderPin().getWrapperElement();T&&(T.style.zIndex=C.toString())},[C]),et.useEffect(()=>{R.setMap(S),R.setClickHandler(()=>d(r)),R.setFocusHandler(w=>g(w,r)),R.setHoverHandler(w=>p(w,r));const T=O==null?void 0:O.clusterIds.includes(r);return O&&!T&&O.setPinStore(w=>[...w,{pin:R,id:r}]),()=>{R.setMap(null),O&&O.setPinStore(w=>w.filter(P=>P.id!==r))}},[]);const b=t||c;if(b){const T=R.getProviderPin().getPinElement();return Object.assign(T.style,{height:"auto",width:"auto"}),nd.createPortal(b,T)}return null},TN=({children:t,coordinate:e,linkSameTab:n,pinUrl:r,onClick:c=()=>null,onHover:d=()=>null,onFocus:g=()=>null,...p})=>at.jsx(fp,{bounds:[e],...p,children:at.jsx(ud,{coordinate:e,id:"location-map-marker",onClick:c,onHover:d,onFocus:g,children:r?at.jsx(op,{href:r,target:n?"_self":"_blank",children:t}):t||void 0})});var Gc={},Bl={},Nf;function xN(){if(Nf)return Bl;Nf=1;var t=et;const e=t.createContext(null);function n(c,d){let g=null;c!=null&&(g=c[1]);function p(){return d??(g!=null?g.getTheme():null)}return{getTheme:p}}function r(){const c=t.useContext(e);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}return Bl.LexicalComposerContext=e,Bl.createLexicalComposerContext=n,Bl.useLexicalComposerContext=r,Bl}var Hl={},Cf;function SN(){if(Cf)return Hl;Cf=1;var t=et;function e(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=t.createContext(null);return Hl.LexicalComposerContext=n,Hl.createLexicalComposerContext=function(r,c){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return c??(d!=null?d.getTheme():null)}}},Hl.useLexicalComposerContext=function(){let r=t.useContext(n);return r==null&&e(8),r},Hl}var Yc,Ef;function Un(){return Ef||(Ef=1,Yc=process.env.NODE_ENV==="development"?xN():SN()),Yc}var Pe={},Tf;function vN(){if(Tf)return Pe;Tf=1;function t(u){return{type:u}}const e=t("SELECTION_CHANGE_COMMAND"),n=t("CLICK_COMMAND"),r=t("DELETE_CHARACTER_COMMAND"),c=t("INSERT_LINE_BREAK_COMMAND"),d=t("INSERT_PARAGRAPH_COMMAND"),g=t("CONTROLLED_TEXT_INSERTION_COMMAND"),p=t("PASTE_COMMAND"),C=t("REMOVE_TEXT_COMMAND"),S=t("DELETE_WORD_COMMAND"),x=t("DELETE_LINE_COMMAND"),O=t("FORMAT_TEXT_COMMAND"),R=t("UNDO_COMMAND"),b=t("REDO_COMMAND"),T=t("KEYDOWN_COMMAND"),w=t("KEY_ARROW_RIGHT_COMMAND"),P=t("MOVE_TO_END"),H=t("KEY_ARROW_LEFT_COMMAND"),$=t("MOVE_TO_START"),W=t("KEY_ARROW_UP_COMMAND"),B=t("KEY_ARROW_DOWN_COMMAND"),K=t("KEY_ENTER_COMMAND"),X=t("KEY_SPACE_COMMAND"),ee=t("KEY_BACKSPACE_COMMAND"),le=t("KEY_ESCAPE_COMMAND"),V=t("KEY_DELETE_COMMAND"),U=t("KEY_TAB_COMMAND"),q=t("INSERT_TAB_COMMAND"),me=t("INDENT_CONTENT_COMMAND"),_e=t("OUTDENT_CONTENT_COMMAND"),pe=t("DROP_COMMAND"),ue=t("FORMAT_ELEMENT_COMMAND"),z=t("DRAGSTART_COMMAND"),D=t("DRAGOVER_COMMAND"),j=t("DRAGEND_COMMAND"),ne=t("COPY_COMMAND"),Y=t("CUT_COMMAND"),G=t("SELECT_ALL_COMMAND"),Q=t("CLEAR_EDITOR_COMMAND"),k=t("CLEAR_HISTORY_COMMAND"),m=t("CAN_REDO_COMMAND"),y=t("CAN_UNDO_COMMAND"),A=t("FOCUS_COMMAND"),Z=t("BLUR_COMMAND"),ae=t("KEY_MODIFIER_COMMAND"),he=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=he&&"documentMode"in document?document.documentMode:null,Te=he&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),be=he&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ue=he&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,re=he&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),te=he&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ce=he&&/Android/.test(navigator.userAgent),we=he&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Le=he&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!we,Be=1,Ye=3,ct=0,yt=1,dt=2,Se=0,ie=1,fe=2,Oe=1,Re=2,De=4,We=8,qe=16,Qe=32,ft=64,kt=128,je=Oe|Re|De|We|qe|Qe|ft|kt,Ve=1,rt=2,_t=1,Et=2,vt=3,Ot=4,Mt=5,xt=6,Qt=" ",Ut=re||te||Le?Qt:"​",It=`
31
+ */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],c=0;c<arguments.length;c++){var d=arguments[c];if(d){var g=typeof d;if(g==="string"||g==="number")r.push(d);else if(Array.isArray(d)){if(d.length){var p=n.apply(null,d);p&&r.push(p)}}else if(g==="object"){if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]")){r.push(d.toString());continue}for(var C in d)e.call(d,C)&&d[C]&&r.push(C)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(sp);var tN=sp.exports;const Xs=id(tN),_f=t=>t.linkType==="Email"||!t.linkType&&lp(t.link)?t.link.startsWith("mailto:")?t.link:`mailto:${t.link}`:t.linkType==="Phone"?t.link.startsWith("tel:")?t.link:`tel:${t.link}`:t.link,lp=t=>t.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(t),nN=t=>"href"in t,ap=et.forwardRef(function(e,n){const r=nN(e)?{link:e.href}:e.cta,{children:c,onClick:d,className:g,eventName:p,scope:C,currency:S,amount:T,cta:O,obfuscate:R,customTags:b,customValues:x,...w}=e,$=O?"CTA_CLICK":"LINK",W=p||(O?"cta":"link"),P=tl();if(!(r!=null&&r.link))throw new Error("CTA's link is undefined");const H=R||R!==!1&&lp(r.link),B=async ee=>{const le=ee.currentTarget;let j="";if(H){ee.preventDefault();const U=le.href.split("/").at(-1);U&&(j=atob(U))}if(P!==null)try{await P.track({action:$,scope:e.scope,eventName:W,currency:S,amount:T,destinationUrl:j||le.href,customTags:b,customValues:x})}catch{console.error("Failed to report click Analytics Event")}d&&d(ee),j&&(window.location.href=j)},z=H?"Obfuscated, set a label or child":r.link,X={className:Xs("Link",g),href:H?btoa(_f(r)):_f(r),onClick:B,rel:e.target&&!e.rel?"noopener":void 0,ref:n};return P!=null&&P.getDebugEnabled()&&(X["data-ya-action"]=$,X["data-ya-scopeoverride"]=C,X["data-ya-eventname"]=W),at.jsx("a",{...X,...w,suppressHydrationWarning:!0,children:c||r.label||z})}),rN={URL:"URL",Email:"Email",Phone:"Phone"},dn=Object.freeze({DEGREE:Symbol("deg"),KILOMETER:Symbol("km"),MILE:Symbol("mi"),RADIAN:Symbol("r")}),jr=Object.freeze({MERCATOR:Symbol("mercator"),SPHERICAL:Symbol("spherical")}),Uc=3959,Gc=6371,iN=["latitude","lat"],oN=["longitude","lon","lng","long"];function yf(t,e){for(const n of e)if(t[n]||t[n]===0)return t[n]}function Nf(t){switch(typeof t){case"string":case"number":const e=Number.parseFloat(t);if(Number.isNaN(e))throw new Error(`'${t}' must be convertible to a Number'`);return e;default:throw new Error(`typeof '${t}' must be a number or a string that can be converted to a number, is '${typeof t}'`)}}function as(t){return t*Math.PI/180}function Ji(t){return t/Math.PI*180}function sN(t,e){const n=as(t.latitude),r=as(e.latitude),c=r-n,d=as(e.longitude-t.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 lN(t,e){const n=Math.tan(Math.PI/360*(t+90)),r=Math.tan(Math.PI/360*(e+90));return Math.log(r/n)}function aN(t,e){const r=Math.tan(Math.PI/360*(t+90))*Math.pow(Math.E,e);return Math.atan(r)*360/Math.PI-90}class tn{constructor(e,n){let r=e;typeof e=="object"&&(r=yf(e,iN),n=yf(e,oN),r=typeof r=="function"?r():r,n=typeof n=="function"?n():n),this.latitude=r,this.longitude=n}get latitude(){return this._lat}get longitude(){return this._lon}get normalLon(){return((this._lon+180)%360+360)%360-180}set latitude(e){this._lat=Math.max(-90,Math.min(Nf(e),90))}set longitude(e){this._lon=Nf(e)}add(e,n,r=dn.DEGREE,c=jr.SPHERICAL){if(c===jr.MERCATOR&&(r===dn.DEGREE||r===dn.RADIAN)){const d=r===dn.DEGREE?as(e):e,g=r===dn.DEGREE?n:Ji(n);this.latitude=aN(this.latitude,d),this.longitude+=g}else switch(r){case dn.DEGREE:this.latitude+=e,this.longitude+=n;break;case dn.KILOMETER:this.latitude+=Ji(e)*Gc,this.longitude+=Ji(n)*Gc*Math.cos(as(this.latitude));break;case dn.MILE:this.latitude+=Ji(e)*Uc,this.longitude+=Ji(n)*Uc*Math.cos(as(this.latitude));break;case dn.RADIAN:this.latitude+=Ji(e),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${r}`)}}distanceTo(e,n=dn.MILE,r=jr.SPHERICAL){if(r===jr.MERCATOR&&(n===dn.DEGREE||n===dn.RADIAN)){const c=lN(this.latitude,e.latitude),d=Math.abs(e.normalLon-this.normalLon),g=as(Math.min(d,360-d)),p=Math.sqrt(Math.pow(c,2)+Math.pow(g,2));switch(n){case dn.DEGREE:return Ji(p);case dn.RADIAN:return p;default:throw new Error(`unit unhandled: ${n}`)}}else{const c=sN(this,e);switch(n){case dn.DEGREE:return Ji(c);case dn.KILOMETER:return c*Gc;case dn.MILE:return c*Uc;case dn.RADIAN:return c;default:throw new Error(`unit unhandled: ${n}`)}}}equals(e){return e&&e.latitude===this.latitude&&e.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function cp(t,e=()=>null){const n=document.createElement("script");n.async=!0,n.onload=e,n.src=t,document.head.appendChild(n)}const dr={UNDEFINED:"undefined",NULL:"object",BOOLEAN:"boolean",NUMBER:"number",BIGINT:"bigint",STRING:"string",SYMBOL:"symbol",FUNCTION:"function",OBJECT:"object"};function Sr(t,e){if(typeof t!==e)throw new Error(`Expected an object of type '${e}' but received '${typeof t}'`)}function fr(t,e){let n;try{n=t instanceof e}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${e.name}' but received '${t.constructor.name}'`)}class up{constructor(e,n){fr(e,fs),fr(n,HTMLElement),this.providerMapClass=e.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(e){return this.controlEnabled=e,this}withPanHandler(e){return Sr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return Sr(e,dr.FUNCTION),this.panStartHandler=e,this}withProviderOptions(e){return this.providerOptions=e,this}build(){const e=this.providerMapClass;return new e(this)}}class nl{constructor(e){fr(e,up),this._panHandler=e.panHandler,this._panStartHandler=e.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(e,n){throw new Error("not implemented")}setZoom(e,n){throw new Error("not implemented")}setZoomCenter(e,n,r){this.setZoom(e,r),this.setCenter(n,r)}}class dp{constructor(e){fr(e,fs),this.providerPinClass=e.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={}}withClickHandler(e){return Sr(e,dr.FUNCTION),this.clickHandler=e,this}withFocusHandler(e){return Sr(e,dr.FUNCTION),this.focusHandler=e,this}withHoverHandler(e){return Sr(e,dr.FUNCTION),this.hoverHandler=e,this}withIcons(e){return this.icons=e,this}build(){const e=this.providerPinClass;return new e(this)}}class ad{constructor(e){fr(e,dp),this._clickHandler=e.clickHandler,this._focusHandler=e.focusHandler,this._hoverHandler=e.hoverHandler,this._icons=e.icons}setCoordinate(e){throw new Error("not implemented")}setMap(e,n){throw new Error("not implemented")}setProperties(e){throw new Error("not implemented")}}const cN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class hc extends ad{static get baseStyle(){return cN}constructor(e){super(e),this._pinEl=document.createElement("button"),Object.assign(this._pinEl.style,this.constructor.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()}addListeners(){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(e){this.setElementProperties(e);const n=e.getClass(),r=e.getElement()||this._pinEl,c=e.getZIndex();r.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=c,this._wrapper.setAttribute("class",n),r!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(r)))}setElementProperties(e){const n=e.getAnchorX(),r=e.getAnchorY(),c=e.getHeight(),d=this._icons[e.getIcon()],g=e.getSRText(),p=e.getWidth();Object.assign(this._pinEl.style,{backgroundImage:d?`url("${d}")`:"",height:c+"px",transform:`translate(${-100*n}%, ${-100*r}%)`,width:p+"px"}),this._pinAlt.innerText=g}}class ds{constructor(){this.loadFunction=(e,n,r,c)=>e(),this.mapClass=nl,this.pinClass=ad,this.providerName=""}withLoadFunction(e){return Sr(e,dr.FUNCTION),this.loadFunction=e,this}withMapClass(e){return this.mapClass=e,this}withPinClass(e){return this.pinClass=e,this}withProviderName(e){return this.providerName=e,this}build(){return new fs(this)}}class fs{constructor(e){fr(e,ds),this._loadFunction=e.loadFunction,this._mapClass=e.mapClass,this._pinClass=e.pinClass,this._providerName=e.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(e=this._apiKey,n=this._options){this._loadInvoked||(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,e,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(e,n=null){this._loadInvoked||(this._apiKey=e,this._options=n||this._options)}}const Cf={GEOCODER:"geocoder",PLACES:"places"};class uN extends nl{constructor(e){super(e),this.map=new google.maps.Map(e.wrapper,{disableDefaultUI:!e.controlEnabled,fullscreenControl:!1,gestureHandling:e.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:e.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...e.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(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new google.maps.LatLng(e.latitude,e.longitude);n?this.map.panTo(r):this.map.setCenter(r)}setZoom(e,n){this.map.setZoom(Math.floor(e))}setZoomCenter(e,n,r){this.setCenter(n,r),this.setZoom(e,r)}}class dN extends hc{constructor(e){super(e),this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper);const n=this;class r extends google.maps.OverlayView{draw(){var g;const d=(g=this.getProjection())==null?void 0:g.fromLatLngToDivPixel(n._latLng);d&&(n._wrapper.style.left=d.x+"px",n._wrapper.style.top=d.y+"px")}onAdd(){this.getPanes().floatPane.appendChild(n._wrapper)}onRemove(){var d;(d=n._wrapper.parentNode)==null||d.removeChild(n._wrapper)}}this.pin=new r}setCoordinate(e){this._latLng=new google.maps.LatLng(e.latitude,e.longitude),this.pin.draw()}setMap(e,n){this.pin.setMap(e?e.getProviderMap().map:null)}}const Ef="GoogleMapsCallback_b7d77ff2",fN="https://maps.googleapis.com/maps/api/js";function hN(t,e,n,{autocomplete:r=!1,channel:c=window.location.hostname,client:d,language:g,region:p,libraries:C=[],loading:S="async",params:T={}}={}){window[Ef]=t,r&&C.push(Cf.GEOCODER,Cf.PLACES);const O={callback:Ef,channel:c,libraries:C.join(","),...T};n&&(O.key=n),d&&(O.client=d),g&&(O.language=g),p&&(O.region=p),S&&(O.loading=S),cp(fN+"?"+Object.entries(O).map(([R,b])=>R+"="+b).join("&"))}const fp=new ds().withLoadFunction(hN).withMapClass(uN).withPinClass(dN).withProviderName("Google").build();class ss{static fit(e){const n=e.map(S=>S.latitude),r=Math.max(...n),c=Math.min(...n),d=e.map(S=>S.normalLon).sort((S,T)=>S-T),g=d.map((S,T)=>({distance:(T<d.length-1?d[T+1]:d[0]+360)-S,index:T})).reduce((S,T)=>T.distance>S.distance?T:S).index,p=d[g],C=d[(g+1)%d.length];return new this(new tn(c,C),new tn(r,p))}constructor(e,n){this._ne=new tn(n),this._sw=new tn(e)}get ne(){return this._ne}get sw(){return this._sw}set ne(e){this._ne=new tn(e)}set sw(e){this._sw=new tn(e)}contains(e){const n=this._sw.latitude<=e.latitude&&e.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,c=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=e.normalLon&&e.normalLon<=this._ne.normalLon:this._sw.normalLon<=e.normalLon||e.normalLon<=this._ne.normalLon;return n&&(r||c)}extend(e){if(this._ne.latitude=Math.max(this._ne.latitude,e.latitude),this._sw.latitude=Math.min(this._sw.latitude,e.latitude),!this.contains(e)){const n=((e.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-e.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(e=jr.SPHERICAL){const n=new tn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,dn.DEGREE,e),c=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,dn.DEGREE,e),n.longitude=c,n}}class gN{constructor(){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(e){return this._anchorX=e,this}setAnchorY(e){return this._anchorY=e,this}setClass(e){return this._class=e,this}setElement(e){return this._element=e,this}setHeight(e){return this._height=e,this}setIcon(e){return this._icon=e,this}setSRText(e){return this._srText=e,this}setWidth(e){return this._width=e,this}setZIndex(e){return this._zIndex=e,this}}class cd{constructor(){this.coordinate=new tn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=e=>new gN,this.provider=null,this.type=""}withCoordinate(e){return this.coordinate=new tn(e),this}withHideOffscreen(e){return this.hideOffscreen=e,this}withIcon(e,n){return this.icons[e]=n,this}withPropertiesForStatus(e){return Sr(e,dr.FUNCTION),this.propertiesForStatus=e,this}withProvider(e){return fr(e,fs),this.provider=e,this}withType(e){return this.type=e,this}build(){return new pN(this)}}class pN{constructor(e){if(fr(e,cd),fr(e.provider,fs),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=e.coordinate,this._hideOffscreen=e.hideOffscreen,this._icons={...e.icons},this._propertiesForStatus=e.propertiesForStatus,this._type=e.type,this._clickHandler=()=>null,this._focusHandler=n=>this._hoverHandler(n),this._hoverHandler=n=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new dp(e.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(n=>this._focusHandler(n)).withHoverHandler(n=>this._hoverHandler(n)).build(),this._pin.setCoordinate(e.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(e){return this._icons[e]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(e){Sr(e,dr.FUNCTION),this._clickHandler=e}setCoordinate(e){this._coordinate=new tn(e),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(e){Sr(e,dr.FUNCTION),this._focusHandler=e}setHoverHandler(e){Sr(e,dr.FUNCTION),this._hoverHandler=e}setMap(e){if(e!==this._map&&(e!==null&&fr(e,gp),this._pin.setMap(e,this._hidden?null:this._map),this._map=e,this._hidden=!1,this._cancelHiddenUpdater(),e&&this._hideOffscreen)){let n=!1;const r=new Promise(c=>{this._cancelHiddenUpdater=()=>{n=!0,c()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,e.moving()]),await Promise.race([r,e.idle()])})()}}setStatus(e){Object.assign(this._status,e),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const e=this._map.getBounds().contains(this._coordinate);this._hidden&&e?this._pin.setMap(this._map,null):!this._hidden&&!e&&this._pin.setMap(null,this._map),this._hidden=!e}}}const So=.98;function Ga(t,e){return Math.max(typeof t==dr.FUNCTION?t():t||0,0)/e}class hp{constructor(){this.controlEnabled=!0,this.defaultCenter=new tn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(e,n)=>null,this.panStartHandler=e=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(e){return this.controlEnabled=e,this}withDefaultCenter(e){return this.defaultCenter=new tn(e),this}withDefaultZoom(e){return this.defaultZoom=e,this}withLegendPins(e){return this.legendPins=Array.from(e),this}withPadding(e){return this.padding=e,this}withPanHandler(e){return Sr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return Sr(e,dr.FUNCTION),this.panStartHandler=e,this}withProvider(e){return fr(e,fs),this.provider=e,this}withProviderOptions(e){return this.providerOptions=e,this}withSinglePinZoom(e){return this.singlePinZoom=e,this}withWrapper(e){return fr(e,HTMLElement),this.wrapper=e,this}build(){return new gp(this)}}let gp=class{constructor(e){if(fr(e,hp),fr(e.provider,fs),fr(e.wrapper,HTMLElement),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=e.defaultCenter,this._defaultZoom=e.defaultZoom,this._legendPins=e.legendPins,this._provider=e.provider,this._singlePinZoom=e.singlePinZoom,this._wrapper=e.wrapper,this._padding={},this.setPadding(e.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(e.panHandler),this.setPanStartHandler(e.panStartHandler);this._wrapper.firstChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new up(e.provider,this._wrapper).withControlEnabled(e.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(e.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(e,n=!1,r=this._singlePinZoom){e.length?this.setBounds(ss.fit(e),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){if(!this._cachedBounds){const e=this._wrapper.offsetHeight,n=this._wrapper.offsetWidth,r=this.getZoom(),c=this.getCenter(),d=360/Math.pow(2,r+8),g=n*d,p=e*d;this._cachedBounds=new ss(c,c),this._cachedBounds.ne.add(p/2,g/2,dn.DEGREE,jr.MERCATOR),this._cachedBounds.sw.add(-p/2,-g/2,dn.DEGREE,jr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new ss(this._cachedBounds.sw,this._cachedBounds.ne)}getCenter(){return this._map.getCenter()}getProviderMap(){return this._map}getZoom(){return this._map.getZoom()}async idle(){await this._idlePromise}async moving(){await this._movingPromise}newPinOptions(){return new cd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const e=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler(e,new ss(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler(new ss(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:e,sw:n},r=!1,c={},d=1/0){const g=this._wrapper.offsetHeight,p=this._wrapper.offsetWidth;if(!g||!p)return;let C=Ga(c.bottom,g),S=Ga(c.left,p),T=Ga(c.right,p),O=Ga(c.top,g),R=S+T,b=C+O;R>So&&(S*=So/R,T*=So/R,R=So),b>So&&(C*=So/b,O*=So/b,b=So);const x=g*(1-b),w=p*(1-R),$=new ss(n,e),W=new tn($.ne.latitude,$.sw.longitude),P=$.sw.distanceTo(W,dn.DEGREE,jr.MERCATOR),H=($.ne.longitude-W.longitude+360)%360;let B=Math.max(P,H*x/w)/(1-b),z=Math.max(H,P*w/x)/(1-R),X=Math.log2(p*360/z)-8;X>d&&(X=d,z=p*360/2**(X+8),B=z*g/p);const ee=$.getCenter(jr.MERCATOR),le=(O-C)/2*B,j=(T-S)/2*z;ee.add(le,j,dn.DEGREE,jr.MERCATOR),this.setZoomCenter(X,ee,r)}setCenter(e,n=!1){this._map.setCenter(new tn(e),n)}setPadding({bottom:e=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:c=this._padding.top}){return this._padding={bottom:e,left:n,right:r,top:c},this}setPanHandler(e){Sr(e,dr.FUNCTION),this._panHandler=e}setPanStartHandler(e){Sr(e,dr.FUNCTION),this._panStartHandler=e}setZoom(e,n=!1){this._map.setZoom(e,n)}setZoomCenter(e,n,r=!1){this._map.setZoomCenter(e,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(e=>this._resolveMoving=e),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(e=>this._resolveIdle=e),this._resolveMoving()}};const gc=et.createContext(null);function mN(){const t=et.useContext(gc);if(!t||t.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return t.map}const pp=({apiKey:t,bounds:e,children:n,className:r,clientKey:c,controls:d=!0,defaultCenter:g={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:C,padding:S={bottom:50,left:50,right:50,top:50},panHandler:T=()=>null,panStartHandler:O=()=>null,provider:R=fp,providerOptions:b={},singleZoom:x=14})=>{const w=et.useRef(null),[$,W]=et.useState(g),[P,H]=et.useState(!1),[B,z]=et.useState(),[X,ee]=et.useState(p),le=(j,U)=>{T(j,U),W(U.getCenter())};return et.useEffect(()=>{!P||!B||ee(B.getZoom())},[$]),et.useEffect(()=>{if(!e||!P||!B)return;const j=e.map(U=>new tn(U));B.fitCoordinates(j)},[JSON.stringify(e),B]),et.useEffect(()=>{if(!P||B)return;const j=new hp().withControlEnabled(d).withDefaultCenter($).withDefaultZoom(X).withPadding(S).withPanHandler(le).withPanStartHandler(O).withProvider(R).withProviderOptions(b).withSinglePinZoom(x).withWrapper(w.current).build();z(j),C&&(C.current=j)},[P]),et.useEffect(()=>{P||B||!w.current||R.load(t,{...b,...c&&{client:c}}).then(()=>H(!0))},[]),at.jsx("div",{className:Xs({"is-loaded":P},r),id:"map",ref:w,"data-testid":"map",children:B&&at.jsx(gc.Provider,{value:{map:B,provider:R},children:n})})},_N=({count:t})=>at.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:at.jsxs("g",{fill:"none",fillRule:"evenodd",children:[at.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),at.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:at.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:t})})]})}),ud=et.createContext(null);function yN(){const t=et.useContext(ud);if(!t)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return t}const NN=({clusterRadius:t=50,children:e,ClusterTemplate:n=_N})=>{const{map:r}=et.useContext(gc),[c,d]=et.useState([]),[g,p]=et.useState(),[C,S]=et.useState([]),[T,O]=et.useState([]);return et.useEffect(()=>{p(CN(c,r.getZoom(),t))},[c,r.getZoom()]),et.useEffect(()=>{O(()=>[]),S(()=>[]),(g==null?void 0:g.length)!==0&&(g==null||g.forEach(R=>{if(R.length===1){R[0].pin.setMap(r);return}if(R.length>1){const b=ss.fit(R.map(w=>w.pin.getCoordinate())).getCenter(jr.MERCATOR),x=`cluster-{${b._lat},${b._lon}}`;R.forEach(w=>w.pin.setMap(null)),S(w=>[...w,x]),O(w=>[...w,at.jsx(dd,{coordinate:b,id:x,onClick:()=>r.fitCoordinates(R.map($=>$.pin.getCoordinate()),!0,1/0),children:at.jsx(n,{count:R.length})},x)])}}))},[g]),at.jsx(ud.Provider,{value:{clusters:g??[],clusterIds:C,setPinStore:d},children:at.jsxs(at.Fragment,{children:[T.map((R,b)=>at.jsx(et.Fragment,{children:R},b)),e]})})},CN=(t,e,n)=>{const r=n*Math.PI/2**(e+7),c=t.map((p,C)=>[C]),d=[];t.forEach((p,C)=>{for(let S=C;S<t.length;S++)S!==C&&new tn(p.pin.getCoordinate()).distanceTo(new tn(t[S].pin.getCoordinate()),dn.RADIAN,jr.MERCATOR)<=r&&(c[C].push(S),c[S].push(C))});let g=1;for(;g;){g=0;let p;if(c.forEach((T,O)=>{T.length>g&&(g=T.length,p=O)}),!g)break;const C=c[p??0],S=[];c[p??0]=[];for(const T of C){const O=c[T];S.push(t[T]),c[T]=[],O.forEach(R=>c[R].splice(c[R].indexOf(T),1))}d.push(S)}return d},EN=at.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),dd=({children:t,coordinate:e,hideOffscreen:n=!1,id:r,icon:c=EN,onClick:d=()=>null,onFocus:g=()=>null,onHover:p=()=>null,zIndex:C})=>{const{map:S,provider:T}=et.useContext(gc),O=et.useContext(ud),R=et.useMemo(()=>new cd().withCoordinate(e).withHideOffscreen(n).withProvider(T).build(),[]);et.useEffect(()=>{if(C!==0&&!C)return;const x=R.getProviderPin().getWrapperElement();x&&(x.style.zIndex=C.toString())},[C]),et.useEffect(()=>{R.setMap(S),R.setClickHandler(()=>d(r)),R.setFocusHandler(w=>g(w,r)),R.setHoverHandler(w=>p(w,r));const x=O==null?void 0:O.clusterIds.includes(r);return O&&!x&&O.setPinStore(w=>[...w,{pin:R,id:r}]),()=>{R.setMap(null),O&&O.setPinStore(w=>w.filter($=>$.id!==r))}},[]);const b=t||c;if(b){const x=R.getProviderPin().getPinElement();return Object.assign(x.style,{height:"auto",width:"auto"}),rd.createPortal(b,x)}return null},TN=({children:t,coordinate:e,linkSameTab:n,pinUrl:r,onClick:c=()=>null,onHover:d=()=>null,onFocus:g=()=>null,...p})=>at.jsx(pp,{bounds:[e],...p,children:at.jsx(dd,{coordinate:e,id:"location-map-marker",onClick:c,onHover:d,onFocus:g,children:r?at.jsx(ap,{href:r,target:n?"_self":"_blank",children:t}):t||void 0})});var Yc={},Bl={},Tf;function xN(){if(Tf)return Bl;Tf=1;var t=et;const e=t.createContext(null);function n(c,d){let g=null;c!=null&&(g=c[1]);function p(){return d??(g!=null?g.getTheme():null)}return{getTheme:p}}function r(){const c=t.useContext(e);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}return Bl.LexicalComposerContext=e,Bl.createLexicalComposerContext=n,Bl.useLexicalComposerContext=r,Bl}var Hl={},xf;function SN(){if(xf)return Hl;xf=1;var t=et;function e(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=t.createContext(null);return Hl.LexicalComposerContext=n,Hl.createLexicalComposerContext=function(r,c){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return c??(d!=null?d.getTheme():null)}}},Hl.useLexicalComposerContext=function(){let r=t.useContext(n);return r==null&&e(8),r},Hl}var jc,Sf;function Un(){return Sf||(Sf=1,jc=process.env.NODE_ENV==="development"?xN():SN()),jc}var Pe={},vf;function vN(){if(vf)return Pe;vf=1;function t(u){return{type:u}}const e=t("SELECTION_CHANGE_COMMAND"),n=t("CLICK_COMMAND"),r=t("DELETE_CHARACTER_COMMAND"),c=t("INSERT_LINE_BREAK_COMMAND"),d=t("INSERT_PARAGRAPH_COMMAND"),g=t("CONTROLLED_TEXT_INSERTION_COMMAND"),p=t("PASTE_COMMAND"),C=t("REMOVE_TEXT_COMMAND"),S=t("DELETE_WORD_COMMAND"),T=t("DELETE_LINE_COMMAND"),O=t("FORMAT_TEXT_COMMAND"),R=t("UNDO_COMMAND"),b=t("REDO_COMMAND"),x=t("KEYDOWN_COMMAND"),w=t("KEY_ARROW_RIGHT_COMMAND"),$=t("MOVE_TO_END"),W=t("KEY_ARROW_LEFT_COMMAND"),P=t("MOVE_TO_START"),H=t("KEY_ARROW_UP_COMMAND"),B=t("KEY_ARROW_DOWN_COMMAND"),z=t("KEY_ENTER_COMMAND"),X=t("KEY_SPACE_COMMAND"),ee=t("KEY_BACKSPACE_COMMAND"),le=t("KEY_ESCAPE_COMMAND"),j=t("KEY_DELETE_COMMAND"),U=t("KEY_TAB_COMMAND"),q=t("INSERT_TAB_COMMAND"),me=t("INDENT_CONTENT_COMMAND"),_e=t("OUTDENT_CONTENT_COMMAND"),pe=t("DROP_COMMAND"),ue=t("FORMAT_ELEMENT_COMMAND"),K=t("DRAGSTART_COMMAND"),D=t("DRAGOVER_COMMAND"),V=t("DRAGEND_COMMAND"),ne=t("COPY_COMMAND"),Y=t("CUT_COMMAND"),G=t("SELECT_ALL_COMMAND"),Q=t("CLEAR_EDITOR_COMMAND"),k=t("CLEAR_HISTORY_COMMAND"),m=t("CAN_REDO_COMMAND"),y=t("CAN_UNDO_COMMAND"),A=t("FOCUS_COMMAND"),Z=t("BLUR_COMMAND"),ae=t("KEY_MODIFIER_COMMAND"),he=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=he&&"documentMode"in document?document.documentMode:null,Te=he&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),be=he&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ue=he&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,re=he&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),te=he&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ce=he&&/Android/.test(navigator.userAgent),we=he&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Le=he&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!we,Be=1,Ye=3,ct=0,yt=1,dt=2,Se=0,ie=1,fe=2,Oe=1,Re=2,De=4,We=8,qe=16,Qe=32,ft=64,kt=128,je=Oe|Re|De|We|qe|Qe|ft|kt,Ve=1,rt=2,_t=1,Et=2,vt=3,Ot=4,Mt=5,xt=6,Qt=" ",Ut=re||te||Le?Qt:"​",It=`
32
32
 
33
- `,hr=be?Qt:Ut,vr="֑-߿יִ-﷽ﹰ-ﻼ",Fi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",gs=new RegExp("^[^"+Fi+"]*["+vr+"]"),ps=new RegExp("^[^"+vr+"]*["+Fi+"]"),fn={bold:Oe,code:qe,highlight:kt,italic:Re,strikethrough:De,subscript:Qe,superscript:ft,underline:We},gr={directionless:Ve,unmergeable:rt},Jr={center:Et,end:xt,justify:Ot,left:_t,right:vt,start:Mt},ms={[Et]:"center",[xt]:"end",[Ot]:"justify",[_t]:"left",[vt]:"right",[Mt]:"start"},ye={normal:Se,segmented:fe,token:ie},Ge={[Se]:"normal",[fe]:"segmented",[ie]:"token"},nt=100;let Nt=!1,Ht=0;function Kt(){return Nt}function $t(u){Ht=u.timeStamp}function Pt(u){Ht===0&&Wi(u).addEventListener("textInput",$t,!0)}function mn(u,o,a){return o.__lexicalLineBreak===u||u[`__lexicalKey_${a._key}`]!==void 0}function sn(u){return u.getEditorState().read(()=>{const o=cn();return o!==null?o.clone():null})}function nn(u,o,a){const f=_r(a._window);let _=null,E=null;f!==null&&f.anchorNode===u&&(_=f.anchorOffset,E=f.focusOffset);const I=u.nodeValue;I!==null&&Po(o,I,_,E,!1)}function $n(u,o,a){if(pt(u)){const f=u.anchor.getNode();if(f.is(a)&&u.format!==f.getFormat())return!1}return o.nodeType===Ye&&a.isAttached()}function pr(u,o,a){Nt=!0;const f=performance.now()-Ht>nt;try{Rr(u,()=>{const _=cn()||sn(u),E=new Map,I=u.getRootElement(),F=u._editorState,oe=u._blockCursorElement;let de=!1,Ne="";for(let xe=0;xe<o.length;xe++){const Ce=o[xe],He=Ce.type,Ie=Ce.target;let Ae=mr(Ie,F);if(!(Ae===null&&Ie!==I||vn(Ae))){if(He==="characterData")f&&gt(Ae)&&$n(_,Ie,Ae)&&nn(Ie,Ae,u);else if(He==="childList"){de=!0;const mt=Ce.addedNodes;for(let Ft=0;Ft<mt.length;Ft++){const Rt=mt[Ft],Ct=Ni(Rt),St=Rt.parentNode;if(St!=null&&Rt!==oe&&Ct===null&&(Rt.nodeName!=="BR"||!mn(Rt,St,u))){if(be){const Wt=Rt.innerText||Rt.nodeValue;Wt&&(Ne+=Wt)}St.removeChild(Rt)}}const ze=Ce.removedNodes,tt=ze.length;if(tt>0){let Ft=0;for(let Rt=0;Rt<tt;Rt++){const Ct=ze[Rt];(Ct.nodeName==="BR"&&mn(Ct,Ie,u)||oe===Ct)&&(Ie.appendChild(Ct),Ft++)}tt!==Ft&&(Ie===I&&(Ae=Ci(F)),E.set(Ie,Ae))}}}}if(E.size>0)for(const[xe,Ce]of E)if(Je(Ce)){const He=Ce.getChildrenKeys();let Ie=xe.firstChild;for(let Ae=0;Ae<He.length;Ae++){const mt=He[Ae],ze=u.getElementByKey(mt);ze!==null&&(Ie==null?(xe.appendChild(ze),Ie=ze):Ie!==ze&&xe.replaceChild(ze,Ie),Ie=Ie.nextSibling)}}else gt(Ce)&&Ce.markDirty();const Ee=a.takeRecords();if(Ee.length>0){for(let xe=0;xe<Ee.length;xe++){const Ce=Ee[xe],He=Ce.addedNodes,Ie=Ce.target;for(let Ae=0;Ae<He.length;Ae++){const mt=He[Ae],ze=mt.parentNode;ze!=null&&mt.nodeName==="BR"&&!mn(mt,Ie,u)&&ze.removeChild(mt)}}a.takeRecords()}_!==null&&(de&&(_.dirty=!0,Or(_)),be&&Ea(u)&&_.insertRawText(Ne))})}finally{Nt=!1}}function mi(u){const o=u._observer;if(o!==null){const a=o.takeRecords();pr(u,a,o)}}function qn(u){Pt(u),u._observer=new MutationObserver((o,a)=>{pr(u,o,a)})}function cl(u,o){const a=u.__mode,f=u.__format,_=u.__style,E=o.__mode,I=o.__format,F=o.__style;return(a===null||a===E)&&(f===null||f===I)&&(_===null||_===F)}function Xr(u,o){const a=u.mergeWithSibling(o),f=gn()._normalizedNodes;return f.add(u.__key),f.add(o.__key),a}function ul(u){let o=u;if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable()){o.remove();return}let a;for(;(a=o.getPreviousSibling())!==null&&gt(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else if(cl(a,o)){o=Xr(a,o);break}else break;let f;for(;(f=o.getNextSibling())!==null&&gt(f)&&f.isSimpleText()&&!f.isUnmergeable();)if(f.__text==="")f.remove();else if(cl(o,f)){o=Xr(o,f);break}else break}function Bi(u){return _s(u.anchor),_s(u.focus),u}function _s(u){for(;u.type==="element";){const o=u.getNode(),a=u.offset;let f,_;if(a===o.getChildrenSize()?(f=o.getChildAtIndex(a-1),_=!0):(f=o.getChildAtIndex(a),_=!1),gt(f)){u.set(f.__key,_?f.getTextContentSize():0,"text");break}else if(!Je(f))break;u.set(f.__key,_?f.getChildrenSize():0,"element")}}let dl=1;function fl(){return""+dl++}function kr(u,o){const a=u._nodes.get(o);if(a===void 0)throw Error(`registeredNode: Type ${o} not found`);return a}const ys=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function Tc(u){return vn(mr(u))}function io(u){const o=document.activeElement;if(o===null)return!1;const a=o.nodeName;return vn(mr(u))&&(a==="INPUT"||a==="TEXTAREA"||o.contentEditable==="true"&&o.__lexicalEditor==null)}function Qr(u,o,a){const f=u.getRootElement();try{return f!==null&&f.contains(o)&&f.contains(a)&&o!==null&&!io(o)&&Lo(o)===u}catch{return!1}}function Lo(u){let o=u;for(;o!=null;){const a=o.__lexicalEditor;if(a!=null)return a;o=ws(o)}return null}function sa(u){return gs.test(u)?"rtl":ps.test(u)?"ltr":null}function hl(u){return u.isToken()||u.isSegmented()}function On(u){return u.nodeType===Ye}function Ln(u){let o=u;for(;o!=null;){if(On(o))return o;o=o.firstChild}return null}function wr(u,o,a){const f=fn[o];if(a!==null&&(u&f)===(a&f))return u;let _=u^f;return o==="subscript"?_&=~fn.superscript:o==="superscript"&&(_&=~fn.subscript),_}function _i(u){return gt(u)||Di(u)||vn(u)}function Fn(u,o){if(o!=null){u.__key=o;return}nr(),Gd();const a=gn(),f=bi(),_=fl();f._nodeMap.set(_,u),Je(u)?a._dirtyElements.set(_,!0):a._dirtyLeaves.add(_),a._cloneNotNeeded.add(_),a._dirtyType=yt,u.__key=_}function ko(u,o,a){let f=u;for(;f!==null;){if(a.has(f))return;const _=o.get(f);if(_===void 0)break;a.set(f,!1),f=_.__parent}}function yi(u){const o=u.getParent();if(o!==null){const a=u.getWritable(),f=o.getWritable(),_=u.getPreviousSibling(),E=u.getNextSibling();if(_===null)if(E!==null){const I=E.getWritable();f.__first=E.__key,I.__prev=null}else f.__first=null;else{const I=_.getWritable();if(E!==null){const F=E.getWritable();F.__prev=I.__key,I.__next=F.__key}else I.__next=null;a.__prev=null}if(E===null)if(_!==null){const I=_.getWritable();f.__last=_.__key,I.__next=null}else f.__last=null;else{const I=E.getWritable();if(_!==null){const F=_.getWritable();F.__next=I.__key,I.__prev=F.__key}else I.__prev=null;a.__next=null}f.__size--,a.__parent=null}}function oo(u){Gd();const o=u.getLatest(),a=o.__parent,f=bi(),_=gn(),E=f._nodeMap,I=_._dirtyElements;a!==null&&ko(a,E,I);const F=o.__key;_._dirtyType=yt,Je(u)?I.set(F,!0):_._dirtyLeaves.add(F)}function Ns(u){const o=u.getPreviousSibling(),a=u.getNextSibling();o!==null&&oo(o),a!==null&&oo(a)}function _n(u){nr();const o=gn(),a=o._compositionKey;if(u!==a){if(o._compositionKey=u,a!==null){const f=En(a);f!==null&&f.getWritable()}if(u!==null){const f=En(u);f!==null&&f.getWritable()}}}function Ir(){return Hs()?null:gn()._compositionKey}function En(u,o){const f=(o||bi())._nodeMap.get(u);return f===void 0?null:f}function Ni(u,o){const a=gn(),f=u[`__lexicalKey_${a._key}`];return f!==void 0?En(f,o):null}function mr(u,o){let a=u;for(;a!=null;){const f=Ni(a,o);if(f!==null)return f;a=ws(a)}return null}function Cs(u){const o=u._decorators,a=Object.assign({},o);return u._pendingDecorators=a,a}function so(u){return u.read(()=>Zn().getTextContent())}function Es(u,o){Rr(u,()=>{const a=bi();if(a.isEmpty())return;if(o==="root"){Zn().markDirty();return}const f=a._nodeMap;for(const[,_]of f)_.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Zn(){return Ci(bi())}function Ci(u){return u._nodeMap.get("root")}function Or(u){nr();const o=bi();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)}o._selection=u}function la(){nr();const u=gn();mi(u)}function ei(u){const o=gn(),a=aa(u,o);if(a===null){const f=o.getRootElement();return u===f?En("root"):null}return En(a)}function Ts(u,o){return o?u.getTextContentSize():0}function aa(u,o){let a=u;for(;a!=null;){const f=a[`__lexicalKey_${o._key}`];if(f!==void 0)return f;a=ws(a)}return null}function gl(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function xs(u){const o=[];let a=u;for(;a!==null;)o.push(a),a=a._parentEditor;return o}function Io(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function lo(u){return u.nodeType===Ye?u.nodeValue:null}function Ss(u,o,a){const f=_r(o._window);if(f===null)return;const _=f.anchorNode;let{anchorOffset:E,focusOffset:I}=f;if(_!==null){let F=lo(_);const oe=mr(_);if(F!==null&&gt(oe)){if(F===Ut&&a){const de=a.length;F=a,E=de,I=de}F!==null&&Po(oe,F,E,I,u)}}}function Po(u,o,a,f,_){let E=u;if(E.isAttached()&&(_||!E.isDirty())){const I=E.isComposing();let F=o;(I||_)&&o[o.length-1]===Ut&&(F=o.slice(0,-1));const oe=E.getTextContent();if(_||F!==oe){if(F===""){if(_n(null),!re&&!te&&!Le){const Ie=gn();setTimeout(()=>{Ie.update(()=>{E.isAttached()&&E.remove()})},20)}else E.remove();return}const de=E.getParent(),Ne=Bs(),Ee=E.getTextContentSize(),xe=Ir(),Ce=E.getKey();if(E.isToken()||xe!==null&&Ce===xe&&!I||pt(Ne)&&(de!==null&&!de.canInsertTextBefore()&&Ne.anchor.offset===0||Ne.anchor.key===u.__key&&Ne.anchor.offset===0&&!E.canInsertTextBefore()||Ne.focus.key===u.__key&&Ne.focus.offset===Ee&&!E.canInsertTextAfter())){E.markDirty();return}const He=cn();if(!pt(He)||a===null||f===null){E.setTextContent(F);return}if(He.setTextNodeRange(E,a,E,f),E.isSegmented()){const Ie=E.getTextContent(),Ae=Wn(Ie);E.replace(Ae),E=Ae}E.setTextContent(F)}}}function pl(u){const o=u.getPreviousSibling();return(gt(o)||Je(o)&&o.isInline())&&!o.canInsertTextAfter()}function ti(u,o){if(o.isSegmented())return!0;if(!u.isCollapsed())return!1;const a=u.anchor.offset,f=o.getParentOrThrow(),_=o.isToken();return a===0?!o.canInsertTextBefore()||!f.canInsertTextBefore()||_||pl(o):a===o.getTextContentSize()?!o.canInsertTextAfter()||!f.canInsertTextAfter()||_:!1}function ml(u,o,a,f){return u===9&&!o&&!a&&!f}function $o(u,o,a,f){return u===66&&!o&&ni(a,f)}function ca(u,o,a,f){return u===73&&!o&&ni(a,f)}function ua(u,o,a,f){return u===85&&!o&&ni(a,f)}function ao(u,o){return Ca(u)&&!o}function Fo(u,o){return Ca(u)&&o}function _l(u,o){return Te&&o&&u===79}function yl(u,o,a){return Pr(u)&&(Te?o:a)}function Bo(u,o,a){return $r(u)&&(Te?o:a)}function Ho(u,o){return Te&&o&&Pr(u)}function da(u,o){return Te&&o&&$r(u)}function fa(u,o,a,f){return Te?o||a?!1:Pr(u)||u===72&&f:f||o||a?!1:Pr(u)}function ha(u,o,a,f,_){return Te?a||f||_?!1:$r(u)||u===68&&o:o||f||_?!1:$r(u)}function ga(u,o,a,f){return u===90&&!o&&ni(a,f)}function xc(u,o,a,f){return Te?u===90&&a&&o:u===89&&f||u===90&&f&&o}function Sc(u,o,a,f){return o?!1:u===67?Te?a:f:!1}function pa(u,o,a,f){return o?!1:u===88?Te?a:f:!1}function ma(u){return u===37}function _a(u){return u===39}function vc(u){return u===38}function wc(u){return u===40}function Nl(u,o,a,f){return ma(u)&&!o&&!f&&!a}function Oc(u,o,a,f,_){return ma(u)&&!f&&!a&&(o||_)}function Dc(u,o,a,f){return _a(u)&&!o&&!f&&!a}function ya(u,o,a,f,_){return _a(u)&&!f&&!a&&(o||_)}function co(u,o,a){return vc(u)&&!o&&!a}function Na(u,o,a){return wc(u)&&!o&&!a}function Mc(u,o,a,f){return u||o||a||f}function Cl(u){return u===32}function ni(u,o){return Te?u:o}function Ca(u){return u===13}function Pr(u){return u===8}function Ac(u){return u===27}function $r(u){return u===46}function Ei(u,o,a){return u===65&&ni(o,a)}function El(){const u=Zn(),o=u.select(0,u.getChildrenSize());Or(Bi(o))}function Hi(u,o){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const a=u.__lexicalClassNameCache,f=a[o];if(f!==void 0)return f;const _=u[o];if(typeof _=="string"){const E=_.split(" ");return a[o]=E,E}return _}function Wo(u,o,a,f,_){if(a.size===0)return;const E=f.__type,I=f.__key,F=o.get(E);if(F===void 0)throw Error(`Type ${E} not in registeredNodes`);const oe=F.klass;let de=u.get(oe);de===void 0&&(de=new Map,u.set(oe,de));const Ne=de.get(I),Ee=Ne==="destroyed"&&_==="created";(Ne===void 0||Ee)&&de.set(I,Ee?"updated":_)}function Tl(u){const o=bi(),a=o._readOnly,f=u.getType(),_=o._nodeMap,E=[];for(const[,I]of _)I instanceof u&&I.__type===f&&(a||I.isAttached())&&E.push(I);return E}function Ko(u,o,a){const f=u.getParent();let _=a,E=u;return f!==null&&(o&&a===0?(_=E.getIndexWithinParent(),E=f):!o&&a===E.getChildrenSize()&&(_=E.getIndexWithinParent()+1,E=f)),E.getChildAtIndex(o?_-1:_)}function ri(u,o){const a=u.offset;if(u.type==="element"){const f=u.getNode();return Ko(f,o,a)}else{const f=u.getNode();if(o&&a===0||!o&&a===f.getTextContentSize()){const _=o?f.getPreviousSibling():f.getNextSibling();return _===null?Ko(f.getParentOrThrow(),o,f.getIndexWithinParent()+(o?0:1)):_}}return null}function Ea(u){const o=Wi(u).event,a=o&&o.inputType;return a==="insertFromPaste"||a==="insertFromPasteAsQuotation"}function st(u,o,a){return Zd(u,o,a)}function zo(u){return!br(u)&&!u.isLastChild()&&!u.isInline()}function vs(u,o){const a=u._keyToDOMMap.get(o);if(a===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${o}`);return a}function ws(u){const o=u.assignedSlot||u.parentElement;return o!==null&&o.nodeType===11?o.host:o}function Ta(u,o,a){const f=a.ownerDocument,_=f.defaultView;if(_===null)return;let{top:E,bottom:I}=o,F=0,oe=0,de=a;for(;de!==null;){const Ne=de===f.body;if(Ne)F=0,oe=Wi(u).innerHeight;else{const xe=de.getBoundingClientRect();F=xe.top,oe=xe.bottom}let Ee=0;if(E<F?Ee=-(F-E):I>oe&&(Ee=I-oe),Ee!==0)if(Ne)_.scrollBy(0,Ee);else{const xe=de.scrollTop;de.scrollTop+=Ee;const Ce=de.scrollTop-xe;E-=Ce,I-=Ce}if(Ne)break;de=ws(de)}}function Rc(u){return gn()._updateTags.has(u)}function Ti(u){nr(),gn()._updateTags.add(u)}function Bn(u){const o=cn();if(!pt(o)||!Je(u))return o;const{anchor:a,focus:f}=o,_=a.getNode(),E=f.getNode();return ht(_,u)&&a.set(u.__key,0,"element"),ht(E,u)&&f.set(u.__key,0,"element"),o}function ht(u,o){let a=u.getParent();for(;a!==null;){if(a.is(o))return!0;a=a.getParent()}return!1}function uo(u){const o=u.ownerDocument;return o&&o.defaultView||null}function Wi(u){const o=u._window;if(o===null)throw Error("window object not found");return o}function xa(u){return Je(u)&&u.isInline()||vn(u)&&u.isInline()}function Dr(u){let o=u.getParentOrThrow();for(;o!==null;){if(Fr(o))return o;o=o.getParentOrThrow()}return o}function Fr(u){return br(u)||Je(u)&&u.isShadowRoot()}function xl(u){const o=u.constructor.clone(u);return Fn(o,null),o}function fo(u){const o=gn(),a=u.constructor.getType(),f=o._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 _=f.replace;if(_!==null){const E=_(u);if(!(E instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return E}return u}function Br(u,o){const a=u.getParent();if(br(a)&&!Je(o)&&!vn(o))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Sl(u){const o=u.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let f=o.blockCursor;if(f!==void 0){if(typeof f=="string"){const _=f.split(" ");f=o.blockCursor=_}f!==void 0&&a.classList.add(...f)}return a}function ho(u){return(vn(u)||Je(u)&&!u.canBeEmpty())&&!u.isInline()}function wt(u,o,a){a.style.removeProperty("caret-color"),o._blockCursorElement=null;const f=u.parentElement;f!==null&&f.removeChild(u)}function vl(u,o,a){let f=u._blockCursorElement;if(pt(a)&&a.isCollapsed()&&a.anchor.type==="element"&&o.contains(document.activeElement)){const _=a.anchor,E=_.getNode(),I=_.offset,F=E.getChildrenSize();let oe=!1,de=null;if(I===F){const Ne=E.getChildAtIndex(I-1);ho(Ne)&&(oe=!0)}else{const Ne=E.getChildAtIndex(I);if(ho(Ne)){const Ee=Ne.getPreviousSibling();(Ee===null||ho(Ee))&&(oe=!0,de=u.getElementByKey(Ne.__key))}}if(oe){const Ne=u.getElementByKey(E.__key);f===null&&(u._blockCursorElement=f=Sl(u._config)),o.style.caretColor="transparent",de===null?Ne.appendChild(f):Ne.insertBefore(f,de);return}}f!==null&&wt(f,u,o)}function _r(u){return he?(u||window).getSelection():null}function Os(u,o){let a=u.getChildAtIndex(o);if(a==null&&(a=u),Fr(u))throw Error("Can not call $splitNode() on root element");const f=I=>{const F=I.getParentOrThrow(),oe=Fr(F),de=I===a&&!oe?I:xl(I);if(oe)return I.insertAfter(de),[I,de,de];{const[Ne,Ee,xe]=f(F),Ce=I.getNextSiblings();return xe.append(de,...Ce),[Ne,Ee,de]}},[_,E]=f(a);return[_,E]}function Uo(u,o){let a=u;for(;a!==Zn()&&a!=null;){if(o(a))return a;a=a.getParent()}return null}function Ki(u){const o=[],a=[u];for(;a.length>0;){const f=a.pop();if(f===void 0)throw Error("Stack.length > 0; can't be undefined");Je(f)&&a.unshift(...f.getChildren()),f!==u&&o.push(f)}return o}function Go(u){return Yo(u)&&u.tagName==="A"}function Yo(u){return u.nodeType===1}function zi(u){if(vn(u)&&!u.isInline())return!0;if(!Je(u)||Fr(u))return!1;const o=u.getFirstChild(),a=o===null||Di(o)||gt(o)||o.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&a}function Ds(u,o){let a=u;for(;a!==null&&a.getParent()!==null&&!o(a);)a=a.getParentOrThrow();return o(a)?a:null}function Sa(u,o){const a=u._decorators;let _=u._pendingDecorators||a;const E=o._nodeMap;let I;for(I in _)E.has(I)||(_===a&&(_=Cs(u)),delete _[I])}function wl(u,o,a,f,_,E){let I=u.getFirstChild();for(;I!==null;){const F=I.__key;I.__parent===o&&(Je(I)&&wl(I,F,a,f,_,E),a.has(F)||E.delete(F),_.push(F)),I=I.getNextSibling()}}function va(u,o,a,f){const _=u._nodeMap,E=o._nodeMap,I=[];for(const[F]of f){const oe=E.get(F);oe!==void 0&&(oe.isAttached()||(Je(oe)&&wl(oe,F,_,E,I,f),_.has(F)||f.delete(F),I.push(F)))}for(const F of I)E.delete(F);for(const F of a){const oe=E.get(F);oe!==void 0&&!oe.isAttached()&&(_.has(F)||a.delete(F),E.delete(F))}}let Tn="",Gn="",Mr="",xi,Hn,Vt,Ui=!1,go=!1,jo,Ms=null,po,As,Si,ii,Vo,qo;function yn(u,o){const a=Si.get(u);if(o!==null){const f=an(u);f.parentNode===o&&o.removeChild(f)}if(ii.has(u)||Hn._keyToDOMMap.delete(u),Je(a)){const f=_o(a,Si);xn(f,0,f.length-1,null)}a!==void 0&&Wo(qo,Vt,jo,a,"destroyed")}function xn(u,o,a,f){let _=o;for(;_<=a;++_){const E=u[_];E!==void 0&&yn(E,f)}}function Sn(u,o){u.setProperty("text-align",o)}const Ol="40px";function mo(u,o){const a=xi.theme.indent;if(typeof a=="string"){const _=u.classList.contains(a);o>0&&!_?u.classList.add(a):o<1&&_&&u.classList.remove(a)}const f=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||Ol;u.style.setProperty("padding-inline-start",o===0?"":`calc(${o} * ${f})`)}function Dl(u,o){const a=u.style;o===0?Sn(a,""):o===_t?Sn(a,"left"):o===Et?Sn(a,"center"):o===vt?Sn(a,"right"):o===Ot?Sn(a,"justify"):o===Mt?Sn(a,"start"):o===xt&&Sn(a,"end")}function oi(u,o,a){const f=ii.get(u);if(f===void 0)throw Error("createNode: node does not exist in nodeMap");const _=f.createDOM(xi,Hn);if(Ma(u,_,Hn),gt(f)?_.setAttribute("data-lexical-text","true"):vn(f)&&_.setAttribute("data-lexical-decorator","true"),Je(f)){const E=f.__indent,I=f.__size;if(E!==0&&mo(_,E),I!==0){const oe=I-1,de=_o(f,ii);Jn(de,oe,f,_)}const F=f.__format;F!==0&&Dl(_,F),f.isInline()||Ml(null,f,_),zo(f)&&(Tn+=It,Mr+=It)}else{const E=f.getTextContent();if(vn(f)){const I=f.decorate(Hn,xi);I!==null&&yo(u,I),_.contentEditable="false"}else gt(f)&&(f.isDirectionless()||(Gn+=E));Tn+=E,Mr+=E}if(o!==null)if(a!=null)o.insertBefore(_,a);else{const E=o.__lexicalLineBreak;E!=null?o.insertBefore(_,E):o.appendChild(_)}return Object.freeze(f),Wo(qo,Vt,jo,f,"created"),_}function Jn(u,o,a,f){const _=Gn;Gn="",yr(u,a,0,o,f,null),wa(a,f),Gn=_}function yr(u,o,a,f,_,E){const I=Tn;Tn="";let F=a;for(;F<=f;++F)oi(u[F],_,E);zo(o)&&(Tn+=It),_.__lexicalTextContent=Tn,Tn=I+Tn}function ln(u,o){const a=o.get(u);return Di(a)||vn(a)&&a.isInline()}function Ml(u,o,a){const f=u!==null&&(u.__size===0||ln(u.__last,Si)),_=o.__size===0||ln(o.__last,ii);if(f){if(!_){const E=a.__lexicalLineBreak;E!=null&&a.removeChild(E),a.__lexicalLineBreak=null}}else if(_){const E=document.createElement("br");a.__lexicalLineBreak=E,a.appendChild(E)}}function wa(u,o){const a=o.__lexicalDirTextContent,f=o.__lexicalDir;if(a!==Gn||f!==Ms){const _=Gn==="",E=_?Ms:sa(Gn);if(E!==f){const I=o.classList,F=xi.theme;let oe=f!==null?F[f]:void 0,de=E!==null?F[E]:void 0;if(oe!==void 0){if(typeof oe=="string"){const Ne=oe.split(" ");oe=F[f]=Ne}I.remove(...oe)}if(E===null||_&&E==="ltr")o.removeAttribute("dir");else{if(de!==void 0){if(typeof de=="string"){const Ne=de.split(" ");de=F[E]=Ne}de!==void 0&&I.add(...de)}o.dir=E}if(!go){const Ne=u.getWritable();Ne.__dir=E}}Ms=E,o.__lexicalDirTextContent=Gn,o.__lexicalDir=E}}function bc(u,o,a){const f=Gn;Gn="",Oa(u,o,a),wa(o,a),Gn=f}function _o(u,o){const a=[];let f=u.__first;for(;f!==null;){const _=o.get(f);if(_===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");a.push(f),f=_.__next}return a}function Oa(u,o,a){const f=Tn,_=u.__size,E=o.__size;if(Tn="",_===1&&E===1){const I=u.__first,F=o.__first;if(I===F)Ar(I,a);else{const oe=an(I),de=oi(F,null,null);a.replaceChild(de,oe),yn(I,null)}}else{const I=_o(u,Si),F=_o(o,ii);if(_===0)E!==0&&yr(F,o,0,E-1,a,null);else if(E===0){if(_!==0){const de=a.__lexicalLineBreak==null;xn(I,0,_-1,de?null:a),de&&(a.textContent="")}}else Da(o,I,F,_,E,a)}zo(o)&&(Tn+=It),a.__lexicalTextContent=Tn,Tn=f+Tn}function Ar(u,o){const a=Si.get(u);let f=ii.get(u);if(a===void 0||f===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const _=Ui||As.has(u)||po.has(u),E=vs(Hn,u);if(a===f&&!_){if(Je(a)){const I=E.__lexicalTextContent;I!==void 0&&(Tn+=I,Mr+=I);const F=E.__lexicalDirTextContent;F!==void 0&&(Gn+=F)}else{const I=a.getTextContent();gt(a)&&!a.isDirectionless()&&(Gn+=I),Mr+=I,Tn+=I}return E}if(a!==f&&_&&Wo(qo,Vt,jo,f,"updated"),f.updateDOM(a,E,xi)){const I=oi(u,null,null);if(o===null)throw Error("reconcileNode: parentDOM is null");return o.replaceChild(I,E),yn(u,null),I}if(Je(a)&&Je(f)){const I=f.__indent;I!==a.__indent&&mo(E,I);const F=f.__format;F!==a.__format&&Dl(E,F),_&&(bc(a,f,E),!br(f)&&!f.isInline()&&Ml(a,f,E)),zo(f)&&(Tn+=It,Mr+=It)}else{const I=f.getTextContent();if(vn(f)){const F=f.decorate(Hn,xi);F!==null&&yo(u,F)}else gt(f)&&!f.isDirectionless()&&(Gn+=I);Tn+=I,Mr+=I}return!go&&br(f)&&f.__cachedText!==Mr&&(f=f.getWritable(),f.__cachedText=Mr),Object.freeze(f),E}function yo(u,o){let a=Hn._pendingDecorators;const f=Hn._decorators;if(a===null){if(f[u]===o)return;a=Cs(Hn)}a[u]=o}function ot(u){return u.firstChild}function Rs(u){let o=u.nextSibling;return o!==null&&o===Hn._blockCursorElement&&(o=o.nextSibling),o}function Da(u,o,a,f,_,E){const I=f-1,F=_-1;let oe,de,Ne=ot(E),Ee=0,xe=0;for(;Ee<=I&&xe<=F;){const Ie=o[Ee],Ae=a[xe];if(Ie===Ae)Ne=Rs(Ar(Ae,E)),Ee++,xe++;else{oe===void 0&&(oe=new Set(o)),de===void 0&&(de=new Set(a));const mt=de.has(Ie),ze=oe.has(Ae);if(!mt)Ne=Rs(an(Ie)),yn(Ie,E),Ee++;else if(!ze)oi(Ae,E,Ne),xe++;else{const tt=vs(Hn,Ae);tt===Ne?Ne=Rs(Ar(Ae,E)):(Ne!=null?E.insertBefore(tt,Ne):E.appendChild(tt),Ar(Ae,E)),Ee++,xe++}}}const Ce=Ee>I,He=xe>F;if(Ce&&!He){const Ie=a[F+1],Ae=Ie===void 0?null:Hn.getElementByKey(Ie);yr(a,u,xe,F,E,Ae)}else He&&!Ce&&xn(o,Ee,I,E)}function sr(u,o,a,f,_,E){Tn="",Mr="",Gn="",Ui=f===dt,Ms=null,Hn=a,xi=a._config,Vt=a._nodes,jo=Hn._listeners.mutation,po=_,As=E,Si=u._nodeMap,ii=o._nodeMap,go=o._readOnly,Vo=new Map(a._keyToDOMMap);const I=new Map;return qo=I,Ar("root",null),Hn=void 0,Vt=void 0,po=void 0,As=void 0,Si=void 0,ii=void 0,xi=void 0,Vo=void 0,qo=void 0,I}function Ma(u,o,a){const f=a._keyToDOMMap;o["__lexicalKey_"+a._key]=u,f.set(u,o)}function an(u){const o=Vo.get(u);if(o===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return o}const Xn=Object.freeze({}),Ze=30,bs=[["keydown",v],["pointerdown",La],["compositionstart",s],["compositionend",N],["input",i],["click",Nr],["cut",Xn],["copy",Xn],["dragstart",Xn],["dragover",Xn],["dragend",Xn],["paste",Xn],["focus",Xn],["blur",Xn],["drop",Xn]];Ue&&bs.push(["beforeinput",(u,o)=>l(u,o)]);let Hr=0,tr=0,Aa=0,vi=null,No=0,Co=!1,wi=!1,Zo=!1,lr=!1,Al=[0,"",0,"root",0];function Ra(u,o,a,f,_){const E=u.anchor,I=u.focus,F=E.getNode(),oe=gn(),de=_r(oe._window),Ne=de!==null?de.anchorNode:null,Ee=E.key,xe=oe.getElementByKey(Ee),Ce=a.length;return Ee!==I.key||!gt(F)||(!_&&(!Ue||Aa<f+50)||F.isDirty()&&Ce<2||gl(a))&&E.offset!==I.offset&&!F.isComposing()||hl(F)||F.isDirty()&&Ce>1||(_||!Ue)&&xe!==null&&!F.isComposing()&&Ne!==Ln(xe)||de!==null&&o!==null&&(!o.collapsed||o.startContainer!==de.anchorNode||o.startOffset!==de.anchorOffset)||F.getFormat()!==u.format||F.getStyle()!==u.style||ti(u,F)}function ba(u,o){return u!==null&&u.nodeValue!==null&&u.nodeType===Ye&&o!==0&&o!==u.nodeValue.length}function Ls(u,o,a){const{anchorNode:f,anchorOffset:_,focusNode:E,focusOffset:I}=u;Co&&(Co=!1,ba(f,_)&&ba(E,I))||Rr(o,()=>{if(!a){Or(null);return}if(!Qr(o,f,E))return;const F=cn();if(pt(F)){const oe=F.anchor,de=oe.getNode();if(F.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&(F.dirty=!0);const Ne=Wi(o).event,Ee=Ne?Ne.timeStamp:performance.now(),[xe,Ce,He,Ie,Ae]=Al,mt=Zn(),ze=o.isComposing()===!1&&mt.getTextContent()==="";Ee<Ae+200&&oe.offset===He&&oe.key===Ie?(F.format=xe,F.style=Ce):oe.type==="text"?(F.format=de.getFormat(),F.style=de.getStyle()):oe.type==="element"&&!ze&&(F.format=0,F.style="")}else{let Ne=je,Ee=!1;const xe=F.getNodes(),Ce=xe.length;for(let He=0;He<Ce;He++){const Ie=xe[He];if(gt(Ie)&&(Ee=!0,Ne&=Ie.getFormat(),Ne===0))break}F.format=Ee?Ne:0}}st(o,e,void 0)})}function Nr(u,o){Rr(o,()=>{const a=cn(),f=_r(o._window),_=Bs();if(f){if(pt(a)){const E=a.anchor,I=E.getNode();if(E.type==="element"&&E.offset===0&&a.isCollapsed()&&!br(I)&&Zn().getChildrenSize()===1&&I.getTopLevelElementOrThrow().isEmpty()&&_!==null&&a.is(_))f.removeAllRanges(),a.dirty=!0;else if(u.detail===3&&!a.isCollapsed()){const oe=a.focus.getNode();I!==oe&&(Je(I)?I.select(0):I.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const E=f.anchorNode;if(E!==null){const I=E.nodeType;if(I===Be||I===Ye){const F=kc(_,f,o);Or(F)}}}}st(o,n,u)})}function La(u,o){const a=u.target,f=u.pointerType;a instanceof Node&&f!=="touch"&&Rr(o,()=>{Tc(a)||(wi=!0)})}function ks(u){if(!u.getTargetRanges)return null;const o=u.getTargetRanges();return o.length===0?null:o[0]}function ka(u,o){return u!==o||Je(u)||Je(o)||!u.isToken()||!o.isToken()}function Jo(u){return tr===229&&u<Hr+Ze}function l(u,o){const a=u.inputType,f=ks(u);a==="deleteCompositionText"||be&&Ea(o)||a!=="insertCompositionText"&&Rr(o,()=>{const _=cn();if(a==="deleteContentBackward"){if(_===null){const Ne=Bs();if(!pt(Ne))return;Or(Ne.clone())}if(pt(_)){if(ce&&_n(_.anchor.key),Jo(u.timeStamp)&&o.isComposing()&&_.anchor.key===_.focus.key){if(_n(null),Hr=0,setTimeout(()=>{Rr(o,()=>{_n(null)})},Ze),pt(_)){const Ee=_.anchor.getNode();Ee.markDirty(),_.format=Ee.getFormat(),_.style=Ee.getStyle()}_.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),st(o,r,!0))}else u.preventDefault(),st(o,r,!0);return}}if(!pt(_))return;const E=u.data;vi!==null&&Ss(!1,o,vi),(!_.dirty||vi!==null)&&_.isCollapsed()&&!br(_.anchor.getNode())&&f!==null&&_.applyDOMRange(f),vi=null;const I=_.anchor,F=_.focus,oe=I.getNode(),de=F.getNode();if(a==="insertText"||a==="insertTranspose"){if(E===`
34
- `)u.preventDefault(),st(o,c,!1);else if(E===It)u.preventDefault(),st(o,d,void 0);else if(E==null&&u.dataTransfer){const Ne=u.dataTransfer.getData("text/plain");u.preventDefault(),_.insertRawText(Ne)}else E!=null&&Ra(_,f,E,u.timeStamp,!0)?(u.preventDefault(),st(o,g,E)):vi=E;Aa=u.timeStamp;return}switch(u.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{st(o,g,u);break}case"insertFromComposition":{_n(null),st(o,g,u);break}case"insertLineBreak":{_n(null),st(o,c,!1);break}case"insertParagraph":{_n(null),Zo&&!te?(Zo=!1,st(o,c,!1)):st(o,d,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{st(o,p,u);break}case"deleteByComposition":{ka(oe,de)&&st(o,C,u);break}case"deleteByDrag":case"deleteByCut":{st(o,C,u);break}case"deleteContent":{st(o,r,!1);break}case"deleteWordBackward":{st(o,S,!0);break}case"deleteWordForward":{st(o,S,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{st(o,x,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{st(o,x,!1);break}case"formatStrikeThrough":{st(o,O,"strikethrough");break}case"formatBold":{st(o,O,"bold");break}case"formatItalic":{st(o,O,"italic");break}case"formatUnderline":{st(o,O,"underline");break}case"historyUndo":{st(o,R,void 0);break}case"historyRedo":{st(o,b,void 0);break}}})}function i(u,o){u.stopPropagation(),Rr(o,()=>{const a=cn(),f=u.data,_=ks(u);if(f!=null&&pt(a)&&Ra(a,_,f,u.timeStamp,!1)){lr&&(h(o,f),lr=!1);const E=a.anchor,I=E.getNode(),F=_r(o._window);if(F===null)return;const oe=E.offset;(!Ue||a.isCollapsed()||!gt(I)||F.anchorNode===null||I.getTextContent().slice(0,oe)+f+I.getTextContent().slice(oe+a.focus.offset)!==lo(F.anchorNode))&&st(o,g,f);const de=f.length;be&&de>1&&u.inputType==="insertCompositionText"&&!o.isComposing()&&(a.anchor.offset-=de),!re&&!te&&!Le&&o.isComposing()&&(Hr=0,_n(null))}else Ss(!1,o,f!==null?f:void 0),lr&&(h(o,f||void 0),lr=!1);la()}),vi=null}function s(u,o){Rr(o,()=>{const a=cn();if(pt(a)&&!o.isComposing()){const f=a.anchor,_=a.anchor.getNode();_n(f.key),(u.timeStamp<Hr+Ze||f.type==="element"||!a.isCollapsed()||_.getFormat()!==a.format||_.getStyle()!==a.style)&&st(o,g,hr)}})}function h(u,o){const a=u._compositionKey;if(_n(null),a!==null&&o!=null){if(o===""){const f=En(a),_=Ln(u.getElementByKey(a));_!==null&&_.nodeValue!==null&&gt(f)&&Po(f,_.nodeValue,null,null,!0);return}if(o[o.length-1]===`
35
- `){const f=cn();if(pt(f)){const _=f.focus;f.anchor.set(_.key,_.offset,_.type),st(u,K,null);return}}}Ss(!0,u,o)}function N(u,o){be?lr=!0:Rr(o,()=>{h(o,u.data)})}function v(u,o){if(Hr=u.timeStamp,tr=u.keyCode,o.isComposing())return;const{keyCode:a,shiftKey:f,ctrlKey:_,metaKey:E,altKey:I}=u;if(!st(o,T,u)){if(Dc(a,_,I,E))st(o,w,u);else if(ya(a,_,f,I,E))st(o,P,u);else if(Nl(a,_,I,E))st(o,H,u);else if(Oc(a,_,f,I,E))st(o,$,u);else if(co(a,_,E))st(o,W,u);else if(Na(a,_,E))st(o,B,u);else if(Fo(a,f))Zo=!0,st(o,K,u);else if(Cl(a))st(o,X,u);else if(_l(a,_))u.preventDefault(),Zo=!0,st(o,c,!0);else if(ao(a,f))Zo=!1,st(o,K,u);else if(fa(a,I,E,_))Pr(a)?st(o,ee,u):(u.preventDefault(),st(o,r,!0));else if(Ac(a))st(o,le,u);else if(ha(a,_,f,I,E))$r(a)?st(o,V,u):(u.preventDefault(),st(o,r,!1));else if(yl(a,I,_))u.preventDefault(),st(o,S,!0);else if(Bo(a,I,_))u.preventDefault(),st(o,S,!1);else if(Ho(a,E))u.preventDefault(),st(o,x,!0);else if(da(a,E))u.preventDefault(),st(o,x,!1);else if($o(a,I,E,_))u.preventDefault(),st(o,O,"bold");else if(ua(a,I,E,_))u.preventDefault(),st(o,O,"underline");else if(ca(a,I,E,_))u.preventDefault(),st(o,O,"italic");else if(ml(a,I,_,E))st(o,U,u);else if(ga(a,f,E,_))u.preventDefault(),st(o,R,void 0);else if(xc(a,f,E,_))u.preventDefault(),st(o,b,void 0);else{const F=o._editorState._selection;Er(F)?Sc(a,f,E,_)?(u.preventDefault(),st(o,ne,u)):pa(a,f,E,_)?(u.preventDefault(),st(o,Y,u)):Ei(a,E,_)&&(u.preventDefault(),st(o,G,u)):!be&&Ei(a,E,_)&&(u.preventDefault(),st(o,G,u))}Mc(_,f,I,E)&&st(o,ae,u)}}function M(u){let o=u.__lexicalEventHandles;return o===void 0&&(o=[],u.__lexicalEventHandles=o),o}const J=new Map;function ge(u){const o=u.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,f=_r(a);if(f===null)return;const _=Lo(f.anchorNode);if(_===null)return;wi&&(wi=!1,Rr(_,()=>{const Ne=Bs(),Ee=f.anchorNode;if(Ee===null)return;const xe=Ee.nodeType;if(xe!==Be&&xe!==Ye)return;const Ce=kc(Ne,f,_);Or(Ce)}));const E=xs(_),I=E[E.length-1],F=I._key,oe=J.get(F),de=oe||I;de!==_&&Ls(f,de,!1),Ls(f,_,!0),_!==I?J.set(F,_):oe&&J.delete(F)}function ve(u){u._lexicalHandled=!0}function Fe(u){return u._lexicalHandled===!0}function Ke(u,o){No===0&&u.ownerDocument.addEventListener("selectionchange",ge),No++,u.__lexicalEditor=o;const a=M(u);for(let f=0;f<bs.length;f++){const[_,E]=bs[f],I=typeof E=="function"?F=>{Fe(F)||(ve(F),o.isEditable()&&E(F,o))}:F=>{if(!Fe(F)&&(ve(F),o.isEditable()))switch(_){case"cut":return st(o,Y,F);case"copy":return st(o,ne,F);case"paste":return st(o,p,F);case"dragstart":return st(o,z,F);case"dragover":return st(o,D,F);case"dragend":return st(o,j,F);case"focus":return st(o,A,F);case"blur":return st(o,Z,F);case"drop":return st(o,pe,F)}};u.addEventListener(_,I),a.push(()=>{u.removeEventListener(_,I)})}}function ke(u){No!==0&&(No--,No===0&&u.ownerDocument.removeEventListener("selectionchange",ge));const o=u.__lexicalEditor;o!=null&&(Me(o),u.__lexicalEditor=null);const a=M(u);for(let f=0;f<a.length;f++)a[f]();u.__lexicalEventHandles=[]}function Me(u){if(u._parentEditor!==null){const o=xs(u),f=o[o.length-1]._key;J.get(f)===u&&J.delete(f)}else J.delete(u._key)}function Xe(){Co=!0}function ut(u,o,a,f,_){Al=[u,o,a,f,_]}function Tt(u,o,a){nr();const f=u.__key,_=u.getParent();if(_===null)return;const E=Bn(u);let I=!1;if(pt(E)&&o){const F=E.anchor,oe=E.focus;F.key===f&&(Ka(F,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0),oe.key===f&&(Ka(oe,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0)}else Er(E)&&o&&u.isSelected()&&u.selectPrevious();if(pt(E)&&o&&!I){const F=u.getIndexWithinParent();yi(u),Wa(E,_,F,-1)}else yi(u);!a&&!Fr(_)&&!_.canBeEmpty()&&_.isEmpty()&&Tt(_,o),o&&br(_)&&_.isEmpty()&&_.selectEnd()}class At{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(o){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(o){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Fn(this,o),this.__type!=="root"&&(nr(),hn(this.__type,this.constructor))}getType(){return this.__type}isAttached(){let o=this.__key;for(;o!==null;){if(o==="root")return!0;const a=En(o);if(a===null)break;o=a.__parent}return!1}isSelected(o){const a=o||cn();if(a==null)return!1;const f=a.getNodes().some(_=>_.__key===this.__key);return gt(this)?f:pt(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 o=this.getParent();if(o===null)return-1;let a=o.getFirstChild(),f=0;for(;a!==null;){if(this.is(a))return f;f++,a=a.getNextSibling()}return-1}getParent(){const o=this.getLatest().__parent;return o===null?null:En(o)}getParentOrThrow(){const o=this.getParent();if(o===null)throw Error(`Expected node ${this.__key} to have a parent.`);return o}getTopLevelElement(){let o=this;for(;o!==null;){const a=o.getParent();if(Fr(a))return o;o=a}return null}getTopLevelElementOrThrow(){const o=this.getTopLevelElement();if(o===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return o}getParents(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a),a=a.getParent();return o}getParentKeys(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a.__key),a=a.getParent();return o}getPreviousSibling(){const a=this.getLatest().__prev;return a===null?null:En(a)}getPreviousSiblings(){const o=[],a=this.getParent();if(a===null)return o;let f=a.getFirstChild();for(;f!==null&&!f.is(this);)o.push(f),f=f.getNextSibling();return o}getNextSibling(){const a=this.getLatest().__next;return a===null?null:En(a)}getNextSiblings(){const o=[];let a=this.getNextSibling();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getCommonAncestor(o){const a=this.getParents(),f=o.getParents();Je(this)&&a.unshift(this),Je(o)&&f.unshift(o);const _=a.length,E=f.length;if(_===0||E===0||a[_-1]!==f[E-1])return null;const I=new Set(f);for(let F=0;F<_;F++){const oe=a[F];if(I.has(oe))return oe}return null}is(o){return o==null?!1:this.__key===o.__key}isBefore(o){if(this===o)return!1;if(o.isParentOf(this))return!0;if(this.isParentOf(o))return!1;const a=this.getCommonAncestor(o);let f=0,_=0,E=this;for(;;){const I=E.getParentOrThrow();if(I===a){f=E.getIndexWithinParent();break}E=I}for(E=o;;){const I=E.getParentOrThrow();if(I===a){_=E.getIndexWithinParent();break}E=I}return f<_}isParentOf(o){const a=this.__key;if(a===o.__key)return!1;let f=o;for(;f!==null;){if(f.__key===a)return!0;f=f.getParent()}return!1}getNodesBetween(o){const a=this.isBefore(o),f=[],_=new Set;let E=this;for(;;){const I=E.__key;if(_.has(I)||(_.add(I),f.push(E)),E===o)break;const F=Je(E)?a?E.getFirstChild():E.getLastChild():null;if(F!==null){E=F;continue}const oe=a?E.getNextSibling():E.getPreviousSibling();if(oe!==null){E=oe;continue}const de=E.getParentOrThrow();if(_.has(de.__key)||f.push(de),de===o)break;let Ne=null,Ee=de;do{if(Ee===null)throw Error("getNodesBetween: ancestor is null");Ne=a?Ee.getNextSibling():Ee.getPreviousSibling(),Ee=Ee.getParent(),Ee!==null&&Ne===null&&!_.has(Ee.__key)&&f.push(Ee)}while(Ne===null);E=Ne}return a||f.reverse(),f}isDirty(){const a=gn()._dirtyLeaves;return a!==null&&a.has(this.__key)}getLatest(){const o=En(this.__key);if(o===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 o}getWritable(){nr();const o=bi(),a=gn(),f=o._nodeMap,_=this.__key,E=this.getLatest(),I=E.__parent,F=a._cloneNotNeeded,oe=cn();if(Cr(oe)&&oe.setCachedNodes(null),F.has(_))return oo(E),E;const Ne=E.constructor.clone(E);return Ne.__parent=I,Ne.__next=E.__next,Ne.__prev=E.__prev,Je(E)&&Je(Ne)?(Ne.__first=E.__first,Ne.__last=E.__last,Ne.__size=E.__size,Ne.__indent=E.__indent,Ne.__format=E.__format,Ne.__dir=E.__dir):gt(E)&&gt(Ne)&&(Ne.__format=E.__format,Ne.__style=E.__style,Ne.__mode=E.__mode,Ne.__detail=E.__detail),F.add(_),Ne.__key=_,oo(Ne),f.set(_,Ne),Ne}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(o,a){throw Error("createDOM: base method not extended")}updateDOM(o,a,f){throw Error("updateDOM: base method not extended")}exportDOM(o){return{element:this.createDOM(o._config,o)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(o){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(o){Tt(this,!0,o)}replace(o,a){nr();let f=cn();f!==null&&(f=f.clone()),Br(this,o);const _=this.getLatest(),E=this.__key,I=o.__key,F=o.getWritable(),oe=this.getParentOrThrow().getWritable(),de=oe.__size;yi(F);const Ne=_.getPreviousSibling(),Ee=_.getNextSibling(),xe=_.__prev,Ce=_.__next,He=_.__parent;if(Tt(_,!1,!0),Ne===null)oe.__first=I;else{const Ie=Ne.getWritable();Ie.__next=I}if(F.__prev=xe,Ee===null)oe.__last=I;else{const Ie=Ee.getWritable();Ie.__prev=I}if(F.__next=Ce,F.__parent=He,oe.__size=de,a&&this.getChildren().forEach(Ie=>{F.append(Ie)}),pt(f)){Or(f);const Ie=f.anchor,Ae=f.focus;Ie.key===E&&Ba(Ie,F),Ae.key===E&&Ba(Ae,F)}return Ir()===E&&_n(I),F}insertAfter(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.getParent(),I=cn();let F=!1,oe=!1;if(E!==null){const Ce=o.getIndexWithinParent();if(yi(_),pt(I)){const He=E.__key,Ie=I.anchor,Ae=I.focus;F=Ie.type==="element"&&Ie.key===He&&Ie.offset===Ce+1,oe=Ae.type==="element"&&Ae.key===He&&Ae.offset===Ce+1}}const de=this.getNextSibling(),Ne=this.getParentOrThrow().getWritable(),Ee=_.__key,xe=f.__next;if(de===null)Ne.__last=Ee;else{const Ce=de.getWritable();Ce.__prev=Ee}if(Ne.__size++,f.__next=Ee,_.__next=xe,_.__prev=f.__key,_.__parent=f.__parent,a&&pt(I)){const Ce=this.getIndexWithinParent();Wa(I,Ne,Ce+1);const He=Ne.__key;F&&I.anchor.set(He,Ce+2,"element"),oe&&I.focus.set(He,Ce+2,"element")}return o}insertBefore(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.__key;yi(_);const I=this.getPreviousSibling(),F=this.getParentOrThrow().getWritable(),oe=f.__prev,de=this.getIndexWithinParent();if(I===null)F.__first=E;else{const Ee=I.getWritable();Ee.__next=E}F.__size++,f.__prev=E,_.__prev=oe,_.__next=f.__key,_.__parent=f.__parent;const Ne=cn();if(a&&pt(Ne)){const Ee=this.getParentOrThrow();Wa(Ne,Ee,de)}return o}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(o,a){nr();const f=this.getPreviousSibling(),_=this.getParentOrThrow();if(f===null)return _.select(0,0);if(Je(f))return f.select();if(!gt(f)){const E=f.getIndexWithinParent()+1;return _.select(E,E)}return f.select(o,a)}selectNext(o,a){nr();const f=this.getNextSibling(),_=this.getParentOrThrow();if(f===null)return _.select();if(Je(f))return f.select(0,0);if(!gt(f)){const E=f.getIndexWithinParent();return _.select(E,E)}return f.select(o,a)}markDirty(){this.getWritable()}}function hn(u,o){const a=gn()._nodes.get(u);if(a===void 0)throw Error(`Create node: Attempted to create node ${o.name} that was not configured to be used on the editor.`);const f=a.klass;if(f!==o)throw Error(`Create node: Type ${u} in node ${o.name} does not match registered node ${f.name} with the same type`)}function ar(u,o,a){const f=o.getParentOrThrow().getLastChild();let _=o;const E=[o];for(;_!==f;){if(!_.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");_=_.getNextSibling(),E.push(_)}let I=u;for(const F of E)I=I.insertAfter(F)}class Wr extends At{static getType(){return"linebreak"}static clone(o){return new Wr(o.__key)}constructor(o){super(o)}getTextContent(){return`
36
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:o=>{const a=o.parentElement;let f,_;return a!==null&&((f=a.firstChild)===o||f.nextSibling===o&&f.nodeType===Ye&&(f.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((_=a.lastChild)===o||_.previousSibling===o&&_.nodeType===Ye&&(_.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:si,priority:0}}}}static importJSON(o){return Oi()}exportJSON(){return{type:"linebreak",version:1}}}function si(u){return{node:Oi()}}function Oi(){return fo(new Wr)}function Di(u){return u instanceof Wr}function Eo(u,o){return o&qe?"code":o&kt?"mark":o&Qe?"sub":o&ft?"sup":null}function Rl(u,o){return o&Oe?"strong":o&Re?"em":"span"}function Is(u,o,a,f,_){const E=f.classList;let I=Hi(_,"base");I!==void 0&&E.add(...I),I=Hi(_,"underlineStrikethrough");let F=!1;const oe=o&We&&o&De,de=a&We&&a&De;I!==void 0&&(de?(F=!0,oe||E.add(...I)):oe&&E.remove(...I));for(const Ne in fn){const xe=fn[Ne];if(I=Hi(_,Ne),I!==void 0)if(a&xe){if(F&&(Ne==="underline"||Ne==="strikethrough")){o&xe&&E.remove(...I);continue}(!(o&xe)||oe&&Ne==="underline"||Ne==="strikethrough")&&E.add(...I)}else o&xe&&E.remove(...I)}}function Kr(u,o){const a=u.length,f=o.length;let _=0,E=0;for(;_<a&&_<f&&u[_]===o[_];)_++;for(;E+_<a&&E+_<f&&u[a-E-1]===o[f-E-1];)E++;return[_,a-_-E,o.slice(_,f-E)]}function To(u,o,a){const f=o.firstChild,_=a.isComposing(),I=u+(_?Ut:"");if(f==null)o.textContent=I;else{const F=f.nodeValue;if(F!==I)if(_||be){const[oe,de,Ne]=Kr(F,I);de!==0&&f.deleteData(oe,de),f.insertData(oe,Ne)}else f.nodeValue=I}}function Ps(u,o,a,f,_,E){To(_,u,o);const F=E.theme.text;F!==void 0&&Is(a,0,f,u,F)}function Xo(u,o){const a=document.createElement(o);return a.appendChild(u),a}class Gi extends At{static getType(){return"text"}static clone(o){return new Gi(o.__text,o.__key)}constructor(o,a){super(a),this.__text=o,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const o=this.getLatest();return Ge[o.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===ie}isComposing(){return this.__key===Ir()}isSegmented(){return this.getLatest().__mode===fe}isDirectionless(){return(this.getLatest().__detail&Ve)!==0}isUnmergeable(){return(this.getLatest().__detail&rt)!==0}hasFormat(o){const a=fn[o];return(this.getFormat()&a)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(o,a){const _=this.getLatest().__format;return wr(_,o,a)}createDOM(o){const a=this.__format,f=Eo(this,a),_=Rl(this,a),E=f===null?_:f,I=document.createElement(E);let F=I;this.hasFormat("code")&&I.setAttribute("spellcheck","false"),f!==null&&(F=document.createElement(_),I.appendChild(F));const oe=this.__text;Ps(F,this,_,a,oe,o);const de=this.__style;return de!==""&&(I.style.cssText=de),I}updateDOM(o,a,f){const _=this.__text,E=o.__format,I=this.__format,F=Eo(this,E),oe=Eo(this,I),de=Rl(this,E),Ne=Rl(this,I);if((F===null?de:F)!==(oe===null?Ne:oe))return!0;if(F===oe&&de!==Ne){const ze=a.firstChild;if(ze==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const tt=document.createElement(Ne);return Ps(tt,this,Ne,I,_,f),a.replaceChild(tt,ze),!1}let Ce=a;if(oe!==null&&F!==null&&(Ce=a.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");To(_,Ce,this);const Ie=f.theme.text;Ie!==void 0&&E!==I&&Is(Ne,E,I,Ce,Ie);const Ae=o.__style,mt=this.__style;return Ae!==mt&&(a.style.cssText=mt),!1}static importDOM(){return{"#text":()=>({conversion:Ll,priority:0}),b:()=>({conversion:Pa,priority:0}),code:()=>({conversion:zr,priority:0}),em:()=>({conversion:zr,priority:0}),i:()=>({conversion:zr,priority:0}),s:()=>({conversion:zr,priority:0}),span:()=>({conversion:Ia,priority:0}),strong:()=>({conversion:zr,priority:0}),sub:()=>({conversion:zr,priority:0}),sup:()=>({conversion:zr,priority:0}),u:()=>({conversion:zr,priority:0})}}static importJSON(o){const a=Wn(o.text);return a.setFormat(o.format),a.setDetail(o.detail),a.setMode(o.mode),a.setStyle(o.style),a}exportDOM(o){let{element:a}=super.exportDOM(o);if(!(a!==null&&Yo(a)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return a.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(a=Xo(a,"b")),this.hasFormat("italic")&&(a=Xo(a,"i")),this.hasFormat("strikethrough")&&(a=Xo(a,"s")),this.hasFormat("underline")&&(a=Xo(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(o,a){}setFormat(o){const a=this.getWritable();return a.__format=typeof o=="string"?fn[o]:o,a}setDetail(o){const a=this.getWritable();return a.__detail=typeof o=="string"?gr[o]:o,a}setStyle(o){const a=this.getWritable();return a.__style=o,a}toggleFormat(o){const a=this.getFormat(),f=wr(a,o,null);return this.setFormat(f)}toggleDirectionless(){const o=this.getWritable();return o.__detail^=Ve,o}toggleUnmergeable(){const o=this.getWritable();return o.__detail^=rt,o}setMode(o){const a=ye[o];if(this.__mode===a)return this;const f=this.getWritable();return f.__mode=a,f}setTextContent(o){if(this.__text===o)return this;const a=this.getWritable();return a.__text=o,a}select(o,a){nr();let f=o,_=a;const E=cn(),I=this.getTextContent(),F=this.__key;if(typeof I=="string"){const oe=I.length;f===void 0&&(f=oe),_===void 0&&(_=oe)}else f=0,_=0;if(pt(E)){const oe=Ir();(oe===E.anchor.key||oe===E.focus.key)&&_n(F),E.setTextNodeRange(this,f,this,_)}else return Bd(F,f,F,_,"text","text");return E}selectStart(){return this.select(0,0)}selectEnd(){const o=this.getTextContentSize();return this.select(o,o)}spliceText(o,a,f,_){const E=this.getWritable(),I=E.__text,F=f.length;let oe=o;oe<0&&(oe=F+oe,oe<0&&(oe=0));const de=cn();if(_&&pt(de)){const Ee=o+F;de.setTextNodeRange(E,Ee,E,Ee)}const Ne=I.slice(0,oe)+f+I.slice(oe+a);return E.__text=Ne,E}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...o){nr();const a=this.getLatest(),f=a.getTextContent(),_=a.__key,E=Ir(),I=new Set(o),F=[],oe=f.length;let de="";for(let St=0;St<oe;St++)de!==""&&I.has(St)&&(F.push(de),de=""),de+=f[St];de!==""&&F.push(de);const Ne=F.length;if(Ne===0)return[];if(F[0]===f)return[a];const Ee=F[0],xe=a.getParentOrThrow();let Ce;const He=a.getFormat(),Ie=a.getStyle(),Ae=a.__detail;let mt=!1;a.isSegmented()?(Ce=Wn(Ee),Ce.__format=He,Ce.__style=Ie,Ce.__detail=Ae,mt=!0):(Ce=a.getWritable(),Ce.__text=Ee);const ze=cn(),tt=[Ce];let Ft=Ee.length;for(let St=1;St<Ne;St++){const Wt=F[St],Zt=Wt.length,pn=Wn(Wt).getWritable();pn.__format=He,pn.__style=Ie,pn.__detail=Ae;const qt=pn.__key,Dn=Ft+Zt;if(pt(ze)){const ai=ze.anchor,Zi=ze.focus;ai.key===_&&ai.type==="text"&&ai.offset>Ft&&ai.offset<=Dn&&(ai.key=qt,ai.offset-=Ft,ze.dirty=!0),Zi.key===_&&Zi.type==="text"&&Zi.offset>Ft&&Zi.offset<=Dn&&(Zi.key=qt,Zi.offset-=Ft,ze.dirty=!0)}E===_&&_n(qt),Ft=Dn,tt.push(pn)}Ns(this);const Rt=xe.getWritable(),Ct=this.getIndexWithinParent();return mt?(Rt.splice(Ct,0,tt),this.remove()):Rt.splice(Ct,1,tt),pt(ze)&&Wa(ze,xe,Ct,Ne-1),tt}mergeWithSibling(o){const a=o===this.getPreviousSibling();if(!a&&o!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const f=this.__key,_=o.__key,E=this.__text,I=E.length;Ir()===_&&_n(f);const oe=cn();if(pt(oe)){const xe=oe.anchor,Ce=oe.focus;xe!==null&&xe.key===_&&(Wd(xe,a,f,o,I),oe.dirty=!0),Ce!==null&&Ce.key===_&&(Wd(Ce,a,f,o,I),oe.dirty=!0)}const de=o.__text,Ne=a?de+E:E+de;this.setTextContent(Ne);const Ee=this.getWritable();return o.remove(),Ee}isTextEntity(){return!1}}function Ia(u){const o=u,a=o.style.fontWeight==="700",f=o.style.textDecoration==="line-through",_=o.style.fontStyle==="italic",E=o.style.textDecoration==="underline",I=o.style.verticalAlign;return{forChild:F=>(gt(F)&&(a&&F.toggleFormat("bold"),f&&F.toggleFormat("strikethrough"),_&&F.toggleFormat("italic"),E&&F.toggleFormat("underline"),I==="sub"&&F.toggleFormat("subscript"),I==="super"&&F.toggleFormat("superscript")),F),node:null}}function Pa(u){const a=u.style.fontWeight==="normal";return{forChild:f=>(gt(f)&&!a&&f.toggleFormat("bold"),f),node:null}}const Qo=new WeakMap;function $a(u){return u.nodeName==="PRE"||u.nodeType===Be&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function bl(u){let o,a=u.parentNode;const f=[u];for(;a!==null&&(o=Qo.get(a))===void 0&&!$a(a);)f.push(a),a=a.parentNode;const _=o===void 0?a:o;for(let E=0;E<f.length;E++)Qo.set(f[E],_);return _}function Ll(u){const o=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let f=o.textContent||"";if(bl(o)!==null){const _=f.split(/(\r?\n|\t)/),E=[],I=_.length;for(let F=0;F<I;F++){const oe=_[F];oe===`
33
+ `,hr=be?Qt:Ut,vr="֑-߿יִ-﷽ﹰ-ﻼ",Fi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",gs=new RegExp("^[^"+Fi+"]*["+vr+"]"),ps=new RegExp("^[^"+vr+"]*["+Fi+"]"),fn={bold:Oe,code:qe,highlight:kt,italic:Re,strikethrough:De,subscript:Qe,superscript:ft,underline:We},gr={directionless:Ve,unmergeable:rt},Jr={center:Et,end:xt,justify:Ot,left:_t,right:vt,start:Mt},ms={[Et]:"center",[xt]:"end",[Ot]:"justify",[_t]:"left",[vt]:"right",[Mt]:"start"},ye={normal:Se,segmented:fe,token:ie},Ge={[Se]:"normal",[fe]:"segmented",[ie]:"token"},nt=100;let Nt=!1,Ht=0;function Kt(){return Nt}function $t(u){Ht=u.timeStamp}function Pt(u){Ht===0&&Wi(u).addEventListener("textInput",$t,!0)}function mn(u,o,a){return o.__lexicalLineBreak===u||u[`__lexicalKey_${a._key}`]!==void 0}function sn(u){return u.getEditorState().read(()=>{const o=cn();return o!==null?o.clone():null})}function nn(u,o,a){const f=_r(a._window);let _=null,E=null;f!==null&&f.anchorNode===u&&(_=f.anchorOffset,E=f.focusOffset);const I=u.nodeValue;I!==null&&Po(o,I,_,E,!1)}function $n(u,o,a){if(pt(u)){const f=u.anchor.getNode();if(f.is(a)&&u.format!==f.getFormat())return!1}return o.nodeType===Ye&&a.isAttached()}function pr(u,o,a){Nt=!0;const f=performance.now()-Ht>nt;try{Rr(u,()=>{const _=cn()||sn(u),E=new Map,I=u.getRootElement(),F=u._editorState,oe=u._blockCursorElement;let de=!1,Ne="";for(let xe=0;xe<o.length;xe++){const Ce=o[xe],He=Ce.type,Ie=Ce.target;let Ae=mr(Ie,F);if(!(Ae===null&&Ie!==I||vn(Ae))){if(He==="characterData")f&&gt(Ae)&&$n(_,Ie,Ae)&&nn(Ie,Ae,u);else if(He==="childList"){de=!0;const mt=Ce.addedNodes;for(let Ft=0;Ft<mt.length;Ft++){const Rt=mt[Ft],Ct=Ni(Rt),St=Rt.parentNode;if(St!=null&&Rt!==oe&&Ct===null&&(Rt.nodeName!=="BR"||!mn(Rt,St,u))){if(be){const Wt=Rt.innerText||Rt.nodeValue;Wt&&(Ne+=Wt)}St.removeChild(Rt)}}const ze=Ce.removedNodes,tt=ze.length;if(tt>0){let Ft=0;for(let Rt=0;Rt<tt;Rt++){const Ct=ze[Rt];(Ct.nodeName==="BR"&&mn(Ct,Ie,u)||oe===Ct)&&(Ie.appendChild(Ct),Ft++)}tt!==Ft&&(Ie===I&&(Ae=Ci(F)),E.set(Ie,Ae))}}}}if(E.size>0)for(const[xe,Ce]of E)if(Je(Ce)){const He=Ce.getChildrenKeys();let Ie=xe.firstChild;for(let Ae=0;Ae<He.length;Ae++){const mt=He[Ae],ze=u.getElementByKey(mt);ze!==null&&(Ie==null?(xe.appendChild(ze),Ie=ze):Ie!==ze&&xe.replaceChild(ze,Ie),Ie=Ie.nextSibling)}}else gt(Ce)&&Ce.markDirty();const Ee=a.takeRecords();if(Ee.length>0){for(let xe=0;xe<Ee.length;xe++){const Ce=Ee[xe],He=Ce.addedNodes,Ie=Ce.target;for(let Ae=0;Ae<He.length;Ae++){const mt=He[Ae],ze=mt.parentNode;ze!=null&&mt.nodeName==="BR"&&!mn(mt,Ie,u)&&ze.removeChild(mt)}}a.takeRecords()}_!==null&&(de&&(_.dirty=!0,Or(_)),be&&Ea(u)&&_.insertRawText(Ne))})}finally{Nt=!1}}function mi(u){const o=u._observer;if(o!==null){const a=o.takeRecords();pr(u,a,o)}}function qn(u){Pt(u),u._observer=new MutationObserver((o,a)=>{pr(u,o,a)})}function cl(u,o){const a=u.__mode,f=u.__format,_=u.__style,E=o.__mode,I=o.__format,F=o.__style;return(a===null||a===E)&&(f===null||f===I)&&(_===null||_===F)}function Xr(u,o){const a=u.mergeWithSibling(o),f=gn()._normalizedNodes;return f.add(u.__key),f.add(o.__key),a}function ul(u){let o=u;if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable()){o.remove();return}let a;for(;(a=o.getPreviousSibling())!==null&&gt(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else if(cl(a,o)){o=Xr(a,o);break}else break;let f;for(;(f=o.getNextSibling())!==null&&gt(f)&&f.isSimpleText()&&!f.isUnmergeable();)if(f.__text==="")f.remove();else if(cl(o,f)){o=Xr(o,f);break}else break}function Bi(u){return _s(u.anchor),_s(u.focus),u}function _s(u){for(;u.type==="element";){const o=u.getNode(),a=u.offset;let f,_;if(a===o.getChildrenSize()?(f=o.getChildAtIndex(a-1),_=!0):(f=o.getChildAtIndex(a),_=!1),gt(f)){u.set(f.__key,_?f.getTextContentSize():0,"text");break}else if(!Je(f))break;u.set(f.__key,_?f.getChildrenSize():0,"element")}}let dl=1;function fl(){return""+dl++}function kr(u,o){const a=u._nodes.get(o);if(a===void 0)throw Error(`registeredNode: Type ${o} not found`);return a}const ys=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function xc(u){return vn(mr(u))}function io(u){const o=document.activeElement;if(o===null)return!1;const a=o.nodeName;return vn(mr(u))&&(a==="INPUT"||a==="TEXTAREA"||o.contentEditable==="true"&&o.__lexicalEditor==null)}function Qr(u,o,a){const f=u.getRootElement();try{return f!==null&&f.contains(o)&&f.contains(a)&&o!==null&&!io(o)&&Lo(o)===u}catch{return!1}}function Lo(u){let o=u;for(;o!=null;){const a=o.__lexicalEditor;if(a!=null)return a;o=ws(o)}return null}function sa(u){return gs.test(u)?"rtl":ps.test(u)?"ltr":null}function hl(u){return u.isToken()||u.isSegmented()}function On(u){return u.nodeType===Ye}function Ln(u){let o=u;for(;o!=null;){if(On(o))return o;o=o.firstChild}return null}function wr(u,o,a){const f=fn[o];if(a!==null&&(u&f)===(a&f))return u;let _=u^f;return o==="subscript"?_&=~fn.superscript:o==="superscript"&&(_&=~fn.subscript),_}function _i(u){return gt(u)||Di(u)||vn(u)}function Fn(u,o){if(o!=null){u.__key=o;return}nr(),Yd();const a=gn(),f=bi(),_=fl();f._nodeMap.set(_,u),Je(u)?a._dirtyElements.set(_,!0):a._dirtyLeaves.add(_),a._cloneNotNeeded.add(_),a._dirtyType=yt,u.__key=_}function ko(u,o,a){let f=u;for(;f!==null;){if(a.has(f))return;const _=o.get(f);if(_===void 0)break;a.set(f,!1),f=_.__parent}}function yi(u){const o=u.getParent();if(o!==null){const a=u.getWritable(),f=o.getWritable(),_=u.getPreviousSibling(),E=u.getNextSibling();if(_===null)if(E!==null){const I=E.getWritable();f.__first=E.__key,I.__prev=null}else f.__first=null;else{const I=_.getWritable();if(E!==null){const F=E.getWritable();F.__prev=I.__key,I.__next=F.__key}else I.__next=null;a.__prev=null}if(E===null)if(_!==null){const I=_.getWritable();f.__last=_.__key,I.__next=null}else f.__last=null;else{const I=E.getWritable();if(_!==null){const F=_.getWritable();F.__next=I.__key,I.__prev=F.__key}else I.__prev=null;a.__next=null}f.__size--,a.__parent=null}}function oo(u){Yd();const o=u.getLatest(),a=o.__parent,f=bi(),_=gn(),E=f._nodeMap,I=_._dirtyElements;a!==null&&ko(a,E,I);const F=o.__key;_._dirtyType=yt,Je(u)?I.set(F,!0):_._dirtyLeaves.add(F)}function Ns(u){const o=u.getPreviousSibling(),a=u.getNextSibling();o!==null&&oo(o),a!==null&&oo(a)}function _n(u){nr();const o=gn(),a=o._compositionKey;if(u!==a){if(o._compositionKey=u,a!==null){const f=En(a);f!==null&&f.getWritable()}if(u!==null){const f=En(u);f!==null&&f.getWritable()}}}function Ir(){return Hs()?null:gn()._compositionKey}function En(u,o){const f=(o||bi())._nodeMap.get(u);return f===void 0?null:f}function Ni(u,o){const a=gn(),f=u[`__lexicalKey_${a._key}`];return f!==void 0?En(f,o):null}function mr(u,o){let a=u;for(;a!=null;){const f=Ni(a,o);if(f!==null)return f;a=ws(a)}return null}function Cs(u){const o=u._decorators,a=Object.assign({},o);return u._pendingDecorators=a,a}function so(u){return u.read(()=>Zn().getTextContent())}function Es(u,o){Rr(u,()=>{const a=bi();if(a.isEmpty())return;if(o==="root"){Zn().markDirty();return}const f=a._nodeMap;for(const[,_]of f)_.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Zn(){return Ci(bi())}function Ci(u){return u._nodeMap.get("root")}function Or(u){nr();const o=bi();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)}o._selection=u}function la(){nr();const u=gn();mi(u)}function ei(u){const o=gn(),a=aa(u,o);if(a===null){const f=o.getRootElement();return u===f?En("root"):null}return En(a)}function Ts(u,o){return o?u.getTextContentSize():0}function aa(u,o){let a=u;for(;a!=null;){const f=a[`__lexicalKey_${o._key}`];if(f!==void 0)return f;a=ws(a)}return null}function gl(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function xs(u){const o=[];let a=u;for(;a!==null;)o.push(a),a=a._parentEditor;return o}function Io(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function lo(u){return u.nodeType===Ye?u.nodeValue:null}function Ss(u,o,a){const f=_r(o._window);if(f===null)return;const _=f.anchorNode;let{anchorOffset:E,focusOffset:I}=f;if(_!==null){let F=lo(_);const oe=mr(_);if(F!==null&&gt(oe)){if(F===Ut&&a){const de=a.length;F=a,E=de,I=de}F!==null&&Po(oe,F,E,I,u)}}}function Po(u,o,a,f,_){let E=u;if(E.isAttached()&&(_||!E.isDirty())){const I=E.isComposing();let F=o;(I||_)&&o[o.length-1]===Ut&&(F=o.slice(0,-1));const oe=E.getTextContent();if(_||F!==oe){if(F===""){if(_n(null),!re&&!te&&!Le){const Ie=gn();setTimeout(()=>{Ie.update(()=>{E.isAttached()&&E.remove()})},20)}else E.remove();return}const de=E.getParent(),Ne=Bs(),Ee=E.getTextContentSize(),xe=Ir(),Ce=E.getKey();if(E.isToken()||xe!==null&&Ce===xe&&!I||pt(Ne)&&(de!==null&&!de.canInsertTextBefore()&&Ne.anchor.offset===0||Ne.anchor.key===u.__key&&Ne.anchor.offset===0&&!E.canInsertTextBefore()||Ne.focus.key===u.__key&&Ne.focus.offset===Ee&&!E.canInsertTextAfter())){E.markDirty();return}const He=cn();if(!pt(He)||a===null||f===null){E.setTextContent(F);return}if(He.setTextNodeRange(E,a,E,f),E.isSegmented()){const Ie=E.getTextContent(),Ae=Wn(Ie);E.replace(Ae),E=Ae}E.setTextContent(F)}}}function pl(u){const o=u.getPreviousSibling();return(gt(o)||Je(o)&&o.isInline())&&!o.canInsertTextAfter()}function ti(u,o){if(o.isSegmented())return!0;if(!u.isCollapsed())return!1;const a=u.anchor.offset,f=o.getParentOrThrow(),_=o.isToken();return a===0?!o.canInsertTextBefore()||!f.canInsertTextBefore()||_||pl(o):a===o.getTextContentSize()?!o.canInsertTextAfter()||!f.canInsertTextAfter()||_:!1}function ml(u,o,a,f){return u===9&&!o&&!a&&!f}function $o(u,o,a,f){return u===66&&!o&&ni(a,f)}function ca(u,o,a,f){return u===73&&!o&&ni(a,f)}function ua(u,o,a,f){return u===85&&!o&&ni(a,f)}function ao(u,o){return Ca(u)&&!o}function Fo(u,o){return Ca(u)&&o}function _l(u,o){return Te&&o&&u===79}function yl(u,o,a){return Pr(u)&&(Te?o:a)}function Bo(u,o,a){return $r(u)&&(Te?o:a)}function Ho(u,o){return Te&&o&&Pr(u)}function da(u,o){return Te&&o&&$r(u)}function fa(u,o,a,f){return Te?o||a?!1:Pr(u)||u===72&&f:f||o||a?!1:Pr(u)}function ha(u,o,a,f,_){return Te?a||f||_?!1:$r(u)||u===68&&o:o||f||_?!1:$r(u)}function ga(u,o,a,f){return u===90&&!o&&ni(a,f)}function Sc(u,o,a,f){return Te?u===90&&a&&o:u===89&&f||u===90&&f&&o}function vc(u,o,a,f){return o?!1:u===67?Te?a:f:!1}function pa(u,o,a,f){return o?!1:u===88?Te?a:f:!1}function ma(u){return u===37}function _a(u){return u===39}function wc(u){return u===38}function Oc(u){return u===40}function Nl(u,o,a,f){return ma(u)&&!o&&!f&&!a}function Dc(u,o,a,f,_){return ma(u)&&!f&&!a&&(o||_)}function Mc(u,o,a,f){return _a(u)&&!o&&!f&&!a}function ya(u,o,a,f,_){return _a(u)&&!f&&!a&&(o||_)}function co(u,o,a){return wc(u)&&!o&&!a}function Na(u,o,a){return Oc(u)&&!o&&!a}function Ac(u,o,a,f){return u||o||a||f}function Cl(u){return u===32}function ni(u,o){return Te?u:o}function Ca(u){return u===13}function Pr(u){return u===8}function Rc(u){return u===27}function $r(u){return u===46}function Ei(u,o,a){return u===65&&ni(o,a)}function El(){const u=Zn(),o=u.select(0,u.getChildrenSize());Or(Bi(o))}function Hi(u,o){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const a=u.__lexicalClassNameCache,f=a[o];if(f!==void 0)return f;const _=u[o];if(typeof _=="string"){const E=_.split(" ");return a[o]=E,E}return _}function Wo(u,o,a,f,_){if(a.size===0)return;const E=f.__type,I=f.__key,F=o.get(E);if(F===void 0)throw Error(`Type ${E} not in registeredNodes`);const oe=F.klass;let de=u.get(oe);de===void 0&&(de=new Map,u.set(oe,de));const Ne=de.get(I),Ee=Ne==="destroyed"&&_==="created";(Ne===void 0||Ee)&&de.set(I,Ee?"updated":_)}function Tl(u){const o=bi(),a=o._readOnly,f=u.getType(),_=o._nodeMap,E=[];for(const[,I]of _)I instanceof u&&I.__type===f&&(a||I.isAttached())&&E.push(I);return E}function Ko(u,o,a){const f=u.getParent();let _=a,E=u;return f!==null&&(o&&a===0?(_=E.getIndexWithinParent(),E=f):!o&&a===E.getChildrenSize()&&(_=E.getIndexWithinParent()+1,E=f)),E.getChildAtIndex(o?_-1:_)}function ri(u,o){const a=u.offset;if(u.type==="element"){const f=u.getNode();return Ko(f,o,a)}else{const f=u.getNode();if(o&&a===0||!o&&a===f.getTextContentSize()){const _=o?f.getPreviousSibling():f.getNextSibling();return _===null?Ko(f.getParentOrThrow(),o,f.getIndexWithinParent()+(o?0:1)):_}}return null}function Ea(u){const o=Wi(u).event,a=o&&o.inputType;return a==="insertFromPaste"||a==="insertFromPasteAsQuotation"}function st(u,o,a){return Jd(u,o,a)}function zo(u){return!br(u)&&!u.isLastChild()&&!u.isInline()}function vs(u,o){const a=u._keyToDOMMap.get(o);if(a===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${o}`);return a}function ws(u){const o=u.assignedSlot||u.parentElement;return o!==null&&o.nodeType===11?o.host:o}function Ta(u,o,a){const f=a.ownerDocument,_=f.defaultView;if(_===null)return;let{top:E,bottom:I}=o,F=0,oe=0,de=a;for(;de!==null;){const Ne=de===f.body;if(Ne)F=0,oe=Wi(u).innerHeight;else{const xe=de.getBoundingClientRect();F=xe.top,oe=xe.bottom}let Ee=0;if(E<F?Ee=-(F-E):I>oe&&(Ee=I-oe),Ee!==0)if(Ne)_.scrollBy(0,Ee);else{const xe=de.scrollTop;de.scrollTop+=Ee;const Ce=de.scrollTop-xe;E-=Ce,I-=Ce}if(Ne)break;de=ws(de)}}function bc(u){return gn()._updateTags.has(u)}function Ti(u){nr(),gn()._updateTags.add(u)}function Bn(u){const o=cn();if(!pt(o)||!Je(u))return o;const{anchor:a,focus:f}=o,_=a.getNode(),E=f.getNode();return ht(_,u)&&a.set(u.__key,0,"element"),ht(E,u)&&f.set(u.__key,0,"element"),o}function ht(u,o){let a=u.getParent();for(;a!==null;){if(a.is(o))return!0;a=a.getParent()}return!1}function uo(u){const o=u.ownerDocument;return o&&o.defaultView||null}function Wi(u){const o=u._window;if(o===null)throw Error("window object not found");return o}function xa(u){return Je(u)&&u.isInline()||vn(u)&&u.isInline()}function Dr(u){let o=u.getParentOrThrow();for(;o!==null;){if(Fr(o))return o;o=o.getParentOrThrow()}return o}function Fr(u){return br(u)||Je(u)&&u.isShadowRoot()}function xl(u){const o=u.constructor.clone(u);return Fn(o,null),o}function fo(u){const o=gn(),a=u.constructor.getType(),f=o._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 _=f.replace;if(_!==null){const E=_(u);if(!(E instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return E}return u}function Br(u,o){const a=u.getParent();if(br(a)&&!Je(o)&&!vn(o))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Sl(u){const o=u.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let f=o.blockCursor;if(f!==void 0){if(typeof f=="string"){const _=f.split(" ");f=o.blockCursor=_}f!==void 0&&a.classList.add(...f)}return a}function ho(u){return(vn(u)||Je(u)&&!u.canBeEmpty())&&!u.isInline()}function wt(u,o,a){a.style.removeProperty("caret-color"),o._blockCursorElement=null;const f=u.parentElement;f!==null&&f.removeChild(u)}function vl(u,o,a){let f=u._blockCursorElement;if(pt(a)&&a.isCollapsed()&&a.anchor.type==="element"&&o.contains(document.activeElement)){const _=a.anchor,E=_.getNode(),I=_.offset,F=E.getChildrenSize();let oe=!1,de=null;if(I===F){const Ne=E.getChildAtIndex(I-1);ho(Ne)&&(oe=!0)}else{const Ne=E.getChildAtIndex(I);if(ho(Ne)){const Ee=Ne.getPreviousSibling();(Ee===null||ho(Ee))&&(oe=!0,de=u.getElementByKey(Ne.__key))}}if(oe){const Ne=u.getElementByKey(E.__key);f===null&&(u._blockCursorElement=f=Sl(u._config)),o.style.caretColor="transparent",de===null?Ne.appendChild(f):Ne.insertBefore(f,de);return}}f!==null&&wt(f,u,o)}function _r(u){return he?(u||window).getSelection():null}function Os(u,o){let a=u.getChildAtIndex(o);if(a==null&&(a=u),Fr(u))throw Error("Can not call $splitNode() on root element");const f=I=>{const F=I.getParentOrThrow(),oe=Fr(F),de=I===a&&!oe?I:xl(I);if(oe)return I.insertAfter(de),[I,de,de];{const[Ne,Ee,xe]=f(F),Ce=I.getNextSiblings();return xe.append(de,...Ce),[Ne,Ee,de]}},[_,E]=f(a);return[_,E]}function Uo(u,o){let a=u;for(;a!==Zn()&&a!=null;){if(o(a))return a;a=a.getParent()}return null}function Ki(u){const o=[],a=[u];for(;a.length>0;){const f=a.pop();if(f===void 0)throw Error("Stack.length > 0; can't be undefined");Je(f)&&a.unshift(...f.getChildren()),f!==u&&o.push(f)}return o}function Go(u){return Yo(u)&&u.tagName==="A"}function Yo(u){return u.nodeType===1}function zi(u){if(vn(u)&&!u.isInline())return!0;if(!Je(u)||Fr(u))return!1;const o=u.getFirstChild(),a=o===null||Di(o)||gt(o)||o.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&a}function Ds(u,o){let a=u;for(;a!==null&&a.getParent()!==null&&!o(a);)a=a.getParentOrThrow();return o(a)?a:null}function Sa(u,o){const a=u._decorators;let _=u._pendingDecorators||a;const E=o._nodeMap;let I;for(I in _)E.has(I)||(_===a&&(_=Cs(u)),delete _[I])}function wl(u,o,a,f,_,E){let I=u.getFirstChild();for(;I!==null;){const F=I.__key;I.__parent===o&&(Je(I)&&wl(I,F,a,f,_,E),a.has(F)||E.delete(F),_.push(F)),I=I.getNextSibling()}}function va(u,o,a,f){const _=u._nodeMap,E=o._nodeMap,I=[];for(const[F]of f){const oe=E.get(F);oe!==void 0&&(oe.isAttached()||(Je(oe)&&wl(oe,F,_,E,I,f),_.has(F)||f.delete(F),I.push(F)))}for(const F of I)E.delete(F);for(const F of a){const oe=E.get(F);oe!==void 0&&!oe.isAttached()&&(_.has(F)||a.delete(F),E.delete(F))}}let Tn="",Gn="",Mr="",xi,Hn,Vt,Ui=!1,go=!1,jo,Ms=null,po,As,Si,ii,Vo,qo;function yn(u,o){const a=Si.get(u);if(o!==null){const f=an(u);f.parentNode===o&&o.removeChild(f)}if(ii.has(u)||Hn._keyToDOMMap.delete(u),Je(a)){const f=_o(a,Si);xn(f,0,f.length-1,null)}a!==void 0&&Wo(qo,Vt,jo,a,"destroyed")}function xn(u,o,a,f){let _=o;for(;_<=a;++_){const E=u[_];E!==void 0&&yn(E,f)}}function Sn(u,o){u.setProperty("text-align",o)}const Ol="40px";function mo(u,o){const a=xi.theme.indent;if(typeof a=="string"){const _=u.classList.contains(a);o>0&&!_?u.classList.add(a):o<1&&_&&u.classList.remove(a)}const f=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||Ol;u.style.setProperty("padding-inline-start",o===0?"":`calc(${o} * ${f})`)}function Dl(u,o){const a=u.style;o===0?Sn(a,""):o===_t?Sn(a,"left"):o===Et?Sn(a,"center"):o===vt?Sn(a,"right"):o===Ot?Sn(a,"justify"):o===Mt?Sn(a,"start"):o===xt&&Sn(a,"end")}function oi(u,o,a){const f=ii.get(u);if(f===void 0)throw Error("createNode: node does not exist in nodeMap");const _=f.createDOM(xi,Hn);if(Ma(u,_,Hn),gt(f)?_.setAttribute("data-lexical-text","true"):vn(f)&&_.setAttribute("data-lexical-decorator","true"),Je(f)){const E=f.__indent,I=f.__size;if(E!==0&&mo(_,E),I!==0){const oe=I-1,de=_o(f,ii);Jn(de,oe,f,_)}const F=f.__format;F!==0&&Dl(_,F),f.isInline()||Ml(null,f,_),zo(f)&&(Tn+=It,Mr+=It)}else{const E=f.getTextContent();if(vn(f)){const I=f.decorate(Hn,xi);I!==null&&yo(u,I),_.contentEditable="false"}else gt(f)&&(f.isDirectionless()||(Gn+=E));Tn+=E,Mr+=E}if(o!==null)if(a!=null)o.insertBefore(_,a);else{const E=o.__lexicalLineBreak;E!=null?o.insertBefore(_,E):o.appendChild(_)}return Object.freeze(f),Wo(qo,Vt,jo,f,"created"),_}function Jn(u,o,a,f){const _=Gn;Gn="",yr(u,a,0,o,f,null),wa(a,f),Gn=_}function yr(u,o,a,f,_,E){const I=Tn;Tn="";let F=a;for(;F<=f;++F)oi(u[F],_,E);zo(o)&&(Tn+=It),_.__lexicalTextContent=Tn,Tn=I+Tn}function ln(u,o){const a=o.get(u);return Di(a)||vn(a)&&a.isInline()}function Ml(u,o,a){const f=u!==null&&(u.__size===0||ln(u.__last,Si)),_=o.__size===0||ln(o.__last,ii);if(f){if(!_){const E=a.__lexicalLineBreak;E!=null&&a.removeChild(E),a.__lexicalLineBreak=null}}else if(_){const E=document.createElement("br");a.__lexicalLineBreak=E,a.appendChild(E)}}function wa(u,o){const a=o.__lexicalDirTextContent,f=o.__lexicalDir;if(a!==Gn||f!==Ms){const _=Gn==="",E=_?Ms:sa(Gn);if(E!==f){const I=o.classList,F=xi.theme;let oe=f!==null?F[f]:void 0,de=E!==null?F[E]:void 0;if(oe!==void 0){if(typeof oe=="string"){const Ne=oe.split(" ");oe=F[f]=Ne}I.remove(...oe)}if(E===null||_&&E==="ltr")o.removeAttribute("dir");else{if(de!==void 0){if(typeof de=="string"){const Ne=de.split(" ");de=F[E]=Ne}de!==void 0&&I.add(...de)}o.dir=E}if(!go){const Ne=u.getWritable();Ne.__dir=E}}Ms=E,o.__lexicalDirTextContent=Gn,o.__lexicalDir=E}}function Lc(u,o,a){const f=Gn;Gn="",Oa(u,o,a),wa(o,a),Gn=f}function _o(u,o){const a=[];let f=u.__first;for(;f!==null;){const _=o.get(f);if(_===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");a.push(f),f=_.__next}return a}function Oa(u,o,a){const f=Tn,_=u.__size,E=o.__size;if(Tn="",_===1&&E===1){const I=u.__first,F=o.__first;if(I===F)Ar(I,a);else{const oe=an(I),de=oi(F,null,null);a.replaceChild(de,oe),yn(I,null)}}else{const I=_o(u,Si),F=_o(o,ii);if(_===0)E!==0&&yr(F,o,0,E-1,a,null);else if(E===0){if(_!==0){const de=a.__lexicalLineBreak==null;xn(I,0,_-1,de?null:a),de&&(a.textContent="")}}else Da(o,I,F,_,E,a)}zo(o)&&(Tn+=It),a.__lexicalTextContent=Tn,Tn=f+Tn}function Ar(u,o){const a=Si.get(u);let f=ii.get(u);if(a===void 0||f===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const _=Ui||As.has(u)||po.has(u),E=vs(Hn,u);if(a===f&&!_){if(Je(a)){const I=E.__lexicalTextContent;I!==void 0&&(Tn+=I,Mr+=I);const F=E.__lexicalDirTextContent;F!==void 0&&(Gn+=F)}else{const I=a.getTextContent();gt(a)&&!a.isDirectionless()&&(Gn+=I),Mr+=I,Tn+=I}return E}if(a!==f&&_&&Wo(qo,Vt,jo,f,"updated"),f.updateDOM(a,E,xi)){const I=oi(u,null,null);if(o===null)throw Error("reconcileNode: parentDOM is null");return o.replaceChild(I,E),yn(u,null),I}if(Je(a)&&Je(f)){const I=f.__indent;I!==a.__indent&&mo(E,I);const F=f.__format;F!==a.__format&&Dl(E,F),_&&(Lc(a,f,E),!br(f)&&!f.isInline()&&Ml(a,f,E)),zo(f)&&(Tn+=It,Mr+=It)}else{const I=f.getTextContent();if(vn(f)){const F=f.decorate(Hn,xi);F!==null&&yo(u,F)}else gt(f)&&!f.isDirectionless()&&(Gn+=I);Tn+=I,Mr+=I}return!go&&br(f)&&f.__cachedText!==Mr&&(f=f.getWritable(),f.__cachedText=Mr),Object.freeze(f),E}function yo(u,o){let a=Hn._pendingDecorators;const f=Hn._decorators;if(a===null){if(f[u]===o)return;a=Cs(Hn)}a[u]=o}function ot(u){return u.firstChild}function Rs(u){let o=u.nextSibling;return o!==null&&o===Hn._blockCursorElement&&(o=o.nextSibling),o}function Da(u,o,a,f,_,E){const I=f-1,F=_-1;let oe,de,Ne=ot(E),Ee=0,xe=0;for(;Ee<=I&&xe<=F;){const Ie=o[Ee],Ae=a[xe];if(Ie===Ae)Ne=Rs(Ar(Ae,E)),Ee++,xe++;else{oe===void 0&&(oe=new Set(o)),de===void 0&&(de=new Set(a));const mt=de.has(Ie),ze=oe.has(Ae);if(!mt)Ne=Rs(an(Ie)),yn(Ie,E),Ee++;else if(!ze)oi(Ae,E,Ne),xe++;else{const tt=vs(Hn,Ae);tt===Ne?Ne=Rs(Ar(Ae,E)):(Ne!=null?E.insertBefore(tt,Ne):E.appendChild(tt),Ar(Ae,E)),Ee++,xe++}}}const Ce=Ee>I,He=xe>F;if(Ce&&!He){const Ie=a[F+1],Ae=Ie===void 0?null:Hn.getElementByKey(Ie);yr(a,u,xe,F,E,Ae)}else He&&!Ce&&xn(o,Ee,I,E)}function sr(u,o,a,f,_,E){Tn="",Mr="",Gn="",Ui=f===dt,Ms=null,Hn=a,xi=a._config,Vt=a._nodes,jo=Hn._listeners.mutation,po=_,As=E,Si=u._nodeMap,ii=o._nodeMap,go=o._readOnly,Vo=new Map(a._keyToDOMMap);const I=new Map;return qo=I,Ar("root",null),Hn=void 0,Vt=void 0,po=void 0,As=void 0,Si=void 0,ii=void 0,xi=void 0,Vo=void 0,qo=void 0,I}function Ma(u,o,a){const f=a._keyToDOMMap;o["__lexicalKey_"+a._key]=u,f.set(u,o)}function an(u){const o=Vo.get(u);if(o===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return o}const Xn=Object.freeze({}),Ze=30,bs=[["keydown",v],["pointerdown",La],["compositionstart",s],["compositionend",N],["input",i],["click",Nr],["cut",Xn],["copy",Xn],["dragstart",Xn],["dragover",Xn],["dragend",Xn],["paste",Xn],["focus",Xn],["blur",Xn],["drop",Xn]];Ue&&bs.push(["beforeinput",(u,o)=>l(u,o)]);let Hr=0,tr=0,Aa=0,vi=null,No=0,Co=!1,wi=!1,Zo=!1,lr=!1,Al=[0,"",0,"root",0];function Ra(u,o,a,f,_){const E=u.anchor,I=u.focus,F=E.getNode(),oe=gn(),de=_r(oe._window),Ne=de!==null?de.anchorNode:null,Ee=E.key,xe=oe.getElementByKey(Ee),Ce=a.length;return Ee!==I.key||!gt(F)||(!_&&(!Ue||Aa<f+50)||F.isDirty()&&Ce<2||gl(a))&&E.offset!==I.offset&&!F.isComposing()||hl(F)||F.isDirty()&&Ce>1||(_||!Ue)&&xe!==null&&!F.isComposing()&&Ne!==Ln(xe)||de!==null&&o!==null&&(!o.collapsed||o.startContainer!==de.anchorNode||o.startOffset!==de.anchorOffset)||F.getFormat()!==u.format||F.getStyle()!==u.style||ti(u,F)}function ba(u,o){return u!==null&&u.nodeValue!==null&&u.nodeType===Ye&&o!==0&&o!==u.nodeValue.length}function Ls(u,o,a){const{anchorNode:f,anchorOffset:_,focusNode:E,focusOffset:I}=u;Co&&(Co=!1,ba(f,_)&&ba(E,I))||Rr(o,()=>{if(!a){Or(null);return}if(!Qr(o,f,E))return;const F=cn();if(pt(F)){const oe=F.anchor,de=oe.getNode();if(F.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&(F.dirty=!0);const Ne=Wi(o).event,Ee=Ne?Ne.timeStamp:performance.now(),[xe,Ce,He,Ie,Ae]=Al,mt=Zn(),ze=o.isComposing()===!1&&mt.getTextContent()==="";Ee<Ae+200&&oe.offset===He&&oe.key===Ie?(F.format=xe,F.style=Ce):oe.type==="text"?(F.format=de.getFormat(),F.style=de.getStyle()):oe.type==="element"&&!ze&&(F.format=0,F.style="")}else{let Ne=je,Ee=!1;const xe=F.getNodes(),Ce=xe.length;for(let He=0;He<Ce;He++){const Ie=xe[He];if(gt(Ie)&&(Ee=!0,Ne&=Ie.getFormat(),Ne===0))break}F.format=Ee?Ne:0}}st(o,e,void 0)})}function Nr(u,o){Rr(o,()=>{const a=cn(),f=_r(o._window),_=Bs();if(f){if(pt(a)){const E=a.anchor,I=E.getNode();if(E.type==="element"&&E.offset===0&&a.isCollapsed()&&!br(I)&&Zn().getChildrenSize()===1&&I.getTopLevelElementOrThrow().isEmpty()&&_!==null&&a.is(_))f.removeAllRanges(),a.dirty=!0;else if(u.detail===3&&!a.isCollapsed()){const oe=a.focus.getNode();I!==oe&&(Je(I)?I.select(0):I.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const E=f.anchorNode;if(E!==null){const I=E.nodeType;if(I===Be||I===Ye){const F=Ic(_,f,o);Or(F)}}}}st(o,n,u)})}function La(u,o){const a=u.target,f=u.pointerType;a instanceof Node&&f!=="touch"&&Rr(o,()=>{xc(a)||(wi=!0)})}function ks(u){if(!u.getTargetRanges)return null;const o=u.getTargetRanges();return o.length===0?null:o[0]}function ka(u,o){return u!==o||Je(u)||Je(o)||!u.isToken()||!o.isToken()}function Jo(u){return tr===229&&u<Hr+Ze}function l(u,o){const a=u.inputType,f=ks(u);a==="deleteCompositionText"||be&&Ea(o)||a!=="insertCompositionText"&&Rr(o,()=>{const _=cn();if(a==="deleteContentBackward"){if(_===null){const Ne=Bs();if(!pt(Ne))return;Or(Ne.clone())}if(pt(_)){if(ce&&_n(_.anchor.key),Jo(u.timeStamp)&&o.isComposing()&&_.anchor.key===_.focus.key){if(_n(null),Hr=0,setTimeout(()=>{Rr(o,()=>{_n(null)})},Ze),pt(_)){const Ee=_.anchor.getNode();Ee.markDirty(),_.format=Ee.getFormat(),_.style=Ee.getStyle()}_.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),st(o,r,!0))}else u.preventDefault(),st(o,r,!0);return}}if(!pt(_))return;const E=u.data;vi!==null&&Ss(!1,o,vi),(!_.dirty||vi!==null)&&_.isCollapsed()&&!br(_.anchor.getNode())&&f!==null&&_.applyDOMRange(f),vi=null;const I=_.anchor,F=_.focus,oe=I.getNode(),de=F.getNode();if(a==="insertText"||a==="insertTranspose"){if(E===`
34
+ `)u.preventDefault(),st(o,c,!1);else if(E===It)u.preventDefault(),st(o,d,void 0);else if(E==null&&u.dataTransfer){const Ne=u.dataTransfer.getData("text/plain");u.preventDefault(),_.insertRawText(Ne)}else E!=null&&Ra(_,f,E,u.timeStamp,!0)?(u.preventDefault(),st(o,g,E)):vi=E;Aa=u.timeStamp;return}switch(u.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{st(o,g,u);break}case"insertFromComposition":{_n(null),st(o,g,u);break}case"insertLineBreak":{_n(null),st(o,c,!1);break}case"insertParagraph":{_n(null),Zo&&!te?(Zo=!1,st(o,c,!1)):st(o,d,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{st(o,p,u);break}case"deleteByComposition":{ka(oe,de)&&st(o,C,u);break}case"deleteByDrag":case"deleteByCut":{st(o,C,u);break}case"deleteContent":{st(o,r,!1);break}case"deleteWordBackward":{st(o,S,!0);break}case"deleteWordForward":{st(o,S,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{st(o,T,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{st(o,T,!1);break}case"formatStrikeThrough":{st(o,O,"strikethrough");break}case"formatBold":{st(o,O,"bold");break}case"formatItalic":{st(o,O,"italic");break}case"formatUnderline":{st(o,O,"underline");break}case"historyUndo":{st(o,R,void 0);break}case"historyRedo":{st(o,b,void 0);break}}})}function i(u,o){u.stopPropagation(),Rr(o,()=>{const a=cn(),f=u.data,_=ks(u);if(f!=null&&pt(a)&&Ra(a,_,f,u.timeStamp,!1)){lr&&(h(o,f),lr=!1);const E=a.anchor,I=E.getNode(),F=_r(o._window);if(F===null)return;const oe=E.offset;(!Ue||a.isCollapsed()||!gt(I)||F.anchorNode===null||I.getTextContent().slice(0,oe)+f+I.getTextContent().slice(oe+a.focus.offset)!==lo(F.anchorNode))&&st(o,g,f);const de=f.length;be&&de>1&&u.inputType==="insertCompositionText"&&!o.isComposing()&&(a.anchor.offset-=de),!re&&!te&&!Le&&o.isComposing()&&(Hr=0,_n(null))}else Ss(!1,o,f!==null?f:void 0),lr&&(h(o,f||void 0),lr=!1);la()}),vi=null}function s(u,o){Rr(o,()=>{const a=cn();if(pt(a)&&!o.isComposing()){const f=a.anchor,_=a.anchor.getNode();_n(f.key),(u.timeStamp<Hr+Ze||f.type==="element"||!a.isCollapsed()||_.getFormat()!==a.format||_.getStyle()!==a.style)&&st(o,g,hr)}})}function h(u,o){const a=u._compositionKey;if(_n(null),a!==null&&o!=null){if(o===""){const f=En(a),_=Ln(u.getElementByKey(a));_!==null&&_.nodeValue!==null&&gt(f)&&Po(f,_.nodeValue,null,null,!0);return}if(o[o.length-1]===`
35
+ `){const f=cn();if(pt(f)){const _=f.focus;f.anchor.set(_.key,_.offset,_.type),st(u,z,null);return}}}Ss(!0,u,o)}function N(u,o){be?lr=!0:Rr(o,()=>{h(o,u.data)})}function v(u,o){if(Hr=u.timeStamp,tr=u.keyCode,o.isComposing())return;const{keyCode:a,shiftKey:f,ctrlKey:_,metaKey:E,altKey:I}=u;if(!st(o,x,u)){if(Mc(a,_,I,E))st(o,w,u);else if(ya(a,_,f,I,E))st(o,$,u);else if(Nl(a,_,I,E))st(o,W,u);else if(Dc(a,_,f,I,E))st(o,P,u);else if(co(a,_,E))st(o,H,u);else if(Na(a,_,E))st(o,B,u);else if(Fo(a,f))Zo=!0,st(o,z,u);else if(Cl(a))st(o,X,u);else if(_l(a,_))u.preventDefault(),Zo=!0,st(o,c,!0);else if(ao(a,f))Zo=!1,st(o,z,u);else if(fa(a,I,E,_))Pr(a)?st(o,ee,u):(u.preventDefault(),st(o,r,!0));else if(Rc(a))st(o,le,u);else if(ha(a,_,f,I,E))$r(a)?st(o,j,u):(u.preventDefault(),st(o,r,!1));else if(yl(a,I,_))u.preventDefault(),st(o,S,!0);else if(Bo(a,I,_))u.preventDefault(),st(o,S,!1);else if(Ho(a,E))u.preventDefault(),st(o,T,!0);else if(da(a,E))u.preventDefault(),st(o,T,!1);else if($o(a,I,E,_))u.preventDefault(),st(o,O,"bold");else if(ua(a,I,E,_))u.preventDefault(),st(o,O,"underline");else if(ca(a,I,E,_))u.preventDefault(),st(o,O,"italic");else if(ml(a,I,_,E))st(o,U,u);else if(ga(a,f,E,_))u.preventDefault(),st(o,R,void 0);else if(Sc(a,f,E,_))u.preventDefault(),st(o,b,void 0);else{const F=o._editorState._selection;Er(F)?vc(a,f,E,_)?(u.preventDefault(),st(o,ne,u)):pa(a,f,E,_)?(u.preventDefault(),st(o,Y,u)):Ei(a,E,_)&&(u.preventDefault(),st(o,G,u)):!be&&Ei(a,E,_)&&(u.preventDefault(),st(o,G,u))}Ac(_,f,I,E)&&st(o,ae,u)}}function M(u){let o=u.__lexicalEventHandles;return o===void 0&&(o=[],u.__lexicalEventHandles=o),o}const J=new Map;function ge(u){const o=u.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,f=_r(a);if(f===null)return;const _=Lo(f.anchorNode);if(_===null)return;wi&&(wi=!1,Rr(_,()=>{const Ne=Bs(),Ee=f.anchorNode;if(Ee===null)return;const xe=Ee.nodeType;if(xe!==Be&&xe!==Ye)return;const Ce=Ic(Ne,f,_);Or(Ce)}));const E=xs(_),I=E[E.length-1],F=I._key,oe=J.get(F),de=oe||I;de!==_&&Ls(f,de,!1),Ls(f,_,!0),_!==I?J.set(F,_):oe&&J.delete(F)}function ve(u){u._lexicalHandled=!0}function Fe(u){return u._lexicalHandled===!0}function Ke(u,o){No===0&&u.ownerDocument.addEventListener("selectionchange",ge),No++,u.__lexicalEditor=o;const a=M(u);for(let f=0;f<bs.length;f++){const[_,E]=bs[f],I=typeof E=="function"?F=>{Fe(F)||(ve(F),o.isEditable()&&E(F,o))}:F=>{if(!Fe(F)&&(ve(F),o.isEditable()))switch(_){case"cut":return st(o,Y,F);case"copy":return st(o,ne,F);case"paste":return st(o,p,F);case"dragstart":return st(o,K,F);case"dragover":return st(o,D,F);case"dragend":return st(o,V,F);case"focus":return st(o,A,F);case"blur":return st(o,Z,F);case"drop":return st(o,pe,F)}};u.addEventListener(_,I),a.push(()=>{u.removeEventListener(_,I)})}}function ke(u){No!==0&&(No--,No===0&&u.ownerDocument.removeEventListener("selectionchange",ge));const o=u.__lexicalEditor;o!=null&&(Me(o),u.__lexicalEditor=null);const a=M(u);for(let f=0;f<a.length;f++)a[f]();u.__lexicalEventHandles=[]}function Me(u){if(u._parentEditor!==null){const o=xs(u),f=o[o.length-1]._key;J.get(f)===u&&J.delete(f)}else J.delete(u._key)}function Xe(){Co=!0}function ut(u,o,a,f,_){Al=[u,o,a,f,_]}function Tt(u,o,a){nr();const f=u.__key,_=u.getParent();if(_===null)return;const E=Bn(u);let I=!1;if(pt(E)&&o){const F=E.anchor,oe=E.focus;F.key===f&&(Ka(F,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0),oe.key===f&&(Ka(oe,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0)}else Er(E)&&o&&u.isSelected()&&u.selectPrevious();if(pt(E)&&o&&!I){const F=u.getIndexWithinParent();yi(u),Wa(E,_,F,-1)}else yi(u);!a&&!Fr(_)&&!_.canBeEmpty()&&_.isEmpty()&&Tt(_,o),o&&br(_)&&_.isEmpty()&&_.selectEnd()}class At{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(o){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(o){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Fn(this,o),this.__type!=="root"&&(nr(),hn(this.__type,this.constructor))}getType(){return this.__type}isAttached(){let o=this.__key;for(;o!==null;){if(o==="root")return!0;const a=En(o);if(a===null)break;o=a.__parent}return!1}isSelected(o){const a=o||cn();if(a==null)return!1;const f=a.getNodes().some(_=>_.__key===this.__key);return gt(this)?f:pt(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 o=this.getParent();if(o===null)return-1;let a=o.getFirstChild(),f=0;for(;a!==null;){if(this.is(a))return f;f++,a=a.getNextSibling()}return-1}getParent(){const o=this.getLatest().__parent;return o===null?null:En(o)}getParentOrThrow(){const o=this.getParent();if(o===null)throw Error(`Expected node ${this.__key} to have a parent.`);return o}getTopLevelElement(){let o=this;for(;o!==null;){const a=o.getParent();if(Fr(a))return o;o=a}return null}getTopLevelElementOrThrow(){const o=this.getTopLevelElement();if(o===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return o}getParents(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a),a=a.getParent();return o}getParentKeys(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a.__key),a=a.getParent();return o}getPreviousSibling(){const a=this.getLatest().__prev;return a===null?null:En(a)}getPreviousSiblings(){const o=[],a=this.getParent();if(a===null)return o;let f=a.getFirstChild();for(;f!==null&&!f.is(this);)o.push(f),f=f.getNextSibling();return o}getNextSibling(){const a=this.getLatest().__next;return a===null?null:En(a)}getNextSiblings(){const o=[];let a=this.getNextSibling();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getCommonAncestor(o){const a=this.getParents(),f=o.getParents();Je(this)&&a.unshift(this),Je(o)&&f.unshift(o);const _=a.length,E=f.length;if(_===0||E===0||a[_-1]!==f[E-1])return null;const I=new Set(f);for(let F=0;F<_;F++){const oe=a[F];if(I.has(oe))return oe}return null}is(o){return o==null?!1:this.__key===o.__key}isBefore(o){if(this===o)return!1;if(o.isParentOf(this))return!0;if(this.isParentOf(o))return!1;const a=this.getCommonAncestor(o);let f=0,_=0,E=this;for(;;){const I=E.getParentOrThrow();if(I===a){f=E.getIndexWithinParent();break}E=I}for(E=o;;){const I=E.getParentOrThrow();if(I===a){_=E.getIndexWithinParent();break}E=I}return f<_}isParentOf(o){const a=this.__key;if(a===o.__key)return!1;let f=o;for(;f!==null;){if(f.__key===a)return!0;f=f.getParent()}return!1}getNodesBetween(o){const a=this.isBefore(o),f=[],_=new Set;let E=this;for(;;){const I=E.__key;if(_.has(I)||(_.add(I),f.push(E)),E===o)break;const F=Je(E)?a?E.getFirstChild():E.getLastChild():null;if(F!==null){E=F;continue}const oe=a?E.getNextSibling():E.getPreviousSibling();if(oe!==null){E=oe;continue}const de=E.getParentOrThrow();if(_.has(de.__key)||f.push(de),de===o)break;let Ne=null,Ee=de;do{if(Ee===null)throw Error("getNodesBetween: ancestor is null");Ne=a?Ee.getNextSibling():Ee.getPreviousSibling(),Ee=Ee.getParent(),Ee!==null&&Ne===null&&!_.has(Ee.__key)&&f.push(Ee)}while(Ne===null);E=Ne}return a||f.reverse(),f}isDirty(){const a=gn()._dirtyLeaves;return a!==null&&a.has(this.__key)}getLatest(){const o=En(this.__key);if(o===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 o}getWritable(){nr();const o=bi(),a=gn(),f=o._nodeMap,_=this.__key,E=this.getLatest(),I=E.__parent,F=a._cloneNotNeeded,oe=cn();if(Cr(oe)&&oe.setCachedNodes(null),F.has(_))return oo(E),E;const Ne=E.constructor.clone(E);return Ne.__parent=I,Ne.__next=E.__next,Ne.__prev=E.__prev,Je(E)&&Je(Ne)?(Ne.__first=E.__first,Ne.__last=E.__last,Ne.__size=E.__size,Ne.__indent=E.__indent,Ne.__format=E.__format,Ne.__dir=E.__dir):gt(E)&&gt(Ne)&&(Ne.__format=E.__format,Ne.__style=E.__style,Ne.__mode=E.__mode,Ne.__detail=E.__detail),F.add(_),Ne.__key=_,oo(Ne),f.set(_,Ne),Ne}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(o,a){throw Error("createDOM: base method not extended")}updateDOM(o,a,f){throw Error("updateDOM: base method not extended")}exportDOM(o){return{element:this.createDOM(o._config,o)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(o){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(o){Tt(this,!0,o)}replace(o,a){nr();let f=cn();f!==null&&(f=f.clone()),Br(this,o);const _=this.getLatest(),E=this.__key,I=o.__key,F=o.getWritable(),oe=this.getParentOrThrow().getWritable(),de=oe.__size;yi(F);const Ne=_.getPreviousSibling(),Ee=_.getNextSibling(),xe=_.__prev,Ce=_.__next,He=_.__parent;if(Tt(_,!1,!0),Ne===null)oe.__first=I;else{const Ie=Ne.getWritable();Ie.__next=I}if(F.__prev=xe,Ee===null)oe.__last=I;else{const Ie=Ee.getWritable();Ie.__prev=I}if(F.__next=Ce,F.__parent=He,oe.__size=de,a&&this.getChildren().forEach(Ie=>{F.append(Ie)}),pt(f)){Or(f);const Ie=f.anchor,Ae=f.focus;Ie.key===E&&Ba(Ie,F),Ae.key===E&&Ba(Ae,F)}return Ir()===E&&_n(I),F}insertAfter(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.getParent(),I=cn();let F=!1,oe=!1;if(E!==null){const Ce=o.getIndexWithinParent();if(yi(_),pt(I)){const He=E.__key,Ie=I.anchor,Ae=I.focus;F=Ie.type==="element"&&Ie.key===He&&Ie.offset===Ce+1,oe=Ae.type==="element"&&Ae.key===He&&Ae.offset===Ce+1}}const de=this.getNextSibling(),Ne=this.getParentOrThrow().getWritable(),Ee=_.__key,xe=f.__next;if(de===null)Ne.__last=Ee;else{const Ce=de.getWritable();Ce.__prev=Ee}if(Ne.__size++,f.__next=Ee,_.__next=xe,_.__prev=f.__key,_.__parent=f.__parent,a&&pt(I)){const Ce=this.getIndexWithinParent();Wa(I,Ne,Ce+1);const He=Ne.__key;F&&I.anchor.set(He,Ce+2,"element"),oe&&I.focus.set(He,Ce+2,"element")}return o}insertBefore(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.__key;yi(_);const I=this.getPreviousSibling(),F=this.getParentOrThrow().getWritable(),oe=f.__prev,de=this.getIndexWithinParent();if(I===null)F.__first=E;else{const Ee=I.getWritable();Ee.__next=E}F.__size++,f.__prev=E,_.__prev=oe,_.__next=f.__key,_.__parent=f.__parent;const Ne=cn();if(a&&pt(Ne)){const Ee=this.getParentOrThrow();Wa(Ne,Ee,de)}return o}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(o,a){nr();const f=this.getPreviousSibling(),_=this.getParentOrThrow();if(f===null)return _.select(0,0);if(Je(f))return f.select();if(!gt(f)){const E=f.getIndexWithinParent()+1;return _.select(E,E)}return f.select(o,a)}selectNext(o,a){nr();const f=this.getNextSibling(),_=this.getParentOrThrow();if(f===null)return _.select();if(Je(f))return f.select(0,0);if(!gt(f)){const E=f.getIndexWithinParent();return _.select(E,E)}return f.select(o,a)}markDirty(){this.getWritable()}}function hn(u,o){const a=gn()._nodes.get(u);if(a===void 0)throw Error(`Create node: Attempted to create node ${o.name} that was not configured to be used on the editor.`);const f=a.klass;if(f!==o)throw Error(`Create node: Type ${u} in node ${o.name} does not match registered node ${f.name} with the same type`)}function ar(u,o,a){const f=o.getParentOrThrow().getLastChild();let _=o;const E=[o];for(;_!==f;){if(!_.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");_=_.getNextSibling(),E.push(_)}let I=u;for(const F of E)I=I.insertAfter(F)}class Wr extends At{static getType(){return"linebreak"}static clone(o){return new Wr(o.__key)}constructor(o){super(o)}getTextContent(){return`
36
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:o=>{const a=o.parentElement;let f,_;return a!==null&&((f=a.firstChild)===o||f.nextSibling===o&&f.nodeType===Ye&&(f.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((_=a.lastChild)===o||_.previousSibling===o&&_.nodeType===Ye&&(_.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:si,priority:0}}}}static importJSON(o){return Oi()}exportJSON(){return{type:"linebreak",version:1}}}function si(u){return{node:Oi()}}function Oi(){return fo(new Wr)}function Di(u){return u instanceof Wr}function Eo(u,o){return o&qe?"code":o&kt?"mark":o&Qe?"sub":o&ft?"sup":null}function Rl(u,o){return o&Oe?"strong":o&Re?"em":"span"}function Is(u,o,a,f,_){const E=f.classList;let I=Hi(_,"base");I!==void 0&&E.add(...I),I=Hi(_,"underlineStrikethrough");let F=!1;const oe=o&We&&o&De,de=a&We&&a&De;I!==void 0&&(de?(F=!0,oe||E.add(...I)):oe&&E.remove(...I));for(const Ne in fn){const xe=fn[Ne];if(I=Hi(_,Ne),I!==void 0)if(a&xe){if(F&&(Ne==="underline"||Ne==="strikethrough")){o&xe&&E.remove(...I);continue}(!(o&xe)||oe&&Ne==="underline"||Ne==="strikethrough")&&E.add(...I)}else o&xe&&E.remove(...I)}}function Kr(u,o){const a=u.length,f=o.length;let _=0,E=0;for(;_<a&&_<f&&u[_]===o[_];)_++;for(;E+_<a&&E+_<f&&u[a-E-1]===o[f-E-1];)E++;return[_,a-_-E,o.slice(_,f-E)]}function To(u,o,a){const f=o.firstChild,_=a.isComposing(),I=u+(_?Ut:"");if(f==null)o.textContent=I;else{const F=f.nodeValue;if(F!==I)if(_||be){const[oe,de,Ne]=Kr(F,I);de!==0&&f.deleteData(oe,de),f.insertData(oe,Ne)}else f.nodeValue=I}}function Ps(u,o,a,f,_,E){To(_,u,o);const F=E.theme.text;F!==void 0&&Is(a,0,f,u,F)}function Xo(u,o){const a=document.createElement(o);return a.appendChild(u),a}class Gi extends At{static getType(){return"text"}static clone(o){return new Gi(o.__text,o.__key)}constructor(o,a){super(a),this.__text=o,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const o=this.getLatest();return Ge[o.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===ie}isComposing(){return this.__key===Ir()}isSegmented(){return this.getLatest().__mode===fe}isDirectionless(){return(this.getLatest().__detail&Ve)!==0}isUnmergeable(){return(this.getLatest().__detail&rt)!==0}hasFormat(o){const a=fn[o];return(this.getFormat()&a)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(o,a){const _=this.getLatest().__format;return wr(_,o,a)}createDOM(o){const a=this.__format,f=Eo(this,a),_=Rl(this,a),E=f===null?_:f,I=document.createElement(E);let F=I;this.hasFormat("code")&&I.setAttribute("spellcheck","false"),f!==null&&(F=document.createElement(_),I.appendChild(F));const oe=this.__text;Ps(F,this,_,a,oe,o);const de=this.__style;return de!==""&&(I.style.cssText=de),I}updateDOM(o,a,f){const _=this.__text,E=o.__format,I=this.__format,F=Eo(this,E),oe=Eo(this,I),de=Rl(this,E),Ne=Rl(this,I);if((F===null?de:F)!==(oe===null?Ne:oe))return!0;if(F===oe&&de!==Ne){const ze=a.firstChild;if(ze==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const tt=document.createElement(Ne);return Ps(tt,this,Ne,I,_,f),a.replaceChild(tt,ze),!1}let Ce=a;if(oe!==null&&F!==null&&(Ce=a.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");To(_,Ce,this);const Ie=f.theme.text;Ie!==void 0&&E!==I&&Is(Ne,E,I,Ce,Ie);const Ae=o.__style,mt=this.__style;return Ae!==mt&&(a.style.cssText=mt),!1}static importDOM(){return{"#text":()=>({conversion:Ll,priority:0}),b:()=>({conversion:Pa,priority:0}),code:()=>({conversion:zr,priority:0}),em:()=>({conversion:zr,priority:0}),i:()=>({conversion:zr,priority:0}),s:()=>({conversion:zr,priority:0}),span:()=>({conversion:Ia,priority:0}),strong:()=>({conversion:zr,priority:0}),sub:()=>({conversion:zr,priority:0}),sup:()=>({conversion:zr,priority:0}),u:()=>({conversion:zr,priority:0})}}static importJSON(o){const a=Wn(o.text);return a.setFormat(o.format),a.setDetail(o.detail),a.setMode(o.mode),a.setStyle(o.style),a}exportDOM(o){let{element:a}=super.exportDOM(o);if(!(a!==null&&Yo(a)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return a.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(a=Xo(a,"b")),this.hasFormat("italic")&&(a=Xo(a,"i")),this.hasFormat("strikethrough")&&(a=Xo(a,"s")),this.hasFormat("underline")&&(a=Xo(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(o,a){}setFormat(o){const a=this.getWritable();return a.__format=typeof o=="string"?fn[o]:o,a}setDetail(o){const a=this.getWritable();return a.__detail=typeof o=="string"?gr[o]:o,a}setStyle(o){const a=this.getWritable();return a.__style=o,a}toggleFormat(o){const a=this.getFormat(),f=wr(a,o,null);return this.setFormat(f)}toggleDirectionless(){const o=this.getWritable();return o.__detail^=Ve,o}toggleUnmergeable(){const o=this.getWritable();return o.__detail^=rt,o}setMode(o){const a=ye[o];if(this.__mode===a)return this;const f=this.getWritable();return f.__mode=a,f}setTextContent(o){if(this.__text===o)return this;const a=this.getWritable();return a.__text=o,a}select(o,a){nr();let f=o,_=a;const E=cn(),I=this.getTextContent(),F=this.__key;if(typeof I=="string"){const oe=I.length;f===void 0&&(f=oe),_===void 0&&(_=oe)}else f=0,_=0;if(pt(E)){const oe=Ir();(oe===E.anchor.key||oe===E.focus.key)&&_n(F),E.setTextNodeRange(this,f,this,_)}else return Hd(F,f,F,_,"text","text");return E}selectStart(){return this.select(0,0)}selectEnd(){const o=this.getTextContentSize();return this.select(o,o)}spliceText(o,a,f,_){const E=this.getWritable(),I=E.__text,F=f.length;let oe=o;oe<0&&(oe=F+oe,oe<0&&(oe=0));const de=cn();if(_&&pt(de)){const Ee=o+F;de.setTextNodeRange(E,Ee,E,Ee)}const Ne=I.slice(0,oe)+f+I.slice(oe+a);return E.__text=Ne,E}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...o){nr();const a=this.getLatest(),f=a.getTextContent(),_=a.__key,E=Ir(),I=new Set(o),F=[],oe=f.length;let de="";for(let St=0;St<oe;St++)de!==""&&I.has(St)&&(F.push(de),de=""),de+=f[St];de!==""&&F.push(de);const Ne=F.length;if(Ne===0)return[];if(F[0]===f)return[a];const Ee=F[0],xe=a.getParentOrThrow();let Ce;const He=a.getFormat(),Ie=a.getStyle(),Ae=a.__detail;let mt=!1;a.isSegmented()?(Ce=Wn(Ee),Ce.__format=He,Ce.__style=Ie,Ce.__detail=Ae,mt=!0):(Ce=a.getWritable(),Ce.__text=Ee);const ze=cn(),tt=[Ce];let Ft=Ee.length;for(let St=1;St<Ne;St++){const Wt=F[St],Zt=Wt.length,pn=Wn(Wt).getWritable();pn.__format=He,pn.__style=Ie,pn.__detail=Ae;const qt=pn.__key,Dn=Ft+Zt;if(pt(ze)){const ai=ze.anchor,Zi=ze.focus;ai.key===_&&ai.type==="text"&&ai.offset>Ft&&ai.offset<=Dn&&(ai.key=qt,ai.offset-=Ft,ze.dirty=!0),Zi.key===_&&Zi.type==="text"&&Zi.offset>Ft&&Zi.offset<=Dn&&(Zi.key=qt,Zi.offset-=Ft,ze.dirty=!0)}E===_&&_n(qt),Ft=Dn,tt.push(pn)}Ns(this);const Rt=xe.getWritable(),Ct=this.getIndexWithinParent();return mt?(Rt.splice(Ct,0,tt),this.remove()):Rt.splice(Ct,1,tt),pt(ze)&&Wa(ze,xe,Ct,Ne-1),tt}mergeWithSibling(o){const a=o===this.getPreviousSibling();if(!a&&o!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const f=this.__key,_=o.__key,E=this.__text,I=E.length;Ir()===_&&_n(f);const oe=cn();if(pt(oe)){const xe=oe.anchor,Ce=oe.focus;xe!==null&&xe.key===_&&(Kd(xe,a,f,o,I),oe.dirty=!0),Ce!==null&&Ce.key===_&&(Kd(Ce,a,f,o,I),oe.dirty=!0)}const de=o.__text,Ne=a?de+E:E+de;this.setTextContent(Ne);const Ee=this.getWritable();return o.remove(),Ee}isTextEntity(){return!1}}function Ia(u){const o=u,a=o.style.fontWeight==="700",f=o.style.textDecoration==="line-through",_=o.style.fontStyle==="italic",E=o.style.textDecoration==="underline",I=o.style.verticalAlign;return{forChild:F=>(gt(F)&&(a&&F.toggleFormat("bold"),f&&F.toggleFormat("strikethrough"),_&&F.toggleFormat("italic"),E&&F.toggleFormat("underline"),I==="sub"&&F.toggleFormat("subscript"),I==="super"&&F.toggleFormat("superscript")),F),node:null}}function Pa(u){const a=u.style.fontWeight==="normal";return{forChild:f=>(gt(f)&&!a&&f.toggleFormat("bold"),f),node:null}}const Qo=new WeakMap;function $a(u){return u.nodeName==="PRE"||u.nodeType===Be&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function bl(u){let o,a=u.parentNode;const f=[u];for(;a!==null&&(o=Qo.get(a))===void 0&&!$a(a);)f.push(a),a=a.parentNode;const _=o===void 0?a:o;for(let E=0;E<f.length;E++)Qo.set(f[E],_);return _}function Ll(u){const o=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let f=o.textContent||"";if(bl(o)!==null){const _=f.split(/(\r?\n|\t)/),E=[],I=_.length;for(let F=0;F<I;F++){const oe=_[F];oe===`
37
37
  `||oe===`\r
38
- `?E.push(Oi()):oe===" "?E.push(Yi()):oe!==""&&E.push(Wn(oe))}return{node:E}}if(f=f.replace(/\r/g,"").replace(/[ \t\n]+/g," "),f==="")return{node:null};if(f[0]===" "){let _=o,E=!0;for(;_!==null&&(_=xo(_,!1))!==null;){const I=_.textContent||"";if(I.length>0){/[ \t\n]$/.test(I)&&(f=f.slice(1)),E=!1;break}}E&&(f=f.slice(1))}if(f[f.length-1]===" "){let _=o,E=!0;for(;_!==null&&(_=xo(_,!0))!==null;)if((_.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){E=!1;break}E&&(f=f.slice(0,f.length-1))}return f===""?{node:null}:{node:Wn(f)}}const Fa=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 xo(u,o){let a=u;for(;;){let f;for(;(f=o?a.nextSibling:a.previousSibling)===null;){const E=a.parentElement;if(E===null)return null;a=E}if(a=f,a.nodeType===Be){const E=a.style.display;if(E===""&&a.nodeName.match(Fa)===null||E!==""&&!E.startsWith("inline"))return null}let _=a;for(;(_=o?a.firstChild:a.lastChild)!==null;)a=_;if(a.nodeType===Ye)return a;if(a.nodeName==="BR")return null}}const $s={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function zr(u){const o=$s[u.nodeName.toLowerCase()];return o===void 0?{node:null}:{forChild:a=>(gt(a)&&!a.hasFormat(o)&&a.toggleFormat(o),a),node:null}}function Wn(u=""){return fo(new Gi(u))}function gt(u){return u instanceof Gi}class Mi extends Gi{static getType(){return"tab"}static clone(o){const a=new Mi(o.__key);return a.__text=o.__text,a.__format=o.__format,a.__style=o.__style,a}constructor(o){super(" ",o),this.__detail=rt}static importDOM(){return null}static importJSON(o){const a=Yi();return a.setFormat(o.format),a.setStyle(o.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(o){throw Error("TabNode does not support setTextContent")}setDetail(o){throw Error("TabNode does not support setDetail")}setMode(o){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Yi(){return fo(new Mi)}function es(u){return u instanceof Mi}class Ai{constructor(o,a,f){this._selection=null,this.key=o,this.offset=a,this.type=f}is(o){return this.key===o.key&&this.offset===o.offset&&this.type===o.type}isBefore(o){let a=this.getNode(),f=o.getNode();const _=this.offset,E=o.offset;if(Je(a)){const I=a.getDescendantByIndex(_);a=I??a}if(Je(f)){const I=f.getDescendantByIndex(E);f=I??f}return a===f?_<E:a.isBefore(f)}getNode(){const o=this.key,a=En(o);if(a===null)throw Error("Point.getNode: node not found");return a}set(o,a,f){const _=this._selection,E=this.key;this.key=o,this.offset=a,this.type=f,Hs()||(Ir()===E&&_n(o),_!==null&&(_.setCachedNodes(null),_.dirty=!0))}}function Ur(u,o,a){return new Ai(u,o,a)}function ts(u,o){let a=o.__key,f=u.offset,_="element";if(gt(o)){_="text";const E=o.getTextContentSize();f>E&&(f=E)}else if(!Je(o)){const E=o.getNextSibling();if(gt(E))a=E.__key,f=0,_="text";else{const I=o.getParent();I&&(a=I.__key,f=o.getIndexWithinParent()+1)}}u.set(a,f,_)}function Ba(u,o){if(Je(o)){const a=o.getLastDescendant();Je(a)||gt(a)?ts(u,a):ts(u,o)}else ts(u,o)}function kl(u,o,a,f){const _=u.getNode(),E=_.getChildAtIndex(u.offset),I=Wn(),F=br(_)?qi().append(I):I;I.setFormat(a),I.setStyle(f),E===null?_.append(F):E.insertBefore(F),u.is(o)&&o.set(I.__key,0,"text"),u.set(I.__key,0,"text")}function li(u,o,a,f){u.key=o,u.offset=a,u.type=f}class rn{constructor(o,a){this.anchor=o,this.focus=a,o._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return Cr(o)?this.anchor.is(o.anchor)&&this.focus.is(o.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return er(this)}}class kn{constructor(o){this.dirty=!1,this._nodes=o,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){if(!Er(o))return!1;const a=this._nodes,f=o._nodes;return a.size===f.size&&Array.from(a).every(_=>f.has(_))}add(o){this.dirty=!0,this._nodes.add(o),this._cachedNodes=null}delete(o){this.dirty=!0,this._nodes.delete(o),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(o){return this._nodes.has(o)}clone(){return new kn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(o){}insertText(){}insertNodes(o){const a=this.getNodes(),f=a.length,_=a[f-1];let E;if(gt(_))E=_.select();else{const I=_.getIndexWithinParent()+1;E=_.getParentOrThrow().select(I,I)}E.insertNodes(o);for(let I=0;I<f;I++)a[I].remove()}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this._nodes,f=[];for(const _ of a){const E=En(_);E!==null&&f.push(E)}return Hs()||(this._cachedNodes=f),f}getTextContent(){const o=this.getNodes();let a="";for(let f=0;f<o.length;f++)a+=o[f].getTextContent();return a}}function pt(u){return u instanceof In}function Cr(u){return u instanceof rn}function ji(u){const[o,,a]=zd(u),f=a.getChildren(),_=f.length,E=f[0].getChildren().length,I=new Array(_);for(let F=0;F<_;F++)I[F]=new Array(E);for(let F=0;F<_;F++){const de=f[F].getChildren();let Ne=0;for(let Ee=0;Ee<de.length;Ee++){for(;I[F][Ne];)Ne++;const xe=de[Ee],Ce=xe.__rowSpan||1,He=xe.__colSpan||1;for(let Ie=0;Ie<Ce;Ie++)for(let Ae=0;Ae<He;Ae++)I[F+Ie][Ne+Ae]=xe;if(o===xe)return{colSpan:He,columnIndex:Ne,rowIndex:F,rowSpan:Ce};Ne+=He}}return null}class Qn extends rn{constructor(o,a,f){super(a,f),this.gridKey=o}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return cr(o)?this.gridKey===o.gridKey&&this.anchor.is(o.anchor)&&this.focus.is(o.focus):!1}set(o,a,f){this.dirty=!0,this.gridKey=o,this.anchor.key=a,this.focus.key=f,this._cachedNodes=null}clone(){return new Qn(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(o){}insertText(){}insertNodes(o){const a=this.focus.getNode();Bi(a.select(0,a.getChildrenSize())).insertNodes(o)}getShape(){const o=En(this.anchor.key);if(!Gr(o))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const a=ji(o);if(a===null)throw Error("getCellRect: expected to find AnchorNode");const f=En(this.focus.key);if(!Gr(f))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const _=ji(f);if(_===null)throw Error("getCellRect: expected to find focusCellNode");const E=Math.min(a.columnIndex,_.columnIndex),I=Math.max(a.columnIndex,_.columnIndex),F=Math.min(a.rowIndex,_.rowIndex),oe=Math.max(a.rowIndex,_.rowIndex);return{fromX:Math.min(E,I),fromY:Math.min(F,oe),toX:Math.max(E,I),toY:Math.max(F,oe)}}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this.anchor.getNode(),f=this.focus.getNode(),_=Uo(a,Gr),E=Uo(f,Gr);if(!Gr(_))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!Gr(E))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const I=_.getParent();if(!Pl(I))throw Error("Expected anchorCell to have a parent GridRowNode");const F=I.getParent();if(!Wc(F))throw Error("Expected tableNode to have a parent GridNode");const oe=E.getParents()[1];if(oe!==F){if(F.isParentOf(E)){const St=oe.getParent();if(St==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,E.getKey(),St.getKey())}else{const St=F.getParent();if(St==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,St.getKey(),E.getKey())}return this.getNodes()}const[de,Ne,Ee]=Kd(F,_,E);let xe=Math.min(Ne.startColumn,Ee.startColumn),Ce=Math.min(Ne.startRow,Ee.startRow),He=Math.max(Ne.startColumn+Ne.cell.__colSpan-1,Ee.startColumn+Ee.cell.__colSpan-1),Ie=Math.max(Ne.startRow+Ne.cell.__rowSpan-1,Ee.startRow+Ee.cell.__rowSpan-1),Ae=xe,mt=Ce,ze=xe,tt=Ce;function Ft(St){const{cell:Wt,startColumn:Zt,startRow:pn}=St;xe=Math.min(xe,Zt),Ce=Math.min(Ce,pn),He=Math.max(He,Zt+Wt.__colSpan-1),Ie=Math.max(Ie,pn+Wt.__rowSpan-1)}for(;xe<Ae||Ce<mt||He>ze||Ie>tt;){if(xe<Ae){const St=tt-mt,Wt=Ae-1;for(let Zt=0;Zt<=St;Zt++)Ft(de[mt+Zt][Wt]);Ae=Wt}if(Ce<mt){const St=ze-Ae,Wt=mt-1;for(let Zt=0;Zt<=St;Zt++)Ft(de[Wt][Ae+Zt]);mt=Wt}if(He>ze){const St=tt-mt,Wt=ze+1;for(let Zt=0;Zt<=St;Zt++)Ft(de[mt+Zt][Wt]);ze=Wt}if(Ie>tt){const St=ze-Ae,Wt=tt+1;for(let Zt=0;Zt<=St;Zt++)Ft(de[Wt][Ae+Zt]);tt=Wt}}const Rt=[F];let Ct=null;for(let St=Ce;St<=Ie;St++)for(let Wt=xe;Wt<=He;Wt++){const{cell:Zt}=de[St][Wt],pn=Zt.getParent();if(!Pl(pn))throw Error("Expected GridCellNode parent to be a GridRowNode");pn!==Ct&&Rt.push(pn),Rt.push(Zt,...Ki(Zt)),Ct=pn}return Hs()||(this._cachedNodes=Rt),Rt}getTextContent(){const o=this.getNodes();let a="";for(let f=0;f<o.length;f++)a+=o[f].getTextContent();return a}}function cr(u){return u instanceof Qn}class In extends rn{constructor(o,a,f,_){super(o,a),this.format=f,this.style=_}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return pt(o)?this.anchor.is(o.anchor)&&this.focus.is(o.focus)&&this.format===o.format&&this.style===o.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this.anchor,f=this.focus,_=a.isBefore(f),E=_?a:f,I=_?f:a;let F=E.getNode(),oe=I.getNode();const de=E.offset,Ne=I.offset;if(Je(F)){const xe=F.getDescendantByIndex(de);F=xe??F}if(Je(oe)){let xe=oe.getDescendantByIndex(Ne);xe!==null&&xe!==F&&oe.getChildAtIndex(Ne)===xe&&(xe=xe.getPreviousSibling()),oe=xe??oe}let Ee;return F.is(oe)?Je(F)&&F.getChildrenSize()>0?Ee=[]:Ee=[F]:Ee=F.getNodesBetween(oe),Hs()||(this._cachedNodes=Ee),Ee}setTextNodeRange(o,a,f,_){li(this.anchor,o.__key,a,"text"),li(this.focus,f.__key,_,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const o=this.getNodes();if(o.length===0)return"";const a=o[0],f=o[o.length-1],_=this.anchor,E=this.focus,I=_.isBefore(E),[F,oe]=er(this);let de="",Ne=!0;for(let Ee=0;Ee<o.length;Ee++){const xe=o[Ee];if(Je(xe)&&!xe.isInline())Ne||(de+=`
39
- `),xe.isEmpty()?Ne=!1:Ne=!0;else if(Ne=!1,gt(xe)){let Ce=xe.getTextContent();xe===a?xe===f?(_.type!=="element"||E.type!=="element"||E.offset===_.offset)&&(Ce=F<oe?Ce.slice(F,oe):Ce.slice(oe,F)):Ce=I?Ce.slice(F):Ce.slice(oe):xe===f&&(Ce=I?Ce.slice(0,oe):Ce.slice(0,F)),de+=Ce}else(vn(xe)||Di(xe))&&(xe!==f||!this.isCollapsed())&&(de+=xe.getTextContent())}return de}applyDOMRange(o){const a=gn(),_=a.getEditorState()._selection,E=Fd(o.startContainer,o.startOffset,o.endContainer,o.endOffset,a,_);if(E===null)return;const[I,F]=E;li(this.anchor,I.key,I.offset,I.type),li(this.focus,F.key,F.offset,F.type),this._cachedNodes=null}clone(){const o=this.anchor,a=this.focus;return new In(Ur(o.key,o.offset,o.type),Ur(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(o){this.format=wr(this.format,o,null),this.dirty=!0}setStyle(o){this.style=o,this.dirty=!0}hasFormat(o){const a=fn[o];return(this.format&a)!==0}insertRawText(o){const a=o.split(/(\r?\n|\t)/),f=[],_=a.length;for(let E=0;E<_;E++){const I=a[E];I===`
38
+ `?E.push(Oi()):oe===" "?E.push(Yi()):oe!==""&&E.push(Wn(oe))}return{node:E}}if(f=f.replace(/\r/g,"").replace(/[ \t\n]+/g," "),f==="")return{node:null};if(f[0]===" "){let _=o,E=!0;for(;_!==null&&(_=xo(_,!1))!==null;){const I=_.textContent||"";if(I.length>0){/[ \t\n]$/.test(I)&&(f=f.slice(1)),E=!1;break}}E&&(f=f.slice(1))}if(f[f.length-1]===" "){let _=o,E=!0;for(;_!==null&&(_=xo(_,!0))!==null;)if((_.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){E=!1;break}E&&(f=f.slice(0,f.length-1))}return f===""?{node:null}:{node:Wn(f)}}const Fa=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 xo(u,o){let a=u;for(;;){let f;for(;(f=o?a.nextSibling:a.previousSibling)===null;){const E=a.parentElement;if(E===null)return null;a=E}if(a=f,a.nodeType===Be){const E=a.style.display;if(E===""&&a.nodeName.match(Fa)===null||E!==""&&!E.startsWith("inline"))return null}let _=a;for(;(_=o?a.firstChild:a.lastChild)!==null;)a=_;if(a.nodeType===Ye)return a;if(a.nodeName==="BR")return null}}const $s={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function zr(u){const o=$s[u.nodeName.toLowerCase()];return o===void 0?{node:null}:{forChild:a=>(gt(a)&&!a.hasFormat(o)&&a.toggleFormat(o),a),node:null}}function Wn(u=""){return fo(new Gi(u))}function gt(u){return u instanceof Gi}class Mi extends Gi{static getType(){return"tab"}static clone(o){const a=new Mi(o.__key);return a.__text=o.__text,a.__format=o.__format,a.__style=o.__style,a}constructor(o){super(" ",o),this.__detail=rt}static importDOM(){return null}static importJSON(o){const a=Yi();return a.setFormat(o.format),a.setStyle(o.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(o){throw Error("TabNode does not support setTextContent")}setDetail(o){throw Error("TabNode does not support setDetail")}setMode(o){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Yi(){return fo(new Mi)}function es(u){return u instanceof Mi}class Ai{constructor(o,a,f){this._selection=null,this.key=o,this.offset=a,this.type=f}is(o){return this.key===o.key&&this.offset===o.offset&&this.type===o.type}isBefore(o){let a=this.getNode(),f=o.getNode();const _=this.offset,E=o.offset;if(Je(a)){const I=a.getDescendantByIndex(_);a=I??a}if(Je(f)){const I=f.getDescendantByIndex(E);f=I??f}return a===f?_<E:a.isBefore(f)}getNode(){const o=this.key,a=En(o);if(a===null)throw Error("Point.getNode: node not found");return a}set(o,a,f){const _=this._selection,E=this.key;this.key=o,this.offset=a,this.type=f,Hs()||(Ir()===E&&_n(o),_!==null&&(_.setCachedNodes(null),_.dirty=!0))}}function Ur(u,o,a){return new Ai(u,o,a)}function ts(u,o){let a=o.__key,f=u.offset,_="element";if(gt(o)){_="text";const E=o.getTextContentSize();f>E&&(f=E)}else if(!Je(o)){const E=o.getNextSibling();if(gt(E))a=E.__key,f=0,_="text";else{const I=o.getParent();I&&(a=I.__key,f=o.getIndexWithinParent()+1)}}u.set(a,f,_)}function Ba(u,o){if(Je(o)){const a=o.getLastDescendant();Je(a)||gt(a)?ts(u,a):ts(u,o)}else ts(u,o)}function kl(u,o,a,f){const _=u.getNode(),E=_.getChildAtIndex(u.offset),I=Wn(),F=br(_)?qi().append(I):I;I.setFormat(a),I.setStyle(f),E===null?_.append(F):E.insertBefore(F),u.is(o)&&o.set(I.__key,0,"text"),u.set(I.__key,0,"text")}function li(u,o,a,f){u.key=o,u.offset=a,u.type=f}class rn{constructor(o,a){this.anchor=o,this.focus=a,o._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return Cr(o)?this.anchor.is(o.anchor)&&this.focus.is(o.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return er(this)}}class kn{constructor(o){this.dirty=!1,this._nodes=o,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){if(!Er(o))return!1;const a=this._nodes,f=o._nodes;return a.size===f.size&&Array.from(a).every(_=>f.has(_))}add(o){this.dirty=!0,this._nodes.add(o),this._cachedNodes=null}delete(o){this.dirty=!0,this._nodes.delete(o),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(o){return this._nodes.has(o)}clone(){return new kn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(o){}insertText(){}insertNodes(o){const a=this.getNodes(),f=a.length,_=a[f-1];let E;if(gt(_))E=_.select();else{const I=_.getIndexWithinParent()+1;E=_.getParentOrThrow().select(I,I)}E.insertNodes(o);for(let I=0;I<f;I++)a[I].remove()}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this._nodes,f=[];for(const _ of a){const E=En(_);E!==null&&f.push(E)}return Hs()||(this._cachedNodes=f),f}getTextContent(){const o=this.getNodes();let a="";for(let f=0;f<o.length;f++)a+=o[f].getTextContent();return a}}function pt(u){return u instanceof In}function Cr(u){return u instanceof rn}function ji(u){const[o,,a]=Ud(u),f=a.getChildren(),_=f.length,E=f[0].getChildren().length,I=new Array(_);for(let F=0;F<_;F++)I[F]=new Array(E);for(let F=0;F<_;F++){const de=f[F].getChildren();let Ne=0;for(let Ee=0;Ee<de.length;Ee++){for(;I[F][Ne];)Ne++;const xe=de[Ee],Ce=xe.__rowSpan||1,He=xe.__colSpan||1;for(let Ie=0;Ie<Ce;Ie++)for(let Ae=0;Ae<He;Ae++)I[F+Ie][Ne+Ae]=xe;if(o===xe)return{colSpan:He,columnIndex:Ne,rowIndex:F,rowSpan:Ce};Ne+=He}}return null}class Qn extends rn{constructor(o,a,f){super(a,f),this.gridKey=o}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return cr(o)?this.gridKey===o.gridKey&&this.anchor.is(o.anchor)&&this.focus.is(o.focus):!1}set(o,a,f){this.dirty=!0,this.gridKey=o,this.anchor.key=a,this.focus.key=f,this._cachedNodes=null}clone(){return new Qn(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(o){}insertText(){}insertNodes(o){const a=this.focus.getNode();Bi(a.select(0,a.getChildrenSize())).insertNodes(o)}getShape(){const o=En(this.anchor.key);if(!Gr(o))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const a=ji(o);if(a===null)throw Error("getCellRect: expected to find AnchorNode");const f=En(this.focus.key);if(!Gr(f))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const _=ji(f);if(_===null)throw Error("getCellRect: expected to find focusCellNode");const E=Math.min(a.columnIndex,_.columnIndex),I=Math.max(a.columnIndex,_.columnIndex),F=Math.min(a.rowIndex,_.rowIndex),oe=Math.max(a.rowIndex,_.rowIndex);return{fromX:Math.min(E,I),fromY:Math.min(F,oe),toX:Math.max(E,I),toY:Math.max(F,oe)}}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this.anchor.getNode(),f=this.focus.getNode(),_=Uo(a,Gr),E=Uo(f,Gr);if(!Gr(_))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!Gr(E))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const I=_.getParent();if(!Pl(I))throw Error("Expected anchorCell to have a parent GridRowNode");const F=I.getParent();if(!Kc(F))throw Error("Expected tableNode to have a parent GridNode");const oe=E.getParents()[1];if(oe!==F){if(F.isParentOf(E)){const St=oe.getParent();if(St==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,E.getKey(),St.getKey())}else{const St=F.getParent();if(St==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,St.getKey(),E.getKey())}return this.getNodes()}const[de,Ne,Ee]=zd(F,_,E);let xe=Math.min(Ne.startColumn,Ee.startColumn),Ce=Math.min(Ne.startRow,Ee.startRow),He=Math.max(Ne.startColumn+Ne.cell.__colSpan-1,Ee.startColumn+Ee.cell.__colSpan-1),Ie=Math.max(Ne.startRow+Ne.cell.__rowSpan-1,Ee.startRow+Ee.cell.__rowSpan-1),Ae=xe,mt=Ce,ze=xe,tt=Ce;function Ft(St){const{cell:Wt,startColumn:Zt,startRow:pn}=St;xe=Math.min(xe,Zt),Ce=Math.min(Ce,pn),He=Math.max(He,Zt+Wt.__colSpan-1),Ie=Math.max(Ie,pn+Wt.__rowSpan-1)}for(;xe<Ae||Ce<mt||He>ze||Ie>tt;){if(xe<Ae){const St=tt-mt,Wt=Ae-1;for(let Zt=0;Zt<=St;Zt++)Ft(de[mt+Zt][Wt]);Ae=Wt}if(Ce<mt){const St=ze-Ae,Wt=mt-1;for(let Zt=0;Zt<=St;Zt++)Ft(de[Wt][Ae+Zt]);mt=Wt}if(He>ze){const St=tt-mt,Wt=ze+1;for(let Zt=0;Zt<=St;Zt++)Ft(de[mt+Zt][Wt]);ze=Wt}if(Ie>tt){const St=ze-Ae,Wt=tt+1;for(let Zt=0;Zt<=St;Zt++)Ft(de[Wt][Ae+Zt]);tt=Wt}}const Rt=[F];let Ct=null;for(let St=Ce;St<=Ie;St++)for(let Wt=xe;Wt<=He;Wt++){const{cell:Zt}=de[St][Wt],pn=Zt.getParent();if(!Pl(pn))throw Error("Expected GridCellNode parent to be a GridRowNode");pn!==Ct&&Rt.push(pn),Rt.push(Zt,...Ki(Zt)),Ct=pn}return Hs()||(this._cachedNodes=Rt),Rt}getTextContent(){const o=this.getNodes();let a="";for(let f=0;f<o.length;f++)a+=o[f].getTextContent();return a}}function cr(u){return u instanceof Qn}class In extends rn{constructor(o,a,f,_){super(o,a),this.format=f,this.style=_}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return pt(o)?this.anchor.is(o.anchor)&&this.focus.is(o.focus)&&this.format===o.format&&this.style===o.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this.anchor,f=this.focus,_=a.isBefore(f),E=_?a:f,I=_?f:a;let F=E.getNode(),oe=I.getNode();const de=E.offset,Ne=I.offset;if(Je(F)){const xe=F.getDescendantByIndex(de);F=xe??F}if(Je(oe)){let xe=oe.getDescendantByIndex(Ne);xe!==null&&xe!==F&&oe.getChildAtIndex(Ne)===xe&&(xe=xe.getPreviousSibling()),oe=xe??oe}let Ee;return F.is(oe)?Je(F)&&F.getChildrenSize()>0?Ee=[]:Ee=[F]:Ee=F.getNodesBetween(oe),Hs()||(this._cachedNodes=Ee),Ee}setTextNodeRange(o,a,f,_){li(this.anchor,o.__key,a,"text"),li(this.focus,f.__key,_,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const o=this.getNodes();if(o.length===0)return"";const a=o[0],f=o[o.length-1],_=this.anchor,E=this.focus,I=_.isBefore(E),[F,oe]=er(this);let de="",Ne=!0;for(let Ee=0;Ee<o.length;Ee++){const xe=o[Ee];if(Je(xe)&&!xe.isInline())Ne||(de+=`
39
+ `),xe.isEmpty()?Ne=!1:Ne=!0;else if(Ne=!1,gt(xe)){let Ce=xe.getTextContent();xe===a?xe===f?(_.type!=="element"||E.type!=="element"||E.offset===_.offset)&&(Ce=F<oe?Ce.slice(F,oe):Ce.slice(oe,F)):Ce=I?Ce.slice(F):Ce.slice(oe):xe===f&&(Ce=I?Ce.slice(0,oe):Ce.slice(0,F)),de+=Ce}else(vn(xe)||Di(xe))&&(xe!==f||!this.isCollapsed())&&(de+=xe.getTextContent())}return de}applyDOMRange(o){const a=gn(),_=a.getEditorState()._selection,E=Bd(o.startContainer,o.startOffset,o.endContainer,o.endOffset,a,_);if(E===null)return;const[I,F]=E;li(this.anchor,I.key,I.offset,I.type),li(this.focus,F.key,F.offset,F.type),this._cachedNodes=null}clone(){const o=this.anchor,a=this.focus;return new In(Ur(o.key,o.offset,o.type),Ur(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(o){this.format=wr(this.format,o,null),this.dirty=!0}setStyle(o){this.style=o,this.dirty=!0}hasFormat(o){const a=fn[o];return(this.format&a)!==0}insertRawText(o){const a=o.split(/(\r?\n|\t)/),f=[],_=a.length;for(let E=0;E<_;E++){const I=a[E];I===`
40
40
  `||I===`\r
41
- `?f.push(Oi()):I===" "?f.push(Yi()):f.push(Wn(I))}this.insertNodes(f)}insertText(o){const a=this.anchor,f=this.focus,_=this.isCollapsed()||a.isBefore(f),E=this.format,I=this.style;_&&a.type==="element"?kl(a,f,E,I):!_&&f.type==="element"&&kl(f,a,E,I);const F=this.getNodes(),oe=F.length,de=_?a:f,Ne=_?f:a,Ee=de.offset,xe=Ne.offset;let Ce=F[0];if(!gt(Ce))throw Error("insertText: first node is not a text node");const Ie=Ce.getTextContent().length,Ae=Ce.getParentOrThrow(),mt=oe-1;let ze=F[mt];if(this.isCollapsed()&&Ee===Ie&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!Ae.canInsertTextAfter()&&Ce.getNextSibling()===null)){let tt=Ce.getNextSibling();if((!gt(tt)||!tt.canInsertTextBefore()||hl(tt))&&(tt=Wn(),tt.setFormat(E),Ae.canInsertTextAfter()?Ce.insertAfter(tt):Ae.insertAfter(tt)),tt.select(0,0),Ce=tt,o!==""){this.insertText(o);return}}else if(this.isCollapsed()&&Ee===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!Ae.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let tt=Ce.getPreviousSibling();if((!gt(tt)||hl(tt))&&(tt=Wn(),tt.setFormat(E),Ae.canInsertTextBefore()?Ce.insertBefore(tt):Ae.insertBefore(tt)),tt.select(),Ce=tt,o!==""){this.insertText(o);return}}else if(Ce.isSegmented()&&Ee!==Ie){const tt=Wn(Ce.getTextContent());tt.setFormat(E),Ce.replace(tt),Ce=tt}else if(!this.isCollapsed()&&o!==""){const tt=ze.getParent();if(!Ae.canInsertTextBefore()||!Ae.canInsertTextAfter()||Je(tt)&&(!tt.canInsertTextBefore()||!tt.canInsertTextAfter())){this.insertText(""),$d(this.anchor,this.focus,null),this.insertText(o);return}}if(oe===1){if(Ce.isToken()){const Ct=Wn(o);Ct.select(),Ce.replace(Ct);return}const tt=Ce.getFormat(),Ft=Ce.getStyle();if(Ee===xe&&(tt!==E||Ft!==I))if(Ce.getTextContent()==="")Ce.setFormat(E),Ce.setStyle(I);else{const Ct=Wn(o);if(Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ee===0)Ce.insertBefore(Ct,!1);else{const[St]=Ce.splitText(Ee);St.insertAfter(Ct,!1)}Ct.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);return}else if(es(Ce)){const Ct=Wn(o);Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ce.replace(Ct);return}const Rt=xe-Ee;Ce=Ce.spliceText(Ee,Rt,o,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=o.length:(this.format=tt,this.style=Ft))}else{const tt=new Set([...Ce.getParentKeys(),...ze.getParentKeys()]),Ft=Je(Ce)?Ce:Ce.getParentOrThrow();let Rt=Je(ze)?ze:ze.getParentOrThrow(),Ct=ze;if(!Ft.is(Rt)&&Rt.isInline())do Ct=Rt,Rt=Rt.getParentOrThrow();while(Rt.isInline());if(Ne.type==="text"&&(xe!==0||ze.getTextContent()==="")||Ne.type==="element"&&ze.getIndexWithinParent()<xe)if(gt(ze)&&!ze.isToken()&&xe!==ze.getTextContentSize()){if(ze.isSegmented()){const qt=Wn(ze.getTextContent());ze.replace(qt),ze=qt}!br(Ne.getNode())&&Ne.type==="text"&&(ze=ze.spliceText(0,xe,"")),tt.add(ze.__key)}else{const qt=ze.getParentOrThrow();!qt.canBeEmpty()&&qt.getChildrenSize()===1?qt.remove():ze.remove()}else tt.add(ze.__key);const St=Rt.getChildren(),Wt=new Set(F),Zt=Ft.is(Rt),pn=Ft.isInline()&&Ce.getNextSibling()===null?Ft:Ce;for(let qt=St.length-1;qt>=0;qt--){const Dn=St[qt];if(Dn.is(Ce)||Je(Dn)&&Dn.isParentOf(Ce))break;Dn.isAttached()&&(!Wt.has(Dn)||Dn.is(Ct)?Zt||pn.insertAfter(Dn,!1):Dn.remove())}if(!Zt){let qt=Rt,Dn=null;for(;qt!==null;){const ai=qt.getChildren(),Zi=ai.length;(Zi===0||ai[Zi-1].is(Dn))&&(tt.delete(qt.__key),Dn=qt),qt=qt.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(Ee,Ie-Ee,o,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);else if(Ee===Ie)Ce.select();else{const qt=Wn(o);qt.select(),Ce.replace(qt)}for(let qt=1;qt<oe;qt++){const Dn=F[qt],ai=Dn.__key;tt.has(ai)||Dn.remove()}}}removeText(){this.insertText("")}formatText(o){if(this.isCollapsed()){this.toggleFormat(o),_n(null);return}const a=this.getNodes(),f=[];for(const ze of a)gt(ze)&&f.push(ze);const _=f.length;if(_===0){this.toggleFormat(o),_n(null);return}const E=this.anchor,I=this.focus,F=this.isBackward(),oe=F?I:E,de=F?E:I;let Ne=0,Ee=f[0],xe=oe.type==="element"?0:oe.offset;if(oe.type==="text"&&xe===Ee.getTextContentSize()&&(Ne=1,Ee=f[1],xe=0),Ee==null)return;const Ce=Ee.getFormatFlags(o,null),He=_-1;let Ie=f[He];const Ae=de.type==="text"?de.offset:Ie.getTextContentSize();if(Ee.is(Ie)){if(xe===Ae)return;if(xe===0&&Ae===Ee.getTextContentSize())Ee.setFormat(Ce);else{const ze=Ee.splitText(xe,Ae),tt=xe===0?ze[0]:ze[1];tt.setFormat(Ce),oe.type==="text"&&oe.set(tt.__key,0,"text"),de.type==="text"&&de.set(tt.__key,Ae-xe,"text")}this.format=Ce;return}xe!==0&&([,Ee]=Ee.splitText(xe),xe=0),Ee.setFormat(Ce);const mt=Ie.getFormatFlags(o,Ce);Ae>0&&(Ae!==Ie.getTextContentSize()&&([Ie]=Ie.splitText(Ae)),Ie.setFormat(mt));for(let ze=Ne+1;ze<He;ze++){const tt=f[ze];if(!tt.isToken()){const Ft=tt.getFormatFlags(o,mt);tt.setFormat(Ft)}}oe.type==="text"&&oe.set(Ee.__key,xe,"text"),de.type==="text"&&de.set(Ie.__key,Ae,"text"),this.format=Ce|mt}insertNodes(o){if(o.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const Ae=cn();if(!pt(Ae))throw Error("Expected RangeSelection after insertParagraph");return Ae.insertNodes(o)}const a=Ds(this.anchor.getNode(),zi),f=o[o.length-1];if("__language"in a){if("__language"in o[0])this.insertText(o[0].getTextContent());else{const Ae=Ic(this);a.splice(Ae,0,o),f.selectEnd()}return}const _=Ae=>(Je(Ae)||vn(Ae))&&!Ae.isInline();if(!o.some(_)){const Ae=Ic(this);a.splice(Ae,0,o),f.selectEnd();return}const E=d_(o),I=E.getLastDescendant(),F=E.getChildren(),oe=Ae=>"__value"in Ae&&"__checked"in Ae,de=Ae=>Je(Ae)&&zi(Ae)&&!Ae.isEmpty()&&Je(a)&&(!a.isEmpty()||oe(a)),Ee=!Je(a)||!a.isEmpty()?this.insertParagraph():null,xe=F[F.length-1];let Ce=F[0];de(Ce)&&(a.append(...Ce.getChildren()),Ce=F[1]),Ce&&ar(a,Ce);const He=Ds(I,zi);Ee&&Je(He)&&(oe(Ee)||zi(xe))&&(He.append(...Ee.getChildren()),Ee.remove()),Je(a)&&a.isEmpty()&&a.remove(),I.selectEnd();const Ie=Je(a)?a.getLastChild():null;Di(Ie)&&He!==a&&Ie.remove()}insertParagraph(){if(this.anchor.key==="root"){const I=qi();return Zn().splice(this.anchor.offset,0,[I]),I.select(),I}const o=Ic(this),a=Ds(this.anchor.getNode(),zi),f=a.getChildAtIndex(o),_=f?[f,...f.getNextSiblings()]:[],E=a.insertNewAfter(this,!1);return E?(E.append(..._),E.selectStart(),E):null}insertLineBreak(o){const a=Oi();if(this.insertNodes([a]),o){const f=a.getParentOrThrow(),_=a.getIndexWithinParent();f.select(_,_)}}extract(){const o=this.getNodes(),a=o.length,f=a-1,_=this.anchor,E=this.focus;let I=o[0],F=o[f];const[oe,de]=er(this);if(a===0)return[];if(a===1){if(gt(I)&&!this.isCollapsed()){const Ee=oe>de?de:oe,xe=oe>de?oe:de,Ce=I.splitText(Ee,xe),He=Ee===0?Ce[0]:Ce[1];return He!=null?[He]:[]}return[I]}const Ne=_.isBefore(E);if(gt(I)){const Ee=Ne?oe:de;Ee===I.getTextContentSize()?o.shift():Ee!==0&&([,I]=I.splitText(Ee),o[0]=I)}if(gt(F)){const xe=F.getTextContent().length,Ce=Ne?de:oe;Ce===0?o.pop():Ce!==xe&&([F]=F.splitText(Ce),o[f]=F)}return o}modify(o,a,f){const _=this.focus,E=this.anchor,I=o==="move",F=ri(_,a);if(vn(F)&&!F.isIsolated()){if(I&&F.isKeyboardSelectable()){const Ce=Lc();Ce.add(F.__key),Or(Ce);return}const xe=a?F.getPreviousSibling():F.getNextSibling();if(gt(xe)){const Ce=xe.__key,He=a?xe.getTextContent().length:0;_.set(Ce,He,"text"),I&&E.set(Ce,He,"text");return}else{const Ce=F.getParentOrThrow();let He,Ie;Je(xe)?(Ie=xe.__key,He=a?xe.getChildrenSize():0):(He=F.getIndexWithinParent(),Ie=Ce.__key,a||He++),_.set(Ie,He,"element"),I&&E.set(Ie,He,"element");return}}const oe=gn(),de=_r(oe._window);if(!de)return;const Ne=oe._blockCursorElement,Ee=oe._rootElement;if(Ee!==null&&Ne!==null&&Je(F)&&!F.isInline()&&!F.canBeEmpty()&&wt(Ne,oe,Ee),Fs(de,o,a?"backward":"forward",f),de.rangeCount>0){const xe=de.getRangeAt(0),Ce=this.anchor.getNode(),He=br(Ce)?Ce:Dr(Ce);if(this.applyDOMRange(xe),this.dirty=!0,!I){const Ie=this.getNodes(),Ae=[];let mt=!1;for(let ze=0;ze<Ie.length;ze++){const tt=Ie[ze];ht(tt,He)?Ae.push(tt):mt=!0}if(mt&&Ae.length>0)if(a){const ze=Ae[0];Je(ze)?ze.selectStart():ze.getParentOrThrow().selectStart()}else{const ze=Ae[Ae.length-1];Je(ze)?ze.selectEnd():ze.getParentOrThrow().selectEnd()}(de.anchorNode!==xe.startContainer||de.anchorOffset!==xe.startOffset)&&Vi(this)}}}deleteCharacter(o){const a=this.isCollapsed();if(this.isCollapsed()){const f=this.anchor,_=this.focus;let E=f.getNode();if(!o&&(f.type==="element"&&Je(E)&&f.offset===E.getChildrenSize()||f.type==="text"&&f.offset===E.getTextContentSize())){const F=E.getParent(),oe=E.getNextSibling()||(F===null?null:F.getNextSibling());if(Je(oe)&&oe.isShadowRoot())return}const I=ri(_,o);if(vn(I)&&!I.isIsolated()){if(I.isKeyboardSelectable()&&Je(E)&&E.getChildrenSize()===0){E.remove();const F=Lc();F.add(I.__key),Or(F)}else I.remove(),gn().dispatchCommand(e,void 0);return}else if(!o&&Je(I)&&Je(E)&&E.isEmpty()){E.remove(),I.selectStart();return}if(this.modify("extend",o,"character"),this.isCollapsed()){if(o&&f.offset===0&&(f.type==="element"?f.getNode():f.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const F=_.type==="text"?_.getNode():null;if(E=f.type==="text"?f.getNode():null,F!==null&&F.isSegmented()){const oe=_.offset,de=F.getTextContentSize();if(F.is(E)||o&&oe!==de||!o&&oe!==0){kd(F,o,oe);return}}else if(E!==null&&E.isSegmented()){const oe=f.offset,de=E.getTextContentSize();if(E.is(F)||o&&oe!==0||!o&&oe!==de){kd(E,o,oe);return}}Ha(this,o)}}if(this.removeText(),o&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const f=this.anchor.getNode();f.isEmpty()&&br(f.getParent())&&f.getIndexWithinParent()===0&&f.collapseAtStart(this)}}deleteLine(o){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",o,"lineboundary"),(o?this.focus:this.anchor).offset===0&&this.modify("extend",o,"character")),this.removeText()}deleteWord(o){this.isCollapsed()&&this.modify("extend",o,"word"),this.removeText()}}function Er(u){return u instanceof kn}function Ri(u){const o=u.offset;if(u.type==="text")return o;const a=u.getNode();return o===a.getChildrenSize()?a.getTextContent().length:0}function er(u){const o=u.anchor,a=u.focus;return o.type==="element"&&a.type==="element"&&o.key===a.key&&o.offset===a.offset?[0,0]:[Ri(o),Ri(a)]}function Vi(u){const o=u.focus,a=u.anchor,f=a.key,_=a.offset,E=a.type;li(a,o.key,o.offset,o.type),li(o,f,_,E),u._cachedNodes=null}function Fs(u,o,a,f){u.modify(o,a,f)}function Ha(u,o){const a=u.anchor,f=u.focus,_=a.getNode(),E=f.getNode();if(_===E&&a.type==="text"&&f.type==="text"){const I=a.offset,F=f.offset,oe=I<F,de=oe?I:F,Ne=oe?F:I,Ee=Ne-1;if(de!==Ee){const xe=_.getTextContent().slice(de,Ne);gl(xe)||(o?f.offset=Ee:a.offset=Ee)}}}function kd(u,o,a){const f=u,E=f.getTextContent().split(/(?=\s)/g),I=E.length;let F=0,oe=0;for(let Ne=0;Ne<I;Ne++){const Ee=E[Ne],xe=Ne===I-1;if(oe=F,F+=Ee.length,o&&F===a||F>a||xe){E.splice(Ne,1),xe&&(oe=void 0);break}}const de=E.join("").trim();de===""?f.remove():(f.setTextContent(de),f.select(oe,oe))}function n_(u,o,a){const f=u.getParent();return a===null||f===null||!f.canBeEmpty()||f!==a.getNode()}function Id(u,o,a,f){let _=o,E;if(u.nodeType===Be){let I=!1;const F=u.childNodes,oe=F.length;_===oe&&(I=!0,_=oe-1);let de=F[_],Ne=!1;if(de===f._blockCursorElement?(de=F[_+1],Ne=!0):f._blockCursorElement!==null&&_--,E=ei(de),gt(E))_=Ts(E,I);else{let Ee=ei(u);if(Ee===null)return null;if(Je(Ee)){let xe=Ee.getChildAtIndex(_);if(Je(xe)&&n_(xe,_,a)){const Ce=I?xe.getLastDescendant():xe.getFirstDescendant();Ce===null?(Ee=xe,_=0):(xe=Ce,Ee=Je(xe)?xe:xe.getParentOrThrow())}gt(xe)?(E=xe,Ee=null,_=Ts(xe,I)):xe!==Ee&&I&&!Ne&&_++}else{const xe=Ee.getIndexWithinParent();o===0&&vn(Ee)&&ei(u)===Ee?_=xe:_=xe+1,Ee=Ee.getParentOrThrow()}if(Je(Ee))return Ur(Ee.__key,_,"element")}}else E=ei(u);return gt(E)?Ur(E.__key,_,"text"):null}function Pd(u,o,a){const f=u.offset,_=u.getNode();if(f===0){const E=_.getPreviousSibling(),I=_.getParent();if(!o)Je(E)&&!a&&E.isInline()?(u.key=E.__key,u.offset=E.getChildrenSize(),u.type="element"):gt(E)&&(u.key=E.__key,u.offset=E.getTextContent().length);else if((a||!o)&&E===null&&Je(I)&&I.isInline()){const F=I.getPreviousSibling();gt(F)&&(u.key=F.__key,u.offset=F.getTextContent().length)}}else if(f===_.getTextContent().length){const E=_.getNextSibling(),I=_.getParent();if(o&&Je(E)&&E.isInline())u.key=E.__key,u.offset=0,u.type="element";else if((a||o)&&E===null&&Je(I)&&I.isInline()&&!I.canInsertTextAfter()){const F=I.getNextSibling();gt(F)&&(u.key=F.__key,u.offset=0)}}}function $d(u,o,a){if(u.type==="text"&&o.type==="text"){const f=u.isBefore(o),_=u.is(o);Pd(u,f,_),Pd(o,!f,_),_&&(o.key=u.key,o.offset=u.offset,o.type=u.type);const E=gn();if(E.isComposing()&&E._compositionKey!==u.key&&pt(a)){const I=a.anchor,F=a.focus;li(u,I.key,I.offset,I.type),li(o,F.key,F.offset,F.type)}}}function Fd(u,o,a,f,_,E){if(u===null||a===null||!Qr(_,u,a))return null;const I=Id(u,o,pt(E)?E.anchor:null,_);if(I===null)return null;const F=Id(a,f,pt(E)?E.focus:null,_);if(F===null)return null;if(I.type==="element"&&F.type==="element"){const oe=ei(u),de=ei(a);if(vn(oe)&&vn(de))return null}return $d(I,F,E),[I,F]}function r_(u){return Je(u)&&!u.isInline()}function Bd(u,o,a,f,_,E){const I=bi(),F=new In(Ur(u,o,_),Ur(a,f,E),0,"");return F.dirty=!0,I._selection=F,F}function i_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new In(u,o,0,"")}function Lc(){return new kn(new Set)}function o_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new Qn("root",u,o)}function s_(u){const a=u.getEditorState()._selection,f=_r(u._window);return pt(a)||a==null?kc(a,f,u):a.clone()}function kc(u,o,a){const f=a._window;if(f===null)return null;const _=f.event,E=_?_.type:void 0,I=E==="selectionchange",F=!Kt()&&(I||E==="beforeinput"||E==="compositionstart"||E==="compositionend"||E==="click"&&_&&_.detail===3||E==="drop"||E===void 0);let oe,de,Ne,Ee;if(!pt(u)||F){if(o===null)return null;if(oe=o.anchorNode,de=o.focusNode,Ne=o.anchorOffset,Ee=o.focusOffset,I&&pt(u)&&!Qr(a,oe,de))return u.clone()}else return u.clone();const xe=Fd(oe,Ne,de,Ee,a,u);if(xe===null)return null;const[Ce,He]=xe;return new In(Ce,He,pt(u)?u.format:0,pt(u)?u.style:"")}function cn(){return bi()._selection}function Bs(){return gn()._editorState._selection}function Wa(u,o,a,f=1){const _=u.anchor,E=u.focus,I=_.getNode(),F=E.getNode();if(!o.is(I)&&!o.is(F))return;const oe=o.__key;if(u.isCollapsed()){const de=_.offset;if(a<=de&&f>0||a<de&&f<0){const Ne=Math.max(0,de+f);_.set(oe,Ne,"element"),E.set(oe,Ne,"element"),Hd(u)}}else{const de=u.isBackward(),Ne=de?E:_,Ee=Ne.getNode(),xe=de?_:E,Ce=xe.getNode();if(o.is(Ee)){const He=Ne.offset;(a<=He&&f>0||a<He&&f<0)&&Ne.set(oe,Math.max(0,He+f),"element")}if(o.is(Ce)){const He=xe.offset;(a<=He&&f>0||a<He&&f<0)&&xe.set(oe,Math.max(0,He+f),"element")}}Hd(u)}function Hd(u){const o=u.anchor,a=o.offset,f=u.focus,_=f.offset,E=o.getNode(),I=f.getNode();if(u.isCollapsed()){if(!Je(E))return;const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text"),f.set(de.__key,Ne,"text")}return}if(Je(E)){const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text")}}if(Je(I)){const F=I.getChildrenSize(),oe=_>=F,de=oe?I.getChildAtIndex(F-1):I.getChildAtIndex(_);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),f.set(de.__key,Ne,"text")}}}function l_(u,o){const f=o.getEditorState()._selection,_=u._selection;if(pt(_)){const E=_.anchor,I=_.focus;let F;if(E.type==="text"&&(F=E.getNode(),F.selectionTransform(f,_)),I.type==="text"){const oe=I.getNode();F!==oe&&oe.selectionTransform(f,_)}}}function Ka(u,o,a,f,_){let E=null,I=0,F=null;f!==null?(E=f.__key,gt(f)?(I=f.getTextContentSize(),F="text"):Je(f)&&(I=f.getChildrenSize(),F="element")):_!==null&&(E=_.__key,gt(_)?F="text":Je(_)&&(F="element")),E!==null&&F!==null?u.set(E,I,F):(I=o.getIndexWithinParent(),I===-1&&(I=a.getChildrenSize()),u.set(a.__key,I,"element"))}function Wd(u,o,a,f,_){u.type==="text"?(u.key=a,o||(u.offset+=_)):u.offset>f.getIndexWithinParent()&&(u.offset-=1)}function a_(u,o,a,f,_,E,I){const F=f.anchorNode,oe=f.focusNode,de=f.anchorOffset,Ne=f.focusOffset,Ee=document.activeElement;if(_.has("collaboration")&&Ee!==E||Ee!==null&&io(Ee))return;if(!pt(o)){u!==null&&Qr(a,F,oe)&&f.removeAllRanges();return}const xe=o.anchor,Ce=o.focus,He=xe.key,Ie=Ce.key,Ae=vs(a,He),mt=vs(a,Ie),ze=xe.offset,tt=Ce.offset,Ft=o.format,Rt=o.style,Ct=o.isCollapsed();let St=Ae,Wt=mt,Zt=!1;if(xe.type==="text"){St=Ln(Ae);const pn=xe.getNode();Zt=pn.getFormat()!==Ft||pn.getStyle()!==Rt}else pt(u)&&u.anchor.type==="text"&&(Zt=!0);if(Ce.type==="text"&&(Wt=Ln(mt)),!(St===null||Wt===null)&&(Ct&&(u===null||Zt||pt(u)&&(u.format!==Ft||u.style!==Rt))&&ut(Ft,Rt,ze,He,performance.now()),!(de===ze&&Ne===tt&&F===St&&oe===Wt&&!(f.type==="Range"&&Ct)&&((Ee===null||!E.contains(Ee))&&E.focus({preventScroll:!0}),xe.type!=="element")))){try{f.setBaseAndExtent(St,ze,Wt,tt)}catch{}if(!_.has("skip-scroll-into-view")&&o.isCollapsed()&&E!==null&&E===document.activeElement){const pn=o instanceof In&&o.anchor.type==="element"?St.childNodes[ze]||null:f.rangeCount>0?f.getRangeAt(0):null;if(pn!==null){let qt;if(pn instanceof Text){const Dn=document.createRange();Dn.selectNode(pn),qt=Dn.getBoundingClientRect()}else qt=pn.getBoundingClientRect();Ta(a,qt,E)}}Xe()}}function c_(u){let o=cn()||Bs();o===null&&(o=Zn().selectEnd()),o.insertNodes(u)}function u_(){const u=cn();return u===null?"":u.getTextContent()}function Kd(u,o,a){const f=[];let _=null,E=null;function I(de,Ne,Ee){const xe={cell:Ee,startColumn:Ne,startRow:de},Ce=Ee.__rowSpan,He=Ee.__colSpan;for(let Ie=0;Ie<Ce;Ie++){f[de+Ie]===void 0&&(f[de+Ie]=[]);for(let Ae=0;Ae<He;Ae++)f[de+Ie][Ne+Ae]=xe}o.is(Ee)&&(_=xe),a.is(Ee)&&(E=xe)}function F(de,Ne){return f[de]===void 0||f[de][Ne]===void 0}const oe=u.getChildren();for(let de=0;de<oe.length;de++){const Ne=oe[de];if(!Pl(Ne))throw Error("Expected GridNode children to be GridRowNode");const Ee=Ne.getChildren();let xe=0;for(const Ce of Ee){if(!Gr(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!F(de,xe);)xe++;I(de,xe,Ce),xe+=Ce.__colSpan}}if(_===null)throw Error("Anchor not found in Grid");if(E===null)throw Error("Focus not found in Grid");return[f,_,E]}function zd(u){let o;if(u instanceof Hc)o=u;else if(u instanceof At){const _=Uo(u,Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}else{const _=Uo(u.getNode(),Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}const a=o.getParent();if(!Pl(a))throw Error("Expected GridCellNode to have a parent GridRowNode");const f=a.getParent();if(!Wc(f))throw Error("Expected GridRowNode to have a parent GridNode");return[o,a,f]}function Ic(u){u.isCollapsed()||u.removeText();const o=u.anchor,a=o.getNode();if(!gt(a))return o.offset;const f=a.getParent();if(!f){const oe=qi();return Zn().append(oe),oe.select(),0}const _=a.splitText(o.offset);if(_.length===0)return 0;const E=o.offset===0?0:1,I=_[0].getIndexWithinParent()+E;if(!f.isInline()||I===0)return I;const F=f.getChildAtIndex(I);return F&&f.insertNewAfter(u).append(F,...F.getNextSiblings()),f.getIndexWithinParent()+E}function d_(u){const o=qi();let a=null;for(let f=0;f<u.length;f++){const _=u[f],E=Di(_);if(E||vn(_)&&_.isInline()||Je(_)&&_.isInline()||gt(_)||_.isParentRequired()){if(a===null&&(a=_.createParentElementNode(),o.append(a),E))continue;a!==null&&a.append(_)}else o.append(_),a=null}return o}let Yn=null,jn=null,Tr=!1,Pc=!1,za=0;const Ud={characterData:!0,childList:!0,subtree:!0};function Hs(){return Tr||Yn!==null&&Yn._readOnly}function nr(){if(Tr)throw Error("Cannot use method in read-only mode.")}function Gd(){if(za>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 bi(){if(Yn===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 Yn}function gn(){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 f_(){return jn}function Yd(u,o,a){const f=o.__type,_=kr(u,f);let E=a.get(f);E===void 0&&(E=Array.from(_.transforms),a.set(f,E));const I=E.length;for(let F=0;F<I&&(E[F](o),!!o.isAttached());F++);}function jd(u,o){return u!==void 0&&u.__key!==o&&u.isAttached()}function h_(u,o){const a=o._dirtyLeaves,f=u._nodeMap;for(const _ of a){const E=f.get(_);gt(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&ul(E)}}function g_(u,o){const a=o._dirtyLeaves,f=o._dirtyElements,_=u._nodeMap,E=Ir(),I=new Map;let F=a,oe=F.size,de=f,Ne=de.size;for(;oe>0||Ne>0;){if(oe>0){o._dirtyLeaves=new Set;for(const Ee of F){const xe=_.get(Ee);gt(xe)&&xe.isAttached()&&xe.isSimpleText()&&!xe.isUnmergeable()&&ul(xe),xe!==void 0&&jd(xe,E)&&Yd(o,xe,I),a.add(Ee)}if(F=o._dirtyLeaves,oe=F.size,oe>0){za++;continue}}o._dirtyLeaves=new Set,o._dirtyElements=new Map;for(const Ee of de){const xe=Ee[0],Ce=Ee[1];if(xe!=="root"&&!Ce)continue;const He=_.get(xe);He!==void 0&&jd(He,E)&&Yd(o,He,I),f.set(xe,Ce)}F=o._dirtyLeaves,oe=F.size,de=o._dirtyElements,Ne=de.size,za++}o._dirtyLeaves=a,o._dirtyElements=f}function p_(u){return $c(u,gn()._nodes)}function $c(u,o){const a=u.type,f=o.get(a);if(f===void 0)throw Error(`parseEditorState: type "${a}" + not found`);const _=f.klass;if(u.type!==_.getType())throw Error(`LexicalNode: Node ${_.name} does not implement .importJSON().`);const E=_.importJSON(u),I=u.children;if(Je(E)&&Array.isArray(I))for(let F=0;F<I.length;F++){const oe=I[F],de=$c(oe,o);E.append(de)}return E}function m_(u,o,a){const f=Bc(),_=Yn,E=Tr,I=jn,F=o._dirtyElements,oe=o._dirtyLeaves,de=o._cloneNotNeeded,Ne=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Yn=f,Tr=!1,jn=o;try{const Ee=o._nodes,xe=u.root;$c(xe,Ee),a&&a(),f._readOnly=!0,qd(f)}catch(Ee){Ee instanceof Error&&o._onError(Ee)}finally{o._dirtyElements=F,o._dirtyLeaves=oe,o._cloneNotNeeded=de,o._dirtyType=Ne,Yn=_,Tr=E,jn=I}return f}function Vd(u,o){const a=Yn,f=Tr,_=jn;Yn=u,Tr=!0,jn=null;try{return o()}finally{Yn=a,Tr=f,jn=_}}function qd(u){const o=u._nodeMap;o.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},o.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},o.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function ns(u,o){const a=u._pendingEditorState,f=u._rootElement,_=u._headless||f===null;if(a===null)return;const E=u._editorState,I=E._selection,F=a._selection,oe=u._dirtyType!==ct,de=Yn,Ne=Tr,Ee=jn,xe=u._updating,Ce=u._observer;let He=null;if(u._pendingEditorState=null,u._editorState=a,!_&&oe&&Ce!==null){jn=u,Yn=a,Tr=!1,u._updating=!0;try{const Ct=u._dirtyType,St=u._dirtyElements,Wt=u._dirtyLeaves;Ce.disconnect(),He=sr(E,a,u,Ct,St,Wt)}catch(Ct){if(Ct instanceof Error&&u._onError(Ct),!Pc)tf(u,null,f,a),qn(u),u._dirtyType=dt,Pc=!0,ns(u,E),Pc=!1;else throw Ct;return}finally{Ce.observe(f,Ud),u._updating=xe,Yn=de,Tr=Ne,jn=Ee}}a._readOnly||(a._readOnly=!0,qd(a),pt(F)&&(Object.freeze(F.anchor),Object.freeze(F.focus)),Object.freeze(F));const Ie=u._dirtyLeaves,Ae=u._dirtyElements,mt=u._normalizedNodes,ze=u._updateTags,tt=u._deferred;oe&&(u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),Sa(u,a);const Ft=_?null:_r(u._window);if(u._editable&&Ft!==null&&(oe||F===null||F.dirty)){jn=u,Yn=a;try{if(Ce!==null&&Ce.disconnect(),oe||F===null||F.dirty){const Ct=u._blockCursorElement;Ct!==null&&wt(Ct,u,f),a_(I,F,u,Ft,ze,f)}vl(u,f,F),Ce!==null&&Ce.observe(f,Ud)}finally{jn=Ee,Yn=de}}He!==null&&y_(u,He,ze,Ie,E),!pt(F)&&F!==null&&(I===null||!I.is(F))&&u.dispatchCommand(e,void 0);const Rt=u._pendingDecorators;Rt!==null&&(u._decorators=Rt,u._pendingDecorators=null,Il("decorator",u,!0,Rt)),__(u,o||E,a),Il("update",u,!0,{dirtyElements:Ae,dirtyLeaves:Ie,editorState:a,normalizedNodes:mt,prevEditorState:o||E,tags:ze}),C_(u,tt),N_(u)}function __(u,o,a){const f=so(o),_=so(a);f!==_&&Il("textcontent",u,!0,_)}function y_(u,o,a,f,_){const E=Array.from(u._listeners.mutation),I=E.length;for(let F=0;F<I;F++){const[oe,de]=E[F],Ne=o.get(de);Ne!==void 0&&oe(Ne,{dirtyLeaves:f,prevEditorState:_,updateTags:a})}}function Il(u,o,a,...f){const _=o._updating;o._updating=a;try{const E=Array.from(o._listeners[u]);for(let I=0;I<E.length;I++)E[I].apply(null,f)}finally{o._updating=_}}function Zd(u,o,a){if(u._updating===!1||jn!==u){let _=!1;return u.update(()=>{_=Zd(u,o,a)}),_}const f=xs(u);for(let _=4;_>=0;_--)for(let E=0;E<f.length;E++){const oe=f[E]._commands.get(o);if(oe!==void 0){const de=oe[_];if(de!==void 0){const Ne=Array.from(de),Ee=Ne.length;for(let xe=0;xe<Ee;xe++)if(Ne[xe](a,u)===!0)return!0}}}return!1}function N_(u){const o=u._updates;if(o.length!==0){const a=o.shift();if(a){const[f,_]=a;Xd(u,f,_)}}}function C_(u,o){if(u._deferred=[],o.length!==0){const a=u._updating;u._updating=!0;try{for(let f=0;f<o.length;f++)o[f]()}finally{u._updating=a}}}function Jd(u,o){const a=u._updates;let f=o||!1;for(;a.length!==0;){const _=a.shift();if(_){const[E,I]=_;let F,oe;I!==void 0&&(F=I.onUpdate,oe=I.tag,I.skipTransforms&&(f=!0),F&&u._deferred.push(F),oe&&u._updateTags.add(oe)),E()}}return f}function Xd(u,o,a){const f=u._updateTags;let _,E,I=!1,F=!1;a!==void 0&&(_=a.onUpdate,E=a.tag,E!=null&&f.add(E),I=a.skipTransforms||!1,F=a.discrete||!1),_&&u._deferred.push(_);const oe=u._editorState;let de=u._pendingEditorState,Ne=!1;(de===null||de._readOnly)&&(de=u._pendingEditorState=x_(de||oe),Ne=!0),de._flushSync=F;const Ee=Yn,xe=Tr,Ce=jn,He=u._updating;Yn=de,Tr=!1,u._updating=!0,jn=u;try{Ne&&(u._headless?oe._selection!=null&&(de._selection=oe._selection.clone()):de._selection=s_(u));const Ae=u._compositionKey;o(),I=Jd(u,I),l_(de,u),u._dirtyType!==ct&&(I?h_(de,u):g_(de,u),Jd(u),va(oe,de,u._dirtyLeaves,u._dirtyElements));const mt=u._compositionKey;Ae!==mt&&(de._flushSync=!0);const ze=de._selection;if(pt(ze)){const tt=de._nodeMap,Ft=ze.anchor.key,Rt=ze.focus.key;if(tt.get(Ft)===void 0||tt.get(Rt)===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 Er(ze)&&ze._nodes.size===0&&(de._selection=null)}catch(Ae){Ae instanceof Error&&u._onError(Ae),u._pendingEditorState=oe,u._dirtyType=dt,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),ns(u);return}finally{Yn=Ee,Tr=xe,jn=Ce,u._updating=He,za=0}u._dirtyType!==ct||T_(de,u)?de._flushSync?(de._flushSync=!1,ns(u)):Ne&&ys(()=>{ns(u)}):(de._flushSync=!1,Ne&&(f.clear(),u._deferred=[],u._pendingEditorState=null))}function Rr(u,o,a){u._updating?u._updates.push([o,a]):Xd(u,o,a)}class Fc extends At{constructor(o){super(o)}decorate(o,a){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function vn(u){return u instanceof Fc}class rs extends At{constructor(o){super(o),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 o=this.getFormat();return ms[o]||""}getIndent(){return this.getLatest().__indent}getChildren(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getChildrenKeys(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a.__key),a=a.getNextSibling();return o}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const a=gn()._dirtyElements;return a!==null&&a.has(this.__key)}isLastChild(){const o=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(o)}getAllTextNodes(){const o=[];let a=this.getFirstChild();for(;a!==null;){if(gt(a)&&o.push(a),Je(a)){const f=a.getAllTextNodes();o.push(...f)}a=a.getNextSibling()}return o}getFirstDescendant(){let o=this.getFirstChild();for(;o!==null;){if(Je(o)){const a=o.getFirstChild();if(a!==null){o=a;continue}}break}return o}getLastDescendant(){let o=this.getLastChild();for(;o!==null;){if(Je(o)){const a=o.getLastChild();if(a!==null){o=a;continue}}break}return o}getDescendantByIndex(o){const a=this.getChildren(),f=a.length;if(o>=f){const E=a[f-1];return Je(E)&&E.getLastDescendant()||E||null}const _=a[o];return Je(_)&&_.getFirstDescendant()||_||null}getFirstChild(){const a=this.getLatest().__first;return a===null?null:En(a)}getFirstChildOrThrow(){const o=this.getFirstChild();if(o===null)throw Error(`Expected node ${this.__key} to have a first child.`);return o}getLastChild(){const a=this.getLatest().__last;return a===null?null:En(a)}getLastChildOrThrow(){const o=this.getLastChild();if(o===null)throw Error(`Expected node ${this.__key} to have a last child.`);return o}getChildAtIndex(o){const a=this.getChildrenSize();let f,_;if(o<a/2){for(f=this.getFirstChild(),_=0;f!==null&&_<=o;){if(_===o)return f;f=f.getNextSibling(),_++}return null}for(f=this.getLastChild(),_=a-1;f!==null&&_>=o;){if(_===o)return f;f=f.getPreviousSibling(),_--}return null}getTextContent(){let o="";const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContent(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It)}return o}getTextContentSize(){let o=0;const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContentSize(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It.length)}return o}getDirection(){return this.getLatest().__dir}hasFormat(o){if(o!==""){const a=Jr[o];return(this.getFormat()&a)!==0}return!1}select(o,a){nr();const f=cn();let _=o,E=a;const I=this.getChildrenSize();if(!this.canBeEmpty()){if(o===0&&a===0){const oe=this.getFirstChild();if(gt(oe)||Je(oe))return oe.select(0,0)}else if((o===void 0||o===I)&&(a===void 0||a===I)){const oe=this.getLastChild();if(gt(oe)||Je(oe))return oe.select()}}_===void 0&&(_=I),E===void 0&&(E=I);const F=this.__key;if(pt(f))f.anchor.set(F,_,"element"),f.focus.set(F,E,"element"),f.dirty=!0;else return Bd(F,_,F,E,"element","element");return f}selectStart(){const o=this.getFirstDescendant();return o?o.selectStart():this.select()}selectEnd(){const o=this.getLastDescendant();return o?o.selectEnd():this.select()}clear(){const o=this.getWritable();return this.getChildren().forEach(f=>f.remove()),o}append(...o){return this.splice(this.getChildrenSize(),0,o)}setDirection(o){const a=this.getWritable();return a.__dir=o,a}setFormat(o){const a=this.getWritable();return a.__format=o!==""?Jr[o]:0,this}setIndent(o){const a=this.getWritable();return a.__indent=o,this}splice(o,a,f){const _=f.length,E=this.getChildrenSize(),I=this.getWritable(),F=I.__key,oe=[],de=[],Ne=this.getChildAtIndex(o+a);let Ee=null,xe=E-a+_;if(o!==0)if(o===E)Ee=this.getLastChild();else{const He=this.getChildAtIndex(o);He!==null&&(Ee=He.getPreviousSibling())}if(a>0){let He=Ee===null?this.getFirstChild():Ee.getNextSibling();for(let Ie=0;Ie<a;Ie++){if(He===null)throw Error("splice: sibling not found");const Ae=He.getNextSibling(),mt=He.__key,ze=He.getWritable();yi(ze),de.push(mt),He=Ae}}let Ce=Ee;for(let He=0;He<_;He++){const Ie=f[He];Ce!==null&&Ie.is(Ce)&&(Ee=Ce=Ce.getPreviousSibling());const Ae=Ie.getWritable();Ae.__parent===F&&xe--,yi(Ae);const mt=Ie.__key;if(Ce===null)I.__first=mt,Ae.__prev=null;else{const ze=Ce.getWritable();ze.__next=mt,Ae.__prev=ze.__key}if(Ie.__key===F)throw Error("append: attempting to append self");Ae.__parent=F,oe.push(mt),Ce=Ie}if(o+a===E){if(Ce!==null){const He=Ce.getWritable();He.__next=null,I.__last=Ce.__key}}else if(Ne!==null){const He=Ne.getWritable();if(Ce!==null){const Ie=Ce.getWritable();He.__prev=Ce.__key,Ie.__next=Ne.__key}else He.__prev=null}if(I.__size=xe,de.length){const He=cn();if(pt(He)){const Ie=new Set(de),Ae=new Set(oe),{anchor:mt,focus:ze}=He;Qd(mt,Ie,Ae)&&Ka(mt,mt.getNode(),this,Ee,Ne),Qd(ze,Ie,Ae)&&Ka(ze,ze.getNode(),this,Ee,Ne),xe===0&&!this.canBeEmpty()&&!Fr(this)&&this.remove()}}return I}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(o,a){return null}canIndent(){return!0}collapseAtStart(o){return!1}excludeFromCopy(o){return!1}canExtractContents(){return!0}canReplaceWith(o){return!0}canInsertAfter(o){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(o){return!1}extractWithChild(o,a,f){return!1}}function Je(u){return u instanceof rs}function Qd(u,o,a){let f=u.getNode();for(;f;){const _=f.__key;if(o.has(_)&&!a.has(_))return!0;f=f.getParent()}return!1}class Ws extends rs{static getType(){return"root"}static clone(){return new Ws}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const o=this.__cachedText;return(Hs()||gn()._dirtyType===ct)&&o!==null?o:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(o){throw Error("replace: cannot be called on root nodes")}insertBefore(o){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(o){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(o,a){return!1}append(...o){for(let a=0;a<o.length;a++){const f=o[a];if(!Je(f)&&!vn(f))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...o)}static importJSON(o){const a=Zn();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function E_(){return new Ws}function br(u){return u instanceof Ws}function T_(u,o){const a=o.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 x_(u){return new Ua(new Map(u._nodeMap))}function Bc(){return new Ua(new Map([["root",E_()]]))}function ef(u){const o=u.exportJSON(),a=u.constructor;if(o.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.`);const f=o.children;if(Je(u)){if(!Array.isArray(f))throw Error(`LexicalNode: Node ${a.name} is an element but .exportJSON() does not have a children array.`);const _=u.getChildren();for(let E=0;E<_.length;E++){const I=_[E],F=ef(I);f.push(F)}}return o}class Ua{constructor(o,a){this._nodeMap=o,this._selection=a||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(o){return Vd(this,o)}clone(o){const a=new Ua(this._nodeMap,o===void 0?this._selection:o);return a._readOnly=!0,a}toJSON(){return Vd(this,()=>({root:ef(Zn())}))}}class Ks extends rs{static getType(){return"paragraph"}static clone(o){return new Ks(o.__key)}createDOM(o){const a=document.createElement("p"),f=Hi(o.theme,"paragraph");return f!==void 0&&a.classList.add(...f),a}updateDOM(o,a,f){return!1}static importDOM(){return{p:o=>({conversion:S_,priority:0})}}exportDOM(o){const{element:a}=super.exportDOM(o);if(a&&Yo(a)){this.isEmpty()&&a.append(document.createElement("br"));const f=this.getFormatType();a.style.textAlign=f;const _=this.getDirection();_&&(a.dir=_);const E=this.getIndent();E>0&&(a.style.textIndent=`${E*20}px`)}return{element:a}}static importJSON(o){const a=qi();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(o,a){const f=qi(),_=this.getDirection();return f.setDirection(_),this.insertAfter(f,a),f}collapseAtStart(){const o=this.getChildren();if(o.length===0||gt(o[0])&&o[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 S_(u){const o=qi();if(u.style){o.setFormat(u.style.textAlign);const a=parseInt(u.style.textIndent,10)/20;a>0&&o.setIndent(a)}return{node:o}}function qi(){return fo(new Ks)}function v_(u){return u instanceof Ks}const w_=0,O_=1,D_=2,M_=3,A_=4;function tf(u,o,a,f){const _=u._keyToDOMMap;_.clear(),u._editorState=Bc(),u._pendingEditorState=f,u._compositionKey=null,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const E=u._observer;E!==null&&(E.disconnect(),u._observer=null),o!==null&&(o.textContent=""),a!==null&&(a.textContent="",_.set("root",a))}function R_(u,o){const a=new Map,f=new Set,_=E=>{Object.keys(E).forEach(I=>{let F=a.get(I);F===void 0&&(F=[],a.set(I,F)),F.push(E[I])})};return u.forEach(E=>{const I=E.klass.importDOM!=null?E.klass.importDOM.bind(E.klass):null;if(I==null||f.has(I))return;f.add(I);const F=I();F!==null&&_(F)}),o&&_(o),a}function b_(u){const o=u||{},a=f_(),f=o.theme||{},_=u===void 0?a:o.parentEditor||null,E=o.disableEvents||!1,I=Bc(),F=o.namespace||(_!==null?_._config.namespace:Io()),oe=o.editorState,de=[Ws,Gi,Wr,Mi,Ks,...o.nodes||[]],{onError:Ne,html:Ee}=o,xe=o.editable!==void 0?o.editable:!0;let Ce;if(u===void 0&&a!==null)Ce=a._nodes;else{Ce=new Map;for(let Ie=0;Ie<de.length;Ie++){let Ae=de[Ie],mt=null,ze=null;if(typeof Ae!="function"){const Ct=Ae;Ae=Ct.replace,mt=Ct.with,ze=Ct.withKlass||null}{const Ct=Ae.name;if(Ct!=="RootNode"){const St=Ae.prototype;["getType","clone"].forEach(Wt=>{Ae.hasOwnProperty(Wt)||console.warn(`${Ct} must implement static "${Wt}" method`)}),!Ae.hasOwnProperty("importDOM")&&Ae.hasOwnProperty("exportDOM")&&console.warn(`${Ct} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),St instanceof Fc&&(St.hasOwnProperty("decorate")||console.warn(`${St.constructor.name} must implement "decorate" method`)),Ae.hasOwnProperty("importJSON")||console.warn(`${Ct} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),St.hasOwnProperty("exportJSON")||console.warn(`${Ct} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const tt=Ae.getType(),Ft=Ae.transform(),Rt=new Set;Ft!==null&&Rt.add(Ft),Ce.set(tt,{exportDOM:Ee&&Ee.export?Ee.export.get(Ae):void 0,klass:Ae,replace:mt,replaceWithKlass:ze,transforms:Rt})}}const He=new L_(I,_,Ce,{disableEvents:E,namespace:F,theme:f},Ne||console.error,R_(Ce,Ee?Ee.import:void 0),xe);return oe!==void 0&&(He._pendingEditorState=oe,He._dirtyType=dt),He}class L_{constructor(o,a,f,_,E,I,F){this._parentEditor=a,this._rootElement=null,this._editorState=o,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=_,this._nodes=f,this._decorators={},this._pendingDecorators=null,this._dirtyType=ct,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=Io(),this._onError=E,this._htmlConversions=I,this._editable=F,this._headless=a!==null&&a._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(o){const a=this._listeners.update;return a.add(o),()=>{a.delete(o)}}registerEditableListener(o){const a=this._listeners.editable;return a.add(o),()=>{a.delete(o)}}registerDecoratorListener(o){const a=this._listeners.decorator;return a.add(o),()=>{a.delete(o)}}registerTextContentListener(o){const a=this._listeners.textcontent;return a.add(o),()=>{a.delete(o)}}registerRootListener(o){const a=this._listeners.root;return o(this._rootElement,null),a.add(o),()=>{o(null,this._rootElement),a.delete(o)}}registerCommand(o,a,f){if(f===void 0)throw Error('Listener for type "command" requires a "priority".');const _=this._commands;_.has(o)||_.set(o,[new Set,new Set,new Set,new Set,new Set]);const E=_.get(o);if(E===void 0)throw Error(`registerCommand: Command ${String(o)} not found in command map`);const I=E[f];return I.add(a),()=>{I.delete(a),E.every(F=>F.size===0)&&_.delete(o)}}registerMutationListener(o,a){if(this._nodes.get(o.getType())===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);const _=this._listeners.mutation;return _.set(a,o),()=>{_.delete(a)}}registerNodeTransformToKlass(o,a){const f=o.getType(),_=this._nodes.get(f);if(_===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);return _.transforms.add(a),_}registerNodeTransform(o,a){const f=this.registerNodeTransformToKlass(o,a),_=[f],E=f.replaceWithKlass;if(E!=null){const I=this.registerNodeTransformToKlass(E,a);_.push(I)}return Es(this,o.getType()),()=>{_.forEach(I=>I.transforms.delete(a))}}hasNode(o){return this._nodes.has(o.getType())}hasNodes(o){return o.every(this.hasNode.bind(this))}dispatchCommand(o,a){return st(this,o,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(o){const a=this._rootElement;if(o!==a){const f=Hi(this._config.theme,"root"),_=this._pendingEditorState||this._editorState;if(this._rootElement=o,tf(this,a,o,_),a!==null&&(this._config.disableEvents||ke(a),f!=null&&a.classList.remove(...f)),o!==null){const E=uo(o),I=o.style;I.userSelect="text",I.whiteSpace="pre-wrap",I.wordBreak="break-word",o.setAttribute("data-lexical-editor","true"),this._window=E,this._dirtyType=dt,qn(this),this._updateTags.add("history-merge"),ns(this),this._config.disableEvents||Ke(o,this),f!=null&&o.classList.add(...f)}else this._editorState=_,this._pendingEditorState=null,this._window=null;Il("root",this,!1,o,a)}}getElementByKey(o){return this._keyToDOMMap.get(o)||null}getEditorState(){return this._editorState}setEditorState(o,a){if(o.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");mi(this);const f=this._pendingEditorState,_=this._updateTags,E=a!==void 0?a.tag:null;f!==null&&!f.isEmpty()&&(E!=null&&_.add(E),ns(this)),this._pendingEditorState=o,this._dirtyType=dt,this._dirtyElements.set("root",!1),this._compositionKey=null,E!=null&&_.add(E),ns(this)}parseEditorState(o,a){const f=typeof o=="string"?JSON.parse(o):o;return m_(f,this,a)}update(o,a){Rr(this,o,a)}focus(o,a={}){const f=this._rootElement;f!==null&&(f.setAttribute("autocapitalize","off"),Rr(this,()=>{const _=cn(),E=Zn();_!==null?_.dirty=!0:E.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?E.selectStart():E.selectEnd())},{onUpdate:()=>{f.removeAttribute("autocapitalize"),o&&o()},tag:"focus"}),this._pendingEditorState===null&&f.removeAttribute("autocapitalize"))}blur(){const o=this._rootElement;o!==null&&o.blur();const a=_r(this._window);a!==null&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(o){this._editable!==o&&(this._editable=o,Il("editable",this,!0,o))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Hc extends rs{constructor(o,a){super(a),this.__colSpan=o,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(o){return this.getWritable().__colSpan=o,this}getRowSpan(){return this.__rowSpan}setRowSpan(o){return this.getWritable().__rowSpan=o,this}}function Gr(u){return u instanceof Hc}class nf extends rs{}function Wc(u){return u instanceof nf}class rf extends rs{}function Pl(u){return u instanceof rf}return Pe.$INTERNAL_isPointSelection=Cr,Pe.$addUpdateTag=Ti,Pe.$applyNodeReplacement=fo,Pe.$copyNode=xl,Pe.$createLineBreakNode=Oi,Pe.$createNodeSelection=Lc,Pe.$createParagraphNode=qi,Pe.$createRangeSelection=i_,Pe.$createTabNode=Yi,Pe.$createTextNode=Wn,Pe.$getAdjacentNode=ri,Pe.$getNearestNodeFromDOMNode=mr,Pe.$getNearestRootOrShadowRoot=Dr,Pe.$getNodeByKey=En,Pe.$getPreviousSelection=Bs,Pe.$getRoot=Zn,Pe.$getSelection=cn,Pe.$getTextContent=u_,Pe.$hasAncestor=ht,Pe.$hasUpdateTag=Rc,Pe.$insertNodes=c_,Pe.$isBlockElementNode=r_,Pe.$isDecoratorNode=vn,Pe.$isElementNode=Je,Pe.$isInlineElementOrDecoratorNode=xa,Pe.$isLeafNode=_i,Pe.$isLineBreakNode=Di,Pe.$isNodeSelection=Er,Pe.$isParagraphNode=v_,Pe.$isRangeSelection=pt,Pe.$isRootNode=br,Pe.$isRootOrShadowRoot=Fr,Pe.$isTabNode=es,Pe.$isTextNode=gt,Pe.$nodesOfType=Tl,Pe.$normalizeSelection__EXPERIMENTAL=Bi,Pe.$parseSerializedNode=p_,Pe.$selectAll=El,Pe.$setCompositionKey=_n,Pe.$setSelection=Or,Pe.$splitNode=Os,Pe.BLUR_COMMAND=Z,Pe.CAN_REDO_COMMAND=m,Pe.CAN_UNDO_COMMAND=y,Pe.CLEAR_EDITOR_COMMAND=Q,Pe.CLEAR_HISTORY_COMMAND=k,Pe.CLICK_COMMAND=n,Pe.COMMAND_PRIORITY_CRITICAL=A_,Pe.COMMAND_PRIORITY_EDITOR=w_,Pe.COMMAND_PRIORITY_HIGH=M_,Pe.COMMAND_PRIORITY_LOW=O_,Pe.COMMAND_PRIORITY_NORMAL=D_,Pe.CONTROLLED_TEXT_INSERTION_COMMAND=g,Pe.COPY_COMMAND=ne,Pe.CUT_COMMAND=Y,Pe.DELETE_CHARACTER_COMMAND=r,Pe.DELETE_LINE_COMMAND=x,Pe.DELETE_WORD_COMMAND=S,Pe.DEPRECATED_$computeGridMap=Kd,Pe.DEPRECATED_$createGridSelection=o_,Pe.DEPRECATED_$getGridCellNodeRect=ji,Pe.DEPRECATED_$getNodeTriplet=zd,Pe.DEPRECATED_$isGridCellNode=Gr,Pe.DEPRECATED_$isGridNode=Wc,Pe.DEPRECATED_$isGridRowNode=Pl,Pe.DEPRECATED_$isGridSelection=cr,Pe.DEPRECATED_GridCellNode=Hc,Pe.DEPRECATED_GridNode=nf,Pe.DEPRECATED_GridRowNode=rf,Pe.DRAGEND_COMMAND=j,Pe.DRAGOVER_COMMAND=D,Pe.DRAGSTART_COMMAND=z,Pe.DROP_COMMAND=pe,Pe.DecoratorNode=Fc,Pe.ElementNode=rs,Pe.FOCUS_COMMAND=A,Pe.FORMAT_ELEMENT_COMMAND=ue,Pe.FORMAT_TEXT_COMMAND=O,Pe.INDENT_CONTENT_COMMAND=me,Pe.INSERT_LINE_BREAK_COMMAND=c,Pe.INSERT_PARAGRAPH_COMMAND=d,Pe.INSERT_TAB_COMMAND=q,Pe.KEY_ARROW_DOWN_COMMAND=B,Pe.KEY_ARROW_LEFT_COMMAND=H,Pe.KEY_ARROW_RIGHT_COMMAND=w,Pe.KEY_ARROW_UP_COMMAND=W,Pe.KEY_BACKSPACE_COMMAND=ee,Pe.KEY_DELETE_COMMAND=V,Pe.KEY_DOWN_COMMAND=T,Pe.KEY_ENTER_COMMAND=K,Pe.KEY_ESCAPE_COMMAND=le,Pe.KEY_MODIFIER_COMMAND=ae,Pe.KEY_SPACE_COMMAND=X,Pe.KEY_TAB_COMMAND=U,Pe.LineBreakNode=Wr,Pe.MOVE_TO_END=P,Pe.MOVE_TO_START=$,Pe.OUTDENT_CONTENT_COMMAND=_e,Pe.PASTE_COMMAND=p,Pe.ParagraphNode=Ks,Pe.REDO_COMMAND=b,Pe.REMOVE_TEXT_COMMAND=C,Pe.RootNode=Ws,Pe.SELECTION_CHANGE_COMMAND=e,Pe.SELECT_ALL_COMMAND=G,Pe.TabNode=Mi,Pe.TextNode=Gi,Pe.UNDO_COMMAND=R,Pe.createCommand=t,Pe.createEditor=b_,Pe.getNearestEditorFromDOMNode=Lo,Pe.isHTMLAnchorElement=Go,Pe.isHTMLElement=Yo,Pe.isSelectionCapturedInDecoratorInput=io,Pe.isSelectionWithinEditor=Qr,Pe}var $e={},xf;function wN(){if(xf)return $e;xf=1;let t={},e={},n={},r={},c={},d={},g={},p={},C={},S={},x={},O={},R={},b={},T={},w={},P={},H={},$={},W={},B={},K={},X={},ee={},le={},V={},U={},q={},me={},_e={},pe={},ue={},z={},D={},j={},ne={};function Y(l){let i=new URLSearchParams;i.append("code",l);for(let s=1;s<arguments.length;s++)i.append("v",arguments[s]);throw Error(`Minified Lexical error #${l}; 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 G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q=G&&"documentMode"in document?document.documentMode:null,k=G&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),m=G&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),y=G&&"InputEvent"in window&&!Q?"getTargetRanges"in new window.InputEvent("input"):!1,A=G&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Z=G&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ae=G&&/Android/.test(navigator.userAgent),he=G&&/^(?=.*Chrome).*/i.test(navigator.userAgent),se=G&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!he,Te=A||Z||se?" ":"​",be=m?" ":Te,Ue=/^[^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]/,re=/^[^\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},we={center:2,end:6,justify:4,left:1,right:3,start:5},Le={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Be={normal:0,segmented:2,token:1},Ye={0:"normal",2:"segmented",1:"token"},ct=!1,yt=0;function dt(l){yt=l.timeStamp}function Se(l,i,s){return i.__lexicalLineBreak===l||l[`__lexicalKey_${s._key}`]!==void 0}function ie(l){return l.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function fe(l,i,s){ct=!0;let h=100<performance.now()-yt;try{sr(l,()=>{let N=Vt()||ie(l);var v=new Map,M=l.getRootElement(),J=l._editorState,ge=l._blockCursorElement;let ve=!1,Fe="";for(var Ke=0;Ke<i.length;Ke++){var ke=i[Ke],Me=ke.type,Xe=ke.target,ut=vr(Xe,J);if(!(ut===null&&Xe!==M||an(ut))){if(Me==="characterData"){if(ke=h&&ht(ut))e:{ke=N,Me=Xe;var Tt=ut;if(wt(ke)){var At=ke.anchor.getNode();if(At.is(Tt)&&ke.format!==At.getFormat()){ke=!1;break e}}ke=Me.nodeType===3&&Tt.isAttached()}ke&&(Tt=kr(l._window),Me=ke=null,Tt!==null&&Tt.anchorNode===Xe&&(ke=Tt.anchorOffset,Me=Tt.focusOffset),Xe=Xe.nodeValue,Xe!==null&&Nt(ut,Xe,ke,Me,!1))}else if(Me==="childList"){for(ve=!0,Me=ke.addedNodes,Tt=0;Tt<Me.length;Tt++){At=Me[Tt];var hn=hr(At),ar=At.parentNode;ar==null||At===ge||hn!==null||At.nodeName==="BR"&&Se(At,ar,l)||(m&&(hn=At.innerText||At.nodeValue)&&(Fe+=hn),ar.removeChild(At))}if(ke=ke.removedNodes,Me=ke.length,0<Me){for(Tt=0,At=0;At<Me;At++)ar=ke[At],(ar.nodeName==="BR"&&Se(ar,Xe,l)||ge===ar)&&(Xe.appendChild(ar),Tt++);Me!==Tt&&(Xe===M&&(ut=J._nodeMap.get("root")),v.set(Xe,ut))}}}}if(0<v.size)for(let[Wr,si]of v)if(Ze(si))for(v=si.getChildrenKeys(),M=Wr.firstChild,J=0;J<v.length;J++)ge=l.getElementByKey(v[J]),ge!==null&&(M==null?(Wr.appendChild(ge),M=ge):M!==ge&&Wr.replaceChild(ge,M),M=M.nextSibling);else ht(si)&&si.markDirty();if(v=s.takeRecords(),0<v.length){for(M=0;M<v.length;M++)for(ge=v[M],J=ge.addedNodes,ge=ge.target,Ke=0;Ke<J.length;Ke++)ut=J[Ke],Xe=ut.parentNode,Xe==null||ut.nodeName!=="BR"||Se(ut,ge,l)||Xe.removeChild(ut);s.takeRecords()}N!==null&&(ve&&(N.dirty=!0,gr(N)),m&&sn(l)&&N.insertRawText(Fe))})}finally{ct=!1}}function Oe(l){let i=l._observer;if(i!==null){let s=i.takeRecords();fe(l,s,i)}}function Re(l){yt===0&&qn(l).addEventListener("textInput",dt,!0),l._observer=new MutationObserver((i,s)=>{fe(l,i,s)})}function De(l,i){let s=l.__mode,h=l.__format;l=l.__style;let N=i.__mode,v=i.__format;return i=i.__style,(s===null||s===N)&&(h===null||h===v)&&(l===null||l===i)}function We(l,i){let s=l.mergeWithSibling(i),h=ln()._normalizedNodes;return h.add(l.__key),h.add(i.__key),s}function qe(l){if(l.__text===""&&l.isSimpleText()&&!l.isUnmergeable())l.remove();else{for(var i;(i=l.getPreviousSibling())!==null&&ht(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{De(i,l)&&(l=We(i,l));break}for(var s;(s=l.getNextSibling())!==null&&ht(s)&&s.isSimpleText()&&!s.isUnmergeable();)if(s.__text==="")s.remove();else{De(l,s)&&We(l,s);break}}}function Qe(l){return ft(l.anchor),ft(l.focus),l}function ft(l){for(;l.type==="element";){var i=l.getNode(),s=l.offset;if(s===i.getChildrenSize()?(i=i.getChildAtIndex(s-1),s=!0):(i=i.getChildAtIndex(s),s=!1),ht(i)){l.set(i.__key,s?i.getTextContentSize():0,"text");break}else if(!Ze(i))break;l.set(i.__key,s?i.getChildrenSize():0,"element")}}let kt=1,je=typeof queueMicrotask=="function"?queueMicrotask:l=>{Promise.resolve().then(l)};function Ve(l){let i=document.activeElement;if(i===null)return!1;let s=i.nodeName;return an(vr(l))&&(s==="INPUT"||s==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function rt(l,i,s){let h=l.getRootElement();try{return h!==null&&h.contains(i)&&h.contains(s)&&i!==null&&!Ve(i)&&_t(i)===l}catch{return!1}}function _t(l){for(;l!=null;){let i=l.__lexicalEditor;if(i!=null)return i;l=pr(l)}return null}function Et(l){return l.isToken()||l.isSegmented()}function vt(l){for(;l!=null;){if(l.nodeType===3)return l;l=l.firstChild}return null}function Ot(l,i,s){let h=te[i];return s!==null&&(l&h)===(s&h)||(l^=h,i==="subscript"?l&=~te.superscript:i==="superscript"&&(l&=~te.subscript)),l}function Mt(l,i){if(i!=null)l.__key=i;else{Jn(),99<mo&&Y(14),i=ln();var s=yr(),h=""+kt++;s._nodeMap.set(h,l),Ze(l)?i._dirtyElements.set(h,!0):i._dirtyLeaves.add(h),i._cloneNotNeeded.add(h),i._dirtyType=1,l.__key=h}}function xt(l){var i=l.getParent();if(i!==null){let N=l.getWritable();i=i.getWritable();var s=l.getPreviousSibling();if(l=l.getNextSibling(),s===null)if(l!==null){var h=l.getWritable();i.__first=l.__key,h.__prev=null}else i.__first=null;else{if(h=s.getWritable(),l!==null){let v=l.getWritable();v.__prev=h.__key,h.__next=v.__key}else h.__next=null;N.__prev=null}l===null?s!==null?(l=s.getWritable(),i.__last=s.__key,l.__next=null):i.__last=null:(l=l.getWritable(),s!==null?(s=s.getWritable(),s.__next=l.__key,l.__prev=s.__key):l.__prev=null,N.__next=null),i.__size--,N.__parent=null}}function Qt(l){99<mo&&Y(14);var i=l.getLatest(),s=i.__parent,h=yr();let N=ln(),v=h._nodeMap;if(h=N._dirtyElements,s!==null)e:for(;s!==null;){if(h.has(s))break e;let M=v.get(s);if(M===void 0)break;h.set(s,!1),s=M.__parent}i=i.__key,N._dirtyType=1,Ze(l)?h.set(i,!0):N._dirtyLeaves.add(i)}function bt(l){Jn();var i=ln();let s=i._compositionKey;l!==s&&(i._compositionKey=l,s!==null&&(i=It(s),i!==null&&i.getWritable()),l!==null&&(l=It(l),l!==null&&l.getWritable()))}function Ut(){return oi()?null:ln()._compositionKey}function It(l,i){return l=(i||yr())._nodeMap.get(l),l===void 0?null:l}function hr(l,i){let s=ln();return l=l[`__lexicalKey_${s._key}`],l!==void 0?It(l,i):null}function vr(l,i){for(;l!=null;){let s=hr(l,i);if(s!==null)return s;l=pr(l)}return null}function Fi(l){let i=Object.assign({},l._decorators);return l._pendingDecorators=i}function gs(l){return l.read(()=>fn().getTextContent())}function ps(l,i){sr(l,()=>{var s=yr();if(!s.isEmpty())if(i==="root")fn().markDirty();else{s=s._nodeMap;for(let[,h]of s)h.markDirty()}},l._pendingEditorState===null?{tag:"history-merge"}:void 0)}function fn(){return yr()._nodeMap.get("root")}function gr(l){Jn();let i=yr();l!==null&&(l.dirty=!0,l.setCachedNodes(null)),i._selection=l}function Jr(l){var i=ln(),s;e:{for(s=l;s!=null;){let h=s[`__lexicalKey_${i._key}`];if(h!==void 0){s=h;break e}s=pr(s)}s=null}return s===null?(i=i.getRootElement(),l===i?It("root"):null):It(s)}function ms(l){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(l)}function ye(l){let i=[];for(;l!==null;)i.push(l),l=l._parentEditor;return i}function Ge(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function nt(l,i,s){if(i=kr(i._window),i!==null){var h=i.anchorNode,{anchorOffset:N,focusOffset:v}=i;if(h!==null&&(i=h.nodeType===3?h.nodeValue:null,h=vr(h),i!==null&&ht(h))){if(i===Te&&s){let M=s.length;i=s,v=N=M}i!==null&&Nt(h,i,N,v,l)}}}function Nt(l,i,s,h,N){let v=l;if(v.isAttached()&&(N||!v.isDirty())){let ve=v.isComposing(),Fe=i;if((ve||N)&&i[i.length-1]===Te&&(Fe=i.slice(0,-1)),i=v.getTextContent(),N||Fe!==i)if(Fe==="")if(bt(null),A||Z||se)v.remove();else{let Ke=ln();setTimeout(()=>{Ke.update(()=>{v.isAttached()&&v.remove()})},20)}else{N=v.getParent(),i=Ui();var M=v.getTextContentSize(),J=Ut(),ge=v.getKey();v.isToken()||J!==null&&ge===J&&!ve||wt(i)&&(N!==null&&!N.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===l.__key&&i.anchor.offset===0&&!v.canInsertTextBefore()||i.focus.key===l.__key&&i.focus.offset===M&&!v.canInsertTextAfter())?v.markDirty():(l=Vt(),wt(l)&&s!==null&&h!==null&&(l.setTextNodeRange(v,s,v,h),v.isSegmented()&&(s=v.getTextContent(),s=Bn(s),v.replace(s),v=s)),v.setTextContent(Fe))}}}function Ht(l,i){if(i.isSegmented())return!0;if(!l.isCollapsed())return!1;l=l.anchor.offset;let s=i.getParentOrThrow(),h=i.isToken();return l===0?((l=!i.canInsertTextBefore()||!s.canInsertTextBefore()||h)||(i=i.getPreviousSibling(),l=(ht(i)||Ze(i)&&i.isInline())&&!i.canInsertTextAfter()),l):l===i.getTextContentSize()?!i.canInsertTextAfter()||!s.canInsertTextAfter()||h:!1}function Kt(l,i){l.__lexicalClassNameCache===void 0&&(l.__lexicalClassNameCache={});let s=l.__lexicalClassNameCache,h=s[i];return h!==void 0?h:(l=l[i],typeof l=="string"?(l=l.split(" "),s[i]=l):l)}function $t(l,i,s,h,N){s.size!==0&&(s=h.__type,h=h.__key,i=i.get(s),i===void 0&&Y(33,s),s=i.klass,i=l.get(s),i===void 0&&(i=new Map,l.set(s,i)),l=i.get(h),s=l==="destroyed"&&N==="created",(l===void 0||s)&&i.set(h,s?"updated":N))}function Pt(l,i,s){let h=l.getParent(),N=s;return h!==null&&(i&&s===0?(N=l.getIndexWithinParent(),l=h):i||s!==l.getChildrenSize()||(N=l.getIndexWithinParent()+1,l=h)),l.getChildAtIndex(i?N-1:N)}function mn(l,i){var s=l.offset;return l.type==="element"?(l=l.getNode(),Pt(l,i,s)):(l=l.getNode(),i&&s===0||!i&&s===l.getTextContentSize()?(s=i?l.getPreviousSibling():l.getNextSibling(),s===null?Pt(l.getParentOrThrow(),i,l.getIndexWithinParent()+(i?0:1)):s):null)}function sn(l){return l=(l=qn(l).event)&&l.inputType,l==="insertFromPaste"||l==="insertFromPasteAsQuotation"}function nn(l){return!tr(l)&&!l.isLastChild()&&!l.isInline()}function $n(l,i){return l=l._keyToDOMMap.get(i),l===void 0&&Y(75,i),l}function pr(l){return l=l.assignedSlot||l.parentElement,l!==null&&l.nodeType===11?l.host:l}function mi(l,i){for(l=l.getParent();l!==null;){if(l.is(i))return!0;l=l.getParent()}return!1}function qn(l){return l=l._window,l===null&&Y(78),l}function cl(l){for(l=l.getParentOrThrow();l!==null&&!Xr(l);)l=l.getParentOrThrow();return l}function Xr(l){return tr(l)||Ze(l)&&l.isShadowRoot()}function ul(l){return l=l.constructor.clone(l),Mt(l,null),l}function Bi(l){var i=ln();let s=l.constructor.getType();return i=i._nodes.get(s),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(l),i instanceof l.constructor||Y(98),i):l}function _s(l,i){l=l.getParent(),!tr(l)||Ze(i)||an(i)||Y(99)}function dl(l){return(an(l)||Ze(l)&&!l.canBeEmpty())&&!l.isInline()}function fl(l,i,s){s.style.removeProperty("caret-color"),i._blockCursorElement=null,i=l.parentElement,i!==null&&i.removeChild(l)}function kr(l){return G?(l||window).getSelection():null}function ys(l,i){for(;l!==fn()&&l!=null;){if(i(l))return l;l=l.getParent()}return null}function Tc(l){let i=[],s=[l];for(;0<s.length;){let h=s.pop();h===void 0&&Y(112),Ze(h)&&s.unshift(...h.getChildren()),h!==l&&i.push(h)}return i}function io(l){return l.nodeType===1}function Qr(l){if(an(l)&&!l.isInline())return!0;if(!Ze(l)||Xr(l))return!1;var i=l.getFirstChild();return i=i===null||Ei(i)||ht(i)||i.isInline(),!l.isInline()&&l.canBeEmpty()!==!1&&i}function Lo(l,i){for(;l!==null&&l.getParent()!==null&&!i(l);)l=l.getParentOrThrow();return i(l)?l:null}function sa(l,i,s,h,N,v){for(l=l.getFirstChild();l!==null;){let M=l.__key;l.__parent===i&&(Ze(l)&&sa(l,M,s,h,N,v),s.has(M)||v.delete(M),N.push(M)),l=l.getNextSibling()}}function hl(l,i,s,h){l=l._nodeMap,i=i._nodeMap;let N=[];for(let[v]of h){let M=i.get(v);M===void 0||M.isAttached()||(Ze(M)&&sa(M,v,l,i,N,h),l.has(v)||h.delete(v),N.push(v))}for(let v of N)i.delete(v);for(let v of s)h=i.get(v),h===void 0||h.isAttached()||(l.has(v)||s.delete(v),i.delete(v))}let On="",Ln="",wr="",_i,Fn,ko,yi=!1,oo=!1,Ns,_n=null,Ir,En,Ni,mr,Cs,so;function Es(l,i){let s=Ni.get(l);if(i!==null){let h=pl(l);h.parentNode===i&&i.removeChild(h)}mr.has(l)||Fn._keyToDOMMap.delete(l),Ze(s)&&(l=Io(s,Ni),Zn(l,0,l.length-1,null)),s!==void 0&&$t(so,ko,Ns,s,"destroyed")}function Zn(l,i,s,h){for(;i<=s;++i){let N=l[i];N!==void 0&&Es(N,h)}}function Ci(l,i){l.setProperty("text-align",i)}function Or(l,i){var s=_i.theme.indent;if(typeof s=="string"){let h=l.classList.contains(s);0<i&&!h?l.classList.add(s):1>i&&h&&l.classList.remove(s)}s=getComputedStyle(l).getPropertyValue("--lexical-indent-base-value")||"40px",l.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${s})`)}function la(l,i){l=l.style,i===0?Ci(l,""):i===1?Ci(l,"left"):i===2?Ci(l,"center"):i===3?Ci(l,"right"):i===4?Ci(l,"justify"):i===5?Ci(l,"start"):i===6&&Ci(l,"end")}function ei(l,i,s){let h=mr.get(l);h===void 0&&Y(60);let N=h.createDOM(_i,Fn);var v=Fn._keyToDOMMap;if(N["__lexicalKey_"+Fn._key]=l,v.set(l,N),ht(h)?N.setAttribute("data-lexical-text","true"):an(h)&&N.setAttribute("data-lexical-decorator","true"),Ze(h)){if(l=h.__indent,v=h.__size,l!==0&&Or(N,l),v!==0){--v,l=Io(h,mr);var M=Ln;Ln="",Ts(l,h,0,v,N,null),xs(h,N),Ln=M}l=h.__format,l!==0&&la(N,l),h.isInline()||gl(null,h,N),nn(h)&&(On+=`
41
+ `?f.push(Oi()):I===" "?f.push(Yi()):f.push(Wn(I))}this.insertNodes(f)}insertText(o){const a=this.anchor,f=this.focus,_=this.isCollapsed()||a.isBefore(f),E=this.format,I=this.style;_&&a.type==="element"?kl(a,f,E,I):!_&&f.type==="element"&&kl(f,a,E,I);const F=this.getNodes(),oe=F.length,de=_?a:f,Ne=_?f:a,Ee=de.offset,xe=Ne.offset;let Ce=F[0];if(!gt(Ce))throw Error("insertText: first node is not a text node");const Ie=Ce.getTextContent().length,Ae=Ce.getParentOrThrow(),mt=oe-1;let ze=F[mt];if(this.isCollapsed()&&Ee===Ie&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!Ae.canInsertTextAfter()&&Ce.getNextSibling()===null)){let tt=Ce.getNextSibling();if((!gt(tt)||!tt.canInsertTextBefore()||hl(tt))&&(tt=Wn(),tt.setFormat(E),Ae.canInsertTextAfter()?Ce.insertAfter(tt):Ae.insertAfter(tt)),tt.select(0,0),Ce=tt,o!==""){this.insertText(o);return}}else if(this.isCollapsed()&&Ee===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!Ae.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let tt=Ce.getPreviousSibling();if((!gt(tt)||hl(tt))&&(tt=Wn(),tt.setFormat(E),Ae.canInsertTextBefore()?Ce.insertBefore(tt):Ae.insertBefore(tt)),tt.select(),Ce=tt,o!==""){this.insertText(o);return}}else if(Ce.isSegmented()&&Ee!==Ie){const tt=Wn(Ce.getTextContent());tt.setFormat(E),Ce.replace(tt),Ce=tt}else if(!this.isCollapsed()&&o!==""){const tt=ze.getParent();if(!Ae.canInsertTextBefore()||!Ae.canInsertTextAfter()||Je(tt)&&(!tt.canInsertTextBefore()||!tt.canInsertTextAfter())){this.insertText(""),Fd(this.anchor,this.focus,null),this.insertText(o);return}}if(oe===1){if(Ce.isToken()){const Ct=Wn(o);Ct.select(),Ce.replace(Ct);return}const tt=Ce.getFormat(),Ft=Ce.getStyle();if(Ee===xe&&(tt!==E||Ft!==I))if(Ce.getTextContent()==="")Ce.setFormat(E),Ce.setStyle(I);else{const Ct=Wn(o);if(Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ee===0)Ce.insertBefore(Ct,!1);else{const[St]=Ce.splitText(Ee);St.insertAfter(Ct,!1)}Ct.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);return}else if(es(Ce)){const Ct=Wn(o);Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ce.replace(Ct);return}const Rt=xe-Ee;Ce=Ce.spliceText(Ee,Rt,o,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=o.length:(this.format=tt,this.style=Ft))}else{const tt=new Set([...Ce.getParentKeys(),...ze.getParentKeys()]),Ft=Je(Ce)?Ce:Ce.getParentOrThrow();let Rt=Je(ze)?ze:ze.getParentOrThrow(),Ct=ze;if(!Ft.is(Rt)&&Rt.isInline())do Ct=Rt,Rt=Rt.getParentOrThrow();while(Rt.isInline());if(Ne.type==="text"&&(xe!==0||ze.getTextContent()==="")||Ne.type==="element"&&ze.getIndexWithinParent()<xe)if(gt(ze)&&!ze.isToken()&&xe!==ze.getTextContentSize()){if(ze.isSegmented()){const qt=Wn(ze.getTextContent());ze.replace(qt),ze=qt}!br(Ne.getNode())&&Ne.type==="text"&&(ze=ze.spliceText(0,xe,"")),tt.add(ze.__key)}else{const qt=ze.getParentOrThrow();!qt.canBeEmpty()&&qt.getChildrenSize()===1?qt.remove():ze.remove()}else tt.add(ze.__key);const St=Rt.getChildren(),Wt=new Set(F),Zt=Ft.is(Rt),pn=Ft.isInline()&&Ce.getNextSibling()===null?Ft:Ce;for(let qt=St.length-1;qt>=0;qt--){const Dn=St[qt];if(Dn.is(Ce)||Je(Dn)&&Dn.isParentOf(Ce))break;Dn.isAttached()&&(!Wt.has(Dn)||Dn.is(Ct)?Zt||pn.insertAfter(Dn,!1):Dn.remove())}if(!Zt){let qt=Rt,Dn=null;for(;qt!==null;){const ai=qt.getChildren(),Zi=ai.length;(Zi===0||ai[Zi-1].is(Dn))&&(tt.delete(qt.__key),Dn=qt),qt=qt.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(Ee,Ie-Ee,o,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);else if(Ee===Ie)Ce.select();else{const qt=Wn(o);qt.select(),Ce.replace(qt)}for(let qt=1;qt<oe;qt++){const Dn=F[qt],ai=Dn.__key;tt.has(ai)||Dn.remove()}}}removeText(){this.insertText("")}formatText(o){if(this.isCollapsed()){this.toggleFormat(o),_n(null);return}const a=this.getNodes(),f=[];for(const ze of a)gt(ze)&&f.push(ze);const _=f.length;if(_===0){this.toggleFormat(o),_n(null);return}const E=this.anchor,I=this.focus,F=this.isBackward(),oe=F?I:E,de=F?E:I;let Ne=0,Ee=f[0],xe=oe.type==="element"?0:oe.offset;if(oe.type==="text"&&xe===Ee.getTextContentSize()&&(Ne=1,Ee=f[1],xe=0),Ee==null)return;const Ce=Ee.getFormatFlags(o,null),He=_-1;let Ie=f[He];const Ae=de.type==="text"?de.offset:Ie.getTextContentSize();if(Ee.is(Ie)){if(xe===Ae)return;if(xe===0&&Ae===Ee.getTextContentSize())Ee.setFormat(Ce);else{const ze=Ee.splitText(xe,Ae),tt=xe===0?ze[0]:ze[1];tt.setFormat(Ce),oe.type==="text"&&oe.set(tt.__key,0,"text"),de.type==="text"&&de.set(tt.__key,Ae-xe,"text")}this.format=Ce;return}xe!==0&&([,Ee]=Ee.splitText(xe),xe=0),Ee.setFormat(Ce);const mt=Ie.getFormatFlags(o,Ce);Ae>0&&(Ae!==Ie.getTextContentSize()&&([Ie]=Ie.splitText(Ae)),Ie.setFormat(mt));for(let ze=Ne+1;ze<He;ze++){const tt=f[ze];if(!tt.isToken()){const Ft=tt.getFormatFlags(o,mt);tt.setFormat(Ft)}}oe.type==="text"&&oe.set(Ee.__key,xe,"text"),de.type==="text"&&de.set(Ie.__key,Ae,"text"),this.format=Ce|mt}insertNodes(o){if(o.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const Ae=cn();if(!pt(Ae))throw Error("Expected RangeSelection after insertParagraph");return Ae.insertNodes(o)}const a=Ds(this.anchor.getNode(),zi),f=o[o.length-1];if("__language"in a){if("__language"in o[0])this.insertText(o[0].getTextContent());else{const Ae=Pc(this);a.splice(Ae,0,o),f.selectEnd()}return}const _=Ae=>(Je(Ae)||vn(Ae))&&!Ae.isInline();if(!o.some(_)){const Ae=Pc(this);a.splice(Ae,0,o),f.selectEnd();return}const E=g_(o),I=E.getLastDescendant(),F=E.getChildren(),oe=Ae=>"__value"in Ae&&"__checked"in Ae,de=Ae=>Je(Ae)&&zi(Ae)&&!Ae.isEmpty()&&Je(a)&&(!a.isEmpty()||oe(a)),Ee=!Je(a)||!a.isEmpty()?this.insertParagraph():null,xe=F[F.length-1];let Ce=F[0];de(Ce)&&(a.append(...Ce.getChildren()),Ce=F[1]),Ce&&ar(a,Ce);const He=Ds(I,zi);Ee&&Je(He)&&(oe(Ee)||zi(xe))&&(He.append(...Ee.getChildren()),Ee.remove()),Je(a)&&a.isEmpty()&&a.remove(),I.selectEnd();const Ie=Je(a)?a.getLastChild():null;Di(Ie)&&He!==a&&Ie.remove()}insertParagraph(){if(this.anchor.key==="root"){const I=qi();return Zn().splice(this.anchor.offset,0,[I]),I.select(),I}const o=Pc(this),a=Ds(this.anchor.getNode(),zi),f=a.getChildAtIndex(o),_=f?[f,...f.getNextSiblings()]:[],E=a.insertNewAfter(this,!1);return E?(E.append(..._),E.selectStart(),E):null}insertLineBreak(o){const a=Oi();if(this.insertNodes([a]),o){const f=a.getParentOrThrow(),_=a.getIndexWithinParent();f.select(_,_)}}extract(){const o=this.getNodes(),a=o.length,f=a-1,_=this.anchor,E=this.focus;let I=o[0],F=o[f];const[oe,de]=er(this);if(a===0)return[];if(a===1){if(gt(I)&&!this.isCollapsed()){const Ee=oe>de?de:oe,xe=oe>de?oe:de,Ce=I.splitText(Ee,xe),He=Ee===0?Ce[0]:Ce[1];return He!=null?[He]:[]}return[I]}const Ne=_.isBefore(E);if(gt(I)){const Ee=Ne?oe:de;Ee===I.getTextContentSize()?o.shift():Ee!==0&&([,I]=I.splitText(Ee),o[0]=I)}if(gt(F)){const xe=F.getTextContent().length,Ce=Ne?de:oe;Ce===0?o.pop():Ce!==xe&&([F]=F.splitText(Ce),o[f]=F)}return o}modify(o,a,f){const _=this.focus,E=this.anchor,I=o==="move",F=ri(_,a);if(vn(F)&&!F.isIsolated()){if(I&&F.isKeyboardSelectable()){const Ce=kc();Ce.add(F.__key),Or(Ce);return}const xe=a?F.getPreviousSibling():F.getNextSibling();if(gt(xe)){const Ce=xe.__key,He=a?xe.getTextContent().length:0;_.set(Ce,He,"text"),I&&E.set(Ce,He,"text");return}else{const Ce=F.getParentOrThrow();let He,Ie;Je(xe)?(Ie=xe.__key,He=a?xe.getChildrenSize():0):(He=F.getIndexWithinParent(),Ie=Ce.__key,a||He++),_.set(Ie,He,"element"),I&&E.set(Ie,He,"element");return}}const oe=gn(),de=_r(oe._window);if(!de)return;const Ne=oe._blockCursorElement,Ee=oe._rootElement;if(Ee!==null&&Ne!==null&&Je(F)&&!F.isInline()&&!F.canBeEmpty()&&wt(Ne,oe,Ee),Fs(de,o,a?"backward":"forward",f),de.rangeCount>0){const xe=de.getRangeAt(0),Ce=this.anchor.getNode(),He=br(Ce)?Ce:Dr(Ce);if(this.applyDOMRange(xe),this.dirty=!0,!I){const Ie=this.getNodes(),Ae=[];let mt=!1;for(let ze=0;ze<Ie.length;ze++){const tt=Ie[ze];ht(tt,He)?Ae.push(tt):mt=!0}if(mt&&Ae.length>0)if(a){const ze=Ae[0];Je(ze)?ze.selectStart():ze.getParentOrThrow().selectStart()}else{const ze=Ae[Ae.length-1];Je(ze)?ze.selectEnd():ze.getParentOrThrow().selectEnd()}(de.anchorNode!==xe.startContainer||de.anchorOffset!==xe.startOffset)&&Vi(this)}}}deleteCharacter(o){const a=this.isCollapsed();if(this.isCollapsed()){const f=this.anchor,_=this.focus;let E=f.getNode();if(!o&&(f.type==="element"&&Je(E)&&f.offset===E.getChildrenSize()||f.type==="text"&&f.offset===E.getTextContentSize())){const F=E.getParent(),oe=E.getNextSibling()||(F===null?null:F.getNextSibling());if(Je(oe)&&oe.isShadowRoot())return}const I=ri(_,o);if(vn(I)&&!I.isIsolated()){if(I.isKeyboardSelectable()&&Je(E)&&E.getChildrenSize()===0){E.remove();const F=kc();F.add(I.__key),Or(F)}else I.remove(),gn().dispatchCommand(e,void 0);return}else if(!o&&Je(I)&&Je(E)&&E.isEmpty()){E.remove(),I.selectStart();return}if(this.modify("extend",o,"character"),this.isCollapsed()){if(o&&f.offset===0&&(f.type==="element"?f.getNode():f.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const F=_.type==="text"?_.getNode():null;if(E=f.type==="text"?f.getNode():null,F!==null&&F.isSegmented()){const oe=_.offset,de=F.getTextContentSize();if(F.is(E)||o&&oe!==de||!o&&oe!==0){Id(F,o,oe);return}}else if(E!==null&&E.isSegmented()){const oe=f.offset,de=E.getTextContentSize();if(E.is(F)||o&&oe!==0||!o&&oe!==de){Id(E,o,oe);return}}Ha(this,o)}}if(this.removeText(),o&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const f=this.anchor.getNode();f.isEmpty()&&br(f.getParent())&&f.getIndexWithinParent()===0&&f.collapseAtStart(this)}}deleteLine(o){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",o,"lineboundary"),(o?this.focus:this.anchor).offset===0&&this.modify("extend",o,"character")),this.removeText()}deleteWord(o){this.isCollapsed()&&this.modify("extend",o,"word"),this.removeText()}}function Er(u){return u instanceof kn}function Ri(u){const o=u.offset;if(u.type==="text")return o;const a=u.getNode();return o===a.getChildrenSize()?a.getTextContent().length:0}function er(u){const o=u.anchor,a=u.focus;return o.type==="element"&&a.type==="element"&&o.key===a.key&&o.offset===a.offset?[0,0]:[Ri(o),Ri(a)]}function Vi(u){const o=u.focus,a=u.anchor,f=a.key,_=a.offset,E=a.type;li(a,o.key,o.offset,o.type),li(o,f,_,E),u._cachedNodes=null}function Fs(u,o,a,f){u.modify(o,a,f)}function Ha(u,o){const a=u.anchor,f=u.focus,_=a.getNode(),E=f.getNode();if(_===E&&a.type==="text"&&f.type==="text"){const I=a.offset,F=f.offset,oe=I<F,de=oe?I:F,Ne=oe?F:I,Ee=Ne-1;if(de!==Ee){const xe=_.getTextContent().slice(de,Ne);gl(xe)||(o?f.offset=Ee:a.offset=Ee)}}}function Id(u,o,a){const f=u,E=f.getTextContent().split(/(?=\s)/g),I=E.length;let F=0,oe=0;for(let Ne=0;Ne<I;Ne++){const Ee=E[Ne],xe=Ne===I-1;if(oe=F,F+=Ee.length,o&&F===a||F>a||xe){E.splice(Ne,1),xe&&(oe=void 0);break}}const de=E.join("").trim();de===""?f.remove():(f.setTextContent(de),f.select(oe,oe))}function o_(u,o,a){const f=u.getParent();return a===null||f===null||!f.canBeEmpty()||f!==a.getNode()}function Pd(u,o,a,f){let _=o,E;if(u.nodeType===Be){let I=!1;const F=u.childNodes,oe=F.length;_===oe&&(I=!0,_=oe-1);let de=F[_],Ne=!1;if(de===f._blockCursorElement?(de=F[_+1],Ne=!0):f._blockCursorElement!==null&&_--,E=ei(de),gt(E))_=Ts(E,I);else{let Ee=ei(u);if(Ee===null)return null;if(Je(Ee)){let xe=Ee.getChildAtIndex(_);if(Je(xe)&&o_(xe,_,a)){const Ce=I?xe.getLastDescendant():xe.getFirstDescendant();Ce===null?(Ee=xe,_=0):(xe=Ce,Ee=Je(xe)?xe:xe.getParentOrThrow())}gt(xe)?(E=xe,Ee=null,_=Ts(xe,I)):xe!==Ee&&I&&!Ne&&_++}else{const xe=Ee.getIndexWithinParent();o===0&&vn(Ee)&&ei(u)===Ee?_=xe:_=xe+1,Ee=Ee.getParentOrThrow()}if(Je(Ee))return Ur(Ee.__key,_,"element")}}else E=ei(u);return gt(E)?Ur(E.__key,_,"text"):null}function $d(u,o,a){const f=u.offset,_=u.getNode();if(f===0){const E=_.getPreviousSibling(),I=_.getParent();if(!o)Je(E)&&!a&&E.isInline()?(u.key=E.__key,u.offset=E.getChildrenSize(),u.type="element"):gt(E)&&(u.key=E.__key,u.offset=E.getTextContent().length);else if((a||!o)&&E===null&&Je(I)&&I.isInline()){const F=I.getPreviousSibling();gt(F)&&(u.key=F.__key,u.offset=F.getTextContent().length)}}else if(f===_.getTextContent().length){const E=_.getNextSibling(),I=_.getParent();if(o&&Je(E)&&E.isInline())u.key=E.__key,u.offset=0,u.type="element";else if((a||o)&&E===null&&Je(I)&&I.isInline()&&!I.canInsertTextAfter()){const F=I.getNextSibling();gt(F)&&(u.key=F.__key,u.offset=0)}}}function Fd(u,o,a){if(u.type==="text"&&o.type==="text"){const f=u.isBefore(o),_=u.is(o);$d(u,f,_),$d(o,!f,_),_&&(o.key=u.key,o.offset=u.offset,o.type=u.type);const E=gn();if(E.isComposing()&&E._compositionKey!==u.key&&pt(a)){const I=a.anchor,F=a.focus;li(u,I.key,I.offset,I.type),li(o,F.key,F.offset,F.type)}}}function Bd(u,o,a,f,_,E){if(u===null||a===null||!Qr(_,u,a))return null;const I=Pd(u,o,pt(E)?E.anchor:null,_);if(I===null)return null;const F=Pd(a,f,pt(E)?E.focus:null,_);if(F===null)return null;if(I.type==="element"&&F.type==="element"){const oe=ei(u),de=ei(a);if(vn(oe)&&vn(de))return null}return Fd(I,F,E),[I,F]}function s_(u){return Je(u)&&!u.isInline()}function Hd(u,o,a,f,_,E){const I=bi(),F=new In(Ur(u,o,_),Ur(a,f,E),0,"");return F.dirty=!0,I._selection=F,F}function l_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new In(u,o,0,"")}function kc(){return new kn(new Set)}function a_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new Qn("root",u,o)}function c_(u){const a=u.getEditorState()._selection,f=_r(u._window);return pt(a)||a==null?Ic(a,f,u):a.clone()}function Ic(u,o,a){const f=a._window;if(f===null)return null;const _=f.event,E=_?_.type:void 0,I=E==="selectionchange",F=!Kt()&&(I||E==="beforeinput"||E==="compositionstart"||E==="compositionend"||E==="click"&&_&&_.detail===3||E==="drop"||E===void 0);let oe,de,Ne,Ee;if(!pt(u)||F){if(o===null)return null;if(oe=o.anchorNode,de=o.focusNode,Ne=o.anchorOffset,Ee=o.focusOffset,I&&pt(u)&&!Qr(a,oe,de))return u.clone()}else return u.clone();const xe=Bd(oe,Ne,de,Ee,a,u);if(xe===null)return null;const[Ce,He]=xe;return new In(Ce,He,pt(u)?u.format:0,pt(u)?u.style:"")}function cn(){return bi()._selection}function Bs(){return gn()._editorState._selection}function Wa(u,o,a,f=1){const _=u.anchor,E=u.focus,I=_.getNode(),F=E.getNode();if(!o.is(I)&&!o.is(F))return;const oe=o.__key;if(u.isCollapsed()){const de=_.offset;if(a<=de&&f>0||a<de&&f<0){const Ne=Math.max(0,de+f);_.set(oe,Ne,"element"),E.set(oe,Ne,"element"),Wd(u)}}else{const de=u.isBackward(),Ne=de?E:_,Ee=Ne.getNode(),xe=de?_:E,Ce=xe.getNode();if(o.is(Ee)){const He=Ne.offset;(a<=He&&f>0||a<He&&f<0)&&Ne.set(oe,Math.max(0,He+f),"element")}if(o.is(Ce)){const He=xe.offset;(a<=He&&f>0||a<He&&f<0)&&xe.set(oe,Math.max(0,He+f),"element")}}Wd(u)}function Wd(u){const o=u.anchor,a=o.offset,f=u.focus,_=f.offset,E=o.getNode(),I=f.getNode();if(u.isCollapsed()){if(!Je(E))return;const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text"),f.set(de.__key,Ne,"text")}return}if(Je(E)){const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text")}}if(Je(I)){const F=I.getChildrenSize(),oe=_>=F,de=oe?I.getChildAtIndex(F-1):I.getChildAtIndex(_);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),f.set(de.__key,Ne,"text")}}}function u_(u,o){const f=o.getEditorState()._selection,_=u._selection;if(pt(_)){const E=_.anchor,I=_.focus;let F;if(E.type==="text"&&(F=E.getNode(),F.selectionTransform(f,_)),I.type==="text"){const oe=I.getNode();F!==oe&&oe.selectionTransform(f,_)}}}function Ka(u,o,a,f,_){let E=null,I=0,F=null;f!==null?(E=f.__key,gt(f)?(I=f.getTextContentSize(),F="text"):Je(f)&&(I=f.getChildrenSize(),F="element")):_!==null&&(E=_.__key,gt(_)?F="text":Je(_)&&(F="element")),E!==null&&F!==null?u.set(E,I,F):(I=o.getIndexWithinParent(),I===-1&&(I=a.getChildrenSize()),u.set(a.__key,I,"element"))}function Kd(u,o,a,f,_){u.type==="text"?(u.key=a,o||(u.offset+=_)):u.offset>f.getIndexWithinParent()&&(u.offset-=1)}function d_(u,o,a,f,_,E,I){const F=f.anchorNode,oe=f.focusNode,de=f.anchorOffset,Ne=f.focusOffset,Ee=document.activeElement;if(_.has("collaboration")&&Ee!==E||Ee!==null&&io(Ee))return;if(!pt(o)){u!==null&&Qr(a,F,oe)&&f.removeAllRanges();return}const xe=o.anchor,Ce=o.focus,He=xe.key,Ie=Ce.key,Ae=vs(a,He),mt=vs(a,Ie),ze=xe.offset,tt=Ce.offset,Ft=o.format,Rt=o.style,Ct=o.isCollapsed();let St=Ae,Wt=mt,Zt=!1;if(xe.type==="text"){St=Ln(Ae);const pn=xe.getNode();Zt=pn.getFormat()!==Ft||pn.getStyle()!==Rt}else pt(u)&&u.anchor.type==="text"&&(Zt=!0);if(Ce.type==="text"&&(Wt=Ln(mt)),!(St===null||Wt===null)&&(Ct&&(u===null||Zt||pt(u)&&(u.format!==Ft||u.style!==Rt))&&ut(Ft,Rt,ze,He,performance.now()),!(de===ze&&Ne===tt&&F===St&&oe===Wt&&!(f.type==="Range"&&Ct)&&((Ee===null||!E.contains(Ee))&&E.focus({preventScroll:!0}),xe.type!=="element")))){try{f.setBaseAndExtent(St,ze,Wt,tt)}catch{}if(!_.has("skip-scroll-into-view")&&o.isCollapsed()&&E!==null&&E===document.activeElement){const pn=o instanceof In&&o.anchor.type==="element"?St.childNodes[ze]||null:f.rangeCount>0?f.getRangeAt(0):null;if(pn!==null){let qt;if(pn instanceof Text){const Dn=document.createRange();Dn.selectNode(pn),qt=Dn.getBoundingClientRect()}else qt=pn.getBoundingClientRect();Ta(a,qt,E)}}Xe()}}function f_(u){let o=cn()||Bs();o===null&&(o=Zn().selectEnd()),o.insertNodes(u)}function h_(){const u=cn();return u===null?"":u.getTextContent()}function zd(u,o,a){const f=[];let _=null,E=null;function I(de,Ne,Ee){const xe={cell:Ee,startColumn:Ne,startRow:de},Ce=Ee.__rowSpan,He=Ee.__colSpan;for(let Ie=0;Ie<Ce;Ie++){f[de+Ie]===void 0&&(f[de+Ie]=[]);for(let Ae=0;Ae<He;Ae++)f[de+Ie][Ne+Ae]=xe}o.is(Ee)&&(_=xe),a.is(Ee)&&(E=xe)}function F(de,Ne){return f[de]===void 0||f[de][Ne]===void 0}const oe=u.getChildren();for(let de=0;de<oe.length;de++){const Ne=oe[de];if(!Pl(Ne))throw Error("Expected GridNode children to be GridRowNode");const Ee=Ne.getChildren();let xe=0;for(const Ce of Ee){if(!Gr(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!F(de,xe);)xe++;I(de,xe,Ce),xe+=Ce.__colSpan}}if(_===null)throw Error("Anchor not found in Grid");if(E===null)throw Error("Focus not found in Grid");return[f,_,E]}function Ud(u){let o;if(u instanceof Wc)o=u;else if(u instanceof At){const _=Uo(u,Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}else{const _=Uo(u.getNode(),Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}const a=o.getParent();if(!Pl(a))throw Error("Expected GridCellNode to have a parent GridRowNode");const f=a.getParent();if(!Kc(f))throw Error("Expected GridRowNode to have a parent GridNode");return[o,a,f]}function Pc(u){u.isCollapsed()||u.removeText();const o=u.anchor,a=o.getNode();if(!gt(a))return o.offset;const f=a.getParent();if(!f){const oe=qi();return Zn().append(oe),oe.select(),0}const _=a.splitText(o.offset);if(_.length===0)return 0;const E=o.offset===0?0:1,I=_[0].getIndexWithinParent()+E;if(!f.isInline()||I===0)return I;const F=f.getChildAtIndex(I);return F&&f.insertNewAfter(u).append(F,...F.getNextSiblings()),f.getIndexWithinParent()+E}function g_(u){const o=qi();let a=null;for(let f=0;f<u.length;f++){const _=u[f],E=Di(_);if(E||vn(_)&&_.isInline()||Je(_)&&_.isInline()||gt(_)||_.isParentRequired()){if(a===null&&(a=_.createParentElementNode(),o.append(a),E))continue;a!==null&&a.append(_)}else o.append(_),a=null}return o}let Yn=null,jn=null,Tr=!1,$c=!1,za=0;const Gd={characterData:!0,childList:!0,subtree:!0};function Hs(){return Tr||Yn!==null&&Yn._readOnly}function nr(){if(Tr)throw Error("Cannot use method in read-only mode.")}function Yd(){if(za>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 bi(){if(Yn===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 Yn}function gn(){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 p_(){return jn}function jd(u,o,a){const f=o.__type,_=kr(u,f);let E=a.get(f);E===void 0&&(E=Array.from(_.transforms),a.set(f,E));const I=E.length;for(let F=0;F<I&&(E[F](o),!!o.isAttached());F++);}function Vd(u,o){return u!==void 0&&u.__key!==o&&u.isAttached()}function m_(u,o){const a=o._dirtyLeaves,f=u._nodeMap;for(const _ of a){const E=f.get(_);gt(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&ul(E)}}function __(u,o){const a=o._dirtyLeaves,f=o._dirtyElements,_=u._nodeMap,E=Ir(),I=new Map;let F=a,oe=F.size,de=f,Ne=de.size;for(;oe>0||Ne>0;){if(oe>0){o._dirtyLeaves=new Set;for(const Ee of F){const xe=_.get(Ee);gt(xe)&&xe.isAttached()&&xe.isSimpleText()&&!xe.isUnmergeable()&&ul(xe),xe!==void 0&&Vd(xe,E)&&jd(o,xe,I),a.add(Ee)}if(F=o._dirtyLeaves,oe=F.size,oe>0){za++;continue}}o._dirtyLeaves=new Set,o._dirtyElements=new Map;for(const Ee of de){const xe=Ee[0],Ce=Ee[1];if(xe!=="root"&&!Ce)continue;const He=_.get(xe);He!==void 0&&Vd(He,E)&&jd(o,He,I),f.set(xe,Ce)}F=o._dirtyLeaves,oe=F.size,de=o._dirtyElements,Ne=de.size,za++}o._dirtyLeaves=a,o._dirtyElements=f}function y_(u){return Fc(u,gn()._nodes)}function Fc(u,o){const a=u.type,f=o.get(a);if(f===void 0)throw Error(`parseEditorState: type "${a}" + not found`);const _=f.klass;if(u.type!==_.getType())throw Error(`LexicalNode: Node ${_.name} does not implement .importJSON().`);const E=_.importJSON(u),I=u.children;if(Je(E)&&Array.isArray(I))for(let F=0;F<I.length;F++){const oe=I[F],de=Fc(oe,o);E.append(de)}return E}function N_(u,o,a){const f=Hc(),_=Yn,E=Tr,I=jn,F=o._dirtyElements,oe=o._dirtyLeaves,de=o._cloneNotNeeded,Ne=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Yn=f,Tr=!1,jn=o;try{const Ee=o._nodes,xe=u.root;Fc(xe,Ee),a&&a(),f._readOnly=!0,Zd(f)}catch(Ee){Ee instanceof Error&&o._onError(Ee)}finally{o._dirtyElements=F,o._dirtyLeaves=oe,o._cloneNotNeeded=de,o._dirtyType=Ne,Yn=_,Tr=E,jn=I}return f}function qd(u,o){const a=Yn,f=Tr,_=jn;Yn=u,Tr=!0,jn=null;try{return o()}finally{Yn=a,Tr=f,jn=_}}function Zd(u){const o=u._nodeMap;o.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},o.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},o.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function ns(u,o){const a=u._pendingEditorState,f=u._rootElement,_=u._headless||f===null;if(a===null)return;const E=u._editorState,I=E._selection,F=a._selection,oe=u._dirtyType!==ct,de=Yn,Ne=Tr,Ee=jn,xe=u._updating,Ce=u._observer;let He=null;if(u._pendingEditorState=null,u._editorState=a,!_&&oe&&Ce!==null){jn=u,Yn=a,Tr=!1,u._updating=!0;try{const Ct=u._dirtyType,St=u._dirtyElements,Wt=u._dirtyLeaves;Ce.disconnect(),He=sr(E,a,u,Ct,St,Wt)}catch(Ct){if(Ct instanceof Error&&u._onError(Ct),!$c)nf(u,null,f,a),qn(u),u._dirtyType=dt,$c=!0,ns(u,E),$c=!1;else throw Ct;return}finally{Ce.observe(f,Gd),u._updating=xe,Yn=de,Tr=Ne,jn=Ee}}a._readOnly||(a._readOnly=!0,Zd(a),pt(F)&&(Object.freeze(F.anchor),Object.freeze(F.focus)),Object.freeze(F));const Ie=u._dirtyLeaves,Ae=u._dirtyElements,mt=u._normalizedNodes,ze=u._updateTags,tt=u._deferred;oe&&(u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),Sa(u,a);const Ft=_?null:_r(u._window);if(u._editable&&Ft!==null&&(oe||F===null||F.dirty)){jn=u,Yn=a;try{if(Ce!==null&&Ce.disconnect(),oe||F===null||F.dirty){const Ct=u._blockCursorElement;Ct!==null&&wt(Ct,u,f),d_(I,F,u,Ft,ze,f)}vl(u,f,F),Ce!==null&&Ce.observe(f,Gd)}finally{jn=Ee,Yn=de}}He!==null&&E_(u,He,ze,Ie,E),!pt(F)&&F!==null&&(I===null||!I.is(F))&&u.dispatchCommand(e,void 0);const Rt=u._pendingDecorators;Rt!==null&&(u._decorators=Rt,u._pendingDecorators=null,Il("decorator",u,!0,Rt)),C_(u,o||E,a),Il("update",u,!0,{dirtyElements:Ae,dirtyLeaves:Ie,editorState:a,normalizedNodes:mt,prevEditorState:o||E,tags:ze}),x_(u,tt),T_(u)}function C_(u,o,a){const f=so(o),_=so(a);f!==_&&Il("textcontent",u,!0,_)}function E_(u,o,a,f,_){const E=Array.from(u._listeners.mutation),I=E.length;for(let F=0;F<I;F++){const[oe,de]=E[F],Ne=o.get(de);Ne!==void 0&&oe(Ne,{dirtyLeaves:f,prevEditorState:_,updateTags:a})}}function Il(u,o,a,...f){const _=o._updating;o._updating=a;try{const E=Array.from(o._listeners[u]);for(let I=0;I<E.length;I++)E[I].apply(null,f)}finally{o._updating=_}}function Jd(u,o,a){if(u._updating===!1||jn!==u){let _=!1;return u.update(()=>{_=Jd(u,o,a)}),_}const f=xs(u);for(let _=4;_>=0;_--)for(let E=0;E<f.length;E++){const oe=f[E]._commands.get(o);if(oe!==void 0){const de=oe[_];if(de!==void 0){const Ne=Array.from(de),Ee=Ne.length;for(let xe=0;xe<Ee;xe++)if(Ne[xe](a,u)===!0)return!0}}}return!1}function T_(u){const o=u._updates;if(o.length!==0){const a=o.shift();if(a){const[f,_]=a;Qd(u,f,_)}}}function x_(u,o){if(u._deferred=[],o.length!==0){const a=u._updating;u._updating=!0;try{for(let f=0;f<o.length;f++)o[f]()}finally{u._updating=a}}}function Xd(u,o){const a=u._updates;let f=o||!1;for(;a.length!==0;){const _=a.shift();if(_){const[E,I]=_;let F,oe;I!==void 0&&(F=I.onUpdate,oe=I.tag,I.skipTransforms&&(f=!0),F&&u._deferred.push(F),oe&&u._updateTags.add(oe)),E()}}return f}function Qd(u,o,a){const f=u._updateTags;let _,E,I=!1,F=!1;a!==void 0&&(_=a.onUpdate,E=a.tag,E!=null&&f.add(E),I=a.skipTransforms||!1,F=a.discrete||!1),_&&u._deferred.push(_);const oe=u._editorState;let de=u._pendingEditorState,Ne=!1;(de===null||de._readOnly)&&(de=u._pendingEditorState=w_(de||oe),Ne=!0),de._flushSync=F;const Ee=Yn,xe=Tr,Ce=jn,He=u._updating;Yn=de,Tr=!1,u._updating=!0,jn=u;try{Ne&&(u._headless?oe._selection!=null&&(de._selection=oe._selection.clone()):de._selection=c_(u));const Ae=u._compositionKey;o(),I=Xd(u,I),u_(de,u),u._dirtyType!==ct&&(I?m_(de,u):__(de,u),Xd(u),va(oe,de,u._dirtyLeaves,u._dirtyElements));const mt=u._compositionKey;Ae!==mt&&(de._flushSync=!0);const ze=de._selection;if(pt(ze)){const tt=de._nodeMap,Ft=ze.anchor.key,Rt=ze.focus.key;if(tt.get(Ft)===void 0||tt.get(Rt)===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 Er(ze)&&ze._nodes.size===0&&(de._selection=null)}catch(Ae){Ae instanceof Error&&u._onError(Ae),u._pendingEditorState=oe,u._dirtyType=dt,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),ns(u);return}finally{Yn=Ee,Tr=xe,jn=Ce,u._updating=He,za=0}u._dirtyType!==ct||v_(de,u)?de._flushSync?(de._flushSync=!1,ns(u)):Ne&&ys(()=>{ns(u)}):(de._flushSync=!1,Ne&&(f.clear(),u._deferred=[],u._pendingEditorState=null))}function Rr(u,o,a){u._updating?u._updates.push([o,a]):Qd(u,o,a)}class Bc extends At{constructor(o){super(o)}decorate(o,a){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function vn(u){return u instanceof Bc}class rs extends At{constructor(o){super(o),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 o=this.getFormat();return ms[o]||""}getIndent(){return this.getLatest().__indent}getChildren(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getChildrenKeys(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a.__key),a=a.getNextSibling();return o}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const a=gn()._dirtyElements;return a!==null&&a.has(this.__key)}isLastChild(){const o=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(o)}getAllTextNodes(){const o=[];let a=this.getFirstChild();for(;a!==null;){if(gt(a)&&o.push(a),Je(a)){const f=a.getAllTextNodes();o.push(...f)}a=a.getNextSibling()}return o}getFirstDescendant(){let o=this.getFirstChild();for(;o!==null;){if(Je(o)){const a=o.getFirstChild();if(a!==null){o=a;continue}}break}return o}getLastDescendant(){let o=this.getLastChild();for(;o!==null;){if(Je(o)){const a=o.getLastChild();if(a!==null){o=a;continue}}break}return o}getDescendantByIndex(o){const a=this.getChildren(),f=a.length;if(o>=f){const E=a[f-1];return Je(E)&&E.getLastDescendant()||E||null}const _=a[o];return Je(_)&&_.getFirstDescendant()||_||null}getFirstChild(){const a=this.getLatest().__first;return a===null?null:En(a)}getFirstChildOrThrow(){const o=this.getFirstChild();if(o===null)throw Error(`Expected node ${this.__key} to have a first child.`);return o}getLastChild(){const a=this.getLatest().__last;return a===null?null:En(a)}getLastChildOrThrow(){const o=this.getLastChild();if(o===null)throw Error(`Expected node ${this.__key} to have a last child.`);return o}getChildAtIndex(o){const a=this.getChildrenSize();let f,_;if(o<a/2){for(f=this.getFirstChild(),_=0;f!==null&&_<=o;){if(_===o)return f;f=f.getNextSibling(),_++}return null}for(f=this.getLastChild(),_=a-1;f!==null&&_>=o;){if(_===o)return f;f=f.getPreviousSibling(),_--}return null}getTextContent(){let o="";const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContent(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It)}return o}getTextContentSize(){let o=0;const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContentSize(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It.length)}return o}getDirection(){return this.getLatest().__dir}hasFormat(o){if(o!==""){const a=Jr[o];return(this.getFormat()&a)!==0}return!1}select(o,a){nr();const f=cn();let _=o,E=a;const I=this.getChildrenSize();if(!this.canBeEmpty()){if(o===0&&a===0){const oe=this.getFirstChild();if(gt(oe)||Je(oe))return oe.select(0,0)}else if((o===void 0||o===I)&&(a===void 0||a===I)){const oe=this.getLastChild();if(gt(oe)||Je(oe))return oe.select()}}_===void 0&&(_=I),E===void 0&&(E=I);const F=this.__key;if(pt(f))f.anchor.set(F,_,"element"),f.focus.set(F,E,"element"),f.dirty=!0;else return Hd(F,_,F,E,"element","element");return f}selectStart(){const o=this.getFirstDescendant();return o?o.selectStart():this.select()}selectEnd(){const o=this.getLastDescendant();return o?o.selectEnd():this.select()}clear(){const o=this.getWritable();return this.getChildren().forEach(f=>f.remove()),o}append(...o){return this.splice(this.getChildrenSize(),0,o)}setDirection(o){const a=this.getWritable();return a.__dir=o,a}setFormat(o){const a=this.getWritable();return a.__format=o!==""?Jr[o]:0,this}setIndent(o){const a=this.getWritable();return a.__indent=o,this}splice(o,a,f){const _=f.length,E=this.getChildrenSize(),I=this.getWritable(),F=I.__key,oe=[],de=[],Ne=this.getChildAtIndex(o+a);let Ee=null,xe=E-a+_;if(o!==0)if(o===E)Ee=this.getLastChild();else{const He=this.getChildAtIndex(o);He!==null&&(Ee=He.getPreviousSibling())}if(a>0){let He=Ee===null?this.getFirstChild():Ee.getNextSibling();for(let Ie=0;Ie<a;Ie++){if(He===null)throw Error("splice: sibling not found");const Ae=He.getNextSibling(),mt=He.__key,ze=He.getWritable();yi(ze),de.push(mt),He=Ae}}let Ce=Ee;for(let He=0;He<_;He++){const Ie=f[He];Ce!==null&&Ie.is(Ce)&&(Ee=Ce=Ce.getPreviousSibling());const Ae=Ie.getWritable();Ae.__parent===F&&xe--,yi(Ae);const mt=Ie.__key;if(Ce===null)I.__first=mt,Ae.__prev=null;else{const ze=Ce.getWritable();ze.__next=mt,Ae.__prev=ze.__key}if(Ie.__key===F)throw Error("append: attempting to append self");Ae.__parent=F,oe.push(mt),Ce=Ie}if(o+a===E){if(Ce!==null){const He=Ce.getWritable();He.__next=null,I.__last=Ce.__key}}else if(Ne!==null){const He=Ne.getWritable();if(Ce!==null){const Ie=Ce.getWritable();He.__prev=Ce.__key,Ie.__next=Ne.__key}else He.__prev=null}if(I.__size=xe,de.length){const He=cn();if(pt(He)){const Ie=new Set(de),Ae=new Set(oe),{anchor:mt,focus:ze}=He;ef(mt,Ie,Ae)&&Ka(mt,mt.getNode(),this,Ee,Ne),ef(ze,Ie,Ae)&&Ka(ze,ze.getNode(),this,Ee,Ne),xe===0&&!this.canBeEmpty()&&!Fr(this)&&this.remove()}}return I}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(o,a){return null}canIndent(){return!0}collapseAtStart(o){return!1}excludeFromCopy(o){return!1}canExtractContents(){return!0}canReplaceWith(o){return!0}canInsertAfter(o){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(o){return!1}extractWithChild(o,a,f){return!1}}function Je(u){return u instanceof rs}function ef(u,o,a){let f=u.getNode();for(;f;){const _=f.__key;if(o.has(_)&&!a.has(_))return!0;f=f.getParent()}return!1}class Ws extends rs{static getType(){return"root"}static clone(){return new Ws}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const o=this.__cachedText;return(Hs()||gn()._dirtyType===ct)&&o!==null?o:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(o){throw Error("replace: cannot be called on root nodes")}insertBefore(o){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(o){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(o,a){return!1}append(...o){for(let a=0;a<o.length;a++){const f=o[a];if(!Je(f)&&!vn(f))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...o)}static importJSON(o){const a=Zn();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function S_(){return new Ws}function br(u){return u instanceof Ws}function v_(u,o){const a=o.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 w_(u){return new Ua(new Map(u._nodeMap))}function Hc(){return new Ua(new Map([["root",S_()]]))}function tf(u){const o=u.exportJSON(),a=u.constructor;if(o.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.`);const f=o.children;if(Je(u)){if(!Array.isArray(f))throw Error(`LexicalNode: Node ${a.name} is an element but .exportJSON() does not have a children array.`);const _=u.getChildren();for(let E=0;E<_.length;E++){const I=_[E],F=tf(I);f.push(F)}}return o}class Ua{constructor(o,a){this._nodeMap=o,this._selection=a||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(o){return qd(this,o)}clone(o){const a=new Ua(this._nodeMap,o===void 0?this._selection:o);return a._readOnly=!0,a}toJSON(){return qd(this,()=>({root:tf(Zn())}))}}class Ks extends rs{static getType(){return"paragraph"}static clone(o){return new Ks(o.__key)}createDOM(o){const a=document.createElement("p"),f=Hi(o.theme,"paragraph");return f!==void 0&&a.classList.add(...f),a}updateDOM(o,a,f){return!1}static importDOM(){return{p:o=>({conversion:O_,priority:0})}}exportDOM(o){const{element:a}=super.exportDOM(o);if(a&&Yo(a)){this.isEmpty()&&a.append(document.createElement("br"));const f=this.getFormatType();a.style.textAlign=f;const _=this.getDirection();_&&(a.dir=_);const E=this.getIndent();E>0&&(a.style.textIndent=`${E*20}px`)}return{element:a}}static importJSON(o){const a=qi();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(o,a){const f=qi(),_=this.getDirection();return f.setDirection(_),this.insertAfter(f,a),f}collapseAtStart(){const o=this.getChildren();if(o.length===0||gt(o[0])&&o[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 O_(u){const o=qi();if(u.style){o.setFormat(u.style.textAlign);const a=parseInt(u.style.textIndent,10)/20;a>0&&o.setIndent(a)}return{node:o}}function qi(){return fo(new Ks)}function D_(u){return u instanceof Ks}const M_=0,A_=1,R_=2,b_=3,L_=4;function nf(u,o,a,f){const _=u._keyToDOMMap;_.clear(),u._editorState=Hc(),u._pendingEditorState=f,u._compositionKey=null,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const E=u._observer;E!==null&&(E.disconnect(),u._observer=null),o!==null&&(o.textContent=""),a!==null&&(a.textContent="",_.set("root",a))}function k_(u,o){const a=new Map,f=new Set,_=E=>{Object.keys(E).forEach(I=>{let F=a.get(I);F===void 0&&(F=[],a.set(I,F)),F.push(E[I])})};return u.forEach(E=>{const I=E.klass.importDOM!=null?E.klass.importDOM.bind(E.klass):null;if(I==null||f.has(I))return;f.add(I);const F=I();F!==null&&_(F)}),o&&_(o),a}function I_(u){const o=u||{},a=p_(),f=o.theme||{},_=u===void 0?a:o.parentEditor||null,E=o.disableEvents||!1,I=Hc(),F=o.namespace||(_!==null?_._config.namespace:Io()),oe=o.editorState,de=[Ws,Gi,Wr,Mi,Ks,...o.nodes||[]],{onError:Ne,html:Ee}=o,xe=o.editable!==void 0?o.editable:!0;let Ce;if(u===void 0&&a!==null)Ce=a._nodes;else{Ce=new Map;for(let Ie=0;Ie<de.length;Ie++){let Ae=de[Ie],mt=null,ze=null;if(typeof Ae!="function"){const Ct=Ae;Ae=Ct.replace,mt=Ct.with,ze=Ct.withKlass||null}{const Ct=Ae.name;if(Ct!=="RootNode"){const St=Ae.prototype;["getType","clone"].forEach(Wt=>{Ae.hasOwnProperty(Wt)||console.warn(`${Ct} must implement static "${Wt}" method`)}),!Ae.hasOwnProperty("importDOM")&&Ae.hasOwnProperty("exportDOM")&&console.warn(`${Ct} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),St instanceof Bc&&(St.hasOwnProperty("decorate")||console.warn(`${St.constructor.name} must implement "decorate" method`)),Ae.hasOwnProperty("importJSON")||console.warn(`${Ct} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),St.hasOwnProperty("exportJSON")||console.warn(`${Ct} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const tt=Ae.getType(),Ft=Ae.transform(),Rt=new Set;Ft!==null&&Rt.add(Ft),Ce.set(tt,{exportDOM:Ee&&Ee.export?Ee.export.get(Ae):void 0,klass:Ae,replace:mt,replaceWithKlass:ze,transforms:Rt})}}const He=new P_(I,_,Ce,{disableEvents:E,namespace:F,theme:f},Ne||console.error,k_(Ce,Ee?Ee.import:void 0),xe);return oe!==void 0&&(He._pendingEditorState=oe,He._dirtyType=dt),He}class P_{constructor(o,a,f,_,E,I,F){this._parentEditor=a,this._rootElement=null,this._editorState=o,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=_,this._nodes=f,this._decorators={},this._pendingDecorators=null,this._dirtyType=ct,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=Io(),this._onError=E,this._htmlConversions=I,this._editable=F,this._headless=a!==null&&a._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(o){const a=this._listeners.update;return a.add(o),()=>{a.delete(o)}}registerEditableListener(o){const a=this._listeners.editable;return a.add(o),()=>{a.delete(o)}}registerDecoratorListener(o){const a=this._listeners.decorator;return a.add(o),()=>{a.delete(o)}}registerTextContentListener(o){const a=this._listeners.textcontent;return a.add(o),()=>{a.delete(o)}}registerRootListener(o){const a=this._listeners.root;return o(this._rootElement,null),a.add(o),()=>{o(null,this._rootElement),a.delete(o)}}registerCommand(o,a,f){if(f===void 0)throw Error('Listener for type "command" requires a "priority".');const _=this._commands;_.has(o)||_.set(o,[new Set,new Set,new Set,new Set,new Set]);const E=_.get(o);if(E===void 0)throw Error(`registerCommand: Command ${String(o)} not found in command map`);const I=E[f];return I.add(a),()=>{I.delete(a),E.every(F=>F.size===0)&&_.delete(o)}}registerMutationListener(o,a){if(this._nodes.get(o.getType())===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);const _=this._listeners.mutation;return _.set(a,o),()=>{_.delete(a)}}registerNodeTransformToKlass(o,a){const f=o.getType(),_=this._nodes.get(f);if(_===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);return _.transforms.add(a),_}registerNodeTransform(o,a){const f=this.registerNodeTransformToKlass(o,a),_=[f],E=f.replaceWithKlass;if(E!=null){const I=this.registerNodeTransformToKlass(E,a);_.push(I)}return Es(this,o.getType()),()=>{_.forEach(I=>I.transforms.delete(a))}}hasNode(o){return this._nodes.has(o.getType())}hasNodes(o){return o.every(this.hasNode.bind(this))}dispatchCommand(o,a){return st(this,o,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(o){const a=this._rootElement;if(o!==a){const f=Hi(this._config.theme,"root"),_=this._pendingEditorState||this._editorState;if(this._rootElement=o,nf(this,a,o,_),a!==null&&(this._config.disableEvents||ke(a),f!=null&&a.classList.remove(...f)),o!==null){const E=uo(o),I=o.style;I.userSelect="text",I.whiteSpace="pre-wrap",I.wordBreak="break-word",o.setAttribute("data-lexical-editor","true"),this._window=E,this._dirtyType=dt,qn(this),this._updateTags.add("history-merge"),ns(this),this._config.disableEvents||Ke(o,this),f!=null&&o.classList.add(...f)}else this._editorState=_,this._pendingEditorState=null,this._window=null;Il("root",this,!1,o,a)}}getElementByKey(o){return this._keyToDOMMap.get(o)||null}getEditorState(){return this._editorState}setEditorState(o,a){if(o.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");mi(this);const f=this._pendingEditorState,_=this._updateTags,E=a!==void 0?a.tag:null;f!==null&&!f.isEmpty()&&(E!=null&&_.add(E),ns(this)),this._pendingEditorState=o,this._dirtyType=dt,this._dirtyElements.set("root",!1),this._compositionKey=null,E!=null&&_.add(E),ns(this)}parseEditorState(o,a){const f=typeof o=="string"?JSON.parse(o):o;return N_(f,this,a)}update(o,a){Rr(this,o,a)}focus(o,a={}){const f=this._rootElement;f!==null&&(f.setAttribute("autocapitalize","off"),Rr(this,()=>{const _=cn(),E=Zn();_!==null?_.dirty=!0:E.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?E.selectStart():E.selectEnd())},{onUpdate:()=>{f.removeAttribute("autocapitalize"),o&&o()},tag:"focus"}),this._pendingEditorState===null&&f.removeAttribute("autocapitalize"))}blur(){const o=this._rootElement;o!==null&&o.blur();const a=_r(this._window);a!==null&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(o){this._editable!==o&&(this._editable=o,Il("editable",this,!0,o))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Wc extends rs{constructor(o,a){super(a),this.__colSpan=o,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(o){return this.getWritable().__colSpan=o,this}getRowSpan(){return this.__rowSpan}setRowSpan(o){return this.getWritable().__rowSpan=o,this}}function Gr(u){return u instanceof Wc}class rf extends rs{}function Kc(u){return u instanceof rf}class of extends rs{}function Pl(u){return u instanceof of}return Pe.$INTERNAL_isPointSelection=Cr,Pe.$addUpdateTag=Ti,Pe.$applyNodeReplacement=fo,Pe.$copyNode=xl,Pe.$createLineBreakNode=Oi,Pe.$createNodeSelection=kc,Pe.$createParagraphNode=qi,Pe.$createRangeSelection=l_,Pe.$createTabNode=Yi,Pe.$createTextNode=Wn,Pe.$getAdjacentNode=ri,Pe.$getNearestNodeFromDOMNode=mr,Pe.$getNearestRootOrShadowRoot=Dr,Pe.$getNodeByKey=En,Pe.$getPreviousSelection=Bs,Pe.$getRoot=Zn,Pe.$getSelection=cn,Pe.$getTextContent=h_,Pe.$hasAncestor=ht,Pe.$hasUpdateTag=bc,Pe.$insertNodes=f_,Pe.$isBlockElementNode=s_,Pe.$isDecoratorNode=vn,Pe.$isElementNode=Je,Pe.$isInlineElementOrDecoratorNode=xa,Pe.$isLeafNode=_i,Pe.$isLineBreakNode=Di,Pe.$isNodeSelection=Er,Pe.$isParagraphNode=D_,Pe.$isRangeSelection=pt,Pe.$isRootNode=br,Pe.$isRootOrShadowRoot=Fr,Pe.$isTabNode=es,Pe.$isTextNode=gt,Pe.$nodesOfType=Tl,Pe.$normalizeSelection__EXPERIMENTAL=Bi,Pe.$parseSerializedNode=y_,Pe.$selectAll=El,Pe.$setCompositionKey=_n,Pe.$setSelection=Or,Pe.$splitNode=Os,Pe.BLUR_COMMAND=Z,Pe.CAN_REDO_COMMAND=m,Pe.CAN_UNDO_COMMAND=y,Pe.CLEAR_EDITOR_COMMAND=Q,Pe.CLEAR_HISTORY_COMMAND=k,Pe.CLICK_COMMAND=n,Pe.COMMAND_PRIORITY_CRITICAL=L_,Pe.COMMAND_PRIORITY_EDITOR=M_,Pe.COMMAND_PRIORITY_HIGH=b_,Pe.COMMAND_PRIORITY_LOW=A_,Pe.COMMAND_PRIORITY_NORMAL=R_,Pe.CONTROLLED_TEXT_INSERTION_COMMAND=g,Pe.COPY_COMMAND=ne,Pe.CUT_COMMAND=Y,Pe.DELETE_CHARACTER_COMMAND=r,Pe.DELETE_LINE_COMMAND=T,Pe.DELETE_WORD_COMMAND=S,Pe.DEPRECATED_$computeGridMap=zd,Pe.DEPRECATED_$createGridSelection=a_,Pe.DEPRECATED_$getGridCellNodeRect=ji,Pe.DEPRECATED_$getNodeTriplet=Ud,Pe.DEPRECATED_$isGridCellNode=Gr,Pe.DEPRECATED_$isGridNode=Kc,Pe.DEPRECATED_$isGridRowNode=Pl,Pe.DEPRECATED_$isGridSelection=cr,Pe.DEPRECATED_GridCellNode=Wc,Pe.DEPRECATED_GridNode=rf,Pe.DEPRECATED_GridRowNode=of,Pe.DRAGEND_COMMAND=V,Pe.DRAGOVER_COMMAND=D,Pe.DRAGSTART_COMMAND=K,Pe.DROP_COMMAND=pe,Pe.DecoratorNode=Bc,Pe.ElementNode=rs,Pe.FOCUS_COMMAND=A,Pe.FORMAT_ELEMENT_COMMAND=ue,Pe.FORMAT_TEXT_COMMAND=O,Pe.INDENT_CONTENT_COMMAND=me,Pe.INSERT_LINE_BREAK_COMMAND=c,Pe.INSERT_PARAGRAPH_COMMAND=d,Pe.INSERT_TAB_COMMAND=q,Pe.KEY_ARROW_DOWN_COMMAND=B,Pe.KEY_ARROW_LEFT_COMMAND=W,Pe.KEY_ARROW_RIGHT_COMMAND=w,Pe.KEY_ARROW_UP_COMMAND=H,Pe.KEY_BACKSPACE_COMMAND=ee,Pe.KEY_DELETE_COMMAND=j,Pe.KEY_DOWN_COMMAND=x,Pe.KEY_ENTER_COMMAND=z,Pe.KEY_ESCAPE_COMMAND=le,Pe.KEY_MODIFIER_COMMAND=ae,Pe.KEY_SPACE_COMMAND=X,Pe.KEY_TAB_COMMAND=U,Pe.LineBreakNode=Wr,Pe.MOVE_TO_END=$,Pe.MOVE_TO_START=P,Pe.OUTDENT_CONTENT_COMMAND=_e,Pe.PASTE_COMMAND=p,Pe.ParagraphNode=Ks,Pe.REDO_COMMAND=b,Pe.REMOVE_TEXT_COMMAND=C,Pe.RootNode=Ws,Pe.SELECTION_CHANGE_COMMAND=e,Pe.SELECT_ALL_COMMAND=G,Pe.TabNode=Mi,Pe.TextNode=Gi,Pe.UNDO_COMMAND=R,Pe.createCommand=t,Pe.createEditor=I_,Pe.getNearestEditorFromDOMNode=Lo,Pe.isHTMLAnchorElement=Go,Pe.isHTMLElement=Yo,Pe.isSelectionCapturedInDecoratorInput=io,Pe.isSelectionWithinEditor=Qr,Pe}var $e={},wf;function wN(){if(wf)return $e;wf=1;let t={},e={},n={},r={},c={},d={},g={},p={},C={},S={},T={},O={},R={},b={},x={},w={},$={},W={},P={},H={},B={},z={},X={},ee={},le={},j={},U={},q={},me={},_e={},pe={},ue={},K={},D={},V={},ne={};function Y(l){let i=new URLSearchParams;i.append("code",l);for(let s=1;s<arguments.length;s++)i.append("v",arguments[s]);throw Error(`Minified Lexical error #${l}; 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 G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q=G&&"documentMode"in document?document.documentMode:null,k=G&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),m=G&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),y=G&&"InputEvent"in window&&!Q?"getTargetRanges"in new window.InputEvent("input"):!1,A=G&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Z=G&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ae=G&&/Android/.test(navigator.userAgent),he=G&&/^(?=.*Chrome).*/i.test(navigator.userAgent),se=G&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!he,Te=A||Z||se?" ":"​",be=m?" ":Te,Ue=/^[^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]/,re=/^[^\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},we={center:2,end:6,justify:4,left:1,right:3,start:5},Le={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Be={normal:0,segmented:2,token:1},Ye={0:"normal",2:"segmented",1:"token"},ct=!1,yt=0;function dt(l){yt=l.timeStamp}function Se(l,i,s){return i.__lexicalLineBreak===l||l[`__lexicalKey_${s._key}`]!==void 0}function ie(l){return l.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function fe(l,i,s){ct=!0;let h=100<performance.now()-yt;try{sr(l,()=>{let N=Vt()||ie(l);var v=new Map,M=l.getRootElement(),J=l._editorState,ge=l._blockCursorElement;let ve=!1,Fe="";for(var Ke=0;Ke<i.length;Ke++){var ke=i[Ke],Me=ke.type,Xe=ke.target,ut=vr(Xe,J);if(!(ut===null&&Xe!==M||an(ut))){if(Me==="characterData"){if(ke=h&&ht(ut))e:{ke=N,Me=Xe;var Tt=ut;if(wt(ke)){var At=ke.anchor.getNode();if(At.is(Tt)&&ke.format!==At.getFormat()){ke=!1;break e}}ke=Me.nodeType===3&&Tt.isAttached()}ke&&(Tt=kr(l._window),Me=ke=null,Tt!==null&&Tt.anchorNode===Xe&&(ke=Tt.anchorOffset,Me=Tt.focusOffset),Xe=Xe.nodeValue,Xe!==null&&Nt(ut,Xe,ke,Me,!1))}else if(Me==="childList"){for(ve=!0,Me=ke.addedNodes,Tt=0;Tt<Me.length;Tt++){At=Me[Tt];var hn=hr(At),ar=At.parentNode;ar==null||At===ge||hn!==null||At.nodeName==="BR"&&Se(At,ar,l)||(m&&(hn=At.innerText||At.nodeValue)&&(Fe+=hn),ar.removeChild(At))}if(ke=ke.removedNodes,Me=ke.length,0<Me){for(Tt=0,At=0;At<Me;At++)ar=ke[At],(ar.nodeName==="BR"&&Se(ar,Xe,l)||ge===ar)&&(Xe.appendChild(ar),Tt++);Me!==Tt&&(Xe===M&&(ut=J._nodeMap.get("root")),v.set(Xe,ut))}}}}if(0<v.size)for(let[Wr,si]of v)if(Ze(si))for(v=si.getChildrenKeys(),M=Wr.firstChild,J=0;J<v.length;J++)ge=l.getElementByKey(v[J]),ge!==null&&(M==null?(Wr.appendChild(ge),M=ge):M!==ge&&Wr.replaceChild(ge,M),M=M.nextSibling);else ht(si)&&si.markDirty();if(v=s.takeRecords(),0<v.length){for(M=0;M<v.length;M++)for(ge=v[M],J=ge.addedNodes,ge=ge.target,Ke=0;Ke<J.length;Ke++)ut=J[Ke],Xe=ut.parentNode,Xe==null||ut.nodeName!=="BR"||Se(ut,ge,l)||Xe.removeChild(ut);s.takeRecords()}N!==null&&(ve&&(N.dirty=!0,gr(N)),m&&sn(l)&&N.insertRawText(Fe))})}finally{ct=!1}}function Oe(l){let i=l._observer;if(i!==null){let s=i.takeRecords();fe(l,s,i)}}function Re(l){yt===0&&qn(l).addEventListener("textInput",dt,!0),l._observer=new MutationObserver((i,s)=>{fe(l,i,s)})}function De(l,i){let s=l.__mode,h=l.__format;l=l.__style;let N=i.__mode,v=i.__format;return i=i.__style,(s===null||s===N)&&(h===null||h===v)&&(l===null||l===i)}function We(l,i){let s=l.mergeWithSibling(i),h=ln()._normalizedNodes;return h.add(l.__key),h.add(i.__key),s}function qe(l){if(l.__text===""&&l.isSimpleText()&&!l.isUnmergeable())l.remove();else{for(var i;(i=l.getPreviousSibling())!==null&&ht(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{De(i,l)&&(l=We(i,l));break}for(var s;(s=l.getNextSibling())!==null&&ht(s)&&s.isSimpleText()&&!s.isUnmergeable();)if(s.__text==="")s.remove();else{De(l,s)&&We(l,s);break}}}function Qe(l){return ft(l.anchor),ft(l.focus),l}function ft(l){for(;l.type==="element";){var i=l.getNode(),s=l.offset;if(s===i.getChildrenSize()?(i=i.getChildAtIndex(s-1),s=!0):(i=i.getChildAtIndex(s),s=!1),ht(i)){l.set(i.__key,s?i.getTextContentSize():0,"text");break}else if(!Ze(i))break;l.set(i.__key,s?i.getChildrenSize():0,"element")}}let kt=1,je=typeof queueMicrotask=="function"?queueMicrotask:l=>{Promise.resolve().then(l)};function Ve(l){let i=document.activeElement;if(i===null)return!1;let s=i.nodeName;return an(vr(l))&&(s==="INPUT"||s==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function rt(l,i,s){let h=l.getRootElement();try{return h!==null&&h.contains(i)&&h.contains(s)&&i!==null&&!Ve(i)&&_t(i)===l}catch{return!1}}function _t(l){for(;l!=null;){let i=l.__lexicalEditor;if(i!=null)return i;l=pr(l)}return null}function Et(l){return l.isToken()||l.isSegmented()}function vt(l){for(;l!=null;){if(l.nodeType===3)return l;l=l.firstChild}return null}function Ot(l,i,s){let h=te[i];return s!==null&&(l&h)===(s&h)||(l^=h,i==="subscript"?l&=~te.superscript:i==="superscript"&&(l&=~te.subscript)),l}function Mt(l,i){if(i!=null)l.__key=i;else{Jn(),99<mo&&Y(14),i=ln();var s=yr(),h=""+kt++;s._nodeMap.set(h,l),Ze(l)?i._dirtyElements.set(h,!0):i._dirtyLeaves.add(h),i._cloneNotNeeded.add(h),i._dirtyType=1,l.__key=h}}function xt(l){var i=l.getParent();if(i!==null){let N=l.getWritable();i=i.getWritable();var s=l.getPreviousSibling();if(l=l.getNextSibling(),s===null)if(l!==null){var h=l.getWritable();i.__first=l.__key,h.__prev=null}else i.__first=null;else{if(h=s.getWritable(),l!==null){let v=l.getWritable();v.__prev=h.__key,h.__next=v.__key}else h.__next=null;N.__prev=null}l===null?s!==null?(l=s.getWritable(),i.__last=s.__key,l.__next=null):i.__last=null:(l=l.getWritable(),s!==null?(s=s.getWritable(),s.__next=l.__key,l.__prev=s.__key):l.__prev=null,N.__next=null),i.__size--,N.__parent=null}}function Qt(l){99<mo&&Y(14);var i=l.getLatest(),s=i.__parent,h=yr();let N=ln(),v=h._nodeMap;if(h=N._dirtyElements,s!==null)e:for(;s!==null;){if(h.has(s))break e;let M=v.get(s);if(M===void 0)break;h.set(s,!1),s=M.__parent}i=i.__key,N._dirtyType=1,Ze(l)?h.set(i,!0):N._dirtyLeaves.add(i)}function bt(l){Jn();var i=ln();let s=i._compositionKey;l!==s&&(i._compositionKey=l,s!==null&&(i=It(s),i!==null&&i.getWritable()),l!==null&&(l=It(l),l!==null&&l.getWritable()))}function Ut(){return oi()?null:ln()._compositionKey}function It(l,i){return l=(i||yr())._nodeMap.get(l),l===void 0?null:l}function hr(l,i){let s=ln();return l=l[`__lexicalKey_${s._key}`],l!==void 0?It(l,i):null}function vr(l,i){for(;l!=null;){let s=hr(l,i);if(s!==null)return s;l=pr(l)}return null}function Fi(l){let i=Object.assign({},l._decorators);return l._pendingDecorators=i}function gs(l){return l.read(()=>fn().getTextContent())}function ps(l,i){sr(l,()=>{var s=yr();if(!s.isEmpty())if(i==="root")fn().markDirty();else{s=s._nodeMap;for(let[,h]of s)h.markDirty()}},l._pendingEditorState===null?{tag:"history-merge"}:void 0)}function fn(){return yr()._nodeMap.get("root")}function gr(l){Jn();let i=yr();l!==null&&(l.dirty=!0,l.setCachedNodes(null)),i._selection=l}function Jr(l){var i=ln(),s;e:{for(s=l;s!=null;){let h=s[`__lexicalKey_${i._key}`];if(h!==void 0){s=h;break e}s=pr(s)}s=null}return s===null?(i=i.getRootElement(),l===i?It("root"):null):It(s)}function ms(l){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(l)}function ye(l){let i=[];for(;l!==null;)i.push(l),l=l._parentEditor;return i}function Ge(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function nt(l,i,s){if(i=kr(i._window),i!==null){var h=i.anchorNode,{anchorOffset:N,focusOffset:v}=i;if(h!==null&&(i=h.nodeType===3?h.nodeValue:null,h=vr(h),i!==null&&ht(h))){if(i===Te&&s){let M=s.length;i=s,v=N=M}i!==null&&Nt(h,i,N,v,l)}}}function Nt(l,i,s,h,N){let v=l;if(v.isAttached()&&(N||!v.isDirty())){let ve=v.isComposing(),Fe=i;if((ve||N)&&i[i.length-1]===Te&&(Fe=i.slice(0,-1)),i=v.getTextContent(),N||Fe!==i)if(Fe==="")if(bt(null),A||Z||se)v.remove();else{let Ke=ln();setTimeout(()=>{Ke.update(()=>{v.isAttached()&&v.remove()})},20)}else{N=v.getParent(),i=Ui();var M=v.getTextContentSize(),J=Ut(),ge=v.getKey();v.isToken()||J!==null&&ge===J&&!ve||wt(i)&&(N!==null&&!N.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===l.__key&&i.anchor.offset===0&&!v.canInsertTextBefore()||i.focus.key===l.__key&&i.focus.offset===M&&!v.canInsertTextAfter())?v.markDirty():(l=Vt(),wt(l)&&s!==null&&h!==null&&(l.setTextNodeRange(v,s,v,h),v.isSegmented()&&(s=v.getTextContent(),s=Bn(s),v.replace(s),v=s)),v.setTextContent(Fe))}}}function Ht(l,i){if(i.isSegmented())return!0;if(!l.isCollapsed())return!1;l=l.anchor.offset;let s=i.getParentOrThrow(),h=i.isToken();return l===0?((l=!i.canInsertTextBefore()||!s.canInsertTextBefore()||h)||(i=i.getPreviousSibling(),l=(ht(i)||Ze(i)&&i.isInline())&&!i.canInsertTextAfter()),l):l===i.getTextContentSize()?!i.canInsertTextAfter()||!s.canInsertTextAfter()||h:!1}function Kt(l,i){l.__lexicalClassNameCache===void 0&&(l.__lexicalClassNameCache={});let s=l.__lexicalClassNameCache,h=s[i];return h!==void 0?h:(l=l[i],typeof l=="string"?(l=l.split(" "),s[i]=l):l)}function $t(l,i,s,h,N){s.size!==0&&(s=h.__type,h=h.__key,i=i.get(s),i===void 0&&Y(33,s),s=i.klass,i=l.get(s),i===void 0&&(i=new Map,l.set(s,i)),l=i.get(h),s=l==="destroyed"&&N==="created",(l===void 0||s)&&i.set(h,s?"updated":N))}function Pt(l,i,s){let h=l.getParent(),N=s;return h!==null&&(i&&s===0?(N=l.getIndexWithinParent(),l=h):i||s!==l.getChildrenSize()||(N=l.getIndexWithinParent()+1,l=h)),l.getChildAtIndex(i?N-1:N)}function mn(l,i){var s=l.offset;return l.type==="element"?(l=l.getNode(),Pt(l,i,s)):(l=l.getNode(),i&&s===0||!i&&s===l.getTextContentSize()?(s=i?l.getPreviousSibling():l.getNextSibling(),s===null?Pt(l.getParentOrThrow(),i,l.getIndexWithinParent()+(i?0:1)):s):null)}function sn(l){return l=(l=qn(l).event)&&l.inputType,l==="insertFromPaste"||l==="insertFromPasteAsQuotation"}function nn(l){return!tr(l)&&!l.isLastChild()&&!l.isInline()}function $n(l,i){return l=l._keyToDOMMap.get(i),l===void 0&&Y(75,i),l}function pr(l){return l=l.assignedSlot||l.parentElement,l!==null&&l.nodeType===11?l.host:l}function mi(l,i){for(l=l.getParent();l!==null;){if(l.is(i))return!0;l=l.getParent()}return!1}function qn(l){return l=l._window,l===null&&Y(78),l}function cl(l){for(l=l.getParentOrThrow();l!==null&&!Xr(l);)l=l.getParentOrThrow();return l}function Xr(l){return tr(l)||Ze(l)&&l.isShadowRoot()}function ul(l){return l=l.constructor.clone(l),Mt(l,null),l}function Bi(l){var i=ln();let s=l.constructor.getType();return i=i._nodes.get(s),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(l),i instanceof l.constructor||Y(98),i):l}function _s(l,i){l=l.getParent(),!tr(l)||Ze(i)||an(i)||Y(99)}function dl(l){return(an(l)||Ze(l)&&!l.canBeEmpty())&&!l.isInline()}function fl(l,i,s){s.style.removeProperty("caret-color"),i._blockCursorElement=null,i=l.parentElement,i!==null&&i.removeChild(l)}function kr(l){return G?(l||window).getSelection():null}function ys(l,i){for(;l!==fn()&&l!=null;){if(i(l))return l;l=l.getParent()}return null}function xc(l){let i=[],s=[l];for(;0<s.length;){let h=s.pop();h===void 0&&Y(112),Ze(h)&&s.unshift(...h.getChildren()),h!==l&&i.push(h)}return i}function io(l){return l.nodeType===1}function Qr(l){if(an(l)&&!l.isInline())return!0;if(!Ze(l)||Xr(l))return!1;var i=l.getFirstChild();return i=i===null||Ei(i)||ht(i)||i.isInline(),!l.isInline()&&l.canBeEmpty()!==!1&&i}function Lo(l,i){for(;l!==null&&l.getParent()!==null&&!i(l);)l=l.getParentOrThrow();return i(l)?l:null}function sa(l,i,s,h,N,v){for(l=l.getFirstChild();l!==null;){let M=l.__key;l.__parent===i&&(Ze(l)&&sa(l,M,s,h,N,v),s.has(M)||v.delete(M),N.push(M)),l=l.getNextSibling()}}function hl(l,i,s,h){l=l._nodeMap,i=i._nodeMap;let N=[];for(let[v]of h){let M=i.get(v);M===void 0||M.isAttached()||(Ze(M)&&sa(M,v,l,i,N,h),l.has(v)||h.delete(v),N.push(v))}for(let v of N)i.delete(v);for(let v of s)h=i.get(v),h===void 0||h.isAttached()||(l.has(v)||s.delete(v),i.delete(v))}let On="",Ln="",wr="",_i,Fn,ko,yi=!1,oo=!1,Ns,_n=null,Ir,En,Ni,mr,Cs,so;function Es(l,i){let s=Ni.get(l);if(i!==null){let h=pl(l);h.parentNode===i&&i.removeChild(h)}mr.has(l)||Fn._keyToDOMMap.delete(l),Ze(s)&&(l=Io(s,Ni),Zn(l,0,l.length-1,null)),s!==void 0&&$t(so,ko,Ns,s,"destroyed")}function Zn(l,i,s,h){for(;i<=s;++i){let N=l[i];N!==void 0&&Es(N,h)}}function Ci(l,i){l.setProperty("text-align",i)}function Or(l,i){var s=_i.theme.indent;if(typeof s=="string"){let h=l.classList.contains(s);0<i&&!h?l.classList.add(s):1>i&&h&&l.classList.remove(s)}s=getComputedStyle(l).getPropertyValue("--lexical-indent-base-value")||"40px",l.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${s})`)}function la(l,i){l=l.style,i===0?Ci(l,""):i===1?Ci(l,"left"):i===2?Ci(l,"center"):i===3?Ci(l,"right"):i===4?Ci(l,"justify"):i===5?Ci(l,"start"):i===6&&Ci(l,"end")}function ei(l,i,s){let h=mr.get(l);h===void 0&&Y(60);let N=h.createDOM(_i,Fn);var v=Fn._keyToDOMMap;if(N["__lexicalKey_"+Fn._key]=l,v.set(l,N),ht(h)?N.setAttribute("data-lexical-text","true"):an(h)&&N.setAttribute("data-lexical-decorator","true"),Ze(h)){if(l=h.__indent,v=h.__size,l!==0&&Or(N,l),v!==0){--v,l=Io(h,mr);var M=Ln;Ln="",Ts(l,h,0,v,N,null),xs(h,N),Ln=M}l=h.__format,l!==0&&la(N,l),h.isInline()||gl(null,h,N),nn(h)&&(On+=`
42
42
 
43
43
  `,wr+=`
44
44
 
@@ -50,55 +50,55 @@ caused by: ${hi.fullStack(n)}`:e.stack}static info(e){Kc(e);const n={},r=hi.caus
50
50
 
51
51
  `,wr+=`
52
52
 
53
- `)}else s=h.getTextContent(),an(h)?(N=h.decorate(Fn,_i),N!==null&&Ss(l,N)):ht(h)&&!h.isDirectionless()&&(Ln+=s),On+=s,wr+=s;return!oo&&tr(h)&&h.__cachedText!==wr&&(h=h.getWritable(),h.__cachedText=wr),v}function Ss(l,i){let s=Fn._pendingDecorators,h=Fn._decorators;if(s===null){if(h[l]===i)return;s=Fi(Fn)}s[l]=i}function Po(l){return l=l.nextSibling,l!==null&&l===Fn._blockCursorElement&&(l=l.nextSibling),l}function pl(l){let i=Cs.get(l);return i===void 0&&Y(75,l),i}let ti=Object.freeze({}),ml=[["keydown",Dc],["pointerdown",Sc],["compositionstart",wc],["compositionend",Oc],["input",vc],["click",xc],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];y&&ml.push(["beforeinput",(l,i)=>_a(l,i)]);let $o=0,ca=0,ua=0,ao=null,Fo=0,_l=!1,yl=!1,Bo=!1,Ho=!1,da=[0,"",0,"root",0];function fa(l,i,s,h,N){let v=l.anchor,M=l.focus,J=v.getNode();var ge=ln();let ve=kr(ge._window),Fe=ve!==null?ve.anchorNode:null,Ke=v.key;ge=ge.getElementByKey(Ke);let ke=s.length;return Ke!==M.key||!ht(J)||(!N&&(!y||ua<h+50)||J.isDirty()&&2>ke||ms(s))&&v.offset!==M.offset&&!J.isComposing()||Et(J)||J.isDirty()&&1<ke||(N||!y)&&ge!==null&&!J.isComposing()&&Fe!==vt(ge)||ve!==null&&i!==null&&(!i.collapsed||i.startContainer!==ve.anchorNode||i.startOffset!==ve.anchorOffset)||J.getFormat()!==l.format||J.getStyle()!==l.style||Ht(l,J)}function ha(l,i){return l!==null&&l.nodeValue!==null&&l.nodeType===3&&i!==0&&i!==l.nodeValue.length}function ga(l,i,s){let{anchorNode:h,anchorOffset:N,focusNode:v,focusOffset:M}=l;_l&&(_l=!1,ha(h,N)&&ha(v,M))||sr(i,()=>{if(!s)gr(null);else if(rt(i,h,v)){var J=Vt();if(wt(J)){var ge=J.anchor,ve=ge.getNode();if(J.isCollapsed()){l.type==="Range"&&l.anchorNode===l.focusNode&&(J.dirty=!0);var Fe=qn(i).event;Fe=Fe?Fe.timeStamp:performance.now();let[ke,Me,Xe,ut,Tt]=da;var Ke=fn();Ke=i.isComposing()===!1&&Ke.getTextContent()==="",Fe<Tt+200&&ge.offset===Xe&&ge.key===ut?(J.format=ke,J.style=Me):ge.type==="text"?(J.format=ve.getFormat(),J.style=ve.getStyle()):ge.type!=="element"||Ke||(J.format=0,J.style="")}else{ge=255,ve=!1,Fe=J.getNodes(),Ke=Fe.length;for(let ke=0;ke<Ke;ke++){let Me=Fe[ke];if(ht(Me)&&(ve=!0,ge&=Me.getFormat(),ge===0))break}J.format=ve?ge:0}}ot(i,t,void 0)}})}function xc(l,i){sr(i,()=>{let s=Vt();var h=kr(i._window);let N=Ui();if(h)if(wt(s)){let M=s.anchor;var v=M.getNode();M.type==="element"&&M.offset===0&&s.isCollapsed()&&!tr(v)&&fn().getChildrenSize()===1&&v.getTopLevelElementOrThrow().isEmpty()&&N!==null&&s.is(N)?(h.removeAllRanges(),s.dirty=!0):l.detail!==3||s.isCollapsed()||(h=s.focus.getNode(),v!==h&&(Ze(v)?v.select(0):v.getParentOrThrow().select(0)))}else l.pointerType==="touch"&&(v=h.anchorNode,v!==null&&(v=v.nodeType,v===1||v===3))&&(h=Hn(N,h,i),gr(h));ot(i,e,l)})}function Sc(l,i){let s=l.target;l=l.pointerType,s instanceof Node&&l!=="touch"&&sr(i,()=>{an(vr(s))||(yl=!0)})}function pa(l){return l.getTargetRanges?(l=l.getTargetRanges(),l.length===0?null:l[0]):null}function ma(l,i){return l!==i||Ze(l)||Ze(i)||!l.isToken()||!i.isToken()}function _a(l,i){let s=l.inputType,h=pa(l);s==="deleteCompositionText"||m&&sn(i)||s!=="insertCompositionText"&&sr(i,()=>{let N=Vt();if(s==="deleteContentBackward"){if(N===null){var v=Ui();if(!wt(v))return;gr(v.clone())}if(wt(N)){ae&&bt(N.anchor.key),ca===229&&l.timeStamp<$o+30&&i.isComposing()&&N.anchor.key===N.focus.key?(bt(null),$o=0,setTimeout(()=>{sr(i,()=>{bt(null)})},30),wt(N)&&(v=N.anchor.getNode(),v.markDirty(),N.format=v.getFormat(),N.style=v.getStyle()),1>=N.anchor.getNode().getTextContent().length&&(l.preventDefault(),ot(i,n,!0))):(l.preventDefault(),ot(i,n,!0));return}}if(wt(N)){v=l.data,ao!==null&&nt(!1,i,ao),N.dirty&&ao===null||!N.isCollapsed()||tr(N.anchor.getNode())||h===null||N.applyDOMRange(h),ao=null;var M=N.focus,J=N.anchor.getNode();if(M=M.getNode(),s==="insertText"||s==="insertTranspose")v===`
53
+ `)}else s=h.getTextContent(),an(h)?(N=h.decorate(Fn,_i),N!==null&&Ss(l,N)):ht(h)&&!h.isDirectionless()&&(Ln+=s),On+=s,wr+=s;return!oo&&tr(h)&&h.__cachedText!==wr&&(h=h.getWritable(),h.__cachedText=wr),v}function Ss(l,i){let s=Fn._pendingDecorators,h=Fn._decorators;if(s===null){if(h[l]===i)return;s=Fi(Fn)}s[l]=i}function Po(l){return l=l.nextSibling,l!==null&&l===Fn._blockCursorElement&&(l=l.nextSibling),l}function pl(l){let i=Cs.get(l);return i===void 0&&Y(75,l),i}let ti=Object.freeze({}),ml=[["keydown",Mc],["pointerdown",vc],["compositionstart",Oc],["compositionend",Dc],["input",wc],["click",Sc],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];y&&ml.push(["beforeinput",(l,i)=>_a(l,i)]);let $o=0,ca=0,ua=0,ao=null,Fo=0,_l=!1,yl=!1,Bo=!1,Ho=!1,da=[0,"",0,"root",0];function fa(l,i,s,h,N){let v=l.anchor,M=l.focus,J=v.getNode();var ge=ln();let ve=kr(ge._window),Fe=ve!==null?ve.anchorNode:null,Ke=v.key;ge=ge.getElementByKey(Ke);let ke=s.length;return Ke!==M.key||!ht(J)||(!N&&(!y||ua<h+50)||J.isDirty()&&2>ke||ms(s))&&v.offset!==M.offset&&!J.isComposing()||Et(J)||J.isDirty()&&1<ke||(N||!y)&&ge!==null&&!J.isComposing()&&Fe!==vt(ge)||ve!==null&&i!==null&&(!i.collapsed||i.startContainer!==ve.anchorNode||i.startOffset!==ve.anchorOffset)||J.getFormat()!==l.format||J.getStyle()!==l.style||Ht(l,J)}function ha(l,i){return l!==null&&l.nodeValue!==null&&l.nodeType===3&&i!==0&&i!==l.nodeValue.length}function ga(l,i,s){let{anchorNode:h,anchorOffset:N,focusNode:v,focusOffset:M}=l;_l&&(_l=!1,ha(h,N)&&ha(v,M))||sr(i,()=>{if(!s)gr(null);else if(rt(i,h,v)){var J=Vt();if(wt(J)){var ge=J.anchor,ve=ge.getNode();if(J.isCollapsed()){l.type==="Range"&&l.anchorNode===l.focusNode&&(J.dirty=!0);var Fe=qn(i).event;Fe=Fe?Fe.timeStamp:performance.now();let[ke,Me,Xe,ut,Tt]=da;var Ke=fn();Ke=i.isComposing()===!1&&Ke.getTextContent()==="",Fe<Tt+200&&ge.offset===Xe&&ge.key===ut?(J.format=ke,J.style=Me):ge.type==="text"?(J.format=ve.getFormat(),J.style=ve.getStyle()):ge.type!=="element"||Ke||(J.format=0,J.style="")}else{ge=255,ve=!1,Fe=J.getNodes(),Ke=Fe.length;for(let ke=0;ke<Ke;ke++){let Me=Fe[ke];if(ht(Me)&&(ve=!0,ge&=Me.getFormat(),ge===0))break}J.format=ve?ge:0}}ot(i,t,void 0)}})}function Sc(l,i){sr(i,()=>{let s=Vt();var h=kr(i._window);let N=Ui();if(h)if(wt(s)){let M=s.anchor;var v=M.getNode();M.type==="element"&&M.offset===0&&s.isCollapsed()&&!tr(v)&&fn().getChildrenSize()===1&&v.getTopLevelElementOrThrow().isEmpty()&&N!==null&&s.is(N)?(h.removeAllRanges(),s.dirty=!0):l.detail!==3||s.isCollapsed()||(h=s.focus.getNode(),v!==h&&(Ze(v)?v.select(0):v.getParentOrThrow().select(0)))}else l.pointerType==="touch"&&(v=h.anchorNode,v!==null&&(v=v.nodeType,v===1||v===3))&&(h=Hn(N,h,i),gr(h));ot(i,e,l)})}function vc(l,i){let s=l.target;l=l.pointerType,s instanceof Node&&l!=="touch"&&sr(i,()=>{an(vr(s))||(yl=!0)})}function pa(l){return l.getTargetRanges?(l=l.getTargetRanges(),l.length===0?null:l[0]):null}function ma(l,i){return l!==i||Ze(l)||Ze(i)||!l.isToken()||!i.isToken()}function _a(l,i){let s=l.inputType,h=pa(l);s==="deleteCompositionText"||m&&sn(i)||s!=="insertCompositionText"&&sr(i,()=>{let N=Vt();if(s==="deleteContentBackward"){if(N===null){var v=Ui();if(!wt(v))return;gr(v.clone())}if(wt(N)){ae&&bt(N.anchor.key),ca===229&&l.timeStamp<$o+30&&i.isComposing()&&N.anchor.key===N.focus.key?(bt(null),$o=0,setTimeout(()=>{sr(i,()=>{bt(null)})},30),wt(N)&&(v=N.anchor.getNode(),v.markDirty(),N.format=v.getFormat(),N.style=v.getStyle()),1>=N.anchor.getNode().getTextContent().length&&(l.preventDefault(),ot(i,n,!0))):(l.preventDefault(),ot(i,n,!0));return}}if(wt(N)){v=l.data,ao!==null&&nt(!1,i,ao),N.dirty&&ao===null||!N.isCollapsed()||tr(N.anchor.getNode())||h===null||N.applyDOMRange(h),ao=null;var M=N.focus,J=N.anchor.getNode();if(M=M.getNode(),s==="insertText"||s==="insertTranspose")v===`
54
54
  `?(l.preventDefault(),ot(i,r,!1)):v===`
55
55
 
56
- `?(l.preventDefault(),ot(i,c,void 0)):v==null&&l.dataTransfer?(v=l.dataTransfer.getData("text/plain"),l.preventDefault(),N.insertRawText(v)):v!=null&&fa(N,h,v,l.timeStamp,!0)?(l.preventDefault(),ot(i,d,v)):ao=v,ua=l.timeStamp;else switch(l.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ot(i,d,l);break;case"insertFromComposition":bt(null),ot(i,d,l);break;case"insertLineBreak":bt(null),ot(i,r,!1);break;case"insertParagraph":bt(null),Bo&&!Z?(Bo=!1,ot(i,r,!1)):ot(i,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ot(i,g,l);break;case"deleteByComposition":ma(J,M)&&ot(i,p,l);break;case"deleteByDrag":case"deleteByCut":ot(i,p,l);break;case"deleteContent":ot(i,n,!1);break;case"deleteWordBackward":ot(i,C,!0);break;case"deleteWordForward":ot(i,C,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ot(i,S,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ot(i,S,!1);break;case"formatStrikeThrough":ot(i,x,"strikethrough");break;case"formatBold":ot(i,x,"bold");break;case"formatItalic":ot(i,x,"italic");break;case"formatUnderline":ot(i,x,"underline");break;case"historyUndo":ot(i,O,void 0);break;case"historyRedo":ot(i,R,void 0)}}})}function vc(l,i){l.stopPropagation(),sr(i,()=>{var s=Vt(),h=l.data,N=pa(l);if(h!=null&&wt(s)&&fa(s,N,h,l.timeStamp,!1)){Ho&&(Nl(i,h),Ho=!1);var v=s.anchor,M=v.getNode();if(N=kr(i._window),N===null)return;let J=v.offset;(v=y&&!s.isCollapsed()&&ht(M)&&N.anchorNode!==null)&&(M=M.getTextContent().slice(0,J)+h+M.getTextContent().slice(J+s.focus.offset),N=N.anchorNode,v=M===(N.nodeType===3?N.nodeValue:null)),v||ot(i,d,h),h=h.length,m&&1<h&&l.inputType==="insertCompositionText"&&!i.isComposing()&&(s.anchor.offset-=h),A||Z||se||!i.isComposing()||($o=0,bt(null))}else nt(!1,i,h!==null?h:void 0),Ho&&(Nl(i,h||void 0),Ho=!1);Jn(),s=ln(),Oe(s)}),ao=null}function wc(l,i){sr(i,()=>{let s=Vt();if(wt(s)&&!i.isComposing()){let h=s.anchor,N=s.anchor.getNode();bt(h.key),(l.timeStamp<$o+30||h.type==="element"||!s.isCollapsed()||N.getFormat()!==s.format||N.getStyle()!==s.style)&&ot(i,d,be)}})}function Nl(l,i){var s=l._compositionKey;if(bt(null),s!==null&&i!=null){if(i===""){i=It(s),l=vt(l.getElementByKey(s)),l!==null&&l.nodeValue!==null&&ht(i)&&Nt(i,l.nodeValue,null,null,!0);return}if(i[i.length-1]===`
57
- `&&(s=Vt(),wt(s))){i=s.focus,s.anchor.set(i.key,i.offset,i.type),ot(l,B,null);return}}nt(!0,l,i)}function Oc(l,i){m?Ho=!0:sr(i,()=>{Nl(i,l.data)})}function Dc(l,i){if($o=l.timeStamp,ca=l.keyCode,!i.isComposing()){var{keyCode:s,shiftKey:h,ctrlKey:N,metaKey:v,altKey:M}=l;if(!ot(i,b,l)){if(s!==39||N||v||M)if(s!==39||M||h||!N&&!v)if(s!==37||N||v||M)if(s!==37||M||h||!N&&!v)if(s!==38||N||v)if(s!==40||N||v)if(s===13&&h)Bo=!0,ot(i,B,l);else if(s===32)ot(i,K,l);else if(k&&N&&s===79)l.preventDefault(),Bo=!0,ot(i,r,!0);else if(s!==13||h){var J=k?M||v?!1:s===8||s===72&&N:N||M||v?!1:s===8;J?s===8?ot(i,X,l):(l.preventDefault(),ot(i,n,!0)):s===27?ot(i,ee,l):(J=k?h||M||v?!1:s===46||s===68&&N:N||M||v?!1:s===46,J?s===46?ot(i,le,l):(l.preventDefault(),ot(i,n,!1)):s===8&&(k?M:N)?(l.preventDefault(),ot(i,C,!0)):s===46&&(k?M:N)?(l.preventDefault(),ot(i,C,!1)):k&&v&&s===8?(l.preventDefault(),ot(i,S,!0)):k&&v&&s===46?(l.preventDefault(),ot(i,S,!1)):s===66&&!M&&(k?v:N)?(l.preventDefault(),ot(i,x,"bold")):s===85&&!M&&(k?v:N)?(l.preventDefault(),ot(i,x,"underline")):s===73&&!M&&(k?v:N)?(l.preventDefault(),ot(i,x,"italic")):s!==9||M||N||v?s===90&&!h&&(k?v:N)?(l.preventDefault(),ot(i,O,void 0)):(J=k?s===90&&v&&h:s===89&&N||s===90&&N&&h,J?(l.preventDefault(),ot(i,R,void 0)):Go(i._editorState._selection)?(J=h?!1:s===67?k?v:N:!1,J?(l.preventDefault(),ot(i,pe,l)):(J=h?!1:s===88?k?v:N:!1,J?(l.preventDefault(),ot(i,ue,l)):s===65&&(k?v:N)&&(l.preventDefault(),ot(i,z,l)))):!m&&s===65&&(k?v:N)&&(l.preventDefault(),ot(i,z,l))):ot(i,V,l))}else Bo=!1,ot(i,B,l);else ot(i,W,l);else ot(i,$,l);else ot(i,H,l);else ot(i,P,l);else ot(i,w,l);else ot(i,T,l);(N||h||M||v)&&ot(i,ne,l)}}}function ya(l){let i=l.__lexicalEventHandles;return i===void 0&&(i=[],l.__lexicalEventHandles=i),i}let co=new Map;function Na(l){l=l.target;let i=kr(l==null?null:l.nodeType===9?l.defaultView:l.ownerDocument.defaultView);if(i!==null){var s=_t(i.anchorNode);if(s!==null){yl&&(yl=!1,sr(s,()=>{var M=Ui(),J=i.anchorNode;J!==null&&(J=J.nodeType,J===1||J===3)&&(M=Hn(M,i,s),gr(M))})),l=ye(s),l=l[l.length-1];var h=l._key,N=co.get(h),v=N||l;v!==s&&ga(i,v,!1),ga(i,s,!0),s!==l?co.set(h,s):N&&co.delete(h)}}}function Mc(l,i){Fo===0&&l.ownerDocument.addEventListener("selectionchange",Na),Fo++,l.__lexicalEditor=i;let s=ya(l);for(let h=0;h<ml.length;h++){let[N,v]=ml[h],M=typeof v=="function"?J=>{J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()&&v(J,i))}:J=>{if(J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()))switch(N){case"cut":return ot(i,ue,J);case"copy":return ot(i,pe,J);case"paste":return ot(i,g,J);case"dragstart":return ot(i,q,J);case"dragover":return ot(i,me,J);case"dragend":return ot(i,_e,J);case"focus":return ot(i,D,J);case"blur":return ot(i,j,J);case"drop":return ot(i,U,J)}};l.addEventListener(N,M),s.push(()=>{l.removeEventListener(N,M)})}}function Cl(l,i,s){Jn();var h=l.__key;let N=l.getParent();if(N!==null){var v=Vt();if(wt(v)&&Ze(l)){var{anchor:M,focus:J}=v,ge=M.getNode(),ve=J.getNode();mi(ge,l)&&M.set(l.__key,0,"element"),mi(ve,l)&&J.set(l.__key,0,"element")}if(ge=v,ve=!1,wt(ge)&&i){v=ge.anchor;let Fe=ge.focus;v.key===h&&(po(v,l,N,l.getPreviousSibling(),l.getNextSibling()),ve=!0),Fe.key===h&&(po(Fe,l,N,l.getPreviousSibling(),l.getNextSibling()),ve=!0)}else Go(ge)&&i&&l.isSelected()&&l.selectPrevious();wt(ge)&&i&&!ve?(h=l.getIndexWithinParent(),xt(l),go(ge,N,h,-1)):xt(l),s||Xr(N)||N.canBeEmpty()||!N.isEmpty()||Cl(N,i),i&&tr(N)&&N.isEmpty()&&N.selectEnd()}}class ni{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,Mt(this,i)}getType(){return this.__type}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=It(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let s=i.getNodes().some(h=>h.__key===this.__key);return ht(this)?s:wt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:s}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let s=0;for(;i!==null;){if(this.is(i))return s;s++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:It(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let s=i.getParent();if(Xr(s))return i;i=s}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],s=this.getParent();for(;s!==null;)i.push(s),s=s.getParent();return i}getParentKeys(){let i=[],s=this.getParent();for(;s!==null;)i.push(s.__key),s=s.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:It(i)}getPreviousSiblings(){let i=[];var s=this.getParent();if(s===null)return i;for(s=s.getFirstChild();s!==null&&!s.is(this);)i.push(s),s=s.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:It(i)}getNextSiblings(){let i=[],s=this.getNextSibling();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getCommonAncestor(i){let s=this.getParents();var h=i.getParents();Ze(this)&&s.unshift(this),Ze(i)&&h.unshift(i),i=s.length;var N=h.length;if(i===0||N===0||s[i-1]!==h[N-1])return null;for(h=new Set(h),N=0;N<i;N++){let v=s[N];if(h.has(v))return v}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 s=this.getCommonAncestor(i);let h=this;for(;;){var N=h.getParentOrThrow();if(N===s){N=h.getIndexWithinParent();break}h=N}for(h=i;;){if(i=h.getParentOrThrow(),i===s){s=h.getIndexWithinParent();break}h=i}return N<s}isParentOf(i){let s=this.__key;if(s===i.__key)return!1;for(;i!==null;){if(i.__key===s)return!0;i=i.getParent()}return!1}getNodesBetween(i){let s=this.isBefore(i),h=[],N=new Set;for(var v=this;;){var M=v.__key;if(N.has(M)||(N.add(M),h.push(v)),v===i)break;if(M=Ze(v)?s?v.getFirstChild():v.getLastChild():null,M!==null)v=M;else if(M=s?v.getNextSibling():v.getPreviousSibling(),M!==null)v=M;else{if(v=v.getParentOrThrow(),N.has(v.__key)||h.push(v),v===i)break;M=v;do M===null&&Y(68),v=s?M.getNextSibling():M.getPreviousSibling(),M=M.getParent(),M!==null&&(v!==null||N.has(M.__key)||h.push(M));while(v===null)}}return s||h.reverse(),h}isDirty(){let i=ln()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=It(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=yr(),s=ln();i=i._nodeMap;let h=this.__key,N=this.getLatest(),v=N.__parent;s=s._cloneNotNeeded;var M=Vt();return vl(M)&&M.setCachedNodes(null),s.has(h)?(Qt(N),N):(M=N.constructor.clone(N),M.__parent=v,M.__next=N.__next,M.__prev=N.__prev,Ze(N)&&Ze(M)?(M.__first=N.__first,M.__last=N.__last,M.__size=N.__size,M.__indent=N.__indent,M.__format=N.__format,M.__dir=N.__dir):ht(N)&&ht(M)&&(M.__format=N.__format,M.__style=N.__style,M.__mode=N.__mode,M.__detail=N.__detail),s.add(h),M.__key=h,Qt(M),i.set(h,M),M)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){Cl(this,!0,i)}replace(i,s){Jn();var h=Vt();h!==null&&(h=h.clone()),_s(this,i);let N=this.getLatest(),v=this.__key,M=i.__key,J=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;xt(J);let ve=N.getPreviousSibling(),Fe=N.getNextSibling(),Ke=N.__prev,ke=N.__next,Me=N.__parent;return Cl(N,!1,!0),ve===null?i.__first=M:ve.getWritable().__next=M,J.__prev=Ke,Fe===null?i.__last=M:Fe.getWritable().__prev=M,J.__next=ke,J.__parent=Me,i.__size=ge,s&&this.getChildren().forEach(Xe=>{J.append(Xe)}),wt(h)&&(gr(h),s=h.anchor,h=h.focus,s.key===v&&xl(s,J),h.key===v&&xl(h,J)),Ut()===v&&bt(M),J}insertAfter(i,s=!0){Jn(),_s(this,i);var h=this.getWritable();let N=i.getWritable();var v=N.getParent();let M=Vt();var J=!1,ge=!1;if(v!==null){var ve=i.getIndexWithinParent();xt(N),wt(M)&&(ge=v.__key,J=M.anchor,v=M.focus,J=J.type==="element"&&J.key===ge&&J.offset===ve+1,ge=v.type==="element"&&v.key===ge&&v.offset===ve+1)}v=this.getNextSibling(),ve=this.getParentOrThrow().getWritable();let Fe=N.__key,Ke=h.__next;return v===null?ve.__last=Fe:v.getWritable().__prev=Fe,ve.__size++,h.__next=Fe,N.__next=Ke,N.__prev=h.__key,N.__parent=h.__parent,s&&wt(M)&&(s=this.getIndexWithinParent(),go(M,ve,s+1),h=ve.__key,J&&M.anchor.set(h,s+2,"element"),ge&&M.focus.set(h,s+2,"element")),i}insertBefore(i,s=!0){Jn(),_s(this,i);var h=this.getWritable();let N=i.getWritable(),v=N.__key;xt(N);let M=this.getPreviousSibling(),J=this.getParentOrThrow().getWritable(),ge=h.__prev,ve=this.getIndexWithinParent();return M===null?J.__first=v:M.getWritable().__next=v,J.__size++,h.__prev=v,N.__prev=ge,N.__next=h.__key,N.__parent=h.__parent,h=Vt(),s&&wt(h)&&(s=this.getParentOrThrow(),go(h,s,ve)),i}isParentRequired(){return!1}createParentElementNode(){return lr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,s){Jn();let h=this.getPreviousSibling(),N=this.getParentOrThrow();return h===null?N.select(0,0):Ze(h)?h.select():ht(h)?h.select(i,s):(i=h.getIndexWithinParent()+1,N.select(i,i))}selectNext(i,s){Jn();let h=this.getNextSibling(),N=this.getParentOrThrow();return h===null?N.select():Ze(h)?h.select(0,0):ht(h)?h.select(i,s):(i=h.getIndexWithinParent(),N.select(i,i))}markDirty(){this.getWritable()}}function Ca(l,i,s){s=s||i.getParentOrThrow().getLastChild();let h=i;for(i=[i];h!==s;){if(!h.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");h=h.getNextSibling(),i.push(h)}for(let N of i)l=l.insertAfter(N)}class Pr extends ni{static getType(){return"linebreak"}static clone(i){return new Pr(i.__key)}constructor(i){super(i)}getTextContent(){return`
58
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let s=i.parentElement,h,N;return s!==null&&((h=s.firstChild)===i||h.nextSibling===i&&h.nodeType===3&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((N=s.lastChild)===i||N.previousSibling===i&&N.nodeType===3&&(N.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Ac,priority:0}}}}static importJSON(){return $r()}exportJSON(){return{type:"linebreak",version:1}}}function Ac(){return{node:$r()}}function $r(){return Bi(new Pr)}function Ei(l){return l instanceof Pr}function El(l,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function Hi(l,i){return i&1?"strong":i&2?"em":"span"}function Wo(l,i,s,h,N){l=h.classList,h=Kt(N,"base"),h!==void 0&&l.add(...h),h=Kt(N,"underlineStrikethrough");let v=!1,M=i&8&&i&4;var J=s&8&&s&4;h!==void 0&&(J?(v=!0,M||l.add(...h)):M&&l.remove(...h));for(let ge in te)J=te[ge],h=Kt(N,ge),h!==void 0&&(s&J?!v||ge!=="underline"&&ge!=="strikethrough"?(!(i&J)||M&&ge==="underline"||ge==="strikethrough")&&l.add(...h):i&J&&l.remove(...h):i&J&&l.remove(...h))}function Tl(l,i,s){let h=i.firstChild;if(s=s.isComposing(),l+=s?Te:"",h==null)i.textContent=l;else if(i=h.nodeValue,i!==l)if(s||m){s=i.length;let N=l.length,v=0,M=0;for(;v<s&&v<N&&i[v]===l[v];)v++;for(;M+v<s&&M+v<N&&i[s-M-1]===l[N-M-1];)M++;l=[v,s-v-M,l.slice(v,N-M)];let[J,ge,ve]=l;ge!==0&&h.deleteData(J,ge),h.insertData(J,ve)}else h.nodeValue=l}function Ko(l,i){return i=document.createElement(i),i.appendChild(l),i}class ri extends ni{static getType(){return"text"}static clone(i){return new ri(i.__text,i.__key)}constructor(i,s){super(s),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 Ye[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ut()}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,s){let h=this.getLatest().__format;return Ot(h,i,s)}createDOM(i){var s=this.__format,h=El(this,s);let N=Hi(this,s),v=document.createElement(h===null?N:h),M=v;return this.hasFormat("code")&&v.setAttribute("spellcheck","false"),h!==null&&(M=document.createElement(N),v.appendChild(M)),h=M,Tl(this.__text,h,this),i=i.theme.text,i!==void 0&&Wo(N,0,s,h,i),s=this.__style,s!==""&&(v.style.cssText=s),v}updateDOM(i,s,h){let N=this.__text;var v=i.__format,M=this.__format,J=El(this,v);let ge=El(this,M);var ve=Hi(this,v);let Fe=Hi(this,M);return(J===null?ve:J)!==(ge===null?Fe:ge)?!0:J===ge&&ve!==Fe?(v=s.firstChild,v==null&&Y(48),i=J=document.createElement(Fe),Tl(N,i,this),h=h.theme.text,h!==void 0&&Wo(Fe,0,M,i,h),s.replaceChild(J,v),!1):(ve=s,ge!==null&&J!==null&&(ve=s.firstChild,ve==null&&Y(49)),Tl(N,ve,this),h=h.theme.text,h!==void 0&&v!==M&&Wo(Fe,v,M,ve,h),M=this.__style,i.__style!==M&&(s.style.cssText=M),!1)}static importDOM(){return{"#text":()=>({conversion:vs,priority:0}),b:()=>({conversion:st,priority:0}),code:()=>({conversion:Ti,priority:0}),em:()=>({conversion:Ti,priority:0}),i:()=>({conversion:Ti,priority:0}),s:()=>({conversion:Ti,priority:0}),span:()=>({conversion:Ea,priority:0}),strong:()=>({conversion:Ti,priority:0}),sub:()=>({conversion:Ti,priority:0}),sup:()=>({conversion:Ti,priority:0}),u:()=>({conversion:Ti,priority:0})}}static importJSON(i){let s=Bn(i.text);return s.setFormat(i.format),s.setDetail(i.detail),s.setMode(i.mode),s.setStyle(i.style),s}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&io(i)||Y(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=Ko(i,"b")),this.hasFormat("italic")&&(i=Ko(i,"i")),this.hasFormat("strikethrough")&&(i=Ko(i,"s")),this.hasFormat("underline")&&(i=Ko(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 s=this.getWritable();return s.__format=typeof i=="string"?te[i]:i,s}setDetail(i){let s=this.getWritable();return s.__detail=typeof i=="string"?ce[i]:i,s}setStyle(i){let s=this.getWritable();return s.__style=i,s}toggleFormat(i){let s=this.getFormat();return i=Ot(s,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=Be[i],this.__mode===i)return this;let s=this.getWritable();return s.__mode=i,s}setTextContent(i){if(this.__text===i)return this;let s=this.getWritable();return s.__text=i,s}select(i,s){Jn();let h=Vt();var N=this.getTextContent();let v=this.__key;if(typeof N=="string"?(N=N.length,i===void 0&&(i=N),s===void 0&&(s=N)):s=i=0,wt(h))N=Ut(),N!==h.anchor.key&&N!==h.focus.key||bt(v),h.setTextNodeRange(this,i,this,s);else return Gn(v,i,v,s,"text","text");return h}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,s,h,N){let v=this.getWritable(),M=v.__text,J=h.length,ge=i;0>ge&&(ge=J+ge,0>ge&&(ge=0));let ve=Vt();return N&&wt(ve)&&(i+=J,ve.setTextNodeRange(v,i,v,i)),s=M.slice(0,ge)+h+M.slice(ge+s),v.__text=s,v}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Jn();var s=this.getLatest(),h=s.getTextContent(),N=s.__key,v=Ut(),M=new Set(i);i=[];for(var J=h.length,ge="",ve=0;ve<J;ve++)ge!==""&&M.has(ve)&&(i.push(ge),ge=""),ge+=h[ve];if(ge!==""&&i.push(ge),M=i.length,M===0)return[];if(i[0]===h)return[s];var Fe=i[0];h=s.getParentOrThrow(),ve=s.getFormat();let Ke=s.getStyle(),ke=s.__detail;J=!1,s.isSegmented()?(ge=Bn(Fe),ge.__format=ve,ge.__style=Ke,ge.__detail=ke,J=!0):(ge=s.getWritable(),ge.__text=Fe),s=Vt(),ge=[ge],Fe=Fe.length;for(let ut=1;ut<M;ut++){var Me=i[ut],Xe=Me.length;Me=Bn(Me).getWritable(),Me.__format=ve,Me.__style=Ke,Me.__detail=ke;let Tt=Me.__key;if(Xe=Fe+Xe,wt(s)){let At=s.anchor,hn=s.focus;At.key===N&&At.type==="text"&&At.offset>Fe&&At.offset<=Xe&&(At.key=Tt,At.offset-=Fe,s.dirty=!0),hn.key===N&&hn.type==="text"&&hn.offset>Fe&&hn.offset<=Xe&&(hn.key=Tt,hn.offset-=Fe,s.dirty=!0)}v===N&&bt(Tt),Fe=Xe,ge.push(Me)}return N=this.getPreviousSibling(),v=this.getNextSibling(),N!==null&&Qt(N),v!==null&&Qt(v),N=h.getWritable(),v=this.getIndexWithinParent(),J?(N.splice(v,0,ge),this.remove()):N.splice(v,1,ge),wt(s)&&go(s,h,v,M-1),ge}mergeWithSibling(i){var s=i===this.getPreviousSibling();s||i===this.getNextSibling()||Y(50);var h=this.__key;let N=i.__key,v=this.__text,M=v.length;Ut()===N&&bt(h);let J=Vt();if(wt(J)){let ge=J.anchor,ve=J.focus;ge!==null&&ge.key===N&&(As(ge,s,h,i,M),J.dirty=!0),ve!==null&&ve.key===N&&(As(ve,s,h,i,M),J.dirty=!0)}return h=i.__text,this.setTextContent(s?h+v:v+h),s=this.getWritable(),i.remove(),s}isTextEntity(){return!1}}function Ea(l){let i=l.style.fontWeight==="700",s=l.style.textDecoration==="line-through",h=l.style.fontStyle==="italic",N=l.style.textDecoration==="underline",v=l.style.verticalAlign;return{forChild:M=>(ht(M)&&(i&&M.toggleFormat("bold"),s&&M.toggleFormat("strikethrough"),h&&M.toggleFormat("italic"),N&&M.toggleFormat("underline"),v==="sub"&&M.toggleFormat("subscript"),v==="super"&&M.toggleFormat("superscript")),M),node:null}}function st(l){let i=l.style.fontWeight==="normal";return{forChild:s=>(ht(s)&&!i&&s.toggleFormat("bold"),s),node:null}}let zo=new WeakMap;function vs(l){l.parentElement===null&&Y(129);for(var i=l.textContent||"",s,h=l.parentNode,N=[l];h!==null&&(s=zo.get(h))===void 0&&!(h.nodeName==="PRE"||h.nodeType===1&&h.style!==void 0&&h.style.whiteSpace!==void 0&&h.style.whiteSpace.startsWith("pre"));)N.push(h),h=h.parentNode;for(s=s===void 0?h:s,h=0;h<N.length;h++)zo.set(N[h],s);if(s!==null){for(i=i.split(/(\r?\n|\t)/),l=[],N=i.length,s=0;s<N;s++)h=i[s],h===`
56
+ `?(l.preventDefault(),ot(i,c,void 0)):v==null&&l.dataTransfer?(v=l.dataTransfer.getData("text/plain"),l.preventDefault(),N.insertRawText(v)):v!=null&&fa(N,h,v,l.timeStamp,!0)?(l.preventDefault(),ot(i,d,v)):ao=v,ua=l.timeStamp;else switch(l.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ot(i,d,l);break;case"insertFromComposition":bt(null),ot(i,d,l);break;case"insertLineBreak":bt(null),ot(i,r,!1);break;case"insertParagraph":bt(null),Bo&&!Z?(Bo=!1,ot(i,r,!1)):ot(i,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ot(i,g,l);break;case"deleteByComposition":ma(J,M)&&ot(i,p,l);break;case"deleteByDrag":case"deleteByCut":ot(i,p,l);break;case"deleteContent":ot(i,n,!1);break;case"deleteWordBackward":ot(i,C,!0);break;case"deleteWordForward":ot(i,C,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ot(i,S,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ot(i,S,!1);break;case"formatStrikeThrough":ot(i,T,"strikethrough");break;case"formatBold":ot(i,T,"bold");break;case"formatItalic":ot(i,T,"italic");break;case"formatUnderline":ot(i,T,"underline");break;case"historyUndo":ot(i,O,void 0);break;case"historyRedo":ot(i,R,void 0)}}})}function wc(l,i){l.stopPropagation(),sr(i,()=>{var s=Vt(),h=l.data,N=pa(l);if(h!=null&&wt(s)&&fa(s,N,h,l.timeStamp,!1)){Ho&&(Nl(i,h),Ho=!1);var v=s.anchor,M=v.getNode();if(N=kr(i._window),N===null)return;let J=v.offset;(v=y&&!s.isCollapsed()&&ht(M)&&N.anchorNode!==null)&&(M=M.getTextContent().slice(0,J)+h+M.getTextContent().slice(J+s.focus.offset),N=N.anchorNode,v=M===(N.nodeType===3?N.nodeValue:null)),v||ot(i,d,h),h=h.length,m&&1<h&&l.inputType==="insertCompositionText"&&!i.isComposing()&&(s.anchor.offset-=h),A||Z||se||!i.isComposing()||($o=0,bt(null))}else nt(!1,i,h!==null?h:void 0),Ho&&(Nl(i,h||void 0),Ho=!1);Jn(),s=ln(),Oe(s)}),ao=null}function Oc(l,i){sr(i,()=>{let s=Vt();if(wt(s)&&!i.isComposing()){let h=s.anchor,N=s.anchor.getNode();bt(h.key),(l.timeStamp<$o+30||h.type==="element"||!s.isCollapsed()||N.getFormat()!==s.format||N.getStyle()!==s.style)&&ot(i,d,be)}})}function Nl(l,i){var s=l._compositionKey;if(bt(null),s!==null&&i!=null){if(i===""){i=It(s),l=vt(l.getElementByKey(s)),l!==null&&l.nodeValue!==null&&ht(i)&&Nt(i,l.nodeValue,null,null,!0);return}if(i[i.length-1]===`
57
+ `&&(s=Vt(),wt(s))){i=s.focus,s.anchor.set(i.key,i.offset,i.type),ot(l,B,null);return}}nt(!0,l,i)}function Dc(l,i){m?Ho=!0:sr(i,()=>{Nl(i,l.data)})}function Mc(l,i){if($o=l.timeStamp,ca=l.keyCode,!i.isComposing()){var{keyCode:s,shiftKey:h,ctrlKey:N,metaKey:v,altKey:M}=l;if(!ot(i,b,l)){if(s!==39||N||v||M)if(s!==39||M||h||!N&&!v)if(s!==37||N||v||M)if(s!==37||M||h||!N&&!v)if(s!==38||N||v)if(s!==40||N||v)if(s===13&&h)Bo=!0,ot(i,B,l);else if(s===32)ot(i,z,l);else if(k&&N&&s===79)l.preventDefault(),Bo=!0,ot(i,r,!0);else if(s!==13||h){var J=k?M||v?!1:s===8||s===72&&N:N||M||v?!1:s===8;J?s===8?ot(i,X,l):(l.preventDefault(),ot(i,n,!0)):s===27?ot(i,ee,l):(J=k?h||M||v?!1:s===46||s===68&&N:N||M||v?!1:s===46,J?s===46?ot(i,le,l):(l.preventDefault(),ot(i,n,!1)):s===8&&(k?M:N)?(l.preventDefault(),ot(i,C,!0)):s===46&&(k?M:N)?(l.preventDefault(),ot(i,C,!1)):k&&v&&s===8?(l.preventDefault(),ot(i,S,!0)):k&&v&&s===46?(l.preventDefault(),ot(i,S,!1)):s===66&&!M&&(k?v:N)?(l.preventDefault(),ot(i,T,"bold")):s===85&&!M&&(k?v:N)?(l.preventDefault(),ot(i,T,"underline")):s===73&&!M&&(k?v:N)?(l.preventDefault(),ot(i,T,"italic")):s!==9||M||N||v?s===90&&!h&&(k?v:N)?(l.preventDefault(),ot(i,O,void 0)):(J=k?s===90&&v&&h:s===89&&N||s===90&&N&&h,J?(l.preventDefault(),ot(i,R,void 0)):Go(i._editorState._selection)?(J=h?!1:s===67?k?v:N:!1,J?(l.preventDefault(),ot(i,pe,l)):(J=h?!1:s===88?k?v:N:!1,J?(l.preventDefault(),ot(i,ue,l)):s===65&&(k?v:N)&&(l.preventDefault(),ot(i,K,l)))):!m&&s===65&&(k?v:N)&&(l.preventDefault(),ot(i,K,l))):ot(i,j,l))}else Bo=!1,ot(i,B,l);else ot(i,H,l);else ot(i,P,l);else ot(i,W,l);else ot(i,$,l);else ot(i,w,l);else ot(i,x,l);(N||h||M||v)&&ot(i,ne,l)}}}function ya(l){let i=l.__lexicalEventHandles;return i===void 0&&(i=[],l.__lexicalEventHandles=i),i}let co=new Map;function Na(l){l=l.target;let i=kr(l==null?null:l.nodeType===9?l.defaultView:l.ownerDocument.defaultView);if(i!==null){var s=_t(i.anchorNode);if(s!==null){yl&&(yl=!1,sr(s,()=>{var M=Ui(),J=i.anchorNode;J!==null&&(J=J.nodeType,J===1||J===3)&&(M=Hn(M,i,s),gr(M))})),l=ye(s),l=l[l.length-1];var h=l._key,N=co.get(h),v=N||l;v!==s&&ga(i,v,!1),ga(i,s,!0),s!==l?co.set(h,s):N&&co.delete(h)}}}function Ac(l,i){Fo===0&&l.ownerDocument.addEventListener("selectionchange",Na),Fo++,l.__lexicalEditor=i;let s=ya(l);for(let h=0;h<ml.length;h++){let[N,v]=ml[h],M=typeof v=="function"?J=>{J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()&&v(J,i))}:J=>{if(J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()))switch(N){case"cut":return ot(i,ue,J);case"copy":return ot(i,pe,J);case"paste":return ot(i,g,J);case"dragstart":return ot(i,q,J);case"dragover":return ot(i,me,J);case"dragend":return ot(i,_e,J);case"focus":return ot(i,D,J);case"blur":return ot(i,V,J);case"drop":return ot(i,U,J)}};l.addEventListener(N,M),s.push(()=>{l.removeEventListener(N,M)})}}function Cl(l,i,s){Jn();var h=l.__key;let N=l.getParent();if(N!==null){var v=Vt();if(wt(v)&&Ze(l)){var{anchor:M,focus:J}=v,ge=M.getNode(),ve=J.getNode();mi(ge,l)&&M.set(l.__key,0,"element"),mi(ve,l)&&J.set(l.__key,0,"element")}if(ge=v,ve=!1,wt(ge)&&i){v=ge.anchor;let Fe=ge.focus;v.key===h&&(po(v,l,N,l.getPreviousSibling(),l.getNextSibling()),ve=!0),Fe.key===h&&(po(Fe,l,N,l.getPreviousSibling(),l.getNextSibling()),ve=!0)}else Go(ge)&&i&&l.isSelected()&&l.selectPrevious();wt(ge)&&i&&!ve?(h=l.getIndexWithinParent(),xt(l),go(ge,N,h,-1)):xt(l),s||Xr(N)||N.canBeEmpty()||!N.isEmpty()||Cl(N,i),i&&tr(N)&&N.isEmpty()&&N.selectEnd()}}class ni{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,Mt(this,i)}getType(){return this.__type}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=It(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let s=i.getNodes().some(h=>h.__key===this.__key);return ht(this)?s:wt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:s}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let s=0;for(;i!==null;){if(this.is(i))return s;s++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:It(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let s=i.getParent();if(Xr(s))return i;i=s}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],s=this.getParent();for(;s!==null;)i.push(s),s=s.getParent();return i}getParentKeys(){let i=[],s=this.getParent();for(;s!==null;)i.push(s.__key),s=s.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:It(i)}getPreviousSiblings(){let i=[];var s=this.getParent();if(s===null)return i;for(s=s.getFirstChild();s!==null&&!s.is(this);)i.push(s),s=s.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:It(i)}getNextSiblings(){let i=[],s=this.getNextSibling();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getCommonAncestor(i){let s=this.getParents();var h=i.getParents();Ze(this)&&s.unshift(this),Ze(i)&&h.unshift(i),i=s.length;var N=h.length;if(i===0||N===0||s[i-1]!==h[N-1])return null;for(h=new Set(h),N=0;N<i;N++){let v=s[N];if(h.has(v))return v}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 s=this.getCommonAncestor(i);let h=this;for(;;){var N=h.getParentOrThrow();if(N===s){N=h.getIndexWithinParent();break}h=N}for(h=i;;){if(i=h.getParentOrThrow(),i===s){s=h.getIndexWithinParent();break}h=i}return N<s}isParentOf(i){let s=this.__key;if(s===i.__key)return!1;for(;i!==null;){if(i.__key===s)return!0;i=i.getParent()}return!1}getNodesBetween(i){let s=this.isBefore(i),h=[],N=new Set;for(var v=this;;){var M=v.__key;if(N.has(M)||(N.add(M),h.push(v)),v===i)break;if(M=Ze(v)?s?v.getFirstChild():v.getLastChild():null,M!==null)v=M;else if(M=s?v.getNextSibling():v.getPreviousSibling(),M!==null)v=M;else{if(v=v.getParentOrThrow(),N.has(v.__key)||h.push(v),v===i)break;M=v;do M===null&&Y(68),v=s?M.getNextSibling():M.getPreviousSibling(),M=M.getParent(),M!==null&&(v!==null||N.has(M.__key)||h.push(M));while(v===null)}}return s||h.reverse(),h}isDirty(){let i=ln()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=It(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=yr(),s=ln();i=i._nodeMap;let h=this.__key,N=this.getLatest(),v=N.__parent;s=s._cloneNotNeeded;var M=Vt();return vl(M)&&M.setCachedNodes(null),s.has(h)?(Qt(N),N):(M=N.constructor.clone(N),M.__parent=v,M.__next=N.__next,M.__prev=N.__prev,Ze(N)&&Ze(M)?(M.__first=N.__first,M.__last=N.__last,M.__size=N.__size,M.__indent=N.__indent,M.__format=N.__format,M.__dir=N.__dir):ht(N)&&ht(M)&&(M.__format=N.__format,M.__style=N.__style,M.__mode=N.__mode,M.__detail=N.__detail),s.add(h),M.__key=h,Qt(M),i.set(h,M),M)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){Cl(this,!0,i)}replace(i,s){Jn();var h=Vt();h!==null&&(h=h.clone()),_s(this,i);let N=this.getLatest(),v=this.__key,M=i.__key,J=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;xt(J);let ve=N.getPreviousSibling(),Fe=N.getNextSibling(),Ke=N.__prev,ke=N.__next,Me=N.__parent;return Cl(N,!1,!0),ve===null?i.__first=M:ve.getWritable().__next=M,J.__prev=Ke,Fe===null?i.__last=M:Fe.getWritable().__prev=M,J.__next=ke,J.__parent=Me,i.__size=ge,s&&this.getChildren().forEach(Xe=>{J.append(Xe)}),wt(h)&&(gr(h),s=h.anchor,h=h.focus,s.key===v&&xl(s,J),h.key===v&&xl(h,J)),Ut()===v&&bt(M),J}insertAfter(i,s=!0){Jn(),_s(this,i);var h=this.getWritable();let N=i.getWritable();var v=N.getParent();let M=Vt();var J=!1,ge=!1;if(v!==null){var ve=i.getIndexWithinParent();xt(N),wt(M)&&(ge=v.__key,J=M.anchor,v=M.focus,J=J.type==="element"&&J.key===ge&&J.offset===ve+1,ge=v.type==="element"&&v.key===ge&&v.offset===ve+1)}v=this.getNextSibling(),ve=this.getParentOrThrow().getWritable();let Fe=N.__key,Ke=h.__next;return v===null?ve.__last=Fe:v.getWritable().__prev=Fe,ve.__size++,h.__next=Fe,N.__next=Ke,N.__prev=h.__key,N.__parent=h.__parent,s&&wt(M)&&(s=this.getIndexWithinParent(),go(M,ve,s+1),h=ve.__key,J&&M.anchor.set(h,s+2,"element"),ge&&M.focus.set(h,s+2,"element")),i}insertBefore(i,s=!0){Jn(),_s(this,i);var h=this.getWritable();let N=i.getWritable(),v=N.__key;xt(N);let M=this.getPreviousSibling(),J=this.getParentOrThrow().getWritable(),ge=h.__prev,ve=this.getIndexWithinParent();return M===null?J.__first=v:M.getWritable().__next=v,J.__size++,h.__prev=v,N.__prev=ge,N.__next=h.__key,N.__parent=h.__parent,h=Vt(),s&&wt(h)&&(s=this.getParentOrThrow(),go(h,s,ve)),i}isParentRequired(){return!1}createParentElementNode(){return lr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,s){Jn();let h=this.getPreviousSibling(),N=this.getParentOrThrow();return h===null?N.select(0,0):Ze(h)?h.select():ht(h)?h.select(i,s):(i=h.getIndexWithinParent()+1,N.select(i,i))}selectNext(i,s){Jn();let h=this.getNextSibling(),N=this.getParentOrThrow();return h===null?N.select():Ze(h)?h.select(0,0):ht(h)?h.select(i,s):(i=h.getIndexWithinParent(),N.select(i,i))}markDirty(){this.getWritable()}}function Ca(l,i,s){s=s||i.getParentOrThrow().getLastChild();let h=i;for(i=[i];h!==s;){if(!h.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");h=h.getNextSibling(),i.push(h)}for(let N of i)l=l.insertAfter(N)}class Pr extends ni{static getType(){return"linebreak"}static clone(i){return new Pr(i.__key)}constructor(i){super(i)}getTextContent(){return`
58
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let s=i.parentElement,h,N;return s!==null&&((h=s.firstChild)===i||h.nextSibling===i&&h.nodeType===3&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((N=s.lastChild)===i||N.previousSibling===i&&N.nodeType===3&&(N.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Rc,priority:0}}}}static importJSON(){return $r()}exportJSON(){return{type:"linebreak",version:1}}}function Rc(){return{node:$r()}}function $r(){return Bi(new Pr)}function Ei(l){return l instanceof Pr}function El(l,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function Hi(l,i){return i&1?"strong":i&2?"em":"span"}function Wo(l,i,s,h,N){l=h.classList,h=Kt(N,"base"),h!==void 0&&l.add(...h),h=Kt(N,"underlineStrikethrough");let v=!1,M=i&8&&i&4;var J=s&8&&s&4;h!==void 0&&(J?(v=!0,M||l.add(...h)):M&&l.remove(...h));for(let ge in te)J=te[ge],h=Kt(N,ge),h!==void 0&&(s&J?!v||ge!=="underline"&&ge!=="strikethrough"?(!(i&J)||M&&ge==="underline"||ge==="strikethrough")&&l.add(...h):i&J&&l.remove(...h):i&J&&l.remove(...h))}function Tl(l,i,s){let h=i.firstChild;if(s=s.isComposing(),l+=s?Te:"",h==null)i.textContent=l;else if(i=h.nodeValue,i!==l)if(s||m){s=i.length;let N=l.length,v=0,M=0;for(;v<s&&v<N&&i[v]===l[v];)v++;for(;M+v<s&&M+v<N&&i[s-M-1]===l[N-M-1];)M++;l=[v,s-v-M,l.slice(v,N-M)];let[J,ge,ve]=l;ge!==0&&h.deleteData(J,ge),h.insertData(J,ve)}else h.nodeValue=l}function Ko(l,i){return i=document.createElement(i),i.appendChild(l),i}class ri extends ni{static getType(){return"text"}static clone(i){return new ri(i.__text,i.__key)}constructor(i,s){super(s),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 Ye[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ut()}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,s){let h=this.getLatest().__format;return Ot(h,i,s)}createDOM(i){var s=this.__format,h=El(this,s);let N=Hi(this,s),v=document.createElement(h===null?N:h),M=v;return this.hasFormat("code")&&v.setAttribute("spellcheck","false"),h!==null&&(M=document.createElement(N),v.appendChild(M)),h=M,Tl(this.__text,h,this),i=i.theme.text,i!==void 0&&Wo(N,0,s,h,i),s=this.__style,s!==""&&(v.style.cssText=s),v}updateDOM(i,s,h){let N=this.__text;var v=i.__format,M=this.__format,J=El(this,v);let ge=El(this,M);var ve=Hi(this,v);let Fe=Hi(this,M);return(J===null?ve:J)!==(ge===null?Fe:ge)?!0:J===ge&&ve!==Fe?(v=s.firstChild,v==null&&Y(48),i=J=document.createElement(Fe),Tl(N,i,this),h=h.theme.text,h!==void 0&&Wo(Fe,0,M,i,h),s.replaceChild(J,v),!1):(ve=s,ge!==null&&J!==null&&(ve=s.firstChild,ve==null&&Y(49)),Tl(N,ve,this),h=h.theme.text,h!==void 0&&v!==M&&Wo(Fe,v,M,ve,h),M=this.__style,i.__style!==M&&(s.style.cssText=M),!1)}static importDOM(){return{"#text":()=>({conversion:vs,priority:0}),b:()=>({conversion:st,priority:0}),code:()=>({conversion:Ti,priority:0}),em:()=>({conversion:Ti,priority:0}),i:()=>({conversion:Ti,priority:0}),s:()=>({conversion:Ti,priority:0}),span:()=>({conversion:Ea,priority:0}),strong:()=>({conversion:Ti,priority:0}),sub:()=>({conversion:Ti,priority:0}),sup:()=>({conversion:Ti,priority:0}),u:()=>({conversion:Ti,priority:0})}}static importJSON(i){let s=Bn(i.text);return s.setFormat(i.format),s.setDetail(i.detail),s.setMode(i.mode),s.setStyle(i.style),s}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&io(i)||Y(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=Ko(i,"b")),this.hasFormat("italic")&&(i=Ko(i,"i")),this.hasFormat("strikethrough")&&(i=Ko(i,"s")),this.hasFormat("underline")&&(i=Ko(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 s=this.getWritable();return s.__format=typeof i=="string"?te[i]:i,s}setDetail(i){let s=this.getWritable();return s.__detail=typeof i=="string"?ce[i]:i,s}setStyle(i){let s=this.getWritable();return s.__style=i,s}toggleFormat(i){let s=this.getFormat();return i=Ot(s,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=Be[i],this.__mode===i)return this;let s=this.getWritable();return s.__mode=i,s}setTextContent(i){if(this.__text===i)return this;let s=this.getWritable();return s.__text=i,s}select(i,s){Jn();let h=Vt();var N=this.getTextContent();let v=this.__key;if(typeof N=="string"?(N=N.length,i===void 0&&(i=N),s===void 0&&(s=N)):s=i=0,wt(h))N=Ut(),N!==h.anchor.key&&N!==h.focus.key||bt(v),h.setTextNodeRange(this,i,this,s);else return Gn(v,i,v,s,"text","text");return h}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,s,h,N){let v=this.getWritable(),M=v.__text,J=h.length,ge=i;0>ge&&(ge=J+ge,0>ge&&(ge=0));let ve=Vt();return N&&wt(ve)&&(i+=J,ve.setTextNodeRange(v,i,v,i)),s=M.slice(0,ge)+h+M.slice(ge+s),v.__text=s,v}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Jn();var s=this.getLatest(),h=s.getTextContent(),N=s.__key,v=Ut(),M=new Set(i);i=[];for(var J=h.length,ge="",ve=0;ve<J;ve++)ge!==""&&M.has(ve)&&(i.push(ge),ge=""),ge+=h[ve];if(ge!==""&&i.push(ge),M=i.length,M===0)return[];if(i[0]===h)return[s];var Fe=i[0];h=s.getParentOrThrow(),ve=s.getFormat();let Ke=s.getStyle(),ke=s.__detail;J=!1,s.isSegmented()?(ge=Bn(Fe),ge.__format=ve,ge.__style=Ke,ge.__detail=ke,J=!0):(ge=s.getWritable(),ge.__text=Fe),s=Vt(),ge=[ge],Fe=Fe.length;for(let ut=1;ut<M;ut++){var Me=i[ut],Xe=Me.length;Me=Bn(Me).getWritable(),Me.__format=ve,Me.__style=Ke,Me.__detail=ke;let Tt=Me.__key;if(Xe=Fe+Xe,wt(s)){let At=s.anchor,hn=s.focus;At.key===N&&At.type==="text"&&At.offset>Fe&&At.offset<=Xe&&(At.key=Tt,At.offset-=Fe,s.dirty=!0),hn.key===N&&hn.type==="text"&&hn.offset>Fe&&hn.offset<=Xe&&(hn.key=Tt,hn.offset-=Fe,s.dirty=!0)}v===N&&bt(Tt),Fe=Xe,ge.push(Me)}return N=this.getPreviousSibling(),v=this.getNextSibling(),N!==null&&Qt(N),v!==null&&Qt(v),N=h.getWritable(),v=this.getIndexWithinParent(),J?(N.splice(v,0,ge),this.remove()):N.splice(v,1,ge),wt(s)&&go(s,h,v,M-1),ge}mergeWithSibling(i){var s=i===this.getPreviousSibling();s||i===this.getNextSibling()||Y(50);var h=this.__key;let N=i.__key,v=this.__text,M=v.length;Ut()===N&&bt(h);let J=Vt();if(wt(J)){let ge=J.anchor,ve=J.focus;ge!==null&&ge.key===N&&(As(ge,s,h,i,M),J.dirty=!0),ve!==null&&ve.key===N&&(As(ve,s,h,i,M),J.dirty=!0)}return h=i.__text,this.setTextContent(s?h+v:v+h),s=this.getWritable(),i.remove(),s}isTextEntity(){return!1}}function Ea(l){let i=l.style.fontWeight==="700",s=l.style.textDecoration==="line-through",h=l.style.fontStyle==="italic",N=l.style.textDecoration==="underline",v=l.style.verticalAlign;return{forChild:M=>(ht(M)&&(i&&M.toggleFormat("bold"),s&&M.toggleFormat("strikethrough"),h&&M.toggleFormat("italic"),N&&M.toggleFormat("underline"),v==="sub"&&M.toggleFormat("subscript"),v==="super"&&M.toggleFormat("superscript")),M),node:null}}function st(l){let i=l.style.fontWeight==="normal";return{forChild:s=>(ht(s)&&!i&&s.toggleFormat("bold"),s),node:null}}let zo=new WeakMap;function vs(l){l.parentElement===null&&Y(129);for(var i=l.textContent||"",s,h=l.parentNode,N=[l];h!==null&&(s=zo.get(h))===void 0&&!(h.nodeName==="PRE"||h.nodeType===1&&h.style!==void 0&&h.style.whiteSpace!==void 0&&h.style.whiteSpace.startsWith("pre"));)N.push(h),h=h.parentNode;for(s=s===void 0?h:s,h=0;h<N.length;h++)zo.set(N[h],s);if(s!==null){for(i=i.split(/(\r?\n|\t)/),l=[],N=i.length,s=0;s<N;s++)h=i[s],h===`
59
59
  `||h===`\r
60
- `?l.push($r()):h===" "?l.push(Wi()):h!==""&&l.push(Bn(h));return{node:l}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(N=l,s=!0;N!==null&&(N=Ta(N,!1))!==null;)if(h=N.textContent||"",0<h.length){/[ \t\n]$/.test(h)&&(i=i.slice(1)),s=!1;break}s&&(i=i.slice(1))}if(i[i.length-1]===" "){for(N=!0;l!==null&&(l=Ta(l,!0))!==null;)if(0<(l.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){N=!1;break}N&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Bn(i)}}let ws=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 Ta(l,i){for(;;){for(var s=void 0;(s=i?l.nextSibling:l.previousSibling)===null;)if(l=l.parentElement,l===null)return null;if(l=s,l.nodeType===1&&(s=l.style.display,s===""&&l.nodeName.match(ws)===null||s!==""&&!s.startsWith("inline")))return null;for(;(s=i?l.firstChild:l.lastChild)!==null;)l=s;if(l.nodeType===3)return l;if(l.nodeName==="BR")return null}}let Rc={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ti(l){let i=Rc[l.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:s=>(ht(s)&&!s.hasFormat(i)&&s.toggleFormat(i),s),node:null}}function Bn(l=""){return Bi(new ri(l))}function ht(l){return l instanceof ri}class uo extends ri{static getType(){return"tab"}static clone(i){let s=new uo(i.__key);return s.__text=i.__text,s.__format=i.__format,s.__style=i.__style,s}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let s=Wi();return s.setFormat(i.format),s.setStyle(i.style),s}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){Y(126)}setDetail(){Y(127)}setMode(){Y(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Wi(){return Bi(new uo)}function xa(l){return l instanceof uo}class Dr{constructor(i,s,h){this._selection=null,this.key=i,this.offset=s,this.type=h}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let s=this.getNode(),h=i.getNode(),N=this.offset;if(i=i.offset,Ze(s)){var v=s.getDescendantByIndex(N);s=v??s}return Ze(h)&&(v=h.getDescendantByIndex(i),h=v??h),s===h?N<i:s.isBefore(h)}getNode(){let i=It(this.key);return i===null&&Y(20),i}set(i,s,h){let N=this._selection,v=this.key;this.key=i,this.offset=s,this.type=h,oi()||(Ut()===v&&bt(i),N!==null&&(N.setCachedNodes(null),N.dirty=!0))}}function Fr(l,i){let s=i.__key,h=l.offset,N="element";if(ht(i))N="text",i=i.getTextContentSize(),h>i&&(h=i);else if(!Ze(i)){var v=i.getNextSibling();ht(v)?(s=v.__key,h=0,N="text"):(v=i.getParent())&&(s=v.__key,h=i.getIndexWithinParent()+1)}l.set(s,h,N)}function xl(l,i){if(Ze(i)){let s=i.getLastDescendant();Ze(s)||ht(s)?Fr(l,s):Fr(l,i)}else Fr(l,i)}function fo(l,i,s,h){let N=l.getNode(),v=N.getChildAtIndex(l.offset),M=Bn(),J=tr(N)?lr().append(M):M;M.setFormat(s),M.setStyle(h),v===null?N.append(J):v.insertBefore(J),l.is(i)&&i.set(M.__key,0,"text"),l.set(M.__key,0,"text")}function Br(l,i,s,h){l.key=i,l.offset=s,l.type=h}class Sl{constructor(i,s){this.anchor=i,this.focus=s,i._selection=this,s._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return vl(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 zi(this)}}class ho{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!Go(i))return!1;let s=this._nodes,h=i._nodes;return s.size===h.size&&Array.from(s).every(N=>h.has(N))}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 ho(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.getNodes(),h=s.length;var N=s[h-1];if(ht(N))N=N.select();else{let v=N.getIndexWithinParent()+1;N=N.getParentOrThrow().select(v,v)}for(N.insertNodes(i),i=0;i<h;i++)s[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var s=this._nodes;i=[];for(let h of s)s=It(h),s!==null&&i.push(s);return oi()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function wt(l){return l instanceof Ki}function vl(l){return l instanceof Sl}function _r(l){let[i,,s]=ii(l);l=s.getChildren();let h=l.length;var N=l[0].getChildren().length;let v=Array(h);for(var M=0;M<h;M++)v[M]=Array(N);for(N=0;N<h;N++){M=l[N].getChildren();let J=0;for(let ge=0;ge<M.length;ge++){for(;v[N][J];)J++;let ve=M[ge],Fe=ve.__rowSpan||1,Ke=ve.__colSpan||1;for(let ke=0;ke<Fe;ke++)for(let Me=0;Me<Ke;Me++)v[N+ke][J+Me]=ve;if(i===ve)return{colSpan:Ke,columnIndex:J,rowIndex:N,rowSpan:Fe};J+=Ke}}return null}class Os extends Sl{constructor(i,s,h){super(s,h),this.gridKey=i}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Uo(i)?this.gridKey===i.gridKey&&this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}set(i,s,h){this.dirty=!0,this.gridKey=i,this.anchor.key=s,this.focus.key=h,this._cachedNodes=null}clone(){return new Os(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.focus.getNode();Qe(s.select(0,s.getChildrenSize())).insertNodes(i)}getShape(){var i=It(this.anchor.key);if(Nr(i)||Y(103),i=_r(i),i===null)throw Error("getCellRect: expected to find AnchorNode");var s=It(this.focus.key);Nr(s)||Y(104);let h=_r(s);if(h===null)throw Error("getCellRect: expected to find focusCellNode");s=Math.min(i.columnIndex,h.columnIndex);let N=Math.max(i.columnIndex,h.columnIndex),v=Math.min(i.rowIndex,h.rowIndex);return i=Math.max(i.rowIndex,h.rowIndex),{fromX:Math.min(s,N),fromY:Math.min(v,i),toX:Math.max(s,N),toY:Math.max(v,i)}}getNodes(){function i(Tt){let{cell:At,startColumn:hn,startRow:ar}=Tt;ve=Math.min(ve,hn),Fe=Math.min(Fe,ar),Ke=Math.max(Ke,hn+At.__colSpan-1),ke=Math.max(ke,ar+At.__rowSpan-1)}var s=this._cachedNodes;if(s!==null)return s;var h=this.anchor.getNode();s=this.focus.getNode();var N=ys(h,Nr);h=ys(s,Nr),Nr(N)||Y(103),Nr(h)||Y(104),s=N.getParent(),Jo(s)||Y(105),s=s.getParent(),ks(s)||Y(106);var v=h.getParents()[1];if(v!==s){if(s.isParentOf(h)){if(s=v.getParent(),s==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,h.getKey(),s.getKey())}else{if(s=s.getParent(),s==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,s.getKey(),h.getKey())}return this.getNodes()}let[M,J,ge]=Si(s,N,h),ve=Math.min(J.startColumn,ge.startColumn),Fe=Math.min(J.startRow,ge.startRow),Ke=Math.max(J.startColumn+J.cell.__colSpan-1,ge.startColumn+ge.cell.__colSpan-1),ke=Math.max(J.startRow+J.cell.__rowSpan-1,ge.startRow+ge.cell.__rowSpan-1);h=ve,N=Fe,v=ve;for(var Me=Fe;ve<h||Fe<N||Ke>v||ke>Me;){if(ve<h){var Xe=Me-N;--h;for(var ut=0;ut<=Xe;ut++)i(M[N+ut][h])}if(Fe<N)for(Xe=v-h,--N,ut=0;ut<=Xe;ut++)i(M[N][h+ut]);if(Ke>v)for(Xe=Me-N,v+=1,ut=0;ut<=Xe;ut++)i(M[N+ut][v]);if(ke>Me)for(Xe=v-h,Me+=1,ut=0;ut<=Xe;ut++)i(M[Me][h+ut])}for(s=[s],h=null,N=Fe;N<=ke;N++)for(v=ve;v<=Ke;v++)({cell:Me}=M[N][v]),Xe=Me.getParent(),Jo(Xe)||Y(107),Xe!==h&&s.push(Xe),s.push(Me,...Tc(Me)),h=Xe;return oi()||(this._cachedNodes=s),s}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function Uo(l){return l instanceof Os}class Ki extends Sl{constructor(i,s,h,N){super(i,s),this.format=h,this.style=N}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return wt(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 s=this.focus,h=i.isBefore(s),N=h?i:s;h=h?s:i,i=N.getNode(),s=h.getNode();let v=N.offset;return N=h.offset,Ze(i)&&(h=i.getDescendantByIndex(v),i=h??i),Ze(s)&&(h=s.getDescendantByIndex(N),h!==null&&h!==i&&s.getChildAtIndex(N)===h&&(h=h.getPreviousSibling()),s=h??s),i=i.is(s)?Ze(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(s),oi()||(this._cachedNodes=i),i}setTextNodeRange(i,s,h,N){Br(this.anchor,i.__key,s,"text"),Br(this.focus,h.__key,N,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let s=i[0],h=i[i.length-1],N=this.anchor,v=this.focus,M=N.isBefore(v),[J,ge]=zi(this),ve="",Fe=!0;for(let Ke=0;Ke<i.length;Ke++){let ke=i[Ke];if(Ze(ke)&&!ke.isInline())Fe||(ve+=`
60
+ `?l.push($r()):h===" "?l.push(Wi()):h!==""&&l.push(Bn(h));return{node:l}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(N=l,s=!0;N!==null&&(N=Ta(N,!1))!==null;)if(h=N.textContent||"",0<h.length){/[ \t\n]$/.test(h)&&(i=i.slice(1)),s=!1;break}s&&(i=i.slice(1))}if(i[i.length-1]===" "){for(N=!0;l!==null&&(l=Ta(l,!0))!==null;)if(0<(l.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){N=!1;break}N&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Bn(i)}}let ws=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 Ta(l,i){for(;;){for(var s=void 0;(s=i?l.nextSibling:l.previousSibling)===null;)if(l=l.parentElement,l===null)return null;if(l=s,l.nodeType===1&&(s=l.style.display,s===""&&l.nodeName.match(ws)===null||s!==""&&!s.startsWith("inline")))return null;for(;(s=i?l.firstChild:l.lastChild)!==null;)l=s;if(l.nodeType===3)return l;if(l.nodeName==="BR")return null}}let bc={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ti(l){let i=bc[l.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:s=>(ht(s)&&!s.hasFormat(i)&&s.toggleFormat(i),s),node:null}}function Bn(l=""){return Bi(new ri(l))}function ht(l){return l instanceof ri}class uo extends ri{static getType(){return"tab"}static clone(i){let s=new uo(i.__key);return s.__text=i.__text,s.__format=i.__format,s.__style=i.__style,s}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let s=Wi();return s.setFormat(i.format),s.setStyle(i.style),s}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){Y(126)}setDetail(){Y(127)}setMode(){Y(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Wi(){return Bi(new uo)}function xa(l){return l instanceof uo}class Dr{constructor(i,s,h){this._selection=null,this.key=i,this.offset=s,this.type=h}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let s=this.getNode(),h=i.getNode(),N=this.offset;if(i=i.offset,Ze(s)){var v=s.getDescendantByIndex(N);s=v??s}return Ze(h)&&(v=h.getDescendantByIndex(i),h=v??h),s===h?N<i:s.isBefore(h)}getNode(){let i=It(this.key);return i===null&&Y(20),i}set(i,s,h){let N=this._selection,v=this.key;this.key=i,this.offset=s,this.type=h,oi()||(Ut()===v&&bt(i),N!==null&&(N.setCachedNodes(null),N.dirty=!0))}}function Fr(l,i){let s=i.__key,h=l.offset,N="element";if(ht(i))N="text",i=i.getTextContentSize(),h>i&&(h=i);else if(!Ze(i)){var v=i.getNextSibling();ht(v)?(s=v.__key,h=0,N="text"):(v=i.getParent())&&(s=v.__key,h=i.getIndexWithinParent()+1)}l.set(s,h,N)}function xl(l,i){if(Ze(i)){let s=i.getLastDescendant();Ze(s)||ht(s)?Fr(l,s):Fr(l,i)}else Fr(l,i)}function fo(l,i,s,h){let N=l.getNode(),v=N.getChildAtIndex(l.offset),M=Bn(),J=tr(N)?lr().append(M):M;M.setFormat(s),M.setStyle(h),v===null?N.append(J):v.insertBefore(J),l.is(i)&&i.set(M.__key,0,"text"),l.set(M.__key,0,"text")}function Br(l,i,s,h){l.key=i,l.offset=s,l.type=h}class Sl{constructor(i,s){this.anchor=i,this.focus=s,i._selection=this,s._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return vl(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 zi(this)}}class ho{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!Go(i))return!1;let s=this._nodes,h=i._nodes;return s.size===h.size&&Array.from(s).every(N=>h.has(N))}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 ho(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.getNodes(),h=s.length;var N=s[h-1];if(ht(N))N=N.select();else{let v=N.getIndexWithinParent()+1;N=N.getParentOrThrow().select(v,v)}for(N.insertNodes(i),i=0;i<h;i++)s[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var s=this._nodes;i=[];for(let h of s)s=It(h),s!==null&&i.push(s);return oi()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function wt(l){return l instanceof Ki}function vl(l){return l instanceof Sl}function _r(l){let[i,,s]=ii(l);l=s.getChildren();let h=l.length;var N=l[0].getChildren().length;let v=Array(h);for(var M=0;M<h;M++)v[M]=Array(N);for(N=0;N<h;N++){M=l[N].getChildren();let J=0;for(let ge=0;ge<M.length;ge++){for(;v[N][J];)J++;let ve=M[ge],Fe=ve.__rowSpan||1,Ke=ve.__colSpan||1;for(let ke=0;ke<Fe;ke++)for(let Me=0;Me<Ke;Me++)v[N+ke][J+Me]=ve;if(i===ve)return{colSpan:Ke,columnIndex:J,rowIndex:N,rowSpan:Fe};J+=Ke}}return null}class Os extends Sl{constructor(i,s,h){super(s,h),this.gridKey=i}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Uo(i)?this.gridKey===i.gridKey&&this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}set(i,s,h){this.dirty=!0,this.gridKey=i,this.anchor.key=s,this.focus.key=h,this._cachedNodes=null}clone(){return new Os(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.focus.getNode();Qe(s.select(0,s.getChildrenSize())).insertNodes(i)}getShape(){var i=It(this.anchor.key);if(Nr(i)||Y(103),i=_r(i),i===null)throw Error("getCellRect: expected to find AnchorNode");var s=It(this.focus.key);Nr(s)||Y(104);let h=_r(s);if(h===null)throw Error("getCellRect: expected to find focusCellNode");s=Math.min(i.columnIndex,h.columnIndex);let N=Math.max(i.columnIndex,h.columnIndex),v=Math.min(i.rowIndex,h.rowIndex);return i=Math.max(i.rowIndex,h.rowIndex),{fromX:Math.min(s,N),fromY:Math.min(v,i),toX:Math.max(s,N),toY:Math.max(v,i)}}getNodes(){function i(Tt){let{cell:At,startColumn:hn,startRow:ar}=Tt;ve=Math.min(ve,hn),Fe=Math.min(Fe,ar),Ke=Math.max(Ke,hn+At.__colSpan-1),ke=Math.max(ke,ar+At.__rowSpan-1)}var s=this._cachedNodes;if(s!==null)return s;var h=this.anchor.getNode();s=this.focus.getNode();var N=ys(h,Nr);h=ys(s,Nr),Nr(N)||Y(103),Nr(h)||Y(104),s=N.getParent(),Jo(s)||Y(105),s=s.getParent(),ks(s)||Y(106);var v=h.getParents()[1];if(v!==s){if(s.isParentOf(h)){if(s=v.getParent(),s==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,h.getKey(),s.getKey())}else{if(s=s.getParent(),s==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,s.getKey(),h.getKey())}return this.getNodes()}let[M,J,ge]=Si(s,N,h),ve=Math.min(J.startColumn,ge.startColumn),Fe=Math.min(J.startRow,ge.startRow),Ke=Math.max(J.startColumn+J.cell.__colSpan-1,ge.startColumn+ge.cell.__colSpan-1),ke=Math.max(J.startRow+J.cell.__rowSpan-1,ge.startRow+ge.cell.__rowSpan-1);h=ve,N=Fe,v=ve;for(var Me=Fe;ve<h||Fe<N||Ke>v||ke>Me;){if(ve<h){var Xe=Me-N;--h;for(var ut=0;ut<=Xe;ut++)i(M[N+ut][h])}if(Fe<N)for(Xe=v-h,--N,ut=0;ut<=Xe;ut++)i(M[N][h+ut]);if(Ke>v)for(Xe=Me-N,v+=1,ut=0;ut<=Xe;ut++)i(M[N+ut][v]);if(ke>Me)for(Xe=v-h,Me+=1,ut=0;ut<=Xe;ut++)i(M[Me][h+ut])}for(s=[s],h=null,N=Fe;N<=ke;N++)for(v=ve;v<=Ke;v++)({cell:Me}=M[N][v]),Xe=Me.getParent(),Jo(Xe)||Y(107),Xe!==h&&s.push(Xe),s.push(Me,...xc(Me)),h=Xe;return oi()||(this._cachedNodes=s),s}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function Uo(l){return l instanceof Os}class Ki extends Sl{constructor(i,s,h,N){super(i,s),this.format=h,this.style=N}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return wt(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 s=this.focus,h=i.isBefore(s),N=h?i:s;h=h?s:i,i=N.getNode(),s=h.getNode();let v=N.offset;return N=h.offset,Ze(i)&&(h=i.getDescendantByIndex(v),i=h??i),Ze(s)&&(h=s.getDescendantByIndex(N),h!==null&&h!==i&&s.getChildAtIndex(N)===h&&(h=h.getPreviousSibling()),s=h??s),i=i.is(s)?Ze(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(s),oi()||(this._cachedNodes=i),i}setTextNodeRange(i,s,h,N){Br(this.anchor,i.__key,s,"text"),Br(this.focus,h.__key,N,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let s=i[0],h=i[i.length-1],N=this.anchor,v=this.focus,M=N.isBefore(v),[J,ge]=zi(this),ve="",Fe=!0;for(let Ke=0;Ke<i.length;Ke++){let ke=i[Ke];if(Ze(ke)&&!ke.isInline())Fe||(ve+=`
61
61
  `),Fe=!ke.isEmpty();else if(Fe=!1,ht(ke)){let Me=ke.getTextContent();ke===s?ke===h?(N.type!=="element"||v.type!=="element"||v.offset===N.offset)&&(Me=J<ge?Me.slice(J,ge):Me.slice(ge,J)):Me=M?Me.slice(J):Me.slice(ge):ke===h&&(Me=M?Me.slice(0,ge):Me.slice(0,J)),ve+=Me}else!an(ke)&&!Ei(ke)||ke===h&&this.isCollapsed()||(ve+=ke.getTextContent())}return ve}applyDOMRange(i){let s=ln(),h=s.getEditorState()._selection;if(i=Tn(i.startContainer,i.startOffset,i.endContainer,i.endOffset,s,h),i!==null){var[N,v]=i;Br(this.anchor,N.key,N.offset,N.type),Br(this.focus,v.key,v.offset,v.type),this._cachedNodes=null}}clone(){let i=this.anchor,s=this.focus;return new Ki(new Dr(i.key,i.offset,i.type),new Dr(s.key,s.offset,s.type),this.format,this.style)}toggleFormat(i){this.format=Ot(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 s=[],h=i.length;for(let N=0;N<h;N++){let v=i[N];v===`
62
62
  `||v===`\r
63
- `?s.push($r()):v===" "?s.push(Wi()):s.push(Bn(v))}this.insertNodes(s)}insertText(i){var s=this.anchor,h=this.focus,N=this.isCollapsed()||s.isBefore(h),v=this.format,M=this.style;N&&s.type==="element"?fo(s,h,v,M):N||h.type!=="element"||fo(h,s,v,M);var J=this.getNodes(),ge=J.length,ve=N?h:s;h=(N?s:h).offset;var Fe=ve.offset;s=J[0],ht(s)||Y(26),N=s.getTextContent().length;var Ke=s.getParentOrThrow(),ke=J[ge-1];if(this.isCollapsed()&&h===N&&(s.isSegmented()||s.isToken()||!s.canInsertTextAfter()||!Ke.canInsertTextAfter()&&s.getNextSibling()===null)){var Me=s.getNextSibling();if(ht(Me)&&Me.canInsertTextBefore()&&!Et(Me)||(Me=Bn(),Me.setFormat(v),Ke.canInsertTextAfter()?s.insertAfter(Me):Ke.insertAfter(Me)),Me.select(0,0),s=Me,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&h===0&&(s.isSegmented()||s.isToken()||!s.canInsertTextBefore()||!Ke.canInsertTextBefore()&&s.getPreviousSibling()===null)){if(Me=s.getPreviousSibling(),(!ht(Me)||Et(Me))&&(Me=Bn(),Me.setFormat(v),Ke.canInsertTextBefore()?s.insertBefore(Me):Ke.insertBefore(Me)),Me.select(),s=Me,i!==""){this.insertText(i);return}}else if(s.isSegmented()&&h!==N)Ke=Bn(s.getTextContent()),Ke.setFormat(v),s.replace(Ke),s=Ke;else if(!(this.isCollapsed()||i===""||(Me=ke.getParent(),Ke.canInsertTextBefore()&&Ke.canInsertTextAfter()&&(!Ze(Me)||Me.canInsertTextBefore()&&Me.canInsertTextAfter())))){this.insertText(""),va(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(s.isToken())i=Bn(i),i.select(),s.replace(i);else{if(J=s.getFormat(),ge=s.getStyle(),h===Fe&&(J!==v||ge!==M))if(s.getTextContent()==="")s.setFormat(v),s.setStyle(M);else{J=Bn(i),J.setFormat(v),J.setStyle(M),J.select(),h===0?s.insertBefore(J,!1):([ge]=s.splitText(h),ge.insertAfter(J,!1)),J.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(xa(s)){i=Bn(i),i.setFormat(v),i.setStyle(M),i.select(),s.replace(i);return}s=s.spliceText(h,Fe-h,i,!0),s.getTextContent()===""?s.remove():this.anchor.type==="text"&&(s.isComposing()?this.anchor.offset-=i.length:(this.format=J,this.style=ge))}else{if(v=new Set([...s.getParentKeys(),...ke.getParentKeys()]),Me=Ze(s)?s:s.getParentOrThrow(),M=Ze(ke)?ke:ke.getParentOrThrow(),Ke=ke,!Me.is(M)&&M.isInline())do Ke=M,M=M.getParentOrThrow();while(M.isInline());if(ve.type==="text"&&(Fe!==0||ke.getTextContent()==="")||ve.type==="element"&&ke.getIndexWithinParent()<Fe)if(ht(ke)&&!ke.isToken()&&Fe!==ke.getTextContentSize()){if(ke.isSegmented()){var Xe=Bn(ke.getTextContent());ke.replace(Xe),ke=Xe}tr(ve.getNode())||ve.type!=="text"||(ke=ke.spliceText(0,Fe,"")),v.add(ke.__key)}else ve=ke.getParentOrThrow(),ve.canBeEmpty()||ve.getChildrenSize()!==1?ke.remove():ve.remove();else v.add(ke.__key);for(ve=M.getChildren(),Fe=new Set(J),ke=Me.is(M),Me=Me.isInline()&&s.getNextSibling()===null?Me:s,Xe=ve.length-1;0<=Xe;Xe--){let ut=ve[Xe];if(ut.is(s)||Ze(ut)&&ut.isParentOf(s))break;ut.isAttached()&&(!Fe.has(ut)||ut.is(Ke)?ke||Me.insertAfter(ut,!1):ut.remove())}if(!ke)for(ve=M,M=null;ve!==null;)Fe=ve.getChildren(),ke=Fe.length,(ke===0||Fe[ke-1].is(M))&&(v.delete(ve.__key),M=ve),ve=ve.getParent();for(s.isToken()?h===N?s.select():(i=Bn(i),i.select(),s.replace(i)):(s=s.spliceText(h,N-h,i,!0),s.getTextContent()===""?s.remove():s.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)s=J[i],v.has(s.__key)||s.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),bt(null);else{var s=this.getNodes(),h=[];for(var N of s)ht(N)&&h.push(N);var v=h.length;if(v===0)this.toggleFormat(i),bt(null);else{N=this.anchor;var M=this.focus,J=this.isBackward();s=J?M:N,N=J?N:M;var ge=0,ve=h[0];if(M=s.type==="element"?0:s.offset,s.type==="text"&&M===ve.getTextContentSize()&&(ge=1,ve=h[1],M=0),ve!=null){J=ve.getFormatFlags(i,null);var Fe=v-1,Ke=h[Fe];if(v=N.type==="text"?N.offset:Ke.getTextContentSize(),ve.is(Ke))M!==v&&(M===0&&v===ve.getTextContentSize()?ve.setFormat(J):(i=ve.splitText(M,v),i=M===0?i[0]:i[1],i.setFormat(J),s.type==="text"&&s.set(i.__key,0,"text"),N.type==="text"&&N.set(i.__key,v-M,"text")),this.format=J);else{M!==0&&([,ve]=ve.splitText(M),M=0),ve.setFormat(J);var ke=Ke.getFormatFlags(i,J);for(0<v&&(v!==Ke.getTextContentSize()&&([Ke]=Ke.splitText(v)),Ke.setFormat(ke)),ge+=1;ge<Fe;ge++){let Me=h[ge];if(!Me.isToken()){let Xe=Me.getFormatFlags(i,ke);Me.setFormat(Xe)}}s.type==="text"&&s.set(ve.__key,M,"text"),N.type==="text"&&N.set(Ke.__key,v,"text"),this.format=J|ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var s=Vt();if(!wt(s))throw Error("Expected RangeSelection after insertParagraph");return s.insertNodes(i)}var h=Lo(this.anchor.getNode(),Qr);if(s=i[i.length-1],"__language"in h)if("__language"in i[0])this.insertText(i[0].getTextContent());else{var N=Vo(this);h.splice(N,0,i),s.selectEnd()}else if(i.some(J=>(Ze(J)||an(J))&&!J.isInline())){s=qo(i),i=s.getLastDescendant();var v=s.getChildren();s=Ze(h)&&h.isEmpty()?null:this.insertParagraph(),N=v[v.length-1];var M=v[0];(J=>Ze(J)&&Qr(J)&&!J.isEmpty()&&Ze(h)&&(!h.isEmpty()||"__value"in h&&"__checked"in h))(M)&&(h.append(...M.getChildren()),M=v[1]),M&&Ca(h,M),v=Lo(i,Qr),s&&Ze(v)&&("__value"in s&&"__checked"in s||Qr(N))&&(v.append(...s.getChildren()),s.remove()),Ze(h)&&h.isEmpty()&&h.remove(),i.selectEnd(),i=Ze(h)?h.getLastChild():null,Ei(i)&&v!==h&&i.remove()}else N=Vo(this),h.splice(N,0,i),s.selectEnd()}}insertParagraph(){if(this.anchor.key==="root"){var i=lr();return fn().splice(this.anchor.offset,0,[i]),i.select(),i}var s=Vo(this);return i=Lo(this.anchor.getNode(),Qr),s=(s=i.getChildAtIndex(s))?[s,...s.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...s),i.selectStart(),i):null}insertLineBreak(i){var s=$r();this.insertNodes([s]),i&&(i=s.getParentOrThrow(),s=s.getIndexWithinParent(),i.select(s,s))}extract(){var i=this.getNodes(),s=i.length,h=s-1,N=this.anchor;let v=this.focus;var M=i[0];let J=i[h],[ge,ve]=zi(this);return s===0?[]:s===1?ht(M)&&!this.isCollapsed()?(i=ge>ve?ve:ge,h=M.splitText(i,ge>ve?ge:ve),i=i===0?h[0]:h[1],i!=null?[i]:[]):[M]:(s=N.isBefore(v),ht(M)&&(N=s?ge:ve,N===M.getTextContentSize()?i.shift():N!==0&&([,M]=M.splitText(N),i[0]=M)),ht(J)&&(M=J.getTextContent().length,s=s?ve:ge,s===0?i.pop():s!==M&&([J]=J.splitText(s),i[h]=J)),i)}modify(i,s,h){var N=this.focus,v=this.anchor,M=i==="move",J=mn(N,s);if(an(J)&&!J.isIsolated())M&&J.isKeyboardSelectable()?(s=Mr(),s.add(J.__key),gr(s)):(i=s?J.getPreviousSibling():J.getNextSibling(),ht(i)?(J=i.__key,s=s?i.getTextContent().length:0,N.set(J,s,"text"),M&&v.set(J,s,"text")):(h=J.getParentOrThrow(),Ze(i)?(h=i.__key,J=s?i.getChildrenSize():0):(J=J.getIndexWithinParent(),h=h.__key,s||J++),N.set(h,J,"element"),M&&v.set(h,J,"element")));else if(v=ln(),N=kr(v._window)){var ge=v._blockCursorElement,ve=v._rootElement;if(ve===null||ge===null||!Ze(J)||J.isInline()||J.canBeEmpty()||fl(ge,v,ve),N.modify(i,s?"backward":"forward",h),0<N.rangeCount&&(J=N.getRangeAt(0),v=this.anchor.getNode(),v=tr(v)?v:cl(v),this.applyDOMRange(J),this.dirty=!0,!M)){for(M=this.getNodes(),i=[],h=!1,ge=0;ge<M.length;ge++)ve=M[ge],mi(ve,v)?i.push(ve):h=!0;h&&0<i.length&&(s?(s=i[0],Ze(s)?s.selectStart():s.getParentOrThrow().selectStart()):(s=i[i.length-1],Ze(s)?s.selectEnd():s.getParentOrThrow().selectEnd())),(N.anchorNode!==J.startContainer||N.anchorOffset!==J.startOffset)&&(s=this.focus,M=this.anchor,N=M.key,J=M.offset,v=M.type,Br(M,s.key,s.offset,s.type),Br(s,N,J,v),this._cachedNodes=null)}}}deleteCharacter(i){let s=this.isCollapsed();if(this.isCollapsed()){var h=this.anchor,N=this.focus,v=h.getNode();if(!i&&(h.type==="element"&&Ze(v)&&h.offset===v.getChildrenSize()||h.type==="text"&&h.offset===v.getTextContentSize())){var M=v.getParent();if(M=v.getNextSibling()||(M===null?null:M.getNextSibling()),Ze(M)&&M.isShadowRoot())return}if(M=mn(N,i),an(M)&&!M.isIsolated()){M.isKeyboardSelectable()&&Ze(v)&&v.getChildrenSize()===0?(v.remove(),i=Mr(),i.add(M.__key),gr(i)):(M.remove(),ln().dispatchCommand(t,void 0));return}if(!i&&Ze(M)&&Ze(v)&&v.isEmpty()){v.remove(),M.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(M=N.type==="text"?N.getNode():null,v=h.type==="text"?h.getNode():null,M!==null&&M.isSegmented()){if(h=N.offset,N=M.getTextContentSize(),M.is(v)||i&&h!==N||!i&&h!==0){Ds(M,i,h);return}}else if(v!==null&&v.isSegmented()&&(h=h.offset,N=v.getTextContentSize(),v.is(M)||i&&h!==0||!i&&h!==N)){Ds(v,i,h);return}if(v=this.anchor,M=this.focus,h=v.getNode(),N=M.getNode(),h===N&&v.type==="text"&&M.type==="text"){var J=v.offset,ge=M.offset;let ve=J<ge;N=ve?J:ge,ge=ve?ge:J,J=ge-1,N!==J&&(h=h.getTextContent().slice(N,ge),ms(h)||(i?M.offset=J:v.offset=J))}}}this.removeText(),i&&!s&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&tr(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 Go(l){return l instanceof ho}function Yo(l){let i=l.offset;return l.type==="text"?i:(l=l.getNode(),i===l.getChildrenSize()?l.getTextContent().length:0)}function zi(l){let i=l.anchor;return l=l.focus,i.type==="element"&&l.type==="element"&&i.key===l.key&&i.offset===l.offset?[0,0]:[Yo(i),Yo(l)]}function Ds(l,i,s){let h=l.getTextContent().split(/(?=\s)/g),N=h.length,v=0,M=0;for(let J=0;J<N;J++){let ge=h[J],ve=J===N-1;if(M=v,v+=ge.length,i&&v===s||v>s||ve){h.splice(J,1),ve&&(M=void 0);break}}i=h.join("").trim(),i===""?l.remove():(l.setTextContent(i),l.select(M,M))}function Sa(l,i,s,h){var N=i;if(l.nodeType===1){let J=!1;var v=l.childNodes,M=v.length;N===M&&(J=!0,N=M-1);let ge=v[N];if(M=!1,ge===h._blockCursorElement?(ge=v[N+1],M=!0):h._blockCursorElement!==null&&N--,h=Jr(ge),ht(h))N=J?h.getTextContentSize():0;else{if(v=Jr(l),v===null)return null;if(Ze(v)?(l=v.getChildAtIndex(N),(i=Ze(l))&&(i=l.getParent(),i=s===null||i===null||!i.canBeEmpty()||i!==s.getNode()),i&&(s=J?l.getLastDescendant():l.getFirstDescendant(),s===null?(v=l,N=0):(l=s,v=Ze(l)?l:l.getParentOrThrow())),ht(l)?(h=l,v=null,N=J?l.getTextContentSize():0):l!==v&&J&&!M&&N++):(N=v.getIndexWithinParent(),N=i===0&&an(v)&&Jr(l)===v?N:N+1,v=v.getParentOrThrow()),Ze(v))return new Dr(v.__key,N,"element")}}else h=Jr(l);return ht(h)?new Dr(h.__key,N,"text"):null}function wl(l,i,s){var h=l.offset,N=l.getNode();h===0?(h=N.getPreviousSibling(),N=N.getParent(),i?(s||!i)&&h===null&&Ze(N)&&N.isInline()&&(i=N.getPreviousSibling(),ht(i)&&(l.key=i.__key,l.offset=i.getTextContent().length)):Ze(h)&&!s&&h.isInline()?(l.key=h.__key,l.offset=h.getChildrenSize(),l.type="element"):ht(h)&&(l.key=h.__key,l.offset=h.getTextContent().length)):h===N.getTextContent().length&&(h=N.getNextSibling(),N=N.getParent(),i&&Ze(h)&&h.isInline()?(l.key=h.__key,l.offset=0,l.type="element"):(s||i)&&h===null&&Ze(N)&&N.isInline()&&!N.canInsertTextAfter()&&(i=N.getNextSibling(),ht(i)&&(l.key=i.__key,l.offset=0)))}function va(l,i,s){if(l.type==="text"&&i.type==="text"){var h=l.isBefore(i);let N=l.is(i);wl(l,h,N),wl(i,!h,N),N&&(i.key=l.key,i.offset=l.offset,i.type=l.type),h=ln(),h.isComposing()&&h._compositionKey!==l.key&&wt(s)&&(h=s.anchor,s=s.focus,Br(l,h.key,h.offset,h.type),Br(i,s.key,s.offset,s.type))}}function Tn(l,i,s,h,N,v){return l===null||s===null||!rt(N,l,s)||(i=Sa(l,i,wt(v)?v.anchor:null,N),i===null)||(h=Sa(s,h,wt(v)?v.focus:null,N),h===null||i.type==="element"&&h.type==="element"&&(l=Jr(l),s=Jr(s),an(l)&&an(s)))?null:(va(i,h,v),[i,h])}function Gn(l,i,s,h,N,v){let M=yr();return l=new Ki(new Dr(l,i,N),new Dr(s,h,v),0,""),l.dirty=!0,M._selection=l}function Mr(){return new ho(new Set)}function xi(l){let i=l.getEditorState()._selection,s=kr(l._window);return wt(i)||i==null?Hn(i,s,l):i.clone()}function Hn(l,i,s){var h=s._window;if(h===null)return null;var N=h.event,v=N?N.type:void 0;h=v==="selectionchange",N=!ct&&(h||v==="beforeinput"||v==="compositionstart"||v==="compositionend"||v==="click"&&N&&N.detail===3||v==="drop"||v===void 0);let M;if(!wt(l)||N){if(i===null)return null;if(N=i.anchorNode,v=i.focusNode,M=i.anchorOffset,i=i.focusOffset,h&&wt(l)&&!rt(s,N,v))return l.clone()}else return l.clone();if(s=Tn(N,M,v,i,s,l),s===null)return null;let[J,ge]=s;return new Ki(J,ge,wt(l)?l.format:0,wt(l)?l.style:"")}function Vt(){return yr()._selection}function Ui(){return ln()._editorState._selection}function go(l,i,s,h=1){var N=l.anchor,v=l.focus,M=N.getNode(),J=v.getNode();if(i.is(M)||i.is(J)){if(M=i.__key,l.isCollapsed())i=N.offset,(s<=i&&0<h||s<i&&0>h)&&(s=Math.max(0,i+h),N.set(M,s,"element"),v.set(M,s,"element"),jo(l));else{let ve=l.isBackward();J=ve?v:N;var ge=J.getNode();N=ve?N:v,v=N.getNode(),i.is(ge)&&(ge=J.offset,(s<=ge&&0<h||s<ge&&0>h)&&J.set(M,Math.max(0,ge+h),"element")),i.is(v)&&(i=N.offset,(s<=i&&0<h||s<i&&0>h)&&N.set(M,Math.max(0,i+h),"element"))}jo(l)}}function jo(l){var i=l.anchor,s=i.offset;let h=l.focus;var N=h.offset,v=i.getNode(),M=h.getNode();if(l.isCollapsed())Ze(v)&&(M=v.getChildrenSize(),M=(N=s>=M)?v.getChildAtIndex(M-1):v.getChildAtIndex(s),ht(M)&&(s=0,N&&(s=M.getTextContentSize()),i.set(M.__key,s,"text"),h.set(M.__key,s,"text")));else{if(Ze(v)){let J=v.getChildrenSize();s=(l=s>=J)?v.getChildAtIndex(J-1):v.getChildAtIndex(s),ht(s)&&(v=0,l&&(v=s.getTextContentSize()),i.set(s.__key,v,"text"))}Ze(M)&&(s=M.getChildrenSize(),N=(i=N>=s)?M.getChildAtIndex(s-1):M.getChildAtIndex(N),ht(N)&&(M=0,i&&(M=N.getTextContentSize()),h.set(N.__key,M,"text")))}}function Ms(l,i){if(i=i.getEditorState()._selection,l=l._selection,wt(l)){var s=l.anchor;let h=l.focus,N;s.type==="text"&&(N=s.getNode(),N.selectionTransform(i,l)),h.type==="text"&&(s=h.getNode(),N!==s&&s.selectionTransform(i,l))}}function po(l,i,s,h,N){let v=null,M=0,J=null;h!==null?(v=h.__key,ht(h)?(M=h.getTextContentSize(),J="text"):Ze(h)&&(M=h.getChildrenSize(),J="element")):N!==null&&(v=N.__key,ht(N)?J="text":Ze(N)&&(J="element")),v!==null&&J!==null?l.set(v,M,J):(M=i.getIndexWithinParent(),M===-1&&(M=s.getChildrenSize()),l.set(s.__key,M,"element"))}function As(l,i,s,h,N){l.type==="text"?(l.key=s,i||(l.offset+=N)):l.offset>h.getIndexWithinParent()&&--l.offset}function Si(l,i,s){let h=[],N=null,v=null;l=l.getChildren();for(let Fe=0;Fe<l.length;Fe++){var M=l[Fe];Jo(M)||Y(108);var J=M.getChildren();M=0;for(let Ke of J){for(Nr(Ke)||Y(109);h[Fe]!==void 0&&h[Fe][M]!==void 0;)M++;J=Fe;var ge=M,ve=Ke;let ke={cell:ve,startColumn:ge,startRow:J},Me=ve.__rowSpan,Xe=ve.__colSpan;for(let ut=0;ut<Me;ut++){h[J+ut]===void 0&&(h[J+ut]=[]);for(let Tt=0;Tt<Xe;Tt++)h[J+ut][ge+Tt]=ke}i.is(ve)&&(N=ke),s.is(ve)&&(v=ke),M+=Ke.__colSpan}}return N===null&&Y(110),v===null&&Y(111),[h,N,v]}function ii(l){l instanceof Ls||(l instanceof ni?(l=ys(l,Nr),Nr(l)||Y(114)):(l=ys(l.getNode(),Nr),Nr(l)||Y(114)));let i=l.getParent();Jo(i)||Y(115);let s=i.getParent();return ks(s)||Y(116),[l,i,s]}function Vo(l){l.isCollapsed()||l.removeText();var i=l.anchor,s=i.getNode();if(!ht(s))return i.offset;let h=s.getParent();return h?(s=s.splitText(i.offset),s.length===0?0:(i=i.offset===0?0:1,s=s[0].getIndexWithinParent()+i,!h.isInline()||s===0?s:((s=h.getChildAtIndex(s))&&h.insertNewAfter(l).append(s,...s.getNextSiblings()),h.getIndexWithinParent()+i))):(l=lr(),fn().append(l),l.select(),0)}function qo(l){let i=lr(),s=null;for(let h=0;h<l.length;h++){let N=l[h],v=Ei(N);if(v||an(N)&&N.isInline()||Ze(N)&&N.isInline()||ht(N)||N.isParentRequired()){if(s===null&&(s=N.createParentElementNode(),i.append(s),v))continue;s!==null&&s.append(N)}else i.append(N),s=null}return i}let yn=null,xn=null,Sn=!1,Ol=!1,mo=0,Dl={characterData:!0,childList:!0,subtree:!0};function oi(){return Sn||yn!==null&&yn._readOnly}function Jn(){Sn&&Y(13)}function yr(){return yn===null&&Y(15),yn}function ln(){return xn===null&&Y(16),xn}function Ml(l,i,s){var h=i.__type;let N=l._nodes.get(h);for(N===void 0&&Y(30,h),l=s.get(h),l===void 0&&(l=Array.from(N.transforms),s.set(h,l)),s=l.length,h=0;h<s&&(l[h](i),i.isAttached());h++);}function wa(l,i){i=i._dirtyLeaves,l=l._nodeMap;for(let s of i)i=l.get(s),ht(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&qe(i)}function bc(l,i){let s=i._dirtyLeaves,h=i._dirtyElements;l=l._nodeMap;let N=Ut(),v=new Map;var M=s;let J=M.size;for(var ge=h,ve=ge.size;0<J||0<ve;){if(0<J){i._dirtyLeaves=new Set;for(let Fe of M)M=l.get(Fe),ht(M)&&M.isAttached()&&M.isSimpleText()&&!M.isUnmergeable()&&qe(M),M!==void 0&&M!==void 0&&M.__key!==N&&M.isAttached()&&Ml(i,M,v),s.add(Fe);if(M=i._dirtyLeaves,J=M.size,0<J){mo++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Fe of ge)ge=Fe[0],ve=Fe[1],(ge==="root"||ve)&&(M=l.get(ge),M!==void 0&&M!==void 0&&M.__key!==N&&M.isAttached()&&Ml(i,M,v),h.set(ge,ve));M=i._dirtyLeaves,J=M.size,ge=i._dirtyElements,ve=ge.size,mo++}i._dirtyLeaves=s,i._dirtyElements=h}function _o(l,i){var s=l.type,h=i.get(s);if(h===void 0&&Y(17,s),s=h.klass,l.type!==s.getType()&&Y(18,s.name),s=s.importJSON(l),l=l.children,Ze(s)&&Array.isArray(l))for(h=0;h<l.length;h++){let N=_o(l[h],i);s.append(N)}return s}function Oa(l,i){let s=yn,h=Sn,N=xn;yn=l,Sn=!0,xn=null;try{return i()}finally{yn=s,Sn=h,xn=N}}function Ar(l,i){let s=l._pendingEditorState,h=l._rootElement,N=l._headless||h===null;if(s!==null){var v=l._editorState,M=v._selection,J=s._selection,ge=l._dirtyType!==0,ve=yn,Fe=Sn,Ke=xn,ke=l._updating,Me=l._observer,Xe=null;if(l._pendingEditorState=null,l._editorState=s,!N&&ge&&Me!==null){xn=l,yn=s,Sn=!1,l._updating=!0;try{let rn=l._dirtyType,kn=l._dirtyElements,pt=l._dirtyLeaves;Me.disconnect();var ut=rn,Tt=kn,At=pt;Ln=wr=On="",yi=ut===2,_n=null,Fn=l,_i=l._config,ko=l._nodes,Ns=Fn._listeners.mutation,Ir=Tt,En=At,Ni=v._nodeMap,mr=s._nodeMap,oo=s._readOnly,Cs=new Map(l._keyToDOMMap);let Cr=new Map;so=Cr,lo("root",null),so=Cs=_i=mr=Ni=En=Ir=ko=Fn=void 0,Xe=Cr}catch(rn){if(rn instanceof Error&&l._onError(rn),Ol)throw rn;Al(l,null,h,s),Re(l),l._dirtyType=2,Ol=!0,Ar(l,v),Ol=!1;return}finally{Me.observe(h,Dl),l._updating=ke,yn=ve,Sn=Fe,xn=Ke}}s._readOnly||(s._readOnly=!0);var hn=l._dirtyLeaves,ar=l._dirtyElements,Wr=l._normalizedNodes,si=l._updateTags,Oi=l._deferred;ge&&(l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements=new Map,l._normalizedNodes=new Set,l._updateTags=new Set);var Di=l._decorators,Eo=l._pendingDecorators||Di,Rl=s._nodeMap,Is;for(Is in Eo)Rl.has(Is)||(Eo===Di&&(Eo=Fi(l)),delete Eo[Is]);var Kr=N?null:kr(l._window);if(l._editable&&Kr!==null&&(ge||J===null||J.dirty)){xn=l,yn=s;try{if(Me!==null&&Me.disconnect(),ge||J===null||J.dirty){let rn=l._blockCursorElement;rn!==null&&fl(rn,l,h);e:{let kn=Kr.anchorNode,pt=Kr.focusNode,Cr=Kr.anchorOffset,ji=Kr.focusOffset,Qn=document.activeElement;if(!(si.has("collaboration")&&Qn!==h||Qn!==null&&Ve(Qn)))if(wt(J)){var To=J.anchor,Ps=J.focus,Xo=To.key,Gi=Ps.key,Ia=$n(l,Xo),Pa=$n(l,Gi),Qo=To.offset,$a=Ps.offset,bl=J.format,Ll=J.style,Fa=J.isCollapsed(),xo=Ia,$s=Pa,zr=!1;if(To.type==="text"){xo=vt(Ia);let cr=To.getNode();zr=cr.getFormat()!==bl||cr.getStyle()!==Ll}else wt(M)&&M.anchor.type==="text"&&(zr=!0);if(Ps.type==="text"&&($s=vt(Pa)),xo!==null&&$s!==null){if(Fa&&(M===null||zr||wt(M)&&(M.format!==bl||M.style!==Ll))){var Wn=performance.now();da=[bl,Ll,Qo,Xo,Wn]}if(Cr===Qo&&ji===$a&&kn===xo&&pt===$s&&(Kr.type!=="Range"||!Fa)&&(Qn!==null&&h.contains(Qn)||h.focus({preventScroll:!0}),To.type!=="element"))break e;try{Kr.setBaseAndExtent(xo,Qo,$s,$a)}catch{}if(!si.has("skip-scroll-into-view")&&J.isCollapsed()&&h!==null&&h===document.activeElement){let cr=J instanceof Ki&&J.anchor.type==="element"?xo.childNodes[Qo]||null:0<Kr.rangeCount?Kr.getRangeAt(0):null;if(cr!==null){let In;if(cr instanceof Text){let er=document.createRange();er.selectNode(cr),In=er.getBoundingClientRect()}else In=cr.getBoundingClientRect();let Er=h.ownerDocument,Ri=Er.defaultView;if(Ri!==null)for(var{top:gt,bottom:Mi}=In,Yi,es,Ai=h;Ai!==null;){let er=Ai===Er.body;if(er)Yi=0,es=qn(l).innerHeight;else{let Fs=Ai.getBoundingClientRect();Yi=Fs.top,es=Fs.bottom}let Vi=0;if(gt<Yi?Vi=-(Yi-gt):Mi>es&&(Vi=Mi-es),Vi!==0)if(er)Ri.scrollBy(0,Vi);else{let Fs=Ai.scrollTop;Ai.scrollTop+=Vi;let Ha=Ai.scrollTop-Fs;gt-=Ha,Mi-=Ha}if(er)break;Ai=pr(Ai)}}}_l=!0}}else M!==null&&rt(l,kn,pt)&&Kr.removeAllRanges()}}e:{let rn=l._blockCursorElement;if(wt(J)&&J.isCollapsed()&&J.anchor.type==="element"&&h.contains(document.activeElement)){let kn=J.anchor,pt=kn.getNode(),Cr=kn.offset,ji=pt.getChildrenSize(),Qn=!1,cr=null;if(Cr===ji){let In=pt.getChildAtIndex(Cr-1);dl(In)&&(Qn=!0)}else{let In=pt.getChildAtIndex(Cr);if(dl(In)){let Er=In.getPreviousSibling();(Er===null||dl(Er))&&(Qn=!0,cr=l.getElementByKey(In.__key))}}if(Qn){let In=l.getElementByKey(pt.__key);if(rn===null){let Er=l._config.theme,Ri=document.createElement("div");Ri.contentEditable="false",Ri.setAttribute("data-lexical-cursor","true");let er=Er.blockCursor;if(er!==void 0){if(typeof er=="string"){let Vi=er.split(" ");er=Er.blockCursor=Vi}er!==void 0&&Ri.classList.add(...er)}l._blockCursorElement=rn=Ri}h.style.caretColor="transparent",cr===null?In.appendChild(rn):In.insertBefore(rn,cr);break e}}rn!==null&&fl(rn,l,h)}Me!==null&&Me.observe(h,Dl)}finally{xn=Ke,yn=ve}}if(Xe!==null){var Ur=Xe;let rn=Array.from(l._listeners.mutation),kn=rn.length;for(let pt=0;pt<kn;pt++){let[Cr,ji]=rn[pt],Qn=Ur.get(ji);Qn!==void 0&&Cr(Qn,{dirtyLeaves:hn,prevEditorState:v,updateTags:si})}}wt(J)||J===null||M!==null&&M.is(J)||l.dispatchCommand(t,void 0);var ts=l._pendingDecorators;ts!==null&&(l._decorators=ts,l._pendingDecorators=null,yo("decorator",l,!0,ts));var Ba=gs(i||v),kl=gs(s);if(Ba!==kl&&yo("textcontent",l,!0,kl),yo("update",l,!0,{dirtyElements:ar,dirtyLeaves:hn,editorState:s,normalizedNodes:Wr,prevEditorState:i||v,tags:si}),l._deferred=[],Oi.length!==0){let rn=l._updating;l._updating=!0;try{for(let kn=0;kn<Oi.length;kn++)Oi[kn]()}finally{l._updating=rn}}var li=l._updates;if(li.length!==0){let rn=li.shift();if(rn){let[kn,pt]=rn;Da(l,kn,pt)}}}}function yo(l,i,s,...h){let N=i._updating;i._updating=s;try{let v=Array.from(i._listeners[l]);for(l=0;l<v.length;l++)v[l].apply(null,h)}finally{i._updating=N}}function ot(l,i,s){if(l._updating===!1||xn!==l){let v=!1;return l.update(()=>{v=ot(l,i,s)}),v}let h=ye(l);for(let v=4;0<=v;v--)for(let M=0;M<h.length;M++){var N=h[M]._commands.get(i);if(N!==void 0&&(N=N[v],N!==void 0)){N=Array.from(N);let J=N.length;for(let ge=0;ge<J;ge++)if(N[ge](s,l)===!0)return!0}}return!1}function Rs(l,i){let s=l._updates;for(i=i||!1;s.length!==0;){var h=s.shift();if(h){let[N,v]=h,M;v!==void 0&&(h=v.onUpdate,M=v.tag,v.skipTransforms&&(i=!0),h&&l._deferred.push(h),M&&l._updateTags.add(M)),N()}}return i}function Da(l,i,s){let h=l._updateTags;var N,v=N=!1;if(s!==void 0){var M=s.onUpdate;N=s.tag,N!=null&&h.add(N),N=s.skipTransforms||!1,v=s.discrete||!1}M&&l._deferred.push(M),s=l._editorState,M=l._pendingEditorState;let J=!1;(M===null||M._readOnly)&&(M=l._pendingEditorState=new Co(new Map((M||s)._nodeMap)),J=!0),M._flushSync=v,v=yn;let ge=Sn,ve=xn,Fe=l._updating;yn=M,Sn=!1,l._updating=!0,xn=l;try{J&&(l._headless?s._selection!=null&&(M._selection=s._selection.clone()):M._selection=xi(l));let Ke=l._compositionKey;i(),N=Rs(l,N),Ms(M,l),l._dirtyType!==0&&(N?wa(M,l):bc(M,l),Rs(l),hl(s,M,l._dirtyLeaves,l._dirtyElements)),Ke!==l._compositionKey&&(M._flushSync=!0);let ke=M._selection;if(wt(ke)){let Me=M._nodeMap,Xe=ke.focus.key;Me.get(ke.anchor.key)!==void 0&&Me.get(Xe)!==void 0||Y(19)}else Go(ke)&&ke._nodes.size===0&&(M._selection=null)}catch(Ke){Ke instanceof Error&&l._onError(Ke),l._pendingEditorState=s,l._dirtyType=2,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),Ar(l);return}finally{yn=v,Sn=ge,xn=ve,l._updating=Fe,mo=0}l._dirtyType!==0||Aa(M,l)?M._flushSync?(M._flushSync=!1,Ar(l)):J&&je(()=>{Ar(l)}):(M._flushSync=!1,J&&(h.clear(),l._deferred=[],l._pendingEditorState=null))}function sr(l,i,s){l._updating?l._updates.push([i,s]):Da(l,i,s)}class Ma extends ni{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function an(l){return l instanceof Ma}class Xn extends ni{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 Le[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getChildrenKeys(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s.__key),s=s.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=ln()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),s=this.getParentOrThrow().getLastChild();return s!==null&&s.is(i)}getAllTextNodes(){let i=[],s=this.getFirstChild();for(;s!==null;){if(ht(s)&&i.push(s),Ze(s)){let h=s.getAllTextNodes();i.push(...h)}s=s.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Ze(i)){let s=i.getFirstChild();if(s!==null){i=s;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Ze(i)){let s=i.getLastChild();if(s!==null){i=s;continue}}break}return i}getDescendantByIndex(i){let s=this.getChildren(),h=s.length;return i>=h?(i=s[h-1],Ze(i)&&i.getLastDescendant()||i||null):(i=s[i],Ze(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:It(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:It(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var s=this.getChildrenSize();let h;if(i<s/2){for(h=this.getFirstChild(),s=0;h!==null&&s<=i;){if(s===i)return h;h=h.getNextSibling(),s++}return null}for(h=this.getLastChild(),--s;h!==null&&s>=i;){if(s===i)return h;h=h.getPreviousSibling(),s--}return null}getTextContent(){let i="",s=this.getChildren(),h=s.length;for(let N=0;N<h;N++){let v=s[N];i+=v.getTextContent(),Ze(v)&&N!==h-1&&!v.isInline()&&(i+=`
63
+ `?s.push($r()):v===" "?s.push(Wi()):s.push(Bn(v))}this.insertNodes(s)}insertText(i){var s=this.anchor,h=this.focus,N=this.isCollapsed()||s.isBefore(h),v=this.format,M=this.style;N&&s.type==="element"?fo(s,h,v,M):N||h.type!=="element"||fo(h,s,v,M);var J=this.getNodes(),ge=J.length,ve=N?h:s;h=(N?s:h).offset;var Fe=ve.offset;s=J[0],ht(s)||Y(26),N=s.getTextContent().length;var Ke=s.getParentOrThrow(),ke=J[ge-1];if(this.isCollapsed()&&h===N&&(s.isSegmented()||s.isToken()||!s.canInsertTextAfter()||!Ke.canInsertTextAfter()&&s.getNextSibling()===null)){var Me=s.getNextSibling();if(ht(Me)&&Me.canInsertTextBefore()&&!Et(Me)||(Me=Bn(),Me.setFormat(v),Ke.canInsertTextAfter()?s.insertAfter(Me):Ke.insertAfter(Me)),Me.select(0,0),s=Me,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&h===0&&(s.isSegmented()||s.isToken()||!s.canInsertTextBefore()||!Ke.canInsertTextBefore()&&s.getPreviousSibling()===null)){if(Me=s.getPreviousSibling(),(!ht(Me)||Et(Me))&&(Me=Bn(),Me.setFormat(v),Ke.canInsertTextBefore()?s.insertBefore(Me):Ke.insertBefore(Me)),Me.select(),s=Me,i!==""){this.insertText(i);return}}else if(s.isSegmented()&&h!==N)Ke=Bn(s.getTextContent()),Ke.setFormat(v),s.replace(Ke),s=Ke;else if(!(this.isCollapsed()||i===""||(Me=ke.getParent(),Ke.canInsertTextBefore()&&Ke.canInsertTextAfter()&&(!Ze(Me)||Me.canInsertTextBefore()&&Me.canInsertTextAfter())))){this.insertText(""),va(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(s.isToken())i=Bn(i),i.select(),s.replace(i);else{if(J=s.getFormat(),ge=s.getStyle(),h===Fe&&(J!==v||ge!==M))if(s.getTextContent()==="")s.setFormat(v),s.setStyle(M);else{J=Bn(i),J.setFormat(v),J.setStyle(M),J.select(),h===0?s.insertBefore(J,!1):([ge]=s.splitText(h),ge.insertAfter(J,!1)),J.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(xa(s)){i=Bn(i),i.setFormat(v),i.setStyle(M),i.select(),s.replace(i);return}s=s.spliceText(h,Fe-h,i,!0),s.getTextContent()===""?s.remove():this.anchor.type==="text"&&(s.isComposing()?this.anchor.offset-=i.length:(this.format=J,this.style=ge))}else{if(v=new Set([...s.getParentKeys(),...ke.getParentKeys()]),Me=Ze(s)?s:s.getParentOrThrow(),M=Ze(ke)?ke:ke.getParentOrThrow(),Ke=ke,!Me.is(M)&&M.isInline())do Ke=M,M=M.getParentOrThrow();while(M.isInline());if(ve.type==="text"&&(Fe!==0||ke.getTextContent()==="")||ve.type==="element"&&ke.getIndexWithinParent()<Fe)if(ht(ke)&&!ke.isToken()&&Fe!==ke.getTextContentSize()){if(ke.isSegmented()){var Xe=Bn(ke.getTextContent());ke.replace(Xe),ke=Xe}tr(ve.getNode())||ve.type!=="text"||(ke=ke.spliceText(0,Fe,"")),v.add(ke.__key)}else ve=ke.getParentOrThrow(),ve.canBeEmpty()||ve.getChildrenSize()!==1?ke.remove():ve.remove();else v.add(ke.__key);for(ve=M.getChildren(),Fe=new Set(J),ke=Me.is(M),Me=Me.isInline()&&s.getNextSibling()===null?Me:s,Xe=ve.length-1;0<=Xe;Xe--){let ut=ve[Xe];if(ut.is(s)||Ze(ut)&&ut.isParentOf(s))break;ut.isAttached()&&(!Fe.has(ut)||ut.is(Ke)?ke||Me.insertAfter(ut,!1):ut.remove())}if(!ke)for(ve=M,M=null;ve!==null;)Fe=ve.getChildren(),ke=Fe.length,(ke===0||Fe[ke-1].is(M))&&(v.delete(ve.__key),M=ve),ve=ve.getParent();for(s.isToken()?h===N?s.select():(i=Bn(i),i.select(),s.replace(i)):(s=s.spliceText(h,N-h,i,!0),s.getTextContent()===""?s.remove():s.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)s=J[i],v.has(s.__key)||s.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),bt(null);else{var s=this.getNodes(),h=[];for(var N of s)ht(N)&&h.push(N);var v=h.length;if(v===0)this.toggleFormat(i),bt(null);else{N=this.anchor;var M=this.focus,J=this.isBackward();s=J?M:N,N=J?N:M;var ge=0,ve=h[0];if(M=s.type==="element"?0:s.offset,s.type==="text"&&M===ve.getTextContentSize()&&(ge=1,ve=h[1],M=0),ve!=null){J=ve.getFormatFlags(i,null);var Fe=v-1,Ke=h[Fe];if(v=N.type==="text"?N.offset:Ke.getTextContentSize(),ve.is(Ke))M!==v&&(M===0&&v===ve.getTextContentSize()?ve.setFormat(J):(i=ve.splitText(M,v),i=M===0?i[0]:i[1],i.setFormat(J),s.type==="text"&&s.set(i.__key,0,"text"),N.type==="text"&&N.set(i.__key,v-M,"text")),this.format=J);else{M!==0&&([,ve]=ve.splitText(M),M=0),ve.setFormat(J);var ke=Ke.getFormatFlags(i,J);for(0<v&&(v!==Ke.getTextContentSize()&&([Ke]=Ke.splitText(v)),Ke.setFormat(ke)),ge+=1;ge<Fe;ge++){let Me=h[ge];if(!Me.isToken()){let Xe=Me.getFormatFlags(i,ke);Me.setFormat(Xe)}}s.type==="text"&&s.set(ve.__key,M,"text"),N.type==="text"&&N.set(Ke.__key,v,"text"),this.format=J|ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var s=Vt();if(!wt(s))throw Error("Expected RangeSelection after insertParagraph");return s.insertNodes(i)}var h=Lo(this.anchor.getNode(),Qr);if(s=i[i.length-1],"__language"in h)if("__language"in i[0])this.insertText(i[0].getTextContent());else{var N=Vo(this);h.splice(N,0,i),s.selectEnd()}else if(i.some(J=>(Ze(J)||an(J))&&!J.isInline())){s=qo(i),i=s.getLastDescendant();var v=s.getChildren();s=Ze(h)&&h.isEmpty()?null:this.insertParagraph(),N=v[v.length-1];var M=v[0];(J=>Ze(J)&&Qr(J)&&!J.isEmpty()&&Ze(h)&&(!h.isEmpty()||"__value"in h&&"__checked"in h))(M)&&(h.append(...M.getChildren()),M=v[1]),M&&Ca(h,M),v=Lo(i,Qr),s&&Ze(v)&&("__value"in s&&"__checked"in s||Qr(N))&&(v.append(...s.getChildren()),s.remove()),Ze(h)&&h.isEmpty()&&h.remove(),i.selectEnd(),i=Ze(h)?h.getLastChild():null,Ei(i)&&v!==h&&i.remove()}else N=Vo(this),h.splice(N,0,i),s.selectEnd()}}insertParagraph(){if(this.anchor.key==="root"){var i=lr();return fn().splice(this.anchor.offset,0,[i]),i.select(),i}var s=Vo(this);return i=Lo(this.anchor.getNode(),Qr),s=(s=i.getChildAtIndex(s))?[s,...s.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...s),i.selectStart(),i):null}insertLineBreak(i){var s=$r();this.insertNodes([s]),i&&(i=s.getParentOrThrow(),s=s.getIndexWithinParent(),i.select(s,s))}extract(){var i=this.getNodes(),s=i.length,h=s-1,N=this.anchor;let v=this.focus;var M=i[0];let J=i[h],[ge,ve]=zi(this);return s===0?[]:s===1?ht(M)&&!this.isCollapsed()?(i=ge>ve?ve:ge,h=M.splitText(i,ge>ve?ge:ve),i=i===0?h[0]:h[1],i!=null?[i]:[]):[M]:(s=N.isBefore(v),ht(M)&&(N=s?ge:ve,N===M.getTextContentSize()?i.shift():N!==0&&([,M]=M.splitText(N),i[0]=M)),ht(J)&&(M=J.getTextContent().length,s=s?ve:ge,s===0?i.pop():s!==M&&([J]=J.splitText(s),i[h]=J)),i)}modify(i,s,h){var N=this.focus,v=this.anchor,M=i==="move",J=mn(N,s);if(an(J)&&!J.isIsolated())M&&J.isKeyboardSelectable()?(s=Mr(),s.add(J.__key),gr(s)):(i=s?J.getPreviousSibling():J.getNextSibling(),ht(i)?(J=i.__key,s=s?i.getTextContent().length:0,N.set(J,s,"text"),M&&v.set(J,s,"text")):(h=J.getParentOrThrow(),Ze(i)?(h=i.__key,J=s?i.getChildrenSize():0):(J=J.getIndexWithinParent(),h=h.__key,s||J++),N.set(h,J,"element"),M&&v.set(h,J,"element")));else if(v=ln(),N=kr(v._window)){var ge=v._blockCursorElement,ve=v._rootElement;if(ve===null||ge===null||!Ze(J)||J.isInline()||J.canBeEmpty()||fl(ge,v,ve),N.modify(i,s?"backward":"forward",h),0<N.rangeCount&&(J=N.getRangeAt(0),v=this.anchor.getNode(),v=tr(v)?v:cl(v),this.applyDOMRange(J),this.dirty=!0,!M)){for(M=this.getNodes(),i=[],h=!1,ge=0;ge<M.length;ge++)ve=M[ge],mi(ve,v)?i.push(ve):h=!0;h&&0<i.length&&(s?(s=i[0],Ze(s)?s.selectStart():s.getParentOrThrow().selectStart()):(s=i[i.length-1],Ze(s)?s.selectEnd():s.getParentOrThrow().selectEnd())),(N.anchorNode!==J.startContainer||N.anchorOffset!==J.startOffset)&&(s=this.focus,M=this.anchor,N=M.key,J=M.offset,v=M.type,Br(M,s.key,s.offset,s.type),Br(s,N,J,v),this._cachedNodes=null)}}}deleteCharacter(i){let s=this.isCollapsed();if(this.isCollapsed()){var h=this.anchor,N=this.focus,v=h.getNode();if(!i&&(h.type==="element"&&Ze(v)&&h.offset===v.getChildrenSize()||h.type==="text"&&h.offset===v.getTextContentSize())){var M=v.getParent();if(M=v.getNextSibling()||(M===null?null:M.getNextSibling()),Ze(M)&&M.isShadowRoot())return}if(M=mn(N,i),an(M)&&!M.isIsolated()){M.isKeyboardSelectable()&&Ze(v)&&v.getChildrenSize()===0?(v.remove(),i=Mr(),i.add(M.__key),gr(i)):(M.remove(),ln().dispatchCommand(t,void 0));return}if(!i&&Ze(M)&&Ze(v)&&v.isEmpty()){v.remove(),M.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(M=N.type==="text"?N.getNode():null,v=h.type==="text"?h.getNode():null,M!==null&&M.isSegmented()){if(h=N.offset,N=M.getTextContentSize(),M.is(v)||i&&h!==N||!i&&h!==0){Ds(M,i,h);return}}else if(v!==null&&v.isSegmented()&&(h=h.offset,N=v.getTextContentSize(),v.is(M)||i&&h!==0||!i&&h!==N)){Ds(v,i,h);return}if(v=this.anchor,M=this.focus,h=v.getNode(),N=M.getNode(),h===N&&v.type==="text"&&M.type==="text"){var J=v.offset,ge=M.offset;let ve=J<ge;N=ve?J:ge,ge=ve?ge:J,J=ge-1,N!==J&&(h=h.getTextContent().slice(N,ge),ms(h)||(i?M.offset=J:v.offset=J))}}}this.removeText(),i&&!s&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&tr(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 Go(l){return l instanceof ho}function Yo(l){let i=l.offset;return l.type==="text"?i:(l=l.getNode(),i===l.getChildrenSize()?l.getTextContent().length:0)}function zi(l){let i=l.anchor;return l=l.focus,i.type==="element"&&l.type==="element"&&i.key===l.key&&i.offset===l.offset?[0,0]:[Yo(i),Yo(l)]}function Ds(l,i,s){let h=l.getTextContent().split(/(?=\s)/g),N=h.length,v=0,M=0;for(let J=0;J<N;J++){let ge=h[J],ve=J===N-1;if(M=v,v+=ge.length,i&&v===s||v>s||ve){h.splice(J,1),ve&&(M=void 0);break}}i=h.join("").trim(),i===""?l.remove():(l.setTextContent(i),l.select(M,M))}function Sa(l,i,s,h){var N=i;if(l.nodeType===1){let J=!1;var v=l.childNodes,M=v.length;N===M&&(J=!0,N=M-1);let ge=v[N];if(M=!1,ge===h._blockCursorElement?(ge=v[N+1],M=!0):h._blockCursorElement!==null&&N--,h=Jr(ge),ht(h))N=J?h.getTextContentSize():0;else{if(v=Jr(l),v===null)return null;if(Ze(v)?(l=v.getChildAtIndex(N),(i=Ze(l))&&(i=l.getParent(),i=s===null||i===null||!i.canBeEmpty()||i!==s.getNode()),i&&(s=J?l.getLastDescendant():l.getFirstDescendant(),s===null?(v=l,N=0):(l=s,v=Ze(l)?l:l.getParentOrThrow())),ht(l)?(h=l,v=null,N=J?l.getTextContentSize():0):l!==v&&J&&!M&&N++):(N=v.getIndexWithinParent(),N=i===0&&an(v)&&Jr(l)===v?N:N+1,v=v.getParentOrThrow()),Ze(v))return new Dr(v.__key,N,"element")}}else h=Jr(l);return ht(h)?new Dr(h.__key,N,"text"):null}function wl(l,i,s){var h=l.offset,N=l.getNode();h===0?(h=N.getPreviousSibling(),N=N.getParent(),i?(s||!i)&&h===null&&Ze(N)&&N.isInline()&&(i=N.getPreviousSibling(),ht(i)&&(l.key=i.__key,l.offset=i.getTextContent().length)):Ze(h)&&!s&&h.isInline()?(l.key=h.__key,l.offset=h.getChildrenSize(),l.type="element"):ht(h)&&(l.key=h.__key,l.offset=h.getTextContent().length)):h===N.getTextContent().length&&(h=N.getNextSibling(),N=N.getParent(),i&&Ze(h)&&h.isInline()?(l.key=h.__key,l.offset=0,l.type="element"):(s||i)&&h===null&&Ze(N)&&N.isInline()&&!N.canInsertTextAfter()&&(i=N.getNextSibling(),ht(i)&&(l.key=i.__key,l.offset=0)))}function va(l,i,s){if(l.type==="text"&&i.type==="text"){var h=l.isBefore(i);let N=l.is(i);wl(l,h,N),wl(i,!h,N),N&&(i.key=l.key,i.offset=l.offset,i.type=l.type),h=ln(),h.isComposing()&&h._compositionKey!==l.key&&wt(s)&&(h=s.anchor,s=s.focus,Br(l,h.key,h.offset,h.type),Br(i,s.key,s.offset,s.type))}}function Tn(l,i,s,h,N,v){return l===null||s===null||!rt(N,l,s)||(i=Sa(l,i,wt(v)?v.anchor:null,N),i===null)||(h=Sa(s,h,wt(v)?v.focus:null,N),h===null||i.type==="element"&&h.type==="element"&&(l=Jr(l),s=Jr(s),an(l)&&an(s)))?null:(va(i,h,v),[i,h])}function Gn(l,i,s,h,N,v){let M=yr();return l=new Ki(new Dr(l,i,N),new Dr(s,h,v),0,""),l.dirty=!0,M._selection=l}function Mr(){return new ho(new Set)}function xi(l){let i=l.getEditorState()._selection,s=kr(l._window);return wt(i)||i==null?Hn(i,s,l):i.clone()}function Hn(l,i,s){var h=s._window;if(h===null)return null;var N=h.event,v=N?N.type:void 0;h=v==="selectionchange",N=!ct&&(h||v==="beforeinput"||v==="compositionstart"||v==="compositionend"||v==="click"&&N&&N.detail===3||v==="drop"||v===void 0);let M;if(!wt(l)||N){if(i===null)return null;if(N=i.anchorNode,v=i.focusNode,M=i.anchorOffset,i=i.focusOffset,h&&wt(l)&&!rt(s,N,v))return l.clone()}else return l.clone();if(s=Tn(N,M,v,i,s,l),s===null)return null;let[J,ge]=s;return new Ki(J,ge,wt(l)?l.format:0,wt(l)?l.style:"")}function Vt(){return yr()._selection}function Ui(){return ln()._editorState._selection}function go(l,i,s,h=1){var N=l.anchor,v=l.focus,M=N.getNode(),J=v.getNode();if(i.is(M)||i.is(J)){if(M=i.__key,l.isCollapsed())i=N.offset,(s<=i&&0<h||s<i&&0>h)&&(s=Math.max(0,i+h),N.set(M,s,"element"),v.set(M,s,"element"),jo(l));else{let ve=l.isBackward();J=ve?v:N;var ge=J.getNode();N=ve?N:v,v=N.getNode(),i.is(ge)&&(ge=J.offset,(s<=ge&&0<h||s<ge&&0>h)&&J.set(M,Math.max(0,ge+h),"element")),i.is(v)&&(i=N.offset,(s<=i&&0<h||s<i&&0>h)&&N.set(M,Math.max(0,i+h),"element"))}jo(l)}}function jo(l){var i=l.anchor,s=i.offset;let h=l.focus;var N=h.offset,v=i.getNode(),M=h.getNode();if(l.isCollapsed())Ze(v)&&(M=v.getChildrenSize(),M=(N=s>=M)?v.getChildAtIndex(M-1):v.getChildAtIndex(s),ht(M)&&(s=0,N&&(s=M.getTextContentSize()),i.set(M.__key,s,"text"),h.set(M.__key,s,"text")));else{if(Ze(v)){let J=v.getChildrenSize();s=(l=s>=J)?v.getChildAtIndex(J-1):v.getChildAtIndex(s),ht(s)&&(v=0,l&&(v=s.getTextContentSize()),i.set(s.__key,v,"text"))}Ze(M)&&(s=M.getChildrenSize(),N=(i=N>=s)?M.getChildAtIndex(s-1):M.getChildAtIndex(N),ht(N)&&(M=0,i&&(M=N.getTextContentSize()),h.set(N.__key,M,"text")))}}function Ms(l,i){if(i=i.getEditorState()._selection,l=l._selection,wt(l)){var s=l.anchor;let h=l.focus,N;s.type==="text"&&(N=s.getNode(),N.selectionTransform(i,l)),h.type==="text"&&(s=h.getNode(),N!==s&&s.selectionTransform(i,l))}}function po(l,i,s,h,N){let v=null,M=0,J=null;h!==null?(v=h.__key,ht(h)?(M=h.getTextContentSize(),J="text"):Ze(h)&&(M=h.getChildrenSize(),J="element")):N!==null&&(v=N.__key,ht(N)?J="text":Ze(N)&&(J="element")),v!==null&&J!==null?l.set(v,M,J):(M=i.getIndexWithinParent(),M===-1&&(M=s.getChildrenSize()),l.set(s.__key,M,"element"))}function As(l,i,s,h,N){l.type==="text"?(l.key=s,i||(l.offset+=N)):l.offset>h.getIndexWithinParent()&&--l.offset}function Si(l,i,s){let h=[],N=null,v=null;l=l.getChildren();for(let Fe=0;Fe<l.length;Fe++){var M=l[Fe];Jo(M)||Y(108);var J=M.getChildren();M=0;for(let Ke of J){for(Nr(Ke)||Y(109);h[Fe]!==void 0&&h[Fe][M]!==void 0;)M++;J=Fe;var ge=M,ve=Ke;let ke={cell:ve,startColumn:ge,startRow:J},Me=ve.__rowSpan,Xe=ve.__colSpan;for(let ut=0;ut<Me;ut++){h[J+ut]===void 0&&(h[J+ut]=[]);for(let Tt=0;Tt<Xe;Tt++)h[J+ut][ge+Tt]=ke}i.is(ve)&&(N=ke),s.is(ve)&&(v=ke),M+=Ke.__colSpan}}return N===null&&Y(110),v===null&&Y(111),[h,N,v]}function ii(l){l instanceof Ls||(l instanceof ni?(l=ys(l,Nr),Nr(l)||Y(114)):(l=ys(l.getNode(),Nr),Nr(l)||Y(114)));let i=l.getParent();Jo(i)||Y(115);let s=i.getParent();return ks(s)||Y(116),[l,i,s]}function Vo(l){l.isCollapsed()||l.removeText();var i=l.anchor,s=i.getNode();if(!ht(s))return i.offset;let h=s.getParent();return h?(s=s.splitText(i.offset),s.length===0?0:(i=i.offset===0?0:1,s=s[0].getIndexWithinParent()+i,!h.isInline()||s===0?s:((s=h.getChildAtIndex(s))&&h.insertNewAfter(l).append(s,...s.getNextSiblings()),h.getIndexWithinParent()+i))):(l=lr(),fn().append(l),l.select(),0)}function qo(l){let i=lr(),s=null;for(let h=0;h<l.length;h++){let N=l[h],v=Ei(N);if(v||an(N)&&N.isInline()||Ze(N)&&N.isInline()||ht(N)||N.isParentRequired()){if(s===null&&(s=N.createParentElementNode(),i.append(s),v))continue;s!==null&&s.append(N)}else i.append(N),s=null}return i}let yn=null,xn=null,Sn=!1,Ol=!1,mo=0,Dl={characterData:!0,childList:!0,subtree:!0};function oi(){return Sn||yn!==null&&yn._readOnly}function Jn(){Sn&&Y(13)}function yr(){return yn===null&&Y(15),yn}function ln(){return xn===null&&Y(16),xn}function Ml(l,i,s){var h=i.__type;let N=l._nodes.get(h);for(N===void 0&&Y(30,h),l=s.get(h),l===void 0&&(l=Array.from(N.transforms),s.set(h,l)),s=l.length,h=0;h<s&&(l[h](i),i.isAttached());h++);}function wa(l,i){i=i._dirtyLeaves,l=l._nodeMap;for(let s of i)i=l.get(s),ht(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&qe(i)}function Lc(l,i){let s=i._dirtyLeaves,h=i._dirtyElements;l=l._nodeMap;let N=Ut(),v=new Map;var M=s;let J=M.size;for(var ge=h,ve=ge.size;0<J||0<ve;){if(0<J){i._dirtyLeaves=new Set;for(let Fe of M)M=l.get(Fe),ht(M)&&M.isAttached()&&M.isSimpleText()&&!M.isUnmergeable()&&qe(M),M!==void 0&&M!==void 0&&M.__key!==N&&M.isAttached()&&Ml(i,M,v),s.add(Fe);if(M=i._dirtyLeaves,J=M.size,0<J){mo++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Fe of ge)ge=Fe[0],ve=Fe[1],(ge==="root"||ve)&&(M=l.get(ge),M!==void 0&&M!==void 0&&M.__key!==N&&M.isAttached()&&Ml(i,M,v),h.set(ge,ve));M=i._dirtyLeaves,J=M.size,ge=i._dirtyElements,ve=ge.size,mo++}i._dirtyLeaves=s,i._dirtyElements=h}function _o(l,i){var s=l.type,h=i.get(s);if(h===void 0&&Y(17,s),s=h.klass,l.type!==s.getType()&&Y(18,s.name),s=s.importJSON(l),l=l.children,Ze(s)&&Array.isArray(l))for(h=0;h<l.length;h++){let N=_o(l[h],i);s.append(N)}return s}function Oa(l,i){let s=yn,h=Sn,N=xn;yn=l,Sn=!0,xn=null;try{return i()}finally{yn=s,Sn=h,xn=N}}function Ar(l,i){let s=l._pendingEditorState,h=l._rootElement,N=l._headless||h===null;if(s!==null){var v=l._editorState,M=v._selection,J=s._selection,ge=l._dirtyType!==0,ve=yn,Fe=Sn,Ke=xn,ke=l._updating,Me=l._observer,Xe=null;if(l._pendingEditorState=null,l._editorState=s,!N&&ge&&Me!==null){xn=l,yn=s,Sn=!1,l._updating=!0;try{let rn=l._dirtyType,kn=l._dirtyElements,pt=l._dirtyLeaves;Me.disconnect();var ut=rn,Tt=kn,At=pt;Ln=wr=On="",yi=ut===2,_n=null,Fn=l,_i=l._config,ko=l._nodes,Ns=Fn._listeners.mutation,Ir=Tt,En=At,Ni=v._nodeMap,mr=s._nodeMap,oo=s._readOnly,Cs=new Map(l._keyToDOMMap);let Cr=new Map;so=Cr,lo("root",null),so=Cs=_i=mr=Ni=En=Ir=ko=Fn=void 0,Xe=Cr}catch(rn){if(rn instanceof Error&&l._onError(rn),Ol)throw rn;Al(l,null,h,s),Re(l),l._dirtyType=2,Ol=!0,Ar(l,v),Ol=!1;return}finally{Me.observe(h,Dl),l._updating=ke,yn=ve,Sn=Fe,xn=Ke}}s._readOnly||(s._readOnly=!0);var hn=l._dirtyLeaves,ar=l._dirtyElements,Wr=l._normalizedNodes,si=l._updateTags,Oi=l._deferred;ge&&(l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements=new Map,l._normalizedNodes=new Set,l._updateTags=new Set);var Di=l._decorators,Eo=l._pendingDecorators||Di,Rl=s._nodeMap,Is;for(Is in Eo)Rl.has(Is)||(Eo===Di&&(Eo=Fi(l)),delete Eo[Is]);var Kr=N?null:kr(l._window);if(l._editable&&Kr!==null&&(ge||J===null||J.dirty)){xn=l,yn=s;try{if(Me!==null&&Me.disconnect(),ge||J===null||J.dirty){let rn=l._blockCursorElement;rn!==null&&fl(rn,l,h);e:{let kn=Kr.anchorNode,pt=Kr.focusNode,Cr=Kr.anchorOffset,ji=Kr.focusOffset,Qn=document.activeElement;if(!(si.has("collaboration")&&Qn!==h||Qn!==null&&Ve(Qn)))if(wt(J)){var To=J.anchor,Ps=J.focus,Xo=To.key,Gi=Ps.key,Ia=$n(l,Xo),Pa=$n(l,Gi),Qo=To.offset,$a=Ps.offset,bl=J.format,Ll=J.style,Fa=J.isCollapsed(),xo=Ia,$s=Pa,zr=!1;if(To.type==="text"){xo=vt(Ia);let cr=To.getNode();zr=cr.getFormat()!==bl||cr.getStyle()!==Ll}else wt(M)&&M.anchor.type==="text"&&(zr=!0);if(Ps.type==="text"&&($s=vt(Pa)),xo!==null&&$s!==null){if(Fa&&(M===null||zr||wt(M)&&(M.format!==bl||M.style!==Ll))){var Wn=performance.now();da=[bl,Ll,Qo,Xo,Wn]}if(Cr===Qo&&ji===$a&&kn===xo&&pt===$s&&(Kr.type!=="Range"||!Fa)&&(Qn!==null&&h.contains(Qn)||h.focus({preventScroll:!0}),To.type!=="element"))break e;try{Kr.setBaseAndExtent(xo,Qo,$s,$a)}catch{}if(!si.has("skip-scroll-into-view")&&J.isCollapsed()&&h!==null&&h===document.activeElement){let cr=J instanceof Ki&&J.anchor.type==="element"?xo.childNodes[Qo]||null:0<Kr.rangeCount?Kr.getRangeAt(0):null;if(cr!==null){let In;if(cr instanceof Text){let er=document.createRange();er.selectNode(cr),In=er.getBoundingClientRect()}else In=cr.getBoundingClientRect();let Er=h.ownerDocument,Ri=Er.defaultView;if(Ri!==null)for(var{top:gt,bottom:Mi}=In,Yi,es,Ai=h;Ai!==null;){let er=Ai===Er.body;if(er)Yi=0,es=qn(l).innerHeight;else{let Fs=Ai.getBoundingClientRect();Yi=Fs.top,es=Fs.bottom}let Vi=0;if(gt<Yi?Vi=-(Yi-gt):Mi>es&&(Vi=Mi-es),Vi!==0)if(er)Ri.scrollBy(0,Vi);else{let Fs=Ai.scrollTop;Ai.scrollTop+=Vi;let Ha=Ai.scrollTop-Fs;gt-=Ha,Mi-=Ha}if(er)break;Ai=pr(Ai)}}}_l=!0}}else M!==null&&rt(l,kn,pt)&&Kr.removeAllRanges()}}e:{let rn=l._blockCursorElement;if(wt(J)&&J.isCollapsed()&&J.anchor.type==="element"&&h.contains(document.activeElement)){let kn=J.anchor,pt=kn.getNode(),Cr=kn.offset,ji=pt.getChildrenSize(),Qn=!1,cr=null;if(Cr===ji){let In=pt.getChildAtIndex(Cr-1);dl(In)&&(Qn=!0)}else{let In=pt.getChildAtIndex(Cr);if(dl(In)){let Er=In.getPreviousSibling();(Er===null||dl(Er))&&(Qn=!0,cr=l.getElementByKey(In.__key))}}if(Qn){let In=l.getElementByKey(pt.__key);if(rn===null){let Er=l._config.theme,Ri=document.createElement("div");Ri.contentEditable="false",Ri.setAttribute("data-lexical-cursor","true");let er=Er.blockCursor;if(er!==void 0){if(typeof er=="string"){let Vi=er.split(" ");er=Er.blockCursor=Vi}er!==void 0&&Ri.classList.add(...er)}l._blockCursorElement=rn=Ri}h.style.caretColor="transparent",cr===null?In.appendChild(rn):In.insertBefore(rn,cr);break e}}rn!==null&&fl(rn,l,h)}Me!==null&&Me.observe(h,Dl)}finally{xn=Ke,yn=ve}}if(Xe!==null){var Ur=Xe;let rn=Array.from(l._listeners.mutation),kn=rn.length;for(let pt=0;pt<kn;pt++){let[Cr,ji]=rn[pt],Qn=Ur.get(ji);Qn!==void 0&&Cr(Qn,{dirtyLeaves:hn,prevEditorState:v,updateTags:si})}}wt(J)||J===null||M!==null&&M.is(J)||l.dispatchCommand(t,void 0);var ts=l._pendingDecorators;ts!==null&&(l._decorators=ts,l._pendingDecorators=null,yo("decorator",l,!0,ts));var Ba=gs(i||v),kl=gs(s);if(Ba!==kl&&yo("textcontent",l,!0,kl),yo("update",l,!0,{dirtyElements:ar,dirtyLeaves:hn,editorState:s,normalizedNodes:Wr,prevEditorState:i||v,tags:si}),l._deferred=[],Oi.length!==0){let rn=l._updating;l._updating=!0;try{for(let kn=0;kn<Oi.length;kn++)Oi[kn]()}finally{l._updating=rn}}var li=l._updates;if(li.length!==0){let rn=li.shift();if(rn){let[kn,pt]=rn;Da(l,kn,pt)}}}}function yo(l,i,s,...h){let N=i._updating;i._updating=s;try{let v=Array.from(i._listeners[l]);for(l=0;l<v.length;l++)v[l].apply(null,h)}finally{i._updating=N}}function ot(l,i,s){if(l._updating===!1||xn!==l){let v=!1;return l.update(()=>{v=ot(l,i,s)}),v}let h=ye(l);for(let v=4;0<=v;v--)for(let M=0;M<h.length;M++){var N=h[M]._commands.get(i);if(N!==void 0&&(N=N[v],N!==void 0)){N=Array.from(N);let J=N.length;for(let ge=0;ge<J;ge++)if(N[ge](s,l)===!0)return!0}}return!1}function Rs(l,i){let s=l._updates;for(i=i||!1;s.length!==0;){var h=s.shift();if(h){let[N,v]=h,M;v!==void 0&&(h=v.onUpdate,M=v.tag,v.skipTransforms&&(i=!0),h&&l._deferred.push(h),M&&l._updateTags.add(M)),N()}}return i}function Da(l,i,s){let h=l._updateTags;var N,v=N=!1;if(s!==void 0){var M=s.onUpdate;N=s.tag,N!=null&&h.add(N),N=s.skipTransforms||!1,v=s.discrete||!1}M&&l._deferred.push(M),s=l._editorState,M=l._pendingEditorState;let J=!1;(M===null||M._readOnly)&&(M=l._pendingEditorState=new Co(new Map((M||s)._nodeMap)),J=!0),M._flushSync=v,v=yn;let ge=Sn,ve=xn,Fe=l._updating;yn=M,Sn=!1,l._updating=!0,xn=l;try{J&&(l._headless?s._selection!=null&&(M._selection=s._selection.clone()):M._selection=xi(l));let Ke=l._compositionKey;i(),N=Rs(l,N),Ms(M,l),l._dirtyType!==0&&(N?wa(M,l):Lc(M,l),Rs(l),hl(s,M,l._dirtyLeaves,l._dirtyElements)),Ke!==l._compositionKey&&(M._flushSync=!0);let ke=M._selection;if(wt(ke)){let Me=M._nodeMap,Xe=ke.focus.key;Me.get(ke.anchor.key)!==void 0&&Me.get(Xe)!==void 0||Y(19)}else Go(ke)&&ke._nodes.size===0&&(M._selection=null)}catch(Ke){Ke instanceof Error&&l._onError(Ke),l._pendingEditorState=s,l._dirtyType=2,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),Ar(l);return}finally{yn=v,Sn=ge,xn=ve,l._updating=Fe,mo=0}l._dirtyType!==0||Aa(M,l)?M._flushSync?(M._flushSync=!1,Ar(l)):J&&je(()=>{Ar(l)}):(M._flushSync=!1,J&&(h.clear(),l._deferred=[],l._pendingEditorState=null))}function sr(l,i,s){l._updating?l._updates.push([i,s]):Da(l,i,s)}class Ma extends ni{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function an(l){return l instanceof Ma}class Xn extends ni{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 Le[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getChildrenKeys(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s.__key),s=s.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=ln()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),s=this.getParentOrThrow().getLastChild();return s!==null&&s.is(i)}getAllTextNodes(){let i=[],s=this.getFirstChild();for(;s!==null;){if(ht(s)&&i.push(s),Ze(s)){let h=s.getAllTextNodes();i.push(...h)}s=s.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Ze(i)){let s=i.getFirstChild();if(s!==null){i=s;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Ze(i)){let s=i.getLastChild();if(s!==null){i=s;continue}}break}return i}getDescendantByIndex(i){let s=this.getChildren(),h=s.length;return i>=h?(i=s[h-1],Ze(i)&&i.getLastDescendant()||i||null):(i=s[i],Ze(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:It(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:It(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var s=this.getChildrenSize();let h;if(i<s/2){for(h=this.getFirstChild(),s=0;h!==null&&s<=i;){if(s===i)return h;h=h.getNextSibling(),s++}return null}for(h=this.getLastChild(),--s;h!==null&&s>=i;){if(s===i)return h;h=h.getPreviousSibling(),s--}return null}getTextContent(){let i="",s=this.getChildren(),h=s.length;for(let N=0;N<h;N++){let v=s[N];i+=v.getTextContent(),Ze(v)&&N!==h-1&&!v.isInline()&&(i+=`
64
64
 
65
- `)}return i}getTextContentSize(){let i=0,s=this.getChildren(),h=s.length;for(let N=0;N<h;N++){let v=s[N];i+=v.getTextContentSize(),Ze(v)&&N!==h-1&&!v.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=we[i],(this.getFormat()&i)!==0):!1}select(i,s){Jn();let h=Vt(),N=i,v=s;var M=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&s===0){if(i=this.getFirstChild(),ht(i)||Ze(i))return i.select(0,0)}else if(!(i!==void 0&&i!==M||s!==void 0&&s!==M)&&(i=this.getLastChild(),ht(i)||Ze(i)))return i.select()}if(N===void 0&&(N=M),v===void 0&&(v=M),M=this.__key,wt(h))h.anchor.set(M,N,"element"),h.focus.set(M,v,"element"),h.dirty=!0;else return Gn(M,N,M,v,"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(s=>s.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let s=this.getWritable();return s.__dir=i,s}setFormat(i){return this.getWritable().__format=i!==""?we[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,s,h){let N=h.length,v=this.getChildrenSize(),M=this.getWritable(),J=M.__key;var ge=[],ve=[];let Fe=this.getChildAtIndex(i+s),Ke=null,ke=v-s+N;if(i!==0)if(i===v)Ke=this.getLastChild();else{var Me=this.getChildAtIndex(i);Me!==null&&(Ke=Me.getPreviousSibling())}if(0<s){var Xe=Ke===null?this.getFirstChild():Ke.getNextSibling();for(Me=0;Me<s;Me++){Xe===null&&Y(100);var ut=Xe.getNextSibling(),Tt=Xe.__key;Xe=Xe.getWritable(),xt(Xe),ve.push(Tt),Xe=ut}}for(Me=Ke,ut=0;ut<N;ut++){Tt=h[ut],Me!==null&&Tt.is(Me)&&(Ke=Me=Me.getPreviousSibling()),Xe=Tt.getWritable(),Xe.__parent===J&&ke--,xt(Xe);let At=Tt.__key;Me===null?(M.__first=At,Xe.__prev=null):(Me=Me.getWritable(),Me.__next=At,Xe.__prev=Me.__key),Tt.__key===J&&Y(76),Xe.__parent=J,ge.push(At),Me=Tt}if(i+s===v?Me!==null&&(Me.getWritable().__next=null,M.__last=Me.__key):Fe!==null&&(i=Fe.getWritable(),Me!==null?(s=Me.getWritable(),i.__prev=Me.__key,s.__next=Fe.__key):i.__prev=null),M.__size=ke,ve.length&&(i=Vt(),wt(i))){ve=new Set(ve),ge=new Set(ge);let{anchor:At,focus:hn}=i;bs(At,ve,ge)&&po(At,At.getNode(),this,Ke,Fe),bs(hn,ve,ge)&&po(hn,hn.getNode(),this,Ke,Fe),ke!==0||this.canBeEmpty()||Xr(this)||this.remove()}return M}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 Ze(l){return l instanceof Xn}function bs(l,i,s){for(l=l.getNode();l;){let h=l.__key;if(i.has(h)&&!s.has(h))return!0;l=l.getParent()}return!1}class Hr extends Xn{static getType(){return"root"}static clone(){return new Hr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!oi()&&ln()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let s=0;s<i.length;s++){let h=i[s];Ze(h)||an(h)||Y(56)}return super.append(...i)}static importJSON(i){let s=fn();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function tr(l){return l instanceof Hr}function Aa(l,i){if(i=i.getEditorState()._selection,l=l._selection,l!==null){if(l.dirty||!l.is(i))return!0}else if(i!==null)return!0;return!1}function vi(){return new Co(new Map([["root",new Hr]]))}function No(l){let i=l.exportJSON();var s=l.constructor;i.type!==s.getType()&&Y(130,s.name);let h=i.children;if(Ze(l))for(Array.isArray(h)||Y(59,s.name),l=l.getChildren(),s=0;s<l.length;s++){let N=No(l[s]);h.push(N)}return i}class Co{constructor(i,s){this._nodeMap=i,this._selection=s||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Oa(this,i)}clone(i){return i=new Co(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Oa(this,()=>({root:No(fn())}))}}class wi extends Xn{static getType(){return"paragraph"}static clone(i){return new wi(i.__key)}createDOM(i){let s=document.createElement("p");return i=Kt(i.theme,"paragraph"),i!==void 0&&s.classList.add(...i),s}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Zo,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&io(i)){this.isEmpty()&&i.append(document.createElement("br"));var s=this.getFormatType();i.style.textAlign=s,(s=this.getDirection())&&(i.dir=s),s=this.getIndent(),0<s&&(i.style.textIndent=`${20*s}px`)}return{element:i}}static importJSON(i){let s=lr();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,s){i=lr();let h=this.getDirection();return i.setDirection(h),this.insertAfter(i,s),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||ht(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 Zo(l){let i=lr();return l.style&&(i.setFormat(l.style.textAlign),l=parseInt(l.style.textIndent,10)/20,0<l&&i.setIndent(l)),{node:i}}function lr(){return Bi(new wi)}function Al(l,i,s,h){let N=l._keyToDOMMap;N.clear(),l._editorState=vi(),l._pendingEditorState=h,l._compositionKey=null,l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),l._normalizedNodes=new Set,l._updateTags=new Set,l._updates=[],l._blockCursorElement=null,h=l._observer,h!==null&&(h.disconnect(),l._observer=null),i!==null&&(i.textContent=""),s!==null&&(s.textContent="",N.set("root",s))}function Ra(l,i){let s=new Map,h=new Set,N=v=>{Object.keys(v).forEach(M=>{let J=s.get(M);J===void 0&&(J=[],s.set(M,J)),J.push(v[M])})};return l.forEach(v=>{v=v.klass.importDOM!=null?v.klass.importDOM.bind(v.klass):null,v==null||h.has(v)||(h.add(v),v=v(),v!==null&&N(v))}),i&&N(i),s}class ba{constructor(i,s,h,N,v,M,J){this._parentEditor=s,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=N,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=Ge(),this._onError=v,this._htmlConversions=M,this._editable=J,this._headless=s!==null&&s._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let s=this._listeners.update;return s.add(i),()=>{s.delete(i)}}registerEditableListener(i){let s=this._listeners.editable;return s.add(i),()=>{s.delete(i)}}registerDecoratorListener(i){let s=this._listeners.decorator;return s.add(i),()=>{s.delete(i)}}registerTextContentListener(i){let s=this._listeners.textcontent;return s.add(i),()=>{s.delete(i)}}registerRootListener(i){let s=this._listeners.root;return i(this._rootElement,null),s.add(i),()=>{i(null,this._rootElement),s.delete(i)}}registerCommand(i,s,h){h===void 0&&Y(35);let N=this._commands;N.has(i)||N.set(i,[new Set,new Set,new Set,new Set,new Set]);let v=N.get(i);v===void 0&&Y(36,String(i));let M=v[h];return M.add(s),()=>{M.delete(s),v.every(J=>J.size===0)&&N.delete(i)}}registerMutationListener(i,s){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let h=this._listeners.mutation;return h.set(s,i),()=>{h.delete(s)}}registerNodeTransformToKlass(i,s){var h=i.getType();return h=this._nodes.get(h),h===void 0&&Y(37,i.name),h.transforms.add(s),h}registerNodeTransform(i,s){var h=this.registerNodeTransformToKlass(i,s);let N=[h];return h=h.replaceWithKlass,h!=null&&(h=this.registerNodeTransformToKlass(h,s),N.push(h)),ps(this,i.getType()),()=>{N.forEach(v=>v.transforms.delete(s))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,s){return ot(this,i,s)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let s=this._rootElement;if(i!==s){let M=Kt(this._config.theme,"root");var h=this._pendingEditorState||this._editorState;if(this._rootElement=i,Al(this,s,i,h),s!==null){if(!this._config.disableEvents){Fo!==0&&(Fo--,Fo===0&&s.ownerDocument.removeEventListener("selectionchange",Na));var N=s.__lexicalEditor;if(N!=null){if(N._parentEditor!==null){var v=ye(N);v=v[v.length-1]._key,co.get(v)===N&&co.delete(v)}else co.delete(N._key);s.__lexicalEditor=null}for(N=ya(s),v=0;v<N.length;v++)N[v]();s.__lexicalEventHandles=[]}M!=null&&s.classList.remove(...M)}i!==null?(h=(h=i.ownerDocument)&&h.defaultView||null,N=i.style,N.userSelect="text",N.whiteSpace="pre-wrap",N.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=h,this._dirtyType=2,Re(this),this._updateTags.add("history-merge"),Ar(this),this._config.disableEvents||Mc(i,this),M!=null&&i.classList.add(...M)):(this._editorState=h,this._window=this._pendingEditorState=null),yo("root",this,!1,i,s)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,s){i.isEmpty()&&Y(38),Oe(this);let h=this._pendingEditorState,N=this._updateTags;s=s!==void 0?s.tag:null,h===null||h.isEmpty()||(s!=null&&N.add(s),Ar(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&N.add(s),Ar(this)}parseEditorState(i,s){i=typeof i=="string"?JSON.parse(i):i;let h=vi(),N=yn,v=Sn,M=xn,J=this._dirtyElements,ge=this._dirtyLeaves,ve=this._cloneNotNeeded,Fe=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,yn=h,Sn=!1,xn=this;try{_o(i.root,this._nodes),s&&s(),h._readOnly=!0}catch(Ke){Ke instanceof Error&&this._onError(Ke)}finally{this._dirtyElements=J,this._dirtyLeaves=ge,this._cloneNotNeeded=ve,this._dirtyType=Fe,yn=N,Sn=v,xn=M}return h}update(i,s){sr(this,i,s)}focus(i,s={}){let h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),sr(this,()=>{let N=Vt(),v=fn();N!==null?N.dirty=!0:v.getChildrenSize()!==0&&(s.defaultSelection==="rootStart"?v.selectStart():v.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=kr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,yo("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Ls extends Xn{constructor(i,s){super(s),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 Nr(l){return l instanceof Ls}class La extends Xn{}function ks(l){return l instanceof La}class ka extends Xn{}function Jo(l){return l instanceof ka}return $e.$INTERNAL_isPointSelection=vl,$e.$addUpdateTag=function(l){Jn(),ln()._updateTags.add(l)},$e.$applyNodeReplacement=Bi,$e.$copyNode=ul,$e.$createLineBreakNode=$r,$e.$createNodeSelection=Mr,$e.$createParagraphNode=lr,$e.$createRangeSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Ki(l,i,0,"")},$e.$createTabNode=Wi,$e.$createTextNode=Bn,$e.$getAdjacentNode=mn,$e.$getNearestNodeFromDOMNode=vr,$e.$getNearestRootOrShadowRoot=cl,$e.$getNodeByKey=It,$e.$getPreviousSelection=Ui,$e.$getRoot=fn,$e.$getSelection=Vt,$e.$getTextContent=function(){let l=Vt();return l===null?"":l.getTextContent()},$e.$hasAncestor=mi,$e.$hasUpdateTag=function(l){return ln()._updateTags.has(l)},$e.$insertNodes=function(l){let i=Vt()||Ui();i===null&&(i=fn().selectEnd()),i.insertNodes(l)},$e.$isBlockElementNode=function(l){return Ze(l)&&!l.isInline()},$e.$isDecoratorNode=an,$e.$isElementNode=Ze,$e.$isInlineElementOrDecoratorNode=function(l){return Ze(l)&&l.isInline()||an(l)&&l.isInline()},$e.$isLeafNode=function(l){return ht(l)||Ei(l)||an(l)},$e.$isLineBreakNode=Ei,$e.$isNodeSelection=Go,$e.$isParagraphNode=function(l){return l instanceof wi},$e.$isRangeSelection=wt,$e.$isRootNode=tr,$e.$isRootOrShadowRoot=Xr,$e.$isTabNode=xa,$e.$isTextNode=ht,$e.$nodesOfType=function(l){var i=yr();let s=i._readOnly,h=l.getType();i=i._nodeMap;let N=[];for(let[,v]of i)v instanceof l&&v.__type===h&&(s||v.isAttached())&&N.push(v);return N},$e.$normalizeSelection__EXPERIMENTAL=Qe,$e.$parseSerializedNode=function(l){return _o(l,ln()._nodes)},$e.$selectAll=function(){var l=fn();l=l.select(0,l.getChildrenSize()),gr(Qe(l))},$e.$setCompositionKey=bt,$e.$setSelection=gr,$e.$splitNode=function(l,i){let s=l.getChildAtIndex(i);s==null&&(s=l),Xr(l)&&Y(102);let h=M=>{const J=M.getParentOrThrow(),ge=Xr(J),ve=M!==s||ge?ul(M):M;if(ge)return M.insertAfter(ve),[M,ve,ve];const[Fe,Ke,ke]=h(J);return M=M.getNextSiblings(),ke.append(ve,...M),[Fe,Ke,ve]},[N,v]=h(s);return[N,v]},$e.BLUR_COMMAND=j,$e.CAN_REDO_COMMAND={},$e.CAN_UNDO_COMMAND={},$e.CLEAR_EDITOR_COMMAND={},$e.CLEAR_HISTORY_COMMAND={},$e.CLICK_COMMAND=e,$e.COMMAND_PRIORITY_CRITICAL=4,$e.COMMAND_PRIORITY_EDITOR=0,$e.COMMAND_PRIORITY_HIGH=3,$e.COMMAND_PRIORITY_LOW=1,$e.COMMAND_PRIORITY_NORMAL=2,$e.CONTROLLED_TEXT_INSERTION_COMMAND=d,$e.COPY_COMMAND=pe,$e.CUT_COMMAND=ue,$e.DELETE_CHARACTER_COMMAND=n,$e.DELETE_LINE_COMMAND=S,$e.DELETE_WORD_COMMAND=C,$e.DEPRECATED_$computeGridMap=Si,$e.DEPRECATED_$createGridSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Os("root",l,i)},$e.DEPRECATED_$getGridCellNodeRect=_r,$e.DEPRECATED_$getNodeTriplet=ii,$e.DEPRECATED_$isGridCellNode=Nr,$e.DEPRECATED_$isGridNode=ks,$e.DEPRECATED_$isGridRowNode=Jo,$e.DEPRECATED_$isGridSelection=Uo,$e.DEPRECATED_GridCellNode=Ls,$e.DEPRECATED_GridNode=La,$e.DEPRECATED_GridRowNode=ka,$e.DRAGEND_COMMAND=_e,$e.DRAGOVER_COMMAND=me,$e.DRAGSTART_COMMAND=q,$e.DROP_COMMAND=U,$e.DecoratorNode=Ma,$e.ElementNode=Xn,$e.FOCUS_COMMAND=D,$e.FORMAT_ELEMENT_COMMAND={},$e.FORMAT_TEXT_COMMAND=x,$e.INDENT_CONTENT_COMMAND={},$e.INSERT_LINE_BREAK_COMMAND=r,$e.INSERT_PARAGRAPH_COMMAND=c,$e.INSERT_TAB_COMMAND={},$e.KEY_ARROW_DOWN_COMMAND=W,$e.KEY_ARROW_LEFT_COMMAND=P,$e.KEY_ARROW_RIGHT_COMMAND=T,$e.KEY_ARROW_UP_COMMAND=$,$e.KEY_BACKSPACE_COMMAND=X,$e.KEY_DELETE_COMMAND=le,$e.KEY_DOWN_COMMAND=b,$e.KEY_ENTER_COMMAND=B,$e.KEY_ESCAPE_COMMAND=ee,$e.KEY_MODIFIER_COMMAND=ne,$e.KEY_SPACE_COMMAND=K,$e.KEY_TAB_COMMAND=V,$e.LineBreakNode=Pr,$e.MOVE_TO_END=w,$e.MOVE_TO_START=H,$e.OUTDENT_CONTENT_COMMAND={},$e.PASTE_COMMAND=g,$e.ParagraphNode=wi,$e.REDO_COMMAND=R,$e.REMOVE_TEXT_COMMAND=p,$e.RootNode=Hr,$e.SELECTION_CHANGE_COMMAND=t,$e.SELECT_ALL_COMMAND=z,$e.TabNode=uo,$e.TextNode=ri,$e.UNDO_COMMAND=O,$e.createCommand=function(){return{}},$e.createEditor=function(l){var i=l||{},s=xn,h=i.theme||{};let N=l===void 0?s:i.parentEditor||null,v=i.disableEvents||!1,M=vi(),J=i.namespace||(N!==null?N._config.namespace:Ge()),ge=i.editorState,ve=[Hr,ri,Pr,uo,wi,...i.nodes||[]],{onError:Fe,html:Ke}=i;if(i=i.editable!==void 0?i.editable:!0,l===void 0&&s!==null)l=s._nodes;else for(l=new Map,s=0;s<ve.length;s++){let Me=ve[s],Xe=null;var ke=null;typeof Me!="function"&&(ke=Me,Me=ke.replace,Xe=ke.with,ke=ke.withKlass||null);let ut=Me.getType(),Tt=Me.transform(),At=new Set;Tt!==null&&At.add(Tt),l.set(ut,{exportDOM:Ke&&Ke.export?Ke.export.get(Me):void 0,klass:Me,replace:Xe,replaceWithKlass:ke,transforms:At})}return h=new ba(M,N,l,{disableEvents:v,namespace:J,theme:h},Fe||console.error,Ra(l,Ke?Ke.import:void 0),i),ge!==void 0&&(h._pendingEditorState=ge,h._dirtyType=2),h},$e.getNearestEditorFromDOMNode=_t,$e.isHTMLAnchorElement=function(l){return io(l)&&l.tagName==="A"},$e.isHTMLElement=io,$e.isSelectionCapturedInDecoratorInput=Ve,$e.isSelectionWithinEditor=rt,$e}var jc,Sf;function Bt(){return Sf||(Sf=1,jc=process.env.NODE_ENV==="development"?vN():wN()),jc}var vf;function ON(){if(vf)return Gc;vf=1;var t=Un(),e=Bt(),n=et;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 p({initialConfig:S,children:x}){const O=n.useMemo(()=>{const{theme:R,namespace:b,editor__DEPRECATED:T,nodes:w,onError:P,editorState:H,html:$}=S,W=t.createLexicalComposerContext(null,R);let B=T||null;if(B===null){const K=e.createEditor({editable:S.editable,html:$,namespace:b,nodes:w,onError:X=>P(X,K),theme:R});C(K,H),B=K}return[B,W]},[]);return d(()=>{const R=S.editable,[b]=O;b.setEditable(R!==void 0?R:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:O},x)}function C(S,x){if(x!==null){if(x===void 0)S.update(()=>{const O=e.$getRoot();if(O.isEmpty()){const R=e.$createParagraphNode();O.append(R);const b=r?document.activeElement:null;(e.$getSelection()!==null||b!==null&&b===S.getRootElement())&&R.select()}},g);else if(x!==null)switch(typeof x){case"string":{const O=S.parseEditorState(x);S.setEditorState(O,g);break}case"object":{S.setEditorState(x,g);break}case"function":{S.update(()=>{e.$getRoot().isEmpty()&&x(S)},g);break}}}}return Gc.LexicalComposer=p,Gc}var Vc={},wf;function DN(){if(wf)return Vc;wf=1;var t=Un(),e=Bt(),n=et;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(p,C){if(C!==null){if(C===void 0)p.update(()=>{var S=e.$getRoot();if(S.isEmpty()){let x=e.$createParagraphNode();S.append(x),S=r?document.activeElement:null,(e.$getSelection()!==null||S!==null&&S===p.getRootElement())&&x.select()}},d);else if(C!==null)switch(typeof C){case"string":let S=p.parseEditorState(C);p.setEditorState(S,d);break;case"object":p.setEditorState(C,d);break;case"function":p.update(()=>{e.$getRoot().isEmpty()&&C(p)},d)}}}return Vc.LexicalComposer=function({initialConfig:p,children:C}){let S=n.useMemo(()=>{const{theme:x,namespace:O,editor__DEPRECATED:R,nodes:b,onError:T,editorState:w,html:P}=p,H=t.createLexicalComposerContext(null,x);let $=R||null;if($===null){const W=e.createEditor({editable:p.editable,html:P,namespace:O,nodes:b,onError:B=>T(B,W),theme:x});g(W,w),$=W}return[$,H]},[]);return c(()=>{let x=p.editable,[O]=S;O.setEditable(x!==void 0?x:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:S},C)},Vc}const MN=process.env.NODE_ENV==="development"?ON():DN();var AN=MN,qc={},Zc,Of;function RN(){if(Of)return Zc;Of=1;var t=Un(),e=et,c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function d(C){const[S]=t.useLexicalComposerContext(),x=e.useMemo(()=>C(S),[S,C]),O=e.useRef(x.initialValueFn()),[R,b]=e.useState(O.current);return c(()=>{const{initialValueFn:T,subscribe:w}=x,P=T();return O.current!==P&&(O.current=P,b(P)),w(H=>{O.current=H,b(H)})},[x,C]),R}function g(C){return{initialValueFn:()=>C.isEditable(),subscribe:S=>C.registerEditableListener(S)}}function p(){return d(g)}return Zc=p,Zc}var Jc,Df;function bN(){if(Df)return Jc;Df=1;var t=Un(),e=et,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function r(d){let[g]=t.useLexicalComposerContext(),p=e.useMemo(()=>d(g),[g,d]),C=e.useRef(p.initialValueFn()),[S,x]=e.useState(C.current);return n(()=>{let{initialValueFn:O,subscribe:R}=p,b=O();return C.current!==b&&(C.current=b,x(b)),R(T=>{C.current=T,x(T)})},[p,d]),S}function c(d){return{initialValueFn:()=>d.isEditable(),subscribe:g=>d.registerEditableListener(g)}}return Jc=function(){return r(c)},Jc}var Xc,Mf;function hp(){return Mf||(Mf=1,Xc=process.env.NODE_ENV==="development"?RN():bN()),Xc}var Xi={},Af;function LN(){if(Af)return Xi;Af=1;var t=Bt();function e(C,S){let x=C.getFirstChild(),O=0;e:for(;x!==null;){if(t.$isElementNode(x)){const T=x.getFirstChild();if(T!==null){x=T;continue}}else if(t.$isTextNode(x)){const T=x.getTextContentSize();if(O+T>S)return{node:x,offset:S-O};O+=T}const R=x.getNextSibling();if(R!==null){x=R;continue}let b=x.getParent();for(;b!==null;){const T=b.getNextSibling();if(T!==null){x=T;continue e}b=b.getParent()}break}return null}function n(C,S=!0){if(C)return!1;let x=c();return S&&(x=x.trim()),x===""}function r(C,S){return()=>n(C,S)}function c(){return t.$getRoot().getTextContent()}function d(C){if(!n(C,!1))return!1;const x=t.$getRoot().getChildren(),O=x.length;if(O>1)return!1;for(let R=0;R<O;R++){const b=x[R];if(t.$isDecoratorNode(b))return!1;if(t.$isElementNode(b)){if(!t.$isParagraphNode(b)||b.__indent!==0)return!1;const T=b.getChildren(),w=T.length;for(let P=0;P<w;P++){const H=T[R];if(!t.$isTextNode(H))return!1}}}return!0}function g(C){return()=>d(C)}function p(C,S,x,O){const R=W=>W instanceof x,b=W=>{const B=t.$createTextNode(W.getTextContent());B.setFormat(W.getFormat()),W.replace(B)},T=W=>W.getLatest().__mode,w=W=>{if(!W.isSimpleText())return;const B=W.getPreviousSibling();let K=W.getTextContent(),X=W,ee;if(t.$isTextNode(B)){const le=B.getTextContent(),V=le+K,U=S(V);if(R(B))if(U===null||T(B)!==0){b(B);return}else{const q=U.end-le.length;if(q>0){const me=K.slice(0,q),_e=le+me;if(B.select(),B.setTextContent(_e),q===K.length)W.remove();else{const pe=K.slice(q);W.setTextContent(pe)}return}}else if(U===null||U.start<le.length)return}for(;;){ee=S(K);let le=ee===null?"":K.slice(ee.end);if(K=le,le===""){const q=X.getNextSibling();if(t.$isTextNode(q)){le=X.getTextContent()+q.getTextContent();const me=S(le);if(me===null){R(q)?b(q):q.markDirty();return}else if(me.start!==0)return}}else{const q=S(le);if(q!==null&&q.start===0)return}if(ee===null)return;if(ee.start===0&&t.$isTextNode(B)&&B.isTextEntity())continue;let V;ee.start===0?[V,X]=X.splitText(ee.end):[,V,X]=X.splitText(ee.start,ee.end);const U=O(V);if(U.setFormat(V.getFormat()),V.replace(U),X==null)return}},P=W=>{const B=W.getTextContent(),K=S(B);if(K===null||K.start!==0){b(W);return}if(B.length>K.end){W.splitText(K.end);return}const X=W.getPreviousSibling();t.$isTextNode(X)&&X.isTextEntity()&&(b(X),b(W));const ee=W.getNextSibling();t.$isTextNode(ee)&&ee.isTextEntity()&&(b(ee),R(W)&&b(W))},H=C.registerNodeTransform(t.TextNode,w),$=C.registerNodeTransform(x,P);return[H,$]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=g,Xi.$findTextIntersectionFromCharacters=e,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=c,Xi.registerLexicalTextEntity=p,Xi}var Qi={},Rf;function kN(){if(Rf)return Qi;Rf=1;var t=Bt();function e(c,d=!0){return c?!1:(c=n(),d&&(c=c.trim()),c==="")}function n(){return t.$getRoot().getTextContent()}function r(c){if(!e(c,!1))return!1;c=t.$getRoot().getChildren();let d=c.length;if(1<d)return!1;for(let p=0;p<d;p++){var g=c[p];if(t.$isDecoratorNode(g))return!1;if(t.$isElementNode(g)){if(!t.$isParagraphNode(g)||g.__indent!==0)return!1;g=g.getChildren();let C=g.length;for(let S=0;S<C;S++)if(!t.$isTextNode(g[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(c){return()=>r(c)},Qi.$findTextIntersectionFromCharacters=function(c,d){var g=c.getFirstChild();c=0;e:for(;g!==null;){if(t.$isElementNode(g)){var p=g.getFirstChild();if(p!==null){g=p;continue}}else if(t.$isTextNode(g)){if(p=g.getTextContentSize(),c+p>d)return{node:g,offset:d-c};c+=p}if(p=g.getNextSibling(),p!==null)g=p;else{for(g=g.getParent();g!==null;){if(p=g.getNextSibling(),p!==null){g=p;continue e}g=g.getParent()}break}}return null},Qi.$isRootTextContentEmpty=e,Qi.$isRootTextContentEmptyCurry=function(c,d){return()=>e(c,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(c,d,g,p){let C=x=>{const O=t.$createTextNode(x.getTextContent());O.setFormat(x.getFormat()),x.replace(O)},S=c.registerNodeTransform(t.TextNode,x=>{if(x.isSimpleText()){var O=x.getPreviousSibling(),R=x.getTextContent(),b=x;if(t.$isTextNode(O)){var T=O.getTextContent(),w=d(T+R);if(O instanceof g){if(w===null||O.getLatest().__mode!==0){C(O);return}if(w=w.end-T.length,0<w){b=R.slice(0,w),b=T+b,O.select(),O.setTextContent(b),w===R.length?x.remove():(O=R.slice(w),x.setTextContent(O));return}}else if(w===null||w.start<T.length)return}for(;;){if(x=d(R),R=w=x===null?"":R.slice(x.end),w===""){if(T=b.getNextSibling(),t.$isTextNode(T)){if(w=b.getTextContent()+T.getTextContent(),w=d(w),w===null){T instanceof g?C(T):T.markDirty();break}else if(w.start!==0)break}}else if(T=d(w),T!==null&&T.start===0)break;if(x===null)break;if(x.start===0&&t.$isTextNode(O)&&O.isTextEntity())continue;let P;if(x.start===0?[P,b]=b.splitText(x.end):[,P,b]=b.splitText(x.start,x.end),x=p(P),x.setFormat(P.getFormat()),P.replace(x),b==null)break}}});return c=c.registerNodeTransform(g,x=>{var O=x.getTextContent();const R=d(O);R===null||R.start!==0?C(x):O.length>R.end?x.splitText(R.end):(O=x.getPreviousSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(C(O),C(x)),O=x.getNextSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(C(O),x instanceof g&&C(x)))}),[S,c]},Qi}var Qc,bf;function gp(){return bf||(bf=1,Qc=process.env.NODE_ENV==="development"?LN():kN()),Qc}var Nn={},Kn={},Lf;function IN(){if(Lf)return Kn;Lf=1;var t=Bt();const e=new Map;function n(z){let D=z;for(;D!=null;){if(D.nodeType===Node.TEXT_NODE)return D;D=D.firstChild}return null}function r(z){const D=z.parentNode;if(D==null)throw new Error("Should never happen");return[D,Array.from(D.childNodes).indexOf(z)]}function c(z,D,j,ne,Y){const G=D.getKey(),Q=ne.getKey(),k=document.createRange();let m=z.getElementByKey(G),y=z.getElementByKey(Q),A=j,Z=Y;if(t.$isTextNode(D)&&(m=n(m)),t.$isTextNode(ne)&&(y=n(y)),D===void 0||ne===void 0||m===null||y===null)return null;m.nodeName==="BR"&&([m,A]=r(m)),y.nodeName==="BR"&&([y,Z]=r(y));const ae=m.firstChild;m===y&&ae!=null&&ae.nodeName==="BR"&&A===0&&Z===0&&(Z=1);try{k.setStart(m,A),k.setEnd(y,Z)}catch{return null}return k.collapsed&&(A!==Z||G!==Q)&&(k.setStart(y,Z),k.setEnd(m,A)),k}function d(z,D){const j=z.getRootElement();if(j===null)return[];const ne=j.getBoundingClientRect(),Y=getComputedStyle(j),G=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),Q=Array.from(D.getClientRects());let k=Q.length;Q.sort((y,A)=>{const Z=y.top-A.top;return Math.abs(Z)<=3?y.left-A.left:Z});let m;for(let y=0;y<k;y++){const A=Q[y],Z=m&&m.top<=A.top&&m.top+m.height>A.top&&m.left+m.width>A.left,ae=A.width+G===ne.width;if(Z||ae){Q.splice(y--,1),k--;continue}m=A}return Q}function g(z){const D={},j=z.split(";");for(const ne of j)if(ne!==""){const[Y,G]=ne.split(/:([^]+)/);Y&&G&&(D[Y.trim()]=G.trim())}return D}function p(z){let D=e.get(z);return D===void 0&&(D=g(z),e.set(z,D)),Object.freeze(D),D}function C(z){let D="";for(const j in z)j&&(D+=`${j}: ${z[j]};`);return D}function S(z,D){return z.__first=D.__first,z.__last=D.__last,z.__size=D.__size,z.__format=D.__format,z.__indent=D.__indent,z.__dir=D.__dir,z}function x(z,D){return z.__format=D.__format,z.__style=D.__style,z.__mode=D.__mode,z.__detail=D.__detail,z}function O(z){const j=z.constructor.clone(z);return j.__parent=z.__parent,j.__next=z.__next,j.__prev=z.__prev,t.$isElementNode(z)&&t.$isElementNode(j)?S(j,z):t.$isTextNode(z)&&t.$isTextNode(j)?x(j,z):j}function R(z,D){if(D.isSelected()&&!D.isSegmented()&&!D.isToken()&&t.$INTERNAL_isPointSelection(z)){const j=z.anchor.getNode(),ne=z.focus.getNode(),Y=D.is(j),G=D.is(ne);if(Y||G){const Q=z.isBackward(),[k,m]=z.getCharacterOffsets(),y=j.is(ne),A=D.is(Q?ne:j),Z=D.is(Q?j:ne);let ae=0,he;if(y)ae=k>m?m:k,he=k>m?k:m;else if(A)ae=Q?m:k,he=void 0;else if(Z){const se=Q?k:m;ae=0,he=se}return D.__text=D.__text.slice(ae,he),D}}return D}function b(z){return z.type==="text"?z.offset===z.getNode().getTextContentSize():z.offset===z.getNode().getChildrenSize()}function T(z,D,j){let ne=D.getNode(),Y=j;if(t.$isElementNode(ne)){const G=ne.getDescendantByIndex(D.offset);G!==null&&(ne=G)}for(;Y>0&&ne!==null;){if(t.$isElementNode(ne)){const y=ne.getLastDescendant();y!==null&&(ne=y)}let G=ne.getPreviousSibling(),Q=0;if(G===null){let y=ne.getParentOrThrow(),A=y.getPreviousSibling();for(;A===null;){if(y=y.getParent(),y===null){G=null;break}A=y.getPreviousSibling()}y!==null&&(Q=y.isInline()?0:2,G=A)}let k=ne.getTextContent();k===""&&t.$isElementNode(ne)&&!ne.isInline()&&(k=`
65
+ `)}return i}getTextContentSize(){let i=0,s=this.getChildren(),h=s.length;for(let N=0;N<h;N++){let v=s[N];i+=v.getTextContentSize(),Ze(v)&&N!==h-1&&!v.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=we[i],(this.getFormat()&i)!==0):!1}select(i,s){Jn();let h=Vt(),N=i,v=s;var M=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&s===0){if(i=this.getFirstChild(),ht(i)||Ze(i))return i.select(0,0)}else if(!(i!==void 0&&i!==M||s!==void 0&&s!==M)&&(i=this.getLastChild(),ht(i)||Ze(i)))return i.select()}if(N===void 0&&(N=M),v===void 0&&(v=M),M=this.__key,wt(h))h.anchor.set(M,N,"element"),h.focus.set(M,v,"element"),h.dirty=!0;else return Gn(M,N,M,v,"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(s=>s.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let s=this.getWritable();return s.__dir=i,s}setFormat(i){return this.getWritable().__format=i!==""?we[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,s,h){let N=h.length,v=this.getChildrenSize(),M=this.getWritable(),J=M.__key;var ge=[],ve=[];let Fe=this.getChildAtIndex(i+s),Ke=null,ke=v-s+N;if(i!==0)if(i===v)Ke=this.getLastChild();else{var Me=this.getChildAtIndex(i);Me!==null&&(Ke=Me.getPreviousSibling())}if(0<s){var Xe=Ke===null?this.getFirstChild():Ke.getNextSibling();for(Me=0;Me<s;Me++){Xe===null&&Y(100);var ut=Xe.getNextSibling(),Tt=Xe.__key;Xe=Xe.getWritable(),xt(Xe),ve.push(Tt),Xe=ut}}for(Me=Ke,ut=0;ut<N;ut++){Tt=h[ut],Me!==null&&Tt.is(Me)&&(Ke=Me=Me.getPreviousSibling()),Xe=Tt.getWritable(),Xe.__parent===J&&ke--,xt(Xe);let At=Tt.__key;Me===null?(M.__first=At,Xe.__prev=null):(Me=Me.getWritable(),Me.__next=At,Xe.__prev=Me.__key),Tt.__key===J&&Y(76),Xe.__parent=J,ge.push(At),Me=Tt}if(i+s===v?Me!==null&&(Me.getWritable().__next=null,M.__last=Me.__key):Fe!==null&&(i=Fe.getWritable(),Me!==null?(s=Me.getWritable(),i.__prev=Me.__key,s.__next=Fe.__key):i.__prev=null),M.__size=ke,ve.length&&(i=Vt(),wt(i))){ve=new Set(ve),ge=new Set(ge);let{anchor:At,focus:hn}=i;bs(At,ve,ge)&&po(At,At.getNode(),this,Ke,Fe),bs(hn,ve,ge)&&po(hn,hn.getNode(),this,Ke,Fe),ke!==0||this.canBeEmpty()||Xr(this)||this.remove()}return M}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 Ze(l){return l instanceof Xn}function bs(l,i,s){for(l=l.getNode();l;){let h=l.__key;if(i.has(h)&&!s.has(h))return!0;l=l.getParent()}return!1}class Hr extends Xn{static getType(){return"root"}static clone(){return new Hr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!oi()&&ln()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let s=0;s<i.length;s++){let h=i[s];Ze(h)||an(h)||Y(56)}return super.append(...i)}static importJSON(i){let s=fn();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function tr(l){return l instanceof Hr}function Aa(l,i){if(i=i.getEditorState()._selection,l=l._selection,l!==null){if(l.dirty||!l.is(i))return!0}else if(i!==null)return!0;return!1}function vi(){return new Co(new Map([["root",new Hr]]))}function No(l){let i=l.exportJSON();var s=l.constructor;i.type!==s.getType()&&Y(130,s.name);let h=i.children;if(Ze(l))for(Array.isArray(h)||Y(59,s.name),l=l.getChildren(),s=0;s<l.length;s++){let N=No(l[s]);h.push(N)}return i}class Co{constructor(i,s){this._nodeMap=i,this._selection=s||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Oa(this,i)}clone(i){return i=new Co(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Oa(this,()=>({root:No(fn())}))}}class wi extends Xn{static getType(){return"paragraph"}static clone(i){return new wi(i.__key)}createDOM(i){let s=document.createElement("p");return i=Kt(i.theme,"paragraph"),i!==void 0&&s.classList.add(...i),s}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Zo,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&io(i)){this.isEmpty()&&i.append(document.createElement("br"));var s=this.getFormatType();i.style.textAlign=s,(s=this.getDirection())&&(i.dir=s),s=this.getIndent(),0<s&&(i.style.textIndent=`${20*s}px`)}return{element:i}}static importJSON(i){let s=lr();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,s){i=lr();let h=this.getDirection();return i.setDirection(h),this.insertAfter(i,s),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||ht(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 Zo(l){let i=lr();return l.style&&(i.setFormat(l.style.textAlign),l=parseInt(l.style.textIndent,10)/20,0<l&&i.setIndent(l)),{node:i}}function lr(){return Bi(new wi)}function Al(l,i,s,h){let N=l._keyToDOMMap;N.clear(),l._editorState=vi(),l._pendingEditorState=h,l._compositionKey=null,l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),l._normalizedNodes=new Set,l._updateTags=new Set,l._updates=[],l._blockCursorElement=null,h=l._observer,h!==null&&(h.disconnect(),l._observer=null),i!==null&&(i.textContent=""),s!==null&&(s.textContent="",N.set("root",s))}function Ra(l,i){let s=new Map,h=new Set,N=v=>{Object.keys(v).forEach(M=>{let J=s.get(M);J===void 0&&(J=[],s.set(M,J)),J.push(v[M])})};return l.forEach(v=>{v=v.klass.importDOM!=null?v.klass.importDOM.bind(v.klass):null,v==null||h.has(v)||(h.add(v),v=v(),v!==null&&N(v))}),i&&N(i),s}class ba{constructor(i,s,h,N,v,M,J){this._parentEditor=s,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=N,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=Ge(),this._onError=v,this._htmlConversions=M,this._editable=J,this._headless=s!==null&&s._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let s=this._listeners.update;return s.add(i),()=>{s.delete(i)}}registerEditableListener(i){let s=this._listeners.editable;return s.add(i),()=>{s.delete(i)}}registerDecoratorListener(i){let s=this._listeners.decorator;return s.add(i),()=>{s.delete(i)}}registerTextContentListener(i){let s=this._listeners.textcontent;return s.add(i),()=>{s.delete(i)}}registerRootListener(i){let s=this._listeners.root;return i(this._rootElement,null),s.add(i),()=>{i(null,this._rootElement),s.delete(i)}}registerCommand(i,s,h){h===void 0&&Y(35);let N=this._commands;N.has(i)||N.set(i,[new Set,new Set,new Set,new Set,new Set]);let v=N.get(i);v===void 0&&Y(36,String(i));let M=v[h];return M.add(s),()=>{M.delete(s),v.every(J=>J.size===0)&&N.delete(i)}}registerMutationListener(i,s){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let h=this._listeners.mutation;return h.set(s,i),()=>{h.delete(s)}}registerNodeTransformToKlass(i,s){var h=i.getType();return h=this._nodes.get(h),h===void 0&&Y(37,i.name),h.transforms.add(s),h}registerNodeTransform(i,s){var h=this.registerNodeTransformToKlass(i,s);let N=[h];return h=h.replaceWithKlass,h!=null&&(h=this.registerNodeTransformToKlass(h,s),N.push(h)),ps(this,i.getType()),()=>{N.forEach(v=>v.transforms.delete(s))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,s){return ot(this,i,s)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let s=this._rootElement;if(i!==s){let M=Kt(this._config.theme,"root");var h=this._pendingEditorState||this._editorState;if(this._rootElement=i,Al(this,s,i,h),s!==null){if(!this._config.disableEvents){Fo!==0&&(Fo--,Fo===0&&s.ownerDocument.removeEventListener("selectionchange",Na));var N=s.__lexicalEditor;if(N!=null){if(N._parentEditor!==null){var v=ye(N);v=v[v.length-1]._key,co.get(v)===N&&co.delete(v)}else co.delete(N._key);s.__lexicalEditor=null}for(N=ya(s),v=0;v<N.length;v++)N[v]();s.__lexicalEventHandles=[]}M!=null&&s.classList.remove(...M)}i!==null?(h=(h=i.ownerDocument)&&h.defaultView||null,N=i.style,N.userSelect="text",N.whiteSpace="pre-wrap",N.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=h,this._dirtyType=2,Re(this),this._updateTags.add("history-merge"),Ar(this),this._config.disableEvents||Ac(i,this),M!=null&&i.classList.add(...M)):(this._editorState=h,this._window=this._pendingEditorState=null),yo("root",this,!1,i,s)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,s){i.isEmpty()&&Y(38),Oe(this);let h=this._pendingEditorState,N=this._updateTags;s=s!==void 0?s.tag:null,h===null||h.isEmpty()||(s!=null&&N.add(s),Ar(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&N.add(s),Ar(this)}parseEditorState(i,s){i=typeof i=="string"?JSON.parse(i):i;let h=vi(),N=yn,v=Sn,M=xn,J=this._dirtyElements,ge=this._dirtyLeaves,ve=this._cloneNotNeeded,Fe=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,yn=h,Sn=!1,xn=this;try{_o(i.root,this._nodes),s&&s(),h._readOnly=!0}catch(Ke){Ke instanceof Error&&this._onError(Ke)}finally{this._dirtyElements=J,this._dirtyLeaves=ge,this._cloneNotNeeded=ve,this._dirtyType=Fe,yn=N,Sn=v,xn=M}return h}update(i,s){sr(this,i,s)}focus(i,s={}){let h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),sr(this,()=>{let N=Vt(),v=fn();N!==null?N.dirty=!0:v.getChildrenSize()!==0&&(s.defaultSelection==="rootStart"?v.selectStart():v.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=kr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,yo("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Ls extends Xn{constructor(i,s){super(s),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 Nr(l){return l instanceof Ls}class La extends Xn{}function ks(l){return l instanceof La}class ka extends Xn{}function Jo(l){return l instanceof ka}return $e.$INTERNAL_isPointSelection=vl,$e.$addUpdateTag=function(l){Jn(),ln()._updateTags.add(l)},$e.$applyNodeReplacement=Bi,$e.$copyNode=ul,$e.$createLineBreakNode=$r,$e.$createNodeSelection=Mr,$e.$createParagraphNode=lr,$e.$createRangeSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Ki(l,i,0,"")},$e.$createTabNode=Wi,$e.$createTextNode=Bn,$e.$getAdjacentNode=mn,$e.$getNearestNodeFromDOMNode=vr,$e.$getNearestRootOrShadowRoot=cl,$e.$getNodeByKey=It,$e.$getPreviousSelection=Ui,$e.$getRoot=fn,$e.$getSelection=Vt,$e.$getTextContent=function(){let l=Vt();return l===null?"":l.getTextContent()},$e.$hasAncestor=mi,$e.$hasUpdateTag=function(l){return ln()._updateTags.has(l)},$e.$insertNodes=function(l){let i=Vt()||Ui();i===null&&(i=fn().selectEnd()),i.insertNodes(l)},$e.$isBlockElementNode=function(l){return Ze(l)&&!l.isInline()},$e.$isDecoratorNode=an,$e.$isElementNode=Ze,$e.$isInlineElementOrDecoratorNode=function(l){return Ze(l)&&l.isInline()||an(l)&&l.isInline()},$e.$isLeafNode=function(l){return ht(l)||Ei(l)||an(l)},$e.$isLineBreakNode=Ei,$e.$isNodeSelection=Go,$e.$isParagraphNode=function(l){return l instanceof wi},$e.$isRangeSelection=wt,$e.$isRootNode=tr,$e.$isRootOrShadowRoot=Xr,$e.$isTabNode=xa,$e.$isTextNode=ht,$e.$nodesOfType=function(l){var i=yr();let s=i._readOnly,h=l.getType();i=i._nodeMap;let N=[];for(let[,v]of i)v instanceof l&&v.__type===h&&(s||v.isAttached())&&N.push(v);return N},$e.$normalizeSelection__EXPERIMENTAL=Qe,$e.$parseSerializedNode=function(l){return _o(l,ln()._nodes)},$e.$selectAll=function(){var l=fn();l=l.select(0,l.getChildrenSize()),gr(Qe(l))},$e.$setCompositionKey=bt,$e.$setSelection=gr,$e.$splitNode=function(l,i){let s=l.getChildAtIndex(i);s==null&&(s=l),Xr(l)&&Y(102);let h=M=>{const J=M.getParentOrThrow(),ge=Xr(J),ve=M!==s||ge?ul(M):M;if(ge)return M.insertAfter(ve),[M,ve,ve];const[Fe,Ke,ke]=h(J);return M=M.getNextSiblings(),ke.append(ve,...M),[Fe,Ke,ve]},[N,v]=h(s);return[N,v]},$e.BLUR_COMMAND=V,$e.CAN_REDO_COMMAND={},$e.CAN_UNDO_COMMAND={},$e.CLEAR_EDITOR_COMMAND={},$e.CLEAR_HISTORY_COMMAND={},$e.CLICK_COMMAND=e,$e.COMMAND_PRIORITY_CRITICAL=4,$e.COMMAND_PRIORITY_EDITOR=0,$e.COMMAND_PRIORITY_HIGH=3,$e.COMMAND_PRIORITY_LOW=1,$e.COMMAND_PRIORITY_NORMAL=2,$e.CONTROLLED_TEXT_INSERTION_COMMAND=d,$e.COPY_COMMAND=pe,$e.CUT_COMMAND=ue,$e.DELETE_CHARACTER_COMMAND=n,$e.DELETE_LINE_COMMAND=S,$e.DELETE_WORD_COMMAND=C,$e.DEPRECATED_$computeGridMap=Si,$e.DEPRECATED_$createGridSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Os("root",l,i)},$e.DEPRECATED_$getGridCellNodeRect=_r,$e.DEPRECATED_$getNodeTriplet=ii,$e.DEPRECATED_$isGridCellNode=Nr,$e.DEPRECATED_$isGridNode=ks,$e.DEPRECATED_$isGridRowNode=Jo,$e.DEPRECATED_$isGridSelection=Uo,$e.DEPRECATED_GridCellNode=Ls,$e.DEPRECATED_GridNode=La,$e.DEPRECATED_GridRowNode=ka,$e.DRAGEND_COMMAND=_e,$e.DRAGOVER_COMMAND=me,$e.DRAGSTART_COMMAND=q,$e.DROP_COMMAND=U,$e.DecoratorNode=Ma,$e.ElementNode=Xn,$e.FOCUS_COMMAND=D,$e.FORMAT_ELEMENT_COMMAND={},$e.FORMAT_TEXT_COMMAND=T,$e.INDENT_CONTENT_COMMAND={},$e.INSERT_LINE_BREAK_COMMAND=r,$e.INSERT_PARAGRAPH_COMMAND=c,$e.INSERT_TAB_COMMAND={},$e.KEY_ARROW_DOWN_COMMAND=H,$e.KEY_ARROW_LEFT_COMMAND=$,$e.KEY_ARROW_RIGHT_COMMAND=x,$e.KEY_ARROW_UP_COMMAND=P,$e.KEY_BACKSPACE_COMMAND=X,$e.KEY_DELETE_COMMAND=le,$e.KEY_DOWN_COMMAND=b,$e.KEY_ENTER_COMMAND=B,$e.KEY_ESCAPE_COMMAND=ee,$e.KEY_MODIFIER_COMMAND=ne,$e.KEY_SPACE_COMMAND=z,$e.KEY_TAB_COMMAND=j,$e.LineBreakNode=Pr,$e.MOVE_TO_END=w,$e.MOVE_TO_START=W,$e.OUTDENT_CONTENT_COMMAND={},$e.PASTE_COMMAND=g,$e.ParagraphNode=wi,$e.REDO_COMMAND=R,$e.REMOVE_TEXT_COMMAND=p,$e.RootNode=Hr,$e.SELECTION_CHANGE_COMMAND=t,$e.SELECT_ALL_COMMAND=K,$e.TabNode=uo,$e.TextNode=ri,$e.UNDO_COMMAND=O,$e.createCommand=function(){return{}},$e.createEditor=function(l){var i=l||{},s=xn,h=i.theme||{};let N=l===void 0?s:i.parentEditor||null,v=i.disableEvents||!1,M=vi(),J=i.namespace||(N!==null?N._config.namespace:Ge()),ge=i.editorState,ve=[Hr,ri,Pr,uo,wi,...i.nodes||[]],{onError:Fe,html:Ke}=i;if(i=i.editable!==void 0?i.editable:!0,l===void 0&&s!==null)l=s._nodes;else for(l=new Map,s=0;s<ve.length;s++){let Me=ve[s],Xe=null;var ke=null;typeof Me!="function"&&(ke=Me,Me=ke.replace,Xe=ke.with,ke=ke.withKlass||null);let ut=Me.getType(),Tt=Me.transform(),At=new Set;Tt!==null&&At.add(Tt),l.set(ut,{exportDOM:Ke&&Ke.export?Ke.export.get(Me):void 0,klass:Me,replace:Xe,replaceWithKlass:ke,transforms:At})}return h=new ba(M,N,l,{disableEvents:v,namespace:J,theme:h},Fe||console.error,Ra(l,Ke?Ke.import:void 0),i),ge!==void 0&&(h._pendingEditorState=ge,h._dirtyType=2),h},$e.getNearestEditorFromDOMNode=_t,$e.isHTMLAnchorElement=function(l){return io(l)&&l.tagName==="A"},$e.isHTMLElement=io,$e.isSelectionCapturedInDecoratorInput=Ve,$e.isSelectionWithinEditor=rt,$e}var Vc,Of;function Bt(){return Of||(Of=1,Vc=process.env.NODE_ENV==="development"?vN():wN()),Vc}var Df;function ON(){if(Df)return Yc;Df=1;var t=Un(),e=Bt(),n=et;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 p({initialConfig:S,children:T}){const O=n.useMemo(()=>{const{theme:R,namespace:b,editor__DEPRECATED:x,nodes:w,onError:$,editorState:W,html:P}=S,H=t.createLexicalComposerContext(null,R);let B=x||null;if(B===null){const z=e.createEditor({editable:S.editable,html:P,namespace:b,nodes:w,onError:X=>$(X,z),theme:R});C(z,W),B=z}return[B,H]},[]);return d(()=>{const R=S.editable,[b]=O;b.setEditable(R!==void 0?R:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:O},T)}function C(S,T){if(T!==null){if(T===void 0)S.update(()=>{const O=e.$getRoot();if(O.isEmpty()){const R=e.$createParagraphNode();O.append(R);const b=r?document.activeElement:null;(e.$getSelection()!==null||b!==null&&b===S.getRootElement())&&R.select()}},g);else if(T!==null)switch(typeof T){case"string":{const O=S.parseEditorState(T);S.setEditorState(O,g);break}case"object":{S.setEditorState(T,g);break}case"function":{S.update(()=>{e.$getRoot().isEmpty()&&T(S)},g);break}}}}return Yc.LexicalComposer=p,Yc}var qc={},Mf;function DN(){if(Mf)return qc;Mf=1;var t=Un(),e=Bt(),n=et;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(p,C){if(C!==null){if(C===void 0)p.update(()=>{var S=e.$getRoot();if(S.isEmpty()){let T=e.$createParagraphNode();S.append(T),S=r?document.activeElement:null,(e.$getSelection()!==null||S!==null&&S===p.getRootElement())&&T.select()}},d);else if(C!==null)switch(typeof C){case"string":let S=p.parseEditorState(C);p.setEditorState(S,d);break;case"object":p.setEditorState(C,d);break;case"function":p.update(()=>{e.$getRoot().isEmpty()&&C(p)},d)}}}return qc.LexicalComposer=function({initialConfig:p,children:C}){let S=n.useMemo(()=>{const{theme:T,namespace:O,editor__DEPRECATED:R,nodes:b,onError:x,editorState:w,html:$}=p,W=t.createLexicalComposerContext(null,T);let P=R||null;if(P===null){const H=e.createEditor({editable:p.editable,html:$,namespace:O,nodes:b,onError:B=>x(B,H),theme:T});g(H,w),P=H}return[P,W]},[]);return c(()=>{let T=p.editable,[O]=S;O.setEditable(T!==void 0?T:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:S},C)},qc}const MN=process.env.NODE_ENV==="development"?ON():DN();var AN=MN,Zc={},Jc,Af;function RN(){if(Af)return Jc;Af=1;var t=Un(),e=et,c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function d(C){const[S]=t.useLexicalComposerContext(),T=e.useMemo(()=>C(S),[S,C]),O=e.useRef(T.initialValueFn()),[R,b]=e.useState(O.current);return c(()=>{const{initialValueFn:x,subscribe:w}=T,$=x();return O.current!==$&&(O.current=$,b($)),w(W=>{O.current=W,b(W)})},[T,C]),R}function g(C){return{initialValueFn:()=>C.isEditable(),subscribe:S=>C.registerEditableListener(S)}}function p(){return d(g)}return Jc=p,Jc}var Xc,Rf;function bN(){if(Rf)return Xc;Rf=1;var t=Un(),e=et,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function r(d){let[g]=t.useLexicalComposerContext(),p=e.useMemo(()=>d(g),[g,d]),C=e.useRef(p.initialValueFn()),[S,T]=e.useState(C.current);return n(()=>{let{initialValueFn:O,subscribe:R}=p,b=O();return C.current!==b&&(C.current=b,T(b)),R(x=>{C.current=x,T(x)})},[p,d]),S}function c(d){return{initialValueFn:()=>d.isEditable(),subscribe:g=>d.registerEditableListener(g)}}return Xc=function(){return r(c)},Xc}var Qc,bf;function mp(){return bf||(bf=1,Qc=process.env.NODE_ENV==="development"?RN():bN()),Qc}var Xi={},Lf;function LN(){if(Lf)return Xi;Lf=1;var t=Bt();function e(C,S){let T=C.getFirstChild(),O=0;e:for(;T!==null;){if(t.$isElementNode(T)){const x=T.getFirstChild();if(x!==null){T=x;continue}}else if(t.$isTextNode(T)){const x=T.getTextContentSize();if(O+x>S)return{node:T,offset:S-O};O+=x}const R=T.getNextSibling();if(R!==null){T=R;continue}let b=T.getParent();for(;b!==null;){const x=b.getNextSibling();if(x!==null){T=x;continue e}b=b.getParent()}break}return null}function n(C,S=!0){if(C)return!1;let T=c();return S&&(T=T.trim()),T===""}function r(C,S){return()=>n(C,S)}function c(){return t.$getRoot().getTextContent()}function d(C){if(!n(C,!1))return!1;const T=t.$getRoot().getChildren(),O=T.length;if(O>1)return!1;for(let R=0;R<O;R++){const b=T[R];if(t.$isDecoratorNode(b))return!1;if(t.$isElementNode(b)){if(!t.$isParagraphNode(b)||b.__indent!==0)return!1;const x=b.getChildren(),w=x.length;for(let $=0;$<w;$++){const W=x[R];if(!t.$isTextNode(W))return!1}}}return!0}function g(C){return()=>d(C)}function p(C,S,T,O){const R=H=>H instanceof T,b=H=>{const B=t.$createTextNode(H.getTextContent());B.setFormat(H.getFormat()),H.replace(B)},x=H=>H.getLatest().__mode,w=H=>{if(!H.isSimpleText())return;const B=H.getPreviousSibling();let z=H.getTextContent(),X=H,ee;if(t.$isTextNode(B)){const le=B.getTextContent(),j=le+z,U=S(j);if(R(B))if(U===null||x(B)!==0){b(B);return}else{const q=U.end-le.length;if(q>0){const me=z.slice(0,q),_e=le+me;if(B.select(),B.setTextContent(_e),q===z.length)H.remove();else{const pe=z.slice(q);H.setTextContent(pe)}return}}else if(U===null||U.start<le.length)return}for(;;){ee=S(z);let le=ee===null?"":z.slice(ee.end);if(z=le,le===""){const q=X.getNextSibling();if(t.$isTextNode(q)){le=X.getTextContent()+q.getTextContent();const me=S(le);if(me===null){R(q)?b(q):q.markDirty();return}else if(me.start!==0)return}}else{const q=S(le);if(q!==null&&q.start===0)return}if(ee===null)return;if(ee.start===0&&t.$isTextNode(B)&&B.isTextEntity())continue;let j;ee.start===0?[j,X]=X.splitText(ee.end):[,j,X]=X.splitText(ee.start,ee.end);const U=O(j);if(U.setFormat(j.getFormat()),j.replace(U),X==null)return}},$=H=>{const B=H.getTextContent(),z=S(B);if(z===null||z.start!==0){b(H);return}if(B.length>z.end){H.splitText(z.end);return}const X=H.getPreviousSibling();t.$isTextNode(X)&&X.isTextEntity()&&(b(X),b(H));const ee=H.getNextSibling();t.$isTextNode(ee)&&ee.isTextEntity()&&(b(ee),R(H)&&b(H))},W=C.registerNodeTransform(t.TextNode,w),P=C.registerNodeTransform(T,$);return[W,P]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=g,Xi.$findTextIntersectionFromCharacters=e,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=c,Xi.registerLexicalTextEntity=p,Xi}var Qi={},kf;function kN(){if(kf)return Qi;kf=1;var t=Bt();function e(c,d=!0){return c?!1:(c=n(),d&&(c=c.trim()),c==="")}function n(){return t.$getRoot().getTextContent()}function r(c){if(!e(c,!1))return!1;c=t.$getRoot().getChildren();let d=c.length;if(1<d)return!1;for(let p=0;p<d;p++){var g=c[p];if(t.$isDecoratorNode(g))return!1;if(t.$isElementNode(g)){if(!t.$isParagraphNode(g)||g.__indent!==0)return!1;g=g.getChildren();let C=g.length;for(let S=0;S<C;S++)if(!t.$isTextNode(g[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(c){return()=>r(c)},Qi.$findTextIntersectionFromCharacters=function(c,d){var g=c.getFirstChild();c=0;e:for(;g!==null;){if(t.$isElementNode(g)){var p=g.getFirstChild();if(p!==null){g=p;continue}}else if(t.$isTextNode(g)){if(p=g.getTextContentSize(),c+p>d)return{node:g,offset:d-c};c+=p}if(p=g.getNextSibling(),p!==null)g=p;else{for(g=g.getParent();g!==null;){if(p=g.getNextSibling(),p!==null){g=p;continue e}g=g.getParent()}break}}return null},Qi.$isRootTextContentEmpty=e,Qi.$isRootTextContentEmptyCurry=function(c,d){return()=>e(c,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(c,d,g,p){let C=T=>{const O=t.$createTextNode(T.getTextContent());O.setFormat(T.getFormat()),T.replace(O)},S=c.registerNodeTransform(t.TextNode,T=>{if(T.isSimpleText()){var O=T.getPreviousSibling(),R=T.getTextContent(),b=T;if(t.$isTextNode(O)){var x=O.getTextContent(),w=d(x+R);if(O instanceof g){if(w===null||O.getLatest().__mode!==0){C(O);return}if(w=w.end-x.length,0<w){b=R.slice(0,w),b=x+b,O.select(),O.setTextContent(b),w===R.length?T.remove():(O=R.slice(w),T.setTextContent(O));return}}else if(w===null||w.start<x.length)return}for(;;){if(T=d(R),R=w=T===null?"":R.slice(T.end),w===""){if(x=b.getNextSibling(),t.$isTextNode(x)){if(w=b.getTextContent()+x.getTextContent(),w=d(w),w===null){x instanceof g?C(x):x.markDirty();break}else if(w.start!==0)break}}else if(x=d(w),x!==null&&x.start===0)break;if(T===null)break;if(T.start===0&&t.$isTextNode(O)&&O.isTextEntity())continue;let $;if(T.start===0?[$,b]=b.splitText(T.end):[,$,b]=b.splitText(T.start,T.end),T=p($),T.setFormat($.getFormat()),$.replace(T),b==null)break}}});return c=c.registerNodeTransform(g,T=>{var O=T.getTextContent();const R=d(O);R===null||R.start!==0?C(T):O.length>R.end?T.splitText(R.end):(O=T.getPreviousSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(C(O),C(T)),O=T.getNextSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(C(O),T instanceof g&&C(T)))}),[S,c]},Qi}var eu,If;function _p(){return If||(If=1,eu=process.env.NODE_ENV==="development"?LN():kN()),eu}var Nn={},Kn={},Pf;function IN(){if(Pf)return Kn;Pf=1;var t=Bt();const e=new Map;function n(K){let D=K;for(;D!=null;){if(D.nodeType===Node.TEXT_NODE)return D;D=D.firstChild}return null}function r(K){const D=K.parentNode;if(D==null)throw new Error("Should never happen");return[D,Array.from(D.childNodes).indexOf(K)]}function c(K,D,V,ne,Y){const G=D.getKey(),Q=ne.getKey(),k=document.createRange();let m=K.getElementByKey(G),y=K.getElementByKey(Q),A=V,Z=Y;if(t.$isTextNode(D)&&(m=n(m)),t.$isTextNode(ne)&&(y=n(y)),D===void 0||ne===void 0||m===null||y===null)return null;m.nodeName==="BR"&&([m,A]=r(m)),y.nodeName==="BR"&&([y,Z]=r(y));const ae=m.firstChild;m===y&&ae!=null&&ae.nodeName==="BR"&&A===0&&Z===0&&(Z=1);try{k.setStart(m,A),k.setEnd(y,Z)}catch{return null}return k.collapsed&&(A!==Z||G!==Q)&&(k.setStart(y,Z),k.setEnd(m,A)),k}function d(K,D){const V=K.getRootElement();if(V===null)return[];const ne=V.getBoundingClientRect(),Y=getComputedStyle(V),G=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),Q=Array.from(D.getClientRects());let k=Q.length;Q.sort((y,A)=>{const Z=y.top-A.top;return Math.abs(Z)<=3?y.left-A.left:Z});let m;for(let y=0;y<k;y++){const A=Q[y],Z=m&&m.top<=A.top&&m.top+m.height>A.top&&m.left+m.width>A.left,ae=A.width+G===ne.width;if(Z||ae){Q.splice(y--,1),k--;continue}m=A}return Q}function g(K){const D={},V=K.split(";");for(const ne of V)if(ne!==""){const[Y,G]=ne.split(/:([^]+)/);Y&&G&&(D[Y.trim()]=G.trim())}return D}function p(K){let D=e.get(K);return D===void 0&&(D=g(K),e.set(K,D)),Object.freeze(D),D}function C(K){let D="";for(const V in K)V&&(D+=`${V}: ${K[V]};`);return D}function S(K,D){return K.__first=D.__first,K.__last=D.__last,K.__size=D.__size,K.__format=D.__format,K.__indent=D.__indent,K.__dir=D.__dir,K}function T(K,D){return K.__format=D.__format,K.__style=D.__style,K.__mode=D.__mode,K.__detail=D.__detail,K}function O(K){const V=K.constructor.clone(K);return V.__parent=K.__parent,V.__next=K.__next,V.__prev=K.__prev,t.$isElementNode(K)&&t.$isElementNode(V)?S(V,K):t.$isTextNode(K)&&t.$isTextNode(V)?T(V,K):V}function R(K,D){if(D.isSelected()&&!D.isSegmented()&&!D.isToken()&&t.$INTERNAL_isPointSelection(K)){const V=K.anchor.getNode(),ne=K.focus.getNode(),Y=D.is(V),G=D.is(ne);if(Y||G){const Q=K.isBackward(),[k,m]=K.getCharacterOffsets(),y=V.is(ne),A=D.is(Q?ne:V),Z=D.is(Q?V:ne);let ae=0,he;if(y)ae=k>m?m:k,he=k>m?k:m;else if(A)ae=Q?m:k,he=void 0;else if(Z){const se=Q?k:m;ae=0,he=se}return D.__text=D.__text.slice(ae,he),D}}return D}function b(K){return K.type==="text"?K.offset===K.getNode().getTextContentSize():K.offset===K.getNode().getChildrenSize()}function x(K,D,V){let ne=D.getNode(),Y=V;if(t.$isElementNode(ne)){const G=ne.getDescendantByIndex(D.offset);G!==null&&(ne=G)}for(;Y>0&&ne!==null;){if(t.$isElementNode(ne)){const y=ne.getLastDescendant();y!==null&&(ne=y)}let G=ne.getPreviousSibling(),Q=0;if(G===null){let y=ne.getParentOrThrow(),A=y.getPreviousSibling();for(;A===null;){if(y=y.getParent(),y===null){G=null;break}A=y.getPreviousSibling()}y!==null&&(Q=y.isInline()?0:2,G=A)}let k=ne.getTextContent();k===""&&t.$isElementNode(ne)&&!ne.isInline()&&(k=`
66
66
 
67
- `);const m=k.length;if(!t.$isTextNode(ne)||Y>=m){const y=ne.getParent();ne.remove(),y!=null&&y.getChildrenSize()===0&&!t.$isRootNode(y)&&y.remove(),Y-=m+Q,ne=G}else{const y=ne.getKey(),A=z.getEditorState().read(()=>{const he=t.$getNodeByKey(y);return t.$isTextNode(he)&&he.isSimpleText()?he.getTextContent():null}),Z=m-Y,ae=k.slice(0,Z);if(A!==null&&A!==k){const he=t.$getPreviousSelection();let se=ne;if(ne.isSimpleText())ne.setTextContent(A);else{const Te=t.$createTextNode(A);ne.replace(Te),se=Te}if(t.$isRangeSelection(he)&&he.isCollapsed()){const Te=he.anchor.offset;se.select(Te,Te)}}else if(ne.isSimpleText()){const he=D.key===y;let se=D.offset;se<Y&&(se=m);const Te=he?se-Y:0,be=he?se:Z;if(he&&Te===0){const[Ue]=ne.splitText(Te,be);Ue.remove()}else{const[,Ue]=ne.splitText(Te,be);Ue.remove()}}else{const he=t.$createTextNode(ae);ne.replace(he)}Y=0}}}function w(z){const D=z.getStyle(),j=g(D);e.set(D,j)}function P(z,D){const j=p("getStyle"in z?z.getStyle():z.style),ne=Object.entries(D).reduce((G,[Q,k])=>(k===null?delete G[Q]:G[Q]=k,G),{...j}),Y=C(ne);z.setStyle(Y),e.set(Y,ne)}function H(z,D){const j=z.getNodes(),ne=j.length;if(t.DEPRECATED_$isGridSelection(z)){const te=t.$createRangeSelection(),ce=te.anchor,we=te.focus;for(let Le=0;Le<ne;Le++){const Be=j[Le];t.DEPRECATED_$isGridCellNode(Be)&&(ce.set(Be.getKey(),0,"element"),we.set(Be.getKey(),Be.getChildrenSize(),"element"),H(t.$normalizeSelection__EXPERIMENTAL(te),D))}t.$setSelection(z);return}const Y=ne-1;let G=j[0],Q=j[Y];if(z.isCollapsed()&&t.$isRangeSelection(z)){P(z,D);return}const k=z.anchor,m=z.focus,A=G.getTextContent().length,Z=m.offset;let ae=k.offset;const he=k.isBefore(m);let se=he?ae:Z,Te=he?Z:ae;const be=he?k.type:m.type,Ue=he?m.type:k.type,re=he?m.key:k.key;if(t.$isTextNode(G)&&se===A){const te=G.getNextSibling();t.$isTextNode(te)&&(ae=0,se=0,G=te)}if(j.length===1){if(t.$isTextNode(G)){if(se=be==="element"?0:ae>Z?Z:ae,Te=Ue==="element"?A:ae>Z?ae:Z,se===Te)return;if(se===0&&Te===A)P(G,D),G.select(se,Te);else{const te=G.splitText(se,Te),ce=se===0?te[0]:te[1];P(ce,D),ce.select(0,Te-se)}}}else{if(t.$isTextNode(G)&&se<G.getTextContentSize()&&(se!==0&&(G=G.splitText(se)[1],se=0,k.set(G.getKey(),se,"text")),P(G,D)),t.$isTextNode(Q)){const ce=Q.getTextContent().length;Q.__key!==re&&Te!==0&&(Te=ce),Te!==ce&&([Q]=Q.splitText(Te)),Te!==0&&P(Q,D)}for(let te=1;te<Y;te++){const ce=j[te],we=ce.getKey();t.$isTextNode(ce)&&we!==G.getKey()&&we!==Q.getKey()&&!ce.isToken()&&P(ce,D)}}}function $(z,D){if(z.anchor.key==="root"){const Y=D(),G=t.$getRoot(),Q=G.getFirstChild();Q?Q.replace(Y,!0):G.append(Y);return}const j=z.getNodes(),ne=ue(z.anchor.getNode(),pe);ne&&j.indexOf(ne)===-1&&j.push(ne);for(let Y=0;Y<j.length;Y++){const G=j[Y];if(!pe(G))continue;const Q=D();Q.setFormat(G.getFormatType()),Q.setIndent(G.getIndent()),G.replace(Q,!0)}}function W(z){return z.getNode().isAttached()}function B(z){let D=z;for(;D!==null&&!t.$isRootOrShadowRoot(D);){const j=D.getLatest(),ne=D.getParent();j.getChildrenSize()===0&&D.remove(!0),D=ne}}function K(z,D,j=null){const ne=z.getNodes(),Y=ne.length,G=z.anchor;if(Y===0||Y===1&&G.type==="element"&&G.getNode().getChildrenSize()===0){const m=G.type==="text"?G.getNode().getParentOrThrow():G.getNode(),y=m.getChildren();let A=D();A.setFormat(m.getFormatType()),A.setIndent(m.getIndent()),y.forEach(Z=>A.append(Z)),j&&(A=j.append(A)),m.replace(A);return}let Q=null,k=[];for(let m=0;m<Y;m++){const y=ne[m];t.$isRootOrShadowRoot(y)?(X(z,k,k.length,D,j),k=[],Q=y):Q===null||Q!==null&&t.$hasAncestor(y,Q)?k.push(y):(X(z,k,k.length,D,j),k=[y])}X(z,k,k.length,D,j)}function X(z,D,j,ne,Y=null){if(D.length===0)return;const G=D[0],Q=new Map,k=[];let m=t.$isElementNode(G)?G:G.getParentOrThrow();m.isInline()&&(m=m.getParentOrThrow());let y=!1;for(;m!==null;){const se=m.getPreviousSibling();if(se!==null){m=se,y=!0;break}if(m=m.getParentOrThrow(),t.$isRootOrShadowRoot(m))break}const A=new Set;for(let se=0;se<j;se++){const Te=D[se];t.$isElementNode(Te)&&Te.getChildrenSize()===0&&A.add(Te.getKey())}const Z=new Set;for(let se=0;se<j;se++){const Te=D[se];let be=Te.getParent();if(be!==null&&be.isInline()&&(be=be.getParent()),be!==null&&t.$isLeafNode(Te)&&!Z.has(Te.getKey())){const Ue=be.getKey();if(Q.get(Ue)===void 0){const re=ne();re.setFormat(be.getFormatType()),re.setIndent(be.getIndent()),k.push(re),Q.set(Ue,re),be.getChildren().forEach(te=>{re.append(te),Z.add(te.getKey()),t.$isElementNode(te)&&te.getChildrenKeys().forEach(ce=>Z.add(ce))}),B(be)}}else if(A.has(Te.getKey())){const Ue=ne();Ue.setFormat(Te.getFormatType()),Ue.setIndent(Te.getIndent()),k.push(Ue),Te.remove(!0)}}if(Y!==null)for(let se=0;se<k.length;se++){const Te=k[se];Y.append(Te)}let ae=null;if(t.$isRootOrShadowRoot(m))if(y)if(Y!==null)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te)}else{const se=m.getFirstChild();if(t.$isElementNode(se)&&(m=se),se===null)if(Y)m.append(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];m.append(be),ae=be}else if(Y!==null)se.insertBefore(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];se.insertBefore(be),ae=be}}else if(Y)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te),ae=Te}const he=t.$getPreviousSelection();t.$isRangeSelection(he)&&W(he.anchor)&&W(he.focus)?t.$setSelection(he.clone()):ae!==null?ae.selectEnd():z.dirty=!0}function ee(z,D){const j=t.$getAdjacentNode(z.focus,D);return t.$isDecoratorNode(j)&&!j.isIsolated()||t.$isElementNode(j)&&!j.isInline()&&!j.canBeEmpty()}function le(z,D,j,ne){z.modify(D?"extend":"move",j,ne)}function V(z){const D=z.anchor.getNode();return(t.$isRootNode(D)?D:D.getParentOrThrow()).getDirection()==="rtl"}function U(z,D,j){const ne=V(z);le(z,D,j?!ne:ne,"character")}function q(z){const D=z.anchor,j=z.focus,G=D.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Q=G.getFirstDescendant(),k=G.getLastDescendant(),m="element",y="element",A=0;t.$isTextNode(Q)?m="text":!t.$isElementNode(Q)&&Q!==null&&(Q=Q.getParentOrThrow()),t.$isTextNode(k)?(y="text",A=k.getTextContentSize()):!t.$isElementNode(k)&&k!==null&&(k=k.getParentOrThrow()),Q&&k&&(D.set(Q.getKey(),0,m),j.set(k.getKey(),A,y))}function me(z,D,j){const ne=z.getStyle(),Y=p(ne);return Y!==null&&Y[D]||j}function _e(z,D,j=""){let ne=null;const Y=z.getNodes(),G=z.anchor,Q=z.focus,k=z.isBackward(),m=k?Q.offset:G.offset,y=k?Q.getNode():G.getNode();if(z.isCollapsed()&&z.style!==""){const A=z.style,Z=p(A);if(Z!==null&&D in Z)return Z[D]}for(let A=0;A<Y.length;A++){const Z=Y[A];if(!(A!==0&&m===0&&Z.is(y))&&t.$isTextNode(Z)){const ae=me(Z,D,j);if(ne===null)ne=ae;else if(ne!==ae){ne="";break}}}return ne===null?j:ne}function pe(z){if(t.$isDecoratorNode(z)&&!z.isInline())return!0;if(!t.$isElementNode(z)||t.$isRootOrShadowRoot(z))return!1;const D=z.getFirstChild(),j=D===null||t.$isLineBreakNode(D)||t.$isTextNode(D)||D.isInline();return!z.isInline()&&z.canBeEmpty()!==!1&&j}function ue(z,D){let j=z;for(;j!==null&&j.getParent()!==null&&!D(j);)j=j.getParentOrThrow();return D(j)?j:null}return Kn.$addNodeStyle=w,Kn.$cloneWithProperties=O,Kn.$getSelectionStyleValueForProperty=_e,Kn.$isAtNodeEnd=b,Kn.$isParentElementRTL=V,Kn.$moveCaretSelection=le,Kn.$moveCharacter=U,Kn.$patchStyleText=H,Kn.$selectAll=q,Kn.$setBlocksType=$,Kn.$shouldOverrideDefaultCharacterSelection=ee,Kn.$sliceSelectedTextNodeContent=R,Kn.$wrapNodes=K,Kn.createDOMRange=c,Kn.createRectsFromDOMRange=d,Kn.getStyleObjectFromCSS=p,Kn.trimTextContentFromAnchor=T,Kn}var zn={},kf;function PN(){if(kf)return zn;kf=1;var t=Bt();let e=new Map;function n(T){for(;T!=null;){if(T.nodeType===Node.TEXT_NODE)return T;T=T.firstChild}return null}function r(T){let w=T.parentNode;if(w==null)throw Error("Should never happen");return[w,Array.from(w.childNodes).indexOf(T)]}function c(T){let w={};T=T.split(";");for(let P of T)if(P!==""){let[H,$]=P.split(/:([^]+)/);H&&$&&(w[H.trim()]=$.trim())}return w}function d(T){let w=e.get(T);return w===void 0&&(w=c(T),e.set(T,w)),w}function g(T){let w="";for(let P in T)P&&(w+=`${P}: ${T[P]};`);return w}function p(T,w){var P=d("getStyle"in T?T.getStyle():T.style);w=Object.entries(w).reduce((H,[$,W])=>(W===null?delete H[$]:H[$]=W,H),{...P}),P=g(w),T.setStyle(P),e.set(P,w)}function C(T,w){var P=T.getNodes(),H=P.length;if(t.DEPRECATED_$isGridSelection(T)){for(var $=t.$createRangeSelection(),W=$.anchor,B=$.focus,K=0;K<H;K++){var X=P[K];t.DEPRECATED_$isGridCellNode(X)&&(W.set(X.getKey(),0,"element"),B.set(X.getKey(),X.getChildrenSize(),"element"),C(t.$normalizeSelection__EXPERIMENTAL($),w))}t.$setSelection(T)}else if(--H,$=P[0],W=P[H],T.isCollapsed()&&t.$isRangeSelection(T))p(T,w);else{K=T.anchor;var ee=T.focus;X=$.getTextContent().length;var le=ee.offset,V=K.offset,U=K.isBefore(ee);B=U?V:le,T=U?le:V;var q=U?K.type:ee.type,me=U?ee.type:K.type;if(ee=U?ee.key:K.key,t.$isTextNode($)&&B===X&&(U=$.getNextSibling(),t.$isTextNode(U)&&(B=V=0,$=U)),P.length===1)t.$isTextNode($)&&(B=q==="element"?0:V>le?le:V,T=me==="element"?X:V>le?V:le,B!==T&&(B===0&&T===X?(p($,w),$.select(B,T)):(P=$.splitText(B,T),P=B===0?P[0]:P[1],p(P,w),P.select(0,T-B))));else for(t.$isTextNode($)&&B<$.getTextContentSize()&&(B!==0&&($=$.splitText(B)[1],B=0,K.set($.getKey(),B,"text")),p($,w)),t.$isTextNode(W)&&(B=W.getTextContent().length,W.__key!==ee&&T!==0&&(T=B),T!==B&&([W]=W.splitText(T)),T!==0&&p(W,w)),T=1;T<H;T++)B=P[T],K=B.getKey(),t.$isTextNode(B)&&K!==$.getKey()&&K!==W.getKey()&&!B.isToken()&&p(B,w)}}function S(T){for(;T!==null&&!t.$isRootOrShadowRoot(T);){let w=T.getLatest(),P=T.getParent();w.getChildrenSize()===0&&T.remove(!0),T=P}}function x(T,w,P,H,$=null){if(w.length!==0){var W=w[0],B=new Map,K=[];W=t.$isElementNode(W)?W:W.getParentOrThrow(),W.isInline()&&(W=W.getParentOrThrow());for(var X=!1;W!==null;){var ee=W.getPreviousSibling();if(ee!==null){W=ee,X=!0;break}if(W=W.getParentOrThrow(),t.$isRootOrShadowRoot(W))break}ee=new Set;for(var le=0;le<P;le++){var V=w[le];t.$isElementNode(V)&&V.getChildrenSize()===0&&ee.add(V.getKey())}var U=new Set;for(le=0;le<P;le++){V=w[le];var q=V.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&t.$isLeafNode(V)&&!U.has(V.getKey())){if(V=q.getKey(),B.get(V)===void 0){let me=H();me.setFormat(q.getFormatType()),me.setIndent(q.getIndent()),K.push(me),B.set(V,me),q.getChildren().forEach(_e=>{me.append(_e),U.add(_e.getKey()),t.$isElementNode(_e)&&_e.getChildrenKeys().forEach(pe=>U.add(pe))}),S(q)}}else ee.has(V.getKey())&&(q=H(),q.setFormat(V.getFormatType()),q.setIndent(V.getIndent()),K.push(q),V.remove(!0))}if($!==null)for(w=0;w<K.length;w++)$.append(K[w]);if(w=null,t.$isRootOrShadowRoot(W))if(X)if($!==null)W.insertAfter($);else for($=K.length-1;0<=$;$--)W.insertAfter(K[$]);else if(X=W.getFirstChild(),t.$isElementNode(X)&&(W=X),X===null)if($)W.append($);else for($=0;$<K.length;$++)X=K[$],W.append(X),w=X;else if($!==null)X.insertBefore($);else for(W=0;W<K.length;W++)$=K[W],X.insertBefore($),w=$;else if($)W.insertAfter($);else for($=K.length-1;0<=$;$--)X=K[$],W.insertAfter(X),w=X;K=t.$getPreviousSelection(),t.$isRangeSelection(K)&&K.anchor.getNode().isAttached()&&K.focus.getNode().isAttached()?t.$setSelection(K.clone()):w!==null?w.selectEnd():T.dirty=!0}}function O(T,w,P,H){T.modify(w?"extend":"move",P,H)}function R(T){return T=T.anchor.getNode(),(t.$isRootNode(T)?T:T.getParentOrThrow()).getDirection()==="rtl"}function b(T){if(t.$isDecoratorNode(T)&&!T.isInline())return!0;if(!t.$isElementNode(T)||t.$isRootOrShadowRoot(T))return!1;var w=T.getFirstChild();return w=w===null||t.$isLineBreakNode(w)||t.$isTextNode(w)||w.isInline(),!T.isInline()&&T.canBeEmpty()!==!1&&w}return zn.$addNodeStyle=function(T){T=T.getStyle();let w=c(T);e.set(T,w)},zn.$cloneWithProperties=function(T){let w=T.constructor.clone(T);return w.__parent=T.__parent,w.__next=T.__next,w.__prev=T.__prev,t.$isElementNode(T)&&t.$isElementNode(w)?(w.__first=T.__first,w.__last=T.__last,w.__size=T.__size,w.__format=T.__format,w.__indent=T.__indent,w.__dir=T.__dir,w):(t.$isTextNode(T)&&t.$isTextNode(w)&&(w.__format=T.__format,w.__style=T.__style,w.__mode=T.__mode,w.__detail=T.__detail),w)},zn.$getSelectionStyleValueForProperty=function(T,w,P=""){let H=null,$=T.getNodes();var W=T.anchor,B=T.focus,K=T.isBackward();let X=K?B.offset:W.offset;if(W=K?B.getNode():W.getNode(),T.isCollapsed()&&T.style!==""&&(T=d(T.style),T!==null&&w in T))return T[w];for(T=0;T<$.length;T++){var ee=$[T];if((T===0||X!==0||!ee.is(W))&&t.$isTextNode(ee)){if(B=w,K=P,ee=ee.getStyle(),ee=d(ee),B=ee!==null&&ee[B]||K,H===null)H=B;else if(H!==B){H="";break}}}return H===null?P:H},zn.$isAtNodeEnd=function(T){return T.type==="text"?T.offset===T.getNode().getTextContentSize():T.offset===T.getNode().getChildrenSize()},zn.$isParentElementRTL=R,zn.$moveCaretSelection=O,zn.$moveCharacter=function(T,w,P){let H=R(T);O(T,w,P?!H:H,"character")},zn.$patchStyleText=C,zn.$selectAll=function(T){let w=T.anchor;T=T.focus;var P=w.getNode().getTopLevelElementOrThrow().getParentOrThrow();let H=P.getFirstDescendant();P=P.getLastDescendant();let $="element",W="element",B=0;t.$isTextNode(H)?$="text":t.$isElementNode(H)||H===null||(H=H.getParentOrThrow()),t.$isTextNode(P)?(W="text",B=P.getTextContentSize()):t.$isElementNode(P)||P===null||(P=P.getParentOrThrow()),H&&P&&(w.set(H.getKey(),0,$),T.set(P.getKey(),B,W))},zn.$setBlocksType=function(T,w){if(T.anchor.key==="root"){w=w();var P=t.$getRoot();(T=P.getFirstChild())?T.replace(w,!0):P.append(w)}else{for(P=T.getNodes(),T=T.anchor.getNode();T!==null&&T.getParent()!==null&&!b(T);)T=T.getParentOrThrow();for((T=b(T)?T:null)&&P.indexOf(T)===-1&&P.push(T),T=0;T<P.length;T++){let H=P[T];if(!b(H))continue;let $=w();$.setFormat(H.getFormatType()),$.setIndent(H.getIndent()),H.replace($,!0)}}},zn.$shouldOverrideDefaultCharacterSelection=function(T,w){return T=t.$getAdjacentNode(T.focus,w),t.$isDecoratorNode(T)&&!T.isIsolated()||t.$isElementNode(T)&&!T.isInline()&&!T.canBeEmpty()},zn.$sliceSelectedTextNodeContent=function(T,w){if(w.isSelected()&&!w.isSegmented()&&!w.isToken()&&t.$INTERNAL_isPointSelection(T)){var P=T.anchor.getNode(),H=T.focus.getNode(),$=w.is(P),W=w.is(H);if($||W){$=T.isBackward();let[B,K]=T.getCharacterOffsets();T=P.is(H),W=w.is($?H:P),H=w.is($?P:H),P=0;let X;T?(P=B>K?K:B,X=B>K?B:K):W?(P=$?K:B,X=void 0):H&&($=$?B:K,P=0,X=$),w.__text=w.__text.slice(P,X)}}return w},zn.$wrapNodes=function(T,w,P=null){var H=T.getNodes();let $=H.length;var W=T.anchor;if($===0||$===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){T=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),H=T.getChildren();let K=w();K.setFormat(T.getFormatType()),K.setIndent(T.getIndent()),H.forEach(X=>K.append(X)),P&&(K=P.append(K)),T.replace(K)}else{W=null;var B=[];for(let K=0;K<$;K++){let X=H[K];t.$isRootOrShadowRoot(X)?(x(T,B,B.length,w,P),B=[],W=X):W===null||W!==null&&t.$hasAncestor(X,W)?B.push(X):(x(T,B,B.length,w,P),B=[X])}x(T,B,B.length,w,P)}},zn.createDOMRange=function(T,w,P,H,$){let W=w.getKey(),B=H.getKey(),K=document.createRange(),X=T.getElementByKey(W);if(T=T.getElementByKey(B),t.$isTextNode(w)&&(X=n(X)),t.$isTextNode(H)&&(T=n(T)),w===void 0||H===void 0||X===null||T===null)return null;X.nodeName==="BR"&&([X,P]=r(X)),T.nodeName==="BR"&&([T,$]=r(T)),w=X.firstChild,X===T&&w!=null&&w.nodeName==="BR"&&P===0&&$===0&&($=1);try{K.setStart(X,P),K.setEnd(T,$)}catch{return null}return!K.collapsed||P===$&&W===B||(K.setStart(T,$),K.setEnd(X,P)),K},zn.createRectsFromDOMRange=function(T,w){var P=T.getRootElement();if(P===null)return[];T=P.getBoundingClientRect(),P=getComputedStyle(P),P=parseFloat(P.paddingLeft)+parseFloat(P.paddingRight),w=Array.from(w.getClientRects());let H=w.length;w.sort((W,B)=>{let K=W.top-B.top;return 3>=Math.abs(K)?W.left-B.left:K});let $;for(let W=0;W<H;W++){let B=w[W],K=B.width+P===T.width;$&&$.top<=B.top&&$.top+$.height>B.top&&$.left+$.width>B.left||K?(w.splice(W--,1),H--):$=B}return w},zn.getStyleObjectFromCSS=d,zn.trimTextContentFromAnchor=function(T,w,P){let H=w.getNode();if(t.$isElementNode(H)){var $=H.getDescendantByIndex(w.offset);$!==null&&(H=$)}for(;0<P&&H!==null;){t.$isElementNode(H)&&($=H.getLastDescendant(),$!==null&&(H=$));var W=H.getPreviousSibling(),B=0;if(W===null){$=H.getParentOrThrow();for(var K=$.getPreviousSibling();K===null;){if($=$.getParent(),$===null){W=null;break}K=$.getPreviousSibling()}$!==null&&(B=$.isInline()?0:2,W=K)}if(K=H.getTextContent(),K===""&&t.$isElementNode(H)&&!H.isInline()&&(K=`
67
+ `);const m=k.length;if(!t.$isTextNode(ne)||Y>=m){const y=ne.getParent();ne.remove(),y!=null&&y.getChildrenSize()===0&&!t.$isRootNode(y)&&y.remove(),Y-=m+Q,ne=G}else{const y=ne.getKey(),A=K.getEditorState().read(()=>{const he=t.$getNodeByKey(y);return t.$isTextNode(he)&&he.isSimpleText()?he.getTextContent():null}),Z=m-Y,ae=k.slice(0,Z);if(A!==null&&A!==k){const he=t.$getPreviousSelection();let se=ne;if(ne.isSimpleText())ne.setTextContent(A);else{const Te=t.$createTextNode(A);ne.replace(Te),se=Te}if(t.$isRangeSelection(he)&&he.isCollapsed()){const Te=he.anchor.offset;se.select(Te,Te)}}else if(ne.isSimpleText()){const he=D.key===y;let se=D.offset;se<Y&&(se=m);const Te=he?se-Y:0,be=he?se:Z;if(he&&Te===0){const[Ue]=ne.splitText(Te,be);Ue.remove()}else{const[,Ue]=ne.splitText(Te,be);Ue.remove()}}else{const he=t.$createTextNode(ae);ne.replace(he)}Y=0}}}function w(K){const D=K.getStyle(),V=g(D);e.set(D,V)}function $(K,D){const V=p("getStyle"in K?K.getStyle():K.style),ne=Object.entries(D).reduce((G,[Q,k])=>(k===null?delete G[Q]:G[Q]=k,G),{...V}),Y=C(ne);K.setStyle(Y),e.set(Y,ne)}function W(K,D){const V=K.getNodes(),ne=V.length;if(t.DEPRECATED_$isGridSelection(K)){const te=t.$createRangeSelection(),ce=te.anchor,we=te.focus;for(let Le=0;Le<ne;Le++){const Be=V[Le];t.DEPRECATED_$isGridCellNode(Be)&&(ce.set(Be.getKey(),0,"element"),we.set(Be.getKey(),Be.getChildrenSize(),"element"),W(t.$normalizeSelection__EXPERIMENTAL(te),D))}t.$setSelection(K);return}const Y=ne-1;let G=V[0],Q=V[Y];if(K.isCollapsed()&&t.$isRangeSelection(K)){$(K,D);return}const k=K.anchor,m=K.focus,A=G.getTextContent().length,Z=m.offset;let ae=k.offset;const he=k.isBefore(m);let se=he?ae:Z,Te=he?Z:ae;const be=he?k.type:m.type,Ue=he?m.type:k.type,re=he?m.key:k.key;if(t.$isTextNode(G)&&se===A){const te=G.getNextSibling();t.$isTextNode(te)&&(ae=0,se=0,G=te)}if(V.length===1){if(t.$isTextNode(G)){if(se=be==="element"?0:ae>Z?Z:ae,Te=Ue==="element"?A:ae>Z?ae:Z,se===Te)return;if(se===0&&Te===A)$(G,D),G.select(se,Te);else{const te=G.splitText(se,Te),ce=se===0?te[0]:te[1];$(ce,D),ce.select(0,Te-se)}}}else{if(t.$isTextNode(G)&&se<G.getTextContentSize()&&(se!==0&&(G=G.splitText(se)[1],se=0,k.set(G.getKey(),se,"text")),$(G,D)),t.$isTextNode(Q)){const ce=Q.getTextContent().length;Q.__key!==re&&Te!==0&&(Te=ce),Te!==ce&&([Q]=Q.splitText(Te)),Te!==0&&$(Q,D)}for(let te=1;te<Y;te++){const ce=V[te],we=ce.getKey();t.$isTextNode(ce)&&we!==G.getKey()&&we!==Q.getKey()&&!ce.isToken()&&$(ce,D)}}}function P(K,D){if(K.anchor.key==="root"){const Y=D(),G=t.$getRoot(),Q=G.getFirstChild();Q?Q.replace(Y,!0):G.append(Y);return}const V=K.getNodes(),ne=ue(K.anchor.getNode(),pe);ne&&V.indexOf(ne)===-1&&V.push(ne);for(let Y=0;Y<V.length;Y++){const G=V[Y];if(!pe(G))continue;const Q=D();Q.setFormat(G.getFormatType()),Q.setIndent(G.getIndent()),G.replace(Q,!0)}}function H(K){return K.getNode().isAttached()}function B(K){let D=K;for(;D!==null&&!t.$isRootOrShadowRoot(D);){const V=D.getLatest(),ne=D.getParent();V.getChildrenSize()===0&&D.remove(!0),D=ne}}function z(K,D,V=null){const ne=K.getNodes(),Y=ne.length,G=K.anchor;if(Y===0||Y===1&&G.type==="element"&&G.getNode().getChildrenSize()===0){const m=G.type==="text"?G.getNode().getParentOrThrow():G.getNode(),y=m.getChildren();let A=D();A.setFormat(m.getFormatType()),A.setIndent(m.getIndent()),y.forEach(Z=>A.append(Z)),V&&(A=V.append(A)),m.replace(A);return}let Q=null,k=[];for(let m=0;m<Y;m++){const y=ne[m];t.$isRootOrShadowRoot(y)?(X(K,k,k.length,D,V),k=[],Q=y):Q===null||Q!==null&&t.$hasAncestor(y,Q)?k.push(y):(X(K,k,k.length,D,V),k=[y])}X(K,k,k.length,D,V)}function X(K,D,V,ne,Y=null){if(D.length===0)return;const G=D[0],Q=new Map,k=[];let m=t.$isElementNode(G)?G:G.getParentOrThrow();m.isInline()&&(m=m.getParentOrThrow());let y=!1;for(;m!==null;){const se=m.getPreviousSibling();if(se!==null){m=se,y=!0;break}if(m=m.getParentOrThrow(),t.$isRootOrShadowRoot(m))break}const A=new Set;for(let se=0;se<V;se++){const Te=D[se];t.$isElementNode(Te)&&Te.getChildrenSize()===0&&A.add(Te.getKey())}const Z=new Set;for(let se=0;se<V;se++){const Te=D[se];let be=Te.getParent();if(be!==null&&be.isInline()&&(be=be.getParent()),be!==null&&t.$isLeafNode(Te)&&!Z.has(Te.getKey())){const Ue=be.getKey();if(Q.get(Ue)===void 0){const re=ne();re.setFormat(be.getFormatType()),re.setIndent(be.getIndent()),k.push(re),Q.set(Ue,re),be.getChildren().forEach(te=>{re.append(te),Z.add(te.getKey()),t.$isElementNode(te)&&te.getChildrenKeys().forEach(ce=>Z.add(ce))}),B(be)}}else if(A.has(Te.getKey())){const Ue=ne();Ue.setFormat(Te.getFormatType()),Ue.setIndent(Te.getIndent()),k.push(Ue),Te.remove(!0)}}if(Y!==null)for(let se=0;se<k.length;se++){const Te=k[se];Y.append(Te)}let ae=null;if(t.$isRootOrShadowRoot(m))if(y)if(Y!==null)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te)}else{const se=m.getFirstChild();if(t.$isElementNode(se)&&(m=se),se===null)if(Y)m.append(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];m.append(be),ae=be}else if(Y!==null)se.insertBefore(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];se.insertBefore(be),ae=be}}else if(Y)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te),ae=Te}const he=t.$getPreviousSelection();t.$isRangeSelection(he)&&H(he.anchor)&&H(he.focus)?t.$setSelection(he.clone()):ae!==null?ae.selectEnd():K.dirty=!0}function ee(K,D){const V=t.$getAdjacentNode(K.focus,D);return t.$isDecoratorNode(V)&&!V.isIsolated()||t.$isElementNode(V)&&!V.isInline()&&!V.canBeEmpty()}function le(K,D,V,ne){K.modify(D?"extend":"move",V,ne)}function j(K){const D=K.anchor.getNode();return(t.$isRootNode(D)?D:D.getParentOrThrow()).getDirection()==="rtl"}function U(K,D,V){const ne=j(K);le(K,D,V?!ne:ne,"character")}function q(K){const D=K.anchor,V=K.focus,G=D.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Q=G.getFirstDescendant(),k=G.getLastDescendant(),m="element",y="element",A=0;t.$isTextNode(Q)?m="text":!t.$isElementNode(Q)&&Q!==null&&(Q=Q.getParentOrThrow()),t.$isTextNode(k)?(y="text",A=k.getTextContentSize()):!t.$isElementNode(k)&&k!==null&&(k=k.getParentOrThrow()),Q&&k&&(D.set(Q.getKey(),0,m),V.set(k.getKey(),A,y))}function me(K,D,V){const ne=K.getStyle(),Y=p(ne);return Y!==null&&Y[D]||V}function _e(K,D,V=""){let ne=null;const Y=K.getNodes(),G=K.anchor,Q=K.focus,k=K.isBackward(),m=k?Q.offset:G.offset,y=k?Q.getNode():G.getNode();if(K.isCollapsed()&&K.style!==""){const A=K.style,Z=p(A);if(Z!==null&&D in Z)return Z[D]}for(let A=0;A<Y.length;A++){const Z=Y[A];if(!(A!==0&&m===0&&Z.is(y))&&t.$isTextNode(Z)){const ae=me(Z,D,V);if(ne===null)ne=ae;else if(ne!==ae){ne="";break}}}return ne===null?V:ne}function pe(K){if(t.$isDecoratorNode(K)&&!K.isInline())return!0;if(!t.$isElementNode(K)||t.$isRootOrShadowRoot(K))return!1;const D=K.getFirstChild(),V=D===null||t.$isLineBreakNode(D)||t.$isTextNode(D)||D.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&V}function ue(K,D){let V=K;for(;V!==null&&V.getParent()!==null&&!D(V);)V=V.getParentOrThrow();return D(V)?V:null}return Kn.$addNodeStyle=w,Kn.$cloneWithProperties=O,Kn.$getSelectionStyleValueForProperty=_e,Kn.$isAtNodeEnd=b,Kn.$isParentElementRTL=j,Kn.$moveCaretSelection=le,Kn.$moveCharacter=U,Kn.$patchStyleText=W,Kn.$selectAll=q,Kn.$setBlocksType=P,Kn.$shouldOverrideDefaultCharacterSelection=ee,Kn.$sliceSelectedTextNodeContent=R,Kn.$wrapNodes=z,Kn.createDOMRange=c,Kn.createRectsFromDOMRange=d,Kn.getStyleObjectFromCSS=p,Kn.trimTextContentFromAnchor=x,Kn}var zn={},$f;function PN(){if($f)return zn;$f=1;var t=Bt();let e=new Map;function n(x){for(;x!=null;){if(x.nodeType===Node.TEXT_NODE)return x;x=x.firstChild}return null}function r(x){let w=x.parentNode;if(w==null)throw Error("Should never happen");return[w,Array.from(w.childNodes).indexOf(x)]}function c(x){let w={};x=x.split(";");for(let $ of x)if($!==""){let[W,P]=$.split(/:([^]+)/);W&&P&&(w[W.trim()]=P.trim())}return w}function d(x){let w=e.get(x);return w===void 0&&(w=c(x),e.set(x,w)),w}function g(x){let w="";for(let $ in x)$&&(w+=`${$}: ${x[$]};`);return w}function p(x,w){var $=d("getStyle"in x?x.getStyle():x.style);w=Object.entries(w).reduce((W,[P,H])=>(H===null?delete W[P]:W[P]=H,W),{...$}),$=g(w),x.setStyle($),e.set($,w)}function C(x,w){var $=x.getNodes(),W=$.length;if(t.DEPRECATED_$isGridSelection(x)){for(var P=t.$createRangeSelection(),H=P.anchor,B=P.focus,z=0;z<W;z++){var X=$[z];t.DEPRECATED_$isGridCellNode(X)&&(H.set(X.getKey(),0,"element"),B.set(X.getKey(),X.getChildrenSize(),"element"),C(t.$normalizeSelection__EXPERIMENTAL(P),w))}t.$setSelection(x)}else if(--W,P=$[0],H=$[W],x.isCollapsed()&&t.$isRangeSelection(x))p(x,w);else{z=x.anchor;var ee=x.focus;X=P.getTextContent().length;var le=ee.offset,j=z.offset,U=z.isBefore(ee);B=U?j:le,x=U?le:j;var q=U?z.type:ee.type,me=U?ee.type:z.type;if(ee=U?ee.key:z.key,t.$isTextNode(P)&&B===X&&(U=P.getNextSibling(),t.$isTextNode(U)&&(B=j=0,P=U)),$.length===1)t.$isTextNode(P)&&(B=q==="element"?0:j>le?le:j,x=me==="element"?X:j>le?j:le,B!==x&&(B===0&&x===X?(p(P,w),P.select(B,x)):($=P.splitText(B,x),$=B===0?$[0]:$[1],p($,w),$.select(0,x-B))));else for(t.$isTextNode(P)&&B<P.getTextContentSize()&&(B!==0&&(P=P.splitText(B)[1],B=0,z.set(P.getKey(),B,"text")),p(P,w)),t.$isTextNode(H)&&(B=H.getTextContent().length,H.__key!==ee&&x!==0&&(x=B),x!==B&&([H]=H.splitText(x)),x!==0&&p(H,w)),x=1;x<W;x++)B=$[x],z=B.getKey(),t.$isTextNode(B)&&z!==P.getKey()&&z!==H.getKey()&&!B.isToken()&&p(B,w)}}function S(x){for(;x!==null&&!t.$isRootOrShadowRoot(x);){let w=x.getLatest(),$=x.getParent();w.getChildrenSize()===0&&x.remove(!0),x=$}}function T(x,w,$,W,P=null){if(w.length!==0){var H=w[0],B=new Map,z=[];H=t.$isElementNode(H)?H:H.getParentOrThrow(),H.isInline()&&(H=H.getParentOrThrow());for(var X=!1;H!==null;){var ee=H.getPreviousSibling();if(ee!==null){H=ee,X=!0;break}if(H=H.getParentOrThrow(),t.$isRootOrShadowRoot(H))break}ee=new Set;for(var le=0;le<$;le++){var j=w[le];t.$isElementNode(j)&&j.getChildrenSize()===0&&ee.add(j.getKey())}var U=new Set;for(le=0;le<$;le++){j=w[le];var q=j.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&t.$isLeafNode(j)&&!U.has(j.getKey())){if(j=q.getKey(),B.get(j)===void 0){let me=W();me.setFormat(q.getFormatType()),me.setIndent(q.getIndent()),z.push(me),B.set(j,me),q.getChildren().forEach(_e=>{me.append(_e),U.add(_e.getKey()),t.$isElementNode(_e)&&_e.getChildrenKeys().forEach(pe=>U.add(pe))}),S(q)}}else ee.has(j.getKey())&&(q=W(),q.setFormat(j.getFormatType()),q.setIndent(j.getIndent()),z.push(q),j.remove(!0))}if(P!==null)for(w=0;w<z.length;w++)P.append(z[w]);if(w=null,t.$isRootOrShadowRoot(H))if(X)if(P!==null)H.insertAfter(P);else for(P=z.length-1;0<=P;P--)H.insertAfter(z[P]);else if(X=H.getFirstChild(),t.$isElementNode(X)&&(H=X),X===null)if(P)H.append(P);else for(P=0;P<z.length;P++)X=z[P],H.append(X),w=X;else if(P!==null)X.insertBefore(P);else for(H=0;H<z.length;H++)P=z[H],X.insertBefore(P),w=P;else if(P)H.insertAfter(P);else for(P=z.length-1;0<=P;P--)X=z[P],H.insertAfter(X),w=X;z=t.$getPreviousSelection(),t.$isRangeSelection(z)&&z.anchor.getNode().isAttached()&&z.focus.getNode().isAttached()?t.$setSelection(z.clone()):w!==null?w.selectEnd():x.dirty=!0}}function O(x,w,$,W){x.modify(w?"extend":"move",$,W)}function R(x){return x=x.anchor.getNode(),(t.$isRootNode(x)?x:x.getParentOrThrow()).getDirection()==="rtl"}function b(x){if(t.$isDecoratorNode(x)&&!x.isInline())return!0;if(!t.$isElementNode(x)||t.$isRootOrShadowRoot(x))return!1;var w=x.getFirstChild();return w=w===null||t.$isLineBreakNode(w)||t.$isTextNode(w)||w.isInline(),!x.isInline()&&x.canBeEmpty()!==!1&&w}return zn.$addNodeStyle=function(x){x=x.getStyle();let w=c(x);e.set(x,w)},zn.$cloneWithProperties=function(x){let w=x.constructor.clone(x);return w.__parent=x.__parent,w.__next=x.__next,w.__prev=x.__prev,t.$isElementNode(x)&&t.$isElementNode(w)?(w.__first=x.__first,w.__last=x.__last,w.__size=x.__size,w.__format=x.__format,w.__indent=x.__indent,w.__dir=x.__dir,w):(t.$isTextNode(x)&&t.$isTextNode(w)&&(w.__format=x.__format,w.__style=x.__style,w.__mode=x.__mode,w.__detail=x.__detail),w)},zn.$getSelectionStyleValueForProperty=function(x,w,$=""){let W=null,P=x.getNodes();var H=x.anchor,B=x.focus,z=x.isBackward();let X=z?B.offset:H.offset;if(H=z?B.getNode():H.getNode(),x.isCollapsed()&&x.style!==""&&(x=d(x.style),x!==null&&w in x))return x[w];for(x=0;x<P.length;x++){var ee=P[x];if((x===0||X!==0||!ee.is(H))&&t.$isTextNode(ee)){if(B=w,z=$,ee=ee.getStyle(),ee=d(ee),B=ee!==null&&ee[B]||z,W===null)W=B;else if(W!==B){W="";break}}}return W===null?$:W},zn.$isAtNodeEnd=function(x){return x.type==="text"?x.offset===x.getNode().getTextContentSize():x.offset===x.getNode().getChildrenSize()},zn.$isParentElementRTL=R,zn.$moveCaretSelection=O,zn.$moveCharacter=function(x,w,$){let W=R(x);O(x,w,$?!W:W,"character")},zn.$patchStyleText=C,zn.$selectAll=function(x){let w=x.anchor;x=x.focus;var $=w.getNode().getTopLevelElementOrThrow().getParentOrThrow();let W=$.getFirstDescendant();$=$.getLastDescendant();let P="element",H="element",B=0;t.$isTextNode(W)?P="text":t.$isElementNode(W)||W===null||(W=W.getParentOrThrow()),t.$isTextNode($)?(H="text",B=$.getTextContentSize()):t.$isElementNode($)||$===null||($=$.getParentOrThrow()),W&&$&&(w.set(W.getKey(),0,P),x.set($.getKey(),B,H))},zn.$setBlocksType=function(x,w){if(x.anchor.key==="root"){w=w();var $=t.$getRoot();(x=$.getFirstChild())?x.replace(w,!0):$.append(w)}else{for($=x.getNodes(),x=x.anchor.getNode();x!==null&&x.getParent()!==null&&!b(x);)x=x.getParentOrThrow();for((x=b(x)?x:null)&&$.indexOf(x)===-1&&$.push(x),x=0;x<$.length;x++){let W=$[x];if(!b(W))continue;let P=w();P.setFormat(W.getFormatType()),P.setIndent(W.getIndent()),W.replace(P,!0)}}},zn.$shouldOverrideDefaultCharacterSelection=function(x,w){return x=t.$getAdjacentNode(x.focus,w),t.$isDecoratorNode(x)&&!x.isIsolated()||t.$isElementNode(x)&&!x.isInline()&&!x.canBeEmpty()},zn.$sliceSelectedTextNodeContent=function(x,w){if(w.isSelected()&&!w.isSegmented()&&!w.isToken()&&t.$INTERNAL_isPointSelection(x)){var $=x.anchor.getNode(),W=x.focus.getNode(),P=w.is($),H=w.is(W);if(P||H){P=x.isBackward();let[B,z]=x.getCharacterOffsets();x=$.is(W),H=w.is(P?W:$),W=w.is(P?$:W),$=0;let X;x?($=B>z?z:B,X=B>z?B:z):H?($=P?z:B,X=void 0):W&&(P=P?B:z,$=0,X=P),w.__text=w.__text.slice($,X)}}return w},zn.$wrapNodes=function(x,w,$=null){var W=x.getNodes();let P=W.length;var H=x.anchor;if(P===0||P===1&&H.type==="element"&&H.getNode().getChildrenSize()===0){x=H.type==="text"?H.getNode().getParentOrThrow():H.getNode(),W=x.getChildren();let z=w();z.setFormat(x.getFormatType()),z.setIndent(x.getIndent()),W.forEach(X=>z.append(X)),$&&(z=$.append(z)),x.replace(z)}else{H=null;var B=[];for(let z=0;z<P;z++){let X=W[z];t.$isRootOrShadowRoot(X)?(T(x,B,B.length,w,$),B=[],H=X):H===null||H!==null&&t.$hasAncestor(X,H)?B.push(X):(T(x,B,B.length,w,$),B=[X])}T(x,B,B.length,w,$)}},zn.createDOMRange=function(x,w,$,W,P){let H=w.getKey(),B=W.getKey(),z=document.createRange(),X=x.getElementByKey(H);if(x=x.getElementByKey(B),t.$isTextNode(w)&&(X=n(X)),t.$isTextNode(W)&&(x=n(x)),w===void 0||W===void 0||X===null||x===null)return null;X.nodeName==="BR"&&([X,$]=r(X)),x.nodeName==="BR"&&([x,P]=r(x)),w=X.firstChild,X===x&&w!=null&&w.nodeName==="BR"&&$===0&&P===0&&(P=1);try{z.setStart(X,$),z.setEnd(x,P)}catch{return null}return!z.collapsed||$===P&&H===B||(z.setStart(x,P),z.setEnd(X,$)),z},zn.createRectsFromDOMRange=function(x,w){var $=x.getRootElement();if($===null)return[];x=$.getBoundingClientRect(),$=getComputedStyle($),$=parseFloat($.paddingLeft)+parseFloat($.paddingRight),w=Array.from(w.getClientRects());let W=w.length;w.sort((H,B)=>{let z=H.top-B.top;return 3>=Math.abs(z)?H.left-B.left:z});let P;for(let H=0;H<W;H++){let B=w[H],z=B.width+$===x.width;P&&P.top<=B.top&&P.top+P.height>B.top&&P.left+P.width>B.left||z?(w.splice(H--,1),W--):P=B}return w},zn.getStyleObjectFromCSS=d,zn.trimTextContentFromAnchor=function(x,w,$){let W=w.getNode();if(t.$isElementNode(W)){var P=W.getDescendantByIndex(w.offset);P!==null&&(W=P)}for(;0<$&&W!==null;){t.$isElementNode(W)&&(P=W.getLastDescendant(),P!==null&&(W=P));var H=W.getPreviousSibling(),B=0;if(H===null){P=W.getParentOrThrow();for(var z=P.getPreviousSibling();z===null;){if(P=P.getParent(),P===null){H=null;break}z=P.getPreviousSibling()}P!==null&&(B=P.isInline()?0:2,H=z)}if(z=W.getTextContent(),z===""&&t.$isElementNode(W)&&!W.isInline()&&(z=`
68
68
 
69
- `),$=K.length,!t.$isTextNode(H)||P>=$)K=H.getParent(),H.remove(),K==null||K.getChildrenSize()!==0||t.$isRootNode(K)||K.remove(),P-=$+B,H=W;else{let X=H.getKey();B=T.getEditorState().read(()=>{const le=t.$getNodeByKey(X);return t.$isTextNode(le)&&le.isSimpleText()?le.getTextContent():null}),W=$-P;let ee=K.slice(0,W);B!==null&&B!==K?(P=t.$getPreviousSelection(),$=H,H.isSimpleText()?H.setTextContent(B):($=t.$createTextNode(B),H.replace($)),t.$isRangeSelection(P)&&P.isCollapsed()&&(P=P.anchor.offset,$.select(P,P))):H.isSimpleText()?(B=w.key===X,K=w.offset,K<P&&(K=$),P=B?K-P:0,$=B?K:W,B&&P===0?([P]=H.splitText(P,$),P.remove()):([,P]=H.splitText(P,$),P.remove())):(P=t.$createTextNode(ee),H.replace(P)),P=0}}},zn}var eu,If;function Ao(){return If||(If=1,eu=process.env.NODE_ENV==="development"?IN():PN()),eu}var Pf;function $N(){if(Pf)return Nn;Pf=1;var t=Ao(),e=Bt();function n(...ee){return()=>{ee.forEach(le=>le())}}function r(ee){return`${ee}px`}const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(ee,le,V){let U=null,q=null,me=null,_e=[];const pe=document.createElement("div");function ue(){if(U===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:ne,top:Y}=U.getBoundingClientRect(),G=q,Q=t.createRectsFromDOMRange(ee,le);pe.isConnected||G.append(pe);let k=!1;for(let m=0;m<Q.length;m++){const y=Q[m],A=_e[m]||document.createElement("div"),Z=A.style;Z.position!=="absolute"&&(Z.position="absolute",k=!0);const ae=r(y.left-ne);Z.left!==ae&&(Z.left=ae,k=!0);const he=r(y.top-Y);Z.top!==he&&(A.style.top=he,k=!0);const se=r(y.width);Z.width!==se&&(A.style.width=se,k=!0);const Te=r(y.height);Z.height!==Te&&(A.style.height=Te,k=!0),A.parentNode!==pe&&(pe.append(A),k=!0),_e[m]=A}for(;_e.length>Q.length;)_e.pop();k&&V(_e)}function z(){q=null,U=null,me!==null&&me.disconnect(),me=null,pe.remove();for(const ne of _e)ne.remove();_e=[]}function D(){const ne=ee.getRootElement();if(ne===null)return z();const Y=ne.parentElement;if(!(Y instanceof HTMLElement))return z();z(),U=ne,q=Y,me=new MutationObserver(G=>{const Q=ee.getRootElement(),k=Q&&Q.parentElement;if(Q!==U||k!==q)return D();for(const m of G)if(!pe.contains(m.target))return ue()}),me.observe(Y,c),ue()}const j=ee.registerRootListener(D);return()=>{j(),z()}}function g(ee,le){let V=null,U=null,q=null,me=null,_e=()=>{};function pe(ue){ue.read(()=>{const z=e.$getSelection();if(!e.$isRangeSelection(z)){V=null,U=null,q=null,me=null,_e(),_e=()=>{};return}const{anchor:D,focus:j}=z,ne=D.getNode(),Y=ne.getKey(),G=D.offset,Q=j.getNode(),k=Q.getKey(),m=j.offset,y=ee.getElementByKey(Y),A=ee.getElementByKey(k),Z=V===null||y===null||G!==U||Y!==V.getKey()||ne!==V&&(!(V instanceof e.TextNode)||ne.updateDOM(V,y,ee._config)),ae=q===null||A===null||m!==me||k!==q.getKey()||Q!==q&&(!(q instanceof e.TextNode)||Q.updateDOM(q,A,ee._config));if(Z||ae){const he=ee.getElementByKey(D.getNode().getKey()),se=ee.getElementByKey(j.getNode().getKey());if(he!==null&&se!==null&&he.tagName==="SPAN"&&se.tagName==="SPAN"){const Te=document.createRange();let be,Ue,re,te;j.isBefore(D)?(be=se,Ue=j.offset,re=he,te=D.offset):(be=he,Ue=D.offset,re=se,te=j.offset);const ce=be.firstChild;if(ce===null)throw Error("Expected text node to be first child of span");const we=re.firstChild;if(we===null)throw Error("Expected text node to be first child of span");Te.setStart(ce,Ue),Te.setEnd(we,te),_e(),_e=d(ee,Te,Le=>{for(const Be of Le){const Ye=Be.style;Ye.background!=="Highlight"&&(Ye.background="Highlight"),Ye.color!=="HighlightText"&&(Ye.color="HighlightText"),Ye.zIndex!=="-1"&&(Ye.zIndex="-1"),Ye.pointerEvents!=="none"&&(Ye.pointerEvents="none"),Ye.marginTop!==r(-1.5)&&(Ye.marginTop=r(-1.5)),Ye.paddingTop!==r(4)&&(Ye.paddingTop=r(4)),Ye.paddingBottom!==r(0)&&(Ye.paddingBottom=r(0))}le!==void 0&&le(Le)})}}V=ne,U=G,q=Q,me=m})}return pe(ee.getEditorState()),n(ee.registerUpdateListener(({editorState:ue})=>pe(ue)),_e,()=>{_e()})}function p(ee,...le){le.forEach(V=>{if(typeof V=="string"){const U=V.split(" ").filter(q=>q!=="");ee.classList.add(...U)}})}function C(ee,...le){le.forEach(V=>{typeof V=="string"&&ee.classList.remove(...V.split(" "))})}function S(ee,le){for(const V of le)if(ee.type.startsWith(V))return!0;return!1}function x(ee,le){const V=ee[Symbol.iterator]();return new Promise((U,q)=>{const me=[],_e=()=>{const{done:pe,value:ue}=V.next();if(pe)return U(me);const z=new FileReader;z.addEventListener("error",q),z.addEventListener("load",()=>{const D=z.result;typeof D=="string"&&me.push({file:ue,result:D}),_e()}),S(ue,le)?z.readAsDataURL(ue):_e()};_e()})}function O(ee,le){const V=[],U=(ee||e.$getRoot()).getLatest(),q=le||(e.$isElementNode(U)?U.getLastDescendant():U);let me=U,_e=R(me);for(;me!==null&&!me.is(q);)if(V.push({depth:_e,node:me}),e.$isElementNode(me)&&me.getChildrenSize()>0)me=me.getFirstChild(),_e++;else{let pe=null;for(;pe===null&&me!==null;)pe=me.getNextSibling(),pe===null?(me=me.getParent(),_e--):me=pe}return me!==null&&me.is(q)&&V.push({depth:_e,node:me}),V}function R(ee){let le=ee,V=0;for(;(le=le.getParent())!==null;)V++;return V}function b(ee,le){let V=ee;for(;V!=null;){if(V instanceof le)return V;V=V.getParent()}return null}function T(ee){const le=w(ee,V=>e.$isElementNode(V)&&!V.isInline());if(!e.$isElementNode(le))throw Error(`Expected node ${ee.__key} to have closest block element node.`);return le}function w(ee,le){let V=ee;for(;V!==e.$getRoot()&&V!=null;){if(le(V))return V;V=V.getParent()}return null}function P(ee,le,V,U){const q=pe=>pe instanceof le,me=pe=>{const ue=pe.getChildren();for(let j=0;j<ue.length;j++){const ne=ue[j];if(q(ne))return null}let z=pe,D=pe;for(;z!==null;)if(D=z,z=z.getParent(),q(z))return{child:D,parent:z};return null},_e=pe=>{const ue=me(pe);if(ue!==null){const{child:z,parent:D}=ue;if(z.is(pe)){U(D,pe);const j=z.getNextSiblings(),ne=j.length;if(D.insertAfter(z),ne!==0){const Y=V(D);z.insertAfter(Y);for(let G=0;G<ne;G++)Y.append(j[G])}!D.canBeEmpty()&&D.getChildrenSize()===0&&D.remove()}}};return ee.registerNodeTransform(le,_e)}function H(ee,le){const U=new Map,q=ee._pendingEditorState;for(const[_e,pe]of le._nodeMap){const ue=t.$cloneWithProperties(pe);e.$isTextNode(ue)&&(ue.__text=pe.__text),U.set(_e,ue)}q&&(q._nodeMap=U),ee._dirtyType=2;const me=le._selection;e.$setSelection(me===null?null:me.clone())}function $(ee){const le=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(le)){const{focus:V}=le,U=V.getNode(),q=V.offset;if(e.$isRootOrShadowRoot(U)){const me=U.getChildAtIndex(q);me==null?U.append(ee):me.insertBefore(ee),ee.selectNext()}else{let me,_e;e.$isTextNode(U)?(me=U.getParentOrThrow(),_e=U.getIndexWithinParent(),q>0&&(_e+=1,U.splitText(q))):(me=U,_e=q);const[,pe]=e.$splitNode(me,_e);pe.insertBefore(ee),pe.selectStart()}}else{if(le!=null){const U=le.getNodes();U[U.length-1].getTopLevelElementOrThrow().insertAfter(ee)}else e.$getRoot().append(ee);const V=e.$createParagraphNode();ee.insertAfter(V),V.select()}return ee.getLatest()}function W(ee,le){const V=le();return ee.replace(V),V.append(ee),V}function B(ee,le){return ee!==null?Object.getPrototypeOf(ee).constructor.name===le.name:!1}function K(ee,le){const V=[];for(let U=0;U<ee.length;U++){const q=le(ee[U]);q!==null&&V.push(q)}return V}function X(ee,le){const V=ee.getFirstChild();V!==null?V.insertBefore(le):ee.append(le)}return Nn.$splitNode=e.$splitNode,Nn.isHTMLAnchorElement=e.isHTMLAnchorElement,Nn.isHTMLElement=e.isHTMLElement,Nn.$dfs=O,Nn.$filter=K,Nn.$findMatchingParent=w,Nn.$getNearestBlockElementAncestorOrThrow=T,Nn.$getNearestNodeOfType=b,Nn.$insertFirst=X,Nn.$insertNodeToNearestRoot=$,Nn.$restoreEditorState=H,Nn.$wrapNodeInElement=W,Nn.addClassNamesToElement=p,Nn.isMimeType=S,Nn.markSelection=g,Nn.mediaFileReader=x,Nn.mergeRegister=n,Nn.objectKlassEquals=B,Nn.positionNodeOnRange=d,Nn.registerNestedElementResolver=P,Nn.removeClassNamesFromElement=C,Nn}var Cn={},$f;function FN(){if($f)return Cn;$f=1;var t=Ao(),e=Bt();function n(C){let S=new URLSearchParams;S.append("code",C);for(let x=1;x<arguments.length;x++)S.append("v",arguments[x]);throw Error(`Minified Lexical error #${C}; 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(...C){return()=>{C.forEach(S=>S())}}let c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(C,S,x){function O(){if(T===null)throw Error("Unexpected null rootDOMNode");if(w===null)throw Error("Unexpected null parentDOMNode");let{left:B,top:K}=T.getBoundingClientRect();var X=w;let ee=t.createRectsFromDOMRange(C,S);$.isConnected||X.append($),X=!1;for(let U=0;U<ee.length;U++){var le=ee[U];let q=H[U]||document.createElement("div"),me=q.style;me.position!=="absolute"&&(me.position="absolute",X=!0);var V=`${le.left-B}px`;me.left!==V&&(me.left=V,X=!0),V=`${le.top-K}px`,me.top!==V&&(q.style.top=V,X=!0),V=`${le.width}px`,me.width!==V&&(q.style.width=V,X=!0),le=`${le.height}px`,me.height!==le&&(q.style.height=le,X=!0),q.parentNode!==$&&($.append(q),X=!0),H[U]=q}for(;H.length>ee.length;)H.pop();X&&x(H)}function R(){T=w=null,P!==null&&P.disconnect(),P=null,$.remove();for(let B of H)B.remove();H=[]}function b(){let B=C.getRootElement();if(B===null)return R();let K=B.parentElement;if(!(K instanceof HTMLElement))return R();R(),T=B,w=K,P=new MutationObserver(X=>{let ee=C.getRootElement(),le=ee&&ee.parentElement;if(ee!==T||le!==w)return b();for(let V of X)if(!$.contains(V.target))return O()}),P.observe(K,c),O()}let T=null,w=null,P=null,H=[],$=document.createElement("div"),W=C.registerRootListener(b);return()=>{W(),R()}}function g(C,S){for(let x of S)if(C.type.startsWith(x))return!0;return!1}function p(C,S){for(;C!==e.$getRoot()&&C!=null;){if(S(C))return C;C=C.getParent()}return null}return Cn.$splitNode=e.$splitNode,Cn.isHTMLAnchorElement=e.isHTMLAnchorElement,Cn.isHTMLElement=e.isHTMLElement,Cn.$dfs=function(C,S){let x=[];C=(C||e.$getRoot()).getLatest(),S=S||(e.$isElementNode(C)?C.getLastDescendant():C);for(var O=C,R=0;(O=O.getParent())!==null;)R++;for(O=R;C!==null&&!C.is(S);)if(x.push({depth:O,node:C}),e.$isElementNode(C)&&0<C.getChildrenSize())C=C.getFirstChild(),O++;else for(R=null;R===null&&C!==null;)R=C.getNextSibling(),R===null?(C=C.getParent(),O--):C=R;return C!==null&&C.is(S)&&x.push({depth:O,node:C}),x},Cn.$filter=function(C,S){let x=[];for(let O=0;O<C.length;O++){let R=S(C[O]);R!==null&&x.push(R)}return x},Cn.$findMatchingParent=p,Cn.$getNearestBlockElementAncestorOrThrow=function(C){let S=p(C,x=>e.$isElementNode(x)&&!x.isInline());return e.$isElementNode(S)||n(4,C.__key),S},Cn.$getNearestNodeOfType=function(C,S){for(;C!=null;){if(C instanceof S)return C;C=C.getParent()}return null},Cn.$insertFirst=function(C,S){let x=C.getFirstChild();x!==null?x.insertBefore(S):C.append(S)},Cn.$insertNodeToNearestRoot=function(C){var S=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(S)){var{focus:x}=S;if(S=x.getNode(),x=x.offset,e.$isRootOrShadowRoot(S))x=S.getChildAtIndex(x),x==null?S.append(C):x.insertBefore(C),C.selectNext();else{let O,R;e.$isTextNode(S)?(O=S.getParentOrThrow(),R=S.getIndexWithinParent(),0<x&&(R+=1,S.splitText(x))):(O=S,R=x),[,S]=e.$splitNode(O,R),S.insertBefore(C),S.selectStart()}}else S!=null?(S=S.getNodes(),S[S.length-1].getTopLevelElementOrThrow().insertAfter(C)):e.$getRoot().append(C),S=e.$createParagraphNode(),C.insertAfter(S),S.select();return C.getLatest()},Cn.$restoreEditorState=function(C,S){let x=new Map,O=C._pendingEditorState;for(let[R,b]of S._nodeMap){let T=t.$cloneWithProperties(b);e.$isTextNode(T)&&(T.__text=b.__text),x.set(R,T)}O&&(O._nodeMap=x),C._dirtyType=2,C=S._selection,e.$setSelection(C===null?null:C.clone())},Cn.$wrapNodeInElement=function(C,S){return S=S(),C.replace(S),S.append(C),S},Cn.addClassNamesToElement=function(C,...S){S.forEach(x=>{typeof x=="string"&&(x=x.split(" ").filter(O=>O!==""),C.classList.add(...x))})},Cn.isMimeType=g,Cn.markSelection=function(C,S){function x(P){P.read(()=>{var H=e.$getSelection();if(e.$isRangeSelection(H)){var{anchor:$,focus:W}=H;H=$.getNode();var B=H.getKey(),K=$.offset,X=W.getNode(),ee=X.getKey(),le=W.offset,V=C.getElementByKey(B),U=C.getElementByKey(ee);if(B=O===null||V===null||K!==R||B!==O.getKey()||H!==O&&(!(O instanceof e.TextNode)||H.updateDOM(O,V,C._config)),ee=b===null||U===null||le!==T||ee!==b.getKey()||X!==b&&(!(b instanceof e.TextNode)||X.updateDOM(b,U,C._config)),B||ee){V=C.getElementByKey($.getNode().getKey());var q=C.getElementByKey(W.getNode().getKey());if(V!==null&&q!==null&&V.tagName==="SPAN"&&q.tagName==="SPAN"){if(ee=document.createRange(),W.isBefore($)?(B=q,U=W.offset,q=V,V=$.offset):(B=V,U=$.offset,V=W.offset),B=B.firstChild,B===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");ee.setStart(B,U),ee.setEnd(q,V),w(),w=d(C,ee,me=>{for(let _e of me){let pe=_e.style;pe.background!=="Highlight"&&(pe.background="Highlight"),pe.color!=="HighlightText"&&(pe.color="HighlightText"),pe.zIndex!=="-1"&&(pe.zIndex="-1"),pe.pointerEvents!=="none"&&(pe.pointerEvents="none"),pe.marginTop!=="-1.5px"&&(pe.marginTop="-1.5px"),pe.paddingTop!=="4px"&&(pe.paddingTop="4px"),pe.paddingBottom!=="0px"&&(pe.paddingBottom="0px")}S!==void 0&&S(me)})}}O=H,R=K,b=X,T=le}else T=b=R=O=null,w(),w=()=>{}})}let O=null,R=null,b=null,T=null,w=()=>{};return x(C.getEditorState()),r(C.registerUpdateListener(({editorState:P})=>x(P)),w,()=>{w()})},Cn.mediaFileReader=function(C,S){let x=C[Symbol.iterator]();return new Promise((O,R)=>{let b=[],T=()=>{const{done:w,value:P}=x.next();if(w)return O(b);const H=new FileReader;H.addEventListener("error",R),H.addEventListener("load",()=>{const $=H.result;typeof $=="string"&&b.push({file:P,result:$}),T()}),g(P,S)?H.readAsDataURL(P):T()};T()})},Cn.mergeRegister=r,Cn.objectKlassEquals=function(C,S){return C!==null?Object.getPrototypeOf(C).constructor.name===S.name:!1},Cn.positionNodeOnRange=d,Cn.registerNestedElementResolver=function(C,S,x,O){return C.registerNodeTransform(S,R=>{e:{for(var b=R.getChildren(),T=0;T<b.length;T++)if(b[T]instanceof S){b=null;break e}for(b=R;b!==null;)if(T=b,b=b.getParent(),b instanceof S){b={child:T,parent:b};break e}b=null}if(b!==null){const{child:w,parent:P}=b;if(w.is(R)){if(O(P,R),R=w.getNextSiblings(),b=R.length,P.insertAfter(w),b!==0){T=x(P),w.insertAfter(T);for(let H=0;H<b;H++)T.append(R[H])}P.canBeEmpty()||P.getChildrenSize()!==0||P.remove()}}})},Cn.removeClassNamesFromElement=function(C,...S){S.forEach(x=>{typeof x=="string"&&C.classList.remove(...x.split(" "))})},Cn}var tu,Ff;function on(){return Ff||(Ff=1,tu=process.env.NODE_ENV==="development"?$N():FN()),tu}var nu={},Bf;function BN(){if(Bf)return nu;Bf=1;var t=Bt();function e(n){const r=window.location.origin,c=d=>{if(d.origin!==r)return;const g=n.getRootElement();if(document.activeElement!==g)return;const p=d.data;if(typeof p=="string"){let C;try{C=JSON.parse(p)}catch{return}if(C&&C.protocol==="nuanria_messaging"&&C.type==="request"){const S=C.payload;if(S&&S.functionId==="makeChanges"){const x=S.args;if(x){const[O,R,b,T,w,P]=x;n.update(()=>{const H=t.$getSelection();if(t.$isRangeSelection(H)){const $=H.anchor;let W=$.getNode(),B=0,K=0;if(t.$isTextNode(W)&&O>=0&&R>=0&&(B=O,K=O+R,H.setTextNodeRange(W,B,W,K)),(B!==K||b!=="")&&(H.insertRawText(b),W=$.getNode()),t.$isTextNode(W)){B=T,K=T+w;const X=W.getTextContentSize();B=B>X?X:B,K=K>X?X:K,H.setTextNodeRange(W,B,W,K)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",c,!0),()=>{window.removeEventListener("message",c,!0)}}return nu.registerDragonSupport=e,nu}var ru={},Hf;function HN(){if(Hf)return ru;Hf=1;var t=Bt();return ru.registerDragonSupport=function(e){let n=window.location.origin,r=c=>{if(c.origin===n){var d=e.getRootElement();if(document.activeElement===d&&(d=c.data,typeof d=="string")){try{var g=JSON.parse(d)}catch{return}if(g&&g.protocol==="nuanria_messaging"&&g.type==="request"&&(g=g.payload)&&g.functionId==="makeChanges"&&(g=g.args)){const[p,C,S,x,O]=g;e.update(()=>{const R=t.$getSelection();if(t.$isRangeSelection(R)){var b=R.anchor;let T=b.getNode(),w=0,P=0;t.$isTextNode(T)&&0<=p&&0<=C&&(w=p,P=p+C,R.setTextNodeRange(T,w,T,P)),(w!==P||S!=="")&&(R.insertRawText(S),T=b.getNode()),t.$isTextNode(T)&&(w=x,P=x+O,b=T.getTextContentSize(),w=w>b?b:w,P=P>b?b:P,R.setTextNodeRange(T,w,T,P)),c.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},ru}var iu,Wf;function pp(){return Wf||(Wf=1,iu=process.env.NODE_ENV==="development"?BN():HN()),iu}var ci={},Li={},Ya={},Kf;function WN(){if(Kf)return Ya;Kf=1;var t=Ao(),e=on(),n=Bt();function r(S,x){const O=x.body?x.body.childNodes:[];let R=[];for(let b=0;b<O.length;b++){const T=O[b];if(!p.has(T.nodeName)){const w=C(T,S);w!==null&&(R=R.concat(w))}}return R}function c(S,x){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 O=document.createElement("div"),b=n.$getRoot().getChildren();for(let T=0;T<b.length;T++){const w=b[T];d(S,w,O,x)}return O.innerHTML}function d(S,x,O,R=null){let b=R!=null?x.isSelected(R):!0;const T=n.$isElementNode(x)&&x.excludeFromCopy("html");let w=x;if(R!==null){let X=t.$cloneWithProperties(x);X=n.$isTextNode(X)&&R!=null?t.$sliceSelectedTextNodeContent(R,X):X,w=X}const P=n.$isElementNode(w)?w.getChildren():[],H=S._nodes.get(w.getType());let $;H&&H.exportDOM!==void 0?$=H.exportDOM(S,w):$=w.exportDOM(S);const{element:W,after:B}=$;if(!W)return!1;const K=document.createDocumentFragment();for(let X=0;X<P.length;X++){const ee=P[X],le=d(S,ee,K,R);!b&&n.$isElementNode(x)&&le&&x.extractWithChild(ee,R,"html")&&(b=!0)}if(b&&!T){if(e.isHTMLElement(W)&&W.append(K),O.append(W),B){const X=B.call(w,W);X&&W.replaceWith(X)}}else O.append(K);return b}function g(S,x){const{nodeName:O}=S,R=x._htmlConversions.get(O.toLowerCase());let b=null;if(R!==void 0)for(const T of R){const w=T(S);w!==null&&(b===null||b.priority<w.priority)&&(b=w)}return b!==null?b.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function C(S,x,O=new Map,R){let b=[];if(p.has(S.nodeName))return b;let T=null;const w=g(S,x),P=w?w(S):null;let H=null;if(P!==null){H=P.after;const B=P.node;if(T=Array.isArray(B)?B[B.length-1]:B,T!==null){for(const[,K]of O)if(T=K(T,R),!T)break;T&&b.push(...Array.isArray(B)?B:[T])}P.forChild!=null&&O.set(S.nodeName,P.forChild)}const $=S.childNodes;let W=[];for(let B=0;B<$.length;B++)W.push(...C($[B],x,new Map(O),T));return H!=null&&(W=H(W)),T==null?b=b.concat(W):n.$isElementNode(T)&&T.append(...W),b}return Ya.$generateHtmlFromNodes=c,Ya.$generateNodesFromDOM=r,Ya}var ja={},zf;function KN(){if(zf)return ja;zf=1;var t=Ao(),e=on(),n=Bt();function r(g,p,C,S=null){let x=S!=null?p.isSelected(S):!0,O=n.$isElementNode(p)&&p.excludeFromCopy("html");var R=p;S!==null&&(R=t.$cloneWithProperties(p),R=n.$isTextNode(R)&&S!=null?t.$sliceSelectedTextNodeContent(S,R):R);let b=n.$isElementNode(R)?R.getChildren():[];var T=g._nodes.get(R.getType());T=T&&T.exportDOM!==void 0?T.exportDOM(g,R):R.exportDOM(g);let{element:w,after:P}=T;if(!w)return!1;T=document.createDocumentFragment();for(let H=0;H<b.length;H++){let $=b[H],W=r(g,$,T,S);!x&&n.$isElementNode(p)&&W&&p.extractWithChild($,S,"html")&&(x=!0)}return x&&!O?(e.isHTMLElement(w)&&w.append(T),C.append(w),P&&(g=P.call(R,w))&&w.replaceWith(g)):C.append(T),x}let c=new Set(["STYLE","SCRIPT"]);function d(g,p,C=new Map,S){let x=[];if(c.has(g.nodeName))return x;let O=null;var R,{nodeName:b}=g,T=p._htmlConversions.get(b.toLowerCase());if(b=null,T!==void 0)for(R of T)T=R(g),T!==null&&(b===null||b.priority<T.priority)&&(b=T);if(b=(R=b!==null?b.conversion:null)?R(g):null,R=null,b!==null){if(R=b.after,T=b.node,O=Array.isArray(T)?T[T.length-1]:T,O!==null){for(var[,w]of C)if(O=w(O,S),!O)break;O&&x.push(...Array.isArray(T)?T:[O])}b.forChild!=null&&C.set(g.nodeName,b.forChild)}for(g=g.childNodes,S=[],w=0;w<g.length;w++)S.push(...d(g[w],p,new Map(C),O));return R!=null&&(S=R(S)),O==null?x=x.concat(S):n.$isElementNode(O)&&O.append(...S),x}return ja.$generateHtmlFromNodes=function(g,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let C=document.createElement("div"),S=n.$getRoot().getChildren();for(let x=0;x<S.length;x++)r(g,S[x],C,p);return C.innerHTML},ja.$generateNodesFromDOM=function(g,p){p=p.body?p.body.childNodes:[];let C=[];for(let x=0;x<p.length;x++){var S=p[x];c.has(S.nodeName)||(S=d(S,g),S!==null&&(C=C.concat(S)))}return C},ja}var ou,Uf;function mp(){return Uf||(Uf=1,ou=process.env.NODE_ENV==="development"?WN():KN()),ou}var Gf;function zN(){if(Gf)return Li;Gf=1;var t=mp(),e=Ao(),n=on(),r=Bt();const c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=B=>c?(B||window).getSelection():null;function g(B){const K=r.$getSelection();if(K==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(K)&&K.isCollapsed()||K.getNodes().length===0?"":t.$generateHtmlFromNodes(B,K)}function p(B){const K=r.$getSelection();if(K==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(K)&&K.isCollapsed()||K.getNodes().length===0?null:JSON.stringify(T(B,K))}function C(B,K){const X=B.getData("text/plain")||B.getData("text/uri-list");X!=null&&K.insertRawText(X)}function S(B,K,X){const ee=B.getData("application/x-lexical-editor");if(ee)try{const U=JSON.parse(ee);if(U.namespace===X._config.namespace&&Array.isArray(U.nodes)){const q=w(U.nodes);return x(X,q,K)}}catch{}const le=B.getData("text/html");if(le)try{const q=new DOMParser().parseFromString(le,"text/html"),me=t.$generateNodesFromDOM(X,q);return x(X,me,K)}catch{}const V=B.getData("text/plain")||B.getData("text/uri-list");if(V!=null)if(r.$isRangeSelection(K)){const U=V.split(/(\r?\n|\t)/);U[U.length-1]===""&&U.pop();for(let q=0;q<U.length;q++){const me=U[q];me===`
69
+ `),P=z.length,!t.$isTextNode(W)||$>=P)z=W.getParent(),W.remove(),z==null||z.getChildrenSize()!==0||t.$isRootNode(z)||z.remove(),$-=P+B,W=H;else{let X=W.getKey();B=x.getEditorState().read(()=>{const le=t.$getNodeByKey(X);return t.$isTextNode(le)&&le.isSimpleText()?le.getTextContent():null}),H=P-$;let ee=z.slice(0,H);B!==null&&B!==z?($=t.$getPreviousSelection(),P=W,W.isSimpleText()?W.setTextContent(B):(P=t.$createTextNode(B),W.replace(P)),t.$isRangeSelection($)&&$.isCollapsed()&&($=$.anchor.offset,P.select($,$))):W.isSimpleText()?(B=w.key===X,z=w.offset,z<$&&(z=P),$=B?z-$:0,P=B?z:H,B&&$===0?([$]=W.splitText($,P),$.remove()):([,$]=W.splitText($,P),$.remove())):($=t.$createTextNode(ee),W.replace($)),$=0}}},zn}var tu,Ff;function Ao(){return Ff||(Ff=1,tu=process.env.NODE_ENV==="development"?IN():PN()),tu}var Bf;function $N(){if(Bf)return Nn;Bf=1;var t=Ao(),e=Bt();function n(...ee){return()=>{ee.forEach(le=>le())}}function r(ee){return`${ee}px`}const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(ee,le,j){let U=null,q=null,me=null,_e=[];const pe=document.createElement("div");function ue(){if(U===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:ne,top:Y}=U.getBoundingClientRect(),G=q,Q=t.createRectsFromDOMRange(ee,le);pe.isConnected||G.append(pe);let k=!1;for(let m=0;m<Q.length;m++){const y=Q[m],A=_e[m]||document.createElement("div"),Z=A.style;Z.position!=="absolute"&&(Z.position="absolute",k=!0);const ae=r(y.left-ne);Z.left!==ae&&(Z.left=ae,k=!0);const he=r(y.top-Y);Z.top!==he&&(A.style.top=he,k=!0);const se=r(y.width);Z.width!==se&&(A.style.width=se,k=!0);const Te=r(y.height);Z.height!==Te&&(A.style.height=Te,k=!0),A.parentNode!==pe&&(pe.append(A),k=!0),_e[m]=A}for(;_e.length>Q.length;)_e.pop();k&&j(_e)}function K(){q=null,U=null,me!==null&&me.disconnect(),me=null,pe.remove();for(const ne of _e)ne.remove();_e=[]}function D(){const ne=ee.getRootElement();if(ne===null)return K();const Y=ne.parentElement;if(!(Y instanceof HTMLElement))return K();K(),U=ne,q=Y,me=new MutationObserver(G=>{const Q=ee.getRootElement(),k=Q&&Q.parentElement;if(Q!==U||k!==q)return D();for(const m of G)if(!pe.contains(m.target))return ue()}),me.observe(Y,c),ue()}const V=ee.registerRootListener(D);return()=>{V(),K()}}function g(ee,le){let j=null,U=null,q=null,me=null,_e=()=>{};function pe(ue){ue.read(()=>{const K=e.$getSelection();if(!e.$isRangeSelection(K)){j=null,U=null,q=null,me=null,_e(),_e=()=>{};return}const{anchor:D,focus:V}=K,ne=D.getNode(),Y=ne.getKey(),G=D.offset,Q=V.getNode(),k=Q.getKey(),m=V.offset,y=ee.getElementByKey(Y),A=ee.getElementByKey(k),Z=j===null||y===null||G!==U||Y!==j.getKey()||ne!==j&&(!(j instanceof e.TextNode)||ne.updateDOM(j,y,ee._config)),ae=q===null||A===null||m!==me||k!==q.getKey()||Q!==q&&(!(q instanceof e.TextNode)||Q.updateDOM(q,A,ee._config));if(Z||ae){const he=ee.getElementByKey(D.getNode().getKey()),se=ee.getElementByKey(V.getNode().getKey());if(he!==null&&se!==null&&he.tagName==="SPAN"&&se.tagName==="SPAN"){const Te=document.createRange();let be,Ue,re,te;V.isBefore(D)?(be=se,Ue=V.offset,re=he,te=D.offset):(be=he,Ue=D.offset,re=se,te=V.offset);const ce=be.firstChild;if(ce===null)throw Error("Expected text node to be first child of span");const we=re.firstChild;if(we===null)throw Error("Expected text node to be first child of span");Te.setStart(ce,Ue),Te.setEnd(we,te),_e(),_e=d(ee,Te,Le=>{for(const Be of Le){const Ye=Be.style;Ye.background!=="Highlight"&&(Ye.background="Highlight"),Ye.color!=="HighlightText"&&(Ye.color="HighlightText"),Ye.zIndex!=="-1"&&(Ye.zIndex="-1"),Ye.pointerEvents!=="none"&&(Ye.pointerEvents="none"),Ye.marginTop!==r(-1.5)&&(Ye.marginTop=r(-1.5)),Ye.paddingTop!==r(4)&&(Ye.paddingTop=r(4)),Ye.paddingBottom!==r(0)&&(Ye.paddingBottom=r(0))}le!==void 0&&le(Le)})}}j=ne,U=G,q=Q,me=m})}return pe(ee.getEditorState()),n(ee.registerUpdateListener(({editorState:ue})=>pe(ue)),_e,()=>{_e()})}function p(ee,...le){le.forEach(j=>{if(typeof j=="string"){const U=j.split(" ").filter(q=>q!=="");ee.classList.add(...U)}})}function C(ee,...le){le.forEach(j=>{typeof j=="string"&&ee.classList.remove(...j.split(" "))})}function S(ee,le){for(const j of le)if(ee.type.startsWith(j))return!0;return!1}function T(ee,le){const j=ee[Symbol.iterator]();return new Promise((U,q)=>{const me=[],_e=()=>{const{done:pe,value:ue}=j.next();if(pe)return U(me);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const D=K.result;typeof D=="string"&&me.push({file:ue,result:D}),_e()}),S(ue,le)?K.readAsDataURL(ue):_e()};_e()})}function O(ee,le){const j=[],U=(ee||e.$getRoot()).getLatest(),q=le||(e.$isElementNode(U)?U.getLastDescendant():U);let me=U,_e=R(me);for(;me!==null&&!me.is(q);)if(j.push({depth:_e,node:me}),e.$isElementNode(me)&&me.getChildrenSize()>0)me=me.getFirstChild(),_e++;else{let pe=null;for(;pe===null&&me!==null;)pe=me.getNextSibling(),pe===null?(me=me.getParent(),_e--):me=pe}return me!==null&&me.is(q)&&j.push({depth:_e,node:me}),j}function R(ee){let le=ee,j=0;for(;(le=le.getParent())!==null;)j++;return j}function b(ee,le){let j=ee;for(;j!=null;){if(j instanceof le)return j;j=j.getParent()}return null}function x(ee){const le=w(ee,j=>e.$isElementNode(j)&&!j.isInline());if(!e.$isElementNode(le))throw Error(`Expected node ${ee.__key} to have closest block element node.`);return le}function w(ee,le){let j=ee;for(;j!==e.$getRoot()&&j!=null;){if(le(j))return j;j=j.getParent()}return null}function $(ee,le,j,U){const q=pe=>pe instanceof le,me=pe=>{const ue=pe.getChildren();for(let V=0;V<ue.length;V++){const ne=ue[V];if(q(ne))return null}let K=pe,D=pe;for(;K!==null;)if(D=K,K=K.getParent(),q(K))return{child:D,parent:K};return null},_e=pe=>{const ue=me(pe);if(ue!==null){const{child:K,parent:D}=ue;if(K.is(pe)){U(D,pe);const V=K.getNextSiblings(),ne=V.length;if(D.insertAfter(K),ne!==0){const Y=j(D);K.insertAfter(Y);for(let G=0;G<ne;G++)Y.append(V[G])}!D.canBeEmpty()&&D.getChildrenSize()===0&&D.remove()}}};return ee.registerNodeTransform(le,_e)}function W(ee,le){const U=new Map,q=ee._pendingEditorState;for(const[_e,pe]of le._nodeMap){const ue=t.$cloneWithProperties(pe);e.$isTextNode(ue)&&(ue.__text=pe.__text),U.set(_e,ue)}q&&(q._nodeMap=U),ee._dirtyType=2;const me=le._selection;e.$setSelection(me===null?null:me.clone())}function P(ee){const le=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(le)){const{focus:j}=le,U=j.getNode(),q=j.offset;if(e.$isRootOrShadowRoot(U)){const me=U.getChildAtIndex(q);me==null?U.append(ee):me.insertBefore(ee),ee.selectNext()}else{let me,_e;e.$isTextNode(U)?(me=U.getParentOrThrow(),_e=U.getIndexWithinParent(),q>0&&(_e+=1,U.splitText(q))):(me=U,_e=q);const[,pe]=e.$splitNode(me,_e);pe.insertBefore(ee),pe.selectStart()}}else{if(le!=null){const U=le.getNodes();U[U.length-1].getTopLevelElementOrThrow().insertAfter(ee)}else e.$getRoot().append(ee);const j=e.$createParagraphNode();ee.insertAfter(j),j.select()}return ee.getLatest()}function H(ee,le){const j=le();return ee.replace(j),j.append(ee),j}function B(ee,le){return ee!==null?Object.getPrototypeOf(ee).constructor.name===le.name:!1}function z(ee,le){const j=[];for(let U=0;U<ee.length;U++){const q=le(ee[U]);q!==null&&j.push(q)}return j}function X(ee,le){const j=ee.getFirstChild();j!==null?j.insertBefore(le):ee.append(le)}return Nn.$splitNode=e.$splitNode,Nn.isHTMLAnchorElement=e.isHTMLAnchorElement,Nn.isHTMLElement=e.isHTMLElement,Nn.$dfs=O,Nn.$filter=z,Nn.$findMatchingParent=w,Nn.$getNearestBlockElementAncestorOrThrow=x,Nn.$getNearestNodeOfType=b,Nn.$insertFirst=X,Nn.$insertNodeToNearestRoot=P,Nn.$restoreEditorState=W,Nn.$wrapNodeInElement=H,Nn.addClassNamesToElement=p,Nn.isMimeType=S,Nn.markSelection=g,Nn.mediaFileReader=T,Nn.mergeRegister=n,Nn.objectKlassEquals=B,Nn.positionNodeOnRange=d,Nn.registerNestedElementResolver=$,Nn.removeClassNamesFromElement=C,Nn}var Cn={},Hf;function FN(){if(Hf)return Cn;Hf=1;var t=Ao(),e=Bt();function n(C){let S=new URLSearchParams;S.append("code",C);for(let T=1;T<arguments.length;T++)S.append("v",arguments[T]);throw Error(`Minified Lexical error #${C}; 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(...C){return()=>{C.forEach(S=>S())}}let c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(C,S,T){function O(){if(x===null)throw Error("Unexpected null rootDOMNode");if(w===null)throw Error("Unexpected null parentDOMNode");let{left:B,top:z}=x.getBoundingClientRect();var X=w;let ee=t.createRectsFromDOMRange(C,S);P.isConnected||X.append(P),X=!1;for(let U=0;U<ee.length;U++){var le=ee[U];let q=W[U]||document.createElement("div"),me=q.style;me.position!=="absolute"&&(me.position="absolute",X=!0);var j=`${le.left-B}px`;me.left!==j&&(me.left=j,X=!0),j=`${le.top-z}px`,me.top!==j&&(q.style.top=j,X=!0),j=`${le.width}px`,me.width!==j&&(q.style.width=j,X=!0),le=`${le.height}px`,me.height!==le&&(q.style.height=le,X=!0),q.parentNode!==P&&(P.append(q),X=!0),W[U]=q}for(;W.length>ee.length;)W.pop();X&&T(W)}function R(){x=w=null,$!==null&&$.disconnect(),$=null,P.remove();for(let B of W)B.remove();W=[]}function b(){let B=C.getRootElement();if(B===null)return R();let z=B.parentElement;if(!(z instanceof HTMLElement))return R();R(),x=B,w=z,$=new MutationObserver(X=>{let ee=C.getRootElement(),le=ee&&ee.parentElement;if(ee!==x||le!==w)return b();for(let j of X)if(!P.contains(j.target))return O()}),$.observe(z,c),O()}let x=null,w=null,$=null,W=[],P=document.createElement("div"),H=C.registerRootListener(b);return()=>{H(),R()}}function g(C,S){for(let T of S)if(C.type.startsWith(T))return!0;return!1}function p(C,S){for(;C!==e.$getRoot()&&C!=null;){if(S(C))return C;C=C.getParent()}return null}return Cn.$splitNode=e.$splitNode,Cn.isHTMLAnchorElement=e.isHTMLAnchorElement,Cn.isHTMLElement=e.isHTMLElement,Cn.$dfs=function(C,S){let T=[];C=(C||e.$getRoot()).getLatest(),S=S||(e.$isElementNode(C)?C.getLastDescendant():C);for(var O=C,R=0;(O=O.getParent())!==null;)R++;for(O=R;C!==null&&!C.is(S);)if(T.push({depth:O,node:C}),e.$isElementNode(C)&&0<C.getChildrenSize())C=C.getFirstChild(),O++;else for(R=null;R===null&&C!==null;)R=C.getNextSibling(),R===null?(C=C.getParent(),O--):C=R;return C!==null&&C.is(S)&&T.push({depth:O,node:C}),T},Cn.$filter=function(C,S){let T=[];for(let O=0;O<C.length;O++){let R=S(C[O]);R!==null&&T.push(R)}return T},Cn.$findMatchingParent=p,Cn.$getNearestBlockElementAncestorOrThrow=function(C){let S=p(C,T=>e.$isElementNode(T)&&!T.isInline());return e.$isElementNode(S)||n(4,C.__key),S},Cn.$getNearestNodeOfType=function(C,S){for(;C!=null;){if(C instanceof S)return C;C=C.getParent()}return null},Cn.$insertFirst=function(C,S){let T=C.getFirstChild();T!==null?T.insertBefore(S):C.append(S)},Cn.$insertNodeToNearestRoot=function(C){var S=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(S)){var{focus:T}=S;if(S=T.getNode(),T=T.offset,e.$isRootOrShadowRoot(S))T=S.getChildAtIndex(T),T==null?S.append(C):T.insertBefore(C),C.selectNext();else{let O,R;e.$isTextNode(S)?(O=S.getParentOrThrow(),R=S.getIndexWithinParent(),0<T&&(R+=1,S.splitText(T))):(O=S,R=T),[,S]=e.$splitNode(O,R),S.insertBefore(C),S.selectStart()}}else S!=null?(S=S.getNodes(),S[S.length-1].getTopLevelElementOrThrow().insertAfter(C)):e.$getRoot().append(C),S=e.$createParagraphNode(),C.insertAfter(S),S.select();return C.getLatest()},Cn.$restoreEditorState=function(C,S){let T=new Map,O=C._pendingEditorState;for(let[R,b]of S._nodeMap){let x=t.$cloneWithProperties(b);e.$isTextNode(x)&&(x.__text=b.__text),T.set(R,x)}O&&(O._nodeMap=T),C._dirtyType=2,C=S._selection,e.$setSelection(C===null?null:C.clone())},Cn.$wrapNodeInElement=function(C,S){return S=S(),C.replace(S),S.append(C),S},Cn.addClassNamesToElement=function(C,...S){S.forEach(T=>{typeof T=="string"&&(T=T.split(" ").filter(O=>O!==""),C.classList.add(...T))})},Cn.isMimeType=g,Cn.markSelection=function(C,S){function T($){$.read(()=>{var W=e.$getSelection();if(e.$isRangeSelection(W)){var{anchor:P,focus:H}=W;W=P.getNode();var B=W.getKey(),z=P.offset,X=H.getNode(),ee=X.getKey(),le=H.offset,j=C.getElementByKey(B),U=C.getElementByKey(ee);if(B=O===null||j===null||z!==R||B!==O.getKey()||W!==O&&(!(O instanceof e.TextNode)||W.updateDOM(O,j,C._config)),ee=b===null||U===null||le!==x||ee!==b.getKey()||X!==b&&(!(b instanceof e.TextNode)||X.updateDOM(b,U,C._config)),B||ee){j=C.getElementByKey(P.getNode().getKey());var q=C.getElementByKey(H.getNode().getKey());if(j!==null&&q!==null&&j.tagName==="SPAN"&&q.tagName==="SPAN"){if(ee=document.createRange(),H.isBefore(P)?(B=q,U=H.offset,q=j,j=P.offset):(B=j,U=P.offset,j=H.offset),B=B.firstChild,B===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");ee.setStart(B,U),ee.setEnd(q,j),w(),w=d(C,ee,me=>{for(let _e of me){let pe=_e.style;pe.background!=="Highlight"&&(pe.background="Highlight"),pe.color!=="HighlightText"&&(pe.color="HighlightText"),pe.zIndex!=="-1"&&(pe.zIndex="-1"),pe.pointerEvents!=="none"&&(pe.pointerEvents="none"),pe.marginTop!=="-1.5px"&&(pe.marginTop="-1.5px"),pe.paddingTop!=="4px"&&(pe.paddingTop="4px"),pe.paddingBottom!=="0px"&&(pe.paddingBottom="0px")}S!==void 0&&S(me)})}}O=W,R=z,b=X,x=le}else x=b=R=O=null,w(),w=()=>{}})}let O=null,R=null,b=null,x=null,w=()=>{};return T(C.getEditorState()),r(C.registerUpdateListener(({editorState:$})=>T($)),w,()=>{w()})},Cn.mediaFileReader=function(C,S){let T=C[Symbol.iterator]();return new Promise((O,R)=>{let b=[],x=()=>{const{done:w,value:$}=T.next();if(w)return O(b);const W=new FileReader;W.addEventListener("error",R),W.addEventListener("load",()=>{const P=W.result;typeof P=="string"&&b.push({file:$,result:P}),x()}),g($,S)?W.readAsDataURL($):x()};x()})},Cn.mergeRegister=r,Cn.objectKlassEquals=function(C,S){return C!==null?Object.getPrototypeOf(C).constructor.name===S.name:!1},Cn.positionNodeOnRange=d,Cn.registerNestedElementResolver=function(C,S,T,O){return C.registerNodeTransform(S,R=>{e:{for(var b=R.getChildren(),x=0;x<b.length;x++)if(b[x]instanceof S){b=null;break e}for(b=R;b!==null;)if(x=b,b=b.getParent(),b instanceof S){b={child:x,parent:b};break e}b=null}if(b!==null){const{child:w,parent:$}=b;if(w.is(R)){if(O($,R),R=w.getNextSiblings(),b=R.length,$.insertAfter(w),b!==0){x=T($),w.insertAfter(x);for(let W=0;W<b;W++)x.append(R[W])}$.canBeEmpty()||$.getChildrenSize()!==0||$.remove()}}})},Cn.removeClassNamesFromElement=function(C,...S){S.forEach(T=>{typeof T=="string"&&C.classList.remove(...T.split(" "))})},Cn}var nu,Wf;function on(){return Wf||(Wf=1,nu=process.env.NODE_ENV==="development"?$N():FN()),nu}var ru={},Kf;function BN(){if(Kf)return ru;Kf=1;var t=Bt();function e(n){const r=window.location.origin,c=d=>{if(d.origin!==r)return;const g=n.getRootElement();if(document.activeElement!==g)return;const p=d.data;if(typeof p=="string"){let C;try{C=JSON.parse(p)}catch{return}if(C&&C.protocol==="nuanria_messaging"&&C.type==="request"){const S=C.payload;if(S&&S.functionId==="makeChanges"){const T=S.args;if(T){const[O,R,b,x,w,$]=T;n.update(()=>{const W=t.$getSelection();if(t.$isRangeSelection(W)){const P=W.anchor;let H=P.getNode(),B=0,z=0;if(t.$isTextNode(H)&&O>=0&&R>=0&&(B=O,z=O+R,W.setTextNodeRange(H,B,H,z)),(B!==z||b!=="")&&(W.insertRawText(b),H=P.getNode()),t.$isTextNode(H)){B=x,z=x+w;const X=H.getTextContentSize();B=B>X?X:B,z=z>X?X:z,W.setTextNodeRange(H,B,H,z)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",c,!0),()=>{window.removeEventListener("message",c,!0)}}return ru.registerDragonSupport=e,ru}var iu={},zf;function HN(){if(zf)return iu;zf=1;var t=Bt();return iu.registerDragonSupport=function(e){let n=window.location.origin,r=c=>{if(c.origin===n){var d=e.getRootElement();if(document.activeElement===d&&(d=c.data,typeof d=="string")){try{var g=JSON.parse(d)}catch{return}if(g&&g.protocol==="nuanria_messaging"&&g.type==="request"&&(g=g.payload)&&g.functionId==="makeChanges"&&(g=g.args)){const[p,C,S,T,O]=g;e.update(()=>{const R=t.$getSelection();if(t.$isRangeSelection(R)){var b=R.anchor;let x=b.getNode(),w=0,$=0;t.$isTextNode(x)&&0<=p&&0<=C&&(w=p,$=p+C,R.setTextNodeRange(x,w,x,$)),(w!==$||S!=="")&&(R.insertRawText(S),x=b.getNode()),t.$isTextNode(x)&&(w=T,$=T+O,b=x.getTextContentSize(),w=w>b?b:w,$=$>b?b:$,R.setTextNodeRange(x,w,x,$)),c.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},iu}var ou,Uf;function yp(){return Uf||(Uf=1,ou=process.env.NODE_ENV==="development"?BN():HN()),ou}var ci={},Li={},Ya={},Gf;function WN(){if(Gf)return Ya;Gf=1;var t=Ao(),e=on(),n=Bt();function r(S,T){const O=T.body?T.body.childNodes:[];let R=[];for(let b=0;b<O.length;b++){const x=O[b];if(!p.has(x.nodeName)){const w=C(x,S);w!==null&&(R=R.concat(w))}}return R}function c(S,T){if(typeof document>"u"||typeof window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const O=document.createElement("div"),b=n.$getRoot().getChildren();for(let x=0;x<b.length;x++){const w=b[x];d(S,w,O,T)}return O.innerHTML}function d(S,T,O,R=null){let b=R!=null?T.isSelected(R):!0;const x=n.$isElementNode(T)&&T.excludeFromCopy("html");let w=T;if(R!==null){let X=t.$cloneWithProperties(T);X=n.$isTextNode(X)&&R!=null?t.$sliceSelectedTextNodeContent(R,X):X,w=X}const $=n.$isElementNode(w)?w.getChildren():[],W=S._nodes.get(w.getType());let P;W&&W.exportDOM!==void 0?P=W.exportDOM(S,w):P=w.exportDOM(S);const{element:H,after:B}=P;if(!H)return!1;const z=document.createDocumentFragment();for(let X=0;X<$.length;X++){const ee=$[X],le=d(S,ee,z,R);!b&&n.$isElementNode(T)&&le&&T.extractWithChild(ee,R,"html")&&(b=!0)}if(b&&!x){if(e.isHTMLElement(H)&&H.append(z),O.append(H),B){const X=B.call(w,H);X&&H.replaceWith(X)}}else O.append(z);return b}function g(S,T){const{nodeName:O}=S,R=T._htmlConversions.get(O.toLowerCase());let b=null;if(R!==void 0)for(const x of R){const w=x(S);w!==null&&(b===null||b.priority<w.priority)&&(b=w)}return b!==null?b.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function C(S,T,O=new Map,R){let b=[];if(p.has(S.nodeName))return b;let x=null;const w=g(S,T),$=w?w(S):null;let W=null;if($!==null){W=$.after;const B=$.node;if(x=Array.isArray(B)?B[B.length-1]:B,x!==null){for(const[,z]of O)if(x=z(x,R),!x)break;x&&b.push(...Array.isArray(B)?B:[x])}$.forChild!=null&&O.set(S.nodeName,$.forChild)}const P=S.childNodes;let H=[];for(let B=0;B<P.length;B++)H.push(...C(P[B],T,new Map(O),x));return W!=null&&(H=W(H)),x==null?b=b.concat(H):n.$isElementNode(x)&&x.append(...H),b}return Ya.$generateHtmlFromNodes=c,Ya.$generateNodesFromDOM=r,Ya}var ja={},Yf;function KN(){if(Yf)return ja;Yf=1;var t=Ao(),e=on(),n=Bt();function r(g,p,C,S=null){let T=S!=null?p.isSelected(S):!0,O=n.$isElementNode(p)&&p.excludeFromCopy("html");var R=p;S!==null&&(R=t.$cloneWithProperties(p),R=n.$isTextNode(R)&&S!=null?t.$sliceSelectedTextNodeContent(S,R):R);let b=n.$isElementNode(R)?R.getChildren():[];var x=g._nodes.get(R.getType());x=x&&x.exportDOM!==void 0?x.exportDOM(g,R):R.exportDOM(g);let{element:w,after:$}=x;if(!w)return!1;x=document.createDocumentFragment();for(let W=0;W<b.length;W++){let P=b[W],H=r(g,P,x,S);!T&&n.$isElementNode(p)&&H&&p.extractWithChild(P,S,"html")&&(T=!0)}return T&&!O?(e.isHTMLElement(w)&&w.append(x),C.append(w),$&&(g=$.call(R,w))&&w.replaceWith(g)):C.append(x),T}let c=new Set(["STYLE","SCRIPT"]);function d(g,p,C=new Map,S){let T=[];if(c.has(g.nodeName))return T;let O=null;var R,{nodeName:b}=g,x=p._htmlConversions.get(b.toLowerCase());if(b=null,x!==void 0)for(R of x)x=R(g),x!==null&&(b===null||b.priority<x.priority)&&(b=x);if(b=(R=b!==null?b.conversion:null)?R(g):null,R=null,b!==null){if(R=b.after,x=b.node,O=Array.isArray(x)?x[x.length-1]:x,O!==null){for(var[,w]of C)if(O=w(O,S),!O)break;O&&T.push(...Array.isArray(x)?x:[O])}b.forChild!=null&&C.set(g.nodeName,b.forChild)}for(g=g.childNodes,S=[],w=0;w<g.length;w++)S.push(...d(g[w],p,new Map(C),O));return R!=null&&(S=R(S)),O==null?T=T.concat(S):n.$isElementNode(O)&&O.append(...S),T}return ja.$generateHtmlFromNodes=function(g,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let C=document.createElement("div"),S=n.$getRoot().getChildren();for(let T=0;T<S.length;T++)r(g,S[T],C,p);return C.innerHTML},ja.$generateNodesFromDOM=function(g,p){p=p.body?p.body.childNodes:[];let C=[];for(let T=0;T<p.length;T++){var S=p[T];c.has(S.nodeName)||(S=d(S,g),S!==null&&(C=C.concat(S)))}return C},ja}var su,jf;function Np(){return jf||(jf=1,su=process.env.NODE_ENV==="development"?WN():KN()),su}var Vf;function zN(){if(Vf)return Li;Vf=1;var t=Np(),e=Ao(),n=on(),r=Bt();const c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=B=>c?(B||window).getSelection():null;function g(B){const z=r.$getSelection();if(z==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(z)&&z.isCollapsed()||z.getNodes().length===0?"":t.$generateHtmlFromNodes(B,z)}function p(B){const z=r.$getSelection();if(z==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(z)&&z.isCollapsed()||z.getNodes().length===0?null:JSON.stringify(x(B,z))}function C(B,z){const X=B.getData("text/plain")||B.getData("text/uri-list");X!=null&&z.insertRawText(X)}function S(B,z,X){const ee=B.getData("application/x-lexical-editor");if(ee)try{const U=JSON.parse(ee);if(U.namespace===X._config.namespace&&Array.isArray(U.nodes)){const q=w(U.nodes);return T(X,q,z)}}catch{}const le=B.getData("text/html");if(le)try{const q=new DOMParser().parseFromString(le,"text/html"),me=t.$generateNodesFromDOM(X,q);return T(X,me,z)}catch{}const j=B.getData("text/plain")||B.getData("text/uri-list");if(j!=null)if(r.$isRangeSelection(z)){const U=j.split(/(\r?\n|\t)/);U[U.length-1]===""&&U.pop();for(let q=0;q<U.length;q++){const me=U[q];me===`
70
70
  `||me===`\r
71
- `?K.insertParagraph():me===" "?K.insertNodes([r.$createTabNode()]):K.insertText(me)}}else K.insertRawText(V)}function x(B,K,X){const ee=r.DEPRECATED_$isGridSelection(X),le=r.$isRangeSelection(X);if((ee||le&&n.$findMatchingParent(X.anchor.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null&&n.$findMatchingParent(X.focus.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null)&&K.length===1&&r.DEPRECATED_$isGridNode(K[0])){O(K,X,!1,B);return}X.insertNodes(K)}function O(B,K,X,ee){if(B.length!==1||!r.DEPRECATED_$isGridNode(B[0]))throw Error("$mergeGridNodesStrategy: Expected Grid insertion.");const le=B[0],V=le.getChildren(),U=le.getFirstChildOrThrow().getChildrenSize(),q=le.getChildrenSize(),me=n.$findMatchingParent(K.anchor.getNode(),Z=>r.DEPRECATED_$isGridCellNode(Z)),_e=me&&n.$findMatchingParent(me,Z=>r.DEPRECATED_$isGridRowNode(Z)),pe=_e&&n.$findMatchingParent(_e,Z=>r.DEPRECATED_$isGridNode(Z));if(!r.DEPRECATED_$isGridCellNode(me)||!r.DEPRECATED_$isGridRowNode(_e)||!r.DEPRECATED_$isGridNode(pe))throw Error("$mergeGridNodesStrategy: Expected selection to be inside of a Grid.");const ue=_e.getIndexWithinParent(),z=Math.min(pe.getChildrenSize()-1,ue+q-1),D=me.getIndexWithinParent(),j=Math.min(_e.getChildrenSize()-1,D+U-1),ne=Math.min(D,j),Y=Math.min(ue,z),G=Math.max(D,j),Q=Math.max(ue,z),k=pe.getChildren();let m=0,y,A;for(let Z=Y;Z<=Q;Z++){const ae=k[Z];if(!r.DEPRECATED_$isGridRowNode(ae))throw Error("getNodes: expected to find GridRowNode");const he=V[m];if(!r.DEPRECATED_$isGridRowNode(he))throw Error("getNodes: expected to find GridRowNode");const se=ae.getChildren(),Te=he.getChildren();let be=0;for(let Ue=ne;Ue<=G;Ue++){const re=se[Ue];if(!r.DEPRECATED_$isGridCellNode(re))throw Error("getNodes: expected to find GridCellNode");const te=Te[be];if(!r.DEPRECATED_$isGridCellNode(te))throw Error("getNodes: expected to find GridCellNode");Z===Y&&Ue===ne?y=re.getKey():Z===Q&&Ue===G&&(A=re.getKey());const ce=re.getChildren();te.getChildren().forEach(we=>{r.$isTextNode(we)&&r.$createParagraphNode().append(we),re.append(we)}),ce.forEach(we=>we.remove()),be++}m++}if(y&&A){const Z=r.DEPRECATED_$createGridSelection();Z.set(pe.getKey(),y,A),r.$setSelection(Z),ee.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0)}}function R(B){const K=B.exportJSON(),X=B.constructor;if(K.type!==X.getType())throw Error(`LexicalNode: Node ${X.name} does not implement .exportJSON().`);const ee=K.children;if(r.$isElementNode(B)&&!Array.isArray(ee))throw Error(`LexicalNode: Node ${X.name} is an element but .exportJSON() does not have a children array.`);return K}function b(B,K,X,ee=[]){let le=K!=null?X.isSelected(K):!0;const V=r.$isElementNode(X)&&X.excludeFromCopy("html");let U=X;if(K!==null){let _e=e.$cloneWithProperties(X);_e=r.$isTextNode(_e)&&K!=null?e.$sliceSelectedTextNodeContent(K,_e):_e,U=_e}const q=r.$isElementNode(U)?U.getChildren():[],me=R(U);if(r.$isTextNode(U)){const _e=U.__text;_e.length>0?me.text=_e:le=!1}for(let _e=0;_e<q.length;_e++){const pe=q[_e],ue=b(B,K,pe,me.children);!le&&r.$isElementNode(X)&&ue&&X.extractWithChild(pe,K,"clone")&&(le=!0)}if(le&&!V)ee.push(me);else if(Array.isArray(me.children))for(let _e=0;_e<me.children.length;_e++){const pe=me.children[_e];ee.push(pe)}return le}function T(B,K){const X=[],le=r.$getRoot().getChildren();for(let V=0;V<le.length;V++){const U=le[V];b(B,K,U,X)}return{namespace:B._config.namespace,nodes:X}}function w(B){const K=[];for(let X=0;X<B.length;X++){const ee=B[X],le=r.$parseSerializedNode(ee);r.$isTextNode(le)&&e.$addNodeStyle(le),K.push(le)}return K}const P=50;let H=null;async function $(B,K){if(H!==null)return!1;if(K!==null)return new Promise((q,me)=>{B.update(()=>{q(W(B,K))})});const X=B.getRootElement(),ee=B._window==null?window.document:B._window.document,le=d(B._window);if(X===null||le===null)return!1;const V=ee.createElement("span");V.style.cssText="position: fixed; top: -1000px;",V.append(ee.createTextNode("#")),X.append(V);const U=new Range;return U.setStart(V,0),U.setEnd(V,1),le.removeAllRanges(),le.addRange(U),new Promise((q,me)=>{const _e=B.registerCommand(r.COPY_COMMAND,pe=>(n.objectKlassEquals(pe,ClipboardEvent)&&(_e(),H!==null&&(window.clearTimeout(H),H=null),q(W(B,pe))),!0),r.COMMAND_PRIORITY_CRITICAL);H=window.setTimeout(()=>{_e(),H=null,q(!1)},P),ee.execCommand("copy"),V.remove()})}function W(B,K){const X=d(B._window);if(!X)return!1;const ee=X.anchorNode,le=X.focusNode;if(ee!==null&&le!==null&&!r.isSelectionWithinEditor(B,ee,le))return!1;K.preventDefault();const V=K.clipboardData,U=r.$getSelection();if(V===null||U===null)return!1;const q=g(B),me=p(B);let _e="";return U!==null&&(_e=U.getTextContent()),q!==null&&V.setData("text/html",q),me!==null&&V.setData("application/x-lexical-editor",me),V.setData("text/plain",_e),!0}return Li.$generateJSONFromSelectedNodes=T,Li.$generateNodesFromSerializedNodes=w,Li.$getHtmlContent=g,Li.$getLexicalContent=p,Li.$insertDataTransferForPlainText=C,Li.$insertDataTransferForRichText=S,Li.$insertGeneratedNodes=x,Li.copyToClipboard=$,Li}var ki={},Yf;function UN(){if(Yf)return ki;Yf=1;var t=mp(),e=Ao(),n=on(),r=Bt();function c(w){let P=new URLSearchParams;P.append("code",w);for(let H=1;H<arguments.length;H++)P.append("v",arguments[H]);throw Error(`Minified Lexical error #${w}; visit https://lexical.dev/docs/error?${P} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g(w){let P=r.$getSelection();if(P==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(P)&&P.isCollapsed()||P.getNodes().length===0?"":t.$generateHtmlFromNodes(w,P)}function p(w){let P=r.$getSelection();if(P==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(P)&&P.isCollapsed()||P.getNodes().length===0?null:JSON.stringify(O(w,P))}function C(w,P,H){let $=r.DEPRECATED_$isGridSelection(H),W=r.$isRangeSelection(H);($||W&&n.$findMatchingParent(H.anchor.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null&&n.$findMatchingParent(H.focus.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null)&&P.length===1&&r.DEPRECATED_$isGridNode(P[0])?S(P,H,!1,w):H.insertNodes(P)}function S(w,P,H,$){w.length===1&&r.DEPRECATED_$isGridNode(w[0])||c(42);var W=w[0];w=W.getChildren(),H=W.getFirstChildOrThrow().getChildrenSize();var B=W.getChildrenSize(),K=n.$findMatchingParent(P.anchor.getNode(),me=>r.DEPRECATED_$isGridCellNode(me));P=(W=K&&n.$findMatchingParent(K,me=>r.DEPRECATED_$isGridRowNode(me)))&&n.$findMatchingParent(W,me=>r.DEPRECATED_$isGridNode(me)),r.DEPRECATED_$isGridCellNode(K)&&r.DEPRECATED_$isGridRowNode(W)&&r.DEPRECATED_$isGridNode(P)||c(43);var X=W.getIndexWithinParent(),ee=Math.min(P.getChildrenSize()-1,X+B-1);B=K.getIndexWithinParent(),K=Math.min(W.getChildrenSize()-1,B+H-1),H=Math.min(B,K),W=Math.min(X,ee),B=Math.max(B,K),X=Math.max(X,ee),ee=P.getChildren(),K=0;let le,V;for(let me=W;me<=X;me++){var U=ee[me];r.DEPRECATED_$isGridRowNode(U)||c(24);var q=w[K];r.DEPRECATED_$isGridRowNode(q)||c(24),U=U.getChildren(),q=q.getChildren();let _e=0;for(let pe=H;pe<=B;pe++){let ue=U[pe];r.DEPRECATED_$isGridCellNode(ue)||c(25);let z=q[_e];r.DEPRECATED_$isGridCellNode(z)||c(25),me===W&&pe===H?le=ue.getKey():me===X&&pe===B&&(V=ue.getKey());let D=ue.getChildren();z.getChildren().forEach(j=>{r.$isTextNode(j)&&r.$createParagraphNode().append(j),ue.append(j)}),D.forEach(j=>j.remove()),_e++}K++}le&&V&&(w=r.DEPRECATED_$createGridSelection(),w.set(P.getKey(),le,V),r.$setSelection(w),$.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0))}function x(w,P,H,$=[]){let W=P!=null?H.isSelected(P):!0,B=r.$isElementNode(H)&&H.excludeFromCopy("html");var K=H;if(P!==null){var X=e.$cloneWithProperties(H);K=X=r.$isTextNode(X)&&P!=null?e.$sliceSelectedTextNodeContent(P,X):X}let ee=r.$isElementNode(K)?K.getChildren():[];var le=K;X=le.exportJSON();var V=le.constructor;X.type!==V.getType()&&c(58,V.name);let U=X.children;for(r.$isElementNode(le)&&(Array.isArray(U)||c(59,V.name)),r.$isTextNode(K)&&(K=K.__text,0<K.length?X.text=K:W=!1),K=0;K<ee.length;K++)le=ee[K],V=x(w,P,le,X.children),!W&&r.$isElementNode(H)&&V&&H.extractWithChild(le,P,"clone")&&(W=!0);if(W&&!B)$.push(X);else if(Array.isArray(X.children))for(w=0;w<X.children.length;w++)$.push(X.children[w]);return W}function O(w,P){let H=[],$=r.$getRoot().getChildren();for(let W=0;W<$.length;W++)x(w,P,$[W],H);return{namespace:w._config.namespace,nodes:H}}function R(w){let P=[];for(let H=0;H<w.length;H++){let $=r.$parseSerializedNode(w[H]);r.$isTextNode($)&&e.$addNodeStyle($),P.push($)}return P}let b=null;function T(w,P){var H=d?(w._window||window).getSelection():null;if(!H)return!1;var $=H.anchorNode;if(H=H.focusNode,$!==null&&H!==null&&!r.isSelectionWithinEditor(w,$,H)||(P.preventDefault(),P=P.clipboardData,$=r.$getSelection(),P===null||$===null))return!1;H=g(w),w=p(w);let W="";return $!==null&&(W=$.getTextContent()),H!==null&&P.setData("text/html",H),w!==null&&P.setData("application/x-lexical-editor",w),P.setData("text/plain",W),!0}return ki.$generateJSONFromSelectedNodes=O,ki.$generateNodesFromSerializedNodes=R,ki.$getHtmlContent=g,ki.$getLexicalContent=p,ki.$insertDataTransferForPlainText=function(w,P){w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null&&P.insertRawText(w)},ki.$insertDataTransferForRichText=function(w,P,H){var $=w.getData("application/x-lexical-editor");if($)try{let B=JSON.parse($);if(B.namespace===H._config.namespace&&Array.isArray(B.nodes)){let K=R(B.nodes);return C(H,K,P)}}catch{}if($=w.getData("text/html"))try{var W=new DOMParser().parseFromString($,"text/html");let B=t.$generateNodesFromDOM(H,W);return C(H,B,P)}catch{}if(w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null)if(r.$isRangeSelection(P))for(w=w.split(/(\r?\n|\t)/),w[w.length-1]===""&&w.pop(),H=0;H<w.length;H++)W=w[H],W===`
72
- `||W===`\r
73
- `?P.insertParagraph():W===" "?P.insertNodes([r.$createTabNode()]):P.insertText(W);else P.insertRawText(w)},ki.$insertGeneratedNodes=C,ki.copyToClipboard=async function(w,P){if(b!==null)return!1;if(P!==null)return new Promise(K=>{w.update(()=>{K(T(w,P))})});var H=w.getRootElement();let $=w._window==null?window.document:w._window.document,W=d?(w._window||window).getSelection():null;if(H===null||W===null)return!1;let B=$.createElement("span");return B.style.cssText="position: fixed; top: -1000px;",B.append($.createTextNode("#")),H.append(B),H=new Range,H.setStart(B,0),H.setEnd(B,1),W.removeAllRanges(),W.addRange(H),new Promise(K=>{let X=w.registerCommand(r.COPY_COMMAND,ee=>(n.objectKlassEquals(ee,ClipboardEvent)&&(X(),b!==null&&(window.clearTimeout(b),b=null),K(T(w,ee))),!0),r.COMMAND_PRIORITY_CRITICAL);b=window.setTimeout(()=>{X(),b=null,K(!1)},50),$.execCommand("copy"),B.remove()})},ki}var su,jf;function _p(){return jf||(jf=1,su=process.env.NODE_ENV==="development"?zN():UN()),su}var Vf;function GN(){if(Vf)return ci;Vf=1;var t=_p(),e=Ao(),n=on(),r=Bt();function c(_e,pe){if(typeof document.caretRangeFromPoint<"u"){const ue=document.caretRangeFromPoint(_e,pe);return ue===null?null:{node:ue.startContainer,offset:ue.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const ue=document.caretPositionFromPoint(_e,pe);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,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,C=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),S=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,x=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!x,R=r.createCommand("DRAG_DROP_PASTE_FILE");class b extends r.ElementNode{static getType(){return"quote"}static clone(pe){return new b(pe.__key)}constructor(pe){super(pe)}createDOM(pe){const ue=document.createElement("blockquote");return n.addClassNamesToElement(ue,pe.theme.quote),ue}updateDOM(pe,ue){return!1}static importDOM(){return{blockquote:pe=>({conversion:W,priority:0})}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const z=this.getFormatType();ue.style.textAlign=z;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=T();return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(pe,ue){const z=r.$createParagraphNode(),D=this.getDirection();return z.setDirection(D),this.insertAfter(z,ue),z}collapseAtStart(){const pe=r.$createParagraphNode();return this.getChildren().forEach(z=>pe.append(z)),this.replace(pe),!0}}function T(){return r.$applyNodeReplacement(new b)}function w(_e){return _e instanceof b}class P extends r.ElementNode{static getType(){return"heading"}static clone(pe){return new P(pe.__tag,pe.__key)}constructor(pe,ue){super(ue),this.__tag=pe}getTag(){return this.__tag}createDOM(pe){const ue=this.__tag,z=document.createElement(ue),j=pe.theme.heading;if(j!==void 0){const ne=j[ue];n.addClassNamesToElement(z,ne)}return z}updateDOM(pe,ue){return!1}static importDOM(){return{h1:pe=>({conversion:$,priority:0}),h2:pe=>({conversion:$,priority:0}),h3:pe=>({conversion:$,priority:0}),h4:pe=>({conversion:$,priority:0}),h5:pe=>({conversion:$,priority:0}),h6:pe=>({conversion:$,priority:0}),p:pe=>{const z=pe.firstChild;return z!==null&&H(z)?{conversion:()=>({node:null}),priority:3}:null},span:pe=>H(pe)?{conversion:ue=>({node:B("h1")}),priority:3}:null}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const z=this.getFormatType();ue.style.textAlign=z;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=B(pe.tag);return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(pe,ue=!0){const z=pe?pe.anchor.offset:0,D=z===this.getTextContentSize()||!pe?r.$createParagraphNode():B(this.getTag()),j=this.getDirection();if(D.setDirection(j),this.insertAfter(D,ue),z===0&&!this.isEmpty()&&pe){const ne=r.$createParagraphNode();ne.select(),this.replace(ne,!0)}return D}collapseAtStart(){const pe=this.isEmpty()?r.$createParagraphNode():B(this.getTag());return this.getChildren().forEach(z=>pe.append(z)),this.replace(pe),!0}extractWithChild(){return!0}}function H(_e){return _e.nodeName.toLowerCase()==="span"?_e.style.fontSize==="26pt":!1}function $(_e){const pe=_e.nodeName.toLowerCase();let ue=null;return(pe==="h1"||pe==="h2"||pe==="h3"||pe==="h4"||pe==="h5"||pe==="h6")&&(ue=B(pe),_e.style!==null&&ue.setFormat(_e.style.textAlign)),{node:ue}}function W(_e){const pe=T();return _e.style!==null&&pe.setFormat(_e.style.textAlign),{node:pe}}function B(_e){return r.$applyNodeReplacement(new P(_e))}function K(_e){return _e instanceof P}function X(_e,pe){_e.preventDefault(),pe.update(()=>{const ue=r.$getSelection(),z=_e instanceof InputEvent||_e instanceof KeyboardEvent?null:_e.clipboardData;z!=null&&r.$INTERNAL_isPointSelection(ue)&&t.$insertDataTransferForRichText(z,ue,pe)},{tag:"paste"})}async function ee(_e,pe){await t.copyToClipboard(pe,n.objectKlassEquals(_e,ClipboardEvent)?_e:null),pe.update(()=>{const ue=r.$getSelection();r.$isRangeSelection(ue)?ue.removeText():r.$isNodeSelection(ue)&&ue.getNodes().forEach(z=>z.remove())})}function le(_e){let pe=null;if(_e instanceof DragEvent?pe=_e.dataTransfer:_e instanceof ClipboardEvent&&(pe=_e.clipboardData),pe===null)return[!1,[],!1];const ue=pe.types,z=ue.includes("Files"),D=ue.includes("text/html")||ue.includes("text/plain");return[z,Array.from(pe.files),D]}function V(_e){const pe=r.$getSelection();if(!r.$isRangeSelection(pe))return!1;const ue=new Set,z=pe.getNodes();for(let D=0;D<z.length;D++){const j=z[D],ne=j.getKey();if(ue.has(ne))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(j),G=Y.getKey();Y.canIndent()&&!ue.has(G)&&(ue.add(G),_e(Y))}return ue.size>0}function U(_e){const pe=r.$getNearestNodeFromDOMNode(_e);return r.$isDecoratorNode(pe)}function q(_e){const pe=_e.focus;return pe.key==="root"&&pe.offset===r.$getRoot().getChildrenSize()}function me(_e){return n.mergeRegister(_e.registerCommand(r.CLICK_COMMAND,ue=>{const z=r.$getSelection();return r.$isNodeSelection(z)?(z.clear(),!0):!1},0),_e.registerCommand(r.DELETE_CHARACTER_COMMAND,ue=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.deleteCharacter(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_WORD_COMMAND,ue=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.deleteWord(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_LINE_COMMAND,ue=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.deleteLine(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,ue=>{const z=r.$getSelection();if(typeof ue=="string")r.$INTERNAL_isPointSelection(z)&&z.insertText(ue);else{if(!r.$INTERNAL_isPointSelection(z))return!1;const D=ue.dataTransfer;if(D!=null)t.$insertDataTransferForRichText(D,z,_e);else if(r.$isRangeSelection(z)){const j=ue.data;return j&&z.insertText(j),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_TEXT_COMMAND,ue=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.formatText(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_ELEMENT_COMMAND,ue=>{const z=r.$getSelection();if(!r.$isRangeSelection(z)&&!r.$isNodeSelection(z))return!1;const D=z.getNodes();for(const j of D){const ne=n.$findMatchingParent(j,Y=>r.$isElementNode(Y)&&!Y.isInline());ne!==null&&ne.setFormat(ue)}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_LINE_BREAK_COMMAND,ue=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.insertLineBreak(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INDENT_CONTENT_COMMAND,()=>V(ue=>{const z=ue.getIndent();ue.setIndent(z+1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>V(ue=>{const z=ue.getIndent();z>0&&ue.setIndent(z-1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_UP_COMMAND,ue=>{const z=r.$getSelection();if(r.$isNodeSelection(z)&&!U(ue.target)){const D=z.getNodes();if(D.length>0)return D[0].selectPrevious(),!0}else if(r.$isRangeSelection(z)){const D=r.$getAdjacentNode(z.focus,!0);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectPrevious(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_DOWN_COMMAND,ue=>{const z=r.$getSelection();if(r.$isNodeSelection(z)){const D=z.getNodes();if(D.length>0)return D[0].selectNext(0,0),!0}else if(r.$isRangeSelection(z)){if(q(z))return ue.preventDefault(),!0;const D=r.$getAdjacentNode(z.focus,!1);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectNext(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_LEFT_COMMAND,ue=>{const z=r.$getSelection();if(r.$isNodeSelection(z)){const D=z.getNodes();if(D.length>0)return ue.preventDefault(),D[0].selectPrevious(),!0}if(!r.$isRangeSelection(z))return!1;if(e.$shouldOverrideDefaultCharacterSelection(z,!0)){const D=ue.shiftKey;return ue.preventDefault(),e.$moveCharacter(z,D,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,ue=>{const z=r.$getSelection();if(r.$isNodeSelection(z)&&!U(ue.target)){const j=z.getNodes();if(j.length>0)return ue.preventDefault(),j[0].selectNext(0,0),!0}if(!r.$isRangeSelection(z))return!1;const D=ue.shiftKey;return e.$shouldOverrideDefaultCharacterSelection(z,!1)?(ue.preventDefault(),e.$moveCharacter(z,D,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_BACKSPACE_COMMAND,ue=>{if(U(ue.target))return!1;const z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;ue.preventDefault();const{anchor:D}=z,j=D.getNode();return z.isCollapsed()&&D.offset===0&&!r.$isRootNode(j)&&n.$getNearestBlockElementAncestorOrThrow(j).getIndent()>0?_e.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_DELETE_COMMAND,ue=>{if(U(ue.target))return!1;const z=r.$getSelection();return r.$isRangeSelection(z)?(ue.preventDefault(),_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ENTER_COMMAND,ue=>{const z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;if(ue!==null){if((S||C||O)&&p)return!1;if(ue.preventDefault(),ue.shiftKey)return _e.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return _e.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(_e.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DROP_COMMAND,ue=>{const[,z]=le(ue);if(z.length>0){const j=ue.clientX,ne=ue.clientY,Y=c(j,ne);if(Y!==null){const{offset:G,node:Q}=Y,k=r.$getNearestNodeFromDOMNode(Q);if(k!==null){const m=r.$createRangeSelection();if(r.$isTextNode(k))m.anchor.set(k.getKey(),G,"text"),m.focus.set(k.getKey(),G,"text");else{const A=k.getParentOrThrow().getKey(),Z=k.getIndexWithinParent()+1;m.anchor.set(A,Z,"element"),m.focus.set(A,Z,"element")}const y=r.$normalizeSelection__EXPERIMENTAL(m);r.$setSelection(y)}_e.dispatchCommand(R,z)}return ue.preventDefault(),!0}const D=r.$getSelection();return!!r.$isRangeSelection(D)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGSTART_COMMAND,ue=>{const[z]=le(ue),D=r.$getSelection();return!(z&&!r.$isRangeSelection(D))},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGOVER_COMMAND,ue=>{const[z]=le(ue),D=r.$getSelection();if(z&&!r.$isRangeSelection(D))return!1;const j=ue.clientX,ne=ue.clientY,Y=c(j,ne);if(Y!==null){const G=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(G)&&ue.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.COPY_COMMAND,ue=>(t.copyToClipboard(_e,n.objectKlassEquals(ue,ClipboardEvent)?ue:null),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CUT_COMMAND,ue=>(ee(ue,_e),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.PASTE_COMMAND,ue=>{const[,z,D]=le(ue);if(z.length>0&&!D)return _e.dispatchCommand(R,z),!0;if(r.isSelectionCapturedInDecoratorInput(ue.target))return!1;const j=r.$getSelection();return r.$INTERNAL_isPointSelection(j)?(X(ue,_e),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ci.$createHeadingNode=B,ci.$createQuoteNode=T,ci.$isHeadingNode=K,ci.$isQuoteNode=w,ci.DRAG_DROP_PASTE=R,ci.HeadingNode=P,ci.QuoteNode=b,ci.eventFiles=le,ci.registerRichText=me,ci}var ui={},qf;function YN(){if(qf)return ui;qf=1;var t=_p(),e=Ao(),n=on(),r=Bt();function c(V,U){return typeof document.caretRangeFromPoint<"u"?(V=document.caretRangeFromPoint(V,U),V===null?null:{node:V.startContainer,offset:V.startOffset}):document.caretPositionFromPoint!=="undefined"?(V=document.caretPositionFromPoint(V,U),V===null?null:{node:V.offsetNode,offset:V.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,C=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),S=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,x=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!x,R=r.createCommand("DRAG_DROP_PASTE_FILE");class b extends r.ElementNode{static getType(){return"quote"}static clone(U){return new b(U.__key)}constructor(U){super(U)}createDOM(U){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,U.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:$,priority:0})}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=T();return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(U,q){U=r.$createParagraphNode();let me=this.getDirection();return U.setDirection(me),this.insertAfter(U,q),U}collapseAtStart(){let U=r.$createParagraphNode();return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}}function T(){return r.$applyNodeReplacement(new b)}class w extends r.ElementNode{static getType(){return"heading"}static clone(U){return new w(U.__tag,U.__key)}constructor(U,q){super(q),this.__tag=U}getTag(){return this.__tag}createDOM(U){let q=this.__tag,me=document.createElement(q);return U=U.theme.heading,U!==void 0&&n.addClassNamesToElement(me,U[q]),me}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:H,priority:0}),h2:()=>({conversion:H,priority:0}),h3:()=>({conversion:H,priority:0}),h4:()=>({conversion:H,priority:0}),h5:()=>({conversion:H,priority:0}),h6:()=>({conversion:H,priority:0}),p:U=>(U=U.firstChild,U!==null&&P(U)?{conversion:()=>({node:null}),priority:3}:null),span:U=>P(U)?{conversion:()=>({node:W("h1")}),priority:3}:null}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=W(U.tag);return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(U,q=!0){let me=U?U.anchor.offset:0,_e=me!==this.getTextContentSize()&&U?W(this.getTag()):r.$createParagraphNode(),pe=this.getDirection();return _e.setDirection(pe),this.insertAfter(_e,q),me===0&&!this.isEmpty()&&U&&(U=r.$createParagraphNode(),U.select(),this.replace(U,!0)),_e}collapseAtStart(){let U=this.isEmpty()?r.$createParagraphNode():W(this.getTag());return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}extractWithChild(){return!0}}function P(V){return V.nodeName.toLowerCase()==="span"?V.style.fontSize==="26pt":!1}function H(V){let U=V.nodeName.toLowerCase(),q=null;return(U==="h1"||U==="h2"||U==="h3"||U==="h4"||U==="h5"||U==="h6")&&(q=W(U),V.style!==null&&q.setFormat(V.style.textAlign)),{node:q}}function $(V){let U=T();return V.style!==null&&U.setFormat(V.style.textAlign),{node:U}}function W(V){return r.$applyNodeReplacement(new w(V))}function B(V,U){V.preventDefault(),U.update(()=>{let q=r.$getSelection(),me=V instanceof InputEvent||V instanceof KeyboardEvent?null:V.clipboardData;me!=null&&r.$INTERNAL_isPointSelection(q)&&t.$insertDataTransferForRichText(me,q,U)},{tag:"paste"})}async function K(V,U){await t.copyToClipboard(U,n.objectKlassEquals(V,ClipboardEvent)?V:null),U.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(me=>me.remove())})}function X(V){let U=null;if(V instanceof DragEvent?U=V.dataTransfer:V instanceof ClipboardEvent&&(U=V.clipboardData),U===null)return[!1,[],!1];var q=U.types;return V=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[V,Array.from(U.files),q]}function ee(V){var U=r.$getSelection();if(!r.$isRangeSelection(U))return!1;let q=new Set;U=U.getNodes();for(let pe=0;pe<U.length;pe++){var me=U[pe],_e=me.getKey();q.has(_e)||(me=n.$getNearestBlockElementAncestorOrThrow(me),_e=me.getKey(),me.canIndent()&&!q.has(_e)&&(q.add(_e),V(me)))}return 0<q.size}function le(V){return V=r.$getNearestNodeFromDOMNode(V),r.$isDecoratorNode(V)}return ui.$createHeadingNode=W,ui.$createQuoteNode=T,ui.$isHeadingNode=function(V){return V instanceof w},ui.$isQuoteNode=function(V){return V instanceof b},ui.DRAG_DROP_PASTE=R,ui.HeadingNode=w,ui.QuoteNode=b,ui.eventFiles=X,ui.registerRichText=function(V){return n.mergeRegister(V.registerCommand(r.CLICK_COMMAND,()=>{const U=r.$getSelection();return r.$isNodeSelection(U)?(U.clear(),!0):!1},0),V.registerCommand(r.DELETE_CHARACTER_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_WORD_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_LINE_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,U=>{const q=r.$getSelection();if(typeof U=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(U);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const me=U.dataTransfer;me!=null?t.$insertDataTransferForRichText(me,q,V):r.$isRangeSelection(q)&&(U=U.data)&&q.insertText(U)}return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_TEXT_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_ELEMENT_COMMAND,U=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const me of q)q=n.$findMatchingParent(me,_e=>r.$isElementNode(_e)&&!_e.isInline()),q!==null&&q.setFormat(U);return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_LINE_BREAK_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INDENT_CONTENT_COMMAND,()=>ee(U=>{const q=U.getIndent();U.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>ee(U=>{const q=U.getIndent();0<q&&U.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_UP_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){if(U=q.getNodes(),0<U.length)return U[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),U.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_DOWN_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(U=q.getNodes(),0<U.length)return U[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let me=q.focus;if(me.key==="root"&&me.offset===r.$getRoot().getChildrenSize())return U.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),U.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_LEFT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&e.$shouldOverrideDefaultCharacterSelection(q,!0)?(me=U.shiftKey,U.preventDefault(),e.$moveCharacter(q,me,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(me=U.shiftKey,e.$shouldOverrideDefaultCharacterSelection(q,!1)?(U.preventDefault(),e.$moveCharacter(q,me,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_BACKSPACE_COMMAND,U=>{if(le(U.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;U.preventDefault(),{anchor:U}=q;const me=U.getNode();return q.isCollapsed()&&U.offset===0&&!r.$isRootNode(me)&&0<n.$getNearestBlockElementAncestorOrThrow(me).getIndent()?V.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_DELETE_COMMAND,U=>{if(le(U.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(U.preventDefault(),V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ENTER_COMMAND,U=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(U!==null){if((S||C||O)&&p)return!1;if(U.preventDefault(),U.shiftKey)return V.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return V.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(V.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DROP_COMMAND,U=>{const[,q]=X(U);if(0<q.length){var me=c(U.clientX,U.clientY);if(me!==null){const{offset:pe,node:ue}=me;var _e=r.$getNearestNodeFromDOMNode(ue);if(_e!==null){if(me=r.$createRangeSelection(),r.$isTextNode(_e))me.anchor.set(_e.getKey(),pe,"text"),me.focus.set(_e.getKey(),pe,"text");else{const z=_e.getParentOrThrow().getKey();_e=_e.getIndexWithinParent()+1,me.anchor.set(z,_e,"element"),me.focus.set(z,_e,"element")}me=r.$normalizeSelection__EXPERIMENTAL(me),r.$setSelection(me)}V.dispatchCommand(R,q)}return U.preventDefault(),!0}return U=r.$getSelection(),!!r.$isRangeSelection(U)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGSTART_COMMAND,U=>{[U]=X(U);const q=r.$getSelection();return!(U&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGOVER_COMMAND,U=>{var[q]=X(U);const me=r.$getSelection();return q&&!r.$isRangeSelection(me)?!1:(q=c(U.clientX,U.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&U.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.COPY_COMMAND,U=>(t.copyToClipboard(V,n.objectKlassEquals(U,ClipboardEvent)?U:null),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CUT_COMMAND,U=>(K(U,V),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.PASTE_COMMAND,U=>{const[,q,me]=X(U);if(0<q.length&&!me)return V.dispatchCommand(R,q),!0;if(r.isSelectionCapturedInDecoratorInput(U.target))return!1;const _e=r.$getSelection();return r.$INTERNAL_isPointSelection(_e)?(B(U,V),!0):!1},r.COMMAND_PRIORITY_EDITOR))},ui}var lu,Zf;function dd(){return Zf||(Zf=1,lu=process.env.NODE_ENV==="development"?GN():YN()),lu}var Jf;function jN(){if(Jf)return qc;Jf=1;var t=Un(),e=hp(),n=et,r=gp(),c=on(),d=nd,g=pp(),p=dd(),x=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function O(H){return H.getEditorState().read(r.$canShowPlaceholderCurry(H.isComposing()))}function R(H){const[$,W]=n.useState(()=>O(H));return x(()=>{function B(){const K=O(H);W(K)}return B(),c.mergeRegister(H.registerUpdateListener(()=>{B()}),H.registerEditableListener(()=>{B()}))},[H]),$}function b(H,$){const[W,B]=n.useState(()=>H.getDecorators());return x(()=>H.registerDecoratorListener(K=>{d.flushSync(()=>{B(K)})}),[H]),n.useEffect(()=>{B(H.getDecorators())},[H]),n.useMemo(()=>{const K=[],X=Object.keys(W);for(let ee=0;ee<X.length;ee++){const le=X[ee],V=n.createElement($,{onError:q=>H._onError(q)},n.createElement(n.Suspense,{fallback:null},W[le])),U=H.getElementByKey(le);U!==null&&K.push(d.createPortal(V,U,le))}return K},[$,W,H])}function T(H){x(()=>c.mergeRegister(p.registerRichText(H),g.registerDragonSupport(H)),[H])}function w({contentEditable:H,placeholder:$,ErrorBoundary:W}){const[B]=t.useLexicalComposerContext(),K=b(B,W);return T(B),n.createElement(n.Fragment,null,H,n.createElement(P,{content:$}),K)}function P({content:H}){const[$]=t.useLexicalComposerContext(),W=R($),B=e();return W?typeof H=="function"?H(B):H:null}return qc.RichTextPlugin=w,qc}var au={},Xf;function VN(){if(Xf)return au;Xf=1;var t=Un(),e=hp(),n=et,r=gp(),c=on(),d=nd,g=pp(),p=dd(),C=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function S(T){return T.getEditorState().read(r.$canShowPlaceholderCurry(T.isComposing()))}function x(T){let[w,P]=n.useState(()=>S(T));return C(()=>{function H(){let $=S(T);P($)}return H(),c.mergeRegister(T.registerUpdateListener(()=>{H()}),T.registerEditableListener(()=>{H()}))},[T]),w}function O(T,w){let[P,H]=n.useState(()=>T.getDecorators());return C(()=>T.registerDecoratorListener($=>{d.flushSync(()=>{H($)})}),[T]),n.useEffect(()=>{H(T.getDecorators())},[T]),n.useMemo(()=>{let $=[],W=Object.keys(P);for(let B=0;B<W.length;B++){let K=W[B],X=n.createElement(w,{onError:le=>T._onError(le)},n.createElement(n.Suspense,{fallback:null},P[K])),ee=T.getElementByKey(K);ee!==null&&$.push(d.createPortal(X,ee,K))}return $},[w,P,T])}function R(T){C(()=>c.mergeRegister(p.registerRichText(T),g.registerDragonSupport(T)),[T])}function b({content:T}){var[w]=t.useLexicalComposerContext();w=x(w);let P=e();return w?typeof T=="function"?T(P):T:null}return au.RichTextPlugin=function({contentEditable:T,placeholder:w,ErrorBoundary:P}){let[H]=t.useLexicalComposerContext();return P=O(H,P),R(H),n.createElement(n.Fragment,null,T,n.createElement(b,{content:w}),P)},au}const qN=process.env.NODE_ENV==="development"?jN():VN();var ZN=qN,cu={},Qf;function JN(){if(Qf)return cu;Qf=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var C=1;C<arguments.length;C++){var S=arguments[C];for(var x in S)Object.prototype.hasOwnProperty.call(S,x)&&(p[x]=S[x])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function g({ariaActiveDescendant:p,ariaAutoComplete:C,ariaControls:S,ariaDescribedBy:x,ariaExpanded:O,ariaLabel:R,ariaLabelledBy:b,ariaMultiline:T,ariaOwns:w,ariaRequired:P,autoCapitalize:H,className:$,id:W,role:B="textbox",spellCheck:K=!0,style:X,tabIndex:ee,"data-testid":le,...V}){const[U]=t.useLexicalComposerContext(),[q,me]=e.useState(!1),_e=e.useCallback(pe=>{U.setRootElement(pe)},[U]);return d(()=>(me(U.isEditable()),U.registerEditableListener(pe=>{me(pe)})),[U]),e.createElement("div",n({},V,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?C:"none","aria-controls":q?S:void 0,"aria-describedby":x,"aria-expanded":q&&B==="combobox"?!!O:void 0,"aria-label":R,"aria-labelledby":b,"aria-multiline":T,"aria-owns":q?w:void 0,"aria-readonly":q?void 0:!0,"aria-required":P,autoCapitalize:H,className:$,contentEditable:q,"data-testid":le,id:W,ref:_e,role:B,spellCheck:K,style:X,tabIndex:ee}))}return cu.ContentEditable=g,cu}var uu={},eh;function XN(){if(eh)return uu;eh=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(c){for(var d=1;d<arguments.length;d++){var g=arguments[d],p;for(p in g)Object.prototype.hasOwnProperty.call(g,p)&&(c[p]=g[p])}return c},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;return uu.ContentEditable=function({ariaActiveDescendant:c,ariaAutoComplete:d,ariaControls:g,ariaDescribedBy:p,ariaExpanded:C,ariaLabel:S,ariaLabelledBy:x,ariaMultiline:O,ariaOwns:R,ariaRequired:b,autoCapitalize:T,className:w,id:P,role:H="textbox",spellCheck:$=!0,style:W,tabIndex:B,"data-testid":K,...X}){let[ee]=t.useLexicalComposerContext(),[le,V]=e.useState(!1),U=e.useCallback(q=>{ee.setRootElement(q)},[ee]);return r(()=>(V(ee.isEditable()),ee.registerEditableListener(q=>{V(q)})),[ee]),e.createElement("div",n({},X,{"aria-activedescendant":le?c:void 0,"aria-autocomplete":le?d:"none","aria-controls":le?g:void 0,"aria-describedby":p,"aria-expanded":le&&H==="combobox"?!!C:void 0,"aria-label":S,"aria-labelledby":x,"aria-multiline":O,"aria-owns":le?R:void 0,"aria-readonly":le?void 0:!0,"aria-required":b,autoCapitalize:T,className:w,contentEditable:le,"data-testid":K,id:P,ref:U,role:H,spellCheck:$,style:W,tabIndex:B}))},uu}const QN=process.env.NODE_ENV==="development"?JN():XN();var eC=QN,du,th;function tC(){if(th)return du;th=1;var t=et;function e(p,C){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,O){return x.__proto__=O,x},e(p,C)}function n(p,C){p.prototype=Object.create(C.prototype),p.prototype.constructor=p,e(p,C)}var r=function(C,S){return C===void 0&&(C=[]),S===void 0&&(S=[]),C.length!==S.length||C.some(function(x,O){return!Object.is(x,S[O])})},c={error:null},d=function(p){n(C,p);function C(){for(var x,O=arguments.length,R=new Array(O),b=0;b<O;b++)R[b]=arguments[b];return x=p.call.apply(p,[this].concat(R))||this,x.state=c,x.resetErrorBoundary=function(){for(var T,w=arguments.length,P=new Array(w),H=0;H<w;H++)P[H]=arguments[H];x.props.onReset==null||(T=x.props).onReset.apply(T,P),x.reset()},x}C.getDerivedStateFromError=function(O){return{error:O}};var S=C.prototype;return S.reset=function(){this.setState(c)},S.componentDidCatch=function(O,R){var b,T;(b=(T=this.props).onError)==null||b.call(T,O,R)},S.componentDidUpdate=function(O,R){var b=this.state.error,T=this.props.resetKeys;if(b!==null&&R.error!==null&&r(O.resetKeys,T)){var w,P;(w=(P=this.props).onResetKeysChange)==null||w.call(P,O.resetKeys,T),this.reset()}},S.render=function(){var O=this.state.error,R=this.props,b=R.fallbackRender,T=R.FallbackComponent,w=R.fallback;if(O!==null){var P={error:O,resetErrorBoundary:this.resetErrorBoundary};if(t.isValidElement(w))return w;if(typeof b=="function")return b(P);if(T)return t.createElement(T,P);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},C}(t.Component);function g({children:p,onError:C}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:C},p)}return du=g,du}var fu,nh;function nC(){if(nh)return fu;nh=1;var t=et;function e(g,p){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,S){return C.__proto__=S,C},e(g,p)}function n(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,e(g,p)}function r(g,p){return g===void 0&&(g=[]),p===void 0&&(p=[]),g.length!==p.length||g.some(function(C,S){return!Object.is(C,p[S])})}var c={error:null},d=function(g){function p(){for(var S,x=arguments.length,O=Array(x),R=0;R<x;R++)O[R]=arguments[R];return S=g.call.apply(g,[this].concat(O))||this,S.state=c,S.resetErrorBoundary=function(){for(var b,T=arguments.length,w=Array(T),P=0;P<T;P++)w[P]=arguments[P];S.props.onReset==null||(b=S.props).onReset.apply(b,w),S.reset()},S}n(p,g),p.getDerivedStateFromError=function(S){return{error:S}};var C=p.prototype;return C.reset=function(){this.setState(c)},C.componentDidCatch=function(S,x){var O,R;(O=(R=this.props).onError)==null||O.call(R,S,x)},C.componentDidUpdate=function(S,x){var O=this.props.resetKeys;if(this.state.error!==null&&x.error!==null&&r(S.resetKeys,O)){var R,b;(R=(b=this.props).onResetKeysChange)==null||R.call(b,S.resetKeys,O),this.reset()}},C.render=function(){var S=this.state.error,x=this.props,O=x.fallbackRender,R=x.FallbackComponent;if(x=x.fallback,S!==null){if(S={error:S,resetErrorBoundary:this.resetErrorBoundary},t.isValidElement(x))return x;if(typeof O=="function")return O(S);if(R)return t.createElement(R,S);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(t.Component);return fu=function({children:g,onError:p}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},g)},fu}const rC=process.env.NODE_ENV==="development"?tC():nC();var iC=rC;const oC=rd(iC);var hu={},rr={},rh;function sC(){if(rh)return rr;rh=1;var t=Bt(),e=on();function n(Y){let G=1,Q=Y.getParent();for(;Q!=null;){if(le(Q)){const k=Q.getParent();if(ue(k)){G++,Q=k.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return G}return G}function r(Y){let G=Y.getParent();if(!ue(G))throw Error("A ListItemNode must have a ListNode for a parent.");let Q=G;for(;Q!==null;)Q=Q.getParent(),ue(Q)&&(G=Q);return G}function c(Y){let G=[];const Q=Y.getChildren().filter(le);for(let k=0;k<Q.length;k++){const m=Q[k],y=m.getFirstChild();ue(y)?G=G.concat(c(y)):G.push(m)}return G}function d(Y){return le(Y)&&ue(Y.getFirstChild())}function g(Y){let G=Y;for(;G.getNextSibling()==null&&G.getPreviousSibling()==null;){const Q=G.getParent();if(Q==null||!(le(G)||ue(G)))break;G=Q}G.remove()}function p(Y){return ee().append(Y)}function C(Y,G){return le(Y)&&(G.length===0||G.length===1&&Y.is(G[0])&&Y.getChildrenSize()===0)}function S(Y){const G=Y.getParent();let Q=1;if(G!=null)if(ue(G))Q=G.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const k=Y.getPreviousSiblings();for(let m=0;m<k.length;m++){const y=k[m];le(y)&&!ue(y.getFirstChild())&&Q++}return Q}function x(Y,G){Y.update(()=>{const Q=t.$getSelection();if(t.$INTERNAL_isPointSelection(Q)){const k=Q.getNodes(),y=Q.anchor.getNode(),A=y.getParent();if(C(y,k)){const Z=pe(G);if(t.$isRootOrShadowRoot(A)){y.replace(Z);const ae=ee();t.$isElementNode(y)&&(ae.setFormat(y.getFormatType()),ae.setIndent(y.getIndent())),Z.append(ae)}else if(le(y)){const ae=y.getParentOrThrow();O(Z,ae.getChildren()),ae.replace(Z)}return}else{const Z=new Set;for(let ae=0;ae<k.length;ae++){const he=k[ae];if(t.$isElementNode(he)&&he.isEmpty()&&!le(he)&&!Z.has(he.getKey())){R(he,G);continue}if(t.$isLeafNode(he)){let se=he.getParent();for(;se!=null;){const Te=se.getKey();if(ue(se)){if(!Z.has(Te)){const be=pe(G);O(be,se.getChildren()),se.replace(be),w(be),Z.add(Te)}break}else{const be=se.getParent();if(t.$isRootOrShadowRoot(be)&&!Z.has(Te)){Z.add(Te),R(se,G);break}se=be}}}}}}})}function O(Y,G){Y.splice(Y.getChildrenSize(),0,G)}function R(Y,G){if(ue(Y))return Y;const Q=Y.getPreviousSibling(),k=Y.getNextSibling(),m=ee();if(m.setFormat(Y.getFormatType()),m.setIndent(Y.getIndent()),O(m,Y.getChildren()),ue(Q)&&G===Q.getListType())return Q.append(m),Y.remove(),ue(k)&&G===k.getListType()&&(O(Q,k.getChildren()),k.remove()),Q;if(ue(k)&&G===k.getListType())return k.getFirstChildOrThrow().insertBefore(m),Y.remove(),k;{const y=pe(G);return y.append(m),Y.replace(y),w(y),y}}function b(Y,G){const Q=Y.getLastChild(),k=G.getFirstChild();Q&&k&&d(Q)&&d(k)&&(b(Q.getFirstChild(),k.getFirstChild()),k.remove());const m=G.getChildren();m.length>0&&(Y.append(...m),w(Y)),G.remove()}function T(Y){Y.update(()=>{const G=t.$getSelection();if(t.$isRangeSelection(G)){const Q=new Set,k=G.getNodes(),m=G.anchor.getNode();if(C(m,k))Q.add(r(m));else for(let y=0;y<k.length;y++){const A=k[y];if(t.$isLeafNode(A)){const Z=e.$getNearestNodeOfType(A,W);Z!=null&&Q.add(r(Z))}}for(const y of Q){let A=y;const Z=c(y);for(const ae of Z){const he=t.$createParagraphNode();O(he,ae.getChildren()),A.insertAfter(he),A=he,ae.__key===G.anchor.key&&G.anchor.set(he.getKey(),0,"element"),ae.__key===G.focus.key&&G.focus.set(he.getKey(),0,"element"),ae.remove()}y.remove()}}})}function w(Y,G){const Q=G||Y.getChildren();if(Q!==void 0)for(let k=0;k<Q.length;k++){const m=Q[k];if(le(m)){const y=m.getValue(),A=S(m);y!==A&&m.setValue(A)}}}function P(Y){const G=new Set;if(d(Y)||G.has(Y.getKey()))return;const Q=Y.getParent(),k=Y.getNextSibling(),m=Y.getPreviousSibling();if(d(k)&&d(m)){const y=m.getFirstChild();if(ue(y)){y.append(Y);const A=k.getFirstChild();if(ue(A)){const Z=A.getChildren();O(y,Z),k.remove(),G.add(k.getKey())}w(y)}}else if(d(k)){const y=k.getFirstChild();if(ue(y)){const A=y.getFirstChild();A!==null&&A.insertBefore(Y),w(y)}}else if(d(m)){const y=m.getFirstChild();ue(y)&&(y.append(Y),w(y))}else if(ue(Q)){const y=ee(),A=pe(Q.getListType());y.append(A),A.append(Y),m?m.insertAfter(y):k?k.insertBefore(y):Q.append(y),w(A)}ue(Q)&&w(Q)}function H(Y){if(d(Y))return;const G=Y.getParent(),Q=G?G.getParent():void 0,k=Q?Q.getParent():void 0;if(ue(k)&&le(Q)&&ue(G)){const m=G?G.getFirstChild():void 0,y=G?G.getLastChild():void 0;if(Y.is(m))Q.insertBefore(Y),G.isEmpty()&&Q.remove();else if(Y.is(y))Q.insertAfter(Y),G.isEmpty()&&Q.remove();else{const A=G.getListType(),Z=ee(),ae=pe(A);Z.append(ae),Y.getPreviousSiblings().forEach(Te=>ae.append(Te));const he=ee(),se=pe(A);he.append(se),O(se,Y.getNextSiblings()),Q.insertBefore(Z),Q.insertAfter(he),Q.replace(Y)}w(G),w(k)}}function $(){const Y=t.$getSelection();if(!t.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const G=Y.anchor.getNode();if(!le(G)||G.getChildrenSize()!==0)return!1;const Q=r(G),k=G.getParent();if(!ue(k))throw Error("A ListItemNode must have a ListNode for a parent.");const m=k.getParent();let y;if(t.$isRootOrShadowRoot(m))y=t.$createParagraphNode(),Q.insertAfter(y);else if(le(m))y=ee(),m.insertAfter(y);else return!1;y.select();const A=G.getNextSiblings();if(A.length>0){const Z=pe(k.getListType());if(t.$isParagraphNode(y))y.insertAfter(Z);else{const ae=ee();ae.append(Z),y.insertAfter(ae)}A.forEach(ae=>{ae.remove(),Z.append(ae)})}return g(G),!0}class W extends t.ElementNode{static getType(){return"listitem"}static clone(G){return new W(G.__value,G.__checked,G.__key)}constructor(G,Q,k){super(k),this.__value=G===void 0?1:G,this.__checked=Q}createDOM(G){const Q=document.createElement("li"),k=this.getParent();return ue(k)&&k.getListType()==="check"&&K(Q,this,null),Q.value=this.__value,B(Q,G.theme,this),Q}updateDOM(G,Q,k){const m=this.getParent();return ue(m)&&m.getListType()==="check"&&K(Q,this,G),Q.value=this.__value,B(Q,k.theme,this),!1}static transform(){return G=>{const Q=G.getParent();ue(Q)&&(w(Q),Q.getListType()!=="check"&&G.getChecked()!=null&&G.setChecked(void 0))}}static importDOM(){return{li:G=>({conversion:X,priority:0})}}static importJSON(G){const Q=ee();return Q.setChecked(G.checked),Q.setValue(G.value),Q.setFormat(G.format),Q.setDirection(G.direction),Q}exportDOM(G){const Q=this.createDOM(G._config);return Q.style.textAlign=this.getFormatType(),{element:Q}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(t.$isElementNode(k)&&this.canMergeWith(k)){const m=k.getChildren();this.append(...m),k.remove()}else super.append(k)}return this}replace(G,Q){if(le(G))return super.replace(G);this.setIndent(0);const k=this.getParentOrThrow();if(!ue(k))return G;if(k.__first===this.getKey())k.insertBefore(G);else if(k.__last===this.getKey())k.insertAfter(G);else{const m=pe(k.getListType());let y=this.getNextSibling();for(;y;){const A=y;y=y.getNextSibling(),m.append(A)}k.insertAfter(G),G.insertAfter(m)}return Q&&this.getChildren().forEach(m=>{G.append(m)}),this.remove(),k.getChildrenSize()===0&&k.remove(),G}insertAfter(G,Q=!0){const k=this.getParentOrThrow();if(!ue(k))throw Error("insertAfter: list node is not parent of list item node");const m=this.getNextSiblings();if(le(G)){const y=super.insertAfter(G,Q),A=G.getParentOrThrow();return ue(A)&&w(A),y}if(ue(G)){let y=G;const A=G.getChildren();for(let Z=A.length-1;Z>=0;Z--)y=A[Z],this.insertAfter(y,Q);return y}if(k.insertAfter(G,Q),m.length!==0){const y=pe(k.getListType());m.forEach(A=>y.append(A)),G.insertAfter(y,Q)}return G}remove(G){const Q=this.getPreviousSibling(),k=this.getNextSibling();if(super.remove(G),Q&&k&&d(Q)&&d(k))b(Q.getFirstChild(),k.getFirstChild()),k.remove();else if(k){const m=k.getParent();ue(m)&&w(m)}}insertNewAfter(G,Q=!0){const k=ee(this.__checked==null?void 0:!1);return this.insertAfter(k,Q),k}collapseAtStart(G){const Q=t.$createParagraphNode();this.getChildren().forEach(Z=>Q.append(Z));const m=this.getParentOrThrow(),y=m.getParentOrThrow(),A=le(y);if(m.getChildrenSize()===1)if(A)m.remove(),y.select();else{m.insertBefore(Q),m.remove();const Z=G.anchor,ae=G.focus,he=Q.getKey();Z.type==="element"&&Z.getNode().is(this)&&Z.set(he,Z.offset,"element"),ae.type==="element"&&ae.getNode().is(this)&&ae.set(he,ae.offset,"element")}else m.insertBefore(Q),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(G){const Q=this.getWritable();Q.__value=G}getChecked(){return this.getLatest().__checked}setChecked(G){const Q=this.getWritable();Q.__checked=G}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const G=this.getParent();if(G===null)return this.getLatest().__indent;let Q=G.getParentOrThrow(),k=0;for(;le(Q);)Q=Q.getParentOrThrow().getParentOrThrow(),k++;return k}setIndent(G){if(!(typeof G=="number"&&G>-1))throw Error("Invalid indent value.");let Q=this.getIndent();for(;Q!==G;)Q<G?(P(this),Q++):(H(this),Q--);return this}insertBefore(G){if(le(G)){const Q=this.getParentOrThrow();if(ue(Q)){const k=this.getNextSiblings();w(Q,k)}}return super.insertBefore(G)}canInsertAfter(G){return le(G)}canReplaceWith(G){return le(G)}canMergeWith(G){return t.$isParagraphNode(G)||le(G)}extractWithChild(G,Q){if(!t.$isRangeSelection(Q))return!1;const k=Q.anchor.getNode(),m=Q.focus.getNode();return this.isParentOf(k)&&this.isParentOf(m)&&this.getTextContent().length===Q.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return pe("bullet")}}function B(Y,G,Q){const k=[],m=[],y=G.list,A=y?y.listitem:void 0;let Z;if(y&&y.nested&&(Z=y.nested.listitem),A!==void 0){const ae=A.split(" ");k.push(...ae)}if(y){const ae=Q.getParent(),he=ue(ae)&&ae.getListType()==="check",se=Q.getChecked();(!he||se)&&m.push(y.listitemUnchecked),(!he||!se)&&m.push(y.listitemChecked),he&&k.push(se?y.listitemChecked:y.listitemUnchecked)}if(Z!==void 0){const ae=Z.split(" ");Q.getChildren().some(he=>ue(he))?k.push(...ae):m.push(...ae)}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function K(Y,G,Q,k){ue(G.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!Q||G.__checked!==Q.__checked)&&Y.setAttribute("aria-checked",G.getChecked()?"true":"false"))}function X(Y){const G=e.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:ee(G)}}function ee(Y){return t.$applyNodeReplacement(new W(void 0,Y))}function le(Y){return Y instanceof W}class V extends t.ElementNode{static getType(){return"list"}static clone(G){const Q=G.__listType||_e[G.__tag];return new V(Q,G.__start,G.__key)}constructor(G,Q,k){super(k);const m=_e[G]||G;this.__listType=m,this.__tag=m==="number"?"ol":"ul",this.__start=Q}getTag(){return this.__tag}setListType(G){const Q=this.getWritable();Q.__listType=G,Q.__tag=G==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(G,Q){const k=this.__tag,m=document.createElement(k);return this.__start!==1&&m.setAttribute("start",String(this.__start)),m.__lexicalListType=this.__listType,U(m,G.theme,this),m}updateDOM(G,Q,k){return G.__tag!==this.__tag?!0:(U(Q,k.theme,this),!1)}static importDOM(){return{ol:G=>({conversion:me,priority:0}),ul:G=>({conversion:me,priority:0})}}static importJSON(G){const Q=pe(G.listType,G.start);return Q.setFormat(G.format),Q.setIndent(G.indent),Q.setDirection(G.direction),Q}exportDOM(G){const{element:Q}=super.exportDOM(G);return Q&&e.isHTMLElement(Q)&&(this.__start!==1&&Q.setAttribute("start",String(this.__start)),this.__listType==="check"&&Q.setAttribute("__lexicalListType","check")),{element:Q}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(le(k))super.append(k);else{const m=ee();if(ue(k))m.append(k);else if(t.$isElementNode(k)){const y=t.$createTextNode(k.getTextContent());m.append(y)}else m.append(k);super.append(m)}}return w(this),this}extractWithChild(G){return le(G)}}function U(Y,G,Q){const k=[],m=[],y=G.list;if(y!==void 0){const A=y[`${Q.__tag}Depth`]||[],Z=n(Q)-1,ae=Z%A.length,he=A[ae],se=y[Q.__tag];let Te;const be=y.nested;if(be!==void 0&&be.list&&(Te=be.list),se!==void 0&&k.push(se),he!==void 0){const Ue=he.split(" ");k.push(...Ue);for(let re=0;re<A.length;re++)re!==ae&&m.push(Q.__tag+re)}if(Te!==void 0){const Ue=Te.split(" ");Z>1?k.push(...Ue):m.push(...Ue)}}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function q(Y){const G=[];for(let Q=0;Q<Y.length;Q++){const k=Y[Q];if(le(k)){G.push(k);const m=k.getChildren();m.length>1&&m.forEach(y=>{ue(y)&&G.push(p(y))})}else G.push(p(k))}return G}function me(Y){const G=Y.nodeName.toLowerCase();let Q=null;if(G==="ol"){const k=Y.start;Q=pe("number",k)}else G==="ul"&&(e.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?Q=pe("check"):Q=pe("bullet"));return{after:q,node:Q}}const _e={ol:"number",ul:"bullet"};function pe(Y,G=1){return t.$applyNodeReplacement(new V(Y,G))}function ue(Y){return Y instanceof V}const z=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),D=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),j=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ne=t.createCommand("REMOVE_LIST_COMMAND");return rr.$createListItemNode=ee,rr.$createListNode=pe,rr.$getListDepth=n,rr.$handleListInsertParagraph=$,rr.$isListItemNode=le,rr.$isListNode=ue,rr.INSERT_CHECK_LIST_COMMAND=j,rr.INSERT_ORDERED_LIST_COMMAND=D,rr.INSERT_UNORDERED_LIST_COMMAND=z,rr.ListItemNode=W,rr.ListNode=V,rr.REMOVE_LIST_COMMAND=ne,rr.insertList=x,rr.removeList=T,rr}var ir={},ih;function lC(){if(ih)return ir;ih=1;var t=Bt(),e=on();function n(z){let D=new URLSearchParams;D.append("code",z);for(let j=1;j<arguments.length;j++)D.append("v",arguments[j]);throw Error(`Minified Lexical error #${z}; visit https://lexical.dev/docs/error?${D} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(z){let D=1;for(z=z.getParent();z!=null;){if(B(z)){if(z=z.getParent(),q(z)){D++,z=z.getParent();continue}n(40)}break}return D}function c(z){z=z.getParent(),q(z)||n(40);let D=z;for(;D!==null;)D=D.getParent(),q(D)&&(z=D);return z}function d(z){let D=[];z=z.getChildren().filter(B);for(let j=0;j<z.length;j++){let ne=z[j],Y=ne.getFirstChild();q(Y)?D=D.concat(d(Y)):D.push(ne)}return D}function g(z){return B(z)&&q(z.getFirstChild())}function p(z){for(;z.getNextSibling()==null&&z.getPreviousSibling()==null;){let D=z.getParent();if(D==null||!B(z)&&!q(z))break;z=D}z.remove()}function C(z){return W().append(z)}function S(z,D){return B(z)&&(D.length===0||D.length===1&&z.is(D[0])&&z.getChildrenSize()===0)}function x(z,D){z.splice(z.getChildrenSize(),0,D)}function O(z,D){if(q(z))return z;let j=z.getPreviousSibling(),ne=z.getNextSibling(),Y=W();return Y.setFormat(z.getFormatType()),Y.setIndent(z.getIndent()),x(Y,z.getChildren()),q(j)&&D===j.getListType()?(j.append(Y),z.remove(),q(ne)&&D===ne.getListType()&&(x(j,ne.getChildren()),ne.remove()),j):q(ne)&&D===ne.getListType()?(ne.getFirstChildOrThrow().insertBefore(Y),z.remove(),ne):(D=U(D),D.append(Y),z.replace(D),b(D),D)}function R(z,D){var j=z.getLastChild();let ne=D.getFirstChild();j&&ne&&g(j)&&g(ne)&&(R(j.getFirstChild(),ne.getFirstChild()),ne.remove()),j=D.getChildren(),0<j.length&&(z.append(...j),b(z)),D.remove()}function b(z,D){if(z=D||z.getChildren(),z!==void 0)for(D=0;D<z.length;D++){let G=z[D];if(B(G)){let Q=G.getValue();var j=G,ne=j.getParent(),Y=1;for(ne!=null&&(q(ne)?Y=ne.getStart():n(44)),j=j.getPreviousSiblings(),ne=0;ne<j.length;ne++){let k=j[ne];B(k)&&!q(k.getFirstChild())&&Y++}Q!==Y&&G.setValue(Y)}}}function T(z){if(!g(z)){var D=z.getParent(),j=D?D.getParent():void 0,ne=j?j.getParent():void 0;if(q(ne)&&B(j)&&q(D)){var Y=D?D.getFirstChild():void 0,G=D?D.getLastChild():void 0;if(z.is(Y))j.insertBefore(z),D.isEmpty()&&j.remove();else if(z.is(G))j.insertAfter(z),D.isEmpty()&&j.remove();else{var Q=D.getListType();Y=W();let k=U(Q);Y.append(k),z.getPreviousSiblings().forEach(m=>k.append(m)),G=W(),Q=U(Q),G.append(Q),x(Q,z.getNextSiblings()),j.insertBefore(Y),j.insertAfter(G),j.replace(z)}b(D),b(ne)}}}class w extends t.ElementNode{static getType(){return"listitem"}static clone(D){return new w(D.__value,D.__checked,D.__key)}constructor(D,j,ne){super(ne),this.__value=D===void 0?1:D,this.__checked=j}createDOM(D){let j=document.createElement("li"),ne=this.getParent();return q(ne)&&ne.getListType()==="check"&&H(j,this,null),j.value=this.__value,P(j,D.theme,this),j}updateDOM(D,j,ne){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&H(j,this,D),j.value=this.__value,P(j,ne.theme,this),!1}static transform(){return D=>{let j=D.getParent();q(j)&&(b(j),j.getListType()!=="check"&&D.getChecked()!=null&&D.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:$,priority:0})}}static importJSON(D){let j=W();return j.setChecked(D.checked),j.setValue(D.value),j.setFormat(D.format),j.setDirection(D.direction),j}exportDOM(D){return D=this.createDOM(D._config),D.style.textAlign=this.getFormatType(),{element:D}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...D){for(let j=0;j<D.length;j++){let ne=D[j];if(t.$isElementNode(ne)&&this.canMergeWith(ne)){let Y=ne.getChildren();this.append(...Y),ne.remove()}else super.append(ne)}return this}replace(D,j){if(B(D))return super.replace(D);this.setIndent(0);let ne=this.getParentOrThrow();if(!q(ne))return D;if(ne.__first===this.getKey())ne.insertBefore(D);else if(ne.__last===this.getKey())ne.insertAfter(D);else{let Y=U(ne.getListType()),G=this.getNextSibling();for(;G;){let Q=G;G=G.getNextSibling(),Y.append(Q)}ne.insertAfter(D),D.insertAfter(Y)}return j&&this.getChildren().forEach(Y=>{D.append(Y)}),this.remove(),ne.getChildrenSize()===0&&ne.remove(),D}insertAfter(D,j=!0){var ne=this.getParentOrThrow();q(ne)||n(39);var Y=this.getNextSiblings();if(B(D))return j=super.insertAfter(D,j),D=D.getParentOrThrow(),q(D)&&b(D),j;if(q(D)){for(ne=D,D=D.getChildren(),Y=D.length-1;0<=Y;Y--)ne=D[Y],this.insertAfter(ne,j);return ne}if(ne.insertAfter(D,j),Y.length!==0){let G=U(ne.getListType());Y.forEach(Q=>G.append(Q)),D.insertAfter(G,j)}return D}remove(D){let j=this.getPreviousSibling(),ne=this.getNextSibling();super.remove(D),j&&ne&&g(j)&&g(ne)?(R(j.getFirstChild(),ne.getFirstChild()),ne.remove()):ne&&(D=ne.getParent(),q(D)&&b(D))}insertNewAfter(D,j=!0){return D=W(this.__checked==null?void 0:!1),this.insertAfter(D,j),D}collapseAtStart(D){let j=t.$createParagraphNode();this.getChildren().forEach(Q=>j.append(Q));var ne=this.getParentOrThrow(),Y=ne.getParentOrThrow();let G=B(Y);return ne.getChildrenSize()===1?G?(ne.remove(),Y.select()):(ne.insertBefore(j),ne.remove(),ne=D.anchor,D=D.focus,Y=j.getKey(),ne.type==="element"&&ne.getNode().is(this)&&ne.set(Y,ne.offset,"element"),D.type==="element"&&D.getNode().is(this)&&D.set(Y,D.offset,"element")):(ne.insertBefore(j),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(D){this.getWritable().__value=D}getChecked(){return this.getLatest().__checked}setChecked(D){this.getWritable().__checked=D}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var D=this.getParent();if(D===null)return this.getLatest().__indent;D=D.getParentOrThrow();let j=0;for(;B(D);)D=D.getParentOrThrow().getParentOrThrow(),j++;return j}setIndent(D){typeof D=="number"&&-1<D||n(117);let j=this.getIndent();for(;j!==D;)if(j<D){e:{var ne=new Set;if(g(this)||ne.has(this.getKey()))break e;let k=this.getParent();var Y=this.getNextSibling(),G=this.getPreviousSibling();if(g(Y)&&g(G)){if(G=G.getFirstChild(),q(G)){G.append(this);var Q=Y.getFirstChild();q(Q)&&(Q=Q.getChildren(),x(G,Q),Y.remove(),ne.add(Y.getKey())),b(G)}}else g(Y)?(Y=Y.getFirstChild(),q(Y)&&(ne=Y.getFirstChild(),ne!==null&&ne.insertBefore(this),b(Y))):g(G)?(Y=G.getFirstChild(),q(Y)&&(Y.append(this),b(Y))):q(k)&&(ne=W(),Q=U(k.getListType()),ne.append(Q),Q.append(this),G?G.insertAfter(ne):Y?Y.insertBefore(ne):k.append(ne),b(Q));q(k)&&b(k)}j++}else T(this),j--;return this}insertBefore(D){if(B(D)){let j=this.getParentOrThrow();if(q(j)){let ne=this.getNextSiblings();b(j,ne)}}return super.insertBefore(D)}canInsertAfter(D){return B(D)}canReplaceWith(D){return B(D)}canMergeWith(D){return t.$isParagraphNode(D)||B(D)}extractWithChild(D,j){if(!t.$isRangeSelection(j))return!1;D=j.anchor.getNode();let ne=j.focus.getNode();return this.isParentOf(D)&&this.isParentOf(ne)&&this.getTextContent().length===j.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return U("bullet")}}function P(z,D,j){let ne=[],Y=[];var G=(D=D.list)?D.listitem:void 0;if(D&&D.nested)var Q=D.nested.listitem;if(G!==void 0&&(G=G.split(" "),ne.push(...G)),D){G=j.getParent(),G=q(G)&&G.getListType()==="check";let k=j.getChecked();G&&!k||Y.push(D.listitemUnchecked),G&&k||Y.push(D.listitemChecked),G&&ne.push(k?D.listitemChecked:D.listitemUnchecked)}Q!==void 0&&(Q=Q.split(" "),j.getChildren().some(k=>q(k))?ne.push(...Q):Y.push(...Q)),0<Y.length&&e.removeClassNamesFromElement(z,...Y),0<ne.length&&e.addClassNamesToElement(z,...ne)}function H(z,D,j){q(D.getFirstChild())?(z.removeAttribute("role"),z.removeAttribute("tabIndex"),z.removeAttribute("aria-checked")):(z.setAttribute("role","checkbox"),z.setAttribute("tabIndex","-1"),j&&D.__checked===j.__checked||z.setAttribute("aria-checked",D.getChecked()?"true":"false"))}function $(z){return z=e.isHTMLElement(z)&&z.getAttribute("aria-checked")==="true",{node:W(z)}}function W(z){return t.$applyNodeReplacement(new w(void 0,z))}function B(z){return z instanceof w}class K extends t.ElementNode{static getType(){return"list"}static clone(D){return new K(D.__listType||V[D.__tag],D.__start,D.__key)}constructor(D,j,ne){super(ne),this.__listType=D=V[D]||D,this.__tag=D==="number"?"ol":"ul",this.__start=j}getTag(){return this.__tag}setListType(D){let j=this.getWritable();j.__listType=D,j.__tag=D==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(D){let j=document.createElement(this.__tag);return this.__start!==1&&j.setAttribute("start",String(this.__start)),j.__lexicalListType=this.__listType,X(j,D.theme,this),j}updateDOM(D,j,ne){return D.__tag!==this.__tag?!0:(X(j,ne.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:le,priority:0}),ul:()=>({conversion:le,priority:0})}}static importJSON(D){let j=U(D.listType,D.start);return j.setFormat(D.format),j.setIndent(D.indent),j.setDirection(D.direction),j}exportDOM(D){return{element:D}=super.exportDOM(D),D&&e.isHTMLElement(D)&&(this.__start!==1&&D.setAttribute("start",String(this.__start)),this.__listType==="check"&&D.setAttribute("__lexicalListType","check")),{element:D}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...D){for(let ne=0;ne<D.length;ne++){var j=D[ne];if(B(j))super.append(j);else{let Y=W();q(j)||t.$isElementNode(j)&&(j=t.$createTextNode(j.getTextContent())),Y.append(j),super.append(Y)}}return b(this),this}extractWithChild(D){return B(D)}}function X(z,D,j){let ne=[],Y=[];var G=D.list;if(G!==void 0){let k=G[`${j.__tag}Depth`]||[];D=r(j)-1;let m=D%k.length;var Q=k[m];let y=G[j.__tag],A;if(G=G.nested,G!==void 0&&G.list&&(A=G.list),y!==void 0&&ne.push(y),Q!==void 0)for(Q=Q.split(" "),ne.push(...Q),Q=0;Q<k.length;Q++)Q!==m&&Y.push(j.__tag+Q);A!==void 0&&(j=A.split(" "),1<D?ne.push(...j):Y.push(...j))}0<Y.length&&e.removeClassNamesFromElement(z,...Y),0<ne.length&&e.addClassNamesToElement(z,...ne)}function ee(z){let D=[];for(let ne=0;ne<z.length;ne++){var j=z[ne];B(j)?(D.push(j),j=j.getChildren(),1<j.length&&j.forEach(Y=>{q(Y)&&D.push(C(Y))})):D.push(C(j))}return D}function le(z){let D=z.nodeName.toLowerCase(),j=null;return D==="ol"?j=U("number",z.start):D==="ul"&&(j=e.isHTMLElement(z)&&z.getAttribute("__lexicallisttype")==="check"?U("check"):U("bullet")),{after:ee,node:j}}let V={ol:"number",ul:"bullet"};function U(z,D=1){return t.$applyNodeReplacement(new K(z,D))}function q(z){return z instanceof K}let me=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),_e=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),pe=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ue=t.createCommand("REMOVE_LIST_COMMAND");return ir.$createListItemNode=W,ir.$createListNode=U,ir.$getListDepth=r,ir.$handleListInsertParagraph=function(){var z=t.$getSelection();if(!t.$isRangeSelection(z)||!z.isCollapsed()||(z=z.anchor.getNode(),!B(z)||z.getChildrenSize()!==0))return!1;var D=c(z),j=z.getParent();q(j)||n(40);let ne=j.getParent(),Y;if(t.$isRootOrShadowRoot(ne))Y=t.$createParagraphNode(),D.insertAfter(Y);else if(B(ne))Y=W(),ne.insertAfter(Y);else return!1;if(Y.select(),D=z.getNextSiblings(),0<D.length){let G=U(j.getListType());t.$isParagraphNode(Y)?Y.insertAfter(G):(j=W(),j.append(G),Y.insertAfter(j)),D.forEach(Q=>{Q.remove(),G.append(Q)})}return p(z),!0},ir.$isListItemNode=B,ir.$isListNode=q,ir.INSERT_CHECK_LIST_COMMAND=pe,ir.INSERT_ORDERED_LIST_COMMAND=_e,ir.INSERT_UNORDERED_LIST_COMMAND=me,ir.ListItemNode=w,ir.ListNode=K,ir.REMOVE_LIST_COMMAND=ue,ir.insertList=function(z,D){z.update(()=>{var j=t.$getSelection();if(t.$INTERNAL_isPointSelection(j)){var ne=j.getNodes();j=j.anchor.getNode();var Y=j.getParent();if(S(j,ne))ne=U(D),t.$isRootOrShadowRoot(Y)?(j.replace(ne),Y=W(),t.$isElementNode(j)&&(Y.setFormat(j.getFormatType()),Y.setIndent(j.getIndent())),ne.append(Y)):B(j)&&(j=j.getParentOrThrow(),x(ne,j.getChildren()),j.replace(ne));else for(j=new Set,Y=0;Y<ne.length;Y++){var G=ne[Y];if(t.$isElementNode(G)&&G.isEmpty()&&!B(G)&&!j.has(G.getKey()))O(G,D);else if(t.$isLeafNode(G))for(G=G.getParent();G!=null;){let k=G.getKey();if(q(G)){if(!j.has(k)){var Q=U(D);x(Q,G.getChildren()),G.replace(Q),b(Q),j.add(k)}break}else{if(Q=G.getParent(),t.$isRootOrShadowRoot(Q)&&!j.has(k)){j.add(k),O(G,D);break}G=Q}}}}})},ir.removeList=function(z){z.update(()=>{let D=t.$getSelection();if(t.$isRangeSelection(D)){var j=new Set,ne=D.getNodes(),Y=D.anchor.getNode();if(S(Y,ne))j.add(c(Y));else for(Y=0;Y<ne.length;Y++){var G=ne[Y];t.$isLeafNode(G)&&(G=e.$getNearestNodeOfType(G,w),G!=null&&j.add(c(G)))}for(let Q of j){j=Q,ne=d(Q);for(let k of ne)ne=t.$createParagraphNode(),x(ne,k.getChildren()),j.insertAfter(ne),j=ne,k.__key===D.anchor.key&&D.anchor.set(ne.getKey(),0,"element"),k.__key===D.focus.key&&D.focus.set(ne.getKey(),0,"element"),k.remove();Q.remove()}}})},ir}var gu,oh;function fd(){return oh||(oh=1,gu=process.env.NODE_ENV==="development"?sC():lC()),gu}var sh;function aC(){if(sh)return hu;sh=1;var t=fd(),e=Un(),n=et,r=on(),c=Bt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(p,"number"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(p,"bullet"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(p),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[p])}function g(){const[p]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([t.ListNode,t.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return hu.ListPlugin=g,hu}var pu={},lh;function cC(){if(lh)return pu;lh=1;var t=fd(),e=Un(),n=et,r=on(),c=Bt();function d(g){n.useEffect(()=>r.mergeRegister(g.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(g,"number"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(g,"bullet"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(g),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[g])}return pu.ListPlugin=function(){let[g]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!g.hasNodes([t.ListNode,t.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[g]),d(g),null},pu}const uC=process.env.NODE_ENV==="development"?aC():cC();var dC=uC,mu={},Ii={},ah;function fC(){if(ah)return Ii;ah=1;var t=on(),e=Bt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(T){return new r(T.__url,{rel:T.__rel,target:T.__target,title:T.__title},T.__key)}constructor(T,w={},P){super(P);const{target:H=null,rel:$=null,title:W=null}=w;this.__url=T,this.__target=H,this.__rel=$,this.__title=W}createDOM(T){const w=document.createElement("a");return w.href=this.sanitizeUrl(this.__url),this.__target!==null&&(w.target=this.__target),this.__rel!==null&&(w.rel=this.__rel),this.__title!==null&&(w.title=this.__title),t.addClassNamesToElement(w,T.theme.link),w}updateDOM(T,w,P){const H=this.__url,$=this.__target,W=this.__rel,B=this.__title;return H!==T.__url&&(w.href=H),$!==T.__target&&($?w.target=$:w.removeAttribute("target")),W!==T.__rel&&(W?w.rel=W:w.removeAttribute("rel")),B!==T.__title&&(B?w.title=B:w.removeAttribute("title")),!1}static importDOM(){return{a:T=>({conversion:c,priority:1})}}static importJSON(T){const w=d(T.url,{rel:T.rel,target:T.target,title:T.title});return w.setFormat(T.format),w.setIndent(T.indent),w.setDirection(T.direction),w}sanitizeUrl(T){try{const w=new URL(T);if(!n.has(w.protocol))return"about:blank"}catch{return T}return T}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(T){const w=this.getWritable();w.__url=T}getTarget(){return this.getLatest().__target}setTarget(T){const w=this.getWritable();w.__target=T}getRel(){return this.getLatest().__rel}setRel(T){const w=this.getWritable();w.__rel=T}getTitle(){return this.getLatest().__title}setTitle(T){const w=this.getWritable();w.__title=T}insertNewAfter(T,w=!0){const P=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(P,w),P}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(T,w,P){if(!e.$isRangeSelection(w))return!1;const H=w.anchor.getNode(),$=w.focus.getNode();return this.isParentOf(H)&&this.isParentOf($)&&w.getTextContent().length>0}}function c(b){let T=null;if(t.isHTMLAnchorElement(b)){const w=b.textContent;(w!==null&&w!==""||b.children.length>0)&&(T=d(b.getAttribute("href")||"",{rel:b.getAttribute("rel"),target:b.getAttribute("target"),title:b.getAttribute("title")}))}return{node:T}}function d(b,T){return e.$applyNodeReplacement(new r(b,T))}function g(b){return b instanceof r}class p extends r{static getType(){return"autolink"}static clone(T){return new p(T.__url,{rel:T.__rel,target:T.__target,title:T.__title},T.__key)}static importJSON(T){const w=C(T.url,{rel:T.rel,target:T.target,title:T.title});return w.setFormat(T.format),w.setIndent(T.indent),w.setDirection(T.direction),w}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(T,w=!0){const P=this.getParentOrThrow().insertNewAfter(T,w);if(e.$isElementNode(P)){const H=C(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return P.append(H),H}return null}}function C(b,T){return e.$applyNodeReplacement(new p(b,T))}function S(b){return b instanceof p}const x=e.createCommand("TOGGLE_LINK_COMMAND");function O(b,T={}){const{target:w,title:P}=T,H=T.rel===void 0?"noreferrer":T.rel,$=e.$getSelection();if(!e.$isRangeSelection($))return;const W=$.extract();if(b===null)W.forEach(B=>{const K=B.getParent();if(g(K)){const X=K.getChildren();for(let ee=0;ee<X.length;ee++)K.insertBefore(X[ee]);K.remove()}});else{if(W.length===1){const X=W[0],ee=R(X,g);if(ee!==null){ee.setURL(b),w!==void 0&&ee.setTarget(w),H!==null&&ee.setRel(H),P!==void 0&&ee.setTitle(P);return}}let B=null,K=null;W.forEach(X=>{const ee=X.getParent();if(!(ee===K||ee===null||e.$isElementNode(X)&&!X.isInline())){if(g(ee)){K=ee,ee.setURL(b),w!==void 0&&ee.setTarget(w),H!==null&&K.setRel(H),P!==void 0&&K.setTitle(P);return}if(ee.is(B)||(B=ee,K=d(b,{rel:H,target:w,title:P}),g(ee)?X.getPreviousSibling()===null?ee.insertBefore(K):ee.insertAfter(K):X.insertBefore(K)),g(X)){if(X.is(K))return;if(K!==null){const le=X.getChildren();for(let V=0;V<le.length;V++)K.append(le[V])}X.remove();return}K!==null&&K.append(X)}})}}function R(b,T){let w=b;for(;w!==null&&w.getParent()!==null&&!T(w);)w=w.getParentOrThrow();return T(w)?w:null}return Ii.$createAutoLinkNode=C,Ii.$createLinkNode=d,Ii.$isAutoLinkNode=S,Ii.$isLinkNode=g,Ii.AutoLinkNode=p,Ii.LinkNode=r,Ii.TOGGLE_LINK_COMMAND=x,Ii.toggleLink=O,Ii}var Pi={},ch;function hC(){if(ch)return Pi;ch=1;var t=on(),e=Bt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(R){return new r(R.__url,{rel:R.__rel,target:R.__target,title:R.__title},R.__key)}constructor(R,b={},T){super(T);let{target:w=null,rel:P=null,title:H=null}=b;this.__url=R,this.__target=w,this.__rel=P,this.__title=H}createDOM(R){let b=document.createElement("a");return b.href=this.sanitizeUrl(this.__url),this.__target!==null&&(b.target=this.__target),this.__rel!==null&&(b.rel=this.__rel),this.__title!==null&&(b.title=this.__title),t.addClassNamesToElement(b,R.theme.link),b}updateDOM(R,b){let T=this.__url,w=this.__target,P=this.__rel,H=this.__title;return T!==R.__url&&(b.href=T),w!==R.__target&&(w?b.target=w:b.removeAttribute("target")),P!==R.__rel&&(P?b.rel=P:b.removeAttribute("rel")),H!==R.__title&&(H?b.title=H:b.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:c,priority:1})}}static importJSON(R){let b=d(R.url,{rel:R.rel,target:R.target,title:R.title});return b.setFormat(R.format),b.setIndent(R.indent),b.setDirection(R.direction),b}sanitizeUrl(R){try{let b=new URL(R);if(!n.has(b.protocol))return"about:blank"}catch{}return R}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(R){this.getWritable().__url=R}getTarget(){return this.getLatest().__target}setTarget(R){this.getWritable().__target=R}getRel(){return this.getLatest().__rel}setRel(R){this.getWritable().__rel=R}getTitle(){return this.getLatest().__title}setTitle(R){this.getWritable().__title=R}insertNewAfter(R,b=!0){return R=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(R,b),R}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(R,b){if(!e.$isRangeSelection(b))return!1;R=b.anchor.getNode();let T=b.focus.getNode();return this.isParentOf(R)&&this.isParentOf(T)&&0<b.getTextContent().length}}function c(O){let R=null;if(t.isHTMLAnchorElement(O)){let b=O.textContent;(b!==null&&b!==""||0<O.children.length)&&(R=d(O.getAttribute("href")||"",{rel:O.getAttribute("rel"),target:O.getAttribute("target"),title:O.getAttribute("title")}))}return{node:R}}function d(O,R){return e.$applyNodeReplacement(new r(O,R))}function g(O){return O instanceof r}class p extends r{static getType(){return"autolink"}static clone(R){return new p(R.__url,{rel:R.__rel,target:R.__target,title:R.__title},R.__key)}static importJSON(R){let b=C(R.url,{rel:R.rel,target:R.target,title:R.title});return b.setFormat(R.format),b.setIndent(R.indent),b.setDirection(R.direction),b}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(R,b=!0){return R=this.getParentOrThrow().insertNewAfter(R,b),e.$isElementNode(R)?(b=C(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),R.append(b),b):null}}function C(O,R){return e.$applyNodeReplacement(new p(O,R))}let S=e.createCommand("TOGGLE_LINK_COMMAND");function x(O,R){for(;O!==null&&O.getParent()!==null&&!R(O);)O=O.getParentOrThrow();return R(O)?O:null}return Pi.$createAutoLinkNode=C,Pi.$createLinkNode=d,Pi.$isAutoLinkNode=function(O){return O instanceof p},Pi.$isLinkNode=g,Pi.AutoLinkNode=p,Pi.LinkNode=r,Pi.TOGGLE_LINK_COMMAND=S,Pi.toggleLink=function(O,R={}){let{target:b,title:T}=R,w=R.rel===void 0?"noreferrer":R.rel;if(R=e.$getSelection(),e.$isRangeSelection(R))if(R=R.extract(),O===null)R.forEach(P=>{if(P=P.getParent(),g(P)){let H=P.getChildren();for(let $=0;$<H.length;$++)P.insertBefore(H[$]);P.remove()}});else{if(R.length===1){let $=x(R[0],g);if($!==null){$.setURL(O),b!==void 0&&$.setTarget(b),w!==null&&$.setRel(w),T!==void 0&&$.setTitle(T);return}}let P=null,H=null;R.forEach($=>{var W=$.getParent();if(W!==H&&W!==null&&(!e.$isElementNode($)||$.isInline()))if(g(W))H=W,W.setURL(O),b!==void 0&&W.setTarget(b),w!==null&&H.setRel(w),T!==void 0&&H.setTitle(T);else if(W.is(P)||(P=W,H=d(O,{rel:w,target:b,title:T}),g(W)?$.getPreviousSibling()===null?W.insertBefore(H):W.insertAfter(H):$.insertBefore(H)),g($)){if(!$.is(H)){if(H!==null){W=$.getChildren();for(let B=0;B<W.length;B++)H.append(W[B])}$.remove()}}else H!==null&&H.append($)})}},Pi}var _u,uh;function hd(){return uh||(uh=1,_u=process.env.NODE_ENV==="development"?fC():hC()),_u}var dh;function gC(){if(dh)return mu;dh=1;var t=hd(),e=Un(),n=on(),r=Bt(),c=et;function d({validateUrl:g}){const[p]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!p.hasNodes([t.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(t.TOGGLE_LINK_COMMAND,C=>{if(C===null)return t.toggleLink(C),!0;if(typeof C=="string")return g===void 0||g(C)?(t.toggleLink(C),!0):!1;{const{url:S,target:x,rel:O,title:R}=C;return t.toggleLink(S,{rel:O,target:x,title:R}),!0}},r.COMMAND_PRIORITY_LOW),g!==void 0?p.registerCommand(r.PASTE_COMMAND,C=>{const S=r.$getSelection();if(!r.$isRangeSelection(S)||S.isCollapsed()||!(C instanceof ClipboardEvent)||C.clipboardData==null)return!1;const x=C.clipboardData.getData("text");return g(x)?S.getNodes().some(O=>r.$isElementNode(O))?!1:(p.dispatchCommand(t.TOGGLE_LINK_COMMAND,x),C.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,g]),null}return mu.LinkPlugin=d,mu}var yu={},fh;function pC(){if(fh)return yu;fh=1;var t=hd(),e=Un(),n=on(),r=Bt(),c=et;return yu.LinkPlugin=function({validateUrl:d}){let[g]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!g.hasNodes([t.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(g.registerCommand(t.TOGGLE_LINK_COMMAND,p=>{if(p===null)return t.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(t.toggleLink(p),!0):!1;let{url:C,target:S,rel:x,title:O}=p;return t.toggleLink(C,{rel:x,target:S,title:O}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?g.registerCommand(r.PASTE_COMMAND,p=>{let C=r.$getSelection();if(!r.$isRangeSelection(C)||C.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let S=p.clipboardData.getData("text");return d(S)?C.getNodes().some(x=>r.$isElementNode(x))?!1:(g.dispatchCommand(t.TOGGLE_LINK_COMMAND,S),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[g,d]),null},yu}const mC=process.env.NODE_ENV==="development"?gC():pC();var _C=mC,Nu={},Gt={},hh;function yC(){if(hh)return Gt;hh=1;var t=Bt(),e=on();const n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const fe=new c(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return fe.__rowSpan=ie.__rowSpan,fe.__backgroundColor=ie.__backgroundColor,fe}static importDOM(){return{td:ie=>({conversion:d,priority:0}),th:ie=>({conversion:d,priority:0})}}static importJSON(ie){const fe=ie.colSpan||1,Oe=ie.rowSpan||1,Re=g(ie.headerState,fe,ie.width||void 0);return Re.__rowSpan=Oe,Re.__backgroundColor=ie.backgroundColor||null,Re}constructor(ie=r.NO_STATUS,fe=1,Oe,Re){super(fe,Re),this.__headerState=ie,this.__width=Oe,this.__backgroundColor=null}createDOM(ie){const fe=document.createElement(this.getTag());return this.__width&&(fe.style.width=`${this.__width}px`),this.__colSpan>1&&(fe.colSpan=this.__colSpan),this.__rowSpan>1&&(fe.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(fe.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(fe,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),fe}exportDOM(ie){const{element:fe}=super.exportDOM(ie);if(fe){const Oe=fe,Re=700,De=this.getParentOrThrow().getChildrenSize();Oe.style.border="1px solid black",this.__colSpan>1&&(Oe.colSpan=this.__colSpan),this.__rowSpan>1&&(Oe.rowSpan=this.__rowSpan),Oe.style.width=`${this.getWidth()||Math.max(90,Re/De)}px`,Oe.style.verticalAlign="top",Oe.style.textAlign="start";const We=this.getBackgroundColor();We!==null?Oe.style.backgroundColor=We:this.hasHeader()&&(Oe.style.backgroundColor="#f2f3f5")}return{element:fe}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const fe=this.getWritable();return fe.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const fe=this.getWritable();return fe.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const fe=this.getWritable();return(fe.__headerState&ie)===ie?fe.__headerState-=ie:fe.__headerState+=ie,fe}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(Se){const ie=Se,fe=Se.nodeName.toLowerCase();let Oe;n.test(ie.style.width)&&(Oe=parseFloat(ie.style.width));const Re=g(fe==="th"?r.ROW:r.NO_STATUS,ie.colSpan,Oe);Re.__rowSpan=ie.rowSpan;const De=ie.style.backgroundColor;return De!==""&&(Re.__backgroundColor=De),{forChild:(We,qe)=>{if(p(qe)&&!t.$isElementNode(We)){const Qe=t.$createParagraphNode();return t.$isLineBreakNode(We)&&We.getTextContent()===`
74
- `?null:(Qe.append(We),Qe)}return We},node:Re}}function g(Se,ie=1,fe){return t.$applyNodeReplacement(new c(Se,ie,fe))}function p(Se){return Se instanceof c}class C extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new C(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:S,priority:0})}}static importJSON(ie){return x(ie.height)}constructor(ie,fe){super(fe),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const fe=document.createElement("tr");return this.__height&&(fe.style.height=`${this.__height}px`),e.addClassNamesToElement(fe,ie.theme.tableRow),fe}isShadowRoot(){return!0}setHeight(ie){const fe=this.getWritable();return fe.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function S(Se){const ie=Se;let fe;return n.test(ie.style.height)&&(fe=parseFloat(ie.style.height)),{node:x(fe)}}function x(Se){return t.$applyNodeReplacement(new C(Se))}function O(Se){return Se instanceof C}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",b=Se=>R?(Se||window).getSelection():null;class T{constructor(ie,fe){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=fe,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(fe=>{this.editor.update(()=>{let Oe=!1;for(let De=0;De<fe.length;De++){const Qe=fe[De].target.nodeName;if(Qe==="TABLE"||Qe==="TR"){Oe=!0;break}}if(!Oe)return;const Re=this.editor.getElementByKey(this.tableNodeKey);if(!Re)throw new Error("Expected to find TableElement in DOM");this.grid=B(Re)})});this.editor.update(()=>{const fe=this.editor.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");this.grid=B(fe),ie.observe(fe,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=ie.getElementByKey(this.tableNodeKey);if(!Oe)throw new Error("Expected to find TableElement in DOM");const Re=B(Oe);K(ie,Re,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(fe,ie._config.theme.tableSelection),fe.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.addClassNamesToElement(fe,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const fe=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),K(fe,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,fe=!1){const Oe=this.editor;Oe.update(()=>{const Re=t.$getNodeByKey(this.tableNodeKey);if(!m(Re))throw new Error("Expected TableNode.");if(!Oe.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const We=ie.x,qe=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const Qe=b(Oe._window);Qe&&Qe.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==We||this.anchorY!==qe||fe))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(We===this.focusX&&qe===this.focusY)return;if(this.focusX=We,this.focusY=qe,this.isHighlightingCells){const Qe=t.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(Qe)){const ft=Qe.getKey();this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ft,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Oe.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),K(Oe,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const fe=t.$getNearestNodeFromDOMNode(ie.elem);if(p(fe)){const Oe=fe.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=Oe}})}formatCells(ie){this.editor.update(()=>{const fe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(fe))throw Error("Expected grid selection");const Oe=t.$createRangeSelection(),Re=Oe.anchor,De=Oe.focus;fe.getNodes().forEach(We=>{p(We)&&We.getTextContentSize()!==0&&(Re.set(We.getKey(),0,"element"),De.set(We.getKey(),We.getChildrenSize(),"element"),Oe.formatText(ie))}),t.$setSelection(fe),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(Oe))throw Error("Expected grid selection");const Re=Oe.getNodes().filter(p);if(Re.length===this.grid.columns*this.grid.rows){fe.selectPrevious(),fe.remove(),t.$getRoot().selectStart();return}Re.forEach(De=>{if(t.$isElementNode(De)){const We=t.$createParagraphNode(),qe=t.$createTextNode();We.append(qe),De.append(We),De.getChildren().forEach(Qe=>{Qe!==We&&Qe.remove()})}}),K(ie,this.grid,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}}const w="__lexicalTableSelection";function P(Se,ie,fe,Oe){const Re=fe.getRootElement();if(Re===null)throw new Error("No root element.");const De=new T(fe,Se.getKey()),We=fe._window||window;H(ie,De),ie.addEventListener("mousedown",je=>{setTimeout(()=>{if(je.button!==0||!We)return;const Ve=W(je.target);Ve!==null&&(ne(je),De.setAnchorCellForSelection(Ve));const rt=()=>{We.removeEventListener("mouseup",rt),We.removeEventListener("mousemove",_t)},_t=Et=>{const vt=W(Et.target);vt!==null&&(De.anchorX!==vt.x||De.anchorY!==vt.y)&&(Et.preventDefault(),De.setFocusCellForSelection(vt))};We.addEventListener("mouseup",rt),We.addEventListener("mousemove",_t)},0)});const qe=je=>{je.button===0&&fe.update(()=>{const Ve=t.$getSelection(),rt=je.target;t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&Re.contains(rt)&&De.clearHighlight()})};We.addEventListener("mousedown",qe),De.listenersToRemove.add(()=>We.removeEventListener("mousedown",qe)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_DOWN_COMMAND,je=>j(fe,je,"down",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_UP_COMMAND,je=>j(fe,je,"up",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_LEFT_COMMAND,je=>j(fe,je,"backward",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,je=>j(fe,je,"forward",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ESCAPE_COMMAND,je=>{const Ve=t.$getSelection();if(t.DEPRECATED_$isGridSelection(Ve)){const rt=e.$findMatchingParent(Ve.focus.getNode(),p);if(p(rt))return ne(je),rt.selectEnd(),!0}return!1},t.COMMAND_PRIORITY_HIGH));const Qe=je=>()=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>p(bt));if(!p(rt))return!1;const _t=Ve.anchor.getNode(),Et=Ve.focus.getNode(),vt=Se.isParentOf(_t),Ot=Se.isParentOf(Et);if(vt&&!Ot||Ot&&!vt)return De.clearText(),!0;const xt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>t.$isElementNode(bt)),Qt=xt&&e.$findMatchingParent(xt,bt=>t.$isElementNode(bt)&&p(bt.getParent()));if(!t.$isElementNode(Qt)||!t.$isElementNode(xt))return!1;if(je===t.DELETE_LINE_COMMAND&&Qt.getPreviousSibling()===null)return!0;if((je===t.DELETE_CHARACTER_COMMAND||je===t.DELETE_WORD_COMMAND)&&Ve.isCollapsed()&&Ve.anchor.offset===0&&xt!==Qt){const bt=xt.getChildren(),Ut=t.$createParagraphNode();return bt.forEach(It=>Ut.append(It)),xt.replace(Ut),xt.getWritable().__parent=rt.getKey(),!0}}return!1};[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(je=>{De.listenersToRemove.add(fe.registerCommand(je,Qe(je),t.COMMAND_PRIORITY_CRITICAL))});const ft=je=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return je.preventDefault(),je.stopPropagation(),De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1};De.listenersToRemove.add(fe.registerCommand(t.KEY_BACKSPACE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.KEY_DELETE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FORMAT_TEXT_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.formatCells(je),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearHighlight(),!1;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),Oe&&De.listenersToRemove.add(fe.registerCommand(t.KEY_TAB_COMMAND,je=>{const Ve=t.$getSelection();if(!t.$isRangeSelection(Ve)||!Ve.isCollapsed()||!q(Ve,Se))return!1;const rt=z(Ve.anchor.getNode());if(rt===null)return!1;ne(je);const _t=Se.getCordsFromCellNode(rt,De.grid);return V(De,Se,_t.x,_t.y,je.shiftKey?"backward":"forward"),!0},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FOCUS_COMMAND,je=>Se.isSelected(),t.COMMAND_PRIORITY_HIGH));function kt(je){const Ve=Se.getCordsFromCellNode(je,De.grid);return Se.getCellFromCordsOrThrow(Ve.x,Ve.y,De.grid)}return De.listenersToRemove.add(fe.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{const je=t.$getSelection(),Ve=t.$getPreviousSelection();if(t.$isRangeSelection(je)){const{anchor:rt,focus:_t}=je,Et=rt.getNode(),vt=_t.getNode(),Ot=z(Et),Mt=z(vt),xt=Ot&&Se.is(D(Ot)),Qt=Mt&&Se.is(D(Mt)),bt=xt!==Qt,Ut=xt&&Qt,It=je.isBackward();if(bt){const hr=je.clone();hr.focus.set(Se.getKey(),It?0:Se.getChildrenSize(),"element"),t.$setSelection(hr),ee(fe,De)}else Ut&&(Ot.is(Mt)||(De.setAnchorCellForSelection(kt(Ot)),De.setFocusCellForSelection(kt(Mt),!0)))}return je&&!je.is(Ve)&&(t.DEPRECATED_$isGridSelection(je)||t.DEPRECATED_$isGridSelection(Ve))&&De.gridSelection&&!De.gridSelection.is(Ve)?(t.DEPRECATED_$isGridSelection(je)&&je.gridKey===De.tableNodeKey?De.updateTableGridSelection(je):!t.DEPRECATED_$isGridSelection(je)&&t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&De.updateTableGridSelection(null),!1):(De.hasHijackedSelectionStyles&&!Se.isSelected()?le(fe,De):!De.hasHijackedSelectionStyles&&Se.isSelected()&&ee(fe,De),!1)},t.COMMAND_PRIORITY_CRITICAL)),De}function H(Se,ie){Se[w]=ie}function $(Se){return Se[w]}function W(Se){let ie=Se;for(;ie!=null;){const fe=ie.nodeName;if(fe==="TD"||fe==="TH"){const Oe=ie._cell;return Oe===void 0?null:Oe}ie=ie.parentNode}return null}function B(Se){const ie=[],fe={cells:ie,columns:0,rows:0};let Oe=Se.firstChild,Re=0,De=0;for(ie.length=0;Oe!=null;){const We=Oe.nodeName;if(We==="TD"||We==="TH"){const ft=Oe,kt={elem:ft,hasBackgroundColor:ft.style.backgroundColor!=="",highlighted:!1,x:Re,y:De};Oe._cell=kt;let je=ie[De];je===void 0&&(je=ie[De]=[]),je[Re]=kt}else{const ft=Oe.firstChild;if(ft!=null){Oe=ft;continue}}const qe=Oe.nextSibling;if(qe!=null){Re++,Oe=qe;continue}const Qe=Oe.parentNode;if(Qe!=null){const ft=Qe.nextSibling;if(ft==null)break;De++,Re=0,Oe=ft}}return fe.columns=Re+1,fe.rows=De+1,fe}function K(Se,ie,fe){const Oe=new Set(fe?fe.getNodes():[]);X(ie,(Re,De)=>{const We=Re.elem;Oe.has(De)?(Re.highlighted=!0,pe(Se,Re)):(Re.highlighted=!1,ue(Se,Re),We.getAttribute("style")||We.removeAttribute("style"))})}function X(Se,ie){const{cells:fe}=Se;for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(Re)for(let De=0;De<Re.length;De++){const We=Re[De];if(!We)continue;const qe=t.$getNearestNodeFromDOMNode(We.elem);qe!==null&&ie(We,qe,{x:De,y:Oe})}}}function ee(Se,ie){ie.disableHighlightStyle(),X(ie.grid,fe=>{fe.highlighted=!0,pe(Se,fe)})}function le(Se,ie){ie.enableHighlightStyle(),X(ie.grid,fe=>{const Oe=fe.elem;fe.highlighted=!1,ue(Se,fe),Oe.getAttribute("style")||Oe.removeAttribute("style")})}const V=(Se,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?Se.grid.columns-1:0)?me(ie.getCellNodeFromCordsOrThrow(fe+(De?1:-1),Oe,Se.grid),De):Oe!==(De?Se.grid.rows-1:0)?me(ie.getCellNodeFromCordsOrThrow(De?0:Se.grid.columns-1,Oe+(De?1:-1),Se.grid),De):De?ie.selectNext():ie.selectPrevious(),!0;case"up":return Oe!==0?me(ie.getCellNodeFromCordsOrThrow(fe,Oe-1,Se.grid),!1):ie.selectPrevious(),!0;case"down":return Oe!==Se.grid.rows-1?me(ie.getCellNodeFromCordsOrThrow(fe,Oe+1,Se.grid),!0):ie.selectNext(),!0;default:return!1}},U=(Se,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?Se.grid.columns-1:0)&&Se.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe+(De?1:-1),Oe,Se.grid)),!0;case"up":return Oe!==0?(Se.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe-1,Se.grid)),!0):!1;case"down":return Oe!==Se.grid.rows-1?(Se.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe+1,Se.grid)),!0):!1;default:return!1}};function q(Se,ie){if(t.$isRangeSelection(Se)||t.DEPRECATED_$isGridSelection(Se)){const fe=ie.isParentOf(Se.anchor.getNode()),Oe=ie.isParentOf(Se.focus.getNode());return fe&&Oe}return!1}function me(Se,ie){ie?Se.selectStart():Se.selectEnd()}const _e="172,206,247";function pe(Se,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null?fe.style.setProperty("background-color",`rgb(${_e})`):fe.style.setProperty("background-image",`linear-gradient(to right, rgba(${_e},0.85), rgba(${_e},0.85))`),fe.style.setProperty("caret-color","transparent")}function ue(Se,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null&&fe.style.removeProperty("background-color"),fe.style.removeProperty("background-image"),fe.style.removeProperty("caret-color")}function z(Se){const ie=e.$findMatchingParent(Se,p);return p(ie)?ie:null}function D(Se){const ie=e.$findMatchingParent(Se,m);return m(ie)?ie:null}function j(Se,ie,fe,Oe,Re){const De=t.$getSelection();if(!q(De,Oe))return!1;if(t.$isRangeSelection(De)&&De.isCollapsed()){if(fe==="backward"||fe==="forward")return!1;const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p);if(!p(Qe)||!Qe.is(ft))return!1;const kt=D(Qe);if(kt!==Oe&&kt!=null){const Mt=Se.getElementByKey(kt.getKey());if(Mt!=null)return Re.grid=B(Mt),j(Se,ie,fe,kt,Re)}const je=Se.getElementByKey(Qe.__key),Ve=Se.getElementByKey(We.key);if(Ve==null||je==null)return!1;let rt;if(We.type==="element")rt=Ve.getBoundingClientRect();else{const Mt=window.getSelection();if(Mt===null||Mt.rangeCount===0)return!1;rt=Mt.getRangeAt(0).getBoundingClientRect()}const _t=fe==="up"?Qe.getFirstChild():Qe.getLastChild();if(_t==null)return!1;const Et=Se.getElementByKey(_t.__key);if(Et==null)return!1;const vt=Et.getBoundingClientRect();if(fe==="up"?vt.top>rt.top-rt.height:rt.bottom+rt.height>vt.bottom){ne(ie);const Mt=Oe.getCordsFromCellNode(Qe,Re.grid);if(ie.shiftKey){const xt=Oe.getCellFromCordsOrThrow(Mt.x,Mt.y,Re.grid);Re.setAnchorCellForSelection(xt),Re.setFocusCellForSelection(xt,!0)}else return V(Re,Oe,Mt.x,Mt.y,fe);return!0}}else if(t.DEPRECATED_$isGridSelection(De)){const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p),[kt]=De.getNodes(),je=Se.getElementByKey(kt.getKey());if(!p(Qe)||!p(ft)||!m(kt)||je==null)return!1;Re.updateTableGridSelection(De);const Ve=B(je),rt=Oe.getCordsFromCellNode(Qe,Ve),_t=Oe.getCellFromCordsOrThrow(rt.x,rt.y,Ve);if(Re.setAnchorCellForSelection(_t),ne(ie),ie.shiftKey){const Et=Oe.getCordsFromCellNode(ft,Ve);return U(Re,kt,Et.x,Et.y,fe)}else ft.selectEnd();return!0}return!1}function ne(Se){Se.preventDefault(),Se.stopImmediatePropagation(),Se.stopPropagation()}class Y extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new Y(ie.__key)}static importDOM(){return{table:ie=>({conversion:Q,priority:1})}}static importJSON(ie){return k()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,fe){const Oe=document.createElement("table");return e.addClassNamesToElement(Oe,ie.theme.table),Oe}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:fe=>{if(fe){const Oe=fe.cloneNode(),Re=document.createElement("colgroup"),De=document.createElement("tbody");e.isHTMLElement(fe)&&De.append(...fe.children);const We=this.getFirstChildOrThrow();if(!O(We))throw new Error("Expected to find row node.");const qe=We.getChildrenSize();for(let Qe=0;Qe<qe;Qe++){const ft=document.createElement("col");Re.append(ft)}return Oe.replaceChildren(Re,De),Oe}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,fe){const{rows:Oe,cells:Re}=fe;for(let De=0;De<Oe;De++){const We=Re[De];if(We==null)continue;const qe=We.findIndex(Qe=>{if(!Qe)return;const{elem:ft}=Qe;return t.$getNearestNodeFromDOMNode(ft)===ie});if(qe!==-1)return{x:qe,y:De}}throw new Error("Cell not found in table.")}getCellFromCords(ie,fe,Oe){const{cells:Re}=Oe,De=Re[fe];if(De==null)return null;const We=De[ie];return We??null}getCellFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(!Re)throw new Error("Cell not found at cords.");return Re}getCellNodeFromCords(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(Re==null)return null;const De=t.$getNearestNodeFromDOMNode(Re.elem);return p(De)?De:null}getCellNodeFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellNodeFromCords(ie,fe,Oe);if(!Re)throw new Error("Node at cords not TableCellNode.");return Re}canSelectBefore(){return!0}canIndent(){return!1}}function G(Se,ie){const fe=Se.getElementByKey(ie.getKey());if(fe==null)throw new Error("Table Element Not Found");return B(fe)}function Q(Se){return{node:k()}}function k(){return t.$applyNodeReplacement(new Y)}function m(Se){return Se instanceof Y}function y(Se,ie,fe=!0){const Oe=k();for(let Re=0;Re<Se;Re++){const De=x();for(let We=0;We<ie;We++){let qe=r.NO_STATUS;typeof fe=="object"?(Re===0&&fe.rows&&(qe|=r.ROW),We===0&&fe.columns&&(qe|=r.COLUMN)):fe&&(Re===0&&(qe|=r.ROW),We===0&&(qe|=r.COLUMN));const Qe=g(qe),ft=t.$createParagraphNode();ft.append(t.$createTextNode()),Qe.append(ft),De.append(Qe)}Oe.append(De)}return Oe}function A(Se){const ie=e.$findMatchingParent(Se,fe=>p(fe));return p(ie)?ie:null}function Z(Se){const ie=e.$findMatchingParent(Se,fe=>O(fe));if(O(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ae(Se){const ie=e.$findMatchingParent(Se,fe=>m(fe));if(m(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function he(Se){const ie=Z(Se);return ae(ie).getChildren().findIndex(Oe=>Oe.is(ie))}function se(Se){return Z(Se).getChildren().findIndex(fe=>fe.is(Se))}function Te(Se,ie){const fe=ae(Se),{x:Oe,y:Re}=fe.getCordsFromCellNode(Se,ie);return{above:fe.getCellNodeFromCords(Oe,Re-1,ie),below:fe.getCellNodeFromCords(Oe,Re+1,ie),left:fe.getCellNodeFromCords(Oe-1,Re,ie),right:fe.getCellNodeFromCords(Oe+1,Re,ie)}}function be(Se,ie){const fe=Se.getChildren();if(ie>=fe.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return fe[ie].remove(),Se}function Ue(Se,ie,fe=!0,Oe,Re){const De=Se.getChildren();if(ie>=De.length||ie<0)throw new Error("Table row target index out of range");const We=De[ie];if(O(We))for(let qe=0;qe<Oe;qe++){const Qe=We.getChildren(),ft=Qe.length,kt=x();for(let je=0;je<ft;je++){const Ve=Qe[je];if(!p(Ve))throw Error("Expected table cell");const{above:rt,below:_t}=Te(Ve,Re);let Et=r.NO_STATUS;const vt=rt&&rt.getWidth()||_t&&_t.getWidth()||void 0;(rt&&rt.hasHeaderState(r.COLUMN)||_t&&_t.hasHeaderState(r.COLUMN))&&(Et|=r.COLUMN);const Ot=g(Et,1,vt);Ot.append(t.$createParagraphNode()),kt.append(Ot)}fe?We.insertAfter(kt):We.insertBefore(kt)}else throw new Error("Row before insertion index does not exist.");return Se}function re(Se=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const fe=ie.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,We]=t.DEPRECATED_$computeGridMap(Re,Oe,Oe),qe=De[0].length,{startRow:Qe}=We;if(Se){const ft=Qe+Oe.__rowSpan-1,kt=De[ft],je=x();for(let rt=0;rt<qe;rt++){const{cell:_t,startRow:Et}=kt[rt];Et+_t.__rowSpan-1<=ft?je.append(g(r.NO_STATUS)):_t.setRowSpan(_t.__rowSpan+1)}const Ve=Re.getChildAtIndex(ft);if(!t.DEPRECATED_$isGridRowNode(Ve))throw Error("focusEndRow is not a GridRowNode");Ve.insertAfter(je)}else{const ft=De[Qe],kt=x();for(let Ve=0;Ve<qe;Ve++){const{cell:rt,startRow:_t}=ft[Ve];_t===Qe?kt.append(g(r.NO_STATUS)):rt.setRowSpan(rt.__rowSpan+1)}const je=Re.getChildAtIndex(Qe);if(!t.DEPRECATED_$isGridRowNode(je))throw Error("focusEndRow is not a GridRowNode");je.insertBefore(kt)}}function te(Se,ie,fe=!0,Oe,Re){const De=Se.getChildren(),We=[];for(let qe=0;qe<De.length;qe++){const Qe=De[qe];if(O(Qe))for(let ft=0;ft<Oe;ft++){const kt=Qe.getChildren();if(ie>=kt.length||ie<0)throw new Error("Table column target index out of range");const je=kt[ie];if(!p(je))throw Error("Expected table cell");const{left:Ve,right:rt}=Te(je,Re);let _t=r.NO_STATUS;(Ve&&Ve.hasHeaderState(r.ROW)||rt&&rt.hasHeaderState(r.ROW))&&(_t|=r.ROW);const Et=g(_t);Et.append(t.$createParagraphNode()),We.push({newTableCell:Et,targetCell:je})}}return We.forEach(({newTableCell:qe,targetCell:Qe})=>{fe?Qe.insertAfter(qe):Qe.insertBefore(qe)}),Se}function ce(Se=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const fe=ie.anchor.getNode(),Oe=ie.focus.getNode(),[Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,,We]=t.DEPRECATED_$getNodeTriplet(Oe),[qe,Qe,ft]=t.DEPRECATED_$computeGridMap(We,De,Re),kt=qe.length,je=Se?Math.max(Qe.startColumn,ft.startColumn):Math.min(Qe.startColumn,ft.startColumn),Ve=Se?je+De.__colSpan-1:je-1,rt=We.getFirstChild();if(!t.DEPRECATED_$isGridRowNode(rt))throw Error("Expected firstTable child to be a row");let _t=null;function Et(){const Ot=g(r.NO_STATUS).append(t.$createParagraphNode());return _t===null&&(_t=Ot),Ot}let vt=rt;e:for(let Ot=0;Ot<kt;Ot++){if(Ot!==0){const Ut=vt.getNextSibling();if(!t.DEPRECATED_$isGridRowNode(Ut))throw Error("Expected row nextSibling to be a row");vt=Ut}const Mt=qe[Ot];if(Ve<0){ct(vt,Et());continue}const{cell:xt,startColumn:Qt,startRow:bt}=Mt[Ve];if(Qt+xt.__colSpan-1<=Ve){let Ut=xt,It=bt,hr=Ve;for(;It!==Ot&&Ut.__rowSpan>1;)if(hr-=xt.__colSpan,hr>=0){const{cell:vr,startRow:Fi}=Mt[hr];Ut=vr,It=Fi}else{vt.append(Et());continue e}Ut.insertAfter(Et())}else xt.setColSpan(xt.__colSpan+1)}_t!==null&&Ye(_t)}function we(Se,ie){const fe=Se.getChildren();for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(O(Re)){const De=Re.getChildren();if(ie>=De.length||ie<0)throw new Error("Table column target index out of range");De[ie].remove()}}return Se}function Le(){const Se=t.$getSelection();if(!t.$INTERNAL_isPointSelection(Se))throw Error("Expected a INTERNAL_PointSelection");const ie=Se.anchor.getNode(),fe=Se.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startRow:ft}=qe,{startRow:kt}=Qe,je=kt+De.__rowSpan-1;if(We.length===je-ft+1){Re.remove();return}const Ve=We[0].length,rt=We[je+1],_t=Re.getChildAtIndex(je+1);for(let Et=je;Et>=ft;Et--){for(let Ot=Ve-1;Ot>=0;Ot--){const{cell:Mt,startRow:xt,startColumn:Qt}=We[Et][Ot];if(Qt===Ot&&(Et===ft&&xt<ft&&Mt.setRowSpan(Mt.__rowSpan-(xt-ft)),xt>=ft&&xt+Mt.__rowSpan-1>je)){if(Mt.setRowSpan(Mt.__rowSpan-(je-xt+1)),_t===null)throw Error("Expected nextRowNode not to be null");if(Ot===0)ct(_t,Mt);else{const{cell:bt}=rt[Ot-1];bt.insertAfter(Mt)}}}const vt=Re.getChildAtIndex(Et);if(!t.DEPRECATED_$isGridRowNode(vt))throw Error(`Expected GridNode childAtIndex(${String(Et)}) to be RowNode`);vt.remove()}if(rt!==void 0){const{cell:Et}=rt[0];Ye(Et)}else{const Et=We[ft-1],{cell:vt}=Et[0];Ye(vt)}}function Be(){const Se=t.$getSelection();if(!t.$INTERNAL_isPointSelection(Se))throw Error("Expected a INTERNAL_PointSelection");const ie=Se.anchor.getNode(),fe=Se.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startColumn:ft}=qe,{startRow:kt,startColumn:je}=Qe,Ve=Math.min(ft,je),rt=Math.max(ft+Oe.__colSpan-1,je+De.__colSpan-1),_t=rt-Ve+1;if(We[0].length===rt-Ve+1){Re.selectPrevious(),Re.remove();return}const vt=We.length;for(let xt=0;xt<vt;xt++)for(let Qt=Ve;Qt<=rt;Qt++){const{cell:bt,startColumn:Ut}=We[xt][Qt];if(Ut<Ve){if(Qt===Ve){const It=Ve-Ut;bt.setColSpan(bt.__colSpan-Math.min(_t,bt.__colSpan-It))}}else if(Ut+bt.__colSpan-1>rt){if(Qt===rt){const It=rt-Ut+1;bt.setColSpan(bt.__colSpan-It)}}else bt.remove()}const Ot=We[kt],Mt=Ot[je+De.__colSpan];if(Mt!==void 0){const{cell:xt}=Mt;Ye(xt)}else{const xt=Ot[je-1],{cell:Qt}=xt;Ye(Qt)}}function Ye(Se){const ie=Se.getFirstDescendant();ie==null?Se.selectStart():ie.getParentOrThrow().selectStart()}function ct(Se,ie){const fe=Se.getFirstChild();fe!==null?fe.insertBefore(ie):Se.append(ie)}function yt(){const Se=t.$getSelection();if(!t.$INTERNAL_isPointSelection(Se))throw Error("Expected a INTERNAL_PointSelection");const ie=Se.anchor.getNode(),[fe,Oe,Re]=t.DEPRECATED_$getNodeTriplet(ie),De=fe.__colSpan,We=fe.__rowSpan;if(De>1){for(let qe=1;qe<De;qe++)fe.insertAfter(g(r.NO_STATUS));fe.setColSpan(1)}if(We>1){const[qe,Qe]=t.DEPRECATED_$computeGridMap(Re,fe,fe),{startColumn:ft,startRow:kt}=Qe;let je;for(let Ve=1;Ve<We;Ve++){const rt=kt+Ve,_t=qe[rt];if(je=(je||Oe).getNextSibling(),!t.DEPRECATED_$isGridRowNode(je))throw Error("Expected row next sibling to be a row");let Et=null;for(let vt=0;vt<ft;vt++){const Ot=_t[vt],Mt=Ot.cell;Ot.startRow===rt&&(Et=Mt),Mt.__colSpan>1&&(vt+=Mt.__colSpan-1)}if(Et===null)for(let vt=0;vt<De;vt++)ct(je,g(r.NO_STATUS));else for(let vt=0;vt<De;vt++)Et.insertAfter(g(r.NO_STATUS))}fe.setRowSpan(1)}}const dt=t.createCommand("INSERT_TABLE_COMMAND");return Gt.$createTableCellNode=g,Gt.$createTableNode=k,Gt.$createTableNodeWithDimensions=y,Gt.$createTableRowNode=x,Gt.$deleteTableColumn=we,Gt.$deleteTableColumn__EXPERIMENTAL=Be,Gt.$deleteTableRow__EXPERIMENTAL=Le,Gt.$getElementGridForTableNode=G,Gt.$getTableCellNodeFromLexicalNode=A,Gt.$getTableColumnIndexFromTableCellNode=se,Gt.$getTableNodeFromLexicalNodeOrThrow=ae,Gt.$getTableRowIndexFromTableCellNode=he,Gt.$getTableRowNodeFromTableCellNodeOrThrow=Z,Gt.$insertTableColumn=te,Gt.$insertTableColumn__EXPERIMENTAL=ce,Gt.$insertTableRow=Ue,Gt.$insertTableRow__EXPERIMENTAL=re,Gt.$isTableCellNode=p,Gt.$isTableNode=m,Gt.$isTableRowNode=O,Gt.$removeTableRowAtIndex=be,Gt.$unmergeCell=yt,Gt.INSERT_TABLE_COMMAND=dt,Gt.TableCellHeaderStates=r,Gt.TableCellNode=c,Gt.TableNode=Y,Gt.TableRowNode=C,Gt.TableSelection=T,Gt.applyTableHandlers=P,Gt.getCellFromTarget=W,Gt.getTableSelectionFromTableElement=$,Gt}var Yt={},gh;function NC(){if(gh)return Yt;gh=1;var t=Bt(),e=on();let n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(y){let A=new c(y.__headerState,y.__colSpan,y.__width,y.__key);return A.__rowSpan=y.__rowSpan,A.__backgroundColor=y.__backgroundColor,A}static importDOM(){return{td:()=>({conversion:d,priority:0}),th:()=>({conversion:d,priority:0})}}static importJSON(y){let A=y.rowSpan||1,Z=g(y.headerState,y.colSpan||1,y.width||void 0);return Z.__rowSpan=A,Z.__backgroundColor=y.backgroundColor||null,Z}constructor(y=r.NO_STATUS,A=1,Z,ae){super(A,ae),this.__headerState=y,this.__width=Z,this.__backgroundColor=null}createDOM(y){let A=document.createElement(this.getTag());return this.__width&&(A.style.width=`${this.__width}px`),1<this.__colSpan&&(A.colSpan=this.__colSpan),1<this.__rowSpan&&(A.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(A.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(A,y.theme.tableCell,this.hasHeader()&&y.theme.tableCellHeader),A}exportDOM(y){if({element:y}=super.exportDOM(y),y){var A=this.getParentOrThrow().getChildrenSize();y.style.border="1px solid black",1<this.__colSpan&&(y.colSpan=this.__colSpan),1<this.__rowSpan&&(y.rowSpan=this.__rowSpan),y.style.width=`${this.getWidth()||Math.max(90,700/A)}px`,y.style.verticalAlign="top",y.style.textAlign="start",A=this.getBackgroundColor(),A!==null?y.style.backgroundColor=A:this.hasHeader()&&(y.style.backgroundColor="#f2f3f5")}return{element:y}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(y){return this.getWritable().__headerState=y,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(y){return this.getWritable().__width=y,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(y){this.getWritable().__backgroundColor=y}toggleHeaderStyle(y){let A=this.getWritable();return A.__headerState=(A.__headerState&y)===y?A.__headerState-y:A.__headerState+y,A}hasHeaderState(y){return(this.getHeaderStyles()&y)===y}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(y){return y.__headerState!==this.__headerState||y.__width!==this.__width||y.__colSpan!==this.__colSpan||y.__rowSpan!==this.__rowSpan||y.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(m){var y=m.nodeName.toLowerCase();let A;return n.test(m.style.width)&&(A=parseFloat(m.style.width)),y=g(y==="th"?r.ROW:r.NO_STATUS,m.colSpan,A),y.__rowSpan=m.rowSpan,m=m.style.backgroundColor,m!==""&&(y.__backgroundColor=m),{forChild:(Z,ae)=>p(ae)&&!t.$isElementNode(Z)?(ae=t.$createParagraphNode(),t.$isLineBreakNode(Z)&&Z.getTextContent()===`
75
- `?null:(ae.append(Z),ae)):Z,node:y}}function g(m,y=1,A){return t.$applyNodeReplacement(new c(m,y,A))}function p(m){return m instanceof c}class C extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(y){return new C(y.__height,y.__key)}static importDOM(){return{tr:()=>({conversion:S,priority:0})}}static importJSON(y){return x(y.height)}constructor(y,A){super(A),this.__height=y}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(y){let A=document.createElement("tr");return this.__height&&(A.style.height=`${this.__height}px`),e.addClassNamesToElement(A,y.theme.tableRow),A}isShadowRoot(){return!0}setHeight(y){return this.getWritable().__height=y,this.__height}getHeight(){return this.getLatest().__height}updateDOM(y){return y.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function S(m){let y;return n.test(m.style.height)&&(y=parseFloat(m.style.height)),{node:x(y)}}function x(m){return t.$applyNodeReplacement(new C(m))}function O(m){return m instanceof C}function R(m){let y=new URLSearchParams;y.append("code",m);for(let A=1;A<arguments.length;A++)y.append("v",arguments[A]);throw Error(`Minified Lexical error #${m}; visit https://lexical.dev/docs/error?${y} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class T{constructor(y,A){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=A,this.editor=y,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(y=>y())}trackTableGrid(){let y=new MutationObserver(A=>{this.editor.update(()=>{var Z=!1;for(let ae=0;ae<A.length;ae++){const he=A[ae].target.nodeName;if(he==="TABLE"||he==="TR"){Z=!0;break}}if(Z){if(Z=this.editor.getElementByKey(this.tableNodeKey),!Z)throw Error("Expected to find TableElement in DOM");this.grid=P(Z)}})});this.editor.update(()=>{let A=this.editor.getElementByKey(this.tableNodeKey);if(!A)throw Error("Expected to find TableElement in DOM");this.grid=P(A),y.observe(A,{childList:!0,subtree:!0})})}clearHighlight(){let y=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(),y.update(()=>{var A=t.$getNodeByKey(this.tableNodeKey);if(!D(A))throw Error("Expected TableNode.");if(A=y.getElementByKey(this.tableNodeKey),!A)throw Error("Expected to find TableElement in DOM");A=P(A),H(y,A,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let y=this.editor;y.update(()=>{let A=y.getElementByKey(this.tableNodeKey);if(!A)throw Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(A,y._config.theme.tableSelection),A.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let y=this.editor;y.update(()=>{let A=y.getElementByKey(this.tableNodeKey);if(!A)throw Error("Expected to find TableElement in DOM");e.addClassNamesToElement(A,y._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(y){if(y!=null&&y.gridKey===this.tableNodeKey){let A=this.editor;this.gridSelection=y,this.isHighlightingCells=!0,this.disableHighlightStyle(),H(A,this.grid,this.gridSelection)}else y==null?this.clearHighlight():(this.tableNodeKey=y.gridKey,this.updateTableGridSelection(y))}setFocusCellForSelection(y,A=!1){let Z=this.editor;Z.update(()=>{var ae=t.$getNodeByKey(this.tableNodeKey);if(!D(ae))throw Error("Expected TableNode.");if(!Z.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ae=y.x;let he=y.y;if(this.focusCell=y,this.anchorCell!==null){let se=b?(Z._window||window).getSelection():null;se&&se.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ae||this.anchorY!==he||A))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ae===this.focusX&&he===this.focusY)return;this.focusX=ae,this.focusY=he,this.isHighlightingCells&&(ae=t.$getNearestNodeFromDOMNode(y.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(ae)&&(ae=ae.getKey(),this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ae,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Z.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),H(Z,this.grid,this.gridSelection)))})}setAnchorCellForSelection(y){this.isHighlightingCells=!1,this.anchorCell=y,this.anchorX=y.x,this.anchorY=y.y,this.editor.update(()=>{var A=t.$getNearestNodeFromDOMNode(y.elem);p(A)&&(A=A.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=A)})}formatCells(y){this.editor.update(()=>{let A=t.$getSelection();t.DEPRECATED_$isGridSelection(A)||R(11);let Z=t.$createRangeSelection(),ae=Z.anchor,he=Z.focus;A.getNodes().forEach(se=>{p(se)&&se.getTextContentSize()!==0&&(ae.set(se.getKey(),0,"element"),he.set(se.getKey(),se.getChildrenSize(),"element"),Z.formatText(y))}),t.$setSelection(A),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let y=this.editor;y.update(()=>{let A=t.$getNodeByKey(this.tableNodeKey);if(!D(A))throw Error("Expected TableNode.");var Z=t.$getSelection();t.DEPRECATED_$isGridSelection(Z)||R(11),Z=Z.getNodes().filter(p),Z.length===this.grid.columns*this.grid.rows?(A.selectPrevious(),A.remove(),t.$getRoot().selectStart()):(Z.forEach(ae=>{if(t.$isElementNode(ae)){let he=t.$createParagraphNode(),se=t.$createTextNode();he.append(se),ae.append(he),ae.getChildren().forEach(Te=>{Te!==he&&Te.remove()})}}),H(y,this.grid,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0))})}}function w(m){for(;m!=null;){let y=m.nodeName;if(y==="TD"||y==="TH"){if(m=m._cell,m===void 0)break;return m}m=m.parentNode}return null}function P(m){let y=[],A={cells:y,columns:0,rows:0};var Z=m.firstChild;let ae=m=0;for(y.length=0;Z!=null;){var he=Z.nodeName;if(he==="TD"||he==="TH"){he=Z,he={elem:he,hasBackgroundColor:he.style.backgroundColor!=="",highlighted:!1,x:m,y:ae},Z._cell=he;let se=y[ae];se===void 0&&(se=y[ae]=[]),se[m]=he}else if(he=Z.firstChild,he!=null){Z=he;continue}if(he=Z.nextSibling,he!=null)m++,Z=he;else if(he=Z.parentNode,he!=null){if(Z=he.nextSibling,Z==null)break;ae++,m=0}}return A.columns=m+1,A.rows=ae+1,A}function H(m,y,A){let Z=new Set(A?A.getNodes():[]);$(y,(ae,he)=>{let se=ae.elem;Z.has(he)?(ae.highlighted=!0,le(m,ae)):(ae.highlighted=!1,V(m,ae),se.getAttribute("style")||se.removeAttribute("style"))})}function $(m,y){({cells:m}=m);for(let A=0;A<m.length;A++){let Z=m[A];if(Z)for(let ae=0;ae<Z.length;ae++){let he=Z[ae];if(!he)continue;let se=t.$getNearestNodeFromDOMNode(he.elem);se!==null&&y(he,se,{x:ae,y:A})}}}function W(m,y){y.disableHighlightStyle(),$(y.grid,A=>{A.highlighted=!0,le(m,A)})}function B(m,y){y.enableHighlightStyle(),$(y.grid,A=>{let Z=A.elem;A.highlighted=!1,V(m,A),Z.getAttribute("style")||Z.removeAttribute("style")})}let K=(m,y,A,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return A!==(he?m.grid.columns-1:0)?(m=y.getCellNodeFromCordsOrThrow(A+(he?1:-1),Z,m.grid),he?m.selectStart():m.selectEnd()):Z!==(he?m.grid.rows-1:0)?(m=y.getCellNodeFromCordsOrThrow(he?0:m.grid.columns-1,Z+(he?1:-1),m.grid),he?m.selectStart():m.selectEnd()):he?y.selectNext():y.selectPrevious(),!0;case"up":return Z!==0?y.getCellNodeFromCordsOrThrow(A,Z-1,m.grid).selectEnd():y.selectPrevious(),!0;case"down":return Z!==m.grid.rows-1?y.getCellNodeFromCordsOrThrow(A,Z+1,m.grid).selectStart():y.selectNext(),!0;default:return!1}},X=(m,y,A,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return A!==(he?m.grid.columns-1:0)&&m.setFocusCellForSelection(y.getCellFromCordsOrThrow(A+(he?1:-1),Z,m.grid)),!0;case"up":return Z!==0?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(A,Z-1,m.grid)),!0):!1;case"down":return Z!==m.grid.rows-1?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(A,Z+1,m.grid)),!0):!1;default:return!1}};function ee(m,y){if(t.$isRangeSelection(m)||t.DEPRECATED_$isGridSelection(m)){let A=y.isParentOf(m.anchor.getNode());return m=y.isParentOf(m.focus.getNode()),A&&m}return!1}function le(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||R(131),y.getBackgroundColor()===null?m.style.setProperty("background-color","rgb(172,206,247)"):m.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),m.style.setProperty("caret-color","transparent")}function V(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||R(131),y.getBackgroundColor()===null&&m.style.removeProperty("background-color"),m.style.removeProperty("background-image"),m.style.removeProperty("caret-color")}function U(m){return m=e.$findMatchingParent(m,p),p(m)?m:null}function q(m){return m=e.$findMatchingParent(m,D),D(m)?m:null}function me(m,y,A,Z,ae){let he=t.$getSelection();if(!ee(he,Z))return!1;if(t.$isRangeSelection(he)&&he.isCollapsed()){if(A==="backward"||A==="forward")return!1;let{anchor:Ue,focus:re}=he;var se=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p);if(!p(se)||!se.is(Te))return!1;if(Te=q(se),Te!==Z&&Te!=null){var be=m.getElementByKey(Te.getKey());if(be!=null)return ae.grid=P(be),me(m,y,A,Te,ae)}if(Te=m.getElementByKey(se.__key),be=m.getElementByKey(Ue.key),be==null||Te==null)return!1;if(Ue.type==="element")Te=be.getBoundingClientRect();else{if(Te=window.getSelection(),Te===null||Te.rangeCount===0)return!1;Te=Te.getRangeAt(0).getBoundingClientRect()}if(be=A==="up"?se.getFirstChild():se.getLastChild(),be==null||(m=m.getElementByKey(be.__key),m==null))return!1;if(m=m.getBoundingClientRect(),A==="up"?m.top>Te.top-Te.height:Te.bottom+Te.height>m.bottom){if(_e(y),m=Z.getCordsFromCellNode(se,ae.grid),y.shiftKey)A=Z.getCellFromCordsOrThrow(m.x,m.y,ae.grid),ae.setAnchorCellForSelection(A),ae.setFocusCellForSelection(A,!0);else return K(ae,Z,m.x,m.y,A);return!0}}else if(t.DEPRECATED_$isGridSelection(he)){let{anchor:Ue,focus:re}=he;return be=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p),[se]=he.getNodes(),m=m.getElementByKey(se.getKey()),!p(be)||!p(Te)||!D(se)||m==null?!1:(ae.updateTableGridSelection(he),m=P(m),be=Z.getCordsFromCellNode(be,m),be=Z.getCellFromCordsOrThrow(be.x,be.y,m),ae.setAnchorCellForSelection(be),_e(y),y.shiftKey?(y=Z.getCordsFromCellNode(Te,m),X(ae,se,y.x,y.y,A)):(Te.selectEnd(),!0))}return!1}function _e(m){m.preventDefault(),m.stopImmediatePropagation(),m.stopPropagation()}class pe extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(y){return new pe(y.__key)}static importDOM(){return{table:()=>({conversion:ue,priority:1})}}static importJSON(){return z()}constructor(y){super(y)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(y){let A=document.createElement("table");return e.addClassNamesToElement(A,y.theme.table),A}updateDOM(){return!1}exportDOM(y){return{...super.exportDOM(y),after:A=>{if(A){let Z=A.cloneNode(),ae=document.createElement("colgroup"),he=document.createElement("tbody");if(e.isHTMLElement(A)&&he.append(...A.children),A=this.getFirstChildOrThrow(),!O(A))throw Error("Expected to find row node.");A=A.getChildrenSize();for(let se=0;se<A;se++){let Te=document.createElement("col");ae.append(Te)}return Z.replaceChildren(ae,he),Z}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(y,A){let{rows:Z,cells:ae}=A;for(A=0;A<Z;A++){var he=ae[A];if(he!=null&&(he=he.findIndex(se=>{if(se)return{elem:se}=se,t.$getNearestNodeFromDOMNode(se)===y}),he!==-1))return{x:he,y:A}}throw Error("Cell not found in table.")}getCellFromCords(y,A,Z){return{cells:Z}=Z,A=Z[A],A==null?null:(y=A[y],y??null)}getCellFromCordsOrThrow(y,A,Z){if(y=this.getCellFromCords(y,A,Z),!y)throw Error("Cell not found at cords.");return y}getCellNodeFromCords(y,A,Z){return y=this.getCellFromCords(y,A,Z),y==null?null:(y=t.$getNearestNodeFromDOMNode(y.elem),p(y)?y:null)}getCellNodeFromCordsOrThrow(y,A,Z){if(y=this.getCellNodeFromCords(y,A,Z),!y)throw Error("Node at cords not TableCellNode.");return y}canSelectBefore(){return!0}canIndent(){return!1}}function ue(){return{node:z()}}function z(){return t.$applyNodeReplacement(new pe)}function D(m){return m instanceof pe}function j(m){if(m=e.$findMatchingParent(m,y=>O(y)),O(m))return m;throw Error("Expected table cell to be inside of table row.")}function ne(m){if(m=e.$findMatchingParent(m,y=>D(y)),D(m))return m;throw Error("Expected table cell to be inside of table.")}function Y(m,y){let A=ne(m),{x:Z,y:ae}=A.getCordsFromCellNode(m,y);return{above:A.getCellNodeFromCords(Z,ae-1,y),below:A.getCellNodeFromCords(Z,ae+1,y),left:A.getCellNodeFromCords(Z-1,ae,y),right:A.getCellNodeFromCords(Z+1,ae,y)}}function G(m){let y=m.getFirstDescendant();y==null?m.selectStart():y.getParentOrThrow().selectStart()}function Q(m,y){let A=m.getFirstChild();A!==null?A.insertBefore(y):m.append(y)}let k=t.createCommand("INSERT_TABLE_COMMAND");return Yt.$createTableCellNode=g,Yt.$createTableNode=z,Yt.$createTableNodeWithDimensions=function(m,y,A=!0){let Z=z();for(let he=0;he<m;he++){let se=x();for(let Te=0;Te<y;Te++){var ae=r.NO_STATUS;typeof A=="object"?(he===0&&A.rows&&(ae|=r.ROW),Te===0&&A.columns&&(ae|=r.COLUMN)):A&&(he===0&&(ae|=r.ROW),Te===0&&(ae|=r.COLUMN)),ae=g(ae);let be=t.$createParagraphNode();be.append(t.$createTextNode()),ae.append(be),se.append(ae)}Z.append(se)}return Z},Yt.$createTableRowNode=x,Yt.$deleteTableColumn=function(m,y){let A=m.getChildren();for(let ae=0;ae<A.length;ae++){var Z=A[ae];if(O(Z)){if(Z=Z.getChildren(),y>=Z.length||0>y)throw Error("Table column target index out of range");Z[y].remove()}}return m},Yt.$deleteTableColumn__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[A,,Z]=t.DEPRECATED_$getNodeTriplet(y);[y]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,A,y);var{startColumn:Te}=he;let{startRow:be,startColumn:Ue}=se;m=Math.min(Te,Ue),Te=Math.max(Te+A.__colSpan-1,Ue+y.__colSpan-1);let re=Te-m+1;if(ae[0].length===Te-m+1)Z.selectPrevious(),Z.remove();else{var te=ae.length;for(let ce=0;ce<te;ce++)for(let we=m;we<=Te;we++){let{cell:Le,startColumn:Be}=ae[ce][we];Be<m?we===m&&Le.setColSpan(Le.__colSpan-Math.min(re,Le.__colSpan-(m-Be))):Be+Le.__colSpan-1>Te?we===Te&&Le.setColSpan(Le.__colSpan-(Te-Be+1)):Le.remove()}m=ae[be],y=m[Ue+y.__colSpan],y!==void 0?({cell:y}=y,G(y)):({cell:y}=m[Ue-1],G(y))}},Yt.$deleteTableRow__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[A,,Z]=t.DEPRECATED_$getNodeTriplet(y);[m]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,A,m);({startRow:y}=he);var{startRow:Te}=se;if(m=Te+m.__rowSpan-1,ae.length===m-y+1)Z.remove();else{Te=ae[0].length;var be=ae[m+1],Ue=Z.getChildAtIndex(m+1);for(let te=m;te>=y;te--){for(var re=Te-1;0<=re;re--){let{cell:ce,startRow:we,startColumn:Le}=ae[te][re];if(Le===re&&(te===y&&we<y&&ce.setRowSpan(ce.__rowSpan-(we-y)),we>=y&&we+ce.__rowSpan-1>m))if(ce.setRowSpan(ce.__rowSpan-(m-we+1)),Ue===null&&R(122),re===0)Q(Ue,ce);else{let{cell:Be}=be[re-1];Be.insertAfter(ce)}}re=Z.getChildAtIndex(te),t.DEPRECATED_$isGridRowNode(re)||R(123,String(te)),re.remove()}be!==void 0?({cell:y}=be[0],G(y)):({cell:y}=ae[y-1][0],G(y))}},Yt.$getElementGridForTableNode=function(m,y){if(m=m.getElementByKey(y.getKey()),m==null)throw Error("Table Element Not Found");return P(m)},Yt.$getTableCellNodeFromLexicalNode=function(m){return m=e.$findMatchingParent(m,y=>p(y)),p(m)?m:null},Yt.$getTableColumnIndexFromTableCellNode=function(m){return j(m).getChildren().findIndex(y=>y.is(m))},Yt.$getTableNodeFromLexicalNodeOrThrow=ne,Yt.$getTableRowIndexFromTableCellNode=function(m){let y=j(m);return ne(y).getChildren().findIndex(A=>A.is(y))},Yt.$getTableRowNodeFromTableCellNodeOrThrow=j,Yt.$insertTableColumn=function(m,y,A=!0,Z,ae){let he=m.getChildren(),se=[];for(let Ue=0;Ue<he.length;Ue++){let re=he[Ue];if(O(re))for(let te=0;te<Z;te++){var Te=re.getChildren();if(y>=Te.length||0>y)throw Error("Table column target index out of range");Te=Te[y],p(Te)||R(12);let{left:ce,right:we}=Y(Te,ae);var be=r.NO_STATUS;(ce&&ce.hasHeaderState(r.ROW)||we&&we.hasHeaderState(r.ROW))&&(be|=r.ROW),be=g(be),be.append(t.$createParagraphNode()),se.push({newTableCell:be,targetCell:Te})}}return se.forEach(({newTableCell:Ue,targetCell:re})=>{A?re.insertAfter(Ue):re.insertBefore(Ue)}),m},Yt.$insertTableColumn__EXPERIMENTAL=function(m=!0){function y(){let te=g(r.NO_STATUS).append(t.$createParagraphNode());return Ue===null&&(Ue=te),te}var A=t.$getSelection();if(!t.$INTERNAL_isPointSelection(A))throw Error("Expected a PointSeleciton");var Z=A.anchor.getNode();A=A.focus.getNode(),[Z]=t.DEPRECATED_$getNodeTriplet(Z);let[ae,,he]=t.DEPRECATED_$getNodeTriplet(A),[se,Te,be]=t.DEPRECATED_$computeGridMap(he,ae,Z);Z=se.length,A=m?Math.max(Te.startColumn,be.startColumn):Math.min(Te.startColumn,be.startColumn),m=m?A+ae.__colSpan-1:A-1,A=he.getFirstChild(),t.DEPRECATED_$isGridRowNode(A)||R(120);let Ue=null;var re=A;e:for(A=0;A<Z;A++){A!==0&&(re=re.getNextSibling(),t.DEPRECATED_$isGridRowNode(re)||R(121));let te=se[A];if(0>m){Q(re,y());continue}let{cell:ce,startColumn:we,startRow:Le}=te[m];if(we+ce.__colSpan-1<=m){let Be=ce,Ye=Le,ct=m;for(;Ye!==A&&1<Be.__rowSpan;)if(ct-=ce.__colSpan,0<=ct){let{cell:yt,startRow:dt}=te[ct];Be=yt,Ye=dt}else{re.append(y());continue e}Be.insertAfter(y())}else ce.setColSpan(ce.__colSpan+1)}Ue!==null&&G(Ue)},Yt.$insertTableRow=function(m,y,A=!0,Z,ae){var he=m.getChildren();if(y>=he.length||0>y)throw Error("Table row target index out of range");if(y=he[y],O(y))for(he=0;he<Z;he++){let Te=y.getChildren(),be=Te.length,Ue=x();for(let re=0;re<be;re++){var se=Te[re];p(se)||R(12);let{above:te,below:ce}=Y(se,ae);se=r.NO_STATUS;let we=te&&te.getWidth()||ce&&ce.getWidth()||void 0;(te&&te.hasHeaderState(r.COLUMN)||ce&&ce.hasHeaderState(r.COLUMN))&&(se|=r.COLUMN),se=g(se,1,we),se.append(t.$createParagraphNode()),Ue.append(se)}A?y.insertAfter(Ue):y.insertBefore(Ue)}else throw Error("Row before insertion index does not exist.");return m},Yt.$insertTableRow__EXPERIMENTAL=function(m=!0){var y=t.$getSelection();if(!t.$INTERNAL_isPointSelection(y))throw Error("Expected a INTERNAL_PointSelection");y=y.focus.getNode();let[A,,Z]=t.DEPRECATED_$getNodeTriplet(y),[ae,he]=t.DEPRECATED_$computeGridMap(Z,A,A);y=ae[0].length;var{startRow:se}=he;if(m){m=se+A.__rowSpan-1;var Te=ae[m];se=x();for(var be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re+Ue.__rowSpan-1<=m?se.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(m),t.DEPRECATED_$isGridRowNode(y)||R(119),y.insertAfter(se)}else{for(Te=ae[se],m=x(),be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re===se?m.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(se),t.DEPRECATED_$isGridRowNode(y)||R(119),y.insertBefore(m)}},Yt.$isTableCellNode=p,Yt.$isTableNode=D,Yt.$isTableRowNode=O,Yt.$removeTableRowAtIndex=function(m,y){let A=m.getChildren();if(y>=A.length||0>y)throw Error("Expected table cell to be inside of table row.");return A[y].remove(),m},Yt.$unmergeCell=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");m=m.anchor.getNode();let[y,A,Z]=t.DEPRECATED_$getNodeTriplet(m);m=y.__colSpan;let ae=y.__rowSpan;if(1<m){for(var he=1;he<m;he++)y.insertAfter(g(r.NO_STATUS));y.setColSpan(1)}if(1<ae){let[be,Ue]=t.DEPRECATED_$computeGridMap(Z,y,y),{startColumn:re,startRow:te}=Ue,ce;for(he=1;he<ae;he++){var se=te+he;let we=be[se];ce=(ce||A).getNextSibling(),t.DEPRECATED_$isGridRowNode(ce)||R(125);var Te=null;for(let Le=0;Le<re;Le++){let Be=we[Le],Ye=Be.cell;Be.startRow===se&&(Te=Ye),1<Ye.__colSpan&&(Le+=Ye.__colSpan-1)}if(Te===null)for(Te=0;Te<m;Te++)Q(ce,g(r.NO_STATUS));else for(se=0;se<m;se++)Te.insertAfter(g(r.NO_STATUS))}y.setRowSpan(1)}},Yt.INSERT_TABLE_COMMAND=k,Yt.TableCellHeaderStates=r,Yt.TableCellNode=c,Yt.TableNode=pe,Yt.TableRowNode=C,Yt.TableSelection=T,Yt.applyTableHandlers=function(m,y,A,Z){function ae(re){return re=m.getCordsFromCellNode(re,se.grid),m.getCellFromCordsOrThrow(re.x,re.y,se.grid)}let he=A.getRootElement();if(he===null)throw Error("No root element.");let se=new T(A,m.getKey()),Te=A._window||window;y.__lexicalTableSelection=se,y.addEventListener("mousedown",re=>{setTimeout(()=>{if(re.button===0&&Te){var te=w(re.target);te!==null&&(_e(re),se.setAnchorCellForSelection(te));var ce=()=>{Te.removeEventListener("mouseup",ce),Te.removeEventListener("mousemove",we)},we=Le=>{const Be=w(Le.target);Be===null||se.anchorX===Be.x&&se.anchorY===Be.y||(Le.preventDefault(),se.setFocusCellForSelection(Be))};Te.addEventListener("mouseup",ce),Te.addEventListener("mousemove",we)}},0)});let be=re=>{re.button===0&&A.update(()=>{const te=t.$getSelection(),ce=re.target;t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&he.contains(ce)&&se.clearHighlight()})};Te.addEventListener("mousedown",be),se.listenersToRemove.add(()=>Te.removeEventListener("mousedown",be)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_DOWN_COMMAND,re=>me(A,re,"down",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_UP_COMMAND,re=>me(A,re,"up",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_LEFT_COMMAND,re=>me(A,re,"backward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,re=>me(A,re,"forward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ESCAPE_COMMAND,re=>{var te=t.$getSelection();return t.DEPRECATED_$isGridSelection(te)&&(te=e.$findMatchingParent(te.focus.getNode(),p),p(te))?(_e(re),te.selectEnd(),!0):!1},t.COMMAND_PRIORITY_HIGH));let Ue=re=>()=>{var te=t.$getSelection();if(!ee(te,m))return!1;if(t.DEPRECATED_$isGridSelection(te))return se.clearText(),!0;if(t.$isRangeSelection(te)){const Le=e.$findMatchingParent(te.anchor.getNode(),Be=>p(Be));if(!p(Le))return!1;var ce=te.anchor.getNode(),we=te.focus.getNode();if(ce=m.isParentOf(ce),we=m.isParentOf(we),ce&&!we||we&&!ce)return se.clearText(),!0;if(ce=(we=e.$findMatchingParent(te.anchor.getNode(),Be=>t.$isElementNode(Be)))&&e.$findMatchingParent(we,Be=>t.$isElementNode(Be)&&p(Be.getParent())),!t.$isElementNode(ce)||!t.$isElementNode(we))return!1;if(re===t.DELETE_LINE_COMMAND&&ce.getPreviousSibling()===null)return!0;if((re===t.DELETE_CHARACTER_COMMAND||re===t.DELETE_WORD_COMMAND)&&te.isCollapsed()&&te.anchor.offset===0&&we!==ce){te=we.getChildren();const Be=t.$createParagraphNode();return te.forEach(Ye=>Be.append(Ye)),we.replace(Be),we.getWritable().__parent=Le.getKey(),!0}}return!1};return[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(re=>{se.listenersToRemove.add(A.registerCommand(re,Ue(re),t.COMMAND_PRIORITY_CRITICAL))}),y=re=>{const te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(re.preventDefault(),re.stopPropagation(),se.clearText(),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},se.listenersToRemove.add(A.registerCommand(t.KEY_BACKSPACE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.KEY_DELETE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.FORMAT_TEXT_COMMAND,re=>{let te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(se.formatCells(re),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var re=t.$getSelection();return ee(re,m)&&(t.DEPRECATED_$isGridSelection(re)?se.clearHighlight():t.$isRangeSelection(re)&&(re=e.$findMatchingParent(re.anchor.getNode(),te=>p(te)),p(re))),!1},t.COMMAND_PRIORITY_CRITICAL)),Z&&se.listenersToRemove.add(A.registerCommand(t.KEY_TAB_COMMAND,re=>{var te=t.$getSelection();return!t.$isRangeSelection(te)||!te.isCollapsed()||!ee(te,m)||(te=U(te.anchor.getNode()),te===null)?!1:(_e(re),te=m.getCordsFromCellNode(te,se.grid),K(se,m,te.x,te.y,re.shiftKey?"backward":"forward"),!0)},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.FOCUS_COMMAND,()=>m.isSelected(),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{let re=t.$getSelection(),te=t.$getPreviousSelection();if(t.$isRangeSelection(re)){let{anchor:Ye,focus:ct}=re;var ce=Ye.getNode(),we=ct.getNode();ce=U(ce),we=U(we);var Le=ce&&m.is(q(ce)),Be=we&&m.is(q(we));let yt=Le!==Be;Be=Le&&Be,Le=re.isBackward(),yt?(ce=re.clone(),ce.focus.set(m.getKey(),Le?0:m.getChildrenSize(),"element"),t.$setSelection(ce),W(A,se)):Be&&!ce.is(we)&&(se.setAnchorCellForSelection(ae(ce)),se.setFocusCellForSelection(ae(we),!0))}return re&&!re.is(te)&&(t.DEPRECATED_$isGridSelection(re)||t.DEPRECATED_$isGridSelection(te))&&se.gridSelection&&!se.gridSelection.is(te)?(t.DEPRECATED_$isGridSelection(re)&&re.gridKey===se.tableNodeKey?se.updateTableGridSelection(re):!t.DEPRECATED_$isGridSelection(re)&&t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&se.updateTableGridSelection(null),!1):(se.hasHijackedSelectionStyles&&!m.isSelected()?B(A,se):!se.hasHijackedSelectionStyles&&m.isSelected()&&W(A,se),!1)},t.COMMAND_PRIORITY_CRITICAL)),se},Yt.getCellFromTarget=w,Yt.getTableSelectionFromTableElement=function(m){return m.__lexicalTableSelection},Yt}var Cu,ph;function gd(){return ph||(ph=1,Cu=process.env.NODE_ENV==="development"?yC():NC()),Cu}var mh;function CC(){if(mh)return Nu;mh=1;var t=Un(),e=gd(),n=on(),r=Bt(),c=et;function d({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:C=!0}){const[S]=t.useLexicalComposerContext();return c.useEffect(()=>{if(!S.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return S.registerCommand(e.INSERT_TABLE_COMMAND,({columns:x,rows:O,includeHeaders:R})=>{const b=e.$createTableNodeWithDimensions(Number(O),Number(x),R);n.$insertNodeToNearestRoot(b);const T=b.getFirstDescendant();return r.$isTextNode(T)&&T.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[S]),c.useEffect(()=>{const x=new Map,O=b=>{const T=b.getKey(),w=S.getElementByKey(T);if(w&&!x.has(T)){const P=e.applyTableHandlers(b,w,S,C);x.set(T,P)}};S.getEditorState().read(()=>{const b=r.$nodesOfType(e.TableNode);for(const T of b)e.$isTableNode(T)&&O(T)});const R=S.registerMutationListener(e.TableNode,b=>{for(const[T,w]of b)if(w==="created")S.getEditorState().read(()=>{const P=r.$getNodeByKey(T);e.$isTableNode(P)&&O(P)});else if(w==="destroyed"){const P=x.get(T);P!==void 0&&(P.removeListeners(),x.delete(T))}});return()=>{R();for(const[,b]of x)b.removeListeners()}},[S,C]),c.useEffect(()=>{if(!g)return S.registerNodeTransform(e.TableCellNode,x=>{if(x.getColSpan()>1||x.getRowSpan()>1){const[,,O]=r.DEPRECATED_$getNodeTriplet(x),[R]=r.DEPRECATED_$computeGridMap(O,x,x),b=R.length,T=R[0].length;let w=O.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(w))throw Error("Expected TableNode first child to be a RowNode");const P=[];for(let H=0;H<b;H++){if(H!==0&&(w=w.getNextSibling(),!r.DEPRECATED_$isGridRowNode(w)))throw Error("Expected TableNode first child to be a RowNode");let $=null;for(let W=0;W<T;W++){const B=R[H][W],K=B.cell;if(B.startRow===H&&B.startColumn===W)$=K,P.push(K);else if(K.getColSpan()>1||K.getRowSpan()>1){const X=e.$createTableCellNode(K.__headerState);$!==null?$.insertAfter(X):n.$insertFirst(w,X)}}}for(const H of P)H.setColSpan(1),H.setRowSpan(1)}})},[S,g]),c.useEffect(()=>{if(!p)return S.registerNodeTransform(e.TableCellNode,x=>{x.getBackgroundColor()!==null&&x.setBackgroundColor(null)})},[S,p,g]),null}return Nu.TablePlugin=d,Nu}var Eu={},_h;function EC(){if(_h)return Eu;_h=1;var t=Un(),e=gd(),n=on(),r=Bt(),c=et;function d(g){let p=new URLSearchParams;p.append("code",g);for(let C=1;C<arguments.length;C++)p.append("v",arguments[C]);throw Error(`Minified Lexical error #${g}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Eu.TablePlugin=function({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:C=!0}){let[S]=t.useLexicalComposerContext();return c.useEffect(()=>(S.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode])||d(10),S.registerCommand(e.INSERT_TABLE_COMMAND,({columns:x,rows:O,includeHeaders:R})=>(x=e.$createTableNodeWithDimensions(Number(O),Number(x),R),n.$insertNodeToNearestRoot(x),x=x.getFirstDescendant(),r.$isTextNode(x)&&x.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[S]),c.useEffect(()=>{let x=new Map,O=b=>{const T=b.getKey(),w=S.getElementByKey(T);w&&!x.has(T)&&(b=e.applyTableHandlers(b,w,S,C),x.set(T,b))};S.getEditorState().read(()=>{let b=r.$nodesOfType(e.TableNode);for(let T of b)e.$isTableNode(T)&&O(T)});let R=S.registerMutationListener(e.TableNode,b=>{for(const[T,w]of b)w==="created"?S.getEditorState().read(()=>{const P=r.$getNodeByKey(T);e.$isTableNode(P)&&O(P)}):w==="destroyed"&&(b=x.get(T),b!==void 0&&(b.removeListeners(),x.delete(T)))});return()=>{R();for(let[,b]of x)b.removeListeners()}},[S,C]),c.useEffect(()=>{if(!g)return S.registerNodeTransform(e.TableCellNode,x=>{if(1<x.getColSpan()||1<x.getRowSpan()){var[,,O]=r.DEPRECATED_$getNodeTriplet(x);[x]=r.DEPRECATED_$computeGridMap(O,x,x);let b=x.length,T=x[0].length;if(O=O.getFirstChild(),!r.DEPRECATED_$isGridRowNode(O))throw Error("Expected TableNode first child to be a RowNode");let w=[];for(let P=0;P<b;P++){if(P!==0&&(O=O.getNextSibling(),!r.DEPRECATED_$isGridRowNode(O)))throw Error("Expected TableNode first child to be a RowNode");let H=null;for(let $=0;$<T;$++){var R=x[P][$];let W=R.cell;R.startRow===P&&R.startColumn===$?(H=W,w.push(W)):(1<W.getColSpan()||1<W.getRowSpan())&&(R=e.$createTableCellNode(W.__headerState),H!==null?H.insertAfter(R):n.$insertFirst(O,R))}}for(let P of w)P.setColSpan(1),P.setRowSpan(1)}})},[S,g]),c.useEffect(()=>{if(!p)return S.registerNodeTransform(e.TableCellNode,x=>{x.getBackgroundColor()!==null&&x.setBackgroundColor(null)})},[S,p,g]),null},Eu}const TC=process.env.NODE_ENV==="development"?CC():EC();var xC=TC,Mn={},Tu={exports:{}},yh;function yp(){return yh||(yh=1,function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
71
+ `?z.insertParagraph():me===" "?z.insertNodes([r.$createTabNode()]):z.insertText(me)}}else z.insertRawText(j)}function T(B,z,X){const ee=r.DEPRECATED_$isGridSelection(X),le=r.$isRangeSelection(X);if((ee||le&&n.$findMatchingParent(X.anchor.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null&&n.$findMatchingParent(X.focus.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null)&&z.length===1&&r.DEPRECATED_$isGridNode(z[0])){O(z,X,!1,B);return}X.insertNodes(z)}function O(B,z,X,ee){if(B.length!==1||!r.DEPRECATED_$isGridNode(B[0]))throw Error("$mergeGridNodesStrategy: Expected Grid insertion.");const le=B[0],j=le.getChildren(),U=le.getFirstChildOrThrow().getChildrenSize(),q=le.getChildrenSize(),me=n.$findMatchingParent(z.anchor.getNode(),Z=>r.DEPRECATED_$isGridCellNode(Z)),_e=me&&n.$findMatchingParent(me,Z=>r.DEPRECATED_$isGridRowNode(Z)),pe=_e&&n.$findMatchingParent(_e,Z=>r.DEPRECATED_$isGridNode(Z));if(!r.DEPRECATED_$isGridCellNode(me)||!r.DEPRECATED_$isGridRowNode(_e)||!r.DEPRECATED_$isGridNode(pe))throw Error("$mergeGridNodesStrategy: Expected selection to be inside of a Grid.");const ue=_e.getIndexWithinParent(),K=Math.min(pe.getChildrenSize()-1,ue+q-1),D=me.getIndexWithinParent(),V=Math.min(_e.getChildrenSize()-1,D+U-1),ne=Math.min(D,V),Y=Math.min(ue,K),G=Math.max(D,V),Q=Math.max(ue,K),k=pe.getChildren();let m=0,y,A;for(let Z=Y;Z<=Q;Z++){const ae=k[Z];if(!r.DEPRECATED_$isGridRowNode(ae))throw Error("getNodes: expected to find GridRowNode");const he=j[m];if(!r.DEPRECATED_$isGridRowNode(he))throw Error("getNodes: expected to find GridRowNode");const se=ae.getChildren(),Te=he.getChildren();let be=0;for(let Ue=ne;Ue<=G;Ue++){const re=se[Ue];if(!r.DEPRECATED_$isGridCellNode(re))throw Error("getNodes: expected to find GridCellNode");const te=Te[be];if(!r.DEPRECATED_$isGridCellNode(te))throw Error("getNodes: expected to find GridCellNode");Z===Y&&Ue===ne?y=re.getKey():Z===Q&&Ue===G&&(A=re.getKey());const ce=re.getChildren();te.getChildren().forEach(we=>{r.$isTextNode(we)&&r.$createParagraphNode().append(we),re.append(we)}),ce.forEach(we=>we.remove()),be++}m++}if(y&&A){const Z=r.DEPRECATED_$createGridSelection();Z.set(pe.getKey(),y,A),r.$setSelection(Z),ee.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0)}}function R(B){const z=B.exportJSON(),X=B.constructor;if(z.type!==X.getType())throw Error(`LexicalNode: Node ${X.name} does not implement .exportJSON().`);const ee=z.children;if(r.$isElementNode(B)&&!Array.isArray(ee))throw Error(`LexicalNode: Node ${X.name} is an element but .exportJSON() does not have a children array.`);return z}function b(B,z,X,ee=[]){let le=z!=null?X.isSelected(z):!0;const j=r.$isElementNode(X)&&X.excludeFromCopy("html");let U=X;if(z!==null){let _e=e.$cloneWithProperties(X);_e=r.$isTextNode(_e)&&z!=null?e.$sliceSelectedTextNodeContent(z,_e):_e,U=_e}const q=r.$isElementNode(U)?U.getChildren():[],me=R(U);if(r.$isTextNode(U)){const _e=U.__text;_e.length>0?me.text=_e:le=!1}for(let _e=0;_e<q.length;_e++){const pe=q[_e],ue=b(B,z,pe,me.children);!le&&r.$isElementNode(X)&&ue&&X.extractWithChild(pe,z,"clone")&&(le=!0)}if(le&&!j)ee.push(me);else if(Array.isArray(me.children))for(let _e=0;_e<me.children.length;_e++){const pe=me.children[_e];ee.push(pe)}return le}function x(B,z){const X=[],le=r.$getRoot().getChildren();for(let j=0;j<le.length;j++){const U=le[j];b(B,z,U,X)}return{namespace:B._config.namespace,nodes:X}}function w(B){const z=[];for(let X=0;X<B.length;X++){const ee=B[X],le=r.$parseSerializedNode(ee);r.$isTextNode(le)&&e.$addNodeStyle(le),z.push(le)}return z}const $=50;let W=null;async function P(B,z){if(W!==null)return!1;if(z!==null)return new Promise((q,me)=>{B.update(()=>{q(H(B,z))})});const X=B.getRootElement(),ee=B._window==null?window.document:B._window.document,le=d(B._window);if(X===null||le===null)return!1;const j=ee.createElement("span");j.style.cssText="position: fixed; top: -1000px;",j.append(ee.createTextNode("#")),X.append(j);const U=new Range;return U.setStart(j,0),U.setEnd(j,1),le.removeAllRanges(),le.addRange(U),new Promise((q,me)=>{const _e=B.registerCommand(r.COPY_COMMAND,pe=>(n.objectKlassEquals(pe,ClipboardEvent)&&(_e(),W!==null&&(window.clearTimeout(W),W=null),q(H(B,pe))),!0),r.COMMAND_PRIORITY_CRITICAL);W=window.setTimeout(()=>{_e(),W=null,q(!1)},$),ee.execCommand("copy"),j.remove()})}function H(B,z){const X=d(B._window);if(!X)return!1;const ee=X.anchorNode,le=X.focusNode;if(ee!==null&&le!==null&&!r.isSelectionWithinEditor(B,ee,le))return!1;z.preventDefault();const j=z.clipboardData,U=r.$getSelection();if(j===null||U===null)return!1;const q=g(B),me=p(B);let _e="";return U!==null&&(_e=U.getTextContent()),q!==null&&j.setData("text/html",q),me!==null&&j.setData("application/x-lexical-editor",me),j.setData("text/plain",_e),!0}return Li.$generateJSONFromSelectedNodes=x,Li.$generateNodesFromSerializedNodes=w,Li.$getHtmlContent=g,Li.$getLexicalContent=p,Li.$insertDataTransferForPlainText=C,Li.$insertDataTransferForRichText=S,Li.$insertGeneratedNodes=T,Li.copyToClipboard=P,Li}var ki={},qf;function UN(){if(qf)return ki;qf=1;var t=Np(),e=Ao(),n=on(),r=Bt();function c(w){let $=new URLSearchParams;$.append("code",w);for(let W=1;W<arguments.length;W++)$.append("v",arguments[W]);throw Error(`Minified Lexical error #${w}; visit https://lexical.dev/docs/error?${$} 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(w){let $=r.$getSelection();if($==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection($)&&$.isCollapsed()||$.getNodes().length===0?"":t.$generateHtmlFromNodes(w,$)}function p(w){let $=r.$getSelection();if($==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection($)&&$.isCollapsed()||$.getNodes().length===0?null:JSON.stringify(O(w,$))}function C(w,$,W){let P=r.DEPRECATED_$isGridSelection(W),H=r.$isRangeSelection(W);(P||H&&n.$findMatchingParent(W.anchor.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null&&n.$findMatchingParent(W.focus.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null)&&$.length===1&&r.DEPRECATED_$isGridNode($[0])?S($,W,!1,w):W.insertNodes($)}function S(w,$,W,P){w.length===1&&r.DEPRECATED_$isGridNode(w[0])||c(42);var H=w[0];w=H.getChildren(),W=H.getFirstChildOrThrow().getChildrenSize();var B=H.getChildrenSize(),z=n.$findMatchingParent($.anchor.getNode(),me=>r.DEPRECATED_$isGridCellNode(me));$=(H=z&&n.$findMatchingParent(z,me=>r.DEPRECATED_$isGridRowNode(me)))&&n.$findMatchingParent(H,me=>r.DEPRECATED_$isGridNode(me)),r.DEPRECATED_$isGridCellNode(z)&&r.DEPRECATED_$isGridRowNode(H)&&r.DEPRECATED_$isGridNode($)||c(43);var X=H.getIndexWithinParent(),ee=Math.min($.getChildrenSize()-1,X+B-1);B=z.getIndexWithinParent(),z=Math.min(H.getChildrenSize()-1,B+W-1),W=Math.min(B,z),H=Math.min(X,ee),B=Math.max(B,z),X=Math.max(X,ee),ee=$.getChildren(),z=0;let le,j;for(let me=H;me<=X;me++){var U=ee[me];r.DEPRECATED_$isGridRowNode(U)||c(24);var q=w[z];r.DEPRECATED_$isGridRowNode(q)||c(24),U=U.getChildren(),q=q.getChildren();let _e=0;for(let pe=W;pe<=B;pe++){let ue=U[pe];r.DEPRECATED_$isGridCellNode(ue)||c(25);let K=q[_e];r.DEPRECATED_$isGridCellNode(K)||c(25),me===H&&pe===W?le=ue.getKey():me===X&&pe===B&&(j=ue.getKey());let D=ue.getChildren();K.getChildren().forEach(V=>{r.$isTextNode(V)&&r.$createParagraphNode().append(V),ue.append(V)}),D.forEach(V=>V.remove()),_e++}z++}le&&j&&(w=r.DEPRECATED_$createGridSelection(),w.set($.getKey(),le,j),r.$setSelection(w),P.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0))}function T(w,$,W,P=[]){let H=$!=null?W.isSelected($):!0,B=r.$isElementNode(W)&&W.excludeFromCopy("html");var z=W;if($!==null){var X=e.$cloneWithProperties(W);z=X=r.$isTextNode(X)&&$!=null?e.$sliceSelectedTextNodeContent($,X):X}let ee=r.$isElementNode(z)?z.getChildren():[];var le=z;X=le.exportJSON();var j=le.constructor;X.type!==j.getType()&&c(58,j.name);let U=X.children;for(r.$isElementNode(le)&&(Array.isArray(U)||c(59,j.name)),r.$isTextNode(z)&&(z=z.__text,0<z.length?X.text=z:H=!1),z=0;z<ee.length;z++)le=ee[z],j=T(w,$,le,X.children),!H&&r.$isElementNode(W)&&j&&W.extractWithChild(le,$,"clone")&&(H=!0);if(H&&!B)P.push(X);else if(Array.isArray(X.children))for(w=0;w<X.children.length;w++)P.push(X.children[w]);return H}function O(w,$){let W=[],P=r.$getRoot().getChildren();for(let H=0;H<P.length;H++)T(w,$,P[H],W);return{namespace:w._config.namespace,nodes:W}}function R(w){let $=[];for(let W=0;W<w.length;W++){let P=r.$parseSerializedNode(w[W]);r.$isTextNode(P)&&e.$addNodeStyle(P),$.push(P)}return $}let b=null;function x(w,$){var W=d?(w._window||window).getSelection():null;if(!W)return!1;var P=W.anchorNode;if(W=W.focusNode,P!==null&&W!==null&&!r.isSelectionWithinEditor(w,P,W)||($.preventDefault(),$=$.clipboardData,P=r.$getSelection(),$===null||P===null))return!1;W=g(w),w=p(w);let H="";return P!==null&&(H=P.getTextContent()),W!==null&&$.setData("text/html",W),w!==null&&$.setData("application/x-lexical-editor",w),$.setData("text/plain",H),!0}return ki.$generateJSONFromSelectedNodes=O,ki.$generateNodesFromSerializedNodes=R,ki.$getHtmlContent=g,ki.$getLexicalContent=p,ki.$insertDataTransferForPlainText=function(w,$){w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null&&$.insertRawText(w)},ki.$insertDataTransferForRichText=function(w,$,W){var P=w.getData("application/x-lexical-editor");if(P)try{let B=JSON.parse(P);if(B.namespace===W._config.namespace&&Array.isArray(B.nodes)){let z=R(B.nodes);return C(W,z,$)}}catch{}if(P=w.getData("text/html"))try{var H=new DOMParser().parseFromString(P,"text/html");let B=t.$generateNodesFromDOM(W,H);return C(W,B,$)}catch{}if(w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null)if(r.$isRangeSelection($))for(w=w.split(/(\r?\n|\t)/),w[w.length-1]===""&&w.pop(),W=0;W<w.length;W++)H=w[W],H===`
72
+ `||H===`\r
73
+ `?$.insertParagraph():H===" "?$.insertNodes([r.$createTabNode()]):$.insertText(H);else $.insertRawText(w)},ki.$insertGeneratedNodes=C,ki.copyToClipboard=async function(w,$){if(b!==null)return!1;if($!==null)return new Promise(z=>{w.update(()=>{z(x(w,$))})});var W=w.getRootElement();let P=w._window==null?window.document:w._window.document,H=d?(w._window||window).getSelection():null;if(W===null||H===null)return!1;let B=P.createElement("span");return B.style.cssText="position: fixed; top: -1000px;",B.append(P.createTextNode("#")),W.append(B),W=new Range,W.setStart(B,0),W.setEnd(B,1),H.removeAllRanges(),H.addRange(W),new Promise(z=>{let X=w.registerCommand(r.COPY_COMMAND,ee=>(n.objectKlassEquals(ee,ClipboardEvent)&&(X(),b!==null&&(window.clearTimeout(b),b=null),z(x(w,ee))),!0),r.COMMAND_PRIORITY_CRITICAL);b=window.setTimeout(()=>{X(),b=null,z(!1)},50),P.execCommand("copy"),B.remove()})},ki}var lu,Zf;function Cp(){return Zf||(Zf=1,lu=process.env.NODE_ENV==="development"?zN():UN()),lu}var Jf;function GN(){if(Jf)return ci;Jf=1;var t=Cp(),e=Ao(),n=on(),r=Bt();function c(_e,pe){if(typeof document.caretRangeFromPoint<"u"){const ue=document.caretRangeFromPoint(_e,pe);return ue===null?null:{node:ue.startContainer,offset:ue.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const ue=document.caretPositionFromPoint(_e,pe);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,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,C=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),S=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,R=r.createCommand("DRAG_DROP_PASTE_FILE");class b extends r.ElementNode{static getType(){return"quote"}static clone(pe){return new b(pe.__key)}constructor(pe){super(pe)}createDOM(pe){const ue=document.createElement("blockquote");return n.addClassNamesToElement(ue,pe.theme.quote),ue}updateDOM(pe,ue){return!1}static importDOM(){return{blockquote:pe=>({conversion:H,priority:0})}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const K=this.getFormatType();ue.style.textAlign=K;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=x();return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(pe,ue){const K=r.$createParagraphNode(),D=this.getDirection();return K.setDirection(D),this.insertAfter(K,ue),K}collapseAtStart(){const pe=r.$createParagraphNode();return this.getChildren().forEach(K=>pe.append(K)),this.replace(pe),!0}}function x(){return r.$applyNodeReplacement(new b)}function w(_e){return _e instanceof b}class $ extends r.ElementNode{static getType(){return"heading"}static clone(pe){return new $(pe.__tag,pe.__key)}constructor(pe,ue){super(ue),this.__tag=pe}getTag(){return this.__tag}createDOM(pe){const ue=this.__tag,K=document.createElement(ue),V=pe.theme.heading;if(V!==void 0){const ne=V[ue];n.addClassNamesToElement(K,ne)}return K}updateDOM(pe,ue){return!1}static importDOM(){return{h1:pe=>({conversion:P,priority:0}),h2:pe=>({conversion:P,priority:0}),h3:pe=>({conversion:P,priority:0}),h4:pe=>({conversion:P,priority:0}),h5:pe=>({conversion:P,priority:0}),h6:pe=>({conversion:P,priority:0}),p:pe=>{const K=pe.firstChild;return K!==null&&W(K)?{conversion:()=>({node:null}),priority:3}:null},span:pe=>W(pe)?{conversion:ue=>({node:B("h1")}),priority:3}:null}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const K=this.getFormatType();ue.style.textAlign=K;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=B(pe.tag);return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(pe,ue=!0){const K=pe?pe.anchor.offset:0,D=K===this.getTextContentSize()||!pe?r.$createParagraphNode():B(this.getTag()),V=this.getDirection();if(D.setDirection(V),this.insertAfter(D,ue),K===0&&!this.isEmpty()&&pe){const ne=r.$createParagraphNode();ne.select(),this.replace(ne,!0)}return D}collapseAtStart(){const pe=this.isEmpty()?r.$createParagraphNode():B(this.getTag());return this.getChildren().forEach(K=>pe.append(K)),this.replace(pe),!0}extractWithChild(){return!0}}function W(_e){return _e.nodeName.toLowerCase()==="span"?_e.style.fontSize==="26pt":!1}function P(_e){const pe=_e.nodeName.toLowerCase();let ue=null;return(pe==="h1"||pe==="h2"||pe==="h3"||pe==="h4"||pe==="h5"||pe==="h6")&&(ue=B(pe),_e.style!==null&&ue.setFormat(_e.style.textAlign)),{node:ue}}function H(_e){const pe=x();return _e.style!==null&&pe.setFormat(_e.style.textAlign),{node:pe}}function B(_e){return r.$applyNodeReplacement(new $(_e))}function z(_e){return _e instanceof $}function X(_e,pe){_e.preventDefault(),pe.update(()=>{const ue=r.$getSelection(),K=_e instanceof InputEvent||_e instanceof KeyboardEvent?null:_e.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(ue)&&t.$insertDataTransferForRichText(K,ue,pe)},{tag:"paste"})}async function ee(_e,pe){await t.copyToClipboard(pe,n.objectKlassEquals(_e,ClipboardEvent)?_e:null),pe.update(()=>{const ue=r.$getSelection();r.$isRangeSelection(ue)?ue.removeText():r.$isNodeSelection(ue)&&ue.getNodes().forEach(K=>K.remove())})}function le(_e){let pe=null;if(_e instanceof DragEvent?pe=_e.dataTransfer:_e instanceof ClipboardEvent&&(pe=_e.clipboardData),pe===null)return[!1,[],!1];const ue=pe.types,K=ue.includes("Files"),D=ue.includes("text/html")||ue.includes("text/plain");return[K,Array.from(pe.files),D]}function j(_e){const pe=r.$getSelection();if(!r.$isRangeSelection(pe))return!1;const ue=new Set,K=pe.getNodes();for(let D=0;D<K.length;D++){const V=K[D],ne=V.getKey();if(ue.has(ne))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(V),G=Y.getKey();Y.canIndent()&&!ue.has(G)&&(ue.add(G),_e(Y))}return ue.size>0}function U(_e){const pe=r.$getNearestNodeFromDOMNode(_e);return r.$isDecoratorNode(pe)}function q(_e){const pe=_e.focus;return pe.key==="root"&&pe.offset===r.$getRoot().getChildrenSize()}function me(_e){return n.mergeRegister(_e.registerCommand(r.CLICK_COMMAND,ue=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),_e.registerCommand(r.DELETE_CHARACTER_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_WORD_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_LINE_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,ue=>{const K=r.$getSelection();if(typeof ue=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(ue);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const D=ue.dataTransfer;if(D!=null)t.$insertDataTransferForRichText(D,K,_e);else if(r.$isRangeSelection(K)){const V=ue.data;return V&&K.insertText(V),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_TEXT_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_ELEMENT_COMMAND,ue=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const D=K.getNodes();for(const V of D){const ne=n.$findMatchingParent(V,Y=>r.$isElementNode(Y)&&!Y.isInline());ne!==null&&ne.setFormat(ue)}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_LINE_BREAK_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INDENT_CONTENT_COMMAND,()=>j(ue=>{const K=ue.getIndent();ue.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>j(ue=>{const K=ue.getIndent();K>0&&ue.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_UP_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!U(ue.target)){const D=K.getNodes();if(D.length>0)return D[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const D=r.$getAdjacentNode(K.focus,!0);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectPrevious(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_DOWN_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return D[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return ue.preventDefault(),!0;const D=r.$getAdjacentNode(K.focus,!1);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectNext(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_LEFT_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return ue.preventDefault(),D[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(e.$shouldOverrideDefaultCharacterSelection(K,!0)){const D=ue.shiftKey;return ue.preventDefault(),e.$moveCharacter(K,D,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!U(ue.target)){const V=K.getNodes();if(V.length>0)return ue.preventDefault(),V[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const D=ue.shiftKey;return e.$shouldOverrideDefaultCharacterSelection(K,!1)?(ue.preventDefault(),e.$moveCharacter(K,D,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_BACKSPACE_COMMAND,ue=>{if(U(ue.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;ue.preventDefault();const{anchor:D}=K,V=D.getNode();return K.isCollapsed()&&D.offset===0&&!r.$isRootNode(V)&&n.$getNearestBlockElementAncestorOrThrow(V).getIndent()>0?_e.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_DELETE_COMMAND,ue=>{if(U(ue.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(ue.preventDefault(),_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ENTER_COMMAND,ue=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(ue!==null){if((S||C||O)&&p)return!1;if(ue.preventDefault(),ue.shiftKey)return _e.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return _e.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(_e.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DROP_COMMAND,ue=>{const[,K]=le(ue);if(K.length>0){const V=ue.clientX,ne=ue.clientY,Y=c(V,ne);if(Y!==null){const{offset:G,node:Q}=Y,k=r.$getNearestNodeFromDOMNode(Q);if(k!==null){const m=r.$createRangeSelection();if(r.$isTextNode(k))m.anchor.set(k.getKey(),G,"text"),m.focus.set(k.getKey(),G,"text");else{const A=k.getParentOrThrow().getKey(),Z=k.getIndexWithinParent()+1;m.anchor.set(A,Z,"element"),m.focus.set(A,Z,"element")}const y=r.$normalizeSelection__EXPERIMENTAL(m);r.$setSelection(y)}_e.dispatchCommand(R,K)}return ue.preventDefault(),!0}const D=r.$getSelection();return!!r.$isRangeSelection(D)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGSTART_COMMAND,ue=>{const[K]=le(ue),D=r.$getSelection();return!(K&&!r.$isRangeSelection(D))},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGOVER_COMMAND,ue=>{const[K]=le(ue),D=r.$getSelection();if(K&&!r.$isRangeSelection(D))return!1;const V=ue.clientX,ne=ue.clientY,Y=c(V,ne);if(Y!==null){const G=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(G)&&ue.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.COPY_COMMAND,ue=>(t.copyToClipboard(_e,n.objectKlassEquals(ue,ClipboardEvent)?ue:null),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CUT_COMMAND,ue=>(ee(ue,_e),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.PASTE_COMMAND,ue=>{const[,K,D]=le(ue);if(K.length>0&&!D)return _e.dispatchCommand(R,K),!0;if(r.isSelectionCapturedInDecoratorInput(ue.target))return!1;const V=r.$getSelection();return r.$INTERNAL_isPointSelection(V)?(X(ue,_e),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ci.$createHeadingNode=B,ci.$createQuoteNode=x,ci.$isHeadingNode=z,ci.$isQuoteNode=w,ci.DRAG_DROP_PASTE=R,ci.HeadingNode=$,ci.QuoteNode=b,ci.eventFiles=le,ci.registerRichText=me,ci}var ui={},Xf;function YN(){if(Xf)return ui;Xf=1;var t=Cp(),e=Ao(),n=on(),r=Bt();function c(j,U){return typeof document.caretRangeFromPoint<"u"?(j=document.caretRangeFromPoint(j,U),j===null?null:{node:j.startContainer,offset:j.startOffset}):document.caretPositionFromPoint!=="undefined"?(j=document.caretPositionFromPoint(j,U),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,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,C=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),S=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,R=r.createCommand("DRAG_DROP_PASTE_FILE");class b extends r.ElementNode{static getType(){return"quote"}static clone(U){return new b(U.__key)}constructor(U){super(U)}createDOM(U){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,U.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:P,priority:0})}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=x();return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(U,q){U=r.$createParagraphNode();let me=this.getDirection();return U.setDirection(me),this.insertAfter(U,q),U}collapseAtStart(){let U=r.$createParagraphNode();return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}}function x(){return r.$applyNodeReplacement(new b)}class w extends r.ElementNode{static getType(){return"heading"}static clone(U){return new w(U.__tag,U.__key)}constructor(U,q){super(q),this.__tag=U}getTag(){return this.__tag}createDOM(U){let q=this.__tag,me=document.createElement(q);return U=U.theme.heading,U!==void 0&&n.addClassNamesToElement(me,U[q]),me}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:W,priority:0}),h2:()=>({conversion:W,priority:0}),h3:()=>({conversion:W,priority:0}),h4:()=>({conversion:W,priority:0}),h5:()=>({conversion:W,priority:0}),h6:()=>({conversion:W,priority:0}),p:U=>(U=U.firstChild,U!==null&&$(U)?{conversion:()=>({node:null}),priority:3}:null),span:U=>$(U)?{conversion:()=>({node:H("h1")}),priority:3}:null}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=H(U.tag);return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(U,q=!0){let me=U?U.anchor.offset:0,_e=me!==this.getTextContentSize()&&U?H(this.getTag()):r.$createParagraphNode(),pe=this.getDirection();return _e.setDirection(pe),this.insertAfter(_e,q),me===0&&!this.isEmpty()&&U&&(U=r.$createParagraphNode(),U.select(),this.replace(U,!0)),_e}collapseAtStart(){let U=this.isEmpty()?r.$createParagraphNode():H(this.getTag());return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}extractWithChild(){return!0}}function $(j){return j.nodeName.toLowerCase()==="span"?j.style.fontSize==="26pt":!1}function W(j){let U=j.nodeName.toLowerCase(),q=null;return(U==="h1"||U==="h2"||U==="h3"||U==="h4"||U==="h5"||U==="h6")&&(q=H(U),j.style!==null&&q.setFormat(j.style.textAlign)),{node:q}}function P(j){let U=x();return j.style!==null&&U.setFormat(j.style.textAlign),{node:U}}function H(j){return r.$applyNodeReplacement(new w(j))}function B(j,U){j.preventDefault(),U.update(()=>{let q=r.$getSelection(),me=j instanceof InputEvent||j instanceof KeyboardEvent?null:j.clipboardData;me!=null&&r.$INTERNAL_isPointSelection(q)&&t.$insertDataTransferForRichText(me,q,U)},{tag:"paste"})}async function z(j,U){await t.copyToClipboard(U,n.objectKlassEquals(j,ClipboardEvent)?j:null),U.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(me=>me.remove())})}function X(j){let U=null;if(j instanceof DragEvent?U=j.dataTransfer:j instanceof ClipboardEvent&&(U=j.clipboardData),U===null)return[!1,[],!1];var q=U.types;return j=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[j,Array.from(U.files),q]}function ee(j){var U=r.$getSelection();if(!r.$isRangeSelection(U))return!1;let q=new Set;U=U.getNodes();for(let pe=0;pe<U.length;pe++){var me=U[pe],_e=me.getKey();q.has(_e)||(me=n.$getNearestBlockElementAncestorOrThrow(me),_e=me.getKey(),me.canIndent()&&!q.has(_e)&&(q.add(_e),j(me)))}return 0<q.size}function le(j){return j=r.$getNearestNodeFromDOMNode(j),r.$isDecoratorNode(j)}return ui.$createHeadingNode=H,ui.$createQuoteNode=x,ui.$isHeadingNode=function(j){return j instanceof w},ui.$isQuoteNode=function(j){return j instanceof b},ui.DRAG_DROP_PASTE=R,ui.HeadingNode=w,ui.QuoteNode=b,ui.eventFiles=X,ui.registerRichText=function(j){return n.mergeRegister(j.registerCommand(r.CLICK_COMMAND,()=>{const U=r.$getSelection();return r.$isNodeSelection(U)?(U.clear(),!0):!1},0),j.registerCommand(r.DELETE_CHARACTER_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_WORD_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_LINE_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,U=>{const q=r.$getSelection();if(typeof U=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(U);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const me=U.dataTransfer;me!=null?t.$insertDataTransferForRichText(me,q,j):r.$isRangeSelection(q)&&(U=U.data)&&q.insertText(U)}return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_TEXT_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_ELEMENT_COMMAND,U=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const me of q)q=n.$findMatchingParent(me,_e=>r.$isElementNode(_e)&&!_e.isInline()),q!==null&&q.setFormat(U);return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_LINE_BREAK_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.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,()=>ee(U=>{const q=U.getIndent();U.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>ee(U=>{const q=U.getIndent();0<q&&U.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_UP_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){if(U=q.getNodes(),0<U.length)return U[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),U.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_DOWN_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(U=q.getNodes(),0<U.length)return U[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let me=q.focus;if(me.key==="root"&&me.offset===r.$getRoot().getChildrenSize())return U.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),U.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_LEFT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&e.$shouldOverrideDefaultCharacterSelection(q,!0)?(me=U.shiftKey,U.preventDefault(),e.$moveCharacter(q,me,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(me=U.shiftKey,e.$shouldOverrideDefaultCharacterSelection(q,!1)?(U.preventDefault(),e.$moveCharacter(q,me,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_BACKSPACE_COMMAND,U=>{if(le(U.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;U.preventDefault(),{anchor:U}=q;const me=U.getNode();return q.isCollapsed()&&U.offset===0&&!r.$isRootNode(me)&&0<n.$getNearestBlockElementAncestorOrThrow(me).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,U=>{if(le(U.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(U.preventDefault(),j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ENTER_COMMAND,U=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(U!==null){if((S||C||O)&&p)return!1;if(U.preventDefault(),U.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 U=r.$getSelection();return r.$isRangeSelection(U)?(j.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DROP_COMMAND,U=>{const[,q]=X(U);if(0<q.length){var me=c(U.clientX,U.clientY);if(me!==null){const{offset:pe,node:ue}=me;var _e=r.$getNearestNodeFromDOMNode(ue);if(_e!==null){if(me=r.$createRangeSelection(),r.$isTextNode(_e))me.anchor.set(_e.getKey(),pe,"text"),me.focus.set(_e.getKey(),pe,"text");else{const K=_e.getParentOrThrow().getKey();_e=_e.getIndexWithinParent()+1,me.anchor.set(K,_e,"element"),me.focus.set(K,_e,"element")}me=r.$normalizeSelection__EXPERIMENTAL(me),r.$setSelection(me)}j.dispatchCommand(R,q)}return U.preventDefault(),!0}return U=r.$getSelection(),!!r.$isRangeSelection(U)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGSTART_COMMAND,U=>{[U]=X(U);const q=r.$getSelection();return!(U&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGOVER_COMMAND,U=>{var[q]=X(U);const me=r.$getSelection();return q&&!r.$isRangeSelection(me)?!1:(q=c(U.clientX,U.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&U.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.COPY_COMMAND,U=>(t.copyToClipboard(j,n.objectKlassEquals(U,ClipboardEvent)?U:null),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CUT_COMMAND,U=>(z(U,j),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.PASTE_COMMAND,U=>{const[,q,me]=X(U);if(0<q.length&&!me)return j.dispatchCommand(R,q),!0;if(r.isSelectionCapturedInDecoratorInput(U.target))return!1;const _e=r.$getSelection();return r.$INTERNAL_isPointSelection(_e)?(B(U,j),!0):!1},r.COMMAND_PRIORITY_EDITOR))},ui}var au,Qf;function fd(){return Qf||(Qf=1,au=process.env.NODE_ENV==="development"?GN():YN()),au}var eh;function jN(){if(eh)return Zc;eh=1;var t=Un(),e=mp(),n=et,r=_p(),c=on(),d=rd,g=yp(),p=fd(),T=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function O(W){return W.getEditorState().read(r.$canShowPlaceholderCurry(W.isComposing()))}function R(W){const[P,H]=n.useState(()=>O(W));return T(()=>{function B(){const z=O(W);H(z)}return B(),c.mergeRegister(W.registerUpdateListener(()=>{B()}),W.registerEditableListener(()=>{B()}))},[W]),P}function b(W,P){const[H,B]=n.useState(()=>W.getDecorators());return T(()=>W.registerDecoratorListener(z=>{d.flushSync(()=>{B(z)})}),[W]),n.useEffect(()=>{B(W.getDecorators())},[W]),n.useMemo(()=>{const z=[],X=Object.keys(H);for(let ee=0;ee<X.length;ee++){const le=X[ee],j=n.createElement(P,{onError:q=>W._onError(q)},n.createElement(n.Suspense,{fallback:null},H[le])),U=W.getElementByKey(le);U!==null&&z.push(d.createPortal(j,U,le))}return z},[P,H,W])}function x(W){T(()=>c.mergeRegister(p.registerRichText(W),g.registerDragonSupport(W)),[W])}function w({contentEditable:W,placeholder:P,ErrorBoundary:H}){const[B]=t.useLexicalComposerContext(),z=b(B,H);return x(B),n.createElement(n.Fragment,null,W,n.createElement($,{content:P}),z)}function $({content:W}){const[P]=t.useLexicalComposerContext(),H=R(P),B=e();return H?typeof W=="function"?W(B):W:null}return Zc.RichTextPlugin=w,Zc}var cu={},th;function VN(){if(th)return cu;th=1;var t=Un(),e=mp(),n=et,r=_p(),c=on(),d=rd,g=yp(),p=fd(),C=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function S(x){return x.getEditorState().read(r.$canShowPlaceholderCurry(x.isComposing()))}function T(x){let[w,$]=n.useState(()=>S(x));return C(()=>{function W(){let P=S(x);$(P)}return W(),c.mergeRegister(x.registerUpdateListener(()=>{W()}),x.registerEditableListener(()=>{W()}))},[x]),w}function O(x,w){let[$,W]=n.useState(()=>x.getDecorators());return C(()=>x.registerDecoratorListener(P=>{d.flushSync(()=>{W(P)})}),[x]),n.useEffect(()=>{W(x.getDecorators())},[x]),n.useMemo(()=>{let P=[],H=Object.keys($);for(let B=0;B<H.length;B++){let z=H[B],X=n.createElement(w,{onError:le=>x._onError(le)},n.createElement(n.Suspense,{fallback:null},$[z])),ee=x.getElementByKey(z);ee!==null&&P.push(d.createPortal(X,ee,z))}return P},[w,$,x])}function R(x){C(()=>c.mergeRegister(p.registerRichText(x),g.registerDragonSupport(x)),[x])}function b({content:x}){var[w]=t.useLexicalComposerContext();w=T(w);let $=e();return w?typeof x=="function"?x($):x:null}return cu.RichTextPlugin=function({contentEditable:x,placeholder:w,ErrorBoundary:$}){let[W]=t.useLexicalComposerContext();return $=O(W,$),R(W),n.createElement(n.Fragment,null,x,n.createElement(b,{content:w}),$)},cu}const qN=process.env.NODE_ENV==="development"?jN():VN();var ZN=qN,uu={},nh;function JN(){if(nh)return uu;nh=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var C=1;C<arguments.length;C++){var S=arguments[C];for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(p[T]=S[T])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function g({ariaActiveDescendant:p,ariaAutoComplete:C,ariaControls:S,ariaDescribedBy:T,ariaExpanded:O,ariaLabel:R,ariaLabelledBy:b,ariaMultiline:x,ariaOwns:w,ariaRequired:$,autoCapitalize:W,className:P,id:H,role:B="textbox",spellCheck:z=!0,style:X,tabIndex:ee,"data-testid":le,...j}){const[U]=t.useLexicalComposerContext(),[q,me]=e.useState(!1),_e=e.useCallback(pe=>{U.setRootElement(pe)},[U]);return d(()=>(me(U.isEditable()),U.registerEditableListener(pe=>{me(pe)})),[U]),e.createElement("div",n({},j,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?C:"none","aria-controls":q?S:void 0,"aria-describedby":T,"aria-expanded":q&&B==="combobox"?!!O:void 0,"aria-label":R,"aria-labelledby":b,"aria-multiline":x,"aria-owns":q?w:void 0,"aria-readonly":q?void 0:!0,"aria-required":$,autoCapitalize:W,className:P,contentEditable:q,"data-testid":le,id:H,ref:_e,role:B,spellCheck:z,style:X,tabIndex:ee}))}return uu.ContentEditable=g,uu}var du={},rh;function XN(){if(rh)return du;rh=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(c){for(var d=1;d<arguments.length;d++){var g=arguments[d],p;for(p in g)Object.prototype.hasOwnProperty.call(g,p)&&(c[p]=g[p])}return c},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;return du.ContentEditable=function({ariaActiveDescendant:c,ariaAutoComplete:d,ariaControls:g,ariaDescribedBy:p,ariaExpanded:C,ariaLabel:S,ariaLabelledBy:T,ariaMultiline:O,ariaOwns:R,ariaRequired:b,autoCapitalize:x,className:w,id:$,role:W="textbox",spellCheck:P=!0,style:H,tabIndex:B,"data-testid":z,...X}){let[ee]=t.useLexicalComposerContext(),[le,j]=e.useState(!1),U=e.useCallback(q=>{ee.setRootElement(q)},[ee]);return r(()=>(j(ee.isEditable()),ee.registerEditableListener(q=>{j(q)})),[ee]),e.createElement("div",n({},X,{"aria-activedescendant":le?c:void 0,"aria-autocomplete":le?d:"none","aria-controls":le?g:void 0,"aria-describedby":p,"aria-expanded":le&&W==="combobox"?!!C:void 0,"aria-label":S,"aria-labelledby":T,"aria-multiline":O,"aria-owns":le?R:void 0,"aria-readonly":le?void 0:!0,"aria-required":b,autoCapitalize:x,className:w,contentEditable:le,"data-testid":z,id:$,ref:U,role:W,spellCheck:P,style:H,tabIndex:B}))},du}const QN=process.env.NODE_ENV==="development"?JN():XN();var eC=QN,fu,ih;function tC(){if(ih)return fu;ih=1;var t=et;function e(p,C){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,O){return T.__proto__=O,T},e(p,C)}function n(p,C){p.prototype=Object.create(C.prototype),p.prototype.constructor=p,e(p,C)}var r=function(C,S){return C===void 0&&(C=[]),S===void 0&&(S=[]),C.length!==S.length||C.some(function(T,O){return!Object.is(T,S[O])})},c={error:null},d=function(p){n(C,p);function C(){for(var T,O=arguments.length,R=new Array(O),b=0;b<O;b++)R[b]=arguments[b];return T=p.call.apply(p,[this].concat(R))||this,T.state=c,T.resetErrorBoundary=function(){for(var x,w=arguments.length,$=new Array(w),W=0;W<w;W++)$[W]=arguments[W];T.props.onReset==null||(x=T.props).onReset.apply(x,$),T.reset()},T}C.getDerivedStateFromError=function(O){return{error:O}};var S=C.prototype;return S.reset=function(){this.setState(c)},S.componentDidCatch=function(O,R){var b,x;(b=(x=this.props).onError)==null||b.call(x,O,R)},S.componentDidUpdate=function(O,R){var b=this.state.error,x=this.props.resetKeys;if(b!==null&&R.error!==null&&r(O.resetKeys,x)){var w,$;(w=($=this.props).onResetKeysChange)==null||w.call($,O.resetKeys,x),this.reset()}},S.render=function(){var O=this.state.error,R=this.props,b=R.fallbackRender,x=R.FallbackComponent,w=R.fallback;if(O!==null){var $={error:O,resetErrorBoundary:this.resetErrorBoundary};if(t.isValidElement(w))return w;if(typeof b=="function")return b($);if(x)return t.createElement(x,$);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},C}(t.Component);function g({children:p,onError:C}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:C},p)}return fu=g,fu}var hu,oh;function nC(){if(oh)return hu;oh=1;var t=et;function e(g,p){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,S){return C.__proto__=S,C},e(g,p)}function n(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,e(g,p)}function r(g,p){return g===void 0&&(g=[]),p===void 0&&(p=[]),g.length!==p.length||g.some(function(C,S){return!Object.is(C,p[S])})}var c={error:null},d=function(g){function p(){for(var S,T=arguments.length,O=Array(T),R=0;R<T;R++)O[R]=arguments[R];return S=g.call.apply(g,[this].concat(O))||this,S.state=c,S.resetErrorBoundary=function(){for(var b,x=arguments.length,w=Array(x),$=0;$<x;$++)w[$]=arguments[$];S.props.onReset==null||(b=S.props).onReset.apply(b,w),S.reset()},S}n(p,g),p.getDerivedStateFromError=function(S){return{error:S}};var C=p.prototype;return C.reset=function(){this.setState(c)},C.componentDidCatch=function(S,T){var O,R;(O=(R=this.props).onError)==null||O.call(R,S,T)},C.componentDidUpdate=function(S,T){var O=this.props.resetKeys;if(this.state.error!==null&&T.error!==null&&r(S.resetKeys,O)){var R,b;(R=(b=this.props).onResetKeysChange)==null||R.call(b,S.resetKeys,O),this.reset()}},C.render=function(){var S=this.state.error,T=this.props,O=T.fallbackRender,R=T.FallbackComponent;if(T=T.fallback,S!==null){if(S={error:S,resetErrorBoundary:this.resetErrorBoundary},t.isValidElement(T))return T;if(typeof O=="function")return O(S);if(R)return t.createElement(R,S);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(t.Component);return hu=function({children:g,onError:p}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},g)},hu}const rC=process.env.NODE_ENV==="development"?tC():nC();var iC=rC;const oC=id(iC);var gu={},rr={},sh;function sC(){if(sh)return rr;sh=1;var t=Bt(),e=on();function n(Y){let G=1,Q=Y.getParent();for(;Q!=null;){if(le(Q)){const k=Q.getParent();if(ue(k)){G++,Q=k.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return G}return G}function r(Y){let G=Y.getParent();if(!ue(G))throw Error("A ListItemNode must have a ListNode for a parent.");let Q=G;for(;Q!==null;)Q=Q.getParent(),ue(Q)&&(G=Q);return G}function c(Y){let G=[];const Q=Y.getChildren().filter(le);for(let k=0;k<Q.length;k++){const m=Q[k],y=m.getFirstChild();ue(y)?G=G.concat(c(y)):G.push(m)}return G}function d(Y){return le(Y)&&ue(Y.getFirstChild())}function g(Y){let G=Y;for(;G.getNextSibling()==null&&G.getPreviousSibling()==null;){const Q=G.getParent();if(Q==null||!(le(G)||ue(G)))break;G=Q}G.remove()}function p(Y){return ee().append(Y)}function C(Y,G){return le(Y)&&(G.length===0||G.length===1&&Y.is(G[0])&&Y.getChildrenSize()===0)}function S(Y){const G=Y.getParent();let Q=1;if(G!=null)if(ue(G))Q=G.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const k=Y.getPreviousSiblings();for(let m=0;m<k.length;m++){const y=k[m];le(y)&&!ue(y.getFirstChild())&&Q++}return Q}function T(Y,G){Y.update(()=>{const Q=t.$getSelection();if(t.$INTERNAL_isPointSelection(Q)){const k=Q.getNodes(),y=Q.anchor.getNode(),A=y.getParent();if(C(y,k)){const Z=pe(G);if(t.$isRootOrShadowRoot(A)){y.replace(Z);const ae=ee();t.$isElementNode(y)&&(ae.setFormat(y.getFormatType()),ae.setIndent(y.getIndent())),Z.append(ae)}else if(le(y)){const ae=y.getParentOrThrow();O(Z,ae.getChildren()),ae.replace(Z)}return}else{const Z=new Set;for(let ae=0;ae<k.length;ae++){const he=k[ae];if(t.$isElementNode(he)&&he.isEmpty()&&!le(he)&&!Z.has(he.getKey())){R(he,G);continue}if(t.$isLeafNode(he)){let se=he.getParent();for(;se!=null;){const Te=se.getKey();if(ue(se)){if(!Z.has(Te)){const be=pe(G);O(be,se.getChildren()),se.replace(be),w(be),Z.add(Te)}break}else{const be=se.getParent();if(t.$isRootOrShadowRoot(be)&&!Z.has(Te)){Z.add(Te),R(se,G);break}se=be}}}}}}})}function O(Y,G){Y.splice(Y.getChildrenSize(),0,G)}function R(Y,G){if(ue(Y))return Y;const Q=Y.getPreviousSibling(),k=Y.getNextSibling(),m=ee();if(m.setFormat(Y.getFormatType()),m.setIndent(Y.getIndent()),O(m,Y.getChildren()),ue(Q)&&G===Q.getListType())return Q.append(m),Y.remove(),ue(k)&&G===k.getListType()&&(O(Q,k.getChildren()),k.remove()),Q;if(ue(k)&&G===k.getListType())return k.getFirstChildOrThrow().insertBefore(m),Y.remove(),k;{const y=pe(G);return y.append(m),Y.replace(y),w(y),y}}function b(Y,G){const Q=Y.getLastChild(),k=G.getFirstChild();Q&&k&&d(Q)&&d(k)&&(b(Q.getFirstChild(),k.getFirstChild()),k.remove());const m=G.getChildren();m.length>0&&(Y.append(...m),w(Y)),G.remove()}function x(Y){Y.update(()=>{const G=t.$getSelection();if(t.$isRangeSelection(G)){const Q=new Set,k=G.getNodes(),m=G.anchor.getNode();if(C(m,k))Q.add(r(m));else for(let y=0;y<k.length;y++){const A=k[y];if(t.$isLeafNode(A)){const Z=e.$getNearestNodeOfType(A,H);Z!=null&&Q.add(r(Z))}}for(const y of Q){let A=y;const Z=c(y);for(const ae of Z){const he=t.$createParagraphNode();O(he,ae.getChildren()),A.insertAfter(he),A=he,ae.__key===G.anchor.key&&G.anchor.set(he.getKey(),0,"element"),ae.__key===G.focus.key&&G.focus.set(he.getKey(),0,"element"),ae.remove()}y.remove()}}})}function w(Y,G){const Q=G||Y.getChildren();if(Q!==void 0)for(let k=0;k<Q.length;k++){const m=Q[k];if(le(m)){const y=m.getValue(),A=S(m);y!==A&&m.setValue(A)}}}function $(Y){const G=new Set;if(d(Y)||G.has(Y.getKey()))return;const Q=Y.getParent(),k=Y.getNextSibling(),m=Y.getPreviousSibling();if(d(k)&&d(m)){const y=m.getFirstChild();if(ue(y)){y.append(Y);const A=k.getFirstChild();if(ue(A)){const Z=A.getChildren();O(y,Z),k.remove(),G.add(k.getKey())}w(y)}}else if(d(k)){const y=k.getFirstChild();if(ue(y)){const A=y.getFirstChild();A!==null&&A.insertBefore(Y),w(y)}}else if(d(m)){const y=m.getFirstChild();ue(y)&&(y.append(Y),w(y))}else if(ue(Q)){const y=ee(),A=pe(Q.getListType());y.append(A),A.append(Y),m?m.insertAfter(y):k?k.insertBefore(y):Q.append(y),w(A)}ue(Q)&&w(Q)}function W(Y){if(d(Y))return;const G=Y.getParent(),Q=G?G.getParent():void 0,k=Q?Q.getParent():void 0;if(ue(k)&&le(Q)&&ue(G)){const m=G?G.getFirstChild():void 0,y=G?G.getLastChild():void 0;if(Y.is(m))Q.insertBefore(Y),G.isEmpty()&&Q.remove();else if(Y.is(y))Q.insertAfter(Y),G.isEmpty()&&Q.remove();else{const A=G.getListType(),Z=ee(),ae=pe(A);Z.append(ae),Y.getPreviousSiblings().forEach(Te=>ae.append(Te));const he=ee(),se=pe(A);he.append(se),O(se,Y.getNextSiblings()),Q.insertBefore(Z),Q.insertAfter(he),Q.replace(Y)}w(G),w(k)}}function P(){const Y=t.$getSelection();if(!t.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const G=Y.anchor.getNode();if(!le(G)||G.getChildrenSize()!==0)return!1;const Q=r(G),k=G.getParent();if(!ue(k))throw Error("A ListItemNode must have a ListNode for a parent.");const m=k.getParent();let y;if(t.$isRootOrShadowRoot(m))y=t.$createParagraphNode(),Q.insertAfter(y);else if(le(m))y=ee(),m.insertAfter(y);else return!1;y.select();const A=G.getNextSiblings();if(A.length>0){const Z=pe(k.getListType());if(t.$isParagraphNode(y))y.insertAfter(Z);else{const ae=ee();ae.append(Z),y.insertAfter(ae)}A.forEach(ae=>{ae.remove(),Z.append(ae)})}return g(G),!0}class H extends t.ElementNode{static getType(){return"listitem"}static clone(G){return new H(G.__value,G.__checked,G.__key)}constructor(G,Q,k){super(k),this.__value=G===void 0?1:G,this.__checked=Q}createDOM(G){const Q=document.createElement("li"),k=this.getParent();return ue(k)&&k.getListType()==="check"&&z(Q,this,null),Q.value=this.__value,B(Q,G.theme,this),Q}updateDOM(G,Q,k){const m=this.getParent();return ue(m)&&m.getListType()==="check"&&z(Q,this,G),Q.value=this.__value,B(Q,k.theme,this),!1}static transform(){return G=>{const Q=G.getParent();ue(Q)&&(w(Q),Q.getListType()!=="check"&&G.getChecked()!=null&&G.setChecked(void 0))}}static importDOM(){return{li:G=>({conversion:X,priority:0})}}static importJSON(G){const Q=ee();return Q.setChecked(G.checked),Q.setValue(G.value),Q.setFormat(G.format),Q.setDirection(G.direction),Q}exportDOM(G){const Q=this.createDOM(G._config);return Q.style.textAlign=this.getFormatType(),{element:Q}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(t.$isElementNode(k)&&this.canMergeWith(k)){const m=k.getChildren();this.append(...m),k.remove()}else super.append(k)}return this}replace(G,Q){if(le(G))return super.replace(G);this.setIndent(0);const k=this.getParentOrThrow();if(!ue(k))return G;if(k.__first===this.getKey())k.insertBefore(G);else if(k.__last===this.getKey())k.insertAfter(G);else{const m=pe(k.getListType());let y=this.getNextSibling();for(;y;){const A=y;y=y.getNextSibling(),m.append(A)}k.insertAfter(G),G.insertAfter(m)}return Q&&this.getChildren().forEach(m=>{G.append(m)}),this.remove(),k.getChildrenSize()===0&&k.remove(),G}insertAfter(G,Q=!0){const k=this.getParentOrThrow();if(!ue(k))throw Error("insertAfter: list node is not parent of list item node");const m=this.getNextSiblings();if(le(G)){const y=super.insertAfter(G,Q),A=G.getParentOrThrow();return ue(A)&&w(A),y}if(ue(G)){let y=G;const A=G.getChildren();for(let Z=A.length-1;Z>=0;Z--)y=A[Z],this.insertAfter(y,Q);return y}if(k.insertAfter(G,Q),m.length!==0){const y=pe(k.getListType());m.forEach(A=>y.append(A)),G.insertAfter(y,Q)}return G}remove(G){const Q=this.getPreviousSibling(),k=this.getNextSibling();if(super.remove(G),Q&&k&&d(Q)&&d(k))b(Q.getFirstChild(),k.getFirstChild()),k.remove();else if(k){const m=k.getParent();ue(m)&&w(m)}}insertNewAfter(G,Q=!0){const k=ee(this.__checked==null?void 0:!1);return this.insertAfter(k,Q),k}collapseAtStart(G){const Q=t.$createParagraphNode();this.getChildren().forEach(Z=>Q.append(Z));const m=this.getParentOrThrow(),y=m.getParentOrThrow(),A=le(y);if(m.getChildrenSize()===1)if(A)m.remove(),y.select();else{m.insertBefore(Q),m.remove();const Z=G.anchor,ae=G.focus,he=Q.getKey();Z.type==="element"&&Z.getNode().is(this)&&Z.set(he,Z.offset,"element"),ae.type==="element"&&ae.getNode().is(this)&&ae.set(he,ae.offset,"element")}else m.insertBefore(Q),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(G){const Q=this.getWritable();Q.__value=G}getChecked(){return this.getLatest().__checked}setChecked(G){const Q=this.getWritable();Q.__checked=G}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const G=this.getParent();if(G===null)return this.getLatest().__indent;let Q=G.getParentOrThrow(),k=0;for(;le(Q);)Q=Q.getParentOrThrow().getParentOrThrow(),k++;return k}setIndent(G){if(!(typeof G=="number"&&G>-1))throw Error("Invalid indent value.");let Q=this.getIndent();for(;Q!==G;)Q<G?($(this),Q++):(W(this),Q--);return this}insertBefore(G){if(le(G)){const Q=this.getParentOrThrow();if(ue(Q)){const k=this.getNextSiblings();w(Q,k)}}return super.insertBefore(G)}canInsertAfter(G){return le(G)}canReplaceWith(G){return le(G)}canMergeWith(G){return t.$isParagraphNode(G)||le(G)}extractWithChild(G,Q){if(!t.$isRangeSelection(Q))return!1;const k=Q.anchor.getNode(),m=Q.focus.getNode();return this.isParentOf(k)&&this.isParentOf(m)&&this.getTextContent().length===Q.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return pe("bullet")}}function B(Y,G,Q){const k=[],m=[],y=G.list,A=y?y.listitem:void 0;let Z;if(y&&y.nested&&(Z=y.nested.listitem),A!==void 0){const ae=A.split(" ");k.push(...ae)}if(y){const ae=Q.getParent(),he=ue(ae)&&ae.getListType()==="check",se=Q.getChecked();(!he||se)&&m.push(y.listitemUnchecked),(!he||!se)&&m.push(y.listitemChecked),he&&k.push(se?y.listitemChecked:y.listitemUnchecked)}if(Z!==void 0){const ae=Z.split(" ");Q.getChildren().some(he=>ue(he))?k.push(...ae):m.push(...ae)}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function z(Y,G,Q,k){ue(G.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!Q||G.__checked!==Q.__checked)&&Y.setAttribute("aria-checked",G.getChecked()?"true":"false"))}function X(Y){const G=e.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:ee(G)}}function ee(Y){return t.$applyNodeReplacement(new H(void 0,Y))}function le(Y){return Y instanceof H}class j extends t.ElementNode{static getType(){return"list"}static clone(G){const Q=G.__listType||_e[G.__tag];return new j(Q,G.__start,G.__key)}constructor(G,Q,k){super(k);const m=_e[G]||G;this.__listType=m,this.__tag=m==="number"?"ol":"ul",this.__start=Q}getTag(){return this.__tag}setListType(G){const Q=this.getWritable();Q.__listType=G,Q.__tag=G==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(G,Q){const k=this.__tag,m=document.createElement(k);return this.__start!==1&&m.setAttribute("start",String(this.__start)),m.__lexicalListType=this.__listType,U(m,G.theme,this),m}updateDOM(G,Q,k){return G.__tag!==this.__tag?!0:(U(Q,k.theme,this),!1)}static importDOM(){return{ol:G=>({conversion:me,priority:0}),ul:G=>({conversion:me,priority:0})}}static importJSON(G){const Q=pe(G.listType,G.start);return Q.setFormat(G.format),Q.setIndent(G.indent),Q.setDirection(G.direction),Q}exportDOM(G){const{element:Q}=super.exportDOM(G);return Q&&e.isHTMLElement(Q)&&(this.__start!==1&&Q.setAttribute("start",String(this.__start)),this.__listType==="check"&&Q.setAttribute("__lexicalListType","check")),{element:Q}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(le(k))super.append(k);else{const m=ee();if(ue(k))m.append(k);else if(t.$isElementNode(k)){const y=t.$createTextNode(k.getTextContent());m.append(y)}else m.append(k);super.append(m)}}return w(this),this}extractWithChild(G){return le(G)}}function U(Y,G,Q){const k=[],m=[],y=G.list;if(y!==void 0){const A=y[`${Q.__tag}Depth`]||[],Z=n(Q)-1,ae=Z%A.length,he=A[ae],se=y[Q.__tag];let Te;const be=y.nested;if(be!==void 0&&be.list&&(Te=be.list),se!==void 0&&k.push(se),he!==void 0){const Ue=he.split(" ");k.push(...Ue);for(let re=0;re<A.length;re++)re!==ae&&m.push(Q.__tag+re)}if(Te!==void 0){const Ue=Te.split(" ");Z>1?k.push(...Ue):m.push(...Ue)}}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function q(Y){const G=[];for(let Q=0;Q<Y.length;Q++){const k=Y[Q];if(le(k)){G.push(k);const m=k.getChildren();m.length>1&&m.forEach(y=>{ue(y)&&G.push(p(y))})}else G.push(p(k))}return G}function me(Y){const G=Y.nodeName.toLowerCase();let Q=null;if(G==="ol"){const k=Y.start;Q=pe("number",k)}else G==="ul"&&(e.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?Q=pe("check"):Q=pe("bullet"));return{after:q,node:Q}}const _e={ol:"number",ul:"bullet"};function pe(Y,G=1){return t.$applyNodeReplacement(new j(Y,G))}function ue(Y){return Y instanceof j}const K=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),D=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),V=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ne=t.createCommand("REMOVE_LIST_COMMAND");return rr.$createListItemNode=ee,rr.$createListNode=pe,rr.$getListDepth=n,rr.$handleListInsertParagraph=P,rr.$isListItemNode=le,rr.$isListNode=ue,rr.INSERT_CHECK_LIST_COMMAND=V,rr.INSERT_ORDERED_LIST_COMMAND=D,rr.INSERT_UNORDERED_LIST_COMMAND=K,rr.ListItemNode=H,rr.ListNode=j,rr.REMOVE_LIST_COMMAND=ne,rr.insertList=T,rr.removeList=x,rr}var ir={},lh;function lC(){if(lh)return ir;lh=1;var t=Bt(),e=on();function n(K){let D=new URLSearchParams;D.append("code",K);for(let V=1;V<arguments.length;V++)D.append("v",arguments[V]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${D} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let D=1;for(K=K.getParent();K!=null;){if(B(K)){if(K=K.getParent(),q(K)){D++,K=K.getParent();continue}n(40)}break}return D}function c(K){K=K.getParent(),q(K)||n(40);let D=K;for(;D!==null;)D=D.getParent(),q(D)&&(K=D);return K}function d(K){let D=[];K=K.getChildren().filter(B);for(let V=0;V<K.length;V++){let ne=K[V],Y=ne.getFirstChild();q(Y)?D=D.concat(d(Y)):D.push(ne)}return D}function g(K){return B(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let D=K.getParent();if(D==null||!B(K)&&!q(K))break;K=D}K.remove()}function C(K){return H().append(K)}function S(K,D){return B(K)&&(D.length===0||D.length===1&&K.is(D[0])&&K.getChildrenSize()===0)}function T(K,D){K.splice(K.getChildrenSize(),0,D)}function O(K,D){if(q(K))return K;let V=K.getPreviousSibling(),ne=K.getNextSibling(),Y=H();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),T(Y,K.getChildren()),q(V)&&D===V.getListType()?(V.append(Y),K.remove(),q(ne)&&D===ne.getListType()&&(T(V,ne.getChildren()),ne.remove()),V):q(ne)&&D===ne.getListType()?(ne.getFirstChildOrThrow().insertBefore(Y),K.remove(),ne):(D=U(D),D.append(Y),K.replace(D),b(D),D)}function R(K,D){var V=K.getLastChild();let ne=D.getFirstChild();V&&ne&&g(V)&&g(ne)&&(R(V.getFirstChild(),ne.getFirstChild()),ne.remove()),V=D.getChildren(),0<V.length&&(K.append(...V),b(K)),D.remove()}function b(K,D){if(K=D||K.getChildren(),K!==void 0)for(D=0;D<K.length;D++){let G=K[D];if(B(G)){let Q=G.getValue();var V=G,ne=V.getParent(),Y=1;for(ne!=null&&(q(ne)?Y=ne.getStart():n(44)),V=V.getPreviousSiblings(),ne=0;ne<V.length;ne++){let k=V[ne];B(k)&&!q(k.getFirstChild())&&Y++}Q!==Y&&G.setValue(Y)}}}function x(K){if(!g(K)){var D=K.getParent(),V=D?D.getParent():void 0,ne=V?V.getParent():void 0;if(q(ne)&&B(V)&&q(D)){var Y=D?D.getFirstChild():void 0,G=D?D.getLastChild():void 0;if(K.is(Y))V.insertBefore(K),D.isEmpty()&&V.remove();else if(K.is(G))V.insertAfter(K),D.isEmpty()&&V.remove();else{var Q=D.getListType();Y=H();let k=U(Q);Y.append(k),K.getPreviousSiblings().forEach(m=>k.append(m)),G=H(),Q=U(Q),G.append(Q),T(Q,K.getNextSiblings()),V.insertBefore(Y),V.insertAfter(G),V.replace(K)}b(D),b(ne)}}}class w extends t.ElementNode{static getType(){return"listitem"}static clone(D){return new w(D.__value,D.__checked,D.__key)}constructor(D,V,ne){super(ne),this.__value=D===void 0?1:D,this.__checked=V}createDOM(D){let V=document.createElement("li"),ne=this.getParent();return q(ne)&&ne.getListType()==="check"&&W(V,this,null),V.value=this.__value,$(V,D.theme,this),V}updateDOM(D,V,ne){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&W(V,this,D),V.value=this.__value,$(V,ne.theme,this),!1}static transform(){return D=>{let V=D.getParent();q(V)&&(b(V),V.getListType()!=="check"&&D.getChecked()!=null&&D.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:P,priority:0})}}static importJSON(D){let V=H();return V.setChecked(D.checked),V.setValue(D.value),V.setFormat(D.format),V.setDirection(D.direction),V}exportDOM(D){return D=this.createDOM(D._config),D.style.textAlign=this.getFormatType(),{element:D}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...D){for(let V=0;V<D.length;V++){let ne=D[V];if(t.$isElementNode(ne)&&this.canMergeWith(ne)){let Y=ne.getChildren();this.append(...Y),ne.remove()}else super.append(ne)}return this}replace(D,V){if(B(D))return super.replace(D);this.setIndent(0);let ne=this.getParentOrThrow();if(!q(ne))return D;if(ne.__first===this.getKey())ne.insertBefore(D);else if(ne.__last===this.getKey())ne.insertAfter(D);else{let Y=U(ne.getListType()),G=this.getNextSibling();for(;G;){let Q=G;G=G.getNextSibling(),Y.append(Q)}ne.insertAfter(D),D.insertAfter(Y)}return V&&this.getChildren().forEach(Y=>{D.append(Y)}),this.remove(),ne.getChildrenSize()===0&&ne.remove(),D}insertAfter(D,V=!0){var ne=this.getParentOrThrow();q(ne)||n(39);var Y=this.getNextSiblings();if(B(D))return V=super.insertAfter(D,V),D=D.getParentOrThrow(),q(D)&&b(D),V;if(q(D)){for(ne=D,D=D.getChildren(),Y=D.length-1;0<=Y;Y--)ne=D[Y],this.insertAfter(ne,V);return ne}if(ne.insertAfter(D,V),Y.length!==0){let G=U(ne.getListType());Y.forEach(Q=>G.append(Q)),D.insertAfter(G,V)}return D}remove(D){let V=this.getPreviousSibling(),ne=this.getNextSibling();super.remove(D),V&&ne&&g(V)&&g(ne)?(R(V.getFirstChild(),ne.getFirstChild()),ne.remove()):ne&&(D=ne.getParent(),q(D)&&b(D))}insertNewAfter(D,V=!0){return D=H(this.__checked==null?void 0:!1),this.insertAfter(D,V),D}collapseAtStart(D){let V=t.$createParagraphNode();this.getChildren().forEach(Q=>V.append(Q));var ne=this.getParentOrThrow(),Y=ne.getParentOrThrow();let G=B(Y);return ne.getChildrenSize()===1?G?(ne.remove(),Y.select()):(ne.insertBefore(V),ne.remove(),ne=D.anchor,D=D.focus,Y=V.getKey(),ne.type==="element"&&ne.getNode().is(this)&&ne.set(Y,ne.offset,"element"),D.type==="element"&&D.getNode().is(this)&&D.set(Y,D.offset,"element")):(ne.insertBefore(V),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(D){this.getWritable().__value=D}getChecked(){return this.getLatest().__checked}setChecked(D){this.getWritable().__checked=D}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var D=this.getParent();if(D===null)return this.getLatest().__indent;D=D.getParentOrThrow();let V=0;for(;B(D);)D=D.getParentOrThrow().getParentOrThrow(),V++;return V}setIndent(D){typeof D=="number"&&-1<D||n(117);let V=this.getIndent();for(;V!==D;)if(V<D){e:{var ne=new Set;if(g(this)||ne.has(this.getKey()))break e;let k=this.getParent();var Y=this.getNextSibling(),G=this.getPreviousSibling();if(g(Y)&&g(G)){if(G=G.getFirstChild(),q(G)){G.append(this);var Q=Y.getFirstChild();q(Q)&&(Q=Q.getChildren(),T(G,Q),Y.remove(),ne.add(Y.getKey())),b(G)}}else g(Y)?(Y=Y.getFirstChild(),q(Y)&&(ne=Y.getFirstChild(),ne!==null&&ne.insertBefore(this),b(Y))):g(G)?(Y=G.getFirstChild(),q(Y)&&(Y.append(this),b(Y))):q(k)&&(ne=H(),Q=U(k.getListType()),ne.append(Q),Q.append(this),G?G.insertAfter(ne):Y?Y.insertBefore(ne):k.append(ne),b(Q));q(k)&&b(k)}V++}else x(this),V--;return this}insertBefore(D){if(B(D)){let V=this.getParentOrThrow();if(q(V)){let ne=this.getNextSiblings();b(V,ne)}}return super.insertBefore(D)}canInsertAfter(D){return B(D)}canReplaceWith(D){return B(D)}canMergeWith(D){return t.$isParagraphNode(D)||B(D)}extractWithChild(D,V){if(!t.$isRangeSelection(V))return!1;D=V.anchor.getNode();let ne=V.focus.getNode();return this.isParentOf(D)&&this.isParentOf(ne)&&this.getTextContent().length===V.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return U("bullet")}}function $(K,D,V){let ne=[],Y=[];var G=(D=D.list)?D.listitem:void 0;if(D&&D.nested)var Q=D.nested.listitem;if(G!==void 0&&(G=G.split(" "),ne.push(...G)),D){G=V.getParent(),G=q(G)&&G.getListType()==="check";let k=V.getChecked();G&&!k||Y.push(D.listitemUnchecked),G&&k||Y.push(D.listitemChecked),G&&ne.push(k?D.listitemChecked:D.listitemUnchecked)}Q!==void 0&&(Q=Q.split(" "),V.getChildren().some(k=>q(k))?ne.push(...Q):Y.push(...Q)),0<Y.length&&e.removeClassNamesFromElement(K,...Y),0<ne.length&&e.addClassNamesToElement(K,...ne)}function W(K,D,V){q(D.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),V&&D.__checked===V.__checked||K.setAttribute("aria-checked",D.getChecked()?"true":"false"))}function P(K){return K=e.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:H(K)}}function H(K){return t.$applyNodeReplacement(new w(void 0,K))}function B(K){return K instanceof w}class z extends t.ElementNode{static getType(){return"list"}static clone(D){return new z(D.__listType||j[D.__tag],D.__start,D.__key)}constructor(D,V,ne){super(ne),this.__listType=D=j[D]||D,this.__tag=D==="number"?"ol":"ul",this.__start=V}getTag(){return this.__tag}setListType(D){let V=this.getWritable();V.__listType=D,V.__tag=D==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(D){let V=document.createElement(this.__tag);return this.__start!==1&&V.setAttribute("start",String(this.__start)),V.__lexicalListType=this.__listType,X(V,D.theme,this),V}updateDOM(D,V,ne){return D.__tag!==this.__tag?!0:(X(V,ne.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:le,priority:0}),ul:()=>({conversion:le,priority:0})}}static importJSON(D){let V=U(D.listType,D.start);return V.setFormat(D.format),V.setIndent(D.indent),V.setDirection(D.direction),V}exportDOM(D){return{element:D}=super.exportDOM(D),D&&e.isHTMLElement(D)&&(this.__start!==1&&D.setAttribute("start",String(this.__start)),this.__listType==="check"&&D.setAttribute("__lexicalListType","check")),{element:D}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...D){for(let ne=0;ne<D.length;ne++){var V=D[ne];if(B(V))super.append(V);else{let Y=H();q(V)||t.$isElementNode(V)&&(V=t.$createTextNode(V.getTextContent())),Y.append(V),super.append(Y)}}return b(this),this}extractWithChild(D){return B(D)}}function X(K,D,V){let ne=[],Y=[];var G=D.list;if(G!==void 0){let k=G[`${V.__tag}Depth`]||[];D=r(V)-1;let m=D%k.length;var Q=k[m];let y=G[V.__tag],A;if(G=G.nested,G!==void 0&&G.list&&(A=G.list),y!==void 0&&ne.push(y),Q!==void 0)for(Q=Q.split(" "),ne.push(...Q),Q=0;Q<k.length;Q++)Q!==m&&Y.push(V.__tag+Q);A!==void 0&&(V=A.split(" "),1<D?ne.push(...V):Y.push(...V))}0<Y.length&&e.removeClassNamesFromElement(K,...Y),0<ne.length&&e.addClassNamesToElement(K,...ne)}function ee(K){let D=[];for(let ne=0;ne<K.length;ne++){var V=K[ne];B(V)?(D.push(V),V=V.getChildren(),1<V.length&&V.forEach(Y=>{q(Y)&&D.push(C(Y))})):D.push(C(V))}return D}function le(K){let D=K.nodeName.toLowerCase(),V=null;return D==="ol"?V=U("number",K.start):D==="ul"&&(V=e.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?U("check"):U("bullet")),{after:ee,node:V}}let j={ol:"number",ul:"bullet"};function U(K,D=1){return t.$applyNodeReplacement(new z(K,D))}function q(K){return K instanceof z}let me=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),_e=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),pe=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ue=t.createCommand("REMOVE_LIST_COMMAND");return ir.$createListItemNode=H,ir.$createListNode=U,ir.$getListDepth=r,ir.$handleListInsertParagraph=function(){var K=t.$getSelection();if(!t.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!B(K)||K.getChildrenSize()!==0))return!1;var D=c(K),V=K.getParent();q(V)||n(40);let ne=V.getParent(),Y;if(t.$isRootOrShadowRoot(ne))Y=t.$createParagraphNode(),D.insertAfter(Y);else if(B(ne))Y=H(),ne.insertAfter(Y);else return!1;if(Y.select(),D=K.getNextSiblings(),0<D.length){let G=U(V.getListType());t.$isParagraphNode(Y)?Y.insertAfter(G):(V=H(),V.append(G),Y.insertAfter(V)),D.forEach(Q=>{Q.remove(),G.append(Q)})}return p(K),!0},ir.$isListItemNode=B,ir.$isListNode=q,ir.INSERT_CHECK_LIST_COMMAND=pe,ir.INSERT_ORDERED_LIST_COMMAND=_e,ir.INSERT_UNORDERED_LIST_COMMAND=me,ir.ListItemNode=w,ir.ListNode=z,ir.REMOVE_LIST_COMMAND=ue,ir.insertList=function(K,D){K.update(()=>{var V=t.$getSelection();if(t.$INTERNAL_isPointSelection(V)){var ne=V.getNodes();V=V.anchor.getNode();var Y=V.getParent();if(S(V,ne))ne=U(D),t.$isRootOrShadowRoot(Y)?(V.replace(ne),Y=H(),t.$isElementNode(V)&&(Y.setFormat(V.getFormatType()),Y.setIndent(V.getIndent())),ne.append(Y)):B(V)&&(V=V.getParentOrThrow(),T(ne,V.getChildren()),V.replace(ne));else for(V=new Set,Y=0;Y<ne.length;Y++){var G=ne[Y];if(t.$isElementNode(G)&&G.isEmpty()&&!B(G)&&!V.has(G.getKey()))O(G,D);else if(t.$isLeafNode(G))for(G=G.getParent();G!=null;){let k=G.getKey();if(q(G)){if(!V.has(k)){var Q=U(D);T(Q,G.getChildren()),G.replace(Q),b(Q),V.add(k)}break}else{if(Q=G.getParent(),t.$isRootOrShadowRoot(Q)&&!V.has(k)){V.add(k),O(G,D);break}G=Q}}}}})},ir.removeList=function(K){K.update(()=>{let D=t.$getSelection();if(t.$isRangeSelection(D)){var V=new Set,ne=D.getNodes(),Y=D.anchor.getNode();if(S(Y,ne))V.add(c(Y));else for(Y=0;Y<ne.length;Y++){var G=ne[Y];t.$isLeafNode(G)&&(G=e.$getNearestNodeOfType(G,w),G!=null&&V.add(c(G)))}for(let Q of V){V=Q,ne=d(Q);for(let k of ne)ne=t.$createParagraphNode(),T(ne,k.getChildren()),V.insertAfter(ne),V=ne,k.__key===D.anchor.key&&D.anchor.set(ne.getKey(),0,"element"),k.__key===D.focus.key&&D.focus.set(ne.getKey(),0,"element"),k.remove();Q.remove()}}})},ir}var pu,ah;function hd(){return ah||(ah=1,pu=process.env.NODE_ENV==="development"?sC():lC()),pu}var ch;function aC(){if(ch)return gu;ch=1;var t=hd(),e=Un(),n=et,r=on(),c=Bt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(p,"number"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(p,"bullet"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(p),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[p])}function g(){const[p]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([t.ListNode,t.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return gu.ListPlugin=g,gu}var mu={},uh;function cC(){if(uh)return mu;uh=1;var t=hd(),e=Un(),n=et,r=on(),c=Bt();function d(g){n.useEffect(()=>r.mergeRegister(g.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(g,"number"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(g,"bullet"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(g),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[g])}return mu.ListPlugin=function(){let[g]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!g.hasNodes([t.ListNode,t.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[g]),d(g),null},mu}const uC=process.env.NODE_ENV==="development"?aC():cC();var dC=uC,_u={},Ii={},dh;function fC(){if(dh)return Ii;dh=1;var t=on(),e=Bt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(x){return new r(x.__url,{rel:x.__rel,target:x.__target,title:x.__title},x.__key)}constructor(x,w={},$){super($);const{target:W=null,rel:P=null,title:H=null}=w;this.__url=x,this.__target=W,this.__rel=P,this.__title=H}createDOM(x){const w=document.createElement("a");return w.href=this.sanitizeUrl(this.__url),this.__target!==null&&(w.target=this.__target),this.__rel!==null&&(w.rel=this.__rel),this.__title!==null&&(w.title=this.__title),t.addClassNamesToElement(w,x.theme.link),w}updateDOM(x,w,$){const W=this.__url,P=this.__target,H=this.__rel,B=this.__title;return W!==x.__url&&(w.href=W),P!==x.__target&&(P?w.target=P:w.removeAttribute("target")),H!==x.__rel&&(H?w.rel=H:w.removeAttribute("rel")),B!==x.__title&&(B?w.title=B:w.removeAttribute("title")),!1}static importDOM(){return{a:x=>({conversion:c,priority:1})}}static importJSON(x){const w=d(x.url,{rel:x.rel,target:x.target,title:x.title});return w.setFormat(x.format),w.setIndent(x.indent),w.setDirection(x.direction),w}sanitizeUrl(x){try{const w=new URL(x);if(!n.has(w.protocol))return"about:blank"}catch{return x}return x}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(x){const w=this.getWritable();w.__url=x}getTarget(){return this.getLatest().__target}setTarget(x){const w=this.getWritable();w.__target=x}getRel(){return this.getLatest().__rel}setRel(x){const w=this.getWritable();w.__rel=x}getTitle(){return this.getLatest().__title}setTitle(x){const w=this.getWritable();w.__title=x}insertNewAfter(x,w=!0){const $=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter($,w),$}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(x,w,$){if(!e.$isRangeSelection(w))return!1;const W=w.anchor.getNode(),P=w.focus.getNode();return this.isParentOf(W)&&this.isParentOf(P)&&w.getTextContent().length>0}}function c(b){let x=null;if(t.isHTMLAnchorElement(b)){const w=b.textContent;(w!==null&&w!==""||b.children.length>0)&&(x=d(b.getAttribute("href")||"",{rel:b.getAttribute("rel"),target:b.getAttribute("target"),title:b.getAttribute("title")}))}return{node:x}}function d(b,x){return e.$applyNodeReplacement(new r(b,x))}function g(b){return b instanceof r}class p extends r{static getType(){return"autolink"}static clone(x){return new p(x.__url,{rel:x.__rel,target:x.__target,title:x.__title},x.__key)}static importJSON(x){const w=C(x.url,{rel:x.rel,target:x.target,title:x.title});return w.setFormat(x.format),w.setIndent(x.indent),w.setDirection(x.direction),w}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(x,w=!0){const $=this.getParentOrThrow().insertNewAfter(x,w);if(e.$isElementNode($)){const W=C(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return $.append(W),W}return null}}function C(b,x){return e.$applyNodeReplacement(new p(b,x))}function S(b){return b instanceof p}const T=e.createCommand("TOGGLE_LINK_COMMAND");function O(b,x={}){const{target:w,title:$}=x,W=x.rel===void 0?"noreferrer":x.rel,P=e.$getSelection();if(!e.$isRangeSelection(P))return;const H=P.extract();if(b===null)H.forEach(B=>{const z=B.getParent();if(g(z)){const X=z.getChildren();for(let ee=0;ee<X.length;ee++)z.insertBefore(X[ee]);z.remove()}});else{if(H.length===1){const X=H[0],ee=R(X,g);if(ee!==null){ee.setURL(b),w!==void 0&&ee.setTarget(w),W!==null&&ee.setRel(W),$!==void 0&&ee.setTitle($);return}}let B=null,z=null;H.forEach(X=>{const ee=X.getParent();if(!(ee===z||ee===null||e.$isElementNode(X)&&!X.isInline())){if(g(ee)){z=ee,ee.setURL(b),w!==void 0&&ee.setTarget(w),W!==null&&z.setRel(W),$!==void 0&&z.setTitle($);return}if(ee.is(B)||(B=ee,z=d(b,{rel:W,target:w,title:$}),g(ee)?X.getPreviousSibling()===null?ee.insertBefore(z):ee.insertAfter(z):X.insertBefore(z)),g(X)){if(X.is(z))return;if(z!==null){const le=X.getChildren();for(let j=0;j<le.length;j++)z.append(le[j])}X.remove();return}z!==null&&z.append(X)}})}}function R(b,x){let w=b;for(;w!==null&&w.getParent()!==null&&!x(w);)w=w.getParentOrThrow();return x(w)?w:null}return Ii.$createAutoLinkNode=C,Ii.$createLinkNode=d,Ii.$isAutoLinkNode=S,Ii.$isLinkNode=g,Ii.AutoLinkNode=p,Ii.LinkNode=r,Ii.TOGGLE_LINK_COMMAND=T,Ii.toggleLink=O,Ii}var Pi={},fh;function hC(){if(fh)return Pi;fh=1;var t=on(),e=Bt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(R){return new r(R.__url,{rel:R.__rel,target:R.__target,title:R.__title},R.__key)}constructor(R,b={},x){super(x);let{target:w=null,rel:$=null,title:W=null}=b;this.__url=R,this.__target=w,this.__rel=$,this.__title=W}createDOM(R){let b=document.createElement("a");return b.href=this.sanitizeUrl(this.__url),this.__target!==null&&(b.target=this.__target),this.__rel!==null&&(b.rel=this.__rel),this.__title!==null&&(b.title=this.__title),t.addClassNamesToElement(b,R.theme.link),b}updateDOM(R,b){let x=this.__url,w=this.__target,$=this.__rel,W=this.__title;return x!==R.__url&&(b.href=x),w!==R.__target&&(w?b.target=w:b.removeAttribute("target")),$!==R.__rel&&($?b.rel=$:b.removeAttribute("rel")),W!==R.__title&&(W?b.title=W:b.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:c,priority:1})}}static importJSON(R){let b=d(R.url,{rel:R.rel,target:R.target,title:R.title});return b.setFormat(R.format),b.setIndent(R.indent),b.setDirection(R.direction),b}sanitizeUrl(R){try{let b=new URL(R);if(!n.has(b.protocol))return"about:blank"}catch{}return R}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(R){this.getWritable().__url=R}getTarget(){return this.getLatest().__target}setTarget(R){this.getWritable().__target=R}getRel(){return this.getLatest().__rel}setRel(R){this.getWritable().__rel=R}getTitle(){return this.getLatest().__title}setTitle(R){this.getWritable().__title=R}insertNewAfter(R,b=!0){return R=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(R,b),R}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(R,b){if(!e.$isRangeSelection(b))return!1;R=b.anchor.getNode();let x=b.focus.getNode();return this.isParentOf(R)&&this.isParentOf(x)&&0<b.getTextContent().length}}function c(O){let R=null;if(t.isHTMLAnchorElement(O)){let b=O.textContent;(b!==null&&b!==""||0<O.children.length)&&(R=d(O.getAttribute("href")||"",{rel:O.getAttribute("rel"),target:O.getAttribute("target"),title:O.getAttribute("title")}))}return{node:R}}function d(O,R){return e.$applyNodeReplacement(new r(O,R))}function g(O){return O instanceof r}class p extends r{static getType(){return"autolink"}static clone(R){return new p(R.__url,{rel:R.__rel,target:R.__target,title:R.__title},R.__key)}static importJSON(R){let b=C(R.url,{rel:R.rel,target:R.target,title:R.title});return b.setFormat(R.format),b.setIndent(R.indent),b.setDirection(R.direction),b}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(R,b=!0){return R=this.getParentOrThrow().insertNewAfter(R,b),e.$isElementNode(R)?(b=C(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),R.append(b),b):null}}function C(O,R){return e.$applyNodeReplacement(new p(O,R))}let S=e.createCommand("TOGGLE_LINK_COMMAND");function T(O,R){for(;O!==null&&O.getParent()!==null&&!R(O);)O=O.getParentOrThrow();return R(O)?O:null}return Pi.$createAutoLinkNode=C,Pi.$createLinkNode=d,Pi.$isAutoLinkNode=function(O){return O instanceof p},Pi.$isLinkNode=g,Pi.AutoLinkNode=p,Pi.LinkNode=r,Pi.TOGGLE_LINK_COMMAND=S,Pi.toggleLink=function(O,R={}){let{target:b,title:x}=R,w=R.rel===void 0?"noreferrer":R.rel;if(R=e.$getSelection(),e.$isRangeSelection(R))if(R=R.extract(),O===null)R.forEach($=>{if($=$.getParent(),g($)){let W=$.getChildren();for(let P=0;P<W.length;P++)$.insertBefore(W[P]);$.remove()}});else{if(R.length===1){let P=T(R[0],g);if(P!==null){P.setURL(O),b!==void 0&&P.setTarget(b),w!==null&&P.setRel(w),x!==void 0&&P.setTitle(x);return}}let $=null,W=null;R.forEach(P=>{var H=P.getParent();if(H!==W&&H!==null&&(!e.$isElementNode(P)||P.isInline()))if(g(H))W=H,H.setURL(O),b!==void 0&&H.setTarget(b),w!==null&&W.setRel(w),x!==void 0&&W.setTitle(x);else if(H.is($)||($=H,W=d(O,{rel:w,target:b,title:x}),g(H)?P.getPreviousSibling()===null?H.insertBefore(W):H.insertAfter(W):P.insertBefore(W)),g(P)){if(!P.is(W)){if(W!==null){H=P.getChildren();for(let B=0;B<H.length;B++)W.append(H[B])}P.remove()}}else W!==null&&W.append(P)})}},Pi}var yu,hh;function gd(){return hh||(hh=1,yu=process.env.NODE_ENV==="development"?fC():hC()),yu}var gh;function gC(){if(gh)return _u;gh=1;var t=gd(),e=Un(),n=on(),r=Bt(),c=et;function d({validateUrl:g}){const[p]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!p.hasNodes([t.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(t.TOGGLE_LINK_COMMAND,C=>{if(C===null)return t.toggleLink(C),!0;if(typeof C=="string")return g===void 0||g(C)?(t.toggleLink(C),!0):!1;{const{url:S,target:T,rel:O,title:R}=C;return t.toggleLink(S,{rel:O,target:T,title:R}),!0}},r.COMMAND_PRIORITY_LOW),g!==void 0?p.registerCommand(r.PASTE_COMMAND,C=>{const S=r.$getSelection();if(!r.$isRangeSelection(S)||S.isCollapsed()||!(C instanceof ClipboardEvent)||C.clipboardData==null)return!1;const T=C.clipboardData.getData("text");return g(T)?S.getNodes().some(O=>r.$isElementNode(O))?!1:(p.dispatchCommand(t.TOGGLE_LINK_COMMAND,T),C.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,g]),null}return _u.LinkPlugin=d,_u}var Nu={},ph;function pC(){if(ph)return Nu;ph=1;var t=gd(),e=Un(),n=on(),r=Bt(),c=et;return Nu.LinkPlugin=function({validateUrl:d}){let[g]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!g.hasNodes([t.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(g.registerCommand(t.TOGGLE_LINK_COMMAND,p=>{if(p===null)return t.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(t.toggleLink(p),!0):!1;let{url:C,target:S,rel:T,title:O}=p;return t.toggleLink(C,{rel:T,target:S,title:O}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?g.registerCommand(r.PASTE_COMMAND,p=>{let C=r.$getSelection();if(!r.$isRangeSelection(C)||C.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let S=p.clipboardData.getData("text");return d(S)?C.getNodes().some(T=>r.$isElementNode(T))?!1:(g.dispatchCommand(t.TOGGLE_LINK_COMMAND,S),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[g,d]),null},Nu}const mC=process.env.NODE_ENV==="development"?gC():pC();var _C=mC,Cu={},Gt={},mh;function yC(){if(mh)return Gt;mh=1;var t=Bt(),e=on();const n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const fe=new c(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return fe.__rowSpan=ie.__rowSpan,fe.__backgroundColor=ie.__backgroundColor,fe}static importDOM(){return{td:ie=>({conversion:d,priority:0}),th:ie=>({conversion:d,priority:0})}}static importJSON(ie){const fe=ie.colSpan||1,Oe=ie.rowSpan||1,Re=g(ie.headerState,fe,ie.width||void 0);return Re.__rowSpan=Oe,Re.__backgroundColor=ie.backgroundColor||null,Re}constructor(ie=r.NO_STATUS,fe=1,Oe,Re){super(fe,Re),this.__headerState=ie,this.__width=Oe,this.__backgroundColor=null}createDOM(ie){const fe=document.createElement(this.getTag());return this.__width&&(fe.style.width=`${this.__width}px`),this.__colSpan>1&&(fe.colSpan=this.__colSpan),this.__rowSpan>1&&(fe.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(fe.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(fe,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),fe}exportDOM(ie){const{element:fe}=super.exportDOM(ie);if(fe){const Oe=fe,Re=700,De=this.getParentOrThrow().getChildrenSize();Oe.style.border="1px solid black",this.__colSpan>1&&(Oe.colSpan=this.__colSpan),this.__rowSpan>1&&(Oe.rowSpan=this.__rowSpan),Oe.style.width=`${this.getWidth()||Math.max(90,Re/De)}px`,Oe.style.verticalAlign="top",Oe.style.textAlign="start";const We=this.getBackgroundColor();We!==null?Oe.style.backgroundColor=We:this.hasHeader()&&(Oe.style.backgroundColor="#f2f3f5")}return{element:fe}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const fe=this.getWritable();return fe.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const fe=this.getWritable();return fe.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const fe=this.getWritable();return(fe.__headerState&ie)===ie?fe.__headerState-=ie:fe.__headerState+=ie,fe}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(Se){const ie=Se,fe=Se.nodeName.toLowerCase();let Oe;n.test(ie.style.width)&&(Oe=parseFloat(ie.style.width));const Re=g(fe==="th"?r.ROW:r.NO_STATUS,ie.colSpan,Oe);Re.__rowSpan=ie.rowSpan;const De=ie.style.backgroundColor;return De!==""&&(Re.__backgroundColor=De),{forChild:(We,qe)=>{if(p(qe)&&!t.$isElementNode(We)){const Qe=t.$createParagraphNode();return t.$isLineBreakNode(We)&&We.getTextContent()===`
74
+ `?null:(Qe.append(We),Qe)}return We},node:Re}}function g(Se,ie=1,fe){return t.$applyNodeReplacement(new c(Se,ie,fe))}function p(Se){return Se instanceof c}class C extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new C(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:S,priority:0})}}static importJSON(ie){return T(ie.height)}constructor(ie,fe){super(fe),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const fe=document.createElement("tr");return this.__height&&(fe.style.height=`${this.__height}px`),e.addClassNamesToElement(fe,ie.theme.tableRow),fe}isShadowRoot(){return!0}setHeight(ie){const fe=this.getWritable();return fe.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function S(Se){const ie=Se;let fe;return n.test(ie.style.height)&&(fe=parseFloat(ie.style.height)),{node:T(fe)}}function T(Se){return t.$applyNodeReplacement(new C(Se))}function O(Se){return Se instanceof C}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",b=Se=>R?(Se||window).getSelection():null;class x{constructor(ie,fe){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=fe,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(fe=>{this.editor.update(()=>{let Oe=!1;for(let De=0;De<fe.length;De++){const Qe=fe[De].target.nodeName;if(Qe==="TABLE"||Qe==="TR"){Oe=!0;break}}if(!Oe)return;const Re=this.editor.getElementByKey(this.tableNodeKey);if(!Re)throw new Error("Expected to find TableElement in DOM");this.grid=B(Re)})});this.editor.update(()=>{const fe=this.editor.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");this.grid=B(fe),ie.observe(fe,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=ie.getElementByKey(this.tableNodeKey);if(!Oe)throw new Error("Expected to find TableElement in DOM");const Re=B(Oe);z(ie,Re,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(fe,ie._config.theme.tableSelection),fe.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.addClassNamesToElement(fe,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const fe=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),z(fe,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,fe=!1){const Oe=this.editor;Oe.update(()=>{const Re=t.$getNodeByKey(this.tableNodeKey);if(!m(Re))throw new Error("Expected TableNode.");if(!Oe.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const We=ie.x,qe=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const Qe=b(Oe._window);Qe&&Qe.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==We||this.anchorY!==qe||fe))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(We===this.focusX&&qe===this.focusY)return;if(this.focusX=We,this.focusY=qe,this.isHighlightingCells){const Qe=t.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(Qe)){const ft=Qe.getKey();this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ft,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Oe.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),z(Oe,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const fe=t.$getNearestNodeFromDOMNode(ie.elem);if(p(fe)){const Oe=fe.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=Oe}})}formatCells(ie){this.editor.update(()=>{const fe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(fe))throw Error("Expected grid selection");const Oe=t.$createRangeSelection(),Re=Oe.anchor,De=Oe.focus;fe.getNodes().forEach(We=>{p(We)&&We.getTextContentSize()!==0&&(Re.set(We.getKey(),0,"element"),De.set(We.getKey(),We.getChildrenSize(),"element"),Oe.formatText(ie))}),t.$setSelection(fe),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(Oe))throw Error("Expected grid selection");const Re=Oe.getNodes().filter(p);if(Re.length===this.grid.columns*this.grid.rows){fe.selectPrevious(),fe.remove(),t.$getRoot().selectStart();return}Re.forEach(De=>{if(t.$isElementNode(De)){const We=t.$createParagraphNode(),qe=t.$createTextNode();We.append(qe),De.append(We),De.getChildren().forEach(Qe=>{Qe!==We&&Qe.remove()})}}),z(ie,this.grid,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}}const w="__lexicalTableSelection";function $(Se,ie,fe,Oe){const Re=fe.getRootElement();if(Re===null)throw new Error("No root element.");const De=new x(fe,Se.getKey()),We=fe._window||window;W(ie,De),ie.addEventListener("mousedown",je=>{setTimeout(()=>{if(je.button!==0||!We)return;const Ve=H(je.target);Ve!==null&&(ne(je),De.setAnchorCellForSelection(Ve));const rt=()=>{We.removeEventListener("mouseup",rt),We.removeEventListener("mousemove",_t)},_t=Et=>{const vt=H(Et.target);vt!==null&&(De.anchorX!==vt.x||De.anchorY!==vt.y)&&(Et.preventDefault(),De.setFocusCellForSelection(vt))};We.addEventListener("mouseup",rt),We.addEventListener("mousemove",_t)},0)});const qe=je=>{je.button===0&&fe.update(()=>{const Ve=t.$getSelection(),rt=je.target;t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&Re.contains(rt)&&De.clearHighlight()})};We.addEventListener("mousedown",qe),De.listenersToRemove.add(()=>We.removeEventListener("mousedown",qe)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_DOWN_COMMAND,je=>V(fe,je,"down",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_UP_COMMAND,je=>V(fe,je,"up",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_LEFT_COMMAND,je=>V(fe,je,"backward",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,je=>V(fe,je,"forward",Se,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ESCAPE_COMMAND,je=>{const Ve=t.$getSelection();if(t.DEPRECATED_$isGridSelection(Ve)){const rt=e.$findMatchingParent(Ve.focus.getNode(),p);if(p(rt))return ne(je),rt.selectEnd(),!0}return!1},t.COMMAND_PRIORITY_HIGH));const Qe=je=>()=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>p(bt));if(!p(rt))return!1;const _t=Ve.anchor.getNode(),Et=Ve.focus.getNode(),vt=Se.isParentOf(_t),Ot=Se.isParentOf(Et);if(vt&&!Ot||Ot&&!vt)return De.clearText(),!0;const xt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>t.$isElementNode(bt)),Qt=xt&&e.$findMatchingParent(xt,bt=>t.$isElementNode(bt)&&p(bt.getParent()));if(!t.$isElementNode(Qt)||!t.$isElementNode(xt))return!1;if(je===t.DELETE_LINE_COMMAND&&Qt.getPreviousSibling()===null)return!0;if((je===t.DELETE_CHARACTER_COMMAND||je===t.DELETE_WORD_COMMAND)&&Ve.isCollapsed()&&Ve.anchor.offset===0&&xt!==Qt){const bt=xt.getChildren(),Ut=t.$createParagraphNode();return bt.forEach(It=>Ut.append(It)),xt.replace(Ut),xt.getWritable().__parent=rt.getKey(),!0}}return!1};[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(je=>{De.listenersToRemove.add(fe.registerCommand(je,Qe(je),t.COMMAND_PRIORITY_CRITICAL))});const ft=je=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return je.preventDefault(),je.stopPropagation(),De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1};De.listenersToRemove.add(fe.registerCommand(t.KEY_BACKSPACE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.KEY_DELETE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FORMAT_TEXT_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.formatCells(je),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,Se))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearHighlight(),!1;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),Oe&&De.listenersToRemove.add(fe.registerCommand(t.KEY_TAB_COMMAND,je=>{const Ve=t.$getSelection();if(!t.$isRangeSelection(Ve)||!Ve.isCollapsed()||!q(Ve,Se))return!1;const rt=K(Ve.anchor.getNode());if(rt===null)return!1;ne(je);const _t=Se.getCordsFromCellNode(rt,De.grid);return j(De,Se,_t.x,_t.y,je.shiftKey?"backward":"forward"),!0},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FOCUS_COMMAND,je=>Se.isSelected(),t.COMMAND_PRIORITY_HIGH));function kt(je){const Ve=Se.getCordsFromCellNode(je,De.grid);return Se.getCellFromCordsOrThrow(Ve.x,Ve.y,De.grid)}return De.listenersToRemove.add(fe.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{const je=t.$getSelection(),Ve=t.$getPreviousSelection();if(t.$isRangeSelection(je)){const{anchor:rt,focus:_t}=je,Et=rt.getNode(),vt=_t.getNode(),Ot=K(Et),Mt=K(vt),xt=Ot&&Se.is(D(Ot)),Qt=Mt&&Se.is(D(Mt)),bt=xt!==Qt,Ut=xt&&Qt,It=je.isBackward();if(bt){const hr=je.clone();hr.focus.set(Se.getKey(),It?0:Se.getChildrenSize(),"element"),t.$setSelection(hr),ee(fe,De)}else Ut&&(Ot.is(Mt)||(De.setAnchorCellForSelection(kt(Ot)),De.setFocusCellForSelection(kt(Mt),!0)))}return je&&!je.is(Ve)&&(t.DEPRECATED_$isGridSelection(je)||t.DEPRECATED_$isGridSelection(Ve))&&De.gridSelection&&!De.gridSelection.is(Ve)?(t.DEPRECATED_$isGridSelection(je)&&je.gridKey===De.tableNodeKey?De.updateTableGridSelection(je):!t.DEPRECATED_$isGridSelection(je)&&t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&De.updateTableGridSelection(null),!1):(De.hasHijackedSelectionStyles&&!Se.isSelected()?le(fe,De):!De.hasHijackedSelectionStyles&&Se.isSelected()&&ee(fe,De),!1)},t.COMMAND_PRIORITY_CRITICAL)),De}function W(Se,ie){Se[w]=ie}function P(Se){return Se[w]}function H(Se){let ie=Se;for(;ie!=null;){const fe=ie.nodeName;if(fe==="TD"||fe==="TH"){const Oe=ie._cell;return Oe===void 0?null:Oe}ie=ie.parentNode}return null}function B(Se){const ie=[],fe={cells:ie,columns:0,rows:0};let Oe=Se.firstChild,Re=0,De=0;for(ie.length=0;Oe!=null;){const We=Oe.nodeName;if(We==="TD"||We==="TH"){const ft=Oe,kt={elem:ft,hasBackgroundColor:ft.style.backgroundColor!=="",highlighted:!1,x:Re,y:De};Oe._cell=kt;let je=ie[De];je===void 0&&(je=ie[De]=[]),je[Re]=kt}else{const ft=Oe.firstChild;if(ft!=null){Oe=ft;continue}}const qe=Oe.nextSibling;if(qe!=null){Re++,Oe=qe;continue}const Qe=Oe.parentNode;if(Qe!=null){const ft=Qe.nextSibling;if(ft==null)break;De++,Re=0,Oe=ft}}return fe.columns=Re+1,fe.rows=De+1,fe}function z(Se,ie,fe){const Oe=new Set(fe?fe.getNodes():[]);X(ie,(Re,De)=>{const We=Re.elem;Oe.has(De)?(Re.highlighted=!0,pe(Se,Re)):(Re.highlighted=!1,ue(Se,Re),We.getAttribute("style")||We.removeAttribute("style"))})}function X(Se,ie){const{cells:fe}=Se;for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(Re)for(let De=0;De<Re.length;De++){const We=Re[De];if(!We)continue;const qe=t.$getNearestNodeFromDOMNode(We.elem);qe!==null&&ie(We,qe,{x:De,y:Oe})}}}function ee(Se,ie){ie.disableHighlightStyle(),X(ie.grid,fe=>{fe.highlighted=!0,pe(Se,fe)})}function le(Se,ie){ie.enableHighlightStyle(),X(ie.grid,fe=>{const Oe=fe.elem;fe.highlighted=!1,ue(Se,fe),Oe.getAttribute("style")||Oe.removeAttribute("style")})}const j=(Se,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?Se.grid.columns-1:0)?me(ie.getCellNodeFromCordsOrThrow(fe+(De?1:-1),Oe,Se.grid),De):Oe!==(De?Se.grid.rows-1:0)?me(ie.getCellNodeFromCordsOrThrow(De?0:Se.grid.columns-1,Oe+(De?1:-1),Se.grid),De):De?ie.selectNext():ie.selectPrevious(),!0;case"up":return Oe!==0?me(ie.getCellNodeFromCordsOrThrow(fe,Oe-1,Se.grid),!1):ie.selectPrevious(),!0;case"down":return Oe!==Se.grid.rows-1?me(ie.getCellNodeFromCordsOrThrow(fe,Oe+1,Se.grid),!0):ie.selectNext(),!0;default:return!1}},U=(Se,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?Se.grid.columns-1:0)&&Se.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe+(De?1:-1),Oe,Se.grid)),!0;case"up":return Oe!==0?(Se.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe-1,Se.grid)),!0):!1;case"down":return Oe!==Se.grid.rows-1?(Se.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe+1,Se.grid)),!0):!1;default:return!1}};function q(Se,ie){if(t.$isRangeSelection(Se)||t.DEPRECATED_$isGridSelection(Se)){const fe=ie.isParentOf(Se.anchor.getNode()),Oe=ie.isParentOf(Se.focus.getNode());return fe&&Oe}return!1}function me(Se,ie){ie?Se.selectStart():Se.selectEnd()}const _e="172,206,247";function pe(Se,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null?fe.style.setProperty("background-color",`rgb(${_e})`):fe.style.setProperty("background-image",`linear-gradient(to right, rgba(${_e},0.85), rgba(${_e},0.85))`),fe.style.setProperty("caret-color","transparent")}function ue(Se,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null&&fe.style.removeProperty("background-color"),fe.style.removeProperty("background-image"),fe.style.removeProperty("caret-color")}function K(Se){const ie=e.$findMatchingParent(Se,p);return p(ie)?ie:null}function D(Se){const ie=e.$findMatchingParent(Se,m);return m(ie)?ie:null}function V(Se,ie,fe,Oe,Re){const De=t.$getSelection();if(!q(De,Oe))return!1;if(t.$isRangeSelection(De)&&De.isCollapsed()){if(fe==="backward"||fe==="forward")return!1;const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p);if(!p(Qe)||!Qe.is(ft))return!1;const kt=D(Qe);if(kt!==Oe&&kt!=null){const Mt=Se.getElementByKey(kt.getKey());if(Mt!=null)return Re.grid=B(Mt),V(Se,ie,fe,kt,Re)}const je=Se.getElementByKey(Qe.__key),Ve=Se.getElementByKey(We.key);if(Ve==null||je==null)return!1;let rt;if(We.type==="element")rt=Ve.getBoundingClientRect();else{const Mt=window.getSelection();if(Mt===null||Mt.rangeCount===0)return!1;rt=Mt.getRangeAt(0).getBoundingClientRect()}const _t=fe==="up"?Qe.getFirstChild():Qe.getLastChild();if(_t==null)return!1;const Et=Se.getElementByKey(_t.__key);if(Et==null)return!1;const vt=Et.getBoundingClientRect();if(fe==="up"?vt.top>rt.top-rt.height:rt.bottom+rt.height>vt.bottom){ne(ie);const Mt=Oe.getCordsFromCellNode(Qe,Re.grid);if(ie.shiftKey){const xt=Oe.getCellFromCordsOrThrow(Mt.x,Mt.y,Re.grid);Re.setAnchorCellForSelection(xt),Re.setFocusCellForSelection(xt,!0)}else return j(Re,Oe,Mt.x,Mt.y,fe);return!0}}else if(t.DEPRECATED_$isGridSelection(De)){const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p),[kt]=De.getNodes(),je=Se.getElementByKey(kt.getKey());if(!p(Qe)||!p(ft)||!m(kt)||je==null)return!1;Re.updateTableGridSelection(De);const Ve=B(je),rt=Oe.getCordsFromCellNode(Qe,Ve),_t=Oe.getCellFromCordsOrThrow(rt.x,rt.y,Ve);if(Re.setAnchorCellForSelection(_t),ne(ie),ie.shiftKey){const Et=Oe.getCordsFromCellNode(ft,Ve);return U(Re,kt,Et.x,Et.y,fe)}else ft.selectEnd();return!0}return!1}function ne(Se){Se.preventDefault(),Se.stopImmediatePropagation(),Se.stopPropagation()}class Y extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new Y(ie.__key)}static importDOM(){return{table:ie=>({conversion:Q,priority:1})}}static importJSON(ie){return k()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,fe){const Oe=document.createElement("table");return e.addClassNamesToElement(Oe,ie.theme.table),Oe}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:fe=>{if(fe){const Oe=fe.cloneNode(),Re=document.createElement("colgroup"),De=document.createElement("tbody");e.isHTMLElement(fe)&&De.append(...fe.children);const We=this.getFirstChildOrThrow();if(!O(We))throw new Error("Expected to find row node.");const qe=We.getChildrenSize();for(let Qe=0;Qe<qe;Qe++){const ft=document.createElement("col");Re.append(ft)}return Oe.replaceChildren(Re,De),Oe}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,fe){const{rows:Oe,cells:Re}=fe;for(let De=0;De<Oe;De++){const We=Re[De];if(We==null)continue;const qe=We.findIndex(Qe=>{if(!Qe)return;const{elem:ft}=Qe;return t.$getNearestNodeFromDOMNode(ft)===ie});if(qe!==-1)return{x:qe,y:De}}throw new Error("Cell not found in table.")}getCellFromCords(ie,fe,Oe){const{cells:Re}=Oe,De=Re[fe];if(De==null)return null;const We=De[ie];return We??null}getCellFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(!Re)throw new Error("Cell not found at cords.");return Re}getCellNodeFromCords(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(Re==null)return null;const De=t.$getNearestNodeFromDOMNode(Re.elem);return p(De)?De:null}getCellNodeFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellNodeFromCords(ie,fe,Oe);if(!Re)throw new Error("Node at cords not TableCellNode.");return Re}canSelectBefore(){return!0}canIndent(){return!1}}function G(Se,ie){const fe=Se.getElementByKey(ie.getKey());if(fe==null)throw new Error("Table Element Not Found");return B(fe)}function Q(Se){return{node:k()}}function k(){return t.$applyNodeReplacement(new Y)}function m(Se){return Se instanceof Y}function y(Se,ie,fe=!0){const Oe=k();for(let Re=0;Re<Se;Re++){const De=T();for(let We=0;We<ie;We++){let qe=r.NO_STATUS;typeof fe=="object"?(Re===0&&fe.rows&&(qe|=r.ROW),We===0&&fe.columns&&(qe|=r.COLUMN)):fe&&(Re===0&&(qe|=r.ROW),We===0&&(qe|=r.COLUMN));const Qe=g(qe),ft=t.$createParagraphNode();ft.append(t.$createTextNode()),Qe.append(ft),De.append(Qe)}Oe.append(De)}return Oe}function A(Se){const ie=e.$findMatchingParent(Se,fe=>p(fe));return p(ie)?ie:null}function Z(Se){const ie=e.$findMatchingParent(Se,fe=>O(fe));if(O(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ae(Se){const ie=e.$findMatchingParent(Se,fe=>m(fe));if(m(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function he(Se){const ie=Z(Se);return ae(ie).getChildren().findIndex(Oe=>Oe.is(ie))}function se(Se){return Z(Se).getChildren().findIndex(fe=>fe.is(Se))}function Te(Se,ie){const fe=ae(Se),{x:Oe,y:Re}=fe.getCordsFromCellNode(Se,ie);return{above:fe.getCellNodeFromCords(Oe,Re-1,ie),below:fe.getCellNodeFromCords(Oe,Re+1,ie),left:fe.getCellNodeFromCords(Oe-1,Re,ie),right:fe.getCellNodeFromCords(Oe+1,Re,ie)}}function be(Se,ie){const fe=Se.getChildren();if(ie>=fe.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return fe[ie].remove(),Se}function Ue(Se,ie,fe=!0,Oe,Re){const De=Se.getChildren();if(ie>=De.length||ie<0)throw new Error("Table row target index out of range");const We=De[ie];if(O(We))for(let qe=0;qe<Oe;qe++){const Qe=We.getChildren(),ft=Qe.length,kt=T();for(let je=0;je<ft;je++){const Ve=Qe[je];if(!p(Ve))throw Error("Expected table cell");const{above:rt,below:_t}=Te(Ve,Re);let Et=r.NO_STATUS;const vt=rt&&rt.getWidth()||_t&&_t.getWidth()||void 0;(rt&&rt.hasHeaderState(r.COLUMN)||_t&&_t.hasHeaderState(r.COLUMN))&&(Et|=r.COLUMN);const Ot=g(Et,1,vt);Ot.append(t.$createParagraphNode()),kt.append(Ot)}fe?We.insertAfter(kt):We.insertBefore(kt)}else throw new Error("Row before insertion index does not exist.");return Se}function re(Se=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const fe=ie.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,We]=t.DEPRECATED_$computeGridMap(Re,Oe,Oe),qe=De[0].length,{startRow:Qe}=We;if(Se){const ft=Qe+Oe.__rowSpan-1,kt=De[ft],je=T();for(let rt=0;rt<qe;rt++){const{cell:_t,startRow:Et}=kt[rt];Et+_t.__rowSpan-1<=ft?je.append(g(r.NO_STATUS)):_t.setRowSpan(_t.__rowSpan+1)}const Ve=Re.getChildAtIndex(ft);if(!t.DEPRECATED_$isGridRowNode(Ve))throw Error("focusEndRow is not a GridRowNode");Ve.insertAfter(je)}else{const ft=De[Qe],kt=T();for(let Ve=0;Ve<qe;Ve++){const{cell:rt,startRow:_t}=ft[Ve];_t===Qe?kt.append(g(r.NO_STATUS)):rt.setRowSpan(rt.__rowSpan+1)}const je=Re.getChildAtIndex(Qe);if(!t.DEPRECATED_$isGridRowNode(je))throw Error("focusEndRow is not a GridRowNode");je.insertBefore(kt)}}function te(Se,ie,fe=!0,Oe,Re){const De=Se.getChildren(),We=[];for(let qe=0;qe<De.length;qe++){const Qe=De[qe];if(O(Qe))for(let ft=0;ft<Oe;ft++){const kt=Qe.getChildren();if(ie>=kt.length||ie<0)throw new Error("Table column target index out of range");const je=kt[ie];if(!p(je))throw Error("Expected table cell");const{left:Ve,right:rt}=Te(je,Re);let _t=r.NO_STATUS;(Ve&&Ve.hasHeaderState(r.ROW)||rt&&rt.hasHeaderState(r.ROW))&&(_t|=r.ROW);const Et=g(_t);Et.append(t.$createParagraphNode()),We.push({newTableCell:Et,targetCell:je})}}return We.forEach(({newTableCell:qe,targetCell:Qe})=>{fe?Qe.insertAfter(qe):Qe.insertBefore(qe)}),Se}function ce(Se=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const fe=ie.anchor.getNode(),Oe=ie.focus.getNode(),[Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,,We]=t.DEPRECATED_$getNodeTriplet(Oe),[qe,Qe,ft]=t.DEPRECATED_$computeGridMap(We,De,Re),kt=qe.length,je=Se?Math.max(Qe.startColumn,ft.startColumn):Math.min(Qe.startColumn,ft.startColumn),Ve=Se?je+De.__colSpan-1:je-1,rt=We.getFirstChild();if(!t.DEPRECATED_$isGridRowNode(rt))throw Error("Expected firstTable child to be a row");let _t=null;function Et(){const Ot=g(r.NO_STATUS).append(t.$createParagraphNode());return _t===null&&(_t=Ot),Ot}let vt=rt;e:for(let Ot=0;Ot<kt;Ot++){if(Ot!==0){const Ut=vt.getNextSibling();if(!t.DEPRECATED_$isGridRowNode(Ut))throw Error("Expected row nextSibling to be a row");vt=Ut}const Mt=qe[Ot];if(Ve<0){ct(vt,Et());continue}const{cell:xt,startColumn:Qt,startRow:bt}=Mt[Ve];if(Qt+xt.__colSpan-1<=Ve){let Ut=xt,It=bt,hr=Ve;for(;It!==Ot&&Ut.__rowSpan>1;)if(hr-=xt.__colSpan,hr>=0){const{cell:vr,startRow:Fi}=Mt[hr];Ut=vr,It=Fi}else{vt.append(Et());continue e}Ut.insertAfter(Et())}else xt.setColSpan(xt.__colSpan+1)}_t!==null&&Ye(_t)}function we(Se,ie){const fe=Se.getChildren();for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(O(Re)){const De=Re.getChildren();if(ie>=De.length||ie<0)throw new Error("Table column target index out of range");De[ie].remove()}}return Se}function Le(){const Se=t.$getSelection();if(!t.$INTERNAL_isPointSelection(Se))throw Error("Expected a INTERNAL_PointSelection");const ie=Se.anchor.getNode(),fe=Se.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startRow:ft}=qe,{startRow:kt}=Qe,je=kt+De.__rowSpan-1;if(We.length===je-ft+1){Re.remove();return}const Ve=We[0].length,rt=We[je+1],_t=Re.getChildAtIndex(je+1);for(let Et=je;Et>=ft;Et--){for(let Ot=Ve-1;Ot>=0;Ot--){const{cell:Mt,startRow:xt,startColumn:Qt}=We[Et][Ot];if(Qt===Ot&&(Et===ft&&xt<ft&&Mt.setRowSpan(Mt.__rowSpan-(xt-ft)),xt>=ft&&xt+Mt.__rowSpan-1>je)){if(Mt.setRowSpan(Mt.__rowSpan-(je-xt+1)),_t===null)throw Error("Expected nextRowNode not to be null");if(Ot===0)ct(_t,Mt);else{const{cell:bt}=rt[Ot-1];bt.insertAfter(Mt)}}}const vt=Re.getChildAtIndex(Et);if(!t.DEPRECATED_$isGridRowNode(vt))throw Error(`Expected GridNode childAtIndex(${String(Et)}) to be RowNode`);vt.remove()}if(rt!==void 0){const{cell:Et}=rt[0];Ye(Et)}else{const Et=We[ft-1],{cell:vt}=Et[0];Ye(vt)}}function Be(){const Se=t.$getSelection();if(!t.$INTERNAL_isPointSelection(Se))throw Error("Expected a INTERNAL_PointSelection");const ie=Se.anchor.getNode(),fe=Se.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startColumn:ft}=qe,{startRow:kt,startColumn:je}=Qe,Ve=Math.min(ft,je),rt=Math.max(ft+Oe.__colSpan-1,je+De.__colSpan-1),_t=rt-Ve+1;if(We[0].length===rt-Ve+1){Re.selectPrevious(),Re.remove();return}const vt=We.length;for(let xt=0;xt<vt;xt++)for(let Qt=Ve;Qt<=rt;Qt++){const{cell:bt,startColumn:Ut}=We[xt][Qt];if(Ut<Ve){if(Qt===Ve){const It=Ve-Ut;bt.setColSpan(bt.__colSpan-Math.min(_t,bt.__colSpan-It))}}else if(Ut+bt.__colSpan-1>rt){if(Qt===rt){const It=rt-Ut+1;bt.setColSpan(bt.__colSpan-It)}}else bt.remove()}const Ot=We[kt],Mt=Ot[je+De.__colSpan];if(Mt!==void 0){const{cell:xt}=Mt;Ye(xt)}else{const xt=Ot[je-1],{cell:Qt}=xt;Ye(Qt)}}function Ye(Se){const ie=Se.getFirstDescendant();ie==null?Se.selectStart():ie.getParentOrThrow().selectStart()}function ct(Se,ie){const fe=Se.getFirstChild();fe!==null?fe.insertBefore(ie):Se.append(ie)}function yt(){const Se=t.$getSelection();if(!t.$INTERNAL_isPointSelection(Se))throw Error("Expected a INTERNAL_PointSelection");const ie=Se.anchor.getNode(),[fe,Oe,Re]=t.DEPRECATED_$getNodeTriplet(ie),De=fe.__colSpan,We=fe.__rowSpan;if(De>1){for(let qe=1;qe<De;qe++)fe.insertAfter(g(r.NO_STATUS));fe.setColSpan(1)}if(We>1){const[qe,Qe]=t.DEPRECATED_$computeGridMap(Re,fe,fe),{startColumn:ft,startRow:kt}=Qe;let je;for(let Ve=1;Ve<We;Ve++){const rt=kt+Ve,_t=qe[rt];if(je=(je||Oe).getNextSibling(),!t.DEPRECATED_$isGridRowNode(je))throw Error("Expected row next sibling to be a row");let Et=null;for(let vt=0;vt<ft;vt++){const Ot=_t[vt],Mt=Ot.cell;Ot.startRow===rt&&(Et=Mt),Mt.__colSpan>1&&(vt+=Mt.__colSpan-1)}if(Et===null)for(let vt=0;vt<De;vt++)ct(je,g(r.NO_STATUS));else for(let vt=0;vt<De;vt++)Et.insertAfter(g(r.NO_STATUS))}fe.setRowSpan(1)}}const dt=t.createCommand("INSERT_TABLE_COMMAND");return Gt.$createTableCellNode=g,Gt.$createTableNode=k,Gt.$createTableNodeWithDimensions=y,Gt.$createTableRowNode=T,Gt.$deleteTableColumn=we,Gt.$deleteTableColumn__EXPERIMENTAL=Be,Gt.$deleteTableRow__EXPERIMENTAL=Le,Gt.$getElementGridForTableNode=G,Gt.$getTableCellNodeFromLexicalNode=A,Gt.$getTableColumnIndexFromTableCellNode=se,Gt.$getTableNodeFromLexicalNodeOrThrow=ae,Gt.$getTableRowIndexFromTableCellNode=he,Gt.$getTableRowNodeFromTableCellNodeOrThrow=Z,Gt.$insertTableColumn=te,Gt.$insertTableColumn__EXPERIMENTAL=ce,Gt.$insertTableRow=Ue,Gt.$insertTableRow__EXPERIMENTAL=re,Gt.$isTableCellNode=p,Gt.$isTableNode=m,Gt.$isTableRowNode=O,Gt.$removeTableRowAtIndex=be,Gt.$unmergeCell=yt,Gt.INSERT_TABLE_COMMAND=dt,Gt.TableCellHeaderStates=r,Gt.TableCellNode=c,Gt.TableNode=Y,Gt.TableRowNode=C,Gt.TableSelection=x,Gt.applyTableHandlers=$,Gt.getCellFromTarget=H,Gt.getTableSelectionFromTableElement=P,Gt}var Yt={},_h;function NC(){if(_h)return Yt;_h=1;var t=Bt(),e=on();let n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(y){let A=new c(y.__headerState,y.__colSpan,y.__width,y.__key);return A.__rowSpan=y.__rowSpan,A.__backgroundColor=y.__backgroundColor,A}static importDOM(){return{td:()=>({conversion:d,priority:0}),th:()=>({conversion:d,priority:0})}}static importJSON(y){let A=y.rowSpan||1,Z=g(y.headerState,y.colSpan||1,y.width||void 0);return Z.__rowSpan=A,Z.__backgroundColor=y.backgroundColor||null,Z}constructor(y=r.NO_STATUS,A=1,Z,ae){super(A,ae),this.__headerState=y,this.__width=Z,this.__backgroundColor=null}createDOM(y){let A=document.createElement(this.getTag());return this.__width&&(A.style.width=`${this.__width}px`),1<this.__colSpan&&(A.colSpan=this.__colSpan),1<this.__rowSpan&&(A.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(A.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(A,y.theme.tableCell,this.hasHeader()&&y.theme.tableCellHeader),A}exportDOM(y){if({element:y}=super.exportDOM(y),y){var A=this.getParentOrThrow().getChildrenSize();y.style.border="1px solid black",1<this.__colSpan&&(y.colSpan=this.__colSpan),1<this.__rowSpan&&(y.rowSpan=this.__rowSpan),y.style.width=`${this.getWidth()||Math.max(90,700/A)}px`,y.style.verticalAlign="top",y.style.textAlign="start",A=this.getBackgroundColor(),A!==null?y.style.backgroundColor=A:this.hasHeader()&&(y.style.backgroundColor="#f2f3f5")}return{element:y}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(y){return this.getWritable().__headerState=y,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(y){return this.getWritable().__width=y,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(y){this.getWritable().__backgroundColor=y}toggleHeaderStyle(y){let A=this.getWritable();return A.__headerState=(A.__headerState&y)===y?A.__headerState-y:A.__headerState+y,A}hasHeaderState(y){return(this.getHeaderStyles()&y)===y}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(y){return y.__headerState!==this.__headerState||y.__width!==this.__width||y.__colSpan!==this.__colSpan||y.__rowSpan!==this.__rowSpan||y.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(m){var y=m.nodeName.toLowerCase();let A;return n.test(m.style.width)&&(A=parseFloat(m.style.width)),y=g(y==="th"?r.ROW:r.NO_STATUS,m.colSpan,A),y.__rowSpan=m.rowSpan,m=m.style.backgroundColor,m!==""&&(y.__backgroundColor=m),{forChild:(Z,ae)=>p(ae)&&!t.$isElementNode(Z)?(ae=t.$createParagraphNode(),t.$isLineBreakNode(Z)&&Z.getTextContent()===`
75
+ `?null:(ae.append(Z),ae)):Z,node:y}}function g(m,y=1,A){return t.$applyNodeReplacement(new c(m,y,A))}function p(m){return m instanceof c}class C extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(y){return new C(y.__height,y.__key)}static importDOM(){return{tr:()=>({conversion:S,priority:0})}}static importJSON(y){return T(y.height)}constructor(y,A){super(A),this.__height=y}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(y){let A=document.createElement("tr");return this.__height&&(A.style.height=`${this.__height}px`),e.addClassNamesToElement(A,y.theme.tableRow),A}isShadowRoot(){return!0}setHeight(y){return this.getWritable().__height=y,this.__height}getHeight(){return this.getLatest().__height}updateDOM(y){return y.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function S(m){let y;return n.test(m.style.height)&&(y=parseFloat(m.style.height)),{node:T(y)}}function T(m){return t.$applyNodeReplacement(new C(m))}function O(m){return m instanceof C}function R(m){let y=new URLSearchParams;y.append("code",m);for(let A=1;A<arguments.length;A++)y.append("v",arguments[A]);throw Error(`Minified Lexical error #${m}; visit https://lexical.dev/docs/error?${y} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class x{constructor(y,A){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=A,this.editor=y,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(y=>y())}trackTableGrid(){let y=new MutationObserver(A=>{this.editor.update(()=>{var Z=!1;for(let ae=0;ae<A.length;ae++){const he=A[ae].target.nodeName;if(he==="TABLE"||he==="TR"){Z=!0;break}}if(Z){if(Z=this.editor.getElementByKey(this.tableNodeKey),!Z)throw Error("Expected to find TableElement in DOM");this.grid=$(Z)}})});this.editor.update(()=>{let A=this.editor.getElementByKey(this.tableNodeKey);if(!A)throw Error("Expected to find TableElement in DOM");this.grid=$(A),y.observe(A,{childList:!0,subtree:!0})})}clearHighlight(){let y=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(),y.update(()=>{var A=t.$getNodeByKey(this.tableNodeKey);if(!D(A))throw Error("Expected TableNode.");if(A=y.getElementByKey(this.tableNodeKey),!A)throw Error("Expected to find TableElement in DOM");A=$(A),W(y,A,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let y=this.editor;y.update(()=>{let A=y.getElementByKey(this.tableNodeKey);if(!A)throw Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(A,y._config.theme.tableSelection),A.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let y=this.editor;y.update(()=>{let A=y.getElementByKey(this.tableNodeKey);if(!A)throw Error("Expected to find TableElement in DOM");e.addClassNamesToElement(A,y._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(y){if(y!=null&&y.gridKey===this.tableNodeKey){let A=this.editor;this.gridSelection=y,this.isHighlightingCells=!0,this.disableHighlightStyle(),W(A,this.grid,this.gridSelection)}else y==null?this.clearHighlight():(this.tableNodeKey=y.gridKey,this.updateTableGridSelection(y))}setFocusCellForSelection(y,A=!1){let Z=this.editor;Z.update(()=>{var ae=t.$getNodeByKey(this.tableNodeKey);if(!D(ae))throw Error("Expected TableNode.");if(!Z.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ae=y.x;let he=y.y;if(this.focusCell=y,this.anchorCell!==null){let se=b?(Z._window||window).getSelection():null;se&&se.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ae||this.anchorY!==he||A))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ae===this.focusX&&he===this.focusY)return;this.focusX=ae,this.focusY=he,this.isHighlightingCells&&(ae=t.$getNearestNodeFromDOMNode(y.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(ae)&&(ae=ae.getKey(),this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ae,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Z.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),W(Z,this.grid,this.gridSelection)))})}setAnchorCellForSelection(y){this.isHighlightingCells=!1,this.anchorCell=y,this.anchorX=y.x,this.anchorY=y.y,this.editor.update(()=>{var A=t.$getNearestNodeFromDOMNode(y.elem);p(A)&&(A=A.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=A)})}formatCells(y){this.editor.update(()=>{let A=t.$getSelection();t.DEPRECATED_$isGridSelection(A)||R(11);let Z=t.$createRangeSelection(),ae=Z.anchor,he=Z.focus;A.getNodes().forEach(se=>{p(se)&&se.getTextContentSize()!==0&&(ae.set(se.getKey(),0,"element"),he.set(se.getKey(),se.getChildrenSize(),"element"),Z.formatText(y))}),t.$setSelection(A),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let y=this.editor;y.update(()=>{let A=t.$getNodeByKey(this.tableNodeKey);if(!D(A))throw Error("Expected TableNode.");var Z=t.$getSelection();t.DEPRECATED_$isGridSelection(Z)||R(11),Z=Z.getNodes().filter(p),Z.length===this.grid.columns*this.grid.rows?(A.selectPrevious(),A.remove(),t.$getRoot().selectStart()):(Z.forEach(ae=>{if(t.$isElementNode(ae)){let he=t.$createParagraphNode(),se=t.$createTextNode();he.append(se),ae.append(he),ae.getChildren().forEach(Te=>{Te!==he&&Te.remove()})}}),W(y,this.grid,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0))})}}function w(m){for(;m!=null;){let y=m.nodeName;if(y==="TD"||y==="TH"){if(m=m._cell,m===void 0)break;return m}m=m.parentNode}return null}function $(m){let y=[],A={cells:y,columns:0,rows:0};var Z=m.firstChild;let ae=m=0;for(y.length=0;Z!=null;){var he=Z.nodeName;if(he==="TD"||he==="TH"){he=Z,he={elem:he,hasBackgroundColor:he.style.backgroundColor!=="",highlighted:!1,x:m,y:ae},Z._cell=he;let se=y[ae];se===void 0&&(se=y[ae]=[]),se[m]=he}else if(he=Z.firstChild,he!=null){Z=he;continue}if(he=Z.nextSibling,he!=null)m++,Z=he;else if(he=Z.parentNode,he!=null){if(Z=he.nextSibling,Z==null)break;ae++,m=0}}return A.columns=m+1,A.rows=ae+1,A}function W(m,y,A){let Z=new Set(A?A.getNodes():[]);P(y,(ae,he)=>{let se=ae.elem;Z.has(he)?(ae.highlighted=!0,le(m,ae)):(ae.highlighted=!1,j(m,ae),se.getAttribute("style")||se.removeAttribute("style"))})}function P(m,y){({cells:m}=m);for(let A=0;A<m.length;A++){let Z=m[A];if(Z)for(let ae=0;ae<Z.length;ae++){let he=Z[ae];if(!he)continue;let se=t.$getNearestNodeFromDOMNode(he.elem);se!==null&&y(he,se,{x:ae,y:A})}}}function H(m,y){y.disableHighlightStyle(),P(y.grid,A=>{A.highlighted=!0,le(m,A)})}function B(m,y){y.enableHighlightStyle(),P(y.grid,A=>{let Z=A.elem;A.highlighted=!1,j(m,A),Z.getAttribute("style")||Z.removeAttribute("style")})}let z=(m,y,A,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return A!==(he?m.grid.columns-1:0)?(m=y.getCellNodeFromCordsOrThrow(A+(he?1:-1),Z,m.grid),he?m.selectStart():m.selectEnd()):Z!==(he?m.grid.rows-1:0)?(m=y.getCellNodeFromCordsOrThrow(he?0:m.grid.columns-1,Z+(he?1:-1),m.grid),he?m.selectStart():m.selectEnd()):he?y.selectNext():y.selectPrevious(),!0;case"up":return Z!==0?y.getCellNodeFromCordsOrThrow(A,Z-1,m.grid).selectEnd():y.selectPrevious(),!0;case"down":return Z!==m.grid.rows-1?y.getCellNodeFromCordsOrThrow(A,Z+1,m.grid).selectStart():y.selectNext(),!0;default:return!1}},X=(m,y,A,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return A!==(he?m.grid.columns-1:0)&&m.setFocusCellForSelection(y.getCellFromCordsOrThrow(A+(he?1:-1),Z,m.grid)),!0;case"up":return Z!==0?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(A,Z-1,m.grid)),!0):!1;case"down":return Z!==m.grid.rows-1?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(A,Z+1,m.grid)),!0):!1;default:return!1}};function ee(m,y){if(t.$isRangeSelection(m)||t.DEPRECATED_$isGridSelection(m)){let A=y.isParentOf(m.anchor.getNode());return m=y.isParentOf(m.focus.getNode()),A&&m}return!1}function le(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||R(131),y.getBackgroundColor()===null?m.style.setProperty("background-color","rgb(172,206,247)"):m.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),m.style.setProperty("caret-color","transparent")}function j(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||R(131),y.getBackgroundColor()===null&&m.style.removeProperty("background-color"),m.style.removeProperty("background-image"),m.style.removeProperty("caret-color")}function U(m){return m=e.$findMatchingParent(m,p),p(m)?m:null}function q(m){return m=e.$findMatchingParent(m,D),D(m)?m:null}function me(m,y,A,Z,ae){let he=t.$getSelection();if(!ee(he,Z))return!1;if(t.$isRangeSelection(he)&&he.isCollapsed()){if(A==="backward"||A==="forward")return!1;let{anchor:Ue,focus:re}=he;var se=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p);if(!p(se)||!se.is(Te))return!1;if(Te=q(se),Te!==Z&&Te!=null){var be=m.getElementByKey(Te.getKey());if(be!=null)return ae.grid=$(be),me(m,y,A,Te,ae)}if(Te=m.getElementByKey(se.__key),be=m.getElementByKey(Ue.key),be==null||Te==null)return!1;if(Ue.type==="element")Te=be.getBoundingClientRect();else{if(Te=window.getSelection(),Te===null||Te.rangeCount===0)return!1;Te=Te.getRangeAt(0).getBoundingClientRect()}if(be=A==="up"?se.getFirstChild():se.getLastChild(),be==null||(m=m.getElementByKey(be.__key),m==null))return!1;if(m=m.getBoundingClientRect(),A==="up"?m.top>Te.top-Te.height:Te.bottom+Te.height>m.bottom){if(_e(y),m=Z.getCordsFromCellNode(se,ae.grid),y.shiftKey)A=Z.getCellFromCordsOrThrow(m.x,m.y,ae.grid),ae.setAnchorCellForSelection(A),ae.setFocusCellForSelection(A,!0);else return z(ae,Z,m.x,m.y,A);return!0}}else if(t.DEPRECATED_$isGridSelection(he)){let{anchor:Ue,focus:re}=he;return be=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p),[se]=he.getNodes(),m=m.getElementByKey(se.getKey()),!p(be)||!p(Te)||!D(se)||m==null?!1:(ae.updateTableGridSelection(he),m=$(m),be=Z.getCordsFromCellNode(be,m),be=Z.getCellFromCordsOrThrow(be.x,be.y,m),ae.setAnchorCellForSelection(be),_e(y),y.shiftKey?(y=Z.getCordsFromCellNode(Te,m),X(ae,se,y.x,y.y,A)):(Te.selectEnd(),!0))}return!1}function _e(m){m.preventDefault(),m.stopImmediatePropagation(),m.stopPropagation()}class pe extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(y){return new pe(y.__key)}static importDOM(){return{table:()=>({conversion:ue,priority:1})}}static importJSON(){return K()}constructor(y){super(y)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(y){let A=document.createElement("table");return e.addClassNamesToElement(A,y.theme.table),A}updateDOM(){return!1}exportDOM(y){return{...super.exportDOM(y),after:A=>{if(A){let Z=A.cloneNode(),ae=document.createElement("colgroup"),he=document.createElement("tbody");if(e.isHTMLElement(A)&&he.append(...A.children),A=this.getFirstChildOrThrow(),!O(A))throw Error("Expected to find row node.");A=A.getChildrenSize();for(let se=0;se<A;se++){let Te=document.createElement("col");ae.append(Te)}return Z.replaceChildren(ae,he),Z}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(y,A){let{rows:Z,cells:ae}=A;for(A=0;A<Z;A++){var he=ae[A];if(he!=null&&(he=he.findIndex(se=>{if(se)return{elem:se}=se,t.$getNearestNodeFromDOMNode(se)===y}),he!==-1))return{x:he,y:A}}throw Error("Cell not found in table.")}getCellFromCords(y,A,Z){return{cells:Z}=Z,A=Z[A],A==null?null:(y=A[y],y??null)}getCellFromCordsOrThrow(y,A,Z){if(y=this.getCellFromCords(y,A,Z),!y)throw Error("Cell not found at cords.");return y}getCellNodeFromCords(y,A,Z){return y=this.getCellFromCords(y,A,Z),y==null?null:(y=t.$getNearestNodeFromDOMNode(y.elem),p(y)?y:null)}getCellNodeFromCordsOrThrow(y,A,Z){if(y=this.getCellNodeFromCords(y,A,Z),!y)throw Error("Node at cords not TableCellNode.");return y}canSelectBefore(){return!0}canIndent(){return!1}}function ue(){return{node:K()}}function K(){return t.$applyNodeReplacement(new pe)}function D(m){return m instanceof pe}function V(m){if(m=e.$findMatchingParent(m,y=>O(y)),O(m))return m;throw Error("Expected table cell to be inside of table row.")}function ne(m){if(m=e.$findMatchingParent(m,y=>D(y)),D(m))return m;throw Error("Expected table cell to be inside of table.")}function Y(m,y){let A=ne(m),{x:Z,y:ae}=A.getCordsFromCellNode(m,y);return{above:A.getCellNodeFromCords(Z,ae-1,y),below:A.getCellNodeFromCords(Z,ae+1,y),left:A.getCellNodeFromCords(Z-1,ae,y),right:A.getCellNodeFromCords(Z+1,ae,y)}}function G(m){let y=m.getFirstDescendant();y==null?m.selectStart():y.getParentOrThrow().selectStart()}function Q(m,y){let A=m.getFirstChild();A!==null?A.insertBefore(y):m.append(y)}let k=t.createCommand("INSERT_TABLE_COMMAND");return Yt.$createTableCellNode=g,Yt.$createTableNode=K,Yt.$createTableNodeWithDimensions=function(m,y,A=!0){let Z=K();for(let he=0;he<m;he++){let se=T();for(let Te=0;Te<y;Te++){var ae=r.NO_STATUS;typeof A=="object"?(he===0&&A.rows&&(ae|=r.ROW),Te===0&&A.columns&&(ae|=r.COLUMN)):A&&(he===0&&(ae|=r.ROW),Te===0&&(ae|=r.COLUMN)),ae=g(ae);let be=t.$createParagraphNode();be.append(t.$createTextNode()),ae.append(be),se.append(ae)}Z.append(se)}return Z},Yt.$createTableRowNode=T,Yt.$deleteTableColumn=function(m,y){let A=m.getChildren();for(let ae=0;ae<A.length;ae++){var Z=A[ae];if(O(Z)){if(Z=Z.getChildren(),y>=Z.length||0>y)throw Error("Table column target index out of range");Z[y].remove()}}return m},Yt.$deleteTableColumn__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[A,,Z]=t.DEPRECATED_$getNodeTriplet(y);[y]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,A,y);var{startColumn:Te}=he;let{startRow:be,startColumn:Ue}=se;m=Math.min(Te,Ue),Te=Math.max(Te+A.__colSpan-1,Ue+y.__colSpan-1);let re=Te-m+1;if(ae[0].length===Te-m+1)Z.selectPrevious(),Z.remove();else{var te=ae.length;for(let ce=0;ce<te;ce++)for(let we=m;we<=Te;we++){let{cell:Le,startColumn:Be}=ae[ce][we];Be<m?we===m&&Le.setColSpan(Le.__colSpan-Math.min(re,Le.__colSpan-(m-Be))):Be+Le.__colSpan-1>Te?we===Te&&Le.setColSpan(Le.__colSpan-(Te-Be+1)):Le.remove()}m=ae[be],y=m[Ue+y.__colSpan],y!==void 0?({cell:y}=y,G(y)):({cell:y}=m[Ue-1],G(y))}},Yt.$deleteTableRow__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[A,,Z]=t.DEPRECATED_$getNodeTriplet(y);[m]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,A,m);({startRow:y}=he);var{startRow:Te}=se;if(m=Te+m.__rowSpan-1,ae.length===m-y+1)Z.remove();else{Te=ae[0].length;var be=ae[m+1],Ue=Z.getChildAtIndex(m+1);for(let te=m;te>=y;te--){for(var re=Te-1;0<=re;re--){let{cell:ce,startRow:we,startColumn:Le}=ae[te][re];if(Le===re&&(te===y&&we<y&&ce.setRowSpan(ce.__rowSpan-(we-y)),we>=y&&we+ce.__rowSpan-1>m))if(ce.setRowSpan(ce.__rowSpan-(m-we+1)),Ue===null&&R(122),re===0)Q(Ue,ce);else{let{cell:Be}=be[re-1];Be.insertAfter(ce)}}re=Z.getChildAtIndex(te),t.DEPRECATED_$isGridRowNode(re)||R(123,String(te)),re.remove()}be!==void 0?({cell:y}=be[0],G(y)):({cell:y}=ae[y-1][0],G(y))}},Yt.$getElementGridForTableNode=function(m,y){if(m=m.getElementByKey(y.getKey()),m==null)throw Error("Table Element Not Found");return $(m)},Yt.$getTableCellNodeFromLexicalNode=function(m){return m=e.$findMatchingParent(m,y=>p(y)),p(m)?m:null},Yt.$getTableColumnIndexFromTableCellNode=function(m){return V(m).getChildren().findIndex(y=>y.is(m))},Yt.$getTableNodeFromLexicalNodeOrThrow=ne,Yt.$getTableRowIndexFromTableCellNode=function(m){let y=V(m);return ne(y).getChildren().findIndex(A=>A.is(y))},Yt.$getTableRowNodeFromTableCellNodeOrThrow=V,Yt.$insertTableColumn=function(m,y,A=!0,Z,ae){let he=m.getChildren(),se=[];for(let Ue=0;Ue<he.length;Ue++){let re=he[Ue];if(O(re))for(let te=0;te<Z;te++){var Te=re.getChildren();if(y>=Te.length||0>y)throw Error("Table column target index out of range");Te=Te[y],p(Te)||R(12);let{left:ce,right:we}=Y(Te,ae);var be=r.NO_STATUS;(ce&&ce.hasHeaderState(r.ROW)||we&&we.hasHeaderState(r.ROW))&&(be|=r.ROW),be=g(be),be.append(t.$createParagraphNode()),se.push({newTableCell:be,targetCell:Te})}}return se.forEach(({newTableCell:Ue,targetCell:re})=>{A?re.insertAfter(Ue):re.insertBefore(Ue)}),m},Yt.$insertTableColumn__EXPERIMENTAL=function(m=!0){function y(){let te=g(r.NO_STATUS).append(t.$createParagraphNode());return Ue===null&&(Ue=te),te}var A=t.$getSelection();if(!t.$INTERNAL_isPointSelection(A))throw Error("Expected a PointSeleciton");var Z=A.anchor.getNode();A=A.focus.getNode(),[Z]=t.DEPRECATED_$getNodeTriplet(Z);let[ae,,he]=t.DEPRECATED_$getNodeTriplet(A),[se,Te,be]=t.DEPRECATED_$computeGridMap(he,ae,Z);Z=se.length,A=m?Math.max(Te.startColumn,be.startColumn):Math.min(Te.startColumn,be.startColumn),m=m?A+ae.__colSpan-1:A-1,A=he.getFirstChild(),t.DEPRECATED_$isGridRowNode(A)||R(120);let Ue=null;var re=A;e:for(A=0;A<Z;A++){A!==0&&(re=re.getNextSibling(),t.DEPRECATED_$isGridRowNode(re)||R(121));let te=se[A];if(0>m){Q(re,y());continue}let{cell:ce,startColumn:we,startRow:Le}=te[m];if(we+ce.__colSpan-1<=m){let Be=ce,Ye=Le,ct=m;for(;Ye!==A&&1<Be.__rowSpan;)if(ct-=ce.__colSpan,0<=ct){let{cell:yt,startRow:dt}=te[ct];Be=yt,Ye=dt}else{re.append(y());continue e}Be.insertAfter(y())}else ce.setColSpan(ce.__colSpan+1)}Ue!==null&&G(Ue)},Yt.$insertTableRow=function(m,y,A=!0,Z,ae){var he=m.getChildren();if(y>=he.length||0>y)throw Error("Table row target index out of range");if(y=he[y],O(y))for(he=0;he<Z;he++){let Te=y.getChildren(),be=Te.length,Ue=T();for(let re=0;re<be;re++){var se=Te[re];p(se)||R(12);let{above:te,below:ce}=Y(se,ae);se=r.NO_STATUS;let we=te&&te.getWidth()||ce&&ce.getWidth()||void 0;(te&&te.hasHeaderState(r.COLUMN)||ce&&ce.hasHeaderState(r.COLUMN))&&(se|=r.COLUMN),se=g(se,1,we),se.append(t.$createParagraphNode()),Ue.append(se)}A?y.insertAfter(Ue):y.insertBefore(Ue)}else throw Error("Row before insertion index does not exist.");return m},Yt.$insertTableRow__EXPERIMENTAL=function(m=!0){var y=t.$getSelection();if(!t.$INTERNAL_isPointSelection(y))throw Error("Expected a INTERNAL_PointSelection");y=y.focus.getNode();let[A,,Z]=t.DEPRECATED_$getNodeTriplet(y),[ae,he]=t.DEPRECATED_$computeGridMap(Z,A,A);y=ae[0].length;var{startRow:se}=he;if(m){m=se+A.__rowSpan-1;var Te=ae[m];se=T();for(var be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re+Ue.__rowSpan-1<=m?se.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(m),t.DEPRECATED_$isGridRowNode(y)||R(119),y.insertAfter(se)}else{for(Te=ae[se],m=T(),be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re===se?m.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(se),t.DEPRECATED_$isGridRowNode(y)||R(119),y.insertBefore(m)}},Yt.$isTableCellNode=p,Yt.$isTableNode=D,Yt.$isTableRowNode=O,Yt.$removeTableRowAtIndex=function(m,y){let A=m.getChildren();if(y>=A.length||0>y)throw Error("Expected table cell to be inside of table row.");return A[y].remove(),m},Yt.$unmergeCell=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");m=m.anchor.getNode();let[y,A,Z]=t.DEPRECATED_$getNodeTriplet(m);m=y.__colSpan;let ae=y.__rowSpan;if(1<m){for(var he=1;he<m;he++)y.insertAfter(g(r.NO_STATUS));y.setColSpan(1)}if(1<ae){let[be,Ue]=t.DEPRECATED_$computeGridMap(Z,y,y),{startColumn:re,startRow:te}=Ue,ce;for(he=1;he<ae;he++){var se=te+he;let we=be[se];ce=(ce||A).getNextSibling(),t.DEPRECATED_$isGridRowNode(ce)||R(125);var Te=null;for(let Le=0;Le<re;Le++){let Be=we[Le],Ye=Be.cell;Be.startRow===se&&(Te=Ye),1<Ye.__colSpan&&(Le+=Ye.__colSpan-1)}if(Te===null)for(Te=0;Te<m;Te++)Q(ce,g(r.NO_STATUS));else for(se=0;se<m;se++)Te.insertAfter(g(r.NO_STATUS))}y.setRowSpan(1)}},Yt.INSERT_TABLE_COMMAND=k,Yt.TableCellHeaderStates=r,Yt.TableCellNode=c,Yt.TableNode=pe,Yt.TableRowNode=C,Yt.TableSelection=x,Yt.applyTableHandlers=function(m,y,A,Z){function ae(re){return re=m.getCordsFromCellNode(re,se.grid),m.getCellFromCordsOrThrow(re.x,re.y,se.grid)}let he=A.getRootElement();if(he===null)throw Error("No root element.");let se=new x(A,m.getKey()),Te=A._window||window;y.__lexicalTableSelection=se,y.addEventListener("mousedown",re=>{setTimeout(()=>{if(re.button===0&&Te){var te=w(re.target);te!==null&&(_e(re),se.setAnchorCellForSelection(te));var ce=()=>{Te.removeEventListener("mouseup",ce),Te.removeEventListener("mousemove",we)},we=Le=>{const Be=w(Le.target);Be===null||se.anchorX===Be.x&&se.anchorY===Be.y||(Le.preventDefault(),se.setFocusCellForSelection(Be))};Te.addEventListener("mouseup",ce),Te.addEventListener("mousemove",we)}},0)});let be=re=>{re.button===0&&A.update(()=>{const te=t.$getSelection(),ce=re.target;t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&he.contains(ce)&&se.clearHighlight()})};Te.addEventListener("mousedown",be),se.listenersToRemove.add(()=>Te.removeEventListener("mousedown",be)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_DOWN_COMMAND,re=>me(A,re,"down",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_UP_COMMAND,re=>me(A,re,"up",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_LEFT_COMMAND,re=>me(A,re,"backward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,re=>me(A,re,"forward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.KEY_ESCAPE_COMMAND,re=>{var te=t.$getSelection();return t.DEPRECATED_$isGridSelection(te)&&(te=e.$findMatchingParent(te.focus.getNode(),p),p(te))?(_e(re),te.selectEnd(),!0):!1},t.COMMAND_PRIORITY_HIGH));let Ue=re=>()=>{var te=t.$getSelection();if(!ee(te,m))return!1;if(t.DEPRECATED_$isGridSelection(te))return se.clearText(),!0;if(t.$isRangeSelection(te)){const Le=e.$findMatchingParent(te.anchor.getNode(),Be=>p(Be));if(!p(Le))return!1;var ce=te.anchor.getNode(),we=te.focus.getNode();if(ce=m.isParentOf(ce),we=m.isParentOf(we),ce&&!we||we&&!ce)return se.clearText(),!0;if(ce=(we=e.$findMatchingParent(te.anchor.getNode(),Be=>t.$isElementNode(Be)))&&e.$findMatchingParent(we,Be=>t.$isElementNode(Be)&&p(Be.getParent())),!t.$isElementNode(ce)||!t.$isElementNode(we))return!1;if(re===t.DELETE_LINE_COMMAND&&ce.getPreviousSibling()===null)return!0;if((re===t.DELETE_CHARACTER_COMMAND||re===t.DELETE_WORD_COMMAND)&&te.isCollapsed()&&te.anchor.offset===0&&we!==ce){te=we.getChildren();const Be=t.$createParagraphNode();return te.forEach(Ye=>Be.append(Ye)),we.replace(Be),we.getWritable().__parent=Le.getKey(),!0}}return!1};return[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(re=>{se.listenersToRemove.add(A.registerCommand(re,Ue(re),t.COMMAND_PRIORITY_CRITICAL))}),y=re=>{const te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(re.preventDefault(),re.stopPropagation(),se.clearText(),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},se.listenersToRemove.add(A.registerCommand(t.KEY_BACKSPACE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.KEY_DELETE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.FORMAT_TEXT_COMMAND,re=>{let te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(se.formatCells(re),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var re=t.$getSelection();return ee(re,m)&&(t.DEPRECATED_$isGridSelection(re)?se.clearHighlight():t.$isRangeSelection(re)&&(re=e.$findMatchingParent(re.anchor.getNode(),te=>p(te)),p(re))),!1},t.COMMAND_PRIORITY_CRITICAL)),Z&&se.listenersToRemove.add(A.registerCommand(t.KEY_TAB_COMMAND,re=>{var te=t.$getSelection();return!t.$isRangeSelection(te)||!te.isCollapsed()||!ee(te,m)||(te=U(te.anchor.getNode()),te===null)?!1:(_e(re),te=m.getCordsFromCellNode(te,se.grid),z(se,m,te.x,te.y,re.shiftKey?"backward":"forward"),!0)},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(A.registerCommand(t.FOCUS_COMMAND,()=>m.isSelected(),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(A.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{let re=t.$getSelection(),te=t.$getPreviousSelection();if(t.$isRangeSelection(re)){let{anchor:Ye,focus:ct}=re;var ce=Ye.getNode(),we=ct.getNode();ce=U(ce),we=U(we);var Le=ce&&m.is(q(ce)),Be=we&&m.is(q(we));let yt=Le!==Be;Be=Le&&Be,Le=re.isBackward(),yt?(ce=re.clone(),ce.focus.set(m.getKey(),Le?0:m.getChildrenSize(),"element"),t.$setSelection(ce),H(A,se)):Be&&!ce.is(we)&&(se.setAnchorCellForSelection(ae(ce)),se.setFocusCellForSelection(ae(we),!0))}return re&&!re.is(te)&&(t.DEPRECATED_$isGridSelection(re)||t.DEPRECATED_$isGridSelection(te))&&se.gridSelection&&!se.gridSelection.is(te)?(t.DEPRECATED_$isGridSelection(re)&&re.gridKey===se.tableNodeKey?se.updateTableGridSelection(re):!t.DEPRECATED_$isGridSelection(re)&&t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&se.updateTableGridSelection(null),!1):(se.hasHijackedSelectionStyles&&!m.isSelected()?B(A,se):!se.hasHijackedSelectionStyles&&m.isSelected()&&H(A,se),!1)},t.COMMAND_PRIORITY_CRITICAL)),se},Yt.getCellFromTarget=w,Yt.getTableSelectionFromTableElement=function(m){return m.__lexicalTableSelection},Yt}var Eu,yh;function pd(){return yh||(yh=1,Eu=process.env.NODE_ENV==="development"?yC():NC()),Eu}var Nh;function CC(){if(Nh)return Cu;Nh=1;var t=Un(),e=pd(),n=on(),r=Bt(),c=et;function d({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:C=!0}){const[S]=t.useLexicalComposerContext();return c.useEffect(()=>{if(!S.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return S.registerCommand(e.INSERT_TABLE_COMMAND,({columns:T,rows:O,includeHeaders:R})=>{const b=e.$createTableNodeWithDimensions(Number(O),Number(T),R);n.$insertNodeToNearestRoot(b);const x=b.getFirstDescendant();return r.$isTextNode(x)&&x.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[S]),c.useEffect(()=>{const T=new Map,O=b=>{const x=b.getKey(),w=S.getElementByKey(x);if(w&&!T.has(x)){const $=e.applyTableHandlers(b,w,S,C);T.set(x,$)}};S.getEditorState().read(()=>{const b=r.$nodesOfType(e.TableNode);for(const x of b)e.$isTableNode(x)&&O(x)});const R=S.registerMutationListener(e.TableNode,b=>{for(const[x,w]of b)if(w==="created")S.getEditorState().read(()=>{const $=r.$getNodeByKey(x);e.$isTableNode($)&&O($)});else if(w==="destroyed"){const $=T.get(x);$!==void 0&&($.removeListeners(),T.delete(x))}});return()=>{R();for(const[,b]of T)b.removeListeners()}},[S,C]),c.useEffect(()=>{if(!g)return S.registerNodeTransform(e.TableCellNode,T=>{if(T.getColSpan()>1||T.getRowSpan()>1){const[,,O]=r.DEPRECATED_$getNodeTriplet(T),[R]=r.DEPRECATED_$computeGridMap(O,T,T),b=R.length,x=R[0].length;let w=O.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(w))throw Error("Expected TableNode first child to be a RowNode");const $=[];for(let W=0;W<b;W++){if(W!==0&&(w=w.getNextSibling(),!r.DEPRECATED_$isGridRowNode(w)))throw Error("Expected TableNode first child to be a RowNode");let P=null;for(let H=0;H<x;H++){const B=R[W][H],z=B.cell;if(B.startRow===W&&B.startColumn===H)P=z,$.push(z);else if(z.getColSpan()>1||z.getRowSpan()>1){const X=e.$createTableCellNode(z.__headerState);P!==null?P.insertAfter(X):n.$insertFirst(w,X)}}}for(const W of $)W.setColSpan(1),W.setRowSpan(1)}})},[S,g]),c.useEffect(()=>{if(!p)return S.registerNodeTransform(e.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[S,p,g]),null}return Cu.TablePlugin=d,Cu}var Tu={},Ch;function EC(){if(Ch)return Tu;Ch=1;var t=Un(),e=pd(),n=on(),r=Bt(),c=et;function d(g){let p=new URLSearchParams;p.append("code",g);for(let C=1;C<arguments.length;C++)p.append("v",arguments[C]);throw Error(`Minified Lexical error #${g}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Tu.TablePlugin=function({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:C=!0}){let[S]=t.useLexicalComposerContext();return c.useEffect(()=>(S.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode])||d(10),S.registerCommand(e.INSERT_TABLE_COMMAND,({columns:T,rows:O,includeHeaders:R})=>(T=e.$createTableNodeWithDimensions(Number(O),Number(T),R),n.$insertNodeToNearestRoot(T),T=T.getFirstDescendant(),r.$isTextNode(T)&&T.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[S]),c.useEffect(()=>{let T=new Map,O=b=>{const x=b.getKey(),w=S.getElementByKey(x);w&&!T.has(x)&&(b=e.applyTableHandlers(b,w,S,C),T.set(x,b))};S.getEditorState().read(()=>{let b=r.$nodesOfType(e.TableNode);for(let x of b)e.$isTableNode(x)&&O(x)});let R=S.registerMutationListener(e.TableNode,b=>{for(const[x,w]of b)w==="created"?S.getEditorState().read(()=>{const $=r.$getNodeByKey(x);e.$isTableNode($)&&O($)}):w==="destroyed"&&(b=T.get(x),b!==void 0&&(b.removeListeners(),T.delete(x)))});return()=>{R();for(let[,b]of T)b.removeListeners()}},[S,C]),c.useEffect(()=>{if(!g)return S.registerNodeTransform(e.TableCellNode,T=>{if(1<T.getColSpan()||1<T.getRowSpan()){var[,,O]=r.DEPRECATED_$getNodeTriplet(T);[T]=r.DEPRECATED_$computeGridMap(O,T,T);let b=T.length,x=T[0].length;if(O=O.getFirstChild(),!r.DEPRECATED_$isGridRowNode(O))throw Error("Expected TableNode first child to be a RowNode");let w=[];for(let $=0;$<b;$++){if($!==0&&(O=O.getNextSibling(),!r.DEPRECATED_$isGridRowNode(O)))throw Error("Expected TableNode first child to be a RowNode");let W=null;for(let P=0;P<x;P++){var R=T[$][P];let H=R.cell;R.startRow===$&&R.startColumn===P?(W=H,w.push(H)):(1<H.getColSpan()||1<H.getRowSpan())&&(R=e.$createTableCellNode(H.__headerState),W!==null?W.insertAfter(R):n.$insertFirst(O,R))}}for(let $ of w)$.setColSpan(1),$.setRowSpan(1)}})},[S,g]),c.useEffect(()=>{if(!p)return S.registerNodeTransform(e.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[S,p,g]),null},Tu}const TC=process.env.NODE_ENV==="development"?CC():EC();var xC=TC,Mn={},xu={exports:{}},Eh;function Ep(){return Eh||(Eh=1,function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
76
76
  * Prism: Lightweight, robust, elegant syntax highlighting
77
77
  *
78
78
  * @license MIT <https://opensource.org/licenses/MIT>
79
79
  * @author Lea Verou <https://lea.verou.me>
80
80
  * @namespace
81
81
  * @public
82
- */var n=function(r){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,g={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function $(W){return W instanceof C?new C(W.type,$(W.content),W.alias):Array.isArray(W)?W.map($):W.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++d}),$.__id},clone:function $(W,B){B=B||{};var K,X;switch(p.util.type(W)){case"Object":if(X=p.util.objId(W),B[X])return B[X];K={},B[X]=K;for(var ee in W)W.hasOwnProperty(ee)&&(K[ee]=$(W[ee],B));return K;case"Array":return X=p.util.objId(W),B[X]?B[X]:(K=[],B[X]=K,W.forEach(function(le,V){K[V]=$(le,B)}),K);default:return W}},getLanguage:function($){for(;$;){var W=c.exec($.className);if(W)return W[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,W){$.className=$.className.replace(RegExp(c,"gi"),""),$.classList.add("language-"+W)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(K){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(K.stack)||[])[1];if($){var W=document.getElementsByTagName("script");for(var B in W)if(W[B].src==$)return W[B]}return null}},isActive:function($,W,B){for(var K="no-"+W;$;){var X=$.classList;if(X.contains(W))return!0;if(X.contains(K))return!1;$=$.parentElement}return!!B}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function($,W){var B=p.util.clone(p.languages[$]);for(var K in W)B[K]=W[K];return B},insertBefore:function($,W,B,K){K=K||p.languages;var X=K[$],ee={};for(var le in X)if(X.hasOwnProperty(le)){if(le==W)for(var V in B)B.hasOwnProperty(V)&&(ee[V]=B[V]);B.hasOwnProperty(le)||(ee[le]=X[le])}var U=K[$];return K[$]=ee,p.languages.DFS(p.languages,function(q,me){me===U&&q!=$&&(this[q]=ee)}),ee},DFS:function $(W,B,K,X){X=X||{};var ee=p.util.objId;for(var le in W)if(W.hasOwnProperty(le)){B.call(W,le,W[le],K||le);var V=W[le],U=p.util.type(V);U==="Object"&&!X[ee(V)]?(X[ee(V)]=!0,$(V,B,null,X)):U==="Array"&&!X[ee(V)]&&(X[ee(V)]=!0,$(V,B,le,X))}}},plugins:{},highlightAll:function($,W){p.highlightAllUnder(document,$,W)},highlightAllUnder:function($,W,B){var K={callback:B,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",K),K.elements=Array.prototype.slice.apply(K.container.querySelectorAll(K.selector)),p.hooks.run("before-all-elements-highlight",K);for(var X=0,ee;ee=K.elements[X++];)p.highlightElement(ee,W===!0,K.callback)},highlightElement:function($,W,B){var K=p.util.getLanguage($),X=p.languages[K];p.util.setLanguage($,K);var ee=$.parentElement;ee&&ee.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(ee,K);var le=$.textContent,V={element:$,language:K,grammar:X,code:le};function U(me){V.highlightedCode=me,p.hooks.run("before-insert",V),V.element.innerHTML=V.highlightedCode,p.hooks.run("after-highlight",V),p.hooks.run("complete",V),B&&B.call(V.element)}if(p.hooks.run("before-sanity-check",V),ee=V.element.parentElement,ee&&ee.nodeName.toLowerCase()==="pre"&&!ee.hasAttribute("tabindex")&&ee.setAttribute("tabindex","0"),!V.code){p.hooks.run("complete",V),B&&B.call(V.element);return}if(p.hooks.run("before-highlight",V),!V.grammar){U(p.util.encode(V.code));return}if(W&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(me){U(me.data)},q.postMessage(JSON.stringify({language:V.language,code:V.code,immediateClose:!0}))}else U(p.highlight(V.code,V.grammar,V.language))},highlight:function($,W,B){var K={code:$,grammar:W,language:B};if(p.hooks.run("before-tokenize",K),!K.grammar)throw new Error('The language "'+K.language+'" has no grammar.');return K.tokens=p.tokenize(K.code,K.grammar),p.hooks.run("after-tokenize",K),C.stringify(p.util.encode(K.tokens),K.language)},tokenize:function($,W){var B=W.rest;if(B){for(var K in B)W[K]=B[K];delete W.rest}var X=new O;return R(X,X.head,$),x($,X,W,X.head,0),T(X)},hooks:{all:{},add:function($,W){var B=p.hooks.all;B[$]=B[$]||[],B[$].push(W)},run:function($,W){var B=p.hooks.all[$];if(!(!B||!B.length))for(var K=0,X;X=B[K++];)X(W)}},Token:C};r.Prism=p;function C($,W,B,K){this.type=$,this.content=W,this.alias=B,this.length=(K||"").length|0}C.stringify=function $(W,B){if(typeof W=="string")return W;if(Array.isArray(W)){var K="";return W.forEach(function(U){K+=$(U,B)}),K}var X={type:W.type,content:$(W.content,B),tag:"span",classes:["token",W.type],attributes:{},language:B},ee=W.alias;ee&&(Array.isArray(ee)?Array.prototype.push.apply(X.classes,ee):X.classes.push(ee)),p.hooks.run("wrap",X);var le="";for(var V in X.attributes)le+=" "+V+'="'+(X.attributes[V]||"").replace(/"/g,"&quot;")+'"';return"<"+X.tag+' class="'+X.classes.join(" ")+'"'+le+">"+X.content+"</"+X.tag+">"};function S($,W,B,K){$.lastIndex=W;var X=$.exec(B);if(X&&K&&X[1]){var ee=X[1].length;X.index+=ee,X[0]=X[0].slice(ee)}return X}function x($,W,B,K,X,ee){for(var le in B)if(!(!B.hasOwnProperty(le)||!B[le])){var V=B[le];V=Array.isArray(V)?V:[V];for(var U=0;U<V.length;++U){if(ee&&ee.cause==le+","+U)return;var q=V[U],me=q.inside,_e=!!q.lookbehind,pe=!!q.greedy,ue=q.alias;if(pe&&!q.pattern.global){var z=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,z+"g")}for(var D=q.pattern||q,j=K.next,ne=X;j!==W.tail&&!(ee&&ne>=ee.reach);ne+=j.value.length,j=j.next){var Y=j.value;if(W.length>$.length)return;if(!(Y instanceof C)){var G=1,Q;if(pe){if(Q=S(D,ne,$,_e),!Q||Q.index>=$.length)break;var A=Q.index,k=Q.index+Q[0].length,m=ne;for(m+=j.value.length;A>=m;)j=j.next,m+=j.value.length;if(m-=j.value.length,ne=m,j.value instanceof C)continue;for(var y=j;y!==W.tail&&(m<k||typeof y.value=="string");y=y.next)G++,m+=y.value.length;G--,Y=$.slice(ne,m),Q.index-=ne}else if(Q=S(D,0,Y,_e),!Q)continue;var A=Q.index,Z=Q[0],ae=Y.slice(0,A),he=Y.slice(A+Z.length),se=ne+Y.length;ee&&se>ee.reach&&(ee.reach=se);var Te=j.prev;ae&&(Te=R(W,Te,ae),ne+=ae.length),b(W,Te,G);var be=new C(le,me?p.tokenize(Z,me):Z,ue,Z);if(j=R(W,Te,be),he&&R(W,j,he),G>1){var Ue={cause:le+","+U,reach:se};x($,W,B,j.prev,ne,Ue),ee&&Ue.reach>ee.reach&&(ee.reach=Ue.reach)}}}}}}function O(){var $={value:null,prev:null,next:null},W={value:null,prev:$,next:null};$.next=W,this.head=$,this.tail=W,this.length=0}function R($,W,B){var K=W.next,X={value:B,prev:W,next:K};return W.next=X,K.prev=X,$.length++,X}function b($,W,B){for(var K=W.next,X=0;X<B&&K!==$.tail;X++)K=K.next;W.next=K,K.prev=W,$.length-=X}function T($){for(var W=[],B=$.head.next;B!==$.tail;)W.push(B.value),B=B.next;return W}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function($){var W=JSON.parse($.data),B=W.language,K=W.code,X=W.immediateClose;r.postMessage(p.highlight(K,p.languages[B],B)),X&&r.close()},!1)),p;var w=p.util.currentScript();w&&(p.filename=w.src,w.hasAttribute("data-manual")&&(p.manual=!0));function P(){p.manual||p.highlightAll()}if(!p.manual){var H=document.readyState;H==="loading"||H==="interactive"&&w&&w.defer?document.addEventListener("DOMContentLoaded",P):window.requestAnimationFrame?window.requestAnimationFrame(P):window.setTimeout(P,16)}return p}(e);t.exports&&(t.exports=n),typeof of<"u"&&(of.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(/&amp;/,"&"))}),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 p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var C={};C[c]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return c}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",C)}}),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(w,P){return"✖ Error "+w+" while fetching file: "+P},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"},p="data-src-status",C="loading",S="loaded",x="failed",O="pre[data-src]:not(["+p+'="'+S+'"]):not(['+p+'="'+C+'"])';function R(w,P,H){var $=new XMLHttpRequest;$.open("GET",w,!0),$.onreadystatechange=function(){$.readyState==4&&($.status<400&&$.responseText?P($.responseText):$.status>=400?H(c($.status,$.statusText)):H(d))},$.send(null)}function b(w){var P=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(w||"");if(P){var H=Number(P[1]),$=P[2],W=P[3];return $?W?[H,Number(W)]:[H,void 0]:[H,H]}}n.hooks.add("before-highlightall",function(w){w.selector+=", "+O}),n.hooks.add("before-sanity-check",function(w){var P=w.element;if(P.matches(O)){w.code="",P.setAttribute(p,C);var H=P.appendChild(document.createElement("CODE"));H.textContent=r;var $=P.getAttribute("data-src"),W=w.language;if(W==="none"){var B=(/\.(\w+)$/.exec($)||[,"none"])[1];W=g[B]||B}n.util.setLanguage(H,W),n.util.setLanguage(P,W);var K=n.plugins.autoloader;K&&K.loadLanguages(W),R($,function(X){P.setAttribute(p,S);var ee=b(P.getAttribute("data-range"));if(ee){var le=X.split(/\r\n?|\n/g),V=ee[0],U=ee[1]==null?le.length:ee[1];V<0&&(V+=le.length),V=Math.max(0,Math.min(V-1,le.length)),U<0&&(U+=le.length),U=Math.max(0,Math.min(U,le.length)),X=le.slice(V,U).join(`
83
- `),P.hasAttribute("data-start")||P.setAttribute("data-start",String(V+1))}H.textContent=X,n.highlightElement(H)},function(X){P.setAttribute(p,x),H.textContent=X})}}),n.plugins.fileHighlight={highlight:function(P){for(var H=(P||document).querySelectorAll(O),$=0,W;W=H[$++];)n.highlightElement(W)}};var T=!1;n.fileHighlight=function(){T||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),T=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(Tu)),Tu.exports}var Nh={},Ch;function Np(){return Ch||(Ch=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:/[{}[\];(),.:]/}),Nh}var Eh={},Th;function Cp(){return Th||(Th=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),Eh}var xh={},Sh;function Ep(){return Sh||(Sh=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(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,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[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:c},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\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:[e,"language-"+e],inside:Prism.languages[e]},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),xh}var vh={},wh;function Tp(){return wh||(wh=1,function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(x){return x=x.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+x+")")}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;t.languages.markdown=t.languages.extend("markup",{}),t.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:t.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:t.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:t.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(x){["url","bold","italic","strike","code-snippet"].forEach(function(O){x!==O&&(t.languages.markdown[x].inside.content.inside[O]=t.languages.markdown[O])})}),t.hooks.add("after-tokenize",function(x){if(x.language!=="markdown"&&x.language!=="md")return;function O(R){if(!(!R||typeof R=="string"))for(var b=0,T=R.length;b<T;b++){var w=R[b];if(w.type!=="code"){O(w.content);continue}var P=w.content[1],H=w.content[3];if(P&&H&&P.type==="code-language"&&H.type==="code-block"&&typeof P.content=="string"){var $=P.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");$=(/[a-z][\w-]*/i.exec($)||[""])[0].toLowerCase();var W="language-"+$;H.alias?typeof H.alias=="string"?H.alias=[H.alias,W]:H.alias.push(W):H.alias=[W]}}}O(x.tokens)}),t.hooks.add("wrap",function(x){if(x.type==="code-block"){for(var O="",R=0,b=x.classes.length;R<b;R++){var T=x.classes[R],w=/language-(.+)/.exec(T);if(w){O=w[1];break}}var P=t.languages[O];if(P)x.content=t.highlight(S(x.content),P,O);else if(O&&O!=="none"&&t.plugins.autoloader){var H="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);x.attributes.id=H,t.plugins.autoloader.loadLanguages(O,function(){var $=document.getElementById(H);$&&($.innerHTML=t.highlight($.textContent,t.languages[O],O))})}}});var g=RegExp(t.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},C=String.fromCodePoint||String.fromCharCode;function S(x){var O=x.replace(g,"");return O=O.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(R,b){if(b=b.toLowerCase(),b[0]==="#"){var T;return b[1]==="x"?T=parseInt(b.slice(2),16):T=Number(b.slice(1)),C(T)}else{var w=p[b];return w||R}}),O}t.languages.md=t.languages.markdown}(Prism)),vh}var Oh={},Dh;function xp(){return Dh||(Dh=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),Oh}var Mh={},Ah;function Sp(){return Ah||(Ah=1,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.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\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,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:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),Mh}var Rh={},bh;function vp(){return bh||(bh=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),Rh}var Lh={},kh;function wp(){return kh||(kh=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:/[;[\]()`,.]/}),Lh}var Ih={},Ph;function Op(){return Ph||(Ph=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:/![sra](?=[:}]$)/,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),Ih}var $h={},Fh;function Dp(){return Fh||(Fh=1,function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(Prism)),$h}var Bh={},Hh;function Mp(){return Hh||(Hh=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(t){t.inside.interpolation.inside=Prism.languages.swift})),Bh}var Wh={},Kh;function Ap(){return Kh||(Kh=1,function(t){t.languages.typescript=t.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/}),t.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 t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.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:e}}}}),t.languages.ts=t.languages.typescript}(Prism)),Wh}var zh={},Uh;function Rp(){return Uh||(Uh=1,function(t){var e=/\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:/\./}};t.languages.java=t.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:e,function:[t.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/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.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:e,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 e.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),zh}var Gh={},Yh;function bp(){return Yh||(Yh=1,function(t){var e=/\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 e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.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:e,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/}),t.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}}),t.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:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(Prism)),Gh}var jh;function SC(){if(jh)return Mn;jh=1;var t=yp();Np(),Cp(),Ep(),Tp(),xp(),Sp(),vp(),wp(),Op(),Dp(),Mp(),Ap(),Rp(),bp();var e=on(),n=Bt();const r=re=>re!=null&&t.languages.hasOwnProperty(re)?re:void 0;function c(re,te){for(const ce of re.childNodes){if(e.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");e.addClassNamesToElement(ce,te.theme.code),ce.setAttribute("spellcheck","false");const we=this.getLanguage();return we&&ce.setAttribute(d,we),ce}updateDOM(te,ce,we){const Le=this.__language,Be=te.__language;return Le?Le!==Be&&ce.setAttribute(d,Le):Be&&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:S,priority:1}:null,div:te=>({conversion:x,priority:1}),pre:te=>({conversion:S,priority:0}),table:te=>H(te)?{conversion:O,priority:3}:null,td:te=>{const ce=te,we=ce.closest("table");return P(ce)?{conversion:b,priority:3}:we&&H(we)?{conversion:R,priority:3}:null},tr:te=>{const we=te.closest("table");return we&&H(we)?{conversion:R,priority:3}:null}}}static importJSON(te){const ce=p(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 we=this.getChildren(),Le=we.length;if(Le>=2&&we[Le-1].getTextContent()===`
82
+ */var n=function(r){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,g={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function P(H){return H instanceof C?new C(H.type,P(H.content),H.alias):Array.isArray(H)?H.map(P):H.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(P){return Object.prototype.toString.call(P).slice(8,-1)},objId:function(P){return P.__id||Object.defineProperty(P,"__id",{value:++d}),P.__id},clone:function P(H,B){B=B||{};var z,X;switch(p.util.type(H)){case"Object":if(X=p.util.objId(H),B[X])return B[X];z={},B[X]=z;for(var ee in H)H.hasOwnProperty(ee)&&(z[ee]=P(H[ee],B));return z;case"Array":return X=p.util.objId(H),B[X]?B[X]:(z=[],B[X]=z,H.forEach(function(le,j){z[j]=P(le,B)}),z);default:return H}},getLanguage:function(P){for(;P;){var H=c.exec(P.className);if(H)return H[1].toLowerCase();P=P.parentElement}return"none"},setLanguage:function(P,H){P.className=P.className.replace(RegExp(c,"gi"),""),P.classList.add("language-"+H)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(z){var P=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(z.stack)||[])[1];if(P){var H=document.getElementsByTagName("script");for(var B in H)if(H[B].src==P)return H[B]}return null}},isActive:function(P,H,B){for(var z="no-"+H;P;){var X=P.classList;if(X.contains(H))return!0;if(X.contains(z))return!1;P=P.parentElement}return!!B}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function(P,H){var B=p.util.clone(p.languages[P]);for(var z in H)B[z]=H[z];return B},insertBefore:function(P,H,B,z){z=z||p.languages;var X=z[P],ee={};for(var le in X)if(X.hasOwnProperty(le)){if(le==H)for(var j in B)B.hasOwnProperty(j)&&(ee[j]=B[j]);B.hasOwnProperty(le)||(ee[le]=X[le])}var U=z[P];return z[P]=ee,p.languages.DFS(p.languages,function(q,me){me===U&&q!=P&&(this[q]=ee)}),ee},DFS:function P(H,B,z,X){X=X||{};var ee=p.util.objId;for(var le in H)if(H.hasOwnProperty(le)){B.call(H,le,H[le],z||le);var j=H[le],U=p.util.type(j);U==="Object"&&!X[ee(j)]?(X[ee(j)]=!0,P(j,B,null,X)):U==="Array"&&!X[ee(j)]&&(X[ee(j)]=!0,P(j,B,le,X))}}},plugins:{},highlightAll:function(P,H){p.highlightAllUnder(document,P,H)},highlightAllUnder:function(P,H,B){var z={callback:B,container:P,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",z),z.elements=Array.prototype.slice.apply(z.container.querySelectorAll(z.selector)),p.hooks.run("before-all-elements-highlight",z);for(var X=0,ee;ee=z.elements[X++];)p.highlightElement(ee,H===!0,z.callback)},highlightElement:function(P,H,B){var z=p.util.getLanguage(P),X=p.languages[z];p.util.setLanguage(P,z);var ee=P.parentElement;ee&&ee.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(ee,z);var le=P.textContent,j={element:P,language:z,grammar:X,code:le};function U(me){j.highlightedCode=me,p.hooks.run("before-insert",j),j.element.innerHTML=j.highlightedCode,p.hooks.run("after-highlight",j),p.hooks.run("complete",j),B&&B.call(j.element)}if(p.hooks.run("before-sanity-check",j),ee=j.element.parentElement,ee&&ee.nodeName.toLowerCase()==="pre"&&!ee.hasAttribute("tabindex")&&ee.setAttribute("tabindex","0"),!j.code){p.hooks.run("complete",j),B&&B.call(j.element);return}if(p.hooks.run("before-highlight",j),!j.grammar){U(p.util.encode(j.code));return}if(H&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(me){U(me.data)},q.postMessage(JSON.stringify({language:j.language,code:j.code,immediateClose:!0}))}else U(p.highlight(j.code,j.grammar,j.language))},highlight:function(P,H,B){var z={code:P,grammar:H,language:B};if(p.hooks.run("before-tokenize",z),!z.grammar)throw new Error('The language "'+z.language+'" has no grammar.');return z.tokens=p.tokenize(z.code,z.grammar),p.hooks.run("after-tokenize",z),C.stringify(p.util.encode(z.tokens),z.language)},tokenize:function(P,H){var B=H.rest;if(B){for(var z in B)H[z]=B[z];delete H.rest}var X=new O;return R(X,X.head,P),T(P,X,H,X.head,0),x(X)},hooks:{all:{},add:function(P,H){var B=p.hooks.all;B[P]=B[P]||[],B[P].push(H)},run:function(P,H){var B=p.hooks.all[P];if(!(!B||!B.length))for(var z=0,X;X=B[z++];)X(H)}},Token:C};r.Prism=p;function C(P,H,B,z){this.type=P,this.content=H,this.alias=B,this.length=(z||"").length|0}C.stringify=function P(H,B){if(typeof H=="string")return H;if(Array.isArray(H)){var z="";return H.forEach(function(U){z+=P(U,B)}),z}var X={type:H.type,content:P(H.content,B),tag:"span",classes:["token",H.type],attributes:{},language:B},ee=H.alias;ee&&(Array.isArray(ee)?Array.prototype.push.apply(X.classes,ee):X.classes.push(ee)),p.hooks.run("wrap",X);var le="";for(var j in X.attributes)le+=" "+j+'="'+(X.attributes[j]||"").replace(/"/g,"&quot;")+'"';return"<"+X.tag+' class="'+X.classes.join(" ")+'"'+le+">"+X.content+"</"+X.tag+">"};function S(P,H,B,z){P.lastIndex=H;var X=P.exec(B);if(X&&z&&X[1]){var ee=X[1].length;X.index+=ee,X[0]=X[0].slice(ee)}return X}function T(P,H,B,z,X,ee){for(var le in B)if(!(!B.hasOwnProperty(le)||!B[le])){var j=B[le];j=Array.isArray(j)?j:[j];for(var U=0;U<j.length;++U){if(ee&&ee.cause==le+","+U)return;var q=j[U],me=q.inside,_e=!!q.lookbehind,pe=!!q.greedy,ue=q.alias;if(pe&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var D=q.pattern||q,V=z.next,ne=X;V!==H.tail&&!(ee&&ne>=ee.reach);ne+=V.value.length,V=V.next){var Y=V.value;if(H.length>P.length)return;if(!(Y instanceof C)){var G=1,Q;if(pe){if(Q=S(D,ne,P,_e),!Q||Q.index>=P.length)break;var A=Q.index,k=Q.index+Q[0].length,m=ne;for(m+=V.value.length;A>=m;)V=V.next,m+=V.value.length;if(m-=V.value.length,ne=m,V.value instanceof C)continue;for(var y=V;y!==H.tail&&(m<k||typeof y.value=="string");y=y.next)G++,m+=y.value.length;G--,Y=P.slice(ne,m),Q.index-=ne}else if(Q=S(D,0,Y,_e),!Q)continue;var A=Q.index,Z=Q[0],ae=Y.slice(0,A),he=Y.slice(A+Z.length),se=ne+Y.length;ee&&se>ee.reach&&(ee.reach=se);var Te=V.prev;ae&&(Te=R(H,Te,ae),ne+=ae.length),b(H,Te,G);var be=new C(le,me?p.tokenize(Z,me):Z,ue,Z);if(V=R(H,Te,be),he&&R(H,V,he),G>1){var Ue={cause:le+","+U,reach:se};T(P,H,B,V.prev,ne,Ue),ee&&Ue.reach>ee.reach&&(ee.reach=Ue.reach)}}}}}}function O(){var P={value:null,prev:null,next:null},H={value:null,prev:P,next:null};P.next=H,this.head=P,this.tail=H,this.length=0}function R(P,H,B){var z=H.next,X={value:B,prev:H,next:z};return H.next=X,z.prev=X,P.length++,X}function b(P,H,B){for(var z=H.next,X=0;X<B&&z!==P.tail;X++)z=z.next;H.next=z,z.prev=H,P.length-=X}function x(P){for(var H=[],B=P.head.next;B!==P.tail;)H.push(B.value),B=B.next;return H}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(P){var H=JSON.parse(P.data),B=H.language,z=H.code,X=H.immediateClose;r.postMessage(p.highlight(z,p.languages[B],B)),X&&r.close()},!1)),p;var w=p.util.currentScript();w&&(p.filename=w.src,w.hasAttribute("data-manual")&&(p.manual=!0));function $(){p.manual||p.highlightAll()}if(!p.manual){var W=document.readyState;W==="loading"||W==="interactive"&&w&&w.defer?document.addEventListener("DOMContentLoaded",$):window.requestAnimationFrame?window.requestAnimationFrame($):window.setTimeout($,16)}return p}(e);t.exports&&(t.exports=n),typeof sf<"u"&&(sf.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(/&amp;/,"&"))}),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 p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var C={};C[c]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return c}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",C)}}),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(w,$){return"✖ Error "+w+" while fetching file: "+$},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"},p="data-src-status",C="loading",S="loaded",T="failed",O="pre[data-src]:not(["+p+'="'+S+'"]):not(['+p+'="'+C+'"])';function R(w,$,W){var P=new XMLHttpRequest;P.open("GET",w,!0),P.onreadystatechange=function(){P.readyState==4&&(P.status<400&&P.responseText?$(P.responseText):P.status>=400?W(c(P.status,P.statusText)):W(d))},P.send(null)}function b(w){var $=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(w||"");if($){var W=Number($[1]),P=$[2],H=$[3];return P?H?[W,Number(H)]:[W,void 0]:[W,W]}}n.hooks.add("before-highlightall",function(w){w.selector+=", "+O}),n.hooks.add("before-sanity-check",function(w){var $=w.element;if($.matches(O)){w.code="",$.setAttribute(p,C);var W=$.appendChild(document.createElement("CODE"));W.textContent=r;var P=$.getAttribute("data-src"),H=w.language;if(H==="none"){var B=(/\.(\w+)$/.exec(P)||[,"none"])[1];H=g[B]||B}n.util.setLanguage(W,H),n.util.setLanguage($,H);var z=n.plugins.autoloader;z&&z.loadLanguages(H),R(P,function(X){$.setAttribute(p,S);var ee=b($.getAttribute("data-range"));if(ee){var le=X.split(/\r\n?|\n/g),j=ee[0],U=ee[1]==null?le.length:ee[1];j<0&&(j+=le.length),j=Math.max(0,Math.min(j-1,le.length)),U<0&&(U+=le.length),U=Math.max(0,Math.min(U,le.length)),X=le.slice(j,U).join(`
83
+ `),$.hasAttribute("data-start")||$.setAttribute("data-start",String(j+1))}W.textContent=X,n.highlightElement(W)},function(X){$.setAttribute(p,T),W.textContent=X})}}),n.plugins.fileHighlight={highlight:function($){for(var W=($||document).querySelectorAll(O),P=0,H;H=W[P++];)n.highlightElement(H)}};var x=!1;n.fileHighlight=function(){x||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),x=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(xu)),xu.exports}var Th={},xh;function Tp(){return xh||(xh=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:/[{}[\];(),.:]/}),Th}var Sh={},vh;function xp(){return vh||(vh=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),Sh}var wh={},Oh;function Sp(){return Oh||(Oh=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(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,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[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:c},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\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:[e,"language-"+e],inside:Prism.languages[e]},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),wh}var Dh={},Mh;function vp(){return Mh||(Mh=1,function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(T){return T=T.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+T+")")}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;t.languages.markdown=t.languages.extend("markup",{}),t.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:t.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:t.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:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(T){["url","bold","italic","strike","code-snippet"].forEach(function(O){T!==O&&(t.languages.markdown[T].inside.content.inside[O]=t.languages.markdown[O])})}),t.hooks.add("after-tokenize",function(T){if(T.language!=="markdown"&&T.language!=="md")return;function O(R){if(!(!R||typeof R=="string"))for(var b=0,x=R.length;b<x;b++){var w=R[b];if(w.type!=="code"){O(w.content);continue}var $=w.content[1],W=w.content[3];if($&&W&&$.type==="code-language"&&W.type==="code-block"&&typeof $.content=="string"){var P=$.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");P=(/[a-z][\w-]*/i.exec(P)||[""])[0].toLowerCase();var H="language-"+P;W.alias?typeof W.alias=="string"?W.alias=[W.alias,H]:W.alias.push(H):W.alias=[H]}}}O(T.tokens)}),t.hooks.add("wrap",function(T){if(T.type==="code-block"){for(var O="",R=0,b=T.classes.length;R<b;R++){var x=T.classes[R],w=/language-(.+)/.exec(x);if(w){O=w[1];break}}var $=t.languages[O];if($)T.content=t.highlight(S(T.content),$,O);else if(O&&O!=="none"&&t.plugins.autoloader){var W="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);T.attributes.id=W,t.plugins.autoloader.loadLanguages(O,function(){var P=document.getElementById(W);P&&(P.innerHTML=t.highlight(P.textContent,t.languages[O],O))})}}});var g=RegExp(t.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},C=String.fromCodePoint||String.fromCharCode;function S(T){var O=T.replace(g,"");return O=O.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(R,b){if(b=b.toLowerCase(),b[0]==="#"){var x;return b[1]==="x"?x=parseInt(b.slice(2),16):x=Number(b.slice(1)),C(x)}else{var w=p[b];return w||R}}),O}t.languages.md=t.languages.markdown}(Prism)),Dh}var Ah={},Rh;function wp(){return Rh||(Rh=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),Ah}var bh={},Lh;function Op(){return Lh||(Lh=1,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.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\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,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:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),bh}var kh={},Ih;function Dp(){return Ih||(Ih=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),kh}var Ph={},$h;function Mp(){return $h||($h=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:/[;[\]()`,.]/}),Ph}var Fh={},Bh;function Ap(){return Bh||(Bh=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:/![sra](?=[:}]$)/,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),Fh}var Hh={},Wh;function Rp(){return Wh||(Wh=1,function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(Prism)),Hh}var Kh={},zh;function bp(){return zh||(zh=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(t){t.inside.interpolation.inside=Prism.languages.swift})),Kh}var Uh={},Gh;function Lp(){return Gh||(Gh=1,function(t){t.languages.typescript=t.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/}),t.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 t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.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:e}}}}),t.languages.ts=t.languages.typescript}(Prism)),Uh}var Yh={},jh;function kp(){return jh||(jh=1,function(t){var e=/\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:/\./}};t.languages.java=t.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:e,function:[t.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/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.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:e,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 e.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),Yh}var Vh={},qh;function Ip(){return qh||(qh=1,function(t){var e=/\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 e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.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:e,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/}),t.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}}),t.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:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(Prism)),Vh}var Zh;function SC(){if(Zh)return Mn;Zh=1;var t=Ep();Tp(),xp(),Sp(),vp(),wp(),Op(),Dp(),Mp(),Ap(),Rp(),bp(),Lp(),kp(),Ip();var e=on(),n=Bt();const r=re=>re!=null&&t.languages.hasOwnProperty(re)?re:void 0;function c(re,te){for(const ce of re.childNodes){if(e.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");e.addClassNamesToElement(ce,te.theme.code),ce.setAttribute("spellcheck","false");const we=this.getLanguage();return we&&ce.setAttribute(d,we),ce}updateDOM(te,ce,we){const Le=this.__language,Be=te.__language;return Le?Le!==Be&&ce.setAttribute(d,Le):Be&&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:S,priority:1}:null,div:te=>({conversion:T,priority:1}),pre:te=>({conversion:S,priority:0}),table:te=>W(te)?{conversion:O,priority:3}:null,td:te=>{const ce=te,we=ce.closest("table");return $(ce)?{conversion:b,priority:3}:we&&W(we)?{conversion:R,priority:3}:null},tr:te=>{const we=te.closest("table");return we&&W(we)?{conversion:R,priority:3}:null}}}static importJSON(te){const ce=p(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 we=this.getChildren(),Le=we.length;if(Le>=2&&we[Le-1].getTextContent()===`
84
84
  `&&we[Le-2].getTextContent()===`
85
- `&&te.isCollapsed()&&te.anchor.key===this.__key&&te.anchor.offset===Le){we[Le-1].remove(),we[Le-2].remove();const dt=n.$createParagraphNode();return this.insertAfter(dt,ce),dt}const{anchor:Be,focus:Ye}=te,yt=(Be.isBefore(Ye)?Be:Ye).getNode();if(n.$isTextNode(yt)){let dt=_e(yt);const Se=[];for(;;)if(n.$isTabNode(dt))Se.push(n.$createTabNode()),dt=dt.getNextSibling();else if(me(dt)){let qe=0;const Qe=dt.getTextContent(),ft=dt.getTextContentSize();for(;qe<ft&&Qe[qe]===" ";qe++);if(qe!==0&&Se.push(q(" ".repeat(qe))),qe!==ft)break;dt=dt.getNextSibling()}else break;const ie=yt.splitText(Be.offset)[0],fe=Be.offset===0?0:1,Oe=ie.getIndexWithinParent()+fe,Re=yt.getParentOrThrow(),De=[n.$createLineBreakNode(),...Se];Re.splice(Oe,0,De);const We=Se[Se.length-1];We?We.select():Be.offset===0?ie.selectPrevious():ie.getNextSibling().selectNext(0,0)}if(C(yt)){const{offset:dt}=te.anchor;yt.splice(dt,0,[n.$createLineBreakNode()]),yt.select(dt+1,dt+1)}return null}canIndent(){return!1}collapseAtStart(){const te=n.$createParagraphNode();return this.getChildren().forEach(we=>te.append(we)),this.replace(te),!0}setLanguage(te){const ce=this.getWritable();ce.__language=r(te)}getLanguage(){return this.getLatest().__language}}function p(re){return n.$applyNodeReplacement(new g(re))}function C(re){return re instanceof g}function S(re){let te;return e.isHTMLElement(re)&&(te=re.getAttribute(d)),{node:p(te)}}function x(re){const te=re,ce=T(te);return!ce&&!w(te)?{node:null}:{after:we=>{const Le=re.parentNode;return Le!=null&&re!==Le.lastChild&&we.push(n.$createLineBreakNode()),we},node:ce?p():null}}function O(){return{node:p()}}function R(){return{node:null}}function b(re){const te=re;return{after:ce=>(te.parentNode&&te.parentNode.nextSibling&&ce.push(n.$createLineBreakNode()),ce),node:null}}function T(re){return re.style.fontFamily.match("monospace")!==null}function w(re){let te=re.parentElement;for(;te!==null;){if(T(te))return!0;te=te.parentElement}return!1}function P(re){return re.classList.contains("js-file-line")}function H(re){return re.classList.contains("js-file-line-container")}const $="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"},B={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function K(re){return B[re]||re}function X(re){const te=K(re);return W[te]||te}const ee=()=>$,le=()=>Object.keys(t.languages).filter(re=>typeof t.languages[re]!="function").sort();class V extends n.TextNode{constructor(te,ce,we){super(te,we),this.__highlightType=ce}static getType(){return"code-highlight"}static clone(te){return new V(te.__text,te.__highlightType||void 0,te.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(te){const ce=super.createDOM(te),we=U(te.theme,this.__highlightType);return e.addClassNamesToElement(ce,we),ce}updateDOM(te,ce,we){const Le=super.updateDOM(te,ce,we),Be=U(we.theme,te.__highlightType),Ye=U(we.theme,this.__highlightType);return Be!==Ye&&(Be&&e.removeClassNamesFromElement(ce,Be),Ye&&e.addClassNamesToElement(ce,Ye)),Le}static importJSON(te){const ce=q(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 p()}}function U(re,te){return te&&re&&re.codeHighlight&&re.codeHighlight[te]}function q(re,te){return n.$applyNodeReplacement(new V(re,te))}function me(re){return re instanceof V}function _e(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getPreviousSibling();return te}function pe(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getNextSibling();return te}const ue={defaultLanguage:$,tokenize(re,te){return t.tokenize(re,t.languages[te||""]||t.languages[this.defaultLanguage])}};function z(re,te){let ce=null,we=null,Le=re,Be=te,Ye=re.getTextContent();for(;;){if(Be===0){if(Le=Le.getPreviousSibling(),Le===null)break;if(!(me(Le)||n.$isTabNode(Le)||n.$isLineBreakNode(Le)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Le)){ce={node:Le,offset:1};break}Be=Math.max(0,Le.getTextContentSize()-1),Ye=Le.getTextContent()}else Be--;const yt=Ye[Be];me(Le)&&yt!==" "&&(we={node:Le,offset:Be})}if(we!==null)return we;let ct=null;if(te<re.getTextContentSize())me(re)&&(ct=re.getTextContent()[te]);else{const yt=re.getNextSibling();me(yt)&&(ct=yt.getTextContent()[0])}if(ct!==null&&ct!==" ")return ce;{const yt=D(re,te);return yt!==null?yt:ce}}function D(re,te){let ce=re,we=te,Le=re.getTextContent(),Be=re.getTextContentSize();for(;;){if(!me(ce)||we===Be){if(ce=ce.getNextSibling(),ce===null||n.$isLineBreakNode(ce))return null;me(ce)&&(we=0,Le=ce.getTextContent(),Be=ce.getTextContentSize())}if(me(ce)){if(Le[we]!==" ")return{node:ce,offset:we};we++}}}function j(re){const te=pe(re);if(n.$isLineBreakNode(te))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return te}function ne(re,te,ce){const we=re.getParent();C(we)?Q(we,te,ce):me(re)&&re.replace(n.$createTextNode(re.__text))}function Y(re,te){const ce=te.getElementByKey(re.getKey());if(ce===null)return;const we=re.getChildren(),Le=we.length;if(Le===ce.__cachedChildrenLength)return;ce.__cachedChildrenLength=Le;let Be="1",Ye=1;for(let ct=0;ct<Le;ct++)n.$isLineBreakNode(we[ct])&&(Be+=`
85
+ `&&te.isCollapsed()&&te.anchor.key===this.__key&&te.anchor.offset===Le){we[Le-1].remove(),we[Le-2].remove();const dt=n.$createParagraphNode();return this.insertAfter(dt,ce),dt}const{anchor:Be,focus:Ye}=te,yt=(Be.isBefore(Ye)?Be:Ye).getNode();if(n.$isTextNode(yt)){let dt=_e(yt);const Se=[];for(;;)if(n.$isTabNode(dt))Se.push(n.$createTabNode()),dt=dt.getNextSibling();else if(me(dt)){let qe=0;const Qe=dt.getTextContent(),ft=dt.getTextContentSize();for(;qe<ft&&Qe[qe]===" ";qe++);if(qe!==0&&Se.push(q(" ".repeat(qe))),qe!==ft)break;dt=dt.getNextSibling()}else break;const ie=yt.splitText(Be.offset)[0],fe=Be.offset===0?0:1,Oe=ie.getIndexWithinParent()+fe,Re=yt.getParentOrThrow(),De=[n.$createLineBreakNode(),...Se];Re.splice(Oe,0,De);const We=Se[Se.length-1];We?We.select():Be.offset===0?ie.selectPrevious():ie.getNextSibling().selectNext(0,0)}if(C(yt)){const{offset:dt}=te.anchor;yt.splice(dt,0,[n.$createLineBreakNode()]),yt.select(dt+1,dt+1)}return null}canIndent(){return!1}collapseAtStart(){const te=n.$createParagraphNode();return this.getChildren().forEach(we=>te.append(we)),this.replace(te),!0}setLanguage(te){const ce=this.getWritable();ce.__language=r(te)}getLanguage(){return this.getLatest().__language}}function p(re){return n.$applyNodeReplacement(new g(re))}function C(re){return re instanceof g}function S(re){let te;return e.isHTMLElement(re)&&(te=re.getAttribute(d)),{node:p(te)}}function T(re){const te=re,ce=x(te);return!ce&&!w(te)?{node:null}:{after:we=>{const Le=re.parentNode;return Le!=null&&re!==Le.lastChild&&we.push(n.$createLineBreakNode()),we},node:ce?p():null}}function O(){return{node:p()}}function R(){return{node:null}}function b(re){const te=re;return{after:ce=>(te.parentNode&&te.parentNode.nextSibling&&ce.push(n.$createLineBreakNode()),ce),node:null}}function x(re){return re.style.fontFamily.match("monospace")!==null}function w(re){let te=re.parentElement;for(;te!==null;){if(x(te))return!0;te=te.parentElement}return!1}function $(re){return re.classList.contains("js-file-line")}function W(re){return re.classList.contains("js-file-line-container")}const P="javascript",H={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"},B={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function z(re){return B[re]||re}function X(re){const te=z(re);return H[te]||te}const ee=()=>P,le=()=>Object.keys(t.languages).filter(re=>typeof t.languages[re]!="function").sort();class j extends n.TextNode{constructor(te,ce,we){super(te,we),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),we=U(te.theme,this.__highlightType);return e.addClassNamesToElement(ce,we),ce}updateDOM(te,ce,we){const Le=super.updateDOM(te,ce,we),Be=U(we.theme,te.__highlightType),Ye=U(we.theme,this.__highlightType);return Be!==Ye&&(Be&&e.removeClassNamesFromElement(ce,Be),Ye&&e.addClassNamesToElement(ce,Ye)),Le}static importJSON(te){const ce=q(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 p()}}function U(re,te){return te&&re&&re.codeHighlight&&re.codeHighlight[te]}function q(re,te){return n.$applyNodeReplacement(new j(re,te))}function me(re){return re instanceof j}function _e(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getPreviousSibling();return te}function pe(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getNextSibling();return te}const ue={defaultLanguage:P,tokenize(re,te){return t.tokenize(re,t.languages[te||""]||t.languages[this.defaultLanguage])}};function K(re,te){let ce=null,we=null,Le=re,Be=te,Ye=re.getTextContent();for(;;){if(Be===0){if(Le=Le.getPreviousSibling(),Le===null)break;if(!(me(Le)||n.$isTabNode(Le)||n.$isLineBreakNode(Le)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Le)){ce={node:Le,offset:1};break}Be=Math.max(0,Le.getTextContentSize()-1),Ye=Le.getTextContent()}else Be--;const yt=Ye[Be];me(Le)&&yt!==" "&&(we={node:Le,offset:Be})}if(we!==null)return we;let ct=null;if(te<re.getTextContentSize())me(re)&&(ct=re.getTextContent()[te]);else{const yt=re.getNextSibling();me(yt)&&(ct=yt.getTextContent()[0])}if(ct!==null&&ct!==" ")return ce;{const yt=D(re,te);return yt!==null?yt:ce}}function D(re,te){let ce=re,we=te,Le=re.getTextContent(),Be=re.getTextContentSize();for(;;){if(!me(ce)||we===Be){if(ce=ce.getNextSibling(),ce===null||n.$isLineBreakNode(ce))return null;me(ce)&&(we=0,Le=ce.getTextContent(),Be=ce.getTextContentSize())}if(me(ce)){if(Le[we]!==" ")return{node:ce,offset:we};we++}}}function V(re){const te=pe(re);if(n.$isLineBreakNode(te))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return te}function ne(re,te,ce){const we=re.getParent();C(we)?Q(we,te,ce):me(re)&&re.replace(n.$createTextNode(re.__text))}function Y(re,te){const ce=te.getElementByKey(re.getKey());if(ce===null)return;const we=re.getChildren(),Le=we.length;if(Le===ce.__cachedChildrenLength)return;ce.__cachedChildrenLength=Le;let Be="1",Ye=1;for(let ct=0;ct<Le;ct++)n.$isLineBreakNode(we[ct])&&(Be+=`
86
86
  `+ ++Ye);ce.setAttribute("data-gutter",Be)}const G=new Set;function Q(re,te,ce){const we=re.getKey();G.has(we)||(G.add(we),re.getLanguage()===void 0&&re.setLanguage(ce.defaultLanguage),te.update(()=>{m(we,()=>{const Le=n.$getNodeByKey(we);if(!C(Le)||!Le.isAttached())return!1;const Be=Le.getTextContent(),Ye=ce.tokenize(Be,Le.getLanguage()||ce.defaultLanguage),ct=k(Ye),yt=y(Le.getChildren(),ct),{from:dt,to:Se,nodesForReplacement:ie}=yt;return dt!==Se||ie.length?(re.splice(dt,Se-dt,ie),!0):!1})},{onUpdate:()=>{G.delete(we)},skipTransforms:!0}))}function k(re,te){const ce=[];for(const we of re)if(typeof we=="string"){const Le=we.split(/(\n|\t)/),Be=Le.length;for(let Ye=0;Ye<Be;Ye++){const ct=Le[Ye];ct===`
87
87
  `||ct===`\r
88
- `?ce.push(n.$createLineBreakNode()):ct===" "?ce.push(n.$createTabNode()):ct.length>0&&ce.push(q(ct,te))}}else{const{content:Le}=we;typeof Le=="string"?ce.push(...k([Le],we.type)):Array.isArray(Le)&&ce.push(...k(Le,we.type))}return ce}function m(re,te){const ce=n.$getNodeByKey(re);if(!C(ce)||!ce.isAttached())return;const we=n.$getSelection();if(!n.$isRangeSelection(we)){te();return}const Le=we.anchor,Be=Le.offset,Ye=Le.type==="element"&&n.$isLineBreakNode(ce.getChildAtIndex(Le.offset-1));let ct=0;if(!Ye){const dt=Le.getNode();ct=Be+dt.getPreviousSiblings().reduce((Se,ie)=>Se+ie.getTextContentSize(),0)}if(te()){if(Ye){Le.getNode().select(Be,Be);return}ce.getChildren().some(dt=>{const Se=n.$isTextNode(dt);if(Se||n.$isLineBreakNode(dt)){const ie=dt.getTextContentSize();if(Se&&ie>=ct)return dt.select(ct,ct),!0;ct-=ie}return!1})}}function y(re,te){let ce=0;for(;ce<re.length&&A(re[ce],te[ce]);)ce++;const we=re.length,Le=te.length,Be=Math.min(we,Le)-ce;let Ye=0;for(;Ye<Be;)if(Ye++,!A(re[we-Ye],te[Le-Ye])){Ye--;break}const ct=ce,yt=we-Ye,dt=te.slice(ce,Le-Ye);return{from:ct,nodesForReplacement:dt,to:yt}}function A(re,te){return me(re)&&me(te)&&re.__text===te.__text&&re.__highlightType===te.__highlightType||n.$isTabNode(re)&&n.$isTabNode(te)||n.$isLineBreakNode(re)&&n.$isLineBreakNode(te)}function Z(re){if(!n.$isRangeSelection(re))return!1;const te=re.anchor.getNode(),ce=re.focus.getNode();if(te.is(ce)&&C(te))return!0;const we=te.getParent();return C(we)&&we.is(ce.getParent())}function ae(re){const te=re.getNodes(),ce=[[]];if(te.length===1&&C(te[0]))return ce;let we=ce[0];for(let Le=0;Le<te.length;Le++){const Be=te[Le];if(!(me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Be)?Le!==0&&we.length>0&&(we=[],ce.push(we)):we.push(Be)}return ce}function he(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return null;const ce=re?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,we=re?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(ae(te).length>1)return ce;const Ye=te.getNodes()[0];if(!(C(Ye)||me(Ye)||n.$isTabNode(Ye)||n.$isLineBreakNode(Ye)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(C(Ye))return ce;const ct=_e(Ye),yt=pe(Ye),dt=te.anchor,Se=te.focus;let ie,fe;return Se.isBefore(dt)?(ie=Se,fe=dt):(ie=dt,fe=Se),ct!==null&&yt!==null&&ie.key===ct.getKey()&&ie.offset===0&&fe.key===yt.getKey()&&fe.offset===yt.getTextContentSize()?ce:we}function se(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return!1;const ce=ae(te),we=ce.length;if(ce.length>1){for(let ct=0;ct<we;ct++){const yt=ce[ct];if(yt.length>0){let dt=yt[0];ct===0&&(dt=_e(dt)),dt!==null&&(re===n.INDENT_CONTENT_COMMAND?dt.insertBefore(n.$createTabNode()):n.$isTabNode(dt)&&dt.remove())}}return!0}const Be=te.getNodes()[0];if(!(C(Be)||me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(C(Be))return re===n.INDENT_CONTENT_COMMAND&&te.insertNodes([n.$createTabNode()]),!0;const Ye=_e(Be);if(Ye===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return re===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(Ye)?Ye.insertAfter(n.$createTabNode()):Ye.insertBefore(n.$createTabNode()):n.$isTabNode(Ye)&&Ye.remove(),!0}function Te(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.offset,Ye=Le.offset,ct=we.getNode(),yt=Le.getNode(),dt=re===n.KEY_ARROW_UP_COMMAND;if(!Z(ce)||!(me(ct)||n.$isTabNode(ct))||!(me(yt)||n.$isTabNode(yt)))return!1;if(!te.altKey){if(ce.isCollapsed()){const qe=ct.getParentOrThrow();if(dt&&Be===0&&ct.getPreviousSibling()===null){if(qe.getPreviousSibling()===null)return qe.selectPrevious(),te.preventDefault(),!0}else if(!dt&&Be===ct.getTextContentSize()&&ct.getNextSibling()===null&&qe.getNextSibling()===null)return qe.selectNext(),te.preventDefault(),!0}return!1}let Se,ie;if(ct.isBefore(yt)?(Se=_e(ct),ie=pe(yt)):(Se=_e(yt),ie=pe(ct)),Se==null||ie==null)return!1;const fe=Se.getNodesBetween(ie);for(let qe=0;qe<fe.length;qe++){const Qe=fe[qe];if(!me(Qe)&&!n.$isTabNode(Qe)&&!n.$isLineBreakNode(Qe))return!1}te.preventDefault(),te.stopPropagation();const Oe=dt?Se.getPreviousSibling():ie.getNextSibling();if(!n.$isLineBreakNode(Oe))return!0;const Re=dt?Oe.getPreviousSibling():Oe.getNextSibling();if(Re==null)return!0;const De=me(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)?dt?_e(Re):pe(Re):null;let We=De??Re;return Oe.remove(),fe.forEach(qe=>qe.remove()),re===n.KEY_ARROW_UP_COMMAND?(fe.forEach(qe=>We.insertBefore(qe)),We.insertBefore(Oe)):(We.insertAfter(Oe),We=Oe,fe.forEach(qe=>{We.insertAfter(qe),We=qe})),ce.setTextNodeRange(ct,Be,yt,Ye),!0}function be(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.getNode(),Ye=Le.getNode(),ct=re===n.MOVE_TO_START;if(!(me(Be)||n.$isTabNode(Be))||!(me(Ye)||n.$isTabNode(Ye)))return!1;if(ct){const yt=z(Ye,Le.offset);if(yt!==null){const{node:dt,offset:Se}=yt;n.$isLineBreakNode(dt)?dt.selectNext(0,0):ce.setTextNodeRange(dt,Se,dt,Se)}else Ye.getParentOrThrow().selectStart()}else j(Ye).select();return te.preventDefault(),te.stopPropagation(),!0}function Ue(re,te){if(!re.hasNodes([g,V]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return te==null&&(te=ue),e.mergeRegister(re.registerMutationListener(g,ce=>{re.update(()=>{for(const[we,Le]of ce)if(Le!=="destroyed"){const Be=n.$getNodeByKey(we);Be!==null&&Y(Be,re)}})}),re.registerNodeTransform(g,ce=>Q(ce,re,te)),re.registerNodeTransform(n.TextNode,ce=>ne(ce,re,te)),re.registerNodeTransform(V,ce=>ne(ce,re,te)),re.registerCommand(n.KEY_TAB_COMMAND,ce=>{const we=he(ce.shiftKey);return we===null?!1:(ce.preventDefault(),re.dispatchCommand(we,void 0),!0)},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ce=n.$getSelection();return Z(ce)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INDENT_CONTENT_COMMAND,ce=>se(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>se(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>Te(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>Te(n.KEY_ARROW_DOWN_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_END,ce=>be(n.MOVE_TO_END,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_START,ce=>be(n.MOVE_TO_START,ce),n.COMMAND_PRIORITY_LOW))}return Mn.$createCodeHighlightNode=q,Mn.$createCodeNode=p,Mn.$isCodeHighlightNode=me,Mn.$isCodeNode=C,Mn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=W,Mn.CODE_LANGUAGE_MAP=B,Mn.CodeHighlightNode=V,Mn.CodeNode=g,Mn.DEFAULT_CODE_LANGUAGE=$,Mn.PrismTokenizer=ue,Mn.getCodeLanguages=le,Mn.getDefaultCodeLanguage=ee,Mn.getEndOfCodeInLine=j,Mn.getFirstCodeNodeOfLine=_e,Mn.getLanguageFriendlyName=X,Mn.getLastCodeNodeOfLine=pe,Mn.getStartOfCodeInLine=z,Mn.normalizeCodeLang=K,Mn.registerCodeHighlighting=Ue,Mn}var An={},Vh;function vC(){if(Vh)return An;Vh=1;var t=yp();Np(),Cp(),Ep(),Tp(),xp(),Sp(),vp(),wp(),Op(),Dp(),Mp(),Ap(),Rp(),bp();var e=on(),n=Bt();let r=k=>k!=null&&t.languages.hasOwnProperty(k)?k:void 0;function c(k,m){for(let y of k.childNodes){if(e.isHTMLElement(y)&&y.tagName===m)return!0;c(y,m)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(m){return new d(m.__language,m.__key)}constructor(m,y){super(y),this.__language=r(m)}createDOM(m){let y=document.createElement("code");return e.addClassNamesToElement(y,m.theme.code),y.setAttribute("spellcheck","false"),(m=this.getLanguage())&&y.setAttribute("data-highlight-language",m),y}updateDOM(m,y){let A=this.__language;return m=m.__language,A?A!==m&&y.setAttribute("data-highlight-language",A):m&&y.removeAttribute("data-highlight-language"),!1}exportDOM(){let m=document.createElement("pre");m.setAttribute("spellcheck","false");let y=this.getLanguage();return y&&m.setAttribute("data-highlight-language",y),{element:m}}static importDOM(){return{code:m=>m.textContent!=null&&(/\r?\n/.test(m.textContent)||c(m,"BR"))?{conversion:C,priority:1}:null,div:()=>({conversion:S,priority:1}),pre:()=>({conversion:C,priority:0}),table:m=>T(m)?{conversion:x,priority:3}:null,td:m=>{let y=m.closest("table");return m.classList.contains("js-file-line")?{conversion:R,priority:3}:y&&T(y)?{conversion:O,priority:3}:null},tr:m=>(m=m.closest("table"))&&T(m)?{conversion:O,priority:3}:null}}static importJSON(m){let y=g(m.language);return y.setFormat(m.format),y.setIndent(m.indent),y.setDirection(m.direction),y}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(m,y=!0){var A=this.getChildren(),Z=A.length;if(2<=Z&&A[Z-1].getTextContent()===`
88
+ `?ce.push(n.$createLineBreakNode()):ct===" "?ce.push(n.$createTabNode()):ct.length>0&&ce.push(q(ct,te))}}else{const{content:Le}=we;typeof Le=="string"?ce.push(...k([Le],we.type)):Array.isArray(Le)&&ce.push(...k(Le,we.type))}return ce}function m(re,te){const ce=n.$getNodeByKey(re);if(!C(ce)||!ce.isAttached())return;const we=n.$getSelection();if(!n.$isRangeSelection(we)){te();return}const Le=we.anchor,Be=Le.offset,Ye=Le.type==="element"&&n.$isLineBreakNode(ce.getChildAtIndex(Le.offset-1));let ct=0;if(!Ye){const dt=Le.getNode();ct=Be+dt.getPreviousSiblings().reduce((Se,ie)=>Se+ie.getTextContentSize(),0)}if(te()){if(Ye){Le.getNode().select(Be,Be);return}ce.getChildren().some(dt=>{const Se=n.$isTextNode(dt);if(Se||n.$isLineBreakNode(dt)){const ie=dt.getTextContentSize();if(Se&&ie>=ct)return dt.select(ct,ct),!0;ct-=ie}return!1})}}function y(re,te){let ce=0;for(;ce<re.length&&A(re[ce],te[ce]);)ce++;const we=re.length,Le=te.length,Be=Math.min(we,Le)-ce;let Ye=0;for(;Ye<Be;)if(Ye++,!A(re[we-Ye],te[Le-Ye])){Ye--;break}const ct=ce,yt=we-Ye,dt=te.slice(ce,Le-Ye);return{from:ct,nodesForReplacement:dt,to:yt}}function A(re,te){return me(re)&&me(te)&&re.__text===te.__text&&re.__highlightType===te.__highlightType||n.$isTabNode(re)&&n.$isTabNode(te)||n.$isLineBreakNode(re)&&n.$isLineBreakNode(te)}function Z(re){if(!n.$isRangeSelection(re))return!1;const te=re.anchor.getNode(),ce=re.focus.getNode();if(te.is(ce)&&C(te))return!0;const we=te.getParent();return C(we)&&we.is(ce.getParent())}function ae(re){const te=re.getNodes(),ce=[[]];if(te.length===1&&C(te[0]))return ce;let we=ce[0];for(let Le=0;Le<te.length;Le++){const Be=te[Le];if(!(me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Be)?Le!==0&&we.length>0&&(we=[],ce.push(we)):we.push(Be)}return ce}function he(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return null;const ce=re?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,we=re?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(ae(te).length>1)return ce;const Ye=te.getNodes()[0];if(!(C(Ye)||me(Ye)||n.$isTabNode(Ye)||n.$isLineBreakNode(Ye)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(C(Ye))return ce;const ct=_e(Ye),yt=pe(Ye),dt=te.anchor,Se=te.focus;let ie,fe;return Se.isBefore(dt)?(ie=Se,fe=dt):(ie=dt,fe=Se),ct!==null&&yt!==null&&ie.key===ct.getKey()&&ie.offset===0&&fe.key===yt.getKey()&&fe.offset===yt.getTextContentSize()?ce:we}function se(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return!1;const ce=ae(te),we=ce.length;if(ce.length>1){for(let ct=0;ct<we;ct++){const yt=ce[ct];if(yt.length>0){let dt=yt[0];ct===0&&(dt=_e(dt)),dt!==null&&(re===n.INDENT_CONTENT_COMMAND?dt.insertBefore(n.$createTabNode()):n.$isTabNode(dt)&&dt.remove())}}return!0}const Be=te.getNodes()[0];if(!(C(Be)||me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(C(Be))return re===n.INDENT_CONTENT_COMMAND&&te.insertNodes([n.$createTabNode()]),!0;const Ye=_e(Be);if(Ye===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return re===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(Ye)?Ye.insertAfter(n.$createTabNode()):Ye.insertBefore(n.$createTabNode()):n.$isTabNode(Ye)&&Ye.remove(),!0}function Te(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.offset,Ye=Le.offset,ct=we.getNode(),yt=Le.getNode(),dt=re===n.KEY_ARROW_UP_COMMAND;if(!Z(ce)||!(me(ct)||n.$isTabNode(ct))||!(me(yt)||n.$isTabNode(yt)))return!1;if(!te.altKey){if(ce.isCollapsed()){const qe=ct.getParentOrThrow();if(dt&&Be===0&&ct.getPreviousSibling()===null){if(qe.getPreviousSibling()===null)return qe.selectPrevious(),te.preventDefault(),!0}else if(!dt&&Be===ct.getTextContentSize()&&ct.getNextSibling()===null&&qe.getNextSibling()===null)return qe.selectNext(),te.preventDefault(),!0}return!1}let Se,ie;if(ct.isBefore(yt)?(Se=_e(ct),ie=pe(yt)):(Se=_e(yt),ie=pe(ct)),Se==null||ie==null)return!1;const fe=Se.getNodesBetween(ie);for(let qe=0;qe<fe.length;qe++){const Qe=fe[qe];if(!me(Qe)&&!n.$isTabNode(Qe)&&!n.$isLineBreakNode(Qe))return!1}te.preventDefault(),te.stopPropagation();const Oe=dt?Se.getPreviousSibling():ie.getNextSibling();if(!n.$isLineBreakNode(Oe))return!0;const Re=dt?Oe.getPreviousSibling():Oe.getNextSibling();if(Re==null)return!0;const De=me(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)?dt?_e(Re):pe(Re):null;let We=De??Re;return Oe.remove(),fe.forEach(qe=>qe.remove()),re===n.KEY_ARROW_UP_COMMAND?(fe.forEach(qe=>We.insertBefore(qe)),We.insertBefore(Oe)):(We.insertAfter(Oe),We=Oe,fe.forEach(qe=>{We.insertAfter(qe),We=qe})),ce.setTextNodeRange(ct,Be,yt,Ye),!0}function be(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.getNode(),Ye=Le.getNode(),ct=re===n.MOVE_TO_START;if(!(me(Be)||n.$isTabNode(Be))||!(me(Ye)||n.$isTabNode(Ye)))return!1;if(ct){const yt=K(Ye,Le.offset);if(yt!==null){const{node:dt,offset:Se}=yt;n.$isLineBreakNode(dt)?dt.selectNext(0,0):ce.setTextNodeRange(dt,Se,dt,Se)}else Ye.getParentOrThrow().selectStart()}else V(Ye).select();return te.preventDefault(),te.stopPropagation(),!0}function Ue(re,te){if(!re.hasNodes([g,j]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return te==null&&(te=ue),e.mergeRegister(re.registerMutationListener(g,ce=>{re.update(()=>{for(const[we,Le]of ce)if(Le!=="destroyed"){const Be=n.$getNodeByKey(we);Be!==null&&Y(Be,re)}})}),re.registerNodeTransform(g,ce=>Q(ce,re,te)),re.registerNodeTransform(n.TextNode,ce=>ne(ce,re,te)),re.registerNodeTransform(j,ce=>ne(ce,re,te)),re.registerCommand(n.KEY_TAB_COMMAND,ce=>{const we=he(ce.shiftKey);return we===null?!1:(ce.preventDefault(),re.dispatchCommand(we,void 0),!0)},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ce=n.$getSelection();return Z(ce)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INDENT_CONTENT_COMMAND,ce=>se(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>se(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>Te(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>Te(n.KEY_ARROW_DOWN_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_END,ce=>be(n.MOVE_TO_END,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_START,ce=>be(n.MOVE_TO_START,ce),n.COMMAND_PRIORITY_LOW))}return Mn.$createCodeHighlightNode=q,Mn.$createCodeNode=p,Mn.$isCodeHighlightNode=me,Mn.$isCodeNode=C,Mn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=H,Mn.CODE_LANGUAGE_MAP=B,Mn.CodeHighlightNode=j,Mn.CodeNode=g,Mn.DEFAULT_CODE_LANGUAGE=P,Mn.PrismTokenizer=ue,Mn.getCodeLanguages=le,Mn.getDefaultCodeLanguage=ee,Mn.getEndOfCodeInLine=V,Mn.getFirstCodeNodeOfLine=_e,Mn.getLanguageFriendlyName=X,Mn.getLastCodeNodeOfLine=pe,Mn.getStartOfCodeInLine=K,Mn.normalizeCodeLang=z,Mn.registerCodeHighlighting=Ue,Mn}var An={},Jh;function vC(){if(Jh)return An;Jh=1;var t=Ep();Tp(),xp(),Sp(),vp(),wp(),Op(),Dp(),Mp(),Ap(),Rp(),bp(),Lp(),kp(),Ip();var e=on(),n=Bt();let r=k=>k!=null&&t.languages.hasOwnProperty(k)?k:void 0;function c(k,m){for(let y of k.childNodes){if(e.isHTMLElement(y)&&y.tagName===m)return!0;c(y,m)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(m){return new d(m.__language,m.__key)}constructor(m,y){super(y),this.__language=r(m)}createDOM(m){let y=document.createElement("code");return e.addClassNamesToElement(y,m.theme.code),y.setAttribute("spellcheck","false"),(m=this.getLanguage())&&y.setAttribute("data-highlight-language",m),y}updateDOM(m,y){let A=this.__language;return m=m.__language,A?A!==m&&y.setAttribute("data-highlight-language",A):m&&y.removeAttribute("data-highlight-language"),!1}exportDOM(){let m=document.createElement("pre");m.setAttribute("spellcheck","false");let y=this.getLanguage();return y&&m.setAttribute("data-highlight-language",y),{element:m}}static importDOM(){return{code:m=>m.textContent!=null&&(/\r?\n/.test(m.textContent)||c(m,"BR"))?{conversion:C,priority:1}:null,div:()=>({conversion:S,priority:1}),pre:()=>({conversion:C,priority:0}),table:m=>x(m)?{conversion:T,priority:3}:null,td:m=>{let y=m.closest("table");return m.classList.contains("js-file-line")?{conversion:R,priority:3}:y&&x(y)?{conversion:O,priority:3}:null},tr:m=>(m=m.closest("table"))&&x(m)?{conversion:O,priority:3}:null}}static importJSON(m){let y=g(m.language);return y.setFormat(m.format),y.setIndent(m.indent),y.setDirection(m.direction),y}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(m,y=!0){var A=this.getChildren(),Z=A.length;if(2<=Z&&A[Z-1].getTextContent()===`
89
89
  `&&A[Z-2].getTextContent()===`
90
- `&&m.isCollapsed()&&m.anchor.key===this.__key&&m.anchor.offset===Z)return A[Z-1].remove(),A[Z-2].remove(),m=n.$createParagraphNode(),this.insertAfter(m,y),m;let{anchor:ae,focus:he}=m;if(y=(ae.isBefore(he)?ae:he).getNode(),n.$isTextNode(y)){for(Z=X(y),A=[];;)if(n.$isTabNode(Z))A.push(n.$createTabNode()),Z=Z.getNextSibling();else if(K(Z)){for(var se=0,Te=Z.getTextContent(),be=Z.getTextContentSize();se<be&&Te[se]===" ";se++);if(se!==0&&A.push(B(" ".repeat(se))),se!==be)break;Z=Z.getNextSibling()}else break;Z=y.splitText(ae.offset)[0],se=ae.offset===0?0:1,se=Z.getIndexWithinParent()+se,Te=y.getParentOrThrow(),be=[n.$createLineBreakNode(),...A],Te.splice(se,0,be),(A=A[A.length-1])?A.select():ae.offset===0?Z.selectPrevious():Z.getNextSibling().selectNext(0,0)}return p(y)&&({offset:m}=m.anchor,y.splice(m,0,[n.$createLineBreakNode()]),y.select(m+1,m+1)),null}canIndent(){return!1}collapseAtStart(){let m=n.$createParagraphNode();return this.getChildren().forEach(y=>m.append(y)),this.replace(m),!0}setLanguage(m){this.getWritable().__language=r(m)}getLanguage(){return this.getLatest().__language}}function g(k){return n.$applyNodeReplacement(new d(k))}function p(k){return k instanceof d}function C(k){let m;return e.isHTMLElement(k)&&(m=k.getAttribute("data-highlight-language")),{node:g(m)}}function S(k){let m=k.style.fontFamily.match("monospace")!==null;return m||b(k)?{after:y=>{let A=k.parentNode;return A!=null&&k!==A.lastChild&&y.push(n.$createLineBreakNode()),y},node:m?g():null}:{node:null}}function x(){return{node:g()}}function O(){return{node:null}}function R(k){return{after:m=>(k.parentNode&&k.parentNode.nextSibling&&m.push(n.$createLineBreakNode()),m),node:null}}function b(k){for(k=k.parentElement;k!==null;){if(k.style.fontFamily.match("monospace")!==null)return!0;k=k.parentElement}return!1}function T(k){return k.classList.contains("js-file-line-container")}let 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"},P={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function H(k){return P[k]||k}class $ extends n.TextNode{constructor(m,y,A){super(m,A),this.__highlightType=y}static getType(){return"code-highlight"}static clone(m){return new $(m.__text,m.__highlightType||void 0,m.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(m){let y=super.createDOM(m);return m=W(m.theme,this.__highlightType),e.addClassNamesToElement(y,m),y}updateDOM(m,y,A){let Z=super.updateDOM(m,y,A);return m=W(A.theme,m.__highlightType),A=W(A.theme,this.__highlightType),m!==A&&(m&&e.removeClassNamesFromElement(y,m),A&&e.addClassNamesToElement(y,A)),Z}static importJSON(m){let y=B(m.text,m.highlightType);return y.setFormat(m.format),y.setDetail(m.detail),y.setMode(m.mode),y.setStyle(m.style),y}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return g()}}function W(k,m){return m&&k&&k.codeHighlight&&k.codeHighlight[m]}function B(k,m){return n.$applyNodeReplacement(new $(k,m))}function K(k){return k instanceof $}function X(k){let m=k;for(;K(k)||n.$isTabNode(k);)m=k,k=k.getPreviousSibling();return m}function ee(k){let m=k;for(;K(k)||n.$isTabNode(k);)m=k,k=k.getNextSibling();return m}let le={defaultLanguage:"javascript",tokenize(k,m){return t.tokenize(k,t.languages[m||""]||t.languages[this.defaultLanguage])}};function V(k,m){let y=null;var A=null,Z=k;let ae=m,he=k.getTextContent();for(;;){if(ae===0){if(Z=Z.getPreviousSibling(),Z===null)break;if(!(K(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Z)){y={node:Z,offset:1};break}ae=Math.max(0,Z.getTextContentSize()-1),he=Z.getTextContent()}else ae--;let se=he[ae];K(Z)&&se!==" "&&(A={node:Z,offset:ae})}if(A!==null)return A;if(A=null,m<k.getTextContentSize()?K(k)&&(A=k.getTextContent()[m]):(Z=k.getNextSibling(),K(Z)&&(A=Z.getTextContent()[0])),A!==null&&A!==" ")return y;e:for(A=k,Z=k.getTextContent(),k=k.getTextContentSize();;){if(!K(A)||m===k){if(A=A.getNextSibling(),A===null||n.$isLineBreakNode(A)){k=null;break e}K(A)&&(m=0,Z=A.getTextContent(),k=A.getTextContentSize())}if(K(A)){if(Z[m]!==" "){k={node:A,offset:m};break e}m++}}return k!==null?k:y}function U(k){if(k=ee(k),n.$isLineBreakNode(k))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return k}function q(k,m,y){let A=k.getParent();p(A)?_e(A,m,y):K(k)&&k.replace(n.$createTextNode(k.__text))}let me=new Set;function _e(k,m,y){let A=k.getKey();me.has(A)||(me.add(A),k.getLanguage()===void 0&&k.setLanguage(y.defaultLanguage),m.update(()=>{ue(A,()=>{var Z=n.$getNodeByKey(A);if(!p(Z)||!Z.isAttached())return!1;var ae=Z.getTextContent();ae=y.tokenize(ae,Z.getLanguage()||y.defaultLanguage),ae=pe(ae);var he=Z.getChildren();for(Z=0;Z<he.length&&z(he[Z],ae[Z]);)Z++;var se=he.length;let Te=ae.length,be=Math.min(se,Te)-Z,Ue=0;for(;Ue<be;)if(Ue++,!z(he[se-Ue],ae[Te-Ue])){Ue--;break}he=Z,se-=Ue,ae=ae.slice(Z,Te-Ue);let{from:re,to:te,nodesForReplacement:ce}={from:he,nodesForReplacement:ae,to:se};return re!==te||ce.length?(k.splice(re,te-re,ce),!0):!1})},{onUpdate:()=>{me.delete(A)},skipTransforms:!0}))}function pe(k,m){let y=[];for(let A of k)if(typeof A=="string"){k=A.split(/(\n|\t)/);let Z=k.length;for(let ae=0;ae<Z;ae++){let he=k[ae];he===`
90
+ `&&m.isCollapsed()&&m.anchor.key===this.__key&&m.anchor.offset===Z)return A[Z-1].remove(),A[Z-2].remove(),m=n.$createParagraphNode(),this.insertAfter(m,y),m;let{anchor:ae,focus:he}=m;if(y=(ae.isBefore(he)?ae:he).getNode(),n.$isTextNode(y)){for(Z=X(y),A=[];;)if(n.$isTabNode(Z))A.push(n.$createTabNode()),Z=Z.getNextSibling();else if(z(Z)){for(var se=0,Te=Z.getTextContent(),be=Z.getTextContentSize();se<be&&Te[se]===" ";se++);if(se!==0&&A.push(B(" ".repeat(se))),se!==be)break;Z=Z.getNextSibling()}else break;Z=y.splitText(ae.offset)[0],se=ae.offset===0?0:1,se=Z.getIndexWithinParent()+se,Te=y.getParentOrThrow(),be=[n.$createLineBreakNode(),...A],Te.splice(se,0,be),(A=A[A.length-1])?A.select():ae.offset===0?Z.selectPrevious():Z.getNextSibling().selectNext(0,0)}return p(y)&&({offset:m}=m.anchor,y.splice(m,0,[n.$createLineBreakNode()]),y.select(m+1,m+1)),null}canIndent(){return!1}collapseAtStart(){let m=n.$createParagraphNode();return this.getChildren().forEach(y=>m.append(y)),this.replace(m),!0}setLanguage(m){this.getWritable().__language=r(m)}getLanguage(){return this.getLatest().__language}}function g(k){return n.$applyNodeReplacement(new d(k))}function p(k){return k instanceof d}function C(k){let m;return e.isHTMLElement(k)&&(m=k.getAttribute("data-highlight-language")),{node:g(m)}}function S(k){let m=k.style.fontFamily.match("monospace")!==null;return m||b(k)?{after:y=>{let A=k.parentNode;return A!=null&&k!==A.lastChild&&y.push(n.$createLineBreakNode()),y},node:m?g():null}:{node:null}}function T(){return{node:g()}}function O(){return{node:null}}function R(k){return{after:m=>(k.parentNode&&k.parentNode.nextSibling&&m.push(n.$createLineBreakNode()),m),node:null}}function b(k){for(k=k.parentElement;k!==null;){if(k.style.fontFamily.match("monospace")!==null)return!0;k=k.parentElement}return!1}function x(k){return k.classList.contains("js-file-line-container")}let 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"},$={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function W(k){return $[k]||k}class P extends n.TextNode{constructor(m,y,A){super(m,A),this.__highlightType=y}static getType(){return"code-highlight"}static clone(m){return new P(m.__text,m.__highlightType||void 0,m.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(m){let y=super.createDOM(m);return m=H(m.theme,this.__highlightType),e.addClassNamesToElement(y,m),y}updateDOM(m,y,A){let Z=super.updateDOM(m,y,A);return m=H(A.theme,m.__highlightType),A=H(A.theme,this.__highlightType),m!==A&&(m&&e.removeClassNamesFromElement(y,m),A&&e.addClassNamesToElement(y,A)),Z}static importJSON(m){let y=B(m.text,m.highlightType);return y.setFormat(m.format),y.setDetail(m.detail),y.setMode(m.mode),y.setStyle(m.style),y}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return g()}}function H(k,m){return m&&k&&k.codeHighlight&&k.codeHighlight[m]}function B(k,m){return n.$applyNodeReplacement(new P(k,m))}function z(k){return k instanceof P}function X(k){let m=k;for(;z(k)||n.$isTabNode(k);)m=k,k=k.getPreviousSibling();return m}function ee(k){let m=k;for(;z(k)||n.$isTabNode(k);)m=k,k=k.getNextSibling();return m}let le={defaultLanguage:"javascript",tokenize(k,m){return t.tokenize(k,t.languages[m||""]||t.languages[this.defaultLanguage])}};function j(k,m){let y=null;var A=null,Z=k;let ae=m,he=k.getTextContent();for(;;){if(ae===0){if(Z=Z.getPreviousSibling(),Z===null)break;if(!(z(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Z)){y={node:Z,offset:1};break}ae=Math.max(0,Z.getTextContentSize()-1),he=Z.getTextContent()}else ae--;let se=he[ae];z(Z)&&se!==" "&&(A={node:Z,offset:ae})}if(A!==null)return A;if(A=null,m<k.getTextContentSize()?z(k)&&(A=k.getTextContent()[m]):(Z=k.getNextSibling(),z(Z)&&(A=Z.getTextContent()[0])),A!==null&&A!==" ")return y;e:for(A=k,Z=k.getTextContent(),k=k.getTextContentSize();;){if(!z(A)||m===k){if(A=A.getNextSibling(),A===null||n.$isLineBreakNode(A)){k=null;break e}z(A)&&(m=0,Z=A.getTextContent(),k=A.getTextContentSize())}if(z(A)){if(Z[m]!==" "){k={node:A,offset:m};break e}m++}}return k!==null?k:y}function U(k){if(k=ee(k),n.$isLineBreakNode(k))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return k}function q(k,m,y){let A=k.getParent();p(A)?_e(A,m,y):z(k)&&k.replace(n.$createTextNode(k.__text))}let me=new Set;function _e(k,m,y){let A=k.getKey();me.has(A)||(me.add(A),k.getLanguage()===void 0&&k.setLanguage(y.defaultLanguage),m.update(()=>{ue(A,()=>{var Z=n.$getNodeByKey(A);if(!p(Z)||!Z.isAttached())return!1;var ae=Z.getTextContent();ae=y.tokenize(ae,Z.getLanguage()||y.defaultLanguage),ae=pe(ae);var he=Z.getChildren();for(Z=0;Z<he.length&&K(he[Z],ae[Z]);)Z++;var se=he.length;let Te=ae.length,be=Math.min(se,Te)-Z,Ue=0;for(;Ue<be;)if(Ue++,!K(he[se-Ue],ae[Te-Ue])){Ue--;break}he=Z,se-=Ue,ae=ae.slice(Z,Te-Ue);let{from:re,to:te,nodesForReplacement:ce}={from:he,nodesForReplacement:ae,to:se};return re!==te||ce.length?(k.splice(re,te-re,ce),!0):!1})},{onUpdate:()=>{me.delete(A)},skipTransforms:!0}))}function pe(k,m){let y=[];for(let A of k)if(typeof A=="string"){k=A.split(/(\n|\t)/);let Z=k.length;for(let ae=0;ae<Z;ae++){let he=k[ae];he===`
91
91
  `||he===`\r
92
- `?y.push(n.$createLineBreakNode()):he===" "?y.push(n.$createTabNode()):0<he.length&&y.push(B(he,m))}}else({content:k}=A),typeof k=="string"?y.push(...pe([k],A.type)):Array.isArray(k)&&y.push(...pe(k,A.type));return y}function ue(k,m){if(k=n.$getNodeByKey(k),p(k)&&k.isAttached()){var y=n.$getSelection();if(n.$isRangeSelection(y)){y=y.anchor;var A=y.offset,Z=y.type==="element"&&n.$isLineBreakNode(k.getChildAtIndex(y.offset-1)),ae=0;if(!Z){let he=y.getNode();ae=A+he.getPreviousSiblings().reduce((se,Te)=>se+Te.getTextContentSize(),0)}m()&&(Z?y.getNode().select(A,A):k.getChildren().some(he=>{let se=n.$isTextNode(he);if(se||n.$isLineBreakNode(he)){let Te=he.getTextContentSize();if(se&&Te>=ae)return he.select(ae,ae),!0;ae-=Te}return!1}))}else m()}}function z(k,m){return K(k)&&K(m)&&k.__text===m.__text&&k.__highlightType===m.__highlightType||n.$isTabNode(k)&&n.$isTabNode(m)||n.$isLineBreakNode(k)&&n.$isLineBreakNode(m)}function D(k){if(!n.$isRangeSelection(k))return!1;var m=k.anchor.getNode();return k=k.focus.getNode(),m.is(k)&&p(m)?!0:(m=m.getParent(),p(m)&&m.is(k.getParent()))}function j(k){k=k.getNodes();let m=[[]];if(k.length===1&&p(k[0]))return m;let y=m[0];for(let A=0;A<k.length;A++){let Z=k[A];if(!(K(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Z)?A!==0&&0<y.length&&(y=[],m.push(y)):y.push(Z)}return m}function ne(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return null;let y=k?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(k=k?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<j(m).length)return y;var A=m.getNodes()[0];if(!(p(A)||K(A)||n.$isTabNode(A)||n.$isLineBreakNode(A)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(p(A))return y;let Z=X(A);A=ee(A);var ae=m.anchor;let he=m.focus;return he.isBefore(ae)?m=he:(m=ae,ae=he),Z!==null&&A!==null&&m.key===Z.getKey()&&m.offset===0&&ae.key===A.getKey()&&ae.offset===A.getTextContentSize()?y:k}function Y(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return!1;var y=j(m);let A=y.length;if(1<y.length){for(m=0;m<A;m++){var Z=y[m];0<Z.length&&(Z=Z[0],m===0&&(Z=X(Z)),Z!==null&&(k===n.INDENT_CONTENT_COMMAND?Z.insertBefore(n.$createTabNode()):n.$isTabNode(Z)&&Z.remove()))}return!0}if(y=m.getNodes()[0],!(p(y)||K(y)||n.$isTabNode(y)||n.$isLineBreakNode(y)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(p(y))return k===n.INDENT_CONTENT_COMMAND&&m.insertNodes([n.$createTabNode()]),!0;if(y=X(y),y===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return k===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(y)?y.insertAfter(n.$createTabNode()):y.insertBefore(n.$createTabNode()):n.$isTabNode(y)&&y.remove(),!0}function G(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:A,focus:Z}=y,ae=A.offset,he=Z.offset,se=A.getNode(),Te=Z.getNode();var be=k===n.KEY_ARROW_UP_COMMAND;if(!D(y)||!K(se)&&!n.$isTabNode(se)||!K(Te)&&!n.$isTabNode(Te))return!1;if(!m.altKey){if(y.isCollapsed()){if(k=se.getParentOrThrow(),be&&ae===0&&se.getPreviousSibling()===null){if(k.getPreviousSibling()===null)return k.selectPrevious(),m.preventDefault(),!0}else if(!be&&ae===se.getTextContentSize()&&se.getNextSibling()===null&&k.getNextSibling()===null)return k.selectNext(),m.preventDefault(),!0}return!1}let Ue;if(se.isBefore(Te)){var re=X(se);Ue=ee(Te)}else re=X(Te),Ue=ee(se);if(re==null||Ue==null)return!1;let te=re.getNodesBetween(Ue);for(let we=0;we<te.length;we++){let Le=te[we];if(!K(Le)&&!n.$isTabNode(Le)&&!n.$isLineBreakNode(Le))return!1}if(m.preventDefault(),m.stopPropagation(),m=be?re.getPreviousSibling():Ue.getNextSibling(),!n.$isLineBreakNode(m)||(re=be?m.getPreviousSibling():m.getNextSibling(),re==null))return!0;be=K(re)||n.$isTabNode(re)||n.$isLineBreakNode(re)?be?X(re):ee(re):null;let ce=be??re;return m.remove(),te.forEach(we=>we.remove()),k===n.KEY_ARROW_UP_COMMAND?(te.forEach(we=>ce.insertBefore(we)),ce.insertBefore(m)):(ce.insertAfter(m),ce=m,te.forEach(we=>{ce.insertAfter(we),ce=we})),y.setTextNodeRange(se,ae,Te,he),!0}function Q(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:A,focus:Z}=y;var ae=A.getNode();let he=Z.getNode();if(k=k===n.MOVE_TO_START,!K(ae)&&!n.$isTabNode(ae)||!K(he)&&!n.$isTabNode(he))return!1;if(k)if(ae=V(he,Z.offset),ae!==null){let{node:se,offset:Te}=ae;n.$isLineBreakNode(se)?se.selectNext(0,0):y.setTextNodeRange(se,Te,se,Te)}else he.getParentOrThrow().selectStart();else U(he).select();return m.preventDefault(),m.stopPropagation(),!0}return An.$createCodeHighlightNode=B,An.$createCodeNode=g,An.$isCodeHighlightNode=K,An.$isCodeNode=p,An.CODE_LANGUAGE_FRIENDLY_NAME_MAP=w,An.CODE_LANGUAGE_MAP=P,An.CodeHighlightNode=$,An.CodeNode=d,An.DEFAULT_CODE_LANGUAGE="javascript",An.PrismTokenizer=le,An.getCodeLanguages=()=>Object.keys(t.languages).filter(k=>typeof t.languages[k]!="function").sort(),An.getDefaultCodeLanguage=()=>"javascript",An.getEndOfCodeInLine=U,An.getFirstCodeNodeOfLine=X,An.getLanguageFriendlyName=function(k){return k=H(k),w[k]||k},An.getLastCodeNodeOfLine=ee,An.getStartOfCodeInLine=V,An.normalizeCodeLang=H,An.registerCodeHighlighting=function(k,m){if(!k.hasNodes([d,$]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return m==null&&(m=le),e.mergeRegister(k.registerMutationListener(d,y=>{k.update(()=>{for(let[ae,he]of y)if(he!=="destroyed"){var A=n.$getNodeByKey(ae);if(A!==null)e:{var Z=A;if(A=k.getElementByKey(Z.getKey()),A===null)break e;Z=Z.getChildren();let se=Z.length;if(se===A.__cachedChildrenLength)break e;A.__cachedChildrenLength=se;let Te="1",be=1;for(let Ue=0;Ue<se;Ue++)n.$isLineBreakNode(Z[Ue])&&(Te+=`
93
- `+ ++be);A.setAttribute("data-gutter",Te)}}})}),k.registerNodeTransform(d,y=>_e(y,k,m)),k.registerNodeTransform(n.TextNode,y=>q(y,k,m)),k.registerNodeTransform($,y=>q(y,k,m)),k.registerCommand(n.KEY_TAB_COMMAND,y=>{let A=ne(y.shiftKey);return A===null?!1:(y.preventDefault(),k.dispatchCommand(A,void 0),!0)},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INSERT_TAB_COMMAND,()=>{let y=n.$getSelection();return D(y)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_UP_COMMAND,y=>G(n.KEY_ARROW_UP_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_DOWN_COMMAND,y=>G(n.KEY_ARROW_DOWN_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_END,y=>Q(n.MOVE_TO_END,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_START,y=>Q(n.MOVE_TO_START,y),n.COMMAND_PRIORITY_LOW))},An}const wC=process.env.NODE_ENV==="development"?SC():vC();var zu=wC,pd=Un();function OC(){const[t]=pd.useLexicalComposerContext();return et.useEffect(()=>zu.registerCodeHighlighting(t),[t]),null}var qh=on(),Rn=Bt();function DC({src:t,altText:e,width:n,height:r,maxWidth:c}){const d=et.useMemo(()=>({height:r,width:n,maxWidth:c}),[r,n,c]);return at.jsx("img",{src:t,alt:e,style:d})}function Lp({altText:t,height:e,maxWidth:n=500,src:r,width:c,key:d}){return Rn.$applyNodeReplacement(new rl(r,t,n,c,e,d))}function MC(t){return t instanceof rl}class rl extends Rn.DecoratorNode{constructor(n,r,c,d,g,p){super(p);Vn(this,"__src");Vn(this,"__altText");Vn(this,"__width");Vn(this,"__height");Vn(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 rl(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 Lp(n)}createDOM(n){const r=document.createElement("span"),c=n.theme.image;return c&&(r.className=c),r}updateDOM(){return!1}decorate(){return at.jsx(DC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const AC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RC=t=>AC?(t||window).getSelection():null,kp=Rn.createCommand("INSERT_IMAGE_COMMAND");function bC(){const[t]=pd.useLexicalComposerContext();return et.useEffect(()=>{if(!t.hasNodes([rl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return qh.mergeRegister(t.registerCommand(kp,e=>{const n=Lp(e);return Rn.$insertNodes([n]),Rn.$isRootOrShadowRoot(n.getParentOrThrow())&&qh.$wrapNodeInElement(n,Rn.$createParagraphNode).selectEnd(),!0},Rn.COMMAND_PRIORITY_EDITOR),t.registerCommand(Rn.DRAGSTART_COMMAND,e=>LC(e),Rn.COMMAND_PRIORITY_HIGH),t.registerCommand(Rn.DRAGOVER_COMMAND,e=>kC(e),Rn.COMMAND_PRIORITY_LOW),t.registerCommand(Rn.DROP_COMMAND,e=>IC(e,t),Rn.COMMAND_PRIORITY_HIGH))},[t]),null}function LC(t){const e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=e;const r=md();if(!r)return!1;const c=t.dataTransfer;return c?(c.setData("text/plain","_"),c.setDragImage(n,0,0),c.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function kC(t){return md()?(Ip(t)||t.preventDefault(),!0):!1}function IC(t,e){const n=md();if(!n)return!1;const r=PC(t);if(!r)return!1;if(t.preventDefault(),Ip(t)){const c=$C(t);n.remove();const d=Rn.$createRangeSelection();c!=null&&d.applyDOMRange(c),Rn.$setSelection(d),e.dispatchCommand(kp,r)}return!0}function md(){const t=Rn.$getSelection();if(!Rn.$isNodeSelection(t))return null;const n=t.getNodes()[0];return MC(n)?n:null}function PC(t){var c;const e=(c=t.dataTransfer)==null?void 0:c.getData("application/x-lexical-drag");if(!e)return null;const{type:n,data:r}=JSON.parse(e);return n!=="image"?null:r}function Ip(t){const e=t.target;return!!(e&&e instanceof HTMLElement&&!e.closest("code, span.yext-default-richtextv2-theme__image")&&e.parentElement)}function $C(t){let e;const n=t.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,c=RC(r);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&c!==null)c.collapse(t.rangeParent,t.rangeOffset||0),e=c.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var ls=fd();function FC(t){const e=t.getNodes();return e.length===0?new Set([t.anchor.getNode().getParentOrThrow(),t.focus.getNode().getParentOrThrow()]):new Set(e.map(n=>Rn.$isElementNode(n)?n:n.getParentOrThrow()))}const BC=3;function HC(t){const e=Rn.$getSelection();if(!Rn.$isRangeSelection(e))return!1;const n=FC(e);let r=0;for(const c of n)if(ls.$isListNode(c))r=Math.max(ls.$getListDepth(c)+1,r);else if(ls.$isListItemNode(c)){const d=c.getParent();if(!ls.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(ls.$getListDepth(d)+1,r)}return r<=t}function WC({maxDepth:t}){const[e]=pd.useLexicalComposerContext();return et.useEffect(()=>e.registerCommand(Rn.INDENT_CONTENT_COMMAND,()=>!HC(t||7),BC),[e,t]),null}var xu=gd(),Zh=hd(),Jh=dd(),Wl={},Xh;function KC(){if(Xh)return Wl;Xh=1;var t=on(),e=Bt();class n extends e.TextNode{static getType(){return"hashtag"}static clone(g){return new n(g.__text,g.__key)}constructor(g,p){super(g,p)}createDOM(g){const p=super.createDOM(g);return t.addClassNamesToElement(p,g.theme.hashtag),p}static importJSON(g){const p=r(g.text);return p.setFormat(g.format),p.setDetail(g.detail),p.setMode(g.mode),p.setStyle(g.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return e.$applyNodeReplacement(new n(d))}function c(d){return d instanceof n}return Wl.$createHashtagNode=r,Wl.$isHashtagNode=c,Wl.HashtagNode=n,Wl}var Kl={},Qh;function zC(){if(Qh)return Kl;Qh=1;var t=on(),e=Bt();class n extends e.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 t.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 e.$applyNodeReplacement(new n(c))}return Kl.$createHashtagNode=r,Kl.$isHashtagNode=function(c){return c instanceof n},Kl.HashtagNode=n,Kl}const UC=process.env.NODE_ENV==="development"?KC():zC();var GC=UC;const YC="_rtl_13v3w_295",jC="_selected_13v3w_370",lt={"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__ul":"_yext-default-richtextv2-theme__ul_13v3w_17","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",rtl:YC,"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",selected:jC,"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"},VC={characterLimit:lt["yext-default-richtextv2-theme__characterLimit"],code:lt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:lt["yext-default-richtextv2-theme__tokenAttr"],attr:lt["yext-default-richtextv2-theme__tokenAttr"],boolean:lt["yext-default-richtextv2-theme__tokenProperty"],builtin:lt["yext-default-richtextv2-theme__tokenSelector"],cdata:lt["yext-default-richtextv2-theme__tokenComment"],char:lt["yext-default-richtextv2-theme__tokenSelector"],class:lt["yext-default-richtextv2-theme__tokenFunction"],"class-name":lt["yext-default-richtextv2-theme__tokenFunction"],comment:lt["yext-default-richtextv2-theme__tokenComment"],constant:lt["yext-default-richtextv2-theme__tokenProperty"],deleted:lt["yext-default-richtextv2-theme__tokenProperty"],doctype:lt["yext-default-richtextv2-theme__tokenComment"],entity:lt["yext-default-richtextv2-theme__tokenOperator"],function:lt["yext-default-richtextv2-theme__tokenFunction"],important:lt["yext-default-richtextv2-theme__tokenVariable"],inserted:lt["yext-default-richtextv2-theme__tokenSelector"],keyword:lt["yext-default-richtextv2-theme__tokenAttr"],namespace:lt["yext-default-richtextv2-theme__tokenVariable"],number:lt["yext-default-richtextv2-theme__tokenProperty"],operator:lt["yext-default-richtextv2-theme__tokenOperator"],prolog:lt["yext-default-richtextv2-theme__tokenComment"],property:lt["yext-default-richtextv2-theme__tokenProperty"],punctuation:lt["yext-default-richtextv2-theme__tokenPunctuation"],regex:lt["yext-default-richtextv2-theme__tokenVariable"],selector:lt["yext-default-richtextv2-theme__tokenSelector"],string:lt["yext-default-richtextv2-theme__tokenSelector"],symbol:lt["yext-default-richtextv2-theme__tokenProperty"],tag:lt["yext-default-richtextv2-theme__tokenProperty"],url:lt["yext-default-richtextv2-theme__tokenOperator"],variable:lt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:lt["yext-default-richtextv2-theme__embedBlock"],focus:lt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:lt["yext-default-richtextv2-theme__hashtag"],heading:{h1:lt["yext-default-richtextv2-theme__h1"],h2:lt["yext-default-richtextv2-theme__h2"],h3:lt["yext-default-richtextv2-theme__h3"],h4:lt["yext-default-richtextv2-theme__h4"],h5:lt["yext-default-richtextv2-theme__h5"],h6:lt["yext-default-richtextv2-theme__h6"]},image:lt["yext-default-richtextv2-theme__image"],link:lt["yext-default-richtextv2-theme__link"],list:{listitem:lt["yext-default-richtextv2-theme__listItem"],listitemChecked:lt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:lt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:lt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[lt["yext-default-richtextv2-theme__ol1"],lt["yext-default-richtextv2-theme__ol2"],lt["yext-default-richtextv2-theme__ol3"],lt["yext-default-richtextv2-theme__ol4"],lt["yext-default-richtextv2-theme__ol5"]],ulDepth:[lt["yext-default-richtextv2-theme__ul1"],lt["yext-default-richtextv2-theme__ul2"],lt["yext-default-richtextv2-theme__ul3"]]},ltr:lt["yext-default-richtextv2-theme__ltr"],mark:lt["yext-default-richtextv2-theme__mark"],markOverlap:lt["yext-default-richtextv2-theme__markOverlap"],paragraph:lt["yext-default-richtextv2-theme__paragraph"],quote:lt["yext-default-richtextv2-theme__quote"],rtl:lt["yext-default-richtextv2-theme__rtl"],table:lt["yext-default-richtextv2-theme__table"],tableCell:lt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:lt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:lt["yext-default-richtextv2-theme__textBold"],code:lt["yext-default-richtextv2-theme__textCode"],italic:lt["yext-default-richtextv2-theme__textItalic"],strikethrough:lt["yext-default-richtextv2-theme__textStrikethrough"],subscript:lt["yext-default-richtextv2-theme__textSubscript"],superscript:lt["yext-default-richtextv2-theme__textSuperscript"],underline:lt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:lt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var zs={},Su={},eg;function qC(){if(eg)return Su;eg=1;var t=Un(),e=Bt(),n=et;function r(d,g){return d.getEditorState().read(()=>{const p=e.$getNodeByKey(g);return p===null?!1:p.isSelected()})}function c(d){const[g]=t.useLexicalComposerContext(),[p,C]=n.useState(()=>r(g,d));n.useEffect(()=>{let O=!0;const R=g.registerUpdateListener(()=>{O&&C(r(g,d))});return()=>{O=!1,R()}},[g,d]);const S=n.useCallback(O=>{g.update(()=>{let R=e.$getSelection();e.$isNodeSelection(R)||(R=e.$createNodeSelection(),e.$setSelection(R)),e.$isNodeSelection(R)&&(O?R.add(d):R.delete(d))})},[g,d]),x=n.useCallback(()=>{g.update(()=>{const O=e.$getSelection();e.$isNodeSelection(O)&&O.clear()})},[g]);return[p,S,x]}return Su.useLexicalNodeSelection=c,Su}var vu={},tg;function ZC(){if(tg)return vu;tg=1;var t=Un(),e=Bt(),n=et;function r(c,d){return c.getEditorState().read(()=>{let g=e.$getNodeByKey(d);return g===null?!1:g.isSelected()})}return vu.useLexicalNodeSelection=function(c){let[d]=t.useLexicalComposerContext(),[g,p]=n.useState(()=>r(d,c));n.useEffect(()=>{let x=!0,O=d.registerUpdateListener(()=>{x&&p(r(d,c))});return()=>{x=!1,O()}},[d,c]);let C=n.useCallback(x=>{d.update(()=>{let O=e.$getSelection();e.$isNodeSelection(O)||(O=e.$createNodeSelection(),e.$setSelection(O)),e.$isNodeSelection(O)&&(x?O.add(c):O.delete(c))})},[d,c]),S=n.useCallback(()=>{d.update(()=>{const x=e.$getSelection();e.$isNodeSelection(x)&&x.clear()})},[d]);return[g,C,S]},vu}var wu,ng;function Pp(){return ng||(ng=1,wu=process.env.NODE_ENV==="development"?qC():ZC()),wu}var rg;function JC(){if(rg)return zs;rg=1;var t=Un(),e=Pp(),n=on(),r=Bt(),c=et;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){const[R]=t.useLexicalComposerContext(),[b,T,w]=e.useLexicalNodeSelection(O),P=c.useCallback(H=>{if(b&&r.$isNodeSelection(r.$getSelection())){H.preventDefault();const $=r.$getNodeByKey(O);x($)&&$.remove()}return!1},[b,O]);return c.useEffect(()=>n.mergeRegister(R.registerCommand(r.CLICK_COMMAND,H=>{const $=R.getElementByKey(O);return H.target===$?(H.shiftKey||w(),T(!b),!0):!1},r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_DELETE_COMMAND,P,r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_BACKSPACE_COMMAND,P,r.COMMAND_PRIORITY_LOW)),[w,R,b,O,P,T]),c.useEffect(()=>{const H=R.getElementByKey(O);H!==null&&(H.className=b?"selected":"")},[R,b,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(R){return new p(R.__key)}static importJSON(R){return S()}static importDOM(){return{hr:()=>({conversion:C,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
94
- `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function C(){return{node:S()}}function S(){return r.$applyNodeReplacement(new p)}function x(O){return O instanceof p}return zs.$createHorizontalRuleNode=S,zs.$isHorizontalRuleNode=x,zs.HorizontalRuleNode=p,zs.INSERT_HORIZONTAL_RULE_COMMAND=d,zs}var Us={},ig;function XC(){if(ig)return Us;ig=1;var t=Un(),e=Pp(),n=on(),r=Bt(),c=et;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){let[R]=t.useLexicalComposerContext(),[b,T,w]=e.useLexicalNodeSelection(O),P=c.useCallback(H=>(b&&r.$isNodeSelection(r.$getSelection())&&(H.preventDefault(),H=r.$getNodeByKey(O),x(H)&&H.remove()),!1),[b,O]);return c.useEffect(()=>n.mergeRegister(R.registerCommand(r.CLICK_COMMAND,H=>{let $=R.getElementByKey(O);return H.target===$?(H.shiftKey||w(),T(!b),!0):!1},r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_DELETE_COMMAND,P,r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_BACKSPACE_COMMAND,P,r.COMMAND_PRIORITY_LOW)),[w,R,b,O,P,T]),c.useEffect(()=>{let H=R.getElementByKey(O);H!==null&&(H.className=b?"selected":"")},[R,b,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(R){return new p(R.__key)}static importJSON(){return S()}static importDOM(){return{hr:()=>({conversion:C,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
95
- `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function C(){return{node:S()}}function S(){return r.$applyNodeReplacement(new p)}function x(O){return O instanceof p}return Us.$createHorizontalRuleNode=S,Us.$isHorizontalRuleNode=x,Us.HorizontalRuleNode=p,Us.INSERT_HORIZONTAL_RULE_COMMAND=d,Us}const QC=process.env.NODE_ENV==="development"?JC():XC();var eE=QC;function tE(t,e){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:t,theme:e??VC,nodes:[Jh.HeadingNode,GC.HashtagNode,rl,ls.ListNode,ls.ListItemNode,Jh.QuoteNode,zu.CodeNode,zu.CodeHighlightNode,xu.TableNode,xu.TableCellNode,xu.TableRowNode,Zh.AutoLinkNode,Zh.LinkNode,eE.HorizontalRuleNode]}}const Ou={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function nE({serializedAST:t,nodeClassNames:e}){return at.jsx(AN.LexicalComposer,{initialConfig:tE(t,e),children:at.jsx("div",{className:`${Ou["editor-inner"]} ${Ou["no-border"]}`,children:at.jsxs("div",{className:Ou["editor-inner"],children:[at.jsx(ZN.RichTextPlugin,{contentEditable:at.jsx(eC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:oC,placeholder:at.jsx("div",{})}),at.jsx(OC,{}),at.jsx(dC.ListPlugin,{}),at.jsx(_C.LinkPlugin,{}),at.jsx(xC.TablePlugin,{}),at.jsx(bC,{}),at.jsx(WC,{maxDepth:7})]})})})}function gc(t,e,n,r){const c=t.length;let d=0,g;if(e<0?e=-e>c?0:c+e:e=e>c?c:e,n=n>0?n:0,r.length<1e4)g=Array.from(r),g.unshift(e,n),[].splice.apply(t,g);else for(n&&[].splice.apply(t,[e,n]);d<r.length;)g=r.slice(d,d+1e4),g.unshift(e,0),[].splice.apply(t,g),d+=1e4,e+=1e4}function js(t,e){return t.length>0?(gc(t,t.length,0,e),t):e}const og={}.hasOwnProperty;function $p(t){const e={};let n=-1;for(;++n<t.length;)rE(e,t[n]);return e}function rE(t,e){let n;for(n in e){const c=(og.call(t,n)?t[n]:void 0)||(t[n]={}),d=e[n];let g;for(g in d){og.call(c,g)||(c[g]=[]);const p=d[g];iE(c[g],Array.isArray(p)?p:p?[p]:[])}}}function iE(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);gc(t,0,0,r)}const eo={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var sg=Object.prototype.hasOwnProperty;function lg(t,e,n){for(n of t.keys())if(ql(n,e))return n}function ql(t,e){var n,r,c;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&ql(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(c=r,c&&typeof c=="object"&&(c=lg(e,c),!c)||!e.has(c))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(c=r[0],c&&typeof c=="object"&&(c=lg(e,c),!c)||!ql(r[1],e.get(c)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(sg.call(t,n)&&++r&&!sg.call(e,n)||!(n in e)||!ql(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}let Uu,Fp,Bp,Hp,Wp=!0;typeof process<"u"&&({FORCE_COLOR:Uu,NODE_DISABLE_COLORS:Fp,NO_COLOR:Bp,TERM:Hp}=process.env||{},Wp=process.stdout&&process.stdout.isTTY);const zt={enabled:!Fp&&Bp==null&&Hp!=="dumb"&&(Uu!=null&&Uu!=="0"||Wp),reset:un(0,0),bold:un(1,22),dim:un(2,22),italic:un(3,23),underline:un(4,24),inverse:un(7,27),hidden:un(8,28),strikethrough:un(9,29),black:un(30,39),red:un(31,39),green:un(32,39),yellow:un(33,39),blue:un(34,39),magenta:un(35,39),cyan:un(36,39),white:un(37,39),gray:un(90,39),grey:un(90,39),bgBlack:un(40,49),bgRed:un(41,49),bgGreen:un(42,49),bgYellow:un(43,49),bgBlue:un(44,49),bgMagenta:un(45,49),bgCyan:un(46,49),bgWhite:un(47,49)};function ag(t,e){let n=0,r,c="",d="";for(;n<t.length;n++)r=t[n],c+=r.open,d+=r.close,~e.indexOf(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return c+e+d}function oE(t,e){let n={has:t,keys:e};return n.reset=zt.reset.bind(n),n.bold=zt.bold.bind(n),n.dim=zt.dim.bind(n),n.italic=zt.italic.bind(n),n.underline=zt.underline.bind(n),n.inverse=zt.inverse.bind(n),n.hidden=zt.hidden.bind(n),n.strikethrough=zt.strikethrough.bind(n),n.black=zt.black.bind(n),n.red=zt.red.bind(n),n.green=zt.green.bind(n),n.yellow=zt.yellow.bind(n),n.blue=zt.blue.bind(n),n.magenta=zt.magenta.bind(n),n.cyan=zt.cyan.bind(n),n.white=zt.white.bind(n),n.gray=zt.gray.bind(n),n.grey=zt.grey.bind(n),n.bgBlack=zt.bgBlack.bind(n),n.bgRed=zt.bgRed.bind(n),n.bgGreen=zt.bgGreen.bind(n),n.bgYellow=zt.bgYellow.bind(n),n.bgBlue=zt.bgBlue.bind(n),n.bgMagenta=zt.bgMagenta.bind(n),n.bgCyan=zt.bgCyan.bind(n),n.bgWhite=zt.bgWhite.bind(n),n}function un(t,e){let n={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(n)),r===void 0?this:zt.enabled?ag(this.keys,r+""):r+""):r===void 0?oE([t],[n]):zt.enabled?ag([n],r+""):r+""}}function Ro(){}Ro.prototype={diff:function(e,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 p(B){return d?(setTimeout(function(){d(void 0,B)},0),!0):B}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var C=n.length,S=e.length,x=1,O=C+S;c.maxEditLength&&(O=Math.min(O,c.maxEditLength));var R=(r=c.timeout)!==null&&r!==void 0?r:1/0,b=Date.now()+R,T=[{oldPos:-1,lastComponent:void 0}],w=this.extractCommon(T[0],n,e,0);if(T[0].oldPos+1>=S&&w+1>=C)return p([{value:this.join(n),count:n.length}]);var P=-1/0,H=1/0;function $(){for(var B=Math.max(P,-x);B<=Math.min(H,x);B+=2){var K=void 0,X=T[B-1],ee=T[B+1];X&&(T[B-1]=void 0);var le=!1;if(ee){var V=ee.oldPos-B;le=ee&&0<=V&&V<C}var U=X&&X.oldPos+1<S;if(!le&&!U){T[B]=void 0;continue}if(!U||le&&X.oldPos+1<ee.oldPos?K=g.addToPath(ee,!0,void 0,0):K=g.addToPath(X,void 0,!0,1),w=g.extractCommon(K,n,e,B),K.oldPos+1>=S&&w+1>=C)return p(sE(g,K.lastComponent,n,e,g.useLongestToken));T[B]=K,K.oldPos+1>=S&&(H=Math.min(H,B-1)),w+1>=C&&(P=Math.max(P,B+1))}x++}if(d)(function B(){setTimeout(function(){if(x>O||Date.now()>b)return d();$()||B()},0)})();else for(;x<=O&&Date.now()<=b;){var W=$();if(W)return W}},addToPath:function(e,n,r,c){var d=e.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:e.oldPos+c,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:e.oldPos+c,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(e,n,r,c){for(var d=n.length,g=r.length,p=e.oldPos,C=p-c,S=0;C+1<d&&p+1<g&&this.equals(n[C+1],r[p+1]);)C++,p++,S++;return S&&(e.lastComponent={count:S,previousComponent:e.lastComponent}),e.oldPos=p,C},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function sE(t,e,n,r,c){for(var d=[],g;e;)d.push(e),g=e.previousComponent,delete e.previousComponent,e=g;d.reverse();for(var p=0,C=d.length,S=0,x=0;p<C;p++){var O=d[p];if(O.removed){if(O.value=t.join(r.slice(x,x+O.count)),x+=O.count,p&&d[p-1].added){var b=d[p-1];d[p-1]=d[p],d[p]=b}}else{if(!O.added&&c){var R=n.slice(S,S+O.count);R=R.map(function(w,P){var H=r[x+P];return H.length>w.length?H:w}),O.value=t.join(R)}else O.value=t.join(n.slice(S,S+O.count));S+=O.count,O.added||(x+=O.count)}}var T=d[C-1];return C>1&&typeof T.value=="string"&&(T.added||T.removed)&&t.equals("",T.value)&&(d[C-2].value+=T.value,d.pop()),d}var cg=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ug=/\S/,Kp=new Ro;Kp.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!ug.test(t)&&!ug.test(e)};Kp.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&cg.test(e[n])&&cg.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var zp=new Ro;zp.tokenize=function(t){this.options.stripTrailingCr&&(t=t.replace(/\r\n/g,`
96
- `));var e=[],n=t.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?e[e.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),e.push(c))}return e};var lE=new Ro;lE.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var aE=new Ro;aE.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};function nc(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nc=function(e){return typeof e}:nc=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nc(t)}var cE=Object.prototype.toString,Jl=new Ro;Jl.useLongestToken=!0;Jl.tokenize=zp.tokenize;Jl.castInput=function(t){var e=this.options,n=e.undefinedReplacement,r=e.stringifyReplacer,c=r===void 0?function(d,g){return typeof g>"u"?n:g}:r;return typeof t=="string"?t:JSON.stringify(Gu(t,null,null,c),c," ")};Jl.equals=function(t,e){return Ro.prototype.equals.call(Jl,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function Gu(t,e,n,r,c){e=e||[],n=n||[],r&&(t=r(c,t));var d;for(d=0;d<e.length;d+=1)if(e[d]===t)return n[d];var g;if(cE.call(t)==="[object Array]"){for(e.push(t),g=new Array(t.length),n.push(g),d=0;d<t.length;d+=1)g[d]=Gu(t[d],e,n,r,c);return e.pop(),n.pop(),g}if(t&&t.toJSON&&(t=t.toJSON()),nc(t)==="object"&&t!==null){e.push(t),g={},n.push(g);var p=[],C;for(C in t)t.hasOwnProperty(C)&&p.push(C);for(p.sort(),d=0;d<p.length;d+=1)C=p[d],g[C]=Gu(t[C],e,n,r,C);e.pop(),n.pop()}else g=t;return g}var Yu=new Ro;Yu.tokenize=function(t){return t.slice()};Yu.join=Yu.removeEmpty=function(t){return t};zt.red,zt.grey,zt.green;zt.dim().italic;zt.dim("→");zt.dim("·");zt.dim("↵");function oc(t){t=t.replace(/\r?\n/g,`
97
- `);let e=t.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,c=(e||[]).length;for(;n<c;n++)r=Math.min(r,e[n].length);return c&&r?t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):t}class uE extends Error{constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}}function Zr(t,e,n,r,c,d,g){if(t)return;let p=g||d;if(g instanceof Error)throw g;let C=c;throw new uE({actual:e,expects:n,operator:r,message:p,details:C,generated:!g})}function pc(t,e){Zr(!!t,!1,!0,"ok",!1,"Expected value to be truthy",e)}function to(t,e){Zr(!t,!0,!1,"not",!1,"Expected value to be falsey",e)}to.ok=to;to.equal=function(t,e,n){Zr(!ql(t,e),t,e,"not.equal",!1,"Expected values not to be deeply equal",n)};to.type=function(t,e,n){let r=typeof t;Zr(r!==e,r,e,"not.type",!1,`Expected "${r}" not to be "${e}"`,n)};to.instance=function(t,e,n){let r="`"+(e.name||e.constructor.name)+"`";Zr(!(t instanceof e),t,e,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};to.snapshot=function(t,e,n){t=oc(t),e=oc(e),Zr(t!==e,t,e,"not.snapshot",!1,"Expected value not to match snapshot",n)};to.fixture=function(t,e,n){t=oc(t),e=oc(e),Zr(t!==e,t,e,"not.fixture",!1,"Expected value not to match fixture",n)};to.match=function(t,e,n){typeof e=="string"?Zr(!t.includes(e),t,e,"not.match",!1,`Expected value not to include "${e}" substring`,n):Zr(!e.test(t),t,e,"not.match",!1,`Expected value not to match \`${String(e)}\` pattern`,n)};to.throws=function(t,e,n){!n&&typeof e=="string"&&(n=e,e=null);try{t()}catch(r){typeof e=="function"?Zr(!e(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):e instanceof RegExp?Zr(!e.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(e)}\` pattern`,n):e||Zr(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const dE=/[!-\/:-@\[-`\{-~\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]/,fE=bo(/[A-Za-z]/),ju=bo(/[\dA-Za-z]/),hE=bo(/[#-'*+\--9=?A-Z^-~]/);function gE(t){return t!==null&&(t<32||t===127)}const pE=bo(/\d/),mE=bo(/[\dA-Fa-f]/),_E=bo(/[!-/:-@[-`{-~]/);function yE(t){return t!==null&&t<-2}function Up(t){return t!==null&&(t<0||t===32)}function NE(t){return t===-2||t===-1||t===32}const CE=bo(dE),EE=bo(/\s/);function bo(t){return e;function e(n){return n!==null&&t.test(String.fromCharCode(n))}}function Xl(t){if(t===null||Up(t)||EE(t))return 1;if(CE(t))return 2}const sc={attentionSideBefore:1,attentionSideAfter:2,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupWhitespace:1,characterGroupPunctuation:2,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeContent:"content",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlRaw:1,htmlComment:2,htmlInstruction:3,htmlDeclaration:4,htmlCdata:5,htmlBasic:6,htmlComplete:7,htmlRawSizeMax:8,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};function TE(t,e){const n=this.previous,r=Xl(n);return c;function c(g){return pc(g===eo.tilde,"expected `~`"),t.enter("tildeSequenceTemporary"),d(g)}function d(g){if(g===eo.tilde)return t.consume(g),d;const p=t.exit("tildeSequenceTemporary"),C=Xl(g);return p._open=!C||C===sc.characterGroupPunctuation&&!!r,p._close=!r||r===sc.characterGroupPunctuation&&!!C,e(g)}}function Gp(t,e,n){const r=[];let c=-1;for(;++c<t.length;){const d=t[c].resolveAll;d&&!r.includes(d)&&(e=d(e,n),r.push(d))}return e}const xE={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};function _d(t,e){return!!(t[0]==="enter"&&t[1].type===`${e}SequenceTemporary`&&t[1]._close)}function yd(t,e){return!!(t[0]==="exit"&&t[1].type===`${e}SequenceTemporary`&&t[1]._open)}function Nd(t,e,n,r,c,d){const[g,p,C,S]=SE(t[e],t[n],c,d);t[e][1].end=Object.assign({},g.start),t[n][1].start=Object.assign({},p.end);let x=[];t[e][1].end.offset-t[e][1].start.offset&&(x=js(x,[["enter",t[e][1],r],["exit",t[e][1],r]])),x=js(x,[["enter",S,r],["enter",g,r],["exit",g,r],["enter",C,r]]),x=js(x,Gp(r.parser.constructs.insideSpan.null,t.slice(e+1,n),r)),x=js(x,[["exit",C,r],["enter",p,r],["exit",p,r],["exit",S,r]]);let O=0;return t[n][1].end.offset-t[n][1].start.offset&&(O=2,x=js(x,[["enter",t[n][1],r],["exit",t[n][1],r]])),gc(t,e-1,n-e+3,x),e+x.length-O-2}function SE(t,e,n,r){const c=Object.assign({},t[1].end),d=Object.assign({},e[1].start);dg(c,-r),dg(d,r);const g={type:`${n}Sequence`,start:c,end:Object.assign({},t[1].end)},p={type:`${n}Sequence`,start:Object.assign({},e[1].start),end:d},C={type:`${n}Text`,start:Object.assign({},t[1].end),end:Object.assign({},e[1].start)},S={type:`${n}`,start:Object.assign({},g.start),end:Object.assign({},p.end)};return[g,p,C,S]}function dg(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}function Cd(t,e){t.forEach(n=>{n[1].type===`${e}SequenceTemporary`&&(n[1].type=xE.data)})}function vE(t,e){let n=-1;for(;++n<t.length;)if(_d(t[n],"tilde")){let r=n;for(;r--;)if(yd(t[r],"tilde")){const c=wE(t[r],t[n]);n=Nd(t,r,n,e,c===1?"subscript":"strikethrough",c);break}}return Cd(t,"tilde"),t}function wE(t,e){const n=t[1].end.offset-t[1].start.offset,r=e[1].end.offset-e[1].start.offset;return n<3||r<3?r<n?r:n:r%2===0?2:1}function OE(){const t={tokenize:TE,resolveAll:vE};return{text:{[eo.tilde]:t},insideSpan:{null:[t]}}}function DE(t,e){let n=-1;for(;++n<t.length;)if(_d(t[n],"superscript")){let r=n;for(;r--;)if(yd(t[r],"superscript")){n=Nd(t,r,n,e,"superscript",1);break}}return Cd(t,"superscript"),t}function ME(t,e){return n;function n(c){return pc(c===eo.caret,"expected `^`"),t.enter("superscriptSequenceTemporary"),r(c)}function r(c){if(c===eo.caret)return t.consume(c),r;const d=t.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,e(c)}}function AE(){const t={tokenize:ME,resolveAll:DE};return{text:{[eo.caret]:t},insideSpan:{null:[t]}}}function RE(t,e,n){const r=this.previous,c=Xl(r);let d=0;return g;function g(C){return pc(C===eo.plusSign,"expected `+`"),t.enter("underlineSequenceTemporary"),p(C)}function p(C){if(C===eo.plusSign)return t.consume(C),d++,p;if(d<2)return n(C);const S=t.exit("underlineSequenceTemporary"),x=Xl(C);return S._open=!x||x===sc.characterGroupPunctuation&&!!c,S._close=!c||c===sc.characterGroupPunctuation&&!!x,e(C)}}function bE(t,e){let n=-1;for(;++n<t.length;)if(_d(t[n],"underline")&&t[n][1].end.offset-t[n][1].start.offset>1){let r=n;for(;r--;)if(yd(t[r],"underline")&&t[r][1].end.offset-t[r][1].start.offset>1){n=Nd(t,r,n,e,"underline",2);break}}return Cd(t,"underline"),t}function LE(){const t={tokenize:RE,resolveAll:bE};return{text:{[eo.plusSign]:t},insideSpan:{null:[t]}}}function kE(){return $p([LE(),AE(),OE()])}const IE={canContainEols:["strikethrough"],enter:{strikethrough:PE},exit:{strikethrough:$E}};function PE(t){this.enter({type:"strikethrough",children:[]},t)}function $E(t){this.exit(t)}const FE={canContainEols:["subscript"],enter:{subscript:BE},exit:{subscript:HE}};function BE(t){this.enter({type:"subscript",children:[]},t)}function HE(t){this.exit(t)}const WE={canContainEols:["superscript"],enter:{superscript:KE},exit:{superscript:zE}};function KE(t){this.enter({type:"superscript",children:[]},t)}function zE(t){this.exit(t)}const UE={canContainEols:["underline"],enter:{underline:GE},exit:{underline:YE}};function GE(t){this.enter({type:"underline",children:[]},t)}function YE(t){this.exit(t)}function jE(){return[UE,IE,FE,WE]}function VE(){const t=this.data();e("micromarkExtensions",kE()),e("fromMarkdownExtensions",jE());function e(n,r){const c=t[n];c?(pc(Array.isArray(c)),c.push(r)):t[n]=[r]}}function qE(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function ZE(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
92
+ `?y.push(n.$createLineBreakNode()):he===" "?y.push(n.$createTabNode()):0<he.length&&y.push(B(he,m))}}else({content:k}=A),typeof k=="string"?y.push(...pe([k],A.type)):Array.isArray(k)&&y.push(...pe(k,A.type));return y}function ue(k,m){if(k=n.$getNodeByKey(k),p(k)&&k.isAttached()){var y=n.$getSelection();if(n.$isRangeSelection(y)){y=y.anchor;var A=y.offset,Z=y.type==="element"&&n.$isLineBreakNode(k.getChildAtIndex(y.offset-1)),ae=0;if(!Z){let he=y.getNode();ae=A+he.getPreviousSiblings().reduce((se,Te)=>se+Te.getTextContentSize(),0)}m()&&(Z?y.getNode().select(A,A):k.getChildren().some(he=>{let se=n.$isTextNode(he);if(se||n.$isLineBreakNode(he)){let Te=he.getTextContentSize();if(se&&Te>=ae)return he.select(ae,ae),!0;ae-=Te}return!1}))}else m()}}function K(k,m){return z(k)&&z(m)&&k.__text===m.__text&&k.__highlightType===m.__highlightType||n.$isTabNode(k)&&n.$isTabNode(m)||n.$isLineBreakNode(k)&&n.$isLineBreakNode(m)}function D(k){if(!n.$isRangeSelection(k))return!1;var m=k.anchor.getNode();return k=k.focus.getNode(),m.is(k)&&p(m)?!0:(m=m.getParent(),p(m)&&m.is(k.getParent()))}function V(k){k=k.getNodes();let m=[[]];if(k.length===1&&p(k[0]))return m;let y=m[0];for(let A=0;A<k.length;A++){let Z=k[A];if(!(z(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Z)?A!==0&&0<y.length&&(y=[],m.push(y)):y.push(Z)}return m}function ne(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return null;let y=k?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(k=k?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<V(m).length)return y;var A=m.getNodes()[0];if(!(p(A)||z(A)||n.$isTabNode(A)||n.$isLineBreakNode(A)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(p(A))return y;let Z=X(A);A=ee(A);var ae=m.anchor;let he=m.focus;return he.isBefore(ae)?m=he:(m=ae,ae=he),Z!==null&&A!==null&&m.key===Z.getKey()&&m.offset===0&&ae.key===A.getKey()&&ae.offset===A.getTextContentSize()?y:k}function Y(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return!1;var y=V(m);let A=y.length;if(1<y.length){for(m=0;m<A;m++){var Z=y[m];0<Z.length&&(Z=Z[0],m===0&&(Z=X(Z)),Z!==null&&(k===n.INDENT_CONTENT_COMMAND?Z.insertBefore(n.$createTabNode()):n.$isTabNode(Z)&&Z.remove()))}return!0}if(y=m.getNodes()[0],!(p(y)||z(y)||n.$isTabNode(y)||n.$isLineBreakNode(y)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(p(y))return k===n.INDENT_CONTENT_COMMAND&&m.insertNodes([n.$createTabNode()]),!0;if(y=X(y),y===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return k===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(y)?y.insertAfter(n.$createTabNode()):y.insertBefore(n.$createTabNode()):n.$isTabNode(y)&&y.remove(),!0}function G(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:A,focus:Z}=y,ae=A.offset,he=Z.offset,se=A.getNode(),Te=Z.getNode();var be=k===n.KEY_ARROW_UP_COMMAND;if(!D(y)||!z(se)&&!n.$isTabNode(se)||!z(Te)&&!n.$isTabNode(Te))return!1;if(!m.altKey){if(y.isCollapsed()){if(k=se.getParentOrThrow(),be&&ae===0&&se.getPreviousSibling()===null){if(k.getPreviousSibling()===null)return k.selectPrevious(),m.preventDefault(),!0}else if(!be&&ae===se.getTextContentSize()&&se.getNextSibling()===null&&k.getNextSibling()===null)return k.selectNext(),m.preventDefault(),!0}return!1}let Ue;if(se.isBefore(Te)){var re=X(se);Ue=ee(Te)}else re=X(Te),Ue=ee(se);if(re==null||Ue==null)return!1;let te=re.getNodesBetween(Ue);for(let we=0;we<te.length;we++){let Le=te[we];if(!z(Le)&&!n.$isTabNode(Le)&&!n.$isLineBreakNode(Le))return!1}if(m.preventDefault(),m.stopPropagation(),m=be?re.getPreviousSibling():Ue.getNextSibling(),!n.$isLineBreakNode(m)||(re=be?m.getPreviousSibling():m.getNextSibling(),re==null))return!0;be=z(re)||n.$isTabNode(re)||n.$isLineBreakNode(re)?be?X(re):ee(re):null;let ce=be??re;return m.remove(),te.forEach(we=>we.remove()),k===n.KEY_ARROW_UP_COMMAND?(te.forEach(we=>ce.insertBefore(we)),ce.insertBefore(m)):(ce.insertAfter(m),ce=m,te.forEach(we=>{ce.insertAfter(we),ce=we})),y.setTextNodeRange(se,ae,Te,he),!0}function Q(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:A,focus:Z}=y;var ae=A.getNode();let he=Z.getNode();if(k=k===n.MOVE_TO_START,!z(ae)&&!n.$isTabNode(ae)||!z(he)&&!n.$isTabNode(he))return!1;if(k)if(ae=j(he,Z.offset),ae!==null){let{node:se,offset:Te}=ae;n.$isLineBreakNode(se)?se.selectNext(0,0):y.setTextNodeRange(se,Te,se,Te)}else he.getParentOrThrow().selectStart();else U(he).select();return m.preventDefault(),m.stopPropagation(),!0}return An.$createCodeHighlightNode=B,An.$createCodeNode=g,An.$isCodeHighlightNode=z,An.$isCodeNode=p,An.CODE_LANGUAGE_FRIENDLY_NAME_MAP=w,An.CODE_LANGUAGE_MAP=$,An.CodeHighlightNode=P,An.CodeNode=d,An.DEFAULT_CODE_LANGUAGE="javascript",An.PrismTokenizer=le,An.getCodeLanguages=()=>Object.keys(t.languages).filter(k=>typeof t.languages[k]!="function").sort(),An.getDefaultCodeLanguage=()=>"javascript",An.getEndOfCodeInLine=U,An.getFirstCodeNodeOfLine=X,An.getLanguageFriendlyName=function(k){return k=W(k),w[k]||k},An.getLastCodeNodeOfLine=ee,An.getStartOfCodeInLine=j,An.normalizeCodeLang=W,An.registerCodeHighlighting=function(k,m){if(!k.hasNodes([d,P]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return m==null&&(m=le),e.mergeRegister(k.registerMutationListener(d,y=>{k.update(()=>{for(let[ae,he]of y)if(he!=="destroyed"){var A=n.$getNodeByKey(ae);if(A!==null)e:{var Z=A;if(A=k.getElementByKey(Z.getKey()),A===null)break e;Z=Z.getChildren();let se=Z.length;if(se===A.__cachedChildrenLength)break e;A.__cachedChildrenLength=se;let Te="1",be=1;for(let Ue=0;Ue<se;Ue++)n.$isLineBreakNode(Z[Ue])&&(Te+=`
93
+ `+ ++be);A.setAttribute("data-gutter",Te)}}})}),k.registerNodeTransform(d,y=>_e(y,k,m)),k.registerNodeTransform(n.TextNode,y=>q(y,k,m)),k.registerNodeTransform(P,y=>q(y,k,m)),k.registerCommand(n.KEY_TAB_COMMAND,y=>{let A=ne(y.shiftKey);return A===null?!1:(y.preventDefault(),k.dispatchCommand(A,void 0),!0)},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INSERT_TAB_COMMAND,()=>{let y=n.$getSelection();return D(y)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_UP_COMMAND,y=>G(n.KEY_ARROW_UP_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_DOWN_COMMAND,y=>G(n.KEY_ARROW_DOWN_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_END,y=>Q(n.MOVE_TO_END,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_START,y=>Q(n.MOVE_TO_START,y),n.COMMAND_PRIORITY_LOW))},An}const wC=process.env.NODE_ENV==="development"?SC():vC();var Uu=wC,md=Un();function OC(){const[t]=md.useLexicalComposerContext();return et.useEffect(()=>Uu.registerCodeHighlighting(t),[t]),null}var Xh=on(),Rn=Bt();function DC({src:t,altText:e,width:n,height:r,maxWidth:c}){const d=et.useMemo(()=>({height:r,width:n,maxWidth:c}),[r,n,c]);return at.jsx("img",{src:t,alt:e,style:d})}function Pp({altText:t,height:e,maxWidth:n=500,src:r,width:c,key:d}){return Rn.$applyNodeReplacement(new rl(r,t,n,c,e,d))}function MC(t){return t instanceof rl}class rl extends Rn.DecoratorNode{constructor(n,r,c,d,g,p){super(p);Vn(this,"__src");Vn(this,"__altText");Vn(this,"__width");Vn(this,"__height");Vn(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 rl(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 Pp(n)}createDOM(n){const r=document.createElement("span"),c=n.theme.image;return c&&(r.className=c),r}updateDOM(){return!1}decorate(){return at.jsx(DC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const AC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RC=t=>AC?(t||window).getSelection():null,$p=Rn.createCommand("INSERT_IMAGE_COMMAND");function bC(){const[t]=md.useLexicalComposerContext();return et.useEffect(()=>{if(!t.hasNodes([rl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return Xh.mergeRegister(t.registerCommand($p,e=>{const n=Pp(e);return Rn.$insertNodes([n]),Rn.$isRootOrShadowRoot(n.getParentOrThrow())&&Xh.$wrapNodeInElement(n,Rn.$createParagraphNode).selectEnd(),!0},Rn.COMMAND_PRIORITY_EDITOR),t.registerCommand(Rn.DRAGSTART_COMMAND,e=>LC(e),Rn.COMMAND_PRIORITY_HIGH),t.registerCommand(Rn.DRAGOVER_COMMAND,e=>kC(e),Rn.COMMAND_PRIORITY_LOW),t.registerCommand(Rn.DROP_COMMAND,e=>IC(e,t),Rn.COMMAND_PRIORITY_HIGH))},[t]),null}function LC(t){const e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=e;const r=_d();if(!r)return!1;const c=t.dataTransfer;return c?(c.setData("text/plain","_"),c.setDragImage(n,0,0),c.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function kC(t){return _d()?(Fp(t)||t.preventDefault(),!0):!1}function IC(t,e){const n=_d();if(!n)return!1;const r=PC(t);if(!r)return!1;if(t.preventDefault(),Fp(t)){const c=$C(t);n.remove();const d=Rn.$createRangeSelection();c!=null&&d.applyDOMRange(c),Rn.$setSelection(d),e.dispatchCommand($p,r)}return!0}function _d(){const t=Rn.$getSelection();if(!Rn.$isNodeSelection(t))return null;const n=t.getNodes()[0];return MC(n)?n:null}function PC(t){var c;const e=(c=t.dataTransfer)==null?void 0:c.getData("application/x-lexical-drag");if(!e)return null;const{type:n,data:r}=JSON.parse(e);return n!=="image"?null:r}function Fp(t){const e=t.target;return!!(e&&e instanceof HTMLElement&&!e.closest("code, span.yext-default-richtextv2-theme__image")&&e.parentElement)}function $C(t){let e;const n=t.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,c=RC(r);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&c!==null)c.collapse(t.rangeParent,t.rangeOffset||0),e=c.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var ls=hd();function FC(t){const e=t.getNodes();return e.length===0?new Set([t.anchor.getNode().getParentOrThrow(),t.focus.getNode().getParentOrThrow()]):new Set(e.map(n=>Rn.$isElementNode(n)?n:n.getParentOrThrow()))}const BC=3;function HC(t){const e=Rn.$getSelection();if(!Rn.$isRangeSelection(e))return!1;const n=FC(e);let r=0;for(const c of n)if(ls.$isListNode(c))r=Math.max(ls.$getListDepth(c)+1,r);else if(ls.$isListItemNode(c)){const d=c.getParent();if(!ls.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(ls.$getListDepth(d)+1,r)}return r<=t}function WC({maxDepth:t}){const[e]=md.useLexicalComposerContext();return et.useEffect(()=>e.registerCommand(Rn.INDENT_CONTENT_COMMAND,()=>!HC(t||7),BC),[e,t]),null}var Su=pd(),Qh=gd(),eg=fd(),Wl={},tg;function KC(){if(tg)return Wl;tg=1;var t=on(),e=Bt();class n extends e.TextNode{static getType(){return"hashtag"}static clone(g){return new n(g.__text,g.__key)}constructor(g,p){super(g,p)}createDOM(g){const p=super.createDOM(g);return t.addClassNamesToElement(p,g.theme.hashtag),p}static importJSON(g){const p=r(g.text);return p.setFormat(g.format),p.setDetail(g.detail),p.setMode(g.mode),p.setStyle(g.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return e.$applyNodeReplacement(new n(d))}function c(d){return d instanceof n}return Wl.$createHashtagNode=r,Wl.$isHashtagNode=c,Wl.HashtagNode=n,Wl}var Kl={},ng;function zC(){if(ng)return Kl;ng=1;var t=on(),e=Bt();class n extends e.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 t.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 e.$applyNodeReplacement(new n(c))}return Kl.$createHashtagNode=r,Kl.$isHashtagNode=function(c){return c instanceof n},Kl.HashtagNode=n,Kl}const UC=process.env.NODE_ENV==="development"?KC():zC();var GC=UC;const YC="_rtl_13v3w_295",jC="_selected_13v3w_370",lt={"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__ul":"_yext-default-richtextv2-theme__ul_13v3w_17","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",rtl:YC,"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",selected:jC,"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"},VC={characterLimit:lt["yext-default-richtextv2-theme__characterLimit"],code:lt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:lt["yext-default-richtextv2-theme__tokenAttr"],attr:lt["yext-default-richtextv2-theme__tokenAttr"],boolean:lt["yext-default-richtextv2-theme__tokenProperty"],builtin:lt["yext-default-richtextv2-theme__tokenSelector"],cdata:lt["yext-default-richtextv2-theme__tokenComment"],char:lt["yext-default-richtextv2-theme__tokenSelector"],class:lt["yext-default-richtextv2-theme__tokenFunction"],"class-name":lt["yext-default-richtextv2-theme__tokenFunction"],comment:lt["yext-default-richtextv2-theme__tokenComment"],constant:lt["yext-default-richtextv2-theme__tokenProperty"],deleted:lt["yext-default-richtextv2-theme__tokenProperty"],doctype:lt["yext-default-richtextv2-theme__tokenComment"],entity:lt["yext-default-richtextv2-theme__tokenOperator"],function:lt["yext-default-richtextv2-theme__tokenFunction"],important:lt["yext-default-richtextv2-theme__tokenVariable"],inserted:lt["yext-default-richtextv2-theme__tokenSelector"],keyword:lt["yext-default-richtextv2-theme__tokenAttr"],namespace:lt["yext-default-richtextv2-theme__tokenVariable"],number:lt["yext-default-richtextv2-theme__tokenProperty"],operator:lt["yext-default-richtextv2-theme__tokenOperator"],prolog:lt["yext-default-richtextv2-theme__tokenComment"],property:lt["yext-default-richtextv2-theme__tokenProperty"],punctuation:lt["yext-default-richtextv2-theme__tokenPunctuation"],regex:lt["yext-default-richtextv2-theme__tokenVariable"],selector:lt["yext-default-richtextv2-theme__tokenSelector"],string:lt["yext-default-richtextv2-theme__tokenSelector"],symbol:lt["yext-default-richtextv2-theme__tokenProperty"],tag:lt["yext-default-richtextv2-theme__tokenProperty"],url:lt["yext-default-richtextv2-theme__tokenOperator"],variable:lt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:lt["yext-default-richtextv2-theme__embedBlock"],focus:lt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:lt["yext-default-richtextv2-theme__hashtag"],heading:{h1:lt["yext-default-richtextv2-theme__h1"],h2:lt["yext-default-richtextv2-theme__h2"],h3:lt["yext-default-richtextv2-theme__h3"],h4:lt["yext-default-richtextv2-theme__h4"],h5:lt["yext-default-richtextv2-theme__h5"],h6:lt["yext-default-richtextv2-theme__h6"]},image:lt["yext-default-richtextv2-theme__image"],link:lt["yext-default-richtextv2-theme__link"],list:{listitem:lt["yext-default-richtextv2-theme__listItem"],listitemChecked:lt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:lt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:lt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[lt["yext-default-richtextv2-theme__ol1"],lt["yext-default-richtextv2-theme__ol2"],lt["yext-default-richtextv2-theme__ol3"],lt["yext-default-richtextv2-theme__ol4"],lt["yext-default-richtextv2-theme__ol5"]],ulDepth:[lt["yext-default-richtextv2-theme__ul1"],lt["yext-default-richtextv2-theme__ul2"],lt["yext-default-richtextv2-theme__ul3"]]},ltr:lt["yext-default-richtextv2-theme__ltr"],mark:lt["yext-default-richtextv2-theme__mark"],markOverlap:lt["yext-default-richtextv2-theme__markOverlap"],paragraph:lt["yext-default-richtextv2-theme__paragraph"],quote:lt["yext-default-richtextv2-theme__quote"],rtl:lt["yext-default-richtextv2-theme__rtl"],table:lt["yext-default-richtextv2-theme__table"],tableCell:lt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:lt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:lt["yext-default-richtextv2-theme__textBold"],code:lt["yext-default-richtextv2-theme__textCode"],italic:lt["yext-default-richtextv2-theme__textItalic"],strikethrough:lt["yext-default-richtextv2-theme__textStrikethrough"],subscript:lt["yext-default-richtextv2-theme__textSubscript"],superscript:lt["yext-default-richtextv2-theme__textSuperscript"],underline:lt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:lt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var zs={},vu={},rg;function qC(){if(rg)return vu;rg=1;var t=Un(),e=Bt(),n=et;function r(d,g){return d.getEditorState().read(()=>{const p=e.$getNodeByKey(g);return p===null?!1:p.isSelected()})}function c(d){const[g]=t.useLexicalComposerContext(),[p,C]=n.useState(()=>r(g,d));n.useEffect(()=>{let O=!0;const R=g.registerUpdateListener(()=>{O&&C(r(g,d))});return()=>{O=!1,R()}},[g,d]);const S=n.useCallback(O=>{g.update(()=>{let R=e.$getSelection();e.$isNodeSelection(R)||(R=e.$createNodeSelection(),e.$setSelection(R)),e.$isNodeSelection(R)&&(O?R.add(d):R.delete(d))})},[g,d]),T=n.useCallback(()=>{g.update(()=>{const O=e.$getSelection();e.$isNodeSelection(O)&&O.clear()})},[g]);return[p,S,T]}return vu.useLexicalNodeSelection=c,vu}var wu={},ig;function ZC(){if(ig)return wu;ig=1;var t=Un(),e=Bt(),n=et;function r(c,d){return c.getEditorState().read(()=>{let g=e.$getNodeByKey(d);return g===null?!1:g.isSelected()})}return wu.useLexicalNodeSelection=function(c){let[d]=t.useLexicalComposerContext(),[g,p]=n.useState(()=>r(d,c));n.useEffect(()=>{let T=!0,O=d.registerUpdateListener(()=>{T&&p(r(d,c))});return()=>{T=!1,O()}},[d,c]);let C=n.useCallback(T=>{d.update(()=>{let O=e.$getSelection();e.$isNodeSelection(O)||(O=e.$createNodeSelection(),e.$setSelection(O)),e.$isNodeSelection(O)&&(T?O.add(c):O.delete(c))})},[d,c]),S=n.useCallback(()=>{d.update(()=>{const T=e.$getSelection();e.$isNodeSelection(T)&&T.clear()})},[d]);return[g,C,S]},wu}var Ou,og;function Bp(){return og||(og=1,Ou=process.env.NODE_ENV==="development"?qC():ZC()),Ou}var sg;function JC(){if(sg)return zs;sg=1;var t=Un(),e=Bp(),n=on(),r=Bt(),c=et;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){const[R]=t.useLexicalComposerContext(),[b,x,w]=e.useLexicalNodeSelection(O),$=c.useCallback(W=>{if(b&&r.$isNodeSelection(r.$getSelection())){W.preventDefault();const P=r.$getNodeByKey(O);T(P)&&P.remove()}return!1},[b,O]);return c.useEffect(()=>n.mergeRegister(R.registerCommand(r.CLICK_COMMAND,W=>{const P=R.getElementByKey(O);return W.target===P?(W.shiftKey||w(),x(!b),!0):!1},r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_DELETE_COMMAND,$,r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_BACKSPACE_COMMAND,$,r.COMMAND_PRIORITY_LOW)),[w,R,b,O,$,x]),c.useEffect(()=>{const W=R.getElementByKey(O);W!==null&&(W.className=b?"selected":"")},[R,b,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(R){return new p(R.__key)}static importJSON(R){return S()}static importDOM(){return{hr:()=>({conversion:C,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
94
+ `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function C(){return{node:S()}}function S(){return r.$applyNodeReplacement(new p)}function T(O){return O instanceof p}return zs.$createHorizontalRuleNode=S,zs.$isHorizontalRuleNode=T,zs.HorizontalRuleNode=p,zs.INSERT_HORIZONTAL_RULE_COMMAND=d,zs}var Us={},lg;function XC(){if(lg)return Us;lg=1;var t=Un(),e=Bp(),n=on(),r=Bt(),c=et;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){let[R]=t.useLexicalComposerContext(),[b,x,w]=e.useLexicalNodeSelection(O),$=c.useCallback(W=>(b&&r.$isNodeSelection(r.$getSelection())&&(W.preventDefault(),W=r.$getNodeByKey(O),T(W)&&W.remove()),!1),[b,O]);return c.useEffect(()=>n.mergeRegister(R.registerCommand(r.CLICK_COMMAND,W=>{let P=R.getElementByKey(O);return W.target===P?(W.shiftKey||w(),x(!b),!0):!1},r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_DELETE_COMMAND,$,r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_BACKSPACE_COMMAND,$,r.COMMAND_PRIORITY_LOW)),[w,R,b,O,$,x]),c.useEffect(()=>{let W=R.getElementByKey(O);W!==null&&(W.className=b?"selected":"")},[R,b,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(R){return new p(R.__key)}static importJSON(){return S()}static importDOM(){return{hr:()=>({conversion:C,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
95
+ `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function C(){return{node:S()}}function S(){return r.$applyNodeReplacement(new p)}function T(O){return O instanceof p}return Us.$createHorizontalRuleNode=S,Us.$isHorizontalRuleNode=T,Us.HorizontalRuleNode=p,Us.INSERT_HORIZONTAL_RULE_COMMAND=d,Us}const QC=process.env.NODE_ENV==="development"?JC():XC();var eE=QC;function tE(t,e){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:t,theme:e??VC,nodes:[eg.HeadingNode,GC.HashtagNode,rl,ls.ListNode,ls.ListItemNode,eg.QuoteNode,Uu.CodeNode,Uu.CodeHighlightNode,Su.TableNode,Su.TableCellNode,Su.TableRowNode,Qh.AutoLinkNode,Qh.LinkNode,eE.HorizontalRuleNode]}}const Du={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function nE({serializedAST:t,nodeClassNames:e}){return at.jsx(AN.LexicalComposer,{initialConfig:tE(t,e),children:at.jsx("div",{className:`${Du["editor-inner"]} ${Du["no-border"]}`,children:at.jsxs("div",{className:Du["editor-inner"],children:[at.jsx(ZN.RichTextPlugin,{contentEditable:at.jsx(eC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:oC,placeholder:at.jsx("div",{})}),at.jsx(OC,{}),at.jsx(dC.ListPlugin,{}),at.jsx(_C.LinkPlugin,{}),at.jsx(xC.TablePlugin,{}),at.jsx(bC,{}),at.jsx(WC,{maxDepth:7})]})})})}function pc(t,e,n,r){const c=t.length;let d=0,g;if(e<0?e=-e>c?0:c+e:e=e>c?c:e,n=n>0?n:0,r.length<1e4)g=Array.from(r),g.unshift(e,n),[].splice.apply(t,g);else for(n&&[].splice.apply(t,[e,n]);d<r.length;)g=r.slice(d,d+1e4),g.unshift(e,0),[].splice.apply(t,g),d+=1e4,e+=1e4}function js(t,e){return t.length>0?(pc(t,t.length,0,e),t):e}const ag={}.hasOwnProperty;function Hp(t){const e={};let n=-1;for(;++n<t.length;)rE(e,t[n]);return e}function rE(t,e){let n;for(n in e){const c=(ag.call(t,n)?t[n]:void 0)||(t[n]={}),d=e[n];let g;for(g in d){ag.call(c,g)||(c[g]=[]);const p=d[g];iE(c[g],Array.isArray(p)?p:p?[p]:[])}}}function iE(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);pc(t,0,0,r)}const eo={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var cg=Object.prototype.hasOwnProperty;function ug(t,e,n){for(n of t.keys())if(ql(n,e))return n}function ql(t,e){var n,r,c;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&ql(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(c=r,c&&typeof c=="object"&&(c=ug(e,c),!c)||!e.has(c))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(c=r[0],c&&typeof c=="object"&&(c=ug(e,c),!c)||!ql(r[1],e.get(c)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(cg.call(t,n)&&++r&&!cg.call(e,n)||!(n in e)||!ql(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}let Gu,Wp,Kp,zp,Up=!0;typeof process<"u"&&({FORCE_COLOR:Gu,NODE_DISABLE_COLORS:Wp,NO_COLOR:Kp,TERM:zp}=process.env||{},Up=process.stdout&&process.stdout.isTTY);const zt={enabled:!Wp&&Kp==null&&zp!=="dumb"&&(Gu!=null&&Gu!=="0"||Up),reset:un(0,0),bold:un(1,22),dim:un(2,22),italic:un(3,23),underline:un(4,24),inverse:un(7,27),hidden:un(8,28),strikethrough:un(9,29),black:un(30,39),red:un(31,39),green:un(32,39),yellow:un(33,39),blue:un(34,39),magenta:un(35,39),cyan:un(36,39),white:un(37,39),gray:un(90,39),grey:un(90,39),bgBlack:un(40,49),bgRed:un(41,49),bgGreen:un(42,49),bgYellow:un(43,49),bgBlue:un(44,49),bgMagenta:un(45,49),bgCyan:un(46,49),bgWhite:un(47,49)};function dg(t,e){let n=0,r,c="",d="";for(;n<t.length;n++)r=t[n],c+=r.open,d+=r.close,~e.indexOf(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return c+e+d}function oE(t,e){let n={has:t,keys:e};return n.reset=zt.reset.bind(n),n.bold=zt.bold.bind(n),n.dim=zt.dim.bind(n),n.italic=zt.italic.bind(n),n.underline=zt.underline.bind(n),n.inverse=zt.inverse.bind(n),n.hidden=zt.hidden.bind(n),n.strikethrough=zt.strikethrough.bind(n),n.black=zt.black.bind(n),n.red=zt.red.bind(n),n.green=zt.green.bind(n),n.yellow=zt.yellow.bind(n),n.blue=zt.blue.bind(n),n.magenta=zt.magenta.bind(n),n.cyan=zt.cyan.bind(n),n.white=zt.white.bind(n),n.gray=zt.gray.bind(n),n.grey=zt.grey.bind(n),n.bgBlack=zt.bgBlack.bind(n),n.bgRed=zt.bgRed.bind(n),n.bgGreen=zt.bgGreen.bind(n),n.bgYellow=zt.bgYellow.bind(n),n.bgBlue=zt.bgBlue.bind(n),n.bgMagenta=zt.bgMagenta.bind(n),n.bgCyan=zt.bgCyan.bind(n),n.bgWhite=zt.bgWhite.bind(n),n}function un(t,e){let n={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(n)),r===void 0?this:zt.enabled?dg(this.keys,r+""):r+""):r===void 0?oE([t],[n]):zt.enabled?dg([n],r+""):r+""}}function Ro(){}Ro.prototype={diff:function(e,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 p(B){return d?(setTimeout(function(){d(void 0,B)},0),!0):B}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var C=n.length,S=e.length,T=1,O=C+S;c.maxEditLength&&(O=Math.min(O,c.maxEditLength));var R=(r=c.timeout)!==null&&r!==void 0?r:1/0,b=Date.now()+R,x=[{oldPos:-1,lastComponent:void 0}],w=this.extractCommon(x[0],n,e,0);if(x[0].oldPos+1>=S&&w+1>=C)return p([{value:this.join(n),count:n.length}]);var $=-1/0,W=1/0;function P(){for(var B=Math.max($,-T);B<=Math.min(W,T);B+=2){var z=void 0,X=x[B-1],ee=x[B+1];X&&(x[B-1]=void 0);var le=!1;if(ee){var j=ee.oldPos-B;le=ee&&0<=j&&j<C}var U=X&&X.oldPos+1<S;if(!le&&!U){x[B]=void 0;continue}if(!U||le&&X.oldPos+1<ee.oldPos?z=g.addToPath(ee,!0,void 0,0):z=g.addToPath(X,void 0,!0,1),w=g.extractCommon(z,n,e,B),z.oldPos+1>=S&&w+1>=C)return p(sE(g,z.lastComponent,n,e,g.useLongestToken));x[B]=z,z.oldPos+1>=S&&(W=Math.min(W,B-1)),w+1>=C&&($=Math.max($,B+1))}T++}if(d)(function B(){setTimeout(function(){if(T>O||Date.now()>b)return d();P()||B()},0)})();else for(;T<=O&&Date.now()<=b;){var H=P();if(H)return H}},addToPath:function(e,n,r,c){var d=e.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:e.oldPos+c,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:e.oldPos+c,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(e,n,r,c){for(var d=n.length,g=r.length,p=e.oldPos,C=p-c,S=0;C+1<d&&p+1<g&&this.equals(n[C+1],r[p+1]);)C++,p++,S++;return S&&(e.lastComponent={count:S,previousComponent:e.lastComponent}),e.oldPos=p,C},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function sE(t,e,n,r,c){for(var d=[],g;e;)d.push(e),g=e.previousComponent,delete e.previousComponent,e=g;d.reverse();for(var p=0,C=d.length,S=0,T=0;p<C;p++){var O=d[p];if(O.removed){if(O.value=t.join(r.slice(T,T+O.count)),T+=O.count,p&&d[p-1].added){var b=d[p-1];d[p-1]=d[p],d[p]=b}}else{if(!O.added&&c){var R=n.slice(S,S+O.count);R=R.map(function(w,$){var W=r[T+$];return W.length>w.length?W:w}),O.value=t.join(R)}else O.value=t.join(n.slice(S,S+O.count));S+=O.count,O.added||(T+=O.count)}}var x=d[C-1];return C>1&&typeof x.value=="string"&&(x.added||x.removed)&&t.equals("",x.value)&&(d[C-2].value+=x.value,d.pop()),d}var fg=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,hg=/\S/,Gp=new Ro;Gp.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!hg.test(t)&&!hg.test(e)};Gp.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&fg.test(e[n])&&fg.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var Yp=new Ro;Yp.tokenize=function(t){this.options.stripTrailingCr&&(t=t.replace(/\r\n/g,`
96
+ `));var e=[],n=t.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?e[e.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),e.push(c))}return e};var lE=new Ro;lE.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var aE=new Ro;aE.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};function nc(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nc=function(e){return typeof e}:nc=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nc(t)}var cE=Object.prototype.toString,Jl=new Ro;Jl.useLongestToken=!0;Jl.tokenize=Yp.tokenize;Jl.castInput=function(t){var e=this.options,n=e.undefinedReplacement,r=e.stringifyReplacer,c=r===void 0?function(d,g){return typeof g>"u"?n:g}:r;return typeof t=="string"?t:JSON.stringify(Yu(t,null,null,c),c," ")};Jl.equals=function(t,e){return Ro.prototype.equals.call(Jl,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function Yu(t,e,n,r,c){e=e||[],n=n||[],r&&(t=r(c,t));var d;for(d=0;d<e.length;d+=1)if(e[d]===t)return n[d];var g;if(cE.call(t)==="[object Array]"){for(e.push(t),g=new Array(t.length),n.push(g),d=0;d<t.length;d+=1)g[d]=Yu(t[d],e,n,r,c);return e.pop(),n.pop(),g}if(t&&t.toJSON&&(t=t.toJSON()),nc(t)==="object"&&t!==null){e.push(t),g={},n.push(g);var p=[],C;for(C in t)t.hasOwnProperty(C)&&p.push(C);for(p.sort(),d=0;d<p.length;d+=1)C=p[d],g[C]=Yu(t[C],e,n,r,C);e.pop(),n.pop()}else g=t;return g}var ju=new Ro;ju.tokenize=function(t){return t.slice()};ju.join=ju.removeEmpty=function(t){return t};zt.red,zt.grey,zt.green;zt.dim().italic;zt.dim("→");zt.dim("·");zt.dim("↵");function sc(t){t=t.replace(/\r?\n/g,`
97
+ `);let e=t.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,c=(e||[]).length;for(;n<c;n++)r=Math.min(r,e[n].length);return c&&r?t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):t}class uE extends Error{constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}}function Zr(t,e,n,r,c,d,g){if(t)return;let p=g||d;if(g instanceof Error)throw g;let C=c;throw new uE({actual:e,expects:n,operator:r,message:p,details:C,generated:!g})}function mc(t,e){Zr(!!t,!1,!0,"ok",!1,"Expected value to be truthy",e)}function to(t,e){Zr(!t,!0,!1,"not",!1,"Expected value to be falsey",e)}to.ok=to;to.equal=function(t,e,n){Zr(!ql(t,e),t,e,"not.equal",!1,"Expected values not to be deeply equal",n)};to.type=function(t,e,n){let r=typeof t;Zr(r!==e,r,e,"not.type",!1,`Expected "${r}" not to be "${e}"`,n)};to.instance=function(t,e,n){let r="`"+(e.name||e.constructor.name)+"`";Zr(!(t instanceof e),t,e,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};to.snapshot=function(t,e,n){t=sc(t),e=sc(e),Zr(t!==e,t,e,"not.snapshot",!1,"Expected value not to match snapshot",n)};to.fixture=function(t,e,n){t=sc(t),e=sc(e),Zr(t!==e,t,e,"not.fixture",!1,"Expected value not to match fixture",n)};to.match=function(t,e,n){typeof e=="string"?Zr(!t.includes(e),t,e,"not.match",!1,`Expected value not to include "${e}" substring`,n):Zr(!e.test(t),t,e,"not.match",!1,`Expected value not to match \`${String(e)}\` pattern`,n)};to.throws=function(t,e,n){!n&&typeof e=="string"&&(n=e,e=null);try{t()}catch(r){typeof e=="function"?Zr(!e(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):e instanceof RegExp?Zr(!e.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(e)}\` pattern`,n):e||Zr(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const dE=/[!-\/:-@\[-`\{-~\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]/,fE=bo(/[A-Za-z]/),Vu=bo(/[\dA-Za-z]/),hE=bo(/[#-'*+\--9=?A-Z^-~]/);function gE(t){return t!==null&&(t<32||t===127)}const pE=bo(/\d/),mE=bo(/[\dA-Fa-f]/),_E=bo(/[!-/:-@[-`{-~]/);function yE(t){return t!==null&&t<-2}function jp(t){return t!==null&&(t<0||t===32)}function NE(t){return t===-2||t===-1||t===32}const CE=bo(dE),EE=bo(/\s/);function bo(t){return e;function e(n){return n!==null&&t.test(String.fromCharCode(n))}}function Xl(t){if(t===null||jp(t)||EE(t))return 1;if(CE(t))return 2}const lc={attentionSideBefore:1,attentionSideAfter:2,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupWhitespace:1,characterGroupPunctuation:2,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeContent:"content",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlRaw:1,htmlComment:2,htmlInstruction:3,htmlDeclaration:4,htmlCdata:5,htmlBasic:6,htmlComplete:7,htmlRawSizeMax:8,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};function TE(t,e){const n=this.previous,r=Xl(n);return c;function c(g){return mc(g===eo.tilde,"expected `~`"),t.enter("tildeSequenceTemporary"),d(g)}function d(g){if(g===eo.tilde)return t.consume(g),d;const p=t.exit("tildeSequenceTemporary"),C=Xl(g);return p._open=!C||C===lc.characterGroupPunctuation&&!!r,p._close=!r||r===lc.characterGroupPunctuation&&!!C,e(g)}}function Vp(t,e,n){const r=[];let c=-1;for(;++c<t.length;){const d=t[c].resolveAll;d&&!r.includes(d)&&(e=d(e,n),r.push(d))}return e}const xE={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};function yd(t,e){return!!(t[0]==="enter"&&t[1].type===`${e}SequenceTemporary`&&t[1]._close)}function Nd(t,e){return!!(t[0]==="exit"&&t[1].type===`${e}SequenceTemporary`&&t[1]._open)}function Cd(t,e,n,r,c,d){const[g,p,C,S]=SE(t[e],t[n],c,d);t[e][1].end=Object.assign({},g.start),t[n][1].start=Object.assign({},p.end);let T=[];t[e][1].end.offset-t[e][1].start.offset&&(T=js(T,[["enter",t[e][1],r],["exit",t[e][1],r]])),T=js(T,[["enter",S,r],["enter",g,r],["exit",g,r],["enter",C,r]]),T=js(T,Vp(r.parser.constructs.insideSpan.null,t.slice(e+1,n),r)),T=js(T,[["exit",C,r],["enter",p,r],["exit",p,r],["exit",S,r]]);let O=0;return t[n][1].end.offset-t[n][1].start.offset&&(O=2,T=js(T,[["enter",t[n][1],r],["exit",t[n][1],r]])),pc(t,e-1,n-e+3,T),e+T.length-O-2}function SE(t,e,n,r){const c=Object.assign({},t[1].end),d=Object.assign({},e[1].start);gg(c,-r),gg(d,r);const g={type:`${n}Sequence`,start:c,end:Object.assign({},t[1].end)},p={type:`${n}Sequence`,start:Object.assign({},e[1].start),end:d},C={type:`${n}Text`,start:Object.assign({},t[1].end),end:Object.assign({},e[1].start)},S={type:`${n}`,start:Object.assign({},g.start),end:Object.assign({},p.end)};return[g,p,C,S]}function gg(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}function Ed(t,e){t.forEach(n=>{n[1].type===`${e}SequenceTemporary`&&(n[1].type=xE.data)})}function vE(t,e){let n=-1;for(;++n<t.length;)if(yd(t[n],"tilde")){let r=n;for(;r--;)if(Nd(t[r],"tilde")){const c=wE(t[r],t[n]);n=Cd(t,r,n,e,c===1?"subscript":"strikethrough",c);break}}return Ed(t,"tilde"),t}function wE(t,e){const n=t[1].end.offset-t[1].start.offset,r=e[1].end.offset-e[1].start.offset;return n<3||r<3?r<n?r:n:r%2===0?2:1}function OE(){const t={tokenize:TE,resolveAll:vE};return{text:{[eo.tilde]:t},insideSpan:{null:[t]}}}function DE(t,e){let n=-1;for(;++n<t.length;)if(yd(t[n],"superscript")){let r=n;for(;r--;)if(Nd(t[r],"superscript")){n=Cd(t,r,n,e,"superscript",1);break}}return Ed(t,"superscript"),t}function ME(t,e){return n;function n(c){return mc(c===eo.caret,"expected `^`"),t.enter("superscriptSequenceTemporary"),r(c)}function r(c){if(c===eo.caret)return t.consume(c),r;const d=t.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,e(c)}}function AE(){const t={tokenize:ME,resolveAll:DE};return{text:{[eo.caret]:t},insideSpan:{null:[t]}}}function RE(t,e,n){const r=this.previous,c=Xl(r);let d=0;return g;function g(C){return mc(C===eo.plusSign,"expected `+`"),t.enter("underlineSequenceTemporary"),p(C)}function p(C){if(C===eo.plusSign)return t.consume(C),d++,p;if(d<2)return n(C);const S=t.exit("underlineSequenceTemporary"),T=Xl(C);return S._open=!T||T===lc.characterGroupPunctuation&&!!c,S._close=!c||c===lc.characterGroupPunctuation&&!!T,e(C)}}function bE(t,e){let n=-1;for(;++n<t.length;)if(yd(t[n],"underline")&&t[n][1].end.offset-t[n][1].start.offset>1){let r=n;for(;r--;)if(Nd(t[r],"underline")&&t[r][1].end.offset-t[r][1].start.offset>1){n=Cd(t,r,n,e,"underline",2);break}}return Ed(t,"underline"),t}function LE(){const t={tokenize:RE,resolveAll:bE};return{text:{[eo.plusSign]:t},insideSpan:{null:[t]}}}function kE(){return Hp([LE(),AE(),OE()])}const IE={canContainEols:["strikethrough"],enter:{strikethrough:PE},exit:{strikethrough:$E}};function PE(t){this.enter({type:"strikethrough",children:[]},t)}function $E(t){this.exit(t)}const FE={canContainEols:["subscript"],enter:{subscript:BE},exit:{subscript:HE}};function BE(t){this.enter({type:"subscript",children:[]},t)}function HE(t){this.exit(t)}const WE={canContainEols:["superscript"],enter:{superscript:KE},exit:{superscript:zE}};function KE(t){this.enter({type:"superscript",children:[]},t)}function zE(t){this.exit(t)}const UE={canContainEols:["underline"],enter:{underline:GE},exit:{underline:YE}};function GE(t){this.enter({type:"underline",children:[]},t)}function YE(t){this.exit(t)}function jE(){return[UE,IE,FE,WE]}function VE(){const t=this.data();e("micromarkExtensions",kE()),e("fromMarkdownExtensions",jE());function e(n,r){const c=t[n];c?(mc(Array.isArray(c)),c.push(r)):t[n]=[r]}}function qE(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function ZE(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
98
98
  `}]}function JE(t,e){const n=e.value?e.value+`
99
- `:"",r=e.lang?e.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 e.meta&&(d.data={meta:e.meta}),t.patch(e,d),d=t.applyData(e,d),d={type:"element",tagName:"pre",properties:{},children:[d]},t.patch(e,d),d}function XE(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function QE(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function il(t){const e=[];let n=-1,r=0,c=0;for(;++n<t.length;){const d=t.charCodeAt(n);let g="";if(d===37&&ju(t.charCodeAt(n+1))&&ju(t.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 p=t.charCodeAt(n+1);d<56320&&p>56319&&p<57344?(g=String.fromCharCode(d,p),c=1):g="�"}else g=String.fromCharCode(d);g&&(e.push(t.slice(r,n),encodeURIComponent(g)),r=n+c+1,g=""),c&&(n+=c,c=0)}return e.join("")+t.slice(r)}function Yp(t,e){const n=String(e.identifier).toUpperCase(),r=il(n.toLowerCase()),c=t.footnoteOrder.indexOf(n);let d;c===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,d=t.footnoteOrder.length):(t.footnoteCounts[n]++,d=c+1);const g=t.footnoteCounts[n],p={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(g>1?"-"+g:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};t.patch(e,p);const C={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(e,C),t.applyData(e,C)}function eT(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const c=String(r);return n[c]={type:"footnoteDefinition",identifier:c,children:[{type:"paragraph",children:e.children}],position:e.position},Yp(t,{type:"footnoteReference",identifier:c,position:e.position})}function tT(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function nT(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function jp(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const c=t.all(e),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 rT(t,e){const n=t.definition(e.identifier);if(!n)return jp(t,e);const r={src:il(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,c),t.applyData(e,c)}function iT(t,e){const n={src:il(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function oT(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function sT(t,e){const n=t.definition(e.identifier);if(!n)return jp(t,e);const r={href:il(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,c),t.applyData(e,c)}function lT(t,e){const n={href:il(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function aT(t,e,n){const r=t.all(e),c=n?cT(n):Vp(e),d={},g=[];if(typeof e.checked=="boolean"){const x=r[0];let O;x&&x.type==="element"&&x.tagName==="p"?O=x:(O={type:"element",tagName:"p",properties:{},children:[]},r.unshift(O)),O.children.length>0&&O.children.unshift({type:"text",value:" "}),O.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const x=r[p];(c||p!==0||x.type!=="element"||x.tagName!=="p")&&g.push({type:"text",value:`
100
- `}),x.type==="element"&&x.tagName==="p"&&!c?g.push(...x.children):g.push(x)}const C=r[r.length-1];C&&(c||C.type!=="element"||C.tagName!=="p")&&g.push({type:"text",value:`
101
- `});const S={type:"element",tagName:"li",properties:d,children:g};return t.patch(e,S),t.applyData(e,S)}function cT(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Vp(n[r])}return e}function Vp(t){const e=t.spread;return e??t.children.length>1}function uT(t,e){const n={},r=t.all(e);let c=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.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:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,d),t.applyData(e,d)}function dT(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function fT(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function hT(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Ed=qp("start"),Td=qp("end");function gT(t){return{start:Ed(t),end:Td(t)}}function qp(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function pT(t,e){const n=t.all(e),r=n.shift(),c=[];if(r){const g={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],g),c.push(g)}if(n.length>0){const g={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},p=Ed(e.children[1]),C=Td(e.children[e.children.length-1]);p.line&&C.line&&(g.position={start:p,end:C}),c.push(g)}const d={type:"element",tagName:"table",properties:{},children:t.wrap(c,!0)};return t.patch(e,d),t.applyData(e,d)}function mT(t,e,n){const r=n?n.children:void 0,d=(r?r.indexOf(e):1)===0?"th":"td",g=n&&n.type==="table"?n.align:void 0,p=g?g.length:e.children.length;let C=-1;const S=[];for(;++C<p;){const O=e.children[C],R={},b=g?g[C]:void 0;b&&(R.align=b);let T={type:"element",tagName:d,properties:R,children:[]};O&&(T.children=t.all(O),t.patch(O,T),T=t.applyData(e,T)),S.push(T)}const x={type:"element",tagName:"tr",properties:{},children:t.wrap(S,!0)};return t.patch(e,x),t.applyData(e,x)}function _T(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const fg=9,hg=32;function yT(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),c=0;const d=[];for(;r;)d.push(gg(e.slice(c,r.index),c>0,!0),r[0]),c=r.index+r[0].length,r=n.exec(e);return d.push(gg(e.slice(c),c>0,!1)),d.join("")}function gg(t,e,n){let r=0,c=t.length;if(e){let d=t.codePointAt(r);for(;d===fg||d===hg;)r++,d=t.codePointAt(r)}if(n){let d=t.codePointAt(c-1);for(;d===fg||d===hg;)c--,d=t.codePointAt(c-1)}return c>r?t.slice(r,c):""}function NT(t,e){const n={type:"text",value:yT(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function CT(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const ET={blockquote:qE,break:ZE,code:JE,delete:XE,emphasis:QE,footnoteReference:Yp,footnote:eT,heading:tT,html:nT,imageReference:rT,image:iT,inlineCode:oT,linkReference:sT,link:lT,listItem:aT,list:uT,paragraph:dT,root:fT,strong:hT,table:pT,tableCell:_T,tableRow:mT,text:NT,thematicBreak:CT,toml:Va,yaml:Va,definition:Va,footnoteDefinition:Va};function Va(){return null}const Zp=function(t){if(t==null)return vT;if(typeof t=="string")return ST(t);if(typeof t=="object")return Array.isArray(t)?TT(t):xT(t);if(typeof t=="function")return mc(t);throw new Error("Expected function, string, or object as test")};function TT(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Zp(t[n]);return mc(r);function r(...c){let d=-1;for(;++d<e.length;)if(e[d].call(this,...c))return!0;return!1}}function xT(t){return mc(e);function e(n){let r;for(r in t)if(n[r]!==t[r])return!1;return!0}}function ST(t){return mc(e);function e(n){return n&&n.type===t}}function mc(t){return e;function e(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...r))}}function vT(){return!0}const wT=!0,pg=!1,OT="skip",DT=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null);const c=Zp(e),d=r?-1:1;g(t,void 0,[])();function g(p,C,S){const x=p&&typeof p=="object"?p:{};if(typeof x.type=="string"){const R=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(O,"name",{value:"node ("+(p.type+(R?"<"+R+">":""))+")"})}return O;function O(){let R=[],b,T,w;if((!e||c(p,C,S[S.length-1]||null))&&(R=MT(n(p,S)),R[0]===pg))return R;if(p.children&&R[0]!==OT)for(T=(r?p.children.length:-1)+d,w=S.concat(p);T>-1&&T<p.children.length;){if(b=g(p.children[T],T,w)(),b[0]===pg)return b;T=typeof b[1]=="number"?b[1]:T+d}return R}}};function MT(t){return Array.isArray(t)?t:typeof t=="number"?[wT,t]:[t]}const xd=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null),DT(t,e,c,r);function c(d,g){const p=g[g.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function AT(t){return!t||!t.position||!t.position.start||!t.position.start.line||!t.position.start.column||!t.position.end||!t.position.end.line||!t.position.end.column}const mg={}.hasOwnProperty;function RT(t){const e=Object.create(null);if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return xd(t,"definition",r=>{const c=_g(r.identifier);c&&!mg.call(e,c)&&(e[c]=r)}),n;function n(r){const c=_g(r);return c&&mg.call(e,c)?e[c]:null}}function _g(t){return String(t||"").toUpperCase()}const lc={}.hasOwnProperty;function bT(t,e){const n=e||{},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={...ET,...n.handlers},g.definition=RT(t),g.footnoteById=c,g.footnoteOrder=[],g.footnoteCounts={},g.patch=LT,g.applyData=kT,g.one=p,g.all=C,g.wrap=PT,g.augment=d,xd(t,"footnoteDefinition",S=>{const x=String(S.identifier).toUpperCase();lc.call(c,x)||(c[x]=S)}),g;function d(S,x){if(S&&"data"in S&&S.data){const O=S.data;O.hName&&(x.type!=="element"&&(x={type:"element",tagName:"",properties:{},children:[]}),x.tagName=O.hName),x.type==="element"&&O.hProperties&&(x.properties={...x.properties,...O.hProperties}),"children"in x&&x.children&&O.hChildren&&(x.children=O.hChildren)}if(S){const O="type"in S?S:{position:S};AT(O)||(x.position={start:Ed(O),end:Td(O)})}return x}function g(S,x,O,R){return Array.isArray(O)&&(R=O,O={}),d(S,{type:"element",tagName:x,properties:O||{},children:R||[]})}function p(S,x){return Jp(g,S,x)}function C(S){return ro(g,S)}}function LT(t,e){t.position&&(e.position=gT(t))}function kT(t,e){let n=e;if(t&&t.data){const r=t.data.hName,c=t.data.hChildren,d=t.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 Jp(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return lc.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:ro(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):IT(t,e)}function ro(t,e){const n=[];if("children"in e){const r=e.children;let c=-1;for(;++c<r.length;){const d=Jp(t,r[c],e);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 IT(t,e){const n=e.data||{},r="value"in e&&!(lc.call(n,"hProperties")||lc.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:ro(t,e)};return t.patch(e,r),t.applyData(e,r)}function PT(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
99
+ `:"",r=e.lang?e.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 e.meta&&(d.data={meta:e.meta}),t.patch(e,d),d=t.applyData(e,d),d={type:"element",tagName:"pre",properties:{},children:[d]},t.patch(e,d),d}function XE(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function QE(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function il(t){const e=[];let n=-1,r=0,c=0;for(;++n<t.length;){const d=t.charCodeAt(n);let g="";if(d===37&&Vu(t.charCodeAt(n+1))&&Vu(t.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 p=t.charCodeAt(n+1);d<56320&&p>56319&&p<57344?(g=String.fromCharCode(d,p),c=1):g="�"}else g=String.fromCharCode(d);g&&(e.push(t.slice(r,n),encodeURIComponent(g)),r=n+c+1,g=""),c&&(n+=c,c=0)}return e.join("")+t.slice(r)}function qp(t,e){const n=String(e.identifier).toUpperCase(),r=il(n.toLowerCase()),c=t.footnoteOrder.indexOf(n);let d;c===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,d=t.footnoteOrder.length):(t.footnoteCounts[n]++,d=c+1);const g=t.footnoteCounts[n],p={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(g>1?"-"+g:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};t.patch(e,p);const C={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(e,C),t.applyData(e,C)}function eT(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const c=String(r);return n[c]={type:"footnoteDefinition",identifier:c,children:[{type:"paragraph",children:e.children}],position:e.position},qp(t,{type:"footnoteReference",identifier:c,position:e.position})}function tT(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function nT(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function Zp(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const c=t.all(e),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 rT(t,e){const n=t.definition(e.identifier);if(!n)return Zp(t,e);const r={src:il(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,c),t.applyData(e,c)}function iT(t,e){const n={src:il(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function oT(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function sT(t,e){const n=t.definition(e.identifier);if(!n)return Zp(t,e);const r={href:il(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,c),t.applyData(e,c)}function lT(t,e){const n={href:il(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function aT(t,e,n){const r=t.all(e),c=n?cT(n):Jp(e),d={},g=[];if(typeof e.checked=="boolean"){const T=r[0];let O;T&&T.type==="element"&&T.tagName==="p"?O=T:(O={type:"element",tagName:"p",properties:{},children:[]},r.unshift(O)),O.children.length>0&&O.children.unshift({type:"text",value:" "}),O.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const T=r[p];(c||p!==0||T.type!=="element"||T.tagName!=="p")&&g.push({type:"text",value:`
100
+ `}),T.type==="element"&&T.tagName==="p"&&!c?g.push(...T.children):g.push(T)}const C=r[r.length-1];C&&(c||C.type!=="element"||C.tagName!=="p")&&g.push({type:"text",value:`
101
+ `});const S={type:"element",tagName:"li",properties:d,children:g};return t.patch(e,S),t.applyData(e,S)}function cT(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Jp(n[r])}return e}function Jp(t){const e=t.spread;return e??t.children.length>1}function uT(t,e){const n={},r=t.all(e);let c=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.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:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,d),t.applyData(e,d)}function dT(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function fT(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function hT(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Td=Xp("start"),xd=Xp("end");function gT(t){return{start:Td(t),end:xd(t)}}function Xp(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function pT(t,e){const n=t.all(e),r=n.shift(),c=[];if(r){const g={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],g),c.push(g)}if(n.length>0){const g={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},p=Td(e.children[1]),C=xd(e.children[e.children.length-1]);p.line&&C.line&&(g.position={start:p,end:C}),c.push(g)}const d={type:"element",tagName:"table",properties:{},children:t.wrap(c,!0)};return t.patch(e,d),t.applyData(e,d)}function mT(t,e,n){const r=n?n.children:void 0,d=(r?r.indexOf(e):1)===0?"th":"td",g=n&&n.type==="table"?n.align:void 0,p=g?g.length:e.children.length;let C=-1;const S=[];for(;++C<p;){const O=e.children[C],R={},b=g?g[C]:void 0;b&&(R.align=b);let x={type:"element",tagName:d,properties:R,children:[]};O&&(x.children=t.all(O),t.patch(O,x),x=t.applyData(e,x)),S.push(x)}const T={type:"element",tagName:"tr",properties:{},children:t.wrap(S,!0)};return t.patch(e,T),t.applyData(e,T)}function _T(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const pg=9,mg=32;function yT(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),c=0;const d=[];for(;r;)d.push(_g(e.slice(c,r.index),c>0,!0),r[0]),c=r.index+r[0].length,r=n.exec(e);return d.push(_g(e.slice(c),c>0,!1)),d.join("")}function _g(t,e,n){let r=0,c=t.length;if(e){let d=t.codePointAt(r);for(;d===pg||d===mg;)r++,d=t.codePointAt(r)}if(n){let d=t.codePointAt(c-1);for(;d===pg||d===mg;)c--,d=t.codePointAt(c-1)}return c>r?t.slice(r,c):""}function NT(t,e){const n={type:"text",value:yT(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function CT(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const ET={blockquote:qE,break:ZE,code:JE,delete:XE,emphasis:QE,footnoteReference:qp,footnote:eT,heading:tT,html:nT,imageReference:rT,image:iT,inlineCode:oT,linkReference:sT,link:lT,listItem:aT,list:uT,paragraph:dT,root:fT,strong:hT,table:pT,tableCell:_T,tableRow:mT,text:NT,thematicBreak:CT,toml:Va,yaml:Va,definition:Va,footnoteDefinition:Va};function Va(){return null}const Qp=function(t){if(t==null)return vT;if(typeof t=="string")return ST(t);if(typeof t=="object")return Array.isArray(t)?TT(t):xT(t);if(typeof t=="function")return _c(t);throw new Error("Expected function, string, or object as test")};function TT(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Qp(t[n]);return _c(r);function r(...c){let d=-1;for(;++d<e.length;)if(e[d].call(this,...c))return!0;return!1}}function xT(t){return _c(e);function e(n){let r;for(r in t)if(n[r]!==t[r])return!1;return!0}}function ST(t){return _c(e);function e(n){return n&&n.type===t}}function _c(t){return e;function e(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...r))}}function vT(){return!0}const wT=!0,yg=!1,OT="skip",DT=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null);const c=Qp(e),d=r?-1:1;g(t,void 0,[])();function g(p,C,S){const T=p&&typeof p=="object"?p:{};if(typeof T.type=="string"){const R=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(O,"name",{value:"node ("+(p.type+(R?"<"+R+">":""))+")"})}return O;function O(){let R=[],b,x,w;if((!e||c(p,C,S[S.length-1]||null))&&(R=MT(n(p,S)),R[0]===yg))return R;if(p.children&&R[0]!==OT)for(x=(r?p.children.length:-1)+d,w=S.concat(p);x>-1&&x<p.children.length;){if(b=g(p.children[x],x,w)(),b[0]===yg)return b;x=typeof b[1]=="number"?b[1]:x+d}return R}}};function MT(t){return Array.isArray(t)?t:typeof t=="number"?[wT,t]:[t]}const Sd=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null),DT(t,e,c,r);function c(d,g){const p=g[g.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function AT(t){return!t||!t.position||!t.position.start||!t.position.start.line||!t.position.start.column||!t.position.end||!t.position.end.line||!t.position.end.column}const Ng={}.hasOwnProperty;function RT(t){const e=Object.create(null);if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return Sd(t,"definition",r=>{const c=Cg(r.identifier);c&&!Ng.call(e,c)&&(e[c]=r)}),n;function n(r){const c=Cg(r);return c&&Ng.call(e,c)?e[c]:null}}function Cg(t){return String(t||"").toUpperCase()}const ac={}.hasOwnProperty;function bT(t,e){const n=e||{},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={...ET,...n.handlers},g.definition=RT(t),g.footnoteById=c,g.footnoteOrder=[],g.footnoteCounts={},g.patch=LT,g.applyData=kT,g.one=p,g.all=C,g.wrap=PT,g.augment=d,Sd(t,"footnoteDefinition",S=>{const T=String(S.identifier).toUpperCase();ac.call(c,T)||(c[T]=S)}),g;function d(S,T){if(S&&"data"in S&&S.data){const O=S.data;O.hName&&(T.type!=="element"&&(T={type:"element",tagName:"",properties:{},children:[]}),T.tagName=O.hName),T.type==="element"&&O.hProperties&&(T.properties={...T.properties,...O.hProperties}),"children"in T&&T.children&&O.hChildren&&(T.children=O.hChildren)}if(S){const O="type"in S?S:{position:S};AT(O)||(T.position={start:Td(O),end:xd(O)})}return T}function g(S,T,O,R){return Array.isArray(O)&&(R=O,O={}),d(S,{type:"element",tagName:T,properties:O||{},children:R||[]})}function p(S,T){return em(g,S,T)}function C(S){return ro(g,S)}}function LT(t,e){t.position&&(e.position=gT(t))}function kT(t,e){let n=e;if(t&&t.data){const r=t.data.hName,c=t.data.hChildren,d=t.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 em(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return ac.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:ro(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):IT(t,e)}function ro(t,e){const n=[];if("children"in e){const r=e.children;let c=-1;for(;++c<r.length;){const d=em(t,r[c],e);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 IT(t,e){const n=e.data||{},r="value"in e&&!(ac.call(n,"hProperties")||ac.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:ro(t,e)};return t.patch(e,r),t.applyData(e,r)}function PT(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
102
102
  `});++r<t.length;)r&&n.push({type:"text",value:`
103
103
  `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
104
- `}),n}const $T=(t,e)=>t(e,"i",ro(t,e)),FT=(t,e)=>t(e,"b",ro(t,e)),BT=(t,e)=>t(e,"u",ro(t,e)),HT=(t,e)=>t(e,"s",ro(t,e)),WT=(t,e)=>t(e,"sub",ro(t,e)),KT=(t,e)=>t(e,"sup",ro(t,e)),zT={emphasis:$T,strong:FT,underline:BT,strikethrough:HT,subscript:WT,superscript:KT},UT=t=>{const[e,n]=et.useState();let r;return et.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-De2GfwGG.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:t.markdown,remarkPlugins:[VE],remarkRehypeOptions:{handlers:zT}});n(d)})()},[t.markdown]),e||null};class hs extends Error{}class GT extends hs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class YT extends hs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class jT extends hs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Vs extends hs{}class Xp extends hs{constructor(e){super(`Invalid unit ${e}`)}}class xr extends hs{}class vo extends hs{constructor(){super("Zone is an abstract class")}}const it="numeric",pi="short",Lr="long",ac={year:it,month:it,day:it},Qp={year:it,month:pi,day:it},VT={year:it,month:pi,day:it,weekday:pi},em={year:it,month:Lr,day:it},tm={year:it,month:Lr,day:it,weekday:Lr},nm={hour:it,minute:it},rm={hour:it,minute:it,second:it},im={hour:it,minute:it,second:it,timeZoneName:pi},om={hour:it,minute:it,second:it,timeZoneName:Lr},sm={hour:it,minute:it,hourCycle:"h23"},lm={hour:it,minute:it,second:it,hourCycle:"h23"},am={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:pi},cm={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:Lr},um={year:it,month:it,day:it,hour:it,minute:it},dm={year:it,month:it,day:it,hour:it,minute:it,second:it},fm={year:it,month:pi,day:it,hour:it,minute:it},hm={year:it,month:pi,day:it,hour:it,minute:it,second:it},qT={year:it,month:pi,day:it,weekday:pi,hour:it,minute:it},gm={year:it,month:Lr,day:it,hour:it,minute:it,timeZoneName:pi},pm={year:it,month:Lr,day:it,hour:it,minute:it,second:it,timeZoneName:pi},mm={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,timeZoneName:Lr},_m={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,second:it,timeZoneName:Lr};class ea{get type(){throw new vo}get name(){throw new vo}get ianaName(){return this.name}get isUniversal(){throw new vo}offsetName(e,n){throw new vo}formatOffset(e,n){throw new vo}offset(e){throw new vo}equals(e){throw new vo}get isValid(){throw new vo}}let Du=null;class _c extends ea{static get instance(){return Du===null&&(Du=new _c),Du}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return wm(e,n,r)}formatOffset(e,n){return Zl(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let rc={};function ZT(t){return rc[t]||(rc[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),rc[t]}const JT={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function XT(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,c,d,g,p,C,S,x]=r;return[g,c,d,p,C,S,x]}function QT(t,e){const n=t.formatToParts(e),r=[];for(let c=0;c<n.length;c++){const{type:d,value:g}=n[c],p=JT[d];d==="era"?r[p]=g:Lt(p)||(r[p]=parseInt(g,10))}return r}let qa={};class no extends ea{static create(e){return qa[e]||(qa[e]=new no(e)),qa[e]}static resetCache(){qa={},rc={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=no.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return wm(e,n,r,this.name)}formatOffset(e,n){return Zl(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const r=ZT(this.name);let[c,d,g,p,C,S,x]=r.formatToParts?QT(r,n):XT(r,n);p==="BC"&&(c=-Math.abs(c)+1);const R=Nc({year:c,month:d,day:g,hour:C===24?0:C,minute:S,second:x,millisecond:0});let b=+n;const T=b%1e3;return b-=T>=0?T:1e3+T,(R-b)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let yg={};function ex(t,e={}){const n=JSON.stringify([t,e]);let r=yg[n];return r||(r=new Intl.ListFormat(t,e),yg[n]=r),r}let Vu={};function qu(t,e={}){const n=JSON.stringify([t,e]);let r=Vu[n];return r||(r=new Intl.DateTimeFormat(t,e),Vu[n]=r),r}let Zu={};function tx(t,e={}){const n=JSON.stringify([t,e]);let r=Zu[n];return r||(r=new Intl.NumberFormat(t,e),Zu[n]=r),r}let Ju={};function nx(t,e={}){const{base:n,...r}=e,c=JSON.stringify([t,r]);let d=Ju[c];return d||(d=new Intl.RelativeTimeFormat(t,e),Ju[c]=d),d}let jl=null;function rx(){return jl||(jl=new Intl.DateTimeFormat().resolvedOptions().locale,jl)}let Ng={};function ix(t){let e=Ng[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Ng[t]=e}return e}function ox(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let r,c;try{r=qu(t).resolvedOptions(),c=t}catch{const C=t.substring(0,n);r=qu(C).resolvedOptions(),c=C}const{numberingSystem:d,calendar:g}=r;return[c,d,g]}}function sx(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function lx(t){const e=[];for(let n=1;n<=12;n++){const r=Dt.utc(2009,n,1);e.push(t(r))}return e}function ax(t){const e=[];for(let n=1;n<=7;n++){const r=Dt.utc(2016,11,13+n);e.push(t(r))}return e}function Za(t,e,n,r){const c=t.listingMode();return c==="error"?null:c==="en"?n(e):r(e)}function cx(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class ux{constructor(e,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 p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=tx(e,p)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):Od(e,3);return Pn(n,this.padTo)}}}class dx{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let c;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const g=-1*(e.offset/60),p=g>=0?`Etc/GMT+${g}`:`Etc/GMT${g}`;e.offset!==0&&no.create(p).valid?(c=p,this.dt=e):(c="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,c=e.zone.name):(c="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const d={...this.opts};d.timeZone=d.timeZone||c,this.dtf=qu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.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}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class fx{constructor(e,n,r){this.opts={style:"long",...r},!n&&Sm()&&(this.rtf=nx(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):bx(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const hx={firstDay:1,minimalDays:4,weekend:[6,7]};class en{static fromOpts(e){return en.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,c,d=!1){const g=e||bn.defaultLocale,p=g||(d?"en-US":rx()),C=n||bn.defaultNumberingSystem,S=r||bn.defaultOutputCalendar,x=Xu(c)||bn.defaultWeekSettings;return new en(p,C,S,x,g)}static resetCache(){jl=null,Vu={},Zu={},Ju={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:c}={}){return en.create(e,n,r,c)}constructor(e,n,r,c,d){const[g,p,C]=ox(e);this.locale=g,this.numberingSystem=n||p||null,this.outputCalendar=r||C||null,this.weekSettings=c,this.intl=sx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=cx(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:en.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Xu(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Za(this,e,Mm,()=>{const r=n?{month:e,day:"numeric"}:{month:e},c=n?"format":"standalone";return this.monthsCache[c][e]||(this.monthsCache[c][e]=lx(d=>this.extract(d,r,"month"))),this.monthsCache[c][e]})}weekdays(e,n=!1){return Za(this,e,bm,()=>{const r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},c=n?"format":"standalone";return this.weekdaysCache[c][e]||(this.weekdaysCache[c][e]=ax(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[c][e]})}meridiems(){return Za(this,void 0,()=>Lm,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Dt.utc(2016,11,13,9),Dt.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Za(this,e,km,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[Dt.utc(-40,1,1),Dt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){const c=this.dtFormatter(e,n),d=c.formatToParts(),g=d.find(p=>p.type.toLowerCase()===r);return g?g.value:null}numberFormatter(e={}){return new ux(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new dx(e,this.intl,n)}relFormatter(e={}){return new fx(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ex(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:vm()?ix(this.locale):hx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let Mu=null;class ur extends ea{static get utcInstance(){return Mu===null&&(Mu=new ur(0)),Mu}static instance(e){return e===0?ur.utcInstance:new ur(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ur(Cc(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Zl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Zl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Zl(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class gx extends ea{constructor(e){super(),this.zoneName=e}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 Do(t,e){if(Lt(t)||t===null)return e;if(t instanceof ea)return t;if(_x(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?_c.instance:n==="utc"||n==="gmt"?ur.utcInstance:ur.parseSpecifier(n)||no.create(t)}else return us(t)?ur.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new gx(t)}let Cg=()=>Date.now(),Eg="system",Tg=null,xg=null,Sg=null,vg=60,wg,Og=null;class bn{static get now(){return Cg}static set now(e){Cg=e}static set defaultZone(e){Eg=e}static get defaultZone(){return Do(Eg,_c.instance)}static get defaultLocale(){return Tg}static set defaultLocale(e){Tg=e}static get defaultNumberingSystem(){return xg}static set defaultNumberingSystem(e){xg=e}static get defaultOutputCalendar(){return Sg}static set defaultOutputCalendar(e){Sg=e}static get defaultWeekSettings(){return Og}static set defaultWeekSettings(e){Og=Xu(e)}static get twoDigitCutoffYear(){return vg}static set twoDigitCutoffYear(e){vg=e%100}static get throwOnInvalid(){return wg}static set throwOnInvalid(e){wg=e}static resetCaches(){en.resetCache(),no.resetCache()}}class gi{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const ym=[0,31,59,90,120,151,181,212,243,273,304,334],Nm=[0,31,60,91,121,152,182,213,244,274,305,335];function Vr(t,e){return new gi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Sd(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const c=r.getUTCDay();return c===0?7:c}function Cm(t,e,n){return n+(ta(t)?Nm:ym)[e-1]}function Em(t,e){const n=ta(t)?Nm:ym,r=n.findIndex(d=>d<e),c=e-n[r];return{month:r+1,day:c}}function vd(t,e){return(t-e+7)%7+1}function cc(t,e=4,n=1){const{year:r,month:c,day:d}=t,g=Cm(r,c,d),p=vd(Sd(r,c,d),n);let C=Math.floor((g-p+14-e)/7),S;return C<1?(S=r-1,C=Ql(S,e,n)):C>Ql(r,e,n)?(S=r+1,C=1):S=r,{weekYear:S,weekNumber:C,weekday:p,...Ec(t)}}function Dg(t,e=4,n=1){const{weekYear:r,weekNumber:c,weekday:d}=t,g=vd(Sd(r,1,e),n),p=qs(r);let C=c*7+d-g-7+e,S;C<1?(S=r-1,C+=qs(S)):C>p?(S=r+1,C-=qs(r)):S=r;const{month:x,day:O}=Em(S,C);return{year:S,month:x,day:O,...Ec(t)}}function Au(t){const{year:e,month:n,day:r}=t,c=Cm(e,n,r);return{year:e,ordinal:c,...Ec(t)}}function Mg(t){const{year:e,ordinal:n}=t,{month:r,day:c}=Em(e,n);return{year:e,month:r,day:c,...Ec(t)}}function Ag(t,e){if(!Lt(t.localWeekday)||!Lt(t.localWeekNumber)||!Lt(t.localWeekYear)){if(!Lt(t.weekday)||!Lt(t.weekNumber)||!Lt(t.weekYear))throw new Vs("Cannot mix locale-based week fields with ISO-based week fields");return Lt(t.localWeekday)||(t.weekday=t.localWeekday),Lt(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Lt(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function px(t,e=4,n=1){const r=yc(t.weekYear),c=qr(t.weekNumber,1,Ql(t.weekYear,e,n)),d=qr(t.weekday,1,7);return r?c?d?!1:Vr("weekday",t.weekday):Vr("week",t.weekNumber):Vr("weekYear",t.weekYear)}function mx(t){const e=yc(t.year),n=qr(t.ordinal,1,qs(t.year));return e?n?!1:Vr("ordinal",t.ordinal):Vr("year",t.year)}function Tm(t){const e=yc(t.year),n=qr(t.month,1,12),r=qr(t.day,1,uc(t.year,t.month));return e?n?r?!1:Vr("day",t.day):Vr("month",t.month):Vr("year",t.year)}function xm(t){const{hour:e,minute:n,second:r,millisecond:c}=t,d=qr(e,0,23)||e===24&&n===0&&r===0&&c===0,g=qr(n,0,59),p=qr(r,0,59),C=qr(c,0,999);return d?g?p?C?!1:Vr("millisecond",c):Vr("second",r):Vr("minute",n):Vr("hour",e)}function Lt(t){return typeof t>"u"}function us(t){return typeof t=="number"}function yc(t){return typeof t=="number"&&t%1===0}function _x(t){return typeof t=="string"}function yx(t){return Object.prototype.toString.call(t)==="[object Date]"}function Sm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function vm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Nx(t){return Array.isArray(t)?t:[t]}function Rg(t,e,n){if(t.length!==0)return t.reduce((r,c)=>{const d=[e(c),c];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function Cx(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function Qs(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Xu(t){if(t==null)return null;if(typeof t!="object")throw new xr("Week settings must be an object");if(!qr(t.firstDay,1,7)||!qr(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!qr(e,1,7)))throw new xr("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function qr(t,e,n){return yc(t)&&t>=e&&t<=n}function Ex(t,e){return t-e*Math.floor(t/e)}function Pn(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Oo(t){if(!(Lt(t)||t===null||t===""))return parseInt(t,10)}function is(t){if(!(Lt(t)||t===null||t===""))return parseFloat(t)}function wd(t){if(!(Lt(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Od(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function ta(t){return t%4===0&&(t%100!==0||t%400===0)}function qs(t){return ta(t)?366:365}function uc(t,e){const n=Ex(e-1,12)+1,r=t+(e-n)/12;return n===2?ta(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Nc(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function bg(t,e,n){return-vd(Sd(t,1,e),n)+e-1}function Ql(t,e=4,n=1){const r=bg(t,e,n),c=bg(t+1,e,n);return(qs(t)-r+c)/7}function Qu(t){return t>99?t:t>bn.twoDigitCutoffYear?1900+t:2e3+t}function wm(t,e,n,r=null){const c=new Date(t),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const g={timeZoneName:e,...d},p=new Intl.DateTimeFormat(n,g).formatToParts(c).find(C=>C.type.toLowerCase()==="timezonename");return p?p.value:null}function Cc(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,c=n<0||Object.is(n,-0)?-r:r;return n*60+c}function Om(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new xr(`Invalid unit value ${t}`);return e}function dc(t,e){const n={};for(const r in t)if(Qs(t,r)){const c=t[r];if(c==null)continue;n[e(r)]=Om(c)}return n}function Zl(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),c=t>=0?"+":"-";switch(e){case"short":return`${c}${Pn(n,2)}:${Pn(r,2)}`;case"narrow":return`${c}${n}${r>0?`:${r}`:""}`;case"techie":return`${c}${Pn(n,2)}${Pn(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ec(t){return Cx(t,["hour","minute","second","millisecond"])}const Tx=["January","February","March","April","May","June","July","August","September","October","November","December"],Dm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Mm(t){switch(t){case"narrow":return[...xx];case"short":return[...Dm];case"long":return[...Tx];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 Am=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Rm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Sx=["M","T","W","T","F","S","S"];function bm(t){switch(t){case"narrow":return[...Sx];case"short":return[...Rm];case"long":return[...Am];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Lm=["AM","PM"],vx=["Before Christ","Anno Domini"],wx=["BC","AD"],Ox=["B","A"];function km(t){switch(t){case"narrow":return[...Ox];case"short":return[...wx];case"long":return[...vx];default:return null}}function Dx(t){return Lm[t.hour<12?0:1]}function Mx(t,e){return bm(e)[t.weekday-1]}function Ax(t,e){return Mm(e)[t.month-1]}function Rx(t,e){return km(e)[t.year<0?0:1]}function bx(t,e,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(t)===-1;if(n==="auto"&&d){const O=t==="days";switch(e){case 1:return O?"tomorrow":`next ${c[t][0]}`;case-1:return O?"yesterday":`last ${c[t][0]}`;case 0:return O?"today":`this ${c[t][0]}`}}const g=Object.is(e,-0)||e<0,p=Math.abs(e),C=p===1,S=c[t],x=r?C?S[1]:S[2]||S[1]:C?c[t][0]:t;return g?`${p} ${x} ago`:`in ${p} ${x}`}function Lg(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const Lx={D:ac,DD:Qp,DDD:em,DDDD:tm,t:nm,tt:rm,ttt:im,tttt:om,T:sm,TT:lm,TTT:am,TTTT:cm,f:um,ff:fm,fff:gm,ffff:mm,F:dm,FF:hm,FFF:pm,FFFF:_m};class or{static create(e,n={}){return new or(e,n)}static parseFormat(e){let n=null,r="",c=!1;const d=[];for(let g=0;g<e.length;g++){const p=e.charAt(g);p==="'"?(r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),n=null,r="",c=!c):c||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(e){return Lx[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return Pn(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(b,T)=>this.loc.extract(e,b,T),g=b=>e.isOffsetFixed&&e.offset===0&&b.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,b.format):"",p=()=>r?Dx(e):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),C=(b,T)=>r?Ax(e,b):d(T?{month:b}:{month:b,day:"numeric"},"month"),S=(b,T)=>r?Mx(e,b):d(T?{weekday:b}:{weekday:b,month:"long",day:"numeric"},"weekday"),x=b=>{const T=or.macroTokenToFormatOpts(b);return T?this.formatWithSystemDefault(e,T):b},O=b=>r?Rx(e,b):d({era:b},"era"),R=b=>{switch(b){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.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 e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return p();case"d":return c?d({day:"numeric"},"day"):this.num(e.day);case"dd":return c?d({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return S("short",!0);case"cccc":return S("long",!0);case"ccccc":return S("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return S("short",!1);case"EEEE":return S("long",!1);case"EEEEE":return S("narrow",!1);case"L":return c?d({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return c?d({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return C("short",!0);case"LLLL":return C("long",!0);case"LLLLL":return C("narrow",!0);case"M":return c?d({month:"numeric"},"month"):this.num(e.month);case"MM":return c?d({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return C("short",!1);case"MMMM":return C("long",!1);case"MMMMM":return C("narrow",!1);case"y":return c?d({year:"numeric"},"year"):this.num(e.year);case"yy":return c?d({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return c?d({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return c?d({year:"numeric"},"year"):this.num(e.year,6);case"G":return O("short");case"GG":return O("long");case"GGGGG":return O("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return x(b)}};return Lg(or.parseFormat(n),R)}formatDurationFromString(e,n){const r=C=>{switch(C[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=C=>S=>{const x=r(S);return x?this.num(C.get(x),S.length):S},d=or.parseFormat(n),g=d.reduce((C,{literal:S,val:x})=>S?C:C.concat(x),[]),p=e.shiftTo(...g.map(r).filter(C=>C));return Lg(d,c(p))}}const Im=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ol(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function sl(...t){return e=>t.reduce(([n,r,c],d)=>{const[g,p,C]=d(e,c);return[{...n,...g},p||r,C]},[{},null,1]).slice(0,2)}function ll(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const c=n.exec(t);if(c)return r(c)}return[null,null]}function Pm(...t){return(e,n)=>{const r={};let c;for(c=0;c<t.length;c++)r[t[c]]=Oo(e[n+c]);return[r,null,n+c]}}const $m=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,kx=`(?:${$m.source}?(?:\\[(${Im.source})\\])?)?`,Dd=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Fm=RegExp(`${Dd.source}${kx}`),Md=RegExp(`(?:T${Fm.source})?`),Ix=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Px=/(\d{4})-?W(\d\d)(?:-?(\d))?/,$x=/(\d{4})-?(\d{3})/,Fx=Pm("weekYear","weekNumber","weekDay"),Bx=Pm("year","ordinal"),Hx=/(\d{4})-(\d\d)-(\d\d)/,Bm=RegExp(`${Dd.source} ?(?:${$m.source}|(${Im.source}))?`),Wx=RegExp(`(?: ${Bm.source})?`);function Zs(t,e,n){const r=t[e];return Lt(r)?n:Oo(r)}function Kx(t,e){return[{year:Zs(t,e),month:Zs(t,e+1,1),day:Zs(t,e+2,1)},null,e+3]}function al(t,e){return[{hours:Zs(t,e,0),minutes:Zs(t,e+1,0),seconds:Zs(t,e+2,0),milliseconds:wd(t[e+3])},null,e+4]}function na(t,e){const n=!t[e]&&!t[e+1],r=Cc(t[e+1],t[e+2]),c=n?null:ur.instance(r);return[{},c,e+3]}function ra(t,e){const n=t[e]?no.create(t[e]):null;return[{},n,e+1]}const zx=RegExp(`^T?${Dd.source}$`),Ux=/^-?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 Gx(t){const[e,n,r,c,d,g,p,C,S]=t,x=e[0]==="-",O=C&&C[0]==="-",R=(b,T=!1)=>b!==void 0&&(T||b&&x)?-b:b;return[{years:R(is(n)),months:R(is(r)),weeks:R(is(c)),days:R(is(d)),hours:R(is(g)),minutes:R(is(p)),seconds:R(is(C),C==="-0"),milliseconds:R(wd(S),O)}]}const Yx={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 Ad(t,e,n,r,c,d,g){const p={year:e.length===2?Qu(Oo(e)):Oo(e),month:Dm.indexOf(n)+1,day:Oo(r),hour:Oo(c),minute:Oo(d)};return g&&(p.second=Oo(g)),t&&(p.weekday=t.length>3?Am.indexOf(t)+1:Rm.indexOf(t)+1),p}const jx=/^(?:(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 Vx(t){const[,e,n,r,c,d,g,p,C,S,x,O]=t,R=Ad(e,c,r,n,d,g,p);let b;return C?b=Yx[C]:S?b=0:b=Cc(x,O),[R,new ur(b)]}function qx(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Zx=/^(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$/,Jx=/^(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$/,Xx=/^(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 kg(t){const[,e,n,r,c,d,g,p]=t;return[Ad(e,c,r,n,d,g,p),ur.utcInstance]}function Qx(t){const[,e,n,r,c,d,g,p]=t;return[Ad(e,p,n,r,c,d,g),ur.utcInstance]}const eS=ol(Ix,Md),tS=ol(Px,Md),nS=ol($x,Md),rS=ol(Fm),Hm=sl(Kx,al,na,ra),iS=sl(Fx,al,na,ra),oS=sl(Bx,al,na,ra),sS=sl(al,na,ra);function lS(t){return ll(t,[eS,Hm],[tS,iS],[nS,oS],[rS,sS])}function aS(t){return ll(qx(t),[jx,Vx])}function cS(t){return ll(t,[Zx,kg],[Jx,kg],[Xx,Qx])}function uS(t){return ll(t,[Ux,Gx])}const dS=sl(al);function fS(t){return ll(t,[zx,dS])}const hS=ol(Hx,Wx),gS=ol(Bm),pS=sl(al,na,ra);function mS(t){return ll(t,[hS,Hm],[gS,pS])}const Ig="Invalid Duration",Wm={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}},_S={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},...Wm},Yr=146097/400,Gs=146097/4800,yS={years:{quarters:4,months:12,weeks:Yr/7,days:Yr,hours:Yr*24,minutes:Yr*24*60,seconds:Yr*24*60*60,milliseconds:Yr*24*60*60*1e3},quarters:{months:3,weeks:Yr/28,days:Yr/4,hours:Yr*24/4,minutes:Yr*24*60/4,seconds:Yr*24*60*60/4,milliseconds:Yr*24*60*60*1e3/4},months:{weeks:Gs/7,days:Gs,hours:Gs*24,minutes:Gs*24*60,seconds:Gs*24*60*60,milliseconds:Gs*24*60*60*1e3},...Wm},cs=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],NS=cs.slice(0).reverse();function wo(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new jt(r)}function Km(t,e){let n=e.milliseconds??0;for(const r of NS.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function Pg(t,e){const n=Km(t,e)<0?-1:1;cs.reduceRight((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]*n,g=t[c][r],p=Math.floor(d/g);e[c]+=p*n,e[r]-=p*g*n}return c},null),cs.reduce((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]%1;e[r]-=d,e[c]+=d*t[r][c]}return c},null)}function CS(t){const e={};for(const[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}class jt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?yS:_S;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||en.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return jt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new xr(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new jt({values:dc(e,jt.normalizeUnit),loc:en.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(us(e))return jt.fromMillis(e);if(jt.isDuration(e))return e;if(typeof e=="object")return jt.fromObject(e);throw new xr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=uS(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=fS(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Duration is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new jT(r);return new jt({invalid:r})}static normalizeUnit(e){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"}[e&&e.toLowerCase()];if(!n)throw new Xp(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?or.create(this.loc,r).formatDurationFromString(this,e):Ig}toHuman(e={}){if(!this.isValid)return Ig;const n=cs.map(r=>{const c=this.values[r];return Lt(c)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(c)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Od(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Dt.fromMillis(n,{zone:"UTC"}).toISOTime(e))}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?Km(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e),r={};for(const c of cs)(Qs(n.values,c)||Qs(this.values,c))&&(r[c]=n.get(c)+this.get(c));return wo(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Om(e(this.values[r],r));return wo(this,{values:n},!0)}get(e){return this[jt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...dc(e,jt.normalizeUnit)};return wo(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:c}={}){const g={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:c,conversionAccuracy:r};return wo(this,g)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Pg(this.matrix,e),wo(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=CS(this.normalize().shiftToAll().toObject());return wo(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(g=>jt.normalizeUnit(g));const n={},r={},c=this.toObject();let d;for(const g of cs)if(e.indexOf(g)>=0){d=g;let p=0;for(const S in r)p+=this.matrix[S][g]*r[S],r[S]=0;us(c[g])&&(p+=c[g]);const C=Math.trunc(p);n[g]=C,r[g]=(p*1e3-C*1e3)/1e3}else us(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 Pg(this.matrix,n),wo(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 e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return wo(this,{values:e},!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(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,c){return r===void 0||r===0?c===void 0||c===0:r===c}for(const r of cs)if(!n(this.values[r],e.values[r]))return!1;return!0}}const Ys="Invalid Interval";function ES(t,e){return!t||!t.isValid?wn.invalid("missing or invalid start"):!e||!e.isValid?wn.invalid("missing or invalid end"):e<t?wn.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class wn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Interval is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new YT(r);return new wn({invalid:r})}static fromDateTimes(e,n){const r=Ul(e),c=Ul(n),d=ES(r,c);return d??new wn({start:r,end:c})}static after(e,n){const r=jt.fromDurationLike(n),c=Ul(e);return wn.fromDateTimes(c,c.plus(r))}static before(e,n){const r=jt.fromDurationLike(n),c=Ul(e);return wn.fromDateTimes(c.minus(r),c)}static fromISO(e,n){const[r,c]=(e||"").split("/",2);if(r&&c){let d,g;try{d=Dt.fromISO(r,n),g=d.isValid}catch{g=!1}let p,C;try{p=Dt.fromISO(c,n),C=p.isValid}catch{C=!1}if(g&&C)return wn.fromDateTimes(d,p);if(g){const S=jt.fromISO(c,n);if(S.isValid)return wn.after(d,S)}else if(C){const S=jt.fromISO(r,n);if(S.isValid)return wn.before(p,S)}}return wn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(e,n);let c;return n!=null&&n.useLocaleWeeks?c=this.end.reconfigure({locale:r.locale}):c=this.end,c=c.startOf(e,n),Math.floor(c.diff(r,e).get(e))+(c.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?wn.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Ul).filter(g=>this.contains(g)).sort((g,p)=>g.toMillis()-p.toMillis()),r=[];let{s:c}=this,d=0;for(;c<this.e;){const g=n[d]||this.e,p=+g>+this.e?this.e:g;r.push(wn.fromDateTimes(c,p)),c=p,d+=1}return r}splitBy(e){const n=jt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,c=1,d;const g=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(C=>C*c));d=+p>+this.e?this.e:p,g.push(wn.fromDateTimes(r,d)),r=d,c+=1}return g}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:wn.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return wn.fromDateTimes(n,r)}static merge(e){const[n,r]=e.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(e){let n=null,r=0;const c=[],d=e.map(C=>[{time:C.s,type:"s"},{time:C.e,type:"e"}]),g=Array.prototype.concat(...d),p=g.sort((C,S)=>C.time-S.time);for(const C of p)r+=C.type==="s"?1:-1,r===1?n=C.time:(n&&+n!=+C.time&&c.push(wn.fromDateTimes(n,C.time)),n=null);return wn.merge(c)}difference(...e){return wn.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ys}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=ac,n={}){return this.isValid?or.create(this.s.loc.clone(n),e).formatInterval(this):Ys}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ys}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ys}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ys}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:Ys}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):jt.invalid(this.invalidReason)}mapEndpoints(e){return wn.fromDateTimes(e(this.s),e(this.e))}}class Ja{static hasDST(e=bn.defaultZone){const n=Dt.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return no.isValidZone(e)}static normalizeZone(e){return Do(e,bn.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return en.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return en.create(n,null,"gregory").eras(e)}static features(){return{relative:Sm(),localeWeek:vm()}}}function $g(t,e){const n=c=>c.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(jt.fromMillis(r).as("days"))}function TS(t,e,n){const r=[["years",(C,S)=>S.year-C.year],["quarters",(C,S)=>S.quarter-C.quarter+(S.year-C.year)*4],["months",(C,S)=>S.month-C.month+(S.year-C.year)*12],["weeks",(C,S)=>{const x=$g(C,S);return(x-x%7)/7}],["days",$g]],c={},d=t;let g,p;for(const[C,S]of r)n.indexOf(C)>=0&&(g=C,c[C]=S(t,e),p=d.plus(c),p>e?(c[C]--,t=d.plus(c),t>e&&(p=t,c[C]--,t=d.plus(c))):t=p);return[t,c,p,g]}function xS(t,e,n,r){let[c,d,g,p]=TS(t,e,n);const C=e-c,S=n.filter(O=>["hours","minutes","seconds","milliseconds"].indexOf(O)>=0);S.length===0&&(g<e&&(g=c.plus({[p]:1})),g!==c&&(d[p]=(d[p]||0)+C/(g-c)));const x=jt.fromObject(d,r);return S.length>0?jt.fromMillis(C,r).shiftTo(...S).plus(x):x}const Rd={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Fg={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]},SS=Rd.hanidec.replace(/[\[|\]]/g,"").split("");function vS(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(t[n].search(Rd.hanidec)!==-1)e+=SS.indexOf(t[n]);else for(const c in Fg){const[d,g]=Fg[c];r>=d&&r<=g&&(e+=r-d)}}return parseInt(e,10)}else return e}function di({numberingSystem:t},e=""){return new RegExp(`${Rd[t||"latn"]}${e}`)}const wS="missing Intl.DateTimeFormat.formatToParts support";function Jt(t,e=n=>n){return{regex:t,deser:([n])=>e(vS(n))}}const OS=" ",zm=`[ ${OS}]`,Um=new RegExp(zm,"g");function DS(t){return t.replace(/\./g,"\\.?").replace(Um,zm)}function Bg(t){return t.replace(/\./g,"").replace(Um," ").toLowerCase()}function fi(t,e){return t===null?null:{regex:RegExp(t.map(DS).join("|")),deser:([n])=>t.findIndex(r=>Bg(n)===Bg(r))+e}}function Hg(t,e){return{regex:t,deser:([,n,r])=>Cc(n,r),groups:e}}function Xa(t){return{regex:t,deser:([e])=>e}}function MS(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function AS(t,e){const n=di(e),r=di(e,"{2}"),c=di(e,"{3}"),d=di(e,"{4}"),g=di(e,"{6}"),p=di(e,"{1,2}"),C=di(e,"{1,3}"),S=di(e,"{1,6}"),x=di(e,"{1,9}"),O=di(e,"{2,4}"),R=di(e,"{4,6}"),b=P=>({regex:RegExp(MS(P.val)),deser:([H])=>H,literal:!0}),w=(P=>{if(t.literal)return b(P);switch(P.val){case"G":return fi(e.eras("short"),0);case"GG":return fi(e.eras("long"),0);case"y":return Jt(S);case"yy":return Jt(O,Qu);case"yyyy":return Jt(d);case"yyyyy":return Jt(R);case"yyyyyy":return Jt(g);case"M":return Jt(p);case"MM":return Jt(r);case"MMM":return fi(e.months("short",!0),1);case"MMMM":return fi(e.months("long",!0),1);case"L":return Jt(p);case"LL":return Jt(r);case"LLL":return fi(e.months("short",!1),1);case"LLLL":return fi(e.months("long",!1),1);case"d":return Jt(p);case"dd":return Jt(r);case"o":return Jt(C);case"ooo":return Jt(c);case"HH":return Jt(r);case"H":return Jt(p);case"hh":return Jt(r);case"h":return Jt(p);case"mm":return Jt(r);case"m":return Jt(p);case"q":return Jt(p);case"qq":return Jt(r);case"s":return Jt(p);case"ss":return Jt(r);case"S":return Jt(C);case"SSS":return Jt(c);case"u":return Xa(x);case"uu":return Xa(p);case"uuu":return Jt(n);case"a":return fi(e.meridiems(),0);case"kkkk":return Jt(d);case"kk":return Jt(O,Qu);case"W":return Jt(p);case"WW":return Jt(r);case"E":case"c":return Jt(n);case"EEE":return fi(e.weekdays("short",!1),1);case"EEEE":return fi(e.weekdays("long",!1),1);case"ccc":return fi(e.weekdays("short",!0),1);case"cccc":return fi(e.weekdays("long",!0),1);case"Z":case"ZZ":return Hg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return Hg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return Xa(/[a-z_+-/]{1,256}?/i);case" ":return Xa(/[^\S\n\r]/);default:return b(P)}})(t)||{invalidReason:wS};return w.token=t,w}const RS={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 bS(t,e,n){const{type:r,value:c}=t;if(r==="literal"){const C=/^\s+$/.test(c);return{literal:!C,val:C?" ":c}}const d=e[r];let g=r;r==="hour"&&(e.hour12!=null?g=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?g="hour12":g="hour24":g=n.hour12?"hour12":"hour24");let p=RS[g];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function LS(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function kS(t,e,n){const r=t.match(e);if(r){const c={};let d=1;for(const g in n)if(Qs(n,g)){const p=n[g],C=p.groups?p.groups+1:1;!p.literal&&p.token&&(c[p.token.val[0]]=p.deser(r.slice(d,d+C))),d+=C}return[r,c]}else return[r,{}]}function IS(t){const e=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(t.z)||(n=no.create(t.z)),Lt(t.Z)||(n||(n=new ur(t.Z)),r=t.Z),Lt(t.q)||(t.M=(t.q-1)*3+1),Lt(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Lt(t.u)||(t.S=wd(t.u)),[Object.keys(t).reduce((d,g)=>{const p=e(g);return p&&(d[p]=t[g]),d},{}),n,r]}let Ru=null;function PS(){return Ru||(Ru=Dt.fromMillis(1555555555555)),Ru}function $S(t,e){if(t.literal)return t;const n=or.macroTokenToFormatOpts(t.val),r=jm(n,e);return r==null||r.includes(void 0)?t:r}function Gm(t,e){return Array.prototype.concat(...t.map(n=>$S(n,e)))}function Ym(t,e,n){const r=Gm(or.parseFormat(n),t),c=r.map(g=>AS(g,t)),d=c.find(g=>g.invalidReason);if(d)return{input:e,tokens:r,invalidReason:d.invalidReason};{const[g,p]=LS(c),C=RegExp(g,"i"),[S,x]=kS(e,C,p),[O,R,b]=x?IS(x):[null,null,void 0];if(Qs(x,"a")&&Qs(x,"H"))throw new Vs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:C,rawMatches:S,matches:x,result:O,zone:R,specificOffset:b}}}function FS(t,e,n){const{result:r,zone:c,specificOffset:d,invalidReason:g}=Ym(t,e,n);return[r,c,d,g]}function jm(t,e){if(!t)return null;const r=or.create(e,t).dtFormatter(PS()),c=r.formatToParts(),d=r.resolvedOptions();return c.map(g=>bS(g,t,d))}const bu="Invalid DateTime",Wg=864e13;function Qa(t){return new gi("unsupported zone",`the zone "${t.name}" is not supported`)}function Lu(t){return t.weekData===null&&(t.weekData=cc(t.c)),t.weekData}function ku(t){return t.localWeekData===null&&(t.localWeekData=cc(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function os(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Dt({...n,...e,old:n})}function Vm(t,e,n){let r=t-e*60*1e3;const c=n.offset(r);if(e===c)return[r,e];r-=(c-e)*60*1e3;const d=n.offset(r);return c===d?[r,c]:[t-Math.min(c,d)*60*1e3,Math.max(c,d)]}function ec(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function ic(t,e,n){return Vm(Nc(t),e,n)}function Kg(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),c=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,d={...t.c,year:r,month:c,day:Math.min(t.c.day,uc(r,c))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},g=jt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),p=Nc(d);let[C,S]=Vm(p,n,t.zone);return g!==0&&(C+=g,S=t.zone.offset(C)),{ts:C,o:S}}function zl(t,e,n,r,c,d){const{setZone:g,zone:p}=n;if(t&&Object.keys(t).length!==0||e){const C=e||p,S=Dt.fromObject(t,{...n,zone:C,specificOffset:d});return g?S:S.setZone(p)}else return Dt.invalid(new gi("unparsable",`the input "${c}" can't be parsed as ${r}`))}function tc(t,e,n=!0){return t.isValid?or.create(en.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Iu(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=Pn(t.c.year,n?6:4),e?(r+="-",r+=Pn(t.c.month),r+="-",r+=Pn(t.c.day)):(r+=Pn(t.c.month),r+=Pn(t.c.day)),r}function zg(t,e,n,r,c,d){let g=Pn(t.c.hour);return e?(g+=":",g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=":")):g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=Pn(t.c.second),(t.c.millisecond!==0||!r)&&(g+=".",g+=Pn(t.c.millisecond,3))),c&&(t.isOffsetFixed&&t.offset===0&&!d?g+="Z":t.o<0?(g+="-",g+=Pn(Math.trunc(-t.o/60)),g+=":",g+=Pn(Math.trunc(-t.o%60))):(g+="+",g+=Pn(Math.trunc(t.o/60)),g+=":",g+=Pn(Math.trunc(t.o%60)))),d&&(g+="["+t.zone.ianaName+"]"),g}const qm={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},BS={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},HS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Zm=["year","month","day","hour","minute","second","millisecond"],WS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],KS=["year","ordinal","hour","minute","second","millisecond"];function zS(t){const e={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"}[t.toLowerCase()];if(!e)throw new Xp(t);return e}function Ug(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return zS(t)}}function Gg(t,e){const n=Do(e.zone,bn.defaultZone),r=en.fromObject(e),c=bn.now();let d,g;if(Lt(t.year))d=c;else{for(const S of Zm)Lt(t[S])&&(t[S]=qm[S]);const p=Tm(t)||xm(t);if(p)return Dt.invalid(p);const C=n.offset(c);[d,g]=ic(t,C,n)}return new Dt({ts:d,zone:n,loc:r,o:g})}function Yg(t,e,n){const r=Lt(n.round)?!0:n.round,c=(g,p)=>(g=Od(g,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(g,p)),d=g=>n.calendary?e.hasSame(t,g)?0:e.startOf(g).diff(t.startOf(g),g).get(g):e.diff(t,g).get(g);if(n.unit)return c(d(n.unit),n.unit);for(const g of n.units){const p=d(g);if(Math.abs(p)>=1)return c(p,g)}return c(t>e?-0:0,n.units[n.units.length-1])}function jg(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class Dt{constructor(e){const n=e.zone||bn.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new gi("invalid input"):null)||(n.isValid?null:Qa(n));this.ts=Lt(e.ts)?bn.now():e.ts;let c=null,d=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[c,d]=[e.old.c,e.old.o];else{const p=n.offset(this.ts);c=ec(this.ts,p),r=Number.isNaN(c.year)?new gi("invalid input"):null,c=r?null:c,d=r?null:p}this._zone=n,this.loc=e.loc||en.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=c,this.o=d,this.isLuxonDateTime=!0}static now(){return new Dt({})}static local(){const[e,n]=jg(arguments),[r,c,d,g,p,C,S]=n;return Gg({year:r,month:c,day:d,hour:g,minute:p,second:C,millisecond:S},e)}static utc(){const[e,n]=jg(arguments),[r,c,d,g,p,C,S]=n;return e.zone=ur.utcInstance,Gg({year:r,month:c,day:d,hour:g,minute:p,second:C,millisecond:S},e)}static fromJSDate(e,n={}){const r=yx(e)?e.valueOf():NaN;if(Number.isNaN(r))return Dt.invalid("invalid input");const c=Do(n.zone,bn.defaultZone);return c.isValid?new Dt({ts:r,zone:c,loc:en.fromObject(n)}):Dt.invalid(Qa(c))}static fromMillis(e,n={}){if(us(e))return e<-Wg||e>Wg?Dt.invalid("Timestamp out of range"):new Dt({ts:e,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(us(e))return new Dt({ts:e*1e3,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=Do(n.zone,bn.defaultZone);if(!r.isValid)return Dt.invalid(Qa(r));const c=en.fromObject(n),d=dc(e,Ug),{minDaysInFirstWeek:g,startOfWeek:p}=Ag(d,c),C=bn.now(),S=Lt(n.specificOffset)?r.offset(C):n.specificOffset,x=!Lt(d.ordinal),O=!Lt(d.year),R=!Lt(d.month)||!Lt(d.day),b=O||R,T=d.weekYear||d.weekNumber;if((b||x)&&T)throw new Vs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(R&&x)throw new Vs("Can't mix ordinal dates with month/day");const w=T||d.weekday&&!b;let P,H,$=ec(C,S);w?(P=WS,H=BS,$=cc($,g,p)):x?(P=KS,H=HS,$=Au($)):(P=Zm,H=qm);let W=!1;for(const U of P){const q=d[U];Lt(q)?W?d[U]=H[U]:d[U]=$[U]:W=!0}const B=w?px(d,g,p):x?mx(d):Tm(d),K=B||xm(d);if(K)return Dt.invalid(K);const X=w?Dg(d,g,p):x?Mg(d):d,[ee,le]=ic(X,S,r),V=new Dt({ts:ee,zone:r,o:le,loc:c});return d.weekday&&b&&e.weekday!==V.weekday?Dt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${V.toISO()}`):V}static fromISO(e,n={}){const[r,c]=lS(e);return zl(r,c,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,c]=aS(e);return zl(r,c,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,c]=cS(e);return zl(r,c,n,"HTTP",n)}static fromFormat(e,n,r={}){if(Lt(e)||Lt(n))throw new xr("fromFormat requires an input string and a format");const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0}),[p,C,S,x]=FS(g,e,n);return x?Dt.invalid(x):zl(p,C,r,`format ${n}`,e,S)}static fromString(e,n,r={}){return Dt.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,c]=mS(e);return zl(r,c,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the DateTime is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new GT(r);return new Dt({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=jm(e,en.fromObject(n));return r?r.map(c=>c?c.val:null).join(""):null}static expandFormat(e,n={}){return Gm(or.parseFormat(e),en.fromObject(n)).map(c=>c.val).join("")}get(e){return this[e]}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?Lu(this).weekYear:NaN}get weekNumber(){return this.isValid?Lu(this).weekNumber:NaN}get weekday(){return this.isValid?Lu(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ku(this).weekday:NaN}get localWeekNumber(){return this.isValid?ku(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ku(this).weekYear:NaN}get ordinal(){return this.isValid?Au(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ja.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ja.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ja.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ja.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 e=864e5,n=6e4,r=Nc(this.c),c=this.zone.offset(r-e),d=this.zone.offset(r+e),g=this.zone.offset(r-c*n),p=this.zone.offset(r-d*n);if(g===p)return[this];const C=r-g*n,S=r-p*n,x=ec(C,g),O=ec(S,p);return x.hour===O.hour&&x.minute===O.minute&&x.second===O.second&&x.millisecond===O.millisecond?[os(this,{ts:C}),os(this,{ts:S})]:[this]}get isInLeapYear(){return ta(this.year)}get daysInMonth(){return uc(this.year,this.month)}get daysInYear(){return this.isValid?qs(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ql(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ql(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:c}=or.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:c}}toUTC(e=0,n={}){return this.setZone(ur.instance(e),n)}toLocal(){return this.setZone(bn.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=Do(e,bn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let c=this.ts;if(n||r){const d=e.offset(this.ts),g=this.toObject();[c]=ic(g,d,e)}return os(this,{ts:c,zone:e})}else return Dt.invalid(Qa(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const c=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return os(this,{loc:c})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=dc(e,Ug),{minDaysInFirstWeek:r,startOfWeek:c}=Ag(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),g=!Lt(n.ordinal),p=!Lt(n.year),C=!Lt(n.month)||!Lt(n.day),S=p||C,x=n.weekYear||n.weekNumber;if((S||g)&&x)throw new Vs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(C&&g)throw new Vs("Can't mix ordinal dates with month/day");let O;d?O=Dg({...cc(this.c,r,c),...n},r,c):Lt(n.ordinal)?(O={...this.toObject(),...n},Lt(n.day)&&(O.day=Math.min(uc(O.year,O.month),O.day))):O=Mg({...Au(this.c),...n});const[R,b]=ic(O,this.o,this.zone);return os(this,{ts:R,o:b})}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return os(this,Kg(this,n))}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e).negate();return os(this,Kg(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},c=jt.normalizeUnit(e);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(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?or.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):bu}toLocaleString(e=ac,n={}){return this.isValid?or.create(this.loc.clone(n),e).formatDateTime(this):bu}toLocaleParts(e={}){return this.isValid?or.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:c=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const g=e==="extended";let p=Iu(this,g);return p+="T",p+=zg(this,g,n,r,c,d),p}toISODate({format:e="extended"}={}){return this.isValid?Iu(this,e==="extended"):null}toISOWeekDate(){return tc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:c=!1,extendedZone:d=!1,format:g="extended"}={}){return this.isValid?(c?"T":"")+zg(this,g==="extended",n,e,r,d):null}toRFC2822(){return tc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return tc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Iu(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let c="HH:mm:ss.SSS";return(n||e)&&(r&&(c+=" "),n?c+="z":e&&(c+="ZZ")),tc(this,c,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():bu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.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(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return jt.invalid("created by diffing an invalid DateTime");const c={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Nx(n).map(jt.normalizeUnit),g=e.valueOf()>this.valueOf(),p=g?this:e,C=g?e:this,S=xS(p,C,d,c);return g?S.negate():S}diffNow(e="milliseconds",n={}){return this.diff(Dt.now(),e,n)}until(e){return this.isValid?wn.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;const c=e.valueOf(),d=this.setZone(e.zone,{keepLocalTime:!0});return d.startOf(n,r)<=c&&c<=d.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||Dt.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0;let c=["years","months","days","hours","minutes","seconds"],d=e.unit;return Array.isArray(e.unit)&&(c=e.unit,d=void 0),Yg(n,this.plus(r),{...e,numeric:"always",units:c,unit:d})}toRelativeCalendar(e={}){return this.isValid?Yg(e.base||Dt.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Dt.isDateTime))throw new xr("min requires all arguments be DateTimes");return Rg(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(Dt.isDateTime))throw new xr("max requires all arguments be DateTimes");return Rg(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});return Ym(g,e,n)}static fromStringExplain(e,n,r={}){return Dt.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return ac}static get DATE_MED(){return Qp}static get DATE_MED_WITH_WEEKDAY(){return VT}static get DATE_FULL(){return em}static get DATE_HUGE(){return tm}static get TIME_SIMPLE(){return nm}static get TIME_WITH_SECONDS(){return rm}static get TIME_WITH_SHORT_OFFSET(){return im}static get TIME_WITH_LONG_OFFSET(){return om}static get TIME_24_SIMPLE(){return sm}static get TIME_24_WITH_SECONDS(){return lm}static get TIME_24_WITH_SHORT_OFFSET(){return am}static get TIME_24_WITH_LONG_OFFSET(){return cm}static get DATETIME_SHORT(){return um}static get DATETIME_SHORT_WITH_SECONDS(){return dm}static get DATETIME_MED(){return fm}static get DATETIME_MED_WITH_SECONDS(){return hm}static get DATETIME_MED_WITH_WEEKDAY(){return qT}static get DATETIME_FULL(){return gm}static get DATETIME_FULL_WITH_SECONDS(){return pm}static get DATETIME_HUGE(){return mm}static get DATETIME_HUGE_WITH_SECONDS(){return _m}}function Ul(t){if(Dt.isDateTime(t))return t;if(t&&t.valueOf&&us(t.valueOf()))return Dt.fromJSDate(t);if(t&&typeof t=="object")return Dt.fromObject(t);throw new xr(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var Xt=(t=>(t.Monday="MONDAY",t.Tuesday="TUESDAY",t.Wednesday="WEDNESDAY",t.Thursday="THURSDAY",t.Friday="FRIDAY",t.Saturday="SATURDAY",t.Sunday="SUNDAY",t))(Xt||{});function bd(t){const e={1:Xt.Monday,2:Xt.Tuesday,3:Xt.Wednesday,4:Xt.Thursday,5:Xt.Friday,6:Xt.Saturday,7:Xt.Sunday};if(t.weekday in e)return e[t.weekday];throw new Error(`Invalid DateTime.weekday property: ${t}, ${t.weekday}`)}function $i(t){return{[Xt.Monday]:"Monday",[Xt.Tuesday]:"Tuesday",[Xt.Wednesday]:"Wednesday",[Xt.Thursday]:"Thursday",[Xt.Friday]:"Friday",[Xt.Saturday]:"Saturday",[Xt.Sunday]:"Sunday"}[t]}class Vg{constructor(e,n,r){Vn(this,"end");Vn(this,"start");this.end=e.setZone(r),this.start=e.setZone(r),[n.start,n.end].forEach(C=>{if(C.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(":"),[g,p]=n.end.split(":");this.end=this.end.set({hour:Number(g),minute:Number(p)}),this.start=this.start.set({hour:Number(c),minute:Number(d)}),this.end<this.start&&(this.end=this.end.plus({days:1})),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(e){return this.start<=e&&e<this.end}getStartTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(e||"en-US").toLocaleString(r)}getEndTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(e||"en-US").toLocaleString(r)}timeIsEqualTo(e){const n=this.getStartTime()===e.getStartTime(),r=this.getEndTime()===e.getEndTime();return n&&r}is24h(){const e=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 e&&n&&r}}class Jm{constructor(e,n){Vn(this,"holidayHoursByDate");Vn(this,"hours");Vn(this,"timezone");this.holidayHoursByDate=Object.fromEntries((e.holidayHours||[]).map(r=>[r.date,r])),this.hours=e,this.timezone=n}getInterval(e){if(this.isTemporarilyClosedAt(e))return null;let n=e;n=n.minus({days:1});for(const r of[n,e]){const c=this.getHours(r);if(c&&!c.isClosed)for(const d of c.openIntervals||[]){const g=new Vg(r,d,this.timezone);if(g.contains(e))return g}}return null}getCurrentInterval(){return this.getInterval(Dt.now())}getIntervalAfter(e){const n=this.getIntervalsForNDays(8,e),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(e)&&c.length>d+1)return c[d+1];for(const d of c)if(d.start>e)return d;return null}getIntervalsForNDays(e,n){const r=[];for(let c=0;c<e;c++){let d=n;d=d.plus({days:c});const g=this.getHours(d);g&&!g.isClosed&&r.push(...g.openIntervals.map(p=>new Vg(d,p,this.timezone)))}return r}getHolidayHours(e){return this.isTemporarilyClosedAt(e)?null:this.holidayHoursByDate[(e.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(e){if(this.isTemporarilyClosedAt(e))return null;const n=$i(bd(e)).toLowerCase();return this.hours[n]}getHours(e){const n=this.getHolidayHours(e);return!n||n.isRegularHours?this.getNormalHours(e):n}getNextInterval(){return this.getIntervalAfter(Dt.now())}isHoliday(e){return!!this.getHolidayHours(e)}isTemporarilyClosedAt(e){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,c,d]=n,g=Dt.fromObject({year:Number(r),month:Number(c),day:Number(d)},{zone:this.timezone});if(e<g)return!0}return!1}isOpenAt(e){return this.isTemporarilyClosedAt(e)?!1:!!this.getInterval(e)}isOpenNow(){return this.isOpenAt(Dt.now())}}function US(t,e){const n=[...t];return e=e%n.length,n.concat(n.splice(0,n.length-e))}function GS(t,e){if(t.length!==e.length)return!1;for(const[n,r]of t.entries())if(!r.timeIsEqualTo(e[n]))return!1;return!0}function ia(t){var e,n;return((n=(e=t==null?void 0:t.currentInterval)==null?void 0:e.is24h)==null?void 0:n.call(e))||!1}function oa(t){return!t.futureInterval}function YS(t){return ia(t)?at.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):oa(t)?at.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):at.jsx("span",{className:"HoursStatus-current",children:t.isOpen?"Open Now":"Closed"})}function jS(t){return ia(t)||oa(t)?null:at.jsx("span",{className:"HoursStatus-separator",children:" • "})}function VS(t){return ia(t)||oa(t)?null:at.jsx("span",{className:"HoursStatus-future",children:t.isOpen?"Closes at":"Opens at"})}function qS(t){if(ia(t)||oa(t))return null;let e="";if(t.isOpen){const n=t.currentInterval;e+=n?n.getEndTime("en-US",t.timeOptions):""}else{const n=t.futureInterval;e+=n?n.getStartTime("en-US",t.timeOptions):""}return at.jsxs("span",{className:"HoursStatus-time",children:[" ",e]})}function ZS(t){var r,c;if(ia(t)||oa(t))return null;const e={weekday:"long",...t.dayOptions??{}};let n="";if(t.isOpen){const d=t.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(e))||""}else{const d=t.futureInterval;n+=((c=d==null?void 0:d.start)==null?void 0:c.setLocale("en-US").toLocaleString(e))||""}return at.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function JS(t,e){const n=t.currentTemplate||YS,r=t.separatorTemplate||jS,c=t.futureTemplate||VS,d=t.timeTemplate||qS,g=t.dayOfWeekTemplate||ZS;return at.jsxs("div",{className:Xs("HoursStatus",(e==null?void 0:e.className)||""),children:[n(t),r(t),c(t),d(t),g(t)]})}const XS=t=>{const[e,n]=et.useState(!1),[r,c]=et.useState(!1);et.useEffect(()=>{c(!0)},[]);const d=t.statusTemplate||JS,g=new Jm(t.hours,t.timezone),p=g.isOpenNow(),C=g.getCurrentInterval(),S=g.getNextInterval(),x=(C==null?void 0:C.end)||(S==null?void 0:S.start);if(x&&!e){n(!0);const R=x.toMillis()-Dt.now().toMillis();setTimeout(()=>n(!1),R)}const O={isOpen:p,currentInterval:C,futureInterval:S,...t};return at.jsx(at.Fragment,{children:r&&d(O,t)})};function QS(t,e){const n=[];return t.forEach(r=>{const c=n[n.length-1];c?GS(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=e&&$i(r.startDay)in e?e[$i(r.startDay)]||"":$i(r.startDay),d=e&&$i(r.endDay)in e?e[$i(r.endDay)]||"":$i(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${c}`:`${c} - ${d}`}})}function ev(t,e){const n=[],r=t.intervals.length>0&&t.intervals[0].is24h();return t.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):t.intervals.forEach(c=>{const d=c.getStartTime("en-US",e),g=c.getEndTime("en-US",e);n.push(`${d} - ${g}`)}),n}function tv(t,e,n){const r=[];for(let c=1;c<=7;c++){const d=Dt.fromObject({weekday:c}),g=bd(d);r.push({startDay:g,endDay:g,dayName:n&&$i(g)in n?n[$i(g)]||"":$i(g),intervals:t.filter(p=>p.start.weekday===c),isToday:e.weekday===c})}return r}const nv=t=>{const[e,n]=et.useState(!1);et.useEffect(()=>{n(!0)},[]);const r=new Jm(t.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),c=Dt.now(),d=r.getIntervalsForNDays(7,c);let g=tv(d,c,t.dayOfWeekNames);function p(x){return x?{today:bd(c),monday:Xt.Monday,tuesday:Xt.Tuesday,wednesday:Xt.Wednesday,thursday:Xt.Thursday,friday:Xt.Friday,saturday:Xt.Saturday,sunday:Xt.Sunday}[x]:Xt.Sunday}let C=[Xt.Sunday,Xt.Monday,Xt.Tuesday,Xt.Wednesday,Xt.Thursday,Xt.Friday,Xt.Saturday];const S=C.indexOf(p(t.startOfWeek));return C=US(C,7-S),g.sort((x,O)=>C.indexOf(x.startDay)-C.indexOf(O.startDay)),t.collapseDays&&(g=QS(g,t.dayOfWeekNames)),at.jsx(at.Fragment,{children:e&&at.jsx("div",{className:Xs("HoursTable",t.className),children:g.map(x=>{const R=(t.intervalStringsBuilderFn||ev)(x,t.timeOptions);return at.jsxs("div",{className:Xs("HoursTable-row",{"is-today":x.isToday}),children:[at.jsx("span",{className:"HoursTable-day",children:x.dayName}),at.jsx("span",{className:"HoursTable-intervals",children:R.map((b,T)=>at.jsx("span",{className:"HoursTable-interval",children:b},T))})]},x.dayName)})})})},ed=Math.log2(1.6745627884839434),rv=4,iv=19,td="js-baidu-neg-lng-fix";let Xm;const ov=new Promise(t=>Xm=t),sv="https://api.map.baidu.com/geoconv/v1/";let Gl=[];const lv="gcj02ToBD09Callback_b872c21c";let av=0,qg;async function Qm(t){return await new Promise((e,n)=>{Gl.push({coordinates:t,resolve:e,reject:n}),Gl.length===1&&(qg=setTimeout(r,100)),Gl.length>40&&(clearTimeout(qg),r());function r(){const c=Gl;Gl=[];const d=[].concat(...c.map(C=>C.coordinates)),g=lv+"_"+av++,p=document.createElement("script");window[g]=C=>{if(C.status){const O=new Error(`Unable to convert coordinates to BD-09: Received status code ${C.status}${C.message?": "+C.message:""}`);c.forEach(R=>R.reject(O))}const S=C.result.map(O=>new tn(O.y,O.x));let x=0;c.forEach(O=>{O.resolve(S.slice(x,x+=O.coordinates.length))}),delete window[g],p.parentNode.removeChild(p)},ov.then(C=>{const S={ak:C,callback:g,coords:d.map(x=>`${x.longitude},${x.latitude}`).join(";"),from:3,to:5};p.src=sv+"?"+Object.entries(S).map(([x,O])=>x+"="+O).join("&"),document.head.appendChild(p)})}})}class cv extends nl{constructor(e){super(e);const n=!!(window.MSInputMethodContext&&document.documentMode);this._wrapper=e.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:e.controlEnabled,maxZoom:n?14:18,...e.providerOptions}),e.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.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper.dataset.baiduZoom=this.map.getZoom(),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()-ed}setCenter(e,n){this._centerReady=Qm([e]).then(([r])=>{const c=new BMap.Point(r.longitude,r.latitude);this.map.panTo(c,{noAnimation:!n})})}setZoom(e,n){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(e+ed)},{enableAnimation:n})})}}class uv extends fc{constructor(e){super(e),this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;const n=this;class r extends BMap.Marker{initialize(g){return n._wrapper=super.initialize(g),n._wrapper&&(n._wrapper.style.zIndex=n._zIndex,n._originalWrapperClass=n._wrapper.getAttribute("class"),n._wrapper.setAttribute("class",n._getClass()),n._wrapper.appendChild(n._element),n.addListeners()),n._wrapper}draw(){if(n._wrapper){const g=n._wrapper.style.zIndex;super.draw(),n._wrapper.style.height="",n._wrapper.style.width="",n._wrapper.style.pointerEvents="none",n._wrapper.style.zIndex=g}else super.draw()}}this.pin=new r(new BMap.Point(0,0));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.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(e){this._coordinateReady=Qm([e]).then(([n])=>{this._negativeLngFix=n.longitude<0,this.pin.setPosition(new BMap.Point(n.longitude+(this._negativeLngFix?180:0),n.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](td)})}setMap(e,n){this._coordinateReady.then(()=>{n&&n.getProviderMap().map.removeOverlay(this.pin),e&&e.getProviderMap().map.addOverlay(this.pin)})}setProperties(e){super.setProperties(e),this._wrapperClass=e.getClass(),this._element=e.getElement()||this._pinEl,this._zIndex=e.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?td:""} ${this._wrapperClass}`}}const dv="https://api.map.baidu.com/getscript";function fv(t,e,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};Xm(d);const p=document.createElement("script");p.src=dv+"?"+Object.entries(g).map(([x,O])=>x+"="+O).join("&"),p.onload=()=>t(),document.head.appendChild(p);let C="";for(let x=rv;x<=iv;x++){const O=2**(x-ed+7);C+=`[data-baidu-zoom="${x}"] .${td}{transform:translateX(-${O}px);}`}const S=document.createElement("style");S.appendChild(document.createTextNode(C)),document.head.appendChild(S)}const hv=new ds().withLoadFunction(fv).withMapClass(cv).withPinClass(uv).withProviderName("Baidu").build();let e_;function gv(){class t extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1}),this._container=document.createElement("div"),this._map=null,this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(n){this._pins.add(n),n._wrapper.style.position="absolute",this._container.appendChild(n._wrapper),this._map&&this.updatePinPosition(n)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(n){this._pins.delete(n),this._container.removeChild(n._wrapper)}updatePinPosition(n){if(!this._map)return;const r=this._map.tryLocationToPixel(n._location,Microsoft.Maps.PixelReference.control);n._wrapper.style.left=r.x+"px",n._wrapper.style.top=r.y+"px"}updatePinPositions(){this._pins.forEach(n=>this.updatePinPosition(n))}}e_=t}class pv extends nl{constructor(e){super(e),this.wrapper=e.wrapper,this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!e.controlEnabled,disableZooming:!e.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...e.providerOptions}),this.pinOverlay=new e_(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(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new Microsoft.Maps.Location(e.latitude,e.longitude);this.map.setView({center:r}),this.pinOverlay.updatePinPositions()}setZoom(e,n){this.map.setView({zoom:Math.floor(e)}),this.pinOverlay.updatePinPositions()}}class mv extends fc{static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}constructor(e){super(e),this._map=null,this._location=new Microsoft.Maps.Location(0,0)}setCoordinate(e){this._location=new Microsoft.Maps.Location(e.latitude,e.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(e,n){n&&n.getProviderMap().pinOverlay.removePin(this),e&&e.getProviderMap().pinOverlay.addPin(this),this._map=e}}const Zg="BingMapsCallback_593d7d33",_v="https://www.bing.com/api/maps/mapcontrol";function yv(t,e,n,{params:r={}}={}){window[Zg]=()=>{gv(),t()};const c={callback:Zg,key:n,...r};sp(_v+"?"+Object.entries(c).map(([d,g])=>d+"="+g).join("&"))}const Nv=new ds().withLoadFunction(yv).withMapClass(pv).withPinClass(mv).withProviderName("Bing").build();class Cv extends nl{constructor(e){if(super(e),this.map=new mapboxgl.Map({container:e.wrapper,interactive:e.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...e.providerOptions}),e.controlEnabled){const n=new mapboxgl.NavigationControl({showCompass:!1});this.map.addControl(n)}this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()+1}setCenter(e,n){const r=new mapboxgl.LngLat(e.longitude,e.latitude);this.map[n?"panTo":"setCenter"](r)}setZoom(e,n){this.map[n?"zoomTo":"setZoom"](e-1)}setZoomCenter(e,n,r){const c=new mapboxgl.LngLat(n.longitude,n.latitude);this.map[r?"easeTo":"jumpTo"]({center:c,zoom:e-1})}}class Ev extends fc{constructor(e){super(e),this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper})}setCoordinate(e){this.pin.setLngLat(new mapboxgl.LngLat(e.longitude,e.latitude))}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}}function Tv(t,e,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=()=>{mapboxgl.accessToken=n,t()},document.head.appendChild(d),document.head.appendChild(g)}const xv=new ds().withLoadFunction(Tv).withMapClass(Cv).withPinClass(Ev).withProviderName("Mapbox").build();let t_=class extends nl{constructor(e){super(e),this._initMap(e),e.controlEnabled&&this.map.zoomControl.setPosition("topright"),this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new L.latLng(e.latitude,e.longitude);this.map.panTo(r,{animate:n})}setZoom(e,n){this.map.setZoom(e,{animate:n})}setZoomCenter(e,n,r){const c=new L.latLng(n.latitude,n.longitude);this.map.setView(c,e,{animate:r})}_initMap(e){this.map=new L.map(e.wrapper,{boxZoom:e.controlEnabled,doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions});const n=e.providerOptions,r=n.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",c=n.tileLayerOptions||{attribution:'Map data &copy; <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"};c.accessToken=this.constructor.apiKey,L.tileLayer(r,c).addTo(this.map)}},Sv=class extends ld{constructor(e){super(e),this.pin=new L.marker,this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(e){const n=new L.latLng(e.latitude,e.longitude);this.pin.setLatLng(n)}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}setProperties(e){const n=e.getWidth(),r=e.getHeight(),c=e.getAnchorX(),d=e.getAnchorY();this.pin.setIcon(new L.icon({iconUrl:this._icons[e.getIcon()],iconSize:[n,r],iconAnchor:[c*n,d*r],className:e.getClass()})),this.pin.setZIndexOffset(e.getZIndex())}};function vv(t,e,n,{version:r="1.7.1"}={}){const c=`https://unpkg.com/leaflet@${r}/dist/leaflet`;t_.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=()=>t(),document.head.appendChild(d),document.head.appendChild(g)}const Ld=new ds().withLoadFunction(vv).withMapClass(t_).withPinClass(Sv).withProviderName("Leaflet").build(),wv=Ld.getMapClass(),Ov=Ld.getPinClass();class Dv extends wv{_initMap(e){this.map=L.mapquest.map(e.wrapper,{boxZoom:e.controlEnabled,center:new L.latLng(0,0),doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions})}}class Mv extends Ov{}function Av(t,e,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,t()},document.head.appendChild(d),document.head.appendChild(g)}const Rv=new ds().withLoadFunction(Av).withMapClass(Dv).withPinClass(Mv).withProviderName("MapQuest").build();exports.Address=j_;exports.Analytics=tp;exports.AnalyticsContext=od;exports.AnalyticsProvider=Yy;exports.AnalyticsScopeProvider=Wy;exports.BaiduMaps=hv;exports.BingMaps=Nv;exports.Clusterer=NN;exports.Coordinate=tn;exports.Day=Xt;exports.GoogleMaps=cp;exports.HoursStatus=XS;exports.HoursTable=nv;exports.Image=Jy;exports.ImageLayoutOption=Mo;exports.LeafletMaps=Ld;exports.LegacyRichText=UT;exports.LexicalRichText=nE;exports.Link=op;exports.LinkTypes=rN;exports.ListingPublisherOption=Jg;exports.LocationMap=TN;exports.Map=fp;exports.MapProviderOption=$u;exports.MapQuestMaps=Rv;exports.MapboxMaps=xv;exports.Marker=ud;exports.asciiAlpha=fE;exports.asciiAlphanumeric=ju;exports.asciiAtext=hE;exports.asciiControl=gE;exports.asciiDigit=pE;exports.asciiHexDigit=mE;exports.asciiPunctuation=_E;exports.c=Xs;exports.classifyCharacter=Xl;exports.combineExtensions=$p;exports.createState=bT;exports.getDefaultExportFromCjs=rd;exports.getDirections=K_;exports.getRuntime=Js;exports.jsxRuntimeExports=at;exports.markdownLineEnding=yE;exports.markdownLineEndingOrSpace=Up;exports.markdownSpace=NE;exports.normalizeUri=il;exports.push=js;exports.resolveAll=Gp;exports.splice=gc;exports.useAnalytics=tl;exports.useClusterContext=yN;exports.useIdentify=Uy;exports.useMapContext=mN;exports.usePageView=zy;exports.useScope=sd;exports.useTrack=Ky;exports.visit=xd;
104
+ `}),n}const $T=(t,e)=>t(e,"i",ro(t,e)),FT=(t,e)=>t(e,"b",ro(t,e)),BT=(t,e)=>t(e,"u",ro(t,e)),HT=(t,e)=>t(e,"s",ro(t,e)),WT=(t,e)=>t(e,"sub",ro(t,e)),KT=(t,e)=>t(e,"sup",ro(t,e)),zT={emphasis:$T,strong:FT,underline:BT,strikethrough:HT,subscript:WT,superscript:KT},UT=t=>{const[e,n]=et.useState();let r;return et.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-BaREGJWP.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:t.markdown,remarkPlugins:[VE],remarkRehypeOptions:{handlers:zT}});n(d)})()},[t.markdown]),e||null};class hs extends Error{}class GT extends hs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class YT extends hs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class jT extends hs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Vs extends hs{}class tm extends hs{constructor(e){super(`Invalid unit ${e}`)}}class xr extends hs{}class vo extends hs{constructor(){super("Zone is an abstract class")}}const it="numeric",pi="short",Lr="long",cc={year:it,month:it,day:it},nm={year:it,month:pi,day:it},VT={year:it,month:pi,day:it,weekday:pi},rm={year:it,month:Lr,day:it},im={year:it,month:Lr,day:it,weekday:Lr},om={hour:it,minute:it},sm={hour:it,minute:it,second:it},lm={hour:it,minute:it,second:it,timeZoneName:pi},am={hour:it,minute:it,second:it,timeZoneName:Lr},cm={hour:it,minute:it,hourCycle:"h23"},um={hour:it,minute:it,second:it,hourCycle:"h23"},dm={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:pi},fm={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:Lr},hm={year:it,month:it,day:it,hour:it,minute:it},gm={year:it,month:it,day:it,hour:it,minute:it,second:it},pm={year:it,month:pi,day:it,hour:it,minute:it},mm={year:it,month:pi,day:it,hour:it,minute:it,second:it},qT={year:it,month:pi,day:it,weekday:pi,hour:it,minute:it},_m={year:it,month:Lr,day:it,hour:it,minute:it,timeZoneName:pi},ym={year:it,month:Lr,day:it,hour:it,minute:it,second:it,timeZoneName:pi},Nm={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,timeZoneName:Lr},Cm={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,second:it,timeZoneName:Lr};class ea{get type(){throw new vo}get name(){throw new vo}get ianaName(){return this.name}get isUniversal(){throw new vo}offsetName(e,n){throw new vo}formatOffset(e,n){throw new vo}offset(e){throw new vo}equals(e){throw new vo}get isValid(){throw new vo}}let Mu=null;class yc extends ea{static get instance(){return Mu===null&&(Mu=new yc),Mu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return Mm(e,n,r)}formatOffset(e,n){return Zl(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let rc={};function ZT(t){return rc[t]||(rc[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),rc[t]}const JT={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function XT(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,c,d,g,p,C,S,T]=r;return[g,c,d,p,C,S,T]}function QT(t,e){const n=t.formatToParts(e),r=[];for(let c=0;c<n.length;c++){const{type:d,value:g}=n[c],p=JT[d];d==="era"?r[p]=g:Lt(p)||(r[p]=parseInt(g,10))}return r}let qa={};class no extends ea{static create(e){return qa[e]||(qa[e]=new no(e)),qa[e]}static resetCache(){qa={},rc={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=no.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return Mm(e,n,r,this.name)}formatOffset(e,n){return Zl(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const r=ZT(this.name);let[c,d,g,p,C,S,T]=r.formatToParts?QT(r,n):XT(r,n);p==="BC"&&(c=-Math.abs(c)+1);const R=Cc({year:c,month:d,day:g,hour:C===24?0:C,minute:S,second:T,millisecond:0});let b=+n;const x=b%1e3;return b-=x>=0?x:1e3+x,(R-b)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Eg={};function ex(t,e={}){const n=JSON.stringify([t,e]);let r=Eg[n];return r||(r=new Intl.ListFormat(t,e),Eg[n]=r),r}let qu={};function Zu(t,e={}){const n=JSON.stringify([t,e]);let r=qu[n];return r||(r=new Intl.DateTimeFormat(t,e),qu[n]=r),r}let Ju={};function tx(t,e={}){const n=JSON.stringify([t,e]);let r=Ju[n];return r||(r=new Intl.NumberFormat(t,e),Ju[n]=r),r}let Xu={};function nx(t,e={}){const{base:n,...r}=e,c=JSON.stringify([t,r]);let d=Xu[c];return d||(d=new Intl.RelativeTimeFormat(t,e),Xu[c]=d),d}let jl=null;function rx(){return jl||(jl=new Intl.DateTimeFormat().resolvedOptions().locale,jl)}let Tg={};function ix(t){let e=Tg[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Tg[t]=e}return e}function ox(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let r,c;try{r=Zu(t).resolvedOptions(),c=t}catch{const C=t.substring(0,n);r=Zu(C).resolvedOptions(),c=C}const{numberingSystem:d,calendar:g}=r;return[c,d,g]}}function sx(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function lx(t){const e=[];for(let n=1;n<=12;n++){const r=Dt.utc(2009,n,1);e.push(t(r))}return e}function ax(t){const e=[];for(let n=1;n<=7;n++){const r=Dt.utc(2016,11,13+n);e.push(t(r))}return e}function Za(t,e,n,r){const c=t.listingMode();return c==="error"?null:c==="en"?n(e):r(e)}function cx(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class ux{constructor(e,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 p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=tx(e,p)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):Dd(e,3);return Pn(n,this.padTo)}}}class dx{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let c;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const g=-1*(e.offset/60),p=g>=0?`Etc/GMT+${g}`:`Etc/GMT${g}`;e.offset!==0&&no.create(p).valid?(c=p,this.dt=e):(c="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,c=e.zone.name):(c="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const d={...this.opts};d.timeZone=d.timeZone||c,this.dtf=Zu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.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}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class fx{constructor(e,n,r){this.opts={style:"long",...r},!n&&Om()&&(this.rtf=nx(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):bx(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const hx={firstDay:1,minimalDays:4,weekend:[6,7]};class en{static fromOpts(e){return en.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,c,d=!1){const g=e||bn.defaultLocale,p=g||(d?"en-US":rx()),C=n||bn.defaultNumberingSystem,S=r||bn.defaultOutputCalendar,T=Qu(c)||bn.defaultWeekSettings;return new en(p,C,S,T,g)}static resetCache(){jl=null,qu={},Ju={},Xu={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:c}={}){return en.create(e,n,r,c)}constructor(e,n,r,c,d){const[g,p,C]=ox(e);this.locale=g,this.numberingSystem=n||p||null,this.outputCalendar=r||C||null,this.weekSettings=c,this.intl=sx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=cx(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:en.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Qu(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Za(this,e,bm,()=>{const r=n?{month:e,day:"numeric"}:{month:e},c=n?"format":"standalone";return this.monthsCache[c][e]||(this.monthsCache[c][e]=lx(d=>this.extract(d,r,"month"))),this.monthsCache[c][e]})}weekdays(e,n=!1){return Za(this,e,Im,()=>{const r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},c=n?"format":"standalone";return this.weekdaysCache[c][e]||(this.weekdaysCache[c][e]=ax(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[c][e]})}meridiems(){return Za(this,void 0,()=>Pm,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Dt.utc(2016,11,13,9),Dt.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Za(this,e,$m,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[Dt.utc(-40,1,1),Dt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){const c=this.dtFormatter(e,n),d=c.formatToParts(),g=d.find(p=>p.type.toLowerCase()===r);return g?g.value:null}numberFormatter(e={}){return new ux(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new dx(e,this.intl,n)}relFormatter(e={}){return new fx(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ex(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Dm()?ix(this.locale):hx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let Au=null;class ur extends ea{static get utcInstance(){return Au===null&&(Au=new ur(0)),Au}static instance(e){return e===0?ur.utcInstance:new ur(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ur(Ec(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Zl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Zl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Zl(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class gx extends ea{constructor(e){super(),this.zoneName=e}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 Do(t,e){if(Lt(t)||t===null)return e;if(t instanceof ea)return t;if(_x(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?yc.instance:n==="utc"||n==="gmt"?ur.utcInstance:ur.parseSpecifier(n)||no.create(t)}else return us(t)?ur.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new gx(t)}let xg=()=>Date.now(),Sg="system",vg=null,wg=null,Og=null,Dg=60,Mg,Ag=null;class bn{static get now(){return xg}static set now(e){xg=e}static set defaultZone(e){Sg=e}static get defaultZone(){return Do(Sg,yc.instance)}static get defaultLocale(){return vg}static set defaultLocale(e){vg=e}static get defaultNumberingSystem(){return wg}static set defaultNumberingSystem(e){wg=e}static get defaultOutputCalendar(){return Og}static set defaultOutputCalendar(e){Og=e}static get defaultWeekSettings(){return Ag}static set defaultWeekSettings(e){Ag=Qu(e)}static get twoDigitCutoffYear(){return Dg}static set twoDigitCutoffYear(e){Dg=e%100}static get throwOnInvalid(){return Mg}static set throwOnInvalid(e){Mg=e}static resetCaches(){en.resetCache(),no.resetCache()}}class gi{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Em=[0,31,59,90,120,151,181,212,243,273,304,334],Tm=[0,31,60,91,121,152,182,213,244,274,305,335];function Vr(t,e){return new gi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function vd(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const c=r.getUTCDay();return c===0?7:c}function xm(t,e,n){return n+(ta(t)?Tm:Em)[e-1]}function Sm(t,e){const n=ta(t)?Tm:Em,r=n.findIndex(d=>d<e),c=e-n[r];return{month:r+1,day:c}}function wd(t,e){return(t-e+7)%7+1}function uc(t,e=4,n=1){const{year:r,month:c,day:d}=t,g=xm(r,c,d),p=wd(vd(r,c,d),n);let C=Math.floor((g-p+14-e)/7),S;return C<1?(S=r-1,C=Ql(S,e,n)):C>Ql(r,e,n)?(S=r+1,C=1):S=r,{weekYear:S,weekNumber:C,weekday:p,...Tc(t)}}function Rg(t,e=4,n=1){const{weekYear:r,weekNumber:c,weekday:d}=t,g=wd(vd(r,1,e),n),p=qs(r);let C=c*7+d-g-7+e,S;C<1?(S=r-1,C+=qs(S)):C>p?(S=r+1,C-=qs(r)):S=r;const{month:T,day:O}=Sm(S,C);return{year:S,month:T,day:O,...Tc(t)}}function Ru(t){const{year:e,month:n,day:r}=t,c=xm(e,n,r);return{year:e,ordinal:c,...Tc(t)}}function bg(t){const{year:e,ordinal:n}=t,{month:r,day:c}=Sm(e,n);return{year:e,month:r,day:c,...Tc(t)}}function Lg(t,e){if(!Lt(t.localWeekday)||!Lt(t.localWeekNumber)||!Lt(t.localWeekYear)){if(!Lt(t.weekday)||!Lt(t.weekNumber)||!Lt(t.weekYear))throw new Vs("Cannot mix locale-based week fields with ISO-based week fields");return Lt(t.localWeekday)||(t.weekday=t.localWeekday),Lt(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Lt(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function px(t,e=4,n=1){const r=Nc(t.weekYear),c=qr(t.weekNumber,1,Ql(t.weekYear,e,n)),d=qr(t.weekday,1,7);return r?c?d?!1:Vr("weekday",t.weekday):Vr("week",t.weekNumber):Vr("weekYear",t.weekYear)}function mx(t){const e=Nc(t.year),n=qr(t.ordinal,1,qs(t.year));return e?n?!1:Vr("ordinal",t.ordinal):Vr("year",t.year)}function vm(t){const e=Nc(t.year),n=qr(t.month,1,12),r=qr(t.day,1,dc(t.year,t.month));return e?n?r?!1:Vr("day",t.day):Vr("month",t.month):Vr("year",t.year)}function wm(t){const{hour:e,minute:n,second:r,millisecond:c}=t,d=qr(e,0,23)||e===24&&n===0&&r===0&&c===0,g=qr(n,0,59),p=qr(r,0,59),C=qr(c,0,999);return d?g?p?C?!1:Vr("millisecond",c):Vr("second",r):Vr("minute",n):Vr("hour",e)}function Lt(t){return typeof t>"u"}function us(t){return typeof t=="number"}function Nc(t){return typeof t=="number"&&t%1===0}function _x(t){return typeof t=="string"}function yx(t){return Object.prototype.toString.call(t)==="[object Date]"}function Om(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Dm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Nx(t){return Array.isArray(t)?t:[t]}function kg(t,e,n){if(t.length!==0)return t.reduce((r,c)=>{const d=[e(c),c];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function Cx(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function Qs(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Qu(t){if(t==null)return null;if(typeof t!="object")throw new xr("Week settings must be an object");if(!qr(t.firstDay,1,7)||!qr(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!qr(e,1,7)))throw new xr("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function qr(t,e,n){return Nc(t)&&t>=e&&t<=n}function Ex(t,e){return t-e*Math.floor(t/e)}function Pn(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Oo(t){if(!(Lt(t)||t===null||t===""))return parseInt(t,10)}function is(t){if(!(Lt(t)||t===null||t===""))return parseFloat(t)}function Od(t){if(!(Lt(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Dd(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function ta(t){return t%4===0&&(t%100!==0||t%400===0)}function qs(t){return ta(t)?366:365}function dc(t,e){const n=Ex(e-1,12)+1,r=t+(e-n)/12;return n===2?ta(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Cc(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Ig(t,e,n){return-wd(vd(t,1,e),n)+e-1}function Ql(t,e=4,n=1){const r=Ig(t,e,n),c=Ig(t+1,e,n);return(qs(t)-r+c)/7}function ed(t){return t>99?t:t>bn.twoDigitCutoffYear?1900+t:2e3+t}function Mm(t,e,n,r=null){const c=new Date(t),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const g={timeZoneName:e,...d},p=new Intl.DateTimeFormat(n,g).formatToParts(c).find(C=>C.type.toLowerCase()==="timezonename");return p?p.value:null}function Ec(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,c=n<0||Object.is(n,-0)?-r:r;return n*60+c}function Am(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new xr(`Invalid unit value ${t}`);return e}function fc(t,e){const n={};for(const r in t)if(Qs(t,r)){const c=t[r];if(c==null)continue;n[e(r)]=Am(c)}return n}function Zl(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),c=t>=0?"+":"-";switch(e){case"short":return`${c}${Pn(n,2)}:${Pn(r,2)}`;case"narrow":return`${c}${n}${r>0?`:${r}`:""}`;case"techie":return`${c}${Pn(n,2)}${Pn(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Tc(t){return Cx(t,["hour","minute","second","millisecond"])}const Tx=["January","February","March","April","May","June","July","August","September","October","November","December"],Rm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xx=["J","F","M","A","M","J","J","A","S","O","N","D"];function bm(t){switch(t){case"narrow":return[...xx];case"short":return[...Rm];case"long":return[...Tx];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 Lm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],km=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Sx=["M","T","W","T","F","S","S"];function Im(t){switch(t){case"narrow":return[...Sx];case"short":return[...km];case"long":return[...Lm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Pm=["AM","PM"],vx=["Before Christ","Anno Domini"],wx=["BC","AD"],Ox=["B","A"];function $m(t){switch(t){case"narrow":return[...Ox];case"short":return[...wx];case"long":return[...vx];default:return null}}function Dx(t){return Pm[t.hour<12?0:1]}function Mx(t,e){return Im(e)[t.weekday-1]}function Ax(t,e){return bm(e)[t.month-1]}function Rx(t,e){return $m(e)[t.year<0?0:1]}function bx(t,e,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(t)===-1;if(n==="auto"&&d){const O=t==="days";switch(e){case 1:return O?"tomorrow":`next ${c[t][0]}`;case-1:return O?"yesterday":`last ${c[t][0]}`;case 0:return O?"today":`this ${c[t][0]}`}}const g=Object.is(e,-0)||e<0,p=Math.abs(e),C=p===1,S=c[t],T=r?C?S[1]:S[2]||S[1]:C?c[t][0]:t;return g?`${p} ${T} ago`:`in ${p} ${T}`}function Pg(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const Lx={D:cc,DD:nm,DDD:rm,DDDD:im,t:om,tt:sm,ttt:lm,tttt:am,T:cm,TT:um,TTT:dm,TTTT:fm,f:hm,ff:pm,fff:_m,ffff:Nm,F:gm,FF:mm,FFF:ym,FFFF:Cm};class or{static create(e,n={}){return new or(e,n)}static parseFormat(e){let n=null,r="",c=!1;const d=[];for(let g=0;g<e.length;g++){const p=e.charAt(g);p==="'"?(r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),n=null,r="",c=!c):c||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(e){return Lx[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return Pn(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(b,x)=>this.loc.extract(e,b,x),g=b=>e.isOffsetFixed&&e.offset===0&&b.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,b.format):"",p=()=>r?Dx(e):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),C=(b,x)=>r?Ax(e,b):d(x?{month:b}:{month:b,day:"numeric"},"month"),S=(b,x)=>r?Mx(e,b):d(x?{weekday:b}:{weekday:b,month:"long",day:"numeric"},"weekday"),T=b=>{const x=or.macroTokenToFormatOpts(b);return x?this.formatWithSystemDefault(e,x):b},O=b=>r?Rx(e,b):d({era:b},"era"),R=b=>{switch(b){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.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 e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return p();case"d":return c?d({day:"numeric"},"day"):this.num(e.day);case"dd":return c?d({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return S("short",!0);case"cccc":return S("long",!0);case"ccccc":return S("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return S("short",!1);case"EEEE":return S("long",!1);case"EEEEE":return S("narrow",!1);case"L":return c?d({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return c?d({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return C("short",!0);case"LLLL":return C("long",!0);case"LLLLL":return C("narrow",!0);case"M":return c?d({month:"numeric"},"month"):this.num(e.month);case"MM":return c?d({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return C("short",!1);case"MMMM":return C("long",!1);case"MMMMM":return C("narrow",!1);case"y":return c?d({year:"numeric"},"year"):this.num(e.year);case"yy":return c?d({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return c?d({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return c?d({year:"numeric"},"year"):this.num(e.year,6);case"G":return O("short");case"GG":return O("long");case"GGGGG":return O("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return T(b)}};return Pg(or.parseFormat(n),R)}formatDurationFromString(e,n){const r=C=>{switch(C[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=C=>S=>{const T=r(S);return T?this.num(C.get(T),S.length):S},d=or.parseFormat(n),g=d.reduce((C,{literal:S,val:T})=>S?C:C.concat(T),[]),p=e.shiftTo(...g.map(r).filter(C=>C));return Pg(d,c(p))}}const Fm=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ol(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function sl(...t){return e=>t.reduce(([n,r,c],d)=>{const[g,p,C]=d(e,c);return[{...n,...g},p||r,C]},[{},null,1]).slice(0,2)}function ll(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const c=n.exec(t);if(c)return r(c)}return[null,null]}function Bm(...t){return(e,n)=>{const r={};let c;for(c=0;c<t.length;c++)r[t[c]]=Oo(e[n+c]);return[r,null,n+c]}}const Hm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,kx=`(?:${Hm.source}?(?:\\[(${Fm.source})\\])?)?`,Md=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Wm=RegExp(`${Md.source}${kx}`),Ad=RegExp(`(?:T${Wm.source})?`),Ix=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Px=/(\d{4})-?W(\d\d)(?:-?(\d))?/,$x=/(\d{4})-?(\d{3})/,Fx=Bm("weekYear","weekNumber","weekDay"),Bx=Bm("year","ordinal"),Hx=/(\d{4})-(\d\d)-(\d\d)/,Km=RegExp(`${Md.source} ?(?:${Hm.source}|(${Fm.source}))?`),Wx=RegExp(`(?: ${Km.source})?`);function Zs(t,e,n){const r=t[e];return Lt(r)?n:Oo(r)}function Kx(t,e){return[{year:Zs(t,e),month:Zs(t,e+1,1),day:Zs(t,e+2,1)},null,e+3]}function al(t,e){return[{hours:Zs(t,e,0),minutes:Zs(t,e+1,0),seconds:Zs(t,e+2,0),milliseconds:Od(t[e+3])},null,e+4]}function na(t,e){const n=!t[e]&&!t[e+1],r=Ec(t[e+1],t[e+2]),c=n?null:ur.instance(r);return[{},c,e+3]}function ra(t,e){const n=t[e]?no.create(t[e]):null;return[{},n,e+1]}const zx=RegExp(`^T?${Md.source}$`),Ux=/^-?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 Gx(t){const[e,n,r,c,d,g,p,C,S]=t,T=e[0]==="-",O=C&&C[0]==="-",R=(b,x=!1)=>b!==void 0&&(x||b&&T)?-b:b;return[{years:R(is(n)),months:R(is(r)),weeks:R(is(c)),days:R(is(d)),hours:R(is(g)),minutes:R(is(p)),seconds:R(is(C),C==="-0"),milliseconds:R(Od(S),O)}]}const Yx={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 Rd(t,e,n,r,c,d,g){const p={year:e.length===2?ed(Oo(e)):Oo(e),month:Rm.indexOf(n)+1,day:Oo(r),hour:Oo(c),minute:Oo(d)};return g&&(p.second=Oo(g)),t&&(p.weekday=t.length>3?Lm.indexOf(t)+1:km.indexOf(t)+1),p}const jx=/^(?:(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 Vx(t){const[,e,n,r,c,d,g,p,C,S,T,O]=t,R=Rd(e,c,r,n,d,g,p);let b;return C?b=Yx[C]:S?b=0:b=Ec(T,O),[R,new ur(b)]}function qx(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Zx=/^(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$/,Jx=/^(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$/,Xx=/^(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 $g(t){const[,e,n,r,c,d,g,p]=t;return[Rd(e,c,r,n,d,g,p),ur.utcInstance]}function Qx(t){const[,e,n,r,c,d,g,p]=t;return[Rd(e,p,n,r,c,d,g),ur.utcInstance]}const eS=ol(Ix,Ad),tS=ol(Px,Ad),nS=ol($x,Ad),rS=ol(Wm),zm=sl(Kx,al,na,ra),iS=sl(Fx,al,na,ra),oS=sl(Bx,al,na,ra),sS=sl(al,na,ra);function lS(t){return ll(t,[eS,zm],[tS,iS],[nS,oS],[rS,sS])}function aS(t){return ll(qx(t),[jx,Vx])}function cS(t){return ll(t,[Zx,$g],[Jx,$g],[Xx,Qx])}function uS(t){return ll(t,[Ux,Gx])}const dS=sl(al);function fS(t){return ll(t,[zx,dS])}const hS=ol(Hx,Wx),gS=ol(Km),pS=sl(al,na,ra);function mS(t){return ll(t,[hS,zm],[gS,pS])}const Fg="Invalid Duration",Um={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}},_S={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},...Um},Yr=146097/400,Gs=146097/4800,yS={years:{quarters:4,months:12,weeks:Yr/7,days:Yr,hours:Yr*24,minutes:Yr*24*60,seconds:Yr*24*60*60,milliseconds:Yr*24*60*60*1e3},quarters:{months:3,weeks:Yr/28,days:Yr/4,hours:Yr*24/4,minutes:Yr*24*60/4,seconds:Yr*24*60*60/4,milliseconds:Yr*24*60*60*1e3/4},months:{weeks:Gs/7,days:Gs,hours:Gs*24,minutes:Gs*24*60,seconds:Gs*24*60*60,milliseconds:Gs*24*60*60*1e3},...Um},cs=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],NS=cs.slice(0).reverse();function wo(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new jt(r)}function Gm(t,e){let n=e.milliseconds??0;for(const r of NS.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function Bg(t,e){const n=Gm(t,e)<0?-1:1;cs.reduceRight((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]*n,g=t[c][r],p=Math.floor(d/g);e[c]+=p*n,e[r]-=p*g*n}return c},null),cs.reduce((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]%1;e[r]-=d,e[c]+=d*t[r][c]}return c},null)}function CS(t){const e={};for(const[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}class jt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?yS:_S;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||en.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return jt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new xr(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new jt({values:fc(e,jt.normalizeUnit),loc:en.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(us(e))return jt.fromMillis(e);if(jt.isDuration(e))return e;if(typeof e=="object")return jt.fromObject(e);throw new xr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=uS(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=fS(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Duration is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new jT(r);return new jt({invalid:r})}static normalizeUnit(e){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"}[e&&e.toLowerCase()];if(!n)throw new tm(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?or.create(this.loc,r).formatDurationFromString(this,e):Fg}toHuman(e={}){if(!this.isValid)return Fg;const n=cs.map(r=>{const c=this.values[r];return Lt(c)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(c)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Dd(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Dt.fromMillis(n,{zone:"UTC"}).toISOTime(e))}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?Gm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e),r={};for(const c of cs)(Qs(n.values,c)||Qs(this.values,c))&&(r[c]=n.get(c)+this.get(c));return wo(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Am(e(this.values[r],r));return wo(this,{values:n},!0)}get(e){return this[jt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...fc(e,jt.normalizeUnit)};return wo(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:c}={}){const g={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:c,conversionAccuracy:r};return wo(this,g)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Bg(this.matrix,e),wo(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=CS(this.normalize().shiftToAll().toObject());return wo(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(g=>jt.normalizeUnit(g));const n={},r={},c=this.toObject();let d;for(const g of cs)if(e.indexOf(g)>=0){d=g;let p=0;for(const S in r)p+=this.matrix[S][g]*r[S],r[S]=0;us(c[g])&&(p+=c[g]);const C=Math.trunc(p);n[g]=C,r[g]=(p*1e3-C*1e3)/1e3}else us(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 Bg(this.matrix,n),wo(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 e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return wo(this,{values:e},!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(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,c){return r===void 0||r===0?c===void 0||c===0:r===c}for(const r of cs)if(!n(this.values[r],e.values[r]))return!1;return!0}}const Ys="Invalid Interval";function ES(t,e){return!t||!t.isValid?wn.invalid("missing or invalid start"):!e||!e.isValid?wn.invalid("missing or invalid end"):e<t?wn.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class wn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Interval is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new YT(r);return new wn({invalid:r})}static fromDateTimes(e,n){const r=Ul(e),c=Ul(n),d=ES(r,c);return d??new wn({start:r,end:c})}static after(e,n){const r=jt.fromDurationLike(n),c=Ul(e);return wn.fromDateTimes(c,c.plus(r))}static before(e,n){const r=jt.fromDurationLike(n),c=Ul(e);return wn.fromDateTimes(c.minus(r),c)}static fromISO(e,n){const[r,c]=(e||"").split("/",2);if(r&&c){let d,g;try{d=Dt.fromISO(r,n),g=d.isValid}catch{g=!1}let p,C;try{p=Dt.fromISO(c,n),C=p.isValid}catch{C=!1}if(g&&C)return wn.fromDateTimes(d,p);if(g){const S=jt.fromISO(c,n);if(S.isValid)return wn.after(d,S)}else if(C){const S=jt.fromISO(r,n);if(S.isValid)return wn.before(p,S)}}return wn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(e,n);let c;return n!=null&&n.useLocaleWeeks?c=this.end.reconfigure({locale:r.locale}):c=this.end,c=c.startOf(e,n),Math.floor(c.diff(r,e).get(e))+(c.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?wn.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Ul).filter(g=>this.contains(g)).sort((g,p)=>g.toMillis()-p.toMillis()),r=[];let{s:c}=this,d=0;for(;c<this.e;){const g=n[d]||this.e,p=+g>+this.e?this.e:g;r.push(wn.fromDateTimes(c,p)),c=p,d+=1}return r}splitBy(e){const n=jt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,c=1,d;const g=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(C=>C*c));d=+p>+this.e?this.e:p,g.push(wn.fromDateTimes(r,d)),r=d,c+=1}return g}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:wn.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return wn.fromDateTimes(n,r)}static merge(e){const[n,r]=e.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(e){let n=null,r=0;const c=[],d=e.map(C=>[{time:C.s,type:"s"},{time:C.e,type:"e"}]),g=Array.prototype.concat(...d),p=g.sort((C,S)=>C.time-S.time);for(const C of p)r+=C.type==="s"?1:-1,r===1?n=C.time:(n&&+n!=+C.time&&c.push(wn.fromDateTimes(n,C.time)),n=null);return wn.merge(c)}difference(...e){return wn.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ys}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=cc,n={}){return this.isValid?or.create(this.s.loc.clone(n),e).formatInterval(this):Ys}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ys}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ys}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ys}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:Ys}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):jt.invalid(this.invalidReason)}mapEndpoints(e){return wn.fromDateTimes(e(this.s),e(this.e))}}class Ja{static hasDST(e=bn.defaultZone){const n=Dt.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return no.isValidZone(e)}static normalizeZone(e){return Do(e,bn.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return en.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return en.create(n,null,"gregory").eras(e)}static features(){return{relative:Om(),localeWeek:Dm()}}}function Hg(t,e){const n=c=>c.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(jt.fromMillis(r).as("days"))}function TS(t,e,n){const r=[["years",(C,S)=>S.year-C.year],["quarters",(C,S)=>S.quarter-C.quarter+(S.year-C.year)*4],["months",(C,S)=>S.month-C.month+(S.year-C.year)*12],["weeks",(C,S)=>{const T=Hg(C,S);return(T-T%7)/7}],["days",Hg]],c={},d=t;let g,p;for(const[C,S]of r)n.indexOf(C)>=0&&(g=C,c[C]=S(t,e),p=d.plus(c),p>e?(c[C]--,t=d.plus(c),t>e&&(p=t,c[C]--,t=d.plus(c))):t=p);return[t,c,p,g]}function xS(t,e,n,r){let[c,d,g,p]=TS(t,e,n);const C=e-c,S=n.filter(O=>["hours","minutes","seconds","milliseconds"].indexOf(O)>=0);S.length===0&&(g<e&&(g=c.plus({[p]:1})),g!==c&&(d[p]=(d[p]||0)+C/(g-c)));const T=jt.fromObject(d,r);return S.length>0?jt.fromMillis(C,r).shiftTo(...S).plus(T):T}const bd={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Wg={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]},SS=bd.hanidec.replace(/[\[|\]]/g,"").split("");function vS(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(t[n].search(bd.hanidec)!==-1)e+=SS.indexOf(t[n]);else for(const c in Wg){const[d,g]=Wg[c];r>=d&&r<=g&&(e+=r-d)}}return parseInt(e,10)}else return e}function di({numberingSystem:t},e=""){return new RegExp(`${bd[t||"latn"]}${e}`)}const wS="missing Intl.DateTimeFormat.formatToParts support";function Jt(t,e=n=>n){return{regex:t,deser:([n])=>e(vS(n))}}const OS=" ",Ym=`[ ${OS}]`,jm=new RegExp(Ym,"g");function DS(t){return t.replace(/\./g,"\\.?").replace(jm,Ym)}function Kg(t){return t.replace(/\./g,"").replace(jm," ").toLowerCase()}function fi(t,e){return t===null?null:{regex:RegExp(t.map(DS).join("|")),deser:([n])=>t.findIndex(r=>Kg(n)===Kg(r))+e}}function zg(t,e){return{regex:t,deser:([,n,r])=>Ec(n,r),groups:e}}function Xa(t){return{regex:t,deser:([e])=>e}}function MS(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function AS(t,e){const n=di(e),r=di(e,"{2}"),c=di(e,"{3}"),d=di(e,"{4}"),g=di(e,"{6}"),p=di(e,"{1,2}"),C=di(e,"{1,3}"),S=di(e,"{1,6}"),T=di(e,"{1,9}"),O=di(e,"{2,4}"),R=di(e,"{4,6}"),b=$=>({regex:RegExp(MS($.val)),deser:([W])=>W,literal:!0}),w=($=>{if(t.literal)return b($);switch($.val){case"G":return fi(e.eras("short"),0);case"GG":return fi(e.eras("long"),0);case"y":return Jt(S);case"yy":return Jt(O,ed);case"yyyy":return Jt(d);case"yyyyy":return Jt(R);case"yyyyyy":return Jt(g);case"M":return Jt(p);case"MM":return Jt(r);case"MMM":return fi(e.months("short",!0),1);case"MMMM":return fi(e.months("long",!0),1);case"L":return Jt(p);case"LL":return Jt(r);case"LLL":return fi(e.months("short",!1),1);case"LLLL":return fi(e.months("long",!1),1);case"d":return Jt(p);case"dd":return Jt(r);case"o":return Jt(C);case"ooo":return Jt(c);case"HH":return Jt(r);case"H":return Jt(p);case"hh":return Jt(r);case"h":return Jt(p);case"mm":return Jt(r);case"m":return Jt(p);case"q":return Jt(p);case"qq":return Jt(r);case"s":return Jt(p);case"ss":return Jt(r);case"S":return Jt(C);case"SSS":return Jt(c);case"u":return Xa(T);case"uu":return Xa(p);case"uuu":return Jt(n);case"a":return fi(e.meridiems(),0);case"kkkk":return Jt(d);case"kk":return Jt(O,ed);case"W":return Jt(p);case"WW":return Jt(r);case"E":case"c":return Jt(n);case"EEE":return fi(e.weekdays("short",!1),1);case"EEEE":return fi(e.weekdays("long",!1),1);case"ccc":return fi(e.weekdays("short",!0),1);case"cccc":return fi(e.weekdays("long",!0),1);case"Z":case"ZZ":return zg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return zg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return Xa(/[a-z_+-/]{1,256}?/i);case" ":return Xa(/[^\S\n\r]/);default:return b($)}})(t)||{invalidReason:wS};return w.token=t,w}const RS={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 bS(t,e,n){const{type:r,value:c}=t;if(r==="literal"){const C=/^\s+$/.test(c);return{literal:!C,val:C?" ":c}}const d=e[r];let g=r;r==="hour"&&(e.hour12!=null?g=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?g="hour12":g="hour24":g=n.hour12?"hour12":"hour24");let p=RS[g];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function LS(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function kS(t,e,n){const r=t.match(e);if(r){const c={};let d=1;for(const g in n)if(Qs(n,g)){const p=n[g],C=p.groups?p.groups+1:1;!p.literal&&p.token&&(c[p.token.val[0]]=p.deser(r.slice(d,d+C))),d+=C}return[r,c]}else return[r,{}]}function IS(t){const e=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(t.z)||(n=no.create(t.z)),Lt(t.Z)||(n||(n=new ur(t.Z)),r=t.Z),Lt(t.q)||(t.M=(t.q-1)*3+1),Lt(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Lt(t.u)||(t.S=Od(t.u)),[Object.keys(t).reduce((d,g)=>{const p=e(g);return p&&(d[p]=t[g]),d},{}),n,r]}let bu=null;function PS(){return bu||(bu=Dt.fromMillis(1555555555555)),bu}function $S(t,e){if(t.literal)return t;const n=or.macroTokenToFormatOpts(t.val),r=Zm(n,e);return r==null||r.includes(void 0)?t:r}function Vm(t,e){return Array.prototype.concat(...t.map(n=>$S(n,e)))}function qm(t,e,n){const r=Vm(or.parseFormat(n),t),c=r.map(g=>AS(g,t)),d=c.find(g=>g.invalidReason);if(d)return{input:e,tokens:r,invalidReason:d.invalidReason};{const[g,p]=LS(c),C=RegExp(g,"i"),[S,T]=kS(e,C,p),[O,R,b]=T?IS(T):[null,null,void 0];if(Qs(T,"a")&&Qs(T,"H"))throw new Vs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:C,rawMatches:S,matches:T,result:O,zone:R,specificOffset:b}}}function FS(t,e,n){const{result:r,zone:c,specificOffset:d,invalidReason:g}=qm(t,e,n);return[r,c,d,g]}function Zm(t,e){if(!t)return null;const r=or.create(e,t).dtFormatter(PS()),c=r.formatToParts(),d=r.resolvedOptions();return c.map(g=>bS(g,t,d))}const Lu="Invalid DateTime",Ug=864e13;function Qa(t){return new gi("unsupported zone",`the zone "${t.name}" is not supported`)}function ku(t){return t.weekData===null&&(t.weekData=uc(t.c)),t.weekData}function Iu(t){return t.localWeekData===null&&(t.localWeekData=uc(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function os(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Dt({...n,...e,old:n})}function Jm(t,e,n){let r=t-e*60*1e3;const c=n.offset(r);if(e===c)return[r,e];r-=(c-e)*60*1e3;const d=n.offset(r);return c===d?[r,c]:[t-Math.min(c,d)*60*1e3,Math.max(c,d)]}function ec(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function ic(t,e,n){return Jm(Cc(t),e,n)}function Gg(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),c=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,d={...t.c,year:r,month:c,day:Math.min(t.c.day,dc(r,c))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},g=jt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),p=Cc(d);let[C,S]=Jm(p,n,t.zone);return g!==0&&(C+=g,S=t.zone.offset(C)),{ts:C,o:S}}function zl(t,e,n,r,c,d){const{setZone:g,zone:p}=n;if(t&&Object.keys(t).length!==0||e){const C=e||p,S=Dt.fromObject(t,{...n,zone:C,specificOffset:d});return g?S:S.setZone(p)}else return Dt.invalid(new gi("unparsable",`the input "${c}" can't be parsed as ${r}`))}function tc(t,e,n=!0){return t.isValid?or.create(en.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Pu(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=Pn(t.c.year,n?6:4),e?(r+="-",r+=Pn(t.c.month),r+="-",r+=Pn(t.c.day)):(r+=Pn(t.c.month),r+=Pn(t.c.day)),r}function Yg(t,e,n,r,c,d){let g=Pn(t.c.hour);return e?(g+=":",g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=":")):g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=Pn(t.c.second),(t.c.millisecond!==0||!r)&&(g+=".",g+=Pn(t.c.millisecond,3))),c&&(t.isOffsetFixed&&t.offset===0&&!d?g+="Z":t.o<0?(g+="-",g+=Pn(Math.trunc(-t.o/60)),g+=":",g+=Pn(Math.trunc(-t.o%60))):(g+="+",g+=Pn(Math.trunc(t.o/60)),g+=":",g+=Pn(Math.trunc(t.o%60)))),d&&(g+="["+t.zone.ianaName+"]"),g}const Xm={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},BS={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},HS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Qm=["year","month","day","hour","minute","second","millisecond"],WS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],KS=["year","ordinal","hour","minute","second","millisecond"];function zS(t){const e={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"}[t.toLowerCase()];if(!e)throw new tm(t);return e}function jg(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return zS(t)}}function Vg(t,e){const n=Do(e.zone,bn.defaultZone),r=en.fromObject(e),c=bn.now();let d,g;if(Lt(t.year))d=c;else{for(const S of Qm)Lt(t[S])&&(t[S]=Xm[S]);const p=vm(t)||wm(t);if(p)return Dt.invalid(p);const C=n.offset(c);[d,g]=ic(t,C,n)}return new Dt({ts:d,zone:n,loc:r,o:g})}function qg(t,e,n){const r=Lt(n.round)?!0:n.round,c=(g,p)=>(g=Dd(g,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(g,p)),d=g=>n.calendary?e.hasSame(t,g)?0:e.startOf(g).diff(t.startOf(g),g).get(g):e.diff(t,g).get(g);if(n.unit)return c(d(n.unit),n.unit);for(const g of n.units){const p=d(g);if(Math.abs(p)>=1)return c(p,g)}return c(t>e?-0:0,n.units[n.units.length-1])}function Zg(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class Dt{constructor(e){const n=e.zone||bn.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new gi("invalid input"):null)||(n.isValid?null:Qa(n));this.ts=Lt(e.ts)?bn.now():e.ts;let c=null,d=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[c,d]=[e.old.c,e.old.o];else{const p=n.offset(this.ts);c=ec(this.ts,p),r=Number.isNaN(c.year)?new gi("invalid input"):null,c=r?null:c,d=r?null:p}this._zone=n,this.loc=e.loc||en.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=c,this.o=d,this.isLuxonDateTime=!0}static now(){return new Dt({})}static local(){const[e,n]=Zg(arguments),[r,c,d,g,p,C,S]=n;return Vg({year:r,month:c,day:d,hour:g,minute:p,second:C,millisecond:S},e)}static utc(){const[e,n]=Zg(arguments),[r,c,d,g,p,C,S]=n;return e.zone=ur.utcInstance,Vg({year:r,month:c,day:d,hour:g,minute:p,second:C,millisecond:S},e)}static fromJSDate(e,n={}){const r=yx(e)?e.valueOf():NaN;if(Number.isNaN(r))return Dt.invalid("invalid input");const c=Do(n.zone,bn.defaultZone);return c.isValid?new Dt({ts:r,zone:c,loc:en.fromObject(n)}):Dt.invalid(Qa(c))}static fromMillis(e,n={}){if(us(e))return e<-Ug||e>Ug?Dt.invalid("Timestamp out of range"):new Dt({ts:e,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(us(e))return new Dt({ts:e*1e3,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=Do(n.zone,bn.defaultZone);if(!r.isValid)return Dt.invalid(Qa(r));const c=en.fromObject(n),d=fc(e,jg),{minDaysInFirstWeek:g,startOfWeek:p}=Lg(d,c),C=bn.now(),S=Lt(n.specificOffset)?r.offset(C):n.specificOffset,T=!Lt(d.ordinal),O=!Lt(d.year),R=!Lt(d.month)||!Lt(d.day),b=O||R,x=d.weekYear||d.weekNumber;if((b||T)&&x)throw new Vs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(R&&T)throw new Vs("Can't mix ordinal dates with month/day");const w=x||d.weekday&&!b;let $,W,P=ec(C,S);w?($=WS,W=BS,P=uc(P,g,p)):T?($=KS,W=HS,P=Ru(P)):($=Qm,W=Xm);let H=!1;for(const U of $){const q=d[U];Lt(q)?H?d[U]=W[U]:d[U]=P[U]:H=!0}const B=w?px(d,g,p):T?mx(d):vm(d),z=B||wm(d);if(z)return Dt.invalid(z);const X=w?Rg(d,g,p):T?bg(d):d,[ee,le]=ic(X,S,r),j=new Dt({ts:ee,zone:r,o:le,loc:c});return d.weekday&&b&&e.weekday!==j.weekday?Dt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${j.toISO()}`):j}static fromISO(e,n={}){const[r,c]=lS(e);return zl(r,c,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,c]=aS(e);return zl(r,c,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,c]=cS(e);return zl(r,c,n,"HTTP",n)}static fromFormat(e,n,r={}){if(Lt(e)||Lt(n))throw new xr("fromFormat requires an input string and a format");const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0}),[p,C,S,T]=FS(g,e,n);return T?Dt.invalid(T):zl(p,C,r,`format ${n}`,e,S)}static fromString(e,n,r={}){return Dt.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,c]=mS(e);return zl(r,c,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the DateTime is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new GT(r);return new Dt({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=Zm(e,en.fromObject(n));return r?r.map(c=>c?c.val:null).join(""):null}static expandFormat(e,n={}){return Vm(or.parseFormat(e),en.fromObject(n)).map(c=>c.val).join("")}get(e){return this[e]}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?ku(this).weekYear:NaN}get weekNumber(){return this.isValid?ku(this).weekNumber:NaN}get weekday(){return this.isValid?ku(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Iu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Iu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Iu(this).weekYear:NaN}get ordinal(){return this.isValid?Ru(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ja.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ja.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ja.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ja.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 e=864e5,n=6e4,r=Cc(this.c),c=this.zone.offset(r-e),d=this.zone.offset(r+e),g=this.zone.offset(r-c*n),p=this.zone.offset(r-d*n);if(g===p)return[this];const C=r-g*n,S=r-p*n,T=ec(C,g),O=ec(S,p);return T.hour===O.hour&&T.minute===O.minute&&T.second===O.second&&T.millisecond===O.millisecond?[os(this,{ts:C}),os(this,{ts:S})]:[this]}get isInLeapYear(){return ta(this.year)}get daysInMonth(){return dc(this.year,this.month)}get daysInYear(){return this.isValid?qs(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ql(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ql(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:c}=or.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:c}}toUTC(e=0,n={}){return this.setZone(ur.instance(e),n)}toLocal(){return this.setZone(bn.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=Do(e,bn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let c=this.ts;if(n||r){const d=e.offset(this.ts),g=this.toObject();[c]=ic(g,d,e)}return os(this,{ts:c,zone:e})}else return Dt.invalid(Qa(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const c=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return os(this,{loc:c})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=fc(e,jg),{minDaysInFirstWeek:r,startOfWeek:c}=Lg(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),g=!Lt(n.ordinal),p=!Lt(n.year),C=!Lt(n.month)||!Lt(n.day),S=p||C,T=n.weekYear||n.weekNumber;if((S||g)&&T)throw new Vs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(C&&g)throw new Vs("Can't mix ordinal dates with month/day");let O;d?O=Rg({...uc(this.c,r,c),...n},r,c):Lt(n.ordinal)?(O={...this.toObject(),...n},Lt(n.day)&&(O.day=Math.min(dc(O.year,O.month),O.day))):O=bg({...Ru(this.c),...n});const[R,b]=ic(O,this.o,this.zone);return os(this,{ts:R,o:b})}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return os(this,Gg(this,n))}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e).negate();return os(this,Gg(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},c=jt.normalizeUnit(e);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(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?or.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):Lu}toLocaleString(e=cc,n={}){return this.isValid?or.create(this.loc.clone(n),e).formatDateTime(this):Lu}toLocaleParts(e={}){return this.isValid?or.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:c=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const g=e==="extended";let p=Pu(this,g);return p+="T",p+=Yg(this,g,n,r,c,d),p}toISODate({format:e="extended"}={}){return this.isValid?Pu(this,e==="extended"):null}toISOWeekDate(){return tc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:c=!1,extendedZone:d=!1,format:g="extended"}={}){return this.isValid?(c?"T":"")+Yg(this,g==="extended",n,e,r,d):null}toRFC2822(){return tc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return tc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Pu(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let c="HH:mm:ss.SSS";return(n||e)&&(r&&(c+=" "),n?c+="z":e&&(c+="ZZ")),tc(this,c,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Lu}[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(e={}){if(!this.isValid)return{};const n={...this.c};return e.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(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return jt.invalid("created by diffing an invalid DateTime");const c={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Nx(n).map(jt.normalizeUnit),g=e.valueOf()>this.valueOf(),p=g?this:e,C=g?e:this,S=xS(p,C,d,c);return g?S.negate():S}diffNow(e="milliseconds",n={}){return this.diff(Dt.now(),e,n)}until(e){return this.isValid?wn.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;const c=e.valueOf(),d=this.setZone(e.zone,{keepLocalTime:!0});return d.startOf(n,r)<=c&&c<=d.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||Dt.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0;let c=["years","months","days","hours","minutes","seconds"],d=e.unit;return Array.isArray(e.unit)&&(c=e.unit,d=void 0),qg(n,this.plus(r),{...e,numeric:"always",units:c,unit:d})}toRelativeCalendar(e={}){return this.isValid?qg(e.base||Dt.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Dt.isDateTime))throw new xr("min requires all arguments be DateTimes");return kg(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(Dt.isDateTime))throw new xr("max requires all arguments be DateTimes");return kg(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});return qm(g,e,n)}static fromStringExplain(e,n,r={}){return Dt.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return cc}static get DATE_MED(){return nm}static get DATE_MED_WITH_WEEKDAY(){return VT}static get DATE_FULL(){return rm}static get DATE_HUGE(){return im}static get TIME_SIMPLE(){return om}static get TIME_WITH_SECONDS(){return sm}static get TIME_WITH_SHORT_OFFSET(){return lm}static get TIME_WITH_LONG_OFFSET(){return am}static get TIME_24_SIMPLE(){return cm}static get TIME_24_WITH_SECONDS(){return um}static get TIME_24_WITH_SHORT_OFFSET(){return dm}static get TIME_24_WITH_LONG_OFFSET(){return fm}static get DATETIME_SHORT(){return hm}static get DATETIME_SHORT_WITH_SECONDS(){return gm}static get DATETIME_MED(){return pm}static get DATETIME_MED_WITH_SECONDS(){return mm}static get DATETIME_MED_WITH_WEEKDAY(){return qT}static get DATETIME_FULL(){return _m}static get DATETIME_FULL_WITH_SECONDS(){return ym}static get DATETIME_HUGE(){return Nm}static get DATETIME_HUGE_WITH_SECONDS(){return Cm}}function Ul(t){if(Dt.isDateTime(t))return t;if(t&&t.valueOf&&us(t.valueOf()))return Dt.fromJSDate(t);if(t&&typeof t=="object")return Dt.fromObject(t);throw new xr(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var Xt=(t=>(t.Monday="MONDAY",t.Tuesday="TUESDAY",t.Wednesday="WEDNESDAY",t.Thursday="THURSDAY",t.Friday="FRIDAY",t.Saturday="SATURDAY",t.Sunday="SUNDAY",t))(Xt||{});function Ld(t){const e={1:Xt.Monday,2:Xt.Tuesday,3:Xt.Wednesday,4:Xt.Thursday,5:Xt.Friday,6:Xt.Saturday,7:Xt.Sunday};if(t.weekday in e)return e[t.weekday];throw new Error(`Invalid DateTime.weekday property: ${t}, ${t.weekday}`)}function $i(t){return{[Xt.Monday]:"Monday",[Xt.Tuesday]:"Tuesday",[Xt.Wednesday]:"Wednesday",[Xt.Thursday]:"Thursday",[Xt.Friday]:"Friday",[Xt.Saturday]:"Saturday",[Xt.Sunday]:"Sunday"}[t]}class Jg{constructor(e,n,r){Vn(this,"end");Vn(this,"start");this.end=e.setZone(r),this.start=e.setZone(r),[n.start,n.end].forEach(C=>{if(C.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(":"),[g,p]=n.end.split(":");this.end=this.end.set({hour:Number(g),minute:Number(p)}),this.start=this.start.set({hour:Number(c),minute:Number(d)}),this.end<this.start&&(this.end=this.end.plus({days:1})),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(e){return this.start<=e&&e<this.end}getStartTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(e||"en-US").toLocaleString(r)}getEndTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(e||"en-US").toLocaleString(r)}timeIsEqualTo(e){const n=this.getStartTime()===e.getStartTime(),r=this.getEndTime()===e.getEndTime();return n&&r}is24h(){const e=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 e&&n&&r}}class e_{constructor(e,n){Vn(this,"holidayHoursByDate");Vn(this,"hours");Vn(this,"timezone");this.holidayHoursByDate=Object.fromEntries((e.holidayHours||[]).map(r=>[r.date,r])),this.hours=e,this.timezone=n}getInterval(e){if(this.isTemporarilyClosedAt(e))return null;let n=e;n=n.minus({days:1});for(const r of[n,e]){const c=this.getHours(r);if(c&&!c.isClosed)for(const d of c.openIntervals||[]){const g=new Jg(r,d,this.timezone);if(g.contains(e))return g}}return null}getCurrentInterval(){return this.getInterval(Dt.now())}getIntervalAfter(e){const n=this.getIntervalsForNDays(8,e),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(e)&&c.length>d+1)return c[d+1];for(const d of c)if(d.start>e)return d;return null}getIntervalsForNDays(e,n){const r=[];for(let c=0;c<e;c++){let d=n;d=d.plus({days:c});const g=this.getHours(d);g&&!g.isClosed&&r.push(...g.openIntervals.map(p=>new Jg(d,p,this.timezone)))}return r}getHolidayHours(e){return this.isTemporarilyClosedAt(e)?null:this.holidayHoursByDate[(e.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(e){if(this.isTemporarilyClosedAt(e))return null;const n=$i(Ld(e)).toLowerCase();return this.hours[n]}getHours(e){const n=this.getHolidayHours(e);return!n||n.isRegularHours?this.getNormalHours(e):n}getNextInterval(){return this.getIntervalAfter(Dt.now())}isHoliday(e){return!!this.getHolidayHours(e)}isTemporarilyClosedAt(e){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,c,d]=n,g=Dt.fromObject({year:Number(r),month:Number(c),day:Number(d)},{zone:this.timezone});if(e<g)return!0}return!1}isOpenAt(e){return this.isTemporarilyClosedAt(e)?!1:!!this.getInterval(e)}isOpenNow(){return this.isOpenAt(Dt.now())}}function US(t,e){const n=[...t];return e=e%n.length,n.concat(n.splice(0,n.length-e))}function GS(t,e){if(t.length!==e.length)return!1;for(const[n,r]of t.entries())if(!r.timeIsEqualTo(e[n]))return!1;return!0}function ia(t){var e,n;return((n=(e=t==null?void 0:t.currentInterval)==null?void 0:e.is24h)==null?void 0:n.call(e))||!1}function oa(t){return!t.futureInterval}function YS(t){return ia(t)?at.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):oa(t)?at.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):at.jsx("span",{className:"HoursStatus-current",children:t.isOpen?"Open Now":"Closed"})}function jS(t){return ia(t)||oa(t)?null:at.jsx("span",{className:"HoursStatus-separator",children:" • "})}function VS(t){return ia(t)||oa(t)?null:at.jsx("span",{className:"HoursStatus-future",children:t.isOpen?"Closes at":"Opens at"})}function qS(t){if(ia(t)||oa(t))return null;let e="";if(t.isOpen){const n=t.currentInterval;e+=n?n.getEndTime("en-US",t.timeOptions):""}else{const n=t.futureInterval;e+=n?n.getStartTime("en-US",t.timeOptions):""}return at.jsxs("span",{className:"HoursStatus-time",children:[" ",e]})}function ZS(t){var r,c;if(ia(t)||oa(t))return null;const e={weekday:"long",...t.dayOptions??{}};let n="";if(t.isOpen){const d=t.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(e))||""}else{const d=t.futureInterval;n+=((c=d==null?void 0:d.start)==null?void 0:c.setLocale("en-US").toLocaleString(e))||""}return at.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function JS(t,e){const n=t.currentTemplate||YS,r=t.separatorTemplate||jS,c=t.futureTemplate||VS,d=t.timeTemplate||qS,g=t.dayOfWeekTemplate||ZS;return at.jsxs("div",{className:Xs("HoursStatus",(e==null?void 0:e.className)||""),children:[n(t),r(t),c(t),d(t),g(t)]})}const XS=t=>{const[e,n]=et.useState(!1),[r,c]=et.useState(!1);et.useEffect(()=>{c(!0)},[]);const d=t.statusTemplate||JS,g=new e_(t.hours,t.timezone),p=g.isOpenNow(),C=g.getCurrentInterval(),S=g.getNextInterval(),T=(C==null?void 0:C.end)||(S==null?void 0:S.start);if(T&&!e){n(!0);const R=T.toMillis()-Dt.now().toMillis();setTimeout(()=>n(!1),R)}const O={isOpen:p,currentInterval:C,futureInterval:S,...t};return at.jsx(at.Fragment,{children:r&&d(O,t)})};function QS(t,e){const n=[];return t.forEach(r=>{const c=n[n.length-1];c?GS(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=e&&$i(r.startDay)in e?e[$i(r.startDay)]||"":$i(r.startDay),d=e&&$i(r.endDay)in e?e[$i(r.endDay)]||"":$i(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${c}`:`${c} - ${d}`}})}function ev(t,e){const n=[],r=t.intervals.length>0&&t.intervals[0].is24h();return t.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):t.intervals.forEach(c=>{const d=c.getStartTime("en-US",e),g=c.getEndTime("en-US",e);n.push(`${d} - ${g}`)}),n}function tv(t,e,n){const r=[];for(let c=1;c<=7;c++){const d=Dt.fromObject({weekday:c}),g=Ld(d);r.push({startDay:g,endDay:g,dayName:n&&$i(g).toLowerCase()in n?n[$i(g).toLowerCase()]||"":$i(g),intervals:t.filter(p=>p.start.weekday===c),isToday:e.weekday===c})}return r}const nv=t=>{const[e,n]=et.useState(!1);et.useEffect(()=>{n(!0)},[]);const r=new e_(t.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),c=Dt.now(),d=r.getIntervalsForNDays(7,c);let g=tv(d,c,t.dayOfWeekNames);function p(T){return T?{today:Ld(c),monday:Xt.Monday,tuesday:Xt.Tuesday,wednesday:Xt.Wednesday,thursday:Xt.Thursday,friday:Xt.Friday,saturday:Xt.Saturday,sunday:Xt.Sunday}[T]:Xt.Sunday}let C=[Xt.Sunday,Xt.Monday,Xt.Tuesday,Xt.Wednesday,Xt.Thursday,Xt.Friday,Xt.Saturday];const S=C.indexOf(p(t.startOfWeek));return C=US(C,7-S),g.sort((T,O)=>C.indexOf(T.startDay)-C.indexOf(O.startDay)),t.collapseDays&&(g=QS(g,t.dayOfWeekNames)),at.jsx(at.Fragment,{children:e&&at.jsx("div",{className:Xs("HoursTable",t.className),children:g.map(T=>{const R=(t.intervalStringsBuilderFn||ev)(T,t.timeOptions);return at.jsxs("div",{className:Xs("HoursTable-row",{"is-today":T.isToday}),children:[at.jsx("span",{className:"HoursTable-day",children:T.dayName}),at.jsx("span",{className:"HoursTable-intervals",children:R.map((b,x)=>at.jsx("span",{className:"HoursTable-interval",children:b},x))})]},T.dayName)})})})},td=Math.log2(1.6745627884839434),rv=4,iv=19,nd="js-baidu-neg-lng-fix";let t_;const ov=new Promise(t=>t_=t),sv="https://api.map.baidu.com/geoconv/v1/";let Gl=[];const lv="gcj02ToBD09Callback_b872c21c";let av=0,Xg;async function n_(t){return await new Promise((e,n)=>{Gl.push({coordinates:t,resolve:e,reject:n}),Gl.length===1&&(Xg=setTimeout(r,100)),Gl.length>40&&(clearTimeout(Xg),r());function r(){const c=Gl;Gl=[];const d=[].concat(...c.map(C=>C.coordinates)),g=lv+"_"+av++,p=document.createElement("script");window[g]=C=>{if(C.status){const O=new Error(`Unable to convert coordinates to BD-09: Received status code ${C.status}${C.message?": "+C.message:""}`);c.forEach(R=>R.reject(O))}const S=C.result.map(O=>new tn(O.y,O.x));let T=0;c.forEach(O=>{O.resolve(S.slice(T,T+=O.coordinates.length))}),delete window[g],p.parentNode.removeChild(p)},ov.then(C=>{const S={ak:C,callback:g,coords:d.map(T=>`${T.longitude},${T.latitude}`).join(";"),from:3,to:5};p.src=sv+"?"+Object.entries(S).map(([T,O])=>T+"="+O).join("&"),document.head.appendChild(p)})}})}class cv extends nl{constructor(e){super(e);const n=!!(window.MSInputMethodContext&&document.documentMode);this._wrapper=e.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:e.controlEnabled,maxZoom:n?14:18,...e.providerOptions}),e.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.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper.dataset.baiduZoom=this.map.getZoom(),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()-td}setCenter(e,n){this._centerReady=n_([e]).then(([r])=>{const c=new BMap.Point(r.longitude,r.latitude);this.map.panTo(c,{noAnimation:!n})})}setZoom(e,n){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(e+td)},{enableAnimation:n})})}}class uv extends hc{constructor(e){super(e),this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;const n=this;class r extends BMap.Marker{initialize(g){return n._wrapper=super.initialize(g),n._wrapper&&(n._wrapper.style.zIndex=n._zIndex,n._originalWrapperClass=n._wrapper.getAttribute("class"),n._wrapper.setAttribute("class",n._getClass()),n._wrapper.appendChild(n._element),n.addListeners()),n._wrapper}draw(){if(n._wrapper){const g=n._wrapper.style.zIndex;super.draw(),n._wrapper.style.height="",n._wrapper.style.width="",n._wrapper.style.pointerEvents="none",n._wrapper.style.zIndex=g}else super.draw()}}this.pin=new r(new BMap.Point(0,0));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.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(e){this._coordinateReady=n_([e]).then(([n])=>{this._negativeLngFix=n.longitude<0,this.pin.setPosition(new BMap.Point(n.longitude+(this._negativeLngFix?180:0),n.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](nd)})}setMap(e,n){this._coordinateReady.then(()=>{n&&n.getProviderMap().map.removeOverlay(this.pin),e&&e.getProviderMap().map.addOverlay(this.pin)})}setProperties(e){super.setProperties(e),this._wrapperClass=e.getClass(),this._element=e.getElement()||this._pinEl,this._zIndex=e.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?nd:""} ${this._wrapperClass}`}}const dv="https://api.map.baidu.com/getscript";function fv(t,e,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};t_(d);const p=document.createElement("script");p.src=dv+"?"+Object.entries(g).map(([T,O])=>T+"="+O).join("&"),p.onload=()=>t(),document.head.appendChild(p);let C="";for(let T=rv;T<=iv;T++){const O=2**(T-td+7);C+=`[data-baidu-zoom="${T}"] .${nd}{transform:translateX(-${O}px);}`}const S=document.createElement("style");S.appendChild(document.createTextNode(C)),document.head.appendChild(S)}const hv=new ds().withLoadFunction(fv).withMapClass(cv).withPinClass(uv).withProviderName("Baidu").build();let r_;function gv(){class t extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1}),this._container=document.createElement("div"),this._map=null,this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(n){this._pins.add(n),n._wrapper.style.position="absolute",this._container.appendChild(n._wrapper),this._map&&this.updatePinPosition(n)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(n){this._pins.delete(n),this._container.removeChild(n._wrapper)}updatePinPosition(n){if(!this._map)return;const r=this._map.tryLocationToPixel(n._location,Microsoft.Maps.PixelReference.control);n._wrapper.style.left=r.x+"px",n._wrapper.style.top=r.y+"px"}updatePinPositions(){this._pins.forEach(n=>this.updatePinPosition(n))}}r_=t}class pv extends nl{constructor(e){super(e),this.wrapper=e.wrapper,this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!e.controlEnabled,disableZooming:!e.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...e.providerOptions}),this.pinOverlay=new r_(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(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new Microsoft.Maps.Location(e.latitude,e.longitude);this.map.setView({center:r}),this.pinOverlay.updatePinPositions()}setZoom(e,n){this.map.setView({zoom:Math.floor(e)}),this.pinOverlay.updatePinPositions()}}class mv extends hc{static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}constructor(e){super(e),this._map=null,this._location=new Microsoft.Maps.Location(0,0)}setCoordinate(e){this._location=new Microsoft.Maps.Location(e.latitude,e.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(e,n){n&&n.getProviderMap().pinOverlay.removePin(this),e&&e.getProviderMap().pinOverlay.addPin(this),this._map=e}}const Qg="BingMapsCallback_593d7d33",_v="https://www.bing.com/api/maps/mapcontrol";function yv(t,e,n,{params:r={}}={}){window[Qg]=()=>{gv(),t()};const c={callback:Qg,key:n,...r};cp(_v+"?"+Object.entries(c).map(([d,g])=>d+"="+g).join("&"))}const Nv=new ds().withLoadFunction(yv).withMapClass(pv).withPinClass(mv).withProviderName("Bing").build();class Cv extends nl{constructor(e){if(super(e),this.map=new mapboxgl.Map({container:e.wrapper,interactive:e.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...e.providerOptions}),e.controlEnabled){const n=new mapboxgl.NavigationControl({showCompass:!1});this.map.addControl(n)}this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()+1}setCenter(e,n){const r=new mapboxgl.LngLat(e.longitude,e.latitude);this.map[n?"panTo":"setCenter"](r)}setZoom(e,n){this.map[n?"zoomTo":"setZoom"](e-1)}setZoomCenter(e,n,r){const c=new mapboxgl.LngLat(n.longitude,n.latitude);this.map[r?"easeTo":"jumpTo"]({center:c,zoom:e-1})}}class Ev extends hc{constructor(e){super(e),this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper})}setCoordinate(e){this.pin.setLngLat(new mapboxgl.LngLat(e.longitude,e.latitude))}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}}function Tv(t,e,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=()=>{mapboxgl.accessToken=n,t()},document.head.appendChild(d),document.head.appendChild(g)}const xv=new ds().withLoadFunction(Tv).withMapClass(Cv).withPinClass(Ev).withProviderName("Mapbox").build();let i_=class extends nl{constructor(e){super(e),this._initMap(e),e.controlEnabled&&this.map.zoomControl.setPosition("topright"),this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new L.latLng(e.latitude,e.longitude);this.map.panTo(r,{animate:n})}setZoom(e,n){this.map.setZoom(e,{animate:n})}setZoomCenter(e,n,r){const c=new L.latLng(n.latitude,n.longitude);this.map.setView(c,e,{animate:r})}_initMap(e){this.map=new L.map(e.wrapper,{boxZoom:e.controlEnabled,doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions});const n=e.providerOptions,r=n.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",c=n.tileLayerOptions||{attribution:'Map data &copy; <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"};c.accessToken=this.constructor.apiKey,L.tileLayer(r,c).addTo(this.map)}},Sv=class extends ad{constructor(e){super(e),this.pin=new L.marker,this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(e){const n=new L.latLng(e.latitude,e.longitude);this.pin.setLatLng(n)}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}setProperties(e){const n=e.getWidth(),r=e.getHeight(),c=e.getAnchorX(),d=e.getAnchorY();this.pin.setIcon(new L.icon({iconUrl:this._icons[e.getIcon()],iconSize:[n,r],iconAnchor:[c*n,d*r],className:e.getClass()})),this.pin.setZIndexOffset(e.getZIndex())}};function vv(t,e,n,{version:r="1.7.1"}={}){const c=`https://unpkg.com/leaflet@${r}/dist/leaflet`;i_.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=()=>t(),document.head.appendChild(d),document.head.appendChild(g)}const kd=new ds().withLoadFunction(vv).withMapClass(i_).withPinClass(Sv).withProviderName("Leaflet").build(),wv=kd.getMapClass(),Ov=kd.getPinClass();class Dv extends wv{_initMap(e){this.map=L.mapquest.map(e.wrapper,{boxZoom:e.controlEnabled,center:new L.latLng(0,0),doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions})}}class Mv extends Ov{}function Av(t,e,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,t()},document.head.appendChild(d),document.head.appendChild(g)}const Rv=new ds().withLoadFunction(Av).withMapClass(Dv).withPinClass(Mv).withProviderName("MapQuest").build();exports.Address=j_;exports.Analytics=ip;exports.AnalyticsContext=sd;exports.AnalyticsProvider=Ky;exports.AnalyticsScopeProvider=zy;exports.BaiduMaps=hv;exports.BingMaps=Nv;exports.Clusterer=NN;exports.Coordinate=tn;exports.Day=Xt;exports.GoogleMaps=fp;exports.HoursStatus=XS;exports.HoursTable=nv;exports.Image=Jy;exports.ImageLayoutOption=Mo;exports.LeafletMaps=kd;exports.LegacyRichText=UT;exports.LexicalRichText=nE;exports.Link=ap;exports.LinkTypes=rN;exports.ListingPublisherOption=ep;exports.LocationMap=TN;exports.Map=pp;exports.MapProviderOption=Fu;exports.MapQuestMaps=Rv;exports.MapboxMaps=xv;exports.Marker=dd;exports.asciiAlpha=fE;exports.asciiAlphanumeric=Vu;exports.asciiAtext=hE;exports.asciiControl=gE;exports.asciiDigit=pE;exports.asciiHexDigit=mE;exports.asciiPunctuation=_E;exports.c=Xs;exports.classifyCharacter=Xl;exports.combineExtensions=Hp;exports.createState=bT;exports.debuggingParamDetected=oc;exports.getDefaultExportFromCjs=id;exports.getDirections=G_;exports.getRuntime=Js;exports.jsxRuntimeExports=at;exports.markdownLineEnding=yE;exports.markdownLineEndingOrSpace=jp;exports.markdownSpace=NE;exports.normalizeUri=il;exports.push=js;exports.resolveAll=Vp;exports.splice=pc;exports.useAnalytics=tl;exports.useClusterContext=yN;exports.useIdentify=Yy;exports.useMapContext=mN;exports.usePageView=Gy;exports.useScope=ld;exports.useTrack=Uy;exports.visit=Sd;