@nebula.js/sn-text 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api-spec/spec.json
CHANGED
package/core/esm/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-text v1.1.
|
|
2
|
+
* @nebula.js/sn-text v1.1.6
|
|
3
3
|
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import{useMemo as e,useEffect as t,useElement as n,useStaleLayout as r,useModel as o,useInteractionState as i,useEmitter as l,useTranslator as a,useState as s,useTheme as u,useImperativeHandle as c}from"@nebula.js/stardust";function d(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const f={version:"1.1.
|
|
7
|
+
import{useMemo as e,useEffect as t,useElement as n,useStaleLayout as r,useModel as o,useInteractionState as i,useEmitter as l,useTranslator as a,useState as s,useTheme as u,useImperativeHandle as c}from"@nebula.js/stardust";function d(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const f={version:"1.1.6",showTitles:!1,text:null,fontsUsed:[],components:[],qHyperCubeDef:{qDimensions:[],qMeasures:[],qSuppressZero:!1,qSuppressMissing:!0,qInitialDataFetch:[{qWidth:500,qHeight:10}]}},p=e=>{const t=()=>{e.setPropertiesHaveBeenModifiedForSelectedModel(!0)};return{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:0,max:10,added(e){e.qDef={...e.qDef,qAggrFunc:"None"},t()},removed:t,replaced:t,moved:t}}]}};var m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g={exports:{}},v={},b={exports:{}},y={},x=Symbol.for("react.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),S=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),R=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),O=Symbol.iterator;var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,P={};function I(e,t,n){this.props=e,this.context=t,this.refs=P,this.updater=n||M}function D(){}function $(e,t,n){this.props=e,this.context=t,this.refs=P,this.updater=n||M}I.prototype.isReactComponent={},I.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},I.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},D.prototype=I.prototype;var z=$.prototype=new D;z.constructor=$,L(z,I.prototype),z.isPureReactComponent=!0;var F=Array.isArray,B=Object.prototype.hasOwnProperty,H={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function j(e,t,n){var r,o={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)B.call(t,r)&&!W.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var s=Array(a),u=0;u<a;u++)s[u]=arguments[u+2];o.children=s}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return{$$typeof:x,type:e,key:i,ref:l,props:o,_owner:H.current}}function K(e){return"object"==typeof e&&null!==e&&e.$$typeof===x}var U=/\/+/g;function Y(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function G(e,t,n,r,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var l=!1;if(null===e)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case x:case _:l=!0}}if(l)return o=o(l=e),e=""===r?"."+Y(l,0):r,F(o)?(n="",null!=e&&(n=e.replace(U,"$&/")+"/"),G(o,t,n,"",(function(e){return e}))):null!=o&&(K(o)&&(o=function(e,t){return{$$typeof:x,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(U,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",F(e))for(var a=0;a<e.length;a++){var s=r+Y(i=e[a],a);l+=G(i,t,n,s,o)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),a=0;!(i=e.next()).done;)l+=G(i=i.value,t,n,s=r+Y(i,a++),o);else if("object"===i)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function V(e,t,n){if(null==e)return e;var r=[],o=0;return G(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function Q(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var q={current:null},X={transition:null},J={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:X,ReactCurrentOwner:H};y.Children={map:V,forEach:function(e,t,n){V(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return V(e,(function(){t++})),t},toArray:function(e){return V(e,(function(e){return e}))||[]},only:function(e){if(!K(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},y.Component=I,y.Fragment=E,y.Profiler=C,y.PureComponent=$,y.StrictMode=w,y.Suspense=N,y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,y.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=L({},e.props),o=e.key,i=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,l=H.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(s in t)B.call(t,s)&&!W.hasOwnProperty(s)&&(r[s]=void 0===t[s]&&void 0!==a?a[s]:t[s])}var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){a=Array(s);for(var u=0;u<s;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:x,type:e.type,key:o,ref:i,props:r,_owner:l}},y.createContext=function(e){return(e={$$typeof:S,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:k,_context:e},e.Consumer=e},y.createElement=j,y.createFactory=function(e){var t=j.bind(null,e);return t.type=e,t},y.createRef=function(){return{current:null}},y.forwardRef=function(e){return{$$typeof:T,render:e}},y.isValidElement=K,y.lazy=function(e){return{$$typeof:A,_payload:{_status:-1,_result:e},_init:Q}},y.memo=function(e,t){return{$$typeof:R,type:e,compare:void 0===t?null:t}},y.startTransition=function(e){var t=X.transition;X.transition={};try{e()}finally{X.transition=t}},y.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},y.useCallback=function(e,t){return q.current.useCallback(e,t)},y.useContext=function(e){return q.current.useContext(e)},y.useDebugValue=function(){},y.useDeferredValue=function(e){return q.current.useDeferredValue(e)},y.useEffect=function(e,t){return q.current.useEffect(e,t)},y.useId=function(){return q.current.useId()},y.useImperativeHandle=function(e,t,n){return q.current.useImperativeHandle(e,t,n)},y.useInsertionEffect=function(e,t){return q.current.useInsertionEffect(e,t)},y.useLayoutEffect=function(e,t){return q.current.useLayoutEffect(e,t)},y.useMemo=function(e,t){return q.current.useMemo(e,t)},y.useReducer=function(e,t,n){return q.current.useReducer(e,t,n)},y.useRef=function(e){return q.current.useRef(e)},y.useState=function(e){return q.current.useState(e)},y.useSyncExternalStore=function(e,t,n){return q.current.useSyncExternalStore(e,t,n)},y.useTransition=function(){return q.current.useTransition()},y.version="18.2.0",b.exports=y;var Z=b.exports,ee=h(Z),te=d({__proto__:null,default:ee},[Z]),ne={exports:{}},re={};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* scheduler.production.min.js
|
package/dist/sn-text.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-text v1.1.
|
|
2
|
+
* @nebula.js/sn-text v1.1.6
|
|
3
3
|
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-text"]=t(e.stardust)}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const n={version:"1.1.
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-text"]=t(e.stardust)}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const n={version:"1.1.6",showTitles:!1,text:null,fontsUsed:[],components:[],qHyperCubeDef:{qDimensions:[],qMeasures:[],qSuppressZero:!1,qSuppressMissing:!0,qInitialDataFetch:[{qWidth:500,qHeight:10}]}},r=e=>{const t=()=>{e.setPropertiesHaveBeenModifiedForSelectedModel(!0)};return{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:0,max:10,added(e){e.qDef={...e.qDef,qAggrFunc:"None"},t()},removed:t,replaced:t,moved:t}}]}};var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l={exports:{}},a={},s={exports:{}},u={},c=Symbol.for("react.element"),d=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),_=Symbol.iterator;var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function k(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||E}function S(){}function T(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||E}k.prototype.isReactComponent={},k.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},k.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=k.prototype;var N=T.prototype=new S;N.constructor=T,w(N,k.prototype),N.isPureReactComponent=!0;var R=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function L(e,t,n){var r,o={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)A.call(t,r)&&!M.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var s=Array(a),u=0;u<a;u++)s[u]=arguments[u+2];o.children=s}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return{$$typeof:c,type:e,key:i,ref:l,props:o,_owner:O.current}}function P(e){return"object"==typeof e&&null!==e&&e.$$typeof===c}var I=/\/+/g;function D(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function $(e,t,n,r,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var l=!1;if(null===e)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case c:case d:l=!0}}if(l)return o=o(l=e),e=""===r?"."+D(l,0):r,R(o)?(n="",null!=e&&(n=e.replace(I,"$&/")+"/"),$(o,t,n,"",(function(e){return e}))):null!=o&&(P(o)&&(o=function(e,t){return{$$typeof:c,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",R(e))for(var a=0;a<e.length;a++){var s=r+D(i=e[a],a);l+=$(i,t,n,s,o)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=_&&e[_]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),a=0;!(i=e.next()).done;)l+=$(i=i.value,t,n,s=r+D(i,a++),o);else if("object"===i)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function z(e,t,n){if(null==e)return e;var r=[],o=0;return $(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function F(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var B={current:null},H={transition:null},W={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:H,ReactCurrentOwner:O};u.Children={map:z,forEach:function(e,t,n){z(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return z(e,(function(){t++})),t},toArray:function(e){return z(e,(function(e){return e}))||[]},only:function(e){if(!P(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},u.Component=k,u.Fragment=f,u.Profiler=m,u.PureComponent=T,u.StrictMode=p,u.Suspense=b,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,u.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=w({},e.props),o=e.key,i=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,l=O.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(s in t)A.call(t,s)&&!M.hasOwnProperty(s)&&(r[s]=void 0===t[s]&&void 0!==a?a[s]:t[s])}var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){a=Array(s);for(var u=0;u<s;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:c,type:e.type,key:o,ref:i,props:r,_owner:l}},u.createContext=function(e){return(e={$$typeof:g,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:h,_context:e},e.Consumer=e},u.createElement=L,u.createFactory=function(e){var t=L.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:v,render:e}},u.isValidElement=P,u.lazy=function(e){return{$$typeof:x,_payload:{_status:-1,_result:e},_init:F}},u.memo=function(e,t){return{$$typeof:y,type:e,compare:void 0===t?null:t}},u.startTransition=function(e){var t=H.transition;H.transition={};try{e()}finally{H.transition=t}},u.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},u.useCallback=function(e,t){return B.current.useCallback(e,t)},u.useContext=function(e){return B.current.useContext(e)},u.useDebugValue=function(){},u.useDeferredValue=function(e){return B.current.useDeferredValue(e)},u.useEffect=function(e,t){return B.current.useEffect(e,t)},u.useId=function(){return B.current.useId()},u.useImperativeHandle=function(e,t,n){return B.current.useImperativeHandle(e,t,n)},u.useInsertionEffect=function(e,t){return B.current.useInsertionEffect(e,t)},u.useLayoutEffect=function(e,t){return B.current.useLayoutEffect(e,t)},u.useMemo=function(e,t){return B.current.useMemo(e,t)},u.useReducer=function(e,t,n){return B.current.useReducer(e,t,n)},u.useRef=function(e){return B.current.useRef(e)},u.useState=function(e){return B.current.useState(e)},u.useSyncExternalStore=function(e,t,n){return B.current.useSyncExternalStore(e,t,n)},u.useTransition=function(){return B.current.useTransition()},u.version="18.2.0",s.exports=u;var j=s.exports,K=i(j),U=t({__proto__:null,default:K},[j]),Y={exports:{}},G={};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* scheduler.production.min.js
|
package/dist/sn-text.systemjs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-text v1.1.
|
|
2
|
+
* @nebula.js/sn-text v1.1.6
|
|
3
3
|
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
System.register(["@nebula.js/stardust","react-dom","react"],(function(e){"use strict";var t,n,r,o,i,l,a,s,u,c,d,p,f,m,g,h,v,b,y,x,_,E,C,w,S,k;return{setters:[function(e){t=e.useMemo,n=e.useEffect,r=e.useElement,o=e.useStaleLayout,i=e.useModel,l=e.useInteractionState,a=e.useEmitter,s=e.useTranslator,u=e.useState,c=e.useTheme,d=e.useImperativeHandle},function(e){p=e.default,f=e},function(e){m=e.createContext,g=e.default,h=e,v=e.forwardRef,b=e.useContext,y=e.Children,x=e.isValidElement,_=e.cloneElement,E=e.useState,C=e.useEffect,w=e.useCallback,S=e.useRef,k=e.useMemo}],execute:function(){e("default",(function(e){const t=new qT,{flags:p}=e;return{qae:{properties:T,data:A(t)},component(){const e=r(),f=L(e),m=o(),g=i(),h=l(),v=a(),b=s(),[y,x]=u(!1),[_,E]=u(void 0),[C,w]=u(1),S=c(),[k,T]=u(!1),[A,N]=u(null),R=e=>{e||w(0),yk(m)||(!0===e&&T(!0),x(e),v.emit("njs-internal-edit-change",e))};n((()=>{const e=e=>{!async function(e,t){!async function(e,t){try{if(e&&t){const n=t(await e.getProperties());await e.setProperties(n)}}catch(e){console.error(e)}}(e,(e=>{const{qHyperCubeDef:n}=e;if(n){var r;const e=null===(r=n.qMeasures)||void 0===r?void 0:r.filter((e=>{const n=null==t?void 0:t.find((t=>{var n;return t===(null==e||null===(n=e.qDef)||void 0===n?void 0:n.cId)}));return!n}));n.qMeasures=e,n.qInterColumnSortOrder=[]}return{...e,qHyperCubeDef:n}}))}(g,e)};return v.on("onNodeDestroyed",e),()=>{v.removeListener("onNodeDestroyed",e)}}),[v,g]),n((()=>{2===C&&h.edit&&h.select&&R(!0)}),[C,h]),n((()=>{m&&void 0===_&&(E(m.text||null),N(null==m?void 0:m.text))}),[m,_]),n((()=>{const n=()=>{h.edit&&h.select&&w((e=>e+1))},r=t=>{const n=document.getElementById(YT(g));e.contains(t.target)||null!=n&&n.contains(t.target)||(e=>{const t=document.getElementsByClassName("tekPopperMenu"),n=document.getElementById("tekTableMenu");if(null!=n&&n.contains(e))return!0;for(let n=0;n<t.length;n++)if(t[n].contains(e))return!0;return!1})(t.target)||R(!1)};if(!h.edit||!h.select){var o;R(!1);const e=(null==g?void 0:g.id)&&(null===(o=t.getSnTexts()[g.id])||void 0===o?void 0:o.propertiesHaveBeenModified);(k||e)&&(v.emit("saveDocument"),t.setPropertiesHaveBeenModified(g.id,!1))}return e.addEventListener("click",n),document.addEventListener("mousedown",r),()=>{e.removeEventListener("click",n),document.removeEventListener("mousedown",r)}}),[e,h,g]),n((()=>{QT({rootElement:f,layout:m,model:g,element:e,edit:y,initialData:_,emitter:v,lang:b.language(),flags:p,theme:S})}),[m,f,g,e,y,e,_,v,p,S]),n((()=>{!y&&k&&v.emit("saveDocument")}),[y,v,k]),n((()=>{if(m){const e=m;e.text&&e.text!==A&&(N(e.text),v.emit("reloadData",e.text))}}),[m,A,v]),d((()=>({updateActiveState(e){e?t.setSelectedModelId(g.id):g.id===t.getSelectedModelId()&&t.setSelectedModelId(void 0)}})),[])},ext:{definition:{type:"items",component:"accordion",items:{data:JT,settings:XT}},exportProperties:null,importProperties:null,support:{snapshot:!0,export:!0,sharing:!0,exportData:!0,viewData:!1}}}}));const T={version:"1.1.5",showTitles:!1,text:null,fontsUsed:[],components:[],qHyperCubeDef:{qDimensions:[],qMeasures:[],qSuppressZero:!1,qSuppressMissing:!0,qInitialDataFetch:[{qWidth:500,qHeight:10}]}},A=e=>{const t=()=>{e.setPropertiesHaveBeenModifiedForSelectedModel(!0)};return{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:0,max:10,added(e){e.qDef={...e.qDef,qAggrFunc:"None"},t()},removed:t,replaced:t,moved:t}}]}};var N,R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M=p;N=M.createRoot,M.hydrateRoot;const L=e=>{const r=t((()=>N(e)),[e]);return n((()=>()=>{null==r||r.unmount()}),[r]),r},P=m({layout:void 0,model:void 0,element:void 0,edit:!1,initialData:void 0,emitter:void 0,lang:"en",flags:{isEnabled:()=>!1},theme:null});var I={},D={},$={},z={};let B={},F={},H={},W={},j={},K={},Y={},G={},U={},V={},Q={},J={},X={},q={},Z={},ee={},te={},ne={},re={},oe={},ie={},le={},ae={},se={},ue={},ce={},de={},pe={},fe={},me={},ge={},he={},ve={},be={},ye={};function xe(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let _e="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ee=_e&&"documentMode"in document?document.documentMode:null,Ce=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),we=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Se=!(!_e||!("InputEvent"in window)||Ee)&&"getTargetRanges"in new window.InputEvent("input"),ke=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Te=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ae=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ne=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ae,Re=ke||Te||Ne?" ":"",Oe=we?" ":Re,Me=/^[^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]/,Le=/^[^\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]/,Pe={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},Ie={directionless:1,unmergeable:2},De={center:2,end:6,justify:4,left:1,right:3,start:5},$e={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},ze={normal:0,segmented:2,token:1},Be={0:"normal",2:"segmented",1:"token"},Fe=!1,He=0;function We(e){He=e.timeStamp}function je(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function Ke(e,t,n){Fe=!0;let r=100<performance.now()-He;try{uo(e,(()=>{let o=zr()||function(e){return e.getEditorState().read((()=>{let e=zr();return null!==e?e.clone():null}))}(e);var i=new Map,l=e.getRootElement(),a=e._editorState,s=e._blockCursorElement;let u=!1,c="";for(var d=0;d<t.length;d++){var p=t[d],f=p.type,m=p.target,g=mt(m,a);if(!(null===g&&m!==l||po(g)))if("characterData"===f){if(p=r&&fr(g))e:{f=m;var h=g;if(Er(p=o)){var v=p.anchor.getNode();if(v.is(h)&&p.format!==v.getFormat()){p=!1;break e}}p=3===f.nodeType&&h.isAttached()}p&&(f=p=null,null!==(h=jt(e._window))&&h.anchorNode===m&&(p=h.anchorOffset,f=h.focusOffset),null!==(m=m.nodeValue)&&wt(g,m,p,f,!1))}else if("childList"===f){for(u=!0,f=p.addedNodes,h=0;h<f.length;h++){var b=ft(v=f[h]),y=v.parentNode;null==y||v===s||null!==b||"BR"===v.nodeName&&je(v,y,e)||(we&&(b=v.innerText||v.nodeValue)&&(c+=b),y.removeChild(v))}if(0<(f=(p=p.removedNodes).length)){for(h=0,v=0;v<f;v++)("BR"===(y=p[v]).nodeName&&je(y,m,e)||s===y)&&(m.appendChild(y),h++);f!==h&&(m===l&&(g=a._nodeMap.get("root")),i.set(m,g))}}}if(0<i.size)for(let[t,n]of i)if(mo(n))for(i=n.getChildrenKeys(),l=t.firstChild,a=0;a<i.length;a++)null!==(s=e.getElementByKey(i[a]))&&(null==l?(t.appendChild(s),l=s):l!==s&&t.replaceChild(s,l),l=l.nextSibling);else fr(n)&&n.markDirty();if(0<(i=n.takeRecords()).length){for(l=0;l<i.length;l++)for(a=(s=i[l]).addedNodes,s=s.target,d=0;d<a.length;d++)null==(m=(g=a[d]).parentNode)||"BR"!==g.nodeName||je(g,s,e)||m.removeChild(g);n.takeRecords()}null!==o&&(u&&(o.dirty=!0,bt(o)),we&&Rt(e)&&o.insertRawText(c))}))}finally{Fe=!1}}function Ye(e){let t=e._observer;if(null!==t){Ke(e,t.takeRecords(),t)}}function Ge(e){0===He&&It(e).addEventListener("textInput",We,!0),e._observer=new MutationObserver(((t,n)=>{Ke(e,t,n)}))}function Ue(e,t){let n=e.__mode,r=e.__format;e=e.__style;let o=t.__mode,i=t.__format;return t=t.__style,!(null!==n&&n!==o||null!==r&&r!==i||null!==e&&e!==t)}function Ve(e,t){let n=e.mergeWithSibling(t),r=eo()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Qe(e){if(""===e.__text&&e.isSimpleText()&&!e.isUnmergeable())e.remove();else{for(var t;null!==(t=e.getPreviousSibling())&&fr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){Ue(t,e)&&(e=Ve(t,e));break}t.remove()}for(var n;null!==(n=e.getNextSibling())&&fr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){Ue(e,n)&&Ve(e,n);break}n.remove()}}}function Je(e){return Xe(e.anchor),Xe(e.focus),e}function Xe(e){for(;"element"===e.type;){var t=e.getNode(),n=e.offset;if(n===t.getChildrenSize()?(t=t.getChildAtIndex(n-1),n=!0):(t=t.getChildAtIndex(n),n=!1),fr(t)){e.set(t.__key,n?t.getTextContentSize():0,"text");break}if(!mo(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element")}}let qe=1,Ze="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function et(e){let t=document.activeElement;if(null===t)return!1;let n=t.nodeName;return po(mt(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function tt(e,t,n){let r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!et(t)&&nt(t)===e}catch(e){return!1}}function nt(e){for(;null!=e;){let t=e.__lexicalEditor;if(null!=t)return t;e=Lt(e)}return null}function rt(e){return e.isToken()||e.isSegmented()}function ot(e){for(;null!=e;){if(3===e.nodeType)return e;e=e.firstChild}return null}function it(e,t,n){return e&(t=Pe[t])&&(null===n||0==(n&t))?e^t:null===n||n&t?e|t:e}function lt(e){return fr(e)||Xn(e)||po(e)}function at(e,t){if(null!=t)e.__key=t;else{qr(),99<Qr&&xe(14),t=eo();var n=Zr(),r=""+qe++;n._nodeMap.set(r,e),mo(e)?t._dirtyElements.set(r,!0):t._dirtyLeaves.add(r),t._cloneNotNeeded.add(r),t._dirtyType=1,e.__key=r}}function st(e){var t=e.getParent();if(null!==t){let o=e.getWritable();t=t.getWritable();var n=e.getPreviousSibling();if(e=e.getNextSibling(),null===n)if(null!==e){var r=e.getWritable();t.__first=e.__key,r.__prev=null}else t.__first=null;else{if(r=n.getWritable(),null!==e){let t=e.getWritable();t.__prev=r.__key,r.__next=t.__key}else r.__next=null;o.__prev=null}null===e?null!==n?(e=n.getWritable(),t.__last=n.__key,e.__next=null):t.__last=null:(e=e.getWritable(),null!==n?((n=n.getWritable()).__next=e.__key,e.__prev=n.__key):e.__prev=null,o.__next=null),t.__size--,o.__parent=null}}function ut(e){99<Qr&&xe(14);var t=e.getLatest(),n=t.__parent,r=Zr();let o=eo(),i=r._nodeMap;if(r=o._dirtyElements,null!==n)e:for(;null!==n&&!r.has(n);){let e=i.get(n);if(void 0===e)break;r.set(n,!1),n=e.__parent}t=t.__key,o._dirtyType=1,mo(e)?r.set(t,!0):o._dirtyLeaves.add(t)}function ct(e){qr();var t=eo();let n=t._compositionKey;e!==n&&(t._compositionKey=e,null!==n&&(null!==(t=pt(n))&&t.getWritable()),null!==e&&(null!==(e=pt(e))&&e.getWritable()))}function dt(){return Xr()?null:eo()._compositionKey}function pt(e,t){return void 0===(e=(t||Zr())._nodeMap.get(e))?null:e}function ft(e,t){return void 0!==(e=e[`__lexicalKey_${eo()._key}`])?pt(e,t):null}function mt(e,t){for(;null!=e;){let n=ft(e,t);if(null!==n)return n;e=Lt(e)}return null}function gt(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t}function ht(e){return e.read((()=>vt().getTextContent()))}function vt(){return Zr()._nodeMap.get("root")}function bt(e){qr();let t=Zr();null!==e&&(e.dirty=!0,e._cachedNodes=null),t._selection=e}function yt(e){var t,n=eo();e:{for(t=e;null!=t;){let e=t[`__lexicalKey_${n._key}`];if(void 0!==e){t=e;break e}t=Lt(t)}t=null}return null===t?e===(n=n.getRootElement())?pt("root"):null:pt(t)}function xt(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function _t(e){let t=[];for(;null!==e;)t.push(e),e=e._parentEditor;return t}function Et(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ct(e,t,n){if(null!==(t=jt(t._window))){var r=t.anchorNode,{anchorOffset:o,focusOffset:i}=t;if(null!==r&&(t=3===r.nodeType?r.nodeValue:null,r=mt(r),null!==t&&fr(r))){if(t===Re&&n){t=n,i=o=n.length}null!==t&&wt(r,t,o,i,e)}}}function wt(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){let u=i.isComposing(),c=t;if((u||o)&&t[t.length-1]===Re&&(c=t.slice(0,-1)),t=i.getTextContent(),o||c!==t)if(""===c)if(ct(null),ke||Te||Ne)i.remove();else{let e=eo();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}else{o=i.getParent(),t=Br();var l=i.getTextContentSize(),a=dt(),s=i.getKey();i.isToken()||null!==a&&s===a&&!u||Er(t)&&(null!==o&&!o.canInsertTextBefore()&&0===t.anchor.offset||t.anchor.key===e.__key&&0===t.anchor.offset&&!i.canInsertTextBefore()||t.focus.key===e.__key&&t.focus.offset===l&&!i.canInsertTextAfter())?i.markDirty():(Er(e=zr())&&null!==n&&null!==r&&(e.setTextNodeRange(i,n,i,r),i.isSegmented()&&(n=pr(n=i.getTextContent()),i.replace(n),i=n)),i.setTextContent(c))}}}function St(){var e=vt();bt(Je(e=e.select(0,e.getChildrenSize())))}function kt(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];return void 0!==r?r:"string"==typeof(e=e[t])?(e=e.split(" "),n[t]=e):e}function Tt(e,t,n,r,o){0!==n.size&&(n=r.__type,r=r.__key,void 0===(t=t.get(n))&&xe(33,n),n=t.klass,void 0===(t=e.get(n))&&(t=new Map,e.set(n,t)),n="destroyed"===(e=t.get(r))&&"created"===o,(void 0===e||n)&&t.set(r,n?"updated":o))}function At(e,t,n){let r=e.getParent(),o=n;return null!==r&&(t&&0===n?(o=e.getIndexWithinParent(),e=r):t||n!==e.getChildrenSize()||(o=e.getIndexWithinParent()+1,e=r)),e.getChildAtIndex(t?o-1:o)}function Nt(e,t){var n=e.offset;return"element"===e.type?At(e=e.getNode(),t,n):(e=e.getNode(),t&&0===n||!t&&n===e.getTextContentSize()?null===(n=t?e.getPreviousSibling():e.getNextSibling())?At(e.getParentOrThrow(),t,e.getIndexWithinParent()+(t?0:1)):n:null)}function Rt(e){return"insertFromPaste"===(e=(e=It(e).event)&&e.inputType)||"insertFromPasteAsQuotation"===e}function Ot(e){return!vo(e)&&!e.isLastChild()&&!e.isInline()}function Mt(e,t){return void 0===(e=e._keyToDOMMap.get(t))&&xe(75,t),e}function Lt(e){return null!==(e=e.assignedSlot||e.parentElement)&&11===e.nodeType?e.host:e}function Pt(e,t){for(e=e.getParent();null!==e;){if(e.is(t))return!0;e=e.getParent()}return!1}function It(e){return null===(e=e._window)&&xe(78),e}function Dt(e){for(e=e.getParentOrThrow();null!==e&&!$t(e);)e=e.getParentOrThrow();return e}function $t(e){return vo(e)||mo(e)&&e.isShadowRoot()}function zt(e){return at(e=e.constructor.clone(e),null),e}function Bt(e){var t=eo();let n=e.constructor.getType();return void 0===(t=t._nodes.get(n))&&xe(97),null!==(t=t.replace)?((t=t(e))instanceof e.constructor||xe(98),t):e}function Ft(e,t){!vo(e=e.getParent())||mo(t)||po(t)||xe(99)}function Ht(e){return(po(e)||mo(e)&&!e.canBeEmpty())&&!e.isInline()}function Wt(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null,null!==(t=e.parentElement)&&t.removeChild(e)}function jt(e){return _e?(e||window).getSelection():null}function Kt(e,t){let n=e.getChildAtIndex(t);null==n&&(n=e),$t(e)&&xe(102);let r=e=>{const t=e.getParentOrThrow(),o=$t(t),i=e!==n||o?zt(e):e;if(o)return e.insertAfter(i),[e,i,i];const[l,a,s]=r(t);return e=e.getNextSiblings(),s.append(i,...e),[l,a,i]},[o,i]=r(n);return[o,i]}function Yt(e,t){for(;e!==vt()&&null!=e;){if(t(e))return e;e=e.getParent()}return null}function Gt(e){let t=[],n=[e];for(;0<n.length;){let r=n.pop();void 0===r&&xe(112),mo(r)&&n.unshift(...r.getChildren()),r!==e&&t.push(r)}return t}function Ut(e,t,n,r,o,i){for(e=e.getFirstChild();null!==e;){let l=e.__key;e.__parent===t&&(mo(e)&&Ut(e,l,n,r,o,i),n.has(l)||i.delete(l),o.push(l)),e=e.getNextSibling()}}let Vt,Qt,Jt,Xt,qt,Zt,en,tn,nn,rn,on="",ln="",an="",sn=!1,un=!1,cn=null;function dn(e,t){let n=en.get(e);if(null!==t){let n=Sn(e);n.parentNode===t&&t.removeChild(n)}tn.has(e)||Qt._keyToDOMMap.delete(e),mo(n)&&pn(e=_n(n,en),0,e.length-1,null),void 0!==n&&Tt(rn,Jt,Xt,n,"destroyed")}function pn(e,t,n,r){for(;t<=n;++t){let n=e[t];void 0!==n&&dn(n,r)}}function fn(e,t){e.setProperty("text-align",t)}function mn(e,t){var n=Vt.theme.indent;if("string"==typeof n){let r=e.classList.contains(n);0<t&&!r?e.classList.add(n):1>t&&r&&e.classList.remove(n)}n=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||"40px",e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${n})`)}function gn(e,t){e=e.style,0===t?fn(e,""):1===t?fn(e,"left"):2===t?fn(e,"center"):3===t?fn(e,"right"):4===t?fn(e,"justify"):5===t?fn(e,"start"):6===t&&fn(e,"end")}function hn(e,t,n){let r=tn.get(e);void 0===r&&xe(60);let o=r.createDOM(Vt,Qt);var i=Qt._keyToDOMMap;if(o["__lexicalKey_"+Qt._key]=e,i.set(e,o),fr(r)?o.setAttribute("data-lexical-text","true"):po(r)&&o.setAttribute("data-lexical-decorator","true"),mo(r)){if(e=r.__indent,i=r.__size,0!==e&&mn(o,e),0!==i){--i,e=_n(r,tn);var l=ln;ln="",vn(e,r,0,i,o,null),xn(r,o),ln=l}0!==(e=r.__format)&&gn(o,e),r.isInline()||yn(null,r,o),Ot(r)&&(on+="\n\n",an+="\n\n")}else i=r.getTextContent(),po(r)?(null!==(l=r.decorate(Qt,Vt))&&Cn(e,l),o.contentEditable="false"):fr(r)&&(r.isDirectionless()||(ln+=i)),on+=i,an+=i;return null!==t&&(null!=n?t.insertBefore(o,n):null!=(n=t.__lexicalLineBreak)?t.insertBefore(o,n):t.appendChild(o)),Tt(rn,Jt,Xt,r,"created"),o}function vn(e,t,n,r,o,i){let l=on;for(on="";n<=r;++n)hn(e[n],o,i);Ot(t)&&(on+="\n\n"),o.__lexicalTextContent=on,on=l+on}function bn(e,t){return Xn(e=t.get(e))||po(e)&&e.isInline()}function yn(e,t,n){e=null!==e&&(0===e.__size||bn(e.__last,en)),t=0===t.__size||bn(t.__last,tn),e?t||(null!=(t=n.__lexicalLineBreak)&&n.removeChild(t),n.__lexicalLineBreak=null):t&&(t=document.createElement("br"),n.__lexicalLineBreak=t,n.appendChild(t))}function xn(e,t){var n=t.__lexicalDir;if(t.__lexicalDirTextContent!==ln||n!==cn){let i=""===ln;if(i)var r=cn;else r=ln,r=Me.test(r)?"rtl":Le.test(r)?"ltr":null;if(r!==n){let l=t.classList,a=Vt.theme;var o=null!==n?a[n]:void 0;let s=null!==r?a[r]:void 0;void 0!==o&&("string"==typeof o&&(o=o.split(" "),o=a[n]=o),l.remove(...o)),null===r||i&&"ltr"===r?t.removeAttribute("dir"):(void 0!==s&&("string"==typeof s&&(n=s.split(" "),s=a[r]=n),void 0!==s&&l.add(...s)),t.dir=r),un||(e.getWritable().__dir=r)}cn=r,t.__lexicalDirTextContent=ln,t.__lexicalDir=r}}function _n(e,t){let n=[];for(e=e.__first;null!==e;){let r=t.get(e);void 0===r&&xe(101),n.push(e),e=r.__next}return n}function En(e,t){var n=en.get(e),r=tn.get(e);void 0!==n&&void 0!==r||xe(61);var o=sn||Zt.has(e)||qt.has(e);let i=Mt(Qt,e);if(n===r&&!o)return mo(n)?(void 0!==(r=i.__lexicalTextContent)&&(on+=r,an+=r),void 0!==(r=i.__lexicalDirTextContent)&&(ln+=r)):(r=n.getTextContent(),fr(n)&&!n.isDirectionless()&&(ln+=r),an+=r,on+=r),i;if(n!==r&&o&&Tt(rn,Jt,Xt,r,"updated"),r.updateDOM(n,i,Vt))return r=hn(e,null,null),null===t&&xe(62),t.replaceChild(r,i),dn(e,null),r;if(mo(n)&&mo(r)){if((e=r.__indent)!==n.__indent&&mn(i,e),(e=r.__format)!==n.__format&&gn(i,e),o){e=r,o=ln,ln="",t=on;var l=n.__size,a=e.__size;if(on="",1===l&&1===a){var s=n.__first,u=e.__first;if(s===u)En(s,i);else{var c=Sn(s);u=hn(u,null,null),i.replaceChild(u,c),dn(s,null)}}else{u=_n(n,en);var d=_n(e,tn);if(0===l)0!==a&&vn(d,e,0,a-1,i,null);else if(0===a)0!==l&&(pn(u,0,l-1,(s=null==i.__lexicalLineBreak)?null:i),s&&(i.textContent=""));else{var p=u;u=d,d=l-1,l=a-1;let t=i.firstChild,n=0;for(a=0;n<=d&&a<=l;){var f=p[n];let e=u[a];if(f===e)t=wn(En(e,i)),n++,a++;else{void 0===s&&(s=new Set(p)),void 0===c&&(c=new Set(u));let r=c.has(f),o=s.has(e);r?(o?((f=Mt(Qt,e))===t?t=wn(En(e,i)):(null!=t?i.insertBefore(f,t):i.appendChild(f),En(e,i)),n++):hn(e,i,t),a++):(t=wn(Sn(f)),dn(f,i),n++)}}c=a>l,(s=n>d)&&!c?vn(u,e,a,l,i,s=void 0===(s=u[l+1])?null:Qt.getElementByKey(s)):c&&!s&&pn(p,n,d,i)}}Ot(e)&&(on+="\n\n"),i.__lexicalTextContent=on,on=t+on,xn(e,i),ln=o,vo(r)||r.isInline()||yn(n,r,i)}Ot(r)&&(on+="\n\n",an+="\n\n")}else n=r.getTextContent(),po(r)?null!==(o=r.decorate(Qt,Vt))&&Cn(e,o):fr(r)&&!r.isDirectionless()&&(ln+=n),on+=n,an+=n;return!un&&vo(r)&&r.__cachedText!==an&&((r=r.getWritable()).__cachedText=an),i}function Cn(e,t){let n=Qt._pendingDecorators,r=Qt._decorators;if(null===n){if(r[e]===t)return;n=gt(Qt)}n[e]=t}function wn(e){return null!==(e=e.nextSibling)&&e===Qt._blockCursorElement&&(e=e.nextSibling),e}function Sn(e){let t=nn.get(e);return void 0===t&&xe(75,e),t}let kn=Object.freeze({}),Tn=[["keydown",function(e,t){if(An=e.timeStamp,Nn=e.keyCode,!t.isComposing()){var{keyCode:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:l}=e;if(!lo(t,q,e)){if(39!==n||o||i||l)if(39!==n||l||r||!o&&!i)if(37!==n||o||i||l)if(37!==n||l||r||!o&&!i)if(38!==n||o||i)if(40!==n||o||i)if(13===n&&r)In=!0,lo(t,ie,e);else if(32===n)lo(t,le,e);else if(Ce&&o&&79===n)e.preventDefault(),In=!0,lo(t,W,!0);else if(13!==n||r)if(Ce?l||i||!(8===n||72===n&&o):o||l||i||8!==n)if(27===n)lo(t,se,e);else if(Ce?r||l||i||!(46===n||68===n&&o):o||l||i||46!==n)if(8===n&&(Ce?l:o))e.preventDefault(),lo(t,U,!0);else if(46===n&&(Ce?l:o))e.preventDefault(),lo(t,U,!1);else if(Ce&&i&&8===n)e.preventDefault(),lo(t,V,!0);else if(Ce&&i&&46===n)e.preventDefault(),lo(t,V,!1);else if(66===n&&!l&&(Ce?i:o))e.preventDefault(),lo(t,Q,"bold");else if(85===n&&!l&&(Ce?i:o))e.preventDefault(),lo(t,Q,"underline");else if(73===n&&!l&&(Ce?i:o))e.preventDefault(),lo(t,Q,"italic");else if(9!==n||l||o||i)if(90===n&&!r&&(Ce?i:o))e.preventDefault(),lo(t,J,void 0);else{var a=Ce?90===n&&i&&r:89===n&&o||90===n&&o&&r;a?(e.preventDefault(),lo(t,X,void 0)):kr(t._editorState._selection)?(a=!r&&(67===n&&(Ce?i:o)))?(e.preventDefault(),lo(t,ge,e)):(a=!r&&(88===n&&(Ce?i:o)))?(e.preventDefault(),lo(t,he,e)):65===n&&(Ce?i:o)&&(e.preventDefault(),t.update((()=>{St()}))):!we&&65===n&&(Ce?i:o)&&(e.preventDefault(),t.update((()=>{St()})))}else lo(t,ce,e);else 46===n?lo(t,ue,e):(e.preventDefault(),lo(t,H,!1));else 8===n?lo(t,ae,e):(e.preventDefault(),lo(t,H,!0));else In=!1,lo(t,ie,e);else lo(t,oe,e);else lo(t,re,e);else lo(t,ne,e);else lo(t,te,e);else lo(t,ee,e);else lo(t,Z,e);(o||r||l||i)&&lo(t,ye,e)}}}],["pointerdown",function(e,t){let n=e.target;e=e.pointerType,n instanceof Node&&"touch"!==e&&uo(t,(()=>{po(mt(n))||(Pn=!0)}))}],["compositionstart",function(e,t){uo(t,(()=>{let n=zr();if(Er(n)&&!t.isComposing()){let r=n.anchor,o=n.anchor.getNode();ct(r.key),(e.timeStamp<An+30||"element"===r.type||!n.isCollapsed()||o.getFormat()!==n.format||o.getStyle()!==n.style)&&lo(t,K,Oe)}}))}],["compositionend",function(e,t){we?Dn=!0:uo(t,(()=>{Wn(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),uo(t,(()=>{var n=zr(),r=e.data,o=Hn(e);if(null!=r&&Er(n)&&zn(n,o,r,e.timeStamp,!1)){Dn&&(Wn(t,r),Dn=!1);var i=n.anchor,l=i.getNode();if(null===(o=jt(t._window)))return;let a=i.offset;(i=Se&&!n.isCollapsed()&&fr(l)&&null!==o.anchorNode)&&(i=(l=l.getTextContent().slice(0,a)+r+l.getTextContent().slice(a+n.focus.offset))===(3===(o=o.anchorNode).nodeType?o.nodeValue:null)),i||lo(t,K,r),r=r.length,we&&1<r&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=r),ke||Te||Ne||!t.isComposing()||(An=0,ct(null))}else Ct(!1,t,null!==r?r:void 0),Dn&&(Wn(t,r||void 0),Dn=!1);qr(),Ye(n=eo())})),On=null}],["click",function(e,t){uo(t,(()=>{let n=zr();var r=jt(t._window);let o=Br();if(r)if(Er(n)){let t=n.anchor;var i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!vo(i)&&1===vt().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==(r=n.focus.getNode())&&(mo(i)?i.select(0):i.getParentOrThrow().select(0))}else"touch"===e.pointerType&&(null!==(i=r.anchorNode)&&(1===(i=i.nodeType)||3===i))&&bt(r=$r(o,r,t));lo(t,F,e)}))}],["cut",kn],["copy",kn],["dragstart",kn],["dragover",kn],["dragend",kn],["paste",kn],["focus",kn],["blur",kn],["drop",kn]];Se&&Tn.push(["beforeinput",(e,t)=>function(e,t){let n=e.inputType,r=Hn(e);"deleteCompositionText"===n||we&&Rt(t)||"insertCompositionText"!==n&&uo(t,(()=>{let o=zr();if("deleteContentBackward"===n){if(null===o){var i=Br();if(!Er(i))return;bt(i.clone())}if(Er(o))return void(229===Nn&&e.timeStamp<An+30&&t.isComposing()&&o.anchor.key===o.focus.key?(ct(null),An=0,setTimeout((()=>{uo(t,(()=>{ct(null)}))}),30),Er(o)&&(i=o.anchor.getNode(),i.markDirty(),o.format=i.getFormat(),o.style=i.getStyle())):(e.preventDefault(),lo(t,H,!0)))}if(Er(o)){i=e.data,null!==On&&Ct(!1,t,On),o.dirty&&null===On||!o.isCollapsed()||vo(o.anchor.getNode())||null===r||o.applyDOMRange(r),On=null;var l=o.focus,a=o.anchor.getNode();if(l=l.getNode(),"insertText"===n||"insertTranspose"===n)"\n"===i?(e.preventDefault(),lo(t,W,!1)):"\n\n"===i?(e.preventDefault(),lo(t,j,void 0)):null==i&&e.dataTransfer?(i=e.dataTransfer.getData("text/plain"),e.preventDefault(),o.insertRawText(i)):null!=i&&zn(o,r,i,e.timeStamp,!0)?(e.preventDefault(),lo(t,K,i)):On=i,Rn=e.timeStamp;else switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":lo(t,K,e);break;case"insertFromComposition":ct(null),lo(t,K,e);break;case"insertLineBreak":ct(null),lo(t,W,!1);break;case"insertParagraph":ct(null),In&&!Te?(In=!1,lo(t,W,!1)):lo(t,j,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":lo(t,Y,e);break;case"deleteByComposition":(function(e,t){return e!==t||mo(e)||mo(t)||!e.isToken()||!t.isToken()})(a,l)&&lo(t,G,e);break;case"deleteByDrag":case"deleteByCut":lo(t,G,e);break;case"deleteContent":lo(t,H,!1);break;case"deleteWordBackward":lo(t,U,!0);break;case"deleteWordForward":lo(t,U,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":lo(t,V,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":lo(t,V,!1);break;case"formatStrikeThrough":lo(t,Q,"strikethrough");break;case"formatBold":lo(t,Q,"bold");break;case"formatItalic":lo(t,Q,"italic");break;case"formatUnderline":lo(t,Q,"underline");break;case"historyUndo":lo(t,J,void 0);break;case"historyRedo":lo(t,X,void 0)}}}))}(e,t)]);let An=0,Nn=0,Rn=0,On=null,Mn=0,Ln=!1,Pn=!1,In=!1,Dn=!1,$n=[0,"",0,"root",0];function zn(e,t,n,r,o){let i=e.anchor,l=e.focus,a=i.getNode();var s=eo();let u=jt(s._window),c=null!==u?u.anchorNode:null,d=i.key;s=s.getElementByKey(d);let p=n.length;return d!==l.key||!fr(a)||(!o&&(!Se||Rn<r+50)||a.isDirty()&&2>p||xt(n))&&i.offset!==l.offset&&!a.isComposing()||rt(a)||a.isDirty()&&1<p||(o||!Se)&&null!==s&&!a.isComposing()&&c!==ot(s)||null!==u&&null!==t&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;e=e.anchor.offset;let n=t.getParentOrThrow(),r=t.isToken();return 0===e?((e=!t.canInsertTextBefore()||!n.canInsertTextBefore()||r)||(e=(fr(t=t.getPreviousSibling())||mo(t)&&t.isInline())&&!t.canInsertTextAfter()),e):e===t.getTextContentSize()&&(!t.canInsertTextAfter()||!n.canInsertTextAfter()||r)}(e,a)}function Bn(e,t){return null!==e&&null!==e.nodeValue&&3===e.nodeType&&0!==t&&t!==e.nodeValue.length}function Fn(e,t,n){let{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:l}=e;Ln&&(Ln=!1,Bn(r,o)&&Bn(i,l))||uo(t,(()=>{if(n){if(tt(t,r,i)){var o=zr();if(Er(o)){var l=o.anchor,a=l.getNode();if(o.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(o.dirty=!0);var s=It(t).event;s=s?s.timeStamp:performance.now();let[n,r,i,u,c]=$n;s<c+200&&l.offset===i&&l.key===u?(o.format=n,o.style=r):"text"===l.type?(o.format=a.getFormat(),o.style=a.getStyle()):"element"===l.type&&(o.format=0,o.style="")}else{l=255,a=!1;let e=(s=o.getNodes()).length;for(let t=0;t<e;t++){let e=s[t];if(fr(e)&&(a=!0,0===(l&=e.getFormat())))break}o.format=a?l:0}}lo(t,B,void 0)}}else bt(null)}))}function Hn(e){return e.getTargetRanges?0===(e=e.getTargetRanges()).length?null:e[0]:null}function Wn(e,t){var n=e._compositionKey;if(ct(null),null!==n&&null!=t){if(""===t)return t=pt(n),void(null!==(e=ot(e.getElementByKey(n)))&&null!==e.nodeValue&&fr(t)&&wt(t,e.nodeValue,null,null,!0));if("\n"===t[t.length-1]&&Er(n=zr()))return t=n.focus,n.anchor.set(t.key,t.offset,t.type),void lo(e,ie,null)}Ct(!0,e,t)}function jn(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}let Kn=new Map;function Yn(e){let t=jt(null==(e=e.target)?null:9===e.nodeType?e.defaultView:e.ownerDocument.defaultView);if(null!==t){var n=nt(t.anchorNode);if(null!==n){Pn&&(Pn=!1,uo(n,(()=>{var e=Br(),r=t.anchorNode;null!==r&&(1===(r=r.nodeType)||3===r)&&bt(e=$r(e,t,n))})));var r=(e=(e=_t(n))[e.length-1])._key,o=Kn.get(r),i=o||e;i!==n&&Fn(t,i,!1),Fn(t,n,!0),n!==e?Kn.set(r,n):o&&Kn.delete(r)}}}function Gn(e,t,n){qr();var r=e.__key;let o=e.getParent();if(null!==o){var i=zr();if(Er(i)&&mo(e)){var{anchor:l,focus:a}=i,s=l.getNode(),u=a.getNode();Pt(s,e)&&l.set(e.__key,0,"element"),Pt(u,e)&&a.set(e.__key,0,"element")}if(u=!1,Er(s=i)&&t){i=s.anchor;let t=s.focus;i.key===r&&(Wr(i,e,o,e.getPreviousSibling(),e.getNextSibling()),u=!0),t.key===r&&(Wr(t,e,o,e.getPreviousSibling(),e.getNextSibling()),u=!0)}else kr(s)&&t&&e.isSelected()&&e.selectPrevious();Er(s)&&t&&!u?(r=e.getIndexWithinParent(),st(e),Fr(s,o,r,-1)):st(e),n||$t(o)||o.canBeEmpty()||!o.isEmpty()||Gn(o,t),t&&vo(o)&&o.isEmpty()&&o.selectEnd()}}class Un{static getType(){xe(64,this.name)}static clone(){xe(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,at(this,e)}getType(){return this.__type}isAttached(){for(var e=this.__key;null!==e;){if("root"===e)return!0;if(null===(e=pt(e)))break;e=e.__parent}return!1}isSelected(e){if(null==(e=e||zr()))return!1;let t=e.getNodes().some((e=>e.__key===this.__key));return(fr(this)||!Er(e)||"element"!==e.anchor.type||"element"!==e.focus.type||e.anchor.key!==e.focus.key||e.anchor.offset!==e.focus.offset)&&t}getKey(){return this.__key}getIndexWithinParent(){var e=this.getParent();if(null===e)return-1;e=e.getFirstChild();let t=0;for(;null!==e;){if(this.is(e))return t;t++,e=e.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return null===e?null:pt(e)}getParentOrThrow(){let e=this.getParent();return null===e&&xe(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){let t=e.getParent();if($t(t))return e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return null===e&&xe(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return null===e?null:pt(e)}getPreviousSiblings(){let e=[];var t=this.getParent();if(null===t)return e;for(t=t.getFirstChild();null!==t&&!t.is(this);)e.push(t),t=t.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return null===e?null:pt(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=this.getParents();var n=e.getParents();mo(this)&&t.unshift(this),mo(e)&&n.unshift(e),e=t.length;var r=n.length;if(0===e||0===r||t[e-1]!==n[r-1])return null;for(n=new Set(n),r=0;r<e;r++){let e=t[r];if(n.has(e))return e}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;var t=this.getCommonAncestor(e);let n=this;for(;;){var r=n.getParentOrThrow();if(r===t){r=n.getIndexWithinParent();break}n=r}for(n=e;;){if((e=n.getParentOrThrow())===t){t=n.getIndexWithinParent();break}n=e}return r<t}isParentOf(e){let t=this.__key;if(t===e.__key)return!1;for(;null!==e;){if(e.__key===t)return!0;e=e.getParent()}return!1}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set;for(var o=this;;){var i=o.__key;if(r.has(i)||(r.add(i),n.push(o)),o===e)break;if(null!==(i=mo(o)?t?o.getFirstChild():o.getLastChild():null))o=i;else if(null!==(i=t?o.getNextSibling():o.getPreviousSibling()))o=i;else{if(o=o.getParentOrThrow(),r.has(o.__key)||n.push(o),o===e)break;i=o;do{null===i&&xe(68),o=t?i.getNextSibling():i.getPreviousSibling(),null!==(i=i.getParent())&&(null!==o||r.has(i.__key)||n.push(i))}while(null===o)}}return t||n.reverse(),n}isDirty(){let e=eo()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){let e=pt(this.__key);return null===e&&xe(113),e}getWritable(){qr();var e=Zr(),t=eo();e=e._nodeMap;let n=this.__key,r=this.getLatest(),o=r.__parent;t=t._cloneNotNeeded;var i=zr();return null!==i&&(i._cachedNodes=null),t.has(n)?(ut(r),r):((i=r.constructor.clone(r)).__parent=o,i.__next=r.__next,i.__prev=r.__prev,mo(r)&&mo(i)?(i.__first=r.__first,i.__last=r.__last,i.__size=r.__size,i.__indent=r.__indent,i.__format=r.__format,i.__dir=r.__dir):fr(r)&&fr(i)&&(i.__format=r.__format,i.__style=r.__style,i.__mode=r.__mode,i.__detail=r.__detail),t.add(n),i.__key=n,ut(i),e.set(n,i),i)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){xe(70)}updateDOM(){xe(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){xe(72)}static importJSON(){xe(18,this.name)}static transform(){return null}remove(e){Gn(this,!0,e)}replace(e,t){qr();var n=zr();null!==n&&(n=n.clone()),Ft(this,e);let r=this.getLatest(),o=this.__key,i=e.__key,l=e.getWritable(),a=(e=this.getParentOrThrow().getWritable()).__size;st(l);let s=r.getPreviousSibling(),u=r.getNextSibling(),c=r.__prev,d=r.__next,p=r.__parent;return Gn(r,!1,!0),null===s?e.__first=i:s.getWritable().__next=i,l.__prev=c,null===u?e.__last=i:u.getWritable().__prev=i,l.__next=d,l.__parent=p,e.__size=a,t&&this.getChildren().forEach((e=>{l.append(e)})),Er(n)&&(bt(n),t=n.anchor,n=n.focus,t.key===o&&br(t,l),n.key===o&&br(n,l)),dt()===o&&ct(i),l}insertAfter(e,t=!0){qr(),Ft(this,e);var n=this.getWritable();let r=e.getWritable();var o=r.getParent();let i=zr();var l=!1,a=!1;if(null!==o){var s=e.getIndexWithinParent();st(r),Er(i)&&(a=o.__key,l=i.anchor,o=i.focus,l="element"===l.type&&l.key===a&&l.offset===s+1,a="element"===o.type&&o.key===a&&o.offset===s+1)}o=this.getNextSibling(),s=this.getParentOrThrow().getWritable();let u=r.__key,c=n.__next;return null===o?s.__last=u:o.getWritable().__prev=u,s.__size++,n.__next=u,r.__next=c,r.__prev=n.__key,r.__parent=n.__parent,t&&Er(i)&&(Fr(i,s,(t=this.getIndexWithinParent())+1),n=s.__key,l&&i.anchor.set(n,t+2,"element"),a&&i.focus.set(n,t+2,"element")),e}insertBefore(e,t=!0){qr(),Ft(this,e);var n=this.getWritable();let r=e.getWritable(),o=r.__key;st(r);let i=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=n.__prev,s=this.getIndexWithinParent();return null===i?l.__first=o:i.getWritable().__next=o,l.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent,n=zr(),t&&Er(n)&&Fr(n,t=this.getParentOrThrow(),s),e}isParentRequired(){return!1}createParentElementNode(){return Co()}selectPrevious(e,t){qr();let n=this.getPreviousSibling(),r=this.getParentOrThrow();return null===n?r.select(0,0):mo(n)?n.select():fr(n)?n.select(e,t):(e=n.getIndexWithinParent()+1,r.select(e,e))}selectNext(e,t){qr();let n=this.getNextSibling(),r=this.getParentOrThrow();return null===n?r.select():mo(n)?n.select(0,0):fr(n)?n.select(e,t):(e=n.getIndexWithinParent(),r.select(e,e))}markDirty(){this.getWritable()}}let Vn=class e extends Un{static getType(){return"linebreak"}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>{let t,n,r=e.parentElement;return null!==r&&((t=r.firstChild)===e||t.nextSibling===e&&3===t.nodeType&&null!==(t.textContent||"").match(/^[\s|\r?\n|\t]+$/))&&((n=r.lastChild)===e||n.previousSibling===e&&3===n.nodeType&&null!==(n.textContent||"").match(/^[\s|\r?\n|\t]+$/))?null:{conversion:Qn,priority:0}}}}static importJSON(){return Jn()}exportJSON(){return{type:"linebreak",version:1}}};function Qn(){return{node:Jn()}}function Jn(){return Bt(new Vn)}function Xn(e){return e instanceof Vn}function qn(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Zn(e,t){return 1&t?"strong":2&t?"em":"span"}function er(e,t,n,r,o){e=r.classList,void 0!==(r=kt(o,"base"))&&e.add(...r);let i=!1,l=8&t&&4&t;var a=8&n&&4&n;void 0!==(r=kt(o,"underlineStrikethrough"))&&(a?(i=!0,l||e.add(...r)):l&&e.remove(...r));for(let s in Pe)a=Pe[s],void 0!==(r=kt(o,s))&&(n&a&&(!i||"underline"!==s&&"strikethrough"!==s)?(0==(t&a)||l&&"underline"===s||"strikethrough"===s)&&e.add(...r):t&a&&e.remove(...r))}function tr(e,t,n){let r=t.firstChild;if(e+=(n=n.isComposing())?Re:"",null==r)t.textContent=e;else if((t=r.nodeValue)!==e)if(n||we){n=t.length;let o=e.length,i=0,l=0;for(;i<n&&i<o&&t[i]===e[i];)i++;for(;l+i<n&&l+i<o&&t[n-l-1]===e[o-l-1];)l++;e=[i,n-i-l,e.slice(i,o-l)];let[a,s,u]=e;0!==s&&r.deleteData(a,s),r.insertData(a,u)}else r.nodeValue=e}function nr(e,t){return(t=document.createElement(t)).appendChild(e),t}let rr=class e extends Un{static getType(){return"text"}static clone(t){return new e(t.__text,t.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return Be[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===dt()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return 0!=(1&this.getLatest().__detail)}isUnmergeable(){return 0!=(2&this.getLatest().__detail)}hasFormat(e){return e=Pe[e],0!=(this.getFormat()&e)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return it(this.getLatest().__format,e,t)}createDOM(e){var t=this.__format,n=qn(0,t);let r=Zn(0,t),o=document.createElement(null===n?r:n),i=o;return null!==n&&(i=document.createElement(r),o.appendChild(i)),n=i,tr(this.__text,n,this),void 0!==(e=e.theme.text)&&er(r,0,t,n,e),""!==(t=this.__style)&&(o.style.cssText=t),o}updateDOM(e,t,n){let r=this.__text;var o=e.__format,i=this.__format,l=qn(0,o);let a=qn(0,i);var s=Zn(0,o);let u=Zn(0,i);return(null===l?s:l)!==(null===a?u:a)||(l===a&&s!==u?(null==(o=t.firstChild)&&xe(48),tr(r,e=l=document.createElement(u),this),void 0!==(n=n.theme.text)&&er(u,0,i,e,n),t.replaceChild(l,o),!1):(s=t,null!==a&&null!==l&&(null==(s=t.firstChild)&&xe(49)),tr(r,s,this),void 0!==(n=n.theme.text)&&o!==i&&er(u,o,i,s,n),i=this.__style,e.__style!==i&&(t.style.cssText=i),!1))}static importDOM(){return{"#text":()=>({conversion:ar,priority:0}),b:()=>({conversion:ir,priority:0}),code:()=>({conversion:dr,priority:0}),em:()=>({conversion:dr,priority:0}),i:()=>({conversion:dr,priority:0}),s:()=>({conversion:dr,priority:0}),span:()=>({conversion:or,priority:0}),strong:()=>({conversion:dr,priority:0}),sub:()=>({conversion:dr,priority:0}),sup:()=>({conversion:dr,priority:0}),u:()=>({conversion:dr,priority:0})}}static importJSON(e){let t=pr(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){return({element:e}=super.exportDOM(e)),null!==e&&(this.hasFormat("bold")&&(e=nr(e,"b")),this.hasFormat("italic")&&(e=nr(e,"i")),this.hasFormat("strikethrough")&&(e=nr(e,"s")),this.hasFormat("underline")&&(e=nr(e,"u"))),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(e){let t=this.getWritable();return t.__format="string"==typeof e?Pe[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?Ie[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){return e=Pe[e],this.setFormat(this.getFormat()^e)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){if(e=ze[e],this.__mode===e)return this;let t=this.getWritable();return t.__mode=e,t}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){qr();let n=zr();var r=this.getTextContent();let o=this.__key;return"string"==typeof r?(r=r.length,void 0===e&&(e=r),void 0===t&&(t=r)):t=e=0,Er(n)?((r=dt())!==n.anchor.key&&r!==n.focus.key||ct(o),n.setTextNodeRange(this,e,this,t),n):Ir(o,e,o,t,"text","text")}spliceText(e,t,n,r){let o=this.getWritable(),i=o.__text,l=n.length,a=e;0>a&&(a=l+a,0>a&&(a=0));let s=zr();return r&&Er(s)&&(e+=l,s.setTextNodeRange(o,e,o,e)),t=i.slice(0,a)+n+i.slice(a+t),o.__text=t,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){qr();var t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=dt(),i=new Set(e);e=[];for(var l=n.length,a="",s=0;s<l;s++)""!==a&&i.has(s)&&(e.push(a),a=""),a+=n[s];if(""!==a&&e.push(a),0===(i=e.length))return[];if(e[0]===n)return[t];var u=e[0];n=t.getParentOrThrow(),s=t.getFormat();let c=t.getStyle(),d=t.__detail;l=!1,t.isSegmented()?((a=pr(u)).__format=s,a.__style=c,a.__detail=d,l=!0):(a=t.getWritable()).__text=u,t=zr(),a=[a],u=u.length;for(let n=1;n<i;n++){var p=e[n],f=p.length;(p=pr(p).getWritable()).__format=s,p.__style=c,p.__detail=d;let i=p.__key;if(f=u+f,Er(t)){let e=t.anchor,n=t.focus;e.key===r&&"text"===e.type&&e.offset>u&&e.offset<=f&&(e.key=i,e.offset-=u,t.dirty=!0),n.key===r&&"text"===n.type&&n.offset>u&&n.offset<=f&&(n.key=i,n.offset-=u,t.dirty=!0)}o===r&&ct(i),u=f,a.push(p)}return r=this.getPreviousSibling(),o=this.getNextSibling(),null!==r&&ut(r),null!==o&&ut(o),r=n.getWritable(),o=this.getIndexWithinParent(),l?(r.splice(o,0,a),this.remove()):r.splice(o,1,a),Er(t)&&Fr(t,n,o,i-1),a}mergeWithSibling(e){var t=e===this.getPreviousSibling();t||e===this.getNextSibling()||xe(50);var n=this.__key;let r=e.__key,o=this.__text,i=o.length;dt()===r&&ct(n);let l=zr();if(Er(l)){let o=l.anchor,a=l.focus;null!==o&&o.key===r&&(jr(o,t,n,e,i),l.dirty=!0),null!==a&&a.key===r&&(jr(a,t,n,e,i),l.dirty=!0)}return n=e.__text,this.setTextContent(t?n+o:o+n),t=this.getWritable(),e.remove(),t}isTextEntity(){return!1}};function or(e){let t="700"===e.style.fontWeight,n="line-through"===e.style.textDecoration,r="italic"===e.style.fontStyle,o="underline"===e.style.textDecoration,i=e.style.verticalAlign;return{forChild:e=>fr(e)?(t&&e.toggleFormat("bold"),n&&e.toggleFormat("strikethrough"),r&&e.toggleFormat("italic"),o&&e.toggleFormat("underline"),"sub"===i&&e.toggleFormat("subscript"),"super"===i&&e.toggleFormat("superscript"),e):e,node:null}}function ir(e){let t="normal"===e.style.fontWeight;return{forChild:e=>(fr(e)&&!t&&e.toggleFormat("bold"),e),node:null}}let lr=new WeakMap;function ar(e){null===e.parentElement&&xe(129);for(var t,n=e.textContent||"",r=e.parentNode,o=[e];null!==r&&void 0===(t=lr.get(r))&&!("PRE"===r.nodeName||1===r.nodeType&&r.style.whiteSpace.startsWith("pre"));)o.push(r),r=r.parentNode;for(t=void 0===t?r:t,r=0;r<o.length;r++)lr.set(o[r],t);if(null!==t){for(e=[],o=(n=n.split(/(\r?\n|\t)/)).length,t=0;t<o;t++)"\n"===(r=n[t])||"\r\n"===r?e.push(Jn()):"\t"===r?e.push(gr()):""!==r&&e.push(pr(r));return{node:e}}if(""===(n=n.replace(/\r?\n|\t/gm," ").replace("\r","").replace(/\s+/g," ")))return{node:null};if(" "===n[0]){for(o=e,t=!0;null!==o&&null!==(o=ur(o,!1));)if(0<(r=o.textContent||"").length){r.match(/(?:\s|\r?\n|\t)$/)&&(n=n.slice(1)),t=!1;break}t&&(n=n.slice(1))}if(" "===n[n.length-1]){for(o=!0;null!==e&&null!==(e=ur(e,!0));)if(0<(e.textContent||"").replace(/^[\s|\r?\n|\t]+/,"").length){o=!1;break}o&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:pr(n)}}let sr=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 ur(e,t){for(;;){for(var n=void 0;null===(n=t?e.nextSibling:e.previousSibling);)if(null===(e=e.parentElement))return null;if(1===(e=n).nodeType&&(""===(n=e.style.display)&&null===e.nodeName.match(sr)||""!==n&&!n.startsWith("inline")))return null;for(;null!==(n=t?e.firstChild:e.lastChild);)e=n;if(3===e.nodeType)return e;if("BR"===e.nodeName)return null}}let cr={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function dr(e){let t=cr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:e=>(fr(e)&&!e.hasFormat(t)&&e.toggleFormat(t),e),node:null}}function pr(e=""){return Bt(new rr(e))}function fr(e){return e instanceof rr}let mr=class e extends rr{static getType(){return"tab"}static clone(t){let n=new e(t.__key);return n.__text=t.__text,n.__format=t.__format,n.__style=t.__style,n}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){let t=gr();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){xe(126)}setDetail(){xe(127)}setMode(){xe(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function gr(){return Bt(new mr)}let hr=class{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode(),r=this.offset;if(e=e.offset,mo(t)){var o=t.getDescendantByIndex(r);t=null!=o?o:t}return mo(n)&&(o=n.getDescendantByIndex(e),n=null!=o?o:n),t===n?r<e:t.isBefore(n)}getNode(){let e=pt(this.key);return null===e&&xe(20),e}set(e,t,n){let r=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,Xr()||(dt()===o&&ct(e),null!==r&&(r._cachedNodes=null,r.dirty=!0))}};function vr(e,t){let n=t.__key,r=e.offset,o="element";if(fr(t))o="text",r>(t=t.getTextContentSize())&&(r=t);else if(!mo(t)){var i=t.getNextSibling();fr(i)?(n=i.__key,r=0,o="text"):(i=t.getParent())&&(n=i.__key,r=t.getIndexWithinParent()+1)}e.set(n,r,o)}function br(e,t){if(mo(t)){let n=t.getLastDescendant();mo(n)||fr(n)?vr(e,n):vr(e,t)}else vr(e,t)}function yr(e,t,n,r){let o=e.getNode(),i=o.getChildAtIndex(e.offset),l=pr(),a=vo(o)?Co().append(l):l;l.setFormat(n),l.setStyle(r),null===i?o.append(a):(i.insertBefore(a),"element"===t.type&&t.key===e.key&&t.offset!==e.offset&&t.set(t.key,t.offset+1,"element")),e.is(t)&&t.set(l.__key,0,"text"),e.set(l.__key,0,"text")}function xr(e,t,n,r){e.key=t,e.offset=n,e.type=r}class _r{constructor(e){this.dirty=!1,this._nodes=e,this._cachedNodes=null}is(e){if(!kr(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new _r(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(e,t){let n=this.getNodes(),r=n.length;var o=n[r-1];if(fr(o))o=o.select();else{let e=o.getIndexWithinParent()+1;o=o.getParentOrThrow().select(e,e)}for(o.insertNodes(e,t),e=0;e<r;e++)n[e].remove();return!0}getNodes(){var e=this._cachedNodes;if(null!==e)return e;var t=this._nodes;e=[];for(let n of t)null!==(t=pt(n))&&e.push(t);return Xr()||(this._cachedNodes=e),e}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function Er(e){return e instanceof Sr}let Cr=class e{constructor(e,t,n){this.gridKey=e,this.anchor=t,this.focus=n,this.dirty=!1,this._cachedNodes=null,t._selection=this,n._selection=this}is(e){return!!wr(e)&&(this.gridKey===e.gridKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus))}set(e,t,n){this.dirty=!0,this.gridKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return Ar(this)}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(e,t){let n=this.focus.getNode();return Je(n.select(0,n.getChildrenSize())).insertNodes(e,t)}getShape(){var e=pt(this.anchor.key);null===e&&xe(21);var t=e.getIndexWithinParent();e=e.getParentOrThrow().getIndexWithinParent();var n=pt(this.focus.key);null===n&&xe(22);var r=n.getIndexWithinParent();let o=n.getParentOrThrow().getIndexWithinParent();return n=Math.min(t,r),t=Math.max(t,r),r=Math.min(e,o),e=Math.max(e,o),{fromX:Math.min(n,t),fromY:Math.min(r,e),toX:Math.max(n,t),toY:Math.max(r,e)}}getNodes(){function e(e){let{cell:t,startColumn:n,startRow:r}=e;a=Math.min(a,n),s=Math.min(s,r),u=Math.max(u,n+t.__colSpan-1),c=Math.max(c,r+t.__rowSpan-1)}var t=this._cachedNodes;if(null!==t)return t;var n=this.anchor.getNode();t=this.focus.getNode(),n=Yt(n,To);var r=Yt(t,To);To(n)||xe(103),To(r)||xe(104),Oo(t=n.getParent())||xe(105),No(t=t.getParent())||xe(106);let[o,i,l]=Kr(t,n,r),a=Math.min(i.startColumn,l.startColumn),s=Math.min(i.startRow,l.startRow),u=Math.max(i.startColumn+i.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),c=Math.max(i.startRow+i.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1);n=a,r=s;for(var d=a,p=s;a<n||s<r||u>d||c>p;){if(a<n){var f=p-r;--n;for(var m=0;m<=f;m++)e(o[r+m][n])}if(s<r)for(f=d-n,--r,m=0;m<=f;m++)e(o[r][n+m]);if(u>d)for(f=p-r,d+=1,m=0;m<=f;m++)e(o[r+m][d]);if(c>p)for(f=d-n,p+=1,m=0;m<=f;m++)e(o[p][n+m])}for(t=[t],n=null,r=s;r<=c;r++)for(d=a;d<=u;d++)({cell:p}=o[r][d]),Oo(f=p.getParent())||xe(107),f!==n&&t.push(f),t.push(p,...Gt(p)),n=f;return Xr()||(this._cachedNodes=t),t}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}};function wr(e){return e instanceof Cr}let Sr=class e{constructor(e,t,n,r){this.anchor=e,this.focus=t,this.dirty=!1,this.format=n,this.style=r,this._cachedNodes=null,e._selection=this,t._selection=this}is(e){return!!Er(e)&&(this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style)}isBackward(){return this.focus.isBefore(this.anchor)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var e=this._cachedNodes;if(null!==e)return e;e=this.anchor;var t=this.focus,n=e.isBefore(t),r=n?e:t;n=n?t:e,e=r.getNode(),t=n.getNode();let o=r.offset;return r=n.offset,mo(e)&&(n=e.getDescendantByIndex(o),e=null!=n?n:e),mo(t)&&(null!==(n=t.getDescendantByIndex(r))&&n!==e&&t.getChildAtIndex(r)===n&&(n=n.getPreviousSibling()),t=null!=n?n:t),e=e.is(t)?mo(e)&&0<e.getChildrenSize()?[]:[e]:e.getNodesBetween(t),Xr()||(this._cachedNodes=e),e}setTextNodeRange(e,t,n,r){xr(this.anchor,e.__key,t,"text"),xr(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let e=this.getNodes();if(0===e.length)return"";let t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[l,a]=Ar(this),s="",u=!0;for(let c=0;c<e.length;c++){let d=e[c];if(mo(d)&&!d.isInline())u||(s+="\n"),u=!d.isEmpty();else if(u=!1,fr(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===o.type&&o.offset!==r.offset||(e=l<a?e.slice(l,a):e.slice(a,l)):e=i?e.slice(l):e.slice(a):d===n&&(e=i?e.slice(0,a):e.slice(0,l)),s+=e}else!po(d)&&!Xn(d)||d===n&&this.isCollapsed()||(s+=d.getTextContent())}return s}applyDOMRange(e){let t=eo(),n=t.getEditorState()._selection;if(null!==(e=Lr(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n))){var[r,o]=e;xr(this.anchor,r.key,r.offset,r.type),xr(this.focus,o.key,o.offset,o.type),this._cachedNodes=null}}clone(){let t=this.anchor,n=this.focus;return new e(new hr(t.key,t.offset,t.type),new hr(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=it(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){return 0!=(this.format&Pe[e])}insertRawText(e){let t=[],n=(e=e.split(/(\r?\n|\t)/)).length;for(let r=0;r<n;r++){let n=e[r];"\n"===n||"\r\n"===n?t.push(Jn()):"\t"===n?t.push(gr()):t.push(pr(n))}this.insertNodes(t)}insertText(e){var t=this.anchor,n=this.focus,r=this.isCollapsed()||t.isBefore(n),o=this.format,i=this.style;r&&"element"===t.type?yr(t,n,o,i):r||"element"!==n.type||yr(n,t,o,i);var l=this.getNodes(),a=l.length,s=r?n:t;n=(r?t:n).offset;var u=s.offset;fr(t=l[0])||xe(26),r=t.getTextContent().length;var c=t.getParentOrThrow(),d=l[a-1];if(this.isCollapsed()&&n===r&&(t.isSegmented()||t.isToken()||!t.canInsertTextAfter()||!c.canInsertTextAfter()&&null===t.getNextSibling())){var p=t.getNextSibling();if(fr(p)&&p.canInsertTextBefore()&&!rt(p)||((p=pr()).setFormat(o),c.canInsertTextAfter()?t.insertAfter(p):c.insertAfter(p)),p.select(0,0),t=p,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===n&&(t.isSegmented()||t.isToken()||!t.canInsertTextBefore()||!c.canInsertTextBefore()&&null===t.getPreviousSibling())){if(fr(p=t.getPreviousSibling())&&!rt(p)||((p=pr()).setFormat(o),c.canInsertTextBefore()?t.insertBefore(p):c.insertBefore(p)),p.select(),t=p,""!==e)return void this.insertText(e)}else if(t.isSegmented()&&n!==r)(c=pr(t.getTextContent())).setFormat(o),t.replace(c),t=c;else if(!(this.isCollapsed()||""===e||(p=d.getParent(),c.canInsertTextBefore()&&c.canInsertTextAfter()&&(!mo(p)||p.canInsertTextBefore()&&p.canInsertTextAfter()))))return this.insertText(""),Mr(this.anchor,this.focus,null),void this.insertText(e);if(1===a)if(t.isToken())(e=pr(e)).select(),t.replace(e);else{if(l=t.getFormat(),a=t.getStyle(),n===u&&(l!==o||a!==i)){if(""!==t.getTextContent())return(l=pr(e)).setFormat(o),l.setStyle(i),l.select(),0===n?t.insertBefore(l,!1):([a]=t.splitText(n),a.insertAfter(l,!1)),void(l.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length));t.setFormat(o),t.setStyle(i)}""===(t=t.spliceText(n,u-n,e,!0)).getTextContent()?t.remove():"text"===this.anchor.type&&(t.isComposing()?this.anchor.offset-=e.length:(this.format=l,this.style=a))}else{if(o=new Set([...t.getParentKeys(),...d.getParentKeys()]),p=mo(t)?t:t.getParentOrThrow(),i=mo(d)?d:d.getParentOrThrow(),c=d,!p.is(i)&&i.isInline())do{c=i,i=i.getParentOrThrow()}while(i.isInline());"text"===s.type&&(0!==u||""===d.getTextContent())||"element"===s.type&&d.getIndexWithinParent()<u?fr(d)&&!d.isToken()&&u!==d.getTextContentSize()?(d.isSegmented()&&(s=pr(d.getTextContent()),d.replace(s),d=s),d=d.spliceText(0,u,""),o.add(d.__key)):(s=d.getParentOrThrow()).canBeEmpty()||1!==s.getChildrenSize()?d.remove():s.remove():o.add(d.__key),s=i.getChildren(),u=new Set(l),d=p.is(i),p=p.isInline()&&null===t.getNextSibling()?p:t;for(let e=s.length-1;0<=e;e--){let n=s[e];if(n.is(t)||mo(n)&&n.isParentOf(t))break;n.isAttached()&&(!u.has(n)||n.is(c)?d||p.insertAfter(n,!1):n.remove())}if(!d)for(s=i,u=null;null!==s;)(0===(d=(i=s.getChildren()).length)||i[d-1].is(u))&&(o.delete(s.__key),u=s),s=s.getParent();for(t.isToken()?n===r?t.select():((e=pr(e)).select(),t.replace(e)):""===(t=t.spliceText(n,r-n,e,!0)).getTextContent()?t.remove():t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length),e=1;e<a;e++)t=l[e],o.has(t.__key)||t.remove()}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())this.toggleFormat(e),ct(null);else{var t=this.getNodes(),n=[];for(var r of t)fr(r)&&n.push(r);var o=n.length;if(0===o)this.toggleFormat(e),ct(null);else{r=this.anchor;var i=this.focus,l=this.isBackward();t=l?i:r,r=l?r:i;var a=0,s=n[0];if(i="element"===t.type?0:t.offset,"text"===t.type&&i===s.getTextContentSize()&&(a=1,s=n[1],i=0),null!=s){l=s.getFormatFlags(e,null);var u=o-1,c=n[u];if(o="text"===r.type?r.offset:c.getTextContentSize(),s.is(c))i!==o&&(0===i&&o===s.getTextContentSize()?s.setFormat(l):(e=s.splitText(i,o),(e=0===i?e[0]:e[1]).setFormat(l),"text"===t.type&&t.set(e.__key,0,"text"),"text"===r.type&&r.set(e.__key,o-i,"text")),this.format=l);else{0!==i&&([,s]=s.splitText(i),i=0),s.setFormat(l);var d=c.getFormatFlags(e,l);for(0<o&&(o!==c.getTextContentSize()&&([c]=c.splitText(o)),c.setFormat(d)),a+=1;a<u;a++){let t=n[a];if(!t.isToken()){let n=t.getFormatFlags(e,d);t.setFormat(n)}}"text"===t.type&&t.set(s.__key,i,"text"),"text"===r.type&&r.set(c.__key,o,"text"),this.format=l|d}}}}}insertNodes(e,t){if(!this.isCollapsed()){var n=this.isBackward()?this.anchor:this.focus,r=n.getNode().getNextSibling();if(r=r?r.getKey():null,n=(n=n.getNode().getPreviousSibling())?n.getKey():null,this.removeText(),this.isCollapsed()&&"element"===this.focus.type){if(this.focus.key===r&&0===this.focus.offset){var o=pr();this.focus.getNode().insertBefore(o)}else this.focus.key===n&&this.focus.offset===this.focus.getNode().getChildrenSize()&&(o=pr(),this.focus.getNode().insertAfter(o));o&&(this.focus.set(o.__key,0,"text"),this.anchor.set(o.__key,0,"text"))}}n=(o=this.anchor).offset;var i=o.getNode();r=i,"element"===o.type&&(r=null===(r=(o=o.getNode()).getChildAtIndex(n-1))?o:r),o=[];var l=i.getNextSiblings(),a=$t(i)?null:i.getTopLevelElementOrThrow();if(fr(i))if(r=i.getTextContent().length,0===n&&0!==r)r=null!==(r=i.getPreviousSibling())?r:i.getParentOrThrow(),o.push(i);else if(n===r)r=i;else{if(i.isToken())return!1;[r,i]=i.splitText(n),o.push(i)}i=r,o.push(...l),l=e[0];var s=!1,u=null;for(let t=0;t<e.length;t++){var c=e[t];if($t(r)||po(r)||!mo(c)||c.isInline())s&&!mo(c)&&!po(c)&&$t(r.getParent())&&xe(28);else{if(c.is(l)){if(mo(r)&&r.isEmpty()&&r.canReplaceWith(c)){r.replace(c),r=c,s=!0;continue}if(lt(s=c.getFirstDescendant())){for(var d=s.getParentOrThrow();d.isInline();)d=d.getParentOrThrow();if(s=(u=d.getChildren()).length,mo(r)){var p=r.getFirstChild();for(let e=0;e<s;e++){let t=u[e];null===p?r.append(t):p.insertAfter(t),p=t}}else{for(p=s-1;0<=p;p--)r.insertAfter(u[p]);r=r.getParentOrThrow()}if(u=u[s-1],d.remove(),s=!0,d.is(c))continue}}fr(r)&&(null===a&&xe(27),r=a)}s=!1,mo(r)&&!r.isInline()?(u=c,po(c)&&!c.isInline()?r=r.insertAfter(c,!1):mo(c)?!c.canBeEmpty()&&c.isEmpty()||(vo(r)?(null!==(d=r.getChildAtIndex(n))?d.insertBefore(c):r.append(c),r=c):c.isInline()?(r.append(c),r=c):r=r.insertAfter(c,!1)):(null!==(d=r.getFirstChild())?d.insertBefore(c):r.append(c),r=c)):!mo(c)||mo(c)&&c.isInline()||po(r)&&!r.isInline()?(u=c,Er(this)&&po(c)&&(mo(r)||fr(r))&&!c.isInline()?(fr(r)?(d=r.getParentOrThrow(),[r]=r.splitText(n),r=r.getIndexWithinParent()+1):(d=r,r=n),[,r]=Kt(d,r),r=r.insertBefore(c)):r=r.insertAfter(c,!1)):(c=r.getParentOrThrow(),Xn(r)&&r.remove(),r=c,t--)}if(t&&(fr(i)?i.select():fr(e=r.getPreviousSibling())?e.select():(e=r.getIndexWithinParent(),r.getParentOrThrow().select(e,e))),mo(r)){if(e=fr(u)?u:mo(u)&&u.isInline()?u.getLastDescendant():r.getLastDescendant(),t||(null===e?r.select():fr(e)?""===e.getTextContent()?e.selectPrevious():e.select():e.selectNext()),0!==o.length)for(t=r,e=o.length-1;0<=e;e--)a=(n=o[e]).getParentOrThrow(),!mo(r)||Pr(n)||po(n)&&(!n.isInline()||n.isIsolated())?mo(r)||Pr(n)?mo(n)&&!n.canInsertAfter(r)?(mo(i=a.constructor.clone(a))||xe(29),i.append(n),r.insertAfter(i)):r.insertAfter(n):(r.insertBefore(n),r=n):(t===r?r.append(n):r.insertBefore(n),r=n),a.isEmpty()&&!a.canBeEmpty()&&a.remove()}else t||(fr(r)?r.select():(t=r.getParentOrThrow(),e=r.getIndexWithinParent()+1,t.select(e,e)));return!0}insertParagraph(){this.isCollapsed()||this.removeText();var e=this.anchor,t=e.offset,n=[];if("text"===e.type){var r=e.getNode(),o=r.getNextSiblings().reverse(),i=r.getParentOrThrow(),l=i.isInline(),a=l?i.getTextContentSize():r.getTextContentSize();0===t?o.push(r):(l&&(n=i.getNextSiblings()),t===a||l&&t===r.getTextContentSize()||([,r]=r.splitText(t),o.push(r)))}else{if($t(i=e.getNode()))return o=Co(),n=i.getChildAtIndex(t),o.select(),void(null!==n?n.insertBefore(o,!1):i.append(o));o=i.getChildren().slice(t).reverse()}if(r=o.length,0===t&&0<r&&i.isInline()){if(mo(o=(n=i.getParentOrThrow()).insertNewAfter(this,!1)))for(n=n.getChildren(),i=0;i<n.length;i++)o.append(n[i])}else if(null===(l=i.insertNewAfter(this,!1)))this.insertLineBreak();else if(mo(l))if(a=i.getFirstChild(),0===t&&(i.is(e.getNode())||a&&a.is(e.getNode()))&&0<r)i.insertBefore(l);else{if(i=null,t=n.length,e=l.getParentOrThrow(),0<t)for(a=0;a<t;a++)e.append(n[a]);if(0!==r)for(n=0;n<r;n++)t=o[n],null===i?l.append(t):i.insertBefore(t),i=t;l.canBeEmpty()||0!==l.getChildrenSize()?l.selectStart():(l.selectPrevious(),l.remove())}}insertLineBreak(e){let t=Jn();var n=this.anchor;"element"===n.type&&(vo(n=n.getNode())&&this.insertParagraph()),e?this.insertNodes([t],!0):this.insertNodes([t])&&t.selectNext(0,0)}getCharacterOffsets(){return Ar(this)}extract(){var e=this.getNodes(),t=e.length,n=t-1,r=this.anchor;let o=this.focus;var i=e[0];let l=e[n],[a,s]=Ar(this);return 0===t?[]:1===t?fr(i)&&!this.isCollapsed()?(e=a>s?s:a,n=i.splitText(e,a>s?a:s),null!=(e=0===e?n[0]:n[1])?[e]:[]):[i]:(t=r.isBefore(o),fr(i)&&((r=t?a:s)===i.getTextContentSize()?e.shift():0!==r&&([,i]=i.splitText(r),e[0]=i)),fr(l)&&(i=l.getTextContent().length,0===(t=t?s:a)?e.pop():t!==i&&([l]=l.splitText(t),e[n]=l)),e)}modify(e,t,n){var r=this.focus,o=this.anchor,i="move"===e,l=Nt(r,t);if(po(l)&&!l.isIsolated())i&&l.isKeyboardSelectable()?((t=Dr()).add(l.__key),bt(t)):fr(e=t?l.getPreviousSibling():l.getNextSibling())?(l=e.__key,t=t?e.getTextContent().length:0,r.set(l,t,"text"),i&&o.set(l,t,"text")):(n=l.getParentOrThrow(),mo(e)?(n=e.__key,l=t?e.getChildrenSize():0):(l=l.getIndexWithinParent(),n=n.__key,t||l++),r.set(n,l,"element"),i&&o.set(n,l,"element"));else if(r=jt((o=eo())._window)){var a=o._blockCursorElement,s=o._rootElement;if(null===s||null===a||!mo(l)||l.isInline()||l.canBeEmpty()||Wt(a,o,s),r.modify(e,t?"backward":"forward",n),0<r.rangeCount&&(l=r.getRangeAt(0),o=vo(o=this.anchor.getNode())?o:Dt(o),this.applyDOMRange(l),this.dirty=!0,!i)){for(i=this.getNodes(),e=[],n=!1,a=0;a<i.length;a++)Pt(s=i[a],o)?e.push(s):n=!0;n&&0<e.length&&(t?mo(t=e[0])?t.selectStart():t.getParentOrThrow().selectStart():mo(t=e[e.length-1])?t.selectEnd():t.getParentOrThrow().selectEnd()),r.anchorNode===l.startContainer&&r.anchorOffset===l.startOffset||(t=this.focus,r=(i=this.anchor).key,l=i.offset,o=i.type,xr(i,t.key,t.offset,t.type),xr(t,r,l,o),this._cachedNodes=null)}}}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){var n=this.anchor,r=this.focus,o=n.getNode();if(!e&&("element"===n.type&&mo(o)&&n.offset===o.getChildrenSize()||"text"===n.type&&n.offset===o.getTextContentSize())){var i=o.getParent();if(mo(i=o.getNextSibling()||(null===i?null:i.getNextSibling()))&&i.isShadowRoot())return}if(po(i=Nt(r,e))&&!i.isIsolated())return void(i.isKeyboardSelectable()&&mo(o)&&0===o.getChildrenSize()?(o.remove(),e=Dr(),e.add(i.__key),bt(e)):(i.remove(),eo().dispatchCommand(B,void 0)));if(!e&&mo(i)&&mo(o)&&o.isEmpty())return o.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===n.offset&&("element"===n.type?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(i="text"===r.type?r.getNode():null,o="text"===n.type?n.getNode():null,null!==i&&i.isSegmented()){if(n=r.offset,r=i.getTextContentSize(),i.is(o)||e&&n!==r||!e&&0!==n)return void Nr(i,e,n)}else if(null!==o&&o.isSegmented()&&(n=n.offset,r=o.getTextContentSize(),o.is(i)||e&&0!==n||!e&&n!==r))return void Nr(o,e,n);if(o=this.anchor,i=this.focus,(n=o.getNode())===(r=i.getNode())&&"text"===o.type&&"text"===i.type){var l=o.offset,a=i.offset;let t=l<a;(r=t?l:a)!==(l=(a=t?a:l)-1)&&(xt(n=n.getTextContent().slice(r,a))||(e?i.offset=l:o.offset=l))}}}this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset&&((e=this.anchor.getNode()).isEmpty()&&vo(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this))}deleteLine(e){this.isCollapsed()&&("text"===this.anchor.type&&this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){this.isCollapsed()&&this.modify("extend",e,"word"),this.removeText()}};function kr(e){return e instanceof _r}function Tr(e){let t=e.offset;return"text"===e.type?t:t===(e=e.getNode()).getChildrenSize()?e.getTextContent().length:0}function Ar(e){let t=e.anchor;return e=e.focus,"element"===t.type&&"element"===e.type&&t.key===e.key&&t.offset===e.offset?[0,0]:[Tr(t),Tr(e)]}function Nr(e,t,n){let r=e.getTextContent().split(/(?=\s)/g),o=r.length,i=0,l=0;for(let e=0;e<o;e++){let a=e===o-1;if(l=i,i+=r[e].length,t&&i===n||i>n||a){r.splice(e,1),a&&(l=void 0);break}}""===(t=r.join("").trim())?e.remove():(e.setTextContent(t),e.select(l,l))}function Rr(e,t,n,r){var o=t;if(1===e.nodeType){let a=!1;var i=e.childNodes,l=i.length;o===l&&(a=!0,o=l-1);let s=i[o];if(l=!1,s===r._blockCursorElement?(s=i[o+1],l=!0):null!==r._blockCursorElement&&o--,fr(r=yt(s)))o=a?r.getTextContentSize():0;else{if(null===(i=yt(e)))return null;if(mo(i)?((t=mo(e=i.getChildAtIndex(o)))&&(t=e.getParent(),t=null===n||null===t||!t.canBeEmpty()||t!==n.getNode()),t&&(null===(n=a?e.getLastDescendant():e.getFirstDescendant())?(i=e,o=0):i=mo(e=n)?e:e.getParentOrThrow()),fr(e)?(r=e,i=null,o=a?e.getTextContentSize():0):e!==i&&a&&!l&&o++):(o=i.getIndexWithinParent(),o=0===t&&po(i)&&yt(e)===i?o:o+1,i=i.getParentOrThrow()),mo(i))return new hr(i.__key,o,"element")}}else r=yt(e);return fr(r)?new hr(r.__key,o,"text"):null}function Or(e,t,n){var r=e.offset,o=e.getNode();0===r?(r=o.getPreviousSibling(),o=o.getParent(),t?(n||!t)&&null===r&&mo(o)&&o.isInline()&&(fr(t=o.getPreviousSibling())&&(e.key=t.__key,e.offset=t.getTextContent().length)):mo(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):fr(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)):r===o.getTextContent().length&&(r=o.getNextSibling(),o=o.getParent(),t&&mo(r)&&r.isInline()?(e.key=r.__key,e.offset=0,e.type="element"):(n||t)&&null===r&&mo(o)&&o.isInline()&&!o.canInsertTextAfter()&&(fr(t=o.getNextSibling())&&(e.key=t.__key,e.offset=0)))}function Mr(e,t,n){if("text"===e.type&&"text"===t.type){var r=e.isBefore(t);let o=e.is(t);Or(e,r,o),Or(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type),(r=eo()).isComposing()&&r._compositionKey!==e.key&&Er(n)&&(r=n.anchor,n=n.focus,xr(e,r.key,r.offset,r.type),xr(t,n.key,n.offset,n.type))}}function Lr(e,t,n,r,o,i){return null!==e&&null!==n&&tt(o,e,n)?null===(t=Rr(e,t,Er(i)?i.anchor:null,o))||null===(r=Rr(n,r,Er(i)?i.focus:null,o))||"element"===t.type&&"element"===r.type&&(e=yt(e),n=yt(n),po(e)&&po(n))?null:(Mr(t,r,i),[t,r]):null}function Pr(e){return mo(e)&&!e.isInline()}function Ir(e,t,n,r,o,i){let l=Zr();return(e=new Sr(new hr(e,t,o),new hr(n,r,i),0,"")).dirty=!0,l._selection=e}function Dr(){return new _r(new Set)}function $r(e,t,n){var r=n._window;if(null===r)return null;var o=r.event,i=o?o.type:void 0;let l;if(r="selectionchange"===i,o=!Fe&&(r||"beforeinput"===i||"compositionstart"===i||"compositionend"===i||"click"===i&&o&&3===o.detail||"drop"===i||void 0===i),Er(e)&&!o)return e.clone();if(null===t)return null;if(o=t.anchorNode,i=t.focusNode,l=t.anchorOffset,t=t.focusOffset,r&&Er(e)&&!tt(n,o,i))return e.clone();if(null===(n=Lr(o,l,i,t,n,e)))return null;let[a,s]=n;return new Sr(a,s,Er(e)?e.format:0,Er(e)?e.style:"")}function zr(){return Zr()._selection}function Br(){return eo()._editorState._selection}function Fr(e,t,n,r=1){var o=e.anchor,i=e.focus,l=o.getNode(),a=i.getNode();if(t.is(l)||t.is(a)){if(l=t.__key,e.isCollapsed())(n<=(t=o.offset)&&0<r||n<t&&0>r)&&(n=Math.max(0,t+r),o.set(l,n,"element"),i.set(l,n,"element"),Hr(e));else{let u=e.isBackward();var s=(a=u?i:o).getNode();i=(o=u?o:i).getNode(),t.is(s)&&((n<=(s=a.offset)&&0<r||n<s&&0>r)&&a.set(l,Math.max(0,s+r),"element")),t.is(i)&&((n<=(t=o.offset)&&0<r||n<t&&0>r)&&o.set(l,Math.max(0,t+r),"element"))}Hr(e)}}function Hr(e){var t=e.anchor,n=t.offset;let r=e.focus;var o=r.offset,i=t.getNode(),l=r.getNode();if(e.isCollapsed())mo(i)&&(fr(l=(o=n>=(l=i.getChildrenSize()))?i.getChildAtIndex(l-1):i.getChildAtIndex(n))&&(n=0,o&&(n=l.getTextContentSize()),t.set(l.__key,n,"text"),r.set(l.__key,n,"text")));else{if(mo(i)){let r=i.getChildrenSize();fr(n=(e=n>=r)?i.getChildAtIndex(r-1):i.getChildAtIndex(n))&&(i=0,e&&(i=n.getTextContentSize()),t.set(n.__key,i,"text"))}mo(l)&&(fr(o=(t=o>=(n=l.getChildrenSize()))?l.getChildAtIndex(n-1):l.getChildAtIndex(o))&&(l=0,t&&(l=o.getTextContentSize()),r.set(o.__key,l,"text")))}}function Wr(e,t,n,r,o){let i=null,l=0,a=null;null!==r?(i=r.__key,fr(r)?(l=r.getTextContentSize(),a="text"):mo(r)&&(l=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,fr(o)?a="text":mo(o)&&(a="element")),null!==i&&null!==a?e.set(i,l,a):(l=t.getIndexWithinParent(),-1===l&&(l=n.getChildrenSize()),e.set(n.__key,l,"element"))}function jr(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&--e.offset}function Kr(e,t,n){let r=[],o=null,i=null;e=e.getChildren();for(let c=0;c<e.length;c++){var l=e[c];Oo(l)||xe(108);var a=l.getChildren();l=0;for(let e of a){for(To(e)||xe(109);void 0!==r[c]&&void 0!==r[c][l];)l++;var s=l,u=e;let d={cell:u,startColumn:s,startRow:a=c},p=u.__rowSpan,f=u.__colSpan;for(let e=0;e<p;e++){void 0===r[a+e]&&(r[a+e]=[]);for(let t=0;t<f;t++)r[a+e][s+t]=d}t.is(u)&&(o=d),n.is(u)&&(i=d),l+=e.__colSpan}}return null===o&&xe(110),null===i&&xe(111),[r,o,i]}let Yr=null,Gr=null,Ur=!1,Vr=!1,Qr=0,Jr={characterData:!0,childList:!0,subtree:!0};function Xr(){return Ur||null!==Yr&&Yr._readOnly}function qr(){Ur&&xe(13)}function Zr(){return null===Yr&&xe(15),Yr}function eo(){return null===Gr&&xe(16),Gr}function to(e,t,n){var r=t.__type;let o=e._nodes.get(r);for(void 0===o&&xe(30,r),void 0===(e=n.get(r))&&(e=Array.from(o.transforms),n.set(r,e)),n=e.length,r=0;r<n&&(e[r](t),t.isAttached());r++);}function no(e,t){var n=e.type,r=t.get(n);if(void 0===r&&xe(17,n),n=r.klass,e.type!==n.getType()&&xe(18,n.name),n=n.importJSON(e),e=e.children,mo(n)&&Array.isArray(e))for(r=0;r<e.length;r++){let o=no(e[r],t);n.append(o)}return n}function ro(e,t){let n=Yr,r=Ur,o=Gr;Yr=e,Ur=!0,Gr=null;try{return t()}finally{Yr=n,Ur=r,Gr=o}}function oo(e,t){let n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null!==n){var i=e._editorState,l=i._selection,a=n._selection,s=0!==e._dirtyType,u=Yr,c=Ur,d=Gr,p=e._updating,f=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!o&&s&&null!==f){Gr=e,Yr=n,Ur=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,o=e._dirtyLeaves;f.disconnect();var g=r,h=o;ln=an=on="",sn=2===t,cn=null,Qt=e,Vt=e._config,Jt=e._nodes,Xt=Qt._listeners.mutation,qt=g,Zt=h,en=i._nodeMap,tn=n._nodeMap,un=n._readOnly,nn=new Map(e._keyToDOMMap);let l=new Map;rn=l,En("root",null),rn=nn=Vt=tn=en=Zt=qt=Jt=Qt=void 0,m=l}catch(t){if(t instanceof Error&&e._onError(t),Vr)throw t;return wo(e,null,r,n),Ge(e),e._dirtyType=2,Vr=!0,oo(e,i),void(Vr=!1)}finally{f.observe(r,Jr),e._updating=p,Yr=u,Ur=c,Gr=d}}n._readOnly||(n._readOnly=!0);var v=e._dirtyLeaves,b=e._dirtyElements,y=e._normalizedNodes,x=e._updateTags,_=e._deferred;s&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set);var E,C=e._decorators,w=e._pendingDecorators||C,S=n._nodeMap;for(E in w)S.has(E)||(w===C&&(w=gt(e)),delete w[E]);var k=o?null:jt(e._window);if(e._editable&&null!==k&&(s||null===a||a.dirty)){Gr=e,Yr=n;try{if(null!==f&&f.disconnect(),s||null===a||a.dirty){let t=e._blockCursorElement;null!==t&&Wt(t,e,r);e:{let t=k.anchorNode,n=k.focusNode,o=k.anchorOffset,i=k.focusOffset,s=document.activeElement;if(!(x.has("collaboration")&&s!==r||null!==s&&et(s)))if(Er(a)){var T=a.anchor,A=a.focus,N=T.key,R=A.key,O=Mt(e,N),M=Mt(e,R),L=T.offset,P=A.offset,I=a.format,D=a.style,$=a.isCollapsed(),z=O,F=M,H=!1;if("text"===T.type){z=ot(O);let e=T.getNode();H=e.getFormat()!==I||e.getStyle()!==D}else Er(l)&&"text"===l.anchor.type&&(H=!0);if("text"===A.type&&(F=ot(M)),null!==z&&null!==F){if($&&(null===l||H||Er(l)&&(l.format!==I||l.style!==D))){var W=performance.now();$n=[I,D,L,N,W]}if(o===L&&i===P&&t===z&&n===F&&("Range"!==k.type||!$)&&(null!==s&&r.contains(s)||r.focus({preventScroll:!0}),"element"!==T.type))break e;try{k.setBaseAndExtent(z,L,F,P)}catch(e){}if(!x.has("skip-scroll-into-view")&&a.isCollapsed()&&null!==r&&r===document.activeElement){let t=a instanceof Sr&&"element"===a.anchor.type?z.childNodes[L]||null:0<k.rangeCount?k.getRangeAt(0):null;if(null!==t){let n;if(t instanceof Text){let e=document.createRange();e.selectNode(t),n=e.getBoundingClientRect()}else n=t.getBoundingClientRect();let o=r.ownerDocument,i=o.defaultView;if(null!==i)for(var j,K,{top:Y,bottom:G}=n,U=r;null!==U;){let t=U===o.body;if(t)j=0,K=It(e).innerHeight;else{let e=U.getBoundingClientRect();j=e.top,K=e.bottom}let n=0;if(Y<j?n=-(j-Y):G>K&&(n=G-K),0!==n)if(t)i.scrollBy(0,n);else{let e=U.scrollTop;U.scrollTop+=n;let t=U.scrollTop-e;Y-=t,G-=t}if(t)break;U=Lt(U)}}}Ln=!0}}else null!==l&&tt(e,t,n)&&k.removeAllRanges()}}e:{let t=e._blockCursorElement;if(Er(a)&&a.isCollapsed()&&"element"===a.anchor.type&&r.contains(document.activeElement)){let n=a.anchor,o=n.getNode(),i=n.offset,l=o.getChildrenSize(),s=!1,u=null;if(i===l){Ht(o.getChildAtIndex(i-1))&&(s=!0)}else{let t=o.getChildAtIndex(i);if(Ht(t)){let n=t.getPreviousSibling();(null===n||Ht(n))&&(s=!0,u=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(o.__key);if(null===t){let n=e._config.theme,r=document.createElement("div");r.contentEditable="false",r.setAttribute("data-lexical-cursor","true");let o=n.blockCursor;if(void 0!==o){if("string"==typeof o){let e=o.split(" ");o=n.blockCursor=e}void 0!==o&&r.classList.add(...o)}e._blockCursorElement=t=r}r.style.caretColor="transparent",null===u?n.appendChild(t):n.insertBefore(t,u);break e}}null!==t&&Wt(t,e,r)}null!==f&&f.observe(r,Jr)}finally{Gr=d,Yr=u}}if(null!==m){var V=m;let t=Array.from(e._listeners.mutation),n=t.length;for(let e=0;e<n;e++){let[n,r]=t[e],o=V.get(r);void 0!==o&&n(o,{dirtyLeaves:v,updateTags:x})}}Er(a)||null===a||null!==l&&l.is(a)||e.dispatchCommand(B,void 0);var Q=e._pendingDecorators;null!==Q&&(e._decorators=Q,e._pendingDecorators=null,io("decorator",e,!0,Q));var J=ht(t||i),X=ht(n);if(J!==X&&io("textcontent",e,!0,X),io("update",e,!0,{dirtyElements:b,dirtyLeaves:v,editorState:n,normalizedNodes:y,prevEditorState:t||i,tags:x}),e._deferred=[],0!==_.length){let t=e._updating;e._updating=!0;try{for(let e=0;e<_.length;e++)_[e]()}finally{e._updating=t}}var q=e._updates;if(0!==q.length){let t=q.shift();if(t){let[n,r]=t;so(e,n,r)}}}}function io(e,t,n,...r){let o=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=o}}function lo(e,t,n){if(!1===e._updating||Gr!==e){let r=!1;return e.update((()=>{r=lo(e,t,n)})),r}let r=_t(e);for(let i=4;0<=i;i--)for(let l=0;l<r.length;l++){var o=r[l]._commands.get(t);if(void 0!==o&&void 0!==(o=o[i])){let t=(o=Array.from(o)).length;for(let r=0;r<t;r++)if(!0===o[r](n,e))return!0}}return!1}function ao(e,t){let n=e._updates;for(t=t||!1;0!==n.length;){var r=n.shift();if(r){let n,[o,i]=r;void 0!==i&&(r=i.onUpdate,n=i.tag,i.skipTransforms&&(t=!0),r&&e._deferred.push(r),n&&e._updateTags.add(n)),o()}}return t}function so(e,t,n){let r=e._updateTags;var o,i=o=!1;if(void 0!==n){var l=n.onUpdate;null!=(o=n.tag)&&r.add(o),o=n.skipTransforms||!1,i=n.discrete||!1}l&&e._deferred.push(l),n=e._editorState;let a=!1;(null===(l=e._pendingEditorState)||l._readOnly)&&(l=e._pendingEditorState=new xo(new Map((l||n)._nodeMap)),a=!0),l._flushSync=i,i=Yr;let s=Ur,u=Gr,c=e._updating;Yr=l,Ur=!1,e._updating=!0,Gr=e;try{a&&(e._headless?null!=n._selection&&(l._selection=n._selection.clone()):l._selection=function(e){let t=e.getEditorState()._selection,n=jt(e._window);return kr(t)||wr(t)?t.clone():$r(t,n,e)}(e));let r=e._compositionKey;t(),o=ao(e,o),function(e,t){if(t=t.getEditorState()._selection,Er(e=e._selection)){var n=e.anchor;let r,o=e.focus;"text"===n.type&&(r=n.getNode(),r.selectionTransform(t,e)),"text"===o.type&&r!==(n=o.getNode())&&n.selectionTransform(t,e)}}(l,e),0!==e._dirtyType&&(o?function(e,t){t=t._dirtyLeaves,e=e._nodeMap;for(let n of t)fr(t=e.get(n))&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Qe(t)}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements;e=e._nodeMap;let o=dt(),i=new Map;var l=n;let a=l.size;for(var s=r,u=s.size;0<a||0<u;){if(0<a){t._dirtyLeaves=new Set;for(let r of l)fr(l=e.get(r))&&l.isAttached()&&l.isSimpleText()&&!l.isUnmergeable()&&Qe(l),void 0!==l&&void 0!==l&&l.__key!==o&&l.isAttached()&&to(t,l,i),n.add(r);if(a=(l=t._dirtyLeaves).size,0<a){Qr++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(let n of s)s=n[0],u=n[1],("root"===s||u)&&(void 0!==(l=e.get(s))&&void 0!==l&&l.__key!==o&&l.isAttached()&&to(t,l,i),r.set(s,u));a=(l=t._dirtyLeaves).size,u=(s=t._dirtyElements).size,Qr++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),ao(e),function(e,t,n,r){e=e._nodeMap,t=t._nodeMap;let o=[];for(let[n]of r){let i=t.get(n);void 0===i||i.isAttached()||(mo(i)&&Ut(i,n,e,t,o,r),e.has(n)||r.delete(n),o.push(n))}for(let e of o)t.delete(e);for(let o of n)void 0===(r=t.get(o))||r.isAttached()||(e.has(o)||n.delete(o),t.delete(o))}(n,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Er(i)){let e=l._nodeMap,t=i.focus.key;void 0!==e.get(i.anchor.key)&&void 0!==e.get(t)||xe(19)}else kr(i)&&0===i._nodes.size&&(l._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=n,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void oo(e)}finally{Yr=i,Ur=s,Gr=u,e._updating=c,Qr=0}0!==e._dirtyType||function(e,t){if(t=t.getEditorState()._selection,e=e._selection,null!==e){if(e.dirty||!e.is(t))return!0}else if(null!==t)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,oo(e)):a&&Ze((()=>{oo(e)})):(l._flushSync=!1,a&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function uo(e,t,n){e._updating?e._updates.push([t,n]):so(e,t,n)}class co extends Un{constructor(e){super(e)}decorate(){xe(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function po(e){return e instanceof co}class fo extends Un{constructor(e){super(e),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return $e[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){let e=eo()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;null!==t;){if(fr(t)&&e.push(t),mo(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;null!==e;){if(mo(e)){let t=e.getFirstChild();if(null!==t){e=t;continue}}break}return e}getLastDescendant(){let e=this.getLastChild();for(;null!==e;){if(mo(e)){let t=e.getLastChild();if(null!==t){e=t;continue}}break}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;return e>=n?mo(e=t[n-1])&&e.getLastDescendant()||e||null:mo(e=t[e])&&e.getFirstDescendant()||e||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:pt(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&xe(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:pt(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&xe(96,this.__key),e}getChildAtIndex(e){var t=this.getChildrenSize();let n;if(e<t/2){for(n=this.getFirstChild(),t=0;null!==n&&t<=e;){if(t===e)return n;n=n.getNextSibling(),t++}return null}for(n=this.getLastChild(),--t;null!==n&&t>=e;){if(t===e)return n;n=n.getPreviousSibling(),t--}return null}getTextContent(){let e="",t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let o=t[r];e+=o.getTextContent(),mo(o)&&r!==n-1&&!o.isInline()&&(e+="\n\n")}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let o=t[r];e+=o.getTextContentSize(),mo(o)&&r!==n-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){return""!==e&&(e=De[e],0!=(this.getFormat()&e))}select(e,t){qr();let n=zr(),r=e,o=t;var i=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){if(fr(e=this.getFirstChild())||mo(e))return e.select(0,0)}else if(!(void 0!==e&&e!==i||void 0!==t&&t!==i)&&(fr(e=this.getLastChild())||mo(e)))return e.select();return void 0===r&&(r=i),void 0===o&&(o=i),i=this.__key,Er(n)?(n.anchor.set(i,r,"element"),n.focus.set(i,o,"element"),n.dirty=!0,n):Ir(i,r,i,o,"element","element")}selectStart(){let e=this.getFirstDescendant();return mo(e)||fr(e)?e.select(0,0):null!==e?e.selectPrevious():this.select(0,0)}selectEnd(){let e=this.getLastDescendant();return mo(e)||fr(e)?e.select():null!==e?e.selectNext():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?De[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){let r=n.length,o=this.getChildrenSize(),i=this.getWritable(),l=i.__key;var a=[],s=[];let u=this.getChildAtIndex(e+t),c=null,d=o-t+r;if(0!==e)if(e===o)c=this.getLastChild();else{var p=this.getChildAtIndex(e);null!==p&&(c=p.getPreviousSibling())}if(0<t){var f=null===c?this.getFirstChild():c.getNextSibling();for(p=0;p<t;p++){null===f&&xe(100);var m=f.getNextSibling(),g=f.__key;st(f=f.getWritable()),s.push(g),f=m}}for(p=c,m=0;m<r;m++){g=n[m],null!==p&&g.is(p)&&(c=p=p.getPreviousSibling()),(f=g.getWritable()).__parent===l&&d--,st(f);let e=g.__key;null===p?(i.__first=e,f.__prev=null):((p=p.getWritable()).__next=e,f.__prev=p.__key),g.__key===l&&xe(76),f.__parent=l,a.push(e),p=g}if(e+t===o?null!==p&&(p.getWritable().__next=null,i.__last=p.__key):null!==u&&(e=u.getWritable(),null!==p?(t=p.getWritable(),e.__prev=p.__key,t.__next=u.__key):e.__prev=null),i.__size=d,s.length&&Er(e=zr())){s=new Set(s),a=new Set(a);let{anchor:t,focus:n}=e;go(t,s,a)&&Wr(t,t.getNode(),this,c,u),go(n,s,a)&&Wr(n,n.getNode(),this,c,u),0!==d||this.canBeEmpty()||$t(this)||this.remove()}return i}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 mo(e){return e instanceof fo}function go(e,t,n){for(e=e.getNode();e;){let r=e.__key;if(t.has(r)&&!n.has(r))return!0;e=e.getParent()}return!1}class ho extends fo{static getType(){return"root"}static clone(){return new ho}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){xe(51)}getTextContent(){let e=this.__cachedText;return!Xr()&&0!==eo()._dirtyType||null===e?super.getTextContent():e}remove(){xe(52)}replace(){xe(53)}insertBefore(){xe(54)}insertAfter(){xe(55)}updateDOM(){return!1}append(...e){for(let t=0;t<e.length;t++){let n=e[t];mo(n)||po(n)||xe(56)}return super.append(...e)}static importJSON(e){let t=vt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function vo(e){return e instanceof ho}function bo(){return new xo(new Map([["root",new ho]]))}function yo(e){let t=e.exportJSON();var n=e.constructor;t.type!==n.getType()&&xe(130,n.name);let r=t.children;if(mo(e))for(Array.isArray(r)||xe(59,n.name),e=e.getChildren(),n=0;n<e.length;n++){let t=yo(e[n]);r.push(t)}return t}class xo{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._readOnly=this._flushSync=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return ro(this,e)}clone(e){return(e=new xo(this._nodeMap,void 0===e?this._selection:e))._readOnly=!0,e}toJSON(){return ro(this,(()=>({root:yo(vt())})))}}class _o extends fo{static getType(){return"paragraph"}static clone(e){return new _o(e.__key)}createDOM(e){let t=document.createElement("p");return void 0!==(e=kt(e.theme,"paragraph"))&&t.classList.add(...e),t}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Eo,priority:0})}}exportDOM(e){if(({element:e}=super.exportDOM(e)),e&&this.isEmpty()&&e.append(document.createElement("br")),e){var t=this.getFormatType();e.style.textAlign=t,(t=this.getDirection())&&(e.dir=t),0<(t=this.getIndent())&&(e.style.textIndent=20*t+"px")}return{element:e}}static importJSON(e){let t=Co();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(e,t){e=Co();let n=this.getDirection();return e.setDirection(n),this.insertAfter(e,t),e}collapseAtStart(){let e=this.getChildren();if(0===e.length||fr(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Eo(e){let t=Co();return e.style&&(t.setFormat(e.style.textAlign),0<(e=parseInt(e.style.textIndent,10)/20)&&t.setIndent(e)),{node:t}}function Co(){return Bt(new _o)}function wo(e,t,n,r){let o=e._keyToDOMMap;o.clear(),e._editorState=bo(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null,null!==(r=e._observer)&&(r.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class So{constructor(e,t,n,r,o,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,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=r,this._nodes=n,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=Et(),this._onError=o,this._htmlConversions=i,this._editable=l,this._headless=null!==t&&t._headless,this._blockCursorElement=this._window=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&xe(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let o=r.get(e);void 0===o&&xe(36,String(e));let i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){void 0===this._nodes.get(e.getType())&&xe(37,e.name);let n=this._listeners.mutation;return n.set(t,e),()=>{n.delete(t)}}registerNodeTransformToKlass(e,t){var n=e.getType();return void 0===(n=this._nodes.get(n))&&xe(37,e.name),n.transforms.add(t),n}registerNodeTransform(e,t){var n=this.registerNodeTransformToKlass(e,t);let r=[n];return null!=(n=n.replaceWithKlass)&&(n=this.registerNodeTransformToKlass(n,t),r.push(n)),function(e,t){uo(e,(()=>{var e=Zr();if(!e.isEmpty())if("root"===t)vt().markDirty();else{e=e._nodeMap;for(let[,t]of e)t.markDirty()}}),null===e._pendingEditorState?{tag:"history-merge"}:void 0)}(this,e.getType()),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return lo(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let i=kt(this._config.theme,"root");var n=this._pendingEditorState||this._editorState;if(this._rootElement=e,wo(this,t,e,n),null!==t){if(!this._config.disableEvents){0!==Mn&&(Mn--,0===Mn&&t.ownerDocument.removeEventListener("selectionchange",Yn));var r=t.__lexicalEditor;if(null!=r){if(null!==r._parentEditor){var o=_t(r);o=o[o.length-1]._key,Kn.get(o)===r&&Kn.delete(o)}else Kn.delete(r._key);t.__lexicalEditor=null}for(r=jn(t),o=0;o<r.length;o++)r[o]();t.__lexicalEventHandles=[]}null!=i&&t.classList.remove(...i)}null!==e?(n=(n=e.ownerDocument)&&n.defaultView||null,(r=e.style).userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=n,this._dirtyType=2,Ge(this),this._updateTags.add("history-merge"),oo(this),this._config.disableEvents||function(e,t){0===Mn&&e.ownerDocument.addEventListener("selectionchange",Yn),Mn++,e.__lexicalEditor=t;let n=jn(e);for(let r=0;r<Tn.length;r++){let[o,i]=Tn[r],l="function"==typeof i?e=>{!0!==e._lexicalHandled&&(e._lexicalHandled=!0,t.isEditable()&&i(e,t))}:e=>{if(!0!==e._lexicalHandled&&(e._lexicalHandled=!0,t.isEditable()))switch(o){case"cut":return lo(t,he,e);case"copy":return lo(t,ge,e);case"paste":return lo(t,Y,e);case"dragstart":return lo(t,pe,e);case"dragover":return lo(t,fe,e);case"dragend":return lo(t,me,e);case"focus":return lo(t,ve,e);case"blur":return lo(t,be,e);case"drop":return lo(t,de,e)}};e.addEventListener(o,l),n.push((()=>{e.removeEventListener(o,l)}))}}(e,this),null!=i&&e.classList.add(...i)):(this._editorState=n,this._window=this._pendingEditorState=null),io("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&xe(38),Ye(this);let n=this._pendingEditorState,r=this._updateTags;t=void 0!==t?t.tag:null,null===n||n.isEmpty()||(null!=t&&r.add(t),oo(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=t&&r.add(t),oo(this)}parseEditorState(e,t){e="string"==typeof e?JSON.parse(e):e;let n=bo(),r=Yr,o=Ur,i=Gr,l=this._dirtyElements,a=this._dirtyLeaves,s=this._cloneNotNeeded,u=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,Yr=n,Ur=!1,Gr=this;try{no(e.root,this._nodes),t&&t(),n._readOnly=!0}catch(e){e instanceof Error&&this._onError(e)}finally{this._dirtyElements=l,this._dirtyLeaves=a,this._cloneNotNeeded=s,this._dirtyType=u,Yr=r,Ur=o,Gr=i}return n}update(e,t){uo(this,e,t)}focus(e,t={}){let n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),uo(this,(()=>{let e=zr(),n=vt();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){var e=this._rootElement;null!==e&&e.blur(),null!==(e=jt(this._window))&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,io("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}class ko extends fo{constructor(e,t){super(t),this.__colSpan=e,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}}function To(e){return e instanceof ko}class Ao extends fo{}function No(e){return e instanceof Ao}class Ro extends fo{}function Oo(e){return e instanceof Ro}z.$addUpdateTag=function(e){qr(),eo()._updateTags.add(e)},z.$applyNodeReplacement=Bt,z.$copyNode=zt,z.$createLineBreakNode=Jn,z.$createNodeSelection=Dr,z.$createParagraphNode=Co,z.$createRangeSelection=function(){let e=new hr("root",0,"element"),t=new hr("root",0,"element");return new Sr(e,t,0,"")},z.$createTabNode=gr,z.$createTextNode=pr,z.$getAdjacentNode=Nt,z.$getNearestNodeFromDOMNode=mt,z.$getNearestRootOrShadowRoot=Dt,z.$getNodeByKey=pt,z.$getPreviousSelection=Br,z.$getRoot=vt,z.$getSelection=zr,z.$getTextContent=function(){let e=zr();return null===e?"":e.getTextContent()},z.$hasAncestor=Pt,z.$hasUpdateTag=function(e){return eo()._updateTags.has(e)},z.$insertNodes=function(e,t){let n=zr()||Br();return null===n&&(n=vt().selectEnd()),n.insertNodes(e,t)},z.$isBlockElementNode=Pr,z.$isDecoratorNode=po,z.$isElementNode=mo,z.$isInlineElementOrDecoratorNode=function(e){return mo(e)&&e.isInline()||po(e)&&e.isInline()},z.$isLeafNode=lt,z.$isLineBreakNode=Xn,z.$isNodeSelection=kr,z.$isParagraphNode=function(e){return e instanceof _o},z.$isRangeSelection=Er,z.$isRootNode=vo,z.$isRootOrShadowRoot=$t,z.$isTabNode=function(e){return e instanceof mr},z.$isTextNode=fr,z.$nodesOfType=function(e){var t=Zr();let n=t._readOnly,r=e.getType();t=t._nodeMap;let o=[];for(let[,i]of t)i instanceof e&&i.__type===r&&(n||i.isAttached())&&o.push(i);return o},z.$normalizeSelection__EXPERIMENTAL=Je,z.$parseSerializedNode=function(e){return no(e,eo()._nodes)},z.$setCompositionKey=ct,z.$setSelection=bt,z.$splitNode=Kt,z.BLUR_COMMAND=be,z.CAN_REDO_COMMAND={},z.CAN_UNDO_COMMAND={},z.CLEAR_EDITOR_COMMAND={},z.CLEAR_HISTORY_COMMAND={},z.CLICK_COMMAND=F,z.COMMAND_PRIORITY_CRITICAL=4,z.COMMAND_PRIORITY_EDITOR=0,z.COMMAND_PRIORITY_HIGH=3,z.COMMAND_PRIORITY_LOW=1,z.COMMAND_PRIORITY_NORMAL=2,z.CONTROLLED_TEXT_INSERTION_COMMAND=K,z.COPY_COMMAND=ge,z.CUT_COMMAND=he,z.DELETE_CHARACTER_COMMAND=H,z.DELETE_LINE_COMMAND=V,z.DELETE_WORD_COMMAND=U,z.DEPRECATED_$computeGridMap=Kr,z.DEPRECATED_$createGridSelection=function(){let e=new hr("root",0,"element"),t=new hr("root",0,"element");return new Cr("root",e,t)},z.DEPRECATED_$getNodeTriplet=function(e){e instanceof ko||(e instanceof Un?To(e=Yt(e,To))||xe(114):To(e=Yt(e.getNode(),To))||xe(114));let t=e.getParent();Oo(t)||xe(115);let n=t.getParent();return No(n)||xe(116),[e,t,n]},z.DEPRECATED_$isGridCellNode=To,z.DEPRECATED_$isGridNode=No,z.DEPRECATED_$isGridRowNode=Oo,z.DEPRECATED_$isGridSelection=wr,z.DEPRECATED_GridCellNode=ko,z.DEPRECATED_GridNode=Ao,z.DEPRECATED_GridRowNode=Ro,z.DRAGEND_COMMAND=me,z.DRAGOVER_COMMAND=fe,z.DRAGSTART_COMMAND=pe,z.DROP_COMMAND=de,z.DecoratorNode=co,z.ElementNode=fo,z.FOCUS_COMMAND=ve,z.FORMAT_ELEMENT_COMMAND={},z.FORMAT_TEXT_COMMAND=Q,z.INDENT_CONTENT_COMMAND={},z.INSERT_LINE_BREAK_COMMAND=W,z.INSERT_PARAGRAPH_COMMAND=j,z.INSERT_TAB_COMMAND={},z.KEY_ARROW_DOWN_COMMAND=oe,z.KEY_ARROW_LEFT_COMMAND=te,z.KEY_ARROW_RIGHT_COMMAND=Z,z.KEY_ARROW_UP_COMMAND=re,z.KEY_BACKSPACE_COMMAND=ae,z.KEY_DELETE_COMMAND=ue,z.KEY_DOWN_COMMAND=q,z.KEY_ENTER_COMMAND=ie,z.KEY_ESCAPE_COMMAND=se,z.KEY_MODIFIER_COMMAND=ye,z.KEY_SPACE_COMMAND=le,z.KEY_TAB_COMMAND=ce,z.LineBreakNode=Vn,z.MOVE_TO_END=ee,z.MOVE_TO_START=ne,z.OUTDENT_CONTENT_COMMAND={},z.PASTE_COMMAND=Y,z.ParagraphNode=_o,z.REDO_COMMAND=X,z.REMOVE_TEXT_COMMAND=G,z.RootNode=ho,z.SELECTION_CHANGE_COMMAND=B,z.TabNode=mr,z.TextNode=rr,z.UNDO_COMMAND=J,z.createCommand=function(){return{}},z.createEditor=function(e){var t=e||{},n=Gr,r=t.theme||{};let o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,l=bo(),a=t.namespace||(null!==o?o._config.namespace:Et()),s=t.editorState,u=[ho,rr,Vn,mr,_o,...t.nodes||[]],c=t.onError;if(t=void 0===t.editable||t.editable,void 0===e&&null!==n)e=n._nodes;else for(e=new Map,n=0;n<u.length;n++){let t=u[n],r=null;var d=null;"function"!=typeof t&&(t=(d=t).replace,r=d.with,d=d.withKlass?d.withKlass:null);let o=t.getType(),i=t.transform(),l=new Set;null!==i&&l.add(i),e.set(o,{klass:t,replace:r,replaceWithKlass:d,transforms:l})}return r=new So(l,o,e,{disableEvents:i,namespace:a,theme:r},c||console.error,function(e){let t=new Map,n=new Set;return e.forEach((e=>{if(null!=(e=null!=e.klass.importDOM?e.klass.importDOM.bind(e.klass):null)&&!n.has(e)){n.add(e);var r=e();null!==r&&Object.keys(r).forEach((e=>{let n=t.get(e);void 0===n&&(n=[],t.set(e,n)),n.push(r[e])}))}})),t}(e),t),void 0!==s&&(r._pendingEditorState=s,r._dirtyType=2),r},z.getNearestEditorFromDOMNode=nt,z.isSelectionCapturedInDecoratorInput=et,z.isSelectionWithinEditor=tt;var Mo=z,Lo=Mo;let Po=new Map;function Io(e){for(;null!=e;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function Do(e){let t=e.parentNode;if(null==t)throw Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function $o(e){let t={};e=e.split(";");for(let n of e)if(""!==n){let[e,r]=n.split(/:([^]+)/);t[e.trim()]=r.trim()}return t}function zo(e){let t=Po.get(e);return void 0===t&&(t=$o(e),Po.set(e,t)),t}function Bo(e,t){var n=zo("getStyle"in e?e.getStyle():e.style);t=Object.entries(t).reduce(((e,[t,n])=>(null===n?delete e[t]:e[t]=n,e)),{...n}),n=function(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}(t),e.setStyle(n),Po.set(n,t)}function Fo(e){for(;null!==e&&!Lo.$isRootOrShadowRoot(e);){let t=e.getLatest(),n=e.getParent();0===t.getChildrenSize()&&e.remove(!0),e=n}}function Ho(e,t,n,r,o=null){if(0!==t.length){var i=t[0],l=new Map,a=[];(i=Lo.$isElementNode(i)?i:i.getParentOrThrow()).isInline()&&(i=i.getParentOrThrow());for(var s=!1;null!==i;){var u=i.getPreviousSibling();if(null!==u){i=u,s=!0;break}if(i=i.getParentOrThrow(),Lo.$isRootOrShadowRoot(i))break}u=new Set;for(var c=0;c<n;c++){var d=t[c];Lo.$isElementNode(d)&&0===d.getChildrenSize()&&u.add(d.getKey())}var p=new Set;for(c=0;c<n;c++){var f=(d=t[c]).getParent();if(null!==f&&f.isInline()&&(f=f.getParent()),null!==f&&Lo.$isLeafNode(d)&&!p.has(d.getKey())){if(d=f.getKey(),void 0===l.get(d)){let e=r();e.setFormat(f.getFormatType()),e.setIndent(f.getIndent()),a.push(e),l.set(d,e),f.getChildren().forEach((t=>{e.append(t),p.add(t.getKey()),Lo.$isElementNode(t)&&t.getChildrenKeys().forEach((e=>p.add(e)))})),Fo(f)}}else u.has(d.getKey())&&((f=r()).setFormat(d.getFormatType()),f.setIndent(d.getIndent()),a.push(f),d.remove(!0))}if(null!==o)for(t=0;t<a.length;t++)o.append(a[t]);if(t=null,Lo.$isRootOrShadowRoot(i))if(s)if(null!==o)i.insertAfter(o);else for(o=a.length-1;0<=o;o--)i.insertAfter(a[o]);else if(s=i.getFirstChild(),Lo.$isElementNode(s)&&(i=s),null===s)if(o)i.append(o);else for(o=0;o<a.length;o++)s=a[o],i.append(s),t=s;else if(null!==o)s.insertBefore(o);else for(i=0;i<a.length;i++)o=a[i],s.insertBefore(o),t=o;else if(o)i.insertAfter(o);else for(o=a.length-1;0<=o;o--)s=a[o],i.insertAfter(s),t=s;a=Lo.$getPreviousSelection(),Lo.$isRangeSelection(a)&&a.anchor.getNode().isAttached()&&a.focus.getNode().isAttached()?Lo.$setSelection(a.clone()):null!==t?t.selectEnd():e.dirty=!0}}function Wo(e,t,n,r){e.modify(t?"extend":"move",n,r)}function jo(e){return e=e.anchor.getNode(),"rtl"===(Lo.$isRootNode(e)?e:e.getParentOrThrow()).getDirection()}$.$addNodeStyle=function(e){let t=$o(e=e.getStyle());Po.set(e,t)},$.$cloneWithProperties=function(e){let t=(e=e.getLatest()).constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,Lo.$isElementNode(e)&&Lo.$isElementNode(t)?(t.__first=e.__first,t.__last=e.__last,t.__size=e.__size,t.__format=e.__format,t.__indent=e.__indent,t.__dir=e.__dir,t):(Lo.$isTextNode(e)&&Lo.$isTextNode(t)&&(t.__format=e.__format,t.__style=e.__style,t.__mode=e.__mode,t.__detail=e.__detail),t)},$.$getSelectionStyleValueForProperty=function(e,t,n=""){let r=null,o=e.getNodes();var i=e.anchor,l=e.focus,a=e.isBackward();let s=a?l.offset:i.offset;if(i=a?l.getNode():i.getNode(),""!==e.style&&(null!==(e=zo(e.style))&&t in e))return e[t];for(e=0;e<o.length;e++){var u=o[e];if((0===e||0!==s||!u.is(i))&&Lo.$isTextNode(u))if(l=t,a=n,l=null!==(u=zo(u=u.getStyle()))&&u[l]||a,null===r)r=l;else if(r!==l){r="";break}}return null===r?n:r},$.$isAtNodeEnd=function(e){return"text"===e.type?e.offset===e.getNode().getTextContentSize():e.offset===e.getNode().getChildrenSize()},$.$isParentElementRTL=jo,$.$moveCaretSelection=Wo,$.$moveCharacter=function(e,t,n){let r=jo(e);Wo(e,t,n?!r:r,"character")},$.$patchStyleText=function(e,t){var n=e.getNodes();let r=n.length-1,o=n[0],i=n[r];if(e.isCollapsed())Bo(e,t);else{var l=e.anchor,a=e.focus,s=o.getTextContent().length,u=a.offset,c=l.offset,d=l.isBefore(a),p=d?c:u;e=d?u:c;var f=d?l.type:a.type,m=d?a.type:l.type;if(l=d?a.key:l.key,Lo.$isTextNode(o)&&p===s&&(a=o.getNextSibling(),Lo.$isTextNode(a)&&(p=c=0,o=a)),1===n.length)Lo.$isTextNode(o)&&((p="element"===f?0:c>u?u:c)!==(e="element"===m?s:c>u?c:u)&&(0===p&&e===s?(Bo(o,t),o.select(p,e)):(n=o.splitText(p,e),Bo(n=0===p?n[0]:n[1],t),n.select(0,e-p))));else for(Lo.$isTextNode(o)&&p<o.getTextContentSize()&&(0!==p&&(o=o.splitText(p)[1]),Bo(o,t)),Lo.$isTextNode(i)&&(p=i.getTextContent().length,i.__key!==l&&0!==e&&(e=p),e!==p&&([i]=i.splitText(e)),0!==e&&Bo(i,t)),e=1;e<r;e++)s=(p=n[e]).getKey(),Lo.$isTextNode(p)&&s!==o.getKey()&&s!==i.getKey()&&!p.isToken()&&Bo(p,t)}},$.$selectAll=function(e){let t=e.anchor;e=e.focus;var n=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let r=n.getFirstDescendant();n=n.getLastDescendant();let o="element",i="element",l=0;Lo.$isTextNode(r)?o="text":Lo.$isElementNode(r)||null===r||(r=r.getParentOrThrow()),Lo.$isTextNode(n)?(i="text",l=n.getTextContentSize()):Lo.$isElementNode(n)||null===n||(n=n.getParentOrThrow()),r&&n&&(t.set(r.getKey(),0,o),e.set(n.getKey(),l,i))},$.$setBlocksType=function(e,t){if("root"===e.anchor.key){t=t();var n=Lo.$getRoot();(e=n.getFirstChild())?e.replace(t,!0):n.append(t)}else for(n=e.getNodes(),e=e.anchor.getNode().getParentOrThrow(),-1===n.indexOf(e)&&n.push(e),e.isInline()&&(e=e.getParentOrThrow(),-1===n.indexOf(e)&&n.push(e)),e=0;e<n.length;e++){let i=n[e];var r=i;if(!Lo.$isElementNode(r)||Lo.$isRootOrShadowRoot(r))r=!1;else{var o=r.getFirstChild();o=null===o||Lo.$isTextNode(o)||o.isInline(),r=!r.isInline()&&!1!==r.canBeEmpty()&&o}r&&((r=t()).setFormat(i.getFormatType()),r.setIndent(i.getIndent()),i.replace(r,!0))}},$.$shouldOverrideDefaultCharacterSelection=function(e,t){return e=Lo.$getAdjacentNode(e.focus,t),Lo.$isDecoratorNode(e)&&!e.isIsolated()||Lo.$isElementNode(e)&&!e.isInline()&&!e.canBeEmpty()},$.$sliceSelectedTextNodeContent=function(e,t){if(t.isSelected()&&!t.isSegmented()&&!t.isToken()&&(Lo.$isRangeSelection(e)||Lo.DEPRECATED_$isGridSelection(e))){var n=e.anchor.getNode(),r=e.focus.getNode(),o=t.is(n),i=t.is(r);if(o||i){o=e.isBackward();let l,[a,s]=e.getCharacterOffsets();e=n.is(r),i=t.is(o?r:n),r=t.is(o?n:r),n=0,e?(n=a>s?s:a,l=a>s?a:s):i?(n=o?s:a,l=void 0):r&&(n=0,l=o=o?a:s),t.__text=t.__text.slice(n,l)}}return t},$.$wrapNodes=function(e,t,n=null){var r=e.getNodes();let o=r.length;var i=e.anchor;if(0===o||1===o&&"element"===i.type&&0===i.getNode().getChildrenSize()){r=(e="text"===i.type?i.getNode().getParentOrThrow():i.getNode()).getChildren();let o=t();o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),r.forEach((e=>o.append(e))),n&&(o=n.append(o)),e.replace(o)}else{i=null;var l=[];for(let a=0;a<o;a++){let o=r[a];Lo.$isRootOrShadowRoot(o)?(Ho(e,l,l.length,t,n),l=[],i=o):null===i||null!==i&&Lo.$hasAncestor(o,i)?l.push(o):(Ho(e,l,l.length,t,n),l=[o])}Ho(e,l,l.length,t,n)}},$.createDOMRange=function(e,t,n,r,o){let i=t.getKey(),l=r.getKey(),a=document.createRange(),s=e.getElementByKey(i);if(e=e.getElementByKey(l),Lo.$isTextNode(t)&&(s=Io(s)),Lo.$isTextNode(r)&&(e=Io(e)),void 0===t||void 0===r||null===s||null===e)return null;"BR"===s.nodeName&&([s,n]=Do(s)),"BR"===e.nodeName&&([e,o]=Do(e)),t=s.firstChild,s===e&&null!=t&&"BR"===t.nodeName&&0===n&&0===o&&(o=1);try{a.setStart(s,n),a.setEnd(e,o)}catch(e){return null}return!a.collapsed||n===o&&i===l||(a.setStart(e,o),a.setEnd(s,n)),a},$.createRectsFromDOMRange=function(e,t){var n=e.getRootElement();if(null===n)return[];e=n.getBoundingClientRect(),n=getComputedStyle(n),n=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight);let r,o=(t=Array.from(t.getClientRects())).length;t.sort(((e,t)=>{let n=e.top-t.top;return 3>=Math.abs(n)?e.left-t.left:n}));for(let i=0;i<o;i++){let l=t[i],a=l.width+n===e.width;r&&r.top<=l.top&&r.top+r.height>l.top&&r.left+r.width>l.left||a?(t.splice(i--,1),o--):r=l}return t},$.getStyleObjectFromCSS=zo,$.trimTextContentFromAnchor=function(e,t,n){let r=t.getNode();if(Lo.$isElementNode(r)){var o=r.getDescendantByIndex(t.offset);null!==o&&(r=o)}for(;0<n&&null!==r;){var i=r.getPreviousSibling(),l=0;if(null===i){for(var a=(o=r.getParentOrThrow()).getPreviousSibling();null===a;){if(null===(o=o.getParent())){i=null;break}a=o.getPreviousSibling()}null!==o&&(l=o.isInline()?0:2,i=Lo.$isElementNode(a)?a.getLastDescendant():a)}if(""===(a=r.getTextContent())&&Lo.$isElementNode(r)&&!r.isInline()&&(a="\n\n"),o=r.getTextContentSize(),!Lo.$isTextNode(r)||n>=o)a=r.getParent(),r.remove(),null==a||0!==a.getChildrenSize()||Lo.$isRootNode(a)||a.remove(),n-=o+l,r=i;else{let s=r.getKey();l=e.getEditorState().read((()=>{const e=Lo.$getNodeByKey(s);return Lo.$isTextNode(e)&&e.isSimpleText()?e.getTextContent():null})),i=o-n;let u=a.slice(0,i);null!==l&&l!==a?(n=Lo.$getPreviousSelection(),o=r,r.isSimpleText()?r.setTextContent(l):(o=Lo.$createTextNode(l),r.replace(o)),Lo.$isRangeSelection(n)&&n.isCollapsed()&&(n=n.anchor.offset,o.select(n,n))):r.isSimpleText()?(l=t.key===s,(a=t.offset)<n&&(a=o),n=l?a-n:0,o=l?a:i,l&&0===n?([n]=r.splitText(n,o),n.remove()):([,n]=r.splitText(n,o),n.remove())):(n=Lo.$createTextNode(u),r.replace(n)),n=0}}};var Ko=$,Yo=Ko,Go=Mo;function Uo(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function Vo(e,t){for(;e!==Go.$getRoot()&&null!=e;){if(t(e))return e;e=e.getParent()}return null}function Qo(e){return 1===e.nodeType}D.$splitNode=Go.$splitNode,D.$dfs=function(e,t){let n=[];e=(e||Go.$getRoot()).getLatest(),t=t||(Go.$isElementNode(e)?e.getLastDescendant():e);for(var r=e,o=0;null!==(r=r.getParent());)o++;for(r=o;null!==e&&!e.is(t);)if(n.push({depth:r,node:e}),Go.$isElementNode(e)&&0<e.getChildrenSize())e=e.getFirstChild(),r++;else for(o=null;null===o&&null!==e;)null===(o=e.getNextSibling())?(e=e.getParent(),r--):e=o;return null!==e&&e.is(t)&&n.push({depth:r,node:e}),n},D.$findMatchingParent=Vo,D.$getNearestBlockElementAncestorOrThrow=function(e){let t=Vo(e,(e=>Go.$isElementNode(e)&&!e.isInline()));return Go.$isElementNode(t)||function(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(4,e.__key),t},D.$getNearestNodeOfType=function(e,t){for(;null!=e;){if(e instanceof t)return e;e=e.getParent()}return null},D.$insertNodeToNearestRoot=function(e){var t=Go.$getSelection()||Go.$getPreviousSelection();if(Go.$isRangeSelection(t)){var{focus:n}=t;if(t=n.getNode(),n=n.offset,Go.$isRootOrShadowRoot(t))null==(n=t.getChildAtIndex(n))?t.append(e):n.insertBefore(e),e.selectNext();else{let r,o;Go.$isTextNode(t)?(r=t.getParentOrThrow(),o=t.getIndexWithinParent(),0<n&&(o+=1,t.splitText(n))):(r=t,o=n),[,t]=Go.$splitNode(r,o),t.insertBefore(e),t.selectStart()}}else Go.$isNodeSelection(t)||Go.DEPRECATED_$isGridSelection(t)?(t=t.getNodes())[t.length-1].getTopLevelElementOrThrow().insertAfter(e):Go.$getRoot().append(e),t=Go.$createParagraphNode(),e.insertAfter(t),t.select();return e.getLatest()},D.$restoreEditorState=function(e,t){let n=new Map,r=e._pendingEditorState;for(let[e,r]of t._nodeMap){let t=Yo.$cloneWithProperties(r);Go.$isTextNode(t)&&(t.__text=r.__text),n.set(e,t)}r&&(r._nodeMap=n),e._dirtyType=2,e=t._selection,Go.$setSelection(null===e?null:e.clone())},D.$wrapNodeInElement=function(e,t){return t=t(),e.replace(t),t.append(e),t},D.addClassNamesToElement=function(e,...t){t.forEach((t=>{"string"==typeof t&&(t=t.split(" ").filter((e=>""!==e)),e.classList.add(...t))}))},D.isHTMLAnchorElement=function(e){return Qo(e)&&"A"===e.tagName},D.isHTMLElement=Qo,D.isMimeType=Uo,D.mediaFileReader=function(e,t){let n=e[Symbol.iterator]();return new Promise(((e,r)=>{let o=[],i=()=>{const{done:l,value:a}=n.next();if(l)return e(o);const s=new FileReader;s.addEventListener("error",r),s.addEventListener("load",(()=>{const e=s.result;"string"==typeof e&&o.push({file:a,result:e}),i()})),Uo(a,t)?s.readAsDataURL(a):i()};i()}))},D.mergeRegister=function(...e){return()=>{e.forEach((e=>e()))}},D.objectKlassEquals=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name},D.registerNestedElementResolver=function(e,t,n,r){return e.registerNodeTransform(t,(e=>{e:{for(var o=e.getChildren(),i=0;i<o.length;i++)if(o[i]instanceof t){o=null;break e}for(o=e;null!==o;)if(i=o,(o=o.getParent())instanceof t){o={child:i,parent:o};break e}o=null}if(null!==o){const{child:t,parent:l}=o;if(t.is(e)){if(r(l,e),o=(e=t.getNextSiblings()).length,l.insertAfter(t),0!==o){i=n(l),t.insertAfter(i);for(let t=0;t<o;t++)i.append(e[t])}l.canBeEmpty()||0!==l.getChildrenSize()||l.remove()}}}))},D.removeClassNamesFromElement=function(e,...t){t.forEach((t=>{"string"==typeof t&&e.classList.remove(...t.split(" "))}))};var Jo=D,Xo=Jo,qo=Mo;let Zo=new Set(["http:","https:","mailto:","sms:","tel:"]),ei=class e extends qo.ElementNode{static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e,t={},n){super(n);let{target:r=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=r,this.__rel=o,this.__title=i}createDOM(e){let t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),Xo.addClassNamesToElement(t,e.theme.link),t}updateDOM(e,t){let n=this.__url,r=this.__target,o=this.__rel,i=this.__title;return n!==e.__url&&(t.href=n),r!==e.__target&&(r?t.target=r:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),i!==e.__title&&(i?t.title=i:t.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:ti,priority:1})}}static importJSON(e){let t=ni(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{let t=new URL(e);if(!Zo.has(t.protocol))return"about:blank"}catch(e){}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){return e=this.getParentOrThrow().insertNewAfter(e,t),qo.$isElementNode(e)?(t=ni(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),e.append(t),t):null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t){if(!qo.$isRangeSelection(t))return!1;e=t.anchor.getNode();let n=t.focus.getNode();return this.isParentOf(e)&&this.isParentOf(n)&&0<t.getTextContent().length}};function ti(e){let t=null;if(Xo.isHTMLAnchorElement(e)){let n=e.textContent;null!==n&&""!==n&&(t=ni(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function ni(e,t){return qo.$applyNodeReplacement(new ei(e,t))}function ri(e){return e instanceof ei}let oi=class e extends ei{static getType(){return"autolink"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}static importJSON(e){let t=ii(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(e,t=!0){return e=this.getParentOrThrow().insertNewAfter(e,t),qo.$isElementNode(e)?(t=ii(this.__url,{rel:this._rel,target:this.__target,title:this.__title}),e.append(t),t):null}};function ii(e,t){return qo.$applyNodeReplacement(new oi(e,t))}let li=qo.createCommand("TOGGLE_LINK_COMMAND");I.$createAutoLinkNode=ii,I.$createLinkNode=ni,I.$isAutoLinkNode=function(e){return e instanceof oi},I.$isLinkNode=ri,I.AutoLinkNode=oi,I.LinkNode=ei,I.TOGGLE_LINK_COMMAND=li,I.toggleLink=function(e,t={}){let{target:n,title:r}=t,o=void 0===t.rel?"noreferrer":t.rel;if(t=qo.$getSelection(),qo.$isRangeSelection(t))if(t=t.extract(),null===e)t.forEach((e=>{if(ri(e=e.getParent())){let t=e.getChildren();for(let n=0;n<t.length;n++)e.insertBefore(t[n]);e.remove()}}));else{if(1===t.length){var i=t[0];if(i=ri(i)?i:function(e,t){for(;null!==e&&null!==(e=e.getParent())&&!t(e););return e}(i,ri),null!==i)return i.setURL(e),void 0!==n&&i.setTarget(n),null!==o&&i.setRel(o),void(void 0!==r&&i.setTitle(r))}let l=null,a=null;t.forEach((t=>{var i=t.getParent();if(i!==a&&null!==i&&(!qo.$isElementNode(t)||t.isInline()))if(ri(i))a=i,i.setURL(e),void 0!==n&&i.setTarget(n),null!==o&&a.setRel(o),void 0!==r&&a.setTitle(r);else if(i.is(l)||(l=i,a=ni(e,{rel:o,target:n}),ri(i)?null===t.getPreviousSibling()?i.insertBefore(a):i.insertAfter(a):t.insertBefore(a)),ri(t)){if(!t.is(a)){if(null!==a){i=t.getChildren();for(let e=0;e<i.length;e++)a.append(i[e])}t.remove()}}else null!==a&&a.append(t)}))}};var ai=I,si={},ui=Mo,ci=Jo;function di(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function pi(e){let t=1;for(e=e.getParent();null!=e;){if(Ai(e)){if(Ii(e=e.getParent())){t++,e=e.getParent();continue}di(40)}break}return t}function fi(e){Ii(e=e.getParent())||di(40);let t=e;for(;null!==t;)t=t.getParent(),Ii(t)&&(e=t);return e}function mi(e){let t=[];e=e.getChildren().filter(Ai);for(let n=0;n<e.length;n++){let r=e[n],o=r.getFirstChild();Ii(o)?t=t.concat(mi(o)):t.push(r)}return t}function gi(e){return Ai(e)&&Ii(e.getFirstChild())}function hi(e){return Ti().append(e)}function vi(e,t){return Ai(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function bi(e,t){e.splice(e.getChildrenSize(),0,t)}function yi(e,t){if(Ii(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),o=Ti();return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),bi(o,e.getChildren()),Ii(n)&&t===n.getListType()?(n.append(o),e.remove(),Ii(r)&&t===r.getListType()&&(bi(n,r.getChildren()),r.remove()),n):Ii(r)&&t===r.getListType()?(r.getFirstChildOrThrow().insertBefore(o),e.remove(),r):((t=Pi(t)).append(o),e.replace(t),_i(t),t)}function xi(e,t){var n=e.getLastChild();let r=t.getFirstChild();n&&r&&gi(n)&&gi(r)&&(xi(n.getFirstChild(),r.getFirstChild()),r.remove()),0<(n=t.getChildren()).length&&(e.append(...n),_i(e)),t.remove()}function _i(e,t){if(void 0!==(e=t||e.getChildren()))for(t=0;t<e.length;t++){let i=e[t];if(Ai(i)){let e=i.getValue();var n=i,r=n.getParent(),o=1;for(null!=r&&(Ii(r)?o=r.getStart():di(44)),n=n.getPreviousSiblings(),r=0;r<n.length;r++){let e=n[r];Ai(e)&&!Ii(e.getFirstChild())&&o++}e!==o&&i.setValue(o)}}}function Ei(e){if(!gi(e)){var t=e.getParent(),n=t?t.getParent():void 0,r=n?n.getParent():void 0;if(Ii(r)&&Ai(n)&&Ii(t)){var o=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(o))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{var l=t.getListType();o=Ti();let r=Pi(l);o.append(r),e.getPreviousSiblings().forEach((e=>r.append(e))),i=Ti(),l=Pi(l),i.append(l),bi(l,e.getNextSiblings()),n.insertBefore(o),n.insertAfter(i),n.replace(e)}_i(t),_i(r)}}}let Ci=class e extends ui.ElementNode{static getType(){return"listitem"}static clone(t){return new e(t.__value,t.__checked,t.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){let t=document.createElement("li"),n=this.getParent();return Ii(n)&&"check"===n.getListType()&&Si(t,this,null),t.value=this.__value,wi(t,e.theme,this),t}updateDOM(e,t,n){let r=this.getParent();return Ii(r)&&"check"===r.getListType()&&Si(t,this,e),t.value=this.__value,wi(t,n.theme,this),!1}static transform(){return e=>{let t=e.getParent();Ii(t)&&(_i(t),"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:ki,priority:0})}}static importJSON(e){let t=Ti();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(ui.$isElementNode(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Ai(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!Ii(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=Pi(n.getListType()),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&this.getChildren().forEach((t=>{e.append(t)})),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){var n=this.getParentOrThrow();Ii(n)||di(39);var r=this.getNextSiblings();if(Ai(e))return t=super.insertAfter(e,t),Ii(e=e.getParentOrThrow())&&_i(e),t;if(Ii(e)){for(n=e,r=(e=e.getChildren()).length-1;0<=r;r--)n=e[r],this.insertAfter(n,t);return n}if(n.insertAfter(e,t),0!==r.length){let o=Pi(n.getListType());r.forEach((e=>o.append(e))),e.insertAfter(o,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&gi(t)&&gi(n)?(xi(t.getFirstChild(),n.getFirstChild()),n.remove()):n&&(Ii(e=n.getParent())&&_i(e))}insertNewAfter(e,t=!0){return e=Ti(null==this.__checked&&void 0),this.insertAfter(e,t),e}collapseAtStart(e){let t=ui.$createParagraphNode();this.getChildren().forEach((e=>t.append(e)));var n=this.getParentOrThrow(),r=n.getParentOrThrow();let o=Ai(r);return 1===n.getChildrenSize()?o?(n.remove(),r.select()):(n.insertBefore(t),n.remove(),n=e.anchor,e=e.focus,r=t.getKey(),"element"===n.type&&n.getNode().is(this)&&n.set(r,n.offset,"element"),"element"===e.type&&e.getNode().is(this)&&e.set(r,e.offset,"element")):(n.insertBefore(t),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){return this.getLatest().__checked}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var e=this.getParent();if(null===e)return this.getLatest().__indent;e=e.getParentOrThrow();let t=0;for(;Ai(e);)e=e.getParentOrThrow().getParentOrThrow(),t++;return t}setIndent(e){"number"==typeof e&&-1<e||di(117);let t=this.getIndent();for(;t!==e;)if(t<e){e:{var n=new Set;if(gi(this)||n.has(this.getKey()))break e;let e=this.getParent();var r=this.getNextSibling(),o=this.getPreviousSibling();if(gi(r)&&gi(o)){if(Ii(o=o.getFirstChild())){o.append(this);var i=r.getFirstChild();Ii(i)&&(bi(o,i=i.getChildren()),r.remove(),n.add(r.getKey())),_i(o)}}else gi(r)?Ii(r=r.getFirstChild())&&(null!==(n=r.getFirstChild())&&n.insertBefore(this),_i(r)):gi(o)?Ii(r=o.getFirstChild())&&(r.append(this),_i(r)):Ii(e)&&(n=Ti(),i=Pi(e.getListType()),n.append(i),i.append(this),o?o.insertAfter(n):r?r.insertBefore(n):e.append(n),_i(i));Ii(e)&&_i(e)}t++}else Ei(this),t--;return this}insertBefore(e){if(Ai(e)){let e=this.getParentOrThrow();if(Ii(e)){_i(e,this.getNextSiblings())}}return super.insertBefore(e)}canInsertAfter(e){return Ai(e)}canReplaceWith(e){return Ai(e)}canMergeWith(e){return ui.$isParagraphNode(e)||Ai(e)}extractWithChild(e,t){if(!ui.$isRangeSelection(t))return!1;e=t.anchor.getNode();let n=t.focus.getNode();return this.isParentOf(e)&&this.isParentOf(n)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Pi("bullet")}};function wi(e,t,n){let r=[],o=[];var i=(t=t.list)?t.listitem:void 0;if(t&&t.nested)var l=t.nested.listitem;if(void 0!==i&&(i=i.split(" "),r.push(...i)),t){i=Ii(i=n.getParent())&&"check"===i.getListType();let e=n.getChecked();i&&!e||o.push(t.listitemUnchecked),i&&e||o.push(t.listitemChecked),i&&r.push(e?t.listitemChecked:t.listitemUnchecked)}void 0!==l&&(l=l.split(" "),n.getChildren().some((e=>Ii(e)))?r.push(...l):o.push(...l)),0<o.length&&ci.removeClassNamesFromElement(e,...o),0<r.length&&ci.addClassNamesToElement(e,...r)}function Si(e,t,n){Ii(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function ki(e){return{node:Ti(e=ci.isHTMLElement(e)&&"true"===e.getAttribute("aria-checked"))}}function Ti(e){return ui.$applyNodeReplacement(new Ci(void 0,e))}function Ai(e){return e instanceof Ci}let Ni=class e extends ui.ElementNode{static getType(){return"list"}static clone(t){return new e(t.__listType||Li[t.__tag],t.__start,t.__key)}constructor(e,t,n){super(n),this.__listType=e=Li[e]||e,this.__tag="number"===e?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){let t=this.getWritable();t.__listType=e,t.__tag="number"===e?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e){let t=document.createElement(this.__tag);return 1!==this.__start&&t.setAttribute("start",String(this.__start)),t.__lexicalListType=this.__listType,Ri(t,e.theme,this),t}updateDOM(e,t,n){return e.__tag!==this.__tag||(Ri(t,n.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:Mi,priority:0}),ul:()=>({conversion:Mi,priority:0})}}static importJSON(e){let t=Pi(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){return({element:e}=super.exportDOM(e)),e&&(1!==this.__start&&e.setAttribute("start",String(this.__start)),"check"===this.__listType&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let n=0;n<e.length;n++){var t=e[n];if(Ai(t))super.append(t);else{let e=Ti();Ii(t)?e.append(t):ui.$isElementNode(t)?(t=ui.$createTextNode(t.getTextContent()),e.append(t)):e.append(t),super.append(e)}}return _i(this),this}extractWithChild(e){return Ai(e)}};function Ri(e,t,n){let r=[],o=[];var i=t.list;if(void 0!==i){let e=i[`${n.__tag}Depth`]||[],a=(t=pi(n)-1)%e.length;var l=e[a];let s,u=i[n.__tag];if(void 0!==(i=i.nested)&&i.list&&(s=i.list),void 0!==u&&r.push(u),void 0!==l)for(l=l.split(" "),r.push(...l),l=0;l<e.length;l++)l!==a&&o.push(n.__tag+l);void 0!==s&&(n=s.split(" "),1<t?r.push(...n):o.push(...n))}0<o.length&&ci.removeClassNamesFromElement(e,...o),0<r.length&&ci.addClassNamesToElement(e,...r)}function Oi(e){let t=[];for(let r=0;r<e.length;r++){var n=e[r];Ai(n)?(t.push(n),1<(n=n.getChildren()).length&&n.forEach((e=>{Ii(e)&&t.push(hi(e))}))):t.push(hi(n))}return t}function Mi(e){let t=e.nodeName.toLowerCase(),n=null;return"ol"===t?n=Pi("number",e.start):"ul"===t&&(n=ci.isHTMLElement(e)&&"check"===e.getAttribute("__lexicallisttype")?Pi("check"):Pi("bullet")),{after:Oi,node:n}}let Li={ol:"number",ul:"bullet"};function Pi(e,t=1){return ui.$applyNodeReplacement(new Ni(e,t))}function Ii(e){return e instanceof Ni}let Di=ui.createCommand("INSERT_UNORDERED_LIST_COMMAND"),$i=ui.createCommand("INSERT_ORDERED_LIST_COMMAND"),zi=ui.createCommand("INSERT_CHECK_LIST_COMMAND"),Bi=ui.createCommand("REMOVE_LIST_COMMAND");si.$createListItemNode=Ti,si.$createListNode=Pi,si.$getListDepth=pi,si.$handleListInsertParagraph=function(){var e=ui.$getSelection();if(!ui.$isRangeSelection(e)||!e.isCollapsed())return!1;if(!Ai(e=e.anchor.getNode())||""!==e.getTextContent())return!1;var t=fi(e),n=e.getParent();Ii(n)||di(40);let r,o=n.getParent();if(ui.$isRootOrShadowRoot(o))r=ui.$createParagraphNode(),t.insertAfter(r);else{if(!Ai(o))return!1;r=Ti(),o.insertAfter(r)}if(r.select(),0<(t=e.getNextSiblings()).length){let e=Pi(n.getListType());ui.$isParagraphNode(r)?r.insertAfter(e):((n=Ti()).append(e),r.insertAfter(n)),t.forEach((t=>{t.remove(),e.append(t)}))}return function(e){for(;null==e.getNextSibling()&&null==e.getPreviousSibling();){let t=e.getParent();if(null==t||!Ai(e)&&!Ii(e))break;e=t}e.remove()}(e),!0},si.$isListItemNode=Ai,si.$isListNode=Ii,si.INSERT_CHECK_LIST_COMMAND=zi,si.INSERT_ORDERED_LIST_COMMAND=$i,si.INSERT_UNORDERED_LIST_COMMAND=Di,si.ListItemNode=Ci,si.ListNode=Ni,si.REMOVE_LIST_COMMAND=Bi,si.insertList=function(e,t){e.update((()=>{var e=ui.$getSelection();if(ui.$isRangeSelection(e)||ui.DEPRECATED_$isGridSelection(e)){var n=e.getNodes(),r=(e=e.anchor.getNode()).getParent();if(vi(e,n))n=Pi(t),ui.$isRootOrShadowRoot(r)?(e.replace(n),r=Ti(),ui.$isElementNode(e)&&(r.setFormat(e.getFormatType()),r.setIndent(e.getIndent())),n.append(r)):Ai(e)&&(bi(n,(e=e.getParentOrThrow()).getChildren()),e.replace(n));else for(e=new Set,r=0;r<n.length;r++){var o=n[r];if(ui.$isElementNode(o)&&o.isEmpty()&&!e.has(o.getKey()))yi(o,t);else if(ui.$isLeafNode(o))for(o=o.getParent();null!=o;){let n=o.getKey();if(Ii(o)){if(!e.has(n)){var i=Pi(t);bi(i,o.getChildren()),o.replace(i),_i(i),e.add(n)}break}if(i=o.getParent(),ui.$isRootOrShadowRoot(i)&&!e.has(n)){e.add(n),yi(o,t);break}o=i}}}}))},si.removeList=function(e){e.update((()=>{let e=ui.$getSelection();if(ui.$isRangeSelection(e)){var t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(vi(r,n))t.add(fi(r));else for(r=0;r<n.length;r++){var o=n[r];ui.$isLeafNode(o)&&(null!=(o=ci.$getNearestNodeOfType(o,Ci))&&t.add(fi(o)))}for(let r of t){t=r,n=mi(r);for(let r of n)bi(n=ui.$createParagraphNode(),r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&e.anchor.set(n.getKey(),0,"element"),r.__key===e.focus.key&&e.focus.set(n.getKey(),0,"element"),r.remove();r.remove()}}}))};var Fi=si,Hi={},Wi={},ji=g;let Ki=ji.createContext(null);Wi.LexicalComposerContext=Ki,Wi.createLexicalComposerContext=function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},Wi.useLexicalComposerContext=function(){let e=ji.useContext(Ki);return null==e&&function(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e};var Yi=Wi,Gi=Yi,Ui=Mo,Vi=g;let Qi="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;var Ji=Qi?Vi.useLayoutEffect:Vi.useEffect;let Xi={tag:"history-merge"};Hi.LexicalComposer=function({initialConfig:e,children:t}){let n=Vi.useMemo((()=>{const{theme:t,namespace:n,editor__DEPRECATED:r,nodes:o,onError:i,editorState:l}=e,a=Gi.createLexicalComposerContext(null,t);let s=r||null;if(null===s){const r=Ui.createEditor({editable:e.editable,namespace:n,nodes:o,onError:e=>i(e,r),theme:t});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{var t=Ui.$getRoot();if(t.isEmpty()){let n=Ui.$createParagraphNode();t.append(n),t=Qi?document.activeElement:null,(null!==Ui.$getSelection()||null!==t&&t===e.getRootElement())&&n.select()}}),Xi);else if(null!==t)switch(typeof t){case"string":let n=e.parseEditorState(t);e.setEditorState(n,Xi);break;case"object":e.setEditorState(t,Xi);break;case"function":e.update((()=>{Ui.$getRoot().isEmpty()&&t(e)}),Xi)}}(r,l),s=r}return[s,a]}),[]);return Ji((()=>{let t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),Vi.createElement(Gi.LexicalComposerContext.Provider,{value:n},t)};var qi=Hi,Zi={},el={},tl=Jo,nl=Mo;function rl(e,t){let n=Date.now(),r=0;return(o,i,l,a,s,u)=>{let c=Date.now();if(u.has("historic"))return r=0,n=c,2;let d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;var i=t._selection,l=e._selection;if(o)return 1;if(!(nl.$isRangeSelection(i)&&nl.$isRangeSelection(l)&&l.isCollapsed()&&i.isCollapsed()))return 0;o=t._nodeMap;let a=[];for(let e of n)void 0!==(n=o.get(e))&&a.push(n);for(let[e,t]of r)t&&(void 0===(r=o.get(e))||nl.$isRootNode(r)||a.push(r));return 0===a.length?0:1<a.length?(t=(r=t._nodeMap).get(i.anchor.key),l=r.get(l.anchor.key),t&&l&&!e._nodeMap.has(t.__key)&&nl.$isTextNode(t)&&1===t.__text.length&&1===i.anchor.offset?2:0):(t=a[0],e=e._nodeMap.get(t.__key),nl.$isTextNode(e)&&nl.$isTextNode(t)&&e.__mode===t.__mode?(e=e.__text)===(t=t.__text)?0:(i=i.anchor,l=l.anchor,i.key!==l.key||"text"!==i.type?0:(i=i.offset,l=l.offset,1==(e=t.length-e.length)&&l===i-1?2:-1===e&&l===i+1?3:-1===e&&l===i?4:0)):0)}(o,i,a,s,e.isComposing()),p=(()=>{var p=null===l||l.editor===e,f=u.has("history-push");if(!f&&p&&u.has("history-merge"))return 0;if(null===o)return 1;var m=i._selection;if(!(0<a.size||0<s.size))return null!==m?0:2;if(!1===f&&0!==d&&d===r&&c<n+t&&p)return 0;if(1===a.size){{f=Array.from(a)[0],p=o._nodeMap.get(f),f=i._nodeMap.get(f),m=o._selection;let e=i._selection,t=!1;nl.$isRangeSelection(m)&&nl.$isRangeSelection(e)&&(t="element"===m.anchor.type&&"element"===m.focus.type&&"text"===e.anchor.type&&"text"===e.focus.type),p=!(t||!nl.$isTextNode(p)||!nl.$isTextNode(f))&&(p.__type===f.__type&&p.__text===f.__text&&p.__mode===f.__mode&&p.__detail===f.__detail&&p.__style===f.__style&&p.__format===f.__format&&p.__parent===f.__parent)}if(p)return 0}return 1})();return n=c,r=d,p}}el.createEmptyHistoryState=function(){return{current:null,redoStack:[],undoStack:[]}},el.registerHistory=function(e,t,n){let r=rl(e,n);n=({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:l,tags:a})=>{const s=t.current,u=t.redoStack,c=t.undoStack,d=null===s?null:s.editorState;if(null===s||n!==d){if(1===(o=r(o,n,s,i,l,a)))0!==u.length&&(t.redoStack=[],e.dispatchCommand(nl.CAN_REDO_COMMAND,!1)),null!==s&&(c.push({...s}),e.dispatchCommand(nl.CAN_UNDO_COMMAND,!0));else if(2===o)return;t.current={editor:e,editorState:n}}};let o=tl.mergeRegister(e.registerCommand(nl.UNDO_COMMAND,(()=>{let n=t.redoStack,r=t.undoStack;if(0!==r.length){let o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(nl.CAN_REDO_COMMAND,!0)),0===r.length&&e.dispatchCommand(nl.CAN_UNDO_COMMAND,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}return!0}),nl.COMMAND_PRIORITY_EDITOR),e.registerCommand(nl.REDO_COMMAND,(()=>{let n=t.redoStack;var r=t.undoStack;if(0!==n.length){let o=t.current;null!==o&&(r.push(o),e.dispatchCommand(nl.CAN_UNDO_COMMAND,!0)),r=n.pop(),0===n.length&&e.dispatchCommand(nl.CAN_REDO_COMMAND,!1),t.current=r||null,r&&r.editor.setEditorState(r.editorState,{tag:"historic"})}return!0}),nl.COMMAND_PRIORITY_EDITOR),e.registerCommand(nl.CLEAR_EDITOR_COMMAND,(()=>(t.undoStack=[],t.redoStack=[],t.current=null,!1)),nl.COMMAND_PRIORITY_EDITOR),e.registerCommand(nl.CLEAR_HISTORY_COMMAND,(()=>(t.undoStack=[],t.redoStack=[],t.current=null,e.dispatchCommand(nl.CAN_REDO_COMMAND,!1),e.dispatchCommand(nl.CAN_UNDO_COMMAND,!1),!0)),nl.COMMAND_PRIORITY_EDITOR),e.registerUpdateListener(n)),i=e.registerUpdateListener(n);return()=>{o(),i()}};var ol=Yi,il=el,ll=g;Zi.createEmptyHistoryState=il.createEmptyHistoryState,Zi.HistoryPlugin=function({externalHistoryState:e}){let[t]=ol.useLexicalComposerContext();return function(e,t,n=1e3){let r=ll.useMemo((()=>t||il.createEmptyHistoryState()),[t]);ll.useEffect((()=>il.registerHistory(e,r,n)),[n,e,r])}(t,e),null};var al=Zi,sl={},ul=Fi,cl=Yi,dl=g,pl=Jo,fl=Mo;sl.ListPlugin=function(){let[e]=cl.useLexicalComposerContext();return dl.useEffect((()=>{if(!e.hasNodes([ul.ListNode,ul.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[e]),function(e){dl.useEffect((()=>pl.mergeRegister(e.registerCommand(ul.INSERT_ORDERED_LIST_COMMAND,(()=>(ul.insertList(e,"number"),!0)),fl.COMMAND_PRIORITY_LOW),e.registerCommand(ul.INSERT_UNORDERED_LIST_COMMAND,(()=>(ul.insertList(e,"bullet"),!0)),fl.COMMAND_PRIORITY_LOW),e.registerCommand(ul.REMOVE_LIST_COMMAND,(()=>(ul.removeList(e),!0)),fl.COMMAND_PRIORITY_LOW),e.registerCommand(fl.INSERT_PARAGRAPH_COMMAND,(()=>!!ul.$handleListInsertParagraph()),fl.COMMAND_PRIORITY_LOW))),[e])}(e),null};var ml=sl,gl={},hl=Yi,vl=Jo,bl=Mo,yl=g;function xl(e){return e.registerCommand(bl.KEY_TAB_COMMAND,(t=>{let n=bl.$getSelection();return!!bl.$isRangeSelection(n)&&(t.preventDefault(),t=function(e){var t=e.getNodes();if(0<function(e,t){let n=[];for(let r=0;r<e.length;r++){let o=t(e[r]);null!==o&&n.push(o)}return n}(t,(e=>bl.$isBlockElementNode(e)&&e.canIndent()?e:null)).length)return!0;if(t=e.anchor,t=(e=(e=e.focus).isBefore(t)?e:t).getNode(),(t=vl.$getNearestBlockElementAncestorOrThrow(t)).canIndent()){t=t.getKey();let n=bl.$createRangeSelection();if(n.anchor.set(t,0,"element"),n.focus.set(t,0,"element"),n=bl.$normalizeSelection__EXPERIMENTAL(n),n.anchor.is(e))return!0}return!1}(n)?t.shiftKey?bl.OUTDENT_CONTENT_COMMAND:bl.INDENT_CONTENT_COMMAND:bl.INSERT_TAB_COMMAND,e.dispatchCommand(t,void 0))}),bl.COMMAND_PRIORITY_EDITOR)}gl.TabIndentationPlugin=function(){let[e]=hl.useLexicalComposerContext();return yl.useEffect((()=>xl(e))),null},gl.registerTabIndentation=xl;var _l=gl,El={},Cl={},wl={},Sl=Ko,kl=Mo;function Tl(e,t,n,r=null){let o=null==r||t.isSelected(r),i=kl.$isElementNode(t)&&t.excludeFromCopy("html");var l=t;null!==r&&(l=Sl.$cloneWithProperties(t),l=kl.$isTextNode(l)&&null!=r?Sl.$sliceSelectedTextNodeContent(r,l):l);let a=kl.$isElementNode(l)?l.getChildren():[],{element:s,after:u}=l.exportDOM(e);if(!s)return!1;let c=document.createDocumentFragment();for(let n=0;n<a.length;n++){let i=a[n],l=Tl(e,i,c,r);!o&&kl.$isElementNode(t)&&l&&t.extractWithChild(i,r,"html")&&(o=!0)}return o&&!i?(s.append(c),n.append(s),u&&(e=u.call(l,s))&&s.replaceWith(e)):n.append(c),o}let Al=new Set(["STYLE","SCRIPT"]);function Nl(e,t,n=new Map,r){let o=[];if(Al.has(e.nodeName))return o;let i=null;var l,{nodeName:a}=e,s=t._htmlConversions.get(a.toLowerCase());if(a=null,void 0!==s)for(l of s)null!==(s=l(e))&&(null===a||a.priority<s.priority)&&(a=s);if(a=(l=null!==a?a.conversion:null)?l(e):null,l=null,null!==a){if(l=a.after,s=a.node,i=Array.isArray(s)?s[s.length-1]:s,null!==i){for(var[,u]of n)if(i=u(i,r),!i)break;i&&o.push(...Array.isArray(s)?s:[i])}null!=a.forChild&&n.set(e.nodeName,a.forChild)}for(e=e.childNodes,r=[],u=0;u<e.length;u++)r.push(...Nl(e[u],t,new Map(n),i));return null!=l&&(r=l(r)),null==i?o=o.concat(r):kl.$isElementNode(i)&&i.append(...r),o}wl.$generateHtmlFromNodes=function(e,t){if("undefined"==typeof document||"undefined"==typeof window)throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),r=kl.$getRoot().getChildren();for(let o=0;o<r.length;o++)Tl(e,r[o],n,t);return n.innerHTML},wl.$generateNodesFromDOM=function(e,t){t=t.body?t.body.childNodes:[];let n=[];for(let o=0;o<t.length;o++){var r=t[o];Al.has(r.nodeName)||null!==(r=Nl(r,e))&&(n=n.concat(r))}return n};var Rl=wl,Ol=Ko,Ml=Jo,Ll=Mo;function Pl(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let Il="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Dl(e){let t=Ll.$getSelection();if(null==t)throw Error("Expected valid LexicalSelection");return Ll.$isRangeSelection(t)&&t.isCollapsed()||0===t.getNodes().length?"":Rl.$generateHtmlFromNodes(e,t)}function $l(e){let t=Ll.$getSelection();if(null==t)throw Error("Expected valid LexicalSelection");return Ll.$isRangeSelection(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(Fl(e,t))}function zl(e,t,n){(Ll.DEPRECATED_$isGridSelection(n)||null!==Ml.$findMatchingParent(n.anchor.getNode(),(e=>Ll.DEPRECATED_$isGridCellNode(e)))&&null!==Ml.$findMatchingParent(n.focus.getNode(),(e=>Ll.DEPRECATED_$isGridCellNode(e))))&&1===t.length&&Ll.DEPRECATED_$isGridNode(t[0])?function(e,t,n,r){1===e.length&&Ll.DEPRECATED_$isGridNode(e[0])||Pl(42);var o=e[0];e=o.getChildren(),n=o.getFirstChildOrThrow().getChildrenSize();var i=o.getChildrenSize(),l=Ml.$findMatchingParent(t.anchor.getNode(),(e=>Ll.DEPRECATED_$isGridCellNode(e)));t=(o=l&&Ml.$findMatchingParent(l,(e=>Ll.DEPRECATED_$isGridRowNode(e))))&&Ml.$findMatchingParent(o,(e=>Ll.DEPRECATED_$isGridNode(e))),Ll.DEPRECATED_$isGridCellNode(l)&&Ll.DEPRECATED_$isGridRowNode(o)&&Ll.DEPRECATED_$isGridNode(t)||Pl(43);var a=o.getIndexWithinParent(),s=Math.min(t.getChildrenSize()-1,a+i-1);let u,c;i=l.getIndexWithinParent(),l=Math.min(o.getChildrenSize()-1,i+n-1),n=Math.min(i,l),o=Math.min(a,s),i=Math.max(i,l),a=Math.max(a,s),s=t.getChildren(),l=0;for(let t=o;t<=a;t++){var d=s[t];Ll.DEPRECATED_$isGridRowNode(d)||Pl(24);var p=e[l];Ll.DEPRECATED_$isGridRowNode(p)||Pl(24),d=d.getChildren(),p=p.getChildren();let r=0;for(let e=n;e<=i;e++){let l=d[e];Ll.DEPRECATED_$isGridCellNode(l)||Pl(25);let s=p[r];Ll.DEPRECATED_$isGridCellNode(s)||Pl(25),t===o&&e===n?u=l.getKey():t===a&&e===i&&(c=l.getKey());let f=l.getChildren();s.getChildren().forEach((e=>{Ll.$isTextNode(e)&&Ll.$createParagraphNode().append(e),l.append(e)})),f.forEach((e=>e.remove())),r++}l++}u&&c&&(e=Ll.DEPRECATED_$createGridSelection(),e.set(t.getKey(),u,c),Ll.$setSelection(e),r.dispatchCommand(Ll.SELECTION_CHANGE_COMMAND,void 0))}(t,n,!1,e):function(e,t){let n=[],r=null;for(let t=0;t<e.length;t++){let o=e[t],i=Ll.$isLineBreakNode(o);if(i||Ll.$isDecoratorNode(o)&&o.isInline()||Ll.$isElementNode(o)&&o.isInline()||Ll.$isTextNode(o)||o.isParentRequired()){if(null===r&&(r=o.createParentElementNode(),n.push(r),i))continue;null!==r&&r.append(o)}else n.push(o),r=null}Ll.$isRangeSelection(t)?t.insertNodes(n):Ll.DEPRECATED_$isGridSelection(t)&&(e=t.anchor.getNode(),Ll.DEPRECATED_$isGridCellNode(e)||Pl(41),e.append(...n))}(t,n)}function Bl(e,t,n,r=[]){let o=null==t||n.isSelected(t),i=Ll.$isElementNode(n)&&n.excludeFromCopy("html");var l=n;if(null!==t){var a=Ol.$cloneWithProperties(n);l=a=Ll.$isTextNode(a)&&null!=t?Ol.$sliceSelectedTextNodeContent(t,a):a}let s=Ll.$isElementNode(l)?l.getChildren():[];var u=l;a=u.exportJSON();var c=u.constructor;a.type!==c.getType()&&Pl(58,c.name);let d=a.children;for(Ll.$isElementNode(u)&&(Array.isArray(d)||Pl(59,c.name)),Ll.$isTextNode(l)&&(0<(l=l.__text).length?a.text=l:o=!1),l=0;l<s.length;l++)c=Bl(e,t,u=s[l],a.children),!o&&Ll.$isElementNode(n)&&c&&n.extractWithChild(u,t,"clone")&&(o=!0);if(o&&!i)r.push(a);else if(Array.isArray(a.children))for(e=0;e<a.children.length;e++)r.push(a.children[e]);return o}function Fl(e,t){let n=[],r=Ll.$getRoot().getChildren();for(let o=0;o<r.length;o++)Bl(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function Hl(e){let t=[];for(let n=0;n<e.length;n++){let r=Ll.$parseSerializedNode(e[n]);Ll.$isTextNode(r)&&Ol.$addNodeStyle(r),t.push(r)}return t}let Wl=null;function jl(e,t){var n=Il?(e._window||window).getSelection():null;if(!n)return!1;var r=n.anchorNode;if(n=n.focusNode,null!==r&&null!==n&&!Ll.isSelectionWithinEditor(e,r,n))return!1;if(t.preventDefault(),t=t.clipboardData,r=Ll.$getSelection(),null===t||null===r)return!1;n=Dl(e),e=$l(e);let o="";return null!==r&&(o=r.getTextContent()),null!==n&&t.setData("text/html",n),null!==e&&t.setData("application/x-lexical-editor",e),t.setData("text/plain",o),!0}Cl.$generateJSONFromSelectedNodes=Fl,Cl.$generateNodesFromSerializedNodes=Hl,Cl.$getHtmlContent=Dl,Cl.$getLexicalContent=$l,Cl.$insertDataTransferForPlainText=function(e,t){null!=(e=e.getData("text/plain")||e.getData("text/uri-list"))&&t.insertRawText(e)},Cl.$insertDataTransferForRichText=function(e,t,n){var r=e.getData("application/x-lexical-editor");if(r)try{let e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes)){return zl(n,Hl(e.nodes),t)}}catch(e){}if(r=e.getData("text/html"))try{var o=(new DOMParser).parseFromString(r,"text/html"),i=Rl.$generateNodesFromDOM(n,o);return zl(n,i,t)}catch(e){}if(null!=(e=e.getData("text/plain")||e.getData("text/uri-list")))if(Ll.$isRangeSelection(t))for(n=(e=e.split(/(\r?\n|\t)/)).length,o=0;o<n;o++)"\n"===(i=e[o])||"\r\n"===i?t.insertParagraph():"\t"===i?t.insertNodes([Ll.$createTabNode()]):t.insertText(i);else t.insertRawText(e)},Cl.$insertGeneratedNodes=zl,Cl.copyToClipboard=async function(e,t){if(null!==Wl)return!1;if(null!==t)return new Promise((n=>{e.update((()=>{n(jl(e,t))}))}));var n=e.getRootElement();let r=null==e._window?window.document:e._window.document,o=Il?(e._window||window).getSelection():null;if(null===n||null===o)return!1;let i=r.createElement("span");return i.style.cssText="position: fixed; top: -1000px;",i.append(r.createTextNode("#")),n.append(i),(n=new Range).setStart(i,0),n.setEnd(i,1),o.removeAllRanges(),o.addRange(n),new Promise((t=>{let n=e.registerCommand(Ll.COPY_COMMAND,(r=>(Ml.objectKlassEquals(r,ClipboardEvent)&&(n(),null!==Wl&&(window.clearTimeout(Wl),Wl=null),t(jl(e,r))),!0)),Ll.COMMAND_PRIORITY_CRITICAL);Wl=window.setTimeout((()=>{n(),Wl=null,t(!1)}),50),r.execCommand("copy"),i.remove()}))};var Kl=Cl,Yl=Ko,Gl=Jo,Ul=Mo;function Vl(e,t){return void 0!==document.caretRangeFromPoint?null===(e=document.caretRangeFromPoint(e,t))?null:{node:e.startContainer,offset:e.startOffset}:"undefined"!==document.caretPositionFromPoint?null===(e=document.caretPositionFromPoint(e,t))?null:{node:e.offsetNode,offset:e.offset}:null}let Ql="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Jl=Ql&&"documentMode"in document?document.documentMode:null,Xl=!(!Ql||!("InputEvent"in window)||Jl)&&"getTargetRanges"in new window.InputEvent("input"),ql=Ql&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Zl=Ql&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ea=Ql&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ta=Ql&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ea,na=Ul.createCommand("DRAG_DROP_PASTE_FILE"),ra=class e extends Ul.ElementNode{static getType(){return"quote"}static clone(t){return new e(t.__key)}constructor(e){super(e)}createDOM(e){let t=document.createElement("blockquote");return Gl.addClassNamesToElement(t,e.theme.quote),t}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:sa,priority:0})}}exportDOM(e){if(({element:e}=super.exportDOM(e)),e&&this.isEmpty()&&e.append(document.createElement("br")),e){var t=this.getFormatType();e.style.textAlign=t,(t=this.getDirection())&&(e.dir=t)}return{element:e}}static importJSON(e){let t=oa();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){e=Ul.$createParagraphNode();let n=this.getDirection();return e.setDirection(n),this.insertAfter(e,t),e}collapseAtStart(){let e=Ul.$createParagraphNode();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}};function oa(){return Ul.$applyNodeReplacement(new ra)}let ia=class e extends Ul.ElementNode{static getType(){return"heading"}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){let t=this.__tag,n=document.createElement(t);return void 0!==(e=e.theme.heading)&&Gl.addClassNamesToElement(n,e[t]),n}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:aa,priority:0}),h2:()=>({conversion:aa,priority:0}),h3:()=>({conversion:aa,priority:0}),h4:()=>({conversion:aa,priority:0}),h5:()=>({conversion:aa,priority:0}),h6:()=>({conversion:aa,priority:0}),p:e=>null!==(e=e.firstChild)&&la(e)?{conversion:()=>({node:null}),priority:3}:null,span:e=>la(e)?{conversion:()=>({node:ua("h1")}),priority:3}:null}}exportDOM(e){if(({element:e}=super.exportDOM(e)),e&&this.isEmpty()&&e.append(document.createElement("br")),e){var t=this.getFormatType();e.style.textAlign=t,(t=this.getDirection())&&(e.dir=t)}return{element:e}}static importJSON(e){let t=ua(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){e=0<(e=e?e.anchor.offset:0)&&e<this.getTextContentSize()?ua(this.getTag()):Ul.$createParagraphNode();let n=this.getDirection();return e.setDirection(n),this.insertAfter(e,t),e}collapseAtStart(){let e=this.isEmpty()?Ul.$createParagraphNode():ua(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function la(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function aa(e){let t=e.nodeName.toLowerCase(),n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=ua(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function sa(e){let t=oa();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function ua(e){return Ul.$applyNodeReplacement(new ia(e))}function ca(e){let t=null;if(e instanceof DragEvent?t=e.dataTransfer:e instanceof ClipboardEvent&&(t=e.clipboardData),null===t)return[!1,[],!1];var n=t.types;return e=n.includes("Files"),n=n.includes("text/html")||n.includes("text/plain"),[e,Array.from(t.files),n]}function da(e){var t=Ul.$getSelection();if(!Ul.$isRangeSelection(t))return!1;let n=new Set;t=t.getNodes();for(let i=0;i<t.length;i++){var r=t[i],o=r.getKey();n.has(o)||(o=(r=Gl.$getNearestBlockElementAncestorOrThrow(r)).getKey(),r.canIndent()&&!n.has(o)&&(n.add(o),e(r)))}return 0<n.size}function pa(e){return e=Ul.$getNearestNodeFromDOMNode(e),Ul.$isDecoratorNode(e)}El.$createHeadingNode=ua,El.$createQuoteNode=oa,El.$isHeadingNode=function(e){return e instanceof ia},El.$isQuoteNode=function(e){return e instanceof ra},El.DRAG_DROP_PASTE=na,El.HeadingNode=ia,El.QuoteNode=ra,El.eventFiles=ca,El.registerRichText=function(e){return Gl.mergeRegister(e.registerCommand(Ul.CLICK_COMMAND,(()=>{const e=Ul.$getSelection();return!!Ul.$isNodeSelection(e)&&(e.clear(),!0)}),0),e.registerCommand(Ul.DELETE_CHARACTER_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.deleteCharacter(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DELETE_WORD_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.deleteWord(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DELETE_LINE_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.deleteLine(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.CONTROLLED_TEXT_INSERTION_COMMAND,(t=>{const n=Ul.$getSelection();if("string"==typeof t)Ul.$isRangeSelection(n)?n.insertText(t):Ul.DEPRECATED_$isGridSelection(n);else{if(!Ul.$isRangeSelection(n)&&!Ul.DEPRECATED_$isGridSelection(n))return!1;const r=t.dataTransfer;null!=r?Kl.$insertDataTransferForRichText(r,n,e):Ul.$isRangeSelection(n)&&(t=t.data)&&n.insertText(t)}return!0}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.REMOVE_TEXT_COMMAND,(()=>{const e=Ul.$getSelection();return!!Ul.$isRangeSelection(e)&&(e.removeText(),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.FORMAT_TEXT_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.formatText(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.FORMAT_ELEMENT_COMMAND,(e=>{var t=Ul.$getSelection();if(!Ul.$isRangeSelection(t)&&!Ul.$isNodeSelection(t))return!1;t=t.getNodes();for(const n of t)t=Gl.$findMatchingParent(n,(e=>Ul.$isElementNode(e)&&!e.isInline())),null!==t&&t.setFormat(e);return!0}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INSERT_LINE_BREAK_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.insertLineBreak(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INSERT_PARAGRAPH_COMMAND,(()=>{const e=Ul.$getSelection();return!!Ul.$isRangeSelection(e)&&(e.insertParagraph(),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INSERT_TAB_COMMAND,(()=>(Ul.$insertNodes([Ul.$createTabNode()]),!0)),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INDENT_CONTENT_COMMAND,(()=>da((e=>{const t=e.getIndent();e.setIndent(t+1)}))),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.OUTDENT_CONTENT_COMMAND,(()=>da((e=>{const t=e.getIndent();0<t&&e.setIndent(t-1)}))),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_UP_COMMAND,(e=>{var t=Ul.$getSelection();if(Ul.$isNodeSelection(t)&&!pa(e.target)){if(0<(e=t.getNodes()).length)return e[0].selectPrevious(),!0}else if(Ul.$isRangeSelection(t)&&(t=Ul.$getAdjacentNode(t.focus,!0),!e.shiftKey&&Ul.$isDecoratorNode(t)&&!t.isIsolated()&&!t.isInline()))return t.selectPrevious(),e.preventDefault(),!0;return!1}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_DOWN_COMMAND,(e=>{var t=Ul.$getSelection();if(Ul.$isNodeSelection(t)){if(0<(e=t.getNodes()).length)return e[0].selectNext(0,0),!0}else if(Ul.$isRangeSelection(t)){let n=t.focus;if("root"===n.key&&n.offset===Ul.$getRoot().getChildrenSize())return e.preventDefault(),!0;if(t=Ul.$getAdjacentNode(t.focus,!1),!e.shiftKey&&Ul.$isDecoratorNode(t)&&!t.isIsolated()&&!t.isInline())return t.selectNext(),e.preventDefault(),!0}return!1}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_LEFT_COMMAND,(e=>{const t=Ul.$getSelection();if(Ul.$isNodeSelection(t)){var n=t.getNodes();if(0<n.length)return e.preventDefault(),n[0].selectPrevious(),!0}return!!Ul.$isRangeSelection(t)&&(!!Yl.$shouldOverrideDefaultCharacterSelection(t,!0)&&(n=e.shiftKey,e.preventDefault(),Yl.$moveCharacter(t,n,!0),!0))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_RIGHT_COMMAND,(e=>{const t=Ul.$getSelection();if(Ul.$isNodeSelection(t)&&!pa(e.target)){var n=t.getNodes();if(0<n.length)return e.preventDefault(),n[0].selectNext(0,0),!0}return!!Ul.$isRangeSelection(t)&&(n=e.shiftKey,!!Yl.$shouldOverrideDefaultCharacterSelection(t,!1)&&(e.preventDefault(),Yl.$moveCharacter(t,n,!1),!0))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_BACKSPACE_COMMAND,(t=>{if(pa(t.target))return!1;const n=Ul.$getSelection();if(!Ul.$isRangeSelection(n))return!1;t.preventDefault(),({anchor:t}=n);const r=t.getNode();return n.isCollapsed()&&0===t.offset&&!Ul.$isRootNode(r)&&0<Gl.$getNearestBlockElementAncestorOrThrow(r).getIndent()?e.dispatchCommand(Ul.OUTDENT_CONTENT_COMMAND,void 0):e.dispatchCommand(Ul.DELETE_CHARACTER_COMMAND,!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_DELETE_COMMAND,(t=>{if(pa(t.target))return!1;const n=Ul.$getSelection();return!!Ul.$isRangeSelection(n)&&(t.preventDefault(),e.dispatchCommand(Ul.DELETE_CHARACTER_COMMAND,!1))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ENTER_COMMAND,(t=>{const n=Ul.$getSelection();if(!Ul.$isRangeSelection(n))return!1;if(null!==t){if((Zl||ql||ta)&&Xl)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Ul.INSERT_LINE_BREAK_COMMAND,!1)}return e.dispatchCommand(Ul.INSERT_PARAGRAPH_COMMAND,void 0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ESCAPE_COMMAND,(()=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(e.blur(),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DROP_COMMAND,(t=>{const[,n]=ca(t);if(0<n.length){var r=Vl(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r;var o=Ul.$getNearestNodeFromDOMNode(i);if(null!==o){if(r=Ul.$createRangeSelection(),Ul.$isTextNode(o))r.anchor.set(o.getKey(),t,"text"),r.focus.set(o.getKey(),t,"text");else{const e=o.getParentOrThrow().getKey();o=o.getIndexWithinParent()+1,r.anchor.set(e,o,"element"),r.focus.set(e,o,"element")}r=Ul.$normalizeSelection__EXPERIMENTAL(r),Ul.$setSelection(r)}e.dispatchCommand(na,n)}return t.preventDefault(),!0}return t=Ul.$getSelection(),!!Ul.$isRangeSelection(t)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DRAGSTART_COMMAND,(e=>{[e]=ca(e);const t=Ul.$getSelection();return!(e&&!Ul.$isRangeSelection(t))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DRAGOVER_COMMAND,(e=>{var[t]=ca(e);const n=Ul.$getSelection();return!(t&&!Ul.$isRangeSelection(n))&&(null!==(t=Vl(e.clientX,e.clientY))&&(t=Ul.$getNearestNodeFromDOMNode(t.node),Ul.$isDecoratorNode(t)&&e.preventDefault()),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.COPY_COMMAND,(t=>(Kl.copyToClipboard(e,Gl.objectKlassEquals(t,ClipboardEvent)?t:null),!0)),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.CUT_COMMAND,(t=>(async function(e,t){await Kl.copyToClipboard(t,Gl.objectKlassEquals(e,ClipboardEvent)?e:null),t.update((()=>{let e=Ul.$getSelection();Ul.$isRangeSelection(e)?e.removeText():Ul.$isNodeSelection(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.PASTE_COMMAND,(t=>{const[,n,r]=ca(t);if(0<n.length&&!r)return e.dispatchCommand(na,n),!0;if(Ul.isSelectionCapturedInDecoratorInput(t.target))return!1;const o=Ul.$getSelection();return!(!Ul.$isRangeSelection(o)&&!Ul.DEPRECATED_$isGridSelection(o))&&(function(e,t){e.preventDefault(),t.update((()=>{let n=Ul.$getSelection(),r=e instanceof InputEvent||e instanceof KeyboardEvent?null:e.clipboardData;null!=r&&(Ul.$isRangeSelection(n)||Ul.DEPRECATED_$isGridSelection(n))&&Kl.$insertDataTransferForRichText(r,n,t)}),{tag:"paste"})}(t,e),!0)}),Ul.COMMAND_PRIORITY_EDITOR))};var fa=El,ma={},ga=ai,ha=Yi,va=Jo,ba=Mo,ya=g;function xa(e,t){for(let n=0;n<t.length;n++){let r=t[n](e);if(r)return r}return null}let _a=/[.,;\s]/;function Ea(e){var t;return e=e.getPreviousSibling(),ba.$isElementNode(e)&&(e=e.getLastDescendant()),!(t=null===e||ba.$isLineBreakNode(e))&&(t=ba.$isTextNode(e))&&(e=e.getTextContent(),t=_a.test(e[e.length-1])),t}function Ca(e){return e=e.getNextSibling(),ba.$isElementNode(e)&&(e=e.getFirstDescendant()),null===e||ba.$isLineBreakNode(e)||ba.$isTextNode(e)&&_a.test(e.getTextContent()[0])}function wa(e,t,n){var r=e.getChildren();let o=r.length;for(let t=0;t<o;t++){let o=r[t];if(!ba.$isTextNode(o)||!o.isSimpleText())return Sa(e),void n(null,e.getURL())}null===(t=xa(r=e.getTextContent(),t))||t.text!==r?(Sa(e),n(null,e.getURL())):Ea(e)&&Ca(e)?((r=e.getURL())!==t.url&&(e.setURL(t.url),n(t.url,r)),t.attributes&&((r=e.getRel())!==t.attributes.rel&&(e.setRel(t.attributes.rel||null),n(t.attributes.rel||null,r)),(r=e.getTarget())!==t.attributes.target&&(e.setTarget(t.attributes.target||null),n(t.attributes.target||null,r)))):(Sa(e),n(null,e.getURL()))}function Sa(e){let t=e.getChildren();var n=t.length;for(--n;0<=n;n--)e.insertAfter(t[n]);return e.remove(),t.map((e=>e.getLatest()))}function ka(e,t,n){ya.useEffect((()=>{e.hasNodes([ga.AutoLinkNode])||function(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);let r=(e,t)=>{n&&n(e,t)};return va.mergeRegister(e.registerNodeTransform(ba.TextNode,(e=>{var o=e.getParentOrThrow(),i=e.getPreviousSibling();if(ga.$isAutoLinkNode(o))wa(o,t,r);else if(!ga.$isLinkNode(o)){if(e.isSimpleText()&&(_a.test(e.getTextContent()[0])||!ga.$isAutoLinkNode(i))){i=o=e.getTextContent();let r=0,p=e;for(var l;(l=xa(i,t))&&null!==l;){let t=l.index,f=l.length,m=t+f;var a=r+t,s=r+m,u=o,c=e;if((0<a?_a.test(u[a-1]):Ea(c))&&(s<u.length?_a.test(u[s]):Ca(c))){var d=void 0;0===r+t?[d,p]=p.splitText(r+f):[,d,p]=p.splitText(r+t,r+t+f),a=ga.$createAutoLinkNode(l.url,l.attributes),(s=ba.$createTextNode(l.text)).setFormat(d.getFormat()),s.setDetail(d.getDetail()),a.append(s),d.replace(a),n&&n(l.url,null),r=0}else r+=m;i=i.substring(m)}}o=e.getPreviousSibling(),l=e.getNextSibling(),d=e.getTextContent(),ga.$isAutoLinkNode(o)&&!_a.test(d[0])&&(o.append(e),wa(o,t,r),e=o.getURL(),n&&n(null,e)),ga.$isAutoLinkNode(l)&&!_a.test(d[d.length-1])&&(Sa(l),wa(l,t,r),e=l.getURL(),n&&n(null,e))}})))}),[e,t,n])}ma.AutoLinkPlugin=function({matchers:e,onChange:t}){let[n]=ha.useLexicalComposerContext();return ka(n,e,t),null},ma.createLinkMatcherWithRegExp=function(e,t=(e=>e)){return n=>{let r=e.exec(n);return null===r?null:{index:r.index,length:r[0].length,text:r[0],url:t(n)}}};var Ta=ma,Aa=Yi,Na=g,Ra="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Na.useLayoutEffect:Na.useEffect;function Oa(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}const Ma=function(){return function(e){let[t]=Aa.useLexicalComposerContext(),n=Na.useMemo((()=>e(t)),[t,e]),r=Na.useRef(n.initialValueFn()),[o,i]=Na.useState(r.current);return Ra((()=>{let{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,i(o)),t((e=>{r.current=e,i(e)}))}),[n,e]),o}(Oa)};var La=Ma,Pa=O(La);var Ia={black:"#000",white:"#fff"};var Da={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};var $a={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};var za={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};var Ba={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};var Fa={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};var Ha={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};var Wa={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function ja(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Ka(e){if(!ja(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=Ka(e[n])})),t}function Ya(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return ja(e)&&ja(t)&&Object.keys(t).forEach((o=>{"__proto__"!==o&&(ja(t[o])&&o in e&&ja(e[o])?r[o]=Ya(e[o],t[o],n):n.clone?r[o]=ja(t[o])?Ka(t[o]):t[o]:r[o]=t[o])})),r}function Ga(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var Ua,Va={},Qa=Symbol.for("react.element"),Ja=Symbol.for("react.portal"),Xa=Symbol.for("react.fragment"),qa=Symbol.for("react.strict_mode"),Za=Symbol.for("react.profiler"),es=Symbol.for("react.provider"),ts=Symbol.for("react.context"),ns=Symbol.for("react.server_context"),rs=Symbol.for("react.forward_ref"),os=Symbol.for("react.suspense"),is=Symbol.for("react.suspense_list"),ls=Symbol.for("react.memo"),as=Symbol.for("react.lazy"),ss=Symbol.for("react.offscreen");
|
|
7
|
+
System.register(["@nebula.js/stardust","react-dom","react"],(function(e){"use strict";var t,n,r,o,i,l,a,s,u,c,d,p,f,m,g,h,v,b,y,x,_,E,C,w,S,k;return{setters:[function(e){t=e.useMemo,n=e.useEffect,r=e.useElement,o=e.useStaleLayout,i=e.useModel,l=e.useInteractionState,a=e.useEmitter,s=e.useTranslator,u=e.useState,c=e.useTheme,d=e.useImperativeHandle},function(e){p=e.default,f=e},function(e){m=e.createContext,g=e.default,h=e,v=e.forwardRef,b=e.useContext,y=e.Children,x=e.isValidElement,_=e.cloneElement,E=e.useState,C=e.useEffect,w=e.useCallback,S=e.useRef,k=e.useMemo}],execute:function(){e("default",(function(e){const t=new qT,{flags:p}=e;return{qae:{properties:T,data:A(t)},component(){const e=r(),f=L(e),m=o(),g=i(),h=l(),v=a(),b=s(),[y,x]=u(!1),[_,E]=u(void 0),[C,w]=u(1),S=c(),[k,T]=u(!1),[A,N]=u(null),R=e=>{e||w(0),yk(m)||(!0===e&&T(!0),x(e),v.emit("njs-internal-edit-change",e))};n((()=>{const e=e=>{!async function(e,t){!async function(e,t){try{if(e&&t){const n=t(await e.getProperties());await e.setProperties(n)}}catch(e){console.error(e)}}(e,(e=>{const{qHyperCubeDef:n}=e;if(n){var r;const e=null===(r=n.qMeasures)||void 0===r?void 0:r.filter((e=>{const n=null==t?void 0:t.find((t=>{var n;return t===(null==e||null===(n=e.qDef)||void 0===n?void 0:n.cId)}));return!n}));n.qMeasures=e,n.qInterColumnSortOrder=[]}return{...e,qHyperCubeDef:n}}))}(g,e)};return v.on("onNodeDestroyed",e),()=>{v.removeListener("onNodeDestroyed",e)}}),[v,g]),n((()=>{2===C&&h.edit&&h.select&&R(!0)}),[C,h]),n((()=>{m&&void 0===_&&(E(m.text||null),N(null==m?void 0:m.text))}),[m,_]),n((()=>{const n=()=>{h.edit&&h.select&&w((e=>e+1))},r=t=>{const n=document.getElementById(YT(g));e.contains(t.target)||null!=n&&n.contains(t.target)||(e=>{const t=document.getElementsByClassName("tekPopperMenu"),n=document.getElementById("tekTableMenu");if(null!=n&&n.contains(e))return!0;for(let n=0;n<t.length;n++)if(t[n].contains(e))return!0;return!1})(t.target)||R(!1)};if(!h.edit||!h.select){var o;R(!1);const e=(null==g?void 0:g.id)&&(null===(o=t.getSnTexts()[g.id])||void 0===o?void 0:o.propertiesHaveBeenModified);(k||e)&&(v.emit("saveDocument"),t.setPropertiesHaveBeenModified(g.id,!1))}return e.addEventListener("click",n),document.addEventListener("mousedown",r),()=>{e.removeEventListener("click",n),document.removeEventListener("mousedown",r)}}),[e,h,g]),n((()=>{QT({rootElement:f,layout:m,model:g,element:e,edit:y,initialData:_,emitter:v,lang:b.language(),flags:p,theme:S})}),[m,f,g,e,y,e,_,v,p,S]),n((()=>{!y&&k&&v.emit("saveDocument")}),[y,v,k]),n((()=>{if(m){const e=m;e.text&&e.text!==A&&(N(e.text),v.emit("reloadData",e.text))}}),[m,A,v]),d((()=>({updateActiveState(e){e?t.setSelectedModelId(g.id):g.id===t.getSelectedModelId()&&t.setSelectedModelId(void 0)}})),[])},ext:{definition:{type:"items",component:"accordion",items:{data:JT,settings:XT}},exportProperties:null,importProperties:null,support:{snapshot:!0,export:!0,sharing:!0,exportData:!0,viewData:!1}}}}));const T={version:"1.1.6",showTitles:!1,text:null,fontsUsed:[],components:[],qHyperCubeDef:{qDimensions:[],qMeasures:[],qSuppressZero:!1,qSuppressMissing:!0,qInitialDataFetch:[{qWidth:500,qHeight:10}]}},A=e=>{const t=()=>{e.setPropertiesHaveBeenModifiedForSelectedModel(!0)};return{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:0,max:10,added(e){e.qDef={...e.qDef,qAggrFunc:"None"},t()},removed:t,replaced:t,moved:t}}]}};var N,R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M=p;N=M.createRoot,M.hydrateRoot;const L=e=>{const r=t((()=>N(e)),[e]);return n((()=>()=>{null==r||r.unmount()}),[r]),r},P=m({layout:void 0,model:void 0,element:void 0,edit:!1,initialData:void 0,emitter:void 0,lang:"en",flags:{isEnabled:()=>!1},theme:null});var I={},D={},$={},z={};let B={},F={},H={},W={},j={},K={},Y={},G={},U={},V={},Q={},J={},X={},q={},Z={},ee={},te={},ne={},re={},oe={},ie={},le={},ae={},se={},ue={},ce={},de={},pe={},fe={},me={},ge={},he={},ve={},be={},ye={};function xe(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let _e="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ee=_e&&"documentMode"in document?document.documentMode:null,Ce=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),we=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Se=!(!_e||!("InputEvent"in window)||Ee)&&"getTargetRanges"in new window.InputEvent("input"),ke=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Te=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ae=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ne=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ae,Re=ke||Te||Ne?" ":"",Oe=we?" ":Re,Me=/^[^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]/,Le=/^[^\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]/,Pe={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},Ie={directionless:1,unmergeable:2},De={center:2,end:6,justify:4,left:1,right:3,start:5},$e={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},ze={normal:0,segmented:2,token:1},Be={0:"normal",2:"segmented",1:"token"},Fe=!1,He=0;function We(e){He=e.timeStamp}function je(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function Ke(e,t,n){Fe=!0;let r=100<performance.now()-He;try{uo(e,(()=>{let o=zr()||function(e){return e.getEditorState().read((()=>{let e=zr();return null!==e?e.clone():null}))}(e);var i=new Map,l=e.getRootElement(),a=e._editorState,s=e._blockCursorElement;let u=!1,c="";for(var d=0;d<t.length;d++){var p=t[d],f=p.type,m=p.target,g=mt(m,a);if(!(null===g&&m!==l||po(g)))if("characterData"===f){if(p=r&&fr(g))e:{f=m;var h=g;if(Er(p=o)){var v=p.anchor.getNode();if(v.is(h)&&p.format!==v.getFormat()){p=!1;break e}}p=3===f.nodeType&&h.isAttached()}p&&(f=p=null,null!==(h=jt(e._window))&&h.anchorNode===m&&(p=h.anchorOffset,f=h.focusOffset),null!==(m=m.nodeValue)&&wt(g,m,p,f,!1))}else if("childList"===f){for(u=!0,f=p.addedNodes,h=0;h<f.length;h++){var b=ft(v=f[h]),y=v.parentNode;null==y||v===s||null!==b||"BR"===v.nodeName&&je(v,y,e)||(we&&(b=v.innerText||v.nodeValue)&&(c+=b),y.removeChild(v))}if(0<(f=(p=p.removedNodes).length)){for(h=0,v=0;v<f;v++)("BR"===(y=p[v]).nodeName&&je(y,m,e)||s===y)&&(m.appendChild(y),h++);f!==h&&(m===l&&(g=a._nodeMap.get("root")),i.set(m,g))}}}if(0<i.size)for(let[t,n]of i)if(mo(n))for(i=n.getChildrenKeys(),l=t.firstChild,a=0;a<i.length;a++)null!==(s=e.getElementByKey(i[a]))&&(null==l?(t.appendChild(s),l=s):l!==s&&t.replaceChild(s,l),l=l.nextSibling);else fr(n)&&n.markDirty();if(0<(i=n.takeRecords()).length){for(l=0;l<i.length;l++)for(a=(s=i[l]).addedNodes,s=s.target,d=0;d<a.length;d++)null==(m=(g=a[d]).parentNode)||"BR"!==g.nodeName||je(g,s,e)||m.removeChild(g);n.takeRecords()}null!==o&&(u&&(o.dirty=!0,bt(o)),we&&Rt(e)&&o.insertRawText(c))}))}finally{Fe=!1}}function Ye(e){let t=e._observer;if(null!==t){Ke(e,t.takeRecords(),t)}}function Ge(e){0===He&&It(e).addEventListener("textInput",We,!0),e._observer=new MutationObserver(((t,n)=>{Ke(e,t,n)}))}function Ue(e,t){let n=e.__mode,r=e.__format;e=e.__style;let o=t.__mode,i=t.__format;return t=t.__style,!(null!==n&&n!==o||null!==r&&r!==i||null!==e&&e!==t)}function Ve(e,t){let n=e.mergeWithSibling(t),r=eo()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Qe(e){if(""===e.__text&&e.isSimpleText()&&!e.isUnmergeable())e.remove();else{for(var t;null!==(t=e.getPreviousSibling())&&fr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){Ue(t,e)&&(e=Ve(t,e));break}t.remove()}for(var n;null!==(n=e.getNextSibling())&&fr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){Ue(e,n)&&Ve(e,n);break}n.remove()}}}function Je(e){return Xe(e.anchor),Xe(e.focus),e}function Xe(e){for(;"element"===e.type;){var t=e.getNode(),n=e.offset;if(n===t.getChildrenSize()?(t=t.getChildAtIndex(n-1),n=!0):(t=t.getChildAtIndex(n),n=!1),fr(t)){e.set(t.__key,n?t.getTextContentSize():0,"text");break}if(!mo(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element")}}let qe=1,Ze="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function et(e){let t=document.activeElement;if(null===t)return!1;let n=t.nodeName;return po(mt(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function tt(e,t,n){let r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!et(t)&&nt(t)===e}catch(e){return!1}}function nt(e){for(;null!=e;){let t=e.__lexicalEditor;if(null!=t)return t;e=Lt(e)}return null}function rt(e){return e.isToken()||e.isSegmented()}function ot(e){for(;null!=e;){if(3===e.nodeType)return e;e=e.firstChild}return null}function it(e,t,n){return e&(t=Pe[t])&&(null===n||0==(n&t))?e^t:null===n||n&t?e|t:e}function lt(e){return fr(e)||Xn(e)||po(e)}function at(e,t){if(null!=t)e.__key=t;else{qr(),99<Qr&&xe(14),t=eo();var n=Zr(),r=""+qe++;n._nodeMap.set(r,e),mo(e)?t._dirtyElements.set(r,!0):t._dirtyLeaves.add(r),t._cloneNotNeeded.add(r),t._dirtyType=1,e.__key=r}}function st(e){var t=e.getParent();if(null!==t){let o=e.getWritable();t=t.getWritable();var n=e.getPreviousSibling();if(e=e.getNextSibling(),null===n)if(null!==e){var r=e.getWritable();t.__first=e.__key,r.__prev=null}else t.__first=null;else{if(r=n.getWritable(),null!==e){let t=e.getWritable();t.__prev=r.__key,r.__next=t.__key}else r.__next=null;o.__prev=null}null===e?null!==n?(e=n.getWritable(),t.__last=n.__key,e.__next=null):t.__last=null:(e=e.getWritable(),null!==n?((n=n.getWritable()).__next=e.__key,e.__prev=n.__key):e.__prev=null,o.__next=null),t.__size--,o.__parent=null}}function ut(e){99<Qr&&xe(14);var t=e.getLatest(),n=t.__parent,r=Zr();let o=eo(),i=r._nodeMap;if(r=o._dirtyElements,null!==n)e:for(;null!==n&&!r.has(n);){let e=i.get(n);if(void 0===e)break;r.set(n,!1),n=e.__parent}t=t.__key,o._dirtyType=1,mo(e)?r.set(t,!0):o._dirtyLeaves.add(t)}function ct(e){qr();var t=eo();let n=t._compositionKey;e!==n&&(t._compositionKey=e,null!==n&&(null!==(t=pt(n))&&t.getWritable()),null!==e&&(null!==(e=pt(e))&&e.getWritable()))}function dt(){return Xr()?null:eo()._compositionKey}function pt(e,t){return void 0===(e=(t||Zr())._nodeMap.get(e))?null:e}function ft(e,t){return void 0!==(e=e[`__lexicalKey_${eo()._key}`])?pt(e,t):null}function mt(e,t){for(;null!=e;){let n=ft(e,t);if(null!==n)return n;e=Lt(e)}return null}function gt(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t}function ht(e){return e.read((()=>vt().getTextContent()))}function vt(){return Zr()._nodeMap.get("root")}function bt(e){qr();let t=Zr();null!==e&&(e.dirty=!0,e._cachedNodes=null),t._selection=e}function yt(e){var t,n=eo();e:{for(t=e;null!=t;){let e=t[`__lexicalKey_${n._key}`];if(void 0!==e){t=e;break e}t=Lt(t)}t=null}return null===t?e===(n=n.getRootElement())?pt("root"):null:pt(t)}function xt(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function _t(e){let t=[];for(;null!==e;)t.push(e),e=e._parentEditor;return t}function Et(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ct(e,t,n){if(null!==(t=jt(t._window))){var r=t.anchorNode,{anchorOffset:o,focusOffset:i}=t;if(null!==r&&(t=3===r.nodeType?r.nodeValue:null,r=mt(r),null!==t&&fr(r))){if(t===Re&&n){t=n,i=o=n.length}null!==t&&wt(r,t,o,i,e)}}}function wt(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){let u=i.isComposing(),c=t;if((u||o)&&t[t.length-1]===Re&&(c=t.slice(0,-1)),t=i.getTextContent(),o||c!==t)if(""===c)if(ct(null),ke||Te||Ne)i.remove();else{let e=eo();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}else{o=i.getParent(),t=Br();var l=i.getTextContentSize(),a=dt(),s=i.getKey();i.isToken()||null!==a&&s===a&&!u||Er(t)&&(null!==o&&!o.canInsertTextBefore()&&0===t.anchor.offset||t.anchor.key===e.__key&&0===t.anchor.offset&&!i.canInsertTextBefore()||t.focus.key===e.__key&&t.focus.offset===l&&!i.canInsertTextAfter())?i.markDirty():(Er(e=zr())&&null!==n&&null!==r&&(e.setTextNodeRange(i,n,i,r),i.isSegmented()&&(n=pr(n=i.getTextContent()),i.replace(n),i=n)),i.setTextContent(c))}}}function St(){var e=vt();bt(Je(e=e.select(0,e.getChildrenSize())))}function kt(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];return void 0!==r?r:"string"==typeof(e=e[t])?(e=e.split(" "),n[t]=e):e}function Tt(e,t,n,r,o){0!==n.size&&(n=r.__type,r=r.__key,void 0===(t=t.get(n))&&xe(33,n),n=t.klass,void 0===(t=e.get(n))&&(t=new Map,e.set(n,t)),n="destroyed"===(e=t.get(r))&&"created"===o,(void 0===e||n)&&t.set(r,n?"updated":o))}function At(e,t,n){let r=e.getParent(),o=n;return null!==r&&(t&&0===n?(o=e.getIndexWithinParent(),e=r):t||n!==e.getChildrenSize()||(o=e.getIndexWithinParent()+1,e=r)),e.getChildAtIndex(t?o-1:o)}function Nt(e,t){var n=e.offset;return"element"===e.type?At(e=e.getNode(),t,n):(e=e.getNode(),t&&0===n||!t&&n===e.getTextContentSize()?null===(n=t?e.getPreviousSibling():e.getNextSibling())?At(e.getParentOrThrow(),t,e.getIndexWithinParent()+(t?0:1)):n:null)}function Rt(e){return"insertFromPaste"===(e=(e=It(e).event)&&e.inputType)||"insertFromPasteAsQuotation"===e}function Ot(e){return!vo(e)&&!e.isLastChild()&&!e.isInline()}function Mt(e,t){return void 0===(e=e._keyToDOMMap.get(t))&&xe(75,t),e}function Lt(e){return null!==(e=e.assignedSlot||e.parentElement)&&11===e.nodeType?e.host:e}function Pt(e,t){for(e=e.getParent();null!==e;){if(e.is(t))return!0;e=e.getParent()}return!1}function It(e){return null===(e=e._window)&&xe(78),e}function Dt(e){for(e=e.getParentOrThrow();null!==e&&!$t(e);)e=e.getParentOrThrow();return e}function $t(e){return vo(e)||mo(e)&&e.isShadowRoot()}function zt(e){return at(e=e.constructor.clone(e),null),e}function Bt(e){var t=eo();let n=e.constructor.getType();return void 0===(t=t._nodes.get(n))&&xe(97),null!==(t=t.replace)?((t=t(e))instanceof e.constructor||xe(98),t):e}function Ft(e,t){!vo(e=e.getParent())||mo(t)||po(t)||xe(99)}function Ht(e){return(po(e)||mo(e)&&!e.canBeEmpty())&&!e.isInline()}function Wt(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null,null!==(t=e.parentElement)&&t.removeChild(e)}function jt(e){return _e?(e||window).getSelection():null}function Kt(e,t){let n=e.getChildAtIndex(t);null==n&&(n=e),$t(e)&&xe(102);let r=e=>{const t=e.getParentOrThrow(),o=$t(t),i=e!==n||o?zt(e):e;if(o)return e.insertAfter(i),[e,i,i];const[l,a,s]=r(t);return e=e.getNextSiblings(),s.append(i,...e),[l,a,i]},[o,i]=r(n);return[o,i]}function Yt(e,t){for(;e!==vt()&&null!=e;){if(t(e))return e;e=e.getParent()}return null}function Gt(e){let t=[],n=[e];for(;0<n.length;){let r=n.pop();void 0===r&&xe(112),mo(r)&&n.unshift(...r.getChildren()),r!==e&&t.push(r)}return t}function Ut(e,t,n,r,o,i){for(e=e.getFirstChild();null!==e;){let l=e.__key;e.__parent===t&&(mo(e)&&Ut(e,l,n,r,o,i),n.has(l)||i.delete(l),o.push(l)),e=e.getNextSibling()}}let Vt,Qt,Jt,Xt,qt,Zt,en,tn,nn,rn,on="",ln="",an="",sn=!1,un=!1,cn=null;function dn(e,t){let n=en.get(e);if(null!==t){let n=Sn(e);n.parentNode===t&&t.removeChild(n)}tn.has(e)||Qt._keyToDOMMap.delete(e),mo(n)&&pn(e=_n(n,en),0,e.length-1,null),void 0!==n&&Tt(rn,Jt,Xt,n,"destroyed")}function pn(e,t,n,r){for(;t<=n;++t){let n=e[t];void 0!==n&&dn(n,r)}}function fn(e,t){e.setProperty("text-align",t)}function mn(e,t){var n=Vt.theme.indent;if("string"==typeof n){let r=e.classList.contains(n);0<t&&!r?e.classList.add(n):1>t&&r&&e.classList.remove(n)}n=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||"40px",e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${n})`)}function gn(e,t){e=e.style,0===t?fn(e,""):1===t?fn(e,"left"):2===t?fn(e,"center"):3===t?fn(e,"right"):4===t?fn(e,"justify"):5===t?fn(e,"start"):6===t&&fn(e,"end")}function hn(e,t,n){let r=tn.get(e);void 0===r&&xe(60);let o=r.createDOM(Vt,Qt);var i=Qt._keyToDOMMap;if(o["__lexicalKey_"+Qt._key]=e,i.set(e,o),fr(r)?o.setAttribute("data-lexical-text","true"):po(r)&&o.setAttribute("data-lexical-decorator","true"),mo(r)){if(e=r.__indent,i=r.__size,0!==e&&mn(o,e),0!==i){--i,e=_n(r,tn);var l=ln;ln="",vn(e,r,0,i,o,null),xn(r,o),ln=l}0!==(e=r.__format)&&gn(o,e),r.isInline()||yn(null,r,o),Ot(r)&&(on+="\n\n",an+="\n\n")}else i=r.getTextContent(),po(r)?(null!==(l=r.decorate(Qt,Vt))&&Cn(e,l),o.contentEditable="false"):fr(r)&&(r.isDirectionless()||(ln+=i)),on+=i,an+=i;return null!==t&&(null!=n?t.insertBefore(o,n):null!=(n=t.__lexicalLineBreak)?t.insertBefore(o,n):t.appendChild(o)),Tt(rn,Jt,Xt,r,"created"),o}function vn(e,t,n,r,o,i){let l=on;for(on="";n<=r;++n)hn(e[n],o,i);Ot(t)&&(on+="\n\n"),o.__lexicalTextContent=on,on=l+on}function bn(e,t){return Xn(e=t.get(e))||po(e)&&e.isInline()}function yn(e,t,n){e=null!==e&&(0===e.__size||bn(e.__last,en)),t=0===t.__size||bn(t.__last,tn),e?t||(null!=(t=n.__lexicalLineBreak)&&n.removeChild(t),n.__lexicalLineBreak=null):t&&(t=document.createElement("br"),n.__lexicalLineBreak=t,n.appendChild(t))}function xn(e,t){var n=t.__lexicalDir;if(t.__lexicalDirTextContent!==ln||n!==cn){let i=""===ln;if(i)var r=cn;else r=ln,r=Me.test(r)?"rtl":Le.test(r)?"ltr":null;if(r!==n){let l=t.classList,a=Vt.theme;var o=null!==n?a[n]:void 0;let s=null!==r?a[r]:void 0;void 0!==o&&("string"==typeof o&&(o=o.split(" "),o=a[n]=o),l.remove(...o)),null===r||i&&"ltr"===r?t.removeAttribute("dir"):(void 0!==s&&("string"==typeof s&&(n=s.split(" "),s=a[r]=n),void 0!==s&&l.add(...s)),t.dir=r),un||(e.getWritable().__dir=r)}cn=r,t.__lexicalDirTextContent=ln,t.__lexicalDir=r}}function _n(e,t){let n=[];for(e=e.__first;null!==e;){let r=t.get(e);void 0===r&&xe(101),n.push(e),e=r.__next}return n}function En(e,t){var n=en.get(e),r=tn.get(e);void 0!==n&&void 0!==r||xe(61);var o=sn||Zt.has(e)||qt.has(e);let i=Mt(Qt,e);if(n===r&&!o)return mo(n)?(void 0!==(r=i.__lexicalTextContent)&&(on+=r,an+=r),void 0!==(r=i.__lexicalDirTextContent)&&(ln+=r)):(r=n.getTextContent(),fr(n)&&!n.isDirectionless()&&(ln+=r),an+=r,on+=r),i;if(n!==r&&o&&Tt(rn,Jt,Xt,r,"updated"),r.updateDOM(n,i,Vt))return r=hn(e,null,null),null===t&&xe(62),t.replaceChild(r,i),dn(e,null),r;if(mo(n)&&mo(r)){if((e=r.__indent)!==n.__indent&&mn(i,e),(e=r.__format)!==n.__format&&gn(i,e),o){e=r,o=ln,ln="",t=on;var l=n.__size,a=e.__size;if(on="",1===l&&1===a){var s=n.__first,u=e.__first;if(s===u)En(s,i);else{var c=Sn(s);u=hn(u,null,null),i.replaceChild(u,c),dn(s,null)}}else{u=_n(n,en);var d=_n(e,tn);if(0===l)0!==a&&vn(d,e,0,a-1,i,null);else if(0===a)0!==l&&(pn(u,0,l-1,(s=null==i.__lexicalLineBreak)?null:i),s&&(i.textContent=""));else{var p=u;u=d,d=l-1,l=a-1;let t=i.firstChild,n=0;for(a=0;n<=d&&a<=l;){var f=p[n];let e=u[a];if(f===e)t=wn(En(e,i)),n++,a++;else{void 0===s&&(s=new Set(p)),void 0===c&&(c=new Set(u));let r=c.has(f),o=s.has(e);r?(o?((f=Mt(Qt,e))===t?t=wn(En(e,i)):(null!=t?i.insertBefore(f,t):i.appendChild(f),En(e,i)),n++):hn(e,i,t),a++):(t=wn(Sn(f)),dn(f,i),n++)}}c=a>l,(s=n>d)&&!c?vn(u,e,a,l,i,s=void 0===(s=u[l+1])?null:Qt.getElementByKey(s)):c&&!s&&pn(p,n,d,i)}}Ot(e)&&(on+="\n\n"),i.__lexicalTextContent=on,on=t+on,xn(e,i),ln=o,vo(r)||r.isInline()||yn(n,r,i)}Ot(r)&&(on+="\n\n",an+="\n\n")}else n=r.getTextContent(),po(r)?null!==(o=r.decorate(Qt,Vt))&&Cn(e,o):fr(r)&&!r.isDirectionless()&&(ln+=n),on+=n,an+=n;return!un&&vo(r)&&r.__cachedText!==an&&((r=r.getWritable()).__cachedText=an),i}function Cn(e,t){let n=Qt._pendingDecorators,r=Qt._decorators;if(null===n){if(r[e]===t)return;n=gt(Qt)}n[e]=t}function wn(e){return null!==(e=e.nextSibling)&&e===Qt._blockCursorElement&&(e=e.nextSibling),e}function Sn(e){let t=nn.get(e);return void 0===t&&xe(75,e),t}let kn=Object.freeze({}),Tn=[["keydown",function(e,t){if(An=e.timeStamp,Nn=e.keyCode,!t.isComposing()){var{keyCode:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:l}=e;if(!lo(t,q,e)){if(39!==n||o||i||l)if(39!==n||l||r||!o&&!i)if(37!==n||o||i||l)if(37!==n||l||r||!o&&!i)if(38!==n||o||i)if(40!==n||o||i)if(13===n&&r)In=!0,lo(t,ie,e);else if(32===n)lo(t,le,e);else if(Ce&&o&&79===n)e.preventDefault(),In=!0,lo(t,W,!0);else if(13!==n||r)if(Ce?l||i||!(8===n||72===n&&o):o||l||i||8!==n)if(27===n)lo(t,se,e);else if(Ce?r||l||i||!(46===n||68===n&&o):o||l||i||46!==n)if(8===n&&(Ce?l:o))e.preventDefault(),lo(t,U,!0);else if(46===n&&(Ce?l:o))e.preventDefault(),lo(t,U,!1);else if(Ce&&i&&8===n)e.preventDefault(),lo(t,V,!0);else if(Ce&&i&&46===n)e.preventDefault(),lo(t,V,!1);else if(66===n&&!l&&(Ce?i:o))e.preventDefault(),lo(t,Q,"bold");else if(85===n&&!l&&(Ce?i:o))e.preventDefault(),lo(t,Q,"underline");else if(73===n&&!l&&(Ce?i:o))e.preventDefault(),lo(t,Q,"italic");else if(9!==n||l||o||i)if(90===n&&!r&&(Ce?i:o))e.preventDefault(),lo(t,J,void 0);else{var a=Ce?90===n&&i&&r:89===n&&o||90===n&&o&&r;a?(e.preventDefault(),lo(t,X,void 0)):kr(t._editorState._selection)?(a=!r&&(67===n&&(Ce?i:o)))?(e.preventDefault(),lo(t,ge,e)):(a=!r&&(88===n&&(Ce?i:o)))?(e.preventDefault(),lo(t,he,e)):65===n&&(Ce?i:o)&&(e.preventDefault(),t.update((()=>{St()}))):!we&&65===n&&(Ce?i:o)&&(e.preventDefault(),t.update((()=>{St()})))}else lo(t,ce,e);else 46===n?lo(t,ue,e):(e.preventDefault(),lo(t,H,!1));else 8===n?lo(t,ae,e):(e.preventDefault(),lo(t,H,!0));else In=!1,lo(t,ie,e);else lo(t,oe,e);else lo(t,re,e);else lo(t,ne,e);else lo(t,te,e);else lo(t,ee,e);else lo(t,Z,e);(o||r||l||i)&&lo(t,ye,e)}}}],["pointerdown",function(e,t){let n=e.target;e=e.pointerType,n instanceof Node&&"touch"!==e&&uo(t,(()=>{po(mt(n))||(Pn=!0)}))}],["compositionstart",function(e,t){uo(t,(()=>{let n=zr();if(Er(n)&&!t.isComposing()){let r=n.anchor,o=n.anchor.getNode();ct(r.key),(e.timeStamp<An+30||"element"===r.type||!n.isCollapsed()||o.getFormat()!==n.format||o.getStyle()!==n.style)&&lo(t,K,Oe)}}))}],["compositionend",function(e,t){we?Dn=!0:uo(t,(()=>{Wn(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),uo(t,(()=>{var n=zr(),r=e.data,o=Hn(e);if(null!=r&&Er(n)&&zn(n,o,r,e.timeStamp,!1)){Dn&&(Wn(t,r),Dn=!1);var i=n.anchor,l=i.getNode();if(null===(o=jt(t._window)))return;let a=i.offset;(i=Se&&!n.isCollapsed()&&fr(l)&&null!==o.anchorNode)&&(i=(l=l.getTextContent().slice(0,a)+r+l.getTextContent().slice(a+n.focus.offset))===(3===(o=o.anchorNode).nodeType?o.nodeValue:null)),i||lo(t,K,r),r=r.length,we&&1<r&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=r),ke||Te||Ne||!t.isComposing()||(An=0,ct(null))}else Ct(!1,t,null!==r?r:void 0),Dn&&(Wn(t,r||void 0),Dn=!1);qr(),Ye(n=eo())})),On=null}],["click",function(e,t){uo(t,(()=>{let n=zr();var r=jt(t._window);let o=Br();if(r)if(Er(n)){let t=n.anchor;var i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!vo(i)&&1===vt().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==(r=n.focus.getNode())&&(mo(i)?i.select(0):i.getParentOrThrow().select(0))}else"touch"===e.pointerType&&(null!==(i=r.anchorNode)&&(1===(i=i.nodeType)||3===i))&&bt(r=$r(o,r,t));lo(t,F,e)}))}],["cut",kn],["copy",kn],["dragstart",kn],["dragover",kn],["dragend",kn],["paste",kn],["focus",kn],["blur",kn],["drop",kn]];Se&&Tn.push(["beforeinput",(e,t)=>function(e,t){let n=e.inputType,r=Hn(e);"deleteCompositionText"===n||we&&Rt(t)||"insertCompositionText"!==n&&uo(t,(()=>{let o=zr();if("deleteContentBackward"===n){if(null===o){var i=Br();if(!Er(i))return;bt(i.clone())}if(Er(o))return void(229===Nn&&e.timeStamp<An+30&&t.isComposing()&&o.anchor.key===o.focus.key?(ct(null),An=0,setTimeout((()=>{uo(t,(()=>{ct(null)}))}),30),Er(o)&&(i=o.anchor.getNode(),i.markDirty(),o.format=i.getFormat(),o.style=i.getStyle())):(e.preventDefault(),lo(t,H,!0)))}if(Er(o)){i=e.data,null!==On&&Ct(!1,t,On),o.dirty&&null===On||!o.isCollapsed()||vo(o.anchor.getNode())||null===r||o.applyDOMRange(r),On=null;var l=o.focus,a=o.anchor.getNode();if(l=l.getNode(),"insertText"===n||"insertTranspose"===n)"\n"===i?(e.preventDefault(),lo(t,W,!1)):"\n\n"===i?(e.preventDefault(),lo(t,j,void 0)):null==i&&e.dataTransfer?(i=e.dataTransfer.getData("text/plain"),e.preventDefault(),o.insertRawText(i)):null!=i&&zn(o,r,i,e.timeStamp,!0)?(e.preventDefault(),lo(t,K,i)):On=i,Rn=e.timeStamp;else switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":lo(t,K,e);break;case"insertFromComposition":ct(null),lo(t,K,e);break;case"insertLineBreak":ct(null),lo(t,W,!1);break;case"insertParagraph":ct(null),In&&!Te?(In=!1,lo(t,W,!1)):lo(t,j,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":lo(t,Y,e);break;case"deleteByComposition":(function(e,t){return e!==t||mo(e)||mo(t)||!e.isToken()||!t.isToken()})(a,l)&&lo(t,G,e);break;case"deleteByDrag":case"deleteByCut":lo(t,G,e);break;case"deleteContent":lo(t,H,!1);break;case"deleteWordBackward":lo(t,U,!0);break;case"deleteWordForward":lo(t,U,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":lo(t,V,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":lo(t,V,!1);break;case"formatStrikeThrough":lo(t,Q,"strikethrough");break;case"formatBold":lo(t,Q,"bold");break;case"formatItalic":lo(t,Q,"italic");break;case"formatUnderline":lo(t,Q,"underline");break;case"historyUndo":lo(t,J,void 0);break;case"historyRedo":lo(t,X,void 0)}}}))}(e,t)]);let An=0,Nn=0,Rn=0,On=null,Mn=0,Ln=!1,Pn=!1,In=!1,Dn=!1,$n=[0,"",0,"root",0];function zn(e,t,n,r,o){let i=e.anchor,l=e.focus,a=i.getNode();var s=eo();let u=jt(s._window),c=null!==u?u.anchorNode:null,d=i.key;s=s.getElementByKey(d);let p=n.length;return d!==l.key||!fr(a)||(!o&&(!Se||Rn<r+50)||a.isDirty()&&2>p||xt(n))&&i.offset!==l.offset&&!a.isComposing()||rt(a)||a.isDirty()&&1<p||(o||!Se)&&null!==s&&!a.isComposing()&&c!==ot(s)||null!==u&&null!==t&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;e=e.anchor.offset;let n=t.getParentOrThrow(),r=t.isToken();return 0===e?((e=!t.canInsertTextBefore()||!n.canInsertTextBefore()||r)||(e=(fr(t=t.getPreviousSibling())||mo(t)&&t.isInline())&&!t.canInsertTextAfter()),e):e===t.getTextContentSize()&&(!t.canInsertTextAfter()||!n.canInsertTextAfter()||r)}(e,a)}function Bn(e,t){return null!==e&&null!==e.nodeValue&&3===e.nodeType&&0!==t&&t!==e.nodeValue.length}function Fn(e,t,n){let{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:l}=e;Ln&&(Ln=!1,Bn(r,o)&&Bn(i,l))||uo(t,(()=>{if(n){if(tt(t,r,i)){var o=zr();if(Er(o)){var l=o.anchor,a=l.getNode();if(o.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(o.dirty=!0);var s=It(t).event;s=s?s.timeStamp:performance.now();let[n,r,i,u,c]=$n;s<c+200&&l.offset===i&&l.key===u?(o.format=n,o.style=r):"text"===l.type?(o.format=a.getFormat(),o.style=a.getStyle()):"element"===l.type&&(o.format=0,o.style="")}else{l=255,a=!1;let e=(s=o.getNodes()).length;for(let t=0;t<e;t++){let e=s[t];if(fr(e)&&(a=!0,0===(l&=e.getFormat())))break}o.format=a?l:0}}lo(t,B,void 0)}}else bt(null)}))}function Hn(e){return e.getTargetRanges?0===(e=e.getTargetRanges()).length?null:e[0]:null}function Wn(e,t){var n=e._compositionKey;if(ct(null),null!==n&&null!=t){if(""===t)return t=pt(n),void(null!==(e=ot(e.getElementByKey(n)))&&null!==e.nodeValue&&fr(t)&&wt(t,e.nodeValue,null,null,!0));if("\n"===t[t.length-1]&&Er(n=zr()))return t=n.focus,n.anchor.set(t.key,t.offset,t.type),void lo(e,ie,null)}Ct(!0,e,t)}function jn(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}let Kn=new Map;function Yn(e){let t=jt(null==(e=e.target)?null:9===e.nodeType?e.defaultView:e.ownerDocument.defaultView);if(null!==t){var n=nt(t.anchorNode);if(null!==n){Pn&&(Pn=!1,uo(n,(()=>{var e=Br(),r=t.anchorNode;null!==r&&(1===(r=r.nodeType)||3===r)&&bt(e=$r(e,t,n))})));var r=(e=(e=_t(n))[e.length-1])._key,o=Kn.get(r),i=o||e;i!==n&&Fn(t,i,!1),Fn(t,n,!0),n!==e?Kn.set(r,n):o&&Kn.delete(r)}}}function Gn(e,t,n){qr();var r=e.__key;let o=e.getParent();if(null!==o){var i=zr();if(Er(i)&&mo(e)){var{anchor:l,focus:a}=i,s=l.getNode(),u=a.getNode();Pt(s,e)&&l.set(e.__key,0,"element"),Pt(u,e)&&a.set(e.__key,0,"element")}if(u=!1,Er(s=i)&&t){i=s.anchor;let t=s.focus;i.key===r&&(Wr(i,e,o,e.getPreviousSibling(),e.getNextSibling()),u=!0),t.key===r&&(Wr(t,e,o,e.getPreviousSibling(),e.getNextSibling()),u=!0)}else kr(s)&&t&&e.isSelected()&&e.selectPrevious();Er(s)&&t&&!u?(r=e.getIndexWithinParent(),st(e),Fr(s,o,r,-1)):st(e),n||$t(o)||o.canBeEmpty()||!o.isEmpty()||Gn(o,t),t&&vo(o)&&o.isEmpty()&&o.selectEnd()}}class Un{static getType(){xe(64,this.name)}static clone(){xe(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,at(this,e)}getType(){return this.__type}isAttached(){for(var e=this.__key;null!==e;){if("root"===e)return!0;if(null===(e=pt(e)))break;e=e.__parent}return!1}isSelected(e){if(null==(e=e||zr()))return!1;let t=e.getNodes().some((e=>e.__key===this.__key));return(fr(this)||!Er(e)||"element"!==e.anchor.type||"element"!==e.focus.type||e.anchor.key!==e.focus.key||e.anchor.offset!==e.focus.offset)&&t}getKey(){return this.__key}getIndexWithinParent(){var e=this.getParent();if(null===e)return-1;e=e.getFirstChild();let t=0;for(;null!==e;){if(this.is(e))return t;t++,e=e.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return null===e?null:pt(e)}getParentOrThrow(){let e=this.getParent();return null===e&&xe(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){let t=e.getParent();if($t(t))return e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return null===e&&xe(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return null===e?null:pt(e)}getPreviousSiblings(){let e=[];var t=this.getParent();if(null===t)return e;for(t=t.getFirstChild();null!==t&&!t.is(this);)e.push(t),t=t.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return null===e?null:pt(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=this.getParents();var n=e.getParents();mo(this)&&t.unshift(this),mo(e)&&n.unshift(e),e=t.length;var r=n.length;if(0===e||0===r||t[e-1]!==n[r-1])return null;for(n=new Set(n),r=0;r<e;r++){let e=t[r];if(n.has(e))return e}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;var t=this.getCommonAncestor(e);let n=this;for(;;){var r=n.getParentOrThrow();if(r===t){r=n.getIndexWithinParent();break}n=r}for(n=e;;){if((e=n.getParentOrThrow())===t){t=n.getIndexWithinParent();break}n=e}return r<t}isParentOf(e){let t=this.__key;if(t===e.__key)return!1;for(;null!==e;){if(e.__key===t)return!0;e=e.getParent()}return!1}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set;for(var o=this;;){var i=o.__key;if(r.has(i)||(r.add(i),n.push(o)),o===e)break;if(null!==(i=mo(o)?t?o.getFirstChild():o.getLastChild():null))o=i;else if(null!==(i=t?o.getNextSibling():o.getPreviousSibling()))o=i;else{if(o=o.getParentOrThrow(),r.has(o.__key)||n.push(o),o===e)break;i=o;do{null===i&&xe(68),o=t?i.getNextSibling():i.getPreviousSibling(),null!==(i=i.getParent())&&(null!==o||r.has(i.__key)||n.push(i))}while(null===o)}}return t||n.reverse(),n}isDirty(){let e=eo()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){let e=pt(this.__key);return null===e&&xe(113),e}getWritable(){qr();var e=Zr(),t=eo();e=e._nodeMap;let n=this.__key,r=this.getLatest(),o=r.__parent;t=t._cloneNotNeeded;var i=zr();return null!==i&&(i._cachedNodes=null),t.has(n)?(ut(r),r):((i=r.constructor.clone(r)).__parent=o,i.__next=r.__next,i.__prev=r.__prev,mo(r)&&mo(i)?(i.__first=r.__first,i.__last=r.__last,i.__size=r.__size,i.__indent=r.__indent,i.__format=r.__format,i.__dir=r.__dir):fr(r)&&fr(i)&&(i.__format=r.__format,i.__style=r.__style,i.__mode=r.__mode,i.__detail=r.__detail),t.add(n),i.__key=n,ut(i),e.set(n,i),i)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){xe(70)}updateDOM(){xe(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){xe(72)}static importJSON(){xe(18,this.name)}static transform(){return null}remove(e){Gn(this,!0,e)}replace(e,t){qr();var n=zr();null!==n&&(n=n.clone()),Ft(this,e);let r=this.getLatest(),o=this.__key,i=e.__key,l=e.getWritable(),a=(e=this.getParentOrThrow().getWritable()).__size;st(l);let s=r.getPreviousSibling(),u=r.getNextSibling(),c=r.__prev,d=r.__next,p=r.__parent;return Gn(r,!1,!0),null===s?e.__first=i:s.getWritable().__next=i,l.__prev=c,null===u?e.__last=i:u.getWritable().__prev=i,l.__next=d,l.__parent=p,e.__size=a,t&&this.getChildren().forEach((e=>{l.append(e)})),Er(n)&&(bt(n),t=n.anchor,n=n.focus,t.key===o&&br(t,l),n.key===o&&br(n,l)),dt()===o&&ct(i),l}insertAfter(e,t=!0){qr(),Ft(this,e);var n=this.getWritable();let r=e.getWritable();var o=r.getParent();let i=zr();var l=!1,a=!1;if(null!==o){var s=e.getIndexWithinParent();st(r),Er(i)&&(a=o.__key,l=i.anchor,o=i.focus,l="element"===l.type&&l.key===a&&l.offset===s+1,a="element"===o.type&&o.key===a&&o.offset===s+1)}o=this.getNextSibling(),s=this.getParentOrThrow().getWritable();let u=r.__key,c=n.__next;return null===o?s.__last=u:o.getWritable().__prev=u,s.__size++,n.__next=u,r.__next=c,r.__prev=n.__key,r.__parent=n.__parent,t&&Er(i)&&(Fr(i,s,(t=this.getIndexWithinParent())+1),n=s.__key,l&&i.anchor.set(n,t+2,"element"),a&&i.focus.set(n,t+2,"element")),e}insertBefore(e,t=!0){qr(),Ft(this,e);var n=this.getWritable();let r=e.getWritable(),o=r.__key;st(r);let i=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=n.__prev,s=this.getIndexWithinParent();return null===i?l.__first=o:i.getWritable().__next=o,l.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent,n=zr(),t&&Er(n)&&Fr(n,t=this.getParentOrThrow(),s),e}isParentRequired(){return!1}createParentElementNode(){return Co()}selectPrevious(e,t){qr();let n=this.getPreviousSibling(),r=this.getParentOrThrow();return null===n?r.select(0,0):mo(n)?n.select():fr(n)?n.select(e,t):(e=n.getIndexWithinParent()+1,r.select(e,e))}selectNext(e,t){qr();let n=this.getNextSibling(),r=this.getParentOrThrow();return null===n?r.select():mo(n)?n.select(0,0):fr(n)?n.select(e,t):(e=n.getIndexWithinParent(),r.select(e,e))}markDirty(){this.getWritable()}}let Vn=class e extends Un{static getType(){return"linebreak"}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>{let t,n,r=e.parentElement;return null!==r&&((t=r.firstChild)===e||t.nextSibling===e&&3===t.nodeType&&null!==(t.textContent||"").match(/^[\s|\r?\n|\t]+$/))&&((n=r.lastChild)===e||n.previousSibling===e&&3===n.nodeType&&null!==(n.textContent||"").match(/^[\s|\r?\n|\t]+$/))?null:{conversion:Qn,priority:0}}}}static importJSON(){return Jn()}exportJSON(){return{type:"linebreak",version:1}}};function Qn(){return{node:Jn()}}function Jn(){return Bt(new Vn)}function Xn(e){return e instanceof Vn}function qn(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Zn(e,t){return 1&t?"strong":2&t?"em":"span"}function er(e,t,n,r,o){e=r.classList,void 0!==(r=kt(o,"base"))&&e.add(...r);let i=!1,l=8&t&&4&t;var a=8&n&&4&n;void 0!==(r=kt(o,"underlineStrikethrough"))&&(a?(i=!0,l||e.add(...r)):l&&e.remove(...r));for(let s in Pe)a=Pe[s],void 0!==(r=kt(o,s))&&(n&a&&(!i||"underline"!==s&&"strikethrough"!==s)?(0==(t&a)||l&&"underline"===s||"strikethrough"===s)&&e.add(...r):t&a&&e.remove(...r))}function tr(e,t,n){let r=t.firstChild;if(e+=(n=n.isComposing())?Re:"",null==r)t.textContent=e;else if((t=r.nodeValue)!==e)if(n||we){n=t.length;let o=e.length,i=0,l=0;for(;i<n&&i<o&&t[i]===e[i];)i++;for(;l+i<n&&l+i<o&&t[n-l-1]===e[o-l-1];)l++;e=[i,n-i-l,e.slice(i,o-l)];let[a,s,u]=e;0!==s&&r.deleteData(a,s),r.insertData(a,u)}else r.nodeValue=e}function nr(e,t){return(t=document.createElement(t)).appendChild(e),t}let rr=class e extends Un{static getType(){return"text"}static clone(t){return new e(t.__text,t.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return Be[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===dt()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return 0!=(1&this.getLatest().__detail)}isUnmergeable(){return 0!=(2&this.getLatest().__detail)}hasFormat(e){return e=Pe[e],0!=(this.getFormat()&e)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return it(this.getLatest().__format,e,t)}createDOM(e){var t=this.__format,n=qn(0,t);let r=Zn(0,t),o=document.createElement(null===n?r:n),i=o;return null!==n&&(i=document.createElement(r),o.appendChild(i)),n=i,tr(this.__text,n,this),void 0!==(e=e.theme.text)&&er(r,0,t,n,e),""!==(t=this.__style)&&(o.style.cssText=t),o}updateDOM(e,t,n){let r=this.__text;var o=e.__format,i=this.__format,l=qn(0,o);let a=qn(0,i);var s=Zn(0,o);let u=Zn(0,i);return(null===l?s:l)!==(null===a?u:a)||(l===a&&s!==u?(null==(o=t.firstChild)&&xe(48),tr(r,e=l=document.createElement(u),this),void 0!==(n=n.theme.text)&&er(u,0,i,e,n),t.replaceChild(l,o),!1):(s=t,null!==a&&null!==l&&(null==(s=t.firstChild)&&xe(49)),tr(r,s,this),void 0!==(n=n.theme.text)&&o!==i&&er(u,o,i,s,n),i=this.__style,e.__style!==i&&(t.style.cssText=i),!1))}static importDOM(){return{"#text":()=>({conversion:ar,priority:0}),b:()=>({conversion:ir,priority:0}),code:()=>({conversion:dr,priority:0}),em:()=>({conversion:dr,priority:0}),i:()=>({conversion:dr,priority:0}),s:()=>({conversion:dr,priority:0}),span:()=>({conversion:or,priority:0}),strong:()=>({conversion:dr,priority:0}),sub:()=>({conversion:dr,priority:0}),sup:()=>({conversion:dr,priority:0}),u:()=>({conversion:dr,priority:0})}}static importJSON(e){let t=pr(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){return({element:e}=super.exportDOM(e)),null!==e&&(this.hasFormat("bold")&&(e=nr(e,"b")),this.hasFormat("italic")&&(e=nr(e,"i")),this.hasFormat("strikethrough")&&(e=nr(e,"s")),this.hasFormat("underline")&&(e=nr(e,"u"))),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(e){let t=this.getWritable();return t.__format="string"==typeof e?Pe[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?Ie[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){return e=Pe[e],this.setFormat(this.getFormat()^e)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){if(e=ze[e],this.__mode===e)return this;let t=this.getWritable();return t.__mode=e,t}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){qr();let n=zr();var r=this.getTextContent();let o=this.__key;return"string"==typeof r?(r=r.length,void 0===e&&(e=r),void 0===t&&(t=r)):t=e=0,Er(n)?((r=dt())!==n.anchor.key&&r!==n.focus.key||ct(o),n.setTextNodeRange(this,e,this,t),n):Ir(o,e,o,t,"text","text")}spliceText(e,t,n,r){let o=this.getWritable(),i=o.__text,l=n.length,a=e;0>a&&(a=l+a,0>a&&(a=0));let s=zr();return r&&Er(s)&&(e+=l,s.setTextNodeRange(o,e,o,e)),t=i.slice(0,a)+n+i.slice(a+t),o.__text=t,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){qr();var t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=dt(),i=new Set(e);e=[];for(var l=n.length,a="",s=0;s<l;s++)""!==a&&i.has(s)&&(e.push(a),a=""),a+=n[s];if(""!==a&&e.push(a),0===(i=e.length))return[];if(e[0]===n)return[t];var u=e[0];n=t.getParentOrThrow(),s=t.getFormat();let c=t.getStyle(),d=t.__detail;l=!1,t.isSegmented()?((a=pr(u)).__format=s,a.__style=c,a.__detail=d,l=!0):(a=t.getWritable()).__text=u,t=zr(),a=[a],u=u.length;for(let n=1;n<i;n++){var p=e[n],f=p.length;(p=pr(p).getWritable()).__format=s,p.__style=c,p.__detail=d;let i=p.__key;if(f=u+f,Er(t)){let e=t.anchor,n=t.focus;e.key===r&&"text"===e.type&&e.offset>u&&e.offset<=f&&(e.key=i,e.offset-=u,t.dirty=!0),n.key===r&&"text"===n.type&&n.offset>u&&n.offset<=f&&(n.key=i,n.offset-=u,t.dirty=!0)}o===r&&ct(i),u=f,a.push(p)}return r=this.getPreviousSibling(),o=this.getNextSibling(),null!==r&&ut(r),null!==o&&ut(o),r=n.getWritable(),o=this.getIndexWithinParent(),l?(r.splice(o,0,a),this.remove()):r.splice(o,1,a),Er(t)&&Fr(t,n,o,i-1),a}mergeWithSibling(e){var t=e===this.getPreviousSibling();t||e===this.getNextSibling()||xe(50);var n=this.__key;let r=e.__key,o=this.__text,i=o.length;dt()===r&&ct(n);let l=zr();if(Er(l)){let o=l.anchor,a=l.focus;null!==o&&o.key===r&&(jr(o,t,n,e,i),l.dirty=!0),null!==a&&a.key===r&&(jr(a,t,n,e,i),l.dirty=!0)}return n=e.__text,this.setTextContent(t?n+o:o+n),t=this.getWritable(),e.remove(),t}isTextEntity(){return!1}};function or(e){let t="700"===e.style.fontWeight,n="line-through"===e.style.textDecoration,r="italic"===e.style.fontStyle,o="underline"===e.style.textDecoration,i=e.style.verticalAlign;return{forChild:e=>fr(e)?(t&&e.toggleFormat("bold"),n&&e.toggleFormat("strikethrough"),r&&e.toggleFormat("italic"),o&&e.toggleFormat("underline"),"sub"===i&&e.toggleFormat("subscript"),"super"===i&&e.toggleFormat("superscript"),e):e,node:null}}function ir(e){let t="normal"===e.style.fontWeight;return{forChild:e=>(fr(e)&&!t&&e.toggleFormat("bold"),e),node:null}}let lr=new WeakMap;function ar(e){null===e.parentElement&&xe(129);for(var t,n=e.textContent||"",r=e.parentNode,o=[e];null!==r&&void 0===(t=lr.get(r))&&!("PRE"===r.nodeName||1===r.nodeType&&r.style.whiteSpace.startsWith("pre"));)o.push(r),r=r.parentNode;for(t=void 0===t?r:t,r=0;r<o.length;r++)lr.set(o[r],t);if(null!==t){for(e=[],o=(n=n.split(/(\r?\n|\t)/)).length,t=0;t<o;t++)"\n"===(r=n[t])||"\r\n"===r?e.push(Jn()):"\t"===r?e.push(gr()):""!==r&&e.push(pr(r));return{node:e}}if(""===(n=n.replace(/\r?\n|\t/gm," ").replace("\r","").replace(/\s+/g," ")))return{node:null};if(" "===n[0]){for(o=e,t=!0;null!==o&&null!==(o=ur(o,!1));)if(0<(r=o.textContent||"").length){r.match(/(?:\s|\r?\n|\t)$/)&&(n=n.slice(1)),t=!1;break}t&&(n=n.slice(1))}if(" "===n[n.length-1]){for(o=!0;null!==e&&null!==(e=ur(e,!0));)if(0<(e.textContent||"").replace(/^[\s|\r?\n|\t]+/,"").length){o=!1;break}o&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:pr(n)}}let sr=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 ur(e,t){for(;;){for(var n=void 0;null===(n=t?e.nextSibling:e.previousSibling);)if(null===(e=e.parentElement))return null;if(1===(e=n).nodeType&&(""===(n=e.style.display)&&null===e.nodeName.match(sr)||""!==n&&!n.startsWith("inline")))return null;for(;null!==(n=t?e.firstChild:e.lastChild);)e=n;if(3===e.nodeType)return e;if("BR"===e.nodeName)return null}}let cr={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function dr(e){let t=cr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:e=>(fr(e)&&!e.hasFormat(t)&&e.toggleFormat(t),e),node:null}}function pr(e=""){return Bt(new rr(e))}function fr(e){return e instanceof rr}let mr=class e extends rr{static getType(){return"tab"}static clone(t){let n=new e(t.__key);return n.__text=t.__text,n.__format=t.__format,n.__style=t.__style,n}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){let t=gr();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){xe(126)}setDetail(){xe(127)}setMode(){xe(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function gr(){return Bt(new mr)}let hr=class{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode(),r=this.offset;if(e=e.offset,mo(t)){var o=t.getDescendantByIndex(r);t=null!=o?o:t}return mo(n)&&(o=n.getDescendantByIndex(e),n=null!=o?o:n),t===n?r<e:t.isBefore(n)}getNode(){let e=pt(this.key);return null===e&&xe(20),e}set(e,t,n){let r=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,Xr()||(dt()===o&&ct(e),null!==r&&(r._cachedNodes=null,r.dirty=!0))}};function vr(e,t){let n=t.__key,r=e.offset,o="element";if(fr(t))o="text",r>(t=t.getTextContentSize())&&(r=t);else if(!mo(t)){var i=t.getNextSibling();fr(i)?(n=i.__key,r=0,o="text"):(i=t.getParent())&&(n=i.__key,r=t.getIndexWithinParent()+1)}e.set(n,r,o)}function br(e,t){if(mo(t)){let n=t.getLastDescendant();mo(n)||fr(n)?vr(e,n):vr(e,t)}else vr(e,t)}function yr(e,t,n,r){let o=e.getNode(),i=o.getChildAtIndex(e.offset),l=pr(),a=vo(o)?Co().append(l):l;l.setFormat(n),l.setStyle(r),null===i?o.append(a):(i.insertBefore(a),"element"===t.type&&t.key===e.key&&t.offset!==e.offset&&t.set(t.key,t.offset+1,"element")),e.is(t)&&t.set(l.__key,0,"text"),e.set(l.__key,0,"text")}function xr(e,t,n,r){e.key=t,e.offset=n,e.type=r}class _r{constructor(e){this.dirty=!1,this._nodes=e,this._cachedNodes=null}is(e){if(!kr(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new _r(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(e,t){let n=this.getNodes(),r=n.length;var o=n[r-1];if(fr(o))o=o.select();else{let e=o.getIndexWithinParent()+1;o=o.getParentOrThrow().select(e,e)}for(o.insertNodes(e,t),e=0;e<r;e++)n[e].remove();return!0}getNodes(){var e=this._cachedNodes;if(null!==e)return e;var t=this._nodes;e=[];for(let n of t)null!==(t=pt(n))&&e.push(t);return Xr()||(this._cachedNodes=e),e}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function Er(e){return e instanceof Sr}let Cr=class e{constructor(e,t,n){this.gridKey=e,this.anchor=t,this.focus=n,this.dirty=!1,this._cachedNodes=null,t._selection=this,n._selection=this}is(e){return!!wr(e)&&(this.gridKey===e.gridKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus))}set(e,t,n){this.dirty=!0,this.gridKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return Ar(this)}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(e,t){let n=this.focus.getNode();return Je(n.select(0,n.getChildrenSize())).insertNodes(e,t)}getShape(){var e=pt(this.anchor.key);null===e&&xe(21);var t=e.getIndexWithinParent();e=e.getParentOrThrow().getIndexWithinParent();var n=pt(this.focus.key);null===n&&xe(22);var r=n.getIndexWithinParent();let o=n.getParentOrThrow().getIndexWithinParent();return n=Math.min(t,r),t=Math.max(t,r),r=Math.min(e,o),e=Math.max(e,o),{fromX:Math.min(n,t),fromY:Math.min(r,e),toX:Math.max(n,t),toY:Math.max(r,e)}}getNodes(){function e(e){let{cell:t,startColumn:n,startRow:r}=e;a=Math.min(a,n),s=Math.min(s,r),u=Math.max(u,n+t.__colSpan-1),c=Math.max(c,r+t.__rowSpan-1)}var t=this._cachedNodes;if(null!==t)return t;var n=this.anchor.getNode();t=this.focus.getNode(),n=Yt(n,To);var r=Yt(t,To);To(n)||xe(103),To(r)||xe(104),Oo(t=n.getParent())||xe(105),No(t=t.getParent())||xe(106);let[o,i,l]=Kr(t,n,r),a=Math.min(i.startColumn,l.startColumn),s=Math.min(i.startRow,l.startRow),u=Math.max(i.startColumn+i.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),c=Math.max(i.startRow+i.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1);n=a,r=s;for(var d=a,p=s;a<n||s<r||u>d||c>p;){if(a<n){var f=p-r;--n;for(var m=0;m<=f;m++)e(o[r+m][n])}if(s<r)for(f=d-n,--r,m=0;m<=f;m++)e(o[r][n+m]);if(u>d)for(f=p-r,d+=1,m=0;m<=f;m++)e(o[r+m][d]);if(c>p)for(f=d-n,p+=1,m=0;m<=f;m++)e(o[p][n+m])}for(t=[t],n=null,r=s;r<=c;r++)for(d=a;d<=u;d++)({cell:p}=o[r][d]),Oo(f=p.getParent())||xe(107),f!==n&&t.push(f),t.push(p,...Gt(p)),n=f;return Xr()||(this._cachedNodes=t),t}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}};function wr(e){return e instanceof Cr}let Sr=class e{constructor(e,t,n,r){this.anchor=e,this.focus=t,this.dirty=!1,this.format=n,this.style=r,this._cachedNodes=null,e._selection=this,t._selection=this}is(e){return!!Er(e)&&(this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style)}isBackward(){return this.focus.isBefore(this.anchor)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var e=this._cachedNodes;if(null!==e)return e;e=this.anchor;var t=this.focus,n=e.isBefore(t),r=n?e:t;n=n?t:e,e=r.getNode(),t=n.getNode();let o=r.offset;return r=n.offset,mo(e)&&(n=e.getDescendantByIndex(o),e=null!=n?n:e),mo(t)&&(null!==(n=t.getDescendantByIndex(r))&&n!==e&&t.getChildAtIndex(r)===n&&(n=n.getPreviousSibling()),t=null!=n?n:t),e=e.is(t)?mo(e)&&0<e.getChildrenSize()?[]:[e]:e.getNodesBetween(t),Xr()||(this._cachedNodes=e),e}setTextNodeRange(e,t,n,r){xr(this.anchor,e.__key,t,"text"),xr(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let e=this.getNodes();if(0===e.length)return"";let t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[l,a]=Ar(this),s="",u=!0;for(let c=0;c<e.length;c++){let d=e[c];if(mo(d)&&!d.isInline())u||(s+="\n"),u=!d.isEmpty();else if(u=!1,fr(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===o.type&&o.offset!==r.offset||(e=l<a?e.slice(l,a):e.slice(a,l)):e=i?e.slice(l):e.slice(a):d===n&&(e=i?e.slice(0,a):e.slice(0,l)),s+=e}else!po(d)&&!Xn(d)||d===n&&this.isCollapsed()||(s+=d.getTextContent())}return s}applyDOMRange(e){let t=eo(),n=t.getEditorState()._selection;if(null!==(e=Lr(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n))){var[r,o]=e;xr(this.anchor,r.key,r.offset,r.type),xr(this.focus,o.key,o.offset,o.type),this._cachedNodes=null}}clone(){let t=this.anchor,n=this.focus;return new e(new hr(t.key,t.offset,t.type),new hr(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=it(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){return 0!=(this.format&Pe[e])}insertRawText(e){let t=[],n=(e=e.split(/(\r?\n|\t)/)).length;for(let r=0;r<n;r++){let n=e[r];"\n"===n||"\r\n"===n?t.push(Jn()):"\t"===n?t.push(gr()):t.push(pr(n))}this.insertNodes(t)}insertText(e){var t=this.anchor,n=this.focus,r=this.isCollapsed()||t.isBefore(n),o=this.format,i=this.style;r&&"element"===t.type?yr(t,n,o,i):r||"element"!==n.type||yr(n,t,o,i);var l=this.getNodes(),a=l.length,s=r?n:t;n=(r?t:n).offset;var u=s.offset;fr(t=l[0])||xe(26),r=t.getTextContent().length;var c=t.getParentOrThrow(),d=l[a-1];if(this.isCollapsed()&&n===r&&(t.isSegmented()||t.isToken()||!t.canInsertTextAfter()||!c.canInsertTextAfter()&&null===t.getNextSibling())){var p=t.getNextSibling();if(fr(p)&&p.canInsertTextBefore()&&!rt(p)||((p=pr()).setFormat(o),c.canInsertTextAfter()?t.insertAfter(p):c.insertAfter(p)),p.select(0,0),t=p,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===n&&(t.isSegmented()||t.isToken()||!t.canInsertTextBefore()||!c.canInsertTextBefore()&&null===t.getPreviousSibling())){if(fr(p=t.getPreviousSibling())&&!rt(p)||((p=pr()).setFormat(o),c.canInsertTextBefore()?t.insertBefore(p):c.insertBefore(p)),p.select(),t=p,""!==e)return void this.insertText(e)}else if(t.isSegmented()&&n!==r)(c=pr(t.getTextContent())).setFormat(o),t.replace(c),t=c;else if(!(this.isCollapsed()||""===e||(p=d.getParent(),c.canInsertTextBefore()&&c.canInsertTextAfter()&&(!mo(p)||p.canInsertTextBefore()&&p.canInsertTextAfter()))))return this.insertText(""),Mr(this.anchor,this.focus,null),void this.insertText(e);if(1===a)if(t.isToken())(e=pr(e)).select(),t.replace(e);else{if(l=t.getFormat(),a=t.getStyle(),n===u&&(l!==o||a!==i)){if(""!==t.getTextContent())return(l=pr(e)).setFormat(o),l.setStyle(i),l.select(),0===n?t.insertBefore(l,!1):([a]=t.splitText(n),a.insertAfter(l,!1)),void(l.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length));t.setFormat(o),t.setStyle(i)}""===(t=t.spliceText(n,u-n,e,!0)).getTextContent()?t.remove():"text"===this.anchor.type&&(t.isComposing()?this.anchor.offset-=e.length:(this.format=l,this.style=a))}else{if(o=new Set([...t.getParentKeys(),...d.getParentKeys()]),p=mo(t)?t:t.getParentOrThrow(),i=mo(d)?d:d.getParentOrThrow(),c=d,!p.is(i)&&i.isInline())do{c=i,i=i.getParentOrThrow()}while(i.isInline());"text"===s.type&&(0!==u||""===d.getTextContent())||"element"===s.type&&d.getIndexWithinParent()<u?fr(d)&&!d.isToken()&&u!==d.getTextContentSize()?(d.isSegmented()&&(s=pr(d.getTextContent()),d.replace(s),d=s),d=d.spliceText(0,u,""),o.add(d.__key)):(s=d.getParentOrThrow()).canBeEmpty()||1!==s.getChildrenSize()?d.remove():s.remove():o.add(d.__key),s=i.getChildren(),u=new Set(l),d=p.is(i),p=p.isInline()&&null===t.getNextSibling()?p:t;for(let e=s.length-1;0<=e;e--){let n=s[e];if(n.is(t)||mo(n)&&n.isParentOf(t))break;n.isAttached()&&(!u.has(n)||n.is(c)?d||p.insertAfter(n,!1):n.remove())}if(!d)for(s=i,u=null;null!==s;)(0===(d=(i=s.getChildren()).length)||i[d-1].is(u))&&(o.delete(s.__key),u=s),s=s.getParent();for(t.isToken()?n===r?t.select():((e=pr(e)).select(),t.replace(e)):""===(t=t.spliceText(n,r-n,e,!0)).getTextContent()?t.remove():t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length),e=1;e<a;e++)t=l[e],o.has(t.__key)||t.remove()}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())this.toggleFormat(e),ct(null);else{var t=this.getNodes(),n=[];for(var r of t)fr(r)&&n.push(r);var o=n.length;if(0===o)this.toggleFormat(e),ct(null);else{r=this.anchor;var i=this.focus,l=this.isBackward();t=l?i:r,r=l?r:i;var a=0,s=n[0];if(i="element"===t.type?0:t.offset,"text"===t.type&&i===s.getTextContentSize()&&(a=1,s=n[1],i=0),null!=s){l=s.getFormatFlags(e,null);var u=o-1,c=n[u];if(o="text"===r.type?r.offset:c.getTextContentSize(),s.is(c))i!==o&&(0===i&&o===s.getTextContentSize()?s.setFormat(l):(e=s.splitText(i,o),(e=0===i?e[0]:e[1]).setFormat(l),"text"===t.type&&t.set(e.__key,0,"text"),"text"===r.type&&r.set(e.__key,o-i,"text")),this.format=l);else{0!==i&&([,s]=s.splitText(i),i=0),s.setFormat(l);var d=c.getFormatFlags(e,l);for(0<o&&(o!==c.getTextContentSize()&&([c]=c.splitText(o)),c.setFormat(d)),a+=1;a<u;a++){let t=n[a];if(!t.isToken()){let n=t.getFormatFlags(e,d);t.setFormat(n)}}"text"===t.type&&t.set(s.__key,i,"text"),"text"===r.type&&r.set(c.__key,o,"text"),this.format=l|d}}}}}insertNodes(e,t){if(!this.isCollapsed()){var n=this.isBackward()?this.anchor:this.focus,r=n.getNode().getNextSibling();if(r=r?r.getKey():null,n=(n=n.getNode().getPreviousSibling())?n.getKey():null,this.removeText(),this.isCollapsed()&&"element"===this.focus.type){if(this.focus.key===r&&0===this.focus.offset){var o=pr();this.focus.getNode().insertBefore(o)}else this.focus.key===n&&this.focus.offset===this.focus.getNode().getChildrenSize()&&(o=pr(),this.focus.getNode().insertAfter(o));o&&(this.focus.set(o.__key,0,"text"),this.anchor.set(o.__key,0,"text"))}}n=(o=this.anchor).offset;var i=o.getNode();r=i,"element"===o.type&&(r=null===(r=(o=o.getNode()).getChildAtIndex(n-1))?o:r),o=[];var l=i.getNextSiblings(),a=$t(i)?null:i.getTopLevelElementOrThrow();if(fr(i))if(r=i.getTextContent().length,0===n&&0!==r)r=null!==(r=i.getPreviousSibling())?r:i.getParentOrThrow(),o.push(i);else if(n===r)r=i;else{if(i.isToken())return!1;[r,i]=i.splitText(n),o.push(i)}i=r,o.push(...l),l=e[0];var s=!1,u=null;for(let t=0;t<e.length;t++){var c=e[t];if($t(r)||po(r)||!mo(c)||c.isInline())s&&!mo(c)&&!po(c)&&$t(r.getParent())&&xe(28);else{if(c.is(l)){if(mo(r)&&r.isEmpty()&&r.canReplaceWith(c)){r.replace(c),r=c,s=!0;continue}if(lt(s=c.getFirstDescendant())){for(var d=s.getParentOrThrow();d.isInline();)d=d.getParentOrThrow();if(s=(u=d.getChildren()).length,mo(r)){var p=r.getFirstChild();for(let e=0;e<s;e++){let t=u[e];null===p?r.append(t):p.insertAfter(t),p=t}}else{for(p=s-1;0<=p;p--)r.insertAfter(u[p]);r=r.getParentOrThrow()}if(u=u[s-1],d.remove(),s=!0,d.is(c))continue}}fr(r)&&(null===a&&xe(27),r=a)}s=!1,mo(r)&&!r.isInline()?(u=c,po(c)&&!c.isInline()?r=r.insertAfter(c,!1):mo(c)?!c.canBeEmpty()&&c.isEmpty()||(vo(r)?(null!==(d=r.getChildAtIndex(n))?d.insertBefore(c):r.append(c),r=c):c.isInline()?(r.append(c),r=c):r=r.insertAfter(c,!1)):(null!==(d=r.getFirstChild())?d.insertBefore(c):r.append(c),r=c)):!mo(c)||mo(c)&&c.isInline()||po(r)&&!r.isInline()?(u=c,Er(this)&&po(c)&&(mo(r)||fr(r))&&!c.isInline()?(fr(r)?(d=r.getParentOrThrow(),[r]=r.splitText(n),r=r.getIndexWithinParent()+1):(d=r,r=n),[,r]=Kt(d,r),r=r.insertBefore(c)):r=r.insertAfter(c,!1)):(c=r.getParentOrThrow(),Xn(r)&&r.remove(),r=c,t--)}if(t&&(fr(i)?i.select():fr(e=r.getPreviousSibling())?e.select():(e=r.getIndexWithinParent(),r.getParentOrThrow().select(e,e))),mo(r)){if(e=fr(u)?u:mo(u)&&u.isInline()?u.getLastDescendant():r.getLastDescendant(),t||(null===e?r.select():fr(e)?""===e.getTextContent()?e.selectPrevious():e.select():e.selectNext()),0!==o.length)for(t=r,e=o.length-1;0<=e;e--)a=(n=o[e]).getParentOrThrow(),!mo(r)||Pr(n)||po(n)&&(!n.isInline()||n.isIsolated())?mo(r)||Pr(n)?mo(n)&&!n.canInsertAfter(r)?(mo(i=a.constructor.clone(a))||xe(29),i.append(n),r.insertAfter(i)):r.insertAfter(n):(r.insertBefore(n),r=n):(t===r?r.append(n):r.insertBefore(n),r=n),a.isEmpty()&&!a.canBeEmpty()&&a.remove()}else t||(fr(r)?r.select():(t=r.getParentOrThrow(),e=r.getIndexWithinParent()+1,t.select(e,e)));return!0}insertParagraph(){this.isCollapsed()||this.removeText();var e=this.anchor,t=e.offset,n=[];if("text"===e.type){var r=e.getNode(),o=r.getNextSiblings().reverse(),i=r.getParentOrThrow(),l=i.isInline(),a=l?i.getTextContentSize():r.getTextContentSize();0===t?o.push(r):(l&&(n=i.getNextSiblings()),t===a||l&&t===r.getTextContentSize()||([,r]=r.splitText(t),o.push(r)))}else{if($t(i=e.getNode()))return o=Co(),n=i.getChildAtIndex(t),o.select(),void(null!==n?n.insertBefore(o,!1):i.append(o));o=i.getChildren().slice(t).reverse()}if(r=o.length,0===t&&0<r&&i.isInline()){if(mo(o=(n=i.getParentOrThrow()).insertNewAfter(this,!1)))for(n=n.getChildren(),i=0;i<n.length;i++)o.append(n[i])}else if(null===(l=i.insertNewAfter(this,!1)))this.insertLineBreak();else if(mo(l))if(a=i.getFirstChild(),0===t&&(i.is(e.getNode())||a&&a.is(e.getNode()))&&0<r)i.insertBefore(l);else{if(i=null,t=n.length,e=l.getParentOrThrow(),0<t)for(a=0;a<t;a++)e.append(n[a]);if(0!==r)for(n=0;n<r;n++)t=o[n],null===i?l.append(t):i.insertBefore(t),i=t;l.canBeEmpty()||0!==l.getChildrenSize()?l.selectStart():(l.selectPrevious(),l.remove())}}insertLineBreak(e){let t=Jn();var n=this.anchor;"element"===n.type&&(vo(n=n.getNode())&&this.insertParagraph()),e?this.insertNodes([t],!0):this.insertNodes([t])&&t.selectNext(0,0)}getCharacterOffsets(){return Ar(this)}extract(){var e=this.getNodes(),t=e.length,n=t-1,r=this.anchor;let o=this.focus;var i=e[0];let l=e[n],[a,s]=Ar(this);return 0===t?[]:1===t?fr(i)&&!this.isCollapsed()?(e=a>s?s:a,n=i.splitText(e,a>s?a:s),null!=(e=0===e?n[0]:n[1])?[e]:[]):[i]:(t=r.isBefore(o),fr(i)&&((r=t?a:s)===i.getTextContentSize()?e.shift():0!==r&&([,i]=i.splitText(r),e[0]=i)),fr(l)&&(i=l.getTextContent().length,0===(t=t?s:a)?e.pop():t!==i&&([l]=l.splitText(t),e[n]=l)),e)}modify(e,t,n){var r=this.focus,o=this.anchor,i="move"===e,l=Nt(r,t);if(po(l)&&!l.isIsolated())i&&l.isKeyboardSelectable()?((t=Dr()).add(l.__key),bt(t)):fr(e=t?l.getPreviousSibling():l.getNextSibling())?(l=e.__key,t=t?e.getTextContent().length:0,r.set(l,t,"text"),i&&o.set(l,t,"text")):(n=l.getParentOrThrow(),mo(e)?(n=e.__key,l=t?e.getChildrenSize():0):(l=l.getIndexWithinParent(),n=n.__key,t||l++),r.set(n,l,"element"),i&&o.set(n,l,"element"));else if(r=jt((o=eo())._window)){var a=o._blockCursorElement,s=o._rootElement;if(null===s||null===a||!mo(l)||l.isInline()||l.canBeEmpty()||Wt(a,o,s),r.modify(e,t?"backward":"forward",n),0<r.rangeCount&&(l=r.getRangeAt(0),o=vo(o=this.anchor.getNode())?o:Dt(o),this.applyDOMRange(l),this.dirty=!0,!i)){for(i=this.getNodes(),e=[],n=!1,a=0;a<i.length;a++)Pt(s=i[a],o)?e.push(s):n=!0;n&&0<e.length&&(t?mo(t=e[0])?t.selectStart():t.getParentOrThrow().selectStart():mo(t=e[e.length-1])?t.selectEnd():t.getParentOrThrow().selectEnd()),r.anchorNode===l.startContainer&&r.anchorOffset===l.startOffset||(t=this.focus,r=(i=this.anchor).key,l=i.offset,o=i.type,xr(i,t.key,t.offset,t.type),xr(t,r,l,o),this._cachedNodes=null)}}}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){var n=this.anchor,r=this.focus,o=n.getNode();if(!e&&("element"===n.type&&mo(o)&&n.offset===o.getChildrenSize()||"text"===n.type&&n.offset===o.getTextContentSize())){var i=o.getParent();if(mo(i=o.getNextSibling()||(null===i?null:i.getNextSibling()))&&i.isShadowRoot())return}if(po(i=Nt(r,e))&&!i.isIsolated())return void(i.isKeyboardSelectable()&&mo(o)&&0===o.getChildrenSize()?(o.remove(),e=Dr(),e.add(i.__key),bt(e)):(i.remove(),eo().dispatchCommand(B,void 0)));if(!e&&mo(i)&&mo(o)&&o.isEmpty())return o.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===n.offset&&("element"===n.type?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(i="text"===r.type?r.getNode():null,o="text"===n.type?n.getNode():null,null!==i&&i.isSegmented()){if(n=r.offset,r=i.getTextContentSize(),i.is(o)||e&&n!==r||!e&&0!==n)return void Nr(i,e,n)}else if(null!==o&&o.isSegmented()&&(n=n.offset,r=o.getTextContentSize(),o.is(i)||e&&0!==n||!e&&n!==r))return void Nr(o,e,n);if(o=this.anchor,i=this.focus,(n=o.getNode())===(r=i.getNode())&&"text"===o.type&&"text"===i.type){var l=o.offset,a=i.offset;let t=l<a;(r=t?l:a)!==(l=(a=t?a:l)-1)&&(xt(n=n.getTextContent().slice(r,a))||(e?i.offset=l:o.offset=l))}}}this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset&&((e=this.anchor.getNode()).isEmpty()&&vo(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this))}deleteLine(e){this.isCollapsed()&&("text"===this.anchor.type&&this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){this.isCollapsed()&&this.modify("extend",e,"word"),this.removeText()}};function kr(e){return e instanceof _r}function Tr(e){let t=e.offset;return"text"===e.type?t:t===(e=e.getNode()).getChildrenSize()?e.getTextContent().length:0}function Ar(e){let t=e.anchor;return e=e.focus,"element"===t.type&&"element"===e.type&&t.key===e.key&&t.offset===e.offset?[0,0]:[Tr(t),Tr(e)]}function Nr(e,t,n){let r=e.getTextContent().split(/(?=\s)/g),o=r.length,i=0,l=0;for(let e=0;e<o;e++){let a=e===o-1;if(l=i,i+=r[e].length,t&&i===n||i>n||a){r.splice(e,1),a&&(l=void 0);break}}""===(t=r.join("").trim())?e.remove():(e.setTextContent(t),e.select(l,l))}function Rr(e,t,n,r){var o=t;if(1===e.nodeType){let a=!1;var i=e.childNodes,l=i.length;o===l&&(a=!0,o=l-1);let s=i[o];if(l=!1,s===r._blockCursorElement?(s=i[o+1],l=!0):null!==r._blockCursorElement&&o--,fr(r=yt(s)))o=a?r.getTextContentSize():0;else{if(null===(i=yt(e)))return null;if(mo(i)?((t=mo(e=i.getChildAtIndex(o)))&&(t=e.getParent(),t=null===n||null===t||!t.canBeEmpty()||t!==n.getNode()),t&&(null===(n=a?e.getLastDescendant():e.getFirstDescendant())?(i=e,o=0):i=mo(e=n)?e:e.getParentOrThrow()),fr(e)?(r=e,i=null,o=a?e.getTextContentSize():0):e!==i&&a&&!l&&o++):(o=i.getIndexWithinParent(),o=0===t&&po(i)&&yt(e)===i?o:o+1,i=i.getParentOrThrow()),mo(i))return new hr(i.__key,o,"element")}}else r=yt(e);return fr(r)?new hr(r.__key,o,"text"):null}function Or(e,t,n){var r=e.offset,o=e.getNode();0===r?(r=o.getPreviousSibling(),o=o.getParent(),t?(n||!t)&&null===r&&mo(o)&&o.isInline()&&(fr(t=o.getPreviousSibling())&&(e.key=t.__key,e.offset=t.getTextContent().length)):mo(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):fr(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)):r===o.getTextContent().length&&(r=o.getNextSibling(),o=o.getParent(),t&&mo(r)&&r.isInline()?(e.key=r.__key,e.offset=0,e.type="element"):(n||t)&&null===r&&mo(o)&&o.isInline()&&!o.canInsertTextAfter()&&(fr(t=o.getNextSibling())&&(e.key=t.__key,e.offset=0)))}function Mr(e,t,n){if("text"===e.type&&"text"===t.type){var r=e.isBefore(t);let o=e.is(t);Or(e,r,o),Or(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type),(r=eo()).isComposing()&&r._compositionKey!==e.key&&Er(n)&&(r=n.anchor,n=n.focus,xr(e,r.key,r.offset,r.type),xr(t,n.key,n.offset,n.type))}}function Lr(e,t,n,r,o,i){return null!==e&&null!==n&&tt(o,e,n)?null===(t=Rr(e,t,Er(i)?i.anchor:null,o))||null===(r=Rr(n,r,Er(i)?i.focus:null,o))||"element"===t.type&&"element"===r.type&&(e=yt(e),n=yt(n),po(e)&&po(n))?null:(Mr(t,r,i),[t,r]):null}function Pr(e){return mo(e)&&!e.isInline()}function Ir(e,t,n,r,o,i){let l=Zr();return(e=new Sr(new hr(e,t,o),new hr(n,r,i),0,"")).dirty=!0,l._selection=e}function Dr(){return new _r(new Set)}function $r(e,t,n){var r=n._window;if(null===r)return null;var o=r.event,i=o?o.type:void 0;let l;if(r="selectionchange"===i,o=!Fe&&(r||"beforeinput"===i||"compositionstart"===i||"compositionend"===i||"click"===i&&o&&3===o.detail||"drop"===i||void 0===i),Er(e)&&!o)return e.clone();if(null===t)return null;if(o=t.anchorNode,i=t.focusNode,l=t.anchorOffset,t=t.focusOffset,r&&Er(e)&&!tt(n,o,i))return e.clone();if(null===(n=Lr(o,l,i,t,n,e)))return null;let[a,s]=n;return new Sr(a,s,Er(e)?e.format:0,Er(e)?e.style:"")}function zr(){return Zr()._selection}function Br(){return eo()._editorState._selection}function Fr(e,t,n,r=1){var o=e.anchor,i=e.focus,l=o.getNode(),a=i.getNode();if(t.is(l)||t.is(a)){if(l=t.__key,e.isCollapsed())(n<=(t=o.offset)&&0<r||n<t&&0>r)&&(n=Math.max(0,t+r),o.set(l,n,"element"),i.set(l,n,"element"),Hr(e));else{let u=e.isBackward();var s=(a=u?i:o).getNode();i=(o=u?o:i).getNode(),t.is(s)&&((n<=(s=a.offset)&&0<r||n<s&&0>r)&&a.set(l,Math.max(0,s+r),"element")),t.is(i)&&((n<=(t=o.offset)&&0<r||n<t&&0>r)&&o.set(l,Math.max(0,t+r),"element"))}Hr(e)}}function Hr(e){var t=e.anchor,n=t.offset;let r=e.focus;var o=r.offset,i=t.getNode(),l=r.getNode();if(e.isCollapsed())mo(i)&&(fr(l=(o=n>=(l=i.getChildrenSize()))?i.getChildAtIndex(l-1):i.getChildAtIndex(n))&&(n=0,o&&(n=l.getTextContentSize()),t.set(l.__key,n,"text"),r.set(l.__key,n,"text")));else{if(mo(i)){let r=i.getChildrenSize();fr(n=(e=n>=r)?i.getChildAtIndex(r-1):i.getChildAtIndex(n))&&(i=0,e&&(i=n.getTextContentSize()),t.set(n.__key,i,"text"))}mo(l)&&(fr(o=(t=o>=(n=l.getChildrenSize()))?l.getChildAtIndex(n-1):l.getChildAtIndex(o))&&(l=0,t&&(l=o.getTextContentSize()),r.set(o.__key,l,"text")))}}function Wr(e,t,n,r,o){let i=null,l=0,a=null;null!==r?(i=r.__key,fr(r)?(l=r.getTextContentSize(),a="text"):mo(r)&&(l=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,fr(o)?a="text":mo(o)&&(a="element")),null!==i&&null!==a?e.set(i,l,a):(l=t.getIndexWithinParent(),-1===l&&(l=n.getChildrenSize()),e.set(n.__key,l,"element"))}function jr(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&--e.offset}function Kr(e,t,n){let r=[],o=null,i=null;e=e.getChildren();for(let c=0;c<e.length;c++){var l=e[c];Oo(l)||xe(108);var a=l.getChildren();l=0;for(let e of a){for(To(e)||xe(109);void 0!==r[c]&&void 0!==r[c][l];)l++;var s=l,u=e;let d={cell:u,startColumn:s,startRow:a=c},p=u.__rowSpan,f=u.__colSpan;for(let e=0;e<p;e++){void 0===r[a+e]&&(r[a+e]=[]);for(let t=0;t<f;t++)r[a+e][s+t]=d}t.is(u)&&(o=d),n.is(u)&&(i=d),l+=e.__colSpan}}return null===o&&xe(110),null===i&&xe(111),[r,o,i]}let Yr=null,Gr=null,Ur=!1,Vr=!1,Qr=0,Jr={characterData:!0,childList:!0,subtree:!0};function Xr(){return Ur||null!==Yr&&Yr._readOnly}function qr(){Ur&&xe(13)}function Zr(){return null===Yr&&xe(15),Yr}function eo(){return null===Gr&&xe(16),Gr}function to(e,t,n){var r=t.__type;let o=e._nodes.get(r);for(void 0===o&&xe(30,r),void 0===(e=n.get(r))&&(e=Array.from(o.transforms),n.set(r,e)),n=e.length,r=0;r<n&&(e[r](t),t.isAttached());r++);}function no(e,t){var n=e.type,r=t.get(n);if(void 0===r&&xe(17,n),n=r.klass,e.type!==n.getType()&&xe(18,n.name),n=n.importJSON(e),e=e.children,mo(n)&&Array.isArray(e))for(r=0;r<e.length;r++){let o=no(e[r],t);n.append(o)}return n}function ro(e,t){let n=Yr,r=Ur,o=Gr;Yr=e,Ur=!0,Gr=null;try{return t()}finally{Yr=n,Ur=r,Gr=o}}function oo(e,t){let n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null!==n){var i=e._editorState,l=i._selection,a=n._selection,s=0!==e._dirtyType,u=Yr,c=Ur,d=Gr,p=e._updating,f=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!o&&s&&null!==f){Gr=e,Yr=n,Ur=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,o=e._dirtyLeaves;f.disconnect();var g=r,h=o;ln=an=on="",sn=2===t,cn=null,Qt=e,Vt=e._config,Jt=e._nodes,Xt=Qt._listeners.mutation,qt=g,Zt=h,en=i._nodeMap,tn=n._nodeMap,un=n._readOnly,nn=new Map(e._keyToDOMMap);let l=new Map;rn=l,En("root",null),rn=nn=Vt=tn=en=Zt=qt=Jt=Qt=void 0,m=l}catch(t){if(t instanceof Error&&e._onError(t),Vr)throw t;return wo(e,null,r,n),Ge(e),e._dirtyType=2,Vr=!0,oo(e,i),void(Vr=!1)}finally{f.observe(r,Jr),e._updating=p,Yr=u,Ur=c,Gr=d}}n._readOnly||(n._readOnly=!0);var v=e._dirtyLeaves,b=e._dirtyElements,y=e._normalizedNodes,x=e._updateTags,_=e._deferred;s&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set);var E,C=e._decorators,w=e._pendingDecorators||C,S=n._nodeMap;for(E in w)S.has(E)||(w===C&&(w=gt(e)),delete w[E]);var k=o?null:jt(e._window);if(e._editable&&null!==k&&(s||null===a||a.dirty)){Gr=e,Yr=n;try{if(null!==f&&f.disconnect(),s||null===a||a.dirty){let t=e._blockCursorElement;null!==t&&Wt(t,e,r);e:{let t=k.anchorNode,n=k.focusNode,o=k.anchorOffset,i=k.focusOffset,s=document.activeElement;if(!(x.has("collaboration")&&s!==r||null!==s&&et(s)))if(Er(a)){var T=a.anchor,A=a.focus,N=T.key,R=A.key,O=Mt(e,N),M=Mt(e,R),L=T.offset,P=A.offset,I=a.format,D=a.style,$=a.isCollapsed(),z=O,F=M,H=!1;if("text"===T.type){z=ot(O);let e=T.getNode();H=e.getFormat()!==I||e.getStyle()!==D}else Er(l)&&"text"===l.anchor.type&&(H=!0);if("text"===A.type&&(F=ot(M)),null!==z&&null!==F){if($&&(null===l||H||Er(l)&&(l.format!==I||l.style!==D))){var W=performance.now();$n=[I,D,L,N,W]}if(o===L&&i===P&&t===z&&n===F&&("Range"!==k.type||!$)&&(null!==s&&r.contains(s)||r.focus({preventScroll:!0}),"element"!==T.type))break e;try{k.setBaseAndExtent(z,L,F,P)}catch(e){}if(!x.has("skip-scroll-into-view")&&a.isCollapsed()&&null!==r&&r===document.activeElement){let t=a instanceof Sr&&"element"===a.anchor.type?z.childNodes[L]||null:0<k.rangeCount?k.getRangeAt(0):null;if(null!==t){let n;if(t instanceof Text){let e=document.createRange();e.selectNode(t),n=e.getBoundingClientRect()}else n=t.getBoundingClientRect();let o=r.ownerDocument,i=o.defaultView;if(null!==i)for(var j,K,{top:Y,bottom:G}=n,U=r;null!==U;){let t=U===o.body;if(t)j=0,K=It(e).innerHeight;else{let e=U.getBoundingClientRect();j=e.top,K=e.bottom}let n=0;if(Y<j?n=-(j-Y):G>K&&(n=G-K),0!==n)if(t)i.scrollBy(0,n);else{let e=U.scrollTop;U.scrollTop+=n;let t=U.scrollTop-e;Y-=t,G-=t}if(t)break;U=Lt(U)}}}Ln=!0}}else null!==l&&tt(e,t,n)&&k.removeAllRanges()}}e:{let t=e._blockCursorElement;if(Er(a)&&a.isCollapsed()&&"element"===a.anchor.type&&r.contains(document.activeElement)){let n=a.anchor,o=n.getNode(),i=n.offset,l=o.getChildrenSize(),s=!1,u=null;if(i===l){Ht(o.getChildAtIndex(i-1))&&(s=!0)}else{let t=o.getChildAtIndex(i);if(Ht(t)){let n=t.getPreviousSibling();(null===n||Ht(n))&&(s=!0,u=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(o.__key);if(null===t){let n=e._config.theme,r=document.createElement("div");r.contentEditable="false",r.setAttribute("data-lexical-cursor","true");let o=n.blockCursor;if(void 0!==o){if("string"==typeof o){let e=o.split(" ");o=n.blockCursor=e}void 0!==o&&r.classList.add(...o)}e._blockCursorElement=t=r}r.style.caretColor="transparent",null===u?n.appendChild(t):n.insertBefore(t,u);break e}}null!==t&&Wt(t,e,r)}null!==f&&f.observe(r,Jr)}finally{Gr=d,Yr=u}}if(null!==m){var V=m;let t=Array.from(e._listeners.mutation),n=t.length;for(let e=0;e<n;e++){let[n,r]=t[e],o=V.get(r);void 0!==o&&n(o,{dirtyLeaves:v,updateTags:x})}}Er(a)||null===a||null!==l&&l.is(a)||e.dispatchCommand(B,void 0);var Q=e._pendingDecorators;null!==Q&&(e._decorators=Q,e._pendingDecorators=null,io("decorator",e,!0,Q));var J=ht(t||i),X=ht(n);if(J!==X&&io("textcontent",e,!0,X),io("update",e,!0,{dirtyElements:b,dirtyLeaves:v,editorState:n,normalizedNodes:y,prevEditorState:t||i,tags:x}),e._deferred=[],0!==_.length){let t=e._updating;e._updating=!0;try{for(let e=0;e<_.length;e++)_[e]()}finally{e._updating=t}}var q=e._updates;if(0!==q.length){let t=q.shift();if(t){let[n,r]=t;so(e,n,r)}}}}function io(e,t,n,...r){let o=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=o}}function lo(e,t,n){if(!1===e._updating||Gr!==e){let r=!1;return e.update((()=>{r=lo(e,t,n)})),r}let r=_t(e);for(let i=4;0<=i;i--)for(let l=0;l<r.length;l++){var o=r[l]._commands.get(t);if(void 0!==o&&void 0!==(o=o[i])){let t=(o=Array.from(o)).length;for(let r=0;r<t;r++)if(!0===o[r](n,e))return!0}}return!1}function ao(e,t){let n=e._updates;for(t=t||!1;0!==n.length;){var r=n.shift();if(r){let n,[o,i]=r;void 0!==i&&(r=i.onUpdate,n=i.tag,i.skipTransforms&&(t=!0),r&&e._deferred.push(r),n&&e._updateTags.add(n)),o()}}return t}function so(e,t,n){let r=e._updateTags;var o,i=o=!1;if(void 0!==n){var l=n.onUpdate;null!=(o=n.tag)&&r.add(o),o=n.skipTransforms||!1,i=n.discrete||!1}l&&e._deferred.push(l),n=e._editorState;let a=!1;(null===(l=e._pendingEditorState)||l._readOnly)&&(l=e._pendingEditorState=new xo(new Map((l||n)._nodeMap)),a=!0),l._flushSync=i,i=Yr;let s=Ur,u=Gr,c=e._updating;Yr=l,Ur=!1,e._updating=!0,Gr=e;try{a&&(e._headless?null!=n._selection&&(l._selection=n._selection.clone()):l._selection=function(e){let t=e.getEditorState()._selection,n=jt(e._window);return kr(t)||wr(t)?t.clone():$r(t,n,e)}(e));let r=e._compositionKey;t(),o=ao(e,o),function(e,t){if(t=t.getEditorState()._selection,Er(e=e._selection)){var n=e.anchor;let r,o=e.focus;"text"===n.type&&(r=n.getNode(),r.selectionTransform(t,e)),"text"===o.type&&r!==(n=o.getNode())&&n.selectionTransform(t,e)}}(l,e),0!==e._dirtyType&&(o?function(e,t){t=t._dirtyLeaves,e=e._nodeMap;for(let n of t)fr(t=e.get(n))&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Qe(t)}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements;e=e._nodeMap;let o=dt(),i=new Map;var l=n;let a=l.size;for(var s=r,u=s.size;0<a||0<u;){if(0<a){t._dirtyLeaves=new Set;for(let r of l)fr(l=e.get(r))&&l.isAttached()&&l.isSimpleText()&&!l.isUnmergeable()&&Qe(l),void 0!==l&&void 0!==l&&l.__key!==o&&l.isAttached()&&to(t,l,i),n.add(r);if(a=(l=t._dirtyLeaves).size,0<a){Qr++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(let n of s)s=n[0],u=n[1],("root"===s||u)&&(void 0!==(l=e.get(s))&&void 0!==l&&l.__key!==o&&l.isAttached()&&to(t,l,i),r.set(s,u));a=(l=t._dirtyLeaves).size,u=(s=t._dirtyElements).size,Qr++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),ao(e),function(e,t,n,r){e=e._nodeMap,t=t._nodeMap;let o=[];for(let[n]of r){let i=t.get(n);void 0===i||i.isAttached()||(mo(i)&&Ut(i,n,e,t,o,r),e.has(n)||r.delete(n),o.push(n))}for(let e of o)t.delete(e);for(let o of n)void 0===(r=t.get(o))||r.isAttached()||(e.has(o)||n.delete(o),t.delete(o))}(n,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Er(i)){let e=l._nodeMap,t=i.focus.key;void 0!==e.get(i.anchor.key)&&void 0!==e.get(t)||xe(19)}else kr(i)&&0===i._nodes.size&&(l._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=n,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void oo(e)}finally{Yr=i,Ur=s,Gr=u,e._updating=c,Qr=0}0!==e._dirtyType||function(e,t){if(t=t.getEditorState()._selection,e=e._selection,null!==e){if(e.dirty||!e.is(t))return!0}else if(null!==t)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,oo(e)):a&&Ze((()=>{oo(e)})):(l._flushSync=!1,a&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function uo(e,t,n){e._updating?e._updates.push([t,n]):so(e,t,n)}class co extends Un{constructor(e){super(e)}decorate(){xe(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function po(e){return e instanceof co}class fo extends Un{constructor(e){super(e),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return $e[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){let e=eo()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;null!==t;){if(fr(t)&&e.push(t),mo(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;null!==e;){if(mo(e)){let t=e.getFirstChild();if(null!==t){e=t;continue}}break}return e}getLastDescendant(){let e=this.getLastChild();for(;null!==e;){if(mo(e)){let t=e.getLastChild();if(null!==t){e=t;continue}}break}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;return e>=n?mo(e=t[n-1])&&e.getLastDescendant()||e||null:mo(e=t[e])&&e.getFirstDescendant()||e||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:pt(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&xe(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:pt(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&xe(96,this.__key),e}getChildAtIndex(e){var t=this.getChildrenSize();let n;if(e<t/2){for(n=this.getFirstChild(),t=0;null!==n&&t<=e;){if(t===e)return n;n=n.getNextSibling(),t++}return null}for(n=this.getLastChild(),--t;null!==n&&t>=e;){if(t===e)return n;n=n.getPreviousSibling(),t--}return null}getTextContent(){let e="",t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let o=t[r];e+=o.getTextContent(),mo(o)&&r!==n-1&&!o.isInline()&&(e+="\n\n")}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let o=t[r];e+=o.getTextContentSize(),mo(o)&&r!==n-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){return""!==e&&(e=De[e],0!=(this.getFormat()&e))}select(e,t){qr();let n=zr(),r=e,o=t;var i=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){if(fr(e=this.getFirstChild())||mo(e))return e.select(0,0)}else if(!(void 0!==e&&e!==i||void 0!==t&&t!==i)&&(fr(e=this.getLastChild())||mo(e)))return e.select();return void 0===r&&(r=i),void 0===o&&(o=i),i=this.__key,Er(n)?(n.anchor.set(i,r,"element"),n.focus.set(i,o,"element"),n.dirty=!0,n):Ir(i,r,i,o,"element","element")}selectStart(){let e=this.getFirstDescendant();return mo(e)||fr(e)?e.select(0,0):null!==e?e.selectPrevious():this.select(0,0)}selectEnd(){let e=this.getLastDescendant();return mo(e)||fr(e)?e.select():null!==e?e.selectNext():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?De[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){let r=n.length,o=this.getChildrenSize(),i=this.getWritable(),l=i.__key;var a=[],s=[];let u=this.getChildAtIndex(e+t),c=null,d=o-t+r;if(0!==e)if(e===o)c=this.getLastChild();else{var p=this.getChildAtIndex(e);null!==p&&(c=p.getPreviousSibling())}if(0<t){var f=null===c?this.getFirstChild():c.getNextSibling();for(p=0;p<t;p++){null===f&&xe(100);var m=f.getNextSibling(),g=f.__key;st(f=f.getWritable()),s.push(g),f=m}}for(p=c,m=0;m<r;m++){g=n[m],null!==p&&g.is(p)&&(c=p=p.getPreviousSibling()),(f=g.getWritable()).__parent===l&&d--,st(f);let e=g.__key;null===p?(i.__first=e,f.__prev=null):((p=p.getWritable()).__next=e,f.__prev=p.__key),g.__key===l&&xe(76),f.__parent=l,a.push(e),p=g}if(e+t===o?null!==p&&(p.getWritable().__next=null,i.__last=p.__key):null!==u&&(e=u.getWritable(),null!==p?(t=p.getWritable(),e.__prev=p.__key,t.__next=u.__key):e.__prev=null),i.__size=d,s.length&&Er(e=zr())){s=new Set(s),a=new Set(a);let{anchor:t,focus:n}=e;go(t,s,a)&&Wr(t,t.getNode(),this,c,u),go(n,s,a)&&Wr(n,n.getNode(),this,c,u),0!==d||this.canBeEmpty()||$t(this)||this.remove()}return i}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 mo(e){return e instanceof fo}function go(e,t,n){for(e=e.getNode();e;){let r=e.__key;if(t.has(r)&&!n.has(r))return!0;e=e.getParent()}return!1}class ho extends fo{static getType(){return"root"}static clone(){return new ho}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){xe(51)}getTextContent(){let e=this.__cachedText;return!Xr()&&0!==eo()._dirtyType||null===e?super.getTextContent():e}remove(){xe(52)}replace(){xe(53)}insertBefore(){xe(54)}insertAfter(){xe(55)}updateDOM(){return!1}append(...e){for(let t=0;t<e.length;t++){let n=e[t];mo(n)||po(n)||xe(56)}return super.append(...e)}static importJSON(e){let t=vt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function vo(e){return e instanceof ho}function bo(){return new xo(new Map([["root",new ho]]))}function yo(e){let t=e.exportJSON();var n=e.constructor;t.type!==n.getType()&&xe(130,n.name);let r=t.children;if(mo(e))for(Array.isArray(r)||xe(59,n.name),e=e.getChildren(),n=0;n<e.length;n++){let t=yo(e[n]);r.push(t)}return t}class xo{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._readOnly=this._flushSync=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return ro(this,e)}clone(e){return(e=new xo(this._nodeMap,void 0===e?this._selection:e))._readOnly=!0,e}toJSON(){return ro(this,(()=>({root:yo(vt())})))}}class _o extends fo{static getType(){return"paragraph"}static clone(e){return new _o(e.__key)}createDOM(e){let t=document.createElement("p");return void 0!==(e=kt(e.theme,"paragraph"))&&t.classList.add(...e),t}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Eo,priority:0})}}exportDOM(e){if(({element:e}=super.exportDOM(e)),e&&this.isEmpty()&&e.append(document.createElement("br")),e){var t=this.getFormatType();e.style.textAlign=t,(t=this.getDirection())&&(e.dir=t),0<(t=this.getIndent())&&(e.style.textIndent=20*t+"px")}return{element:e}}static importJSON(e){let t=Co();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(e,t){e=Co();let n=this.getDirection();return e.setDirection(n),this.insertAfter(e,t),e}collapseAtStart(){let e=this.getChildren();if(0===e.length||fr(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Eo(e){let t=Co();return e.style&&(t.setFormat(e.style.textAlign),0<(e=parseInt(e.style.textIndent,10)/20)&&t.setIndent(e)),{node:t}}function Co(){return Bt(new _o)}function wo(e,t,n,r){let o=e._keyToDOMMap;o.clear(),e._editorState=bo(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null,null!==(r=e._observer)&&(r.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class So{constructor(e,t,n,r,o,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,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=r,this._nodes=n,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=Et(),this._onError=o,this._htmlConversions=i,this._editable=l,this._headless=null!==t&&t._headless,this._blockCursorElement=this._window=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&xe(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let o=r.get(e);void 0===o&&xe(36,String(e));let i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){void 0===this._nodes.get(e.getType())&&xe(37,e.name);let n=this._listeners.mutation;return n.set(t,e),()=>{n.delete(t)}}registerNodeTransformToKlass(e,t){var n=e.getType();return void 0===(n=this._nodes.get(n))&&xe(37,e.name),n.transforms.add(t),n}registerNodeTransform(e,t){var n=this.registerNodeTransformToKlass(e,t);let r=[n];return null!=(n=n.replaceWithKlass)&&(n=this.registerNodeTransformToKlass(n,t),r.push(n)),function(e,t){uo(e,(()=>{var e=Zr();if(!e.isEmpty())if("root"===t)vt().markDirty();else{e=e._nodeMap;for(let[,t]of e)t.markDirty()}}),null===e._pendingEditorState?{tag:"history-merge"}:void 0)}(this,e.getType()),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return lo(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let i=kt(this._config.theme,"root");var n=this._pendingEditorState||this._editorState;if(this._rootElement=e,wo(this,t,e,n),null!==t){if(!this._config.disableEvents){0!==Mn&&(Mn--,0===Mn&&t.ownerDocument.removeEventListener("selectionchange",Yn));var r=t.__lexicalEditor;if(null!=r){if(null!==r._parentEditor){var o=_t(r);o=o[o.length-1]._key,Kn.get(o)===r&&Kn.delete(o)}else Kn.delete(r._key);t.__lexicalEditor=null}for(r=jn(t),o=0;o<r.length;o++)r[o]();t.__lexicalEventHandles=[]}null!=i&&t.classList.remove(...i)}null!==e?(n=(n=e.ownerDocument)&&n.defaultView||null,(r=e.style).userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=n,this._dirtyType=2,Ge(this),this._updateTags.add("history-merge"),oo(this),this._config.disableEvents||function(e,t){0===Mn&&e.ownerDocument.addEventListener("selectionchange",Yn),Mn++,e.__lexicalEditor=t;let n=jn(e);for(let r=0;r<Tn.length;r++){let[o,i]=Tn[r],l="function"==typeof i?e=>{!0!==e._lexicalHandled&&(e._lexicalHandled=!0,t.isEditable()&&i(e,t))}:e=>{if(!0!==e._lexicalHandled&&(e._lexicalHandled=!0,t.isEditable()))switch(o){case"cut":return lo(t,he,e);case"copy":return lo(t,ge,e);case"paste":return lo(t,Y,e);case"dragstart":return lo(t,pe,e);case"dragover":return lo(t,fe,e);case"dragend":return lo(t,me,e);case"focus":return lo(t,ve,e);case"blur":return lo(t,be,e);case"drop":return lo(t,de,e)}};e.addEventListener(o,l),n.push((()=>{e.removeEventListener(o,l)}))}}(e,this),null!=i&&e.classList.add(...i)):(this._editorState=n,this._window=this._pendingEditorState=null),io("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&xe(38),Ye(this);let n=this._pendingEditorState,r=this._updateTags;t=void 0!==t?t.tag:null,null===n||n.isEmpty()||(null!=t&&r.add(t),oo(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=t&&r.add(t),oo(this)}parseEditorState(e,t){e="string"==typeof e?JSON.parse(e):e;let n=bo(),r=Yr,o=Ur,i=Gr,l=this._dirtyElements,a=this._dirtyLeaves,s=this._cloneNotNeeded,u=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,Yr=n,Ur=!1,Gr=this;try{no(e.root,this._nodes),t&&t(),n._readOnly=!0}catch(e){e instanceof Error&&this._onError(e)}finally{this._dirtyElements=l,this._dirtyLeaves=a,this._cloneNotNeeded=s,this._dirtyType=u,Yr=r,Ur=o,Gr=i}return n}update(e,t){uo(this,e,t)}focus(e,t={}){let n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),uo(this,(()=>{let e=zr(),n=vt();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){var e=this._rootElement;null!==e&&e.blur(),null!==(e=jt(this._window))&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,io("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}class ko extends fo{constructor(e,t){super(t),this.__colSpan=e,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}}function To(e){return e instanceof ko}class Ao extends fo{}function No(e){return e instanceof Ao}class Ro extends fo{}function Oo(e){return e instanceof Ro}z.$addUpdateTag=function(e){qr(),eo()._updateTags.add(e)},z.$applyNodeReplacement=Bt,z.$copyNode=zt,z.$createLineBreakNode=Jn,z.$createNodeSelection=Dr,z.$createParagraphNode=Co,z.$createRangeSelection=function(){let e=new hr("root",0,"element"),t=new hr("root",0,"element");return new Sr(e,t,0,"")},z.$createTabNode=gr,z.$createTextNode=pr,z.$getAdjacentNode=Nt,z.$getNearestNodeFromDOMNode=mt,z.$getNearestRootOrShadowRoot=Dt,z.$getNodeByKey=pt,z.$getPreviousSelection=Br,z.$getRoot=vt,z.$getSelection=zr,z.$getTextContent=function(){let e=zr();return null===e?"":e.getTextContent()},z.$hasAncestor=Pt,z.$hasUpdateTag=function(e){return eo()._updateTags.has(e)},z.$insertNodes=function(e,t){let n=zr()||Br();return null===n&&(n=vt().selectEnd()),n.insertNodes(e,t)},z.$isBlockElementNode=Pr,z.$isDecoratorNode=po,z.$isElementNode=mo,z.$isInlineElementOrDecoratorNode=function(e){return mo(e)&&e.isInline()||po(e)&&e.isInline()},z.$isLeafNode=lt,z.$isLineBreakNode=Xn,z.$isNodeSelection=kr,z.$isParagraphNode=function(e){return e instanceof _o},z.$isRangeSelection=Er,z.$isRootNode=vo,z.$isRootOrShadowRoot=$t,z.$isTabNode=function(e){return e instanceof mr},z.$isTextNode=fr,z.$nodesOfType=function(e){var t=Zr();let n=t._readOnly,r=e.getType();t=t._nodeMap;let o=[];for(let[,i]of t)i instanceof e&&i.__type===r&&(n||i.isAttached())&&o.push(i);return o},z.$normalizeSelection__EXPERIMENTAL=Je,z.$parseSerializedNode=function(e){return no(e,eo()._nodes)},z.$setCompositionKey=ct,z.$setSelection=bt,z.$splitNode=Kt,z.BLUR_COMMAND=be,z.CAN_REDO_COMMAND={},z.CAN_UNDO_COMMAND={},z.CLEAR_EDITOR_COMMAND={},z.CLEAR_HISTORY_COMMAND={},z.CLICK_COMMAND=F,z.COMMAND_PRIORITY_CRITICAL=4,z.COMMAND_PRIORITY_EDITOR=0,z.COMMAND_PRIORITY_HIGH=3,z.COMMAND_PRIORITY_LOW=1,z.COMMAND_PRIORITY_NORMAL=2,z.CONTROLLED_TEXT_INSERTION_COMMAND=K,z.COPY_COMMAND=ge,z.CUT_COMMAND=he,z.DELETE_CHARACTER_COMMAND=H,z.DELETE_LINE_COMMAND=V,z.DELETE_WORD_COMMAND=U,z.DEPRECATED_$computeGridMap=Kr,z.DEPRECATED_$createGridSelection=function(){let e=new hr("root",0,"element"),t=new hr("root",0,"element");return new Cr("root",e,t)},z.DEPRECATED_$getNodeTriplet=function(e){e instanceof ko||(e instanceof Un?To(e=Yt(e,To))||xe(114):To(e=Yt(e.getNode(),To))||xe(114));let t=e.getParent();Oo(t)||xe(115);let n=t.getParent();return No(n)||xe(116),[e,t,n]},z.DEPRECATED_$isGridCellNode=To,z.DEPRECATED_$isGridNode=No,z.DEPRECATED_$isGridRowNode=Oo,z.DEPRECATED_$isGridSelection=wr,z.DEPRECATED_GridCellNode=ko,z.DEPRECATED_GridNode=Ao,z.DEPRECATED_GridRowNode=Ro,z.DRAGEND_COMMAND=me,z.DRAGOVER_COMMAND=fe,z.DRAGSTART_COMMAND=pe,z.DROP_COMMAND=de,z.DecoratorNode=co,z.ElementNode=fo,z.FOCUS_COMMAND=ve,z.FORMAT_ELEMENT_COMMAND={},z.FORMAT_TEXT_COMMAND=Q,z.INDENT_CONTENT_COMMAND={},z.INSERT_LINE_BREAK_COMMAND=W,z.INSERT_PARAGRAPH_COMMAND=j,z.INSERT_TAB_COMMAND={},z.KEY_ARROW_DOWN_COMMAND=oe,z.KEY_ARROW_LEFT_COMMAND=te,z.KEY_ARROW_RIGHT_COMMAND=Z,z.KEY_ARROW_UP_COMMAND=re,z.KEY_BACKSPACE_COMMAND=ae,z.KEY_DELETE_COMMAND=ue,z.KEY_DOWN_COMMAND=q,z.KEY_ENTER_COMMAND=ie,z.KEY_ESCAPE_COMMAND=se,z.KEY_MODIFIER_COMMAND=ye,z.KEY_SPACE_COMMAND=le,z.KEY_TAB_COMMAND=ce,z.LineBreakNode=Vn,z.MOVE_TO_END=ee,z.MOVE_TO_START=ne,z.OUTDENT_CONTENT_COMMAND={},z.PASTE_COMMAND=Y,z.ParagraphNode=_o,z.REDO_COMMAND=X,z.REMOVE_TEXT_COMMAND=G,z.RootNode=ho,z.SELECTION_CHANGE_COMMAND=B,z.TabNode=mr,z.TextNode=rr,z.UNDO_COMMAND=J,z.createCommand=function(){return{}},z.createEditor=function(e){var t=e||{},n=Gr,r=t.theme||{};let o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,l=bo(),a=t.namespace||(null!==o?o._config.namespace:Et()),s=t.editorState,u=[ho,rr,Vn,mr,_o,...t.nodes||[]],c=t.onError;if(t=void 0===t.editable||t.editable,void 0===e&&null!==n)e=n._nodes;else for(e=new Map,n=0;n<u.length;n++){let t=u[n],r=null;var d=null;"function"!=typeof t&&(t=(d=t).replace,r=d.with,d=d.withKlass?d.withKlass:null);let o=t.getType(),i=t.transform(),l=new Set;null!==i&&l.add(i),e.set(o,{klass:t,replace:r,replaceWithKlass:d,transforms:l})}return r=new So(l,o,e,{disableEvents:i,namespace:a,theme:r},c||console.error,function(e){let t=new Map,n=new Set;return e.forEach((e=>{if(null!=(e=null!=e.klass.importDOM?e.klass.importDOM.bind(e.klass):null)&&!n.has(e)){n.add(e);var r=e();null!==r&&Object.keys(r).forEach((e=>{let n=t.get(e);void 0===n&&(n=[],t.set(e,n)),n.push(r[e])}))}})),t}(e),t),void 0!==s&&(r._pendingEditorState=s,r._dirtyType=2),r},z.getNearestEditorFromDOMNode=nt,z.isSelectionCapturedInDecoratorInput=et,z.isSelectionWithinEditor=tt;var Mo=z,Lo=Mo;let Po=new Map;function Io(e){for(;null!=e;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function Do(e){let t=e.parentNode;if(null==t)throw Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function $o(e){let t={};e=e.split(";");for(let n of e)if(""!==n){let[e,r]=n.split(/:([^]+)/);t[e.trim()]=r.trim()}return t}function zo(e){let t=Po.get(e);return void 0===t&&(t=$o(e),Po.set(e,t)),t}function Bo(e,t){var n=zo("getStyle"in e?e.getStyle():e.style);t=Object.entries(t).reduce(((e,[t,n])=>(null===n?delete e[t]:e[t]=n,e)),{...n}),n=function(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}(t),e.setStyle(n),Po.set(n,t)}function Fo(e){for(;null!==e&&!Lo.$isRootOrShadowRoot(e);){let t=e.getLatest(),n=e.getParent();0===t.getChildrenSize()&&e.remove(!0),e=n}}function Ho(e,t,n,r,o=null){if(0!==t.length){var i=t[0],l=new Map,a=[];(i=Lo.$isElementNode(i)?i:i.getParentOrThrow()).isInline()&&(i=i.getParentOrThrow());for(var s=!1;null!==i;){var u=i.getPreviousSibling();if(null!==u){i=u,s=!0;break}if(i=i.getParentOrThrow(),Lo.$isRootOrShadowRoot(i))break}u=new Set;for(var c=0;c<n;c++){var d=t[c];Lo.$isElementNode(d)&&0===d.getChildrenSize()&&u.add(d.getKey())}var p=new Set;for(c=0;c<n;c++){var f=(d=t[c]).getParent();if(null!==f&&f.isInline()&&(f=f.getParent()),null!==f&&Lo.$isLeafNode(d)&&!p.has(d.getKey())){if(d=f.getKey(),void 0===l.get(d)){let e=r();e.setFormat(f.getFormatType()),e.setIndent(f.getIndent()),a.push(e),l.set(d,e),f.getChildren().forEach((t=>{e.append(t),p.add(t.getKey()),Lo.$isElementNode(t)&&t.getChildrenKeys().forEach((e=>p.add(e)))})),Fo(f)}}else u.has(d.getKey())&&((f=r()).setFormat(d.getFormatType()),f.setIndent(d.getIndent()),a.push(f),d.remove(!0))}if(null!==o)for(t=0;t<a.length;t++)o.append(a[t]);if(t=null,Lo.$isRootOrShadowRoot(i))if(s)if(null!==o)i.insertAfter(o);else for(o=a.length-1;0<=o;o--)i.insertAfter(a[o]);else if(s=i.getFirstChild(),Lo.$isElementNode(s)&&(i=s),null===s)if(o)i.append(o);else for(o=0;o<a.length;o++)s=a[o],i.append(s),t=s;else if(null!==o)s.insertBefore(o);else for(i=0;i<a.length;i++)o=a[i],s.insertBefore(o),t=o;else if(o)i.insertAfter(o);else for(o=a.length-1;0<=o;o--)s=a[o],i.insertAfter(s),t=s;a=Lo.$getPreviousSelection(),Lo.$isRangeSelection(a)&&a.anchor.getNode().isAttached()&&a.focus.getNode().isAttached()?Lo.$setSelection(a.clone()):null!==t?t.selectEnd():e.dirty=!0}}function Wo(e,t,n,r){e.modify(t?"extend":"move",n,r)}function jo(e){return e=e.anchor.getNode(),"rtl"===(Lo.$isRootNode(e)?e:e.getParentOrThrow()).getDirection()}$.$addNodeStyle=function(e){let t=$o(e=e.getStyle());Po.set(e,t)},$.$cloneWithProperties=function(e){let t=(e=e.getLatest()).constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,Lo.$isElementNode(e)&&Lo.$isElementNode(t)?(t.__first=e.__first,t.__last=e.__last,t.__size=e.__size,t.__format=e.__format,t.__indent=e.__indent,t.__dir=e.__dir,t):(Lo.$isTextNode(e)&&Lo.$isTextNode(t)&&(t.__format=e.__format,t.__style=e.__style,t.__mode=e.__mode,t.__detail=e.__detail),t)},$.$getSelectionStyleValueForProperty=function(e,t,n=""){let r=null,o=e.getNodes();var i=e.anchor,l=e.focus,a=e.isBackward();let s=a?l.offset:i.offset;if(i=a?l.getNode():i.getNode(),""!==e.style&&(null!==(e=zo(e.style))&&t in e))return e[t];for(e=0;e<o.length;e++){var u=o[e];if((0===e||0!==s||!u.is(i))&&Lo.$isTextNode(u))if(l=t,a=n,l=null!==(u=zo(u=u.getStyle()))&&u[l]||a,null===r)r=l;else if(r!==l){r="";break}}return null===r?n:r},$.$isAtNodeEnd=function(e){return"text"===e.type?e.offset===e.getNode().getTextContentSize():e.offset===e.getNode().getChildrenSize()},$.$isParentElementRTL=jo,$.$moveCaretSelection=Wo,$.$moveCharacter=function(e,t,n){let r=jo(e);Wo(e,t,n?!r:r,"character")},$.$patchStyleText=function(e,t){var n=e.getNodes();let r=n.length-1,o=n[0],i=n[r];if(e.isCollapsed())Bo(e,t);else{var l=e.anchor,a=e.focus,s=o.getTextContent().length,u=a.offset,c=l.offset,d=l.isBefore(a),p=d?c:u;e=d?u:c;var f=d?l.type:a.type,m=d?a.type:l.type;if(l=d?a.key:l.key,Lo.$isTextNode(o)&&p===s&&(a=o.getNextSibling(),Lo.$isTextNode(a)&&(p=c=0,o=a)),1===n.length)Lo.$isTextNode(o)&&((p="element"===f?0:c>u?u:c)!==(e="element"===m?s:c>u?c:u)&&(0===p&&e===s?(Bo(o,t),o.select(p,e)):(n=o.splitText(p,e),Bo(n=0===p?n[0]:n[1],t),n.select(0,e-p))));else for(Lo.$isTextNode(o)&&p<o.getTextContentSize()&&(0!==p&&(o=o.splitText(p)[1]),Bo(o,t)),Lo.$isTextNode(i)&&(p=i.getTextContent().length,i.__key!==l&&0!==e&&(e=p),e!==p&&([i]=i.splitText(e)),0!==e&&Bo(i,t)),e=1;e<r;e++)s=(p=n[e]).getKey(),Lo.$isTextNode(p)&&s!==o.getKey()&&s!==i.getKey()&&!p.isToken()&&Bo(p,t)}},$.$selectAll=function(e){let t=e.anchor;e=e.focus;var n=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let r=n.getFirstDescendant();n=n.getLastDescendant();let o="element",i="element",l=0;Lo.$isTextNode(r)?o="text":Lo.$isElementNode(r)||null===r||(r=r.getParentOrThrow()),Lo.$isTextNode(n)?(i="text",l=n.getTextContentSize()):Lo.$isElementNode(n)||null===n||(n=n.getParentOrThrow()),r&&n&&(t.set(r.getKey(),0,o),e.set(n.getKey(),l,i))},$.$setBlocksType=function(e,t){if("root"===e.anchor.key){t=t();var n=Lo.$getRoot();(e=n.getFirstChild())?e.replace(t,!0):n.append(t)}else for(n=e.getNodes(),e=e.anchor.getNode().getParentOrThrow(),-1===n.indexOf(e)&&n.push(e),e.isInline()&&(e=e.getParentOrThrow(),-1===n.indexOf(e)&&n.push(e)),e=0;e<n.length;e++){let i=n[e];var r=i;if(!Lo.$isElementNode(r)||Lo.$isRootOrShadowRoot(r))r=!1;else{var o=r.getFirstChild();o=null===o||Lo.$isTextNode(o)||o.isInline(),r=!r.isInline()&&!1!==r.canBeEmpty()&&o}r&&((r=t()).setFormat(i.getFormatType()),r.setIndent(i.getIndent()),i.replace(r,!0))}},$.$shouldOverrideDefaultCharacterSelection=function(e,t){return e=Lo.$getAdjacentNode(e.focus,t),Lo.$isDecoratorNode(e)&&!e.isIsolated()||Lo.$isElementNode(e)&&!e.isInline()&&!e.canBeEmpty()},$.$sliceSelectedTextNodeContent=function(e,t){if(t.isSelected()&&!t.isSegmented()&&!t.isToken()&&(Lo.$isRangeSelection(e)||Lo.DEPRECATED_$isGridSelection(e))){var n=e.anchor.getNode(),r=e.focus.getNode(),o=t.is(n),i=t.is(r);if(o||i){o=e.isBackward();let l,[a,s]=e.getCharacterOffsets();e=n.is(r),i=t.is(o?r:n),r=t.is(o?n:r),n=0,e?(n=a>s?s:a,l=a>s?a:s):i?(n=o?s:a,l=void 0):r&&(n=0,l=o=o?a:s),t.__text=t.__text.slice(n,l)}}return t},$.$wrapNodes=function(e,t,n=null){var r=e.getNodes();let o=r.length;var i=e.anchor;if(0===o||1===o&&"element"===i.type&&0===i.getNode().getChildrenSize()){r=(e="text"===i.type?i.getNode().getParentOrThrow():i.getNode()).getChildren();let o=t();o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),r.forEach((e=>o.append(e))),n&&(o=n.append(o)),e.replace(o)}else{i=null;var l=[];for(let a=0;a<o;a++){let o=r[a];Lo.$isRootOrShadowRoot(o)?(Ho(e,l,l.length,t,n),l=[],i=o):null===i||null!==i&&Lo.$hasAncestor(o,i)?l.push(o):(Ho(e,l,l.length,t,n),l=[o])}Ho(e,l,l.length,t,n)}},$.createDOMRange=function(e,t,n,r,o){let i=t.getKey(),l=r.getKey(),a=document.createRange(),s=e.getElementByKey(i);if(e=e.getElementByKey(l),Lo.$isTextNode(t)&&(s=Io(s)),Lo.$isTextNode(r)&&(e=Io(e)),void 0===t||void 0===r||null===s||null===e)return null;"BR"===s.nodeName&&([s,n]=Do(s)),"BR"===e.nodeName&&([e,o]=Do(e)),t=s.firstChild,s===e&&null!=t&&"BR"===t.nodeName&&0===n&&0===o&&(o=1);try{a.setStart(s,n),a.setEnd(e,o)}catch(e){return null}return!a.collapsed||n===o&&i===l||(a.setStart(e,o),a.setEnd(s,n)),a},$.createRectsFromDOMRange=function(e,t){var n=e.getRootElement();if(null===n)return[];e=n.getBoundingClientRect(),n=getComputedStyle(n),n=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight);let r,o=(t=Array.from(t.getClientRects())).length;t.sort(((e,t)=>{let n=e.top-t.top;return 3>=Math.abs(n)?e.left-t.left:n}));for(let i=0;i<o;i++){let l=t[i],a=l.width+n===e.width;r&&r.top<=l.top&&r.top+r.height>l.top&&r.left+r.width>l.left||a?(t.splice(i--,1),o--):r=l}return t},$.getStyleObjectFromCSS=zo,$.trimTextContentFromAnchor=function(e,t,n){let r=t.getNode();if(Lo.$isElementNode(r)){var o=r.getDescendantByIndex(t.offset);null!==o&&(r=o)}for(;0<n&&null!==r;){var i=r.getPreviousSibling(),l=0;if(null===i){for(var a=(o=r.getParentOrThrow()).getPreviousSibling();null===a;){if(null===(o=o.getParent())){i=null;break}a=o.getPreviousSibling()}null!==o&&(l=o.isInline()?0:2,i=Lo.$isElementNode(a)?a.getLastDescendant():a)}if(""===(a=r.getTextContent())&&Lo.$isElementNode(r)&&!r.isInline()&&(a="\n\n"),o=r.getTextContentSize(),!Lo.$isTextNode(r)||n>=o)a=r.getParent(),r.remove(),null==a||0!==a.getChildrenSize()||Lo.$isRootNode(a)||a.remove(),n-=o+l,r=i;else{let s=r.getKey();l=e.getEditorState().read((()=>{const e=Lo.$getNodeByKey(s);return Lo.$isTextNode(e)&&e.isSimpleText()?e.getTextContent():null})),i=o-n;let u=a.slice(0,i);null!==l&&l!==a?(n=Lo.$getPreviousSelection(),o=r,r.isSimpleText()?r.setTextContent(l):(o=Lo.$createTextNode(l),r.replace(o)),Lo.$isRangeSelection(n)&&n.isCollapsed()&&(n=n.anchor.offset,o.select(n,n))):r.isSimpleText()?(l=t.key===s,(a=t.offset)<n&&(a=o),n=l?a-n:0,o=l?a:i,l&&0===n?([n]=r.splitText(n,o),n.remove()):([,n]=r.splitText(n,o),n.remove())):(n=Lo.$createTextNode(u),r.replace(n)),n=0}}};var Ko=$,Yo=Ko,Go=Mo;function Uo(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function Vo(e,t){for(;e!==Go.$getRoot()&&null!=e;){if(t(e))return e;e=e.getParent()}return null}function Qo(e){return 1===e.nodeType}D.$splitNode=Go.$splitNode,D.$dfs=function(e,t){let n=[];e=(e||Go.$getRoot()).getLatest(),t=t||(Go.$isElementNode(e)?e.getLastDescendant():e);for(var r=e,o=0;null!==(r=r.getParent());)o++;for(r=o;null!==e&&!e.is(t);)if(n.push({depth:r,node:e}),Go.$isElementNode(e)&&0<e.getChildrenSize())e=e.getFirstChild(),r++;else for(o=null;null===o&&null!==e;)null===(o=e.getNextSibling())?(e=e.getParent(),r--):e=o;return null!==e&&e.is(t)&&n.push({depth:r,node:e}),n},D.$findMatchingParent=Vo,D.$getNearestBlockElementAncestorOrThrow=function(e){let t=Vo(e,(e=>Go.$isElementNode(e)&&!e.isInline()));return Go.$isElementNode(t)||function(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(4,e.__key),t},D.$getNearestNodeOfType=function(e,t){for(;null!=e;){if(e instanceof t)return e;e=e.getParent()}return null},D.$insertNodeToNearestRoot=function(e){var t=Go.$getSelection()||Go.$getPreviousSelection();if(Go.$isRangeSelection(t)){var{focus:n}=t;if(t=n.getNode(),n=n.offset,Go.$isRootOrShadowRoot(t))null==(n=t.getChildAtIndex(n))?t.append(e):n.insertBefore(e),e.selectNext();else{let r,o;Go.$isTextNode(t)?(r=t.getParentOrThrow(),o=t.getIndexWithinParent(),0<n&&(o+=1,t.splitText(n))):(r=t,o=n),[,t]=Go.$splitNode(r,o),t.insertBefore(e),t.selectStart()}}else Go.$isNodeSelection(t)||Go.DEPRECATED_$isGridSelection(t)?(t=t.getNodes())[t.length-1].getTopLevelElementOrThrow().insertAfter(e):Go.$getRoot().append(e),t=Go.$createParagraphNode(),e.insertAfter(t),t.select();return e.getLatest()},D.$restoreEditorState=function(e,t){let n=new Map,r=e._pendingEditorState;for(let[e,r]of t._nodeMap){let t=Yo.$cloneWithProperties(r);Go.$isTextNode(t)&&(t.__text=r.__text),n.set(e,t)}r&&(r._nodeMap=n),e._dirtyType=2,e=t._selection,Go.$setSelection(null===e?null:e.clone())},D.$wrapNodeInElement=function(e,t){return t=t(),e.replace(t),t.append(e),t},D.addClassNamesToElement=function(e,...t){t.forEach((t=>{"string"==typeof t&&(t=t.split(" ").filter((e=>""!==e)),e.classList.add(...t))}))},D.isHTMLAnchorElement=function(e){return Qo(e)&&"A"===e.tagName},D.isHTMLElement=Qo,D.isMimeType=Uo,D.mediaFileReader=function(e,t){let n=e[Symbol.iterator]();return new Promise(((e,r)=>{let o=[],i=()=>{const{done:l,value:a}=n.next();if(l)return e(o);const s=new FileReader;s.addEventListener("error",r),s.addEventListener("load",(()=>{const e=s.result;"string"==typeof e&&o.push({file:a,result:e}),i()})),Uo(a,t)?s.readAsDataURL(a):i()};i()}))},D.mergeRegister=function(...e){return()=>{e.forEach((e=>e()))}},D.objectKlassEquals=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name},D.registerNestedElementResolver=function(e,t,n,r){return e.registerNodeTransform(t,(e=>{e:{for(var o=e.getChildren(),i=0;i<o.length;i++)if(o[i]instanceof t){o=null;break e}for(o=e;null!==o;)if(i=o,(o=o.getParent())instanceof t){o={child:i,parent:o};break e}o=null}if(null!==o){const{child:t,parent:l}=o;if(t.is(e)){if(r(l,e),o=(e=t.getNextSiblings()).length,l.insertAfter(t),0!==o){i=n(l),t.insertAfter(i);for(let t=0;t<o;t++)i.append(e[t])}l.canBeEmpty()||0!==l.getChildrenSize()||l.remove()}}}))},D.removeClassNamesFromElement=function(e,...t){t.forEach((t=>{"string"==typeof t&&e.classList.remove(...t.split(" "))}))};var Jo=D,Xo=Jo,qo=Mo;let Zo=new Set(["http:","https:","mailto:","sms:","tel:"]),ei=class e extends qo.ElementNode{static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e,t={},n){super(n);let{target:r=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=r,this.__rel=o,this.__title=i}createDOM(e){let t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),Xo.addClassNamesToElement(t,e.theme.link),t}updateDOM(e,t){let n=this.__url,r=this.__target,o=this.__rel,i=this.__title;return n!==e.__url&&(t.href=n),r!==e.__target&&(r?t.target=r:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),i!==e.__title&&(i?t.title=i:t.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:ti,priority:1})}}static importJSON(e){let t=ni(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{let t=new URL(e);if(!Zo.has(t.protocol))return"about:blank"}catch(e){}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){return e=this.getParentOrThrow().insertNewAfter(e,t),qo.$isElementNode(e)?(t=ni(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),e.append(t),t):null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t){if(!qo.$isRangeSelection(t))return!1;e=t.anchor.getNode();let n=t.focus.getNode();return this.isParentOf(e)&&this.isParentOf(n)&&0<t.getTextContent().length}};function ti(e){let t=null;if(Xo.isHTMLAnchorElement(e)){let n=e.textContent;null!==n&&""!==n&&(t=ni(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function ni(e,t){return qo.$applyNodeReplacement(new ei(e,t))}function ri(e){return e instanceof ei}let oi=class e extends ei{static getType(){return"autolink"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}static importJSON(e){let t=ii(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(e,t=!0){return e=this.getParentOrThrow().insertNewAfter(e,t),qo.$isElementNode(e)?(t=ii(this.__url,{rel:this._rel,target:this.__target,title:this.__title}),e.append(t),t):null}};function ii(e,t){return qo.$applyNodeReplacement(new oi(e,t))}let li=qo.createCommand("TOGGLE_LINK_COMMAND");I.$createAutoLinkNode=ii,I.$createLinkNode=ni,I.$isAutoLinkNode=function(e){return e instanceof oi},I.$isLinkNode=ri,I.AutoLinkNode=oi,I.LinkNode=ei,I.TOGGLE_LINK_COMMAND=li,I.toggleLink=function(e,t={}){let{target:n,title:r}=t,o=void 0===t.rel?"noreferrer":t.rel;if(t=qo.$getSelection(),qo.$isRangeSelection(t))if(t=t.extract(),null===e)t.forEach((e=>{if(ri(e=e.getParent())){let t=e.getChildren();for(let n=0;n<t.length;n++)e.insertBefore(t[n]);e.remove()}}));else{if(1===t.length){var i=t[0];if(i=ri(i)?i:function(e,t){for(;null!==e&&null!==(e=e.getParent())&&!t(e););return e}(i,ri),null!==i)return i.setURL(e),void 0!==n&&i.setTarget(n),null!==o&&i.setRel(o),void(void 0!==r&&i.setTitle(r))}let l=null,a=null;t.forEach((t=>{var i=t.getParent();if(i!==a&&null!==i&&(!qo.$isElementNode(t)||t.isInline()))if(ri(i))a=i,i.setURL(e),void 0!==n&&i.setTarget(n),null!==o&&a.setRel(o),void 0!==r&&a.setTitle(r);else if(i.is(l)||(l=i,a=ni(e,{rel:o,target:n}),ri(i)?null===t.getPreviousSibling()?i.insertBefore(a):i.insertAfter(a):t.insertBefore(a)),ri(t)){if(!t.is(a)){if(null!==a){i=t.getChildren();for(let e=0;e<i.length;e++)a.append(i[e])}t.remove()}}else null!==a&&a.append(t)}))}};var ai=I,si={},ui=Mo,ci=Jo;function di(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function pi(e){let t=1;for(e=e.getParent();null!=e;){if(Ai(e)){if(Ii(e=e.getParent())){t++,e=e.getParent();continue}di(40)}break}return t}function fi(e){Ii(e=e.getParent())||di(40);let t=e;for(;null!==t;)t=t.getParent(),Ii(t)&&(e=t);return e}function mi(e){let t=[];e=e.getChildren().filter(Ai);for(let n=0;n<e.length;n++){let r=e[n],o=r.getFirstChild();Ii(o)?t=t.concat(mi(o)):t.push(r)}return t}function gi(e){return Ai(e)&&Ii(e.getFirstChild())}function hi(e){return Ti().append(e)}function vi(e,t){return Ai(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function bi(e,t){e.splice(e.getChildrenSize(),0,t)}function yi(e,t){if(Ii(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),o=Ti();return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),bi(o,e.getChildren()),Ii(n)&&t===n.getListType()?(n.append(o),e.remove(),Ii(r)&&t===r.getListType()&&(bi(n,r.getChildren()),r.remove()),n):Ii(r)&&t===r.getListType()?(r.getFirstChildOrThrow().insertBefore(o),e.remove(),r):((t=Pi(t)).append(o),e.replace(t),_i(t),t)}function xi(e,t){var n=e.getLastChild();let r=t.getFirstChild();n&&r&&gi(n)&&gi(r)&&(xi(n.getFirstChild(),r.getFirstChild()),r.remove()),0<(n=t.getChildren()).length&&(e.append(...n),_i(e)),t.remove()}function _i(e,t){if(void 0!==(e=t||e.getChildren()))for(t=0;t<e.length;t++){let i=e[t];if(Ai(i)){let e=i.getValue();var n=i,r=n.getParent(),o=1;for(null!=r&&(Ii(r)?o=r.getStart():di(44)),n=n.getPreviousSiblings(),r=0;r<n.length;r++){let e=n[r];Ai(e)&&!Ii(e.getFirstChild())&&o++}e!==o&&i.setValue(o)}}}function Ei(e){if(!gi(e)){var t=e.getParent(),n=t?t.getParent():void 0,r=n?n.getParent():void 0;if(Ii(r)&&Ai(n)&&Ii(t)){var o=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(o))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{var l=t.getListType();o=Ti();let r=Pi(l);o.append(r),e.getPreviousSiblings().forEach((e=>r.append(e))),i=Ti(),l=Pi(l),i.append(l),bi(l,e.getNextSiblings()),n.insertBefore(o),n.insertAfter(i),n.replace(e)}_i(t),_i(r)}}}let Ci=class e extends ui.ElementNode{static getType(){return"listitem"}static clone(t){return new e(t.__value,t.__checked,t.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){let t=document.createElement("li"),n=this.getParent();return Ii(n)&&"check"===n.getListType()&&Si(t,this,null),t.value=this.__value,wi(t,e.theme,this),t}updateDOM(e,t,n){let r=this.getParent();return Ii(r)&&"check"===r.getListType()&&Si(t,this,e),t.value=this.__value,wi(t,n.theme,this),!1}static transform(){return e=>{let t=e.getParent();Ii(t)&&(_i(t),"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:ki,priority:0})}}static importJSON(e){let t=Ti();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(ui.$isElementNode(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Ai(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!Ii(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=Pi(n.getListType()),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&this.getChildren().forEach((t=>{e.append(t)})),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){var n=this.getParentOrThrow();Ii(n)||di(39);var r=this.getNextSiblings();if(Ai(e))return t=super.insertAfter(e,t),Ii(e=e.getParentOrThrow())&&_i(e),t;if(Ii(e)){for(n=e,r=(e=e.getChildren()).length-1;0<=r;r--)n=e[r],this.insertAfter(n,t);return n}if(n.insertAfter(e,t),0!==r.length){let o=Pi(n.getListType());r.forEach((e=>o.append(e))),e.insertAfter(o,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&gi(t)&&gi(n)?(xi(t.getFirstChild(),n.getFirstChild()),n.remove()):n&&(Ii(e=n.getParent())&&_i(e))}insertNewAfter(e,t=!0){return e=Ti(null==this.__checked&&void 0),this.insertAfter(e,t),e}collapseAtStart(e){let t=ui.$createParagraphNode();this.getChildren().forEach((e=>t.append(e)));var n=this.getParentOrThrow(),r=n.getParentOrThrow();let o=Ai(r);return 1===n.getChildrenSize()?o?(n.remove(),r.select()):(n.insertBefore(t),n.remove(),n=e.anchor,e=e.focus,r=t.getKey(),"element"===n.type&&n.getNode().is(this)&&n.set(r,n.offset,"element"),"element"===e.type&&e.getNode().is(this)&&e.set(r,e.offset,"element")):(n.insertBefore(t),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){return this.getLatest().__checked}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var e=this.getParent();if(null===e)return this.getLatest().__indent;e=e.getParentOrThrow();let t=0;for(;Ai(e);)e=e.getParentOrThrow().getParentOrThrow(),t++;return t}setIndent(e){"number"==typeof e&&-1<e||di(117);let t=this.getIndent();for(;t!==e;)if(t<e){e:{var n=new Set;if(gi(this)||n.has(this.getKey()))break e;let e=this.getParent();var r=this.getNextSibling(),o=this.getPreviousSibling();if(gi(r)&&gi(o)){if(Ii(o=o.getFirstChild())){o.append(this);var i=r.getFirstChild();Ii(i)&&(bi(o,i=i.getChildren()),r.remove(),n.add(r.getKey())),_i(o)}}else gi(r)?Ii(r=r.getFirstChild())&&(null!==(n=r.getFirstChild())&&n.insertBefore(this),_i(r)):gi(o)?Ii(r=o.getFirstChild())&&(r.append(this),_i(r)):Ii(e)&&(n=Ti(),i=Pi(e.getListType()),n.append(i),i.append(this),o?o.insertAfter(n):r?r.insertBefore(n):e.append(n),_i(i));Ii(e)&&_i(e)}t++}else Ei(this),t--;return this}insertBefore(e){if(Ai(e)){let e=this.getParentOrThrow();if(Ii(e)){_i(e,this.getNextSiblings())}}return super.insertBefore(e)}canInsertAfter(e){return Ai(e)}canReplaceWith(e){return Ai(e)}canMergeWith(e){return ui.$isParagraphNode(e)||Ai(e)}extractWithChild(e,t){if(!ui.$isRangeSelection(t))return!1;e=t.anchor.getNode();let n=t.focus.getNode();return this.isParentOf(e)&&this.isParentOf(n)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Pi("bullet")}};function wi(e,t,n){let r=[],o=[];var i=(t=t.list)?t.listitem:void 0;if(t&&t.nested)var l=t.nested.listitem;if(void 0!==i&&(i=i.split(" "),r.push(...i)),t){i=Ii(i=n.getParent())&&"check"===i.getListType();let e=n.getChecked();i&&!e||o.push(t.listitemUnchecked),i&&e||o.push(t.listitemChecked),i&&r.push(e?t.listitemChecked:t.listitemUnchecked)}void 0!==l&&(l=l.split(" "),n.getChildren().some((e=>Ii(e)))?r.push(...l):o.push(...l)),0<o.length&&ci.removeClassNamesFromElement(e,...o),0<r.length&&ci.addClassNamesToElement(e,...r)}function Si(e,t,n){Ii(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function ki(e){return{node:Ti(e=ci.isHTMLElement(e)&&"true"===e.getAttribute("aria-checked"))}}function Ti(e){return ui.$applyNodeReplacement(new Ci(void 0,e))}function Ai(e){return e instanceof Ci}let Ni=class e extends ui.ElementNode{static getType(){return"list"}static clone(t){return new e(t.__listType||Li[t.__tag],t.__start,t.__key)}constructor(e,t,n){super(n),this.__listType=e=Li[e]||e,this.__tag="number"===e?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){let t=this.getWritable();t.__listType=e,t.__tag="number"===e?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e){let t=document.createElement(this.__tag);return 1!==this.__start&&t.setAttribute("start",String(this.__start)),t.__lexicalListType=this.__listType,Ri(t,e.theme,this),t}updateDOM(e,t,n){return e.__tag!==this.__tag||(Ri(t,n.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:Mi,priority:0}),ul:()=>({conversion:Mi,priority:0})}}static importJSON(e){let t=Pi(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){return({element:e}=super.exportDOM(e)),e&&(1!==this.__start&&e.setAttribute("start",String(this.__start)),"check"===this.__listType&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let n=0;n<e.length;n++){var t=e[n];if(Ai(t))super.append(t);else{let e=Ti();Ii(t)?e.append(t):ui.$isElementNode(t)?(t=ui.$createTextNode(t.getTextContent()),e.append(t)):e.append(t),super.append(e)}}return _i(this),this}extractWithChild(e){return Ai(e)}};function Ri(e,t,n){let r=[],o=[];var i=t.list;if(void 0!==i){let e=i[`${n.__tag}Depth`]||[],a=(t=pi(n)-1)%e.length;var l=e[a];let s,u=i[n.__tag];if(void 0!==(i=i.nested)&&i.list&&(s=i.list),void 0!==u&&r.push(u),void 0!==l)for(l=l.split(" "),r.push(...l),l=0;l<e.length;l++)l!==a&&o.push(n.__tag+l);void 0!==s&&(n=s.split(" "),1<t?r.push(...n):o.push(...n))}0<o.length&&ci.removeClassNamesFromElement(e,...o),0<r.length&&ci.addClassNamesToElement(e,...r)}function Oi(e){let t=[];for(let r=0;r<e.length;r++){var n=e[r];Ai(n)?(t.push(n),1<(n=n.getChildren()).length&&n.forEach((e=>{Ii(e)&&t.push(hi(e))}))):t.push(hi(n))}return t}function Mi(e){let t=e.nodeName.toLowerCase(),n=null;return"ol"===t?n=Pi("number",e.start):"ul"===t&&(n=ci.isHTMLElement(e)&&"check"===e.getAttribute("__lexicallisttype")?Pi("check"):Pi("bullet")),{after:Oi,node:n}}let Li={ol:"number",ul:"bullet"};function Pi(e,t=1){return ui.$applyNodeReplacement(new Ni(e,t))}function Ii(e){return e instanceof Ni}let Di=ui.createCommand("INSERT_UNORDERED_LIST_COMMAND"),$i=ui.createCommand("INSERT_ORDERED_LIST_COMMAND"),zi=ui.createCommand("INSERT_CHECK_LIST_COMMAND"),Bi=ui.createCommand("REMOVE_LIST_COMMAND");si.$createListItemNode=Ti,si.$createListNode=Pi,si.$getListDepth=pi,si.$handleListInsertParagraph=function(){var e=ui.$getSelection();if(!ui.$isRangeSelection(e)||!e.isCollapsed())return!1;if(!Ai(e=e.anchor.getNode())||""!==e.getTextContent())return!1;var t=fi(e),n=e.getParent();Ii(n)||di(40);let r,o=n.getParent();if(ui.$isRootOrShadowRoot(o))r=ui.$createParagraphNode(),t.insertAfter(r);else{if(!Ai(o))return!1;r=Ti(),o.insertAfter(r)}if(r.select(),0<(t=e.getNextSiblings()).length){let e=Pi(n.getListType());ui.$isParagraphNode(r)?r.insertAfter(e):((n=Ti()).append(e),r.insertAfter(n)),t.forEach((t=>{t.remove(),e.append(t)}))}return function(e){for(;null==e.getNextSibling()&&null==e.getPreviousSibling();){let t=e.getParent();if(null==t||!Ai(e)&&!Ii(e))break;e=t}e.remove()}(e),!0},si.$isListItemNode=Ai,si.$isListNode=Ii,si.INSERT_CHECK_LIST_COMMAND=zi,si.INSERT_ORDERED_LIST_COMMAND=$i,si.INSERT_UNORDERED_LIST_COMMAND=Di,si.ListItemNode=Ci,si.ListNode=Ni,si.REMOVE_LIST_COMMAND=Bi,si.insertList=function(e,t){e.update((()=>{var e=ui.$getSelection();if(ui.$isRangeSelection(e)||ui.DEPRECATED_$isGridSelection(e)){var n=e.getNodes(),r=(e=e.anchor.getNode()).getParent();if(vi(e,n))n=Pi(t),ui.$isRootOrShadowRoot(r)?(e.replace(n),r=Ti(),ui.$isElementNode(e)&&(r.setFormat(e.getFormatType()),r.setIndent(e.getIndent())),n.append(r)):Ai(e)&&(bi(n,(e=e.getParentOrThrow()).getChildren()),e.replace(n));else for(e=new Set,r=0;r<n.length;r++){var o=n[r];if(ui.$isElementNode(o)&&o.isEmpty()&&!e.has(o.getKey()))yi(o,t);else if(ui.$isLeafNode(o))for(o=o.getParent();null!=o;){let n=o.getKey();if(Ii(o)){if(!e.has(n)){var i=Pi(t);bi(i,o.getChildren()),o.replace(i),_i(i),e.add(n)}break}if(i=o.getParent(),ui.$isRootOrShadowRoot(i)&&!e.has(n)){e.add(n),yi(o,t);break}o=i}}}}))},si.removeList=function(e){e.update((()=>{let e=ui.$getSelection();if(ui.$isRangeSelection(e)){var t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(vi(r,n))t.add(fi(r));else for(r=0;r<n.length;r++){var o=n[r];ui.$isLeafNode(o)&&(null!=(o=ci.$getNearestNodeOfType(o,Ci))&&t.add(fi(o)))}for(let r of t){t=r,n=mi(r);for(let r of n)bi(n=ui.$createParagraphNode(),r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&e.anchor.set(n.getKey(),0,"element"),r.__key===e.focus.key&&e.focus.set(n.getKey(),0,"element"),r.remove();r.remove()}}}))};var Fi=si,Hi={},Wi={},ji=g;let Ki=ji.createContext(null);Wi.LexicalComposerContext=Ki,Wi.createLexicalComposerContext=function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},Wi.useLexicalComposerContext=function(){let e=ji.useContext(Ki);return null==e&&function(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e};var Yi=Wi,Gi=Yi,Ui=Mo,Vi=g;let Qi="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;var Ji=Qi?Vi.useLayoutEffect:Vi.useEffect;let Xi={tag:"history-merge"};Hi.LexicalComposer=function({initialConfig:e,children:t}){let n=Vi.useMemo((()=>{const{theme:t,namespace:n,editor__DEPRECATED:r,nodes:o,onError:i,editorState:l}=e,a=Gi.createLexicalComposerContext(null,t);let s=r||null;if(null===s){const r=Ui.createEditor({editable:e.editable,namespace:n,nodes:o,onError:e=>i(e,r),theme:t});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{var t=Ui.$getRoot();if(t.isEmpty()){let n=Ui.$createParagraphNode();t.append(n),t=Qi?document.activeElement:null,(null!==Ui.$getSelection()||null!==t&&t===e.getRootElement())&&n.select()}}),Xi);else if(null!==t)switch(typeof t){case"string":let n=e.parseEditorState(t);e.setEditorState(n,Xi);break;case"object":e.setEditorState(t,Xi);break;case"function":e.update((()=>{Ui.$getRoot().isEmpty()&&t(e)}),Xi)}}(r,l),s=r}return[s,a]}),[]);return Ji((()=>{let t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),Vi.createElement(Gi.LexicalComposerContext.Provider,{value:n},t)};var qi=Hi,Zi={},el={},tl=Jo,nl=Mo;function rl(e,t){let n=Date.now(),r=0;return(o,i,l,a,s,u)=>{let c=Date.now();if(u.has("historic"))return r=0,n=c,2;let d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;var i=t._selection,l=e._selection;if(o)return 1;if(!(nl.$isRangeSelection(i)&&nl.$isRangeSelection(l)&&l.isCollapsed()&&i.isCollapsed()))return 0;o=t._nodeMap;let a=[];for(let e of n)void 0!==(n=o.get(e))&&a.push(n);for(let[e,t]of r)t&&(void 0===(r=o.get(e))||nl.$isRootNode(r)||a.push(r));return 0===a.length?0:1<a.length?(t=(r=t._nodeMap).get(i.anchor.key),l=r.get(l.anchor.key),t&&l&&!e._nodeMap.has(t.__key)&&nl.$isTextNode(t)&&1===t.__text.length&&1===i.anchor.offset?2:0):(t=a[0],e=e._nodeMap.get(t.__key),nl.$isTextNode(e)&&nl.$isTextNode(t)&&e.__mode===t.__mode?(e=e.__text)===(t=t.__text)?0:(i=i.anchor,l=l.anchor,i.key!==l.key||"text"!==i.type?0:(i=i.offset,l=l.offset,1==(e=t.length-e.length)&&l===i-1?2:-1===e&&l===i+1?3:-1===e&&l===i?4:0)):0)}(o,i,a,s,e.isComposing()),p=(()=>{var p=null===l||l.editor===e,f=u.has("history-push");if(!f&&p&&u.has("history-merge"))return 0;if(null===o)return 1;var m=i._selection;if(!(0<a.size||0<s.size))return null!==m?0:2;if(!1===f&&0!==d&&d===r&&c<n+t&&p)return 0;if(1===a.size){{f=Array.from(a)[0],p=o._nodeMap.get(f),f=i._nodeMap.get(f),m=o._selection;let e=i._selection,t=!1;nl.$isRangeSelection(m)&&nl.$isRangeSelection(e)&&(t="element"===m.anchor.type&&"element"===m.focus.type&&"text"===e.anchor.type&&"text"===e.focus.type),p=!(t||!nl.$isTextNode(p)||!nl.$isTextNode(f))&&(p.__type===f.__type&&p.__text===f.__text&&p.__mode===f.__mode&&p.__detail===f.__detail&&p.__style===f.__style&&p.__format===f.__format&&p.__parent===f.__parent)}if(p)return 0}return 1})();return n=c,r=d,p}}el.createEmptyHistoryState=function(){return{current:null,redoStack:[],undoStack:[]}},el.registerHistory=function(e,t,n){let r=rl(e,n);n=({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:l,tags:a})=>{const s=t.current,u=t.redoStack,c=t.undoStack,d=null===s?null:s.editorState;if(null===s||n!==d){if(1===(o=r(o,n,s,i,l,a)))0!==u.length&&(t.redoStack=[],e.dispatchCommand(nl.CAN_REDO_COMMAND,!1)),null!==s&&(c.push({...s}),e.dispatchCommand(nl.CAN_UNDO_COMMAND,!0));else if(2===o)return;t.current={editor:e,editorState:n}}};let o=tl.mergeRegister(e.registerCommand(nl.UNDO_COMMAND,(()=>{let n=t.redoStack,r=t.undoStack;if(0!==r.length){let o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(nl.CAN_REDO_COMMAND,!0)),0===r.length&&e.dispatchCommand(nl.CAN_UNDO_COMMAND,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}return!0}),nl.COMMAND_PRIORITY_EDITOR),e.registerCommand(nl.REDO_COMMAND,(()=>{let n=t.redoStack;var r=t.undoStack;if(0!==n.length){let o=t.current;null!==o&&(r.push(o),e.dispatchCommand(nl.CAN_UNDO_COMMAND,!0)),r=n.pop(),0===n.length&&e.dispatchCommand(nl.CAN_REDO_COMMAND,!1),t.current=r||null,r&&r.editor.setEditorState(r.editorState,{tag:"historic"})}return!0}),nl.COMMAND_PRIORITY_EDITOR),e.registerCommand(nl.CLEAR_EDITOR_COMMAND,(()=>(t.undoStack=[],t.redoStack=[],t.current=null,!1)),nl.COMMAND_PRIORITY_EDITOR),e.registerCommand(nl.CLEAR_HISTORY_COMMAND,(()=>(t.undoStack=[],t.redoStack=[],t.current=null,e.dispatchCommand(nl.CAN_REDO_COMMAND,!1),e.dispatchCommand(nl.CAN_UNDO_COMMAND,!1),!0)),nl.COMMAND_PRIORITY_EDITOR),e.registerUpdateListener(n)),i=e.registerUpdateListener(n);return()=>{o(),i()}};var ol=Yi,il=el,ll=g;Zi.createEmptyHistoryState=il.createEmptyHistoryState,Zi.HistoryPlugin=function({externalHistoryState:e}){let[t]=ol.useLexicalComposerContext();return function(e,t,n=1e3){let r=ll.useMemo((()=>t||il.createEmptyHistoryState()),[t]);ll.useEffect((()=>il.registerHistory(e,r,n)),[n,e,r])}(t,e),null};var al=Zi,sl={},ul=Fi,cl=Yi,dl=g,pl=Jo,fl=Mo;sl.ListPlugin=function(){let[e]=cl.useLexicalComposerContext();return dl.useEffect((()=>{if(!e.hasNodes([ul.ListNode,ul.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[e]),function(e){dl.useEffect((()=>pl.mergeRegister(e.registerCommand(ul.INSERT_ORDERED_LIST_COMMAND,(()=>(ul.insertList(e,"number"),!0)),fl.COMMAND_PRIORITY_LOW),e.registerCommand(ul.INSERT_UNORDERED_LIST_COMMAND,(()=>(ul.insertList(e,"bullet"),!0)),fl.COMMAND_PRIORITY_LOW),e.registerCommand(ul.REMOVE_LIST_COMMAND,(()=>(ul.removeList(e),!0)),fl.COMMAND_PRIORITY_LOW),e.registerCommand(fl.INSERT_PARAGRAPH_COMMAND,(()=>!!ul.$handleListInsertParagraph()),fl.COMMAND_PRIORITY_LOW))),[e])}(e),null};var ml=sl,gl={},hl=Yi,vl=Jo,bl=Mo,yl=g;function xl(e){return e.registerCommand(bl.KEY_TAB_COMMAND,(t=>{let n=bl.$getSelection();return!!bl.$isRangeSelection(n)&&(t.preventDefault(),t=function(e){var t=e.getNodes();if(0<function(e,t){let n=[];for(let r=0;r<e.length;r++){let o=t(e[r]);null!==o&&n.push(o)}return n}(t,(e=>bl.$isBlockElementNode(e)&&e.canIndent()?e:null)).length)return!0;if(t=e.anchor,t=(e=(e=e.focus).isBefore(t)?e:t).getNode(),(t=vl.$getNearestBlockElementAncestorOrThrow(t)).canIndent()){t=t.getKey();let n=bl.$createRangeSelection();if(n.anchor.set(t,0,"element"),n.focus.set(t,0,"element"),n=bl.$normalizeSelection__EXPERIMENTAL(n),n.anchor.is(e))return!0}return!1}(n)?t.shiftKey?bl.OUTDENT_CONTENT_COMMAND:bl.INDENT_CONTENT_COMMAND:bl.INSERT_TAB_COMMAND,e.dispatchCommand(t,void 0))}),bl.COMMAND_PRIORITY_EDITOR)}gl.TabIndentationPlugin=function(){let[e]=hl.useLexicalComposerContext();return yl.useEffect((()=>xl(e))),null},gl.registerTabIndentation=xl;var _l=gl,El={},Cl={},wl={},Sl=Ko,kl=Mo;function Tl(e,t,n,r=null){let o=null==r||t.isSelected(r),i=kl.$isElementNode(t)&&t.excludeFromCopy("html");var l=t;null!==r&&(l=Sl.$cloneWithProperties(t),l=kl.$isTextNode(l)&&null!=r?Sl.$sliceSelectedTextNodeContent(r,l):l);let a=kl.$isElementNode(l)?l.getChildren():[],{element:s,after:u}=l.exportDOM(e);if(!s)return!1;let c=document.createDocumentFragment();for(let n=0;n<a.length;n++){let i=a[n],l=Tl(e,i,c,r);!o&&kl.$isElementNode(t)&&l&&t.extractWithChild(i,r,"html")&&(o=!0)}return o&&!i?(s.append(c),n.append(s),u&&(e=u.call(l,s))&&s.replaceWith(e)):n.append(c),o}let Al=new Set(["STYLE","SCRIPT"]);function Nl(e,t,n=new Map,r){let o=[];if(Al.has(e.nodeName))return o;let i=null;var l,{nodeName:a}=e,s=t._htmlConversions.get(a.toLowerCase());if(a=null,void 0!==s)for(l of s)null!==(s=l(e))&&(null===a||a.priority<s.priority)&&(a=s);if(a=(l=null!==a?a.conversion:null)?l(e):null,l=null,null!==a){if(l=a.after,s=a.node,i=Array.isArray(s)?s[s.length-1]:s,null!==i){for(var[,u]of n)if(i=u(i,r),!i)break;i&&o.push(...Array.isArray(s)?s:[i])}null!=a.forChild&&n.set(e.nodeName,a.forChild)}for(e=e.childNodes,r=[],u=0;u<e.length;u++)r.push(...Nl(e[u],t,new Map(n),i));return null!=l&&(r=l(r)),null==i?o=o.concat(r):kl.$isElementNode(i)&&i.append(...r),o}wl.$generateHtmlFromNodes=function(e,t){if("undefined"==typeof document||"undefined"==typeof window)throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),r=kl.$getRoot().getChildren();for(let o=0;o<r.length;o++)Tl(e,r[o],n,t);return n.innerHTML},wl.$generateNodesFromDOM=function(e,t){t=t.body?t.body.childNodes:[];let n=[];for(let o=0;o<t.length;o++){var r=t[o];Al.has(r.nodeName)||null!==(r=Nl(r,e))&&(n=n.concat(r))}return n};var Rl=wl,Ol=Ko,Ml=Jo,Ll=Mo;function Pl(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let Il="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Dl(e){let t=Ll.$getSelection();if(null==t)throw Error("Expected valid LexicalSelection");return Ll.$isRangeSelection(t)&&t.isCollapsed()||0===t.getNodes().length?"":Rl.$generateHtmlFromNodes(e,t)}function $l(e){let t=Ll.$getSelection();if(null==t)throw Error("Expected valid LexicalSelection");return Ll.$isRangeSelection(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(Fl(e,t))}function zl(e,t,n){(Ll.DEPRECATED_$isGridSelection(n)||null!==Ml.$findMatchingParent(n.anchor.getNode(),(e=>Ll.DEPRECATED_$isGridCellNode(e)))&&null!==Ml.$findMatchingParent(n.focus.getNode(),(e=>Ll.DEPRECATED_$isGridCellNode(e))))&&1===t.length&&Ll.DEPRECATED_$isGridNode(t[0])?function(e,t,n,r){1===e.length&&Ll.DEPRECATED_$isGridNode(e[0])||Pl(42);var o=e[0];e=o.getChildren(),n=o.getFirstChildOrThrow().getChildrenSize();var i=o.getChildrenSize(),l=Ml.$findMatchingParent(t.anchor.getNode(),(e=>Ll.DEPRECATED_$isGridCellNode(e)));t=(o=l&&Ml.$findMatchingParent(l,(e=>Ll.DEPRECATED_$isGridRowNode(e))))&&Ml.$findMatchingParent(o,(e=>Ll.DEPRECATED_$isGridNode(e))),Ll.DEPRECATED_$isGridCellNode(l)&&Ll.DEPRECATED_$isGridRowNode(o)&&Ll.DEPRECATED_$isGridNode(t)||Pl(43);var a=o.getIndexWithinParent(),s=Math.min(t.getChildrenSize()-1,a+i-1);let u,c;i=l.getIndexWithinParent(),l=Math.min(o.getChildrenSize()-1,i+n-1),n=Math.min(i,l),o=Math.min(a,s),i=Math.max(i,l),a=Math.max(a,s),s=t.getChildren(),l=0;for(let t=o;t<=a;t++){var d=s[t];Ll.DEPRECATED_$isGridRowNode(d)||Pl(24);var p=e[l];Ll.DEPRECATED_$isGridRowNode(p)||Pl(24),d=d.getChildren(),p=p.getChildren();let r=0;for(let e=n;e<=i;e++){let l=d[e];Ll.DEPRECATED_$isGridCellNode(l)||Pl(25);let s=p[r];Ll.DEPRECATED_$isGridCellNode(s)||Pl(25),t===o&&e===n?u=l.getKey():t===a&&e===i&&(c=l.getKey());let f=l.getChildren();s.getChildren().forEach((e=>{Ll.$isTextNode(e)&&Ll.$createParagraphNode().append(e),l.append(e)})),f.forEach((e=>e.remove())),r++}l++}u&&c&&(e=Ll.DEPRECATED_$createGridSelection(),e.set(t.getKey(),u,c),Ll.$setSelection(e),r.dispatchCommand(Ll.SELECTION_CHANGE_COMMAND,void 0))}(t,n,!1,e):function(e,t){let n=[],r=null;for(let t=0;t<e.length;t++){let o=e[t],i=Ll.$isLineBreakNode(o);if(i||Ll.$isDecoratorNode(o)&&o.isInline()||Ll.$isElementNode(o)&&o.isInline()||Ll.$isTextNode(o)||o.isParentRequired()){if(null===r&&(r=o.createParentElementNode(),n.push(r),i))continue;null!==r&&r.append(o)}else n.push(o),r=null}Ll.$isRangeSelection(t)?t.insertNodes(n):Ll.DEPRECATED_$isGridSelection(t)&&(e=t.anchor.getNode(),Ll.DEPRECATED_$isGridCellNode(e)||Pl(41),e.append(...n))}(t,n)}function Bl(e,t,n,r=[]){let o=null==t||n.isSelected(t),i=Ll.$isElementNode(n)&&n.excludeFromCopy("html");var l=n;if(null!==t){var a=Ol.$cloneWithProperties(n);l=a=Ll.$isTextNode(a)&&null!=t?Ol.$sliceSelectedTextNodeContent(t,a):a}let s=Ll.$isElementNode(l)?l.getChildren():[];var u=l;a=u.exportJSON();var c=u.constructor;a.type!==c.getType()&&Pl(58,c.name);let d=a.children;for(Ll.$isElementNode(u)&&(Array.isArray(d)||Pl(59,c.name)),Ll.$isTextNode(l)&&(0<(l=l.__text).length?a.text=l:o=!1),l=0;l<s.length;l++)c=Bl(e,t,u=s[l],a.children),!o&&Ll.$isElementNode(n)&&c&&n.extractWithChild(u,t,"clone")&&(o=!0);if(o&&!i)r.push(a);else if(Array.isArray(a.children))for(e=0;e<a.children.length;e++)r.push(a.children[e]);return o}function Fl(e,t){let n=[],r=Ll.$getRoot().getChildren();for(let o=0;o<r.length;o++)Bl(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function Hl(e){let t=[];for(let n=0;n<e.length;n++){let r=Ll.$parseSerializedNode(e[n]);Ll.$isTextNode(r)&&Ol.$addNodeStyle(r),t.push(r)}return t}let Wl=null;function jl(e,t){var n=Il?(e._window||window).getSelection():null;if(!n)return!1;var r=n.anchorNode;if(n=n.focusNode,null!==r&&null!==n&&!Ll.isSelectionWithinEditor(e,r,n))return!1;if(t.preventDefault(),t=t.clipboardData,r=Ll.$getSelection(),null===t||null===r)return!1;n=Dl(e),e=$l(e);let o="";return null!==r&&(o=r.getTextContent()),null!==n&&t.setData("text/html",n),null!==e&&t.setData("application/x-lexical-editor",e),t.setData("text/plain",o),!0}Cl.$generateJSONFromSelectedNodes=Fl,Cl.$generateNodesFromSerializedNodes=Hl,Cl.$getHtmlContent=Dl,Cl.$getLexicalContent=$l,Cl.$insertDataTransferForPlainText=function(e,t){null!=(e=e.getData("text/plain")||e.getData("text/uri-list"))&&t.insertRawText(e)},Cl.$insertDataTransferForRichText=function(e,t,n){var r=e.getData("application/x-lexical-editor");if(r)try{let e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes)){return zl(n,Hl(e.nodes),t)}}catch(e){}if(r=e.getData("text/html"))try{var o=(new DOMParser).parseFromString(r,"text/html"),i=Rl.$generateNodesFromDOM(n,o);return zl(n,i,t)}catch(e){}if(null!=(e=e.getData("text/plain")||e.getData("text/uri-list")))if(Ll.$isRangeSelection(t))for(n=(e=e.split(/(\r?\n|\t)/)).length,o=0;o<n;o++)"\n"===(i=e[o])||"\r\n"===i?t.insertParagraph():"\t"===i?t.insertNodes([Ll.$createTabNode()]):t.insertText(i);else t.insertRawText(e)},Cl.$insertGeneratedNodes=zl,Cl.copyToClipboard=async function(e,t){if(null!==Wl)return!1;if(null!==t)return new Promise((n=>{e.update((()=>{n(jl(e,t))}))}));var n=e.getRootElement();let r=null==e._window?window.document:e._window.document,o=Il?(e._window||window).getSelection():null;if(null===n||null===o)return!1;let i=r.createElement("span");return i.style.cssText="position: fixed; top: -1000px;",i.append(r.createTextNode("#")),n.append(i),(n=new Range).setStart(i,0),n.setEnd(i,1),o.removeAllRanges(),o.addRange(n),new Promise((t=>{let n=e.registerCommand(Ll.COPY_COMMAND,(r=>(Ml.objectKlassEquals(r,ClipboardEvent)&&(n(),null!==Wl&&(window.clearTimeout(Wl),Wl=null),t(jl(e,r))),!0)),Ll.COMMAND_PRIORITY_CRITICAL);Wl=window.setTimeout((()=>{n(),Wl=null,t(!1)}),50),r.execCommand("copy"),i.remove()}))};var Kl=Cl,Yl=Ko,Gl=Jo,Ul=Mo;function Vl(e,t){return void 0!==document.caretRangeFromPoint?null===(e=document.caretRangeFromPoint(e,t))?null:{node:e.startContainer,offset:e.startOffset}:"undefined"!==document.caretPositionFromPoint?null===(e=document.caretPositionFromPoint(e,t))?null:{node:e.offsetNode,offset:e.offset}:null}let Ql="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Jl=Ql&&"documentMode"in document?document.documentMode:null,Xl=!(!Ql||!("InputEvent"in window)||Jl)&&"getTargetRanges"in new window.InputEvent("input"),ql=Ql&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Zl=Ql&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ea=Ql&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ta=Ql&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ea,na=Ul.createCommand("DRAG_DROP_PASTE_FILE"),ra=class e extends Ul.ElementNode{static getType(){return"quote"}static clone(t){return new e(t.__key)}constructor(e){super(e)}createDOM(e){let t=document.createElement("blockquote");return Gl.addClassNamesToElement(t,e.theme.quote),t}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:sa,priority:0})}}exportDOM(e){if(({element:e}=super.exportDOM(e)),e&&this.isEmpty()&&e.append(document.createElement("br")),e){var t=this.getFormatType();e.style.textAlign=t,(t=this.getDirection())&&(e.dir=t)}return{element:e}}static importJSON(e){let t=oa();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){e=Ul.$createParagraphNode();let n=this.getDirection();return e.setDirection(n),this.insertAfter(e,t),e}collapseAtStart(){let e=Ul.$createParagraphNode();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}};function oa(){return Ul.$applyNodeReplacement(new ra)}let ia=class e extends Ul.ElementNode{static getType(){return"heading"}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){let t=this.__tag,n=document.createElement(t);return void 0!==(e=e.theme.heading)&&Gl.addClassNamesToElement(n,e[t]),n}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:aa,priority:0}),h2:()=>({conversion:aa,priority:0}),h3:()=>({conversion:aa,priority:0}),h4:()=>({conversion:aa,priority:0}),h5:()=>({conversion:aa,priority:0}),h6:()=>({conversion:aa,priority:0}),p:e=>null!==(e=e.firstChild)&&la(e)?{conversion:()=>({node:null}),priority:3}:null,span:e=>la(e)?{conversion:()=>({node:ua("h1")}),priority:3}:null}}exportDOM(e){if(({element:e}=super.exportDOM(e)),e&&this.isEmpty()&&e.append(document.createElement("br")),e){var t=this.getFormatType();e.style.textAlign=t,(t=this.getDirection())&&(e.dir=t)}return{element:e}}static importJSON(e){let t=ua(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){e=0<(e=e?e.anchor.offset:0)&&e<this.getTextContentSize()?ua(this.getTag()):Ul.$createParagraphNode();let n=this.getDirection();return e.setDirection(n),this.insertAfter(e,t),e}collapseAtStart(){let e=this.isEmpty()?Ul.$createParagraphNode():ua(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function la(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function aa(e){let t=e.nodeName.toLowerCase(),n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=ua(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function sa(e){let t=oa();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function ua(e){return Ul.$applyNodeReplacement(new ia(e))}function ca(e){let t=null;if(e instanceof DragEvent?t=e.dataTransfer:e instanceof ClipboardEvent&&(t=e.clipboardData),null===t)return[!1,[],!1];var n=t.types;return e=n.includes("Files"),n=n.includes("text/html")||n.includes("text/plain"),[e,Array.from(t.files),n]}function da(e){var t=Ul.$getSelection();if(!Ul.$isRangeSelection(t))return!1;let n=new Set;t=t.getNodes();for(let i=0;i<t.length;i++){var r=t[i],o=r.getKey();n.has(o)||(o=(r=Gl.$getNearestBlockElementAncestorOrThrow(r)).getKey(),r.canIndent()&&!n.has(o)&&(n.add(o),e(r)))}return 0<n.size}function pa(e){return e=Ul.$getNearestNodeFromDOMNode(e),Ul.$isDecoratorNode(e)}El.$createHeadingNode=ua,El.$createQuoteNode=oa,El.$isHeadingNode=function(e){return e instanceof ia},El.$isQuoteNode=function(e){return e instanceof ra},El.DRAG_DROP_PASTE=na,El.HeadingNode=ia,El.QuoteNode=ra,El.eventFiles=ca,El.registerRichText=function(e){return Gl.mergeRegister(e.registerCommand(Ul.CLICK_COMMAND,(()=>{const e=Ul.$getSelection();return!!Ul.$isNodeSelection(e)&&(e.clear(),!0)}),0),e.registerCommand(Ul.DELETE_CHARACTER_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.deleteCharacter(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DELETE_WORD_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.deleteWord(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DELETE_LINE_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.deleteLine(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.CONTROLLED_TEXT_INSERTION_COMMAND,(t=>{const n=Ul.$getSelection();if("string"==typeof t)Ul.$isRangeSelection(n)?n.insertText(t):Ul.DEPRECATED_$isGridSelection(n);else{if(!Ul.$isRangeSelection(n)&&!Ul.DEPRECATED_$isGridSelection(n))return!1;const r=t.dataTransfer;null!=r?Kl.$insertDataTransferForRichText(r,n,e):Ul.$isRangeSelection(n)&&(t=t.data)&&n.insertText(t)}return!0}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.REMOVE_TEXT_COMMAND,(()=>{const e=Ul.$getSelection();return!!Ul.$isRangeSelection(e)&&(e.removeText(),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.FORMAT_TEXT_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.formatText(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.FORMAT_ELEMENT_COMMAND,(e=>{var t=Ul.$getSelection();if(!Ul.$isRangeSelection(t)&&!Ul.$isNodeSelection(t))return!1;t=t.getNodes();for(const n of t)t=Gl.$findMatchingParent(n,(e=>Ul.$isElementNode(e)&&!e.isInline())),null!==t&&t.setFormat(e);return!0}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INSERT_LINE_BREAK_COMMAND,(e=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(t.insertLineBreak(e),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INSERT_PARAGRAPH_COMMAND,(()=>{const e=Ul.$getSelection();return!!Ul.$isRangeSelection(e)&&(e.insertParagraph(),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INSERT_TAB_COMMAND,(()=>(Ul.$insertNodes([Ul.$createTabNode()]),!0)),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.INDENT_CONTENT_COMMAND,(()=>da((e=>{const t=e.getIndent();e.setIndent(t+1)}))),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.OUTDENT_CONTENT_COMMAND,(()=>da((e=>{const t=e.getIndent();0<t&&e.setIndent(t-1)}))),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_UP_COMMAND,(e=>{var t=Ul.$getSelection();if(Ul.$isNodeSelection(t)&&!pa(e.target)){if(0<(e=t.getNodes()).length)return e[0].selectPrevious(),!0}else if(Ul.$isRangeSelection(t)&&(t=Ul.$getAdjacentNode(t.focus,!0),!e.shiftKey&&Ul.$isDecoratorNode(t)&&!t.isIsolated()&&!t.isInline()))return t.selectPrevious(),e.preventDefault(),!0;return!1}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_DOWN_COMMAND,(e=>{var t=Ul.$getSelection();if(Ul.$isNodeSelection(t)){if(0<(e=t.getNodes()).length)return e[0].selectNext(0,0),!0}else if(Ul.$isRangeSelection(t)){let n=t.focus;if("root"===n.key&&n.offset===Ul.$getRoot().getChildrenSize())return e.preventDefault(),!0;if(t=Ul.$getAdjacentNode(t.focus,!1),!e.shiftKey&&Ul.$isDecoratorNode(t)&&!t.isIsolated()&&!t.isInline())return t.selectNext(),e.preventDefault(),!0}return!1}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_LEFT_COMMAND,(e=>{const t=Ul.$getSelection();if(Ul.$isNodeSelection(t)){var n=t.getNodes();if(0<n.length)return e.preventDefault(),n[0].selectPrevious(),!0}return!!Ul.$isRangeSelection(t)&&(!!Yl.$shouldOverrideDefaultCharacterSelection(t,!0)&&(n=e.shiftKey,e.preventDefault(),Yl.$moveCharacter(t,n,!0),!0))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ARROW_RIGHT_COMMAND,(e=>{const t=Ul.$getSelection();if(Ul.$isNodeSelection(t)&&!pa(e.target)){var n=t.getNodes();if(0<n.length)return e.preventDefault(),n[0].selectNext(0,0),!0}return!!Ul.$isRangeSelection(t)&&(n=e.shiftKey,!!Yl.$shouldOverrideDefaultCharacterSelection(t,!1)&&(e.preventDefault(),Yl.$moveCharacter(t,n,!1),!0))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_BACKSPACE_COMMAND,(t=>{if(pa(t.target))return!1;const n=Ul.$getSelection();if(!Ul.$isRangeSelection(n))return!1;t.preventDefault(),({anchor:t}=n);const r=t.getNode();return n.isCollapsed()&&0===t.offset&&!Ul.$isRootNode(r)&&0<Gl.$getNearestBlockElementAncestorOrThrow(r).getIndent()?e.dispatchCommand(Ul.OUTDENT_CONTENT_COMMAND,void 0):e.dispatchCommand(Ul.DELETE_CHARACTER_COMMAND,!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_DELETE_COMMAND,(t=>{if(pa(t.target))return!1;const n=Ul.$getSelection();return!!Ul.$isRangeSelection(n)&&(t.preventDefault(),e.dispatchCommand(Ul.DELETE_CHARACTER_COMMAND,!1))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ENTER_COMMAND,(t=>{const n=Ul.$getSelection();if(!Ul.$isRangeSelection(n))return!1;if(null!==t){if((Zl||ql||ta)&&Xl)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Ul.INSERT_LINE_BREAK_COMMAND,!1)}return e.dispatchCommand(Ul.INSERT_PARAGRAPH_COMMAND,void 0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.KEY_ESCAPE_COMMAND,(()=>{const t=Ul.$getSelection();return!!Ul.$isRangeSelection(t)&&(e.blur(),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DROP_COMMAND,(t=>{const[,n]=ca(t);if(0<n.length){var r=Vl(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r;var o=Ul.$getNearestNodeFromDOMNode(i);if(null!==o){if(r=Ul.$createRangeSelection(),Ul.$isTextNode(o))r.anchor.set(o.getKey(),t,"text"),r.focus.set(o.getKey(),t,"text");else{const e=o.getParentOrThrow().getKey();o=o.getIndexWithinParent()+1,r.anchor.set(e,o,"element"),r.focus.set(e,o,"element")}r=Ul.$normalizeSelection__EXPERIMENTAL(r),Ul.$setSelection(r)}e.dispatchCommand(na,n)}return t.preventDefault(),!0}return t=Ul.$getSelection(),!!Ul.$isRangeSelection(t)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DRAGSTART_COMMAND,(e=>{[e]=ca(e);const t=Ul.$getSelection();return!(e&&!Ul.$isRangeSelection(t))}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.DRAGOVER_COMMAND,(e=>{var[t]=ca(e);const n=Ul.$getSelection();return!(t&&!Ul.$isRangeSelection(n))&&(null!==(t=Vl(e.clientX,e.clientY))&&(t=Ul.$getNearestNodeFromDOMNode(t.node),Ul.$isDecoratorNode(t)&&e.preventDefault()),!0)}),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.COPY_COMMAND,(t=>(Kl.copyToClipboard(e,Gl.objectKlassEquals(t,ClipboardEvent)?t:null),!0)),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.CUT_COMMAND,(t=>(async function(e,t){await Kl.copyToClipboard(t,Gl.objectKlassEquals(e,ClipboardEvent)?e:null),t.update((()=>{let e=Ul.$getSelection();Ul.$isRangeSelection(e)?e.removeText():Ul.$isNodeSelection(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),Ul.COMMAND_PRIORITY_EDITOR),e.registerCommand(Ul.PASTE_COMMAND,(t=>{const[,n,r]=ca(t);if(0<n.length&&!r)return e.dispatchCommand(na,n),!0;if(Ul.isSelectionCapturedInDecoratorInput(t.target))return!1;const o=Ul.$getSelection();return!(!Ul.$isRangeSelection(o)&&!Ul.DEPRECATED_$isGridSelection(o))&&(function(e,t){e.preventDefault(),t.update((()=>{let n=Ul.$getSelection(),r=e instanceof InputEvent||e instanceof KeyboardEvent?null:e.clipboardData;null!=r&&(Ul.$isRangeSelection(n)||Ul.DEPRECATED_$isGridSelection(n))&&Kl.$insertDataTransferForRichText(r,n,t)}),{tag:"paste"})}(t,e),!0)}),Ul.COMMAND_PRIORITY_EDITOR))};var fa=El,ma={},ga=ai,ha=Yi,va=Jo,ba=Mo,ya=g;function xa(e,t){for(let n=0;n<t.length;n++){let r=t[n](e);if(r)return r}return null}let _a=/[.,;\s]/;function Ea(e){var t;return e=e.getPreviousSibling(),ba.$isElementNode(e)&&(e=e.getLastDescendant()),!(t=null===e||ba.$isLineBreakNode(e))&&(t=ba.$isTextNode(e))&&(e=e.getTextContent(),t=_a.test(e[e.length-1])),t}function Ca(e){return e=e.getNextSibling(),ba.$isElementNode(e)&&(e=e.getFirstDescendant()),null===e||ba.$isLineBreakNode(e)||ba.$isTextNode(e)&&_a.test(e.getTextContent()[0])}function wa(e,t,n){var r=e.getChildren();let o=r.length;for(let t=0;t<o;t++){let o=r[t];if(!ba.$isTextNode(o)||!o.isSimpleText())return Sa(e),void n(null,e.getURL())}null===(t=xa(r=e.getTextContent(),t))||t.text!==r?(Sa(e),n(null,e.getURL())):Ea(e)&&Ca(e)?((r=e.getURL())!==t.url&&(e.setURL(t.url),n(t.url,r)),t.attributes&&((r=e.getRel())!==t.attributes.rel&&(e.setRel(t.attributes.rel||null),n(t.attributes.rel||null,r)),(r=e.getTarget())!==t.attributes.target&&(e.setTarget(t.attributes.target||null),n(t.attributes.target||null,r)))):(Sa(e),n(null,e.getURL()))}function Sa(e){let t=e.getChildren();var n=t.length;for(--n;0<=n;n--)e.insertAfter(t[n]);return e.remove(),t.map((e=>e.getLatest()))}function ka(e,t,n){ya.useEffect((()=>{e.hasNodes([ga.AutoLinkNode])||function(e){let t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);let r=(e,t)=>{n&&n(e,t)};return va.mergeRegister(e.registerNodeTransform(ba.TextNode,(e=>{var o=e.getParentOrThrow(),i=e.getPreviousSibling();if(ga.$isAutoLinkNode(o))wa(o,t,r);else if(!ga.$isLinkNode(o)){if(e.isSimpleText()&&(_a.test(e.getTextContent()[0])||!ga.$isAutoLinkNode(i))){i=o=e.getTextContent();let r=0,p=e;for(var l;(l=xa(i,t))&&null!==l;){let t=l.index,f=l.length,m=t+f;var a=r+t,s=r+m,u=o,c=e;if((0<a?_a.test(u[a-1]):Ea(c))&&(s<u.length?_a.test(u[s]):Ca(c))){var d=void 0;0===r+t?[d,p]=p.splitText(r+f):[,d,p]=p.splitText(r+t,r+t+f),a=ga.$createAutoLinkNode(l.url,l.attributes),(s=ba.$createTextNode(l.text)).setFormat(d.getFormat()),s.setDetail(d.getDetail()),a.append(s),d.replace(a),n&&n(l.url,null),r=0}else r+=m;i=i.substring(m)}}o=e.getPreviousSibling(),l=e.getNextSibling(),d=e.getTextContent(),ga.$isAutoLinkNode(o)&&!_a.test(d[0])&&(o.append(e),wa(o,t,r),e=o.getURL(),n&&n(null,e)),ga.$isAutoLinkNode(l)&&!_a.test(d[d.length-1])&&(Sa(l),wa(l,t,r),e=l.getURL(),n&&n(null,e))}})))}),[e,t,n])}ma.AutoLinkPlugin=function({matchers:e,onChange:t}){let[n]=ha.useLexicalComposerContext();return ka(n,e,t),null},ma.createLinkMatcherWithRegExp=function(e,t=(e=>e)){return n=>{let r=e.exec(n);return null===r?null:{index:r.index,length:r[0].length,text:r[0],url:t(n)}}};var Ta=ma,Aa=Yi,Na=g,Ra="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Na.useLayoutEffect:Na.useEffect;function Oa(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}const Ma=function(){return function(e){let[t]=Aa.useLexicalComposerContext(),n=Na.useMemo((()=>e(t)),[t,e]),r=Na.useRef(n.initialValueFn()),[o,i]=Na.useState(r.current);return Ra((()=>{let{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,i(o)),t((e=>{r.current=e,i(e)}))}),[n,e]),o}(Oa)};var La=Ma,Pa=O(La);var Ia={black:"#000",white:"#fff"};var Da={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};var $a={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};var za={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};var Ba={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};var Fa={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};var Ha={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};var Wa={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function ja(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Ka(e){if(!ja(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=Ka(e[n])})),t}function Ya(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return ja(e)&&ja(t)&&Object.keys(t).forEach((o=>{"__proto__"!==o&&(ja(t[o])&&o in e&&ja(e[o])?r[o]=Ya(e[o],t[o],n):n.clone?r[o]=ja(t[o])?Ka(t[o]):t[o]:r[o]=t[o])})),r}function Ga(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var Ua,Va={},Qa=Symbol.for("react.element"),Ja=Symbol.for("react.portal"),Xa=Symbol.for("react.fragment"),qa=Symbol.for("react.strict_mode"),Za=Symbol.for("react.profiler"),es=Symbol.for("react.provider"),ts=Symbol.for("react.context"),ns=Symbol.for("react.server_context"),rs=Symbol.for("react.forward_ref"),os=Symbol.for("react.suspense"),is=Symbol.for("react.suspense_list"),ls=Symbol.for("react.memo"),as=Symbol.for("react.lazy"),ss=Symbol.for("react.offscreen");
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-is.production.min.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebula.js/sn-text",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Display text, links, and measures. Add tables with rows and columns. Format and color the text. Add background image and color.",
|
|
5
5
|
"author": "QlikTech International AB",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"main": "dist/sn-text.js",
|
|
26
26
|
"systemjs": "dist/sn-text.systemjs.js",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "nebula build --core core --mode production --config nebula.config.cjs",
|
|
28
|
+
"build": "nebula build --core core --mode production --sourcemap false --config nebula.config.cjs && nebula sense --meta src/meta.json",
|
|
29
29
|
"build:test": "nebula build --mode production --config nebula.config.cjs",
|
|
30
30
|
"build:dev": "nebula build --core core --mode development --typescript",
|
|
31
31
|
"lint": "eslint .",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-text v1.1.
|
|
2
|
+
* @nebula.js/sn-text v1.1.6
|
|
3
3
|
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-text"]=t(e.stardust)}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const n={version:"1.1.
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-text"]=t(e.stardust)}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const n={version:"1.1.6",showTitles:!1,text:null,fontsUsed:[],components:[],qHyperCubeDef:{qDimensions:[],qMeasures:[],qSuppressZero:!1,qSuppressMissing:!0,qInitialDataFetch:[{qWidth:500,qHeight:10}]}},r=e=>{const t=()=>{e.setPropertiesHaveBeenModifiedForSelectedModel(!0)};return{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:0,max:10,added(e){e.qDef={...e.qDef,qAggrFunc:"None"},t()},removed:t,replaced:t,moved:t}}]}};var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l={exports:{}},a={},s={exports:{}},u={},c=Symbol.for("react.element"),d=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),_=Symbol.iterator;var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function k(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||E}function S(){}function T(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||E}k.prototype.isReactComponent={},k.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},k.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=k.prototype;var N=T.prototype=new S;N.constructor=T,w(N,k.prototype),N.isPureReactComponent=!0;var R=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function L(e,t,n){var r,o={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)A.call(t,r)&&!M.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var s=Array(a),u=0;u<a;u++)s[u]=arguments[u+2];o.children=s}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return{$$typeof:c,type:e,key:i,ref:l,props:o,_owner:O.current}}function P(e){return"object"==typeof e&&null!==e&&e.$$typeof===c}var I=/\/+/g;function D(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function $(e,t,n,r,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var l=!1;if(null===e)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case c:case d:l=!0}}if(l)return o=o(l=e),e=""===r?"."+D(l,0):r,R(o)?(n="",null!=e&&(n=e.replace(I,"$&/")+"/"),$(o,t,n,"",(function(e){return e}))):null!=o&&(P(o)&&(o=function(e,t){return{$$typeof:c,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",R(e))for(var a=0;a<e.length;a++){var s=r+D(i=e[a],a);l+=$(i,t,n,s,o)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=_&&e[_]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),a=0;!(i=e.next()).done;)l+=$(i=i.value,t,n,s=r+D(i,a++),o);else if("object"===i)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function z(e,t,n){if(null==e)return e;var r=[],o=0;return $(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function F(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var B={current:null},H={transition:null},W={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:H,ReactCurrentOwner:O};u.Children={map:z,forEach:function(e,t,n){z(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return z(e,(function(){t++})),t},toArray:function(e){return z(e,(function(e){return e}))||[]},only:function(e){if(!P(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},u.Component=k,u.Fragment=f,u.Profiler=m,u.PureComponent=T,u.StrictMode=p,u.Suspense=b,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,u.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=w({},e.props),o=e.key,i=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,l=O.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(s in t)A.call(t,s)&&!M.hasOwnProperty(s)&&(r[s]=void 0===t[s]&&void 0!==a?a[s]:t[s])}var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){a=Array(s);for(var u=0;u<s;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:c,type:e.type,key:o,ref:i,props:r,_owner:l}},u.createContext=function(e){return(e={$$typeof:g,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:h,_context:e},e.Consumer=e},u.createElement=L,u.createFactory=function(e){var t=L.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:v,render:e}},u.isValidElement=P,u.lazy=function(e){return{$$typeof:x,_payload:{_status:-1,_result:e},_init:F}},u.memo=function(e,t){return{$$typeof:y,type:e,compare:void 0===t?null:t}},u.startTransition=function(e){var t=H.transition;H.transition={};try{e()}finally{H.transition=t}},u.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},u.useCallback=function(e,t){return B.current.useCallback(e,t)},u.useContext=function(e){return B.current.useContext(e)},u.useDebugValue=function(){},u.useDeferredValue=function(e){return B.current.useDeferredValue(e)},u.useEffect=function(e,t){return B.current.useEffect(e,t)},u.useId=function(){return B.current.useId()},u.useImperativeHandle=function(e,t,n){return B.current.useImperativeHandle(e,t,n)},u.useInsertionEffect=function(e,t){return B.current.useInsertionEffect(e,t)},u.useLayoutEffect=function(e,t){return B.current.useLayoutEffect(e,t)},u.useMemo=function(e,t){return B.current.useMemo(e,t)},u.useReducer=function(e,t,n){return B.current.useReducer(e,t,n)},u.useRef=function(e){return B.current.useRef(e)},u.useState=function(e){return B.current.useState(e)},u.useSyncExternalStore=function(e,t,n){return B.current.useSyncExternalStore(e,t,n)},u.useTransition=function(){return B.current.useTransition()},u.version="18.2.0",s.exports=u;var j=s.exports,K=i(j),U=t({__proto__:null,default:K},[j]),Y={exports:{}},G={};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* scheduler.production.min.js
|
package/sn-text-ext/sn-text.qext
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Text",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Display text, links, and measures. Add tables with rows and columns. Format and color the text. Add background image and color.",
|
|
5
5
|
"author": "QlikTech International AB",
|
|
6
6
|
"icon": "text-object",
|