403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/lexical/prod/dist/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/lexical/prod/dist/lexical.prod.bundle.min.js
this.BX=this.BX||{},this.BX.UI=this.BX.UI||{},function(exports){"use strict";const CAN_USE_DOM="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,documentMode=CAN_USE_DOM&&"documentMode"in document?document.documentMode:null,IS_CHROME=(CAN_USE_DOM&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),CAN_USE_DOM&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!CAN_USE_DOM||!("InputEvent"in window)||documentMode)&&new window.InputEvent("input"),CAN_USE_DOM&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),CAN_USE_DOM&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,CAN_USE_DOM&&/Android/.test(navigator.userAgent),CAN_USE_DOM&&/^(?=.*Chrome).*/i.test(navigator.userAgent));CAN_USE_DOM&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent),Object.freeze({});const e={},r={},i={},s={},o={},l={},c={},a={},u={},f={},d={},h={},g={},_={},p={},y={},m={},x={},v={},S={},T={},C={},k={},b={},w={},N={},D={},O={},I={},A={},M={},W={},z={},J={},U={},V={},j="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,H=j&&"documentMode"in document?document.documentMode:null,q=j&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Q=j&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),X=!(!j||!("InputEvent"in window)||H)&&"getTargetRanges"in new window.InputEvent("input"),Y=j&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Z=j&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,G=j&&/Android/.test(navigator.userAgent),tt=j&&/^(?=.*Chrome).*/i.test(navigator.userAgent),et=j&&G&&tt,nt=j&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!tt,wt=Y||Z||nt?" ":"​",Nt="\n\n",Et=Q?" ":wt,Pt="֑-߿יִ-﷽ﹰ-ﻼ",Ft="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Dt=new RegExp("^[^"+Ft+"]*["+Pt+"]"),Lt=new RegExp("^[^"+Pt+"]*["+Ft+"]"),Ot={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},It={directionless:1,unmergeable:2},At={center:2,end:6,justify:4,left:1,right:3,start:5},Mt={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Wt={normal:0,segmented:2,token:1},zt={0:"normal",2:"segmented",1:"token"};var Rt=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function Kt(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}let Jt=!1,Ut=0;function Vt(t){Ut=t.timeStamp}function jt(t,e,n){return e.__lexicalLineBreak===t||void 0!==t["__lexicalKey_"+n._key]}function Ht(t,e,n){const r=yn(n._window);let i=null,s=null;null!==r&&r.anchorNode===t&&(i=r.anchorOffset,s=r.focusOffset);const o=t.nodeValue;null!==o&&Me(e,o,i,s,!1)}function qt(t,e,n){if(yi(t)){const e=t.anchor.getNode();if(e.is(n)&&t.format!==e.getFormat())return!1}return 3===e.nodeType&&n.isAttached()}function Qt(t,e,n){Jt=!0;const r=performance.now()-Ut>100;try{hs(t,()=>{const i=Oi()||function(t){return t.getEditorState().read(()=>{const t=Oi();return null!==t?t.clone():null})}(t),s=new Map,o=t.getRootElement(),l=t._editorState,c=t._blockCursorElement;let a=!1,u="";for(let n=0;n<e.length;n++){const f=e[n],d=f.type,h=f.target;let g=Ce(h,l);if(!(null===g&&h!==o||ms(g)))if("characterData"===d)r&&oi(g)&&qt(i,h,g)&&Ht(h,g,t);else if("childList"===d){a=!0;const e=f.addedNodes;for(let n=0;n<e.length;n++){const r=e[n],i=Te(r),s=r.parentNode;if(null!=s&&r!==c&&null===i&&("BR"!==r.nodeName||!jt(r,s,t))){if(Q){const t=r.innerText||r.nodeValue;t&&(u+=t)}s.removeChild(r)}}const n=f.removedNodes,r=n.length;if(r>0){let e=0;for(let i=0;i<r;i++){const r=n[i];("BR"===r.nodeName&&jt(r,h,t)||c===r)&&(h.appendChild(r),e++)}r!==e&&(h===o&&(g=Ne(l)),s.set(h,g))}}}if(s.size>0)for(const[e,n]of s)if(_s(n)){const r=n.getChildrenKeys();let i=e.firstChild;for(let n=0;n<r.length;n++){const s=r[n],o=t.getElementByKey(s);null!==o&&(null==i?(e.appendChild(o),i=o):i!==o&&e.replaceChild(o,i),i=i.nextSibling)}}else oi(n)&&n.markDirty();const f=n.takeRecords();if(f.length>0){for(let e=0;e<f.length;e++){const n=f[e],r=n.addedNodes,i=n.target;for(let e=0;e<r.length;e++){const n=r[e],s=n.parentNode;null==s||"BR"!==n.nodeName||jt(n,i,t)||s.removeChild(n)}}n.takeRecords()}null!==i&&(a&&(i.dirty=!0,Ee(i)),Q&&Ye(t)&&i.insertRawText(u))})}finally{Jt=!1}}function Xt(t){const e=t._observer;null!==e&&Qt(t,e.takeRecords(),e)}function Yt(t){!function(t){0===Ut&&on(t).addEventListener("textInput",Vt,!0)}(t),t._observer=new MutationObserver((e,n)=>{Qt(t,e,n)})}function Zt(t,e){const n=t.__mode,r=t.__format,i=t.__style,s=e.__mode,o=e.__format,l=e.__style;return!(null!==n&&n!==s||null!==r&&r!==o||null!==i&&i!==l)}function Gt(t,e){const n=t.mergeWithSibling(e),r=ts()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function te(t){let e,n,r=t;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(e=r.getPreviousSibling())&&oi(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(""!==e.__text){if(Zt(e,r)){r=Gt(e,r);break}break}e.remove()}for(;null!==(n=r.getNextSibling())&&oi(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Zt(r,n)){r=Gt(r,n);break}break}n.remove()}}else r.remove()}function ee(t){return ne(t.anchor),ne(t.focus),t}function ne(t){for(;"element"===t.type;){const e=t.getNode(),n=t.offset;let r,i;if(n===e.getChildrenSize()?(r=e.getChildAtIndex(n-1),i=!0):(r=e.getChildAtIndex(n),i=!1),oi(r)){t.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!_s(r))break;t.set(r.__key,i?r.getChildrenSize():0,"element")}}let re=1;const se="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)};function oe(t){const e=document.activeElement;if(null===e)return!1;const n=e.nodeName;return ms(Ce(t))&&("INPUT"===n||"TEXTAREA"===n||"true"===e.contentEditable&&null==ue(e))}function le(t,e,n){const r=t.getRootElement();try{return null!==r&&r.contains(e)&&r.contains(n)&&null!==e&&!oe(e)&&ae(e)===t}catch(t){return!1}}function ce(t){return t instanceof Ms}function ae(t){let e=t;for(;null!=e;){const t=ue(e);if(ce(t))return t;e=en(e)}return null}function ue(t){return t?t.__lexicalEditor:null}function fe(t){return t.isToken()||t.isSegmented()}function de(t){return 3===t.nodeType}function he(t){let e=t;for(;null!=e;){if(de(e))return e;e=e.firstChild}return null}function ge(t,e,n){const r=Ot[e];if(null!==n&&(t&r)==(n&r))return t;let i=t^r;return"subscript"===e?i&=~Ot.superscript:"superscript"===e&&(i&=~Ot.subscript),i}function pe(t,e){if(null!=e)return void(t.__key=e);Yi(),Zi();const n=ts(),r=Gi(),i=""+re++;r._nodeMap.set(i,t),_s(t)?n._dirtyElements.set(i,!0):n._dirtyLeaves.add(i),n._cloneNotNeeded.add(i),n._dirtyType=1,t.__key=i}function ye(t){const e=t.getParent();if(null!==e){const n=t.getWritable(),r=e.getWritable(),i=t.getPreviousSibling(),s=t.getNextSibling();if(null===i)if(null!==s){const t=s.getWritable();r.__first=s.__key,t.__prev=null}else r.__first=null;else{const t=i.getWritable();if(null!==s){const e=s.getWritable();e.__prev=t.__key,t.__next=e.__key}else t.__next=null;n.__prev=null}if(null===s)if(null!==i){const t=i.getWritable();r.__last=i.__key,t.__next=null}else r.__last=null;else{const t=s.getWritable();if(null!==i){const e=i.getWritable();e.__next=t.__key,t.__prev=e.__key}else t.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function me(t){Zi();const e=t.getLatest(),n=e.__parent,r=Gi(),i=ts(),s=r._nodeMap,o=i._dirtyElements;null!==n&&function(t,e,n){let r=t;for(;null!==r;){if(n.has(r))return;const t=e.get(r);if(void 0===t)break;n.set(r,!1),r=t.__parent}}(n,s,o);const l=e.__key;i._dirtyType=1,_s(t)?o.set(l,!0):i._dirtyLeaves.add(l)}function xe(t){Yi();const e=ts(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,null!==n){const t=Se(n);null!==t&&t.getWritable()}if(null!==t){const e=Se(t);null!==e&&e.getWritable()}}}function ve(){return Xi()?null:ts()._compositionKey}function Se(t,e){const n=(e||Gi())._nodeMap.get(t);return void 0===n?null:n}function Te(t,e){const n=t["__lexicalKey_"+ts()._key];return void 0!==n?Se(n,e):null}function Ce(t,e){let n=t;for(;null!=n;){const t=Te(n,e);if(null!==t)return t;n=en(n)}return null}function ke(t){const e=t._decorators,n=Object.assign({},e);return t._pendingDecorators=n,n}function be(t){return t.read(()=>we().getTextContent())}function we(){return Ne(Gi())}function Ne(t){return t._nodeMap.get("root")}function Ee(t){Yi();const e=Gi();null!==t&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function Pe(t){const e=ts(),n=function(t,e){let n=t;for(;null!=n;){const t=n["__lexicalKey_"+e._key];if(void 0!==t)return t;n=en(n)}return null}(t,e);return null===n?t===e.getRootElement()?Se("root"):null:Se(n)}function Fe(t,e){return e?t.getTextContentSize():0}function De(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function Le(t){const e=[];let n=t;for(;null!==n;)e.push(n),n=n._parentEditor;return e}function Oe(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ie(t){return 3===t.nodeType?t.nodeValue:null}function Ae(t,e,n){const r=yn(e._window);if(null===r)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(null!==i){let e=Ie(i);const r=Ce(i);if(null!==e&&oi(r)){if(e===wt&&n){const t=n.length;e=n,s=t,o=t}null!==e&&Me(r,e,s,o,t)}}}function Me(t,e,n,r,i){let s=t;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let l=e;(o||i)&&e[e.length-1]===wt&&(l=e.slice(0,-1));const c=s.getTextContent();if(i||l!==c){if(""===l){if(xe(null),Y||Z||nt)s.remove();else{const t=ts();setTimeout(()=>{t.update(()=>{s.isAttached()&&s.remove()})},20)}return}const e=s.getParent(),i=Ii(),c=s.getTextContentSize(),a=ve(),u=s.getKey();if(s.isToken()||null!==a&&u===a&&!o||yi(i)&&(null!==e&&!e.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===t.__key&&0===i.anchor.offset&&!s.canInsertTextBefore()&&!o||i.focus.key===t.__key&&i.focus.offset===c&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const f=Oi();if(!yi(f)||null===n||null===r)return void s.setTextContent(l);if(f.setTextNodeRange(s,n,s,r),s.isSegmented()){const t=si(s.getTextContent());s.replace(t),s=t}s.setTextContent(l)}}}function ze(t){return"ArrowLeft"===t}function Be(t){return"ArrowRight"===t}function Re(t,e){return q?t:e}function Ke(t){return"Enter"===t}function $e(t){return"Backspace"===t}function Je(t){return"Delete"===t}function Ue(t,e,n){return"a"===t.toLowerCase()&&Re(e,n)}function je(t,e){void 0===t.__lexicalClassNameCache&&(t.__lexicalClassNameCache={});const n=t.__lexicalClassNameCache,r=n[e];if(void 0!==r)return r;const i=t[e];if("string"==typeof i){const t=Kt(i);return n[e]=t,t}return i}function He(t,e,n,r,i){if(0===n.size)return;const s=r.__type,o=r.__key,l=e.get(s);void 0===l&&Rt(33,s);const c=l.klass;let a=t.get(c);void 0===a&&(a=new Map,t.set(c,a));const u=a.get(o),f="destroyed"===u&&"created"===i;(void 0===u||f)&&a.set(o,f?"updated":i)}function Qe(t,e,n){const r=t.getParent();let i=n,s=t;return null!==r&&(e&&0===n?(i=s.getIndexWithinParent(),s=r):e||n!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function Xe(t,e){const n=t.offset;if("element"===t.type)return Qe(t.getNode(),e,n);{const r=t.getNode();if(e&&0===n||!e&&n===r.getTextContentSize()){const t=e?r.getPreviousSibling():r.getNextSibling();return null===t?Qe(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):t}}return null}function Ye(t){const e=on(t).event,n=e&&e.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Ze(t,e,n){return function us(t,e,n){if(!1===t._updating||Vi!==t){let r=!1;return t.update(()=>{r=us(t,e,n)}),r}const r=Le(t);for(let i=4;i>=0;i--)for(let s=0;s<r.length;s++){const o=r[s]._commands.get(e);if(void 0!==o){const e=o[i];if(void 0!==e){const r=Array.from(e),i=r.length;for(let e=0;e<i;e++)if(!0===r[e](n,t))return!0}}}return!1}(t,e,n)}function Ge(t){return!vs(t)&&!t.isLastChild()&&!t.isInline()}function tn(t,e){const n=t._keyToDOMMap.get(e);return void 0===n&&Rt(75,e),n}function en(t){const e=t.assignedSlot||t.parentElement;return null!==e&&11===e.nodeType?e.host:e}function sn(t,e){let n=t.getParent();for(;null!==n;){if(n.is(e))return!0;n=n.getParent()}return!1}function on(t){const e=t._window;return null===e&&Rt(78),e}function cn(t){let e=t.getParentOrThrow();for(;null!==e;){if(an(e))return e;e=e.getParentOrThrow()}return e}function an(t){return vs(t)||_s(t)&&t.isShadowRoot()}function un(t){const e=t.constructor.clone(t);return pe(e,null),e}function fn(t){const e=ts(),n=t.constructor.getType(),r=e._nodes.get(n);void 0===r&&Rt(97);const i=r.replace;if(null!==i){const e=i(t);return e instanceof t.constructor||Rt(98),e}return t}function dn(t,e){!vs(t.getParent())||_s(e)||ms(e)||Rt(99)}function gn(t){return(ms(t)||_s(t)&&!t.canBeEmpty())&&!t.isInline()}function _n(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=t.parentElement;null!==r&&r.removeChild(t)}function yn(t){return j?(t||window).getSelection():null}function vn(t){return 1===t.nodeType}function Sn(t){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==t.nodeName.match(e)}function Tn(t){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==t.nodeName.match(e)}function Cn(t){if(vs(t)||ms(t)&&!t.isInline())return!0;if(!_s(t)||an(t))return!1;const e=t.getFirstChild(),n=null===e||$r(e)||oi(e)||e.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&n}function kn(t,e){let n=t;for(;null!==n&&null!==n.getParent()&&!e(n);)n=n.getParentOrThrow();return e(n)?n:null}const wn=new WeakMap,Nn=new Map;function En(t){if(!t._readOnly&&t.isEmpty())return Nn;t._readOnly||Rt(192);let e=wn.get(t);if(!e){e=new Map,wn.set(t,e);for(const[n,r]of t._nodeMap){const t=r.__type;let i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)}}return e}function Pn(t){const e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function Fn(t,e,n,r,i,s){let o=t.getFirstChild();for(;null!==o;){const t=o.__key;o.__parent===e&&(_s(o)&&Fn(o,t,n,r,i,s),n.has(t)||s.delete(t),i.push(t)),o=o.getNextSibling()}}let Dn,Ln,On,In,An,Mn,Wn,zn,Bn,Rn,Kn="",$n="",Jn=null,Un="",Vn="",jn=!1,Hn=!1,qn=null;function Qn(t,e){const n=Wn.get(t);if(null!==e){const n=dr(t);n.parentNode===e&&e.removeChild(n)}if(zn.has(t)||Ln._keyToDOMMap.delete(t),_s(n)){const t=lr(n,Wn);Xn(t,0,t.length-1,null)}void 0!==n&&He(Rn,On,In,n,"destroyed")}function Xn(t,e,n,r){let i=e;for(;i<=n;++i){const e=t[i];void 0!==e&&Qn(e,r)}}function Yn(t,e){t.setProperty("text-align",e)}function Gn(t,e){const n=Dn.theme.indent;if("string"==typeof n){const r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}const r=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||"40px";t.style.setProperty("padding-inline-start",0===e?"":`calc(${e} * ${r})`)}function tr(t,e){const n=t.style;0===e?Yn(n,""):1===e?Yn(n,"left"):2===e?Yn(n,"center"):3===e?Yn(n,"right"):4===e?Yn(n,"justify"):5===e?Yn(n,"start"):6===e&&Yn(n,"end")}function er(t,e,n){const r=zn.get(t);void 0===r&&Rt(60);const i=r.createDOM(Dn,Ln);if(function(t,e,n){const r=n._keyToDOMMap;e["__lexicalKey_"+n._key]=t,r.set(t,e)}(t,i,Ln),oi(r)?i.setAttribute("data-lexical-text","true"):ms(r)&&i.setAttribute("data-lexical-decorator","true"),_s(r)){const t=r.__indent,e=r.__size;if(0!==t&&Gn(i,t),0!==e){const t=e-1;!function(t,e,n,r){const i=$n;$n="",nr(t,n,0,e,r,null),sr(n,r),$n=i}(lr(r,zn),t,r,i)}const n=r.__format;0!==n&&tr(i,n),r.isInline()||ir(null,r,i),Ge(r)&&(Kn+=Nt,Vn+=Nt)}else{const e=r.getTextContent();if(ms(r)){const e=r.decorate(Ln,Dn);null!==e&&ar(t,e),i.contentEditable="false"}else oi(r)&&(r.isDirectionless()||($n+=e));Kn+=e,Vn+=e}if(null!==e)if(null!=n)e.insertBefore(i,n);else{const t=e.__lexicalLineBreak;null!=t?e.insertBefore(i,t):e.appendChild(i)}return He(Rn,On,In,r,"created"),i}function nr(t,e,n,r,i,s){const o=Kn;Kn="";let l=n;for(;l<=r;++l){er(t[l],i,s);const e=zn.get(t[l]);null!==e&&oi(e)&&(null===Jn&&(Jn=e.getFormat()),""===Un&&(Un=e.getStyle()))}Ge(e)&&(Kn+=Nt),i.__lexicalTextContent=Kn,Kn=o+Kn}function rr(t,e){const n=e.get(t);return $r(n)||ms(n)&&n.isInline()}function ir(t,e,n){const r=null!==t&&(0===t.__size||rr(t.__last,Wn)),i=0===e.__size||rr(e.__last,zn);if(r){if(!i){const t=n.__lexicalLineBreak;if(null!=t)try{n.removeChild(t)}catch(e){if("object"==typeof e&&null!=e){const r=`${e.toString()} Parent: ${n.tagName}, child: ${t.tagName}.`;throw new Error(r)}throw e}n.__lexicalLineBreak=null}}else if(i){const t=document.createElement("br");n.__lexicalLineBreak=t,n.appendChild(t)}}function sr(t,e){const n=e.__lexicalDirTextContent,r=e.__lexicalDir;if(n!==$n||r!==qn){const n=""===$n,s=n?qn:(i=$n,Dt.test(i)?"rtl":Lt.test(i)?"ltr":null);if(s!==r){const i=e.classList,o=Dn.theme;let l=null!==r?o[r]:void 0,c=null!==s?o[s]:void 0;if(void 0!==l){if("string"==typeof l){const t=Kt(l);l=o[r]=t}i.remove(...l)}if(null===s||n&&"ltr"===s)e.removeAttribute("dir");else{if(void 0!==c){if("string"==typeof c){const t=Kt(c);c=o[s]=t}void 0!==c&&i.add(...c)}e.dir=s}Hn||(t.getWritable().__dir=s)}qn=s,e.__lexicalDirTextContent=$n,e.__lexicalDir=s}var i}function lr(t,e){const n=[];let r=t.__first;for(;null!==r;){const t=e.get(r);void 0===t&&Rt(101),n.push(r),r=t.__next}return n}function cr(t,e){const n=Wn.get(t);let r=zn.get(t);void 0!==n&&void 0!==r||Rt(61);const i=jn||Mn.has(t)||An.has(t),s=tn(Ln,t);if(n===r&&!i){if(_s(n)){const t=s.__lexicalTextContent;void 0!==t&&(Kn+=t,Vn+=t);const e=s.__lexicalDirTextContent;void 0!==e&&($n+=e)}else{const t=n.getTextContent();oi(n)&&!n.isDirectionless()&&($n+=t),Vn+=t,Kn+=t}return s}if(n!==r&&i&&He(Rn,On,In,r,"updated"),r.updateDOM(n,s,Dn)){const n=er(t,null,null);return null===e&&Rt(62),e.replaceChild(n,s),Qn(t,null),n}if(_s(n)&&_s(r)){const t=r.__indent;t!==n.__indent&&Gn(s,t);const e=r.__format;e!==n.__format&&tr(s,e),i&&(function(t,e,n){const r=$n;var i;$n="",Jn=null,Un="",function(t,e,n){const r=Kn,i=t.__size,s=e.__size;if(Kn="",1===i&&1===s){const r=t.__first,i=e.__first;if(r===i)cr(r,n);else{const t=dr(r),e=er(i,null,null);try{n.replaceChild(e,t)}catch(s){if("object"==typeof s&&null!=s){const o=`${s.toString()} Parent: ${n.tagName}, new child: {tag: ${e.tagName} key: ${i}}, old child: {tag: ${t.tagName}, key: ${r}}.`;throw new Error(o)}throw s}Qn(r,null)}const s=zn.get(i);oi(s)&&(null===Jn&&(Jn=s.getFormat()),""===Un&&(Un=s.getStyle()))}else{const r=lr(t,Wn),o=lr(e,zn);if(0===i)0!==s&&nr(o,e,0,s-1,n,null);else if(0===s){if(0!==i){const t=null==n.__lexicalLineBreak;Xn(r,0,i-1,t?null:n),t&&(n.textContent="")}}else!function(t,e,n,r,i,s){const o=r-1,l=i-1;let c,a,u=s.firstChild,f=0,d=0;for(;f<=o&&d<=l;){const t=e[f],r=n[d];if(t===r)u=ur(cr(r,s)),f++,d++;else{void 0===c&&(c=new Set(e)),void 0===a&&(a=new Set(n));const i=a.has(t),o=c.has(r);if(i)if(o){const t=tn(Ln,r);t===u?u=ur(cr(r,s)):(null!=u?s.insertBefore(t,u):s.appendChild(t),cr(r,s)),f++,d++}else er(r,s,u),d++;else u=ur(dr(t)),Qn(t,s),f++}const i=zn.get(r);null!==i&&oi(i)&&(null===Jn&&(Jn=i.getFormat()),""===Un&&(Un=i.getStyle()))}const g=f>o,_=d>l;if(g&&!_){const e=n[l+1];nr(n,t,d,l,s,void 0===e?null:Ln.getElementByKey(e))}else _&&!g&&Xn(e,f,o,s)}(e,r,o,i,s,n)}Ge(e)&&(Kn+=Nt),n.__lexicalTextContent=Kn,Kn=r+Kn}(t,e,n),sr(e,n),Es(i=e)&&null!=Jn&&Jn!==i.__textFormat&&!Hn&&(i.setTextFormat(Jn),i.setTextStyle(Un)),function(t){Es(t)&&""!==Un&&Un!==t.__textStyle&&!Hn&&t.setTextStyle(Un)}(e),$n=r}(n,r,s),vs(r)||r.isInline()||ir(n,r,s)),Ge(r)&&(Kn+=Nt,Vn+=Nt)}else{const e=r.getTextContent();if(ms(r)){const e=r.decorate(Ln,Dn);null!==e&&ar(t,e)}else oi(r)&&!r.isDirectionless()&&($n+=e);Kn+=e,Vn+=e}if(!Hn&&vs(r)&&r.__cachedText!==Vn){const t=r.getWritable();t.__cachedText=Vn,r=t}return s}function ar(t,e){let n=Ln._pendingDecorators;const r=Ln._decorators;if(null===n){if(r[t]===e)return;n=ke(Ln)}n[t]=e}function ur(t){let e=t.nextSibling;return null!==e&&e===Ln._blockCursorElement&&(e=e.nextSibling),e}function dr(t){const e=Bn.get(t);return void 0===e&&Rt(75,t),e}const hr=Object.freeze({}),_r=[["keydown",function(t,e){if(pr=t.timeStamp,yr=t.key,e.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:l,altKey:c}=t;Ze(e,_,t)||null!=n&&(!function(t,e,n,r){return Be(t)&&!e&&!r&&!n}(n,o,c,l)?!function(t,e,n,r,i){return Be(t)&&!r&&!n&&(e||i)}(n,o,r,c,l)?!function(t,e,n,r){return ze(t)&&!e&&!r&&!n}(n,o,c,l)?!function(t,e,n,r,i){return ze(t)&&!r&&!n&&(e||i)}(n,o,r,c,l)?!function(t,e,n){return function(t){return"ArrowUp"===t}(t)&&!e&&!n}(n,o,l)?!function(t,e,n){return function(t){return"ArrowDown"===t}(t)&&!e&&!n}(n,o,l)?!function(t,e){return Ke(t)&&e}(n,r)?!function(t){return" "===t}(n)?!function(t,e){return q&&e&&"o"===t.toLowerCase()}(n,o)?!function(t,e){return Ke(t)&&!e}(n,r)?!function(t,e,n,r){return q?!e&&!n&&($e(t)||"h"===t.toLowerCase()&&r):!(r||e||n)&&$e(t)}(n,c,l,o)?!function(t){return"Escape"===t}(n)?!function(t,e,n,r,i){return q?!(n||r||i)&&(Je(t)||"d"===t.toLowerCase()&&e):!(e||r||i)&&Je(t)}(n,o,r,c,l)?!function(t,e,n){return $e(t)&&(q?e:n)}(n,c,o)?!function(t,e,n){return Je(t)&&(q?e:n)}(n,c,o)?!function(t,e){return q&&e&&$e(t)}(n,l)?!function(t,e){return q&&e&&Je(t)}(n,l)?!function(t,e,n,r){return"b"===t.toLowerCase()&&!e&&Re(n,r)}(n,c,l,o)?!function(t,e,n,r){return"u"===t.toLowerCase()&&!e&&Re(n,r)}(n,c,l,o)?!function(t,e,n,r){return"i"===t.toLowerCase()&&!e&&Re(n,r)}(n,c,l,o)?!function(t,e,n,r){return"Tab"===t&&!e&&!n&&!r}(n,c,o,l)?!function(t,e,n,r){return"z"===t.toLowerCase()&&!e&&Re(n,r)}(n,r,l,o)?!function(t,e,n,r){return q?"z"===t.toLowerCase()&&n&&e:"y"===t.toLowerCase()&&r||"z"===t.toLowerCase()&&r&&e}(n,r,l,o)?xi(e._editorState._selection)?function(t,e,n,r){return!e&&"c"===t.toLowerCase()&&(q?n:r)}(n,r,l,o)?(t.preventDefault(),Ze(e,M,t)):function(t,e,n,r){return!e&&"x"===t.toLowerCase()&&(q?n:r)}(n,r,l,o)?(t.preventDefault(),Ze(e,W,t)):Ue(n,l,o)&&(t.preventDefault(),Ze(e,z,t)):!Q&&Ue(n,l,o)&&(t.preventDefault(),Ze(e,z,t)):(t.preventDefault(),Ze(e,g,void 0)):(t.preventDefault(),Ze(e,h,void 0)):Ze(e,N,t):(t.preventDefault(),Ze(e,d,"italic")):(t.preventDefault(),Ze(e,d,"underline")):(t.preventDefault(),Ze(e,d,"bold")):(t.preventDefault(),Ze(e,f,!1)):(t.preventDefault(),Ze(e,f,!0)):(t.preventDefault(),Ze(e,u,!1)):(t.preventDefault(),Ze(e,u,!0)):Je(n)?Ze(e,w,t):(t.preventDefault(),Ze(e,i,!1)):Ze(e,b,t):$e(n)?Ze(e,k,t):(t.preventDefault(),Ze(e,i,!0)):(Cr=!1,Ze(e,T,t)):(t.preventDefault(),Cr=!0,Ze(e,s,!0)):Ze(e,C,t):(Cr=!0,Ze(e,T,t)):Ze(e,S,t):Ze(e,v,t):Ze(e,x,t):Ze(e,m,t):Ze(e,y,t):Ze(e,p,t),function(t,e,n,r){return t||e||n||r}(o,r,c,l)&&Ze(e,V,t))}],["pointerdown",function(t,e){const n=t.target,r=t.pointerType;n instanceof Node&&"touch"!==r&&hs(e,()=>{ms(Ce(n))||(Tr=!0)})}],["compositionstart",function(t,e){hs(e,()=>{const n=Oi();if(yi(n)&&!e.isComposing()){const r=n.anchor,i=n.anchor.getNode();xe(r.key),(t.timeStamp<pr+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||oi(i)&&i.getStyle()!==n.style)&&Ze(e,l,Et)}})}],["compositionend",function(t,e){Q?kr=!0:hs(e,()=>{Fr(e,t.data)})}],["input",function(t,e){t.stopPropagation(),hs(e,()=>{const n=Oi(),r=t.data,i=Pr(t);if(null!=r&&yi(n)&&wr(n,i,r,t.timeStamp,!1)){kr&&(Fr(e,r),kr=!1);const i=n.anchor.getNode(),s=yn(e._window);if(null===s)return;const o=n.isBackward(),c=o?n.anchor.offset:n.focus.offset,a=o?n.focus.offset:n.anchor.offset;X&&!n.isCollapsed()&&oi(i)&&null!==s.anchorNode&&i.getTextContent().slice(0,c)+r+i.getTextContent().slice(c+a)===Ie(s.anchorNode)||Ze(e,l,r);const u=r.length;Q&&u>1&&"insertCompositionText"===t.inputType&&!e.isComposing()&&(n.anchor.offset-=u),Y||Z||nt||!e.isComposing()||(pr=0,xe(null))}else Ae(!1,e,null!==r?r:void 0),kr&&(Fr(e,r||void 0),kr=!1);Yi(),Xt(ts())}),xr=null}],["click",function(t,e){hs(e,()=>{const n=Oi(),i=yn(e._window),s=Ii();if(i)if(yi(n)){const e=n.anchor,r=e.getNode();"element"===e.type&&0===e.offset&&n.isCollapsed()&&!vs(r)&&1===we().getChildrenSize()&&r.getTopLevelElementOrThrow().isEmpty()&&null!==s&&n.is(s)?(i.removeAllRanges(),n.dirty=!0):3!==t.detail||n.isCollapsed()||r!==n.focus.getNode()&&(_s(r)?r.select(0):r.getParentOrThrow().select(0))}else if("touch"===t.pointerType){const n=i.anchorNode;if(null!==n){const r=n.nodeType;1!==r&&3!==r||Ee(Li(s,i,e,t))}}Ze(e,r,t)})}],["cut",hr],["copy",hr],["dragstart",hr],["dragover",hr],["dragend",hr],["paste",hr],["focus",hr],["blur",hr],["drop",hr]];X&&_r.push(["beforeinput",(t,e)=>function(t,e){const n=t.inputType,r=Pr(t);"deleteCompositionText"===n||Q&&Ye(e)||"insertCompositionText"!==n&&hs(e,()=>{const _=Oi();if("deleteContentBackward"===n){if(null===_){const t=Ii();if(!yi(t))return;Ee(t.clone())}if(yi(_)){const n=_.anchor.key===_.focus.key;if(p=t.timeStamp,"MediaLast"===yr&&p<pr+30&&e.isComposing()&&n){if(xe(null),pr=0,setTimeout(()=>{hs(e,()=>{xe(null)})},30),yi(_)){const t=_.anchor.getNode();t.markDirty(),_.format=t.getFormat(),oi(t)||Rt(142),_.style=t.getStyle()}}else{xe(null),t.preventDefault();const r=_.anchor.getNode().getTextContent(),s=0===_.anchor.offset&&_.focus.offset===r.length;et&&n&&!s||Ze(e,i,!0)}return}}var p;if(!yi(_))return;const y=t.data;null!==xr&&Ae(!1,e,xr),_.dirty&&null===xr||!_.isCollapsed()||vs(_.anchor.getNode())||null===r||_.applyDOMRange(r),xr=null;const m=_.anchor,x=_.focus,v=m.getNode(),S=x.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(t.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Ze(e,l,t);break;case"insertFromComposition":xe(null),Ze(e,l,t);break;case"insertLineBreak":xe(null),Ze(e,s,!1);break;case"insertParagraph":xe(null),Cr&&!Z?(Cr=!1,Ze(e,s,!1)):Ze(e,o,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Ze(e,c,t);break;case"deleteByComposition":(function(t,e){return t!==e||_s(t)||_s(e)||!t.isToken()||!e.isToken()})(v,S)&&Ze(e,a,t);break;case"deleteByDrag":case"deleteByCut":Ze(e,a,t);break;case"deleteContent":Ze(e,i,!1);break;case"deleteWordBackward":Ze(e,u,!0);break;case"deleteWordForward":Ze(e,u,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Ze(e,f,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Ze(e,f,!1);break;case"formatStrikeThrough":Ze(e,d,"strikethrough");break;case"formatBold":Ze(e,d,"bold");break;case"formatItalic":Ze(e,d,"italic");break;case"formatUnderline":Ze(e,d,"underline");break;case"historyUndo":Ze(e,h,void 0);break;case"historyRedo":Ze(e,g,void 0)}else{if("\n"===y)t.preventDefault(),Ze(e,s,!1);else if(y===Nt)t.preventDefault(),Ze(e,o,void 0);else if(null==y&&t.dataTransfer){const e=t.dataTransfer.getData("text/plain");t.preventDefault(),_.insertRawText(e)}else null!=y&&wr(_,r,y,t.timeStamp,!0)?(t.preventDefault(),Ze(e,l,y)):xr=y;mr=t.timeStamp}})}(t,e)]);let pr=0,yr=null,mr=0,xr=null;const vr=new WeakMap;let Sr=!1,Tr=!1,Cr=!1,kr=!1,br=[0,"",0,"root",0];function wr(t,e,n,r,i){const s=t.anchor,o=t.focus,l=s.getNode(),c=ts(),a=yn(c._window),u=null!==a?a.anchorNode:null,f=s.key,d=c.getElementByKey(f),h=n.length;return f!==o.key||!oi(l)||(!i&&(!X||mr<r+50)||l.isDirty()&&h<2||De(n))&&s.offset!==o.offset&&!l.isComposing()||fe(l)||l.isDirty()&&h>1||(i||!X)&&null!==d&&!l.isComposing()&&u!==he(d)||null!==a&&null!==e&&(!e.collapsed||e.startContainer!==a.anchorNode||e.startOffset!==a.anchorOffset)||l.getFormat()!==t.format||l.getStyle()!==t.style||function(t,e){if(e.isSegmented())return!0;if(!t.isCollapsed())return!1;const n=t.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return 0===n?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(t){const e=t.getPreviousSibling();return(oi(e)||_s(e)&&e.isInline())&&!e.canInsertTextAfter()}(e):n===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}(t,l)}function Nr(t,e){return null!==t&&null!==t.nodeValue&&3===t.nodeType&&0!==e&&e!==t.nodeValue.length}function Er(t,n,r){const{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:l}=t;Sr&&(Sr=!1,Nr(i,s)&&Nr(o,l))||hs(n,()=>{if(!r)return void Ee(null);if(!le(n,i,o))return;const c=Oi();if(yi(c)){const e=c.anchor,r=e.getNode();if(c.isCollapsed()){"Range"===t.type&&t.anchorNode===t.focusNode&&(c.dirty=!0);const i=on(n).event,s=i?i.timeStamp:performance.now(),[o,l,a,u,f]=br,d=we(),h=!1===n.isComposing()&&""===d.getTextContent();if(s<f+200&&e.offset===a&&e.key===u)c.format=o,c.style=l;else if("text"===e.type)oi(r)||Rt(141),c.format=r.getFormat(),c.style=r.getStyle();else if("element"===e.type&&!h){const t=e.getNode();c.style="",t instanceof bs&&0===t.getChildrenSize()?(c.format=t.getTextFormat(),c.style=t.getTextStyle()):c.format=0}}else{const t=e.key,n=c.focus.key,r=c.getNodes(),i=r.length,o=c.isBackward(),a=o?l:s,u=o?s:l,f=o?n:t,d=o?t:n;let h=255,g=!1;for(let t=0;t<i;t++){const e=r[t],n=e.getTextContentSize();if(oi(e)&&0!==n&&!(0===t&&e.__key===f&&a===n||t===i-1&&e.__key===d&&0===u)&&(g=!0,h&=e.getFormat(),0===h))break}c.format=g?h:0}}Ze(n,e,void 0)})}function Pr(t){if(!t.getTargetRanges)return null;const e=t.getTargetRanges();return 0===e.length?null:e[0]}function Fr(t,e){const n=t._compositionKey;if(xe(null),null!==n&&null!=e){if(""===e){const e=Se(n),r=he(t.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&oi(e)&&Me(e,r.nodeValue,null,null,!0))}if("\n"===e[e.length-1]){const e=Oi();if(yi(e)){const n=e.focus;return e.anchor.set(n.key,n.offset,n.type),void Ze(t,T,null)}}}Ae(!0,t,e)}function Dr(t){let e=t.__lexicalEventHandles;return void 0===e&&(e=[],t.__lexicalEventHandles=e),e}const Lr=new Map;function Or(t){const e=t.target,n=yn(null==e?null:9===e.nodeType?e.defaultView:e.ownerDocument.defaultView);if(null===n)return;const r=ae(n.anchorNode);if(null===r)return;Tr&&(Tr=!1,hs(r,()=>{const e=Ii(),i=n.anchorNode;if(null===i)return;const s=i.nodeType;1!==s&&3!==s||Ee(Li(e,n,r,t))}));const i=Le(r),s=i[i.length-1],o=s._key,l=Lr.get(o),c=l||s;c!==r&&Er(n,c,!1),Er(n,r,!0),r!==s?Lr.set(o,r):l&&Lr.delete(o)}function Ir(t){t._lexicalHandled=!0}function Ar(t){return!0===t._lexicalHandled}function Wr(t,e,n){Yi();const r=t.__key,i=t.getParent();if(null===i)return;const s=function(t){const e=Oi();if(!yi(e)||!_s(t))return e;const{anchor:n,focus:r}=e,i=n.getNode(),s=r.getNode();return sn(i,t)&&n.set(t.__key,0,"element"),sn(s,t)&&r.set(t.__key,0,"element"),e}(t);let o=!1;if(yi(s)&&e){const e=s.anchor,n=s.focus;e.key===r&&(Wi(e,t,i,t.getPreviousSibling(),t.getNextSibling()),o=!0),n.key===r&&(Wi(n,t,i,t.getPreviousSibling(),t.getNextSibling()),o=!0)}else xi(s)&&e&&t.isSelected()&&t.selectPrevious();if(yi(s)&&e&&!o){const e=t.getIndexWithinParent();ye(t),Ai(s,i,e,-1)}else ye(t);n||an(i)||i.canBeEmpty()||!i.isEmpty()||Wr(i,e),e&&vs(i)&&i.isEmpty()&&i.selectEnd()}class zr{static getType(){Rt(64,this.name)}static clone(t){Rt(65,this.name)}afterCloneFrom(t){this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev}constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,pe(this,t)}getType(){return this.__type}isInline(){Rt(137,this.constructor.name)}isAttached(){let t=this.__key;for(;null!==t;){if("root"===t)return!0;const e=Se(t);if(null===e)break;t=e.__parent}return!1}isSelected(t){const e=t||Oi();if(null==e)return!1;const n=e.getNodes().some(t=>t.__key===this.__key);if(oi(this))return n;if(yi(e)&&"element"===e.anchor.type&&"element"===e.focus.type){if(e.isCollapsed())return!1;const t=this.getParent();if(ms(this)&&this.isInline()&&t){const n=e.isBackward()?e.focus:e.anchor,r=n.getNode();if(n.offset===r.getChildrenSize()&&r.is(t)&&r.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(null===t)return-1;let e=t.getFirstChild(),n=0;for(;null!==e;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return null===t?null:Se(t)}getParentOrThrow(){const t=this.getParent();return null===t&&Rt(66,this.__key),t}getTopLevelElement(){let t=this;for(;null!==t;){const e=t.getParent();if(an(e))return _s(t)||t===this&&ms(t)||Rt(194),t;t=e}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return null===t&&Rt(67,this.__key),t}getParents(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e),e=e.getParent();return t}getParentKeys(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e.__key),e=e.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return null===t?null:Se(t)}getPreviousSiblings(){const t=[],e=this.getParent();if(null===e)return t;let n=e.getFirstChild();for(;null!==n&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return null===t?null:Se(t)}getNextSiblings(){const t=[];let e=this.getNextSibling();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){const e=this.getParents(),n=t.getParents();_s(this)&&e.unshift(this),_s(t)&&n.unshift(t);const r=e.length,i=n.length;if(0===r||0===i||e[r-1]!==n[i-1])return null;const s=new Set(n);for(let t=0;t<r;t++){const n=e[t];if(s.has(n))return n}return null}is(t){return null!=t&&this.__key===t.__key}isBefore(t){if(this===t)return!1;if(t.isParentOf(this))return!0;if(this.isParentOf(t))return!1;const e=this.getCommonAncestor(t);let n=0,r=0,i=this;for(;;){const t=i.getParentOrThrow();if(t===e){n=i.getIndexWithinParent();break}i=t}for(i=t;;){const t=i.getParentOrThrow();if(t===e){r=i.getIndexWithinParent();break}i=t}return n<r}isParentOf(t){const e=this.__key;if(e===t.__key)return!1;let n=t;for(;null!==n;){if(n.__key===e)return!0;n=n.getParent()}return!1}getNodesBetween(t){const e=this.isBefore(t),n=[],r=new Set;let i=this;for(;null!==i;){const s=i.__key;if(r.has(s)||(r.add(s),n.push(i)),i===t)break;const o=_s(i)?e?i.getFirstChild():i.getLastChild():null;if(null!==o){i=o;continue}const l=e?i.getNextSibling():i.getPreviousSibling();if(null!==l){i=l;continue}const c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===t)break;let a=null,u=c;do{if(null===u&&Rt(68),a=e?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==a||r.has(u.__key)||n.push(u)}while(null===a);i=a}return e||n.reverse(),n}isDirty(){const t=ts()._dirtyLeaves;return null!==t&&t.has(this.__key)}getLatest(){const t=Se(this.__key);return null===t&&Rt(113),t}getWritable(){Yi();const t=Gi(),e=ts(),n=t._nodeMap,r=this.__key,i=this.getLatest(),s=e._cloneNotNeeded,o=Oi();if(null!==o&&o.setCachedNodes(null),s.has(r))return me(i),i;const l=Pn(i);return s.add(r),me(l),n.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,e){Rt(70)}updateDOM(t,e,n){Rt(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){Rt(72)}static importJSON(t){Rt(18,this.name)}static transform(){return null}remove(t){Wr(this,!0,t)}replace(t,e){Yi();let n=Oi();null!==n&&(n=n.clone()),dn(this,t);const r=this.getLatest(),i=this.__key,s=t.__key,o=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;ye(o);const a=r.getPreviousSibling(),u=r.getNextSibling(),f=r.__prev,d=r.__next,h=r.__parent;if(Wr(r,!1,!0),null===a?l.__first=s:a.getWritable().__next=s,o.__prev=f,null===u?l.__last=s:u.getWritable().__prev=s,o.__next=d,o.__parent=h,l.__size=c,e&&(_s(this)&&_s(o)||Rt(139),this.getChildren().forEach(t=>{o.append(t)})),yi(n)){Ee(n);const t=n.anchor,e=n.focus;t.key===i&&gi(t,o),e.key===i&&gi(e,o)}return ve()===i&&xe(s),o}insertAfter(t,e=!0){Yi(),dn(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.getParent(),s=Oi();let o=!1,l=!1;if(null!==i){const e=t.getIndexWithinParent();if(ye(r),yi(s)){const t=i.__key,n=s.anchor,r=s.focus;o="element"===n.type&&n.key===t&&n.offset===e+1,l="element"===r.type&&r.key===t&&r.offset===e+1}}const c=this.getNextSibling(),a=this.getParentOrThrow().getWritable(),u=r.__key,f=n.__next;if(null===c?a.__last=u:c.getWritable().__prev=u,a.__size++,n.__next=u,r.__next=f,r.__prev=n.__key,r.__parent=n.__parent,e&&yi(s)){const t=this.getIndexWithinParent();Ai(s,a,t+1);const e=a.__key;o&&s.anchor.set(e,t+2,"element"),l&&s.focus.set(e,t+2,"element")}return t}insertBefore(t,e=!0){Yi(),dn(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.__key;ye(r);const s=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),l=n.__prev,c=this.getIndexWithinParent();null===s?o.__first=i:s.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const a=Oi();return e&&yi(a)&&Ai(a,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return Ns()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){Yi();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(_s(n))return n.select();if(!oi(n)){const t=n.getIndexWithinParent()+1;return r.select(t,t)}return n.select(t,e)}selectNext(t,e){Yi();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(_s(n))return n.select(0,0);if(!oi(n)){const t=n.getIndexWithinParent();return r.select(t,t)}return n.select(t,e)}markDirty(){this.getWritable()}}class Br extends zr{static getType(){return"linebreak"}static clone(t){return new Br(t.__key)}constructor(t){super(t)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:t=>function(t){const e=t.parentElement;if(null!==e&&Tn(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&Jr(n)){const n=e.lastChild;if(n===t||n.previousSibling===t&&Jr(n))return!0}}return!1}(t)||function(t){const e=t.parentElement;if(null!==e&&Tn(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&Jr(n))return!1;const r=e.lastChild;if(r===t||r.previousSibling===t&&Jr(r))return!0}return!1}(t)?null:{conversion:Rr,priority:0}}}static importJSON(t){return Kr()}exportJSON(){return{type:"linebreak",version:1}}}function Rr(t){return{node:Kr()}}function Kr(){return fn(new Br)}function $r(t){return t instanceof Br}function Jr(t){return 3===t.nodeType&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function Ur(t,e){return 16&e?"code":128&e?"mark":32&e?"sub":64&e?"sup":null}function Vr(t,e){return 1&e?"strong":2&e?"em":"span"}function jr(t,e,n,r,i){const s=r.classList;let o=je(i,"base");void 0!==o&&s.add(...o),o=je(i,"underlineStrikethrough");let l=!1;const c=8&e&&4&e;void 0!==o&&(8&n&&4&n?(l=!0,c||s.add(...o)):c&&s.remove(...o));for(const t in Ot){const r=Ot[t];if(o=je(i,t),void 0!==o)if(n&r){if(l&&("underline"===t||"strikethrough"===t)){e&r&&s.remove(...o);continue}e&r&&(!c||"underline"!==t)&&"strikethrough"!==t||s.add(...o)}else e&r&&s.remove(...o)}}function Hr(t,e,n){const r=e.firstChild,i=n.isComposing(),s=t+(i?wt:"");if(null==r)e.textContent=s;else{const t=r.nodeValue;if(t!==s)if(i||Q){const[e,n,i]=function(t,e){const n=t.length,r=e.length;let i=0,s=0;for(;i<n&&i<r&&t[i]===e[i];)i++;for(;s+i<n&&s+i<r&&t[n-s-1]===e[r-s-1];)s++;return[i,n-i-s,e.slice(i,r-s)]}(t,s);0!==n&&r.deleteData(e,n),r.insertData(e,i)}else r.nodeValue=s}}function qr(t,e,n,r,i,s){Hr(i,t,e);const o=s.theme.text;void 0!==o&&jr(0,0,r,t,o)}function Qr(t,e){const n=document.createElement(e);return n.appendChild(t),n}class Xr extends zr{static getType(){return"text"}static clone(t){return new Xr(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t,e){super(e),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return zt[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===ve()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const e=Ot[t];return!!(this.getFormat()&e)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(t,e){return ge(this.getLatest().__format,t,e)}canHaveFormat(){return!0}createDOM(t,e){const n=this.__format,r=Ur(0,n),i=Vr(0,n),s=null===r?i:r,o=document.createElement(s);let l=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(l=document.createElement(i),o.appendChild(l)),qr(l,this,0,n,this.__text,t);const c=this.__style;return""!==c&&(o.style.cssText=c),o}updateDOM(t,e,n){const r=this.__text,i=t.__format,s=this.__format,o=Ur(0,i),l=Ur(0,s),c=Vr(0,i),a=Vr(0,s);if((null===o?c:o)!==(null===l?a:l))return!0;if(o===l&&c!==a){const t=e.firstChild;null==t&&Rt(48);const i=document.createElement(a);return qr(i,this,0,s,r,n),e.replaceChild(i,t),!1}let u=e;null!==l&&null!==o&&(u=e.firstChild,null==u&&Rt(49)),Hr(r,u,this);const f=n.theme.text;void 0!==f&&i!==s&&jr(0,i,s,u,f);const d=t.__style,h=this.__style;return d!==h&&(e.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:ei,priority:0}),b:()=>({conversion:Zr,priority:0}),code:()=>({conversion:ii,priority:0}),em:()=>({conversion:ii,priority:0}),i:()=>({conversion:ii,priority:0}),s:()=>({conversion:ii,priority:0}),span:()=>({conversion:Yr,priority:0}),strong:()=>({conversion:ii,priority:0}),sub:()=>({conversion:ii,priority:0}),sup:()=>({conversion:ii,priority:0}),u:()=>({conversion:ii,priority:0})}}static importJSON(t){const e=si(t.text);return e.setFormat(t.format),e.setDetail(t.detail),e.setMode(t.mode),e.setStyle(t.style),e}exportDOM(t){let{element:e}=super.exportDOM(t);return null!==e&&vn(e)||Rt(132),e.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(e=Qr(e,"b")),this.hasFormat("italic")&&(e=Qr(e,"i")),this.hasFormat("strikethrough")&&(e=Qr(e,"s")),this.hasFormat("underline")&&(e=Qr(e,"u")),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(t,e){}setFormat(t){const e=this.getWritable();return e.__format="string"==typeof t?Ot[t]:t,e}setDetail(t){const e=this.getWritable();return e.__detail="string"==typeof t?It[t]:t,e}setStyle(t){const e=this.getWritable();return e.__style=t,e}toggleFormat(t){const e=ge(this.getFormat(),t,null);return this.setFormat(e)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const e=Wt[t];if(this.__mode===e)return this;const n=this.getWritable();return n.__mode=e,n}setTextContent(t){if(this.__text===t)return this;const e=this.getWritable();return e.__text=t,e}select(t,e){Yi();let n=t,r=e;const i=Oi(),s=this.getTextContent(),o=this.__key;if("string"==typeof s){const t=s.length;void 0===n&&(n=t),void 0===r&&(r=t)}else n=0,r=0;if(!yi(i))return Ei(o,n,o,r,"text","text");{const t=ve();t!==i.anchor.key&&t!==i.focus.key||xe(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,e,n,r){const i=this.getWritable(),s=i.__text,o=n.length;let l=t;l<0&&(l=o+l,l<0&&(l=0));const c=Oi();if(r&&yi(c)){const e=t+o;c.setTextNodeRange(i,e,i,e)}const a=s.slice(0,l)+n+s.slice(l+e);return i.__text=a,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){Yi();const e=this.getLatest(),n=e.getTextContent(),r=e.__key,i=ve(),s=new Set(t),o=[],l=n.length;let c="";for(let t=0;t<l;t++)""!==c&&s.has(t)&&(o.push(c),c=""),c+=n[t];""!==c&&o.push(c);const a=o.length;if(0===a)return[];if(o[0]===n)return[e];const u=o[0],f=e.getParent();let d;const h=e.getFormat(),g=e.getStyle(),_=e.__detail;let p=!1;e.isSegmented()?(d=si(u),d.__format=h,d.__style=g,d.__detail=_,p=!0):(d=e.getWritable(),d.__text=u);const y=Oi(),m=[d];let x=u.length;for(let t=1;t<a;t++){const e=o[t],n=e.length,s=si(e).getWritable();s.__format=h,s.__style=g,s.__detail=_;const l=s.__key,c=x+n;if(yi(y)){const t=y.anchor,e=y.focus;t.key===r&&"text"===t.type&&t.offset>x&&t.offset<=c&&(t.key=l,t.offset-=x,y.dirty=!0),e.key===r&&"text"===e.type&&e.offset>x&&e.offset<=c&&(e.key=l,e.offset-=x,y.dirty=!0)}i===r&&xe(l),x=c,m.push(s)}if(null!==f){!function(t){const e=t.getPreviousSibling(),n=t.getNextSibling();null!==e&&me(e),null!==n&&me(n)}(this);const t=f.getWritable(),e=this.getIndexWithinParent();p?(t.splice(e,0,m),this.remove()):t.splice(e,1,m),yi(y)&&Ai(y,f,e,a-1)}return m}mergeWithSibling(t){const e=t===this.getPreviousSibling();e||t===this.getNextSibling()||Rt(50);const n=this.__key,r=t.__key,i=this.__text,s=i.length;ve()===r&&xe(n);const o=Oi();if(yi(o)){const i=o.anchor,l=o.focus;null!==i&&i.key===r&&(zi(i,e,n,t,s),o.dirty=!0),null!==l&&l.key===r&&(zi(l,e,n,t,s),o.dirty=!0)}const l=t.__text,c=e?l+i:i+l;this.setTextContent(c);const a=this.getWritable();return t.remove(),a}isTextEntity(){return!1}}function Yr(t){return{forChild:li(t.style),node:null}}function Zr(t){const e=t,n="normal"===e.style.fontWeight;return{forChild:li(e.style,n?void 0:"bold"),node:null}}const Gr=new WeakMap;function ti(t){return"PRE"===t.nodeName||1===t.nodeType&&void 0!==t.style&&void 0!==t.style.whiteSpace&&t.style.whiteSpace.startsWith("pre")}function ei(t){const e=t;null===t.parentElement&&Rt(129);let n=e.textContent||"";if(null!==function(t){let e,n=t.parentNode;const r=[t];for(;null!==n&&void 0===(e=Gr.get(n))&&!ti(n);)r.push(n),n=n.parentNode;const i=void 0===e?n:e;for(let t=0;t<r.length;t++)Gr.set(r[t],i);return i}(e)){const t=n.split(/(\r?\n|\t)/),e=[],r=t.length;for(let n=0;n<r;n++){const r=t[n];"\n"===r||"\r\n"===r?e.push(Kr()):"\t"===r?e.push(ai()):""!==r&&e.push(si(r))}return{node:e}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let t=e,r=!0;for(;null!==t&&null!==(t=ni(t,!1));){const e=t.textContent||"";if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let t=e,r=!0;for(;null!==t&&null!==(t=ni(t,!0));)if((t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:si(n)}}function ni(t,e){let n=t;for(;;){let t;for(;null===(t=e?n.nextSibling:n.previousSibling);){const t=n.parentElement;if(null===t)return null;n=t}if(n=t,1===n.nodeType){const t=n.style.display;if(""===t&&!Sn(n)||""!==t&&!t.startsWith("inline"))return null}let r=n;for(;null!==(r=e?n.firstChild:n.lastChild);)n=r;if(3===n.nodeType)return n;if("BR"===n.nodeName)return null}}const ri={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ii(t){const e=ri[t.nodeName.toLowerCase()];return void 0===e?{node:null}:{forChild:li(t.style,e),node:null}}function si(t=""){return fn(new Xr(t))}function oi(t){return t instanceof Xr}function li(t,e){const n=t.fontWeight,r=t.textDecoration.split(" "),i="700"===n||"bold"===n,s=r.includes("line-through"),o="italic"===t.fontStyle,l=r.includes("underline"),c=t.verticalAlign;return t=>oi(t)?(i&&!t.hasFormat("bold")&&t.toggleFormat("bold"),s&&!t.hasFormat("strikethrough")&&t.toggleFormat("strikethrough"),o&&!t.hasFormat("italic")&&t.toggleFormat("italic"),l&&!t.hasFormat("underline")&&t.toggleFormat("underline"),"sub"!==c||t.hasFormat("subscript")||t.toggleFormat("subscript"),"super"!==c||t.hasFormat("superscript")||t.toggleFormat("superscript"),e&&!t.hasFormat(e)&&t.toggleFormat(e),t):t}class ci extends Xr{static getType(){return"tab"}static clone(t){return new ci(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text}constructor(t){super("\t",t),this.__detail=2}static importDOM(){return null}static importJSON(t){const e=ai();return e.setFormat(t.format),e.setStyle(t.style),e}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(t){Rt(126)}setDetail(t){Rt(127)}setMode(t){Rt(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function ai(){return fn(new ci)}function ui(t){return t instanceof ci}class fi{constructor(t,e,n){this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){let e=this.getNode(),n=t.getNode();const r=this.offset,i=t.offset;if(_s(e)){const t=e.getDescendantByIndex(r);e=null!=t?t:e}if(_s(n)){const t=n.getDescendantByIndex(i);n=null!=t?t:n}return e===n?r<i:e.isBefore(n)}getNode(){const t=Se(this.key);return null===t&&Rt(20),t}set(t,e,n){const r=this._selection,i=this.key;this.key=t,this.offset=e,this.type=n,Xi()||(ve()===i&&xe(t),null!==r&&(r.setCachedNodes(null),r.dirty=!0))}}function di(t,e,n){return new fi(t,e,n)}function hi(t,e){let n=e.__key,r=t.offset,i="element";if(oi(e)){i="text";const t=e.getTextContentSize();r>t&&(r=t)}else if(!_s(e)){const t=e.getNextSibling();if(oi(t))n=t.__key,r=0,i="text";else{const t=e.getParent();t&&(n=t.__key,r=e.getIndexWithinParent()+1)}}t.set(n,r,i)}function gi(t,e){if(_s(e)){const n=e.getLastDescendant();_s(n)||oi(n)?hi(t,n):hi(t,e)}else hi(t,e)}function _i(t,e,n,r){t.key=e,t.offset=n,t.type=r}class pi{constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!xi(t))return!1;const e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every(t=>n.has(t))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new pi(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const e=this.getNodes(),n=e.length,r=e[n-1];let i;if(oi(r))i=r.select();else{const t=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(t,t)}i.insertNodes(t);for(let t=0;t<n;t++)e[t].remove()}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=this._nodes,n=[];for(const t of e){const e=Se(t);null!==e&&n.push(e)}return Xi()||(this._cachedNodes=n),n}getTextContent(){const t=this.getNodes();let e="";for(let n=0;n<t.length;n++)e+=t[n].getTextContent();return e}}function yi(t){return t instanceof mi}class mi{constructor(t,e,n,r){this.anchor=t,this.focus=e,t._selection=this,e._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!yi(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=this.anchor,n=this.focus,r=e.isBefore(n),i=r?e:n,s=r?n:e;let o=i.getNode(),l=s.getNode();const c=i.offset,a=s.offset;if(_s(o)){const t=o.getDescendantByIndex(c);o=null!=t?t:o}if(_s(l)){let t=l.getDescendantByIndex(a);null!==t&&t!==o&&l.getChildAtIndex(a)===t&&(t=t.getPreviousSibling()),l=null!=t?t:l}let u;return u=o.is(l)?_s(o)&&o.getChildrenSize()>0?[]:[o]:o.getNodesBetween(l),Xi()||(this._cachedNodes=u),u}setTextNodeRange(t,e,n,r){_i(this.anchor,t.__key,e,"text"),_i(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const t=this.getNodes();if(0===t.length)return"";const e=t[0],n=t[t.length-1],r=this.anchor,i=this.focus,s=r.isBefore(i),[o,l]=Si(this);let c="",a=!0;for(let u=0;u<t.length;u++){const f=t[u];if(_s(f)&&!f.isInline())a||(c+="\n"),a=!f.isEmpty();else if(a=!1,oi(f)){let t=f.getTextContent();f===e?f===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(t=o<l?t.slice(o,l):t.slice(l,o)):t=s?t.slice(o):t.slice(l):f===n&&(t=s?t.slice(0,l):t.slice(0,o)),c+=t}else!ms(f)&&!$r(f)||f===n&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(t){const e=ts(),n=e.getEditorState()._selection,r=wi(t.startContainer,t.startOffset,t.endContainer,t.endOffset,e,n);if(null===r)return;const[i,s]=r;_i(this.anchor,i.key,i.offset,i.type),_i(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const t=this.anchor,e=this.focus;return new mi(di(t.key,t.offset,t.type),di(e.key,e.offset,e.type),this.format,this.style)}toggleFormat(t){this.format=ge(this.format,t,null),this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const e=Ot[t];return!!(this.format&e)}insertRawText(t){const e=t.split(/(\r?\n|\t)/),n=[],r=e.length;for(let t=0;t<r;t++){const r=e[t];"\n"===r||"\r\n"===r?n.push(Kr()):"\t"===r?n.push(ai()):n.push(si(r))}this.insertNodes(n)}insertText(t){const e=this.anchor,n=this.focus,r=this.format,i=this.style;let s=e,o=n;!this.isCollapsed()&&n.isBefore(e)&&(s=n,o=e),"element"===s.type&&function(t,e,n,r){const i=t.getNode(),s=i.getChildAtIndex(t.offset),o=si(),l=vs(i)?Ns().append(o):o;o.setFormat(n),o.setStyle(r),null===s?i.append(l):s.insertBefore(l),t.is(e)&&e.set(o.__key,0,"text"),t.set(o.__key,0,"text")}(s,o,r,i);const l=s.offset;let c=o.offset;const a=this.getNodes(),u=a.length;let f=a[0];oi(f)||Rt(26);const d=f.getTextContent().length,h=f.getParentOrThrow();let g=a[u-1];if(1===u&&"element"===o.type&&(c=d,o.set(s.key,c,"text")),this.isCollapsed()&&l===d&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!h.canInsertTextAfter()&&null===f.getNextSibling())){let e=f.getNextSibling();if(oi(e)&&e.canInsertTextBefore()&&!fe(e)||(e=si(),e.setFormat(r),e.setStyle(i),h.canInsertTextAfter()?f.insertAfter(e):h.insertAfter(e)),e.select(0,0),f=e,""!==t)return void this.insertText(t)}else if(this.isCollapsed()&&0===l&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!h.canInsertTextBefore()&&null===f.getPreviousSibling())){let e=f.getPreviousSibling();if(oi(e)&&!fe(e)||(e=si(),e.setFormat(r),h.canInsertTextBefore()?f.insertBefore(e):h.insertBefore(e)),e.select(),f=e,""!==t)return void this.insertText(t)}else if(f.isSegmented()&&l!==d){const t=si(f.getTextContent());t.setFormat(r),f.replace(t),f=t}else if(!this.isCollapsed()&&""!==t){const e=g.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||_s(e)&&(!e.canInsertTextBefore()||!e.canInsertTextAfter()))return this.insertText(""),bi(this.anchor,this.focus,null),void this.insertText(t)}if(1===u){if(f.isToken()){const e=si(t);return e.select(),void f.replace(e)}const e=f.getFormat(),n=f.getStyle();if(l!==c||e===r&&n===i){if(ui(f)){const e=si(t);return e.setFormat(r),e.setStyle(i),e.select(),void f.replace(e)}}else{if(""!==f.getTextContent()){const e=si(t);if(e.setFormat(r),e.setStyle(i),e.select(),0===l)f.insertBefore(e,!1);else{const[t]=f.splitText(l);t.insertAfter(e,!1)}return void(e.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length))}f.setFormat(r),f.setStyle(i)}const s=c-l;f=f.spliceText(l,s,t,!0),""===f.getTextContent()?f.remove():"text"===this.anchor.type&&(f.isComposing()?this.anchor.offset-=t.length:(this.format=e,this.style=n))}else{const e=new Set([...f.getParentKeys(),...g.getParentKeys()]),n=_s(f)?f:f.getParentOrThrow();let r=_s(g)?g:g.getParentOrThrow(),i=g;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===o.type&&(0!==c||""===g.getTextContent())||"element"===o.type&&g.getIndexWithinParent()<c)if(oi(g)&&!g.isToken()&&c!==g.getTextContentSize()){if(g.isSegmented()){const t=si(g.getTextContent());g.replace(t),g=t}vs(o.getNode())||"text"!==o.type||(g=g.spliceText(0,c,"")),e.add(g.__key)}else{const t=g.getParentOrThrow();t.canBeEmpty()||1!==t.getChildrenSize()?g.remove():t.remove()}else e.add(g.__key);const s=r.getChildren(),h=new Set(a),_=n.is(r),p=n.isInline()&&null===f.getNextSibling()?n:f;for(let t=s.length-1;t>=0;t--){const e=s[t];if(e.is(f)||_s(e)&&e.isParentOf(f))break;e.isAttached()&&(!h.has(e)||e.is(i)?_||p.insertAfter(e,!1):e.remove())}if(!_){let t=r,n=null;for(;null!==t;){const r=t.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(e.delete(t.__key),n=t),t=t.getParent()}}if(f.isToken())if(l===d)f.select();else{const e=si(t);e.select(),f.replace(e)}else f=f.spliceText(l,d-l,t,!0),""===f.getTextContent()?f.remove():f.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length);for(let t=1;t<u;t++){const n=a[t],r=n.__key;e.has(r)||n.remove()}}}removeText(){this.insertText("")}formatText(t){if(this.isCollapsed())return this.toggleFormat(t),void xe(null);const e=this.getNodes(),n=[];for(const t of e)oi(t)&&n.push(t);const r=n.length;if(0===r)return this.toggleFormat(t),void xe(null);const i=this.anchor,s=this.focus,o=this.isBackward(),l=o?s:i,c=o?i:s;let a=0,u=n[0],f="element"===l.type?0:l.offset;if("text"===l.type&&f===u.getTextContentSize()&&(a=1,u=n[1],f=0),null==u)return;const d=u.getFormatFlags(t,null),h=r-1;let g=n[h];const _="text"===c.type?c.offset:g.getTextContentSize();if(u.is(g)){if(f===_)return;if(fe(u)||0===f&&_===u.getTextContentSize())u.setFormat(d);else{const t=u.splitText(f,_),e=0===f?t[0]:t[1];e.setFormat(d),"text"===l.type&&l.set(e.__key,0,"text"),"text"===c.type&&c.set(e.__key,_-f,"text")}return void(this.format=d)}0===f||fe(u)||([,u]=u.splitText(f),f=0),u.setFormat(d);const p=g.getFormatFlags(t,d);_>0&&(_===g.getTextContentSize()||fe(g)||([g]=g.splitText(_)),g.setFormat(p));for(let e=a+1;e<h;e++){const r=n[e],i=r.getFormatFlags(t,p);r.setFormat(i)}"text"===l.type&&l.set(u.__key,f,"text"),"text"===c.type&&c.set(g.__key,_,"text"),this.format=d|p}insertNodes(t){if(0===t.length)return;if("root"===this.anchor.key){this.insertParagraph();const e=Oi();return yi(e)||Rt(134),e.insertNodes(t)}const e=kn((this.isBackward()?this.focus:this.anchor).getNode(),Cn),n=t[t.length-1];if("__language"in e&&_s(e)){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const r=$i(this);e.splice(r,0,t),n.selectEnd()}return}if(!t.some(t=>(_s(t)||ms(t))&&!t.isInline())){_s(e)||Rt(135);const r=$i(this);return e.splice(r,0,t),void n.selectEnd()}const r=function(t){const e=Ns();let n=null;for(let r=0;r<t.length;r++){const i=t[r],s=$r(i);if(s||ms(i)&&i.isInline()||_s(i)&&i.isInline()||oi(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),e.append(n),s))continue;null!==n&&n.append(i)}else e.append(i),n=null}return e}(t),i=r.getLastDescendant(),s=r.getChildren(),o=_s(e)&&e.isEmpty()?null:this.insertParagraph(),l=s[s.length-1];let c=s[0];var a;_s(a=c)&&Cn(a)&&!a.isEmpty()&&_s(e)&&(!e.isEmpty()||e.canMergeWhenEmpty())&&(_s(e)||Rt(135),e.append(...c.getChildren()),c=s[1]),c&&function(t,e,n){const r=e.getParentOrThrow().getLastChild();let i=e;const s=[e];for(;i!==r;)i.getNextSibling()||Rt(140),i=i.getNextSibling(),s.push(i);let o=t;for(const t of s)o=o.insertAfter(t)}(e,c);const u=kn(i,Cn);o&&_s(u)&&(o.canMergeWhenEmpty()||Cn(l))&&(u.append(...o.getChildren()),o.remove()),_s(e)&&e.isEmpty()&&e.remove(),i.selectEnd();const f=_s(e)?e.getLastChild():null;$r(f)&&u!==e&&f.remove()}insertParagraph(){if("root"===this.anchor.key){const t=Ns();return we().splice(this.anchor.offset,0,[t]),t.select(),t}const t=$i(this),e=kn(this.anchor.getNode(),Cn);_s(e)||Rt(136);const n=e.getChildAtIndex(t),r=n?[n,...n.getNextSiblings()]:[],i=e.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(t){const e=Kr();if(this.insertNodes([e]),t){const t=e.getParentOrThrow(),n=e.getIndexWithinParent();t.select(n,n)}}extract(){const t=this.getNodes(),e=t.length,n=e-1,r=this.anchor,i=this.focus;let s=t[0],o=t[n];const[l,c]=Si(this);if(0===e)return[];if(1===e){if(oi(s)&&!this.isCollapsed()){const t=l>c?c:l,e=l>c?l:c,n=s.splitText(t,e),r=0===t?n[0]:n[1];return null!=r?[r]:[]}return[s]}const a=r.isBefore(i);if(oi(s)){const e=a?l:c;e===s.getTextContentSize()?t.shift():0!==e&&([,s]=s.splitText(e),t[0]=s)}if(oi(o)){const e=o.getTextContent().length,r=a?c:l;0===r?t.pop():r!==e&&([o]=o.splitText(r),t[n]=o)}return t}modify(t,e,n){const r=this.focus,i=this.anchor,s="move"===t,o=Xe(r,e);if(ms(o)&&!o.isIsolated()){if(s&&o.isKeyboardSelectable()){const t=Fi();return t.add(o.__key),void Ee(t)}const t=e?o.getPreviousSibling():o.getNextSibling();if(oi(t)){const n=t.__key,o=e?t.getTextContent().length:0;return r.set(n,o,"text"),void(s&&i.set(n,o,"text"))}{const n=o.getParentOrThrow();let l,c;return _s(t)?(c=t.__key,l=e?t.getChildrenSize():0):(l=o.getIndexWithinParent(),c=n.__key,e||l++),r.set(c,l,"element"),void(s&&i.set(c,l,"element"))}}const l=ts(),c=yn(l._window);if(!c)return;const a=l._blockCursorElement,u=l._rootElement;if(null===u||null===a||!_s(o)||o.isInline()||o.canBeEmpty()||_n(a,l,u),function(t,e,n,r){t.modify(e,n,r)}(c,t,e?"backward":"forward",n),c.rangeCount>0){const t=c.getRangeAt(0),n=this.anchor.getNode(),r=vs(n)?n:cn(n);if(this.applyDOMRange(t),this.dirty=!0,!s){const n=this.getNodes(),i=[];let s=!1;for(let t=0;t<n.length;t++){const e=n[t];sn(e,r)?i.push(e):s=!0}if(s&&i.length>0)if(e){const t=i[0];_s(t)?t.selectStart():t.getParentOrThrow().selectStart()}else{const t=i[i.length-1];_s(t)?t.selectEnd():t.getParentOrThrow().selectEnd()}c.anchorNode===t.startContainer&&c.anchorOffset===t.startOffset||function(t){const e=t.focus,n=t.anchor,r=n.key,i=n.offset,s=n.type;_i(n,e.key,e.offset,e.type),_i(e,r,i,s),t._cachedNodes=null}(this)}}}forwardDeletion(t,e,n){if(!n&&("element"===t.type&&_s(e)&&t.offset===e.getChildrenSize()||"text"===t.type&&t.offset===e.getTextContentSize())){const t=e.getParent(),n=e.getNextSibling()||(null===t?null:t.getNextSibling());if(_s(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const n=this.anchor;let r=n.getNode();if(this.forwardDeletion(n,r,t))return;const i=this.focus,s=Xe(i,t);if(ms(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&_s(r)&&0===r.getChildrenSize()){r.remove();const t=Fi();t.add(s.__key),Ee(t)}else s.remove(),ts().dispatchCommand(e,void 0);return}if(!t&&_s(s)&&_s(r)&&r.isEmpty())return r.remove(),void s.selectStart();if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&0===n.offset&&("element"===n.type?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const e="text"===i.type?i.getNode():null;if(r="text"===n.type?n.getNode():null,null!==e&&e.isSegmented()){const n=i.offset,s=e.getTextContentSize();if(e.is(r)||t&&n!==s||!t&&0!==n)return void Ti(e,t,n)}else if(null!==r&&r.isSegmented()){const i=n.offset,s=r.getTextContentSize();if(r.is(e)||t&&0!==i||!t&&i!==s)return void Ti(r,t,i)}!function(t,e){const n=t.anchor,r=t.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const t=n.offset,s=r.offset,o=t<s,l=o?t:s,c=o?s:t,a=c-1;l!==a&&(De(i.getTextContent().slice(l,c))||(e?r.offset=a:n.offset=a))}}(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const t=this.anchor.getNode();t.isEmpty()&&vs(t.getParent())&&0===t.getIndexWithinParent()&&t.collapseAtStart(this)}}deleteLine(t){if(this.isCollapsed()){const e="element"===this.anchor.type;if(e&&this.insertText(" "),this.modify("extend",t,"lineboundary"),0===(t?this.focus:this.anchor).offset&&this.modify("extend",t,"character"),e){const e=t?this.anchor:this.focus;e.set(e.key,e.offset+1,e.type)}}this.removeText()}deleteWord(t){if(this.isCollapsed()){const e=this.anchor,n=e.getNode();if(this.forwardDeletion(e,n,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function xi(t){return t instanceof pi}function vi(t){const e=t.offset;if("text"===t.type)return e;const n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function Si(t){const e=t.getStartEndPoints();if(null===e)return[0,0];const[n,r]=e;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[vi(n),vi(r)]}function Ti(t,e,n){const r=t,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,l=0;for(let t=0;t<s;t++){const r=t===s-1;if(l=o,o+=i[t].length,e&&o===n||o>n||r){i.splice(t,1),r&&(l=void 0);break}}const c=i.join("").trim();""===c?r.remove():(r.setTextContent(c),r.select(l,l))}function Ci(t,e,n,r){let i,s=e;if(1===t.nodeType){let o=!1;const l=t.childNodes,c=l.length,a=r._blockCursorElement;s===c&&(o=!0,s=c-1);let u=l[s],f=!1;if(u===a)u=l[s+1],f=!0;else if(null!==a){const n=a.parentNode;t===n&&e>Array.prototype.indexOf.call(n.children,a)&&s--}if(i=Pe(u),oi(i))s=Fe(i,o);else{let r=Pe(t);if(null===r)return null;if(_s(r)){s=Math.min(r.getChildrenSize(),s);let t=r.getChildAtIndex(s);if(_s(t)&&function(t,e,n){const r=t.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(t,0,n)){const e=o?t.getLastDescendant():t.getFirstDescendant();null===e?r=t:(t=e,r=_s(t)?t:t.getParentOrThrow()),s=0}oi(t)?(i=t,r=null,s=Fe(t,o)):t!==r&&o&&!f&&s++}else{const n=r.getIndexWithinParent();s=0===e&&ms(r)&&Pe(t)===r?n:n+1,r=r.getParentOrThrow()}if(_s(r))return di(r.__key,s,"element")}}else i=Pe(t);return oi(i)?di(i.__key,s,"text"):null}function ki(t,e,n){const r=t.offset,i=t.getNode();if(0===r){const r=i.getPreviousSibling(),s=i.getParent();if(e){if((n||!e)&&null===r&&_s(s)&&s.isInline()){const e=s.getPreviousSibling();oi(e)&&(t.key=e.__key,t.offset=e.getTextContent().length)}}else _s(r)&&!n&&r.isInline()?(t.key=r.__key,t.offset=r.getChildrenSize(),t.type="element"):oi(r)&&(t.key=r.__key,t.offset=r.getTextContent().length)}else if(r===i.getTextContent().length){const r=i.getNextSibling(),s=i.getParent();if(e&&_s(r)&&r.isInline())t.key=r.__key,t.offset=0,t.type="element";else if((n||e)&&null===r&&_s(s)&&s.isInline()&&!s.canInsertTextAfter()){const e=s.getNextSibling();oi(e)&&(t.key=e.__key,t.offset=0)}}}function bi(t,e,n){if("text"===t.type&&"text"===e.type){const r=t.isBefore(e),i=t.is(e);ki(t,r,i),ki(e,!r,i),i&&(e.key=t.key,e.offset=t.offset,e.type=t.type);const s=ts();if(s.isComposing()&&s._compositionKey!==t.key&&yi(n)){const r=n.anchor,i=n.focus;_i(t,r.key,r.offset,r.type),_i(e,i.key,i.offset,i.type)}}}function wi(t,e,n,r,i,s){if(null===t||null===n||!le(i,t,n))return null;const o=Ci(t,e,yi(s)?s.anchor:null,i);if(null===o)return null;const l=Ci(n,r,yi(s)?s.focus:null,i);if(null===l)return null;if("element"===o.type&&"element"===l.type){const e=Pe(t),r=Pe(n);if(ms(e)&&ms(r))return null}return bi(o,l,s),[o,l]}function Ei(t,e,n,r,i,s){const o=Gi(),l=new mi(di(t,e,i),di(n,r,s),0,"");return l.dirty=!0,o._selection=l,l}function Fi(){return new pi(new Set)}function Li(t,e,n,r){const i=n._window;if(null===i)return null;const s=r||i.event,o=s?s.type:void 0,l="selectionchange"===o,c=!Jt&&(l||"beforeinput"===o||"compositionstart"===o||"compositionend"===o||"click"===o&&s&&3===s.detail||"drop"===o||void 0===o);let a,u,f,d;if(yi(t)&&!c)return t.clone();if(null===e)return null;if(a=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&yi(t)&&!le(n,a,u))return t.clone();const h=wi(a,f,u,d,n,t);if(null===h)return null;const[g,_]=h;return new mi(g,_,yi(t)?t.format:0,yi(t)?t.style:"")}function Oi(){return Gi()._selection}function Ii(){return ts()._editorState._selection}function Ai(t,e,n,r=1){const i=t.anchor,s=t.focus,o=i.getNode(),l=s.getNode();if(!e.is(o)&&!e.is(l))return;const c=e.__key;if(t.isCollapsed()){const e=i.offset;if(n<=e&&r>0||n<e&&r<0){const n=Math.max(0,e+r);i.set(c,n,"element"),s.set(c,n,"element"),Mi(t)}}else{const o=t.isBackward(),l=o?s:i,a=l.getNode(),u=o?i:s,f=u.getNode();if(e.is(a)){const t=l.offset;(n<=t&&r>0||n<t&&r<0)&&l.set(c,Math.max(0,t+r),"element")}if(e.is(f)){const t=u.offset;(n<=t&&r>0||n<t&&r<0)&&u.set(c,Math.max(0,t+r),"element")}}Mi(t)}function Mi(t){const e=t.anchor,n=e.offset,r=t.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(t.isCollapsed()){if(!_s(s))return;const t=s.getChildrenSize(),i=n>=t,o=i?s.getChildAtIndex(t-1):s.getChildAtIndex(n);if(oi(o)){let t=0;i&&(t=o.getTextContentSize()),e.set(o.__key,t,"text"),r.set(o.__key,t,"text")}}else{if(_s(s)){const t=s.getChildrenSize(),r=n>=t,i=r?s.getChildAtIndex(t-1):s.getChildAtIndex(n);if(oi(i)){let t=0;r&&(t=i.getTextContentSize()),e.set(i.__key,t,"text")}}if(_s(o)){const t=o.getChildrenSize(),e=i>=t,n=e?o.getChildAtIndex(t-1):o.getChildAtIndex(i);if(oi(n)){let t=0;e&&(t=n.getTextContentSize()),r.set(n.__key,t,"text")}}}}function Wi(t,e,n,r,i){let s=null,o=0,l=null;null!==r?(s=r.__key,oi(r)?(o=r.getTextContentSize(),l="text"):_s(r)&&(o=r.getChildrenSize(),l="element")):null!==i&&(s=i.__key,oi(i)?l="text":_s(i)&&(l="element")),null!==s&&null!==l?t.set(s,o,l):(o=e.getIndexWithinParent(),-1===o&&(o=n.getChildrenSize()),t.set(n.__key,o,"element"))}function zi(t,e,n,r,i){"text"===t.type?(t.key=n,e||(t.offset+=i)):t.offset>r.getIndexWithinParent()&&(t.offset-=1)}function $i(t){let e=t;t.isCollapsed()||e.removeText();const n=Oi();yi(n)&&(e=n),yi(e)||Rt(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!Cn(i);)[i,s]=Ji(i,s);return s}function Ji(t,e){const n=t.getParent();if(!n){const t=Ns();return we().append(t),t.select(),[we(),0]}if(oi(t)){const r=t.splitText(e);if(0===r.length)return[n,t.getIndexWithinParent()];const i=0===e?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!_s(t)||0===e)return[n,t.getIndexWithinParent()];const r=t.getChildAtIndex(e);if(r){const n=new mi(di(t.__key,e,"element"),di(t.__key,e,"element"),0,""),i=t.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}let Ui=null,Vi=null,ji=!1,Hi=!1,qi=0;const Qi={characterData:!0,childList:!0,subtree:!0};function Xi(){return ji||null!==Ui&&Ui._readOnly}function Yi(){ji&&Rt(13)}function Zi(){qi>99&&Rt(14)}function Gi(){return null===Ui&&Rt(195,es()),Ui}function ts(){return null===Vi&&Rt(196,es()),Vi}function es(){let t=0;const e=new Set,n=Ms.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=ue(r);if(ce(i))t++;else if(i){let t=String(i.constructor.version||"<0.17.1");t===n&&(t+=" (separately built, likely a bundler configuration issue)"),e.add(t)}}let r=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(r+=" and incompatible editors with versions "+Array.from(e).join(", ")),r}function rs(t,e,n){const r=e.__type,i=function(t,e){const n=t._nodes.get(e);return void 0===n&&Rt(30,e),n}(t,r);let s=n.get(r);void 0===s&&(s=Array.from(i.transforms),n.set(r,s));const o=s.length;for(let t=0;t<o&&(s[t](e),e.isAttached());t++);}function is(t,e){return void 0!==t&&t.__key!==e&&t.isAttached()}function os(t,e){const n=t.type,r=e.get(n);void 0===r&&Rt(17,n);const i=r.klass;t.type!==i.getType()&&Rt(18,i.name);const s=i.importJSON(t),o=t.children;if(_s(s)&&Array.isArray(o))for(let t=0;t<o.length;t++){const n=os(o[t],e);s.append(n)}return s}function ls(t,e,n){const r=Ui,i=ji,s=Vi;Ui=e,ji=!0,Vi=t;try{return n()}finally{Ui=r,ji=i,Vi=s}}function cs(t,n){const r=t._pendingEditorState,i=t._rootElement,s=t._headless||null===i;if(null===r)return;const o=t._editorState,l=o._selection,c=r._selection,a=0!==t._dirtyType,u=Ui,f=ji,d=Vi,h=t._updating,g=t._observer;let _=null;if(t._pendingEditorState=null,t._editorState=r,!s&&a&&null!==g){Vi=t,Ui=r,ji=!1,t._updating=!0;try{const e=t._dirtyType,n=t._dirtyElements,i=t._dirtyLeaves;g.disconnect(),_=function(t,e,n,r,i,s){Kn="",Vn="",$n="",jn=2===r,qn=null,Ln=n,Dn=n._config,On=n._nodes,In=Ln._listeners.mutation,An=i,Mn=s,Wn=t._nodeMap,zn=e._nodeMap,Hn=e._readOnly,Bn=new Map(n._keyToDOMMap);const o=new Map;return Rn=o,cr("root",null),Ln=void 0,On=void 0,An=void 0,Mn=void 0,Wn=void 0,zn=void 0,Dn=void 0,Bn=void 0,Rn=void 0,o}(o,r,t,e,n,i)}catch(e){if(e instanceof Error&&t._onError(e),Hi)throw e;return Is(t,null,i,r),Yt(t),t._dirtyType=2,Hi=!0,cs(t,o),void(Hi=!1)}finally{g.observe(i,Qi),t._updating=h,Ui=u,ji=f,Vi=d}}r._readOnly||(r._readOnly=!0);const p=t._dirtyLeaves,y=t._dirtyElements,m=t._normalizedNodes,x=t._updateTags,v=t._deferred;a&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set),function(t,e){const n=t._decorators;let r=t._pendingDecorators||n;const i=e._nodeMap;let s;for(s in r)i.has(s)||(r===n&&(r=ke(t)),delete r[s])}(t,r);const S=s?null:yn(t._window);if(t._editable&&null!==S&&(a||null===c||c.dirty)){Vi=t,Ui=r;try{if(null!==g&&g.disconnect(),a||null===c||c.dirty){const e=t._blockCursorElement;null!==e&&_n(e,t,i),function(t,e,n,r,i,s,o){const l=r.anchorNode,c=r.focusNode,a=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==s||null!==f&&oe(f))return;if(!yi(e))return void(null!==t&&le(n,l,c)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,_=h.key,p=tn(n,g),y=tn(n,_),m=d.offset,x=h.offset,v=e.format,S=e.style,T=e.isCollapsed();let C=p,k=y,b=!1;if("text"===d.type){C=he(p);const t=d.getNode();b=t.getFormat()!==v||t.getStyle()!==S}else yi(t)&&"text"===t.anchor.type&&(b=!0);var w,N,E,P,F;if("text"===h.type&&(k=he(y)),null!==C&&null!==k&&(T&&(null===t||b||yi(t)&&(t.format!==v||t.style!==S))&&(w=v,N=S,E=m,P=g,F=performance.now(),br=[w,N,E,P,F]),a!==m||u!==x||l!==C||c!==k||"Range"===r.type&&T||(null!==f&&s.contains(f)||s.focus({preventScroll:!0}),"element"===d.type))){try{r.setBaseAndExtent(C,m,k,x)}catch(t){}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&null!==s&&s===document.activeElement){const t=e instanceof mi&&"element"===e.anchor.type?C.childNodes[m]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==t){let e;if(t instanceof Text){const n=document.createRange();n.selectNode(t),e=n.getBoundingClientRect()}else e=t.getBoundingClientRect();!function(t,e,n){const r=n.ownerDocument,i=r.defaultView;if(null===i)return;let{top:s,bottom:o}=e,l=0,c=0,a=n;for(;null!==a;){const e=a===r.body;if(e)l=0,c=on(t).innerHeight;else{const t=a.getBoundingClientRect();l=t.top,c=t.bottom}let n=0;if(s<l?n=-(l-s):o>c&&(n=o-c),0!==n)if(e)i.scrollBy(0,n);else{const t=a.scrollTop;a.scrollTop+=n;const e=a.scrollTop-t;s-=e,o-=e}if(e)break;a=en(a)}}(n,e,s)}}Sr=!0}}(l,c,t,S,x,i)}(function(t,e,n){let r=t._blockCursorElement;if(yi(n)&&n.isCollapsed()&&"element"===n.anchor.type&&e.contains(document.activeElement)){const i=n.anchor,s=i.getNode(),o=i.offset;let l=!1,c=null;if(o===s.getChildrenSize())gn(s.getChildAtIndex(o-1))&&(l=!0);else{const e=s.getChildAtIndex(o);if(gn(e)){const n=e.getPreviousSibling();(null===n||gn(n))&&(l=!0,c=t.getElementByKey(e.__key))}}if(l){const n=t.getElementByKey(s.__key);return null===r&&(t._blockCursorElement=r=function(t){const e=t.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=e.blockCursor;if(void 0!==r){if("string"==typeof r){const t=Kt(r);r=e.blockCursor=t}void 0!==r&&n.classList.add(...r)}return n}(t._config)),e.style.caretColor="transparent",void(null===c?n.appendChild(r):n.insertBefore(r,c))}}null!==r&&_n(r,t,e)})(t,i,c),null!==g&&g.observe(i,Qi)}finally{Vi=d,Ui=u}}null!==_&&function(t,e,n,r,i){const s=Array.from(t._listeners.mutation),o=s.length;for(let t=0;t<o;t++){const[o,l]=s[t],c=e.get(l);void 0!==c&&o(c,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}(t,_,x,p,o),yi(c)||null===c||null!==l&&l.is(c)||t.dispatchCommand(e,void 0);const T=t._pendingDecorators;null!==T&&(t._decorators=T,t._pendingDecorators=null,as("decorator",t,!0,T)),function(t,e,n){const r=be(e),i=be(n);r!==i&&as("textcontent",t,!0,i)}(t,n||o,r),as("update",t,!0,{dirtyElements:y,dirtyLeaves:p,editorState:r,normalizedNodes:m,prevEditorState:n||o,tags:x}),function(t,e){if(t._deferred=[],0!==e.length){const n=t._updating;t._updating=!0;try{for(let t=0;t<e.length;t++)e[t]()}finally{t._updating=n}}}(t,v),function(t){const e=t._updates;if(0!==e.length){const n=e.shift();if(n){const[e,r]=n;ds(t,e,r)}}}(t)}function as(t,e,n,...r){const i=e._updating;e._updating=n;try{const n=Array.from(e._listeners[t]);for(let t=0;t<n.length;t++)n[t].apply(null,r)}finally{e._updating=i}}function fs(t,e){const n=t._updates;let r=e||!1;for(;0!==n.length;){const e=n.shift();if(e){const[n,i]=e;let s,o;if(void 0!==i){if(s=i.onUpdate,o=i.tag,i.skipTransforms&&(r=!0),i.discrete){const e=t._pendingEditorState;null===e&&Rt(191),e._flushSync=!0}s&&t._deferred.push(s),o&&t._updateTags.add(o)}n()}}return r}function ds(t,e,n){const r=t._updateTags;let i,s,o=!1,l=!1;void 0!==n&&(i=n.onUpdate,s=n.tag,null!=s&&r.add(s),o=n.skipTransforms||!1,l=n.discrete||!1),i&&t._deferred.push(i);const c=t._editorState;let a=t._pendingEditorState,u=!1;(null===a||a._readOnly)&&(a=t._pendingEditorState=new Cs(new Map((a||c)._nodeMap)),u=!0),a._flushSync=l;const f=Ui,d=ji,h=Vi,g=t._updating;Ui=a,ji=!1,t._updating=!0,Vi=t;try{u&&(t._headless?null!==c._selection&&(a._selection=c._selection.clone()):a._selection=function(t){const e=t.getEditorState()._selection,n=yn(t._window);return yi(e)||null==e?Li(e,n,t,null):e.clone()}(t));const n=t._compositionKey;e(),o=fs(t,o),function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(yi(r)){const t=r.anchor,e=r.focus;let i;if("text"===t.type&&(i=t.getNode(),i.selectionTransform(n,r)),"text"===e.type){const t=e.getNode();i!==t&&t.selectionTransform(n,r)}}}(a,t),0!==t._dirtyType&&(o?function(t,e){const n=e._dirtyLeaves,r=t._nodeMap;for(const t of n){const e=r.get(t);oi(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&te(e)}}(a,t):function(t,e){const n=e._dirtyLeaves,r=e._dirtyElements,i=t._nodeMap,s=ve(),o=new Map;let l=n,c=l.size,a=r,u=a.size;for(;c>0||u>0;){if(c>0){e._dirtyLeaves=new Set;for(const t of l){const r=i.get(t);oi(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&te(r),void 0!==r&&is(r,s)&&rs(e,r,o),n.add(t)}if(l=e._dirtyLeaves,c=l.size,c>0){qi++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map;for(const t of a){const n=t[0],l=t[1];if("root"!==n&&!l)continue;const c=i.get(n);void 0!==c&&is(c,s)&&rs(e,c,o),r.set(n,l)}l=e._dirtyLeaves,c=l.size,a=e._dirtyElements,u=a.size,qi++}e._dirtyLeaves=n,e._dirtyElements=r}(a,t),fs(t),function(t,e,n,r){const i=t._nodeMap,s=e._nodeMap,o=[];for(const[t]of r){const e=s.get(t);void 0!==e&&(e.isAttached()||(_s(e)&&Fn(e,t,i,s,o,r),i.has(t)||r.delete(t),o.push(t)))}for(const t of o)s.delete(t);for(const t of n){const e=s.get(t);void 0===e||e.isAttached()||(i.has(t)||n.delete(t),s.delete(t))}}(c,a,t._dirtyLeaves,t._dirtyElements)),n!==t._compositionKey&&(a._flushSync=!0);const r=a._selection;if(yi(r)){const t=a._nodeMap,e=r.anchor.key,n=r.focus.key;void 0!==t.get(e)&&void 0!==t.get(n)||Rt(19)}else xi(r)&&0===r._nodes.size&&(a._selection=null)}catch(e){return e instanceof Error&&t._onError(e),t._pendingEditorState=c,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void cs(t)}finally{Ui=f,ji=d,Vi=h,t._updating=g,qi=0}0!==t._dirtyType||function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(a,t)?a._flushSync?(a._flushSync=!1,cs(t)):u&&se(()=>{cs(t)}):(a._flushSync=!1,u&&(r.clear(),t._deferred=[],t._pendingEditorState=null))}function hs(t,e,n){t._updating?t._updates.push([e,n]):ds(t,e,n)}class gs extends zr{constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(t){super.afterCloneFrom(t),this.__first=t.__first,this.__last=t.__last,this.__size=t.__size,this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return Mt[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getChildrenKeys(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e.__key),e=e.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const t=ts()._dirtyElements;return null!==t&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),e=this.getParentOrThrow().getLastChild();return null!==e&&e.is(t)}getAllTextNodes(){const t=[];let e=this.getFirstChild();for(;null!==e;){if(oi(e)&&t.push(e),_s(e)){const n=e.getAllTextNodes();t.push(...n)}e=e.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;_s(t);){const e=t.getFirstChild();if(null===e)break;t=e}return t}getLastDescendant(){let t=this.getLastChild();for(;_s(t);){const e=t.getLastChild();if(null===e)break;t=e}return t}getDescendantByIndex(t){const e=this.getChildren(),n=e.length;if(t>=n){const t=e[n-1];return _s(t)&&t.getLastDescendant()||t||null}const r=e[t];return _s(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const t=this.getLatest().__first;return null===t?null:Se(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return null===t&&Rt(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return null===t?null:Se(t)}getLastChildOrThrow(){const t=this.getLastChild();return null===t&&Rt(96,this.__key),t}getChildAtIndex(t){const e=this.getChildrenSize();let n,r;if(t<e/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=t;){if(r===t)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=e-1;null!==n&&r>=t;){if(r===t)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let t="";const e=this.getChildren(),n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=i.getTextContent(),_s(i)&&r!==n-1&&!i.isInline()&&(t+=Nt)}return t}getTextContentSize(){let t=0;const e=this.getChildren(),n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=i.getTextContentSize(),_s(i)&&r!==n-1&&!i.isInline()&&(t+=Nt.length)}return t}getDirection(){return this.getLatest().__dir}hasFormat(t){if(""!==t){const e=At[t];return!!(this.getFormat()&e)}return!1}select(t,e){Yi();const n=Oi();let r=t,i=e;const s=this.getChildrenSize();if(!this.canBeEmpty())if(0===t&&0===e){const t=this.getFirstChild();if(oi(t)||_s(t))return t.select(0,0)}else if(!(void 0!==t&&t!==s||void 0!==e&&e!==s)){const t=this.getLastChild();if(oi(t)||_s(t))return t.select()}void 0===r&&(r=s),void 0===i&&(i=s);const o=this.__key;return yi(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,i,"element"),n.dirty=!0,n):Ei(o,r,o,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(t=>t.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const e=this.getWritable();return e.__dir=t,e}setFormat(t){return this.getWritable().__format=""!==t?At[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setIndent(t){return this.getWritable().__indent=t,this}splice(t,e,n){const r=n.length,i=this.getChildrenSize(),s=this.getWritable(),o=s.__key,l=[],c=[],a=this.getChildAtIndex(t+e);let u=null,f=i-e+r;if(0!==t)if(t===i)u=this.getLastChild();else{const e=this.getChildAtIndex(t);null!==e&&(u=e.getPreviousSibling())}if(e>0){let t=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<e;n++){null===t&&Rt(100);const e=t.getNextSibling(),n=t.__key;ye(t.getWritable()),c.push(n),t=e}}let d=u;for(let t=0;t<r;t++){const e=n[t];null!==d&&e.is(d)&&(u=d=d.getPreviousSibling());const r=e.getWritable();r.__parent===o&&f--,ye(r);const i=e.__key;if(null===d)s.__first=i,r.__prev=null;else{const t=d.getWritable();t.__next=i,r.__prev=t.__key}e.__key===o&&Rt(76),r.__parent=o,l.push(i),d=e}if(t+e===i)null!==d&&(d.getWritable().__next=null,s.__last=d.__key);else if(null!==a){const t=a.getWritable();if(null!==d){const e=d.getWritable();t.__prev=d.__key,e.__next=a.__key}else t.__prev=null}if(s.__size=f,c.length){const t=Oi();if(yi(t)){const e=new Set(c),n=new Set(l),{anchor:r,focus:i}=t;ps(r,e,n)&&Wi(r,r.getNode(),this,u,a),ps(i,e,n)&&Wi(i,i.getNode(),this,u,a),0!==f||this.canBeEmpty()||an(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(t,e){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,e,n){return!1}canMergeWhenEmpty(){return!1}}function _s(t){return t instanceof gs}function ps(t,e,n){let r=t.getNode();for(;r;){const t=r.__key;if(e.has(t)&&!n.has(t))return!0;r=r.getParent()}return!1}class ys extends zr{constructor(t){super(t)}decorate(t,e){Rt(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ms(t){return t instanceof ys}class xs extends gs{static getType(){return"root"}static clone(){return new xs}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Rt(51)}getTextContent(){const t=this.__cachedText;return!Xi()&&0!==ts()._dirtyType||null===t?super.getTextContent():t}remove(){Rt(52)}replace(t){Rt(53)}insertBefore(t){Rt(54)}insertAfter(t){Rt(55)}updateDOM(t,e){return!1}append(...t){for(let e=0;e<t.length;e++){const n=t[e];_s(n)||ms(n)||Rt(56)}return super.append(...t)}static importJSON(t){const e=we();return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function vs(t){return t instanceof xs}function Ss(){return new Cs(new Map([["root",new xs]]))}function Ts(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&Rt(130,n.name),_s(t)){const r=e.children;Array.isArray(r)||Rt(59,n.name);const i=t.getChildren();for(let t=0;t<i.length;t++){const e=Ts(i[t]);r.push(e)}}return e}class Cs{constructor(t,e){this._nodeMap=t,this._selection=e||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(t,e){return ls(e&&e.editor||null,this,t)}clone(t){const e=new Cs(this._nodeMap,void 0===t?this._selection:t);return e._readOnly=!0,e}toJSON(){return ls(null,this,()=>({root:Ts(we())}))}}class ks extends gs{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class bs extends gs{constructor(t){super(t),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(t){const e=this.getWritable();return e.__textFormat=t,e}hasTextFormat(t){const e=Ot[t];return!!(this.getTextFormat()&e)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(t){const e=this.getWritable();return e.__textStyle=t,e}static clone(t){return new bs(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}createDOM(t){const e=document.createElement("p"),n=je(t.theme,"paragraph");return void 0!==n&&e.classList.add(...n),e}updateDOM(t,e,n){return!1}static importDOM(){return{p:t=>({conversion:ws,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&vn(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n);const r=this.getIndent();r>0&&(e.style.textIndent=20*r+"px")}return{element:e}}static importJSON(t){const e=Ns();return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e.setTextFormat(t.textFormat),e}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(t,e){const n=Ns();n.setTextFormat(t.format),n.setTextStyle(t.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,e),n}collapseAtStart(){const t=this.getChildren();if(0===t.length||oi(t[0])&&""===t[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function ws(t){const e=Ns();if(t.style){e.setFormat(t.style.textAlign);const n=parseInt(t.style.textIndent,10)/20;n>0&&e.setIndent(n)}return{node:e}}function Ns(){return fn(new bs)}function Es(t){return t instanceof bs}function Is(t,e,n,r){const i=t._keyToDOMMap;i.clear(),t._editorState=Ss(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null;const s=t._observer;null!==s&&(s.disconnect(),t._observer=null),null!==e&&(e.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}class Ms{constructor(t,e,n,r,i,s,o){this._parentEditor=e,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Oe(),this._onError=i,this._htmlConversions=s,this._editable=o,this._headless=null!==e&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(t){const e=this._listeners.update;return e.add(t),()=>{e.delete(t)}}registerEditableListener(t){const e=this._listeners.editable;return e.add(t),()=>{e.delete(t)}}registerDecoratorListener(t){const e=this._listeners.decorator;return e.add(t),()=>{e.delete(t)}}registerTextContentListener(t){const e=this._listeners.textcontent;return e.add(t),()=>{e.delete(t)}}registerRootListener(t){const e=this._listeners.root;return t(this._rootElement,null),e.add(t),()=>{t(null,this._rootElement),e.delete(t)}}registerCommand(t,e,n){void 0===n&&Rt(35);const r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=r.get(t);void 0===i&&Rt(36,String(t));const s=i[n];return s.add(e),()=>{s.delete(e),i.every(t=>0===t.size)&&r.delete(t)}}registerMutationListener(t,e,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;i.set(e,r);const s=n&&n.skipInitialization;return void 0===s||s||this.initializeMutationListener(e,r),()=>{i.delete(e)}}getRegisteredNode(t){const e=this._nodes.get(t.getType());return void 0===e&&Rt(37,t.name),e}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){const n=this._editorState,r=En(n).get(e.getType());if(!r)return;const i=new Map;for(const t of r.keys())i.set(t,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){const n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){const n=this.registerNodeTransformToKlass(t,e),r=[n],i=n.replaceWithKlass;if(null!=i){const t=this.registerNodeTransformToKlass(i,e);r.push(t)}var o;return this,o=t.getType(),hs(this,()=>{const t=Gi();if(t.isEmpty())return;if("root"===o)return void we().markDirty();const e=t._nodeMap;for(const[,t]of e)t.markDirty()},null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach(t=>t.transforms.delete(e))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return Ze(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const e=this._rootElement;if(t!==e){const n=je(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,Is(this,e,t,r),null!==e&&(this._config.disableEvents||function(t){const e=t.ownerDocument,n=vr.get(e);void 0===n&&Rt(162);const r=n-1;r>=0||Rt(164),vr.set(e,r),0===r&&e.removeEventListener("selectionchange",Or);const i=ue(t);ce(i)?(function(t){if(null!==t._parentEditor){const e=Le(t),n=e[e.length-1]._key;Lr.get(n)===t&&Lr.delete(n)}else Lr.delete(t._key)}(i),t.__lexicalEditor=null):i&&Rt(198);const s=Dr(t);for(let t=0;t<s.length;t++)s[t]();t.__lexicalEventHandles=[]}(e),null!=n&&e.classList.remove(...n)),null!==t){const e=function(t){const e=t.ownerDocument;return e&&e.defaultView||null}(t),r=t.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=e,this._dirtyType=2,Yt(this),this._updateTags.add("history-merge"),cs(this),this._config.disableEvents||function(t,e){const n=t.ownerDocument,r=vr.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Or),vr.set(n,(r||0)+1),t.__lexicalEditor=e;const i=Dr(t);for(let n=0;n<_r.length;n++){const[r,s]=_r[n],o="function"==typeof s?t=>{Ar(t)||(Ir(t),(e.isEditable()||"click"===r)&&s(t,e))}:t=>{if(Ar(t))return;Ir(t);const n=e.isEditable();switch(r){case"cut":return n&&Ze(e,W,t);case"copy":return Ze(e,M,t);case"paste":return n&&Ze(e,c,t);case"dragstart":return n&&Ze(e,O,t);case"dragover":return n&&Ze(e,I,t);case"dragend":return n&&Ze(e,A,t);case"focus":return n&&Ze(e,J,t);case"blur":return n&&Ze(e,U,t);case"drop":return n&&Ze(e,D,t)}};t.addEventListener(r,o),i.push(()=>{t.removeEventListener(r,o)})}}(t,this),null!=n&&t.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;as("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,e){t.isEmpty()&&Rt(38),Xt(this);const n=this._pendingEditorState,r=this._updateTags,i=void 0!==e?e.tag:null;null===n||n.isEmpty()||(null!=i&&r.add(i),cs(this)),this._pendingEditorState=t,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=i&&r.add(i),cs(this)}parseEditorState(t,e){return function(t,e,n){const r=Ss(),s=ji,o=Vi,l=e._dirtyElements,c=e._dirtyLeaves,a=e._cloneNotNeeded,u=e._dirtyType;e._dirtyElements=new Map,e._dirtyLeaves=new Set,e._cloneNotNeeded=new Set,e._dirtyType=0,Ui=r,ji=!1,Vi=e;try{const i=e._nodes;os(t.root,i),n&&n(),r._readOnly=!0}catch(t){t instanceof Error&&e._onError(t)}finally{e._dirtyElements=l,e._dirtyLeaves=c,e._cloneNotNeeded=a,e._dirtyType=u,Ui=i,ji=s,Vi=o}return r}("string"==typeof t?JSON.parse(t):t,this,e)}read(t){return cs(this),this.getEditorState().read(t,{editor:this})}update(t,e){hs(this,t,e)}focus(t,e={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),hs(this,()=>{const t=Oi(),n=we();null!==t?t.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===e.defaultSelection?n.selectStart():n.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),t&&t()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;null!==t&&t.blur();const e=yn(this._window);null!==e&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,as("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ms.version="0.17.1+prod.esm";const mod=Object.freeze({$addUpdateTag:function(t){Yi(),ts()._updateTags.add(t)},$applyNodeReplacement:fn,$cloneWithProperties:Pn,$copyNode:un,$createLineBreakNode:Kr,$createNodeSelection:Fi,$createParagraphNode:Ns,$createPoint:di,$createRangeSelection:function(){const t=di("root",0,"element"),e=di("root",0,"element");return new mi(t,e,0,"")},$createRangeSelectionFromDom:function(t,e){return Li(null,t,e,null)},$createTabNode:ai,$createTextNode:si,$getAdjacentNode:Xe,$getCharacterOffsets:Si,$getEditor:function(){return ts()},$getNearestNodeFromDOMNode:Ce,$getNearestRootOrShadowRoot:cn,$getNodeByKey:Se,$getNodeByKeyOrThrow:function(t){const e=Se(t);return null===e&&Rt(63,t),e},$getPreviousSelection:Ii,$getRoot:we,$getSelection:Oi,$getTextContent:function(){const t=Oi();return null===t?"":t.getTextContent()},$hasAncestor:sn,$hasUpdateTag:function(t){return ts()._updateTags.has(t)},$insertNodes:function(t){let e=Oi()||Ii();null===e&&(e=we().selectEnd()),e.insertNodes(t)},$isBlockElementNode:function(t){return _s(t)&&!t.isInline()},$isDecoratorNode:ms,$isElementNode:_s,$isInlineElementOrDecoratorNode:function(t){return _s(t)&&t.isInline()||ms(t)&&t.isInline()},$isLeafNode:function(t){return oi(t)||$r(t)||ms(t)},$isLineBreakNode:$r,$isNodeSelection:xi,$isParagraphNode:Es,$isRangeSelection:yi,$isRootNode:vs,$isRootOrShadowRoot:an,$isTabNode:ui,$isTextNode:oi,$isTokenOrSegmented:fe,$nodesOfType:function(t){const e=t.getType(),n=Gi();if(n._readOnly){const t=En(n).get(e);return t?Array.from(t.values()):[]}const r=n._nodeMap,i=[];for(const[,n]of r)n instanceof t&&n.__type===e&&n.isAttached()&&i.push(n);return i},$normalizeSelection__EXPERIMENTAL:ee,$parseSerializedNode:function(t){return os(t,ts()._nodes)},$selectAll:function(){const t=we();Ee(ee(t.select(0,t.getChildrenSize())))},$setCompositionKey:xe,$setSelection:Ee,$splitNode:function(t,e){let n=t.getChildAtIndex(e);null==n&&(n=t),an(t)&&Rt(102);const r=t=>{const e=t.getParentOrThrow(),i=an(e),s=t!==n||i?un(t):t;if(i)return _s(t)&&_s(s)||Rt(133),t.insertAfter(s),[t,s,s];{const[n,i,o]=r(e),l=t.getNextSiblings();return o.append(s,...l),[n,i,s]}},[i,s]=r(n);return[i,s]},ArtificialNode__DO_NOT_USE:ks,BLUR_COMMAND:U,CAN_REDO_COMMAND:{},CAN_UNDO_COMMAND:{},CLEAR_EDITOR_COMMAND:{},CLEAR_HISTORY_COMMAND:{},CLICK_COMMAND:r,COMMAND_PRIORITY_CRITICAL:4,COMMAND_PRIORITY_EDITOR:0,COMMAND_PRIORITY_HIGH:3,COMMAND_PRIORITY_LOW:1,COMMAND_PRIORITY_NORMAL:2,CONTROLLED_TEXT_INSERTION_COMMAND:l,COPY_COMMAND:M,CUT_COMMAND:W,DELETE_CHARACTER_COMMAND:i,DELETE_LINE_COMMAND:f,DELETE_WORD_COMMAND:u,DRAGEND_COMMAND:A,DRAGOVER_COMMAND:I,DRAGSTART_COMMAND:O,DROP_COMMAND:D,DecoratorNode:ys,ElementNode:gs,FOCUS_COMMAND:J,FORMAT_ELEMENT_COMMAND:{},FORMAT_TEXT_COMMAND:d,INDENT_CONTENT_COMMAND:{},INSERT_LINE_BREAK_COMMAND:s,INSERT_PARAGRAPH_COMMAND:o,INSERT_TAB_COMMAND:{},IS_ALL_FORMATTING:255,IS_BOLD:1,IS_CODE:16,IS_HIGHLIGHT:128,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_UNDERLINE:8,KEY_ARROW_DOWN_COMMAND:S,KEY_ARROW_LEFT_COMMAND:m,KEY_ARROW_RIGHT_COMMAND:p,KEY_ARROW_UP_COMMAND:v,KEY_BACKSPACE_COMMAND:k,KEY_DELETE_COMMAND:w,KEY_DOWN_COMMAND:_,KEY_ENTER_COMMAND:T,KEY_ESCAPE_COMMAND:b,KEY_MODIFIER_COMMAND:V,KEY_SPACE_COMMAND:C,KEY_TAB_COMMAND:N,LineBreakNode:Br,MOVE_TO_END:y,MOVE_TO_START:x,OUTDENT_CONTENT_COMMAND:{},PASTE_COMMAND:c,ParagraphNode:bs,REDO_COMMAND:g,REMOVE_TEXT_COMMAND:a,RootNode:xs,SELECTION_CHANGE_COMMAND:e,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:{},SELECT_ALL_COMMAND:z,TEXT_TYPE_TO_FORMAT:Ot,TabNode:ci,TextNode:Xr,UNDO_COMMAND:h,createCommand:function(t){return{}},createEditor:function(t){const e=t||{},n=Vi,r=e.theme||{},i=void 0===t?n:e.parentEditor||null,s=e.disableEvents||!1,o=Ss(),l=e.namespace||(null!==i?i._config.namespace:Oe()),c=e.editorState,a=[xs,Xr,Br,ci,bs,ks,...e.nodes||[]],{onError:u,html:f}=e,d=void 0===e.editable||e.editable;let h;if(void 0===t&&null!==n)h=n._nodes;else{h=new Map;for(let t=0;t<a.length;t++){let e=a[t],n=null,r=null;if("function"!=typeof e){const t=e;e=t.replace,n=t.with,r=t.withKlass||null}const i=e.getType(),s=e.transform(),o=new Set;null!==s&&o.add(s),h.set(i,{exportDOM:f&&f.export?f.export.get(e):void 0,klass:e,replace:n,replaceWithKlass:r,transforms:o})}}const g=new Ms(o,i,h,{disableEvents:s,namespace:l,theme:r},u||console.error,function(t,e){const n=new Map,r=new Set,i=t=>{Object.keys(t).forEach(e=>{let r=n.get(e);void 0===r&&(r=[],n.set(e,r)),r.push(t[e])})};return t.forEach(t=>{const e=t.klass.importDOM;if(null==e||r.has(e))return;r.add(e);const n=e.call(t.klass);null!==n&&i(n)}),e&&i(e),n}(h,f?f.import:void 0),d);return void 0!==c&&(g._pendingEditorState=c,g._dirtyType=2),g},getEditorPropertyFromDOMNode:ue,getNearestEditorFromDOMNode:ae,isBlockDomNode:Tn,isCurrentlyReadOnlyMode:Xi,isHTMLAnchorElement:function(t){return vn(t)&&"A"===t.tagName},isHTMLElement:vn,isInlineDomNode:Sn,isLexicalEditor:ce,isSelectionCapturedInDecoratorInput:oe,isSelectionWithinEditor:le,resetRandomKey:function(){re=1}}),$addUpdateTag$1=mod.$addUpdateTag,$applyNodeReplacement$1=mod.$applyNodeReplacement,$cloneWithProperties$1=mod.$cloneWithProperties,$copyNode$1=mod.$copyNode,$createLineBreakNode$1=mod.$createLineBreakNode,$createNodeSelection$1=mod.$createNodeSelection,$createParagraphNode$1=mod.$createParagraphNode,$createPoint$1=mod.$createPoint,$createRangeSelection$1=mod.$createRangeSelection,$createRangeSelectionFromDom$1=mod.$createRangeSelectionFromDom,$createTabNode$1=mod.$createTabNode,$createTextNode$1=mod.$createTextNode,$getAdjacentNode$1=mod.$getAdjacentNode,$getCharacterOffsets$1=mod.$getCharacterOffsets,$getEditor$1=mod.$getEditor,$getNearestNodeFromDOMNode$1=mod.$getNearestNodeFromDOMNode,$getNearestRootOrShadowRoot$1=mod.$getNearestRootOrShadowRoot,$getNodeByKey$1=mod.$getNodeByKey,$getNodeByKeyOrThrow$1=mod.$getNodeByKeyOrThrow,$getPreviousSelection$1=mod.$getPreviousSelection,$getRoot$1=mod.$getRoot,$getSelection$1=mod.$getSelection,$getTextContent$1=mod.$getTextContent,$hasAncestor$1=mod.$hasAncestor,$hasUpdateTag$1=mod.$hasUpdateTag,$insertNodes$1=mod.$insertNodes,$isBlockElementNode$1=mod.$isBlockElementNode,$isDecoratorNode$1=mod.$isDecoratorNode,$isElementNode$1=mod.$isElementNode,$isInlineElementOrDecoratorNode$1=mod.$isInlineElementOrDecoratorNode,$isLeafNode$1=mod.$isLeafNode,$isLineBreakNode$1=mod.$isLineBreakNode,$isNodeSelection$1=mod.$isNodeSelection,$isParagraphNode$1=mod.$isParagraphNode,$isRangeSelection$1=mod.$isRangeSelection,$isRootNode$1=mod.$isRootNode,$isRootOrShadowRoot$1=mod.$isRootOrShadowRoot,$isTabNode$1=mod.$isTabNode,$isTextNode$1=mod.$isTextNode,$isTokenOrSegmented$1=mod.$isTokenOrSegmented,$nodesOfType$1=mod.$nodesOfType,$normalizeSelection__EXPERIMENTAL=mod.$normalizeSelection__EXPERIMENTAL,$parseSerializedNode$1=mod.$parseSerializedNode,$selectAll$1=mod.$selectAll,$setCompositionKey$1=mod.$setCompositionKey,$setSelection$1=mod.$setSelection,$splitNode$1=mod.$splitNode,ArtificialNode__DO_NOT_USE$1=mod.ArtificialNode__DO_NOT_USE,BLUR_COMMAND$1=mod.BLUR_COMMAND,CAN_REDO_COMMAND$1=mod.CAN_REDO_COMMAND,CAN_UNDO_COMMAND$1=mod.CAN_UNDO_COMMAND,CLEAR_EDITOR_COMMAND$1=mod.CLEAR_EDITOR_COMMAND,CLEAR_HISTORY_COMMAND$1=mod.CLEAR_HISTORY_COMMAND,CLICK_COMMAND$1=mod.CLICK_COMMAND,COMMAND_PRIORITY_CRITICAL$1=mod.COMMAND_PRIORITY_CRITICAL,COMMAND_PRIORITY_EDITOR$1=mod.COMMAND_PRIORITY_EDITOR,COMMAND_PRIORITY_HIGH$1=mod.COMMAND_PRIORITY_HIGH,COMMAND_PRIORITY_LOW$1=mod.COMMAND_PRIORITY_LOW,COMMAND_PRIORITY_NORMAL$1=mod.COMMAND_PRIORITY_NORMAL,CONTROLLED_TEXT_INSERTION_COMMAND$1=mod.CONTROLLED_TEXT_INSERTION_COMMAND,COPY_COMMAND$1=mod.COPY_COMMAND,CUT_COMMAND$1=mod.CUT_COMMAND,DELETE_CHARACTER_COMMAND$1=mod.DELETE_CHARACTER_COMMAND,DELETE_LINE_COMMAND$1=mod.DELETE_LINE_COMMAND,DELETE_WORD_COMMAND$1=mod.DELETE_WORD_COMMAND,DRAGEND_COMMAND$1=mod.DRAGEND_COMMAND,DRAGOVER_COMMAND$1=mod.DRAGOVER_COMMAND,DRAGSTART_COMMAND$1=mod.DRAGSTART_COMMAND,DROP_COMMAND$1=mod.DROP_COMMAND,DecoratorNode$1=mod.DecoratorNode,ElementNode$1=mod.ElementNode,FOCUS_COMMAND$1=mod.FOCUS_COMMAND,FORMAT_ELEMENT_COMMAND$1=mod.FORMAT_ELEMENT_COMMAND,FORMAT_TEXT_COMMAND$1=mod.FORMAT_TEXT_COMMAND,INDENT_CONTENT_COMMAND$1=mod.INDENT_CONTENT_COMMAND,INSERT_LINE_BREAK_COMMAND$1=mod.INSERT_LINE_BREAK_COMMAND,INSERT_PARAGRAPH_COMMAND$1=mod.INSERT_PARAGRAPH_COMMAND,INSERT_TAB_COMMAND$1=mod.INSERT_TAB_COMMAND,IS_ALL_FORMATTING$1=mod.IS_ALL_FORMATTING,IS_BOLD$1=mod.IS_BOLD,IS_CODE$1=mod.IS_CODE,IS_HIGHLIGHT$1=mod.IS_HIGHLIGHT,IS_ITALIC$1=mod.IS_ITALIC,IS_STRIKETHROUGH$1=mod.IS_STRIKETHROUGH,IS_SUBSCRIPT$1=mod.IS_SUBSCRIPT,IS_SUPERSCRIPT$1=mod.IS_SUPERSCRIPT,IS_UNDERLINE$1=mod.IS_UNDERLINE,KEY_ARROW_DOWN_COMMAND$1=mod.KEY_ARROW_DOWN_COMMAND,KEY_ARROW_LEFT_COMMAND$1=mod.KEY_ARROW_LEFT_COMMAND,KEY_ARROW_RIGHT_COMMAND$1=mod.KEY_ARROW_RIGHT_COMMAND,KEY_ARROW_UP_COMMAND$1=mod.KEY_ARROW_UP_COMMAND,KEY_BACKSPACE_COMMAND$1=mod.KEY_BACKSPACE_COMMAND,KEY_DELETE_COMMAND$1=mod.KEY_DELETE_COMMAND,KEY_DOWN_COMMAND$1=mod.KEY_DOWN_COMMAND,KEY_ENTER_COMMAND$1=mod.KEY_ENTER_COMMAND,KEY_ESCAPE_COMMAND$1=mod.KEY_ESCAPE_COMMAND,KEY_MODIFIER_COMMAND$1=mod.KEY_MODIFIER_COMMAND,KEY_SPACE_COMMAND$1=mod.KEY_SPACE_COMMAND,KEY_TAB_COMMAND$1=mod.KEY_TAB_COMMAND,LineBreakNode$1=mod.LineBreakNode,MOVE_TO_END$1=mod.MOVE_TO_END,MOVE_TO_START$1=mod.MOVE_TO_START,OUTDENT_CONTENT_COMMAND$1=mod.OUTDENT_CONTENT_COMMAND,PASTE_COMMAND$1=mod.PASTE_COMMAND,ParagraphNode$1=mod.ParagraphNode,REDO_COMMAND$1=mod.REDO_COMMAND,REMOVE_TEXT_COMMAND$1=mod.REMOVE_TEXT_COMMAND,RootNode$1=mod.RootNode,SELECTION_CHANGE_COMMAND$1=mod.SELECTION_CHANGE_COMMAND,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND$1=mod.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,SELECT_ALL_COMMAND$1=mod.SELECT_ALL_COMMAND,TEXT_TYPE_TO_FORMAT$1=mod.TEXT_TYPE_TO_FORMAT,TabNode$1=mod.TabNode,TextNode$1=mod.TextNode,UNDO_COMMAND$1=mod.UNDO_COMMAND,createCommand$1=mod.createCommand,createEditor$1=mod.createEditor,getEditorPropertyFromDOMNode$1=mod.getEditorPropertyFromDOMNode,getNearestEditorFromDOMNode$1=mod.getNearestEditorFromDOMNode,isBlockDomNode$1=mod.isBlockDomNode,isCurrentlyReadOnlyMode$1=mod.isCurrentlyReadOnlyMode,isHTMLAnchorElement$1=mod.isHTMLAnchorElement,isHTMLElement$1=mod.isHTMLElement,isInlineDomNode$1=mod.isInlineDomNode,isLexicalEditor$1=mod.isLexicalEditor,isSelectionCapturedInDecoratorInput$1=mod.isSelectionCapturedInDecoratorInput,isSelectionWithinEditor$1=mod.isSelectionWithinEditor,resetRandomKey$1=mod.resetRandomKey;var Lexical=Object.freeze({$addUpdateTag:$addUpdateTag$1,$applyNodeReplacement:$applyNodeReplacement$1,$cloneWithProperties:$cloneWithProperties$1,$copyNode:$copyNode$1,$createLineBreakNode:$createLineBreakNode$1,$createNodeSelection:$createNodeSelection$1,$createParagraphNode:$createParagraphNode$1,$createPoint:$createPoint$1,$createRangeSelection:$createRangeSelection$1,$createRangeSelectionFromDom:$createRangeSelectionFromDom$1,$createTabNode:$createTabNode$1,$createTextNode:$createTextNode$1,$getAdjacentNode:$getAdjacentNode$1,$getCharacterOffsets:$getCharacterOffsets$1,$getEditor:$getEditor$1,$getNearestNodeFromDOMNode:$getNearestNodeFromDOMNode$1,$getNearestRootOrShadowRoot:$getNearestRootOrShadowRoot$1,$getNodeByKey:$getNodeByKey$1,$getNodeByKeyOrThrow:$getNodeByKeyOrThrow$1,$getPreviousSelection:$getPreviousSelection$1,$getRoot:$getRoot$1,$getSelection:$getSelection$1,$getTextContent:$getTextContent$1,$hasAncestor:$hasAncestor$1,$hasUpdateTag:$hasUpdateTag$1,$insertNodes:$insertNodes$1,$isBlockElementNode:$isBlockElementNode$1,$isDecoratorNode:$isDecoratorNode$1,$isElementNode:$isElementNode$1,$isInlineElementOrDecoratorNode:$isInlineElementOrDecoratorNode$1,$isLeafNode:$isLeafNode$1,$isLineBreakNode:$isLineBreakNode$1,$isNodeSelection:$isNodeSelection$1,$isParagraphNode:$isParagraphNode$1,$isRangeSelection:$isRangeSelection$1,$isRootNode:$isRootNode$1,$isRootOrShadowRoot:$isRootOrShadowRoot$1,$isTabNode:$isTabNode$1,$isTextNode:$isTextNode$1,$isTokenOrSegmented:$isTokenOrSegmented$1,$nodesOfType:$nodesOfType$1,$normalizeSelection__EXPERIMENTAL:$normalizeSelection__EXPERIMENTAL,$parseSerializedNode:$parseSerializedNode$1,$selectAll:$selectAll$1,$setCompositionKey:$setCompositionKey$1,$setSelection:$setSelection$1,$splitNode:$splitNode$1,ArtificialNode__DO_NOT_USE:ArtificialNode__DO_NOT_USE$1,BLUR_COMMAND:BLUR_COMMAND$1,CAN_REDO_COMMAND:CAN_REDO_COMMAND$1,CAN_UNDO_COMMAND:CAN_UNDO_COMMAND$1,CLEAR_EDITOR_COMMAND:CLEAR_EDITOR_COMMAND$1,CLEAR_HISTORY_COMMAND:CLEAR_HISTORY_COMMAND$1,CLICK_COMMAND:CLICK_COMMAND$1,COMMAND_PRIORITY_CRITICAL:COMMAND_PRIORITY_CRITICAL$1,COMMAND_PRIORITY_EDITOR:COMMAND_PRIORITY_EDITOR$1,COMMAND_PRIORITY_HIGH:COMMAND_PRIORITY_HIGH$1,COMMAND_PRIORITY_LOW:COMMAND_PRIORITY_LOW$1,COMMAND_PRIORITY_NORMAL:COMMAND_PRIORITY_NORMAL$1,CONTROLLED_TEXT_INSERTION_COMMAND:CONTROLLED_TEXT_INSERTION_COMMAND$1,COPY_COMMAND:COPY_COMMAND$1,CUT_COMMAND:CUT_COMMAND$1,DELETE_CHARACTER_COMMAND:DELETE_CHARACTER_COMMAND$1,DELETE_LINE_COMMAND:DELETE_LINE_COMMAND$1,DELETE_WORD_COMMAND:DELETE_WORD_COMMAND$1,DRAGEND_COMMAND:DRAGEND_COMMAND$1,DRAGOVER_COMMAND:DRAGOVER_COMMAND$1,DRAGSTART_COMMAND:DRAGSTART_COMMAND$1,DROP_COMMAND:DROP_COMMAND$1,DecoratorNode:DecoratorNode$1,ElementNode:ElementNode$1,FOCUS_COMMAND:FOCUS_COMMAND$1,FORMAT_ELEMENT_COMMAND:FORMAT_ELEMENT_COMMAND$1,FORMAT_TEXT_COMMAND:FORMAT_TEXT_COMMAND$1,INDENT_CONTENT_COMMAND:INDENT_CONTENT_COMMAND$1,INSERT_LINE_BREAK_COMMAND:INSERT_LINE_BREAK_COMMAND$1,INSERT_PARAGRAPH_COMMAND:INSERT_PARAGRAPH_COMMAND$1,INSERT_TAB_COMMAND:INSERT_TAB_COMMAND$1,IS_ALL_FORMATTING:IS_ALL_FORMATTING$1,IS_BOLD:IS_BOLD$1,IS_CODE:IS_CODE$1,IS_HIGHLIGHT:IS_HIGHLIGHT$1,IS_ITALIC:IS_ITALIC$1,IS_STRIKETHROUGH:IS_STRIKETHROUGH$1,IS_SUBSCRIPT:IS_SUBSCRIPT$1,IS_SUPERSCRIPT:IS_SUPERSCRIPT$1,IS_UNDERLINE:IS_UNDERLINE$1,KEY_ARROW_DOWN_COMMAND:KEY_ARROW_DOWN_COMMAND$1,KEY_ARROW_LEFT_COMMAND:KEY_ARROW_LEFT_COMMAND$1,KEY_ARROW_RIGHT_COMMAND:KEY_ARROW_RIGHT_COMMAND$1,KEY_ARROW_UP_COMMAND:KEY_ARROW_UP_COMMAND$1,KEY_BACKSPACE_COMMAND:KEY_BACKSPACE_COMMAND$1,KEY_DELETE_COMMAND:KEY_DELETE_COMMAND$1,KEY_DOWN_COMMAND:KEY_DOWN_COMMAND$1,KEY_ENTER_COMMAND:KEY_ENTER_COMMAND$1,KEY_ESCAPE_COMMAND:KEY_ESCAPE_COMMAND$1,KEY_MODIFIER_COMMAND:KEY_MODIFIER_COMMAND$1,KEY_SPACE_COMMAND:KEY_SPACE_COMMAND$1,KEY_TAB_COMMAND:KEY_TAB_COMMAND$1,LineBreakNode:LineBreakNode$1,MOVE_TO_END:MOVE_TO_END$1,MOVE_TO_START:MOVE_TO_START$1,OUTDENT_CONTENT_COMMAND:OUTDENT_CONTENT_COMMAND$1,PASTE_COMMAND:PASTE_COMMAND$1,ParagraphNode:ParagraphNode$1,REDO_COMMAND:REDO_COMMAND$1,REMOVE_TEXT_COMMAND:REMOVE_TEXT_COMMAND$1,RootNode:RootNode$1,SELECTION_CHANGE_COMMAND:SELECTION_CHANGE_COMMAND$1,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:SELECTION_INSERT_CLIPBOARD_NODES_COMMAND$1,SELECT_ALL_COMMAND:SELECT_ALL_COMMAND$1,TEXT_TYPE_TO_FORMAT:TEXT_TYPE_TO_FORMAT$1,TabNode:TabNode$1,TextNode:TextNode$1,UNDO_COMMAND:UNDO_COMMAND$1,createCommand:createCommand$1,createEditor:createEditor$1,getEditorPropertyFromDOMNode:getEditorPropertyFromDOMNode$1,getNearestEditorFromDOMNode:getNearestEditorFromDOMNode$1,isBlockDomNode:isBlockDomNode$1,isCurrentlyReadOnlyMode:isCurrentlyReadOnlyMode$1,isHTMLAnchorElement:isHTMLAnchorElement$1,isHTMLElement:isHTMLElement$1,isInlineDomNode:isInlineDomNode$1,isLexicalEditor:isLexicalEditor$1,isSelectionCapturedInDecoratorInput:isSelectionCapturedInDecoratorInput$1,isSelectionWithinEditor:isSelectionWithinEditor$1,resetRandomKey:resetRandomKey$1});var T$1=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const x$1=new Map;function S$1(e){let t=e;for(;null!=t;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function v$1(e){const t=e.parentNode;if(null==t)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function w$1(e){const t={},n=e.split(";");for(const e of n)if(""!==e){const[n,l]=e.split(/:([^]+)/);n&&l&&(t[n.trim()]=l.trim())}return t}function N$1(e){let t=x$1.get(e);return void 0===t&&(t=w$1(e),x$1.set(e,t)),t}function K$1(t,c,f){let u=c.getNode(),g=f;if($isElementNode$1(u)){const e=u.getDescendantByIndex(c.offset);null!==e&&(u=e)}for(;g>0&&null!==u;){if($isElementNode$1(u)){const e=u.getLastDescendant();null!==e&&(u=e)}let f=u.getPreviousSibling(),a=0;if(null===f){let e=u.getParentOrThrow(),t=e.getPreviousSibling();for(;null===t;){if(e=e.getParent(),null===e){f=null;break}t=e.getPreviousSibling()}null!==e&&(a=e.isInline()?0:2,f=t)}let d=u.getTextContent();""===d&&$isElementNode$1(u)&&!u.isInline()&&(d="\n\n");const p=d.length;if(!$isTextNode$1(u)||g>=p){const e=u.getParent();u.remove(),null==e||0!==e.getChildrenSize()||$isRootNode$1(e)||e.remove(),g-=p+a,u=f}else{const n=u.getKey(),l=t.getEditorState().read(()=>{const t=$getNodeByKey$1(n);return $isTextNode$1(t)&&t.isSimpleText()?t.getTextContent():null}),f=p-g,a=d.slice(0,f);if(null!==l&&l!==d){const e=$getPreviousSelection$1();let t=u;if(u.isSimpleText())u.setTextContent(l);else{const e=$createTextNode$1(l);u.replace(e),t=e}if($isRangeSelection$1(e)&&e.isCollapsed()){const n=e.anchor.offset;t.select(n,n)}}else if(u.isSimpleText()){const e=c.key===n;let t=c.offset;t<g&&(t=p);const l=e?t-g:0,o=e?t:f;if(e&&0===l){const[e]=u.splitText(l,o);e.remove()}else{const[,e]=u.splitText(l,o);e.remove()}}else{const e=$createTextNode$1(a);u.replace(e)}g=0}}}function O$1(e,t){const n=N$1("getStyle"in e?e.getStyle():e.style),l=Object.entries(t).reduce((t,[l,o])=>("function"==typeof o?t[l]=o(n[l],e):null===o?delete t[l]:t[l]=o,t),{...n}||{}),o=function(e){let t="";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}(l);e.setStyle(o),x$1.set(o,l)}function b$1(e){return e.getNode().isAttached()}function R$1(e){let t=e;for(;null!==t&&!$isRootOrShadowRoot$1(t);){const e=t.getLatest(),n=t.getParent();0===e.getChildrenSize()&&t.remove(!0),t=n}}function z$1(e,t,l,o,s=null){if(0===t.length)return;const c=t[0],f=new Map,g=[];let p=$isElementNode$1(c)?c:c.getParentOrThrow();p.isInline()&&(p=p.getParentOrThrow());let h=!1;for(;null!==p;){const e=p.getPreviousSibling();if(null!==e){p=e,h=!0;break}if(p=p.getParentOrThrow(),$isRootOrShadowRoot$1(p))break}const y=new Set;for(let e=0;e<l;e++){const l=t[e];$isElementNode$1(l)&&0===l.getChildrenSize()&&y.add(l.getKey())}const m=new Set;for(let e=0;e<l;e++){const l=t[e];let r=l.getParent();if(null!==r&&r.isInline()&&(r=r.getParent()),null!==r&&$isLeafNode$1(l)&&!m.has(l.getKey())){const e=r.getKey();if(void 0===f.get(e)){const t=o();t.setFormat(r.getFormatType()),t.setIndent(r.getIndent()),g.push(t),f.set(e,t),r.getChildren().forEach(e=>{t.append(e),m.add(e.getKey()),$isElementNode$1(e)&&e.getChildrenKeys().forEach(e=>m.add(e))}),R$1(r)}}else if(y.has(l.getKey())){$isElementNode$1(l)||T$1(179);const e=o();e.setFormat(l.getFormatType()),e.setIndent(l.getIndent()),g.push(e),l.remove(!0)}}if(null!==s)for(let e=0;e<g.length;e++){const t=g[e];s.append(t)}let x=null;if($isRootOrShadowRoot$1(p))if(h)if(null!==s)p.insertAfter(s);else for(let e=g.length-1;e>=0;e--){const t=g[e];p.insertAfter(t)}else{const e=p.getFirstChild();if($isElementNode$1(e)&&(p=e),null===e)if(s)p.append(s);else for(let e=0;e<g.length;e++){const t=g[e];p.append(t),x=t}else if(null!==s)e.insertBefore(s);else for(let t=0;t<g.length;t++){const n=g[t];e.insertBefore(n),x=n}}else if(s)p.insertAfter(s);else for(let e=g.length-1;e>=0;e--){const t=g[e];p.insertAfter(t),x=t}const S=$getPreviousSelection$1();$isRangeSelection$1(S)&&b$1(S.anchor)&&b$1(S.focus)?$setSelection$1(S.clone()):null!==x?x.selectEnd():e.dirty=!0}function L$1(e,t,n,l){e.modify(t?"extend":"move",n,l)}function D$1(e){const t=e.anchor.getNode();return"rtl"===($isRootNode$1(t)?t:t.getParentOrThrow()).getDirection()}function H$1(e,t,n){const l=N$1(e.getStyle());return null!==l&&l[t]||n}function U$1(t){if($isDecoratorNode$1(t))return!1;if(!$isElementNode$1(t)||$isRootOrShadowRoot$1(t))return!1;const l=t.getFirstChild(),o=null===l||$isLineBreakNode$1(l)||$isTextNode$1(l)||l.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&o}const W$1=K$1;const mod$1=Object.freeze({$addNodeStyle:function(e){const t=e.getStyle(),n=w$1(t);x$1.set(t,n)},$getSelectionStyleValueForProperty:function(t,n,l=""){let o=null;const r=t.getNodes(),s=t.anchor,c=t.focus,f=t.isBackward(),u=f?c.offset:s.offset,g=f?c.getNode():s.getNode();if($isRangeSelection$1(t)&&t.isCollapsed()&&""!==t.style){const e=N$1(t.style);if(null!==e&&n in e)return e[n]}for(let t=0;t<r.length;t++){const s=r[t];if((0===t||0!==u||!s.is(g))&&$isTextNode$1(s)){const e=H$1(s,n,l);if(null===o)o=e;else if(o!==e){o="";break}}}return null===o?l:o},$isAtNodeEnd:function(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return $isElementNode$1(t)||T$1(177),e.offset===t.getChildrenSize()},$isParentElementRTL:D$1,$moveCaretSelection:L$1,$moveCharacter:function(e,t,n){const l=D$1(e);L$1(e,t,n?!l:l,"character")},$patchStyleText:function(t,n){const l=t.getNodes(),o=l.length,r=t.getStartEndPoints();if(null===r)return;const[s,f]=r,u=o-1;let g=l[0],a=l[u];if(t.isCollapsed()&&$isRangeSelection$1(t))return void O$1(t,n);const d=g.getTextContent().length,p=f.offset;let h=s.offset;const y=s.isBefore(f);let m=y?h:p,T=y?p:h;const x=y?s.type:f.type,S=y?f.type:s.type,v=y?f.key:s.key;if($isTextNode$1(g)&&m===d){const t=g.getNextSibling();$isTextNode$1(t)&&(h=0,m=0,g=t)}if(1===l.length){if($isTextNode$1(g)&&g.canHaveFormat()){if(m="element"===x?0:h>p?p:h,T="element"===S?d:h>p?h:p,m===T)return;if($isTokenOrSegmented$1(g)||0===m&&T===d)O$1(g,n),g.select(m,T);else{const e=g.splitText(m,T),t=0===m?e[0]:e[1];O$1(t,n),t.select(0,T-m)}}}else{if($isTextNode$1(g)&&m<g.getTextContentSize()&&g.canHaveFormat()&&(0===m||$isTokenOrSegmented$1(g)||(g=g.splitText(m)[1],m=0,y?s.set(g.getKey(),m,"text"):f.set(g.getKey(),m,"text")),O$1(g,n)),$isTextNode$1(a)&&a.canHaveFormat()){const e=a.getTextContent().length;a.__key!==v&&0!==T&&(T=e),T===e||$isTokenOrSegmented$1(a)||([a]=a.splitText(T)),0===T&&"element"!==S||O$1(a,n)}for(let t=1;t<u;t++){const o=l[t],r=o.getKey();$isTextNode$1(o)&&o.canHaveFormat()&&r!==g.getKey()&&r!==a.getKey()&&!o.isToken()&&O$1(o,n)}}},$selectAll:function(t){const l=t.anchor,o=t.focus,r=l.getNode().getTopLevelElementOrThrow().getParentOrThrow();let s=r.getFirstDescendant(),i=r.getLastDescendant(),c="element",f="element",u=0;$isTextNode$1(s)?c="text":$isElementNode$1(s)||null===s||(s=s.getParentOrThrow()),$isTextNode$1(i)?(f="text",u=i.getTextContentSize()):$isElementNode$1(i)||null===i||(i=i.getParentOrThrow()),s&&i&&(l.set(s.getKey(),0,c),o.set(i.getKey(),u,f))},$setBlocksType:function(e,t){if(null===e)return;const l=e.getStartEndPoints(),o=l?l[0]:null;if(null!==o&&"root"===o.key){const e=t(),n=$getRoot$1(),l=n.getFirstChild();return void(l?l.replace(e,!0):n.append(e))}const r=e.getNodes(),s=null!==o&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(o.getNode(),U$1);s&&-1===r.indexOf(s)&&r.push(s);for(let e=0;e<r.length;e++){const l=r[e];if(!U$1(l))continue;$isElementNode$1(l)||T$1(178);const o=t();o.setFormat(l.getFormatType()),o.setIndent(l.getIndent()),l.replace(o,!0)}},$shouldOverrideDefaultCharacterSelection:function(e,t){const l=$getAdjacentNode$1(e.focus,t);return $isDecoratorNode$1(l)&&!l.isIsolated()||$isElementNode$1(l)&&!l.isInline()&&!l.canBeEmpty()},$sliceSelectedTextNodeContent:function(e,n){const l=e.getStartEndPoints();if(n.isSelected(e)&&!n.isSegmented()&&!n.isToken()&&null!==l){const[o,r]=l,s=e.isBackward(),i=o.getNode(),c=r.getNode(),f=n.is(i),u=n.is(c);if(f||u){const[l,o]=$getCharacterOffsets$1(e),r=i.is(c),f=n.is(s?c:i),u=n.is(s?i:c);let g,a=0;return r?(a=l>o?o:l,g=l>o?l:o):f?(a=s?o:l,g=void 0):u&&(a=0,g=s?l:o),n.__text=n.__text.slice(a,g),n}}return n},$trimTextContentFromAnchor:K$1,$wrapNodes:function(e,t,n=null){const l=e.getStartEndPoints(),o=l?l[0]:null,r=e.getNodes(),s=r.length;if(null!==o&&(0===s||1===s&&"element"===o.type&&0===o.getNode().getChildrenSize())){const e="text"===o.type?o.getNode().getParentOrThrow():o.getNode(),l=e.getChildren();let r=t();return r.setFormat(e.getFormatType()),r.setIndent(e.getIndent()),l.forEach(e=>r.append(e)),n&&(r=n.append(r)),void e.replace(r)}let i=null,c=[];for(let l=0;l<s;l++){const o=r[l];$isRootOrShadowRoot$1(o)?(z$1(e,c,c.length,t,n),c=[],i=o):null===i||null!==i&&$hasAncestor$1(o,i)?c.push(o):(z$1(e,c,c.length,t,n),c=[o])}z$1(e,c,c.length,t,n)},createDOMRange:function(t,n,l,o,r){const s=n.getKey(),i=o.getKey(),c=document.createRange();let f=t.getElementByKey(s),u=t.getElementByKey(i),g=l,a=r;if($isTextNode$1(n)&&(f=S$1(f)),$isTextNode$1(o)&&(u=S$1(u)),void 0===n||void 0===o||null===f||null===u)return null;"BR"===f.nodeName&&([f,g]=v$1(f)),"BR"===u.nodeName&&([u,a]=v$1(u));const d=f.firstChild;f===u&&null!=d&&"BR"===d.nodeName&&0===g&&0===a&&(a=1);try{c.setStart(f,g),c.setEnd(u,a)}catch(e){return null}return!c.collapsed||g===a&&s===i||(c.setStart(u,a),c.setEnd(f,g)),c},createRectsFromDOMRange:function(e,t){const n=e.getRootElement();if(null===n)return[];const l=n.getBoundingClientRect(),o=getComputedStyle(n),r=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=Array.from(t.getClientRects());let i,c=s.length;s.sort((e,t)=>{const n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n});for(let e=0;e<c;e++){const t=s[e],n=i&&i.top<=t.top&&i.top+i.height>t.top&&i.left+i.width>t.left,o=t.width+r===l.width;n||o?(s.splice(e--,1),c--):i=t}return s},getStyleObjectFromCSS:N$1,trimTextContentFromAnchor:W$1,$cloneWithProperties:$cloneWithProperties$1}),$addNodeStyle$1=mod$1.$addNodeStyle,$cloneWithProperties$2=mod$1.$cloneWithProperties,$getSelectionStyleValueForProperty$1=mod$1.$getSelectionStyleValueForProperty,$isAtNodeEnd$1=mod$1.$isAtNodeEnd,$isParentElementRTL$1=mod$1.$isParentElementRTL,$moveCaretSelection$1=mod$1.$moveCaretSelection,$moveCharacter$1=mod$1.$moveCharacter,$patchStyleText$1=mod$1.$patchStyleText,$selectAll$3=mod$1.$selectAll,$setBlocksType$1=mod$1.$setBlocksType,$shouldOverrideDefaultCharacterSelection$1=mod$1.$shouldOverrideDefaultCharacterSelection,$sliceSelectedTextNodeContent$1=mod$1.$sliceSelectedTextNodeContent,$trimTextContentFromAnchor$1=mod$1.$trimTextContentFromAnchor,$wrapNodes$1=mod$1.$wrapNodes,createDOMRange$1=mod$1.createDOMRange,createRectsFromDOMRange$1=mod$1.createRectsFromDOMRange,getStyleObjectFromCSS$1=mod$1.getStyleObjectFromCSS,trimTextContentFromAnchor$1=mod$1.trimTextContentFromAnchor;var LexicalSelection=Object.freeze({$addNodeStyle:$addNodeStyle$1,$cloneWithProperties:$cloneWithProperties$2,$getSelectionStyleValueForProperty:$getSelectionStyleValueForProperty$1,$isAtNodeEnd:$isAtNodeEnd$1,$isParentElementRTL:$isParentElementRTL$1,$moveCaretSelection:$moveCaretSelection$1,$moveCharacter:$moveCharacter$1,$patchStyleText:$patchStyleText$1,$selectAll:$selectAll$3,$setBlocksType:$setBlocksType$1,$shouldOverrideDefaultCharacterSelection:$shouldOverrideDefaultCharacterSelection$1,$sliceSelectedTextNodeContent:$sliceSelectedTextNodeContent$1,$trimTextContentFromAnchor:$trimTextContentFromAnchor$1,$wrapNodes:$wrapNodes$1,createDOMRange:createDOMRange$1,createRectsFromDOMRange:createRectsFromDOMRange$1,getStyleObjectFromCSS:getStyleObjectFromCSS$1,trimTextContentFromAnchor:trimTextContentFromAnchor$1});const CAN_USE_DOM$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,documentMode$1=CAN_USE_DOM$1&&"documentMode"in document?document.documentMode:null,IS_CHROME$1=(CAN_USE_DOM$1&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),CAN_USE_DOM$1&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!CAN_USE_DOM$1||!("InputEvent"in window)||documentMode$1)&&new window.InputEvent("input"),CAN_USE_DOM$1&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),CAN_USE_DOM$1&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,CAN_USE_DOM$1&&/Android/.test(navigator.userAgent),CAN_USE_DOM$1&&/^(?=.*Chrome).*/i.test(navigator.userAgent));CAN_USE_DOM$1&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);var p$1=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const h$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,m$2=h$1&&"documentMode"in document?document.documentMode:null,v$2=h$1&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),y$1=h$1&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),w$2=!(!h$1||!("InputEvent"in window)||m$2)&&"getTargetRanges"in new window.InputEvent("input"),E$2=h$1&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),P$2=h$1&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,S$2=h$1&&/Android/.test(navigator.userAgent),x$2=h$1&&/^(?=.*Chrome).*/i.test(navigator.userAgent),N$2=h$1&&S$2&&x$2,A$2=h$1&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!x$2;function L$2(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function b$2(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function T$2(e){return e+"px"}const M$2={attributes:!0,characterData:!0,childList:!0,subtree:!0};function C$2(e,t,n){let o=null,r=null,l=null,i=[];const s=document.createElement("div");function u(){null===o&&p$1(182),null===r&&p$1(183);const{left:l,top:u}=o.getBoundingClientRect(),c=r,f=createRectsFromDOMRange$1(e,t);s.isConnected||c.append(s);let a=!1;for(let e=0;e<f.length;e++){const t=f[e],n=i[e]||document.createElement("div"),o=n.style;"absolute"!==o.position&&(o.position="absolute",a=!0);const r=T$2(t.left-l);o.left!==r&&(o.left=r,a=!0);const c=T$2(t.top-u);o.top!==c&&(n.style.top=c,a=!0);const d=T$2(t.width);o.width!==d&&(n.style.width=d,a=!0);const g=T$2(t.height);o.height!==g&&(n.style.height=g,a=!0),n.parentNode!==s&&(s.append(n),a=!0),i[e]=n}for(;i.length>f.length;)i.pop();a&&n(i)}function c(){r=null,o=null,null!==l&&l.disconnect(),l=null,s.remove();for(const e of i)e.remove();i=[]}const f=e.registerRootListener((function t(){const n=e.getRootElement();if(null===n)return c();const i=n.parentElement;if(!(i instanceof HTMLElement))return c();c(),o=n,r=i,l=new MutationObserver(n=>{const l=e.getRootElement(),i=l&&l.parentElement;if(l!==o||i!==r)return t();for(const e of n)if(!s.contains(e.target))return u()}),l.observe(i,M$2),u()}));return()=>{f(),c()}}const _$2=w$2,K$2=h$1,O$2=S$2,R$2=N$2,I$2=v$2,D$2=A$2,H$2=x$2,z$2=y$1,k$2=P$2,F$2=E$2;function W$2(e,t){for(const n of t)if(e.type.startsWith(n))return!0;return!1}const Q$1=(e,t)=>{let n=e;for(;n!==$getRoot$1()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};const mod$2=Object.freeze({$dfs:function(e,t){const n=[],l=(e||$getRoot$1()).getLatest(),i=t||$isElementNode$1(l)&&l.getLastDescendant()||l;let s=l,u=function(e){let t=e,n=0;for(;null!==(t=t.getParent());)n++;return n}(s);for(;null!==s&&!s.is(i);)if(n.push({depth:u,node:s}),$isElementNode$1(s)&&s.getChildrenSize()>0)s=s.getFirstChild(),u++;else{let e=null;for(;null===e&&null!==s;)e=s.getNextSibling(),null===e?(s=s.getParent(),u--):s=e}return null!==s&&s.is(i)&&n.push({depth:u,node:s}),n},$filter:function(e,t){const n=[];for(let o=0;o<e.length;o++){const r=t(e[o]);null!==r&&n.push(r)}return n},$findMatchingParent:Q$1,$getNearestBlockElementAncestorOrThrow:function(e){const t=Q$1(e,e=>$isElementNode$1(e)&&!e.isInline());return $isElementNode$1(t)||p$1(4,e.__key),t},$getNearestNodeOfType:function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null},$getNextRightPreorderNode:function(e){let t=e;if($isElementNode$1(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t},$insertFirst:function(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)},$insertNodeToNearestRoot:function(n){const r=$getSelection$1()||$getPreviousSelection$1();if($isRangeSelection$1(r)){const{focus:e}=r,t=e.getNode(),o=e.offset;if($isRootOrShadowRoot$1(t)){const e=t.getChildAtIndex(o);null==e?t.append(n):e.insertBefore(n),n.selectNext()}else{let e,r;$isTextNode$1(t)?(e=t.getParentOrThrow(),r=t.getIndexWithinParent(),o>0&&(r+=1,t.splitText(o))):(e=t,r=o);const[,l]=$splitNode$1(e,r);l.insertBefore(n),l.selectStart()}}else{if(null!=r){const e=r.getNodes();e[e.length-1].getTopLevelElementOrThrow().insertAfter(n)}else $getRoot$1().append(n);const e=$createParagraphNode$1();n.insertAfter(e),e.select()}return n.getLatest()},$isEditorIsNestedEditor:function(e){return null!==e._parentEditor},$restoreEditorState:function(e,t){const n=new Map,o=e._pendingEditorState;for(const[e,o]of t._nodeMap)n.set(e,$cloneWithProperties$1(o));o&&(o._nodeMap=n),e._dirtyType=2;const r=t._selection;$setSelection$1(null===r?null:r.clone())},$wrapNodeInElement:function(e,t){const n=t();return e.replace(n),n.append(e),n},CAN_USE_BEFORE_INPUT:_$2,CAN_USE_DOM:K$2,IS_ANDROID:O$2,IS_ANDROID_CHROME:R$2,IS_APPLE:I$2,IS_APPLE_WEBKIT:D$2,IS_CHROME:H$2,IS_FIREFOX:z$2,IS_IOS:k$2,IS_SAFARI:F$2,addClassNamesToElement:function(e,...t){const n=L$2(...t);n.length>0&&e.classList.add(...n)},calculateZoomLevel:function(e){if(z$2)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t},isMimeType:W$2,markSelection:function(o,r){let l=null,i=null,s=null,u=null,c=()=>{};function f(f){f.read(()=>{const f=$getSelection$1();if(!$isRangeSelection$1(f))return l=null,i=null,s=null,u=null,c(),void(c=()=>{});const{anchor:a,focus:d}=f,g=a.getNode(),h=g.getKey(),m=a.offset,v=d.getNode(),y=v.getKey(),w=d.offset,E=o.getElementByKey(h),P=o.getElementByKey(y),S=null===l||null===E||m!==i||h!==l.getKey()||g!==l&&(!(l instanceof TextNode$1)||g.updateDOM(l,E,o._config)),x=null===s||null===P||w!==u||y!==s.getKey()||v!==s&&(!(s instanceof TextNode$1)||v.updateDOM(s,P,o._config));if(S||x){const e=o.getElementByKey(a.getNode().getKey()),t=o.getElementByKey(d.getNode().getKey());if(null!==e&&null!==t&&"SPAN"===e.tagName&&"SPAN"===t.tagName){const n=document.createRange();let l,i,s,u;d.isBefore(a)?(l=t,i=d.offset,s=e,u=a.offset):(l=e,i=a.offset,s=t,u=d.offset);const f=l.firstChild;null===f&&p$1(181);const g=s.firstChild;null===g&&p$1(181),n.setStart(f,i),n.setEnd(g,u),c(),c=C$2(o,n,e=>{for(const t of e){const e=t.style;"Highlight"!==e.background&&(e.background="Highlight"),"HighlightText"!==e.color&&(e.color="HighlightText"),"-1"!==e.zIndex&&(e.zIndex="-1"),"none"!==e.pointerEvents&&(e.pointerEvents="none"),e.marginTop!==T$2(-1.5)&&(e.marginTop=T$2(-1.5)),e.paddingTop!==T$2(4)&&(e.paddingTop=T$2(4)),e.paddingBottom!==T$2(0)&&(e.paddingBottom=T$2(0))}void 0!==r&&r(e)})}}l=g,i=m,s=v,u=w})}return f(o.getEditorState()),b$2(o.registerUpdateListener(({editorState:e})=>f(e)),c,()=>{c()})},mediaFileReader:function(e,t){const n=e[Symbol.iterator]();return new Promise((e,o)=>{const r=[],l=()=>{const{done:i,value:s}=n.next();if(i)return e(r);const u=new FileReader;u.addEventListener("error",o),u.addEventListener("load",()=>{const e=u.result;"string"==typeof e&&r.push({file:s,result:e}),l()}),W$2(s,t)?u.readAsDataURL(s):l()};l()})},mergeRegister:b$2,objectKlassEquals:function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name},positionNodeOnRange:C$2,registerNestedElementResolver:function(e,t,n,o){const r=e=>e instanceof t;return e.registerNodeTransform(t,e=>{const t=(e=>{const t=e.getChildren();for(let e=0;e<t.length;e++){const n=t[e];if(r(n))return null}let n=e,o=e;for(;null!==n;)if(o=n,n=n.getParent(),r(n))return{child:o,parent:n};return null})(e);if(null!==t){const{child:r,parent:l}=t;if(r.is(e)){o(l,e);const t=r.getNextSiblings(),i=t.length;if(l.insertAfter(r),0!==i){const e=n(l);r.insertAfter(e);for(let n=0;n<i;n++)e.append(t[n])}l.canBeEmpty()||0!==l.getChildrenSize()||l.remove()}}})},removeClassNamesFromElement:function(e,...t){const n=L$2(...t);n.length>0&&e.classList.remove(...n)},$splitNode:$splitNode$1,isBlockDomNode:isBlockDomNode$1,isHTMLAnchorElement:isHTMLAnchorElement$1,isHTMLElement:isHTMLElement$1,isInlineDomNode:isInlineDomNode$1}),$dfs$1=mod$2.$dfs,$filter$1=mod$2.$filter,$findMatchingParent$1=mod$2.$findMatchingParent,$getNearestBlockElementAncestorOrThrow$1=mod$2.$getNearestBlockElementAncestorOrThrow,$getNearestNodeOfType$1=mod$2.$getNearestNodeOfType,$getNextRightPreorderNode$1=mod$2.$getNextRightPreorderNode,$insertFirst$1=mod$2.$insertFirst,$insertNodeToNearestRoot$1=mod$2.$insertNodeToNearestRoot,$isEditorIsNestedEditor$1=mod$2.$isEditorIsNestedEditor,$restoreEditorState$1=mod$2.$restoreEditorState,$splitNode$2=mod$2.$splitNode,$wrapNodeInElement$1=mod$2.$wrapNodeInElement,CAN_USE_BEFORE_INPUT$3=mod$2.CAN_USE_BEFORE_INPUT,CAN_USE_DOM$3=mod$2.CAN_USE_DOM,IS_ANDROID$3=mod$2.IS_ANDROID,IS_ANDROID_CHROME$3=mod$2.IS_ANDROID_CHROME,IS_APPLE$3=mod$2.IS_APPLE,IS_APPLE_WEBKIT$3=mod$2.IS_APPLE_WEBKIT,IS_CHROME$3=mod$2.IS_CHROME,IS_FIREFOX$3=mod$2.IS_FIREFOX,IS_IOS$3=mod$2.IS_IOS,IS_SAFARI$3=mod$2.IS_SAFARI,addClassNamesToElement$1=mod$2.addClassNamesToElement,calculateZoomLevel$1=mod$2.calculateZoomLevel,isBlockDomNode$2=mod$2.isBlockDomNode,isHTMLAnchorElement$2=mod$2.isHTMLAnchorElement,isHTMLElement$2=mod$2.isHTMLElement,isInlineDomNode$2=mod$2.isInlineDomNode,isMimeType$1=mod$2.isMimeType,markSelection$1=mod$2.markSelection,mediaFileReader$1=mod$2.mediaFileReader,mergeRegister$1=mod$2.mergeRegister,objectKlassEquals$1=mod$2.objectKlassEquals,positionNodeOnRange$1=mod$2.positionNodeOnRange,registerNestedElementResolver$1=mod$2.registerNestedElementResolver,removeClassNamesFromElement$1=mod$2.removeClassNamesFromElement;var LexicalUtils=Object.freeze({$dfs:$dfs$1,$filter:$filter$1,$findMatchingParent:$findMatchingParent$1,$getNearestBlockElementAncestorOrThrow:$getNearestBlockElementAncestorOrThrow$1,$getNearestNodeOfType:$getNearestNodeOfType$1,$getNextRightPreorderNode:$getNextRightPreorderNode$1,$insertFirst:$insertFirst$1,$insertNodeToNearestRoot:$insertNodeToNearestRoot$1,$isEditorIsNestedEditor:$isEditorIsNestedEditor$1,$restoreEditorState:$restoreEditorState$1,$splitNode:$splitNode$2,$wrapNodeInElement:$wrapNodeInElement$1,CAN_USE_BEFORE_INPUT:CAN_USE_BEFORE_INPUT$3,CAN_USE_DOM:CAN_USE_DOM$3,IS_ANDROID:IS_ANDROID$3,IS_ANDROID_CHROME:IS_ANDROID_CHROME$3,IS_APPLE:IS_APPLE$3,IS_APPLE_WEBKIT:IS_APPLE_WEBKIT$3,IS_CHROME:IS_CHROME$3,IS_FIREFOX:IS_FIREFOX$3,IS_IOS:IS_IOS$3,IS_SAFARI:IS_SAFARI$3,addClassNamesToElement:addClassNamesToElement$1,calculateZoomLevel:calculateZoomLevel$1,isBlockDomNode:isBlockDomNode$2,isHTMLAnchorElement:isHTMLAnchorElement$2,isHTMLElement:isHTMLElement$2,isInlineDomNode:isInlineDomNode$2,isMimeType:isMimeType$1,markSelection:markSelection$1,mediaFileReader:mediaFileReader$1,mergeRegister:mergeRegister$1,objectKlassEquals:objectKlassEquals$1,positionNodeOnRange:positionNodeOnRange$1,registerNestedElementResolver:registerNestedElementResolver$1,removeClassNamesFromElement:removeClassNamesFromElement$1});function m$3(t,o,s,c=null){let u=null===c||o.isSelected(c);const f=$isElementNode$1(o)&&o.excludeFromCopy("html");let a=o;if(null!==c){let n=$cloneWithProperties$1(o);n=$isTextNode$1(n)&&null!==c?$sliceSelectedTextNodeContent$1(c,n):n,a=n}const d=$isElementNode$1(a)?a.getChildren():[],p=t._nodes.get(a.getType());let h;h=p&&void 0!==p.exportDOM?p.exportDOM(t,a):a.exportDOM(t);const{element:g,after:x}=h;if(!g)return!1;const y=document.createDocumentFragment();for(let e=0;e<d.length;e++){const n=d[e],r=m$3(t,n,y,c);!u&&$isElementNode$1(o)&&r&&o.extractWithChild(n,c,"html")&&(u=!0)}if(u&&!f){if(isHTMLElement$2(g)&&g.append(y),s.append(g),x){const e=x.call(a,g);e&&g.replaceWith(e)}}else s.append(y);return u}const g$2=new Set(["STYLE","SCRIPT"]);function x$3(e,n,o,r,i=new Map,p){let h=[];if(g$2.has(e.nodeName))return h;let m=null;const w=function(e,n){const{nodeName:t}=e,o=n._htmlConversions.get(t.toLowerCase());let l=null;if(void 0!==o)for(const n of o){const t=n(e);null!==t&&(null===l||(l.priority||0)<(t.priority||0))&&(l=t)}return null!==l?l.conversion:null}(e,n),b=w?w(e):null;let C=null;if(null!==b){C=b.after;const n=b.node;if(m=Array.isArray(n)?n[n.length-1]:n,null!==m){for(const[,e]of i)if(m=e(m,p),!m)break;m&&h.push(...Array.isArray(n)?n:[m])}null!=b.forChild&&i.set(e.nodeName,b.forChild)}const S=e.childNodes;let v=[];const N=(null==m||!$isRootOrShadowRoot$1(m))&&(null!=m&&$isBlockElementNode$1(m)||r);for(let e=0;e<S.length;e++)v.push(...x$3(S[e],n,o,N,new Map(i),m));return null!=C&&(v=C(v)),isBlockDomNode$2(e)&&(v=function(e,n,t){const o=e.style.textAlign,l=[];let r=[];for(let e=0;e<n.length;e++){const i=n[e];if($isBlockElementNode$1(i))o&&!i.getFormat()&&i.setFormat(o),l.push(i);else if(r.push(i),e===n.length-1||e<n.length-1&&$isBlockElementNode$1(n[e+1])){const e=t();e.setFormat(o),e.append(...r),l.push(e),r=[]}}return l}(e,v,N?()=>{const e=new ArtificialNode__DO_NOT_USE$1;return o.push(e),e}:$createParagraphNode$1)),null==m?v.length>0?h=h.concat(v):isBlockDomNode$2(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(isInlineDomNode$1(e.nextSibling)&&isInlineDomNode$1(e.previousSibling))}(e)&&(h=h.concat($createLineBreakNode$1())):$isElementNode$1(m)&&m.append(...v),h}const mod$3=Object.freeze({$generateHtmlFromNodes:function(e,n){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),l=$getRoot$1().getChildren();for(let o=0;o<l.length;o++)m$3(e,l[o],t,n);return t.innerHTML},$generateNodesFromDOM:function(e,n){const t=n.body?n.body.childNodes:[];let o=[];const l=[];for(let n=0;n<t.length;n++){const r=t[n];if(!g$2.has(r.nodeName)){const n=x$3(r,e,l,!1);null!==n&&(o=o.concat(n))}}return function(e){for(const n of e)n.getNextSibling()instanceof ArtificialNode__DO_NOT_USE$1&&n.insertAfter($createLineBreakNode$1());for(const n of e){const e=n.getChildren();for(const t of e)n.insertBefore(t);n.remove()}}(l),o}}),$generateHtmlFromNodes$1=mod$3.$generateHtmlFromNodes,$generateNodesFromDOM$1=mod$3.$generateNodesFromDOM;var LexicalHtml=Object.freeze({$generateHtmlFromNodes:$generateHtmlFromNodes$1,$generateNodesFromDOM:$generateNodesFromDOM$1});createCommand$1("INSERT_UNORDERED_LIST_COMMAND"),createCommand$1("INSERT_ORDERED_LIST_COMMAND"),createCommand$1("INSERT_CHECK_LIST_COMMAND"),createCommand$1("REMOVE_LIST_COMMAND");var _$3=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function m$4(e){let t=1,n=e.getParent();for(;null!=n;){if(B$3(n)){const e=n.getParent();if($$3(e)){t++,n=e.getParent();continue}_$3(40)}return t}return t}function v$3(e){let t=e.getParent();$$3(t)||_$3(40);let n=t;for(;null!==n;)n=n.getParent(),$$3(n)&&(t=n);return t}function y$3(e){let t=[];const n=e.getChildren().filter(B$3);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();$$3(i)?t=t.concat(y$3(i)):t.push(r)}return t}function C$3(e){return B$3(e)&&$$3(e.getFirstChild())}function k$3(e){return R$3().append(e)}function T$3(e,t){return B$3(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function S$3(e,t){e.splice(e.getChildrenSize(),0,t)}function P$3(e,t){if($$3(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=R$3();if(i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),S$3(i,e.getChildren()),$$3(n)&&t===n.getListType())return n.append(i),e.remove(),$$3(r)&&t===r.getListType()&&(S$3(n,r.getChildren()),r.remove()),n;if($$3(r)&&t===r.getListType())return r.getFirstChildOrThrow().insertBefore(i),e.remove(),r;{const n=U$3(t);return n.append(i),e.replace(n),n}}function A$3(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&C$3(n)&&C$3(r)&&(A$3(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function x$4(e){const t=new Set;if(C$3(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(C$3(r)&&C$3(i)){const n=i.getFirstChild();if($$3(n)){n.append(e);const i=r.getFirstChild();$$3(i)&&(S$3(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(C$3(r)){const t=r.getFirstChild();if($$3(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(C$3(i)){const t=i.getFirstChild();$$3(t)&&t.append(e)}else if($$3(n)){const t=R$3(),s=U$3(n.getListType());t.append(s),s.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function L$3(e){if(C$3(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if($$3(n?n.getParent():void 0)&&B$3(n)&&$$3(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),i=R$3(),s=U$3(r);i.append(s),e.getPreviousSiblings().forEach(e=>s.append(e));const o=R$3(),c=U$3(r);o.append(c),S$3(c,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function E$3(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}class M$3 extends ElementNode$1{static getType(){return"listitem"}static clone(e){return new M$3(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return $$3(n)&&"check"===n.getListType()&&w$3(t,this,null),t.value=this.__value,F$3(t,e.theme,this),t}updateDOM(e,t,n){const r=this.getParent();return $$3(r)&&"check"===r.getListType()&&w$3(t,this,e),t.value=this.__value,F$3(t,n.theme,this),!1}static transform(){return e=>{if(B$3(e)||_$3(144),null==e.__checked)return;const t=e.getParent();$$3(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:D$3,priority:0})}}static importJSON(e){const t=R$3();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if($isElementNode$1(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(B$3(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!$$3(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=U$3(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&($isElementNode$1(e)||_$3(139),this.getChildren().forEach(t=>{e.append(t)})),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if($$3(n)||_$3(39),B$3(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=U$3(n.getListType());r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&C$3(t)&&C$3(n)&&(A$3(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=R$3(null==this.__checked&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=$createParagraphNode$1();this.getChildren().forEach(e=>t.append(e));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=B$3(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,s=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(s,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(s,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return $$3(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(null===e)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;B$3(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&_$3(117),(e=Math.floor(e))>=0||_$3(199);let t=this.getIndent();for(;t!==e;)t<e?(x$4(this),t++):(L$3(this),t--);return this}canInsertAfter(e){return B$3(e)}canReplaceWith(e){return B$3(e)}canMergeWith(e){return $isParagraphNode$1(e)||B$3(e)}extractWithChild(e,n){if(!$isRangeSelection$1(n))return!1;const r=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return U$3("bullet")}canMergeWhenEmpty(){return!0}}function F$3(e,t,n){const r=[],i=[],s=t.list,o=s?s.listitem:void 0;let c;if(s&&s.nested&&(c=s.nested.listitem),void 0!==o&&r.push(...E$3(o)),s){const e=n.getParent(),t=$$3(e)&&"check"===e.getListType(),o=n.getChecked();t&&!o||i.push(s.listitemUnchecked),t&&o||i.push(s.listitemChecked),t&&r.push(o?s.listitemChecked:s.listitemUnchecked)}if(void 0!==c){const e=E$3(c);n.getChildren().some(e=>$$3(e))?r.push(...e):i.push(...e)}i.length>0&&removeClassNamesFromElement$1(e,...i),r.length>0&&addClassNamesToElement$1(e,...r)}function w$3(e,t,n,r){$$3(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function D$3(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return I$3(t);const t=e.getAttribute("aria-checked");return{node:R$3("true"===t||"false"!==t&&void 0)}}function I$3(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:R$3(e.hasAttribute("checked"))}}function R$3(e){return $applyNodeReplacement$1(new M$3(void 0,e))}function B$3(e){return e instanceof M$3}class K$3 extends ElementNode$1{static getType(){return"list"}static clone(e){const t=e.__listType||z$3[e.__tag];return new K$3(t,e.__start,e.__key)}constructor(e,t,n){super(n);const r=z$3[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag="number"===e?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,W$3(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(W$3(t,n.theme,this),!1)}static transform(){return e=>{$$3(e)||_$3(163),function(e){const t=e.getNextSibling();$$3(t)&&e.getListType()===t.getListType()&&A$3(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())B$3(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),$$3(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:J$2,priority:0}),ul:()=>({conversion:J$2,priority:0})}}static importJSON(e){const t=U$3(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const{element:t}=super.exportDOM(e);return t&&isHTMLElement$2(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(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(B$3(n))super.append(n);else{const e=R$3();if($$3(n))e.append(n);else if($isElementNode$1(n)){const t=$createTextNode$1(n.getTextContent());e.append(t)}else e.append(n);super.append(e)}}return this}extractWithChild(e){return B$3(e)}}function W$3(e,t,n){const r=[],i=[],s=t.list;if(void 0!==s){const e=s[n.__tag+"Depth"]||[],t=m$4(n)-1,o=t%e.length,c=e[o],l=s[n.__tag];let a;const h=s.nested,u=s.checklist;if(void 0!==h&&h.list&&(a=h.list),void 0!==l&&r.push(l),void 0!==u&&"check"===n.__listType&&r.push(u),void 0!==c){r.push(...E$3(c));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(void 0!==a){const e=E$3(a);t>1?r.push(...e):i.push(...e)}}i.length>0&&removeClassNamesFromElement$1(e,...i),r.length>0&&addClassNamesToElement$1(e,...r)}function V$2(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(B$3(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach(e=>{$$3(e)&&t.push(k$3(e))})}else t.push(k$3(r))}return t}function J$2(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=U$3("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if(isHTMLElement$2(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?U$3("check"):U$3("bullet")),{after:V$2,node:n}}const z$3={ol:"number",ul:"bullet"};function U$3(e,t=1){return $applyNodeReplacement$1(new K$3(e,t))}function $$3(e){return e instanceof K$3}const j$3=createCommand$1("INSERT_UNORDERED_LIST_COMMAND"),q$2=createCommand$1("INSERT_ORDERED_LIST_COMMAND"),H$3=createCommand$1("INSERT_CHECK_LIST_COMMAND"),G$2=createCommand$1("REMOVE_LIST_COMMAND");const mod$4=Object.freeze({$createListItemNode:R$3,$createListNode:U$3,$getListDepth:m$4,$handleListInsertParagraph:function(){const r=$getSelection$1();if(!$isRangeSelection$1(r)||!r.isCollapsed())return!1;const i=r.anchor.getNode();if(!B$3(i)||0!==i.getChildrenSize())return!1;const c=v$3(i),l=i.getParent();$$3(l)||_$3(40);const a=l.getParent();let h;if($isRootOrShadowRoot$1(a))h=$createParagraphNode$1(),c.insertAfter(h);else{if(!B$3(a))return!1;h=R$3(),a.insertAfter(h)}h.select();const u=i.getNextSiblings();if(u.length>0){const e=U$3(l.getListType());if($isParagraphNode$1(h))h.insertAfter(e);else{const t=R$3();t.append(e),h.insertAfter(t)}u.forEach(t=>{t.remove(),e.append(t)})}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!B$3(t)&&!$$3(t))break;t=e}t.remove()}(i),!0},$isListItemNode:B$3,$isListNode:$$3,INSERT_CHECK_LIST_COMMAND:H$3,INSERT_ORDERED_LIST_COMMAND:q$2,INSERT_UNORDERED_LIST_COMMAND:j$3,ListItemNode:M$3,ListNode:K$3,REMOVE_LIST_COMMAND:G$2,insertList:function(s,o){s.update(()=>{const s=$getSelection$1();if(null!==s){const e=s.getNodes();if($isRangeSelection$1(s)){const t=s.getStartEndPoints();null===t&&_$3(143);const[i]=t,c=i.getNode(),l=c.getParent();if(T$3(c,e)){const e=U$3(o);if($isRootOrShadowRoot$1(l)){c.replace(e);const t=R$3();$isElementNode$1(c)&&(t.setFormat(c.getFormatType()),t.setIndent(c.getIndent())),e.append(t)}else if(B$3(c)){const t=c.getParentOrThrow();S$3(e,t.getChildren()),t.replace(e)}return}}const c=new Set;for(let t=0;t<e.length;t++){const s=e[t];if(!$isElementNode$1(s)||!s.isEmpty()||B$3(s)||c.has(s.getKey())){if($isLeafNode$1(s)){let e=s.getParent();for(;null!=e;){const t=e.getKey();if($$3(e)){if(!c.has(t)){const n=U$3(o);S$3(n,e.getChildren()),e.replace(n),c.add(t)}break}{const r=e.getParent();if($isRootOrShadowRoot$1(r)&&!c.has(t)){c.add(t),P$3(e,o);break}e=r}}}}else P$3(s,o)}}})},removeList:function(n){n.update(()=>{const n=$getSelection$1();if($isRangeSelection$1(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(T$3(r,t))e.add(v$3(r));else for(let n=0;n<t.length;n++){const r=t[n];if($isLeafNode$1(r)){const t=$getNearestNodeOfType$1(r,M$3);null!=t&&e.add(v$3(t))}}for(const t of e){let e=t;const r=y$3(t);for(const t of r){const r=$createParagraphNode$1();S$3(r,t.getChildren()),e.insertAfter(r),e=r,t.__key===n.anchor.key&&n.anchor.set(r.getKey(),0,"element"),t.__key===n.focus.key&&n.focus.set(r.getKey(),0,"element"),t.remove()}t.remove()}}})}}),$createListItemNode$1=mod$4.$createListItemNode,$createListNode$1=mod$4.$createListNode,$getListDepth$1=mod$4.$getListDepth,$handleListInsertParagraph$1=mod$4.$handleListInsertParagraph,$isListItemNode$1=mod$4.$isListItemNode,$isListNode$1=mod$4.$isListNode,INSERT_CHECK_LIST_COMMAND$1=mod$4.INSERT_CHECK_LIST_COMMAND,INSERT_ORDERED_LIST_COMMAND$1=mod$4.INSERT_ORDERED_LIST_COMMAND,INSERT_UNORDERED_LIST_COMMAND$1=mod$4.INSERT_UNORDERED_LIST_COMMAND,ListItemNode$1=mod$4.ListItemNode,ListNode$1=mod$4.ListNode,REMOVE_LIST_COMMAND$1=mod$4.REMOVE_LIST_COMMAND,insertList$1=mod$4.insertList,removeList$1=mod$4.removeList;var LexicalList=Object.freeze({$createListItemNode:$createListItemNode$1,$createListNode:$createListNode$1,$getListDepth:$getListDepth$1,$handleListInsertParagraph:$handleListInsertParagraph$1,$isListItemNode:$isListItemNode$1,$isListNode:$isListNode$1,INSERT_CHECK_LIST_COMMAND:INSERT_CHECK_LIST_COMMAND$1,INSERT_ORDERED_LIST_COMMAND:INSERT_ORDERED_LIST_COMMAND$1,INSERT_UNORDERED_LIST_COMMAND:INSERT_UNORDERED_LIST_COMMAND$1,ListItemNode:ListItemNode$1,ListNode:ListNode$1,REMOVE_LIST_COMMAND:REMOVE_LIST_COMMAND$1,insertList:insertList$1,removeList:removeList$1});createCommand$1("TOGGLE_LINK_COMMAND");const _$4=new Set(["http:","https:","mailto:","sms:","tel:"]);class o$1 extends ElementNode$1{static getType(){return"link"}static clone(t){return new o$1(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t,e={},r){super(r);const{target:i=null,rel:n=null,title:l=null}=e;this.__url=t,this.__target=i,this.__rel=n,this.__title=l}createDOM(e){const r=document.createElement("a");return r.href=this.sanitizeUrl(this.__url),null!==this.__target&&(r.target=this.__target),null!==this.__rel&&(r.rel=this.__rel),null!==this.__title&&(r.title=this.__title),addClassNamesToElement$1(r,e.theme.link),r}updateDOM(t,e,r){if(e instanceof HTMLAnchorElement){const r=this.__url,i=this.__target,n=this.__rel,l=this.__title;r!==t.__url&&(e.href=r),i!==t.__target&&(i?e.target=i:e.removeAttribute("target")),n!==t.__rel&&(n?e.rel=n:e.removeAttribute("rel")),l!==t.__title&&(l?e.title=l:e.removeAttribute("title"))}return!1}static importDOM(){return{a:t=>({conversion:a$1,priority:1})}}static importJSON(t){const e=h$3(t.url,{rel:t.rel,target:t.target,title:t.title});return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}sanitizeUrl(t){try{const e=new URL(t);if(!_$4.has(e.protocol))return"about:blank"}catch(e){return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(t){this.getWritable().__url=t}getTarget(){return this.getLatest().__target}setTarget(t){this.getWritable().__target=t}getRel(){return this.getLatest().__rel}setRel(t){this.getWritable().__rel=t}getTitle(){return this.getLatest().__title}setTitle(t){this.getWritable().__title=t}insertNewAfter(t,e=!0){const r=h$3(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,e),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,e,r){if(!$isRangeSelection$1(e))return!1;const i=e.anchor.getNode(),l=e.focus.getNode();return this.isParentOf(i)&&this.isParentOf(l)&&e.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function a$1(t){let r=null;if(isHTMLAnchorElement$2(t)){const e=t.textContent;(null!==e&&""!==e||t.children.length>0)&&(r=h$3(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:r}}function h$3(t,e){return $applyNodeReplacement$1(new o$1(t,e))}function c$1(t){return t instanceof o$1}class g$3 extends o$1{constructor(t,e={},r){super(t,e,r),this.__isUnlinked=void 0!==e.isUnlinked&&null!==e.isUnlinked&&e.isUnlinked}static getType(){return"autolink"}static clone(t){return new g$3(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const e=this.getWritable();return e.__isUnlinked=t,e}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,e,r){return super.updateDOM(t,e,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){const e=f$1(t.url,{isUnlinked:t.isUnlinked,rel:t.rel,target:t.target,title:t.title});return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked,type:"autolink",version:1}}insertNewAfter(t,e=!0){const r=this.getParentOrThrow().insertNewAfter(t,e);if($isElementNode$1(r)){const t=f$1(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(t),t}return null}}function f$1(t,e){return $applyNodeReplacement$1(new g$3(t,e))}function d$1(t){return t instanceof g$3}const p$4=createCommand$1("TOGGLE_LINK_COMMAND");function U$4(t,e={}){const{target:r,title:i}=e,l=void 0===e.rel?"noreferrer":e.rel,_=$getSelection$1();if(!$isRangeSelection$1(_))return;const o=_.extract();if(null===t)o.forEach(t=>{const e=t.getParent();if(!d$1(e)&&c$1(e)){const t=e.getChildren();for(let r=0;r<t.length;r++)e.insertBefore(t[r]);e.remove()}});else{if(1===o.length){const e=function(t,e){let r=t;for(;null!==r&&null!==r.getParent()&&!e(r);)r=r.getParentOrThrow();return e(r)?r:null}(o[0],c$1);if(null!==e)return e.setURL(t),void 0!==r&&e.setTarget(r),null!==l&&e.setRel(l),void(void 0!==i&&e.setTitle(i))}let e=null,n=null;o.forEach(u=>{const _=u.getParent();if(_!==n&&null!==_&&(!$isElementNode$1(u)||u.isInline())){if(c$1(_))return n=_,_.setURL(t),void 0!==r&&_.setTarget(r),null!==l&&n.setRel(l),void(void 0!==i&&n.setTitle(i));if(_.is(e)||(e=_,n=h$3(t,{rel:l,target:r,title:i}),c$1(_)?null===u.getPreviousSibling()?_.insertBefore(n):_.insertAfter(n):u.insertBefore(n)),c$1(u)){if(u.is(n))return;if(null!==n){const t=u.getChildren();for(let e=0;e<t.length;e++)n.append(t[e])}u.remove()}else null!==n&&n.append(u)}})}}const m$5=U$4;const mod$5=Object.freeze({$createAutoLinkNode:f$1,$createLinkNode:h$3,$isAutoLinkNode:d$1,$isLinkNode:c$1,$toggleLink:U$4,AutoLinkNode:g$3,LinkNode:o$1,TOGGLE_LINK_COMMAND:p$4,toggleLink:m$5}),$createAutoLinkNode$1=mod$5.$createAutoLinkNode,$createLinkNode$1=mod$5.$createLinkNode,$isAutoLinkNode$1=mod$5.$isAutoLinkNode,$isLinkNode$1=mod$5.$isLinkNode,$toggleLink$1=mod$5.$toggleLink,AutoLinkNode$1=mod$5.AutoLinkNode,LinkNode$1=mod$5.LinkNode,TOGGLE_LINK_COMMAND$1=mod$5.TOGGLE_LINK_COMMAND,toggleLink$1=mod$5.toggleLink;var LexicalLink=Object.freeze({$createAutoLinkNode:$createAutoLinkNode$1,$createLinkNode:$createLinkNode$1,$isAutoLinkNode:$isAutoLinkNode$1,$isLinkNode:$isLinkNode$1,$toggleLink:$toggleLink$1,AutoLinkNode:AutoLinkNode$1,LinkNode:LinkNode$1,TOGGLE_LINK_COMMAND:TOGGLE_LINK_COMMAND$1,toggleLink:toggleLink$1});"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;var y$4=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const v$4="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,C$4=t=>v$4?(t||window).getSelection():null;function D$4(e,n=$getSelection$1()){return null==n&&y$4(166),$isRangeSelection$1(n)&&n.isCollapsed()||0===n.getNodes().length?"":$generateHtmlFromNodes$1(e,n)}function N$4(t,e=$getSelection$1()){return null==e&&y$4(166),$isRangeSelection$1(e)&&e.isCollapsed()||0===e.getNodes().length?null:JSON.stringify(R$4(t,e))}function S$4(t,e,n){t.dispatchCommand(SELECTION_INSERT_CLIPBOARD_NODES_COMMAND$1,{nodes:e,selection:n})||n.insertNodes(e)}function A$4(t,e,n,r=[]){let l=null===e||n.isSelected(e);const i=$isElementNode$1(n)&&n.excludeFromCopy("html");let c=n;if(null!==e){let t=$cloneWithProperties$1(n);t=$isTextNode$1(t)&&null!==e?$sliceSelectedTextNodeContent$1(e,t):t,c=t}const s=$isElementNode$1(c)?c.getChildren():[],a=function(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&y$4(58,n.name),$isElementNode$1(t)){const t=e.children;Array.isArray(t)||y$4(59,n.name)}return e}(c);if($isTextNode$1(c)){const t=c.__text;t.length>0?a.text=t:l=!1}for(let o=0;o<s.length;o++){const r=s[o],i=A$4(t,e,r,a.children);!l&&$isElementNode$1(n)&&i&&n.extractWithChild(r,e,"clone")&&(l=!0)}if(l&&!i)r.push(a);else if(Array.isArray(a.children))for(let t=0;t<a.children.length;t++){const e=a.children[t];r.push(e)}return l}function R$4(t,e){const n=[],o=$getRoot$1().getChildren();for(let r=0;r<o.length;r++)A$4(t,e,o[r],n);return{namespace:t._config.namespace,nodes:n}}function E$4(t){const e=[];for(let o=0;o<t.length;o++){const r=t[o],l=$parseSerializedNode$1(r);$isTextNode$1(l)&&$addNodeStyle$1(l),e.push(l)}return e}let O$4=null;function b$4(t,e,n){if(void 0===n){const e=C$4(t._window);if(!e)return!1;const o=e.anchorNode,r=e.focusNode;if(null!==o&&null!==r&&!isSelectionWithinEditor$1(t,o,r))return!1;const l=$getSelection$1();if(null===l)return!1;n=M$4(l)}e.preventDefault();const o=e.clipboardData;return null!==o&&(F$4(o,n),!0)}const J$3=[["text/html",D$4],["application/x-lexical-editor",N$4]];function M$4(t=$getSelection$1()){const e={"text/plain":t?t.getTextContent():""};if(t){const n=$getEditor$1();for(const[o,r]of J$3){const l=r(n,t);null!==l&&(e[o]=l)}}return e}function F$4(t,e){for(const n in e){const o=e[n];void 0!==o&&t.setData(n,o)}}const mod$6=Object.freeze({$generateJSONFromSelectedNodes:R$4,$generateNodesFromSerializedNodes:E$4,$getClipboardDataFromSelection:M$4,$getHtmlContent:D$4,$getLexicalContent:N$4,$insertDataTransferForPlainText:function(t,e){const n=t.getData("text/plain")||t.getData("text/uri-list");null!=n&&e.insertRawText(n)},$insertDataTransferForRichText:function(t,n,o){const r=t.getData("application/x-lexical-editor");if(r)try{const t=JSON.parse(r);if(t.namespace===o._config.namespace&&Array.isArray(t.nodes))return S$4(o,E$4(t.nodes),n)}catch(t){}const s=t.getData("text/html");if(s)try{const t=(new DOMParser).parseFromString(s,"text/html");return S$4(o,$generateNodesFromDOM$1(o,t),n)}catch(t){}const a=t.getData("text/plain")||t.getData("text/uri-list");if(null!=a)if($isRangeSelection$1(n)){const t=a.split(/(\r?\n|\t)/);""===t[t.length-1]&&t.pop();for(let e=0;e<t.length;e++){const n=$getSelection$1();if($isRangeSelection$1(n)){const o=t[e];"\n"===o||"\r\n"===o?n.insertParagraph():"\t"===o?n.insertNodes([$createTabNode$1()]):n.insertText(o)}}}else n.insertRawText(a)},$insertGeneratedNodes:S$4,copyToClipboard:async function(t,e,n){if(null!==O$4)return!1;if(null!==e)return new Promise((o,r)=>{t.update(()=>{o(b$4(t,e,n))})});const o=t.getRootElement(),l=null==t._window?window.document:t._window.document,i=C$4(t._window);if(null===o||null===i)return!1;const c=l.createElement("span");c.style.cssText="position: fixed; top: -1000px;",c.append(l.createTextNode("#")),o.append(c);const s=new Range;return s.setStart(c,0),s.setEnd(c,1),i.removeAllRanges(),i.addRange(s),new Promise((e,o)=>{const i=t.registerCommand(COPY_COMMAND$1,o=>(objectKlassEquals$1(o,ClipboardEvent)&&(i(),null!==O$4&&(window.clearTimeout(O$4),O$4=null),e(b$4(t,o,n))),!0),COMMAND_PRIORITY_CRITICAL$1);O$4=window.setTimeout(()=>{i(),O$4=null,e(!1)},50),l.execCommand("copy"),c.remove()})},setLexicalClipboardDataTransfer:F$4}),$generateJSONFromSelectedNodes$1=mod$6.$generateJSONFromSelectedNodes,$generateNodesFromSerializedNodes$1=mod$6.$generateNodesFromSerializedNodes,$getClipboardDataFromSelection$1=mod$6.$getClipboardDataFromSelection,$getHtmlContent$1=mod$6.$getHtmlContent,$getLexicalContent$1=mod$6.$getLexicalContent,$insertDataTransferForPlainText$1=mod$6.$insertDataTransferForPlainText,$insertDataTransferForRichText$1=mod$6.$insertDataTransferForRichText,$insertGeneratedNodes$1=mod$6.$insertGeneratedNodes,copyToClipboard$1=mod$6.copyToClipboard,setLexicalClipboardDataTransfer$1=mod$6.setLexicalClipboardDataTransfer;var LexicalClipboard=Object.freeze({$generateJSONFromSelectedNodes:$generateJSONFromSelectedNodes$1,$generateNodesFromSerializedNodes:$generateNodesFromSerializedNodes$1,$getClipboardDataFromSelection:$getClipboardDataFromSelection$1,$getHtmlContent:$getHtmlContent$1,$getLexicalContent:$getLexicalContent$1,$insertDataTransferForPlainText:$insertDataTransferForPlainText$1,$insertDataTransferForRichText:$insertDataTransferForRichText$1,$insertGeneratedNodes:$insertGeneratedNodes$1,copyToClipboard:copyToClipboard$1,setLexicalClipboardDataTransfer:setLexicalClipboardDataTransfer$1});function k$4(t,e){let n=Date.now(),r=0;return(o,i,s,c,d,m)=>{const g=Date.now();if(m.has("historic"))return r=0,n=g,2;const _=function(t,e,n,r,o){if(null===t||0===n.size&&0===r.size&&!o)return 0;const i=e._selection,s=t._selection;if(o)return 1;if(!($isRangeSelection$1(i)&&$isRangeSelection$1(s)&&s.isCollapsed()&&i.isCollapsed()))return 0;const c=function(t,e,n){const r=t._nodeMap,o=[];for(const t of e){const e=r.get(t);void 0!==e&&o.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||$isRootNode$1(n)||o.push(n)}return o}(e,n,r);if(0===c.length)return 0;if(c.length>1){const n=e._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!t._nodeMap.has(r.__key)&&$isTextNode$1(r)&&1===r.__text.length&&1===i.anchor.offset?2:0}const l=c[0],f=t._nodeMap.get(l.__key);if(!$isTextNode$1(f)||!$isTextNode$1(l)||f.__mode!==l.__mode)return 0;const p=f.__text,y=l.__text;if(p===y)return 0;const k=i.anchor,C=s.anchor;if(k.key!==C.key||"text"!==k.type)return 0;const x=k.offset,M=C.offset,z=y.length-p.length;return 1===z&&M===x-1?2:-1===z&&M===x+1?3:-1===z&&M===x?4:0}(o,i,c,d,t.isComposing()),S=(()=>{const S=null===s||s.editor===t,y=m.has("history-push");if(!y&&S&&m.has("history-merge"))return 0;if(null===o)return 1;const k=i._selection;return c.size>0||d.size>0?!1===y&&0!==_&&_===r&&g<n+e&&S||1===c.size&&function(t,e,n){const r=e._nodeMap.get(t),o=n._nodeMap.get(t),i=e._selection,s=n._selection;return!($isRangeSelection$1(i)&&$isRangeSelection$1(s)&&"element"===i.anchor.type&&"element"===i.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!$isTextNode$1(r)||!$isTextNode$1(o)||r.__parent!==o.__parent)&&JSON.stringify(e.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>o.exportJSON()))}(Array.from(c)[0],o,i)?0:1:null!==k?0:2})();return n=g,r=_,S}}function C$5(t){t.undoStack=[],t.redoStack=[],t.current=null}const mod$7=Object.freeze({createEmptyHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},registerHistory:function(a,u,d){const l=k$4(a,d);return mergeRegister$1(a.registerCommand(UNDO_COMMAND$1,()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const o=e.current,i=r.pop();null!==o&&(n.push(o),t.dispatchCommand(CAN_REDO_COMMAND$1,!0)),0===r.length&&t.dispatchCommand(CAN_UNDO_COMMAND$1,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(a,u),!0),COMMAND_PRIORITY_EDITOR$1),a.registerCommand(REDO_COMMAND$1,()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const o=e.current;null!==o&&(r.push(o),t.dispatchCommand(CAN_UNDO_COMMAND$1,!0));const i=n.pop();0===n.length&&t.dispatchCommand(CAN_REDO_COMMAND$1,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(a,u),!0),COMMAND_PRIORITY_EDITOR$1),a.registerCommand(CLEAR_EDITOR_COMMAND$1,()=>(C$5(u),!1),COMMAND_PRIORITY_EDITOR$1),a.registerCommand(CLEAR_HISTORY_COMMAND$1,()=>(C$5(u),a.dispatchCommand(CAN_REDO_COMMAND$1,!1),a.dispatchCommand(CAN_UNDO_COMMAND$1,!1),!0),COMMAND_PRIORITY_EDITOR$1),a.registerUpdateListener(({editorState:t,prevEditorState:e,dirtyLeaves:n,dirtyElements:r,tags:o})=>{const i=u.current,d=u.redoStack,h=u.undoStack,m=null===i?null:i.editorState;if(null!==i&&t===m)return;const g=l(e,t,i,n,r,o);if(1===g)0!==d.length&&(u.redoStack=[],a.dispatchCommand(CAN_REDO_COMMAND$1,!1)),null!==i&&(h.push({...i}),a.dispatchCommand(CAN_UNDO_COMMAND$1,!0));else if(2===g)return;u.current={editor:a,editorState:t}}))}}),createEmptyHistoryState$1=mod$7.createEmptyHistoryState,registerHistory$1=mod$7.registerHistory;var LexicalHistory=Object.freeze({createEmptyHistoryState:createEmptyHistoryState$1,registerHistory:registerHistory$1});function s$1(){return $getRoot$1().getTextContent()}function u$1(t,e=!0){if(t)return!1;let n=s$1();return e&&(n=n.trim()),""===n}function c$2(o){if(!u$1(o,!1))return!1;const l=$getRoot$1().getChildren(),s=l.length;if(s>1)return!1;for(let t=0;t<s;t++){const o=l[t];if($isDecoratorNode$1(o))return!1;if($isElementNode$1(o)){if(!$isParagraphNode$1(o))return!1;if(0!==o.__indent)return!1;const e=o.getChildren(),n=e.length;for(let r=0;r<n;r++){const n=e[t];if(!$isTextNode$1(n))return!1}}}return!0}var x$6=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const mod$8=Object.freeze({$canShowPlaceholder:c$2,$canShowPlaceholderCurry:function(t){return()=>c$2(t)},$findTextIntersectionFromCharacters:function(t,e){let r=t.getFirstChild(),o=0;t:for(;null!==r;){if($isElementNode$1(r)){const t=r.getFirstChild();if(null!==t){r=t;continue}}else if($isTextNode$1(r)){const t=r.getTextContentSize();if(o+t>e)return{node:r,offset:e-o};o+=t}const t=r.getNextSibling();if(null!==t){r=t;continue}let l=r.getParent();for(;null!==l;){const t=l.getNextSibling();if(null!==t){r=t;continue t}l=l.getParent()}break}return null},$isRootTextContentEmpty:u$1,$isRootTextContentEmptyCurry:function(t,e){return()=>u$1(t,e)},$rootTextContent:s$1,registerLexicalTextEntity:function(t,e,n,r){const s=t=>t instanceof n,u=t=>{const e=$createTextNode$1(t.getTextContent());e.setFormat(t.getFormat()),t.replace(e)};return[t.registerNodeTransform(TextNode$1,t=>{if(!t.isSimpleText())return;let n,o=t.getPreviousSibling(),l=t.getTextContent(),f=t;if($isTextNode$1(o)){const n=o.getTextContent(),r=e(n+l);if(s(o)){if(null===r||0!==(t=>t.getLatest().__mode)(o))return void u(o);{const e=r.end-n.length;if(e>0){const r=n+l.slice(0,e);if(o.select(),o.setTextContent(r),e===l.length)t.remove();else{const n=l.slice(e);t.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let c=0;for(;;){n=e(l);let t,g=null===n?"":l.slice(n.end);if(l=g,""===g){const t=f.getNextSibling();if($isTextNode$1(t)){g=f.getTextContent()+t.getTextContent();const n=e(g);if(null===n)return void(s(t)?u(t):t.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&$isTextNode$1(o)&&o.isTextEntity()){c+=n.end;continue}0===n.start?[t,f]=f.splitText(n.end):[,t,f]=f.splitText(n.start+c,n.end+c),void 0===t&&x$6(165,"nodeToReplace");const a=r(t);if(a.setFormat(t.getFormat()),t.replace(a),null==f)return;c=0,o=a}}),t.registerNodeTransform(n,t=>{const n=t.getTextContent(),r=e(n);if(null===r||0!==r.start)return void u(t);if(n.length>r.end)return void t.splitText(r.end);const o=t.getPreviousSibling();$isTextNode$1(o)&&o.isTextEntity()&&(u(o),u(t));const l=t.getNextSibling();$isTextNode$1(l)&&l.isTextEntity()&&(u(l),s(t)&&u(t))})]}}),$canShowPlaceholder$1=mod$8.$canShowPlaceholder,$canShowPlaceholderCurry$1=mod$8.$canShowPlaceholderCurry,$findTextIntersectionFromCharacters$1=mod$8.$findTextIntersectionFromCharacters,$isRootTextContentEmpty$1=mod$8.$isRootTextContentEmpty,$isRootTextContentEmptyCurry$1=mod$8.$isRootTextContentEmptyCurry,$rootTextContent$1=mod$8.$rootTextContent,registerLexicalTextEntity$1=mod$8.registerLexicalTextEntity;var LexicalText=Object.freeze({$canShowPlaceholder:$canShowPlaceholder$1,$canShowPlaceholderCurry:$canShowPlaceholderCurry$1,$findTextIntersectionFromCharacters:$findTextIntersectionFromCharacters$1,$isRootTextContentEmpty:$isRootTextContentEmpty$1,$isRootTextContentEmptyCurry:$isRootTextContentEmptyCurry$1,$rootTextContent:$rootTextContent$1,registerLexicalTextEntity:registerLexicalTextEntity$1});const CAN_USE_DOM$5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,documentMode$2=CAN_USE_DOM$5&&"documentMode"in document?document.documentMode:null,IS_CHROME$4=(!(!CAN_USE_DOM$5||!("InputEvent"in window)||documentMode$2)&&new window.InputEvent("input"),CAN_USE_DOM$5&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),CAN_USE_DOM$5&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,CAN_USE_DOM$5&&/^(?=.*Chrome).*/i.test(navigator.userAgent));CAN_USE_DOM$5&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent),createCommand$1("DRAG_DROP_PASTE_FILE");function st$1(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const ct$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,at$1=ct$1&&"documentMode"in document?document.documentMode:null,ut$1=!(!ct$1||!("InputEvent"in window)||at$1)&&"getTargetRanges"in new window.InputEvent("input"),lt$1=ct$1&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),dt$1=ct$1&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,mt$1=ct$1&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ft$1=ct$1&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mt$1,gt$1=createCommand$1("DRAG_DROP_PASTE_FILE");class pt$1 extends ElementNode$1{static getType(){return"quote"}static clone(t){return new pt$1(t.__key)}constructor(t){super(t)}createDOM(t){const e=document.createElement("blockquote");return addClassNamesToElement$1(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:xt$1,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&isHTMLElement$2(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=ht$1();return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,e){const n=$createParagraphNode$1(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=$createParagraphNode$1();return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function ht$1(){return $applyNodeReplacement$1(new pt$1)}class yt$1 extends ElementNode$1{static getType(){return"heading"}static clone(t){return new yt$1(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];addClassNamesToElement$1(n,t)}return n}updateDOM(t,e){return!1}static importDOM(){return{h1:t=>({conversion:Dt$1,priority:0}),h2:t=>({conversion:Dt$1,priority:0}),h3:t=>({conversion:Dt$1,priority:0}),h4:t=>({conversion:Dt$1,priority:0}),h5:t=>({conversion:Dt$1,priority:0}),h6:t=>({conversion:Dt$1,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&vt$1(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>vt$1(t)?{conversion:t=>({node:wt$1("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&isHTMLElement$2(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=wt$1(t.tag);return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),o=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?$createParagraphNode$1():wt$1(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,e),0===n&&!this.isEmpty()&&t){const t=$createParagraphNode$1();t.select(),this.replace(t,!0)}return o}collapseAtStart(){const t=this.isEmpty()?$createParagraphNode$1():wt$1(this.getTag());return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}extractWithChild(){return!0}}function vt$1(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function Dt$1(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=wt$1(e),null!==t.style&&n.setFormat(t.style.textAlign)),{node:n}}function xt$1(t){const e=ht$1();return null!==t.style&&e.setFormat(t.style.textAlign),{node:e}}function wt$1(t){return $applyNodeReplacement$1(new yt$1(t))}function Nt$1(t){let e=null;if(objectKlassEquals$1(t,DragEvent)?e=t.dataTransfer:objectKlassEquals$1(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),o]}function It$1(t){const e=$getSelection$1();if(!$isRangeSelection$1(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e<r.length;e++){const o=r[e],i=o.getKey();if(n.has(i))continue;const s=$findMatchingParent$1(o,t=>$isElementNode$1(t)&&!t.isInline());if(null===s)continue;const c=s.getKey();s.canIndent()&&!n.has(c)&&(n.add(c),t(s))}return n.size>0}function Ot$1(t){const e=$getNearestNodeFromDOMNode$1(t);return $isDecoratorNode$1(e)}const mod$9=Object.freeze({$createHeadingNode:wt$1,$createQuoteNode:ht$1,$isHeadingNode:function(t){return t instanceof yt$1},$isQuoteNode:function(t){return t instanceof pt$1},DRAG_DROP_PASTE:gt$1,HeadingNode:yt$1,QuoteNode:pt$1,eventFiles:Nt$1,registerRichText:function(o){return mergeRegister$1(o.registerCommand(CLICK_COMMAND$1,t=>{const e=$getSelection$1();return!!$isNodeSelection$1(e)&&(e.clear(),!0)},0),o.registerCommand(DELETE_CHARACTER_COMMAND$1,t=>{const e=$getSelection$1();return!!$isRangeSelection$1(e)&&(e.deleteCharacter(t),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(DELETE_WORD_COMMAND$1,t=>{const e=$getSelection$1();return!!$isRangeSelection$1(e)&&(e.deleteWord(t),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(DELETE_LINE_COMMAND$1,t=>{const e=$getSelection$1();return!!$isRangeSelection$1(e)&&(e.deleteLine(t),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(CONTROLLED_TEXT_INSERTION_COMMAND$1,e=>{const n=$getSelection$1();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)$insertDataTransferForRichText$1(r,n,o);else if($isRangeSelection$1(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(REMOVE_TEXT_COMMAND$1,()=>{const t=$getSelection$1();return!!$isRangeSelection$1(t)&&(t.removeText(),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(FORMAT_TEXT_COMMAND$1,t=>{const e=$getSelection$1();return!!$isRangeSelection$1(e)&&(e.formatText(t),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(FORMAT_ELEMENT_COMMAND$1,t=>{const e=$getSelection$1();if(!$isRangeSelection$1(e)&&!$isNodeSelection$1(e))return!1;const n=e.getNodes();for(const e of n){const n=$findMatchingParent$1(e,t=>$isElementNode$1(t)&&!t.isInline());null!==n&&n.setFormat(t)}return!0},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(INSERT_LINE_BREAK_COMMAND$1,t=>{const e=$getSelection$1();return!!$isRangeSelection$1(e)&&(e.insertLineBreak(t),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(INSERT_PARAGRAPH_COMMAND$1,()=>{const t=$getSelection$1();return!!$isRangeSelection$1(t)&&(t.insertParagraph(),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(INSERT_TAB_COMMAND$1,()=>($insertNodes$1([$createTabNode$1()]),!0),COMMAND_PRIORITY_EDITOR$1),o.registerCommand(INDENT_CONTENT_COMMAND$1,()=>It$1(t=>{const e=t.getIndent();t.setIndent(e+1)}),COMMAND_PRIORITY_EDITOR$1),o.registerCommand(OUTDENT_CONTENT_COMMAND$1,()=>It$1(t=>{const e=t.getIndent();e>0&&t.setIndent(e-1)}),COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_ARROW_UP_COMMAND$1,t=>{const e=$getSelection$1();if($isNodeSelection$1(e)&&!Ot$1(t.target)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if($isRangeSelection$1(e)){const n=$getAdjacentNode$1(e.focus,!0);if(!t.shiftKey&&$isDecoratorNode$1(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_ARROW_DOWN_COMMAND$1,t=>{const e=$getSelection$1();if($isNodeSelection$1(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if($isRangeSelection$1(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===$getRoot$1().getChildrenSize()}(e))return t.preventDefault(),!0;const n=$getAdjacentNode$1(e.focus,!1);if(!t.shiftKey&&$isDecoratorNode$1(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_ARROW_LEFT_COMMAND$1,t=>{const e=$getSelection$1();if($isNodeSelection$1(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!$isRangeSelection$1(e))return!1;if($shouldOverrideDefaultCharacterSelection$1(e,!0)){const n=t.shiftKey;return t.preventDefault(),$moveCharacter$1(e,n,!0),!0}return!1},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_ARROW_RIGHT_COMMAND$1,t=>{const e=$getSelection$1();if($isNodeSelection$1(e)&&!Ot$1(t.target)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!$isRangeSelection$1(e))return!1;const o=t.shiftKey;return!!$shouldOverrideDefaultCharacterSelection$1(e,!1)&&(t.preventDefault(),$moveCharacter$1(e,o,!1),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_BACKSPACE_COMMAND$1,t=>{if(Ot$1(t.target))return!1;const e=$getSelection$1();if(!$isRangeSelection$1(e))return!1;t.preventDefault();const{anchor:n}=e,r=n.getNode();return e.isCollapsed()&&0===n.offset&&!$isRootNode$1(r)&&$getNearestBlockElementAncestorOrThrow$1(r).getIndent()>0?o.dispatchCommand(OUTDENT_CONTENT_COMMAND$1,void 0):o.dispatchCommand(DELETE_CHARACTER_COMMAND$1,!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_DELETE_COMMAND$1,t=>{if(Ot$1(t.target))return!1;const e=$getSelection$1();return!!$isRangeSelection$1(e)&&(t.preventDefault(),o.dispatchCommand(DELETE_CHARACTER_COMMAND$1,!1))},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_ENTER_COMMAND$1,t=>{const e=$getSelection$1();if(!$isRangeSelection$1(e))return!1;if(null!==t){if((dt$1||lt$1||ft$1)&&ut$1)return!1;if(t.preventDefault(),t.shiftKey)return o.dispatchCommand(INSERT_LINE_BREAK_COMMAND$1,!1)}return o.dispatchCommand(INSERT_PARAGRAPH_COMMAND$1,void 0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(KEY_ESCAPE_COMMAND$1,()=>{const t=$getSelection$1();return!!$isRangeSelection$1(t)&&(o.blur(),!0)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(DROP_COMMAND$1,t=>{const[,e]=Nt$1(t);if(e.length>0){const n=st$1(t.clientX,t.clientY);if(null!==n){const{offset:t,node:r}=n,i=$getNearestNodeFromDOMNode$1(r);if(null!==i){const e=$createRangeSelection$1();if($isTextNode$1(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=$normalizeSelection__EXPERIMENTAL(e);$setSelection$1(n)}o.dispatchCommand(gt$1,e)}return t.preventDefault(),!0}const n=$getSelection$1();return!!$isRangeSelection$1(n)},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(DRAGSTART_COMMAND$1,t=>{const[e]=Nt$1(t),n=$getSelection$1();return!(e&&!$isRangeSelection$1(n))},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(DRAGOVER_COMMAND$1,t=>{const[e]=Nt$1(t),n=$getSelection$1();if(e&&!$isRangeSelection$1(n))return!1;const r=st$1(t.clientX,t.clientY);if(null!==r){const e=$getNearestNodeFromDOMNode$1(r.node);$isDecoratorNode$1(e)&&t.preventDefault()}return!0},COMMAND_PRIORITY_EDITOR$1),o.registerCommand(SELECT_ALL_COMMAND$1,()=>($selectAll$1(),!0),COMMAND_PRIORITY_EDITOR$1),o.registerCommand(COPY_COMMAND$1,t=>(copyToClipboard$1(o,objectKlassEquals$1(t,ClipboardEvent)?t:null),!0),COMMAND_PRIORITY_EDITOR$1),o.registerCommand(CUT_COMMAND$1,t=>(async function(t,n){await copyToClipboard$1(n,objectKlassEquals$1(t,ClipboardEvent)?t:null),n.update(()=>{const t=$getSelection$1();$isRangeSelection$1(t)?t.removeText():$isNodeSelection$1(t)&&t.getNodes().forEach(t=>t.remove())})}(t,o),!0),COMMAND_PRIORITY_EDITOR$1),o.registerCommand(PASTE_COMMAND$1,e=>{const[,n,r]=Nt$1(e);return n.length>0&&!r?(o.dispatchCommand(gt$1,n),!0):!isSelectionCapturedInDecoratorInput$1(e.target)&&(null!==$getSelection$1()&&(function(e,n){e.preventDefault(),n.update(()=>{const r=$getSelection$1(),o=objectKlassEquals$1(e,InputEvent)||objectKlassEquals$1(e,KeyboardEvent)?null:e.clipboardData;null!=o&&null!==r&&$insertDataTransferForRichText$1(o,r,n)},{tag:"paste"})}(e,o),!0))},COMMAND_PRIORITY_EDITOR$1))}}),$createHeadingNode$1=mod$9.$createHeadingNode,$createQuoteNode$1=mod$9.$createQuoteNode,$isHeadingNode$1=mod$9.$isHeadingNode,$isQuoteNode$1=mod$9.$isQuoteNode,DRAG_DROP_PASTE$1=mod$9.DRAG_DROP_PASTE,HeadingNode$1=mod$9.HeadingNode,QuoteNode$1=mod$9.QuoteNode,eventFiles$1=mod$9.eventFiles,registerRichText$1=mod$9.registerRichText;var LexicalRichText=Object.freeze({$createHeadingNode:$createHeadingNode$1,$createQuoteNode:$createQuoteNode$1,$isHeadingNode:$isHeadingNode$1,$isQuoteNode:$isQuoteNode$1,DRAG_DROP_PASTE:DRAG_DROP_PASTE$1,HeadingNode:HeadingNode$1,QuoteNode:QuoteNode$1,eventFiles:eventFiles$1,registerRichText:registerRichText$1});createCommand$1("INSERT_TABLE_COMMAND"),"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;const G$3=/^(\d+(?:\.\d+)?)px$/,Q$2={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class V$3 extends ElementNode$1{static getType(){return"tablecell"}static clone(e){const t=new V$3(e.__headerState,e.__colSpan,e.__width,e.__key);return t.__rowSpan=e.__rowSpan,t.__backgroundColor=e.__backgroundColor,t}static importDOM(){return{td:e=>({conversion:Z$2,priority:0}),th:e=>({conversion:Z$2,priority:0})}}static importJSON(e){const t=e.colSpan||1,n=e.rowSpan||1,o=ee$2(e.headerState,t,e.width||void 0);return o.__rowSpan=n,o.__backgroundColor=e.backgroundColor||null,o}constructor(e=Q$2.NO_STATUS,t=1,n,o){super(o),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=this.__width+"px"),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),null!==this.__backgroundColor&&(n.style.backgroundColor=this.__backgroundColor),addClassNamesToElement$1(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(e){const{element:t}=super.exportDOM(e);if(t){const e=t;e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=(this.getWidth()||75)+"px",e.style.verticalAlign="top",e.style.textAlign="start";const n=this.getBackgroundColor();null!==n?e.style.backgroundColor=n:this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return{element:t}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e){return this.getWritable().__headerState=e,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){return this.getWritable().__width=e,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){this.getWritable().__backgroundColor=e}toggleHeaderStyle(e){const t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==Q$2.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Z$2(e){const t=e,n=e.nodeName.toLowerCase();let o;G$3.test(t.style.width)&&(o=parseFloat(t.style.width));const r=ee$2("th"===n?Q$2.ROW:Q$2.NO_STATUS,t.colSpan,o);r.__rowSpan=t.rowSpan;const l=t.style.backgroundColor;""!==l&&(r.__backgroundColor=l);const d=t.style,u=d.textDecoration.split(" "),h="700"===d.fontWeight||"bold"===d.fontWeight,g=u.includes("line-through"),f="italic"===d.fontStyle,m=u.includes("underline");return{after:e=>(0===e.length&&e.push($createParagraphNode$1()),e),forChild:(e,t)=>{if(te$2(t)&&!$isElementNode$1(e)){const t=$createParagraphNode$1();return $isLineBreakNode$1(e)&&"\n"===e.getTextContent()?null:($isTextNode$1(e)&&(h&&e.toggleFormat("bold"),g&&e.toggleFormat("strikethrough"),f&&e.toggleFormat("italic"),m&&e.toggleFormat("underline")),t.append(e),t)}return e},node:r}}function ee$2(e,t=1,n){return $applyNodeReplacement$1(new V$3(e,t,n))}function te$2(e){return e instanceof V$3}const ne$2=createCommand$1("INSERT_TABLE_COMMAND");class oe$2 extends ElementNode$1{static getType(){return"tablerow"}static clone(e){return new oe$2(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:re$2,priority:0})}}static importJSON(e){return le$2(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=this.__height+"px"),addClassNamesToElement$1(n,t.theme.tableRow),n}isShadowRoot(){return!0}setHeight(e){return this.getWritable().__height=e,this.__height}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function re$2(e){const t=e;let n;return G$3.test(t.style.height)&&(n=parseFloat(t.style.height)),{node:le$2(n)}}function le$2(e){return $applyNodeReplacement$1(new oe$2(e))}function se$1(e){return e instanceof oe$2}var ce$1=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const ae$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function he$1(e){const n=$findMatchingParent$1(e,e=>se$1(e));if(se$1(n))return n;throw new Error("Expected table cell to be inside of table row.")}function ge$1(e){const n=$findMatchingParent$1(e,e=>dt$2(e));if(dt$2(n))return n;throw new Error("Expected table cell to be inside of table.")}function pe$1(e,t){const n=ge$1(e),{x:o,y:r}=n.getCordsFromCellNode(e,t);return{above:n.getCellNodeFromCords(o,r-1,t),below:n.getCellNodeFromCords(o,r+1,t),left:n.getCellNodeFromCords(o-1,r,t),right:n.getCellNodeFromCords(o+1,r,t)}}const _e$1=(e,t)=>e===Q$2.BOTH||e===t?t:Q$2.NO_STATUS;function ve$1(e){const t=e.getFirstDescendant();null==t?e.selectStart():t.getParentOrThrow().selectStart()}function Ee$1(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function Me$1(e,t,n){const[o,r,l]=Re$1(e,t,n);return null===r&&ce$1(110),null===l&&ce$1(111),[o,r,l]}function Re$1(e,t,n){const o=[];let r=null,l=null;function s(e,s,i){const c={cell:i,startColumn:s,startRow:e},a=i.__rowSpan,d=i.__colSpan;for(let t=0;t<a;t++){void 0===o[e+t]&&(o[e+t]=[]);for(let n=0;n<d;n++)o[e+t][s+n]=c}null!==t&&t.is(i)&&(r=c),null!==n&&n.is(i)&&(l=c)}function i(e,t){return void 0===o[e]||void 0===o[e][t]}const c=e.getChildren();for(let e=0;e<c.length;e++){const t=c[e];se$1(t)||ce$1(146);const n=t.getChildren();let o=0;for(const t of n){for(te$2(t)||ce$1(147);!i(e,o);)o++;s(e,o,t),o+=t.__colSpan}}return[o,r,l]}function Ke$1(e){let n;if(e instanceof V$3)n=e;else if("__type"in e){const o=$findMatchingParent$1(e,te$2);te$2(o)||ce$1(148),n=o}else{const o=$findMatchingParent$1(e.getNode(),te$2);te$2(o)||ce$1(148),n=o}const o=n.getParent();se$1(o)||ce$1(149);const r=o.getParent();return dt$2(r)||ce$1(150),[n,o,r]}function Fe$1(e){const[t,,n]=Ke$1(e),o=n.getChildren(),r=o.length,l=o[0].getChildren().length,s=new Array(r);for(let e=0;e<r;e++)s[e]=new Array(l);for(let e=0;e<r;e++){const n=o[e].getChildren();let r=0;for(let o=0;o<n.length;o++){for(;s[e][r];)r++;const l=n[o],i=l.__rowSpan||1,c=l.__colSpan||1;for(let t=0;t<i;t++)for(let n=0;n<c;n++)s[e+t][r+n]=l;if(t===l)return{colSpan:c,columnIndex:r,rowIndex:e,rowSpan:i};r+=c}}return null}class ke$1{constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Ae$1(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=!0,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new ke$1(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.focus.getNode();$isElementNode$1(t)||ce$1(151),$normalizeSelection__EXPERIMENTAL(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){const e=$getNodeByKey$1(this.anchor.key);te$2(e)||ce$1(152);const t=Fe$1(e);null===t&&ce$1(153);const n=$getNodeByKey$1(this.focus.key);te$2(n)||ce$1(154);const o=Fe$1(n);null===o&&ce$1(155);const r=Math.min(t.columnIndex,o.columnIndex),l=Math.max(t.columnIndex,o.columnIndex),s=Math.min(t.rowIndex,o.rowIndex),i=Math.max(t.rowIndex,o.rowIndex);return{fromX:Math.min(r,l),fromY:Math.min(s,i),toX:Math.max(r,l),toY:Math.max(s,i)}}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const n=this.anchor.getNode(),o=this.focus.getNode(),r=$findMatchingParent$1(n,te$2),l=$findMatchingParent$1(o,te$2);te$2(r)||ce$1(152),te$2(l)||ce$1(154);const s=r.getParent();se$1(s)||ce$1(156);const i=s.getParent();dt$2(i)||ce$1(157);const c=l.getParents()[1];if(c!==i){if(i.isParentOf(l)){const e=c.getParent();null==e&&ce$1(159),this.set(this.tableKey,l.getKey(),e.getKey())}else{const e=i.getParent();null==e&&ce$1(158),this.set(this.tableKey,e.getKey(),l.getKey())}return this.getNodes()}const[a,d,u]=Me$1(i,r,l);let h=Math.min(d.startColumn,u.startColumn),g=Math.min(d.startRow,u.startRow),f=Math.max(d.startColumn+d.cell.__colSpan-1,u.startColumn+u.cell.__colSpan-1),m=Math.max(d.startRow+d.cell.__rowSpan-1,u.startRow+u.cell.__rowSpan-1),p=h,C=g,_=h,w=g;function b(e){const{cell:t,startColumn:n,startRow:o}=e;h=Math.min(h,n),g=Math.min(g,o),f=Math.max(f,n+t.__colSpan-1),m=Math.max(m,o+t.__rowSpan-1)}for(;h<p||g<C||f>_||m>w;){if(h<p){const e=w-C,t=p-1;for(let n=0;n<=e;n++)b(a[C+n][t]);p=t}if(g<C){const e=_-p,t=C-1;for(let n=0;n<=e;n++)b(a[t][p+n]);C=t}if(f>_){const e=w-C,t=_+1;for(let n=0;n<=e;n++)b(a[C+n][t]);_=t}if(m>w){const e=_-p,t=w+1;for(let n=0;n<=e;n++)b(a[t][p+n]);w=t}}const y=[i];let N=null;for(let e=g;e<=m;e++)for(let t=h;t<=f;t++){const{cell:n}=a[e][t],o=n.getParent();se$1(o)||ce$1(160),o!==N&&y.push(o),y.push(n,...De$1(n)),N=o}return isCurrentlyReadOnlyMode$1()||(this._cachedNodes=y),y}getTextContent(){const e=this.getNodes().filter(e=>te$2(e));let t="";for(let n=0;n<e.length;n++){const o=e[n],r=o.__parent,l=(e[n+1]||{}).__parent;t+=o.getTextContent()+(l!==r?"\n":"\t")}return t}}function Ae$1(e){return e instanceof ke$1}function He$1(){const e=$createPoint$1("root",0,"element"),t=$createPoint$1("root",0,"element");return new ke$1("root",e,t)}function De$1(e){const t=[],n=[e];for(;n.length>0;){const o=n.pop();void 0===o&&ce$1(112),$isElementNode$1(o)&&n.unshift(...o.getChildren()),o!==e&&t.push(o)}return t}class Pe$1{constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(e=>e())}trackTable(){const e=new MutationObserver(e=>{this.editor.update(()=>{let t=!1;for(let n=0;n<e.length;n++){const o=e[n].target.nodeName;if("TABLE"===o||"TBODY"===o||"THEAD"===o||"TR"===o){t=!0;break}}if(!t)return;const n=this.editor.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");this.table=ze$1(n)})});this.editor.update(()=>{const t=this.editor.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");this.table=ze$1(t),e.observe(t,{attributes:!0,childList:!0,subtree:!0})})}clearHighlight(){const e=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),e.update(()=>{if(!dt$2($getNodeByKey$1(this.tableNodeKey)))throw new Error("Expected TableNode.");const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");const n=ze$1(t);Ye$1(e,n,null),$setSelection$1(null),e.dispatchCommand(SELECTION_CHANGE_COMMAND$1,void 0)})}enableHighlightStyle(){const e=this.editor;e.update(()=>{const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");removeClassNamesFromElement$1(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const t=this.editor;t.update(()=>{const n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");addClassNamesToElement$1(n,t._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(e){if(null!==e&&e.tableKey===this.tableNodeKey){const t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.disableHighlightStyle(),Ye$1(t,this.table,this.tableSelection)}else null==e?this.clearHighlight():(this.tableNodeKey=e.tableKey,this.updateTableTableSelection(e))}setFocusCellForSelection(e,t=!1){const n=this.editor;n.update(()=>{const o=$getNodeByKey$1(this.tableNodeKey);if(!dt$2(o))throw new Error("Expected TableNode.");if(!n.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const r=e.x,l=e.y;if(this.focusCell=e,null!==this.anchorCell){const e=Le$1(n._window);e&&e.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(this.isHighlightingCells||this.anchorX===r&&this.anchorY===l&&!t){if(r===this.focusX&&l===this.focusY)return}else this.isHighlightingCells=!0,this.disableHighlightStyle();if(this.focusX=r,this.focusY=l,this.isHighlightingCells){const t=$getNearestNodeFromDOMNode$1(e.elem);if(null!=this.tableSelection&&null!=this.anchorCellNodeKey&&te$2(t)&&o.is(tt$1(t))){const e=t.getKey();this.tableSelection=this.tableSelection.clone()||He$1(),this.focusCellNodeKey=e,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),$setSelection$1(this.tableSelection),n.dispatchCommand(SELECTION_CHANGE_COMMAND$1,void 0),Ye$1(n,this.table,this.tableSelection)}}})}setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.editor.update(()=>{const t=$getNearestNodeFromDOMNode$1(e.elem);if(te$2(t)){const e=t.getKey();this.tableSelection=null!=this.tableSelection?this.tableSelection.clone():He$1(),this.anchorCellNodeKey=e}})}formatCells(e){this.editor.update(()=>{const t=$getSelection$1();Ae$1(t)||ce$1(11);const n=$createRangeSelection$1(),o=n.anchor,r=n.focus;t.getNodes().forEach(t=>{te$2(t)&&0!==t.getTextContentSize()&&(o.set(t.getKey(),0,"element"),r.set(t.getKey(),t.getChildrenSize(),"element"),n.formatText(e))}),$setSelection$1(t),this.editor.dispatchCommand(SELECTION_CHANGE_COMMAND$1,void 0)})}clearText(){const e=this.editor;e.update(()=>{const t=$getNodeByKey$1(this.tableNodeKey);if(!dt$2(t))throw new Error("Expected TableNode.");const n=$getSelection$1();Ae$1(n)||ce$1(11);const o=n.getNodes().filter(te$2);o.length!==this.table.columns*this.table.rows?(o.forEach(e=>{if($isElementNode$1(e)){const t=$createParagraphNode$1(),n=$createTextNode$1();t.append(n),e.append(t),e.getChildren().forEach(e=>{e!==t&&e.remove()})}}),Ye$1(e,this.table,null),$setSelection$1(null),e.dispatchCommand(SELECTION_CHANGE_COMMAND$1,void 0)):(t.selectPrevious(),t.remove(),$getRoot$1().selectStart())})}}const Be$1="__lexicalTableSelection",Le$1=e=>ae$1?(e||window).getSelection():null;function Ue$1(e){let t=e;for(;null!=t;){const e=t.nodeName;if("TD"===e||"TH"===e){const e=t._cell;return void 0===e?null:e}t=t.parentNode}return null}function ze$1(e){const t=[],n={columns:0,domRows:t,rows:0};let o=e.firstChild,r=0,l=0;for(t.length=0;null!=o;){const e=o.nodeName;if("TD"===e||"TH"===e){const e={elem:o,hasBackgroundColor:""!==o.style.backgroundColor,highlighted:!1,x:r,y:l};o._cell=e;let n=t[l];void 0===n&&(n=t[l]=[]),n[r]=e}else{const e=o.firstChild;if(null!=e){o=e;continue}}const n=o.nextSibling;if(null!=n){r++,o=n;continue}const s=o.parentNode;if(null!=s){const e=s.nextSibling;if(null==e)break;l++,r=0,o=e}}return n.columns=r+1,n.rows=l+1,n}function Ye$1(e,t,n){const o=new Set(n?n.getNodes():[]);Xe$1(t,(t,n)=>{const r=t.elem;o.has(n)?(t.highlighted=!0,Ve$1(e,t)):(t.highlighted=!1,Ze$1(e,t),r.getAttribute("style")||r.removeAttribute("style"))})}function Xe$1(e,t){const{domRows:n}=e;for(let e=0;e<n.length;e++){const o=n[e];if(o)for(let n=0;n<o.length;n++){const r=o[n];if(!r)continue;const l=$getNearestNodeFromDOMNode$1(r.elem);null!==l&&t(r,l,{x:n,y:e})}}}function Je$1(e,t){t.disableHighlightStyle(),Xe$1(t.table,t=>{t.highlighted=!0,Ve$1(e,t)})}const $e$1=(e,t,n,o,r)=>{const l="forward"===r;switch(r){case"backward":case"forward":return n!==(l?e.table.columns-1:0)?Ge$1(t.getCellNodeFromCordsOrThrow(n+(l?1:-1),o,e.table),l):o!==(l?e.table.rows-1:0)?Ge$1(t.getCellNodeFromCordsOrThrow(l?0:e.table.columns-1,o+(l?1:-1),e.table),l):l?t.selectNext():t.selectPrevious(),!0;case"up":return 0!==o?Ge$1(t.getCellNodeFromCordsOrThrow(n,o-1,e.table),!1):t.selectPrevious(),!0;case"down":return o!==e.table.rows-1?Ge$1(t.getCellNodeFromCordsOrThrow(n,o+1,e.table),!0):t.selectNext(),!0;default:return!1}};function qe$1(e,t){if($isRangeSelection$1(e)||Ae$1(e)){const n=t.isParentOf(e.anchor.getNode()),o=t.isParentOf(e.focus.getNode());return n&&o}return!1}function Ge$1(e,t){t?e.selectStart():e.selectEnd()}const Qe$1="172,206,247";function Ve$1(e,t){const n=t.elem,o=$getNearestNodeFromDOMNode$1(n);te$2(o)||ce$1(131),null===o.getBackgroundColor()?n.style.setProperty("background-color",`rgb(${Qe$1})`):n.style.setProperty("background-image",`linear-gradient(to right, rgba(${Qe$1},0.85), rgba(${Qe$1},0.85))`),n.style.setProperty("caret-color","transparent")}function Ze$1(e,t){const n=t.elem,o=$getNearestNodeFromDOMNode$1(n);te$2(o)||ce$1(131),null===o.getBackgroundColor()&&n.style.removeProperty("background-color"),n.style.removeProperty("background-image"),n.style.removeProperty("caret-color")}function et$1(e){const n=$findMatchingParent$1(e,te$2);return te$2(n)?n:null}function tt$1(e){const n=$findMatchingParent$1(e,dt$2);return dt$2(n)?n:null}function nt$1(e,n,o,r,l){if(("up"===o||"down"===o)&&function(e){const t=e.getRootElement();return!!t&&(t.hasAttribute("aria-controls")&&"typeahead-menu"===t.getAttribute("aria-controls"))}(e))return!1;const s=$getSelection$1();if(!qe$1(s,r)){if($isRangeSelection$1(s)){if(s.isCollapsed()&&"backward"===o){const e=s.anchor.type,o=s.anchor.offset;if("element"!==e&&("text"!==e||0!==o))return!1;const r=s.anchor.getNode();if(!r)return!1;const l=$findMatchingParent$1(r,e=>$isElementNode$1(e)&&!e.isInline());if(!l)return!1;const c=l.getPreviousSibling();return!(!c||!dt$2(c)||(ot$1(n),c.selectEnd(),0))}if(n.shiftKey&&("up"===o||"down"===o)){const e=s.focus.getNode();if($isRootOrShadowRoot$1(e)){const e=s.getNodes()[0];if(e){const n=$findMatchingParent$1(e,te$2);if(n&&r.isParentOf(n)){const e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;const[n]=Ke$1(e),[o]=Ke$1(t),s=r.getCordsFromCellNode(n,l.table),i=r.getCordsFromCellNode(o,l.table),c=r.getDOMCellFromCordsOrThrow(s.x,s.y,l.table),a=r.getDOMCellFromCordsOrThrow(i.x,i.y,l.table);return l.setAnchorCellForSelection(c),l.setFocusCellForSelection(a,!0),!0}}return!1}{const n=$findMatchingParent$1(e,e=>$isElementNode$1(e)&&!e.isInline());if(!n)return!1;const r="down"===o?n.getNextSibling():n.getPreviousSibling();if(dt$2(r)&&l.tableNodeKey===r.getKey()){const e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;const[n]=Ke$1(e),[l]=Ke$1(t),i=s.clone();return i.focus.set(("up"===o?n:l).getKey(),"up"===o?0:l.getChildrenSize(),"element"),$setSelection$1(i),!0}}}}return!1}if($isRangeSelection$1(s)&&s.isCollapsed()){const{anchor:c,focus:a}=s,d=$findMatchingParent$1(c.getNode(),te$2),u=$findMatchingParent$1(a.getNode(),te$2);if(!te$2(d)||!d.is(u))return!1;const h=tt$1(d);if(h!==r&&null!=h){const t=e.getElementByKey(h.getKey());if(null!=t)return l.table=ze$1(t),nt$1(e,n,o,h,l)}if("backward"===o||"forward"===o){const e=c.type,l=c.offset,a=c.getNode();if(!a)return!1;const d=s.getNodes();return(1!==d.length||!$isDecoratorNode$1(d[0]))&&!!function(e,n,o,r){return function(e,t,n){return"element"===e&&("backward"===n?null===t.getPreviousSibling():null===t.getNextSibling())}(e,o,r)||function(e,n,o,r){const l=$findMatchingParent$1(o,e=>$isElementNode$1(e)&&!e.isInline());if(!l)return!1;const s="backward"===r?0===n:n===o.getTextContentSize();return"text"===e&&s&&("backward"===r?null===l.getPreviousSibling():null===l.getNextSibling())}(e,n,o,r)}(e,l,a,o)&&function(e,n,o,r){const l=$findMatchingParent$1(n,te$2);if(!te$2(l))return!1;const[s,c]=Me$1(o,l,l);if(!function(e,t,n){const o=e[0][0],r=e[e.length-1][e[0].length-1],{startColumn:l,startRow:s}=t;return"backward"===n?l===o.startColumn&&s===o.startRow:l===r.startColumn&&s===r.startRow}(s,c,r))return!1;const a=function(e,n,o){const r=$findMatchingParent$1(e,e=>$isElementNode$1(e)&&!e.isInline());if(!r)return;const l="backward"===n?r.getPreviousSibling():r.getNextSibling();return l&&dt$2(l)?l:"backward"===n?o.getPreviousSibling():o.getNextSibling()}(n,r,o);return!(!a||dt$2(a))&&(ot$1(e),"backward"===r?a.selectEnd():a.selectStart(),!0)}(n,a,r,o)}const g=e.getElementByKey(d.__key),f=e.getElementByKey(c.key);if(null==f||null==g)return!1;let m;if("element"===c.type)m=f.getBoundingClientRect();else{const e=window.getSelection();if(null===e||0===e.rangeCount)return!1;m=e.getRangeAt(0).getBoundingClientRect()}const p="up"===o?d.getFirstChild():d.getLastChild();if(null==p)return!1;const C=e.getElementByKey(p.__key);if(null==C)return!1;const S=C.getBoundingClientRect();if("up"===o?S.top>m.top-m.height:m.bottom+m.height>S.bottom){ot$1(n);const e=r.getCordsFromCellNode(d,l.table);if(!n.shiftKey)return $e$1(l,r,e.x,e.y,o);{const t=r.getDOMCellFromCordsOrThrow(e.x,e.y,l.table);l.setAnchorCellForSelection(t),l.setFocusCellForSelection(t,!0)}return!0}}else if(Ae$1(s)){const{anchor:i,focus:c}=s,a=$findMatchingParent$1(i.getNode(),te$2),d=$findMatchingParent$1(c.getNode(),te$2),[u]=s.getNodes(),h=e.getElementByKey(u.getKey());if(!te$2(a)||!te$2(d)||!dt$2(u)||null==h)return!1;l.updateTableTableSelection(s);const g=ze$1(h),f=r.getCordsFromCellNode(a,g),m=r.getDOMCellFromCordsOrThrow(f.x,f.y,g);if(l.setAnchorCellForSelection(m),ot$1(n),n.shiftKey){const e=r.getCordsFromCellNode(d,g);return((e,t,n,o,r)=>{const l="forward"===r;switch(r){case"backward":case"forward":return n!==(l?e.table.columns-1:0)&&e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n+(l?1:-1),o,e.table)),!0;case"up":return 0!==o&&(e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,o-1,e.table)),!0);case"down":return o!==e.table.rows-1&&(e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,o+1,e.table)),!0);default:return!1}})(l,u,e.x,e.y,o)}return d.selectEnd(),!0}return!1}function ot$1(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function rt$1(e,t,n){const o=$createParagraphNode$1();"first"===e?t.insertBefore(o):t.insertAfter(o),o.append(...n||[]),o.selectEnd()}function lt$2(e,n,o){const r=o.getParent();if(!r)return;const l=e.getElementByKey(r.getKey());if(!l)return;const s=window.getSelection();if(!s||s.anchorNode!==l)return;const i=$findMatchingParent$1(n.anchor.getNode(),e=>te$2(e));if(!i)return;const c=$findMatchingParent$1(i,e=>dt$2(e));if(!dt$2(c)||!c.is(o))return;const[a,d]=Me$1(o,i,i),u=a[0][0],h=a[a.length-1][a[0].length-1],{startRow:g,startColumn:f}=d,m=g===u.startRow&&f===u.startColumn,p=g===h.startRow&&f===h.startColumn;return m?"first":p?"last":void 0}class st$2 extends ElementNode$1{static getType(){return"table"}static clone(e){return new st$2(e.__key)}static importDOM(){return{table:e=>({conversion:ct$2,priority:1})}}static importJSON(e){return at$2()}constructor(e){super(e)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(t,n){const o=document.createElement("table");return addClassNamesToElement$1(o,t.theme.table),o}updateDOM(){return!1}exportDOM(e){return{...super.exportDOM(e),after:e=>{if(e){const t=e.cloneNode(),n=document.createElement("colgroup"),o=document.createElement("tbody");isHTMLElement$2(e)&&o.append(...e.children);const l=this.getFirstChildOrThrow();if(!se$1(l))throw new Error("Expected to find row node.");const s=l.getChildrenSize();for(let e=0;e<s;e++){const e=document.createElement("col");n.append(e)}return t.replaceChildren(n,o),t}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){const{rows:n,domRows:o}=t;for(let t=0;t<n;t++){const n=o[t];if(null==n)continue;const r=n.findIndex(t=>{if(!t)return;const{elem:n}=t;return $getNearestNodeFromDOMNode$1(n)===e});if(-1!==r)return{x:r,y:t}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,t,n){const{domRows:o}=n,r=o[t];if(null==r)return null;const l=r[e<r.length?e:r.length-1];return null==l?null:l}getDOMCellFromCordsOrThrow(e,t,n){const o=this.getDOMCellFromCords(e,t,n);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(e,t,n){const o=this.getDOMCellFromCords(e,t,n);if(null==o)return null;const r=$getNearestNodeFromDOMNode$1(o.elem);return te$2(r)?r:null}getCellNodeFromCordsOrThrow(e,t,n){const o=this.getCellNodeFromCords(e,t,n);if(!o)throw new Error("Node at cords not TableCellNode.");return o}canSelectBefore(){return!0}canIndent(){return!1}}function ct$2(e){return{node:at$2()}}function at$2(){return $applyNodeReplacement$1(new st$2)}function dt$2(e){return e instanceof st$2}const mod$a=Object.freeze({$computeTableMap:Me$1,$computeTableMapSkipCellCheck:Re$1,$createTableCellNode:ee$2,$createTableNode:at$2,$createTableNodeWithDimensions:function(e,t,n=!0){const o=at$2();for(let r=0;r<e;r++){const e=le$2();for(let o=0;o<t;o++){let t=Q$2.NO_STATUS;"object"==typeof n?(0===r&&n.rows&&(t|=Q$2.ROW),0===o&&n.columns&&(t|=Q$2.COLUMN)):n&&(0===r&&(t|=Q$2.ROW),0===o&&(t|=Q$2.COLUMN));const l=ee$2(t),i=$createParagraphNode$1();i.append($createTextNode$1()),l.append(i),e.append(l)}o.append(e)}return o},$createTableRowNode:le$2,$createTableSelection:He$1,$deleteTableColumn:function(e,t){const n=e.getChildren();for(let e=0;e<n.length;e++){const o=n[e];if(se$1(o)){const e=o.getChildren();if(t>=e.length||t<0)throw new Error("Table column target index out of range");e[t].remove()}}return e},$deleteTableColumn__EXPERIMENTAL:function(){const e=$getSelection$1();$isRangeSelection$1(e)||Ae$1(e)||ce$1(188);const t=e.anchor.getNode(),n=e.focus.getNode(),[o,,r]=Ke$1(t),[l]=Ke$1(n),[s,i,c]=Me$1(r,o,l),{startColumn:a}=i,{startRow:d,startColumn:u}=c,h=Math.min(a,u),m=Math.max(a+o.__colSpan-1,u+l.__colSpan-1),p=m-h+1;if(s[0].length===m-h+1)return r.selectPrevious(),void r.remove();const C=s.length;for(let e=0;e<C;e++)for(let t=h;t<=m;t++){const{cell:n,startColumn:o}=s[e][t];if(o<h){if(t===h){const e=h-o;n.setColSpan(n.__colSpan-Math.min(p,n.__colSpan-e))}}else if(o+n.__colSpan-1>m){if(t===m){const e=m-o+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}const S=s[d],_=a>u?S[a+o.__colSpan]:S[u+l.__colSpan];if(void 0!==_){const{cell:e}=_;ve$1(e)}else{const e=u<a?S[u-1]:S[a-1],{cell:t}=e;ve$1(t)}},$deleteTableRow__EXPERIMENTAL:function(){const e=$getSelection$1();$isRangeSelection$1(e)||Ae$1(e)||ce$1(188);const t=e.anchor.getNode(),n=e.focus.getNode(),[o,,r]=Ke$1(t),[l]=Ke$1(n),[s,i,c]=Me$1(r,o,l),{startRow:a}=i,{startRow:d}=c,u=d+l.__rowSpan-1;if(s.length===u-a+1)return void r.remove();const h=s[0].length,m=s[u+1],p=r.getChildAtIndex(u+1);for(let e=u;e>=a;e--){for(let t=h-1;t>=0;t--){const{cell:n,startRow:o,startColumn:r}=s[e][t];if(r===t&&(e===a&&o<a&&n.setRowSpan(n.__rowSpan-(o-a)),o>=a&&o+n.__rowSpan-1>u))if(n.setRowSpan(n.__rowSpan-(u-o+1)),null===p&&ce$1(122),0===t)Ee$1(p,n);else{const{cell:e}=m[t-1];e.insertAfter(n)}}const t=r.getChildAtIndex(e);se$1(t)||ce$1(123,String(e)),t.remove()}if(void 0!==m){const{cell:e}=m[0];ve$1(e)}else{const e=s[a-1],{cell:t}=e[0];ve$1(t)}},$findCellNode:et$1,$findTableNode:tt$1,$getElementForTableNode:function(e,t){const n=e.getElementByKey(t.getKey());if(null==n)throw new Error("Table Element Not Found");return ze$1(n)},$getNodeTriplet:Ke$1,$getTableCellNodeFromLexicalNode:function(e){const n=$findMatchingParent$1(e,e=>te$2(e));return te$2(n)?n:null},$getTableCellNodeRect:Fe$1,$getTableColumnIndexFromTableCellNode:function(e){return he$1(e).getChildren().findIndex(t=>t.is(e))},$getTableNodeFromLexicalNodeOrThrow:ge$1,$getTableRowIndexFromTableCellNode:function(e){const t=he$1(e);return ge$1(t).getChildren().findIndex(e=>e.is(t))},$getTableRowNodeFromTableCellNodeOrThrow:he$1,$insertTableColumn:function(e,t,n=!0,o,r){const l=e.getChildren(),i=[];for(let e=0;e<l.length;e++){const n=l[e];if(se$1(n))for(let e=0;e<o;e++){const e=n.getChildren();if(t>=e.length||t<0)throw new Error("Table column target index out of range");const o=e[t];te$2(o)||ce$1(12);const{left:l,right:c}=pe$1(o,r);let a=Q$2.NO_STATUS;(l&&l.hasHeaderState(Q$2.ROW)||c&&c.hasHeaderState(Q$2.ROW))&&(a|=Q$2.ROW);const d=ee$2(a);d.append($createParagraphNode$1()),i.push({newTableCell:d,targetCell:o})}}return i.forEach(({newTableCell:e,targetCell:t})=>{n?t.insertAfter(e):t.insertBefore(e)}),e},$insertTableColumn__EXPERIMENTAL:function(e=!0){const t=$getSelection$1();$isRangeSelection$1(t)||Ae$1(t)||ce$1(188);const n=t.anchor.getNode(),o=t.focus.getNode(),[r]=Ke$1(n),[l,,i]=Ke$1(o),[c,a,d]=Me$1(i,l,r),u=c.length,h=e?Math.max(a.startColumn,d.startColumn):Math.min(a.startColumn,d.startColumn),m=e?h+l.__colSpan-1:h-1,p=i.getFirstChild();se$1(p)||ce$1(120);let C=null;function S(e=Q$2.NO_STATUS){const t=ee$2(e).append($createParagraphNode$1());return null===C&&(C=t),t}let _=p;e:for(let e=0;e<u;e++){if(0!==e){const e=_.getNextSibling();se$1(e)||ce$1(121),_=e}const t=c[e],n=t[m<0?0:m].cell.__headerState,o=_e$1(n,Q$2.ROW);if(m<0){Ee$1(_,S(o));continue}const{cell:r,startColumn:l,startRow:s}=t[m];if(l+r.__colSpan-1<=m){let n=r,l=s,i=m;for(;l!==e&&n.__rowSpan>1;){if(i-=r.__colSpan,!(i>=0)){_.append(S(o));continue e}{const{cell:e,startRow:o}=t[i];n=e,l=o}}n.insertAfter(S(o))}else r.setColSpan(r.__colSpan+1)}null!==C&&ve$1(C)},$insertTableRow:function(e,t,n=!0,o,r){const l=e.getChildren();if(t>=l.length||t<0)throw new Error("Table row target index out of range");const i=l[t];if(!se$1(i))throw new Error("Row before insertion index does not exist.");for(let e=0;e<o;e++){const e=i.getChildren(),t=e.length,o=le$2();for(let n=0;n<t;n++){const t=e[n];te$2(t)||ce$1(12);const{above:l,below:i}=pe$1(t,r);let c=Q$2.NO_STATUS;const a=l&&l.getWidth()||i&&i.getWidth()||void 0;(l&&l.hasHeaderState(Q$2.COLUMN)||i&&i.hasHeaderState(Q$2.COLUMN))&&(c|=Q$2.COLUMN);const d=ee$2(c,1,a);d.append($createParagraphNode$1()),o.append(d)}n?i.insertAfter(o):i.insertBefore(o)}return e},$insertTableRow__EXPERIMENTAL:function(e=!0){const t=$getSelection$1();$isRangeSelection$1(t)||Ae$1(t)||ce$1(188);const n=t.focus.getNode(),[o,,r]=Ke$1(n),[l,i]=Me$1(r,o,o),c=l[0].length,{startRow:a}=i;if(e){const e=a+o.__rowSpan-1,t=l[e],n=le$2();for(let o=0;o<c;o++){const{cell:r,startRow:l}=t[o];if(l+r.__rowSpan-1<=e){const e=t[o].cell.__headerState,r=_e$1(e,Q$2.COLUMN);n.append(ee$2(r).append($createParagraphNode$1()))}else r.setRowSpan(r.__rowSpan+1)}const i=r.getChildAtIndex(e);se$1(i)||ce$1(145),i.insertAfter(n)}else{const e=l[a],t=le$2();for(let n=0;n<c;n++){const{cell:o,startRow:r}=e[n];if(r===a){const o=e[n].cell.__headerState,r=_e$1(o,Q$2.COLUMN);t.append(ee$2(r).append($createParagraphNode$1()))}else o.setRowSpan(o.__rowSpan+1)}const n=r.getChildAtIndex(a);se$1(n)||ce$1(145),n.insertBefore(t)}},$isTableCellNode:te$2,$isTableNode:dt$2,$isTableRowNode:se$1,$isTableSelection:Ae$1,$removeTableRowAtIndex:function(e,t){const n=e.getChildren();if(t>=n.length||t<0)throw new Error("Expected table cell to be inside of table row.");return n[t].remove(),e},$unmergeCell:function(){const e=$getSelection$1();$isRangeSelection$1(e)||Ae$1(e)||ce$1(188);const t=e.anchor.getNode(),[n,o,r]=Ke$1(t),l=n.__colSpan,i=n.__rowSpan;if(l>1){for(let e=1;e<l;e++)n.insertAfter(ee$2(Q$2.NO_STATUS).append($createParagraphNode$1()));n.setColSpan(1)}if(i>1){const[e,t]=Me$1(r,n,n),{startColumn:c,startRow:a}=t;let d;for(let t=1;t<i;t++){const n=a+t,r=e[n];d=(d||o).getNextSibling(),se$1(d)||ce$1(125);let i=null;for(let e=0;e<c;e++){const t=r[e],o=t.cell;t.startRow===n&&(i=o),o.__colSpan>1&&(e+=o.__colSpan-1)}if(null===i)for(let e=0;e<l;e++)Ee$1(d,ee$2(Q$2.NO_STATUS).append($createParagraphNode$1()));else for(let e=0;e<l;e++)i.insertAfter(ee$2(Q$2.NO_STATUS).append($createParagraphNode$1()))}n.setRowSpan(1)}},INSERT_TABLE_COMMAND:ne$2,TableCellHeaderStates:Q$2,TableCellNode:V$3,TableNode:st$2,TableObserver:Pe$1,TableRowNode:oe$2,applyTableHandlers:function(e,n,r,l){const c=r.getRootElement();if(null===c)throw new Error("No root element.");const d=new Pe$1(r,e.getKey()),u=r._window||window;!function(e,t){e[Be$1]=t}(n,d);const m=()=>{const e=()=>{d.isSelecting=!1,u.removeEventListener("mouseup",e),u.removeEventListener("mousemove",t)},t=n=>{setTimeout(()=>{if(1&~n.buttons&&d.isSelecting)return d.isSelecting=!1,u.removeEventListener("mouseup",e),void u.removeEventListener("mousemove",t);const o=Ue$1(n.target);null===o||d.anchorX===o.x&&d.anchorY===o.y||(n.preventDefault(),d.setFocusCellForSelection(o))},0)};return{onMouseMove:t,onMouseUp:e}};n.addEventListener("mousedown",e=>{setTimeout(()=>{if(0!==e.button)return;if(!u)return;const t=Ue$1(e.target);null!==t&&(ot$1(e),d.setAnchorCellForSelection(t));const{onMouseUp:n,onMouseMove:o}=m();d.isSelecting=!0,u.addEventListener("mouseup",n),u.addEventListener("mousemove",o)},0)});const p=e=>{0===e.button&&r.update(()=>{const t=$getSelection$1(),n=e.target;Ae$1(t)&&t.tableKey===d.tableNodeKey&&c.contains(n)&&d.clearHighlight()})};u.addEventListener("mousedown",p),d.listenersToRemove.add(()=>u.removeEventListener("mousedown",p)),d.listenersToRemove.add(r.registerCommand(KEY_ARROW_DOWN_COMMAND$1,t=>nt$1(r,t,"down",e,d),COMMAND_PRIORITY_HIGH$1)),d.listenersToRemove.add(r.registerCommand(KEY_ARROW_UP_COMMAND$1,t=>nt$1(r,t,"up",e,d),COMMAND_PRIORITY_HIGH$1)),d.listenersToRemove.add(r.registerCommand(KEY_ARROW_LEFT_COMMAND$1,t=>nt$1(r,t,"backward",e,d),COMMAND_PRIORITY_HIGH$1)),d.listenersToRemove.add(r.registerCommand(KEY_ARROW_RIGHT_COMMAND$1,t=>nt$1(r,t,"forward",e,d),COMMAND_PRIORITY_HIGH$1)),d.listenersToRemove.add(r.registerCommand(KEY_ESCAPE_COMMAND$1,e=>{const n=$getSelection$1();if(Ae$1(n)){const o=$findMatchingParent$1(n.focus.getNode(),te$2);if(te$2(o))return ot$1(e),o.selectEnd(),!0}return!1},COMMAND_PRIORITY_HIGH$1)),[DELETE_WORD_COMMAND$1,DELETE_LINE_COMMAND$1,DELETE_CHARACTER_COMMAND$1].forEach(n=>{d.listenersToRemove.add(r.registerCommand(n,(n=>()=>{const o=$getSelection$1();if(!qe$1(o,e))return!1;if(Ae$1(o))return d.clearText(),!0;if($isRangeSelection$1(o)){const r=$findMatchingParent$1(o.anchor.getNode(),e=>te$2(e));if(!te$2(r))return!1;const l=o.anchor.getNode(),s=o.focus.getNode(),c=e.isParentOf(l),a=e.isParentOf(s);if(c&&!a||a&&!c)return d.clearText(),!0;const u=$findMatchingParent$1(o.anchor.getNode(),e=>$isElementNode$1(e)),h=u&&$findMatchingParent$1(u,e=>$isElementNode$1(e)&&te$2(e.getParent()));if(!$isElementNode$1(h)||!$isElementNode$1(u))return!1;if(n===DELETE_LINE_COMMAND$1&&null===h.getPreviousSibling())return!0}return!1})(n),COMMAND_PRIORITY_CRITICAL$1))});const C=n=>{const o=$getSelection$1();if(!qe$1(o,e)){const e=o?o.getNodes():null;if(e){const t=e.find(e=>dt$2(e)&&e.getKey()===d.tableNodeKey);if(dt$2(t)){if(!t.getParent())return!1;t.remove()}}return!1}if(Ae$1(o))return n&&(n.preventDefault(),n.stopPropagation()),d.clearText(),!0;if($isRangeSelection$1(o)){const e=$findMatchingParent$1(o.anchor.getNode(),e=>te$2(e));if(!te$2(e))return!1}return!1};function S(t){const n=e.getCordsFromCellNode(t,d.table);return e.getDOMCellFromCordsOrThrow(n.x,n.y,d.table)}return d.listenersToRemove.add(r.registerCommand(KEY_BACKSPACE_COMMAND$1,C,COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(KEY_DELETE_COMMAND$1,C,COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(CUT_COMMAND$1,e=>{const t=$getSelection$1();if(t){if(!Ae$1(t)&&!$isRangeSelection$1(t))return!1;copyToClipboard$1(r,objectKlassEquals$1(e,ClipboardEvent)?e:null,$getClipboardDataFromSelection$1(t));const n=C(e);return $isRangeSelection$1(t)&&t.removeText(),n}return!1},COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(FORMAT_TEXT_COMMAND$1,n=>{const o=$getSelection$1();if(!qe$1(o,e))return!1;if(Ae$1(o))return d.formatCells(n),!0;if($isRangeSelection$1(o)){const e=$findMatchingParent$1(o.anchor.getNode(),e=>te$2(e));if(!te$2(e))return!1}return!1},COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(FORMAT_ELEMENT_COMMAND$1,t=>{const n=$getSelection$1();if(!Ae$1(n)||!qe$1(n,e))return!1;const o=n.anchor.getNode(),r=n.focus.getNode();if(!te$2(o)||!te$2(r))return!1;const[l,s,c]=Me$1(e,o,r),a=Math.max(s.startRow,c.startRow),d=Math.max(s.startColumn,c.startColumn),u=Math.min(s.startRow,c.startRow),h=Math.min(s.startColumn,c.startColumn);for(let e=u;e<=a;e++)for(let n=h;n<=d;n++){const o=l[e][n].cell;o.setFormat(t);const r=o.getChildren();for(let e=0;e<r.length;e++){const n=r[e];$isElementNode$1(n)&&!n.isInline()&&n.setFormat(t)}}return!0},COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(CONTROLLED_TEXT_INSERTION_COMMAND$1,n=>{const o=$getSelection$1();if(!qe$1(o,e))return!1;if(Ae$1(o))return d.clearHighlight(),!1;if($isRangeSelection$1(o)){const l=$findMatchingParent$1(o.anchor.getNode(),e=>te$2(e));if(!te$2(l))return!1;if("string"==typeof n){const t=lt$2(r,o,e);if(t)return rt$1(t,e,[$createTextNode$1(n)]),!0}}return!1},COMMAND_PRIORITY_CRITICAL$1)),l&&d.listenersToRemove.add(r.registerCommand(KEY_TAB_COMMAND$1,t=>{const n=$getSelection$1();if(!$isRangeSelection$1(n)||!n.isCollapsed()||!qe$1(n,e))return!1;const o=et$1(n.anchor.getNode());if(null===o)return!1;ot$1(t);const r=e.getCordsFromCellNode(o,d.table);return $e$1(d,e,r.x,r.y,t.shiftKey?"backward":"forward"),!0},COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(FOCUS_COMMAND$1,t=>e.isSelected(),COMMAND_PRIORITY_HIGH$1)),d.listenersToRemove.add(r.registerCommand(SELECTION_INSERT_CLIPBOARD_NODES_COMMAND$1,e=>{const{nodes:n,selection:o}=e,r=o.getStartEndPoints(),l=Ae$1(o),i=$isRangeSelection$1(o)&&null!==$findMatchingParent$1(o.anchor.getNode(),e=>te$2(e))&&null!==$findMatchingParent$1(o.focus.getNode(),e=>te$2(e))||l;if(1!==n.length||!dt$2(n[0])||!i||null===r)return!1;const[c]=r,d=n[0],u=d.getChildren(),h=d.getFirstChildOrThrow().getChildrenSize(),g=d.getChildrenSize(),m=$findMatchingParent$1(c.getNode(),e=>te$2(e)),p=m&&$findMatchingParent$1(m,e=>se$1(e)),C=p&&$findMatchingParent$1(p,e=>dt$2(e));if(!te$2(m)||!se$1(p)||!dt$2(C))return!1;const S=p.getIndexWithinParent(),_=Math.min(C.getChildrenSize()-1,S+g-1),w=m.getIndexWithinParent(),b=Math.min(p.getChildrenSize()-1,w+h-1),y=Math.min(w,b),N=Math.min(S,_),T=Math.max(w,b),x=Math.max(S,_),v=C.getChildren();let E=0;for(let e=N;e<=x;e++){const t=v[e];if(!se$1(t))return!1;const n=u[E];if(!se$1(n))return!1;const o=t.getChildren(),r=n.getChildren();let l=0;for(let e=y;e<=T;e++){const t=o[e];if(!te$2(t))return!1;const n=r[l];if(!te$2(n))return!1;const i=t.getChildren();n.getChildren().forEach(e=>{$isTextNode$1(e)?($createParagraphNode$1().append(e),t.append(e)):t.append(e)}),i.forEach(e=>e.remove()),l++}E++}return!0},COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(SELECTION_CHANGE_COMMAND$1,()=>{const t=$getSelection$1(),n=$getPreviousSelection$1();if($isRangeSelection$1(t)){const{anchor:n,focus:o}=t,l=n.getNode(),s=o.getNode(),i=et$1(l),c=et$1(s),a=!(!i||!e.is(tt$1(i))),h=!(!c||!e.is(tt$1(c))),g=a!==h,f=a&&h,p=t.isBackward();if(g){const n=t.clone();if(h){const[t]=Me$1(e,c,c),o=t[0][0].cell,r=t[t.length-1].at(-1).cell;n.focus.set(p?o.getKey():r.getKey(),p?o.getChildrenSize():r.getChildrenSize(),"element")}$setSelection$1(n),Je$1(r,d)}else f&&(i.is(c)||(d.setAnchorCellForSelection(S(i)),d.setFocusCellForSelection(S(c),!0),d.isSelecting||setTimeout(()=>{const{onMouseUp:e,onMouseMove:t}=m();d.isSelecting=!0,u.addEventListener("mouseup",e),u.addEventListener("mousemove",t)},0)))}else if(t&&Ae$1(t)&&t.is(n)&&t.tableKey===e.getKey()){const n=Le$1(r._window);if(n&&n.anchorNode&&n.focusNode){const o=$getNearestNodeFromDOMNode$1(n.focusNode),l=o&&!e.is(tt$1(o)),s=$getNearestNodeFromDOMNode$1(n.anchorNode),i=s&&e.is(tt$1(s));if(l&&i&&n.rangeCount>0){const o=$createRangeSelectionFromDom$1(n,r);o&&(o.anchor.set(e.getKey(),t.isBackward()?e.getChildrenSize():0,"element"),n.removeAllRanges(),$setSelection$1(o))}}}return t&&!t.is(n)&&(Ae$1(t)||Ae$1(n))&&d.tableSelection&&!d.tableSelection.is(n)?(Ae$1(t)&&t.tableKey===d.tableNodeKey?d.updateTableTableSelection(t):!Ae$1(t)&&Ae$1(n)&&n.tableKey===d.tableNodeKey&&d.updateTableTableSelection(null),!1):(d.hasHijackedSelectionStyles&&!e.isSelected()?function(e,t){t.enableHighlightStyle(),Xe$1(t.table,t=>{const n=t.elem;t.highlighted=!1,Ze$1(e,t),n.getAttribute("style")||n.removeAttribute("style")})}(r,d):!d.hasHijackedSelectionStyles&&e.isSelected()&&Je$1(r,d),!1)},COMMAND_PRIORITY_CRITICAL$1)),d.listenersToRemove.add(r.registerCommand(INSERT_PARAGRAPH_COMMAND$1,()=>{const t=$getSelection$1();if(!$isRangeSelection$1(t)||!t.isCollapsed()||!qe$1(t,e))return!1;const n=lt$2(r,t,e);return!!n&&(rt$1(n,e),!0)},COMMAND_PRIORITY_CRITICAL$1)),d},getDOMCellFromTarget:Ue$1,getTableObserverFromTableElement:function(e){return e[Be$1]}}),$computeTableMap$1=mod$a.$computeTableMap,$computeTableMapSkipCellCheck$1=mod$a.$computeTableMapSkipCellCheck,$createTableCellNode$1=mod$a.$createTableCellNode,$createTableNode$1=mod$a.$createTableNode,$createTableNodeWithDimensions$1=mod$a.$createTableNodeWithDimensions,$createTableRowNode$1=mod$a.$createTableRowNode,$createTableSelection$1=mod$a.$createTableSelection,$deleteTableColumn$1=mod$a.$deleteTableColumn,$deleteTableColumn__EXPERIMENTAL$1=mod$a.$deleteTableColumn__EXPERIMENTAL,$deleteTableRow__EXPERIMENTAL$1=mod$a.$deleteTableRow__EXPERIMENTAL,$findCellNode$1=mod$a.$findCellNode,$findTableNode$1=mod$a.$findTableNode,$getElementForTableNode$1=mod$a.$getElementForTableNode,$getNodeTriplet$1=mod$a.$getNodeTriplet,$getTableCellNodeFromLexicalNode$1=mod$a.$getTableCellNodeFromLexicalNode,$getTableCellNodeRect$1=mod$a.$getTableCellNodeRect,$getTableColumnIndexFromTableCellNode$1=mod$a.$getTableColumnIndexFromTableCellNode,$getTableNodeFromLexicalNodeOrThrow$1=mod$a.$getTableNodeFromLexicalNodeOrThrow,$getTableRowIndexFromTableCellNode$1=mod$a.$getTableRowIndexFromTableCellNode,$getTableRowNodeFromTableCellNodeOrThrow$1=mod$a.$getTableRowNodeFromTableCellNodeOrThrow,$insertTableColumn$1=mod$a.$insertTableColumn,$insertTableColumn__EXPERIMENTAL$1=mod$a.$insertTableColumn__EXPERIMENTAL,$insertTableRow$1=mod$a.$insertTableRow,$insertTableRow__EXPERIMENTAL$1=mod$a.$insertTableRow__EXPERIMENTAL,$isTableCellNode$1=mod$a.$isTableCellNode,$isTableNode$1=mod$a.$isTableNode,$isTableRowNode$1=mod$a.$isTableRowNode,$isTableSelection$1=mod$a.$isTableSelection,$removeTableRowAtIndex$1=mod$a.$removeTableRowAtIndex,$unmergeCell$1=mod$a.$unmergeCell,INSERT_TABLE_COMMAND$1=mod$a.INSERT_TABLE_COMMAND,TableCellHeaderStates$1=mod$a.TableCellHeaderStates,TableCellNode$1=mod$a.TableCellNode,TableNode$1=mod$a.TableNode,TableObserver$1=mod$a.TableObserver,TableRowNode$1=mod$a.TableRowNode,applyTableHandlers$1=mod$a.applyTableHandlers,getDOMCellFromTarget$1=mod$a.getDOMCellFromTarget,getTableObserverFromTableElement$1=mod$a.getTableObserverFromTableElement;var LexicalTable=Object.freeze({$computeTableMap:$computeTableMap$1,$computeTableMapSkipCellCheck:$computeTableMapSkipCellCheck$1,$createTableCellNode:$createTableCellNode$1,$createTableNode:$createTableNode$1,$createTableNodeWithDimensions:$createTableNodeWithDimensions$1,$createTableRowNode:$createTableRowNode$1,$createTableSelection:$createTableSelection$1,$deleteTableColumn:$deleteTableColumn$1,$deleteTableColumn__EXPERIMENTAL:$deleteTableColumn__EXPERIMENTAL$1,$deleteTableRow__EXPERIMENTAL:$deleteTableRow__EXPERIMENTAL$1,$findCellNode:$findCellNode$1,$findTableNode:$findTableNode$1,$getElementForTableNode:$getElementForTableNode$1,$getNodeTriplet:$getNodeTriplet$1,$getTableCellNodeFromLexicalNode:$getTableCellNodeFromLexicalNode$1,$getTableCellNodeRect:$getTableCellNodeRect$1,$getTableColumnIndexFromTableCellNode:$getTableColumnIndexFromTableCellNode$1,$getTableNodeFromLexicalNodeOrThrow:$getTableNodeFromLexicalNodeOrThrow$1,$getTableRowIndexFromTableCellNode:$getTableRowIndexFromTableCellNode$1,$getTableRowNodeFromTableCellNodeOrThrow:$getTableRowNodeFromTableCellNodeOrThrow$1,$insertTableColumn:$insertTableColumn$1,$insertTableColumn__EXPERIMENTAL:$insertTableColumn__EXPERIMENTAL$1,$insertTableRow:$insertTableRow$1,$insertTableRow__EXPERIMENTAL:$insertTableRow__EXPERIMENTAL$1,$isTableCellNode:$isTableCellNode$1,$isTableNode:$isTableNode$1,$isTableRowNode:$isTableRowNode$1,$isTableSelection:$isTableSelection$1,$removeTableRowAtIndex:$removeTableRowAtIndex$1,$unmergeCell:$unmergeCell$1,INSERT_TABLE_COMMAND:INSERT_TABLE_COMMAND$1,TableCellHeaderStates:TableCellHeaderStates$1,TableCellNode:TableCellNode$1,TableNode:TableNode$1,TableObserver:TableObserver$1,TableRowNode:TableRowNode$1,applyTableHandlers:applyTableHandlers$1,getDOMCellFromTarget:getDOMCellFromTarget$1,getTableObserverFromTableElement:getTableObserverFromTableElement$1});exports.Core=Lexical,exports.Html=LexicalHtml,exports.List=LexicalList,exports.Link=LexicalLink,exports.Clipboard=LexicalClipboard,exports.Selection=LexicalSelection,exports.History=LexicalHistory,exports.Utils=LexicalUtils,exports.Text=LexicalText,exports.RichText=LexicalRichText,exports.Table=LexicalTable}(this.BX.UI.Lexical=this.BX.UI.Lexical||{});

Youez - 2016 - github.com/yon3zu
LinuXploit