Files
e-tib.com/.next/static/chunks/660c4c2db7ab5b54.js
Marc Mintel d14122005d Initial commit: E-TIB production hardening & E2E foundation
Former-commit-id: ef04fca3d76375630c05aac117bf586953f3b657
2026-04-28 19:11:38 +02:00

13 lines
96 KiB
JavaScript

;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="32675c1d-eaaa-477c-325e-0ac8019fdfa6")}catch(e){}}();
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,178249,974725,410911,501522,397910,800569,704338,35500,20207,e=>{"use strict";let t,n,i;var r=e.i(785316),o=e.i(907358),l=e.i(452797),s=e.i(600745),a=e.i(703057),d=a;let u=new Map;function c(e,t){let n=e.getRootElement();if(null===n)return[];let i=n.getBoundingClientRect(),r=getComputedStyle(n),o=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),l=Array.from(t.getClientRects()),s,a=l.length;l.sort((e,t)=>{let n=e.top-t.top;return 3>=Math.abs(n)?e.left-t.left:n});for(let e=0;e<a;e++){let t=l[e],n=s&&s.top<=t.top&&s.top+s.height>t.top&&s.left+s.width>t.left,r=t.width+o===i.width;n||r?(l.splice(e--,1),a--):s=t}return l}function g(e){let t={};if(!e)return t;for(let n of e.split(";"))if(""!==n){let[e,i]=n.split(/:([^]+)/);e&&i&&(t[e.trim()]=i.trim())}return t}function f(e){let t=u.get(e);return void 0===t&&(t=g(e),u.set(e,t)),t}function h(e){let t=(0,a.$getEditor)().getElementByKey(e.getKey());if(null===t)return null;let n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function m(e){return h((0,a.$isRootNode)(e)?e:e.getParentOrThrow())}function p(e){let t=m(e);return null!==t&&"rtl"===t.direction}function N(e,t,n="self"){let i=e.getStartEndPoints();if(t.isSelected(e)&&!(0,a.$isTokenOrSegmented)(t)&&null!==i){let[r,o]=i,l=e.isBackward(),s=r.getNode(),d=o.getNode(),u=t.is(s),c=t.is(d);if(u||c){let[i,r]=(0,a.$getCharacterOffsets)(e),o=s.is(d),u=t.is(l?d:s),c=t.is(l?s:d),g,f=0;o?(f=i>r?r:i,g=i>r?i:r):u?(f=l?r:i,g=void 0):c&&(f=0,g=l?i:r);let h=t.__text.slice(f,g);h!==t.__text&&("clone"===n&&(t=(0,a.$cloneWithPropertiesEphemeral)(t)),t.__text=h)}}return t}function C(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return(0,a.$isElementNode)(t)||function(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let e of(i.append("code",177),t))i.append("v",e);throw n.search=i.toString(),Error(`Minified Lexical error #177; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(0),e.offset===t.getChildrenSize()}function _(e){let t=e.getStyle(),n=g(t);u.set(t,n)}function S(e){let t=(0,a.$getSelection)();if(!t)return;let n=new Map,i=e=>n.get(e.getKey())||[0,e.getTextContentSize()];if((0,a.$isRangeSelection)(t))for(let e of(0,a.$caretRangeFromSelection)(t).getTextSlices())e&&n.set(e.caret.origin.getKey(),e.getSliceIndices());for(let n of t.getNodes()){if(!(0,a.$isTextNode)(n)||!n.canHaveFormat())continue;let[t,r]=i(n);r!==t&&e((0,a.$isTokenOrSegmented)(n)||0===t&&r===n.getTextContentSize()?n:n.splitText(t,r)[+(0!==t)])}(0,a.$isRangeSelection)(t)&&"text"===t.anchor.type&&"text"===t.focus.type&&t.anchor.key===t.focus.key&&function(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:i,offset:r,type:o}=t;t.set(n.key,n.offset,n.type),n.set(i,r,o)}}(t)}function E(e,t){let n=e.getFormatType(),i=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),i!==t.getIndent()&&t.setIndent(i)}function x(e,t,n=E){if(null===e)return;let i=e.getStartEndPoints(),r=new Map,o=null;if(i){let[e,t]=i;(o=(0,a.$createRangeSelection)()).anchor.set(e.key,e.offset,e.type),o.focus.set(t.key,t.offset,t.type);let n=(0,a.$findMatchingParent)(e.getNode(),a.INTERNAL_$isBlock),l=(0,a.$findMatchingParent)(t.getNode(),a.INTERNAL_$isBlock);(0,a.$isElementNode)(n)&&r.set(n.getKey(),n),(0,a.$isElementNode)(l)&&r.set(l.getKey(),l)}for(let t of e.getNodes())if((0,a.$isElementNode)(t)&&(0,a.INTERNAL_$isBlock)(t))r.set(t.getKey(),t);else if(null===i){let e=(0,a.$findMatchingParent)(t,a.INTERNAL_$isBlock);(0,a.$isElementNode)(e)&&r.set(e.getKey(),e)}for(let[e,i]of r){let r=t();n(i,r),i.replace(r,!0),o&&(e===o.anchor.key&&o.anchor.set(r.getKey(),o.anchor.offset,o.anchor.type),e===o.focus.key&&o.focus.set(r.getKey(),o.focus.offset,o.focus.type))}o&&e.is((0,a.$getSelection)())&&(0,a.$setSelection)(o)}function T(e){let t=y(e);return null!==t&&"vertical-rl"===t.writingMode}function y(e){let t=e.anchor.getNode();return(0,a.$isElementNode)(t)?h(t):m(t)}function R(e,t){let n=T(e)?!t:t;O(e)&&(n=!n);let i=(0,a.$caretFromPoint)(e.focus,n?"previous":"next");if((0,a.$isExtendableTextPointCaret)(i))return!1;for(let e of(0,a.$extendCaretToRange)(i)){if((0,a.$isChildCaret)(e))return!e.origin.isInline();if(!(0,a.$isElementNode)(e.origin)){if((0,a.$isDecoratorNode)(e.origin))return!0;break}}return!1}function O(e){let t=y(e);return null!==t&&"rtl"===t.direction}function v(e,t,n){let i,r=O(e);i=T(e)||r?!n:n,e.modify(t?"extend":"move",i,"character")}function $(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}e.s(["$addNodeStyle",()=>_,"$forEachSelectedTextNode",()=>S,"$isAtNodeEnd",()=>C,"$isParentRTL",()=>p,"$moveCharacter",()=>v,"$setBlocksType",()=>x,"$shouldOverrideDefaultCharacterSelection",()=>R,"$sliceSelectedTextNodeContent",()=>N,"createRectsFromDOMRange",()=>c,"getStyleObjectFromCSS",()=>f],974725);let M="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,D=M&&"documentMode"in document?document.documentMode:null,I=(M&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),M&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));function A(e,t){return Array.from(b(e,t))}function b(e,t){var n,i,r;let o,l,s,d,u,c;return n="next",i=e,r=t,o=(0,a.$getRoot)(),l=i||o,s=(0,a.$isElementNode)(l)?(0,a.$getChildCaret)(l,n):(0,a.$getSiblingCaret)(l,n),d=function(e){let t=-1;for(let n=e;null!==n;n=n.getParent())t++;return t}(l),u=r?(0,a.$getAdjacentChildCaret)((0,a.$getChildCaretOrSelf)((0,a.$getSiblingCaret)(r,n)))||w(r,n):w(l,n),c=d,(0,a.makeStepwiseIterator)({hasNext:e=>null!==e,initial:s,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(u))return null;(0,a.$isChildCaret)(e)&&c++;let t=(0,a.$getAdjacentSiblingOrParentSiblingCaret)(e);return!t||t[0].isSameNodeCaret(u)?null:(c+=t[1],t[0])}})}function w(e,t){let n=(0,a.$getAdjacentSiblingOrParentSiblingCaret)((0,a.$getSiblingCaret)(e,t));return n&&n[0]}function P(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function L(e){let t=(0,a.$findMatchingParent)(e,e=>(0,a.$isElementNode)(e)&&!e.isInline());return(0,a.$isElementNode)(t)||$(4,e.__key),t}function F(e){let t,n=(0,a.$getSelection)()||(0,a.$getPreviousSelection)();if((0,a.$isRangeSelection)(n))t=(0,a.$caretFromPoint)(n.focus,"next");else{if(null!=n){let e=n.getNodes(),i=e[e.length-1];i&&(t=(0,a.$getSiblingCaret)(i,"next"))}t=t||(0,a.$getChildCaret)((0,a.$getRoot)(),"previous").getFlipped().insert((0,a.$createParagraphNode)())}let i=k(e,t),r=(0,a.$getAdjacentChildCaret)(i),o=(0,a.$isChildCaret)(r)?(0,a.$normalizeCaret)(r):i;return(0,a.$setSelectionFromCaretRange)((0,a.$getCollapsedCaretRange)(o)),e.getLatest()}function k(e,t,n){let i=(0,a.$getCaretInDirection)(t,"next");for(let e=i;e;e=(0,a.$splitAtPointCaretNext)(e,n))i=e;return(0,a.$isTextPointCaret)(i)&&$(283),i.insert(e.isInline()?(0,a.$createParagraphNode)().append(e):e),(0,a.$getCaretInDirection)((0,a.$getSiblingCaret)(e.getLatest(),"next"),t.direction)}function B(e,t){let n=t();return e.replace(n),n.append(e),n}function K(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function Y(e){let t=(0,a.$getSelection)();if(!(0,a.$isRangeSelection)(t))return!1;let n=new Set,i=t.getNodes();for(let t=0;t<i.length;t++){let r=i[t],o=r.getKey();if(n.has(o))continue;let l=(0,a.$findMatchingParent)(r,e=>(0,a.$isElementNode)(e)&&!e.isInline());if(null===l)continue;let s=l.getKey();l.canIndent()&&!n.has(s)&&(n.add(s),e(l))}return n.size>0}function W(e,t){(0,a.$getChildCaret)(e,"next").insert(t)}M&&"InputEvent"in window&&!D&&new window.InputEvent("input"),M&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),M&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,M&&/Android/.test(navigator.userAgent),M&&/^(?=.*Chrome).*/i.test(navigator.userAgent),M&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);let z=!(I||!M)&&void 0;function U(e,t=!1){let n=1;if(function(){if(void 0===z){let e=document.createElement("div");e.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty("zoom","2"),z=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return z}()||t)for(;e;)n*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return n}function j(e,t){return function e(t,n,i){let r=!1;for(let o of J(t))n(o)?null!==i&&i(o):(r=!0,(0,a.$isElementNode)(o)&&e(o,n,i||(e=>o.insertAfter(e))),o.remove());return r}(e,t,null)}function H(e,t){let n=[],i=Array.from(e).reverse();for(let e=i.pop();void 0!==e;e=i.pop())if(t(e))n.push(e);else if((0,a.$isElementNode)(e))for(let t of J(e))i.push(t);return n}function J(e){var t;return t=(0,a.$getChildCaret)(e,"previous"),(0,a.makeStepwiseIterator)({hasNext:a.$isSiblingCaret,initial:t.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}e.s(["$descendantsMatching",()=>H,"$dfs",()=>A,"$dfsIterator",()=>b,"$getNearestBlockElementAncestorOrThrow",()=>L,"$getNearestNodeOfType",()=>P,"$handleIndentAndOutdent",()=>Y,"$insertFirst",()=>W,"$insertNodeToNearestRoot",()=>F,"$insertNodeToNearestRootAtCaret",()=>k,"$unwrapAndFilterDescendants",()=>j,"$wrapNodeInElement",()=>B,"calculateZoomLevel",()=>U,"objectKlassEquals",()=>K],410911);let V=Symbol.for("preact-signals");function X(){if(Q>1)return void Q--;let e,t=!1;for(;void 0!==n;){let i=n;for(n=void 0,Z++;void 0!==i;){let n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&er(i))try{i.c()}catch(n){t||(e=n,t=!0)}i=n}}if(Z=0,Q--,t)throw e}function q(e){if(Q>0)return e();Q++;try{return e()}finally{X()}}function G(e){let n=t;t=void 0;try{return e()}finally{t=n}}let Q=0,Z=0,ee=0;function et(e){if(void 0===t)return;let n=e.n;return void 0===n||n.t!==t?(n={i:0,S:e,p:t.s,n:void 0,t:t,e:void 0,x:void 0,r:n},void 0!==t.s&&(t.s.n=n),t.s=n,e.n=n,32&t.f&&e.S(n),n):-1===n.i?(n.i=0,void 0!==n.n&&(n.n.p=n.p,void 0!==n.p&&(n.p.n=n.n),n.p=t.s,n.n=void 0,t.s.n=n,t.s=n),n):void 0}function en(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function ei(e,t){return new en(e,t)}function er(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function eo(e){for(let t=e.s;void 0!==t;t=t.n){let n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function el(e){let t,n=e.s;for(;void 0!==n;){let e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function es(e,t){en.call(this,void 0),this.x=e,this.s=void 0,this.g=ee-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function ea(e){let n=e.u;if(e.u=void 0,"function"==typeof n){Q++;let i=t;t=void 0;try{n()}catch(t){throw e.f&=-2,e.f|=8,ed(e),t}finally{t=i,X()}}}function ed(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ea(e)}function eu(e){if(t!==this)throw Error("Out-of-order effect");el(this),t=e,this.f&=-2,8&this.f&&ed(this),X()}function ec(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function eg(e,t){let n=new ec(e,t);try{n.c()}catch(e){throw n.d(),e}let i=n.d.bind(n);return i[Symbol.dispose]=i,i}function ef(e,t={}){let n={};for(let i in e){let r=t[i],o=ei(void 0===r?e[i]:r);n[i]=o}return n}function eh(){let e=(0,d.$getRoot)(),t=(0,d.$getSelection)(),n=(0,d.$createParagraphNode)();e.clear(),e.append(n),null!==t&&n.select(),(0,d.$isRangeSelection)(t)&&(t.format=0)}en.prototype.brand=V,en.prototype.h=function(){return!0},en.prototype.S=function(e){let t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:G(()=>{var e;null==(e=this.W)||e.call(this)}))},en.prototype.U=function(e){if(void 0!==this.t){let t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&G(()=>{var e;null==(e=this.Z)||e.call(this)}))}},en.prototype.subscribe=function(e){return eg(()=>{let n=this.value,i=t;t=void 0;try{e(n)}finally{t=i}},{name:"sub"})},en.prototype.valueOf=function(){return this.value},en.prototype.toString=function(){return this.value+""},en.prototype.toJSON=function(){return this.value},en.prototype.peek=function(){let e=t;t=void 0;try{return this.value}finally{t=e}},Object.defineProperty(en.prototype,"value",{get(){let e=et(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Z>100)throw Error("Cycle detected");this.v=e,this.i++,ee++,Q++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{X()}}}}),es.prototype=new en,es.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f)||(this.f&=-5,this.g===ee))return!0;if(this.g=ee,this.f|=1,this.i>0&&!er(this))return this.f&=-2,!0;let e=t;try{eo(this),t=this;let e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return t=e,el(this),this.f&=-2,!0},es.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}en.prototype.S.call(this,e)},es.prototype.U=function(e){if(void 0!==this.t&&(en.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},es.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(es.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=et(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),ec.prototype.c=function(){let e=this.S();try{if(8&this.f||void 0===this.x)return;let e=this.x();"function"==typeof e&&(this.u=e)}finally{e()}},ec.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,ea(this),eo(this),Q++;let e=t;return t=this,eu.bind(this,e)},ec.prototype.N=function(){2&this.f||(this.f|=2,this.o=n,n=this)},ec.prototype.d=function(){this.f|=8,1&this.f||ed(this)},ec.prototype.dispose=function(){this.d()},(0,d.defineExtension)({build:(e,t,n)=>ef(t),config:(0,d.safeCast)({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let i=n.getOutput();return eg(()=>i.disabled.value?void 0:e.registerRootListener(t=>{e.focus(()=>{let e=document.activeElement;null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})},{defaultSelection:i.defaultSelection.peek()})}))}}),(0,d.defineExtension)({build:(e,t,n)=>ef(t),config:(0,d.safeCast)({$onClear:eh}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:i}=n.getOutput();return eg(()=>(function(e,t=eh){return e.registerCommand(d.CLEAR_EDITOR_COMMAND,n=>(e.update(t),!0),d.COMMAND_PRIORITY_EDITOR)})(e,i.value))}});let em=(0,d.createState)("format",{parse:e=>"number"==typeof e?e:0});class ep extends d.DecoratorNode{$config(){return this.config("decorator-text",{extends:d.DecoratorNode,stateConfigs:[{flat:!0,stateConfig:em}]})}getFormat(){return(0,d.$getState)(this,em)}getFormatFlags(e,t){return(0,d.toggleTextFormatType)(this.getFormat(),e,t)}hasFormat(e){let t=d.TEXT_TYPE_TO_FORMAT[e];return 0!=(this.getFormat()&t)}setFormat(e){return(0,d.$setState)(this,em,e)}toggleFormat(e){let t=this.getFormat(),n=(0,d.toggleTextFormatType)(t,e,null);return this.setFormat(n)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}}function eN(e,t){let n;return ei(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}(0,d.defineExtension)({name:"@lexical/extension/DecoratorText",nodes:()=>[ep],register:(e,t,n)=>e.registerCommand(d.FORMAT_TEXT_COMMAND,e=>{let t=(0,d.$getSelection)();if((0,d.$isNodeSelection)(t)||(0,d.$isRangeSelection)(t))for(let n of t.getNodes())n instanceof ep&&n.toggleFormat(e);return!1},d.COMMAND_PRIORITY_LOW)});let eC=(0,d.defineExtension)({build:e=>eN(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:"@lexical/extension/EditorState"});function e_(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let eS=new Set;class eE{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):d.shallowMergeConfig;for(let n of this.configs)e=t(e,n);return e}init(e){let t,n=this.state;2===n.id||e_(306,String(n.id));let i={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...i,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},o=Object.assign(n,{config:this.mergeConfigs(),id:3,registerState:i});this.state=o,this.extension.init&&(t=this.extension.init(e,o.config,i)),this.state=Object.assign(o,{id:4,initResult:t,registerState:r})}build(e){let t,n=this.state;4!==n.id&&e_(307,String(n.id),String(5)),this.extension.build&&(t=this.extension.build(e,n.config,n.registerState));let i={...n.registerState,getOutput:()=>t,getSignal:this.getSignal.bind(this)};this.state=Object.assign(n,{id:5,output:t,registerState:i})}register(e,t){this._signal=t;let n=this.state;5!==n.id&&e_(308,String(n.id),String(5));let i=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=Object.assign(n,{id:6}),()=>{let e=this.state;7!==e.id&&e_(309,String(n.id),String(7)),this.state=Object.assign(e,{id:5}),i&&i()}}afterRegistration(e){let t,n=this.state;return 6!==n.id&&e_(310,String(n.id),String(6)),this.extension.afterRegistration&&(t=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=Object.assign(n,{id:7}),t}getSignal(){return void 0===this._signal&&e_(311),this._signal}getInitResult(){void 0===this.extension.init&&e_(312,this.extension.name);let e=this.state;return e.id>=4||e_(313,String(e.id),String(4)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return e.id>=3||e_(314,String(e.id),String(3)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&e_(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&e_(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return e.id>=7||e_(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||eS}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;e.id>=5||e_(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}let ex={tag:d.HISTORY_MERGE_TAG};function eT(){let e=(0,d.$getRoot)();e.isEmpty()&&e.append((0,d.$createParagraphNode)())}let ey=(0,d.defineExtension)({config:(0,d.safeCast)({setOptions:ex,updateOptions:ex}),init:({$initialEditorState:e=eT})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},i){let r=i.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:i}=r;if((0,d.$isEditorState)(i))e.setEditorState(i,n);else if("function"==typeof i)e.update(()=>{i(e)},t);else if(i&&("string"==typeof i||"object"==typeof i)){let t=e.parseEditorState(i);e.setEditorState(t,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[d.RootNode,d.TextNode,d.LineBreakNode,d.TabNode,d.ParagraphNode]}),eR=Symbol.for("@lexical/extension/LexicalBuilder");function eO(){}function ev(e){throw e}function e$(e){return Array.isArray(e)?e:[e]}let eM="0.41.0+prod.esm";class eD{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){for(const t of(this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=eM,this.roots=e,e))this.addExtension(t)}static fromExtensions(e){let t=[e$(ey)];for(let n of e)t.push(e$(n));return new eD(t)}static maybeFromEditor(e){let t=e[eR];return t&&(t.PACKAGE_VERSION!==eM&&e_(292,t.PACKAGE_VERSION,eM),t instanceof eD||e_(293)),t}static fromEditor(e){let t=eD.maybeFromEditor(e);return void 0===t&&e_(294),t}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),i=Object.assign((0,d.createEditor)({...n,...t?{onError:e=>{t(e,i)}}:{}}),{[eR]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=eO;function t(){try{e()}finally{e=eO}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=(0,d.mergeRegister)(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&e_(295,e.name),t}addEdge(e,t,n){let i=this.outgoingConfigEdges.get(e);i?i.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let r=this.incomingEdges.get(t);r?r.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){void 0!==this._sortedExtensionReps&&e_(296);let[t]=e$(e);"string"!=typeof t.name&&e_(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(void 0!==n&&n.extension!==t&&e_(298,t.name),!n){n=new eE(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);for(let n of("string"==typeof e&&e_(299,t.name,e),t.conflictsWith||[]))this.extensionNameMap.has(n)&&e_(299,t.name,n),this.conflicts.set(n,t.name);for(let e of t.dependencies||[]){let n=e$(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,i)=>{var r,o;let l=n.state;if(2===l.id)return;let s=n.extension.name;0===l.id||e_(300,s,i||"[unknown]"),0===(r=l).id||e_(304,String(r.id),String(0)),n.state=l=Object.assign(r,{id:1});let a=this.outgoingConfigEdges.get(s);if(a)for(let e of a.keys()){let n=this.extensionNameMap.get(e);n&&t(n,s)}1===(o=l).id||e_(305,String(o.id),String(1)),n.state=l=Object.assign(o,{id:2}),e.push(n)};for(let e of this.extensionNameMap.values())0===e.state.id&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);for(let i of(void 0===n&&e_(301,e.name),t))n.configs.add(i)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,i=[()=>n.abort()],r=n.signal;for(let n of t){let t=n.register(e,r);t&&i.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&i.push(t)}return(0,d.mergeRegister)(...i)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,i=new Map,r={},o={},l=this.sortedExtensionReps();for(let s of l){let{extension:l}=s;if(void 0!==l.onError&&(e.onError=l.onError),void 0!==l.disableEvents&&(e.disableEvents=l.disableEvents),void 0!==l.parentEditor&&(e.parentEditor=l.parentEditor),void 0!==l.editable&&(e.editable=l.editable),void 0!==l.namespace&&(e.namespace=l.namespace),void 0!==l.$initialEditorState&&(e.$initialEditorState=l.$initialEditorState),l.nodes){for(let e of("function"==typeof l.nodes?l.nodes():l.nodes)||[]){if("function"!=typeof e){let t=n.get(e.replace);t&&e_(302,l.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}}if(l.html){if(l.html.export)for(let[e,t]of l.html.export.entries())i.set(e,t);l.html.import&&Object.assign(r,l.html.import)}l.theme&&function e(t,n){if(t&&n&&!Array.isArray(n)&&"object"==typeof t&&"object"==typeof n){for(let i in n)t[i]=e(t[i],n[i]);return t}return n}(o,l.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);let s=Object.keys(r).length>0,a=i.size>0;for(let t of((s||a)&&(e.html={},s&&(e.html.import=r),a&&(e.html.export=i)),l))t.init(e);return e.onError||(e.onError=ev),e}}function eI(e,t){let n=eD.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}let eA=new Set,eb=(0,d.defineExtension)({build(e,t,n){let i=n.getDependency(eC).output,r=ei({watchedNodeKeys:new Map}),o=eN(()=>{},()=>eg(()=>{let e=o.peek(),{watchedNodeKeys:t}=r.value,n,l=!1;i.value.read(()=>{if((0,d.$getSelection)())for(let[i,r]of t.entries()){if(0===r.size){t.delete(i);continue}let o=(0,d.$getNodeByKey)(i),s=o&&o.isSelected()||!1;l=l||s!==(!!e&&e.has(i)),s&&(n=n||new Set).add(i)}}),!l&&n&&e&&n.size===e.size||(o.value=n)}));return{watchNodeKey:function(e){let t=new es(()=>(o.value||eA).has(e),void 0),{watchedNodeKeys:n}=r.peek(),i=n.get(e),l=void 0!==i;return(i=i||new Set).add(t),l||(n.set(e,i),r.value={watchedNodeKeys:n}),t}}},dependencies:[eC],name:"@lexical/extension/NodeSelection"});(0,d.createCommand)("INSERT_HORIZONTAL_RULE_COMMAND");class ew extends d.DecoratorNode{static getType(){return"horizontalrule"}static clone(e){return new ew(e.__key)}static importJSON(e){return eL().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:eP,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){let t=document.createElement("hr");return(0,d.addClassNamesToElement)(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function eP(){return{node:eL()}}function eL(){return(0,d.$create)(ew)}function eF(e){return e.canBeEmpty()}function ek(e,t,n=eF){return(0,d.mergeRegister)(e.registerCommand(d.KEY_TAB_COMMAND,t=>{let n=(0,d.$getSelection)();if(!(0,d.$isRangeSelection)(n))return!1;t.preventDefault();let i=!function(e){if(e.getNodes().filter(e=>(0,d.$isBlockElementNode)(e)&&e.canIndent()).length>0)return!0;let t=e.anchor,n=e.focus,i=n.isBefore(t)?n:t,r=L(i.getNode());if(r.canIndent()){let e=r.getKey(),t=(0,d.$createRangeSelection)();if(t.anchor.set(e,0,"element"),t.focus.set(e,0,"element"),(t=(0,d.$normalizeSelection__EXPERIMENTAL)(t)).anchor.is(i))return!0}return!1}(n)?d.INSERT_TAB_COMMAND:t.shiftKey?d.OUTDENT_CONTENT_COMMAND:d.INDENT_CONTENT_COMMAND;return e.dispatchCommand(i,void 0)},d.COMMAND_PRIORITY_EDITOR),e.registerCommand(d.INDENT_CONTENT_COMMAND,()=>{let e="number"==typeof t?t:t?t.peek():null,i=(0,d.$getSelection)();if(!(0,d.$isRangeSelection)(i))return!1;let r="function"==typeof n?n:n.peek();return Y(t=>{if(r(t)){let n=t.getIndent()+1;(!e||n<e)&&t.setIndent(n)}})},d.COMMAND_PRIORITY_CRITICAL))}(0,d.defineExtension)({dependencies:[eC,eb],name:"@lexical/extension/HorizontalRule",nodes:()=>[ew],register(e,t,n){let{watchNodeKey:i}=n.getDependency(eb).output,r=ei({nodeSelections:new Map}),o=e._config.theme.hrSelected??"selected";return(0,d.mergeRegister)(e.registerCommand(d.CLICK_COMMAND,e=>{if((0,d.isDOMNode)(e.target)){let t=(0,d.$getNodeFromDOMNode)(e.target);if(t instanceof ew)return function(e,t=!1){let n,i=(0,d.$getSelection)(),r=e.isSelected(),o=e.getKey();t&&(0,d.$isNodeSelection)(i)?n=i:(n=(0,d.$createNodeSelection)(),(0,d.$setSelection)(n)),r?n.delete(o):n.add(o)}(t,e.shiftKey),!0}return!1},d.COMMAND_PRIORITY_LOW),e.registerMutationListener(ew,(t,n)=>{q(()=>{let n=!1,{nodeSelections:o}=r.peek();for(let[r,l]of t.entries())if("destroyed"===l)o.delete(r),n=!0;else{let t=o.get(r),l=e.getElementByKey(r);t?t.domNode.value=l:(n=!0,o.set(r,{domNode:ei(l),selectedSignal:i(r)}))}n&&(r.value={nodeSelections:o})})}),eg(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of r.value.nodeSelections.values())e.push(eg(()=>{let e=t.value;e&&(n.value?(0,d.addClassNamesToElement)(e,o):(0,d.removeClassNamesFromElement)(e,o))}));return(0,d.mergeRegister)(...e)}))}}),(0,d.defineExtension)({build:(e,t,n)=>ef(t),config:(0,d.safeCast)({$canIndent:eF,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:i,maxIndent:r,$canIndent:o}=n.getOutput();return eg(()=>{if(!i.value)return ek(e,r,o)})}}),e.s(["LexicalBuilder",()=>eD,"batch",()=>q,"effect",()=>eg,"getPeerDependencyFromEditor",()=>eI,"namedSignals",()=>ef,"registerTabIndentation",()=>ek,"signal",()=>ei],501522);var eB=a;function eK(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function eY(e){let t=1,n=e.getParent();for(;null!=n;){if(e1(n)){let e=n.getParent();if(e6(e)){t++,n=e.getParent();continue}eK(40)}break}return t}function eW(e){let t=e.getParent();e6(t)||eK(40);let n=t;for(;null!==n;)e6(n=n.getParent())&&(t=n);return t}function ez(e){return e1(e)&&e6(e.getFirstChild())}function eU(e){return e0().append(e)}function ej(e,t){return e1(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function eH(e){let t=(0,eB.$getSelection)();if(null!==t){let n=t.getNodes();if((0,eB.$isRangeSelection)(t)){let i=t.getStartEndPoints();null===i&&eK(143);let[r]=i,o=r.getNode(),l=o.getParent();if((0,eB.$isRootOrShadowRoot)(o)){let e=o.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=(0,eB.$createParagraphNode)();o.append(e),n=e.select().getNodes()}}else if(ej(o,n)){let t=e9(e);if((0,eB.$isRootOrShadowRoot)(l)){o.replace(t);let e=e0();(0,eB.$isElementNode)(o)&&(e.setFormat(o.getFormatType()),e.setIndent(o.getIndent())),t.append(e)}else if(e1(o)){let e=o.getParentOrThrow();eJ(t,e.getChildren()),e.replace(t)}return}}let i=new Set;for(let t=0;t<n.length;t++){let r=n[t];if((0,eB.$isElementNode)(r)&&r.isEmpty()&&!e1(r)&&!i.has(r.getKey())){eV(r,e);continue}let o=(0,eB.$isLeafNode)(r)?r.getParent():e1(r)&&r.isEmpty()?r:null;for(;null!=o;){let t=o.getKey();if(e6(o)){if(!i.has(t)){let n=e9(e);eJ(n,o.getChildren()),o.replace(n),i.add(t)}break}{let n=o.getParent();if((0,eB.$isRootOrShadowRoot)(n)&&!i.has(t)){i.add(t),eV(o,e);break}o=n}}}}}function eJ(e,t){e.splice(e.getChildrenSize(),0,t)}function eV(e,t){let n;if(e6(e))return e;let i=e.getPreviousSibling(),r=e.getNextSibling(),o=e0();if(eJ(o,e.getChildren()),e6(i)&&t===i.getListType())i.append(o),e6(r)&&t===r.getListType()&&(eJ(i,r.getChildren()),r.remove()),n=i;else if(e6(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),n=r;else{let i=e9(t);i.append(o),e.replace(i),n=i}o.setFormat(e.getFormatType()),o.setIndent(e.getIndent());let l=(0,eB.$getSelection)();return(0,eB.$isRangeSelection)(l)&&(n.getKey()===l.anchor.key&&l.anchor.set(o.getKey(),l.anchor.offset,"element"),n.getKey()===l.focus.key&&l.focus.set(o.getKey(),l.focus.offset,"element")),e.remove(),n}function eX(e,t){let n=e.getLastChild(),i=t.getFirstChild();n&&i&&ez(n)&&ez(i)&&(eX(n.getFirstChild(),i.getFirstChild()),i.remove());let r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function eq(e){let t="check"!==e.getListType(),n=e.getStart();for(let i of e.getChildren())e1(i)&&(i.getValue()!==n&&i.setValue(n),t&&null!=i.getLatest().__checked&&i.setChecked(void 0),e6(i.getFirstChild())||n++)}class eG extends eB.ElementNode{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(null==e.__checked)return;let t=e.getParent();e6(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)},extends:eB.ElementNode,importDOM:(0,eB.buildImportMap)({li:()=>({conversion:eQ,priority:0})})})}constructor(e=1,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){let i;!e6(i=this.getParent())||"check"!==i.getListType()||e6(this.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),e&&this.__checked===e.__checked||t.setAttribute("aria-checked",this.getChecked()?"true":"false")),t.value=this.__value,function(e,t,n){let i,r=[],o=[],l=t.list,s=l?l.listitem:void 0;if(l&&l.nested&&(i=l.nested.listitem),void 0!==s&&r.push(...(0,eB.normalizeClassNames)(s)),l){let e=n.getParent(),t=e6(e)&&"check"===e.getListType(),i=n.getChecked();t&&!i||o.push(l.listitemUnchecked),t&&i||o.push(l.listitemChecked),t&&r.push(i?l.listitemChecked:l.listitemUnchecked)}if(void 0!==i){let e=(0,eB.normalizeClassNames)(i);n.getChildren().some(e=>e6(e))?r.push(...e):o.push(...e)}o.length>0&&(0,eB.removeClassNamesFromElement)(e,...o),r.length>0&&(0,eB.addClassNamesToElement)(e,...r)}(t,n.theme,this);let r=e?e.__style:"",o=this.__style;r!==o&&(""===o?t.removeAttribute("style"):t.style.cssText=o),function(e,t,n){let i=f(t.__textStyle);for(let t in i)e.style.setProperty(`--listitem-marker-${t}`,i[t]);if(n)for(let t in f(n.__textStyle))t in i||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){return this.updateListItemDOM(e,t,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if((0,eB.$isElementNode)(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(e1(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!e6(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=e9(n.getListType()),i=this.getNextSibling();for(;i;){let e=i;i=i.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&((0,eB.$isElementNode)(e)||eK(139),this.getChildren().forEach(t=>{e.append(t)})),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(e6(n)||eK(39),e1(e))return super.insertAfter(e,t);let i=this.getNextSiblings();if(n.insertAfter(e,t),0!==i.length){let r=e9(n.getListType());i.forEach(e=>r.append(e)),e.insertAfter(r,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&ez(t)&&ez(n)&&(eX(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=e0().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let t=(0,eB.$createParagraphNode)();this.getChildren().forEach(e=>t.append(e));let n=this.getParentOrThrow(),i=n.getParentOrThrow(),r=e1(i);if(1===n.getChildrenSize())if(r)n.remove(),i.select();else{n.insertBefore(t),n.remove();let i=e.anchor,r=e.focus,o=t.getKey();"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element"),"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e,t=this.getLatest(),n=this.getParent();return e6(n)&&(e=n.getListType()),"check"===e?!!t.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;e1(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&eK(117),(e=Math.floor(e))>=0||eK(199);let t=this.getIndent();for(;t!==e;)t<e?(function(e){let t=new Set;if(ez(e)||t.has(e.getKey()))return;let n=e.getParent(),i=e.getNextSibling(),r=e.getPreviousSibling();if(ez(i)&&ez(r)){let n=r.getFirstChild();if(e6(n)){n.append(e);let r=i.getFirstChild();e6(r)&&(eJ(n,r.getChildren()),i.remove(),t.add(i.getKey()))}}else if(ez(i)){let t=i.getFirstChild();if(e6(t)){let n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(ez(r)){let t=r.getFirstChild();e6(t)&&t.append(e)}else if(e6(n)){let t=e0().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),o=e9(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(o),o.append(e),r?r.insertAfter(t):i?i.insertBefore(t):n.append(t)}}(this),t++):(function(e){if(ez(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(e6(n?n.getParent():void 0)&&e1(n)&&e6(t)){let i=t?t.getFirstChild():void 0,r=t?t.getLastChild():void 0;if(e.is(i))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(r))n.insertAfter(e),t.isEmpty()&&n.remove();else{let i=t.getListType(),r=e0(),o=e9(i);r.append(o),e.getPreviousSiblings().forEach(e=>o.append(e));let l=e0(),s=e9(i);l.append(s),eJ(s,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(l),n.replace(e)}}}(this),t--);return this}canInsertAfter(e){return e1(e)}canReplaceWith(e){return e1(e)}canMergeWith(e){return e1(e)||(0,eB.$isParagraphNode)(e)}extractWithChild(e,t){if(!(0,eB.$isRangeSelection)(t))return!1;let n=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return e9("bullet")}canMergeWhenEmpty(){return!0}}function eQ(e){if(e.classList.contains("task-list-item")){for(let t of e.children)if("INPUT"===t.tagName)return eZ(t)}if(e.classList.contains("joplin-checkbox")){for(let t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return eZ(t.children[0])}let t=e.getAttribute("aria-checked");return{node:e0("true"===t||"false"!==t&&void 0)}}function eZ(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:e0(e.hasAttribute("checked"))}}function e0(e){return(0,eB.$applyNodeReplacement)(new eG(void 0,e))}function e1(e){return e instanceof eG}class e3 extends eB.ElementNode{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{let t;e6(t=e.getNextSibling())&&e.getListType()===t.getListType()&&eX(e,t),eq(e)},extends:eB.ElementNode,importDOM:(0,eB.buildImportMap)({ol:()=>({conversion:e4,priority:0}),ul:()=>({conversion:e4,priority:0})})})}constructor(e="number",t=1,n){super(n);const i=e7[e]||e;this.__listType=i,this.__tag="number"===i?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,i=document.createElement(n);return 1!==this.__start&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,e2(i,e.theme,this),i}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(e2(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return(0,eB.isHTMLElement)(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let i=n;for(let e=0;e<n.length;e++){let t=n[e];e1(t)||(i===n&&(i=[...n]),i[e]=e0().append(!(0,eB.$isElementNode)(t)||e6(t)||t.isInline()?t:(0,eB.$createTextNode)(t.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return e1(e)}}function e2(e,t,n){let i=[],r=[],o=t.list;if(void 0!==o){let e,t=o[`${n.__tag}Depth`]||[],l=eY(n)-1,s=l%t.length,a=t[s],d=o[n.__tag],u=o.nested,c=o.checklist;if(void 0!==u&&u.list&&(e=u.list),void 0!==d&&i.push(d),void 0!==c&&"check"===n.__listType&&i.push(c),void 0!==a){i.push(...(0,eB.normalizeClassNames)(a));for(let e=0;e<t.length;e++)e!==s&&r.push(n.__tag+e)}if(void 0!==e){let t=(0,eB.normalizeClassNames)(e);l>1?i.push(...t):r.push(...t)}}r.length>0&&(0,eB.removeClassNamesFromElement)(e,...r),i.length>0&&(0,eB.addClassNamesToElement)(e,...i)}function e5(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];if(e1(i)){t.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{e6(e)&&t.push(eU(e))})}else t.push(eU(i))}return t}function e4(e){let t=e.nodeName.toLowerCase(),n=null;return"ol"===t?n=e9("number",e.start):"ul"===t&&(n=!function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(let t of e.childNodes)if((0,eB.isHTMLElement)(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?e9("bullet"):e9("check")),{after:e5,node:n}}let e7={ol:"number",ul:"bullet"};function e9(e="number",t=1){return(0,eB.$applyNodeReplacement)(new e3(e,t))}function e6(e){return e instanceof e3}let e8=(0,eB.createCommand)("INSERT_CHECK_LIST_COMMAND");function te(e,t){let n=t&&t.disableTakeFocusOnClick||!1,i=e=>{tt(e,()=>{if((0,eB.isHTMLElement)(e.target)){let t=e.target,i=(0,eB.getNearestEditorFromDOMNode)(t);null!=i&&i.isEditable()&&i.update(()=>{let e=(0,eB.$getNearestNodeFromDOMNode)(t);e1(e)&&(n?((0,eB.$addUpdateTag)(eB.SKIP_SELECTION_FOCUS_TAG),(0,eB.$addUpdateTag)(eB.SKIP_DOM_SELECTION_TAG)):t.focus(),e.toggleChecked())})}})},r=e=>{tt(e,()=>{e.preventDefault(),n&&e.stopPropagation()})};return(0,eB.mergeRegister)(e.registerCommand(e8,()=>(eH("check"),!0),eB.COMMAND_PRIORITY_LOW),e.registerCommand(eB.KEY_ARROW_DOWN_COMMAND,t=>ti(t,e,!1),eB.COMMAND_PRIORITY_LOW),e.registerCommand(eB.KEY_ARROW_UP_COMMAND,t=>ti(t,e,!0),eB.COMMAND_PRIORITY_LOW),e.registerCommand(eB.KEY_ESCAPE_COMMAND,()=>{if(null!=tn()){let t=e.getRootElement();return null!=t&&t.focus(),!0}return!1},eB.COMMAND_PRIORITY_LOW),e.registerCommand(eB.KEY_SPACE_COMMAND,t=>{let n=tn();return!(null==n||!e.isEditable())&&(e.update(()=>{let e=(0,eB.$getNearestNodeFromDOMNode)(n);e1(e)&&(t.preventDefault(),e.toggleChecked())}),!0)},eB.COMMAND_PRIORITY_LOW),e.registerCommand(eB.KEY_ARROW_LEFT_COMMAND,t=>e.getEditorState().read(()=>{let n=(0,eB.$getSelection)();if((0,eB.$isRangeSelection)(n)&&n.isCollapsed()){let{anchor:i}=n,r="element"===i.type;if(r||0===i.offset){let n=i.getNode(),o=(0,eB.$findMatchingParent)(n,e=>(0,eB.$isElementNode)(e)&&!e.isInline());if(e1(o)){let i=o.getParent();if(e6(i)&&"check"===i.getListType()&&(r||o.getFirstDescendant()===n)){let n=e.getElementByKey(o.__key);if(null!=n&&document.activeElement!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}),eB.COMMAND_PRIORITY_LOW),e.registerRootListener((e,t)=>{null!==e&&(e.addEventListener("click",i),e.addEventListener("pointerdown",r,{capture:!0}),e.addEventListener("mousedown",r,{capture:!0}),e.addEventListener("touchstart",r,{capture:!0,passive:!1})),null!==t&&(t.removeEventListener("click",i),t.removeEventListener("pointerdown",r,{capture:!0}),t.removeEventListener("mousedown",r,{capture:!0}),t.removeEventListener("touchstart",r,{capture:!0}))}))}function tt(e,t){let n=e.target;if(!(0,eB.isHTMLElement)(n))return;let i=n.firstChild;if((0,eB.isHTMLElement)(i)&&("UL"===i.tagName||"OL"===i.tagName))return;let r=n.parentNode;if(!r||"check"!==r.__lexicalListType)return;let o=null,l=null;if("clientX"in e)o=e.clientX;else if("touches"in e){let t=e.touches;t.length>0&&(o=t[0].clientX,l="touch")}if(null==o)return;let s=n.getBoundingClientRect(),a=o/U(n),d=parseFloat((window.getComputedStyle?window.getComputedStyle(n,"::before"):{width:"0px"}).width),u=32*("touch"===l||"touch"===e.pointerType);("rtl"===n.dir?a<s.right+u&&a>s.right-d-u:a>s.left-u&&a<s.left+d+u)&&t()}function tn(){let e=document.activeElement;return(0,eB.isHTMLElement)(e)&&"LI"===e.tagName&&null!=e.parentNode&&"check"===e.parentNode.__lexicalListType?e:null}function ti(e,t,n){let i=tn();return null!=i&&t.update(()=>{let r=(0,eB.$getNearestNodeFromDOMNode)(i);if(!e1(r))return;let o=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),i=e;for(;null==n&&e1(i);)null!=(i=i.getParentOrThrow().getParent())&&(n=t?i.getPreviousSibling():i.getNextSibling());for(;e1(n);){let e=t?n.getLastChild():n.getFirstChild();if(!e6(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(r,n);if(null!=o){o.selectStart();let n=t.getElementByKey(o.__key);null!=n&&(e.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}let tr=(0,eB.createCommand)("UPDATE_LIST_START_COMMAND"),to=(0,eB.createCommand)("INSERT_UNORDERED_LIST_COMMAND"),tl=(0,eB.createCommand)("INSERT_ORDERED_LIST_COMMAND"),ts=(0,eB.createCommand)("REMOVE_LIST_COMMAND");function ta(e,t){return(0,eB.mergeRegister)(e.registerCommand(tl,()=>(eH("number"),!0),eB.COMMAND_PRIORITY_LOW),e.registerCommand(tr,e=>{let{listNodeKey:t,newStart:n}=e,i=(0,eB.$getNodeByKey)(t);return!!e6(i)&&("number"===i.getListType()&&(i.setStart(n),eq(i)),!0)},eB.COMMAND_PRIORITY_LOW),e.registerCommand(to,()=>(eH("bullet"),!0),eB.COMMAND_PRIORITY_LOW),e.registerCommand(ts,()=>((function(){let e=(0,eB.$getSelection)();if((0,eB.$isRangeSelection)(e)){let t=new Set,n=e.getNodes(),i=e.anchor.getNode();if(ej(i,n))t.add(eW(i));else for(let e=0;e<n.length;e++){let i=n[e];if((0,eB.$isLeafNode)(i)){let e=P(i,eG);null!=e&&t.add(eW(e))}}for(let n of t){let t=n;for(let i of function e(t){let n=[],i=t.getChildren().filter(e1);for(let t=0;t<i.length;t++){let r=i[t],o=r.getFirstChild();e6(o)?n=n.concat(e(o)):n.push(r)}return n}(n)){let n=(0,eB.$createParagraphNode)().setTextStyle(e.style).setTextFormat(e.format);eJ(n,i.getChildren()),t.insertAfter(n),t=n,i.__key===e.anchor.key&&(0,eB.$setPointFromCaret)(e.anchor,(0,eB.$normalizeCaret)((0,eB.$getChildCaret)(n,"next"))),i.__key===e.focus.key&&(0,eB.$setPointFromCaret)(e.focus,(0,eB.$normalizeCaret)((0,eB.$getChildCaret)(n,"next"))),i.remove()}n.remove()}}})(),!0),eB.COMMAND_PRIORITY_LOW),e.registerCommand(eB.INSERT_PARAGRAPH_COMMAND,()=>(function(e=!1){let t,n=(0,eB.$getSelection)();if(!(0,eB.$isRangeSelection)(n)||!n.isCollapsed())return!1;let i=n.anchor.getNode(),r=null;if(e1(i)&&0===i.getChildrenSize())r=i;else if((0,eB.$isTextNode)(i)){let e=i.getParent();e1(e)&&e.getChildren().every(e=>(0,eB.$isTextNode)(e)&&""===e.getTextContent().trim())&&(r=e)}if(null===r)return!1;let o=eW(r),l=r.getParent();e6(l)||eK(40);let s=l.getParent();if((0,eB.$isRootOrShadowRoot)(s))t=(0,eB.$createParagraphNode)(),o.insertAfter(t);else{if(!e1(s))return!1;t=e0(),s.insertAfter(t)}t.setTextStyle(n.style).setTextFormat(n.format).select();let a=r.getNextSiblings();if(a.length>0){var d;let n=e?(d=r,l.getStart()+d.getIndexWithinParent()):1,i=e9(l.getListType(),n);if(e1(t)){let e=e0();e.append(i),t.insertAfter(e)}else t.insertAfter(i);i.append(...a)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){let e=t.getParent();if(null==e||!e1(e)&&!e6(e))break;t=e}t.remove()}(r),!0})(!!(t&&t.restoreNumbering)),eB.COMMAND_PRIORITY_LOW),e.registerNodeTransform(eG,e=>{let t=e.getFirstChild();if(t){if((0,eB.$isTextNode)(t)){let n=t.getStyle(),i=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{let t=(0,eB.$getSelection)();(0,eB.$isRangeSelection)(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(eB.TextNode,e=>{let t=e.getParent();if(e1(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),i=e.getFormat();n===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(n).setTextFormat(i)}}))}function td(e){let t=e=>{let t=e.getParent();if(e6(e.getFirstChild())||!e6(t))return;let n=(0,eB.$findMatchingParent)(e,e=>e1(e)&&e6(e.getParent())&&e1(e.getPreviousSibling()));if(null===n&&e.getIndent()>0)e.setIndent(0);else if(e1(n)){let i=n.getPreviousSibling();if(e1(i)){let n=(function(e){let t=e,n=t.getFirstChild();for(;e6(n);){let e=n.getLastChild();if(!e1(e))break;n=(t=e).getFirstChild()}return t})(i).getParent();if(e6(n)){let i=eY(n);i+1<eY(t)&&e.setIndent(i)}}}};return e.registerNodeTransform(e3,e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(e6(e)){for(let i of e.getChildren())if(e1(i)){t(i);let e=i.getFirstChild();e6(e)&&n.push(e)}}}})}let tu=(0,eB.defineExtension)({build:(e,t,n)=>ef(t),config:(0,eB.safeCast)({hasStrictIndent:!1,shouldPreserveNumbering:!1}),name:"@lexical/list/List",nodes:()=>[e3,eG],register(e,t,n){let i=n.getOutput();return(0,eB.mergeRegister)(eg(()=>ta(e,{restoreNumbering:i.shouldPreserveNumbering.value})),eg(()=>i.hasStrictIndent.value?td(e):void 0))}});function tc(e,t){let n=(0,a.isDOMDocumentNode)(t)?t.body.childNodes:t.childNodes,i=[],r=[];for(let t of n)if(!tf.has(t.nodeName)){let n=function e(t,n,i,r,o=new Map,l){let s=[];if(tf.has(t.nodeName))return s;let d=null,u=function(e,t){let{nodeName:n}=e,i=t._htmlConversions.get(n.toLowerCase()),r=null;if(void 0!==i)for(let t of i){let n=t(e);null!==n&&(null===r||(r.priority||0)<=(n.priority||0))&&(r=n)}return null!==r?r.conversion:null}(t,n),c=u?u(t):null,g=null;if(null!==c){g=c.after;let e=c.node;if(null!==(d=Array.isArray(e)?e[e.length-1]:e)){for(let[,e]of o)if(!(d=e(d,l)))break;d&&s.push(...Array.isArray(e)?e:[d])}null!=c.forChild&&o.set(t.nodeName,c.forChild)}let f=t.childNodes,h=[],m=(null==d||!(0,a.$isRootOrShadowRoot)(d))&&(null!=d&&(0,a.$isBlockElementNode)(d)||r);for(let t=0;t<f.length;t++)h.push(...e(f[t],n,i,m,new Map(o),d));return null!=g&&(h=g(h)),(0,a.isBlockDomNode)(t)&&(h=function(e,t,n){let i=e.style.textAlign,r=[],o=[];for(let e=0;e<t.length;e++){let l=t[e];if((0,a.$isBlockElementNode)(l))i&&!l.getFormat()&&l.setFormat(i),r.push(l);else if(o.push(l),e===t.length-1||e<t.length-1&&(0,a.$isBlockElementNode)(t[e+1])){let e=n();e.setFormat(i),e.append(...o),r.push(e),o=[]}}return r}(t,h,m?()=>{let e=new a.ArtificialNode__DO_NOT_USE;return i.push(e),e}:a.$createParagraphNode)),null==d?h.length>0?s=s.concat(h):(0,a.isBlockDomNode)(t)&&null!=t.nextSibling&&null!=t.previousSibling&&(0,a.isInlineDomNode)(t.nextSibling)&&(0,a.isInlineDomNode)(t.previousSibling)&&(s=s.concat((0,a.$createLineBreakNode)())):(0,a.$isElementNode)(d)&&d.append(...h),s}(t,e,r,!1);null!==n&&(i=i.concat(n))}return function(e){for(let t of e)t.getNextSibling()instanceof a.ArtificialNode__DO_NOT_USE&&t.insertAfter((0,a.$createLineBreakNode)());for(let t of e){for(let e of t.getChildren())t.insertBefore(e);t.remove()}}(r),i}function tg(t,n){if("u"<typeof document||"u"<typeof window&&void 0===e.g.window)throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let i=document.createElement("div"),r=(0,a.$getRoot)().getChildren();for(let e=0;e<r.length;e++)!function e(t,n,i,r=null){let o=null===r||n.isSelected(r),l=(0,a.$isElementNode)(n)&&n.excludeFromCopy("html"),s=n;null!==r&&(0,a.$isTextNode)(n)&&(s=N(r,n,"clone"));let d=(0,a.$isElementNode)(s)?s.getChildren():[],u=(0,a.getRegisteredNode)(t,s.getType()),{element:c,after:g}=u&&void 0!==u.exportDOM?u.exportDOM(t,s):s.exportDOM(t);if(!c)return!1;let f=document.createDocumentFragment();for(let i=0;i<d.length;i++){let l=d[i],s=e(t,l,f,r);!o&&(0,a.$isElementNode)(n)&&s&&n.extractWithChild(l,r,"html")&&(o=!0)}if(o&&!l){if(((0,a.isHTMLElement)(c)||(0,a.isDocumentFragment)(c))&&c.append(f),i.append(c),g){let e=g.call(s,c);e&&((0,a.isDocumentFragment)(c)?c.replaceChildren(e):c.replaceWith(e))}}else i.append(f);return o}(t,r[e],i,n);return i.innerHTML}(0,eB.defineExtension)({config:(0,eB.safeCast)({disableTakeFocusOnClick:!1}),dependencies:[tu],name:"@lexical/list/CheckList",register:te}),e.s(["$createListItemNode",()=>e0,"$createListNode",()=>e9,"$isListItemNode",()=>e1,"$isListNode",()=>e6,"INSERT_CHECK_LIST_COMMAND",()=>e8,"INSERT_ORDERED_LIST_COMMAND",()=>tl,"INSERT_UNORDERED_LIST_COMMAND",()=>to,"ListItemNode",()=>eG,"ListNode",()=>e3,"registerCheckList",()=>te,"registerList",()=>ta,"registerListStrictIndentTransform",()=>td],397910);let tf=new Set(["STYLE","SCRIPT"]);function th(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function tm(e,t,n){let i=e.getData("application/x-lexical-editor");if(i)try{let e=JSON.parse(i);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return tp(n,function(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],r=(0,a.$parseSerializedNode)(i);(0,a.$isTextNode)(r)&&_(r),t.push(r)}return t}(e.nodes),t)}catch(e){console.error(e)}let r=e.getData("text/html"),o=e.getData("text/plain");if(r&&o!==r)try{let e=(new DOMParser).parseFromString(window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(r):r,"text/html");return tp(n,tc(n,e),t)}catch(e){console.error(e)}let l=o||e.getData("text/uri-list");if(null!=l)if((0,a.$isRangeSelection)(t)){let e=l.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){let n=(0,a.$getSelection)();if((0,a.$isRangeSelection)(n)){let i=e[t];"\n"===i||"\r\n"===i?n.insertParagraph():" "===i?n.insertNodes([(0,a.$createTabNode)()]):n.insertText(i)}}}else t.insertRawText(l)}function tp(e,t,n){e.dispatchCommand(a.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if((0,a.$isRangeSelection)(e)&&e.isCollapsed()){let t=e.anchor,n=null,i=(0,a.$caretFromPoint)(t,"previous");if(i)if((0,a.$isTextPointCaret)(i))n=i.origin;else for(let e of(0,a.$getCaretRange)(i,(0,a.$getChildCaret)((0,a.$getRoot)(),"next").getFlipped())){if((0,a.$isTextNode)(e.origin)){n=e.origin;break}if((0,a.$isElementNode)(e.origin)&&!e.origin.isInline())break}if(n&&(0,a.$isTextNode)(n)){let t=n.getFormat(),i=n.getStyle();e.format===t&&e.style===i||(e.format=t,e.style=i,e.dirty=!0)}}}(n))}e.s(["$generateHtmlFromNodes",()=>tg,"$generateNodesFromDOM",()=>tc],800569);let tN=null;async function tC(e,t,n){if(null!==tN)return!1;if(null!==t)return new Promise((i,r)=>{e.update(()=>{i(t_(e,t,n))})});let i=e.getRootElement(),r=e._window||window,o=r.document,l=(0,a.getDOMSelection)(r);if(null===i||null===l)return!1;let s=o.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(o.createTextNode("#")),i.append(s);let d=new Range;return d.setStart(s,0),d.setEnd(s,1),l.removeAllRanges(),l.addRange(d),new Promise((t,i)=>{let l=e.registerCommand(a.COPY_COMMAND,i=>(K(i,ClipboardEvent)&&(l(),null!==tN&&(r.clearTimeout(tN),tN=null),t(t_(e,i,n))),!0),a.COMMAND_PRIORITY_CRITICAL);tN=r.setTimeout(()=>{l(),tN=null,t(!1)},50),o.execCommand("copy"),s.remove()})}function t_(e,t,n){if(void 0===n){let t=(0,a.getDOMSelection)(e._window),i=(0,a.$getSelection)();if(!i||i.isCollapsed()||!t)return!1;let r=t.anchorNode,o=t.focusNode;if(null!==r&&null!==o&&!(0,a.isSelectionWithinEditor)(e,r,o))return!1;n=tE(i)}t.preventDefault();let i=t.clipboardData;return null!==i&&(function(e,t){for(let[n]of tS)void 0===t[n]&&e.setData(n,"");for(let n in t){let i=t[n];void 0!==i&&e.setData(n,i)}}(i,n),!0)}let tS=[["text/html",function(e,t=(0,a.$getSelection)()){return null==t&&th(166),(0,a.$isRangeSelection)(t)&&t.isCollapsed()||0===t.getNodes().length?"":tg(e,t)}],["application/x-lexical-editor",function(e,t=(0,a.$getSelection)()){return null==t&&th(166),(0,a.$isRangeSelection)(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){let n=[],i=(0,a.$getRoot)().getChildren();for(let r=0;r<i.length;r++)!function e(t,n,i,r=[]){var o;let l,s,d=null===n||i.isSelected(n),u=(0,a.$isElementNode)(i)&&i.excludeFromCopy("html"),c=i;null!==n&&(0,a.$isTextNode)(c)&&(c=N(n,c,"clone"));let g=(0,a.$isElementNode)(c)?c.getChildren():[],f=(l=(o=c).exportJSON(),s=o.constructor,l.type!==s.getType()&&th(58,s.name),(0,a.$isElementNode)(o)&&(Array.isArray(l.children)||th(59,s.name)),l);(0,a.$isTextNode)(c)&&0===c.getTextContentSize()&&(d=!1);for(let r=0;r<g.length;r++){let o=g[r],l=e(t,n,o,f.children);!d&&(0,a.$isElementNode)(i)&&l&&i.extractWithChild(o,n,"clone")&&(d=!0)}if(d&&!u)r.push(f);else if(Array.isArray(f.children))for(let e=0;e<f.children.length;e++){let t=f.children[e];r.push(t)}return d}(e,t,i[r],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function tE(e=(0,a.$getSelection)()){let t={"text/plain":e?e.getTextContent():""};if(e){let n=(0,a.$getEditor)();for(let[i,r]of tS){let o=r(n,e);null!==o&&(t[i]=o)}}return t}function tx(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let i=e.getRootElement();if(document.activeElement!==i)return;let r=n.data;if("string"==typeof r){let t;try{t=JSON.parse(r)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){let i=t.payload;if(i&&"makeChanges"===i.functionId){let t=i.args;if(t){let[i,r,o,l,s]=t;e.update(()=>{let e=(0,a.$getSelection)();if((0,a.$isRangeSelection)(e)){let t=e.anchor,d=t.getNode(),u=0,c=0;if((0,a.$isTextNode)(d)&&i>=0&&r>=0&&(u=i,c=i+r,e.setTextNodeRange(d,u,d,c)),u===c&&""===o||(e.insertRawText(o),d=t.getNode()),(0,a.$isTextNode)(d)){u=l,c=l+s;let t=d.getTextContentSize();u=u>t?t:u,c=c>t?t:c,e.setTextNodeRange(d,u,d,c)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}e.s(["$getClipboardDataFromSelection",()=>tE,"$insertDataTransferForRichText",()=>tm,"copyToClipboard",()=>tC],704338);let tT=(0,a.defineExtension)({build:(e,t,n)=>ef(t),config:(0,a.safeCast)({disabled:"u"<typeof window}),name:"@lexical/dragon",register:(e,t,n)=>eg(()=>n.getOutput().disabled.value?void 0:tx(e))});e.s(["DragonExtension",()=>tT,"registerDragonSupport",()=>tx],35500);var ty=a;function tR(e,t){if(void 0!==document.caretRangeFromPoint){let n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){let n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}let tO="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,tv=tO&&"documentMode"in document?document.documentMode:null,t$=tO&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),tM=!(!tO||!("InputEvent"in window)||tv)&&"getTargetRanges"in new window.InputEvent("input"),tD=tO&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),tI=tO&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tA=tO&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tb=tO&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&t$&&!tA,tw=(0,ty.createCommand)("DRAG_DROP_PASTE_FILE");class tP extends ty.ElementNode{static getType(){return"quote"}static clone(e){return new tP(e.__key)}createDOM(e){let t=document.createElement("blockquote");return(0,ty.addClassNamesToElement)(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:tY,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,ty.isHTMLElement)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return tL().updateFromJSON(e)}insertNewAfter(e,t){let n=(0,ty.$createParagraphNode)(),i=this.getDirection();return n.setDirection(i),this.insertAfter(n,t),n}collapseAtStart(){let e=(0,ty.$createParagraphNode)();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function tL(){return(0,ty.$applyNodeReplacement)(new tP)}function tF(e){return e instanceof tP}class tk extends ty.ElementNode{__tag;static getType(){return"heading"}static clone(e){return new tk(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),i=e.theme.heading;if(void 0!==i){let e=i[t];(0,ty.addClassNamesToElement)(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:tK,priority:0}),h2:e=>({conversion:tK,priority:0}),h3:e=>({conversion:tK,priority:0}),h4:e=>({conversion:tK,priority:0}),h5:e=>({conversion:tK,priority:0}),h6:e=>({conversion:tK,priority:0}),p:e=>{let t=e.firstChild;return null!==t&&tB(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>tB(e)?{conversion:e=>({node:tW("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,ty.isHTMLElement)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return tW(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,i=this.getLastDescendant(),r=i&&(!e||e.anchor.key!==i.getKey()||n!==i.getTextContentSize())&&e?tW(this.getTag()):(0,ty.$createParagraphNode)(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){let e=(0,ty.$createParagraphNode)();e.select(),this.replace(e,!0)}return r}collapseAtStart(){let e=this.isEmpty()?(0,ty.$createParagraphNode)():tW(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function tB(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function tK(e){let t=e.nodeName.toLowerCase(),n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=tW(t),null!==e.style&&((0,ty.setNodeIndentFromDOM)(e,n),n.setFormat(e.style.textAlign))),{node:n}}function tY(e){let t=tL();return null!==e.style&&(t.setFormat(e.style.textAlign),(0,ty.setNodeIndentFromDOM)(e,t)),{node:t}}function tW(e="h1"){return(0,ty.$applyNodeReplacement)(new tk(e))}function tz(e){return e instanceof tk}function tU(e){let t=null;if(K(e,DragEvent)?t=e.dataTransfer:K(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];let n=t.types,i=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[i,Array.from(t.files),r]}function tj(e){let t=(0,ty.$getNearestNodeFromDOMNode)(e);return(0,ty.$isDecoratorNode)(t)}function tH(e){for(let t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function tJ(e){return(0,ty.mergeRegister)(e.registerCommand(ty.CLICK_COMMAND,e=>{let t=(0,ty.$getSelection)();return!!(0,ty.$isNodeSelection)(t)&&(t.clear(),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.DELETE_CHARACTER_COMMAND,e=>{let t=(0,ty.$getSelection)();return(0,ty.$isRangeSelection)(t)?(t.deleteCharacter(e),!0):!!(0,ty.$isNodeSelection)(t)&&(t.deleteNodes(),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.DELETE_WORD_COMMAND,e=>{let t=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(t)&&(t.deleteWord(e),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.DELETE_LINE_COMMAND,e=>{let t=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(t)&&(t.deleteLine(e),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.CONTROLLED_TEXT_INSERTION_COMMAND,t=>{let n=(0,ty.$getSelection)();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;let i=t.dataTransfer;if(null!=i)tm(i,n,e);else if((0,ty.$isRangeSelection)(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.REMOVE_TEXT_COMMAND,()=>{let e=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(e)&&(e.removeText(),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.FORMAT_TEXT_COMMAND,e=>{let t=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(t)&&(t.formatText(e),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.FORMAT_ELEMENT_COMMAND,e=>{let t=(0,ty.$getSelection)();if(!(0,ty.$isRangeSelection)(t)&&!(0,ty.$isNodeSelection)(t))return!1;for(let n of t.getNodes()){let t=(0,ty.$findMatchingParent)(n,e=>(0,ty.$isElementNode)(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.INSERT_LINE_BREAK_COMMAND,e=>{let t=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(t)&&(t.insertLineBreak(e),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.INSERT_PARAGRAPH_COMMAND,()=>{let e=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(e)&&(e.insertParagraph(),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.INSERT_TAB_COMMAND,()=>{let e=(0,ty.$createTabNode)(),t=(0,ty.$getSelection)();return(0,ty.$isRangeSelection)(t)&&(e.setFormat(t.format),e.setStyle(t.style)),(0,ty.$insertNodes)([e]),!0},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.INDENT_CONTENT_COMMAND,()=>Y(e=>{let t=e.getIndent();e.setIndent(t+1)}),ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.OUTDENT_CONTENT_COMMAND,()=>Y(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_ARROW_UP_COMMAND,e=>{let t=(0,ty.$getSelection)();if((0,ty.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if((0,ty.$isRangeSelection)(t)){let n=(0,ty.$getAdjacentNode)(t.focus,!0);if(!e.shiftKey&&(0,ty.$isDecoratorNode)(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_ARROW_DOWN_COMMAND,e=>{let t=(0,ty.$getSelection)();if((0,ty.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if((0,ty.$isRangeSelection)(t)){let n;if("root"===(n=t.focus).key&&n.offset===(0,ty.$getRoot)().getChildrenSize())return e.preventDefault(),!0;let i=(0,ty.$getAdjacentNode)(t.focus,!1);if(!e.shiftKey&&(0,ty.$isDecoratorNode)(i)&&!i.isIsolated()&&!i.isInline())return i.selectNext(),e.preventDefault(),!0}return!1},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_ARROW_LEFT_COMMAND,e=>{let t=(0,ty.$getSelection)();if((0,ty.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),p(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!(0,ty.$isRangeSelection)(t))return!1;if(R(t,!0)){let n=e.shiftKey;return e.preventDefault(),v(t,n,!0),!0}return!1},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_ARROW_RIGHT_COMMAND,e=>{let t=(0,ty.$getSelection)();if((0,ty.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),p(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!(0,ty.$isRangeSelection)(t))return!1;let n=e.shiftKey;return!!R(t,!1)&&(e.preventDefault(),v(t,n,!1),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_BACKSPACE_COMMAND,t=>{if(tj(t.target))return!1;let n=(0,ty.$getSelection)();if((0,ty.$isRangeSelection)(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(0!==t.offset)return!1;let n=t.getNode();if((0,ty.$isRootNode)(n))return!1;let i=L(n);return i.getIndent()>0&&(i.is(n)||n.is(i.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(ty.OUTDENT_CONTENT_COMMAND,void 0);if(tI&&"ko-KR"===navigator.language)return!1}else if(!(0,ty.$isNodeSelection)(n))return!1;return t.preventDefault(),e.dispatchCommand(ty.DELETE_CHARACTER_COMMAND,!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_DELETE_COMMAND,t=>{if(tj(t.target))return!1;let n=(0,ty.$getSelection)();return!(!(0,ty.$isRangeSelection)(n)&&!(0,ty.$isNodeSelection)(n))&&(t.preventDefault(),e.dispatchCommand(ty.DELETE_CHARACTER_COMMAND,!1))},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_ENTER_COMMAND,t=>{let n=(0,ty.$getSelection)();if(!(0,ty.$isRangeSelection)(n))return!1;if(tH(n),null!==t){if((tI||tD||tb)&&tM)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(ty.INSERT_LINE_BREAK_COMMAND,!1)}return e.dispatchCommand(ty.INSERT_PARAGRAPH_COMMAND,void 0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_ESCAPE_COMMAND,()=>{let t=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(t)&&(e.blur(),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.DROP_COMMAND,t=>{let[,n]=tU(t);if(n.length>0){let i=tR(t.clientX,t.clientY);if(null!==i){let{offset:t,node:r}=i,o=(0,ty.$getNearestNodeFromDOMNode)(r);if(null!==o){let e=(0,ty.$createRangeSelection)();if((0,ty.$isTextNode)(o))e.anchor.set(o.getKey(),t,"text"),e.focus.set(o.getKey(),t,"text");else{let t=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}let n=(0,ty.$normalizeSelection__EXPERIMENTAL)(e);(0,ty.$setSelection)(n)}e.dispatchCommand(tw,n)}return t.preventDefault(),!0}let i=(0,ty.$getSelection)();return!!(0,ty.$isRangeSelection)(i)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.DRAGSTART_COMMAND,e=>{let[t]=tU(e),n=(0,ty.$getSelection)();return!(t&&!(0,ty.$isRangeSelection)(n))},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.DRAGOVER_COMMAND,e=>{let[t]=tU(e),n=(0,ty.$getSelection)();if(t&&!(0,ty.$isRangeSelection)(n))return!1;let i=tR(e.clientX,e.clientY);if(null!==i){let t=(0,ty.$getNearestNodeFromDOMNode)(i.node);(0,ty.$isDecoratorNode)(t)&&e.preventDefault()}return!0},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.SELECT_ALL_COMMAND,()=>((0,ty.$selectAll)(),!0),ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.COPY_COMMAND,t=>(tC(e,K(t,ClipboardEvent)?t:null),!0),ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.CUT_COMMAND,t=>((async function(e,t){await tC(t,K(e,ClipboardEvent)?e:null),t.update(()=>{let e=(0,ty.$getSelection)();(0,ty.$isRangeSelection)(e)?e.removeText():(0,ty.$isNodeSelection)(e)&&e.getNodes().forEach(e=>e.remove())})})(t,e),!0),ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.PASTE_COMMAND,t=>{let[,n,i]=tU(t);return n.length>0&&!i?(e.dispatchCommand(tw,n),!0):!((0,ty.isDOMNode)(t.target)&&(0,ty.isSelectionCapturedInDecoratorInput)(t.target))&&null!==(0,ty.$getSelection)()&&(t.preventDefault(),e.update(()=>{let n=(0,ty.$getSelection)(),i=K(t,InputEvent)||K(t,KeyboardEvent)?null:t.clipboardData;null!=i&&null!==n&&tm(i,n,e)},{tag:ty.PASTE_TAG}),!0)},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_SPACE_COMMAND,e=>{let t=(0,ty.$getSelection)();return(0,ty.$isRangeSelection)(t)&&tH(t),!1},ty.COMMAND_PRIORITY_EDITOR),e.registerCommand(ty.KEY_TAB_COMMAND,e=>{let t=(0,ty.$getSelection)();return(0,ty.$isRangeSelection)(t)&&tH(t),!1},ty.COMMAND_PRIORITY_EDITOR))}(0,ty.defineExtension)({conflictsWith:["@lexical/plain-text"],dependencies:[tT],name:"@lexical/rich-text",nodes:()=>[tk,tP],register:tJ}),e.s(["$createHeadingNode",()=>tW,"$createQuoteNode",()=>tL,"$isHeadingNode",()=>tz,"$isQuoteNode",()=>tF,"HeadingNode",()=>tk,"QuoteNode",()=>tP,"eventFiles",()=>tU,"registerRichText",()=>tJ],20207);var tV="u">typeof window&&"u">typeof window.document&&"u">typeof window.document.createElement;function tX(e){let t=(0,r.c)(2),n=void 0===e?500:e,i=(0,o.useRef)(void 0),l;return t[0]!==n?(l=e=>new Promise(t=>{let r=()=>{e(),t()};"requestIdleCallback"in window?("cancelIdleCallback"in window&&void 0!==i.current&&cancelIdleCallback(i.current),i.current=requestIdleCallback(r,{timeout:n})):new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})}).then(r)}),t[0]=n,t[1]=l):l=t[1],l}var tq=class{_x;_y;constructor(e,t){this._x=e,this._y=t}calcDeltaXTo({x:e}){return this.x-e}calcDeltaYTo({y:e}){return this.y-e}calcDistanceTo(e){return Math.sqrt(Math.pow(this.calcDeltaXTo(e),2)+Math.pow(this.calcDeltaYTo(e),2))}calcHorizontalDistanceTo(e){return Math.abs(this.calcDeltaXTo(e))}calcVerticalDistance(e){return Math.abs(this.calcDeltaYTo(e))}equals({x:e,y:t}){return this.x===e&&this.y===t}get x(){return this._x}get y(){return this._y}};function tG(e){return e instanceof tq}var tQ=e=>{let t=document.getElementById("slash-menu");if(!t)return;let n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function tZ(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return n.top>i.top&&n.top<i.bottom}var t0=(0,a.createCommand)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function t1({anchorElementRef:e,close:t,editor:n,groups:i,menuRenderFn:r,resolution:l,shouldSplitNodeWithQuery:s=!1}){let[d,u]=(0,o.useState)(null),c=l.match&&l.match.matchingString||"",g=(0,o.useCallback)(e=>{let t=n.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant",`slash-menu-popup__item-${e.key}`),u(e.key))},[n]),f=(0,o.useCallback)(()=>{if(null!==i&&null!=c){let e=i.flatMap(e=>e.items);e.length&&g(e[0])}},[i,g,c]);(0,o.useEffect)(()=>{f()},[c,f]);let h=(0,o.useCallback)(e=>{t(),n.update(()=>{let e=null!=l.match&&s?function(e){let t,n=(0,a.$getSelection)();if(!(0,a.$isRangeSelection)(n)||!n.isCollapsed())return;let i=n.anchor;if("text"!==i.type)return;let r=i.getNode();if(!r.isSimpleText())return;let o=i.offset,l=r.getTextContent().slice(0,o),s=e.replaceableString.length,d=o-function(e,t,n){let i=n;for(let n=i;n<=t.length;n++)e.substring(e.length-n)===t.substring(0,n)&&(i=n);return i}(l,e.matchingString,s);if(!(d<0))return 0===d?[t]=r.splitText(o):[,t]=r.splitText(d,o),t}(l.match):null;e&&e.remove()}),setTimeout(()=>{let t;n.read(()=>{t=(0,a.$getSelection)()?.clone()}),n.update(()=>{t&&(0,a.$setSelection)(t)}),e.onSelect({editor:n,queryString:l.match?l.match.matchingString:""})},0)},[n,s,l.match,t]);return(0,o.useEffect)(()=>()=>{let e=n.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[n]),(0,o.useLayoutEffect)(()=>{null===i?u(null):null===d&&f()},[i,d,g,f]),(0,o.useEffect)(()=>(0,a.mergeRegister)(n.registerCommand(t0,({item:e})=>!!e.ref&&null!=e.ref.current&&(tQ(e.ref.current),!0),a.COMMAND_PRIORITY_LOW)),[n,g]),(0,o.useEffect)(()=>(0,a.mergeRegister)(n.registerCommand(a.KEY_ARROW_DOWN_COMMAND,e=>{if(null!==i&&i.length&&null!==d){let t=i.flatMap(e=>e.items),r=t.findIndex(e=>e.key===d),o=r!==t.length-1?r+1:0,l=t[o];if(!l)return!1;g(l),null!=l.ref&&l.ref.current&&n.dispatchCommand(t0,{index:o,item:l}),e.preventDefault(),e.stopImmediatePropagation()}return!0},a.COMMAND_PRIORITY_NORMAL),n.registerCommand(a.KEY_ARROW_UP_COMMAND,e=>{if(null!==i&&i.length&&null!==d){let t=i.flatMap(e=>e.items),n=t.findIndex(e=>e.key===d),r=0!==n?n-1:t.length-1,o=t[r];if(!o)return!1;g(o),null!=o.ref&&o.ref.current&&tQ(o.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0},a.COMMAND_PRIORITY_NORMAL),n.registerCommand(a.KEY_ESCAPE_COMMAND,e=>(e.preventDefault(),e.stopImmediatePropagation(),t(),!0),a.COMMAND_PRIORITY_LOW),n.registerCommand(a.KEY_TAB_COMMAND,e=>{if(null===i||null===d)return!1;let t=i.flatMap(e=>e.items).find(e=>e.key===d);return!!t&&(e.preventDefault(),e.stopImmediatePropagation(),h(t),!0)},a.COMMAND_PRIORITY_NORMAL),n.registerCommand(a.KEY_ENTER_COMMAND,e=>{if(null===i||null===d)return!1;let t=i.flatMap(e=>e.items).find(e=>e.key===d);return!!t&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(t),!0)},a.COMMAND_PRIORITY_NORMAL)),[h,t,n,i,d,g]),r(e,(0,o.useMemo)(()=>({groups:i,selectedItemKey:d,selectItemAndCleanUp:h,setSelectedItemKey:u}),[h,d,i]),l.match?l.match.matchingString:"")}function t3(e,t,n){let i=(0,a.getDOMSelection)(n);if(null===i||!i.isCollapsed)return!1;let r=i.anchorNode,o=i.anchorOffset;if(null==r||null==o)return!1;try{t.setStart(r,e),t.setEnd(r,o>1?o:1)}catch{return!1}return!0}function t2(e,t){return 0===t&&e.getEditorState().read(()=>{let e=(0,a.$getSelection)();if((0,a.$isRangeSelection)(e)){let t=e.anchor.getNode().getPreviousSibling();return(0,a.$isTextNode)(t)&&t.isTextEntity()}return!1})}function t5(e){o.startTransition?o.startTransition(e):e()}var t4=(0,a.createCommand)("ENABLE_SLASH_MENU_COMMAND");function t7({anchorClassName:e,anchorElem:t,groups:n,menuRenderFn:i,onClose:d,onOpen:u,onQueryChange:c,triggerFn:g}){let[f]=(0,s.useLexicalComposerContext)(),[h,m]=(0,o.useState)(null),p=function(e,t,n,i){let l,a=(0,r.c)(14),[d]=(0,s.useLexicalComposerContext)(),u;a[0]===Symbol.for("react.memo_cache_sentinel")?(u=tV?document.createElement("div"):null,a[0]=u):u=a[0];let c=(0,o.useRef)(u),g;a[1]!==e||a[2]!==i||a[3]!==d||a[4]!==t?(g=()=>{if(null===c.current||void 0===parent)return;let n=d.getRootElement(),r=c.current,o=r.firstChild;if(null!==n&&null!==t){let{height:l,width:s}=t.getRect(),{left:a,top:d}=t.getRect(),u=d;if(d-=e.getBoundingClientRect().top+window.scrollY,a-=e.getBoundingClientRect().left+window.scrollX,r.style.left=`${a+window.scrollX}px`,r.style.height=`${l}px`,r.style.width=`${s}px`,null!==o){let t=o.getBoundingClientRect(),i=t.height,s=t.width,c=n.getBoundingClientRect(),g="rtl"===document.dir||"rtl"===document.documentElement.dir,f=e.getBoundingClientRect(),h=Math.max(0,c.left);if(!g&&a+s>c.right)r.style.left=`${c.right-s+window.scrollX}px`;else if(g&&t.left<h){let e=h+s-f.left;r.style.left=`${e+window.scrollX}px`}u+i+32>window.innerHeight&&!(u<0)?r.style.top=`${d+32-i+window.scrollY-(l+24)}px`:r.style.top=`${d+window.scrollY+32}px`}r.isConnected||(null!=i&&(r.className=i),r.setAttribute("aria-label","Slash menu"),r.setAttribute("role","listbox"),r.style.display="block",r.style.position="absolute",e.append(r)),r.setAttribute("id","slash-menu"),c.current=r,n.setAttribute("aria-controls","slash-menu")}},a[1]=e,a[2]=i,a[3]=d,a[4]=t,a[5]=g):g=a[5];let f=g,h,m;return a[6]!==d||a[7]!==f||a[8]!==t?(h=()=>{let e=d.getRootElement();if(null!==t)return f(),()=>{null!==e&&e.removeAttribute("aria-controls");let t=c.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},m=[d,f,t],a[6]=d,a[7]=f,a[8]=t,a[9]=h,a[10]=m):(h=a[9],m=a[10]),(0,o.useEffect)(h,m),a[11]!==t||a[12]!==n?(l=e=>{null!==t&&(e||n(null))},a[11]=t,a[12]=n,a[13]=l):l=a[13],function(e,t,n,i){let l=(0,r.c)(7),[a]=(0,s.useLexicalComposerContext)(),d,u;l[0]!==a||l[1]!==n||l[2]!==i||l[3]!==e||l[4]!==t?(d=()=>{let r=t.current;if(null!=r&&null!=e){let e=a.getRootElement(),t=null!=e?function(e,t){let n=getComputedStyle(e),i="absolute"===n.position,r=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),!(i&&"static"===n.position)&&r.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e,!1):document.body,o=!1,l=tZ(r,t),s=function(){o||(window.requestAnimationFrame(function(){n(),o=!1}),o=!0);let e=tZ(r,t);e!==l&&(l=e,i?.(e))},d=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",s,{capture:!0,passive:!0}),d.observe(r),()=>{d.disconnect(),window.removeEventListener("resize",n),document.removeEventListener("scroll",s,!0)}}},u=[a,i,n,e,t],l[0]=a,l[1]=n,l[2]=i,l[3]=e,l[4]=t,l[5]=d,l[6]=u):(d=l[5],u=l[6]),(0,o.useEffect)(d,u)}(t,c,f,l),c}(t,h,m,e),N=(0,o.useCallback)(()=>{m(null),null!=d&&null!==h&&d()},[d,h]),C=(0,o.useCallback)(e=>{m(e),null!=u&&null===h&&u(e)},[u,h]);return(0,o.useEffect)(()=>(0,a.mergeRegister)(f.registerCommand(t4,({node:e})=>(f.getEditorState().read(()=>{let t={leadOffset:0,matchingString:"",replaceableString:""};if(!t2(f,t.leadOffset)&&null!==e){let e=f._window??window,n=e.document.createRange();null!==t3(t.leadOffset,n,e)&&t5(()=>C({getRect:()=>n.getBoundingClientRect(),match:t}));return}}),!0),a.COMMAND_PRIORITY_LOW)),[f,C]),(0,o.useEffect)(()=>{let e=f.registerUpdateListener(()=>{f.getEditorState().read(()=>{let e,t=f._window??window,n=t.document.createRange(),i=(0,a.$getSelection)(),r=(f.getEditorState().read(()=>{let t=(0,a.$getSelection)();(0,a.$isRangeSelection)(t)&&(e=function(e){let t=e.anchor;if("text"!==t.type)return null;let n=t.getNode();if(!n.isSimpleText())return null;let i=t.offset;return n.getTextContent().slice(0,i)}(t))}),e);if(!(0,a.$isRangeSelection)(i)||!i.isCollapsed()||void 0===r||null===n)return void N();let o=g({editor:f,query:r});(c(o?o.matchingString:null),null===o||t2(f,o.leadOffset)||null===t3(o.leadOffset,n,t))?N():t5(()=>C({getRect:()=>n.getBoundingClientRect(),match:o}))})});return()=>{e()}},[f,g,c,h,N,C]),null===p.current||null===h||null===f?null:(0,l.jsx)(t1,{anchorElementRef:p,close:N,editor:f,groups:n,menuRenderFn:i,resolution:h,shouldSplitNodeWithQuery:!0})}var t9=class e{_bottom;_left;_right;_top;constructor(e,t,n,i){let[r,o]=t<=i?[t,i]:[i,t],[l,s]=e<=n?[e,n]:[n,e];this._top=r,this._right=s,this._left=l,this._bottom=o}static fromDOM(t){let{height:n,left:i,top:r,width:o}=t.getBoundingClientRect();return e.fromLWTH(i,o,r,n)}static fromDOMRect(t){let{height:n,left:i,top:r,width:o}=t;return e.fromLWTH(i,o,r,n)}static fromLTRB(t,n,i,r){return new e(t,n,i,r)}static fromLWTH(t,n,i,r){return new e(t,i,t+n,i+r)}static fromPoints(t,n){let{x:i,y:r}=t,{x:o,y:l}=n;return e.fromLTRB(i,r,o,l)}contains(e){if(tG(e)){let{x:t,y:n}=e,i=n<this._top,r=n>this._bottom,o=t<this._left,l=t>this._right;return{reason:{isOnBottomSide:r,isOnLeftSide:o,isOnRightSide:l,isOnTopSide:i},result:!i&&!r&&!o&&!l}}let{bottom:t,left:n,right:i,top:r}=e;return r>=this._top&&r<=this._bottom&&t>=this._top&&t<=this._bottom&&n>=this._left&&n<=this._right&&i>=this._left&&i<=this._right}distanceFromPoint(e){let t=this.contains(e);if(t.result)return{distance:0,isOnBottomSide:t.reason.isOnBottomSide,isOnLeftSide:t.reason.isOnLeftSide,isOnRightSide:t.reason.isOnRightSide,isOnTopSide:t.reason.isOnTopSide};let n=0,i=0;return e.x<this._left?n=this._left-e.x:e.x>this._right&&(n=e.x-this._right),e.y<this._top?i=this._top-e.y:e.y>this._bottom&&(i=e.y-this._bottom),{distance:Math.sqrt(n*n+i*i),isOnBottomSide:e.y>this._bottom,isOnLeftSide:e.x<this._left,isOnRightSide:e.x>this._right,isOnTopSide:e.y<this._top}}equals({bottom:e,left:t,right:n,top:i}){return i===this._top&&e===this._bottom&&t===this._left&&n===this._right}generateNewRect({bottom:t=this.bottom,left:n=this.left,right:i=this.right,top:r=this.top}){return new e(n,r,i,t)}intersectsWith(e){let{height:t,left:n,top:i,width:r}=e,{height:o,left:l,top:s,width:a}=this;return(n+r>=l+a?n+r:l+a)-(n<=l?n:l)<=r+a&&(i+t>=s+o?i+t:s+o)-(i<=s?i:s)<=t+o}get bottom(){return this._bottom}get height(){return Math.abs(this._bottom-this._top)}get left(){return this._left}get right(){return this._right}get top(){return this._top}get width(){return Math.abs(this._left-this._right)}};function t6({editorConfig:e}){return function({nodes:e}){return e.map(e=>"node"in e?e.node:e)}({nodes:e.features.nodes})}function t8(e){return(t,n)=>tz(t)&&t.getTag()==="h"+e?"#".repeat(e)+" "+n(t):null}function ne(e,t){let n={};for(let i of e){let e=t(i);e&&(n[e]?n[e].push(i):n[e]=[i])}return n}function nt(e){let t=ne(e,e=>e.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}t8(1),t8(2),t8(3),t8(4),t8(5),t8(6);var nn=/[!-/:-@[-`{-~\s]/,ni=/^\s{0,3}$/;function nr(e){if(!(0,a.$isParagraphNode)(e))return!1;let t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&(0,a.$isTextNode)(t)&&ni.test(t.getTextContent())}function no(e,t,n,i,r){let o=[],l=e.getChildren();i||(i=[]),r||(r=[]);e:for(let e of l){for(let l of n){if(!l.export)continue;let s=l.export(e,e=>no(e,t,n,i,[...r,...i]),(e,n)=>nl(e,n,t,i,r));if(null!=s){o.push(s);continue e}}(0,a.$isLineBreakNode)(e)?o.push(`
`):(0,a.$isTextNode)(e)?o.push(nl(e,e.getTextContent(),t,i,r)):(0,a.$isElementNode)(e)?o.push(no(e,t,n,i,r)):(0,a.$isDecoratorNode)(e)&&o.push(e.getTextContent())}return o.join("")}function nl(e,t,n,i,r){let o=t.trim(),l=o;e.hasFormat("code")||(l=l.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",d="",u=ns(e,!0),c=ns(e,!1),g=new Set;for(let t of n){let n=t.format[0],r=t.tag;na(e,n)&&!g.has(n)&&(g.add(n),na(u,n)&&i.find(e=>e.tag===r)||(i.push({format:n,tag:r}),s+=r))}for(let t=0;t<i.length;t++){let n=i[t],o=na(e,n.format),l=na(c,n.format);if(o&&l)continue;let s=[...i];for(;s.length>t;){let e=s.pop();r&&e&&r.find(t=>t.tag===e.tag)||(e&&"string"==typeof e.tag&&(o?l||(d+=e.tag):a+=e.tag),i.pop())}break}return l=s+l+d,a+t.replace(o,()=>l)}function ns(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){let i=e.getParentOrThrow();i.isInline()&&(n=t?i.getPreviousSibling():i.getNextSibling())}for(;n;){if((0,a.$isElementNode)(n)){if(!n.isInline())break;let e=t?n.getLastDescendant():n.getFirstDescendant();if((0,a.$isTextNode)(e))return e;n=t?n.getPreviousSibling():n.getNextSibling()}if((0,a.$isTextNode)(n))return n;if(!(0,a.$isElementNode)(n))break}return null}function na(e,t){return(0,a.$isTextNode)(e)&&e.hasFormat(t)}function nd(e,t,n){let i=n.length;for(let r=t;r>=i;r--){let t=r-i;if(nu(e,t,n,0,i)&&" "!==e[t+i])return t}return -1}function nu(e,t,n,i,r){for(let o=0;o<r;o++)if(e[t+o]!==n[i+o])return!1;return!0}function nc(e,t=nv){let n=nt(t),i=ne(n.textFormat,({tag:e})=>e[e.length-1]),r=ne(n.textMatch,({trigger:e})=>e);for(let n of t){let t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){for(let t of n.dependencies)if(!e.hasNode(t))throw Error("MarkdownShortcuts: missing dependency %s for transformer. Ensure node dependency is included in editor initial config."+t.getType())}}return e.registerUpdateListener(({dirtyLeaves:t,editorState:o,prevEditorState:l,tags:s})=>{if(s.has("collaboration")||s.has("historic")||e.isComposing())return;let d=o.read(a.$getSelection),u=l.read(a.$getSelection);if(!(0,a.$isRangeSelection)(u)||!(0,a.$isRangeSelection)(d)||!d.isCollapsed()||d.is(u))return;let c=d.anchor.key,g=d.anchor.offset,f=o._nodeMap.get(c);(0,a.$isTextNode)(f)&&t.has(c)&&(1===g||!(g>u.anchor.offset+1))&&e.update(()=>{var e;if(f.hasFormat("code"))return;let t=f.getParent();null!==t&&(function(e,t,n,i){let r=e.getParent();if(!(0,a.$isRootOrShadowRoot)(r)||e.getFirstChild()!==t)return!1;let o=t.getTextContent();if(" "!==o[n-1])return!1;for(let{regExp:r,replace:l}of i){let i=o.match(r);if(i&&i[0].length===(i[0].endsWith(" ")?n:n-1)){let r=t.getNextSiblings(),[o,s]=t.splitText(n);if(o?.remove(),!1!==l(e,s?[s,...r]:r,i,!1))return!0}}return!1}(t,f,e=d.anchor.offset,n.element)||function(e,t,n,i){let r=e.getParent();if(!(0,a.$isRootOrShadowRoot)(r)||e.getFirstChild()!==t)return!1;let o=t.getTextContent();if(" "!==o[n-1])return!1;for(let{regExpEnd:r,regExpStart:l,replace:s}of i){if(r&&!("optional"in r)||r&&"optional"in r&&!r.optional)continue;let i=o.match(l);if(i&&i[0].length===(i[0].endsWith(" ")?n:n-1)){let r=t.getNextSiblings(),[o,l]=t.splitText(n);if(o?.remove(),!1!==s(e,l?[l,...r]:r,i,null,null,!1))return!0}}return!1}(t,f,e,n.multilineElement)||function(e,t,n){let i=e.getTextContent(),r=n[i[t-1]];if(null==r)return!1;for(let n of(t<i.length&&(i=i.slice(0,t)),r)){if(!n.replace||!n.regExp)continue;let t=i.match(n.regExp);if(null===t)continue;let r=t.index||0,o=r+t[0].length,l;return 0===r?[l]=e.splitText(o):[,l]=e.splitText(r,o),l&&(l.selectNext(0,0),n.replace(l,t)),!0}return!1}(f,e,r)||function(e,t,n){let i=e.getTextContent(),r=t-1,o=i[r],l=n[o];if(l)for(let t of l){let{tag:n}=t,l=n.length,s=r-l+1;if(l>1&&!nu(i,s,n,0,l)||" "===i[s-1])continue;let d=i[r+1];if(!1===t.intraword&&d&&!nn.test(d))continue;let u=e,c=nd(i,s,n),g=u;for(;c<0&&(g=g.getPreviousSibling())&&!(0,a.$isLineBreakNode)(g);)if((0,a.$isTextNode)(g)){let e=g.getTextContent();u=g,c=nd(e,e.length,n)}if(c<0||u===e&&c+l===s)continue;let f=u.getTextContent();if(c>0&&f[c-1]===o)continue;let h=f[c-1];if(!1===t.intraword&&h&&!nn.test(h))continue;let m=e.getTextContent(),p=m.slice(0,s)+m.slice(r+1);e.setTextContent(p);let N=u===e?p:f;u.setTextContent(N.slice(0,c)+N.slice(c+l));let C=(0,a.$getSelection)(),_=(0,a.$createRangeSelection)();(0,a.$setSelection)(_);let S=r-l*(u===e?2:1)+1;for(let n of(_.anchor.set(u.__key,c,"text"),_.focus.set(e.__key,S,"text"),t.format))_.hasFormat(n)||_.formatText(n);for(let e of(_.anchor.set(_.focus.key,_.focus.offset,_.focus.type),t.format))_.hasFormat(e)&&_.toggleFormat(e);return(0,a.$isRangeSelection)(C)&&(_.format=C.format),!0}}(f,e,i))})})}var ng=/^[\t ]*$/,nf=/^(\s*)(\d+)\.\s/,nh=/^(\s*)[-*+]\s/,nm=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,np=/^(#{1,6})\s/,nN=/^>\s/,nC=/^[ \t]*(\\`\\`\\`|```)(\w+)?/,n_=/[ \t]*(\\`\\`\\`|```)$/,nS=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,nE=/^\|(.+)\|\s?$/,nx=/^(\| ?:?-*:? ?)+\|\s?$/,nT=/^[ \t]*<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,ny=/^[ \t]*<\/[a-z_][\w-]*\s*>/i,nR=e=>(t,n,i)=>{var r;let o,l,s,a=t.getPreviousSibling(),d=t.getNextSibling(),u=e0("check"===e?"x"===i[3]:void 0);if(e6(d)&&d.getListType()===e){let e=d.getFirstChild();null!==e?e.insertBefore(u):d.append(u),t.remove()}else if(e6(a)&&a.getListType()===e)a.append(u),t.remove();else{let n=e9(e,"number"===e?Number(i[2]):void 0);n.append(u),t.replace(n)}u.append(...n),u.select(0,0);let c=(o=(r=i[1]).match(/\t/g),l=r.match(/ /g),s=0,o&&(s+=o.length),l&&(s+=Math.floor(l.length/4)),s);c&&u.setIndent(c)},nO=(e,t,n)=>{let i=[],r=e.getChildren(),o=0;for(let l of r)if(e1(l)){if(1===l.getChildrenSize()){let e=l.getFirstChild();if(e6(e)){i.push(nO(e,t,n+1));continue}}let r=" ".repeat(4*n),s=e.getListType(),a="number"===s?`${e.getStart()+o}. `:"check"===s?`- [${l.getChecked()?"x":" "}] `:"- ";i.push(r+a+t(l)),o++}return i.join(`
`)},nv=[{type:"element",dependencies:[tk],export:(e,t)=>{if(!tz(e))return null;let n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:np,replace:(i=e=>tW("h"+e[1].length),(e,t,n)=>{let r=i(n);r.append(...t),e.replace(r),r.select(0,0)})},{type:"element",dependencies:[tP],export:(e,t)=>{if(!tF(e))return null;let n=t(e).split(`
`),i=[];for(let e of n)i.push("> "+e);return i.join(`
`)},regExp:nN,replace:(e,t,n,i)=>{if(i){let n=e.getPreviousSibling();if(tF(n)){n.splice(n.getChildrenSize(),0,[(0,a.$createLineBreakNode)(),...t]),n.select(0,0),e.remove();return}}let r=tL();r.append(...t),e.replace(r),r.select(0,0)}},{type:"element",dependencies:[e3,eG],export:(e,t)=>e6(e)?nO(e,t,0):null,regExp:nh,replace:nR("bullet")},(nR("check"),{type:"element",dependencies:[e3,eG],export:(e,t)=>e6(e)?nO(e,t,0):null,regExp:nf,replace:nR("number")}),{type:"text-format",format:["code"],tag:"`"},{type:"text-format",format:["bold","italic"],tag:"***"},{type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},{type:"text-format",format:["bold"],tag:"**"},{type:"text-format",format:["bold"],intraword:!1,tag:"__"},{type:"text-format",format:["highlight"],tag:"=="},{type:"text-format",format:["italic"],tag:"*"},{type:"text-format",format:["italic"],intraword:!1,tag:"_"},{type:"text-format",format:["strikethrough"],tag:"~~"}];function n$(e,t=nv,n,i=!1,r=!0){let o=i?e:function(e,t){let n=e.split(`
`),i=!1,r=[],o=0;for(let e=0;e<n.length;e++){let l=n[e],s=r[r.length-1];if(nS.test(l)){r.push(l);continue}if(n_.test(l)){0===o&&(i=!0),1===o&&(i=!1),o>0&&o--,r.push(l);continue}if(nC.test(l)){i=!0,o++,r.push(l);continue}if(i){r.push(l);continue}ng.test(l)||ng.test(s)||!s||np.test(s)||np.test(l)||nN.test(l)||nf.test(l)||nh.test(l)||nm.test(l)||nE.test(l)||nx.test(l)||!t||nT.test(l)||ny.test(l)||nT.test(s)||ny.test(s)||n_.test(s)?r.push(l):r[r.length-1]=s+" "+l.trim()}return r.join(`
`)}(e,r);return(function(e,t=!1){let n=nt(e),i=function(e){let t={},n={},i=[];for(let r of e){let{tag:e}=r;t[e]=r;let o=e.replace(/([*^+])/g,"\\$1");i.push(o),1===e.length?n[e]=RegExp(`(?<![\\\\${o}])(${o})((\\\\${o})?.*?[^${o}\\s](\\\\${o})?)((?<!\\\\)|(?<=\\\\\\\\))(${o})(?![\\\\${o}])`):n[e]=RegExp(`(?<!\\\\)(${o})((\\\\${o})?.*?[^\\s](\\\\${o})?)((?<!\\\\)|(?<=\\\\\\\\))(${o})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(?<![\\\\])(${i.join("|")})`,"g"),transformersByTag:t}}(n.textFormat);return(e,r)=>{let o=e.split(`
`),l=o.length,s=r||(0,a.$getRoot)();s.clear();for(let e=0;e<l;e++){let t=o[e],[r,l]=function(e,t,n,i){for(let r of n){let{handleImportAfterStartMatch:n,regExpEnd:o,regExpStart:l,replace:s}=r,a=e[t]?.match(l);if(!a)continue;if(n){let o=n({lines:e,rootNode:i,startLineIndex:t,startMatch:a,transformer:r});if(null===o)continue;if(o)return o}let d="object"==typeof o&&"regExp"in o?o.regExp:o,u=o&&"object"==typeof o&&"optional"in o?o.optional:!o,c=t,g=e.length;for(;c<g;){let n=d?e[c]?.match(d):null;if(!n&&(!u||u&&c<g-1)||n&&t===c&&n.index===a.index){c++;continue}let r=[];if(n&&t===c)r.push(e[t].slice(a[0].length,-n[0].length));else for(let i=t;i<=c;i++){let o=e[i];if(i===t){let e=o.slice(a[0].length);r.push(e)}else if(i===c&&n){let e=o.slice(0,-n[0].length);r.push(e)}else r.push(o)}if(!1!==s(i,null,a,n,r,!0))return[!0,c];break}}return[!1,t]}(o,e,n.multilineElement,s);if(r){e=l;continue}!function(e,t,n,i,r){let o=(0,a.$createTextNode)(e),l=(0,a.$createParagraphNode)();for(let{regExp:i,replace:r}of(l.append(o),t.append(l),n)){let t=e.match(i);if(t&&(o.setTextContent(e.slice(t[0].length)),!1!==r(l,[o],t,!0)))break}if(function e(t,n,i){let r=function(e,t){let n=function(e,t){let n=e.match(t.openTagsRegExp);if(null==n)return null;for(let i of n){let n=i.replace(/^\s/,""),r=t.fullMatchRegExpByTag[n];if(null==r)continue;let o=e.match(r),l=t.transformersByTag[n];if(null!=o&&null!=l){if(!1!==l.intraword)return o;let{index:t=0}=o,n=e[t-1],i=e[t+o[0].length];if((!n||nn.test(n))&&(!i||nn.test(i)))return o}}return null}(e.getTextContent(),t);if(!n)return null;let i=n.index||0,r=i+n[0].length,o=t.transformersByTag[n[1]];return{endIndex:r,match:n,startIndex:i,transformer:o}}(t,n),o=function(e,t){let n,i,r,o;for(let l of t){if(!l.replace||!l.importRegExp)continue;let t=e.getTextContent().match(l.importRegExp);if(!t)continue;let s=t.index||0,a=l.getEndIndex?l.getEndIndex(e,t):s+t[0].length;!1!==a&&(void 0===n||void 0===i||s<n&&a>i)&&(n=s,i=a,r=l,o=t)}return void 0===n||void 0===i||void 0===r||void 0===o?null:{endIndex:i,match:o,startIndex:n,transformer:r}}(t,i);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex?o=null:r=null),r){let o=function(e,t,n,i,r){let o=e.getTextContent(),l,s,a;if(r[0]===o?a=e:0===t?[a,l]=e.splitText(n):[s,a,l]=e.splitText(t,n),a.setTextContent(r[2]),i)for(let e of i.format)a.hasFormat(e)||a.toggleFormat(e);return{nodeAfter:l,nodeBefore:s,transformedNode:a}}(t,r.startIndex,r.endIndex,r.transformer,r.match);o.nodeAfter&&(0,a.$isTextNode)(o.nodeAfter)&&!o.nodeAfter.hasFormat("code")&&e(o.nodeAfter,n,i),o.nodeBefore&&(0,a.$isTextNode)(o.nodeBefore)&&!o.nodeBefore.hasFormat("code")&&e(o.nodeBefore,n,i),o.transformedNode&&(0,a.$isTextNode)(o.transformedNode)&&!o.transformedNode.hasFormat("code")&&e(o.transformedNode,n,i)}else if(o){var l,s,d,u;let r,c,g,f=(l=o.startIndex,s=o.endIndex,d=o.transformer,u=o.match,(0===l?[g,r]=t.splitText(s):[c,g,r]=t.splitText(l,s),d.replace)?{nodeAfter:r,nodeBefore:c,transformedNode:(g?d.replace(g,u):void 0)||void 0}:null);if(!f)return;f.nodeAfter&&(0,a.$isTextNode)(f.nodeAfter)&&!f.nodeAfter.hasFormat("code")&&e(f.nodeAfter,n,i),f.nodeBefore&&(0,a.$isTextNode)(f.nodeBefore)&&!f.nodeBefore.hasFormat("code")&&e(f.nodeBefore,n,i),f.transformedNode&&(0,a.$isTextNode)(f.transformedNode)&&!f.transformedNode.hasFormat("code")&&e(f.transformedNode,n,i)}let c=t.getTextContent().replace(/\\([*_`~])/g,"$1");t.setTextContent(c)}(o,i,r),l.isAttached()&&e.length>0){let e=l.getPreviousSibling();if((0,a.$isParagraphNode)(e)||tF(e)||e6(e)){let t=e;if(e6(e)){let n=e.getLastDescendant();t=null==n?null:(0,a.$findMatchingParent)(n,e1)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[(0,a.$createLineBreakNode)(),...l.getChildren()]),l.remove())}}}(t,s,n.element,i,n.textMatch)}for(let e of s.getChildren())!t&&nr(e)&&s.getChildrenSize()>1&&e.remove();null!==(0,a.$getSelection)()&&s.selectStart()}})(t,i)(o,n)}function nM(e=nv,t,n=!1){return(function(e,t=!1){let n=nt(e),i=[...n.multilineElement,...n.element],r=!t,o=n.textFormat.filter(e=>1===e.format.length).sort((e,t)=>e.format.includes("code")&&!t.format.includes("code")?1:!e.format.includes("code")&&t.format.includes("code")?-1:0);return e=>{let t=[],l=(e||(0,a.$getRoot)()).getChildren();return l.forEach((e,s)=>{let d=function(e,t,n,i){for(let r of t){if(!r.export)continue;let t=r.export(e,e=>no(e,n,i));if(null!=t)return t}return(0,a.$isElementNode)(e)?no(e,n,i):(0,a.$isDecoratorNode)(e)?e.getTextContent():null}(e,i,o,n.textMatch);null!=d&&t.push(r&&s>0&&!nr(e)&&!nr(l[s-1])?`
`.concat(d):d)}),t.join(`
`)}})(e,n)(t)}e.s(["a",()=>nc,"b",()=>n$,"c",()=>nM,"d",()=>tV,"e",()=>tX,"f",()=>tq,"g",()=>tG,"h",()=>"\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;","i",()=>t4,"j",()=>t7,"k",()=>t9,"l",()=>t6],178249)}]);
//# debugId=32675c1d-eaaa-477c-325e-0ac8019fdfa6