??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/am1atec.co.uk/wp-content/plugins/surerank/build/vendor-7d0314d1/index.js
⬅ Kembali
"use strict";(globalThis.webpackChunksurerank=globalThis.webpackChunksurerank||[]).push([[938],{38129(t,e,n){n.d(e,{QZ:()=>k,iZ:()=>Z,v:()=>w,vA:()=>l,xT:()=>V});var i=n(48832),r=n(73105);const o=Symbol.for("preact-signals");function s(){if(d>1)return void d--;let t,e=!1;for(;void 0!==a;){let i=a;for(a=void 0,f++;void 0!==i;){const r=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&m(i))try{i.c()}catch(n){e||(t=n,e=!0)}i=r}}if(f=0,d--,e)throw t}function l(t){if(d>0)return t();d++;try{return t()}finally{s()}}let c,a;function u(t){const e=c;c=void 0;try{return t()}finally{c=e}}let d=0,f=0,h=0;function g(t){if(void 0===c)return;let e=t.n;return void 0===e||e.t!==c?(e={i:0,S:t,p:c.s,n:void 0,t:c,e:void 0,x:void 0,r:e},void 0!==c.s&&(c.s.n=e),c.s=e,t.n=e,32&c.f&&t.S(e),e):-1===e.i?(e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=c.s,e.n=void 0,c.s.n=e,c.s=e),e):void 0}function p(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=null==e?void 0:e.watched,this.Z=null==e?void 0:e.unwatched,this.name=null==e?void 0:e.name}function _(t,e){return new p(t,e)}function m(t){for(let e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function y(t){for(let e=t.s;void 0!==e;e=e.n){const n=e.S.n;if(void 0!==n&&(e.r=n),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function v(t){let e,n=t.s;for(;void 0!==n;){const t=n.p;-1===n.i?(n.S.U(n),void 0!==t&&(t.n=n.n),void 0!==n.n&&(n.n.p=t)):e=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=t}t.s=e}function x(t,e){p.call(this,void 0),this.x=t,this.s=void 0,this.g=h-1,this.f=4,this.W=null==e?void 0:e.watched,this.Z=null==e?void 0:e.unwatched,this.name=null==e?void 0:e.name}function S(t){const e=t.u;if(t.u=void 0,"function"==typeof e){d++;const n=c;c=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,C(t),e}finally{c=n,s()}}}function C(t){for(let e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,S(t)}function b(t){if(c!==this)throw new Error("Out-of-order effect");v(this),c=t,this.f&=-2,8&this.f&&C(this),s()}function E(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==e?void 0:e.name}function k(t,e){const n=new E(t,e);try{n.c()}catch(t){throw n.d(),t}const i=n.d.bind(n);return i[Symbol.dispose]=i,i}function w(t,e={}){const n={};for(const i in t){const r=e[i],o=_(void 0===r?t[i]:r);n[i]=o}return n}function N(){const t=(0,i.NiT)(),e=(0,i.vJq)(),n=(0,i.lJ7)();t.clear(),t.append(n),null!==e&&n.select(),(0,i.I2P)(e)&&(e.format=0)}function T(t){return("function"==typeof t.nodes?t.nodes():t.nodes)||[]}function M(t,e){let n;return _(t(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=t(),n=e(this)}})}p.prototype.brand=o,p.prototype.h=function(){return!0},p.prototype.S=function(t){const e=this.t;e!==t&&void 0===t.e&&(t.x=e,this.t=t,void 0!==e?e.e=t:u(()=>{var t;null==(t=this.W)||t.call(this)}))},p.prototype.U=function(t){if(void 0!==this.t){const e=t.e,n=t.x;void 0!==e&&(e.x=n,t.e=void 0),void 0!==n&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n,void 0===n&&u(()=>{var t;null==(t=this.Z)||t.call(this)}))}},p.prototype.subscribe=function(t){return k(()=>{const e=this.value,n=c;c=void 0;try{t(e)}finally{c=n}},{name:"sub"})},p.prototype.valueOf=function(){return this.value},p.prototype.toString=function(){return this.value+""},p.prototype.toJSON=function(){return this.value},p.prototype.peek=function(){const t=c;c=void 0;try{return this.value}finally{c=t}},Object.defineProperty(p.prototype,"value",{get(){const t=g(this);return void 0!==t&&(t.i=this.i),this.v},set(t){if(t!==this.v){if(f>100)throw new Error("Cycle detected");this.v=t,this.i++,h++,d++;try{for(let t=this.t;void 0!==t;t=t.x)t.t.N()}finally{s()}}}}),(x.prototype=new p).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===h)return!0;if(this.g=h,this.f|=1,this.i>0&&!m(this))return this.f&=-2,!0;const t=c;try{y(this),c=this;const t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return c=t,v(this),this.f&=-2,!0},x.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(let t=this.s;void 0!==t;t=t.n)t.S.S(t)}p.prototype.S.call(this,t)},x.prototype.U=function(t){if(void 0!==this.t&&(p.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(let t=this.s;void 0!==t;t=t.n)t.S.U(t)}},x.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(x.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const t=g(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),E.prototype.c=function(){const t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();"function"==typeof t&&(this.u=t)}finally{t()}},E.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,S(this),y(this),d++;const t=c;return c=this,b.bind(this,t)},E.prototype.N=function(){2&this.f||(this.f|=2,this.o=a,a=this)},E.prototype.d=function(){this.f|=8,1&this.f||C(this)},E.prototype.dispose=function(){this.d()},(0,i.vE9)({build:(t,e,n)=>w(e),config:(0,i.lVE)({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(t,e,n){const i=n.getOutput();return k(()=>i.disabled.value?void 0:t.registerRootListener(e=>{t.focus(()=>{const t=document.activeElement;null===e||null!==t&&e.contains(t)||e.focus({preventScroll:!0})},{defaultSelection:i.defaultSelection.peek()})}))}}),(0,i.vE9)({build:(t,e,n)=>w(e),config:(0,i.lVE)({$onClear:N}),name:"@lexical/extension/ClearEditor",register(t,e,n){const{$onClear:r}=n.getOutput();return k(()=>function(t,e=N){return t.registerCommand(i.SKc,n=>(t.update(e),!0),i.jZM)}(t,r.value))}});const O=(0,i.vE9)({build:t=>M(()=>t.getEditorState(),e=>t.registerUpdateListener(t=>{e.value=t.editorState})),name:"@lexical/extension/EditorState"});function P(t,...e){const n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const r of e)i.append("v",r);throw n.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function D(t,e){if(t&&e&&!Array.isArray(e)&&"object"==typeof t&&"object"==typeof e){const n=t,i=e;for(const t in i)n[t]=D(n[t],i[t]);return t}return e}function A(t){return 0===t.id}function I(t){return 2===t.id}const L=new Set;class F{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,e){this.builder=t,this.extension=e,this.configs=new Set,this.state={id:0}}mergeConfigs(){let t=this.extension.config||{};const e=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):i.Tc1;for(const n of this.configs)t=e(t,n);return t}init(t){const e=this.state;I(e)||P(306,String(e.id));const n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},r=function(t,e,n){return Object.assign(t,{config:e,id:3,registerState:n})}(e,this.mergeConfigs(),n);let o;this.state=r,this.extension.init&&(o=this.extension.init(t,r.config,n)),this.state=function(t,e,n){return Object.assign(t,{id:4,initResult:e,registerState:n})}(r,o,i)}build(t){const e=this.state;let n;4!==e.id&&P(307,String(e.id),String(5)),this.extension.build&&(n=this.extension.build(t,e.config,e.registerState));const i={...e.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(t,e,n){return Object.assign(t,{id:5,output:e,registerState:n})}(e,n,i)}register(t,e){this._signal=e;const n=this.state;5!==n.id&&P(308,String(n.id),String(5));const i=this.extension.register&&this.extension.register(t,n.config,n.registerState);return this.state=function(t){return Object.assign(t,{id:6})}(n),()=>{const t=this.state;7!==t.id&&P(309,String(n.id),String(7)),this.state=function(t){return Object.assign(t,{id:5})}(t),i&&i()}}afterRegistration(t){const e=this.state;let n;return 6!==e.id&&P(310,String(e.id),String(6)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(t,e.config,e.registerState)),this.state=function(t){return Object.assign(t,{id:7})}(e),n}getSignal(){return void 0===this._signal&&P(311),this._signal}getInitResult(){void 0===this.extension.init&&P(312,this.extension.name);const t=this.state;return function(t){return t.id>=4}(t)||P(313,String(t.id),String(4)),t.initResult}getInitPeer(t){const e=this.builder.extensionNameMap.get(t);return e?e.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return function(t){return t.id>=3}(t)||P(314,String(t.id),String(3)),{config:t.config}}getPeer(t){const e=this.builder.extensionNameMap.get(t);return e?e.getExtensionDependency():void 0}getInitDependency(t){const e=this.builder.getExtensionRep(t);return void 0===e&&P(315,this.extension.name,t.name),e.getExtensionInitDependency()}getDependency(t){const e=this.builder.getExtensionRep(t);return void 0===e&&P(315,this.extension.name,t.name),e.getExtensionDependency()}getState(){const t=this.state;return function(t){return t.id>=7}(t)||P(316,String(t.id),String(7)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||L}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(t){return t.id>=5})(t)||P(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}}const R={tag:i.T40};function K(){const t=(0,i.NiT)();t.isEmpty()&&t.append((0,i.lJ7)())}const B=(0,i.vE9)({config:(0,i.lVE)({setOptions:R,updateOptions:R}),init:({$initialEditorState:t=K})=>({$initialEditorState:t,initialized:!1}),afterRegistration(t,{updateOptions:e,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:r}=o;if((0,i.v0B)(r))t.setEditorState(r,n);else if("function"==typeof r)t.update(()=>{r(t)},e);else if(r&&("string"==typeof r||"object"==typeof r)){const e=t.parseEditorState(r);t.setEditorState(e,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[i.haT,i.Ey8,i.GRK,i.MZu,i.fD3]}),z=Symbol.for("@lexical/extension/LexicalBuilder");function W(){}function j(t){throw t}function J(t){return Array.isArray(t)?t:[t]}const U="0.38.2+prod.esm";class Z{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=U,this.roots=t;for(const e of t)this.addExtension(e)}static fromExtensions(t){const e=[J(B)];for(const n of t)e.push(J(n));return new Z(e)}static maybeFromEditor(t){const e=t[z];return e&&(e.PACKAGE_VERSION!==U&&P(292,e.PACKAGE_VERSION,U),e instanceof Z||P(293)),e}static fromEditor(t){const e=Z.maybeFromEditor(t);return void 0===e&&P(294),e}constructEditor(){const{$initialEditorState:t,onError:e,...n}=this.buildCreateEditorArgs(),r=Object.assign((0,i.ieJ)({...n,...e?{onError:t=>{e(t,r)}}:{}}),{[z]:this});for(const i of this.sortedExtensionReps())i.build(r);return r}buildEditor(){let t=W;function e(){try{t()}finally{t=W}}const n=Object.assign(this.constructEditor(),{dispose:e,[Symbol.dispose]:e});return t=(0,r.Sd)(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const e=this.extensionNameMap.get(t.name);if(e)return e.extension!==t&&P(295,t.name),e}addEdge(t,e,n){const i=this.outgoingConfigEdges.get(t);i?i.set(e,n):this.outgoingConfigEdges.set(t,new Map([[e,n]]));const r=this.incomingEdges.get(e);r?r.add(t):this.incomingEdges.set(e,new Set([t]))}addExtension(t){void 0!==this._sortedExtensionReps&&P(296);const e=J(t),[n]=e;"string"!=typeof n.name&&P(297,typeof n.name);let i=this.extensionNameMap.get(n.name);if(void 0!==i&&i.extension!==n&&P(298,n.name),!i){i=new F(this,n),this.extensionNameMap.set(n.name,i);const t=this.conflicts.get(n.name);"string"==typeof t&&P(299,n.name,t);for(const e of n.conflictsWith||[])this.extensionNameMap.has(e)&&P(299,n.name,e),this.conflicts.set(e,n.name);for(const e of n.dependencies||[]){const t=J(e);this.addEdge(n.name,t[0].name,t.slice(1)),this.addExtension(t)}for(const[e,i]of n.peerDependencies||[])this.addEdge(n.name,e,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],e=(n,i)=>{let r=n.state;if(I(r))return;const o=n.extension.name;var s;A(r)||P(300,o,i||"[unknown]"),A(s=r)||P(304,String(s.id),String(0)),r=Object.assign(s,{id:1}),n.state=r;const l=this.outgoingConfigEdges.get(o);if(l)for(const t of l.keys()){const n=this.extensionNameMap.get(t);n&&e(n,o)}r=function(t){return function(t){return 1===t.id}(t)||P(305,String(t.id),String(1)),Object.assign(t,{id:2})}(r),n.state=r,t.push(n)};for(const n of this.extensionNameMap.values())A(n.state)&&e(n);for(const n of t)for(const[t,e]of this.outgoingConfigEdges.get(n.extension.name)||[])if(e.length>0){const n=this.extensionNameMap.get(t);if(n)for(const t of e)n.configs.add(t)}for(const[n,...i]of this.roots)if(i.length>0){const t=this.extensionNameMap.get(n.name);void 0===t&&P(301,n.name);for(const e of i)t.configs.add(e)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const e=this.sortedExtensionReps(),n=new AbortController,i=[()=>n.abort()],o=n.signal;for(const r of e){const e=r.register(t,o);e&&i.push(e)}for(const r of e){const e=r.afterRegistration(t);e&&i.push(e)}return(0,r.Sd)(...i)}buildCreateEditorArgs(){const t={},e=new Set,n=new Map,i=new Map,r={},o={},s=this.sortedExtensionReps();for(const a of s){const{extension:s}=a;if(void 0!==s.onError&&(t.onError=s.onError),void 0!==s.disableEvents&&(t.disableEvents=s.disableEvents),void 0!==s.parentEditor&&(t.parentEditor=s.parentEditor),void 0!==s.editable&&(t.editable=s.editable),void 0!==s.namespace&&(t.namespace=s.namespace),void 0!==s.$initialEditorState&&(t.$initialEditorState=s.$initialEditorState),s.nodes)for(const t of T(s)){if("function"!=typeof t){const e=n.get(t.replace);e&&P(302,s.name,t.replace.name,e.extension.name),n.set(t.replace,a)}e.add(t)}if(s.html){if(s.html.export)for(const[t,e]of s.html.export.entries())i.set(t,e);s.html.import&&Object.assign(r,s.html.import)}s.theme&&D(o,s.theme)}Object.keys(o).length>0&&(t.theme=o),e.size&&(t.nodes=[...e]);const l=Object.keys(r).length>0,c=i.size>0;(l||c)&&(t.html={},l&&(t.html.import=r),c&&(t.html.export=i));for(const a of s)a.init(t);return t.onError||(t.onError=j),t}}function V(t,e){const n=Z.fromEditor(t).extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}const $=new Set,q=(0,i.vE9)({build(t,e,n){const r=n.getDependency(O).output,o=_({watchedNodeKeys:new Map}),s=M(()=>{},()=>k(()=>{const t=s.peek(),{watchedNodeKeys:e}=o.value;let n,l=!1;r.value.read(()=>{if((0,i.vJq)())for(const[r,o]of e.entries()){if(0===o.size){e.delete(r);continue}const s=(0,i.nsf)(r),c=s&&s.isSelected()||!1;l=l||c!==(!!t&&t.has(r)),c&&(n=n||new Set,n.add(r))}}),!l&&n&&t&&n.size===t.size||(s.value=n)}));return{watchNodeKey:function(t){const e=function(t){return new x(t,void 0)}(()=>(s.value||$).has(t)),{watchedNodeKeys:n}=o.peek();let i=n.get(t);const r=void 0!==i;return i=i||new Set,i.add(e),r||(n.set(t,i),o.value={watchedNodeKeys:n}),e}}},dependencies:[O],name:"@lexical/extension/NodeSelection"});(0,i.guI)("INSERT_HORIZONTAL_RULE_COMMAND");class H extends i.Kp7{static getType(){return"horizontalrule"}static clone(t){return new H(t.__key)}static importJSON(t){return G().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:Y,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const e=document.createElement("hr");return(0,r.ZB)(e,t.theme.hr),e}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function Y(){return{node:G()}}function G(){return(0,i.phO)(H)}(0,i.vE9)({dependencies:[O,q],name:"@lexical/extension/HorizontalRule",nodes:[H],register(t,e,n){const{watchNodeKey:o}=n.getDependency(q).output,s=_({nodeSelections:new Map}),c=t._config.theme.hrSelected??"selected";return(0,r.Sd)(t.registerCommand(i.d8p,t=>{if((0,i.vAA)(t.target)){const e=(0,i.pJU)(t.target);if(function(t){return t instanceof H}(e))return function(t,e=!1){const n=(0,i.vJq)(),r=t.isSelected(),o=t.getKey();let s;e&&(0,i.RTZ)(n)?s=n:(s=(0,i.rUs)(),(0,i.n1P)(s)),r?s.delete(o):s.add(o)}(e,t.shiftKey),!0}return!1},i.AcJ),t.registerMutationListener(H,(e,n)=>{l(()=>{let n=!1;const{nodeSelections:i}=s.peek();for(const[r,s]of e.entries())if("destroyed"===s)i.delete(r),n=!0;else{const e=i.get(r),s=t.getElementByKey(r);e?e.domNode.value=s:(n=!0,i.set(r,{domNode:_(s),selectedSignal:o(r)}))}n&&(s.value={nodeSelections:i})})}),k(()=>{const t=[];for(const{domNode:e,selectedSignal:n}of s.value.nodeSelections.values())t.push(k(()=>{const t=e.value;t&&(n.value?(0,r.ZB)(t,c):(0,r.HE)(t,c))}));return(0,r.Sd)(...t)}))}}),(0,i.vE9)({build:(t,e,n)=>w(e),config:(0,i.lVE)({disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(t,e,n){const{disabled:o,maxIndent:s}=n.getOutput();return k(()=>{if(!o.value)return function(t,e){return(0,r.Sd)(t.registerCommand(i.OXk,e=>{const n=(0,i.vJq)();if(!(0,i.I2P)(n))return!1;e.preventDefault();const o=function(t){const e=t.getNodes();if((0,r.zD)(e,t=>(0,i.y68)(t)&&t.canIndent()?t:null).length>0)return!0;const n=t.anchor,o=t.focus,s=o.isBefore(n)?o:n,l=s.getNode(),c=(0,r.mB)(l);if(c.canIndent()){const t=c.getKey();let e=(0,i.uTE)();if(e.anchor.set(t,0,"element"),e.focus.set(t,0,"element"),e=(0,i.CaD)(e),e.anchor.is(s))return!0}return!1}(n)?e.shiftKey?i.sik:i.PiT:i.YW5;return t.dispatchCommand(o,void 0)},i.jZM),t.registerCommand(i.PiT,()=>{const t="number"==typeof e?e:e?e.peek():null;if(null==t)return!1;const n=(0,i.vJq)();if(!(0,i.I2P)(n))return!1;const o=n.getNodes().map(t=>(0,r.mB)(t).getIndent());return Math.max(...o)+1>=t},i.da8))}(t,s)})}})},12532(t,e,n){n.d(e,{x:()=>o});var i=n(94439),r=n(51609);function o({defaultSelection:t}){const[e]=(0,i.DF)();return(0,r.useEffect)(()=>{e.focus(()=>{const t=document.activeElement,n=e.getRootElement();null===n||null!==t&&n.contains(t)||n.focus({preventScroll:!0})},{defaultSelection:t})},[t,e]),null}},6246(t,e,n){n.d(e,{n:()=>u});var i=n(94439),r=n(48832),o=n(51609),s=n(10790);const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,c=l?o.useLayoutEffect:o.useEffect,a={tag:r.T40};function u({initialConfig:t,children:e}){const n=(0,o.useMemo)(()=>{const{theme:e,namespace:n,nodes:o,onError:s,editorState:c,html:u}=t,d=(0,i.Mx)(null,e),f=(0,r.ieJ)({editable:t.editable,html:u,namespace:n,nodes:o,onError:t=>s(t,f),theme:e});return function(t,e){if(null!==e)if(void 0===e)t.update(()=>{const e=(0,r.NiT)();if(e.isEmpty()){const n=(0,r.lJ7)();e.append(n);const i=l?document.activeElement:null;(null!==(0,r.vJq)()||null!==i&&i===t.getRootElement())&&n.select()}},a);else if(null!==e)switch(typeof e){case"string":{const n=t.parseEditorState(e);t.setEditorState(n,a);break}case"object":t.setEditorState(e,a);break;case"function":t.update(()=>{(0,r.NiT)().isEmpty()&&e(t)},a)}}(f,c),[f,d]},[]);return c(()=>{const e=t.editable,[i]=n;i.setEditable(void 0===e||e)},[]),(0,s.jsx)(i.Gu.Provider,{value:n,children:e})}},94439(t,e,n){n.d(e,{DF:()=>s,Gu:()=>r,Mx:()=>o});var i=n(51609);const r=(0,i.createContext)(null);function o(t,e){let n=null;return null!=t&&(n=t[1]),{getTheme:function(){return null!=e?e:null!=n?n.getTheme():null}}}function s(){const t=(0,i.useContext)(r);return null==t&&function(t,...e){const n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const r of e)i.append("v",r);throw n.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),t}},60083(t,e,n){n.d(e,{a:()=>d});var i=n(94439),r=n(51609),o=n(10790),s=n(85745),l=n(73105);const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,a=(0,r.forwardRef)(function({editor:t,ariaActiveDescendant:e,ariaAutoComplete:n,ariaControls:i,ariaDescribedBy:s,ariaErrorMessage:l,ariaExpanded:a,ariaInvalid:u,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:h,ariaOwns:g,ariaRequired:p,autoCapitalize:_,className:m,id:y,role:v="textbox",spellCheck:x=!0,style:S,tabIndex:C,"data-testid":b,...E},k){const[w,N]=(0,r.useState)(t.isEditable()),T=(0,r.useCallback)(e=>{t.setRootElement(e&&e.ownerDocument&&e.ownerDocument.defaultView?e:null)},[t]),M=(0,r.useMemo)(()=>function(...t){return e=>{for(const n of t)"function"==typeof n?n(e):null!=n&&(n.current=e)}}(k,T),[T,k]);return c(()=>(N(t.isEditable()),t.registerEditableListener(t=>{N(t)})),[t]),(0,o.jsx)("div",{"aria-activedescendant":w?e:void 0,"aria-autocomplete":w?n:"none","aria-controls":w?i:void 0,"aria-describedby":s,...null!=l?{"aria-errormessage":l}:{},"aria-expanded":w&&"combobox"===v?!!a:void 0,...null!=u?{"aria-invalid":u}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":h,"aria-owns":w?g:void 0,"aria-readonly":!w||void 0,"aria-required":p,autoCapitalize:_,className:m,contentEditable:w,"data-testid":b,id:y,ref:M,role:v,spellCheck:x,style:S,tabIndex:C,...E})});function u(t){return t.getEditorState().read((0,s.yl)(t.isComposing()))}const d=(0,r.forwardRef)(function(t,e){const{placeholder:n,...r}=t,[s]=(0,i.DF)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a,{editor:s,...r,ref:e}),null!=n&&(0,o.jsx)(f,{editor:s,content:n})]})});function f({content:t,editor:e}){const n=function(t){const[e,n]=(0,r.useState)(()=>u(t));return c(()=>{function e(){const e=u(t);n(e)}return e(),(0,l.Sd)(t.registerUpdateListener(()=>{e()}),t.registerEditableListener(()=>{e()}))},[t]),e}(e),[i,s]=(0,r.useState)(e.isEditable());if((0,r.useLayoutEffect)(()=>(s(e.isEditable()),e.registerEditableListener(t=>{s(t)})),[e]),!n)return null;let a=null;return"function"==typeof t?a=t(i):null!==t&&(a=t),null===a?null:(0,o.jsx)("div",{"aria-hidden":!0,children:a})}},16191(t,e,n){n.d(e,{G:()=>o});var i=n(94439),r=n(51609);function o({editorRef:t}){const[e]=(0,i.DF)();return r.useEffect(()=>{"function"==typeof t?t(e):"object"==typeof t&&(t.current=e)},[e]),null}},59798(t,e,n){n.d(e,{R:()=>o});var i=n(94177),r=n(10790);function o({children:t,onError:e}){return(0,r.jsx)(i.tH,{fallback:(0,r.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:t})}},40290(t,e,n){n.d(e,{G:()=>d});var i=n(94439),r=n(38129),o=n(73105),s=n(48832);function l(t){t.undoStack=[],t.redoStack=[],t.current=null}function c(t,e,n){const i=function(t,e){let n=Date.now(),i=0;return(r,o,l,c,a,u)=>{const d=Date.now();if(u.has(s.n0X))return i=0,n=d,2;const f=function(t,e,n,i,r){if(null===t||0===n.size&&0===i.size&&!r)return 0;const o=e._selection,l=t._selection;if(r)return 1;if(!((0,s.I2P)(o)&&(0,s.I2P)(l)&&l.isCollapsed()&&o.isCollapsed()))return 0;const c=function(t,e,n){const i=t._nodeMap,r=[];for(const o of e){const t=i.get(o);void 0!==t&&r.push(t)}for(const[o,l]of n){if(!l)continue;const t=i.get(o);void 0===t||(0,s.hVZ)(t)||r.push(t)}return r}(e,n,i);if(0===c.length)return 0;if(c.length>1){const n=e._nodeMap,i=n.get(o.anchor.key),r=n.get(l.anchor.key);return i&&r&&!t._nodeMap.has(i.__key)&&(0,s.kFe)(i)&&1===i.__text.length&&1===o.anchor.offset?2:0}const a=c[0],u=t._nodeMap.get(a.__key);if(!(0,s.kFe)(u)||!(0,s.kFe)(a)||u.__mode!==a.__mode)return 0;const d=u.__text,f=a.__text;if(d===f)return 0;const h=o.anchor,g=l.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,_=g.offset,m=f.length-d.length;return 1===m&&_===p-1?2:-1===m&&_===p+1?3:-1===m&&_===p?4:0}(r,o,c,a,t.isComposing()),h=(()=>{const h=null===l||l.editor===t,g=u.has(s.bMH);if(!g&&h&&u.has(s.T40))return 0;if(null===r)return 1;if(!(c.size>0||a.size>0))return null!==o._selection?0:2;const p="number"==typeof e?e:e.peek();return!1===g&&0!==f&&f===i&&d<n+p&&h||1===c.size&&function(t,e,n){const i=e._nodeMap.get(t),r=n._nodeMap.get(t),o=e._selection,l=n._selection;return!((0,s.I2P)(o)&&(0,s.I2P)(l)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===l.anchor.type&&"text"===l.focus.type||!(0,s.kFe)(i)||!(0,s.kFe)(r)||i.__parent!==r.__parent)&&JSON.stringify(e.read(()=>i.exportJSON()))===JSON.stringify(n.read(()=>r.exportJSON()))}(Array.from(c)[0],r,o)?0:1})();return n=d,i=f,h}}(t,n),r=(0,o.Sd)(t.registerCommand(s.ZKf,()=>(function(t,e){const n=e.redoStack,i=e.undoStack;if(0!==i.length){const r=e.current,o=i.pop();null!==r&&(n.push(r),t.dispatchCommand(s.WWb,!0)),0===i.length&&t.dispatchCommand(s.KfJ,!1),e.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:s.n0X})}}(t,e),!0),s.jZM),t.registerCommand(s.V30,()=>(function(t,e){const n=e.redoStack;if(0!==n.length){const i=e.current;null!==i&&(e.undoStack.push(i),t.dispatchCommand(s.KfJ,!0));const r=n.pop();0===n.length&&t.dispatchCommand(s.WWb,!1),e.current=r||null,r&&r.editor.setEditorState(r.editorState,{tag:s.n0X})}}(t,e),!0),s.jZM),t.registerCommand(s.SKc,()=>(l(e),!1),s.jZM),t.registerCommand(s.t5V,()=>(l(e),t.dispatchCommand(s.WWb,!1),t.dispatchCommand(s.KfJ,!1),!0),s.jZM),t.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:o,dirtyElements:l,tags:c})=>{const a=e.current,u=e.redoStack,d=e.undoStack;if(null!==a&&n===(null===a?null:a.editorState))return;const f=i(r,n,a,o,l,c);if(1===f)0!==u.length&&(e.redoStack=[],t.dispatchCommand(s.WWb,!1)),null!==a&&(d.push({...a}),t.dispatchCommand(s.KfJ,!0));else if(2===f)return;e.current={editor:t,editorState:n}}));return r}const a=(0,s.vE9)({build:(t,{delay:e,createInitialHistoryState:n,disabled:i})=>(0,r.v)({delay:e,disabled:i,historyState:n(t)}),config:(0,s.lVE)({createInitialHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},delay:300,disabled:"undefined"==typeof window}),name:"@lexical/history/History",register:(t,e,n)=>{const i=n.getOutput();return(0,r.QZ)(()=>i.disabled.value?void 0:c(t,i.historyState.value,i.delay))}});(0,s.vE9)({dependencies:[(0,s.O0w)(a,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(t,e,n){const{output:i}=n.getDependency(a),o=function(t){return t?(0,r.xT)(t,a.name):null}(t._parentEditor);if(!o)return()=>{};const s=o.output;return(0,r.QZ)(()=>(0,r.vA)(()=>{i.delay.value=s.delay.value,i.historyState.value=s.historyState.value,i.disabled.value=s.disabled.value}))}});var u=n(51609);function d({delay:t,externalHistoryState:e}){const[n]=(0,i.DF)();return function(t,e,n=1e3){const i=(0,u.useMemo)(()=>e||{current:null,redoStack:[],undoStack:[]},[e]);(0,u.useEffect)(()=>c(t,i,n),[n,t,i])}(n,e,t),null}},45838(t,e,n){n.d(e,{D:()=>l});var i=n(94439),r=n(48832),o=n(51609);const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function l({ignoreHistoryMergeTagChange:t=!0,ignoreSelectionChange:e=!1,onChange:n}){const[o]=(0,i.DF)();return s(()=>{if(n)return o.registerUpdateListener(({editorState:i,dirtyElements:s,dirtyLeaves:l,prevEditorState:c,tags:a})=>{e&&0===s.size&&0===l.size||t&&a.has(r.T40)||c.isEmpty()||n(i,o,a)})},[o,t,e,n]),null}},17784(t,e,n){n.d(e,{h:()=>I});var i=n(94439),r=n(51609);const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;function s(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}var l=n(38129),c=n(48832);const a=(0,c.vE9)({name:"@lexical/react/ReactProvider"});var u=n(75795),d=n(10790),f=n(85745),h=n(73105);function g(t){const e=window.location.origin,n=n=>{if(n.origin!==e)return;const i=t.getRootElement();if(document.activeElement!==i)return;const r=n.data;if("string"==typeof r){let e;try{e=JSON.parse(r)}catch(t){return}if(e&&"nuanria_messaging"===e.protocol&&"request"===e.type){const i=e.payload;if(i&&"makeChanges"===i.functionId){const e=i.args;if(e){const[i,r,o,s,l]=e;t.update(()=>{const t=(0,c.vJq)();if((0,c.I2P)(t)){const e=t.anchor;let a=e.getNode(),u=0,d=0;if((0,c.kFe)(a)&&i>=0&&r>=0&&(u=i,d=i+r,t.setTextNodeRange(a,u,a,d)),u===d&&""===o||(t.insertRawText(o),a=e.getNode()),(0,c.kFe)(a)){u=s,d=s+l;const e=a.getTextContentSize();u=u>e?e:u,d=d>e?e:d,t.setTextNodeRange(a,u,a,d)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const p=(0,c.vE9)({build:(t,e,n)=>(0,l.v)(e),config:(0,c.lVE)({disabled:"undefined"==typeof window}),name:"@lexical/dragon",register:(t,e,n)=>(0,l.QZ)(()=>n.getOutput().disabled.value?void 0:g(t))});var _=n(27639);function m(t,e,n,i=null){let r=null===i||e.isSelected(i);const o=(0,c.ff4)(e)&&e.excludeFromCopy("html");let s=e;null!==i&&(0,c.kFe)(e)&&(s=(0,_.SD)(i,e,"clone"));const l=(0,c.ff4)(s)?s.getChildren():[],a=(0,c.Jvg)(t,s.getType());let u;u=a&&void 0!==a.exportDOM?a.exportDOM(t,s):s.exportDOM(t);const{element:d,after:f}=u;if(!d)return!1;const h=document.createDocumentFragment();for(let g=0;g<l.length;g++){const n=l[g],o=m(t,n,h,i);!r&&(0,c.ff4)(e)&&o&&e.extractWithChild(n,i,"html")&&(r=!0)}if(r&&!o){if(((0,c.sby)(d)||(0,c.K8K)(d))&&d.append(h),n.append(d),f){const t=f.call(s,d);t&&((0,c.K8K)(d)?d.replaceChildren(t):d.replaceWith(t))}}else n.append(h);return r}function y(t,e){const n=t.getData("text/plain")||t.getData("text/uri-list");null!=n&&e.insertRawText(n)}new Set(["STYLE","SCRIPT"]);const v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,x=v&&"documentMode"in document?document.documentMode:null,S=v&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),C=!(!v||!("InputEvent"in window)||x)&&"getTargetRanges"in new window.InputEvent("input"),b=v&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),E=v&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,k=v&&/^(?=.*Chrome).*/i.test(navigator.userAgent),w=v&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&S&&!k;function N(t,e){e.update(()=>{if(null!==t){const n=(0,h.xj)(t,KeyboardEvent)?null:t.clipboardData,i=(0,c.vJq)();if(null!==i&&!i.isCollapsed()&&null!=n){t.preventDefault();const r=function(t,e=(0,c.vJq)()){return null==e&&function(t,...e){const n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const r of e)i.append("v",r);throw n.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(166),(0,c.I2P)(e)&&e.isCollapsed()||0===e.getNodes().length?"":function(t,e){if("undefined"==typeof document||"undefined"==typeof window&&void 0===globalThis.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),i=(0,c.NiT)().getChildren();for(let r=0;r<i.length;r++)m(t,i[r],n,e);return n.innerHTML}(t,e)}(e);null!==r&&n.setData("text/html",r),n.setData("text/plain",i.getTextContent())}}})}function T(t){return(0,h.Sd)(t.registerCommand(c.WuB,t=>{const e=(0,c.vJq)();return!!(0,c.I2P)(e)&&(e.deleteCharacter(t),!0)},c.jZM),t.registerCommand(c.hi0,t=>{const e=(0,c.vJq)();return!!(0,c.I2P)(e)&&(e.deleteWord(t),!0)},c.jZM),t.registerCommand(c.viC,t=>{const e=(0,c.vJq)();return!!(0,c.I2P)(e)&&(e.deleteLine(t),!0)},c.jZM),t.registerCommand(c.bM3,t=>{const e=(0,c.vJq)();if(!(0,c.I2P)(e))return!1;if("string"==typeof t)e.insertText(t);else{const n=t.dataTransfer;if(null!=n)y(n,e);else{const n=t.data;n&&e.insertText(n)}}return!0},c.jZM),t.registerCommand(c.$ey,()=>{const t=(0,c.vJq)();return!!(0,c.I2P)(t)&&(t.removeText(),!0)},c.jZM),t.registerCommand(c.FEN,t=>{const e=(0,c.vJq)();return!!(0,c.I2P)(e)&&(e.insertLineBreak(t),!0)},c.jZM),t.registerCommand(c.XKQ,()=>{const t=(0,c.vJq)();return!!(0,c.I2P)(t)&&(t.insertLineBreak(),!0)},c.jZM),t.registerCommand(c.AX0,t=>{const e=(0,c.vJq)();if(!(0,c.I2P)(e))return!1;const n=t,i=n.shiftKey;return!!(0,_.Cb)(e,!0)&&(n.preventDefault(),(0,_.Rk)(e,i,!0),!0)},c.jZM),t.registerCommand(c.JM3,t=>{const e=(0,c.vJq)();if(!(0,c.I2P)(e))return!1;const n=t,i=n.shiftKey;return!!(0,_.Cb)(e,!1)&&(n.preventDefault(),(0,_.Rk)(e,i,!1),!0)},c.jZM),t.registerCommand(c.gCZ,e=>{const n=(0,c.vJq)();return!!(0,c.I2P)(n)&&(!E||"ko-KR"!==navigator.language)&&(e.preventDefault(),t.dispatchCommand(c.WuB,!0))},c.jZM),t.registerCommand(c.w$Z,e=>{const n=(0,c.vJq)();return!!(0,c.I2P)(n)&&(e.preventDefault(),t.dispatchCommand(c.WuB,!1))},c.jZM),t.registerCommand(c.RTo,e=>{const n=(0,c.vJq)();if(!(0,c.I2P)(n))return!1;if(null!==e){if((E||b||w)&&C)return!1;e.preventDefault()}return t.dispatchCommand(c.FEN,!1)},c.jZM),t.registerCommand(c.HYn,()=>((0,c.e1k)(),!0),c.jZM),t.registerCommand(c.u5G,e=>{const n=(0,c.vJq)();return!!(0,c.I2P)(n)&&(N(e,t),!0)},c.jZM),t.registerCommand(c.VSO,e=>{const n=(0,c.vJq)();return!!(0,c.I2P)(n)&&(function(t,e){N(t,e),e.update(()=>{const t=(0,c.vJq)();(0,c.I2P)(t)&&t.removeText()})}(e,t),!0)},c.jZM),t.registerCommand(c.waI,e=>{const n=(0,c.vJq)();return!!(0,c.I2P)(n)&&(function(t,e){t.preventDefault(),e.update(()=>{const e=(0,c.vJq)(),n=(0,h.xj)(t,ClipboardEvent)?t.clipboardData:null;null!=n&&(0,c.I2P)(e)&&y(n,e)},{tag:c.fwY})}(e,t),!0)},c.jZM),t.registerCommand(c.Sr4,t=>{const e=(0,c.vJq)();return!!(0,c.I2P)(e)&&(t.preventDefault(),!0)},c.jZM),t.registerCommand(c.TgX,t=>{const e=(0,c.vJq)();return!!(0,c.I2P)(e)&&(t.preventDefault(),!0)},c.jZM))}function M(t,...e){const n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const r of e)i.append("v",r);throw n.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(0,c.vE9)({conflictsWith:["@lexical/rich-text"],dependencies:[p],name:"@lexical/plain-text",register:T});const O="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;function P({editor:t,ErrorBoundary:e}){return function(t,e){const[n,i]=(0,r.useState)(()=>t.getDecorators());return O(()=>t.registerDecoratorListener(t=>{(0,u.flushSync)(()=>{i(t)})}),[t]),(0,r.useEffect)(()=>{i(t.getDecorators())},[t]),(0,r.useMemo)(()=>{const i=[],o=Object.keys(n);for(let s=0;s<o.length;s++){const l=o[s],c=(0,d.jsx)(e,{onError:e=>t._onError(e),children:(0,d.jsx)(r.Suspense,{fallback:null,children:n[l]})}),a=t.getElementByKey(l);null!==a&&i.push((0,u.createPortal)(c,a,l))}return i},[e,n,t])}(t,e)}function D({editor:t,ErrorBoundary:e}){return function(t){const e=l.iZ.maybeFromEditor(t);if(e&&e.hasExtensionByName(a.name)){for(const t of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(t)&&M(320,t);return!0}return!1}(t)?null:(0,d.jsx)(P,{editor:t,ErrorBoundary:e})}function A(t){return t.getEditorState().read((0,f.yl)(t.isComposing()))}function I({contentEditable:t,placeholder:e=null,ErrorBoundary:n}){const[r]=(0,i.DF)();return O(()=>(0,h.Sd)(T(o),g(o)),[o=r]),(0,d.jsxs)(d.Fragment,{children:[t,(0,d.jsx)(L,{content:e}),(0,d.jsx)(D,{editor:r,ErrorBoundary:n})]});var o}function L({content:t}){const[e]=(0,i.DF)(),n=function(t){const[e,n]=(0,r.useState)(()=>A(t));return O(()=>{function e(){const e=A(t);n(e)}return e(),(0,h.Sd)(t.registerUpdateListener(()=>{e()}),t.registerEditableListener(()=>{e()}))},[t]),e}(e),l=function(t){const[e]=(0,i.DF)(),n=(0,r.useMemo)(()=>t(e),[e,t]),[s,l]=(0,r.useState)(()=>n.initialValueFn()),c=(0,r.useRef)(s);return o(()=>{const{initialValueFn:t,subscribe:e}=n,i=t();return c.current!==i&&(c.current=i,l(i)),e(t=>{c.current=t,l(t)})},[n,t]),s}(s);return n?"function"==typeof t?t(l):t:null}},95591(t,e,n){n.d(e,{BB:()=>s,GZ:()=>c});var i=n(94439),r=n(48832),o=n(51609);n(75795),n(10790),"undefined"!=typeof window&&void 0!==window.document&&window;class s{key;ref;icon;title;constructor(t){this.key=t,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(t){this.ref={current:t}}}function l(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return n.top>=i.top-6&&n.top<=i.bottom+6}function c(t,e,n,r){const[s]=(0,i.DF)();(0,o.useEffect)(()=>{if(null!=e&&null!=t){const t=s.getRootElement(),i=null!=t?function(t){let e=getComputedStyle(t);const n="absolute"===e.position,i=/(auto|scroll)/;if("fixed"===e.position)return document.body;for(let r=t;r=r.parentElement;)if(e=getComputedStyle(r),(!n||"static"!==e.position)&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.body}(t):document.body;let o=!1,c=l(e,i);const a=function(){o||(window.requestAnimationFrame(function(){n(),o=!1}),o=!0);const t=l(e,i);t!==c&&(c=t,null!=r&&r(t))},u=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",a,{capture:!0,passive:!0}),u.observe(e),()=>{u.unobserve(e),window.removeEventListener("resize",n),document.removeEventListener("scroll",a,!0)}}},[e,s,r,n,t])}(0,r.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND"),(0,r.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND")},27639(t,e,n){n.d(e,{Cb:()=>a,Rk:()=>d,SD:()=>o,_A:()=>s});var i=n(48832);function r(t){const e=(0,i.i0_)().getElementByKey(t.getKey());if(null===e)return null;const n=e.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(e)}function o(t,e,n="self"){const r=t.getStartEndPoints();if(e.isSelected(t)&&!(0,i.Rb_)(e)&&null!==r){const[o,s]=r,l=t.isBackward(),c=o.getNode(),a=s.getNode(),u=e.is(c),d=e.is(a);if(u||d){const[r,o]=(0,i.Cku)(t),s=c.is(a),u=e.is(l?a:c),d=e.is(l?c:a);let f,h=0;s?(h=r>o?o:r,f=r>o?r:o):u?(h=l?o:r,f=void 0):d&&(h=0,f=l?r:o);const g=e.__text.slice(h,f);g!==e.__text&&("clone"===n&&(e=(0,i.U5P)(e)),e.__text=g)}}return e}function s(t,e,n){let r=e.getNode(),o=n;if((0,i.ff4)(r)){const t=r.getDescendantByIndex(e.offset);null!==t&&(r=t)}for(;o>0&&null!==r;){if((0,i.ff4)(r)){const t=r.getLastDescendant();null!==t&&(r=t)}let n=r.getPreviousSibling(),s=0;if(null===n){let t=r.getParentOrThrow(),e=t.getPreviousSibling();for(;null===e;){if(t=t.getParent(),null===t){n=null;break}e=t.getPreviousSibling()}null!==t&&(s=t.isInline()?0:2,n=e)}let l=r.getTextContent();""===l&&(0,i.ff4)(r)&&!r.isInline()&&(l="\n\n");const c=l.length;if(!(0,i.kFe)(r)||o>=c){const t=r.getParent();r.remove(),null==t||0!==t.getChildrenSize()||(0,i.hVZ)(t)||t.remove(),o-=c+s,r=n}else{const n=r.getKey(),s=t.getEditorState().read(()=>{const t=(0,i.nsf)(n);return(0,i.kFe)(t)&&t.isSimpleText()?t.getTextContent():null}),a=c-o,u=l.slice(0,a);if(null!==s&&s!==l){const t=(0,i.S1w)();let e=r;if(r.isSimpleText())r.setTextContent(s);else{const t=(0,i.sTu)(s);r.replace(t),e=t}if((0,i.I2P)(t)&&t.isCollapsed()){const n=t.anchor.offset;e.select(n,n)}}else if(r.isSimpleText()){const t=e.key===n;let i=e.offset;i<o&&(i=c);const s=t?i-o:0,l=t?i:a;if(t&&0===s){const[t]=r.splitText(s,l);t.remove()}else{const[,t]=r.splitText(s,l);t.remove()}}else{const t=(0,i.sTu)(u);r.replace(t)}o=0}}}function l(t){const e=c(t);return null!==e&&"vertical-rl"===e.writingMode}function c(t){const e=t.anchor.getNode();return(0,i.ff4)(e)?r(e):function(t){return r((0,i.hVZ)(t)?t:t.getParentOrThrow())}(e)}function a(t,e){let n=l(t)?!e:e;u(t)&&(n=!n);const r=(0,i.Ave)(t.focus,n?"previous":"next");if((0,i.pGK)(r))return!1;for(const o of(0,i.mWO)(r)){if((0,i.cmH)(o))return!o.origin.isInline();if(!(0,i.ff4)(o.origin)){if((0,i.Cyw)(o.origin))return!0;break}}return!1}function u(t){const e=c(t);return null!==e&&"rtl"===e.direction}function d(t,e,n){const i=u(t);let r;r=l(t)||i?!n:n,function(t,e,n){t.modify(e?"extend":"move",n,"character")}(t,e,r)}new Map},85745(t,e,n){n.d(e,{yl:()=>r});var i=n(48832);function r(t){return()=>function(t){if(!function(t,e=!0){if(t)return!1;let n=(0,i.NiT)().getTextContent();return e&&(n=n.trim()),""===n}(t,!1))return!1;const e=(0,i.NiT)().getChildren(),n=e.length;if(n>1)return!1;for(let r=0;r<n;r++){const t=e[r];if((0,i.Cyw)(t))return!1;if((0,i.ff4)(t)){if(!(0,i.bSg)(t))return!1;if(0!==t.__indent)return!1;const e=t.getChildren(),n=e.length;for(let t=0;t<n;t++)if(!(0,i.kFe)(e[r]))return!1}}return!0}(t)}},73105(t,e,n){n.d(e,{HE:()=>a,Sd:()=>l,Xq:()=>d,ZB:()=>c,mB:()=>u,xj:()=>f,zD:()=>h});var i=n(48832);const r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,o=r&&"documentMode"in document?document.documentMode:null;function s(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}function l(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}function c(t,...e){const n=s(...e);n.length>0&&t.classList.add(...n)}function a(t,...e){const n=s(...e);n.length>0&&t.classList.remove(...n)}function u(t){const e=(0,i.BtT)(t,t=>(0,i.ff4)(t)&&!t.isInline());return(0,i.ff4)(e)||function(t,...e){const n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const r of e)i.append("v",r);throw n.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(4,t.__key),e}function d(t,e){const n=new Map,r=t._pendingEditorState;for(const[s,l]of e._nodeMap)n.set(s,(0,i.BEs)(l));r&&(r._nodeMap=n),t._dirtyType=2;const o=e._selection;(0,i.n1P)(null===o?null:o.clone())}function f(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}function h(t,e){const n=[];for(let i=0;i<t.length;i++){const r=e(t[i]);null!==r&&n.push(r)}return n}r&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),r&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!r||!("InputEvent"in window)||o)&&new window.InputEvent("input"),r&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),r&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window,r&&/Android/.test(navigator.userAgent),r&&/^(?=.*Chrome).*/i.test(navigator.userAgent),r&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)},48832(t,e,n){function i(t,...e){const n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const r of e)i.append("v",r);throw n.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(t,...e){const n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const r of e)i.append("v",r);n.search=i.toString()}n.d(e,{$7r:()=>Oe,$ey:()=>Gt,AX0:()=>se,AcJ:()=>gr,Ave:()=>Ts,BEs:()=>Zo,BtT:()=>Go,CaD:()=>ot,Cku:()=>ii,Cyw:()=>tr,Ey8:()=>An,FEN:()=>$t,GRK:()=>Cn,HYn:()=>ke,I2P:()=>Qn,JM3:()=>re,Jvg:()=>Er,K8K:()=>Ro,KfJ:()=>Me,Kp7:()=>Qi,MZu:()=>Zn,NiT:()=>$r,O0w:()=>Ws,OXk:()=>pe,PiT:()=>me,Q$N:()=>he,R18:()=>ie,RTZ:()=>ei,RTo:()=>ue,Rb_:()=>Ar,S1w:()=>mi,SKc:()=>we,Sr4:()=>ve,T40:()=>xn,Tc1:()=>Js,TgX:()=>xe,U5P:()=>Vo,UDz:()=>ce,V30:()=>ne,VSO:()=>Ee,VwU:()=>Do,WWb:()=>Te,WuB:()=>Vt,XKQ:()=>qt,YW5:()=>_e,ZKf:()=>ee,bM3:()=>Ht,bMH:()=>vn,bSg:()=>fr,bbF:()=>ae,cmH:()=>cs,d8p:()=>Wt,da8:()=>pr,e1k:()=>uo,fD3:()=>ar,ff4:()=>Gi,fwY:()=>Sn,gCZ:()=>fe,guI:()=>Bt,hVZ:()=>nr,haT:()=>er,hi0:()=>Xt,i0_:()=>Wo,ieJ:()=>yr,jZM:()=>hr,kFe:()=>Jn,lJ7:()=>dr,lVE:()=>js,mWO:()=>xs,n0X:()=>yn,n1P:()=>Hr,nsf:()=>Wr,pGK:()=>Rs,pJU:()=>jr,phO:()=>Yo,rUs:()=>gi,sTu:()=>jn,sby:()=>Lo,sik:()=>ye,t5V:()=>Ne,u5G:()=>be,uTE:()=>hi,v0B:()=>sr,vAA:()=>Fo,vE9:()=>zs,vJq:()=>_i,viC:()=>Qt,w$Z:()=>ge,waI:()=>Yt,y68:()=>di});const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,s=o&&"documentMode"in document?document.documentMode:null,l=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),c=o&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),a=!(!o||!("InputEvent"in window)||s)&&"getTargetRanges"in new window.InputEvent("input"),u=o&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),d=o&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,f=o&&/Android/.test(navigator.userAgent),h=o&&/^(?=.*Chrome).*/i.test(navigator.userAgent),g=o&&f&&h,p=o&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&l&&!h;function _(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}const m=0,y=1,v=2,x=1,S=2,C=3,b=4,E=5,k=6,w=u||d||p?"\xa0":"\u200b",N="\n\n",T=c?"\xa0":w,M="\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc",O="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff",P=(new RegExp("^[^"+O+"]*["+M+"]"),new RegExp("^[^"+M+"]*["+O+"]"),{bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512}),D={directionless:1,unmergeable:2},A={center:2,end:6,justify:4,left:1,right:3,start:5},I={[S]:"center",[k]:"end",[b]:"justify",[x]:"left",[C]:"right",[E]:"start"},L={normal:0,segmented:2,token:1},F={[m]:"normal",[v]:"segmented",[y]:"token"},R="$config";function K(t,e,n,i,r,o){let s=t.getFirstChild();for(;null!==s;){const t=s.__key;s.__parent===e&&(Gi(s)&&K(s,t,n,i,r,o),n.has(t)||o.delete(t),r.push(t)),s=s.getNextSibling()}}let B=!1,z=0;function W(t){z=t.timeStamp}function j(t,e,n){const i="BR"===t.nodeName,r=e.__lexicalLineBreak;return r&&(t===r||i&&t.previousSibling===r)||i&&void 0!==Jr(t,n)}function J(t,e,n){const i=Do(n);let r=null,o=null;null!==i&&i.anchorNode===t&&(r=i.anchorOffset,o=i.focusOffset);const s=t.nodeValue;null!==s&&no(e,s,r,o,!1)}function U(t,e,n){if(Qn(t)){const e=t.anchor.getNode();if(e.is(n)&&t.format!==e.getFormat())return!1}return Ir(e)&&n.isAttached()}function Z(t,e,n,i){for(let r=t;r&&!$o(r);r=xo(r)){const t=Jr(r,e);if(void 0!==t){const e=Wr(t,n);if(e)return tr(e)||!Lo(r)?void 0:[r,e]}else if(r===i)return[i,qr(n)]}}function V(t,e,n){B=!0;const i=performance.now()-z>100;try{$i(t,()=>{const r=_i()||function(t){return t.getEditorState().read(()=>{const t=_i();return null!==t?t.clone():null})}(t),o=new Map,s=t.getRootElement(),l=t._editorState,a=t._blockCursorElement;let u=!1,d="";for(let n=0;n<e.length;n++){const f=e[n],h=f.type,g=f.target,p=Z(g,t,l,s);if(!p)continue;const[_,m]=p;if("characterData"===h)i&&Jn(m)&&Ir(g)&&U(r,g,m)&&J(g,m,t);else if("childList"===h){u=!0;const e=f.addedNodes;for(let r=0;r<e.length;r++){const n=e[r],i=jr(n),o=n.parentNode;if(null!=o&&n!==a&&null===i&&!j(n,o,t)){if(c){const t=(Lo(n)?n.innerText:null)||n.nodeValue;t&&(d+=t)}o.removeChild(n)}}const n=f.removedNodes,i=n.length;if(i>0){let e=0;for(let r=0;r<i;r++){const i=n[r];(j(i,g,t)||a===i)&&(g.appendChild(i),e++)}i!==e&&o.set(_,m)}}}if(o.size>0)for(const[e,n]of o)n.reconcileObservedMutation(e,t);const f=n.takeRecords();if(f.length>0){for(let e=0;e<f.length;e++){const n=f[e],i=n.addedNodes,r=n.target;for(let e=0;e<i.length;e++){const n=i[e],o=n.parentNode;null==o||"BR"!==n.nodeName||j(n,r,t)||o.removeChild(n)}}n.takeRecords()}null!==r&&(u&&Hr(r),c&&po(t)&&r.insertRawText(d))})}finally{B=!1}}function $(t){const e=t._observer;null!==e&&V(t,e.takeRecords(),e)}function q(t){!function(t){0===z&&Eo(t).addEventListener("textInput",W,!0)}(t),t._observer=new MutationObserver((e,n)=>{V(t,e,n)})}function H(t){const e=new Map,n=new Set;for(let i="function"==typeof t?t:t.replace;i.prototype&&void 0!==i.prototype.getType;i=Object.getPrototypeOf(i)){const{ownNodeConfig:t}=Ho(i);if(t&&t.stateConfigs)for(const i of t.stateConfigs){let t;"stateConfig"in i?(t=i.stateConfig,i.flat&&n.add(t.key)):t=i,e.set(t.key,t)}}return{flatKeys:n,sharedConfigMap:e}}class Y{node;knownState;unknownState;sharedNodeState;size;constructor(t,e,n=void 0,i=new Map,r=void 0){this.node=t,this.sharedNodeState=e,this.unknownState=n,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,s=void 0!==r?r:function(t,e,n){let i=n.size;if(e)for(const r in e){const e=t.get(r);e&&n.has(e)||i++}return i}(o,n,i);this.size=s}getValue(t){const e=this.knownState.get(t);if(void 0!==e)return e;this.sharedNodeState.sharedConfigMap.set(t.key,t);let n=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const e=this.unknownState[t.key];void 0!==e&&(n=t.parse(e)),this.updateFromKnown(t,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},e={};for(const[n,i]of this.knownState)n.isEqual(i,n.defaultValue)?delete t[n.key]:t[n.key]=n.unparse(i);for(const n of this.sharedNodeState.flatKeys)n in t&&(e[n]=t[n],delete t[n]);return X(t)&&(e.$=t),e}getWritable(t){if(this.node===t)return this;const{sharedNodeState:e,unknownState:n}=this,i=new Map(this.knownState);return new Y(t,e,function(t,e,n){let i;if(n)for(const[r,o]of Object.entries(n)){const n=t.get(r);n?e.has(n)||e.set(n,n.parse(o)):(i=i||{},i[r]=o)}return i}(e.sharedConfigMap,i,n),i,this.size)}updateFromKnown(t,e){const n=t.key;this.sharedNodeState.sharedConfigMap.set(n,t);const{knownState:i,unknownState:r}=this;i.has(t)||r&&n in r||(r&&(delete r[n],this.unknownState=X(r)),this.size++),i.set(t,e)}updateFromUnknown(t,e){const n=this.sharedNodeState.sharedConfigMap.get(t);n?this.updateFromKnown(n,n.parse(e)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=e)}updateFromJSON(t){const{knownState:e}=this;for(const n of e.keys())e.set(n,n.defaultValue);if(this.size=e.size,this.unknownState=void 0,t)for(const[n,i]of Object.entries(t))this.updateFromUnknown(n,i)}}function G(t){return t.__state?t.__state.sharedNodeState:br(Wo(),t.getType()).sharedNodeState}function X(t){if(t)for(const e in t)return t}function Q(t,e,n){for(const[i,r]of e.knownState){if(t.has(i.key))continue;t.add(i.key);const e=n?n.getValue(i):i.defaultValue;if(e!==r&&!i.isEqual(e,r))return!0}return!1}function tt(t,e,n){const{unknownState:i}=e,r=n?n.unknownState:void 0;if(i)for(const[o,s]of Object.entries(i))if(!t.has(o)&&(t.add(o),s!==(r?r[o]:void 0)))return!0;return!1}function et(t,e){const n=t.__state;return n&&n.node===t?n.getWritable(e):n}function nt(t,e){const n=t.__mode,i=t.__format,r=t.__style,o=t.__state,s=e.__state;return(null===n||n===e.__mode)&&(null===i||i===e.__format)&&(null===r||r===e.__style)&&(null===t.__state||o===s||function(t,e){if(t===e)return!0;if(t&&e&&t.size!==e.size)return!1;const n=new Set;return!(t&&Q(n,t,e)||e&&Q(n,e,t)||t&&tt(n,t,e)||e&&tt(n,e,t))}(o,s))}function it(t,e){const n=t.mergeWithSibling(e),i=Fi()._normalizedNodes;return i.add(t.__key),i.add(e.__key),n}function rt(t){let e,n,i=t;if(""!==i.__text||!i.isSimpleText()||i.isUnmergeable()){for(;null!==(e=i.getPreviousSibling())&&Jn(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(""!==e.__text){if(nt(e,i)){i=it(e,i);break}break}e.remove()}for(;null!==(n=i.getNextSibling())&&Jn(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(nt(i,n)){i=it(i,n);break}break}n.remove()}}else i.remove()}function ot(t){return st(t.anchor),st(t.focus),t}function st(t){for(;"element"===t.type;){const e=t.getNode(),n=t.offset;let i,r;if(n===e.getChildrenSize()?(i=e.getChildAtIndex(n-1),r=!0):(i=e.getChildAtIndex(n),r=!1),Jn(i)){t.set(i.__key,r?i.getTextContentSize():0,"text",!0);break}if(!Gi(i))break;t.set(i.__key,r?i.getChildrenSize():0,"element",!0)}}let lt,ct,at,ut,dt,ft,ht,gt,pt,_t,mt="",yt=null,vt=null,xt="",St=!1,Ct=!1;function bt(t,e){const n=ht.get(t);if(null!==e){const n=Kt(t);n.parentNode===e&&e.removeChild(n)}if(gt.has(t)||ct._keyToDOMMap.delete(t),Gi(n)){const t=It(n,ht);Et(t,0,t.length-1,null)}void 0!==n&&ho(_t,at,ut,n,"destroyed")}function Et(t,e,n,i){let r=e;for(;r<=n;++r){const e=t[r];void 0!==e&&bt(e,i)}}function kt(t,e){t.setProperty("text-align",e)}function wt(t,e){const n=lt.theme.indent;if("string"==typeof n){const i=t.classList.contains(n);e>0&&!i?t.classList.add(n):e<1&&i&&t.classList.remove(n)}const i=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||"40px";t.style.setProperty("padding-inline-start",0===e?"":`calc(${e} * ${i})`)}function Nt(t,e){const n=t.style;0===e?kt(n,""):1===e?kt(n,"left"):2===e?kt(n,"center"):3===e?kt(n,"right"):4===e?kt(n,"justify"):5===e?kt(n,"start"):6===e&&kt(n,"end")}function Tt(t,e){const n=function(t){const e=t.__dir;if(null!==e)return e;if(nr(t))return null;const n=t.getParentOrThrow();return nr(n)&&null===n.__dir?"auto":null}(e);null!==n?t.dir=n:t.removeAttribute("dir")}function Mt(t,e){const n=gt.get(t);void 0===n&&i(60);const r=n.createDOM(lt,ct);if(function(t,e,n){const i=n._keyToDOMMap;(function(t,e,n){t[`__lexicalKey_${e._key}`]=n})(e,n,t),i.set(t,e)}(t,r,ct),Jn(n)?r.setAttribute("data-lexical-text","true"):tr(n)&&r.setAttribute("data-lexical-decorator","true"),Gi(n)){const t=n.__indent,e=n.__size;if(Tt(r,n),0!==t&&wt(r,t),0!==e){const t=e-1;Ot(It(n,gt),n,0,t,n.getDOMSlot(r))}const i=n.__format;0!==i&&Nt(r,i),n.isInline()||Dt(null,n,r),mo(n)&&(mt+=N,xt+=N)}else{const e=n.getTextContent();if(tr(n)){const e=n.decorate(ct,lt);null!==e&&Ft(t,e),r.contentEditable="false"}mt+=e,xt+=e}return null!==e&&e.insertChild(r),ho(_t,at,ut,n,"created"),r}function Ot(t,e,n,i,r){const o=mt;mt="";let s=n;for(;s<=i;++s){Mt(t[s],r);const e=gt.get(t[s]);null!==e&&Jn(e)&&null===yt&&(yt=e.getFormat(),vt=e.getStyle())}mo(e)&&(mt+=N),r.element.__lexicalTextContent=mt,mt=o+mt}function Pt(t,e){if(t){const n=t.__last;if(n){const t=e.get(n);if(t)return kn(t)?"line-break":tr(t)&&t.isInline()?"decorator":null}return"empty"}return null}function Dt(t,e,n){const i=Pt(t,ht),r=Pt(e,gt);i!==r&&e.getDOMSlot(n).setManagedLineBreak(r)}function At(t,e,n){var r;yt=null,vt=null,function(t,e,n){const r=mt,o=t.__size,s=e.__size;mt="";const l=n.element;if(1===o&&1===s){const n=t.__first,i=e.__first;if(n===i)Lt(n,l);else{const t=Kt(n),e=Mt(i,null);try{l.replaceChild(e,t)}catch(r){if("object"==typeof r&&null!=r){const o=`${r.toString()} Parent: ${l.tagName}, new child: {tag: ${e.tagName} key: ${i}}, old child: {tag: ${t.tagName}, key: ${n}}.`;throw new Error(o)}throw r}bt(n,null)}const o=gt.get(i);Jn(o)&&null===yt&&(yt=o.getFormat(),vt=o.getStyle())}else{const r=It(t,ht),c=It(e,gt);if(r.length!==o&&i(227),c.length!==s&&i(228),0===o)0!==s&&Ot(c,e,0,s-1,n);else if(0===s){if(0!==o){const t=null==n.after&&null==n.before&&null==n.element.__lexicalLineBreak;Et(r,0,o-1,t?null:l),t&&(l.textContent="")}}else!function(t,e,n,i,r,o){const s=i-1,l=r-1;let c,a,u=o.getFirstChild(),d=0,f=0;for(;d<=s&&f<=l;){const t=e[d],i=n[f];if(t===i)u=Rt(Lt(i,o.element)),d++,f++;else{void 0===c&&(c=new Set(e)),void 0===a&&(a=new Set(n));const r=a.has(t),s=c.has(i);if(r)if(s){const t=yo(ct,i);t===u?u=Rt(Lt(i,o.element)):(o.withBefore(u).insertChild(t),Lt(i,o.element)),d++,f++}else Mt(i,o.withBefore(u)),f++;else u=Rt(Kt(t)),bt(t,o.element),d++}const r=gt.get(i);null!==r&&Jn(r)&&null===yt&&(yt=r.getFormat(),vt=r.getStyle())}const h=d>s,g=f>l;if(h&&!g){const e=n[l+1],i=void 0===e?null:ct.getElementByKey(e);Ot(n,t,f,l,o.withBefore(i))}else g&&!h&&Et(e,d,s,o.element)}(e,r,c,o,s,n)}mo(e)&&(mt+=N),l.__lexicalTextContent=mt,mt=r+mt}(t,e,e.getDOMSlot(n)),r=e,null==yt||yt===r.__textFormat||Ct||r.setTextFormat(yt),function(t){null==vt||vt===t.__textStyle||Ct||t.setTextStyle(vt)}(e)}function It(t,e){const n=[];let r=t.__first;for(;null!==r;){const t=e.get(r);void 0===t&&i(101),n.push(r),r=t.__next}return n}function Lt(t,e){const n=ht.get(t);let r=gt.get(t);void 0!==n&&void 0!==r||i(61);const o=St||ft.has(t)||dt.has(t),s=yo(ct,t);if(n===r&&!o){if(Gi(n)){const t=s.__lexicalTextContent;void 0!==t&&(mt+=t,xt+=t)}else{const t=n.getTextContent();xt+=t,mt+=t}return s}if(n!==r&&o&&ho(_t,at,ut,r,"updated"),r.updateDOM(n,s,lt)){const n=Mt(t,null);return null===e&&i(62),e.replaceChild(n,s),bt(t,null),n}if(Gi(n)&&Gi(r)){const t=r.__indent;(St||t!==n.__indent)&&wt(s,t);const e=r.__format;if((St||e!==n.__format)&&Nt(s,e),o&&(At(n,r,s),nr(r)||r.isInline()||Dt(n,r,s)),mo(r)&&(mt+=N,xt+=N),(St||r.__dir!==n.__dir)&&(Tt(s,r),nr(r)&&!St))for(const n of r.getChildren())Gi(n)&&Tt(yo(ct,n.getKey()),n)}else{const e=r.getTextContent();if(tr(r)){const e=r.decorate(ct,lt);null!==e&&Ft(t,e)}mt+=e,xt+=e}if(!Ct&&nr(r)&&r.__cachedText!==xt){const t=r.getWritable();t.__cachedText=xt,r=t}return s}function Ft(t,e){let n=ct._pendingDecorators;if(null===n){if(ct._decorators[t]===e)return;n=Zr(ct)}n[t]=e}function Rt(t){let e=t.nextSibling;return null!==e&&e===ct._blockCursorElement&&(e=e.nextSibling),e}function Kt(t){const e=pt.get(t);return void 0===e&&i(75,t),e}function Bt(t){return{type:t}}const zt=Bt("SELECTION_CHANGE_COMMAND"),Wt=(Bt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Bt("CLICK_COMMAND")),jt=Bt("BEFORE_INPUT_COMMAND"),Jt=Bt("INPUT_COMMAND"),Ut=Bt("COMPOSITION_START_COMMAND"),Zt=Bt("COMPOSITION_END_COMMAND"),Vt=Bt("DELETE_CHARACTER_COMMAND"),$t=Bt("INSERT_LINE_BREAK_COMMAND"),qt=Bt("INSERT_PARAGRAPH_COMMAND"),Ht=Bt("CONTROLLED_TEXT_INSERTION_COMMAND"),Yt=Bt("PASTE_COMMAND"),Gt=Bt("REMOVE_TEXT_COMMAND"),Xt=Bt("DELETE_WORD_COMMAND"),Qt=Bt("DELETE_LINE_COMMAND"),te=Bt("FORMAT_TEXT_COMMAND"),ee=Bt("UNDO_COMMAND"),ne=Bt("REDO_COMMAND"),ie=Bt("KEYDOWN_COMMAND"),re=Bt("KEY_ARROW_RIGHT_COMMAND"),oe=Bt("MOVE_TO_END"),se=Bt("KEY_ARROW_LEFT_COMMAND"),le=Bt("MOVE_TO_START"),ce=Bt("KEY_ARROW_UP_COMMAND"),ae=Bt("KEY_ARROW_DOWN_COMMAND"),ue=Bt("KEY_ENTER_COMMAND"),de=Bt("KEY_SPACE_COMMAND"),fe=Bt("KEY_BACKSPACE_COMMAND"),he=Bt("KEY_ESCAPE_COMMAND"),ge=Bt("KEY_DELETE_COMMAND"),pe=Bt("KEY_TAB_COMMAND"),_e=Bt("INSERT_TAB_COMMAND"),me=Bt("INDENT_CONTENT_COMMAND"),ye=Bt("OUTDENT_CONTENT_COMMAND"),ve=Bt("DROP_COMMAND"),xe=(Bt("FORMAT_ELEMENT_COMMAND"),Bt("DRAGSTART_COMMAND")),Se=Bt("DRAGOVER_COMMAND"),Ce=Bt("DRAGEND_COMMAND"),be=Bt("COPY_COMMAND"),Ee=Bt("CUT_COMMAND"),ke=Bt("SELECT_ALL_COMMAND"),we=Bt("CLEAR_EDITOR_COMMAND"),Ne=Bt("CLEAR_HISTORY_COMMAND"),Te=Bt("CAN_REDO_COMMAND"),Me=Bt("CAN_UNDO_COMMAND"),Oe=Bt("FOCUS_COMMAND"),Pe=Bt("BLUR_COMMAND"),De=Bt("KEY_MODIFIER_COMMAND"),Ae=Object.freeze({}),Ie=[["keydown",function(t,e){Le=t.timeStamp,Fe=t.key,e.isComposing()||_o(e,ie,t)}],["pointerdown",function(t,e){const n=t.target,i=t.pointerType;Fo(n)&&"touch"!==i&&"pen"!==i&&0===t.button&&$i(e,()=>{wr(n)||(je=!0)})}],["compositionstart",function(t,e){_o(e,Ut,t)}],["compositionend",function(t,e){c?Ue=!0:d||!u&&!p?_o(e,Zt,t):(Ze=!0,Ve=t.data)}],["input",function(t,e){t.stopPropagation(),$i(e,()=>{e.dispatchCommand(Jt,t)},{event:t}),Ke=null}],["click",function(t,e){$i(e,()=>{const n=_i(),i=Do(e),r=mi();if(i)if(Qn(n)){const e=n.anchor,o=e.getNode();if("element"===e.type&&0===e.offset&&n.isCollapsed()&&!nr(o)&&1===$r().getChildrenSize()&&o.getTopLevelElementOrThrow().isEmpty()&&null!==r&&n.is(r))i.removeAllRanges(),n.dirty=!0;else if(3===t.detail&&!n.isCollapsed()&&o!==n.focus.getNode()){const t=Go(o,t=>Gi(t)&&!t.isInline());Gi(t)&&t.select(0)}}else if("touch"===t.pointerType||"pen"===t.pointerType){const n=i.anchorNode;(Lo(n)||Ir(n))&&Hr(pi(r,i,e,t))}_o(e,Wt,t)})}],["cut",Ae],["copy",Ae],["dragstart",Ae],["dragover",Ae],["dragend",Ae],["paste",Ae],["focus",Ae],["blur",Ae],["drop",Ae]];a&&Ie.push(["beforeinput",(t,e)=>function(t,e){const n=t.inputType;"deleteCompositionText"===n||c&&po(e)||"insertCompositionText"!==n&&_o(e,jt,t)}(t,e)]);let Le=0,Fe=null,Re=0,Ke=null;const Be=new WeakMap,ze=new WeakMap;let We=!1,je=!1,Je=!1,Ue=!1,Ze=!1,Ve="",$e=null,qe=[0,"",0,"root",0];function He(t,e,n,i,r){const o=t.anchor,s=t.focus,l=o.getNode(),c=Fi(),u=Do(c),d=null!==u?u.anchorNode:null,f=o.key,h=c.getElementByKey(f),g=n.length;return f!==s.key||!Jn(l)||(!r&&(!a||Re<i+50)||l.isDirty()&&g<2||Gr(n))&&o.offset!==s.offset&&!l.isComposing()||Ar(l)||l.isDirty()&&g>1||(r||!a)&&null!==h&&!l.isComposing()&&d!==Lr(h)||null!==u&&null!==e&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==t.format||l.getStyle()!==t.style||function(t,e){if(e.isSegmented())return!0;if(!t.isCollapsed())return!1;const n=t.anchor.offset,i=e.getParentOrThrow(),r=Dr(e);return 0===n?!e.canInsertTextBefore()||!i.canInsertTextBefore()&&!e.isComposing()||r||function(t){const e=t.getPreviousSibling();return(Jn(e)||Gi(e)&&e.isInline())&&!e.canInsertTextAfter()}(e):n===e.getTextContentSize()&&(!e.canInsertTextAfter()||!i.canInsertTextAfter()&&!e.isComposing()||r)}(t,l)}function Ye(t,e){return Ir(t)&&null!==t.nodeValue&&0!==e&&e!==t.nodeValue.length}function Ge(t,e,n){const{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:l}=t;We&&(We=!1,Ye(r,o)&&Ye(s,l)&&!$e)||$i(e,()=>{if(!n)return void Hr(null);if(!Tr(e,r,s))return;let c=_i();if($e&&Qn(c)&&c.isCollapsed()){const t=c.anchor,e=$e.anchor;(t.key===e.key&&t.offset===e.offset+1||1===t.offset&&e.getNode().is(t.getNode().getPreviousSibling()))&&(c=$e.clone(),Hr(c))}if($e=null,Qn(c)){const n=c.anchor,r=n.getNode();if(c.isCollapsed()){"Range"===t.type&&t.anchorNode===t.focusNode&&(c.dirty=!0);const o=Eo(e).event,s=o?o.timeStamp:performance.now(),[l,a,u,d,f]=qe,h=$r(),g=!1===e.isComposing()&&""===h.getTextContent();if(s<f+200&&n.offset===u&&n.key===d)Xe(c,l,a);else if("text"===n.type)Jn(r)||i(141),Qe(c,r);else if("element"===n.type&&!g){Gi(r)||i(259);const t=n.getNode();t.isEmpty()?function(t,e){Xe(t,e.getTextFormat(),e.getTextStyle())}(c,t):Xe(c,0,"")}}else{const t=n.key,e=c.focus.key,i=c.getNodes(),r=i.length,s=c.isBackward(),a=s?l:o,u=s?o:l,d=s?e:t,f=s?t:e;let h=2047,g=!1;for(let n=0;n<r;n++){const t=i[n],e=t.getTextContentSize();if(Jn(t)&&0!==e&&!(0===n&&t.__key===d&&a===e||n===r-1&&t.__key===f&&0===u)&&(g=!0,h&=t.getFormat(),0===h))break}c.format=g?h:0}}_o(e,zt,void 0)})}function Xe(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function Qe(t,e){Xe(t,e.getFormat(),e.getStyle())}function tn(t){if(!t.getTargetRanges)return null;const e=t.getTargetRanges();return 0===e.length?null:e[0]}function en(t){const e=t.inputType,n=tn(t),r=Fi(),o=_i();if("deleteContentBackward"===e){if(null===o){const t=mi();if(!Qn(t))return!0;Hr(t.clone())}if(Qn(o)){const e=o.anchor.key===o.focus.key;if("MediaLast"===Fe&&t.timeStamp<Le+30&&r.isComposing()&&e){if(Br(null),Le=0,setTimeout(()=>{$i(r,()=>{Br(null)})},30),Qn(o)){const t=o.anchor.getNode();t.markDirty(),Jn(t)||i(142),Qe(o,t)}}else{Br(null),t.preventDefault();const n=o.anchor.getNode(),i=n.getTextContent(),s=n.canInsertTextAfter();let l=g&&e&&!(0===o.anchor.offset&&o.focus.offset===i.length)&&s;if(l&&o.isCollapsed()&&(l=!tr(function(t,e){const n=t.offset;if("element"===t.type)return go(t.getNode(),e,n);{const i=t.getNode();if(0===n){const t=i.getPreviousSibling();return null===t?go(i.getParentOrThrow(),e,i.getIndexWithinParent()+0):t}}return null}(o.anchor,!0))),!l){_o(r,Vt,!0);const t=_i();g&&Qn(t)&&t.isCollapsed()&&($e=t,setTimeout(()=>$e=null))}}return!0}}if(!Qn(o))return!0;const s=t.data;null!==Ke&&eo(!1,r,Ke),o.dirty&&null===Ke||!o.isCollapsed()||nr(o.anchor.getNode())||null===n||o.applyDOMRange(n),Ke=null;const l=o.focus,c=o.anchor.getNode(),a=l.getNode();if("insertText"===e||"insertTranspose"===e){if("\n"===s)t.preventDefault(),_o(r,$t,!1);else if(s===N)t.preventDefault(),_o(r,qt,void 0);else if(null==s&&t.dataTransfer){const e=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(e)}else null!=s&&He(o,n,s,t.timeStamp,!0)?(t.preventDefault(),_o(r,Ht,s)):Ke=s;return Re=t.timeStamp,!0}switch(t.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":_o(r,Ht,t);break;case"insertFromComposition":Br(null),_o(r,Ht,t);break;case"insertLineBreak":Br(null),_o(r,$t,!1);break;case"insertParagraph":Br(null),Je&&!d?(Je=!1,_o(r,$t,!1)):_o(r,qt,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":_o(r,Yt,t);break;case"deleteByComposition":(function(t,e){return t!==e||Gi(t)||Gi(e)||!Dr(t)||!Dr(e)})(c,a)&&_o(r,Gt,t);break;case"deleteByDrag":case"deleteByCut":_o(r,Gt,t);break;case"deleteContent":_o(r,Vt,!1);break;case"deleteWordBackward":_o(r,Xt,!0);break;case"deleteWordForward":_o(r,Xt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":_o(r,Qt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":_o(r,Qt,!1);break;case"formatStrikeThrough":_o(r,te,"strikethrough");break;case"formatBold":_o(r,te,"bold");break;case"formatItalic":_o(r,te,"italic");break;case"formatUnderline":_o(r,te,"underline");break;case"historyUndo":_o(r,ee,void 0);break;case"historyRedo":_o(r,ne,void 0)}return!0}function nn(t){if(Lo(t.target)&&wr(t.target))return!0;const e=Fi(),n=_i(),i=t.data,r=tn(t);if(null!=i&&Qn(n)&&He(n,r,i,t.timeStamp,!1)){Ue&&(sn(e,i),Ue=!1);const r=n.anchor.getNode(),o=Po(Eo(e));if(null===o)return!0;const s=n.isBackward(),l=s?n.anchor.offset:n.focus.offset,f=s?n.focus.offset:n.anchor.offset;a&&!n.isCollapsed()&&Jn(r)&&null!==o.anchorNode&&r.getTextContent().slice(0,l)+i+r.getTextContent().slice(l+f)===to(o.anchorNode)||_o(e,Ht,i);const h=i.length;c&&h>1&&"insertCompositionText"===t.inputType&&!e.isComposing()&&(n.anchor.offset-=h),u||d||p||!e.isComposing()||(Le=0,Br(null))}else eo(!1,e,null!==i?i:void 0),Ue&&(sn(e,i||void 0),Ue=!1);return Ai(),$(Fi()),!0}function rn(t){const e=Fi(),n=_i();if(Qn(n)&&!e.isComposing()){const i=n.anchor,r=n.anchor.getNode();Br(i.key),(t.timeStamp<Le+30||"element"===i.type||!n.isCollapsed()||r.getFormat()!==n.format||Jn(r)&&r.getStyle()!==n.style)&&_o(e,Ht,T)}return!0}function on(t){return sn(Fi(),t.data),!0}function sn(t,e){const n=t._compositionKey;if(Br(null),null!==n&&null!=e){if(""===e){const e=Wr(n),i=Lr(t.getElementByKey(n));return void(null!==i&&null!==i.nodeValue&&Jn(e)&&no(e,i.nodeValue,null,null,!0))}if("\n"===e[e.length-1]){const e=_i();if(Qn(e)){const n=e.focus;return e.anchor.set(n.key,n.offset,n.type),void _o(t,ue,null)}}}eo(!0,t,e)}function ln(t){const e=Fi();if(null==t.key)return!0;if(Ze&&co(t))return $i(e,()=>{sn(e,Ve)}),Ze=!1,Ve="",!0;if(function(t){return oo(t,"ArrowRight",{shiftKey:"any"})}(t))_o(e,re,t);else if(function(t){return oo(t,"ArrowRight",so)}(t))_o(e,oe,t);else if(function(t){return oo(t,"ArrowLeft",{shiftKey:"any"})}(t))_o(e,se,t);else if(function(t){return oo(t,"ArrowLeft",so)}(t))_o(e,le,t);else if(function(t){return oo(t,"ArrowUp",{altKey:"any",shiftKey:"any"})}(t))_o(e,ce,t);else if(function(t){return oo(t,"ArrowDown",{altKey:"any",shiftKey:"any"})}(t))_o(e,ae,t);else if(function(t){return oo(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(t))Je=!0,_o(e,ue,t);else if(function(t){return" "===t.key}(t))_o(e,de,t);else if(function(t){return l&&oo(t,"o",{ctrlKey:!0})}(t))t.preventDefault(),Je=!0,_o(e,$t,!0);else if(function(t){return oo(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(t))Je=!1,_o(e,ue,t);else if(function(t){return oo(t,"Backspace",{shiftKey:"any"})||l&&oo(t,"h",{ctrlKey:!0})}(t))co(t)?_o(e,fe,t):(t.preventDefault(),_o(e,Vt,!0));else if(function(t){return"Escape"===t.key}(t))_o(e,he,t);else if(function(t){return oo(t,"Delete",{})||l&&oo(t,"d",{ctrlKey:!0})}(t))!function(t){return"Delete"===t.key}(t)?(t.preventDefault(),_o(e,Vt,!1)):_o(e,ge,t);else if(function(t){return oo(t,"Backspace",lo)}(t))t.preventDefault(),_o(e,Xt,!0);else if(function(t){return oo(t,"Delete",lo)}(t))t.preventDefault(),_o(e,Xt,!1);else if(function(t){return l&&oo(t,"Backspace",{metaKey:!0})}(t))t.preventDefault(),_o(e,Qt,!0);else if(function(t){return l&&(oo(t,"Delete",{metaKey:!0})||oo(t,"k",{ctrlKey:!0}))}(t))t.preventDefault(),_o(e,Qt,!1);else if(function(t){return oo(t,"b",so)}(t))t.preventDefault(),_o(e,te,"bold");else if(function(t){return oo(t,"u",so)}(t))t.preventDefault(),_o(e,te,"underline");else if(function(t){return oo(t,"i",so)}(t))t.preventDefault(),_o(e,te,"italic");else if(function(t){return oo(t,"Tab",{shiftKey:"any"})}(t))_o(e,pe,t);else if(function(t){return oo(t,"z",so)}(t))t.preventDefault(),_o(e,ee,void 0);else if(function(t){return l?oo(t,"z",{metaKey:!0,shiftKey:!0}):oo(t,"y",{ctrlKey:!0})||oo(t,"z",{ctrlKey:!0,shiftKey:!0})}(t))t.preventDefault(),_o(e,ne,void 0);else{const n=e._editorState._selection;null===n||Qn(n)?ao(t)&&(t.preventDefault(),_o(e,ke,t)):function(t){return oo(t,"c",so)}(t)?(t.preventDefault(),_o(e,be,t)):function(t){return oo(t,"x",so)}(t)?(t.preventDefault(),_o(e,Ee,t)):ao(t)&&(t.preventDefault(),_o(e,ke,t))}return function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey}(t)&&e.dispatchCommand(De,t),!0}function cn(t){let e=t.__lexicalEventHandles;return void 0===e&&(e=[],t.__lexicalEventHandles=e),e}const an=new Map;function un(t){const e=function(t){if(!t)return null;if(Lo(t)){const e=Ao(t);if(e&&vo(e))return Oo(e)}const e=bo(t);return e?e.getSelection():null}(t.target);if(null===e)return;const n=Or(e.anchorNode);if(null===n)return;je&&(je=!1,$i(n,()=>{const i=mi(),r=e.anchorNode;(Lo(r)||Ir(r))&&Hr(pi(i,e,n,t))}));const i=Xr(n),r=i[i.length-1],o=r._key,s=an.get(o),l=s||r;l!==n&&Ge(e,l,!1),Ge(e,n,!0),n!==r?an.set(o,n):s&&an.delete(o)}function dn(t){t._lexicalHandled=!0}function fn(t){return!0===t._lexicalHandled}function hn(t){const e=Ao(t);if(void 0===e)return;const n=ze.get(e);if(void 0===n)return;const r=n-1;r>=0||i(164),Be.delete(t),ze.set(e,r),0===r&&e.removeEventListener("selectionchange",un);const o=Pr(t);Mr(o)?(function(t){if(null!==t._parentEditor){const e=Xr(t),n=e[e.length-1]._key;an.get(n)===t&&an.delete(n)}else an.delete(t._key)}(o),t.__lexicalEditor=null):o&&i(198);const s=cn(t);for(let i=0;i<s.length;i++)s[i]();t.__lexicalEventHandles=[]}function gn(t,e,n){Ai();const i=t.__key,r=t.getParent();if(null===r)return;const o=function(t){const e=_i();if(!Qn(e)||!Gi(t))return e;const{anchor:n,focus:i}=e,r=n.getNode(),o=i.getNode();return Co(r,t)&&n.set(t.__key,0,"element"),Co(o,t)&&i.set(t.__key,0,"element"),e}(t);let s=!1;if(Qn(o)&&e){const e=o.anchor,n=o.focus;e.key===i&&(xi(e,t,r,t.getPreviousSibling(),t.getNextSibling()),s=!0),n.key===i&&(xi(n,t,r,t.getPreviousSibling(),t.getNextSibling()),s=!0)}else ei(o)&&e&&t.isSelected()&&t.selectPrevious();if(Qn(o)&&e&&!s){const e=t.getIndexWithinParent();Rr(t),yi(o,r,e,-1)}else Rr(t);n||ko(r)||r.canBeEmpty()||!r.isEmpty()||gn(r,e),e&&o&&nr(r)&&r.isEmpty()&&r.selectEnd()}const pn=Symbol.for("ephemeral");function _n(t){return t[pn]||!1}class mn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=Ho(this);return void 0===t&&i(64,this.name),t}static clone(t){i(65,this.name)}$config(){return{}}config(t,e){const n=e.extends||Object.getPrototypeOf(this.constructor);return Object.assign(e,{extends:n,type:t}),{[t]:e}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),function(t,e){const n=function(){const t=xr;return xr=null,t}();if(null!=(e=e||n&&n.__key))return void(t.__key=e);Ai(),Ii();const i=Fi(),r=Li(),o=""+Cr++;r._nodeMap.set(o,t),Gi(t)?i._dirtyElements.set(o,!0):i._dirtyLeaves.add(o),i._cloneNotNeeded.add(o),i._dirtyType=1,t.__key=o}(this,t)}getType(){return this.__type}isInline(){i(137,this.constructor.name)}isAttached(){let t=this.__key;for(;null!==t;){if("root"===t)return!0;const e=Wr(t);if(null===e)break;t=e.__parent}return!1}isSelected(t){const e=t||_i();if(null==e)return!1;const n=e.getNodes().some(t=>t.__key===this.__key);if(Jn(this))return n;if(Qn(e)&&"element"===e.anchor.type&&"element"===e.focus.type){if(e.isCollapsed())return!1;const t=this.getParent();if(tr(this)&&this.isInline()&&t){const n=e.isBackward()?e.focus:e.anchor;if(t.is(n.getNode())&&n.offset===t.getChildrenSize()&&this.is(t.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(null===t)return-1;let e=t.getFirstChild(),n=0;for(;null!==e;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return null===t?null:Wr(t)}getParentOrThrow(){const t=this.getParent();return null===t&&i(66,this.__key),t}getTopLevelElement(){let t=this;for(;null!==t;){const e=t.getParent();if(ko(e))return Gi(t)||t===this&&tr(t)||i(194),t;t=e}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return null===t&&i(67,this.__key),t}getParents(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e),e=e.getParent();return t}getParentKeys(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e.__key),e=e.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return null===t?null:Wr(t)}getPreviousSiblings(){const t=[],e=this.getParent();if(null===e)return t;let n=e.getFirstChild();for(;null!==n&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return null===t?null:Wr(t)}getNextSiblings(){const t=[];let e=this.getNextSibling();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){const e=Gi(this)?this:this.getParent(),n=Gi(t)?t:t.getParent(),i=e&&n?Ns(e,n):null;return i?i.commonAncestor:null}is(t){return null!=t&&this.__key===t.__key}isBefore(t){const e=Ns(this,t);return null!==e&&("descendant"===e.type||("branch"===e.type?-1===Es(e):("same"!==e.type&&"ancestor"!==e.type&&i(279),!1)))}isParentOf(t){const e=Ns(this,t);return null!==e&&"ancestor"===e.type}getNodesBetween(t){const e=this.isBefore(t),n=[],r=new Set;let o=this;for(;null!==o;){const s=o.__key;if(r.has(s)||(r.add(s),n.push(o)),o===t)break;const l=Gi(o)?e?o.getFirstChild():o.getLastChild():null;if(null!==l){o=l;continue}const c=e?o.getNextSibling():o.getPreviousSibling();if(null!==c){o=c;continue}const a=o.getParentOrThrow();if(r.has(a.__key)||n.push(a),a===t)break;let u=null,d=a;do{if(null===d&&i(68),u=e?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),null===d)break;null!==u||r.has(d.__key)||n.push(d)}while(null===u);o=u}return e||n.reverse(),n}isDirty(){const t=Fi()._dirtyLeaves;return null!==t&&t.has(this.__key)}getLatest(){if(_n(this))return this;const t=Wr(this.__key);return null===t&&i(113),t}getWritable(){if(_n(this))return this;Ai();const t=Li(),e=Fi(),n=t._nodeMap,i=this.__key,r=this.getLatest(),o=e._cloneNotNeeded,s=_i();if(null!==s&&s.setCachedNodes(null),o.has(i))return Kr(r),r;const l=Zo(r);return o.add(i),Kr(l),n.set(i,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,e){i(70)}updateDOM(t,e,n){i(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){i(18,this.name)}updateFromJSON(t){return function(t,e){const n=t.getWritable(),i=e.$;let r=i;for(const o of G(n).flatKeys)o in e&&(void 0!==r&&r!==i||(r={...i}),r[o]=e[o]);return(n.__state||r)&&function(t){const e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new Y(e,G(e));return e.__state=n,n}(t).updateFromJSON(r),n}(this,t)}static transform(){return null}remove(t){gn(this,!0,t)}replace(t,e){Ai();let n=_i();null!==n&&(n=n.clone()),No(this,t);const r=this.getLatest(),o=this.__key,s=t.__key,l=t.getWritable(),c=this.getParentOrThrow().getWritable(),a=c.__size;Rr(l);const u=r.getPreviousSibling(),d=r.getNextSibling(),f=r.__prev,h=r.__next,g=r.__parent;if(gn(r,!1,!0),null===u?c.__first=s:u.getWritable().__next=s,l.__prev=f,null===d?c.__last=s:d.getWritable().__prev=s,l.__next=h,l.__parent=g,c.__size=a,e&&(Gi(this)&&Gi(l)||i(139),this.getChildren().forEach(t=>{l.append(t)})),Qn(n)){Hr(n);const t=n.anchor,e=n.focus;t.key===o&&Gn(t,l),e.key===o&&Gn(e,l)}return zr()===o&&Br(s),l}insertAfter(t,e=!0){Ai(),No(this,t);const n=this.getWritable(),i=t.getWritable(),r=i.getParent(),o=_i();let s=!1,l=!1;if(null!==r){const e=t.getIndexWithinParent();if(Rr(i),Qn(o)){const t=r.__key,n=o.anchor,i=o.focus;s="element"===n.type&&n.key===t&&n.offset===e+1,l="element"===i.type&&i.key===t&&i.offset===e+1}}const c=this.getNextSibling(),a=this.getParentOrThrow().getWritable(),u=i.__key,d=n.__next;if(null===c?a.__last=u:c.getWritable().__prev=u,a.__size++,n.__next=u,i.__next=d,i.__prev=n.__key,i.__parent=n.__parent,e&&Qn(o)){const t=this.getIndexWithinParent();yi(o,a,t+1);const e=a.__key;s&&o.anchor.set(e,t+2,"element"),l&&o.focus.set(e,t+2,"element")}return t}insertBefore(t,e=!0){Ai(),No(this,t);const n=this.getWritable(),i=t.getWritable(),r=i.__key;Rr(i);const o=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),l=n.__prev,c=this.getIndexWithinParent();null===o?s.__first=r:o.getWritable().__next=r,s.__size++,n.__prev=r,i.__prev=l,i.__next=n.__key,i.__parent=n.__parent;const a=_i();return e&&Qn(a)&&yi(a,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return dr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){Ai();const n=this.getPreviousSibling(),i=this.getParentOrThrow();if(null===n)return i.select(0,0);if(Gi(n))return n.select();if(!Jn(n)){const t=n.getIndexWithinParent()+1;return i.select(t,t)}return n.select(t,e)}selectNext(t,e){Ai();const n=this.getNextSibling(),i=this.getParentOrThrow();if(null===n)return i.select();if(Gi(n))return n.select(0,0);if(!Jn(n)){const t=n.getIndexWithinParent();return i.select(t,t)}return n.select(t,e)}markDirty(){this.getWritable()}reconcileObservedMutation(t,e){this.markDirty()}}const yn="historic",vn="history-push",xn="history-merge",Sn="paste";class Cn extends mn{static getType(){return"linebreak"}static clone(t){return new Cn(t.__key)}constructor(t){super(t)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>function(t){const e=t.parentElement;if(null!==e&&Bo(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&wn(n)){const n=e.lastChild;if(n===t||n.previousSibling===t&&wn(n))return!0}}return!1}(t)||function(t){const e=t.parentElement;if(null!==e&&Bo(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&wn(n))return!1;const i=e.lastChild;if(i===t||i.previousSibling===t&&wn(i))return!0}return!1}(t)?null:{conversion:bn,priority:0}}}static importJSON(t){return En().updateFromJSON(t)}}function bn(t){return{node:En()}}function En(){return wo(new Cn)}function kn(t){return t instanceof Cn}function wn(t){return Ir(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function Nn(t,e){return 16&e?"code":128&e?"mark":32&e?"sub":64&e?"sup":null}function Tn(t,e){return 1&e?"strong":2&e?"em":"span"}function Mn(t,e,n,i,r){const o=i.classList;let s=fo(r,"base");void 0!==s&&o.add(...s),s=fo(r,"underlineStrikethrough");let l=!1;const c=8&e&&4&e;void 0!==s&&(8&n&&4&n?(l=!0,c||o.add(...s)):c&&o.remove(...s));for(const a in P){const t=P[a];if(s=fo(r,a),void 0!==s)if(n&t){if(l&&("underline"===a||"strikethrough"===a)){e&t&&o.remove(...s);continue}(0===(e&t)||c&&"underline"===a||"strikethrough"===a)&&o.add(...s)}else e&t&&o.remove(...s)}}function On(t,e,n){const i=e.firstChild,r=n.isComposing(),o=t+(r?w:"");if(null==i)e.textContent=o;else{const t=i.nodeValue;if(t!==o)if(r||c){const[e,n,r]=function(t,e){const n=t.length,i=e.length;let r=0,o=0;for(;r<n&&r<i&&t[r]===e[r];)r++;for(;o+r<n&&o+r<i&&t[n-o-1]===e[i-o-1];)o++;return[r,n-r-o,e.slice(r,i-o)]}(t,o);0!==n&&i.deleteData(e,n),i.insertData(e,r)}else i.nodeValue=o}}function Pn(t,e,n,i,r,o){On(r,t,e);const s=o.theme.text;void 0!==s&&Mn(0,0,i,t,s)}function Dn(t,e){const n=document.createElement(e);return n.appendChild(t),n}class An extends mn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new An(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",e){super(e),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return F[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===zr()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const e=P[t];return 0!==(this.getFormat()&e)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(t,e){return Fr(this.getLatest().__format,t,e)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,e){const n=this.__format,i=Nn(0,n),r=Tn(0,n),o=document.createElement(null===i?r:i);let s=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==i&&(s=document.createElement(r),o.appendChild(s)),Pn(s,this,0,n,this.__text,t);const l=this.__style;return""!==l&&(o.style.cssText=l),o}updateDOM(t,e,n){const r=this.__text,o=t.__format,s=this.__format,l=Nn(0,o),c=Nn(0,s),a=Tn(0,o),u=Tn(0,s);if((null===l?a:l)!==(null===c?u:c))return!0;if(l===c&&a!==u){const t=e.firstChild;null==t&&i(48);const o=document.createElement(u);return Pn(o,this,0,s,r,n),e.replaceChild(o,t),!1}let d=e;null!==c&&null!==l&&(d=e.firstChild,null==d&&i(49)),On(r,d,this);const f=n.theme.text;void 0!==f&&o!==s&&Mn(0,o,s,d,f);const h=this.__style;return t.__style!==h&&(e.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:Kn,priority:0}),b:()=>({conversion:Ln,priority:0}),code:()=>({conversion:Wn,priority:0}),em:()=>({conversion:Wn,priority:0}),i:()=>({conversion:Wn,priority:0}),mark:()=>({conversion:Wn,priority:0}),s:()=>({conversion:Wn,priority:0}),span:()=>({conversion:In,priority:0}),strong:()=>({conversion:Wn,priority:0}),sub:()=>({conversion:Wn,priority:0}),sup:()=>({conversion:Wn,priority:0}),u:()=>({conversion:Wn,priority:0})}}static importJSON(t){return jn().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:e}=super.exportDOM(t);return Lo(e)||i(132),e.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?e.style.textTransform="lowercase":this.hasFormat("uppercase")?e.style.textTransform="uppercase":this.hasFormat("capitalize")&&(e.style.textTransform="capitalize"),this.hasFormat("bold")&&(e=Dn(e,"b")),this.hasFormat("italic")&&(e=Dn(e,"i")),this.hasFormat("strikethrough")&&(e=Dn(e,"s")),this.hasFormat("underline")&&(e=Dn(e,"u")),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,e){}setFormat(t){const e=this.getWritable();return e.__format="string"==typeof t?P[t]:t,e}setDetail(t){const e=this.getWritable();return e.__detail="string"==typeof t?D[t]:t,e}setStyle(t){const e=this.getWritable();return e.__style=t,e}toggleFormat(t){const e=Fr(this.getFormat(),t,null);return this.setFormat(e)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const e=L[t];if(this.__mode===e)return this;const n=this.getWritable();return n.__mode=e,n}setTextContent(t){if(this.__text===t)return this;const e=this.getWritable();return e.__text=t,e}select(t,e){Ai();let n=t,i=e;const r=_i(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const t=o.length;void 0===n&&(n=t),void 0===i&&(i=t)}else n=0,i=0;if(!Qn(r))return fi(s,n,s,i,"text","text");{const t=zr();t!==r.anchor.key&&t!==r.focus.key||Br(s),r.setTextNodeRange(this,n,this,i)}return r}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,e,n,i){const r=this.getWritable(),o=r.__text,s=n.length;let l=t;l<0&&(l=s+l,l<0&&(l=0));const c=_i();if(i&&Qn(c)){const e=t+s;c.setTextNodeRange(r,e,r,e)}const a=o.slice(0,l)+n+o.slice(l+e);return r.__text=a,r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){Ai();const e=this.getLatest(),n=e.getTextContent();if(""===n)return[];const i=e.__key,r=zr(),o=n.length;t.sort((t,e)=>t-e),t.push(o);const s=[],l=t.length;for(let b=0,E=0;b<o&&E<=l;E++){const e=t[E];e>b&&(s.push(n.slice(b,e)),b=e)}const c=s.length;if(1===c)return[e];const a=s[0],u=e.getParent();let d;const f=e.getFormat(),h=e.getStyle(),g=e.__detail;let p=!1,_=null,m=null;const y=_i();if(Qn(y)){const[t,e]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===t.type&&t.key===i&&(_=t),"text"===e.type&&e.key===i&&(m=e)}e.isSegmented()?(d=jn(a),d.__format=f,d.__style=h,d.__detail=g,d.__state=et(e,d),p=!0):d=e.setTextContent(a);const v=[d];for(let b=1;b<c;b++){const t=jn(s[b]);t.__format=f,t.__style=h,t.__detail=g,t.__state=et(e,t),r===i&&Br(t.__key),v.push(t)}const x=_?_.offset:null,S=m?m.offset:null;let C=0;for(const b of v){if(!_&&!m)break;const t=C+b.getTextContentSize();if(null!==_&&null!==x&&x<=t&&x>=C&&(_.set(b.getKey(),x-C,"text"),x<t&&(_=null)),null!==m&&null!==S&&S<=t&&S>=C){m.set(b.getKey(),S-C,"text");break}C=t}if(null!==u){!function(t){const e=t.getPreviousSibling(),n=t.getNextSibling();null!==e&&Kr(e),null!==n&&Kr(n)}(this);const t=u.getWritable(),e=this.getIndexWithinParent();p?(t.splice(e,0,v),this.remove()):t.splice(e,1,v),Qn(y)&&yi(y,u,e,c-1)}return v}mergeWithSibling(t){const e=t===this.getPreviousSibling();e||t===this.getNextSibling()||i(50);const n=this.__key,r=t.__key,o=this.__text,s=o.length;zr()===r&&Br(n);const l=_i();if(Qn(l)){const i=l.anchor,o=l.focus;null!==i&&i.key===r&&Si(i,e,n,t,s),null!==o&&o.key===r&&Si(o,e,n,t,s)}const c=t.__text;this.setTextContent(e?c+o:o+c);const a=this.getWritable();return t.remove(),a}isTextEntity(){return!1}}function In(t){return{forChild:Un(t.style),node:null}}function Ln(t){return{forChild:Un(t.style,"normal"===t.style.fontWeight?void 0:"bold"),node:null}}const Fn=new WeakMap;function Rn(t){if(!Lo(t))return!1;if("PRE"===t.nodeName)return!0;const e=t.style.whiteSpace;return"string"==typeof e&&e.startsWith("pre")}function Kn(t){const e=t;null===t.parentElement&&i(129);let n=e.textContent||"";if(null!==function(t){let e,n=t.parentNode;const i=[t];for(;null!==n&&void 0===(e=Fn.get(n))&&!Rn(n);)i.push(n),n=n.parentNode;const r=void 0===e?n:e;for(let o=0;o<i.length;o++)Fn.set(i[o],r);return r}(e)){const t=n.split(/(\r?\n|\t)/),e=[],i=t.length;for(let n=0;n<i;n++){const i=t[n];"\n"===i||"\r\n"===i?e.push(En()):"\t"===i?e.push(Vn()):""!==i&&e.push(jn(i))}return{node:e}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let t=e,i=!0;for(;null!==t&&null!==(t=Bn(t,!1));){const e=t.textContent||"";if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(" "===n[n.length-1]){let t=e,i=!0;for(;null!==t&&null!==(t=Bn(t,!0));)if((t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:jn(n)}}function Bn(t,e){let n=t;for(;;){let t;for(;null===(t=e?n.nextSibling:n.previousSibling);){const t=n.parentElement;if(null===t)return null;n=t}if(n=t,Lo(n)){const t=n.style.display;if(""===t&&!Ko(n)||""!==t&&!t.startsWith("inline"))return null}let i=n;for(;null!==(i=e?n.firstChild:n.lastChild);)n=i;if(Ir(n))return n;if("BR"===n.nodeName)return null}}const zn={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Wn(t){const e=zn[t.nodeName.toLowerCase()];return void 0===e?{node:null}:{forChild:Un(t.style,e),node:null}}function jn(t=""){return wo(new An(t))}function Jn(t){return t instanceof An}function Un(t,e){const n=t.fontWeight,i=t.textDecoration.split(" "),r="700"===n||"bold"===n,o=i.includes("line-through"),s="italic"===t.fontStyle,l=i.includes("underline"),c=t.verticalAlign;return t=>Jn(t)?(r&&!t.hasFormat("bold")&&t.toggleFormat("bold"),o&&!t.hasFormat("strikethrough")&&t.toggleFormat("strikethrough"),s&&!t.hasFormat("italic")&&t.toggleFormat("italic"),l&&!t.hasFormat("underline")&&t.toggleFormat("underline"),"sub"!==c||t.hasFormat("subscript")||t.toggleFormat("subscript"),"super"!==c||t.hasFormat("superscript")||t.toggleFormat("superscript"),e&&!t.hasFormat(e)&&t.toggleFormat(e),t):t}class Zn extends An{static getType(){return"tab"}static clone(t){return new Zn(t.__key)}constructor(t){super("\t",t),this.__detail=2}static importDOM(){return null}createDOM(t){const e=super.createDOM(t),n=fo(t.theme,"tab");return void 0!==n&&e.classList.add(...n),e}static importJSON(t){return Vn().updateFromJSON(t)}setTextContent(t){return"\t"!==t&&""!==t&&r(126),super.setTextContent("\t")}spliceText(t,e,n,r){return""===n&&0===e||"\t"===n&&1===e||i(286),this}setDetail(t){return 2!==t&&i(127),this}setMode(t){return"normal"!==t&&i(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Vn(){return wo(new Zn)}function $n(t){return t instanceof Zn}class qn{key;offset;type;_selection;constructor(t,e,n){this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:bs(Fs(Ts(this,"next")),Fs(Ts(t,"next")))<0}getNode(){const t=Wr(this.key);return null===t&&i(20),t}set(t,e,n,i){const r=this._selection,o=this.key;i&&this.key===t&&this.offset===e&&this.type===n||(this.key=t,this.offset=e,this.type=n,Di()||(zr()===o&&Br(t),null!==r&&(r.setCachedNodes(null),r.dirty=!0)))}}function Hn(t,e,n){return new qn(t,e,n)}function Yn(t,e){let n=e.__key,i=t.offset,r="element";if(Jn(e)){r="text";const t=e.getTextContentSize();i>t&&(i=t)}else if(!Gi(e)){const t=e.getNextSibling();if(Jn(t))n=t.__key,i=0,r="text";else{const t=e.getParent();t&&(n=t.__key,i=e.getIndexWithinParent()+1)}}t.set(n,i,r)}function Gn(t,e){if(Gi(e)){const n=e.getLastDescendant();Gi(n)||Jn(n)?Yn(t,n):Yn(t,e)}else Yn(t,e)}class Xn{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!ei(t))return!1;const e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every(t=>n.has(t))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new Xn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const e=this.getNodes(),n=e.length,i=e[n-1];let r;if(Jn(i))r=i.select();else{const t=i.getIndexWithinParent()+1;r=i.getParentOrThrow().select(t,t)}r.insertNodes(t);for(let o=0;o<n;o++)e[o].remove()}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=this._nodes,n=[];for(const i of e){const t=Wr(i);null!==t&&n.push(t)}return Di()||(this._cachedNodes=n),n}getTextContent(){const t=this.getNodes();let e="";for(let n=0;n<t.length;n++)e+=t[n].getTextContent();return e}deleteNodes(){const t=this.getNodes();if((_i()||mi())===this&&t[0]){const e=fs(t[0],"next");!function(t){const e=_i(),n=Qn(e)?e:hi();Os(n,t),Hr(n)}(Ss(e,e))}for(const e of t)e.remove()}}function Qn(t){return t instanceof ti}class ti{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,e,n,i){this.anchor=t,this.focus=e,t._selection=this,e._selection=this,this._cachedNodes=null,this.format=n,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!Qn(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=function(t){const e=[],[n,i]=t.getTextSlices();n&&e.push(n.caret.origin);const r=new Set,o=new Set;for(const s of t)if(cs(s)){const{origin:t}=s;0===e.length?r.add(t):(o.add(t),e.push(t))}else{const{origin:t}=s;Gi(t)&&o.has(t)||e.push(t)}if(i&&e.push(i.caret.origin),ls(t.focus)&&Gi(t.focus.origin)&&null===t.focus.getNodeAtCaret())for(let s=_s(t.focus.origin,"previous");cs(s)&&r.has(s.origin)&&!s.origin.isEmpty()&&s.origin.is(e[e.length-1]);s=ms(s))r.delete(s.origin),e.pop();for(;e.length>1;){const t=e[e.length-1];if(!Gi(t)||o.has(t)||t.isEmpty()||r.has(t))break;e.pop()}if(0===e.length&&t.isCollapsed()){const n=Fs(t.anchor),i=Fs(t.anchor.getFlipped()),r=t=>ss(t)?t.origin:t.getNodeAtCaret(),o=r(n)||r(i)||(t.anchor.getNodeAtCaret()?n.origin:i.origin);e.push(o)}return e}(Bs(Ps(this),"next"));return Di()||(this._cachedNodes=e),e}setTextNodeRange(t,e,n,i){this.anchor.set(t.__key,e,"text"),this.focus.set(n.__key,i,"text")}getTextContent(){const t=this.getNodes();if(0===t.length)return"";const e=t[0],n=t[t.length-1],i=this.anchor,r=this.focus,o=i.isBefore(r),[s,l]=ii(this);let c="",a=!0;for(let u=0;u<t.length;u++){const d=t[u];if(Gi(d)&&!d.isInline())a||(c+="\n"),a=!d.isEmpty();else if(a=!1,Jn(d)){let t=d.getTextContent();d===e?d===n?"element"===i.type&&"element"===r.type&&r.offset!==i.offset||(t=s<l?t.slice(s,l):t.slice(l,s)):t=t.slice(o?s:l):d===n&&(t=t.slice(0,o?l:s)),c+=t}else!tr(d)&&!kn(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const e=Fi(),n=e.getEditorState()._selection,i=ui(t.startContainer,t.startOffset,t.endContainer,t.endOffset,e,n);if(null===i)return;const[r,o]=i;this.anchor.set(r.key,r.offset,r.type,!0),this.focus.set(o.key,o.offset,o.type,!0),ot(this)}clone(){const t=this.anchor,e=this.focus;return new ti(Hn(t.key,t.offset,t.type),Hn(e.key,e.offset,e.type),this.format,this.style)}toggleFormat(t){this.format=Fr(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){return 0!==(this.format&P[t])}insertRawText(t){const e=t.split(/(\r?\n|\t)/),n=[],i=e.length;for(let r=0;r<i;r++){const t=e[r];n.push("\n"===t||"\r\n"===t?En():"\t"===t?Vn():jn(t))}this.insertNodes(n)}insertText(t){const e=this.anchor,n=this.focus,r=this.format,o=this.style;let s=e,l=n;!this.isCollapsed()&&n.isBefore(e)&&(s=n,l=e),"element"===s.type&&function(t,e,n,i){const r=t.getNode(),o=r.getChildAtIndex(t.offset),s=jn();if(s.setFormat(n),s.setStyle(i),fr(o))o.splice(0,0,[s]);else{const t=nr(r)?dr().append(s):s;null===o?r.append(t):o.insertBefore(t)}t.is(e)&&e.set(s.__key,0,"text"),t.set(s.__key,0,"text")}(s,l,r,o),"element"===l.type&&Ms(l,Fs(Ts(l,"next")));const c=s.offset;let a=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];Jn(f)||i(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let p=u[d-1];if(1===d&&"element"===l.type&&(a=h,l.set(s.key,a,"text")),this.isCollapsed()&&c===h&&(Ar(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&null===f.getNextSibling())){let e=f.getNextSibling();if(Jn(e)&&e.canInsertTextBefore()&&!Ar(e)||(e=jn(),e.setFormat(r),e.setStyle(o),g.canInsertTextAfter()?f.insertAfter(e):g.insertAfter(e)),e.select(0,0),f=e,""!==t)return void this.insertText(t)}else if(this.isCollapsed()&&0===c&&(Ar(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&null===f.getPreviousSibling())){let e=f.getPreviousSibling();if(Jn(e)&&!Ar(e)||(e=jn(),e.setFormat(r),g.canInsertTextBefore()?f.insertBefore(e):g.insertBefore(e)),e.select(),f=e,""!==t)return void this.insertText(t)}else if(f.isSegmented()&&c!==h){const t=jn(f.getTextContent());t.setFormat(r),f.replace(t),f=t}else if(!this.isCollapsed()&&""!==t){const e=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||Gi(e)&&(!e.canInsertTextBefore()||!e.canInsertTextAfter()))return this.insertText(""),ai(this.anchor,this.focus,null),void this.insertText(t)}if(1===d){if(Dr(f)){const e=jn(t);return e.select(),void f.replace(e)}const e=f.getFormat(),n=f.getStyle();if(c!==a||e===r&&n===o){if($n(f)){const e=jn(t);return e.setFormat(r),e.setStyle(o),e.select(),void f.replace(e)}}else{if(""!==f.getTextContent()){const e=jn(t);if(e.setFormat(r),e.setStyle(o),e.select(),0===c)f.insertBefore(e,!1);else{const[t]=f.splitText(c);t.insertAfter(e,!1)}return void(e.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length))}f.setFormat(r),f.setStyle(o)}f=f.spliceText(c,a-c,t,!0),""===f.getTextContent()?f.remove():"text"===this.anchor.type&&(f.isComposing()?this.anchor.offset-=t.length:(this.format=e,this.style=n))}else{const e=new Set([...f.getParentKeys(),...p.getParentKeys()]),n=Gi(f)?f:f.getParentOrThrow();let i=Gi(p)?p:p.getParentOrThrow(),r=p;if(!n.is(i)&&i.isInline())do{r=i,i=i.getParentOrThrow()}while(i.isInline());if("text"===l.type&&(0!==a||""===p.getTextContent())||"element"===l.type&&p.getIndexWithinParent()<a)if(Jn(p)&&!Dr(p)&&a!==p.getTextContentSize()){if(p.isSegmented()){const t=jn(p.getTextContent());p.replace(t),p=t}nr(l.getNode())||"text"!==l.type||(p=p.spliceText(0,a,"")),e.add(p.__key)}else{const t=p.getParentOrThrow();t.canBeEmpty()||1!==t.getChildrenSize()?p.remove():t.remove()}else e.add(p.__key);const o=i.getChildren(),s=new Set(u),g=n.is(i),_=n.isInline()&&null===f.getNextSibling()?n:f;for(let t=o.length-1;t>=0;t--){const e=o[t];if(e.is(f)||Gi(e)&&e.isParentOf(f))break;e.isAttached()&&(!s.has(e)||e.is(r)?g||_.insertAfter(e,!1):e.remove())}if(!g){let t=i,n=null;for(;null!==t;){const i=t.getChildren(),r=i.length;(0===r||i[r-1].is(n))&&(e.delete(t.__key),n=t),t=t.getParent()}}if(Dr(f))if(c===h)f.select();else{const e=jn(t);e.select(),f.replace(e)}else f=f.spliceText(c,h-c,t,!0),""===f.getTextContent()?f.remove():f.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length);for(let t=1;t<d;t++){const n=u[t];e.has(n.__key)||n.remove()}}}removeText(){const t=_i()===this;Os(this,Ls(Ps(this))),t&&_i()!==this&&Hr(this)}formatText(t,e=null){if(this.isCollapsed())return this.toggleFormat(t),void Br(null);const n=this.getNodes(),i=[];for(const v of n)Jn(v)&&i.push(v);const r=e=>{n.forEach(n=>{if(Gi(n)){const i=n.getFormatFlags(t,e);n.setTextFormat(i)}})},o=i.length;if(0===o)return this.toggleFormat(t),Br(null),void r(e);const s=this.anchor,l=this.focus,c=this.isBackward(),a=c?l:s,u=c?s:l;let d=0,f=i[0],h="element"===a.type?0:a.offset;if("text"===a.type&&h===f.getTextContentSize()&&(d=1,f=i[1],h=0),null==f)return;const g=f.getFormatFlags(t,e);r(g);const p=o-1;let _=i[p];const m="text"===u.type?u.offset:_.getTextContentSize();if(f.is(_)){if(h===m)return;if(Ar(f)||0===h&&m===f.getTextContentSize())f.setFormat(g);else{const t=f.splitText(h,m),e=0===h?t[0]:t[1];e.setFormat(g),"text"===a.type&&a.set(e.__key,0,"text"),"text"===u.type&&u.set(e.__key,m-h,"text")}return void(this.format=g)}0===h||Ar(f)||([,f]=f.splitText(h),h=0),f.setFormat(g);const y=_.getFormatFlags(t,g);m>0&&(m===_.getTextContentSize()||Ar(_)||([_]=_.splitText(m)),_.setFormat(y));for(let v=d+1;v<p;v++){const e=i[v],n=e.getFormatFlags(t,y);e.setFormat(n)}"text"===a.type&&a.set(f.__key,h,"text"),"text"===u.type&&u.set(_.__key,m,"text"),this.format=g|y}insertNodes(t){if(0===t.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const e=_i();return Qn(e)||i(134),e.insertNodes(t)}const e=(this.isBackward()?this.focus:this.anchor).getNode(),n=Go(e,zo),r=t[t.length-1];if(Gi(n)&&"__language"in n){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const e=bi(this);n.splice(e,0,t),r.selectEnd()}return}if(!t.some(t=>(Gi(t)||tr(t))&&!t.isInline())){Gi(n)||i(211,e.constructor.name,e.getType());const o=bi(this);return n.splice(o,0,t),void r.selectEnd()}const o=function(t){const e=dr();let n=null;for(let i=0;i<t.length;i++){const r=t[i],o=kn(r);if(o||tr(r)&&r.isInline()||Gi(r)&&r.isInline()||Jn(r)||r.isParentRequired()){if(null===n&&(n=r.createParentElementNode(),e.append(n),o))continue;null!==n&&n.append(r)}else e.append(r),n=null}return e}(t),s=o.getLastDescendant(),l=o.getChildren(),c=Gi(n)&&n.isEmpty()?null:this.insertParagraph(),a=l[l.length-1];let u=l[0];var d;Gi(d=u)&&zo(d)&&!d.isEmpty()&&Gi(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(Gi(n)||i(211,e.constructor.name,e.getType()),n.append(...u.getChildren()),u=l[1]),u&&(null===n&&i(212,e.constructor.name,e.getType()),function(t,e){const n=e.getParentOrThrow().getLastChild();let r=e;const o=[e];for(;r!==n;)r.getNextSibling()||i(140),r=r.getNextSibling(),o.push(r);let s=t;for(const i of o)s=s.insertAfter(i)}(n,u));const f=Go(s,zo);c&&Gi(f)&&(c.canMergeWhenEmpty()||zo(a))&&(f.append(...c.getChildren()),c.remove()),Gi(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=Gi(n)?n.getLastChild():null;kn(h)&&f!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const t=dr();return $r().splice(this.anchor.offset,0,[t]),t.select(),t}const t=bi(this),e=Go(this.anchor.getNode(),zo);Gi(e)||i(213);const n=e.getChildAtIndex(t),r=n?[n,...n.getNextSiblings()]:[],o=e.insertNewAfter(this,!1);return o?(o.append(...r),o.selectStart(),o):null}insertLineBreak(t){const e=En();if(this.insertNodes([e]),t){const t=e.getParentOrThrow(),n=e.getIndexWithinParent();t.select(n,n)}}extract(){const t=[...this.getNodes()],e=t.length;let n=t[0],i=t[e-1];const[r,o]=ii(this),s=this.isBackward(),[l,c]=s?[this.focus,this.anchor]:[this.anchor,this.focus],[a,u]=s?[o,r]:[r,o];if(0===e)return[];if(1===e){if(Jn(n)&&!this.isCollapsed()){const t=n.splitText(a,u),e=0===a?t[0]:t[1];return e?(l.set(e.getKey(),0,"text"),c.set(e.getKey(),e.getTextContentSize(),"text"),[e]):[]}return[n]}if(Jn(n)&&(a===n.getTextContentSize()?t.shift():0!==a&&([,n]=n.splitText(a),t[0]=n,l.set(n.getKey(),0,"text"))),Jn(i)){const e=i.getTextContent().length;0===u?t.pop():u!==e&&([i]=i.splitText(u),t[t.length-1]=i,c.set(i.getKey(),i.getTextContentSize(),"text"))}return t}modify(t,e,n){if(ki(this,t,e,n))return;const i="move"===t,r=Fi(),o=Do(r);if(!o)return;const s=r._blockCursorElement,l=r._rootElement,c=this.focus.getNode();if(null===l||null===s||!Gi(c)||c.isInline()||c.canBeEmpty()||Mo(s,r,l),this.dirty){let t=yo(r,this.anchor.key),e=yo(r,this.focus.key);"text"===this.anchor.type&&(t=Lr(t)),"text"===this.focus.type&&(e=Lr(e)),t&&e&&Ci(o,t,this.anchor.offset,e,this.focus.offset)}if(function(t,e,n,i){t.modify(e,n,i)}(o,t,e?"backward":"forward",n),o.rangeCount>0){const t=o.getRangeAt(0),n=this.anchor.getNode(),r=nr(n)?n:function(t){let e=t.getParentOrThrow();for(;null!==e;){if(ko(e))return e;e=e.getParentOrThrow()}return e}(n);if(this.applyDOMRange(t),this.dirty=!0,!i){const n=this.getNodes(),i=[];let s=!1;for(let t=0;t<n.length;t++){const e=n[t];Co(e,r)?i.push(e):s=!0}if(s&&i.length>0)if(e){const t=i[0];Gi(t)?t.selectStart():t.getParentOrThrow().selectStart()}else{const t=i[i.length-1];Gi(t)?t.selectEnd():t.getParentOrThrow().selectEnd()}o.anchorNode===t.startContainer&&o.anchorOffset===t.startOffset||function(t){const e=t.focus,n=t.anchor,i=n.key,r=n.offset,o=n.type;n.set(e.key,e.offset,e.type,!0),e.set(i,r,o,!0)}(this)}}"lineboundary"===n&&ki(this,t,e,n,"decorators")}forwardDeletion(t,e,n){if(!n&&("element"===t.type&&Gi(e)&&t.offset===e.getChildrenSize()||"text"===t.type&&t.offset===e.getTextContentSize())){const t=e.getParent(),n=e.getNextSibling()||(null===t?null:t.getNextSibling());if(Gi(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(t){const e=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let n=e.getNode();if(this.forwardDeletion(e,n,t))return;const i=xs(Ts(e,t?"previous":"next"));if(i.getTextSlices().every(t=>null===t||0===t.distance)){let t={type:"initial"};for(const e of i.iterNodeCarets("shadowRoot"))if(cs(e))if(e.origin.isInline());else{if(e.origin.isShadowRoot()){if("merge-block"===t.type)break;if(Gi(i.anchor.origin)&&i.anchor.origin.isEmpty()){const t=Fs(e);Os(this,Ss(t,t)),i.anchor.origin.remove()}return}"merge-next-block"!==t.type&&"merge-block"!==t.type||(t={block:t.block,caret:e,type:"merge-block"})}else{if("merge-block"===t.type)break;if(ls(e)){if(Gi(e.origin)){if(e.origin.isInline()){if(!e.origin.isParentOf(i.anchor.origin))break}else t={block:e.origin,type:"merge-next-block"};continue}if(tr(e.origin)){if(e.origin.isIsolated());else if("merge-next-block"===t.type&&(e.origin.isKeyboardSelectable()||!e.origin.isInline())&&Gi(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const t=gi();t.add(e.origin.getKey()),Hr(t)}else e.origin.remove();return}break}}if("merge-block"===t.type){const{caret:e,block:n}=t;return Os(this,Ss(!e.origin.isEmpty()&&n.isEmpty()?Ds(fs(n,e.direction)):i.anchor,e)),this.removeText()}}const r=this.focus,o=e.key,s=e.offset,l=r.key,c=r.offset;if(this.modify("extend",t,"character"),this.anchor.key===o&&this.anchor.offset===s&&this.focus.key===l&&this.focus.offset===c&&"text"===e.type&&Jn(n)){const i=n.getTextContent(),o=e.offset;t&&o>0?this.anchor.set(e.key,o-1,"text"):!t&&o<i.length&&this.focus.set(r.key,o+1,"text")}if(this.isCollapsed()){if(t&&0===e.offset&&ri(this,e.getNode()))return}else{const i="text"===r.type?r.getNode():null;if(n="text"===e.type?e.getNode():null,null!==i&&i.isSegmented()){const e=r.offset,o=i.getTextContentSize();if(i.is(n)||t&&e!==o||!t&&0!==e)return void si(i,t,e)}else if(null!==n&&n.isSegmented()){const r=e.offset,o=n.getTextContentSize();if(n.is(i)||t&&0!==r||!t&&r!==o)return void si(n,t,r)}!function(t,e){const n=t.anchor,i=t.focus,r=n.getNode();if(r===i.getNode()&&"text"===n.type&&"text"===i.type){const t=n.offset,o=i.offset,s=t<o,l=s?t:o,c=s?o:t,a=c-1;l!==a&&function(t){return!(Gr(t)||oi(t))}(r.getTextContent().slice(l,c))&&(e?i.set(i.key,a,i.type):n.set(n.key,a,n.type))}}(this,t)}}if(this.removeText(),t&&!e&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const t=this.anchor.getNode();t.isEmpty()&&nr(t.getParent())&&null===t.getPreviousSibling()&&ri(this,t)}}deleteLine(t){if(this.isCollapsed()){const e=this.anchor,n=this.focus,i=e.key,r=e.offset,o=n.key,s=n.offset;if(this.modify("extend",t,"lineboundary"),this.anchor.key===i&&this.anchor.offset===r&&this.focus.key===o&&this.focus.offset===s&&"text"===e.type){const i=e.getNode();if(Jn(i)){const r=i.getTextContent(),o=e.offset;t&&o>0?this.anchor.set(e.key,0,"text"):!t&&o<r.length&&this.focus.set(n.key,r.length,"text")}}}this.isCollapsed()?this.deleteCharacter(t):this.removeText()}isWordBoundary(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}findWordStart(t,e){let n=e-1;for(;n>=0&&this.isWordBoundary(t[n]);)n--;for(;n>0&&!this.isWordBoundary(t[n-1]);)n--;return n>=0?n:0}findWordEnd(t,e){let n=e;for(;n<t.length&&this.isWordBoundary(t[n]);)n++;for(;n<t.length&&!this.isWordBoundary(t[n]);)n++;return n}deleteWord(t){if(this.isCollapsed()){const e=this.anchor,n=e.getNode();if(this.forwardDeletion(e,n,t))return;const i=e.key,r=e.offset,o=this.focus,s=o.key,l=o.offset;if(this.modify("extend",t,"word"),this.anchor.key===i&&this.anchor.offset===r&&this.focus.key===s&&this.focus.offset===l&&"text"===e.type&&Jn(n)){const i=n.getTextContent(),r=e.offset;if(t)if(0===r){const t=n.getPreviousSibling();if(Jn(t)){const e=t.getTextContent(),n=this.findWordStart(e,e.length);this.anchor.set(t.__key,n,"text")}}else{const t=this.findWordStart(i,r);if(0===t&&this.isWordBoundary(i[0])){const t=n.getPreviousSibling();if(Jn(t)){const e=t.getTextContent(),n=this.findWordStart(e,e.length);return void this.anchor.set(t.__key,n,"text")}}this.anchor.set(e.key,t,"text")}else if(r===i.length){const t=n.getNextSibling();if(Jn(t)){const e=t.getTextContent(),n=this.findWordEnd(e,0);this.focus.set(t.__key,n,"text")}}else{const t=this.findWordEnd(i,r);if(t===i.length&&this.isWordBoundary(i[i.length-1])){const t=n.getNextSibling();if(Jn(t)){const e=t.getTextContent(),n=this.findWordEnd(e,0);return void this.focus.set(t.__key,n,"text")}}this.focus.set(o.key,t,"text")}}}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ei(t){return t instanceof Xn}function ni(t){const e=t.offset;if("text"===t.type)return e;const n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function ii(t){const e=t.getStartEndPoints();if(null===e)return[0,0];const[n,i]=e;return"element"===n.type&&"element"===i.type&&n.key===i.key&&n.offset===i.offset?[0,0]:[ni(n),ni(i)]}function ri(t,e){for(let n=e;n;n=n.getParent()){if(Gi(n)){if(n.collapseAtStart(t))return!0;if(ko(n))break}if(n.getPreviousSibling())break}return!1}const oi=(()=>{try{const t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("\u2764\ufe0f")&&e("#\ufe0f\u20e3")&&e("\ud83d\udc4d"))return e}catch(i){}return()=>!1})();function si(t,e,n){const i=t,r=i.getTextContent().split(/(?=\s)/g),o=r.length;let s=0,l=0;for(let a=0;a<o;a++){const t=a===o-1;if(l=s,s+=r[a].length,e&&s===n||s>n||t){r.splice(a,1),t&&(l=void 0);break}}const c=r.join("").trim();""===c?i.remove():(i.setTextContent(c),i.select(l,l))}function li(t,e,n,r){let o,s=e;if(Lo(t)){let l=!1;const c=t.childNodes,a=c.length,u=r._blockCursorElement;s===a&&(l=!0,s=a-1);let d=c[s],f=!1;if(d===u)d=c[s+1],f=!0;else if(null!==u){const n=u.parentNode;t===n&&e>Array.prototype.indexOf.call(n.children,u)&&s--}if(o=Yr(d),Jn(o))s=gs(o,l?"next":"previous");else{let c=Yr(t);if(null===c)return null;if(Gi(c)){const a=r.getElementByKey(c.getKey());null===a&&i(214);const u=c.getDOMSlot(a);[c,s]=u.resolveChildIndex(c,a,t,e),Gi(c)||i(215),l&&s>=c.getChildrenSize()&&(s=Math.max(0,c.getChildrenSize()-1));let d=c.getChildAtIndex(s);if(Gi(d)&&function(t,e,n){const i=t.getParent();return null===n||null===i||!i.canBeEmpty()||i!==n.getNode()}(d,0,n)){const t=l?d.getLastDescendant():d.getFirstDescendant();null===t?c=d:(d=t,c=Gi(d)?d:d.getParentOrThrow()),s=0}Jn(d)?(o=d,c=null,s=gs(d,l?"next":"previous")):d!==c&&l&&!f&&(Gi(c)||i(216),s=Math.min(c.getChildrenSize(),s+1))}else{const n=c.getIndexWithinParent();s=0===e&&tr(c)&&Yr(t)===c?n:n+1,c=c.getParentOrThrow()}if(Gi(c))return Hn(c.__key,s,"element")}}else o=Yr(t);return Jn(o)?Hn(o.__key,gs(o,s,"clamp"),"text"):null}function ci(t,e,n){const i=t.offset,r=t.getNode();if(0===i){const i=r.getPreviousSibling(),o=r.getParent();if(e){if((n||!e)&&null===i&&Gi(o)&&o.isInline()){const e=o.getPreviousSibling();Jn(e)&&t.set(e.__key,e.getTextContent().length,"text")}}else Gi(i)&&!n&&i.isInline()?t.set(i.__key,i.getChildrenSize(),"element"):Jn(i)&&t.set(i.__key,i.getTextContent().length,"text")}else if(i===r.getTextContent().length){const i=r.getNextSibling(),o=r.getParent();if(e&&Gi(i)&&i.isInline())t.set(i.__key,0,"element");else if((n||e)&&null===i&&Gi(o)&&o.isInline()&&!o.canInsertTextAfter()){const e=o.getNextSibling();Jn(e)&&t.set(e.__key,0,"text")}}}function ai(t,e,n){if("text"===t.type&&"text"===e.type){const i=t.isBefore(e),r=t.is(e);ci(t,i,r),ci(e,!i,r),r&&e.set(t.key,t.offset,t.type);const o=Fi();if(o.isComposing()&&o._compositionKey!==t.key&&Qn(n)){const i=n.anchor,r=n.focus;t.set(i.key,i.offset,i.type,!0),e.set(r.key,r.offset,r.type,!0)}}}function ui(t,e,n,i,r,o){if(null===t||null===n||!Tr(r,t,n))return null;const s=li(t,e,Qn(o)?o.anchor:null,r);if(null===s)return null;const l=li(n,i,Qn(o)?o.focus:null,r);if(null===l)return null;if("element"===s.type&&"element"===l.type){const e=Yr(t),i=Yr(n);if(tr(e)&&tr(i))return null}return ai(s,l,o),[s,l]}function di(t){return Gi(t)&&!t.isInline()}function fi(t,e,n,i,r,o){const s=Li(),l=new ti(Hn(t,e,r),Hn(n,i,o),0,"");return l.dirty=!0,s._selection=l,l}function hi(){const t=Hn("root",0,"element"),e=Hn("root",0,"element");return new ti(t,e,0,"")}function gi(){return new Xn(new Set)}function pi(t,e,n,i){const r=n._window;if(null===r)return null;const o=i||r.event,s=o?o.type:void 0,l="selectionchange"===s,c=!B&&(l||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let a,u,d,f;if(Qn(t)&&!c)return t.clone();if(null===e)return null;if(a=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(l||void 0===s)&&Qn(t)&&!Tr(n,a,u))return t.clone();const h=ui(a,d,u,f,n,t);if(null===h)return null;const[g,p]=h;return new ti(g,p,Qn(t)?t.format:0,Qn(t)?t.style:"")}function _i(){return Li()._selection}function mi(){return Fi()._editorState._selection}function yi(t,e,n,i=1){const r=t.anchor,o=t.focus,s=r.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const c=e.__key;if(t.isCollapsed()){const e=r.offset;if(n<=e&&i>0||n<e&&i<0){const n=Math.max(0,e+i);r.set(c,n,"element"),o.set(c,n,"element"),vi(t)}}else{const s=t.isBackward(),l=s?o:r,a=l.getNode(),u=s?r:o,d=u.getNode();if(e.is(a)){const t=l.offset;(n<=t&&i>0||n<t&&i<0)&&l.set(c,Math.max(0,t+i),"element")}if(e.is(d)){const t=u.offset;(n<=t&&i>0||n<t&&i<0)&&u.set(c,Math.max(0,t+i),"element")}}vi(t)}function vi(t){const e=t.anchor,n=e.offset,i=t.focus,r=i.offset,o=e.getNode(),s=i.getNode();if(t.isCollapsed()){if(!Gi(o))return;const t=o.getChildrenSize(),r=n>=t,s=o.getChildAtIndex(r?t-1:n);if(Jn(s)){let t=0;r&&(t=s.getTextContentSize()),e.set(s.__key,t,"text"),i.set(s.__key,t,"text")}return}if(Gi(o)){const t=o.getChildrenSize(),i=n>=t,r=o.getChildAtIndex(i?t-1:n);if(Jn(r)){let t=0;i&&(t=r.getTextContentSize()),e.set(r.__key,t,"text")}}if(Gi(s)){const t=s.getChildrenSize(),e=r>=t,n=s.getChildAtIndex(e?t-1:r);if(Jn(n)){let t=0;e&&(t=n.getTextContentSize()),i.set(n.__key,t,"text")}}}function xi(t,e,n,i,r){let o=null,s=0,l=null;null!==i?(o=i.__key,Jn(i)?(s=i.getTextContentSize(),l="text"):Gi(i)&&(s=i.getChildrenSize(),l="element")):null!==r&&(o=r.__key,Jn(r)?l="text":Gi(r)&&(l="element")),null!==o&&null!==l?t.set(o,s,l):(s=e.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),t.set(n.__key,s,"element"))}function Si(t,e,n,i,r){"text"===t.type?t.set(n,t.offset+(e?0:r),"text"):t.offset>i.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function Ci(t,e,n,i,r){try{t.setBaseAndExtent(e,n,i,r)}catch(t){}}function bi(t){let e=t;t.isCollapsed()||e.removeText();const n=_i();Qn(n)&&(e=n),Qn(e)||i(161);const r=e.anchor;let o=r.getNode(),s=r.offset;for(;!zo(o);){const t=o;if([o,s]=Ei(o,s),t.is(o))break}return s}function Ei(t,e){const n=t.getParent();if(!n){const t=dr();return $r().append(t),t.select(),[$r(),0]}if(Jn(t)){const i=t.splitText(e);if(0===i.length)return[n,t.getIndexWithinParent()];const r=0===e?0:1;return[n,i[0].getIndexWithinParent()+r]}if(!Gi(t)||0===e)return[n,t.getIndexWithinParent()];const i=t.getChildAtIndex(e);if(i){const n=new ti(Hn(t.__key,e,"element"),Hn(t.__key,e,"element"),0,""),r=t.insertNewAfter(n);r&&r.append(i,...i.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function ki(t,e,n,i,r="decorators-and-blocks"){if("move"===e&&"character"===i&&!t.isCollapsed()){const[e,i]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return i.set(e.key,e.offset,e.type),!0}const o=Ts(t.focus,n?"previous":"next"),s="lineboundary"===i,l="move"===e;let c=o,a="decorators-and-blocks"===r;if(!Rs(c)){for(const t of c){a=!1;const{origin:e}=t;if(!tr(e)||e.isIsolated()||(c=t,!s||!e.isInline()))break}if(a)for(const t of xs(o).iterNodeCarets("extend"===e?"shadowRoot":"root")){if(cs(t))t.origin.isInline()||(c=t);else{if(Gi(t.origin))continue;tr(t.origin)&&!t.origin.isInline()&&(c=t)}break}}if(c===o)return!1;if(l&&!s&&tr(c.origin)&&c.origin.isKeyboardSelectable()){const t=gi();return t.add(c.origin.getKey()),Hr(t),!0}return c=Fs(c),l&&Ms(t.anchor,c),Ms(t.focus,c),a||!s}let wi=null,Ni=null,Ti=!1,Mi=!1,Oi=0;const Pi={characterData:!0,childList:!0,subtree:!0};function Di(){return Ti||null!==wi&&wi._readOnly}function Ai(){Ti&&i(13)}function Ii(){Oi>99&&i(14)}function Li(){return null===wi&&i(195,Ri()),wi}function Fi(){return null===Ni&&i(196,Ri()),Ni}function Ri(){let t=0;const e=new Set,n=vr.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=Pr(r);if(Mr(i))t++;else if(i){let t=String(i.constructor.version||"<0.17.1");t===n&&(t+=" (separately built, likely a bundler configuration issue)"),e.add(t)}}let i=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(i+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),i}function Ki(t,e,n){const i=e.__type,r=br(t,i);let o=n.get(i);void 0===o&&(o=Array.from(r.transforms),n.set(i,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function Bi(t,e){return void 0!==t&&t.__key!==e&&t.isAttached()}function zi(t,e){if(!e)return;const n=t._updateTags;let i=e;Array.isArray(e)||(i=[e]);for(const r of i)n.add(r)}function Wi(t,e){const n=t.type,r=e.get(n);void 0===r&&i(17,n);const o=r.klass;t.type!==o.getType()&&i(18,o.name);const s=o.importJSON(t),l=t.children;if(Gi(s)&&Array.isArray(l))for(let i=0;i<l.length;i++){const t=Wi(l[i],e);s.append(t)}return s}function ji(t,e,n){const i=wi,r=Ti,o=Ni;wi=e,Ti=!0,Ni=t;try{return n()}finally{wi=i,Ti=r,Ni=o}}function Ji(t,e){const n=t._pendingEditorState,i=t._rootElement,r=t._headless||null===i;if(null===n)return;const o=t._editorState,s=o._selection,l=n._selection,c=0!==t._dirtyType,a=wi,u=Ti,d=Ni,f=t._updating,h=t._observer;let g=null;if(t._pendingEditorState=null,t._editorState=n,!r&&c&&null!==h){Ni=t,wi=n,Ti=!1,t._updating=!0;try{const e=t._dirtyType,i=t._dirtyElements,r=t._dirtyLeaves;h.disconnect(),g=function(t,e,n,i,r,o){mt="",xt="",St=2===i,ct=n,lt=n._config,at=n._nodes,ut=ct._listeners.mutation,dt=r,ft=o,ht=t._nodeMap,gt=e._nodeMap,Ct=e._readOnly,pt=new Map(n._keyToDOMMap);const s=new Map;return _t=s,Lt("root",null),ct=void 0,at=void 0,dt=void 0,ft=void 0,ht=void 0,gt=void 0,lt=void 0,pt=void 0,_t=void 0,s}(o,n,t,e,i,r)}catch(e){if(e instanceof Error&&t._onError(e),Mi)throw e;return _r(t,null,i,n),q(t),t._dirtyType=2,Mi=!0,Ji(t,o),void(Mi=!1)}finally{h.observe(i,Pi),t._updating=f,wi=a,Ti=u,Ni=d}}n._readOnly||(n._readOnly=!0);const p=t._dirtyLeaves,m=t._dirtyElements,y=t._normalizedNodes,v=t._updateTags,x=t._deferred;c&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set),function(t,e){const n=t._decorators;let i=t._pendingDecorators||n;const r=e._nodeMap;let o;for(o in i)r.has(o)||(i===n&&(i=Zr(t)),delete i[o])}(t,n);const S=r?null:Do(t);if(t._editable&&null!==S&&(c||null===l||l.dirty||!l.is(s))&&null!==i&&!v.has("skip-dom-selection")){Ni=t,wi=n;try{if(null!==h&&h.disconnect(),c||null===l||l.dirty){const e=t._blockCursorElement;null!==e&&Mo(e,t,i),function(t,e,n,i,r,o){const s=i.anchorNode,l=i.focusNode,c=i.anchorOffset,a=i.focusOffset,u=Io(o);if(r.has("collaboration")&&u!==o||null!==u&&Nr(u))return;if(!Qn(e))return void(null!==t&&Tr(n,s,l)&&i.removeAllRanges());const d=e.anchor,f=e.focus,h=d.key,g=f.key,p=yo(n,h),_=yo(n,g),m=d.offset,y=f.offset,v=e.format,x=e.style,S=e.isCollapsed();let C=p,b=_,E=!1;if("text"===d.type){C=Lr(p);const t=d.getNode();E=t.getFormat()!==v||t.getStyle()!==x}else Qn(t)&&"text"===t.anchor.type&&(E=!0);var k,w,N,T,M;if("text"===f.type&&(b=Lr(_)),null!==C&&null!==b&&(S&&(null===t||E||Qn(t)&&(t.format!==v||t.style!==x))&&(k=v,w=x,N=m,T=h,M=performance.now(),qe=[k,w,N,T,M]),c!==m||a!==y||s!==C||l!==b||"Range"===i.type&&S||(null!==u&&o.contains(u)||r.has("skip-selection-focus")||o.focus({preventScroll:!0}),"element"===d.type))){if(Ci(i,C,m,b,y),!r.has("skip-scroll-into-view")&&e.isCollapsed()&&null!==o&&o===document.activeElement){const t=Qn(e)&&"element"===e.anchor.type?C.childNodes[m]||null:i.rangeCount>0?i.getRangeAt(0):null;if(null!==t){let e;if(t instanceof Text){const n=document.createRange();n.selectNode(t),e=n.getBoundingClientRect()}else e=t.getBoundingClientRect();!function(t,e,n){const i=So(n),r=bo(i);if(null===i||null===r)return;let{top:o,bottom:s}=e,l=0,c=0,a=n;for(;null!==a;){const e=a===i.body;if(e)l=0,c=Eo(t).innerHeight;else{const t=a.getBoundingClientRect();l=t.top,c=t.bottom}let n=0;if(o<l?n=-(l-o):s>c&&(n=s-c),0!==n)if(e)r.scrollBy(0,n);else{const t=a.scrollTop;a.scrollTop+=n;const e=a.scrollTop-t;o-=e,s-=e}if(e)break;a=xo(a)}}(n,e,o)}}We=!0}}(s,l,t,S,v,i)}!function(t,e,n){let i=t._blockCursorElement;if(Qn(n)&&n.isCollapsed()&&"element"===n.anchor.type&&e.contains(Io(e))){const r=n.anchor,o=r.getNode(),s=r.offset;let l=!1,c=null;if(s===o.getChildrenSize())To(o.getChildAtIndex(s-1))&&(l=!0);else{const e=o.getChildAtIndex(s);if(null!==e&&To(e)){const n=e.getPreviousSibling();(null===n||To(n))&&(l=!0,c=t.getElementByKey(e.__key))}}if(l){const n=t.getElementByKey(o.__key);return null===i&&(t._blockCursorElement=i=function(t){const e=t.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let i=e.blockCursor;if(void 0!==i){if("string"==typeof i){const t=_(i);i=e.blockCursor=t}void 0!==i&&n.classList.add(...i)}return n}(t._config)),e.style.caretColor="transparent",void(null===c?n.appendChild(i):n.insertBefore(i,c))}}null!==i&&Mo(i,t,e)}(t,i,l)}finally{null!==h&&h.observe(i,Pi),Ni=d,wi=a}}null!==g&&function(t,e,n,i,r){const o=Array.from(t._listeners.mutation),s=o.length;for(let l=0;l<s;l++){const[t,s]=o[l];for(const o of s){const s=e.get(o);void 0!==s&&t(s,{dirtyLeaves:i,prevEditorState:r,updateTags:n})}}}(t,g,v,p,o),Qn(l)||null===l||null!==s&&s.is(l)||t.dispatchCommand(zt,void 0);const C=t._pendingDecorators;null!==C&&(t._decorators=C,t._pendingDecorators=null,Ui("decorator",t,!0,C)),function(t,e,n){const i=Vr(e),r=Vr(n);i!==r&&Ui("textcontent",t,!0,r)}(t,e||o,n),Ui("update",t,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:y,prevEditorState:e||o,tags:v}),function(t,e){if(t._deferred=[],0!==e.length){const n=t._updating;t._updating=!0;try{for(let t=0;t<e.length;t++)e[t]()}finally{t._updating=n}}}(t,x),function(t){const e=t._updates;if(0!==e.length){const n=e.shift();if(n){const[e,i]=n;Vi(t,e,i)}}}(t)}function Ui(t,e,n,...i){const r=e._updating;e._updating=n;try{const n=Array.from(e._listeners[t]);for(let t=0;t<n.length;t++)n[t].apply(null,i)}finally{e._updating=r}}function Zi(t,e){const n=t._updates;let r=e||!1;for(;0!==n.length;){const e=n.shift();if(e){const[n,o]=e,s=t._pendingEditorState;let l;void 0!==o&&(l=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(null===s&&i(191),s._flushSync=!0),l&&t._deferred.push(l),zi(t,o.tag)),null==s?Vi(t,n,o):n()}}return r}function Vi(t,e,n){const r=t._updateTags;let o,s=!1,l=!1;void 0!==n&&(o=n.onUpdate,zi(t,n.tag),s=n.skipTransforms||!1,l=n.discrete||!1),o&&t._deferred.push(o);const c=t._editorState;let a=t._pendingEditorState,u=!1;(null===a||a._readOnly)&&(a=t._pendingEditorState=ir(a||c),u=!0),a._flushSync=l;const d=wi,f=Ti,h=Ni,g=t._updating;wi=a,Ti=!1,t._updating=!0,Ni=t;const p=t._headless||null===t.getRootElement();Sr(null);try{u&&(p?null!==c._selection&&(a._selection=c._selection.clone()):a._selection=function(t,e){const n=t.getEditorState()._selection,i=Do(t);return Qn(n)||null==n?pi(n,i,t,e):n.clone()}(t,n&&n.event||null));const r=t._compositionKey;e(),s=Zi(t,s),function(t,e){const n=e.getEditorState()._selection,i=t._selection;if(Qn(i)){const t=i.anchor,e=i.focus;let r;if("text"===t.type&&(r=t.getNode(),r.selectionTransform(n,i)),"text"===e.type){const t=e.getNode();r!==t&&t.selectionTransform(n,i)}}}(a,t),0!==t._dirtyType&&(s?function(t,e){const n=e._dirtyLeaves,i=t._nodeMap;for(const r of n){const t=i.get(r);Jn(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&rt(t)}}(a,t):function(t,e){const n=e._dirtyLeaves,i=e._dirtyElements,r=t._nodeMap,o=zr(),s=new Map;let l=n,c=l.size,a=i,u=a.size;for(;c>0||u>0;){if(c>0){e._dirtyLeaves=new Set;for(const t of l){const i=r.get(t);Jn(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&rt(i),void 0!==i&&Bi(i,o)&&Ki(e,i,s),n.add(t)}if(l=e._dirtyLeaves,c=l.size,c>0){Oi++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map,a.delete("root")&&a.set("root",!0);for(const t of a){const n=t[0],l=t[1];if(i.set(n,l),!l)continue;const c=r.get(n);void 0!==c&&Bi(c,o)&&Ki(e,c,s)}l=e._dirtyLeaves,c=l.size,a=e._dirtyElements,u=a.size,Oi++}e._dirtyLeaves=n,e._dirtyElements=i}(a,t),Zi(t),function(t,e,n,i){const r=t._nodeMap,o=e._nodeMap,s=[];for(const[l]of i){const t=o.get(l);void 0!==t&&(t.isAttached()||(Gi(t)&&K(t,l,r,o,s,i),r.has(l)||i.delete(l),s.push(l)))}for(const l of s)o.delete(l);for(const l of n){const t=o.get(l);void 0===t||t.isAttached()||(r.has(l)||n.delete(l),o.delete(l))}}(c,a,t._dirtyLeaves,t._dirtyElements)),r!==t._compositionKey&&(a._flushSync=!0);const o=a._selection;if(Qn(o)){const t=a._nodeMap,e=o.focus.key;void 0!==t.get(o.anchor.key)&&void 0!==t.get(e)||i(19)}else ei(o)&&0===o._nodes.size&&(a._selection=null)}catch(i){return i instanceof Error&&t._onError(i),t._pendingEditorState=c,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void Ji(t)}finally{wi=d,Ti=f,Ni=h,t._updating=g,Oi=0}const _=0!==t._dirtyType||t._deferred.length>0||function(t,e){const n=e.getEditorState()._selection,i=t._selection;if(null!==i){if(i.dirty||!i.is(n))return!0}else if(null!==n)return!0;return!1}(a,t);_?a._flushSync?(a._flushSync=!1,Ji(t)):u&&kr(()=>{Ji(t)}):(a._flushSync=!1,u&&(r.clear(),t._deferred=[],t._pendingEditorState=null))}function $i(t,e,n){Ni===t&&void 0===n?e():Vi(t,e,n)}class qi{element;before;after;constructor(t,e,n){this.element=t,this.before=e||null,this.after=n||null}withBefore(t){return new qi(this.element,t,this.after)}withAfter(t){return new qi(this.element,this.before,t)}withElement(t){return this.element===t?this:new qi(t,this.before,this.after)}insertChild(t){const e=this.before||this.getManagedLineBreak();return null!==e&&e.parentElement!==this.element&&i(222),this.element.insertBefore(t,e),this}removeChild(t){return t.parentElement!==this.element&&i(223),this.element.removeChild(t),this}replaceChild(t,e){return e.parentElement!==this.element&&i(224),this.element.replaceChild(t,e),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){null===t?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===t&&(p||d||u))}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const e=this.element,n="IMG"===t.nodeName?t.nextSibling:null;n&&e.removeChild(n),e.removeChild(t),e.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const e=this.getManagedLineBreak();if(e){if(t===("IMG"===e.nodeName))return;this.removeManagedLineBreak()}const n=this.element,i=this.before,r=document.createElement("br");if(n.insertBefore(r,i),t){const t=document.createElement("img");t.setAttribute("data-lexical-linebreak","true"),t.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",t.alt="",n.insertBefore(t,r),n.__lexicalLineBreak=t}else n.__lexicalLineBreak=r}getFirstChildOffset(){let t=0;for(let e=this.after;null!==e;e=e.previousSibling)t++;return t}resolveChildIndex(t,e,n,i){if(n===this.element){const e=this.getFirstChildOffset();return[t,Math.min(e+t.getChildrenSize(),Math.max(e,i))]}const r=Hi(e,n);r.push(i);const o=Hi(e,this.element);let s=t.getIndexWithinParent();for(let l=0;l<o.length;l++){const t=r[l],e=o[l];if(void 0===t||t<e)break;if(t>e){s+=1;break}}return[t.getParentOrThrow(),s]}}function Hi(t,e){const n=[];let r=e;for(;r!==t&&null!==r;r=r.parentNode){let t=0;for(let e=r.previousSibling;null!==e;e=e.previousSibling)t++;n.push(t)}return r!==t&&i(225),n.reverse()}class Yi extends mn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return I[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getChildrenKeys(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e.__key),e=e.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const t=Fi()._dirtyElements;return null!==t&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),e=this.getParentOrThrow().getLastChild();return null!==e&&e.is(t)}getAllTextNodes(){const t=[];let e=this.getFirstChild();for(;null!==e;){if(Jn(e)&&t.push(e),Gi(e)){const n=e.getAllTextNodes();t.push(...n)}e=e.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;Gi(t);){const e=t.getFirstChild();if(null===e)break;t=e}return t}getLastDescendant(){let t=this.getLastChild();for(;Gi(t);){const e=t.getLastChild();if(null===e)break;t=e}return t}getDescendantByIndex(t){const e=this.getChildren(),n=e.length;if(t>=n){const t=e[n-1];return Gi(t)&&t.getLastDescendant()||t||null}const i=e[t];return Gi(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const t=this.getLatest().__first;return null===t?null:Wr(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return null===t&&i(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return null===t?null:Wr(t)}getLastChildOrThrow(){const t=this.getLastChild();return null===t&&i(96,this.__key),t}getChildAtIndex(t){const e=this.getChildrenSize();let n,i;if(t<e/2){for(n=this.getFirstChild(),i=0;null!==n&&i<=t;){if(i===t)return n;n=n.getNextSibling(),i++}return null}for(n=this.getLastChild(),i=e-1;null!==n&&i>=t;){if(i===t)return n;n=n.getPreviousSibling(),i--}return null}getTextContent(){let t="";const e=this.getChildren(),n=e.length;for(let i=0;i<n;i++){const r=e[i];t+=r.getTextContent(),Gi(r)&&i!==n-1&&!r.isInline()&&(t+=N)}return t}getTextContentSize(){let t=0;const e=this.getChildren(),n=e.length;for(let i=0;i<n;i++){const r=e[i];t+=r.getTextContentSize(),Gi(r)&&i!==n-1&&!r.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(""!==t){const e=A[t];return 0!==(this.getFormat()&e)}return!1}hasTextFormat(t){const e=P[t];return 0!==(this.getTextFormat()&e)}getFormatFlags(t,e){return Fr(this.getLatest().__textFormat,t,e)}getTextStyle(){return this.getLatest().__textStyle}select(t,e){Ai();const n=_i();let i=t,r=e;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===t&&0===e){const t=this.getFirstChild();if(Jn(t)||Gi(t))return t.select(0,0)}else if(!(void 0!==t&&t!==o||void 0!==e&&e!==o)){const t=this.getLastChild();if(Jn(t)||Gi(t))return t.select()}void 0===i&&(i=o),void 0===r&&(r=o);const s=this.__key;return Qn(n)?(n.anchor.set(s,i,"element"),n.focus.set(s,r,"element"),n.dirty=!0,n):fi(s,i,s,r,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(t=>t.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const e=this.getWritable();return e.__dir=t,e}setFormat(t){return this.getWritable().__format=""!==t?A[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const e=this.getWritable();return e.__textFormat=t,e}setTextStyle(t){const e=this.getWritable();return e.__textStyle=t,e}setIndent(t){return this.getWritable().__indent=t,this}splice(t,e,n){_n(this)&&i(324,this.__key,this.__type);const r=this.getChildrenSize(),o=this.getWritable();t+e<=r||i(226,String(t),String(e),String(r));const s=o.__key,l=[],c=[],a=this.getChildAtIndex(t+e);let u=null,d=r-e+n.length;if(0!==t)if(t===r)u=this.getLastChild();else{const e=this.getChildAtIndex(t);null!==e&&(u=e.getPreviousSibling())}if(e>0){let t=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<e;n++){null===t&&i(100);const e=t.getNextSibling(),n=t.__key;Rr(t.getWritable()),c.push(n),t=e}}let f=u;for(const h of n){null!==f&&h.is(f)&&(u=f=f.getPreviousSibling());const t=h.getWritable();t.__parent===s&&d--,Rr(t);const e=h.__key;if(null===f)o.__first=e,t.__prev=null;else{const n=f.getWritable();n.__next=e,t.__prev=n.__key}h.__key===s&&i(76),t.__parent=s,l.push(e),f=h}if(t+e===r)null!==f&&(f.getWritable().__next=null,o.__last=f.__key);else if(null!==a){const t=a.getWritable();if(null!==f){const e=f.getWritable();t.__prev=f.__key,e.__next=a.__key}else t.__prev=null}if(o.__size=d,c.length){const t=_i();if(Qn(t)){const e=new Set(c),n=new Set(l),{anchor:i,focus:r}=t;Xi(i,e,n)&&xi(i,i.getNode(),this,u,a),Xi(r,e,n)&&xi(r,r.getNode(),this,u,a),0!==d||this.canBeEmpty()||ko(this)||this.remove()}}return o}getDOMSlot(t){return new qi(t)}exportDOM(t){const{element:e}=super.exportDOM(t);if(Lo(e)){const t=this.getIndent();t>0&&(e.style.paddingInlineStart=40*t+"px");const n=this.getDirection();n&&(e.dir=n)}return{element:e}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},e=this.getTextFormat(),n=this.getTextStyle();return 0===e&&""===n||ko(this)||this.getChildren().some(Jn)||(0!==e&&(t.textFormat=e),""!==n&&(t.textStyle=n)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,e){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,e,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,e){const n=this.getDOMSlot(t);let i=n.getFirstChild();for(let r=this.getFirstChild();r;r=r.getNextSibling()){const t=e.getElementByKey(r.getKey());null!==t&&(null==i?(n.insertChild(t),i=t):i!==t&&n.replaceChild(t,i),i=i.nextSibling)}}}function Gi(t){return t instanceof Yi}function Xi(t,e,n){let i=t.getNode();for(;i;){const t=i.__key;if(e.has(t)&&!n.has(t))return!0;i=i.getParent()}return!1}class Qi extends mn{decorate(t,e){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function tr(t){return t instanceof Qi}class er extends Yi{__cachedText;static getType(){return"root"}static clone(){return new er}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){i(51)}getTextContent(){const t=this.__cachedText;return!Di()&&0!==Fi()._dirtyType||null===t?super.getTextContent():t}remove(){i(52)}replace(t){i(53)}insertBefore(t){i(54)}insertAfter(t){i(55)}updateDOM(t,e){return!1}splice(t,e,n){for(const r of n)Gi(r)||tr(r)||i(282);return super.splice(t,e,n)}static importJSON(t){return $r().updateFromJSON(t)}collapseAtStart(){return!0}}function nr(t){return t instanceof er}function ir(t){return new lr(new Map(t._nodeMap))}function rr(){return new lr(new Map([["root",new er]]))}function or(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&i(130,n.name),Gi(t)){const r=e.children;Array.isArray(r)||i(59,n.name);const o=t.getChildren();for(let t=0;t<o.length;t++){const e=or(o[t]);r.push(e)}}return e}function sr(t){return t instanceof lr}class lr{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,e){this._nodeMap=t,this._selection=e||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(t,e){return ji(e&&e.editor||null,this,t)}clone(t){const e=new lr(this._nodeMap,void 0===t?this._selection:t);return e._readOnly=!0,e}toJSON(){return ji(null,this,()=>({root:or($r())}))}}class cr extends Yi{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class ar extends Yi{static getType(){return"paragraph"}static clone(t){return new ar(t.__key)}createDOM(t){const e=document.createElement("p"),n=fo(t.theme,"paragraph");return void 0!==n&&e.classList.add(...n),e}updateDOM(t,e,n){return!1}static importDOM(){return{p:t=>({conversion:ur,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(Lo(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t)}return{element:e}}static importJSON(t){return dr().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(void 0===t.textFormat||void 0===t.textStyle){const e=this.getChildren().find(Jn);e?(t.textFormat=e.getFormat(),t.textStyle=e.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,e){const n=dr();n.setTextFormat(t.format),n.setTextStyle(t.style);const i=this.getDirection();return n.setDirection(i),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,e),n}collapseAtStart(){const t=this.getChildren();if(0===t.length||Jn(t[0])&&""===t[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 ur(t){const e=dr();return t.style&&(e.setFormat(t.style.textAlign),function(t,e){const n=parseInt(t.style.paddingInlineStart,10)||0,i=Math.round(n/40);e.setIndent(i)}(t,e)),{node:e}}function dr(){return wo(new ar)}function fr(t){return t instanceof ar}const hr=0,gr=1,pr=4;function _r(t,e,n,i){const r=t._keyToDOMMap;r.clear(),t._editorState=rr(),t._pendingEditorState=i,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null;const o=t._observer;null!==o&&(o.disconnect(),t._observer=null),null!==e&&(e.textContent=""),null!==n&&(n.textContent="",r.set("root",n))}function mr(t){const e=new Set,n=new Set;let i=t;for(;i;){const{ownNodeConfig:t}=Ho(i),r=i.transform;if(!n.has(r)){n.add(r);const t=i.transform();t&&e.add(t)}if(t){const n=t.$transform;n&&e.add(n),i=t.extends}else{const t=Object.getPrototypeOf(i);i=t.prototype instanceof mn&&t!==mn?t:void 0}}return e}function yr(t){const e=t||{},n=Ni,i=e.theme||{},r=void 0===t?n:e.parentEditor||null,o=e.disableEvents||!1,s=rr(),l=e.namespace||(null!==r?r._config.namespace:Qr()),c=e.editorState,a=[er,An,Cn,Zn,ar,cr,...e.nodes||[]],{onError:u,html:d}=e,f=void 0===e.editable||e.editable;let h;if(void 0===t&&null!==n)h=n._nodes;else{h=new Map;for(let t=0;t<a.length;t++){let e=a[t],n=null,i=null;if("function"!=typeof e){const t=e;e=t.replace,n=t.with,i=t.withKlass||null}Ho(e);const r=e.getType(),o=mr(e);h.set(r,{exportDOM:d&&d.export?d.export.get(e):void 0,klass:e,replace:n,replaceWithKlass:i,sharedNodeState:H(a[t]),transforms:o})}}const g=new vr(s,r,h,{disableEvents:o,namespace:l,theme:i},u||console.error,function(t,e){const n=new Map,i=new Set,r=t=>{Object.keys(t).forEach(e=>{let i=n.get(e);void 0===i&&(i=[],n.set(e,i)),i.push(t[e])})};return t.forEach(t=>{const e=t.klass.importDOM;if(null==e||i.has(e))return;i.add(e);const n=e.call(t.klass);null!==n&&r(n)}),e&&r(e),n}(h,d?d.import:void 0),f,t);return void 0!==c&&(g._pendingEditorState=c,g._dirtyType=2),function(t){t.registerCommand(jt,en,hr),t.registerCommand(Jt,nn,hr),t.registerCommand(Ut,rn,hr),t.registerCommand(Zt,on,hr),t.registerCommand(ie,ln,hr)}(g),g}class vr{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,e,n,i,r,o,s,l){this._createEditorArgs=l,this._parentEditor=e,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,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=Qr(),this._onError=r,this._htmlConversions=o,this._editable=s,this._headless=null!==e&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(t){const e=this._listeners.update;return e.add(t),()=>{e.delete(t)}}registerEditableListener(t){const e=this._listeners.editable;return e.add(t),()=>{e.delete(t)}}registerDecoratorListener(t){const e=this._listeners.decorator;return e.add(t),()=>{e.delete(t)}}registerTextContentListener(t){const e=this._listeners.textcontent;return e.add(t),()=>{e.delete(t)}}registerRootListener(t){const e=this._listeners.root;return t(this._rootElement,null),e.add(t),()=>{t(null,this._rootElement),e.delete(t)}}registerCommand(t,e,n){void 0===n&&i(35);const r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(t);void 0===o&&i(36,String(t));const s=o[n];return s.add(e),()=>{s.delete(e),o.every(t=>0===t.size)&&r.delete(t)}}registerMutationListener(t,e,n){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,r=this._listeners.mutation;let o=r.get(e);void 0===o&&(o=new Set,r.set(e,o)),o.add(i);const s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(e,i),()=>{o.delete(i),0===o.size&&r.delete(e)}}getRegisteredNode(t){const e=this._nodes.get(t.getType());return void 0===e&&i(37,t.name),e}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){const n=this._editorState,i=Uo(n).get(e.getType());if(!i)return;const r=new Map;for(const o of i.keys())r.set(o,"created");r.size>0&&t(r,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){const n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){const n=this.registerNodeTransformToKlass(t,e),i=[n],r=n.replaceWithKlass;if(null!=r){const t=this.registerNodeTransformToKlass(r,e);i.push(t)}return function(t,e){const n=Uo(t.getEditorState()),i=[];for(const r of e){const t=n.get(r);t&&i.push(t)}0!==i.length&&t.update(()=>{for(const t of i)for(const e of t.keys()){const t=Wr(e);t&&t.markDirty()}},null===t._pendingEditorState?{tag:xn}:void 0)}(this,i.map(t=>t.klass.getType())),()=>{i.forEach(t=>t.transforms.delete(e))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return _o(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const e=this._rootElement;if(t!==e){const n=fo(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=t,_r(this,e,t,i),null!==e&&(this._config.disableEvents||hn(e),null!=n&&e.classList.remove(...n)),null!==t){const e=bo(t),i=t.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=e,this._dirtyType=2,q(this),this._updateTags.add(xn),Ji(this),this._config.disableEvents||function(t,e){const n=Ao(t);Be.set(t,n);const i=ze.get(n)??0;i<1&&n.addEventListener("selectionchange",un),ze.set(n,i+1),t.__lexicalEditor=e;const r=cn(t);for(let o=0;o<Ie.length;o++){const[n,i]=Ie[o],s="function"==typeof i?t=>{fn(t)||(dn(t),(e.isEditable()||"click"===n)&&i(t,e))}:t=>{if(fn(t))return;dn(t);const i=e.isEditable();switch(n){case"cut":return i&&_o(e,Ee,t);case"copy":return _o(e,be,t);case"paste":return i&&_o(e,Yt,t);case"dragstart":return i&&_o(e,xe,t);case"dragover":return i&&_o(e,Se,t);case"dragend":return i&&_o(e,Ce,t);case"focus":return i&&_o(e,Oe,t);case"blur":return i&&_o(e,Pe,t);case"drop":return i&&_o(e,ve,t)}};t.addEventListener(n,s),r.push(()=>{t.removeEventListener(n,s)})}}(t,this),null!=n&&t.classList.add(...n)}else this._window=null,this._updateTags.add(xn),Ji(this);Ui("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,e){t.isEmpty()&&i(38);let n=t;n._readOnly&&(n=ir(t),n._selection=t._selection?t._selection.clone():null),$(this);const r=this._pendingEditorState,o=this._updateTags,s=void 0!==e?e.tag:null;null===r||r.isEmpty()||(null!=s&&o.add(s),Ji(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&o.add(s),this._updating||Ji(this)}parseEditorState(t,e){return function(t,e,n){const i=rr(),r=wi,o=Ti,s=Ni,l=e._dirtyElements,c=e._dirtyLeaves,a=e._cloneNotNeeded,u=e._dirtyType;e._dirtyElements=new Map,e._dirtyLeaves=new Set,e._cloneNotNeeded=new Set,e._dirtyType=0,wi=i,Ti=!1,Ni=e,Sr(null);try{Wi(t.root,e._nodes),n&&n(),i._readOnly=!0}catch(t){t instanceof Error&&e._onError(t)}finally{e._dirtyElements=l,e._dirtyLeaves=c,e._cloneNotNeeded=a,e._dirtyType=u,wi=r,Ti=o,Ni=s}return i}("string"==typeof t?JSON.parse(t):t,this,e)}read(t){return Ji(this),this.getEditorState().read(t,{editor:this})}update(t,e){!function(t,e,n){t._updating?t._updates.push([e,n]):Vi(t,e,n)}(this,t,e)}focus(t,e={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),$i(this,()=>{const i=_i(),r=$r();null!==i?i.dirty||Hr(i.clone()):0!==r.getChildrenSize()&&("rootStart"===e.defaultSelection?r.selectStart():r.selectEnd()),Ai(),Fi()._updateTags.add("focus"),function(t){Ai(),Fi()._deferred.push(t)}(()=>{n.removeAttribute("autocapitalize"),t&&t()})}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;null!==t&&t.blur();const e=Do(this);null!==e&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Ui("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}vr.version="0.38.2+prod.esm";let xr=null;function Sr(t){xr=t}let Cr=1;function br(t,e){const n=Er(t,e);return void 0===n&&i(30,e),n}function Er(t,e){return t._nodes.get(e)}const kr="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)};function wr(t){return tr(Ur(t))}function Nr(t){const e=Or(t),n=e?e.getRootElement():null,i=n?Io(n):document.activeElement;if(!Lo(i))return!1;const r=i.nodeName;return tr(Ur(t))&&("INPUT"===r||"TEXTAREA"===r||"true"===i.contentEditable&&null==Pr(i))}function Tr(t,e,n){const i=t.getRootElement();try{return null!==i&&i.contains(e)&&i.contains(n)&&null!==e&&!Nr(e)&&Or(e)===t}catch(t){return!1}}function Mr(t){return t instanceof vr}function Or(t){let e=t;for(;null!=e;){const t=Pr(e);if(Mr(t))return t;e=xo(e)}return null}function Pr(t){return t?t.__lexicalEditor:null}function Dr(t){return $n(t)||t.isToken()}function Ar(t){return Dr(t)||t.isSegmented()}function Ir(t){return Fo(t)&&3===t.nodeType}function Lr(t){let e=t;for(;null!=e;){if(Ir(e))return e;e=e.firstChild}return null}function Fr(t,e,n){const i=P[e];if(null!==n&&(t&i)===(n&i))return t;let r=t^i;return"subscript"===e?r&=~P.superscript:"superscript"===e?r&=~P.subscript:"lowercase"===e?(r&=~P.uppercase,r&=~P.capitalize):"uppercase"===e?(r&=~P.lowercase,r&=~P.capitalize):"capitalize"===e&&(r&=~P.lowercase,r&=~P.uppercase),r}function Rr(t){const e=t.getParent();if(null!==e){const n=t.getWritable(),i=e.getWritable(),r=t.getPreviousSibling(),o=t.getNextSibling(),s=null!==o?o.__key:null,l=null!==r?r.__key:null,c=null!==r?r.getWritable():null,a=null!==o?o.getWritable():null;null===r&&(i.__first=s),null===o&&(i.__last=l),null!==c&&(c.__next=s),null!==a&&(a.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,i.__size--}}function Kr(t){Ii(),_n(t)&&i(323,t.__key,t.__type);const e=t.getLatest(),n=e.__parent,r=Li(),o=Fi(),s=o._dirtyElements;null!==n&&function(t,e,n){let i=t;for(;null!==i;){if(n.has(i))return;const t=e.get(i);if(void 0===t)break;n.set(i,!1),i=t.__parent}}(n,r._nodeMap,s);const l=e.__key;o._dirtyType=1,Gi(t)?s.set(l,!0):o._dirtyLeaves.add(l)}function Br(t){Ai();const e=Fi(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,null!==n){const t=Wr(n);null!==t&&t.getWritable()}if(null!==t){const e=Wr(t);null!==e&&e.getWritable()}}}function zr(){return Di()?null:Fi()._compositionKey}function Wr(t,e){const n=(e||Li())._nodeMap.get(t);return void 0===n?null:n}function jr(t,e){const n=Jr(t,Fi());return void 0!==n?Wr(n,e):null}function Jr(t,e){return t[`__lexicalKey_${e._key}`]}function Ur(t,e){let n=t;for(;null!=n;){const t=jr(n,e);if(null!==t)return t;n=xo(n)}return null}function Zr(t){const e=Object.assign({},t._decorators);return t._pendingDecorators=e,e}function Vr(t){return t.read(()=>$r().getTextContent())}function $r(){return qr(Li())}function qr(t){return t._nodeMap.get("root")}function Hr(t){Ai();const e=Li();null!==t&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function Yr(t){const e=Fi(),n=function(t,e){let n=t;for(;null!=n;){const t=Jr(n,e);if(void 0!==t)return t;n=xo(n)}return null}(t,e);return null===n?t===e.getRootElement()?Wr("root"):null:Wr(n)}function Gr(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function Xr(t){const e=[];let n=t;for(;null!==n;)e.push(n),n=n._parentEditor;return e}function Qr(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function to(t){return Ir(t)?t.nodeValue:null}function eo(t,e,n){const i=Do(e);if(null===i)return;const r=i.anchorNode;let{anchorOffset:o,focusOffset:s}=i;if(null!==r){let e=to(r);const i=Ur(r);if(null!==e&&Jn(i)){if(e===w&&n){const t=n.length;e=n,o=t,s=t}null!==e&&no(i,e,o,s,t)}}}function no(t,e,n,i,r){let o=t;if(o.isAttached()&&(r||!o.isDirty())){const s=o.isComposing();let l=e;(s||r)&&e[e.length-1]===w&&(l=e.slice(0,-1));const c=o.getTextContent();if(r||l!==c){if(""===l){if(Br(null),u||d||p)o.remove();else{const t=Fi();setTimeout(()=>{t.update(()=>{o.isAttached()&&o.remove()})},20)}return}const e=o.getParent(),r=mi(),c=o.getTextContentSize(),a=zr(),f=o.getKey();if(o.isToken()||null!==a&&f===a&&!s||Qn(r)&&(null!==e&&!e.canInsertTextBefore()&&0===r.anchor.offset||r.anchor.key===t.__key&&0===r.anchor.offset&&!o.canInsertTextBefore()&&!s||r.focus.key===t.__key&&r.focus.offset===c&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const h=_i();if(!Qn(h)||null===n||null===i)return void io(o,l,h);if(h.setTextNodeRange(o,n,o,i),o.isSegmented()){const t=jn(o.getTextContent());o.replace(t),o=t}io(o,l,h)}}}function io(t,e,n){if(t.setTextContent(e),Qn(n)){const e=t.getKey();for(const i of["anchor","focus"]){const r=n[i];"text"===r.type&&r.key===e&&(r.offset=gs(t,r.offset,"clamp"))}}}function ro(t,e,n){const i=e[n]||!1;return"any"===i||i===t[n]}function oo(t,e,n){return function(t,e){return ro(t,e,"altKey")&&ro(t,e,"ctrlKey")&&ro(t,e,"shiftKey")&&ro(t,e,"metaKey")}(t,n)&&t.key.toLowerCase()===e.toLowerCase()}const so={ctrlKey:!l,metaKey:l},lo={altKey:l,ctrlKey:!l};function co(t){return"Backspace"===t.key}function ao(t){return oo(t,"a",so)}function uo(t){const e=$r();if(Qn(t)){const e=t.anchor,n=t.focus,i=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),ot(t),t}{const t=e.select(0,e.getChildrenSize());return Hr(ot(t)),t}}function fo(t,e){void 0===t.__lexicalClassNameCache&&(t.__lexicalClassNameCache={});const n=t.__lexicalClassNameCache,i=n[e];if(void 0!==i)return i;const r=t[e];if("string"==typeof r){const t=_(r);return n[e]=t,t}return r}function ho(t,e,n,r,o){if(0===n.size)return;const s=r.__type,l=r.__key,c=e.get(s);void 0===c&&i(33,s);const a=c.klass;let u=t.get(a);void 0===u&&(u=new Map,t.set(a,u));const d=u.get(l),f="destroyed"===d&&"created"===o;(void 0===d||f)&&u.set(l,f?"updated":o)}function go(t,e,n){const i=t.getParent();let r=n,o=t;return null!==i&&(e&&0===n?(r=o.getIndexWithinParent(),o=i):e||n!==o.getChildrenSize()||(r=o.getIndexWithinParent()+1,o=i)),o.getChildAtIndex(e?r-1:r)}function po(t){const e=Eo(t).event,n=e&&e.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function _o(t,e,n){return function(t,e,n){const i=Xr(t);for(let r=4;r>=0;r--)for(let o=0;o<i.length;o++){const s=i[o],l=s._commands.get(e);if(void 0!==l){const e=l[r];if(void 0!==e){const i=Array.from(e),r=i.length;let o=!1;if($i(s,()=>{for(let e=0;e<r;e++)if(i[e](n,t))return void(o=!0)}),o)return o}}}return!1}(t,e,n)}function mo(t){return!nr(t)&&!t.isLastChild()&&!t.isInline()}function yo(t,e){const n=t._keyToDOMMap.get(e);return void 0===n&&i(75,e),n}function vo(t){return Ro(t)&&"host"in t}function xo(t){const e=t.assignedSlot||t.parentElement;return vo(e)?e.host:e}function So(t){return function(t){return Fo(t)&&9===t.nodeType}(t)?t:Lo(t)?t.ownerDocument:null}function Co(t,e){let n=t.getParent();for(;null!==n;){if(n.is(e))return!0;n=n.getParent()}return!1}function bo(t){const e=So(t);return e?e.defaultView:null}function Eo(t){const e=t._window||window;return null===e&&i(78),e}function ko(t){return nr(t)||Gi(t)&&t.isShadowRoot()}function wo(t){const e=Fi(),n=t.getType(),r=Er(e,n);void 0===r&&i(200,t.constructor.name,n);const{replace:o,replaceWithKlass:s}=r;if(null!==o){const e=o(t),r=e.constructor;return null!==s?e instanceof s||i(201,s.name,s.getType(),r.name,r.getType(),t.constructor.name,n):e instanceof t.constructor&&r!==t.constructor||i(202,r.name,r.getType(),t.constructor.name,n),e.__key===t.__key&&i(203,t.constructor.name,n,r.name,r.getType()),e}return t}function No(t,e){!nr(t.getParent())||Gi(e)||tr(e)||i(99)}function To(t){return(tr(t)||Gi(t)&&!t.canBeEmpty())&&!t.isInline()}function Mo(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;const i=t.parentElement;null!==i&&i.removeChild(t)}function Oo(t){const e=window.getSelection();if(!e)return null;if("getComposedRanges"in Selection.prototype){const n=e.getComposedRanges({shadowRoots:[t]});if(n.length>0)return function(t,e){if(0===e.length)return t;const n=e[0],i=Object.create(Selection.prototype),r=Object.getOwnPropertyDescriptors(Selection.prototype);return Object.keys(r).forEach(e=>{if("constructor"===e)return;const n=r[e];if(n.value&&"function"==typeof n.value){const n=t[e];"function"==typeof n&&(i[e]=n.bind(t))}else if(!n.get){const n=t[e];void 0!==n&&(i[e]=n)}}),Object.defineProperty(i,"anchorNode",{enumerable:!0,get:()=>n.startContainer}),Object.defineProperty(i,"anchorOffset",{enumerable:!0,get:()=>n.startOffset}),Object.defineProperty(i,"focusNode",{enumerable:!0,get:()=>n.endContainer}),Object.defineProperty(i,"focusOffset",{enumerable:!0,get:()=>n.endOffset}),Object.defineProperty(i,"isCollapsed",{enumerable:!0,get:()=>n.collapsed}),Object.defineProperty(i,"rangeCount",{enumerable:!0,get:()=>e.length}),Object.defineProperty(i,"type",{enumerable:!0,get:()=>{const t=e[0];return t?t.collapsed?"Caret":"Range":"None"}}),i.getRangeAt=function(t){if(t<0||t>=e.length)throw new DOMException("Index out of range","IndexSizeError");const n=e[t],i=document.createRange();return i.setStart(n.startContainer,n.startOffset),i.setEnd(n.endContainer,n.endOffset),i},"getComposedRanges"in t&&(i.getComposedRanges=function(){return e}),i}(e,n)}return e}function Po(t,e){if(!o)return null;if(e){const t=Ao(e);if(t&&vo(t))return Oo(t)}return(t||window).getSelection()}function Do(t){return Po(Eo(t),t.getRootElement())}function Ao(t){const e=t.getRootNode({composed:!1});return vo(e)?e:document}function Io(t){const e=Ao(t);return e&&vo(e)&&e.activeElement?e.activeElement:function(t){if(!t||!o)return document;const e=t.getRootNode({composed:!0});return e===t||e.nodeType!==Node.DOCUMENT_NODE?t.ownerDocument||document:e}(t).activeElement}function Lo(t){return Fo(t)&&1===t.nodeType}function Fo(t){return"object"==typeof t&&null!==t&&"nodeType"in t&&"number"==typeof t.nodeType}function Ro(t){return Fo(t)&&11===t.nodeType}function Ko(t){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==t.nodeName.match(e)}function Bo(t){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==t.nodeName.match(e)}function zo(t){if(tr(t)&&!t.isInline())return!0;if(!Gi(t)||ko(t))return!1;const e=t.getFirstChild(),n=null===e||kn(e)||Jn(e)||e.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&n}function Wo(){return Fi()}const jo=new WeakMap,Jo=new Map;function Uo(t){if(!t._readOnly&&t.isEmpty())return Jo;t._readOnly||i(192);let e=jo.get(t);return e||(e=function(t){const e=new Map;for(const[n,i]of t._nodeMap){const t=i.__type;let r=e.get(t);r||(r=new Map,e.set(t,r)),r.set(n,i)}return e}(t),jo.set(t,e)),e}function Zo(t){const e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function Vo(t){return(e=Zo(t))[pn]=!0,e;var e}function $o(t){return!0===t.__lexicalUnmanaged}function qo(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(t,e)&&t[e]!==mn[e]}function Ho(t){const e=R in t.prototype?t.prototype[R]():void 0,n=function(t){if(!(t===mn||t.prototype instanceof mn)){let e="<unknown>",n="<unknown>";try{e=t.getType()}catch(i){}try{vr.version&&(n=JSON.parse(vr.version))}catch(i){}i(290,t.name,e,n)}return t===Qi||t===Yi||t===mn}(t),r=!n&&qo(t,"getType")?t.getType():void 0;let o,s=r;if(e)if(r)o=e[r];else for(const[i,l]of Object.entries(e))s=i,o=l;if(!n&&s&&(qo(t,"getType")||(t.getType=()=>s),qo(t,"clone")||(t.clone=e=>(Sr(e),new t)),qo(t,"importJSON")||(t.importJSON=o&&o.$importJSON||(e=>(new t).updateFromJSON(e))),!qo(t,"importDOM")&&o)){const{importDOM:e}=o;e&&(t.importDOM=()=>e)}return{ownNodeConfig:o,ownNodeType:s}}function Yo(t){const e=Wo();return Ai(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(t)).klass)}const Go=(t,e)=>{let n=t;for(;null!=n&&!nr(n);){if(e(n))return n;n=n.getParent()}return null},Xo={next:"previous",previous:"next"};class Qo{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Cs({hasNext:ls,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return fs(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return fs(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,e){const n=this.getNodeAtCaret();return t.is(this.origin)||t.is(n)||(null===n?this.insert(t):n.replace(t,e)),this}splice(t,e,n="next"){const r=n===this.direction?e:Array.from(e).reverse();let o=this;const s=this.getParentAtCaret(),l=new Map;for(let i=o.getAdjacentCaret();null!==i&&l.size<t;i=i.getAdjacentCaret()){const t=i.origin.getWritable();l.set(t.getKey(),t)}for(const c of r){if(l.size>0){const t=o.getNodeAtCaret();if(t)if(l.delete(t.getKey()),l.delete(c.getKey()),t.is(c)||o.origin.is(c));else{const e=c.getParent();e&&e.is(s)&&c.remove(),t.replace(c)}else null===t&&i(263,Array.from(l).join(" "))}else o.insert(c);o=fs(c,this.direction)}for(const i of l.values())i.remove();return this}}class ts extends Qo{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:_s(t,this.direction)}getParentCaret(t="root"){return fs(is(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=ns(this.direction);return fs(this.getNodeAtCaret(),t)||_s(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof ts&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const es={root:nr,shadowRoot:ko};function ns(t){return Xo[t]}function is(t,e="root"){return es[e](t)?null:t}class rs extends Qo{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:fs(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Gi(this.origin)?_s(this.origin,this.direction):null}getParentCaret(t="root"){return fs(is(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=ns(this.direction);return fs(this.getNodeAtCaret(),t)||_s(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof rs&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof rs||t instanceof os)&&this.direction===t.direction&&this.origin.is(t.origin)}}class os extends Qo{type="text";offset;constructor(t,e){super(t),this.offset=e}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:hs(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return fs(is(this.getParentAtCaret(),t),this.direction)}getFlipped(){return hs(this.origin,ns(this.direction),this.offset)}isSamePointCaret(t){return t instanceof os&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof rs||t instanceof os)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return fs(this.origin,this.direction)}}function ss(t){return t instanceof os}function ls(t){return t instanceof rs}function cs(t){return t instanceof ts}const as={next:class extends os{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends os{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},us={next:class extends rs{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends rs{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},ds={next:class extends ts{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends ts{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function fs(t,e){return t?new us[e](t):null}function hs(t,e,n){return t?new as[e](t,gs(t,n)):null}function gs(t,e,n="error"){const i=t.getTextContentSize();let o="next"===e?i:"previous"===e?0:e;return(o<0||o>i)&&("clamp"!==n&&r(284,String(e),String(i),t.getKey()),o=o<0?0:i),o}function ps(t,e){return new vs(t,e)}function _s(t,e){return Gi(t)?new ds[e](t):null}function ms(t){return t&&function(t){return t&&t.getChildCaret()||t}(t.getAdjacentCaret())}class ys{type="node-caret-range";direction;anchor;focus;constructor(t,e,n){this.anchor=t,this.focus=e,this.direction=n}getLatest(){const t=this.anchor.getLatest(),e=this.focus.getLatest();return t===this.anchor&&e===this.focus?this:new ys(t,e,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=t=>{const e=this[t].getLatest();return ss(e)?function(t,e){const{direction:n,origin:i}=t;return ps(t,gs(i,"focus"===e?ns(n):n)-t.offset)}(e,t):null},e=t("anchor"),n=t("focus");if(e&&n){const{caret:t}=e,{caret:i}=n;if(t.isSameNodeCaret(i))return[ps(t,i.offset-t.offset),null]}return[e,n]}iterNodeCarets(t="root"){const e=ss(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),i=ss(n),r=e=>e.isSameNodeCaret(n)?null:ms(e)||e.getParentCaret(t);return Cs({hasNext:t=>null!==t&&!(i&&n.isSameNodeCaret(t)),initial:e.isSameNodeCaret(n)?null:r(e),map:t=>t,step:r})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class vs{type="slice";caret;distance;constructor(t,e){this.caret=t,this.distance=e}getSliceIndices(){const{distance:t,caret:{offset:e}}=this,n=e+t;return n<e?[n,e]:[e,n]}getTextContent(){const[t,e]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,e)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:e}}=this,[n,i]=this.getSliceIndices(),r=t.getTextContent();return hs(t.setTextContent(r.slice(0,n)+r.slice(i)),e,n)}}function xs(t){return Ss(t,fs($r(),t.direction))}function Ss(t,e){return t.direction!==e.direction&&i(265),new ys(t,e,t.direction)}function Cs(t){const{initial:e,hasNext:n,step:i,map:r}=t;let o=e;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const t={done:!1,value:r(o)};return o=i(o),t}}}function bs(t,e){const n=Ns(t.origin,e.origin);switch(null===n&&i(275,t.origin.getKey(),e.origin.getKey()),n.type){case"same":{const n="text"===t.type,i="text"===e.type;return n&&i?function(t,e){return Math.sign(t-e)}(t.offset,e.offset):t.type===e.type?0:n?-1:i?1:"child"===t.type?-1:1}case"ancestor":return"child"===t.type?-1:1;case"descendant":return"child"===e.type?1:-1;case"branch":return Es(n)}}function Es(t){const{a:e,b:n}=t,i=e.__key,r=n.__key;let o=e,s=n;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===r)return-1;if(s.__key===i)return 1}return null===o?1:-1}function ks(t,e){return e.is(t)}function ws(t){return Gi(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function Ns(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};const n=new Map;for(let[i,r]=ws(t);i;r=i,i=i.getParent())n.set(i,r);for(let[r,o]=ws(e);r;o=r,r=r.getParent()){const s=n.get(r);if(void 0!==s)return null===s?(ks(t,r)||i(276),{commonAncestor:r,type:"ancestor"}):null===o?(ks(e,r)||i(277),{commonAncestor:r,type:"descendant"}):((Gi(s)||ks(t,s))&&(Gi(o)||ks(e,o))&&r.is(s.getParent())&&r.is(o.getParent())||i(278),{a:s,b:o,commonAncestor:r,type:"branch"})}return null}function Ts(t,e){const{type:n,key:r,offset:o}=t,s=function(t){const e=Wr(t);return null===e&&i(63,t),e}(t.key);return"text"===n?(Jn(s)||i(266,s.getType(),r),hs(s,e,o)):(Gi(s)||i(267,s.getType(),r),function(t,e,n){let i=_s(t,"next");for(let r=0;r<e;r++){const t=i.getAdjacentCaret();if(null===t)break;i=t}return Ks(i,n)}(s,t.offset,e))}function Ms(t,e){const{origin:n,direction:r}=e,o="next"===r;ss(e)?t.set(n.getKey(),e.offset,"text"):ls(e)?Jn(n)?t.set(n.getKey(),gs(n,r),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(cs(e)&&Gi(n)||i(268),t.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function Os(t,e){Ms(t.anchor,e.anchor),Ms(t.focus,e.focus)}function Ps(t){const{anchor:e,focus:n}=t,i=Ts(e,"next"),r=Ts(n,"next"),o=bs(i,r)<=0?"next":"previous";return Ss(Ks(i,o),Ks(r,o))}function Ds(t){const{direction:e,origin:n}=t,i=fs(n,ns(e)).getNodeAtCaret();return i?fs(i,e):_s(n.getParentOrThrow(),e)}function As(t,e="root"){const n=[t];for(let i=cs(t)?t.getParentCaret(e):t.getSiblingCaret();null!==i;i=i.getParentCaret(e))n.push(Ds(i));return n}function Is(t){return!!t&&t.origin.isAttached()}function Ls(t,e="removeEmptySlices"){if(t.isCollapsed())return t;const n="root",r="next";let o=e;const s=Bs(t,r),l=As(s.anchor,n),c=As(s.focus.getFlipped(),n),a=new Set,u=[];for(const i of s.iterNodeCarets(n))if(cs(i))a.add(i.origin.getKey());else if(ls(i)){const{origin:t}=i;Gi(t)&&!a.has(t.getKey())||u.push(t)}for(const i of u)i.remove();for(const i of s.getTextSlices()){if(!i)continue;const{origin:t}=i.caret,e=t.getTextContentSize(),n=Ds(fs(t,r)),s=t.getMode();if(Math.abs(i.distance)===e&&"removeEmptySlices"===o||"token"===s&&0!==i.distance)n.remove();else if(0!==i.distance){o="removeEmptySlices";let t=i.removeTextSlice();const e=i.caret.origin;if("segmented"===s){const e=t.origin,i=jn(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());n.replaceOrInsert(i),t=hs(i,r,t.offset)}e.is(l[0].origin)&&(l[0]=t),e.is(c[0].origin)&&(c[0]=t.getFlipped())}}let d,f;for(const i of l)if(Is(i)){d=Fs(i);break}for(const i of c)if(Is(i)){f=Fs(i);break}const h=function(t,e,n){if(!t||!e)return null;const i=t.getParentAtCaret(),r=e.getParentAtCaret();if(!i||!r)return null;const o=i.getParents().reverse();o.push(i);const s=r.getParents().reverse();s.push(r);const l=Math.min(o.length,s.length);let c;for(c=0;c<l&&o[c]===s[c];c++);const a=(t,e)=>{let n;for(let i=c;i<t.length;i++){const r=t[i];if(ko(r))return;!n&&e(r)&&(n=r)}return n},u=a(o,zo),d=u&&a(s,t=>n.has(t.getKey())&&zo(t));return u&&d?[u,d]:null}(d,f,a);if(h){const[t,e]=h;_s(t,"previous").splice(0,e.getChildren()),e.remove()}const g=[d,f,...l,...c].find(Is);if(g)return function(t){return Ss(t,t)}(Ks(Fs(g),t.direction));i(269,JSON.stringify(l.map(t=>t.origin.__key)))}function Fs(t){const e=function(t){let e=t;for(;cs(e);){const t=ms(e);if(!cs(t))break;e=t}return e}(t.getLatest()),{direction:n}=e;if(Jn(e.origin))return ss(e)?e:hs(e.origin,n,n);const i=e.getAdjacentCaret();return ls(i)&&Jn(i.origin)?hs(i.origin,n,ns(n)):e}function Rs(t){return ss(t)&&t.offset!==gs(t.origin,t.direction)}function Ks(t,e){return t.direction===e?t:t.getFlipped()}function Bs(t,e){return t.direction===e?t:Ss(Ks(t.focus,e),Ks(t.anchor,e))}function zs(t){return t}function Ws(...t){return t}function js(t){return t}function Js(t,e){if(!e||t===e)return t;for(const n in e)if(t[n]!==e[n])return{...t,...e};return t}}}]);
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 index.asset.php
php
131 B
2026-06-21 06:40
📜 index.js
js
165.5 KB
2026-06-21 06:40