PageSourceSearch

https://www.wyattworks.ai/_next/static/chunks/08b8984nc74fe.js?dpl=dpl_6behjDta9ipsu7VwPwFScP3xXxh2

js wyattworks.ai collected 2026-10-05 13:24:30 UTC 124,520 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="89d8d900-86b9-3230-b125-33017c0bdb88")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,433266,e=>{"use strict";function t(e,...n){let r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let t of(i.append("code",e),n))i.append("v",t);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function n(e,...t){let r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);r.search=i.toString(),console.warn(`Minified Lexical warning #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let r="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,i=r&&"documentMode"in document?document.documentMode:null,l=r&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),s=r&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),o=!(!r||!("InputEvent"in window)||i)&&"getTargetRanges"in new window.InputEvent("input"),a=r&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),u=r&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,d=r&&/Android/.test(navigator.userAgent),f=r&&/^(?=.*Chrome).*/i.test(navigator.userAgent),c=r&&d&&f,h=r&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&l&&!f;function g(...e){let t=[];for(let n of e)if(n&&"string"==typeof n)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}let _=a||u||h?" ":"​",p=s?" ":_,y="֑-߿יִ-﷽ﹰ-ﻼ",m="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",C=RegExp("^[^"+m+"]*["+y+"]"),x=RegExp("^[^"+y+"]*["+m+"]"),S={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},N={directionless:1,unmergeable:2},T={center:2,end:6,justify:4,left:1,right:3,start:5},v={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},k={normal:0,segmented:2,token:1},b={0:"normal",2:"segmented",1:"token"},E="$config",M=!1,O=0;function A(e){O=e.timeStamp}function w(e,t,n){let r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==rJ(e,n)}function D(e,t,n){M=!0;let r=performance.now()-O>100;try{re(e,()=>{let i=nL()||e.getEditorState().read(()=>{let e=nL();return null!==e?e.clone():null}),l=new Map,o=e.getRootElement(),a=e._editorState,u=e._blockCursorElement,d=!1,f="";for(let n=0;n<t.length;n++){let c=t[n],h=c.type,g=c.target,_=function(e,t,n,r){var i;for(let l=e;l&&(i=l,!0!==i.__lexicalUnmanaged);l=ia(l)){let e=rJ(l,t);if(void 0!==e){let t=rW(e,n);if(t)return ro(t)||!iS(l)?void 0:[l,t]}else if(l===r)return[r,rH(n)]}}(g,e,a,o);if(!_)continue;let[p,y]=_;if("characterData"===h)r&&na(y)&&rD(g)&&function(e,t,n){if(nm(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return rD(t)&&n.isAttached()}(i,g,y)&&function(e,t,n){let r=ix(ih(n)),i=null,l=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,l=r.focusOffset);let s=e.nodeValue;null!==s&&r2(t,s,i,l,!1)}(g,y,e);else if("childList"===h){d=!0;let t=c.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=r$(r),l=r.parentNode;if(null!=l&&r!==u&&null===i&&!w(r,l,e)){if(s){let e=(iS(r)?r.innerText:null)||r.nodeValue;e&&(f+=e)}l.removeChild(r)}}let n=c.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(w(r,g,e)||u===r)&&(g.appendChild(r),t++)}r!==t&&l.set(p,y)}}}if(l.size>0)for(let[t,n]of l)n.reconcileObservedMutation(t,e);let c=n.takeRecords();if(c.length>0){for(let t=0;t<c.length;t++){let n=c[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],l=n.parentNode;null==l||"BR"!==n.nodeName||w(n,i,e)||l.removeChild(n)}}n.takeRecords()}null!==i&&(d&&rG(i),s&&ii(e)&&i.insertRawText(f))})}finally{M=!1}}function P(e){let t=e._observer;null!==t&&D(e,t.takeRecords(),t)}function L(e){0===O&&ih(e).addEventListener("textInput",A,!0),e._observer=new MutationObserver((t,n)=>{D(e,t,n)})}class F{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||W).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}}function I(e,t,n="latest"){let r=("latest"===n?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}class R{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n,r=new Map,i){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;const{sharedConfigMap:l}=this.sharedNodeState,s=void 0!==i?i:function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(l,n,r);this.size=s}getValue(e){let t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return z(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:n}=this,r=new Map(this.knownState);return new R(e,t,function(e,t,n){let r;if(n)for(let[i,l]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(l)):(r=r||{})[i]=l}return r}(t.sharedConfigMap,r,n),r,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=z(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}}function K(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new R(t,B(t));return t.__state=n,n}function B(e){return e.__state?e.__state.sharedNodeState:rN(iE(),e.getType()).sharedNodeState}function z(e){if(e)for(let t in e)return e}function W(e){return e}function $(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;
2if(t!==i&&!r.isEqual(t,i))return!0}return!1}function J(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function U(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function j(e,t){let n=e.__mode,r=e.__format,i=e.__style,l=t.__mode,s=t.__format,o=t.__style,a=e.__state,u=t.__state;return(null===n||n===l)&&(null===r||r===s)&&(null===i||i===o)&&(null===e.__state||a===u||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&$(n,e,t)||t&&$(n,t,e)||e&&J(n,e,t)||t&&J(n,t,e))}(a,u))}function Y(e,t){let n=e.mergeWithSibling(t),r=nZ()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function V(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&na(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){j(t,r)&&(r=Y(t,r));break}t.remove()}for(;null!==(n=r.getNextSibling())&&na(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){j(r,n)&&(r=Y(r,n));break}n.remove()}}else r.remove()}function H(e){return G(e.anchor),G(e.focus),e}function G(e){for(;"element"===e.type;){let t,n,r=e.getNode(),i=e.offset;if(i===r.getChildrenSize()?(t=r.getChildAtIndex(i-1),n=!0):(t=r.getChildAtIndex(i),n=!1),na(t)){e.set(t.__key,n?t.getTextContentSize():0,"text",!0);break}if(!ri(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element",!0)}}let q,X,Q,Z,ee,et,en,er,ei,el,es="",eo=null,ea=null,eu="",ed=!1,ef=!1;function ec(e,t){let n=en.get(e);if(null!==t){let n=ek(e);n.parentNode===t&&t.removeChild(n)}if(er.has(e)||X._keyToDOMMap.delete(e),ri(n)){let e=eN(n,en);eh(e,0,e.length-1,null)}void 0!==n&&ie(el,Q,Z,n,"destroyed")}function eh(e,t,n,r){let i=t;for(;i<=n;++i){let t=e[i];void 0!==t&&ec(t,r)}}function eg(e,t){e.setProperty("text-align",t)}function e_(e,t){let n=q.theme.indent;if("string"==typeof n){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}let r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||"40px";e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function ep(e,t){let n=e.style;0===t?eg(n,""):1===t?eg(n,"left"):2===t?eg(n,"center"):3===t?eg(n,"right"):4===t?eg(n,"justify"):5===t?eg(n,"start"):6===t&&eg(n,"end")}function ey(e,t){let n=function(e){let t=e.__dir;if(null!==t)return t;if(ru(e))return null;let n=e.getParentOrThrow();return ru(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function em(e,n){var r;let i,l=er.get(e);void 0===l&&t(60);let s=l.createDOM(q,X);if(i=(r=X)._keyToDOMMap,s[`__lexicalKey_${r._key}`]=e,i.set(e,s),na(l)?s.setAttribute("data-lexical-text","true"):ro(l)&&s.setAttribute("data-lexical-decorator","true"),ri(l)){let e=l.__indent,t=l.__size;ey(s,l),0!==e&&e_(s,e),0!==t&&eC(eN(l,er),l,0,t-1,l.getDOMSlot(s));let n=l.__format;0!==n&&ep(s,n),l.isInline()||eS(null,l,s),is(l)&&(es+="\n\n",eu+="\n\n")}else{let t=l.getTextContent();if(ro(l)){let t=l.decorate(X,q);null!==t&&eT(e,t),s.contentEditable="false"}es+=t,eu+=t}return null!==n&&n.insertChild(s),ie(el,Q,Z,l,"created"),s}function eC(e,t,n,r,i){let l=es;es="";let s=n;for(;s<=r;++s){em(e[s],i);let t=er.get(e[s]);null!==t&&na(t)&&null===eo&&(eo=t.getFormat(),ea=t.getStyle())}is(t)&&(es+="\n\n"),i.element.__lexicalTextContent=es,es=l+es}function ex(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return t1(e)?"line-break":ro(e)&&e.isInline()?"decorator":null}return"empty"}return null}function eS(e,t,n){let r=ex(e,en),i=ex(t,er);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function eN(e,n){let r=[],i=e.__first;for(;null!==i;){let e=n.get(i);void 0===e&&t(101),r.push(i),i=e.__next}return r}function eT(e,t){let n=X._pendingDecorators,r=X._decorators;if(null===n){if(r[e]===t)return;n=rj(X)}n[e]=t}function ev(e){let t=e.nextSibling;return null!==t&&t===X._blockCursorElement&&(t=t.nextSibling),t}function ek(e){let n=ei.get(e);return void 0===n&&t(75,e),n}function eb(e){return{type:e}}let eE=eb("SELECTION_CHANGE_COMMAND"),eM=eb("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),eO=eb("CLICK_COMMAND"),eA=eb("BEFORE_INPUT_COMMAND"),ew=eb("INPUT_COMMAND"),eD=eb("COMPOSITION_START_COMMAND"),eP=eb("COMPOSITION_END_COMMAND"),eL=eb("DELETE_CHARACTER_COMMAND"),eF=eb("INSERT_LINE_BREAK_COMMAND"),eI=eb("INSERT_PARAGRAPH_COMMAND"),eR=eb("CONTROLLED_TEXT_INSERTION_COMMAND"),eK=eb("PASTE_COMMAND"),eB=eb("REMOVE_TEXT_COMMAND"),ez=eb("DELETE_WORD_COMMAND"),eW=eb("DELETE_LINE_COMMAND"),e$=eb("FORMAT_TEXT_COMMAND"),eJ=eb("UNDO_COMMAND"),eU=eb("REDO_COMMAND"),ej=eb("KEYDOWN_COMMAND"),eY=eb("KEY_ARROW_RIGHT_COMMAND"),eV=eb("MOVE_TO_END"),eH=eb("KEY_ARROW_LEFT_COMMAND"),eG=eb("MOVE_TO_START"),eq=eb("KEY_ARROW_UP_COMMAND"),eX=eb("KEY_ARROW_DOWN_COMMAND"),eQ=eb("KEY_ENTER_COMMAND"),eZ=eb("KEY_SPACE_COMMAND"),e0=eb("KEY_BACKSPACE_COMMAND"),e1=eb("KEY_ESCAPE_COMMAND"),e2=eb("KEY_DELETE_COMMAND"),e6=eb("KEY_TAB_COMMAND"),e3=eb("INSERT_TAB_COMMAND"),e4=eb("INDENT_CONTENT_COMMAND"),e5=eb("OUTDENT_CONTENT_COMMAND"),e7=eb("DROP_COMMAND"),e9=eb("FORMAT_ELEMENT_COMMAND"),e8=eb("DRAGSTART_COMMAND"),te=eb("DRAGOVER_COMMAND"),tt=eb("DRAGEND_COMMAND"),tn=eb("COPY_COMMAND"),tr=eb("CUT_COMMAND"),ti=eb("SELECT_ALL_COMMAND"),tl=eb("CLEAR_EDITOR_COMMAND"),ts=eb("CLEAR_HISTORY_COMMAND"),to=eb("CAN_REDO_COMMAND"),ta=eb("CAN_UNDO_COMMAND"),tu=eb("FOCUS_COMMAND"),td=eb("BLUR_COMMAND"),tf=eb("KEY_MODIFIER_COMMAND"),tc=Object.freeze({}),th=[["keydown",function(e,t){tg=e.timeStamp,t_=e.key,t.isComposing()||il(t,ej,e)}],["pointerdown",function(e,t){let n=e.target,r=e.pointerType;iN(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&re(t,()=>{ro(rU(n))||(tS=!0)})}],["compositionstart",function(e,t){il(t,eD,e)}],["compositionend",function(e,t){s?tT=!0:!u&&(a||h)?(tv=!0,tk=e.data):il(t,eP,e)}],["input",function(e,t){e.stopPropagation(),re(t,()=>{t.dispatchCommand(ew,e)},{event:e}),ty=null}],["click",function(e,t){re(t,()=>{let n=nL(),r=ix(ih(t)),i=nF();if(r){if(nm(n)){let t=n.anchor,l=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!ru(l)&&1===rV().getChildrenSize()&&l.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===e.detail&&!n.isCollapsed()&&l!==n.focus.getNode()){let e=iF(l,e=>ri(e)&&!e.isInline());ri(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){let n=r.anchorNode;(iS(n)||rD(n))&&rG(nP(i,r,t,e))}}il(t,eO,e)})}],["cut",tc],["copy",tc],["dragstart",tc],["dragover",tc],["dragend",tc],["paste",tc],["focus",tc],["blur",tc],["drop",tc]];o&&th.push(["beforeinput",(e,t)=>{let n;"deleteCompositionText"===(n=e.inputType)||s&&ii(t)||"insertCompositionText"!==n&&il(t,eA,e)}]);let tg=0,t_=null,tp=0,ty=null,tm=new WeakMap,tC=new WeakMap,tx=!1,tS=!1,tN=!1,tT=!1,tv=!1,tk="",tb=null,tE=[0,"",0,"root",0];function tM(e,t,n,r,i){let l=e.anchor,s=e.focus,a=l.getNode(),u=nZ(),d=ix(ih(u)),f=null!==d?d.anchorNode:null,c=l.key,h=u.getElementByKey(c),g=n.length;return c!==s.key||!na(a)||(!i&&(!o||tp<r+50)||a.isDirty()&&g<2||rX(n))&&l.offset!==s.offset&&!a.isComposing()||rw(a)||a.isDirty()&&g>1||(i||!o)&&null!==h&&!a.isComposing()&&f!==rL(h)||null!==d&&null!==t&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){let n;if(t.isSegmented())return!0;
2if(!e.isCollapsed())return!1;let r=e.anchor.offset,i=t.getParentOrThrow(),l=rA(t);return 0===r?!t.canInsertTextBefore()||!i.canInsertTextBefore()&&!t.isComposing()||l||(na(n=t.getPreviousSibling())||ri(n)&&n.isInline())&&!n.canInsertTextAfter():r===t.getTextContentSize()&&(!t.canInsertTextAfter()||!i.canInsertTextAfter()&&!t.isComposing()||l)}(e,a)}function tO(e,t){return rD(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function tA(e,n,r){let{anchorNode:i,anchorOffset:l,focusNode:s,focusOffset:o}=e;tx&&(tx=!1,tO(i,l)&&tO(s,o)&&!tb)||re(n,()=>{if(!r)return void rG(null);if(!rb(n,i,s))return;let a=nL();if(tb&&nm(a)&&a.isCollapsed()){let e=a.anchor,t=tb.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&rG(a=tb.clone())}if(tb=null,nm(a)){let r=a.anchor,i=r.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);let l=ih(n).event,s=l?l.timeStamp:performance.now(),[o,u,d,f,c]=tE,h=rV(),g=!1===n.isComposing()&&""===h.getTextContent();if(s<c+200&&r.offset===d&&r.key===f)tw(a,o,u);else if("text"===r.type)na(i)||t(141),tD(a,i);else if("element"===r.type&&!g){ri(i)||t(259);let e=r.getNode();e.isEmpty()?tw(a,e.getTextFormat(),e.getTextStyle()):tw(a,0,"")}}else{let e=r.key,t=a.focus.key,n=a.getNodes(),i=n.length,s=a.isBackward(),u=s?o:l,d=s?l:o,f=s?t:e,c=s?e:t,h=2047,g=!1;for(let e=0;e<i;e++){let t=n[e],r=t.getTextContentSize();if(na(t)&&0!==r&&(0!==e||t.__key!==f||u!==r)&&(e!==i-1||t.__key!==c||0!==d)&&(g=!0,0==(h&=t.getFormat())))break}a.format=g?h:0}}il(n,eE,void 0)})}function tw(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function tD(e,t){tw(e,t.getFormat(),t.getStyle())}function tP(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return 0===t.length?null:t[0]}function tL(e){var n;let r=e.inputType,i=tP(e),l=nZ(),s=nL();if("deleteContentBackward"===r){if(null===s){let e=nF();if(!nm(e))return!0;rG(e.clone())}if(nm(s)){let r=s.anchor.key===s.focus.key;if(n=e.timeStamp,"MediaLast"===t_&&n<tg+30&&l.isComposing()&&r){if(rB(null),tg=0,setTimeout(()=>{re(l,()=>{rB(null)})},30),nm(s)){let e=s.anchor.getNode();e.markDirty(),na(e)||t(142),tD(s,e)}}else{rB(null),e.preventDefault();let t=s.anchor.getNode(),n=t.getTextContent(),i=t.canInsertTextAfter(),o=0===s.anchor.offset&&s.focus.offset===n.length,a=c&&r&&!o&&i;if(a&&s.isCollapsed()&&(a=!ro(ir(s.anchor,!0))),!a){il(l,eL,!0);let e=nL();c&&nm(e)&&e.isCollapsed()&&(tb=e,setTimeout(()=>tb=null))}}return!0}}if(!nm(s))return!0;let o=e.data;null!==ty&&r1(!1,l,ty),s.dirty&&null===ty||!s.isCollapsed()||ru(s.anchor.getNode())||null===i||s.applyDOMRange(i),ty=null;let a=s.anchor,d=s.focus,f=a.getNode(),h=d.getNode();if("insertText"===r||"insertTranspose"===r){if("\n"===o)e.preventDefault(),il(l,eF,!1);else if("\n\n"===o)e.preventDefault(),il(l,eI,void 0);else if(null==o&&e.dataTransfer){let t=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(t)}else null!=o&&tM(s,i,o,e.timeStamp,!0)?(e.preventDefault(),il(l,eR,o)):ty=o;return tp=e.timeStamp,!0}switch(e.preventDefault(),r){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":il(l,eR,e);break;case"insertFromComposition":rB(null),il(l,eR,e);break;case"insertLineBreak":rB(null),il(l,eF,!1);break;case"insertParagraph":rB(null),tN&&!u?(tN=!1,il(l,eF,!1)):il(l,eI,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":il(l,eK,e);break;case"deleteByComposition":(f!==h||ri(f)||ri(h)||!rA(f)||!rA(h))&&il(l,eB,e);break;case"deleteByDrag":case"deleteByCut":il(l,eB,e);break;case"deleteContent":il(l,eL,!1);break;case"deleteWordBackward":il(l,ez,!0);break;
2case"deleteWordForward":il(l,ez,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":il(l,eW,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":il(l,eW,!1);break;case"formatStrikeThrough":il(l,e$,"strikethrough");break;case"formatBold":il(l,e$,"bold");break;case"formatItalic":il(l,e$,"italic");break;case"formatUnderline":il(l,e$,"underline");break;case"historyUndo":il(l,eJ,void 0);break;case"historyRedo":il(l,eU,void 0)}return!0}function tF(e){if(iS(e.target)&&ro(rU(e.target)))return!0;let t=nZ(),n=nL(),r=e.data,i=tP(e);if(null!=r&&nm(n)&&tM(n,i,r,e.timeStamp,!1)){tT&&(tK(t,r),tT=!1);let i=n.anchor.getNode(),l=ix(ih(t));if(null===l)return!0;let d=n.isBackward(),f=d?n.anchor.offset:n.focus.offset,c=d?n.focus.offset:n.anchor.offset;o&&!n.isCollapsed()&&na(i)&&null!==l.anchorNode&&i.getTextContent().slice(0,f)+r+i.getTextContent().slice(f+c)===r0(l.anchorNode)||il(t,eR,r);let g=r.length;s&&g>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=g),a||u||h||!t.isComposing()||(tg=0,rB(null))}else r1(!1,t,null!==r?r:void 0),tT&&(tK(t,r||void 0),tT=!1);return nq(),P(nZ()),!0}function tI(e){let t=nZ(),n=nL();if(nm(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();rB(r.key),(e.timeStamp<tg+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||na(i)&&i.getStyle()!==n.style)&&il(t,eR,p)}return!0}function tR(e){return tK(nZ(),e.data),!0}function tK(e,t){let n=e._compositionKey;if(rB(null),null!==n&&null!=t){if(""===t){let t=rW(n),r=rL(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&na(t)&&r2(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){let t=nL();if(nm(t)){let n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void il(e,eQ,null)}}}r1(!0,e,t)}function tB(e){let t=nZ();if(null==e.key)return!0;if(tv&&r9(e))return re(t,()=>{tK(t,tk)}),tv=!1,tk="",!0;if(r4(e,"ArrowRight",{shiftKey:"any"}))il(t,eY,e);else if(r4(e,"ArrowRight",r5))il(t,eV,e);else if(r4(e,"ArrowLeft",{shiftKey:"any"}))il(t,eH,e);else if(r4(e,"ArrowLeft",r5))il(t,eG,e);else if(r4(e,"ArrowUp",{altKey:"any",shiftKey:"any"}))il(t,eq,e);else if(r4(e,"ArrowDown",{altKey:"any",shiftKey:"any"}))il(t,eX,e);else if(r4(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0}))tN=!0,il(t,eQ,e);else if(" "===e.key)il(t,eZ,e);else if(l&&r4(e,"o",{ctrlKey:!0}))e.preventDefault(),tN=!0,il(t,eF,!0);else if(r4(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"}))tN=!1,il(t,eQ,e);else if(r4(e,"Backspace",{shiftKey:"any"})||l&&r4(e,"h",{ctrlKey:!0}))r9(e)?il(t,e0,e):(e.preventDefault(),il(t,eL,!0));else if("Escape"===e.key)il(t,e1,e);else if(r4(e,"Delete",{})||l&&r4(e,"d",{ctrlKey:!0}))"Delete"!==e.key?(e.preventDefault(),il(t,eL,!1)):il(t,e2,e);else if(r4(e,"Backspace",r7))e.preventDefault(),il(t,ez,!0);else if(r4(e,"Delete",r7))e.preventDefault(),il(t,ez,!1);else if(l&&r4(e,"Backspace",{metaKey:!0}))e.preventDefault(),il(t,eW,!0);else if(l&&(r4(e,"Delete",{metaKey:!0})||r4(e,"k",{ctrlKey:!0})))e.preventDefault(),il(t,eW,!1);else if(r4(e,"b",r5))e.preventDefault(),il(t,e$,"bold");else if(r4(e,"u",r5))e.preventDefault(),il(t,e$,"underline");else if(r4(e,"i",r5))e.preventDefault(),il(t,e$,"italic");else if(r4(e,"Tab",{shiftKey:"any"}))il(t,e6,e);else if(r4(e,"z",r5))e.preventDefault(),il(t,eJ,void 0);else if(l?r4(e,"z",{metaKey:!0,shiftKey:!0}):r4(e,"y",{ctrlKey:!0})||r4(e,"z",{ctrlKey:!0,shiftKey:!0}))e.preventDefault(),il(t,eU,void 0);else{let n=t._editorState._selection;null===n||nm(n)?r4(e,"a",r5)&&(e.preventDefault(),il(t,ti,e)):r4(e,"c",r5)?(e.preventDefault(),il(t,tn,e)):r4(e,"x",r5)?(e.preventDefault(),il(t,tr,e)):r4(e,"a",r5)&&(e.preventDefault(),il(t,ti,e))}return(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)&&t.dispatchCommand(tf,e),!0}function tz(e){let t=e.__lexicalEventHandles;return void 0===t&&(e.__lexicalEventHandles=t=[]),t}let tW=new Map;function t$(e){let t,n=(t=ic(e.target))?t.getSelection():null;if(null===n)return;let r=rM(n.anchorNode);if(null===r)return;tS&&(tS=!1,re(r,()=>{let t=nF(),i=n.anchorNode;(iS(i)||rD(i))&&rG(nP(t,n,r,e))}));let i=rQ(r),l=i[i.length-1],s=l._key,o=tW.get(s),a=o||l;a!==r&&tA(n,a,!1),tA(n,r,!0),r!==l?tW.set(s,r):o&&tW.delete(s)}function tJ(e){e._lexicalHandled=!0}function tU(e){return!0===e._lexicalHandled}let tj=()=>{};function tY(e,t,n){nq();let r=e.__key,i=e.getParent();if(null===i)return;let l=function(e){let t=nL();if(!nm(t)||!ri(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),l=r.getNode();return id(i,e)&&n.set(e.__key,0,"element"),id(l,e)&&r.set(e.__key,0,"element"),t}(e),s=!1;if(nm(l)&&t){let t=l.anchor,n=l.focus;t.key===r&&(nK(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(nK(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else nx(l)&&t&&e.isSelected()&&e.selectPrevious();if(nm(l)&&t&&!s){let t=e.getIndexWithinParent();rR(e),nI(l,i,t,-1)}else rR(e);n||ig(i)||i.canBeEmpty()||!i.isEmpty()||tY(i,t),t&&l&&ru(i)&&i.isEmpty()&&i.selectEnd()}let tV=Symbol.for("ephemeral");function tH(e){return e[tV]||!1}class tG{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=iL(this);return void 0===e&&t(64,this.name),e}static clone(e){t(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),rI(this,e)}getType(){return this.__type}isInline(){t(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;let t=rW(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){let t=e||nL();if(null==t)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(na(this))return n;if(nm(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;let e=this.getParent();if(ro(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(null===e)return -1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return -1}getParent(){let e=this.getLatest().__parent;return null===e?null:rW(e)}getParentOrThrow(){let e=this.getParent();return null===e&&t(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){let n=e.getParent();if(ig(n))return ri(e)||e===this&&ro(e)||t(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return null===e&&t(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return null===e?null:rW(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return null===e?null:rW(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=ri(this)?this:this.getParent(),n=ri(e)?e:e.getParent(),r=t&&n?le(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){let n=le(this,e);return null!==n&&("descendant"===n.type||("branch"===n.type?-1===i9(n):("same"!==n.type&&"ancestor"!==n.type&&t(279),!1)))}isParentOf(e){let t=le(this,e);return null!==t&&"ancestor"===t.type}getNodesBetween(e){let n=this.isBefore(e),r=[],i=new Set,l=this;for(;null!==l;){let s=l.__key;if(i.has(s)||(i.add(s),r.push(l)),l===e)break;let o=ri(l)?n?l.getFirstChild():l.getLastChild():null;if(null!==o){l=o;continue}let a=n?l.getNextSibling():l.getPreviousSibling();if(null!==a){l=a;continue}let u=l.getParentOrThrow();if(i.has(u.__key)||r.push(u),u===e)break;let d=null,f=u;do{if(null===f&&t(68),d=n?f.getNextSibling():f.getPreviousSibling(),null===(f=f.getParent()))break;null!==d||i.has(f.__key)||r.push(f)}while(null===d)l=d}return n||r.reverse(),r}isDirty(){let e=nZ()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(tH(this))return this;let e=rW(this.__key);return null===e&&t(113),e}getWritable(){if(tH(this))return this;nq();let e=nQ(),t=nZ(),n=e._nodeMap,r=this.__key,i=this.getLatest(),l=t._cloneNotNeeded,s=nL();if(null!==s&&s.setCachedNodes(null),l.has(r))return rK(i),i;let o=iw(i);return l.add(r),rK(o),n.set(r,o),o}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){t(70)}updateDOM(e,n,r){t(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){t(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of B(n).flatKeys)e in t&&(void 0!==i&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&K(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){tY(this,!0,e)}replace(e,n){nq();let r=nL();null!==r&&(r=r.clone()),iy(this,e);let i=this.getLatest(),l=this.__key,s=e.__key,o=e.getWritable(),a=this.getParentOrThrow().getWritable(),u=a.__size;rR(o);let d=i.getPreviousSibling(),f=i.getNextSibling(),c=i.__prev,h=i.__next,g=i.__parent;if((tY(i,!1,!0),null===d)?a.__first=s:d.getWritable().__next=s,(o.__prev=c,null===f)?a.__last=s:f.getWritable().__prev=s,o.__next=h,o.__parent=g,a.__size=u,n&&(ri(this)&&ri(o)||t(139),this.getChildren().forEac
2h(e=>{o.append(e)})),nm(r)){rG(r);let e=r.anchor,t=r.focus;e.key===l&&np(e,o),t.key===l&&np(t,o)}return rz()===l&&rB(s),o}insertAfter(e,t=!0){nq(),iy(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),l=nL(),s=!1,o=!1;if(null!==i){let t=e.getIndexWithinParent();if(rR(r),nm(l)){let e=i.__key,n=l.anchor,r=l.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,o="element"===r.type&&r.key===e&&r.offset===t+1}}let a=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=r.__key,f=n.__next;if(null===a?u.__last=d:a.getWritable().__prev=d,u.__size++,n.__next=d,r.__next=f,r.__prev=n.__key,r.__parent=n.__parent,t&&nm(l)){let e=this.getIndexWithinParent();nI(l,u,e+1);let t=u.__key;s&&l.anchor.set(t,e+2,"element"),o&&l.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){nq(),iy(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;rR(r);let l=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),o=n.__prev,a=this.getIndexWithinParent();null===l?s.__first=i:l.getWritable().__next=i,s.__size++,n.__prev=i,r.__prev=o,r.__next=n.__key,r.__parent=n.__parent;let u=nL();return t&&nm(u)&&nI(u,this.getParentOrThrow(),a),e}isParentRequired(){return!1}createParentElementNode(){return rp()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){nq();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(ri(n))return n.select();if(!na(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){nq();let n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(ri(n))return n.select(0,0);if(!na(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}let tq="history-merge",tX="collaboration";class tQ extends tG{static getType(){return"linebreak"}static clone(e){return new tQ(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(e){let t=e.parentElement;if(null!==t&&ik(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&t2(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&t2(n))return!0}}return!1})(e)||function(e){let t=e.parentElement;if(null!==t&&ik(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&t2(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&t2(r))return!0}return!1}(e)?null:{conversion:tZ,priority:0}}}static importJSON(e){return t0().updateFromJSON(e)}}function tZ(e){return{node:t0()}}function t0(){return ip(new tQ)}function t1(e){return e instanceof tQ}function t2(e){return rD(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function t6(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function t3(e,t){return 1&t?"strong":2&t?"em":"span"}function t4(e,t,n,r,i){let l=r.classList,s=r8(i,"base");void 0!==s&&l.add(...s);let o=!1,a=8&t&&4&t;for(let e in void 0!==(s=r8(i,"underlineStrikethrough"))&&(8&n&&4&n?(o=!0,a||l.add(...s)):a&&l.remove(...s)),S){let r=S[e];if(void 0!==(s=r8(i,e)))if(n&r){if(o&&("underline"===e||"strikethrough"===e)){t&r&&l.remove(...s);continue}(0==(t&r)||a&&"underline"===e||"strikethrough"===e)&&l.add(...s)}else t&r&&l.remove(...s)}}function t5(e,t,n){let r=t.firstChild,i=n.isComposing(),l=e+(i?_:"");if(null==r)t.textContent=l;else{let e=r.nodeValue;if(e!==l)if(i||s){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,l=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;l+i<n&&l+i<r&&e[n-l-1]===t[r-l-1];)l++;return[i,n-i-l,t.slice(i,r-l)]}(e,l);0!==n&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=l}}function t7(e,t,n,r,i,l){t5(i,e,t);let s=l.theme.text;void 0!==s&&t4(0,0,r,e,s)}function t9(e,t){let n=document.createElement(t);return n.appendChild(e),n}class t8 extends tG{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new t8(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return b[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===rz()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=S[e];return 0!=(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return rF(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=t6(0,n),i=t3(0,n),l=null===r?i:r,s=document.createElement(l),o=s;
2this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(o=document.createElement(i),s.appendChild(o)),t7(o,this,0,n,this.__text,e);let a=this.__style;return""!==a&&(s.style.cssText=a),s}updateDOM(e,n,r){let i=this.__text,l=e.__format,s=this.__format,o=t6(0,l),a=t6(0,s),u=t3(0,l),d=t3(0,s);if((null===o?u:o)!==(null===a?d:a))return!0;if(o===a&&u!==d){let e=n.firstChild;null==e&&t(48);let l=document.createElement(d);return t7(l,this,0,s,i,r),n.replaceChild(l,e),!1}let f=n;null!==a&&null!==o&&null==(f=n.firstChild)&&t(49),t5(i,f,this);let c=r.theme.text;void 0!==c&&l!==s&&t4(0,l,s,f,c);let h=e.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:nr,priority:0}),b:()=>({conversion:nt,priority:0}),code:()=>({conversion:ns,priority:0}),em:()=>({conversion:ns,priority:0}),i:()=>({conversion:ns,priority:0}),mark:()=>({conversion:ns,priority:0}),s:()=>({conversion:ns,priority:0}),span:()=>({conversion:ne,priority:0}),strong:()=>({conversion:ns,priority:0}),sub:()=>({conversion:ns,priority:0}),sup:()=>({conversion:ns,priority:0}),u:()=>({conversion:ns,priority:0})}}static importJSON(e){return no().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}
2exportDOM(e){let{element:n}=super.exportDOM(e);return iS(n)||t(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=t9(n,"b")),this.hasFormat("italic")&&(n=t9(n,"i")),this.hasFormat("strikethrough")&&(n=t9(n,"s")),this.hasFormat("underline")&&(n=t9(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format="string"==typeof e?S[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?N[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=rF(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=k[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){nq();let n=e,r=t,i=nL(),l=this.getTextContent(),s=this.__key;if("string"==typeof l){let e=l.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!nm(i))return nA(s,n,s,r,"text","text");{let e=rz();e!==i.anchor.key&&e!==i.focus.key||rB(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),l=i.__text,s=n.length,o=e;o<0&&(o=s+o)<0&&(o=0);let a=nL();if(r&&nm(a)){let t=e+s;a.setTextNodeRange(i,t,i,t)}return i.__text=l.slice(0,o)+n+l.slice(o+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){let t;nq();let n=this.getLatest(),r=n.getTextContent();if(""===r)return[];let i=n.__key,l=rz(),s=r.length;e.sort((e,t)=>e-t),e.push(s);let o=[],a=e.length;for(let t=0,n=0;t<s&&n<=a;n++){let i=e[n];i>t&&(o.push(r.slice(t,i)),t=i)}let u=o.length;if(1===u)return[n];let d=o[0],f=n.getParent(),c=n.getFormat(),h=n.getStyle(),g=n.__detail,_=!1,p=null,y=null,m=nL();if(nm(m)){let[e,t]=m.isBackward()?[m.focus,m.anchor]:[m.anchor,m.focus];"text"===e.type&&e.key===i&&(p=e),"text"===t.type&&t.key===i&&(y=t)}n.isSegmented()?((t=no(d)).__format=c,t.__style=h,t.__detail=g,t.__state=U(n,t),_=!0):t=n.setTextContent(d);let C=[t];for(let e=1;e<u;e++){let t=no(o[e]);t.__format=c,t.__style=h,t.__detail=g,t.__state=U(n,t);let r=t.__key;l===i&&rB(r),C.push(t)}let x=p?p.offset:null,S=y?y.offset:null,N=0;for(let e of C){if(!p&&!y)break;let t=N+e.getTextContentSize();if(null!==p&&null!==x&&x<=t&&x>=N&&(p.set(e.getKey(),x-N,"text"),x<t&&(p=null)),null!==y&&null!==S&&S<=t&&S>=N){y.set(e.getKey(),S-N,"text");break}N=t}if(null!==f){let e,t;e=this.getPreviousSibling(),t=this.getNextSibling(),null!==e&&rK(e),null!==t&&rK(t);let n=f.getWritable(),r=this.getIndexWithinParent();_?(n.splice(r,0,C),this.remove()):n.splice(r,1,C),nm(m)&&nI(m,f,r,u-1)}return C}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||t(50);let r=this.__key,i=e.__key,l=this.__text,s=l.length;rz()===i&&rB(r);let o=nL();if(nm(o)){let t=o.anchor,l=o.focus;null!==t&&t.key===i&&nB(t,n,r,e,s),null!==l&&l.key===i&&nB(l,n,r,e,s)}let a=e.__text,u=n?a+l:l+a;this.setTextContent(u);let d=this.getWritable();return e.remove(),d}isTextEntity(){return!1}}function ne(e){return{forChild:nu(e.style),node:null}}function nt(e){let t="normal"===e.style.fontWeight;return{forChild:nu(e.style,t?void 0:"bold"),node:null}}let nn=new WeakMap;function nr(e){null===e.parentElement&&t(129);let n=e.textContent||"";if(null!==function(e){let t,n=e.parentNode,r=[e];for(;null!==n&&void 0===(t=nn.get(n))&&!function(e){if(!iS(e))return!1;if("PRE"===e.nodeName)return!0;let t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}(n);)r.push(n),n=n.parentNode;let i=void 0===t?n:t;for(let e=0;e<r.length;e++)nn.set(r[e],i);return i}(e)){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];"\n"===r||"\r\n"===r?t.push(t0()):"	"===r?t.push(nf()):""!==r&&t.push(no(r))}return{node:t}}if(""===(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," ")))return{node:null};if(" "===n[0]){let t=e,r=!0;for(;null!==t&&null!==(t=ni(t,!1));){let 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}
2:{node:no(n)}}function ni(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){let e=n.parentElement;if(null===e)return null;n=e}if(iS(n=e)){let e=n.style.display;if(""===e&&!iv(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(rD(n))return n;if("BR"===n.nodeName)return null}}let nl={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ns(e){let t=nl[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:nu(e.style,t),node:null}}function no(e=""){return ip(new t8(e))}function na(e){return e instanceof t8}function nu(e,t){let n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,l=r.includes("line-through"),s="italic"===e.fontStyle,o=r.includes("underline"),a=e.verticalAlign;return e=>(na(e)&&(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),o&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==a||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==a||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}class nd extends t8{static getType(){return"tab"}static clone(e){return new nd(e.__key)}constructor(e){super("	",e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=r8(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return nf().updateFromJSON(e)}setTextContent(e){return"	"!==e&&""!==e&&n(126),super.setTextContent("	")}spliceText(e,n,r,i){return""===r&&0===n||"	"===r&&1===n||t(286),this}setDetail(e){return 2!==e&&t(127),this}setMode(e){return"normal"!==e&&t(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function nf(){return ip(new nd)}function nc(e){return e instanceof nd}class nh{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:0>i7(lu(lt(this,"next")),lu(lt(e,"next")))}getNode(){let e=rW(this.key);return null===e&&t(20),e}set(e,t,n,r){let i=this._selection,l=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,nG()||(rz()===l&&rB(e),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function ng(e,t,n){return new nh(e,t,n)}function n_(e,t){let n=t.__key,r=e.offset,i="element";if(na(t)){i="text";let e=t.getTextContentSize();r>e&&(r=e)}else if(!ri(t)){let e=t.getNextSibling();if(na(e))n=e.__key,r=0,i="text";else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function np(e,t){if(ri(t)){let n=t.getLastDescendant();ri(n)||na(n)?n_(e,n):n_(e,t)}else n_(e,t)}class ny{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!nx(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new ny(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t,n=this.getNodes(),r=n.length,i=n[r-1];if(na(i))t=i.select();else{let e=i.getIndexWithinParent()+1;t=i.getParentOrThrow().select(e,e)}t.insertNodes(e);for(let e=0;e<r;e++)n[e].remove()}getNodes(){let e=this._cachedNodes;if(null!==e)return e;let t=this._nodes,n=[];for(let e of t){let t=rW(e);null!==t&&n.push(t)}return nG()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((nL()||nF())===this&&e[0]){let t=iG(e[0],"next");lr(i4(t,t))}for(let t of e)t.remove()}}function nm(e){return e instanceof nC}class nC{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!nm(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(null!==e)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();
2n&&t.push(n.caret.origin);let i=new Set,l=new Set;for(let n of e)if(ij(n)){let{origin:e}=n;0===t.length?i.add(e):(l.add(e),t.push(e))}else{let{origin:e}=n;ri(e)&&l.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),iU(e.focus)&&ri(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=iQ(e.focus.origin,"previous");ij(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=i0(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!ri(e)||l.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){let n=lu(e.anchor),r=lu(e.anchor.getFlipped()),i=e=>iJ(e)?e.origin:e.getNodeAtCaret(),l=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(l)}return t}(lc(ll(this),"next"));return nG()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){let e=this.getNodes();if(0===e.length)return"";let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,l=r.isBefore(i),[s,o]=nN(this),a="",u=!0;for(let d=0;d<e.length;d++){let f=e[d];if(ri(f)&&!f.isInline())u||(a+="\n"),u=!f.isEmpty();else if(u=!1,na(f)){let e=f.getTextContent();f===t?f===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=s<o?e.slice(s,o):e.slice(o,s)):e=l?e.slice(s):e.slice(o):f===n&&(e=l?e.slice(0,o):e.slice(0,s)),a+=e}else!ro(f)&&!t1(f)||f===n&&this.isCollapsed()||(a+=f.getTextContent())}return a}applyDOMRange(e){let t=nZ(),n=t.getEditorState()._selection,r=nO(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;let[i,l]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(l.key,l.offset,l.type,!0),H(this)}clone(){let e=this.anchor,t=this.focus;return new nC(ng(e.key,e.offset,e.type),ng(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=rF(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=S[e];return 0!=(this.format&t)}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];"\n"===r||"\r\n"===r?n.push(t0()):"	"===r?n.push(nf()):n.push(no(r))}this.insertNodes(n)}insertText(e){let n=this.anchor,r=this.focus,i=this.format,l=this.style,s=n,o=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,o=n),"element"===s.type&&function(e,t,n,r){let i=e.getNode(),l=i.getChildAtIndex(e.offset),s=no();if(s.setFormat(n),s.setStyle(r),ry(l))l.splice(0,0,[s]);else{let e=ru(i)?rp().append(s):s;null===l?i.append(e):l.insertBefore(e)}e.is(t)&&t.set(s.__key,0,"text"),e.set(s.__key,0,"text")}(s,o,i,l),"element"===o.type&&ln(o,lu(lt(o,"next")));let a=s.offset,u=o.offset,d=this.getNodes(),f=d.length,c=d[0];na(c)||t(26);let h=c.getTextContent().length,g=c.getParentOrThrow(),_=d[f-1];if(1===f&&"element"===o.type&&(u=h,o.set(s.key,u,"text")),this.isCollapsed()&&a===h&&(rw(c)||!c.canInsertTextAfter()||!g.canInsertTextAfter()&&null===c.getNextSibling())){let t=c.getNextSibling();if(na(t)&&t.canInsertTextBefore()&&!rw(t)||((t=no()).setFormat(i),t.setStyle(l),g.canInsertTextAfter()?c.insertAfter(t):g.insertAfter(t)),t.select(0,0),c=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(rw(c)||!c.canInsertTextBefore()||!g.canInsertTextBefore()&&null===c.getPreviousSibling())){let t=c.getPreviousSibling();if(na(t)&&!rw(t)||((t=no()).setFormat(i),g.canInsertTextBefore()?c.insertBefore(t):g.insertBefore(t)),t.select(),c=t,""!==e)return void this.insertText(e)}else if(c.isSegmented()&&a!==h){let e=no(c.getTextContent());e.setFormat(i),c.replace(e),c=e}else if(!this.isCollapsed()&&""!==e){let t=_.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||ri(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),nM(this.anchor,this.focus,null),void this.insertText(e)}if(1===f){if(rA(c)){let t=no(e);return t.select(),void c.replace(t)}let t=c.getFormat(),n=c.getStyle();if(a!==u||t===i&&n===l){if(nc(c)){let t=no(e);return t.setFormat(i),t.setStyle(l),t.select(),void c.replace(t)}}else{if(""!==c.getTextContent()){let t=no(e);if(t.setFormat(i),t.setStyle(l),t.select(),0===a)c.insertBefore(t,!1);else{let[e]=c.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}c.setFormat(i),c.setStyle(l)}let r=u-a;""===(c=c.spliceText(a,r,e,!0)).getTextContent()?c.remove():"text"===this.anchor.type&&(c.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{let t=new Set([...c.getParentKeys(),..._.getParentKeys()]),n=ri(c)?c:c.getParentOrThrow(),r=ri(_)?_:_.getParentOrThrow(),i=_;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline())if("text"===o.type&&(0!==u||""===_.getTextContent())||"element"===o.type&&_.getIndexWithinParent()<u)if(na(_)&&!rA(_)&&u!==_.getTextContentSize()){if(_.isSegmented()){let e=no(_.getTextContent());_.replace(e),_=e}ru(o.getNode())||"text"!==o.type||(_=_.spliceText(0,u,"")),t.add(_.__key)}else{let e=_.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?_.remove():e.remove()}else t.add(_.__key);let l=r.getChildren(),s=new Set(d),g=n.is(r),p=n.isInline()&&null===c.getNextSibling()?n:c;for(let e=l.length-1;e>=0;e--){let t=l[e];if(t.is(c)||ri(t)&&t.isParentOf(c))break;t.isAttached()&&(!s.has(t)||t.is(i)?g||p.insertAfter(t,!1):t.remove())}if(!g){let e=r,n=null;for(;null!==e;){let r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(rA(c))if(a===h)c.select();else{let t=no(e);t.select(),c.replace(t)}else""===(c=c.spliceText(a,h-a,e,!0)).getTextContent()?c.remove():c.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<f;e++){let n=d[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=nL()===this;li(this,function(e,n="removeEmptySlices"){let r,i;if(e.isCollapsed())return e;let l="root",s="next",o=n,a=lc(e,s),u=lo(a.anchor,l),d=lo(a.focus.getFlipped(),l),f=new Set,c=[];for(let e of a.iterNodeCarets(l))if(ij(e))f.add(e.origin.getKey());else if(iU(e)){let{origin:t}=e;ri(t)&&!f.has(t.getKey())||c.push(t)}for(let e of c)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),r=ls(iG(t,s)),i=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===o||"token"===i&&0!==e.distance)r.remove();else if(0!==e.distance){o="removeEmptySlices";let t=e.removeTextSlice(),n=e.caret.origin;if("segmented"===i){let e=t.origin,n=no(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());r.replaceOrInsert(n),t=iq(n,s,t.offset)}n.is(u[0].origin)&&(u[0]=t),n.is(d[0].origin)&&(d[0]=t.getFlipped())}}for(let e of u)if(la(e)){r=lu(e);break}for(let e of d)if(la(e)){i=lu(e);break}let h=function(e,t,n){let r;if(!e||!t)return null;let i=e.getParentAtCaret(),l=t.getParentAtCaret();if(!i||!l)return null;let s=i.getParents().reverse();s.push(i);let o=l.getParents().reverse();o.push(l);let a=Math.min(s.length,o.length);for(r=0;r<a&&s[r]===o[r];r++);let u=(e,t)=>
2{let n;for(let i=r;i<e.length;i++){let r=e[i];if(ig(r))return;!n&&t(r)&&(n=r)}return n},d=u(s,ib),f=d&&u(o,e=>n.has(e.getKey())&&ib(e));return d&&f?[d,f]:null}(r,i,f);if(h){let[e,t]=h;iQ(e,"previous").splice(0,t.getChildren()),t.remove()}let g=[r,i,...u,...d].find(la);if(g)return i3(lf(lu(g),e.direction));t(269,JSON.stringify(u.map(e=>e.origin.__key)))}(ll(this))),e&&nL()!==this&&rG(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void rB(null);let n=this.getNodes(),r=[];for(let e of n)na(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(ri(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},l=r.length;if(0===l)return this.toggleFormat(e),rB(null),void i(t);let s=this.anchor,o=this.focus,a=this.isBackward(),u=a?o:s,d=a?s:o,f=0,c=r[0],h="element"===u.type?0:u.offset;if("text"===u.type&&h===c.getTextContentSize()&&(f=1,c=r[1],h=0),null==c)return;let g=c.getFormatFlags(e,t);i(g);let _=l-1,p=r[_],y="text"===d.type?d.offset:p.getTextContentSize();if(c.is(p)){if(h===y)return;if(rw(c)||0===h&&y===c.getTextContentSize())c.setFormat(g);else{let e=c.splitText(h,y),t=0===h?e[0]:e[1];t.setFormat(g),"text"===u.type&&u.set(t.__key,0,"text"),"text"===d.type&&d.set(t.__key,y-h,"text")}return void(this.format=g)}0===h||rw(c)||([,c]=c.splitText(h),h=0),c.setFormat(g);let m=p.getFormatFlags(e,g);y>0&&(y===p.getTextContentSize()||rw(p)||([p]=p.splitText(y)),p.setFormat(m));for(let t=f+1;t<_;t++){let n=r[t],i=n.getFormatFlags(e,m);n.setFormat(i)}"text"===u.type&&u.set(c.__key,h,"text"),"text"===d.type&&d.set(p.__key,y,"text"),this.format=g|m}insertNodes(e){var n;if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();let n=nL();return nm(n)||t(134),n.insertNodes(e)}let r=(this.isBackward()?this.focus:this.anchor).getNode(),i=iF(r,ib),l=e[e.length-1];if(ri(i)&&"__language"in i){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let t=nW(this);i.splice(t,0,e),l.selectEnd()}return}if(!e.some(e=>(ri(e)||ro(e))&&!e.isInline())){ri(i)||t(211,r.constructor.name,r.getType());let n=nW(this);return i.splice(n,0,e),void l.selectEnd()}let s=function(e){let t=rp(),n=null;for(let r=0;r<e.length;r++){let i=e[r],l=t1(i);if(l||ro(i)&&i.isInline()||ri(i)&&i.isInline()||na(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),t.append(n),l))continue;null!==n&&n.append(i)}else t.append(i),n=null}return t}(e),o=s.getLastDescendant(),a=s.getChildren(),u=ri(i)&&i.isEmpty()?null:this.insertParagraph(),d=a[a.length-1],f=a[0];ri(n=f)&&ib(n)&&!n.isEmpty()&&ri(i)&&(!i.isEmpty()||i.canMergeWhenEmpty())&&(ri(i)||t(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=a[1]),f&&(null===i&&t(212,r.constructor.name,r.getType()),function(e,n){let r=n.getParentOrThrow().getLastChild(),i=n,l=[n];for(;i!==r;)i.getNextSibling()||t(140),l.push(i=i.getNextSibling());let s=e;for(let e of l)s=s.insertAfter(e)}(i,f));let c=iF(o,ib);u&&ri(c)&&(u.canMergeWhenEmpty()||ib(d))&&(c.append(...u.getChildren()),u.remove()),ri(i)&&i.isEmpty()&&i.remove(),o.selectEnd();let h=ri(i)?i.getLastChild():null;t1(h)&&c!==i&&h.remove()}insertParagraph(){if("root"===this.anchor.key){let e=rp();return rV().splice(this.anchor.offset,0,[e]),e.select(),e}let e=nW(this),n=iF(this.anchor.getNode(),ib);ri(n)||t(213);let r=n.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],l=n.insertNewAfter(this,!1);return l?(l.append(...i),l.selectStart(),l):null}insertLineBreak(e){let t=t0();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,l]=nN(this),s=this.isBackward(),[o,a]=s?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=s?[l,i]:[i,l];if(0===t)return[];if(1===t){if(na(n)&&!this.isCollapsed()){let e=n.splitText(u,d),t=0===u?e[0]:e[1];return t?(o.set(t.getKey(),0,"text"),a.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(na(n)&&(u===n.getTextContentSize()?e.shift():0!==u&&([,n]=n.splitText(u),e[0]=n,o.set(n.getKey(),0,"text"))),na(r)){let t=r.getTextContent().length;0===d?e.pop():d!==t&&([r]=r.splitText(d),e[e.length-1]=r,a.set(r.getKey(),r.getTextContentSize(),"text"))}return e}
2modify(e,t,n){var r;if(n$(this,e,t,n))return;let i="move"===e,l=nZ(),s=ix(ih(l));if(!s)return;let o=l._blockCursorElement,a=l._rootElement,u=this.focus.getNode();if(null===a||null===o||!ri(u)||u.isInline()||u.canBeEmpty()||iC(o,l,a),this.dirty){let e=io(l,this.anchor.key),t=io(l,this.focus.key);"text"===this.anchor.type&&(e=rL(e)),"text"===this.focus.type&&(t=rL(t)),e&&t&&nz(s,e,this.anchor.offset,t,this.focus.offset)}if(r=t?"backward":"forward",s.modify(e,r,n),s.rangeCount>0){let e=s.getRangeAt(0),n=this.anchor.getNode(),r=ru(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t&&!ig(t);)t=t.getParentOrThrow();return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){let n,i,l,o,a,u=this.getNodes(),d=[],f=!1;for(let e=0;e<u.length;e++){let t=u[e];id(t,r)?d.push(t):f=!0}if(f&&d.length>0)if(t){let e=d[0];ri(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=d[d.length-1];ri(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}s.anchorNode===e.startContainer&&s.anchorOffset===e.startOffset||(n=this.focus,l=(i=this.anchor).key,o=i.offset,a=i.type,i.set(n.key,n.offset,n.type,!0),n.set(l,o,a,!0))}}"lineboundary"===n&&n$(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&ri(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(ri(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=i6(lt(t,e?"previous":"next"));if(r.getTextSlices().every(e=>null===e||0===e.distance)){let e={type:"initial"};for(let t of r.iterNodeCarets("shadowRoot"))if(ij(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(ri(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=lu(t);li(this,i4(e,e)),r.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(iU(t)){if(ri(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(ro(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&ri(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=nD();e.add(t.origin.getKey()),rG(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){let{caret:t,block:n}=e;return li(this,i4(!t.origin.isEmpty()&&n.isEmpty()?ls(iG(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&nT(this,t.getNode()))return}else{let r="text"===i.type?i.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){let t=i.offset,l=r.getTextContentSize();if(r.is(n)||e&&t!==l||!e&&0!==t)return void nk(r,e,t)}else if(null!==n&&n.isSegmented()){let i=t.offset,l=n.getTextContentSize();if(n.is(r)||e&&0!==i||!e&&i!==l)return void nk(n,e,i)}!function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){var l;let e=n.offset,s=r.offset,o=e<s,a=o?e:s,u=o?s:e,d=u-1;a===d||rX(l=i.getTextContent().slice(a,u))||nv(l)||(t?r.set(r.key,d,r.type):n.set(n.key,d,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){let e=this.anchor.getNode();e.isEmpty()&&ru(e.getParent())&&null===e.getPreviousSibling()&&nT(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function nx(e){return e instanceof ny}function nS(e){let t=e.offset;if("text"===e.type)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function nN(e){let t=e.getStartEndPoints();if(null===t)return[0,0];let[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[nS(n),nS(r)]}function nT(e,t){for(let n=t;n;n=n.getParent()){if(ri(n)){if(n.collapseAtStart(e))return!0;
2if(ig(n))break}if(n.getPreviousSibling())break}return!1}let nv=(()=>{try{let e=RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function nk(e,t,n){let r=e.getTextContent().split(/(?=\s)/g),i=r.length,l=0,s=0;for(let e=0;e<i;e++){let o=e===i-1;if(s=l,l+=r[e].length,t&&l===n||l>n||o){r.splice(e,1),o&&(s=void 0);break}}let o=r.join("").trim();""===o?e.remove():(e.setTextContent(o),e.select(s,s))}function nb(e,n,r,i){let l,s=n;if(iS(e)){let o=!1,a=e.childNodes,u=a.length,d=i._blockCursorElement;s===u&&(o=!0,s=u-1);let f=a[s],c=!1;if(f===d)f=a[s+1],c=!0;else if(null!==d){let t=d.parentNode;e===t&&n>Array.prototype.indexOf.call(t.children,d)&&s--}if(na(l=rq(f)))s=iX(l,o?"next":"previous");else{let a=rq(e);if(null===a)return null;if(ri(a)){let u,d=i.getElementByKey(a.getKey());null===d&&t(214);let f=a.getDOMSlot(d);[a,s]=f.resolveChildIndex(a,d,e,n),ri(a)||t(215),o&&s>=a.getChildrenSize()&&(s=Math.max(0,a.getChildrenSize()-1));let h=a.getChildAtIndex(s);if(ri(h)&&(u=h.getParent(),null===r||null===u||!u.canBeEmpty()||u!==r.getNode())){let e=o?h.getLastDescendant():h.getFirstDescendant();a=null===e||ri(h=e)?h:h.getParentOrThrow(),s=0}na(h)?(l=h,a=null,s=iX(h,o?"next":"previous")):h!==a&&o&&!c&&(ri(a)||t(216),s=Math.min(a.getChildrenSize(),s+1))}else{let t=a.getIndexWithinParent();s=0===n&&ro(a)&&rq(e)===a?t:t+1,a=a.getParentOrThrow()}if(ri(a))return ng(a.__key,s,"element")}}else l=rq(e);return na(l)?ng(l.__key,iX(l,s,"clamp"),"text"):null}function nE(e,t,n){let r=e.offset,i=e.getNode();if(0===r){let r=i.getPreviousSibling(),l=i.getParent();if(t){if((n||!t)&&null===r&&ri(l)&&l.isInline()){let t=l.getPreviousSibling();na(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else ri(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):na(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){let r=i.getNextSibling(),l=i.getParent();if(t&&ri(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&ri(l)&&l.isInline()&&!l.canInsertTextAfter()){let t=l.getNextSibling();na(t)&&e.set(t.__key,0,"text")}}}function nM(e,t,n){if("text"===e.type&&"text"===t.type){let r=e.isBefore(t),i=e.is(t);nE(e,r,i),nE(t,!r,i),i&&t.set(e.key,e.offset,e.type);let l=nZ();if(l.isComposing()&&l._compositionKey!==e.key&&nm(n)){let r=n.anchor,i=n.focus;e.set(r.key,r.offset,r.type,!0),t.set(i.key,i.offset,i.type,!0)}}}function nO(e,t,n,r,i,l){if(null===e||null===n||!rb(i,e,n))return null;let s=nb(e,t,nm(l)?l.anchor:null,i);if(null===s)return null;let o=nb(n,r,nm(l)?l.focus:null,i);if(null===o)return null;if("element"===s.type&&"element"===o.type){let t=rq(e),r=rq(n);if(ro(t)&&ro(r))return null}return nM(s,o,l),[s,o]}function nA(e,t,n,r,i,l){let s=nQ(),o=new nC(ng(e,t,i),ng(n,r,l),0,"");return o.dirty=!0,s._selection=o,o}function nw(){return new nC(ng("root",0,"element"),ng("root",0,"element"),0,"")}function nD(){return new ny(new Set)}function nP(e,t,n,r){let i,l,s,o,a=n._window;if(null===a)return null;let u=r||a.event,d=u?u.type:void 0,f="selectionchange"===d,c=!M&&(f||"beforeinput"===d||"compositionstart"===d||"compositionend"===d||"click"===d&&u&&3===u.detail||"drop"===d||void 0===d);if(nm(e)&&!c)return e.clone();if(null===t)return null;if(i=t.anchorNode,l=t.focusNode,s=t.anchorOffset,o=t.focusOffset,(f||void 0===d)&&nm(e)&&!rb(n,i,l))return e.clone();let h=nO(i,s,l,o,n,e);if(null===h)return null;let[g,_]=h;return new nC(g,_,nm(e)?e.format:0,nm(e)?e.style:"")}function nL(){return nQ()._selection}function nF(){return nZ()._editorState._selection}function nI(e,t,n,r=1){let i=e.anchor,l=e.focus,s=i.getNode(),o=l.getNode();if(!t.is(s)&&!t.is(o))return;let a=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(a,n,"element"),l.set(a,n,"element"),nR(e)}}else{let s=e.isBackward(),o=s?l:i,u=o.getNode(),d=s?i:l,f=d.getNode();if(t.is(u)){let e=o.offset;(n<=e&&r>0||n<e&&r<0)&&o.set(a,Math.max(0,e+r),"element")}if(t.is(f)){let e=d.offset;(n<=e&&r>0||n<e&&r<0)&&d.set(a,Math.max(0,e+r),"element")}}nR(e)}function nR(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,l=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!ri(l))return;let e=l.getChildrenSize(),i=n>=e,s=i?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(na(s)){let e=0;i&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}return}if(ri(l)){let e=l.getChildrenSize(),r=n>=e,i=r?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(na(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(ri(s)){let e=s.getChildrenSize(),t=i>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(i);if(na(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}function nK(e,t,n,r,i){let l=null,s=0,o=null;null!==r?(l=r.__key,na(r)?(s=r.getTextContentSize(),o="text"):ri(r)&&(s=r.getChildrenSize(),o="element")):null!==i&&(l=i.__key,na(i)?o="text":ri(i)&&(o="element")),null!==l&&null!==o?e.set(l,s,o):(-1===(s=t.getIndexWithinParent())&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function nB(e,t,n,r,i){"text"===e.type?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function nz(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function nW(e){let n=e;e.isCollapsed()||n.removeText();let r=nL();nm(r)&&(n=r),nm(n)||t(161);let i=n.anchor,l=i.getNode(),s=i.offset;for(;!ib(l);){let e=l;if([l,s]=function(e,t){let n=e.getParent();if(!n){let e=rp();return rV().append(e),e.select(),[rV(),0]}if(na(e)){let r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];let i=+(0!==t);return[n,r[0].getIndexWithinParent()+i]}if(!ri(e)||0===t)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new nC(ng(e.__key,t,"element"),ng(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}(l,s),e.is(l))break}return s}function n$(e,t,n,r,i="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}
2let l=lt(e.focus,n?"previous":"next"),s="lineboundary"===r,o="move"===t,a=l,u="decorators-and-blocks"===i;if(!ld(a)){for(let e of a){u=!1;let{origin:t}=e;if(!ro(t)||t.isIsolated()||(a=e,!s||!t.isInline()))break}if(u)for(let e of i6(l).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(ij(e))e.origin.isInline()||(a=e);else{if(ri(e.origin))continue;ro(e.origin)&&!e.origin.isInline()&&(a=e)}break}}if(a===l)return!1;if(o&&!s&&ro(a.origin)&&a.origin.isKeyboardSelectable()){let e=nD();return e.add(a.origin.getKey()),rG(e),!0}return a=lu(a),o&&ln(e.anchor,a),ln(e.focus,a),u||!s}let nJ=null,nU=null,nj=!1,nY=!1,nV=0,nH={characterData:!0,childList:!0,subtree:!0};function nG(){return nj||null!==nJ&&nJ._readOnly}function nq(){nj&&t(13)}function nX(){nV>99&&t(14)}function nQ(){return null===nJ&&t(195,n0()),nJ}function nZ(){return null===nU&&t(196,n0()),nU}function n0(){let e=0,t=new Set,n=rC.version;if("u">typeof window)for(let r of document.querySelectorAll("[contenteditable]")){let i=rO(r);if(rE(i))e++;else if(i){let e=String(i.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function n1(e,t,n){let r=t.__type,i=rN(e,r),l=n.get(r);void 0===l&&(l=Array.from(i.transforms),n.set(r,l));let s=l.length;for(let e=0;e<s&&(l[e](t),t.isAttached());e++);}function n2(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function n6(e,t){if(!t)return;let n=e._updateTags,r=t;for(let e of(Array.isArray(t)||(r=[t]),r))n.add(e)}function n3(e,n){let r=e.type,i=n.get(r);void 0===i&&t(17,r);let l=i.klass;e.type!==l.getType()&&t(18,l.name);let s=l.importJSON(e),o=e.children;if(ri(s)&&Array.isArray(o))for(let e=0;e<o.length;e++){let t=n3(o[e],n);s.append(t)}return s}function n4(e,t,n){let r=nJ,i=nj,l=nU;nJ=t,nj=!0,nU=e;try{return n()}finally{nJ=r,nj=i,nU=l}}function n5(e,n){let r,i,l=e._pendingEditorState,s=e._rootElement,o=e._headless||null===s;if(null===l)return;let a=e._editorState,u=a._selection,d=l._selection,f=0!==e._dirtyType,c=nJ,h=nj,_=nU,p=e._updating,y=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=l,!o&&f&&null!==y){nU=e,nJ=l,nj=!1,e._updating=!0;try{let n,r=e._dirtyType,i=e._dirtyElements,s=e._dirtyLeaves;y.disconnect(),es="",eu="",ed=2===r,X=e,q=e._config,Q=e._nodes,Z=X._listeners.mutation,ee=i,et=s,en=a._nodeMap,er=l._nodeMap,ef=l._readOnly,ei=new Map(e._keyToDOMMap),el=n=new Map,function e(n,r){let i=en.get(n),l=er.get(n);void 0!==i&&void 0!==l||t(61);let s=ed||et.has(n)||ee.has(n),o=io(X,n);if(i===l&&!s){if(ri(i)){let e=o.__lexicalTextContent;void 0!==e&&(es+=e,eu+=e)}else{let e=i.getTextContent();eu+=e,es+=e}return o}if(i!==l&&s&&ie(el,Q,Z,l,"updated"),l.updateDOM(i,o,q)){let e=em(n,null);return null===r&&t(62),r.replaceChild(e,o),ec(n,null),e}if(ri(i)&&ri(l)){let n=l.__indent;(ed||n!==i.__indent)&&e_(o,n);let r=l.__format;if((ed||r!==i.__format)&&ep(o,r),s&&(function(n,r,i){eo=null,ea=null,function(n,r,i){let l=es,s=n.__size,o=r.__size;es="";let a=i.element;if(1===s&&1===o){let t=n.__first,i=r.__first;if(t===i)e(t,a);else{let e=ek(t),n=em(i,null);try{a.replaceChild(n,e)}catch(r){if("object"==typeof r&&null!=r)throw Error(`${r.toString()} Parent: ${a.tagName}, new child: {tag: ${n.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${t}}.`);throw r}ec(t,null)}let l=er.get(i);na(l)&&null===eo&&(eo=l.getFormat(),ea=l.getStyle())}else{let l=eN(n,en),u=eN(r,er);if(l.length!==s&&t(227),u.length!==o&&t(228),0===s)0!==o&&eC(u,r,0,o-1,i);else if(0===o){if(0!==s){let e=null==i.after&&null==i.before&&null==i.element.__lexicalLineBreak;eh(l,0,s-1,e?null:a),e&&(a.textContent="")}}else!function(t,n,r,i,l,s){let o=i-1,a=l-1,u,d,f=s.getFirstChild(),c=0,h=0;for(;c<=o&&h<=a;){let t=n[c],i=r[h];if(t===i)f=ev(e(i,s.element)),c++,h++;else{void 0===u&&(u=new Set(n)),void 0===d&&(d=new Set(r));let l=d.has(t),o=u.has(i);if(l)if(o){let t=io(X,i);t===f?f=ev(e(i,s.element)):(s.withBefore(f).insertChild(t),e(i,s.element)),c++,h++}else em(i,s.withBefore(f)),h++;else f=ev(ek(t)),ec(t,s.element),c++}let l=er.get(i);null!==l&&na(l)&&null===eo&&(eo=l.getFormat(),ea=l.getStyle())}let g=c>o,_=h>a;if(g&&!_){let e=r[a+1],n=void 0===e?null:X.getElementByKey(e);eC(r,t,h,a,s.withBefore(n))}else _&&!g&&eh(n,c,o,s.element)}(r,l,u,s,o,i)}is(r)&&(es+="\n\n"),a.__lexicalTextContent=es,es=l+es}(n,r,r.getDOMSlot(i)),null==eo||eo===r.__textFormat||ef||r.setTextFormat(eo),null==ea||ea===r.__textStyle||ef||r.setTextStyle(ea)}(i,l,o),ru(l)||l.isInline()||eS(i,l,o)),is(l)&&(es+="\n\n",eu+="\n\n"),(ed||l.__dir!==i.__dir)&&(ey(o,l),ru(l)&&!ed))for(let e of l.getChildren())ri(e)&&ey(io(X,e.getKey()),e)}else{let e=l.getTextContent();if(ro(l)){let e=l.decorate(X,q);null!==e&&eT(n,e)}es+=e,eu+=e}if(!ef&&ru(l)&&l.__cachedText!==eu){let e=l.getWritable();e.__cachedText=eu,l=e}return o}("root",null),X=void 0,Q=void 0,ee=void 0,et=void 0,en=void 0,er=void 0,q=void 0,ei=void 0,el=void 0,m=n}catch(t){if(t instanceof Error&&e._onError(t),nY)throw t;return rm(e,null,s,l),L(e),e._dirtyType=2,nY=!0,n5(e,a),void(nY=!1)}finally{y.observe(s,nH),e._updating=p,nJ=c,nj=h,nU=_}}l._readOnly||(l._readOnly=!0);let C=e._dirtyLeaves,x=e._dirtyElements,S=e._normalizedNodes,N=e._updateTags,T=e._deferred;f&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n,r=e._decorators,i=e._pendingDecorators||r,l=t._nodeMap;for(n in i)l.has(n)||(i===r&&(i=rj(e)),delete i[n])}(e,l);let v=o?null:ix(ih(e));if(e._editable&&null!==v&&(f||null===d||d.dirty||!d.is(u))&&null!==s&&!N.has("skip-dom-selection")){nU=e,nJ=l;try{if(null!==y&&y.disconnect(),f||null===d||d.dirty){let t=e._blockCursorElement;null!==t&&iC(t,e,s),function(e,t,n,r,i,l){let s=r.anchorNode,o=r.focusNode,a=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(tX)&&d!==l||null!==d&&rk(d))return;if(!nm(t))return null!==e&&rb(n,s,o)&&r.removeAllRanges();let f=t.anchor,c=t.focus,h=f.key,g=c.key,_=io(n,h),p=io(n,g),y=f.offset,m=c.offset,C=t.format,x=t.style,S=t.isCollapsed(),N=_,T=p,v=!1;if("text"===f.type){N=rL(_);let e=f.getNode();v=e.getFormat()!==C||e.getStyle()!==x}else nm(e)&&"text"===e.anchor.type&&(v=!0);if("text"===c.type&&(T=rL(p)),null!==N&&null!==T&&(S&&(null===e||v||nm(e)&&(e.format!==C||e.style!==x))&&(tE=[C,x,y,h,performance.now()]),a!==y||u!==m||s!==N||o!==T||"Range"===r.type&&S||(null!==d&&l.contains(d)||i.has("skip-selection-focus")||l.focus({preventScroll:!0}),"element"===f.type))){if(nz(r,N,y,T,m),!i.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==l&&l===document.activeElement){let e=nm(t)&&"element"===t.anchor.type?N.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){let r=iu(n),i=ic(r);if(null===r||null===i)return;let{top:l,bottom:s}=t,o=0,a=0,u=n;for(;null!==u;){let t=u===r.body;if(t)o=0,a=ih(e).innerHeight;else{let e=u.getBoundingClientRect();o=e.top,a=e.bottom}let n=0;if(l<o?n=-(o-l):s>
2a&&(n=s-a),0!==n)if(t)i.scrollBy(0,n);else{let e=u.scrollTop;u.scrollTop+=n;let t=u.scrollTop-e;l-=t,s-=t}if(t)break;u=ia(u)}}(n,t,l)}}tx=!0}}(u,d,e,v,N,s)}!function(e,t,n){let r=e._blockCursorElement;if(nm(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){let i=n.anchor,l=i.getNode(),s=i.offset,o=!1,a=null;if(s===l.getChildrenSize())im(l.getChildAtIndex(s-1))&&(o=!0);else{let t=l.getChildAtIndex(s);if(null!==t&&im(t)){let n=t.getPreviousSibling();(null===n||im(n))&&(o=!0,a=e.getElementByKey(t.__key))}}if(o){let n,i,s,o=e.getElementByKey(l.__key);return null===r&&(n=e._config.theme,(i=document.createElement("div")).contentEditable="false",i.setAttribute("data-lexical-cursor","true"),s=n.blockCursor,void 0!==s&&("string"==typeof s&&(s=n.blockCursor=g(s)),void 0!==s&&i.classList.add(...s)),e._blockCursorElement=r=i),t.style.caretColor="transparent",null===a?o.appendChild(r):o.insertBefore(r,a)}}null!==r&&iC(r,e,t)}(e,s,d)}finally{null!==y&&y.observe(s,nH),nU=_,nJ=c}}null!==m&&function(e,t,n,r,i){let l=Array.from(e._listeners.mutation),s=l.length;for(let e=0;e<s;e++){let[s,o]=l[e];for(let e of o){let l=t.get(e);void 0!==l&&s(l,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,N,C,a),nm(d)||null===d||null!==u&&u.is(d)||e.dispatchCommand(eE,void 0);let k=e._pendingDecorators;null!==k&&(e._decorators=k,e._pendingDecorators=null,n7("decorator",e,!0,k)),r=rY(n||a),r!==(i=rY(l))&&n7("textcontent",e,!0,i),n7("update",e,!0,{dirtyElements:x,dirtyLeaves:C,editorState:l,mutatedNodes:m,normalizedNodes:S,prevEditorState:n||a,tags:N}),function(e,t){if(e._deferred=[],0!==t.length){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,T),function(e){let t=e._updates;if(0!==t.length){let n=t.shift();if(n){let[t,r]=n;n8(e,t,r)}}}(e)}function n7(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function n9(e,n){let r=e._updates,i=n||!1;for(;0!==r.length;){let n=r.shift();if(n){let r,[l,s]=n,o=e._pendingEditorState;void 0!==s&&(r=s.onUpdate,s.skipTransforms&&(i=!0),s.discrete&&(null===o&&t(191),o._flushSync=!0),r&&e._deferred.push(r),n6(e,s.tag)),null==o?n8(e,l,s):l()}}return i}function n8(e,n,r){let i=e._updateTags,l,s=!1,o=!1;void 0!==r&&(l=r.onUpdate,n6(e,r.tag),s=r.skipTransforms||!1,o=r.discrete||!1),l&&e._deferred.push(l);let a=e._editorState,u=e._pendingEditorState,d=!1;(null===u||u._readOnly)&&(u=e._pendingEditorState=rd(u||a),d=!0),u._flushSync=o;let f=nJ,c=nj,h=nU,g=e._updating;nJ=u,nj=!1,e._updating=!0,nU=e;let _=e._headless||null===e.getRootElement();rx=null;try{var p;let i,l;d&&(_?null!==a._selection&&(u._selection=a._selection.clone()):u._selection=(p=r&&r.event||null,i=e.getEditorState()._selection,l=ix(ih(e)),nm(i)||null==i?nP(i,l,e,p):i.clone()));let o=e._compositionKey;n(),s=n9(e,s),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(nm(r)){let e,t=r.anchor,i=r.focus;if("text"===t.type&&(e=t.getNode()).selectionTransform(n,r),"text"===i.type){let t=i.getNode();e!==t&&t.selectionTransform(n,r)}}}(u,e),0!==e._dirtyType&&(s?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);na(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&V(t)}}(u,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,l=rz(),s=new Map,o=n,a=o.size,u=r,d=u.size;for(;a>0||d>0;){if(a>0){for(let e of(t._dirtyLeaves=new Set,o)){let r=i.get(e);na(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&V(r),void 0!==r&&n2(r,l)&&n1(t,r,s),n.add(e)}if((a=(o=t._dirtyLeaves).size)>0){nV++;continue}}for(let e of(t._dirtyLeaves=new Set,t._dirtyElements=new Map,u.delete("root")&&u.set("root",!0),u)){let n=e[0],o=e[1];if(r.set(n,o),!o)continue;let a=i.get(n);void 0!==a&&n2(a,l)&&n1(t,a,s)}a=(o=t._dirtyLeaves).size,d=(u=t._dirtyElements).size,nV++}t._dirtyLeaves=n,t._dirtyElements=r}(u,e),n9(e),function(e,t,n,r){let i=e._nodeMap,l=t._nodeMap,s=[];for(let[e]of r){let t=l.get(e);void 0!==t&&(t.isAttached()||(ri(t)&&function e(t,n,r,i,l,s){let o=t.getFirstChild();for(;null!==o;){let t=o.__key;o.__parent===n&&(ri(o)&&e(o,t,r,i,l,s),r.has(t)||s.delete(t),l.push(t)),o=o.getNextSibling()}}(t,e,i,l,s,r),i.has(e)||r.delete(e),s.push(e)))}for(let e of s)l.delete(e);for(let e of n){let t=l.get(e);void 0===t||t.isAttached()||(i.has(e)||n.delete(e),l.delete(e))}}(a,u,e._dirtyLeaves,e._dirtyElements)),o!==e._compositionKey&&(u._flushSync=!0);let f=u._selection;if(nm(f)){let e=u._nodeMap,n=f.anchor.key,r=f.focus.key;void 0!==e.get(n)&&void 0!==e.get(r)||t(19)}else nx(f)&&0===f._nodes.size&&(u._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void n5(e)}finally{nJ=f,nj=c,nU=h,e._updating=g,nV=0}0!==e._dirtyType||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(u,e)?u._flushSync?(u._flushSync=!1,n5(e)):d&&rv(()=>{n5(e)}):(u._flushSync=!1,d&&(i.clear(),e._deferred=[],e._pendingEditorState=null))}function re(e,t,n){nU===e&&void 0===n?t():n8(e,t,n)}class rt{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new rt(this.element,e,this.after)}withAfter(e){return new rt(this.element,this.before,e)}withElement(e){return this.element===e?this:new rt(e,this.before,this.after)}insertChild(e){let n=this.before||this.getManagedLineBreak();return null!==n&&n.parentElement!==this.element&&t(222),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&t(223),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&t(224),this.element.replaceChild(e,n),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){null===e?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===e&&(h||u||a))}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement("br");if(n.insertBefore(i,r),e){let e=document.createElement("img");e.setAttribute("data-lexical-linebreak","true"),e.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",e.alt="",n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;null!==t;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=rn(t,n);i.push(r);let l=rn(t,this.element),s=e.getIndexWithinParent();for(let e=0;e<l.length;e++){let t=i[e],n=l[e];
2if(void 0===t||t<n)break;if(t>n){s+=1;break}}return[e.getParentOrThrow(),s]}}function rn(e,n){let r=[],i=n;for(;i!==e&&null!==i;i=i.parentNode){let e=0;for(let t=i.previousSibling;null!==t;t=t.previousSibling)e++;r.push(e)}return i!==e&&t(225),r.reverse()}class rr extends tG{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return v[this.getFormat()]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){let e=nZ()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;null!==t;){if(na(t)&&e.push(t),ri(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;ri(e);){let t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;ri(e);){let t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return ri(e)&&e.getLastDescendant()||e||null}let r=t[e];return ri(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:rW(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&t(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:rW(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&t(96,this.__key),e}getChildAtIndex(e){let t,n,r=this.getChildrenSize();if(e<r/2){for(t=this.getFirstChild(),n=0;null!==t&&n<=e;){if(n===e)return t;t=t.getNextSibling(),n++}return null}for(t=this.getLastChild(),n=r-1;null!==t&&n>=e;){if(n===e)return t;t=t.getPreviousSibling(),n--}return null}getTextContent(){let e="",t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),ri(i)&&r!==n-1&&!i.isInline()&&(e+="\n\n")}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),ri(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){let t=T[e];return 0!=(this.getFormat()&t)}return!1}hasTextFormat(e){let t=S[e];return 0!=(this.getTextFormat()&t)}getFormatFlags(e,t){return rF(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){nq();let n=nL(),r=e,i=t,l=this.getChildrenSize();if(!this.canBeEmpty()){if(0===e&&0===t){let e=this.getFirstChild();if(na(e)||ri(e))return e.select(0,0)}else if((void 0===e||e===l)&&(void 0===t||t===l)){let e=this.getLastChild();if(na(e)||ri(e))return e.select()}}void 0===r&&(r=l),void 0===i&&(i=l);let s=this.__key;return nm(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):nA(s,r,s,i,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();
2return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?T[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){tH(this)&&t(324,this.__key,this.__type);let i=this.getChildrenSize(),l=this.getWritable();e+n<=i||t(226,String(e),String(n),String(i));let s=l.__key,o=[],a=[],u=this.getChildAtIndex(e+n),d=null,f=i-n+r.length;if(0!==e)if(e===i)d=this.getLastChild();else{let t=this.getChildAtIndex(e);null!==t&&(d=t.getPreviousSibling())}if(n>0){let e=null===d?this.getFirstChild():d.getNextSibling();for(let r=0;r<n;r++){null===e&&t(100);let n=e.getNextSibling(),r=e.__key;rR(e.getWritable()),a.push(r),e=n}}let c=d;for(let e of r){null!==c&&e.is(c)&&(d=c=c.getPreviousSibling());let n=e.getWritable();n.__parent===s&&f--,rR(n);let r=e.__key;if(null===c)l.__first=r,n.__prev=null;else{let e=c.getWritable();e.__next=r,n.__prev=e.__key}e.__key===s&&t(76),n.__parent=s,o.push(r),c=e}if(e+n===i)null!==c&&(c.getWritable().__next=null,l.__last=c.__key);else if(null!==u){let e=u.getWritable();if(null!==c){let t=c.getWritable();e.__prev=c.__key,t.__next=u.__key}else e.__prev=null}if(l.__size=f,a.length){let e=nL();if(nm(e)){let t=new Set(a),n=new Set(o),{anchor:r,focus:i}=e;rl(r,t,n)&&nK(r,r.getNode(),this,d,u),rl(i,t,n)&&nK(i,i.getNode(),this,d,u),0!==f||this.canBeEmpty()||ig(this)||this.remove()}}return l}getDOMSlot(e){return new rt(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(iS(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px");let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0===t&&""===n||ig(this)||this.getChildren().some(na)||(0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());null!==i&&(null==r?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}}function ri(e){return e instanceof rr}function rl(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class rs extends tG{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ro(e){return e instanceof rs}class ra extends rr{__cachedText;static getType(){return"root"}static clone(){return new ra}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){t(51)}getTextContent(){let e=this.__cachedText;return(nG()||0===nZ()._dirtyType)&&null!==e?e:super.getTextContent()}remove(){t(52)}replace(e){t(53)}insertBefore(e){t(54)}insertAfter(e){t(55)}updateDOM(e,t){return!1}splice(e,n,r){for(let e of r)ri(e)||ro(e)||t(282);return super.splice(e,n,r)}static importJSON(e){return rV().updateFromJSON(e)}collapseAtStart(){return!0}}function ru(e){return e instanceof ra}function rd(e){return new rc(new Map(e._nodeMap))}function rf(){return new rc(new Map([["root",new ra]]))}class rc{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return n4(t&&t.editor||null,this,e)}clone(e){let t=new rc(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return n4(null,this,()=>({root:function e(n){let r=n.exportJSON(),i=n.constructor;if(r.type!==i.getType()&&t(130,i.name),ri(n)){let l=r.children;Array.isArray(l)||t(59,i.name);let s=n.getChildren();for(let t=0;t<s.length;t++){let n=e(s[t]);l.push(n)}}return r}(rV())}))}}class rh extends rr{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class rg extends rr{static getType(){return"paragraph"}static clone(e){return new rg(e.__key)}createDOM(e){let t=document.createElement("p"),n=r8(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:r_,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(iS(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return rp().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){let t=this.getChildren().find(na);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=rp();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(0===e.length||na(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function r_(e){let t=rp();return e.style&&(t.setFormat(e.style.textAlign),iD(e,t)),{node:t}}function rp(){return ip(new rg)}function ry(e){return e instanceof rg}function rm(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=rf(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let l=e._observer;null!==l&&(l.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}class rC{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,l,s,o){this._createEditorArgs=o,this._parentEditor=t,this._rootElement=null,this._editorState=e,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=rZ(),this._onError=i,this._htmlConversions=l,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}
2registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,n,r){void 0===r&&t(35);let i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);let l=i.get(e);void 0===l&&t(36,String(e));let s=l[r];return s.add(n),()=>{s.delete(n),l.every(e=>0===e.size)&&i.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,l=i.get(t);void 0===l&&(l=new Set,i.set(t,l)),l.add(r);let s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(t,r),()=>{l.delete(r),0===l.size&&i.delete(t)}}getRegisteredNode(e){let n=this._nodes.get(e.getType());return void 0===n&&t(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=iA(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=iA(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}0!==r.length&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=rW(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:tq}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return il(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let r=r8(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,rm(this,n,e,i),null!==n&&(this._config.disableEvents||function(e){let n=tm.get(e);if(void 0===n)return tj();let r=tC.get(n);if(void 0===r)return tj();let i=r-1;i>=0||t(164),tm.delete(e),tC.set(n,i),0===i&&n.removeEventListener("selectionchange",t$);let l=rO(e);rE(l)?(!function(e){if(null!==e._parentEditor){let t=rQ(e),n=t[t.length-1]._key;tW.get(n)===e&&tW.delete(n)}else tW.delete(e._key)}(l),e.__lexicalEditor=null):l&&t(198);let s=tz(e);for(let e=0;e<s.length;e++)s[e]();e.__lexicalEventHandles=[]}(n),null!=r&&n.classList.remove(...r)),null!==e){let t=ic(e),n=e.style;n.userSelect="text",n.whiteSpace="pre-wrap",n.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,L(this),this._updateTags.add(tq),n5(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;tm.set(e,n);let r=tC.get(n)??0;r<1&&n.addEventListener("selectionchange",t$),tC.set(n,r+1),e.__lexicalEditor=t;let i=tz(e);for(let n=0;n<th.length;n++){let[r,l]=th[n],s="function"==typeof l?e=>{tU(e)||(tJ(e),(t.isEditable()||"click"===r)&&l(e,t))}:e=>{if(tU(e))return;tJ(e);let n=t.isEditable();switch(r){case"cut":return n&&il(t,tr,e);case"copy":return il(t,tn,e);case"paste":return n&&il(t,eK,e);case"dragstart":return n&&il(t,e8,e);case"dragover":return n&&il(t,te,e);case"dragend":return n&&il(t,tt,e);case"focus":return n&&il(t,tu,e);case"blur":return n&&il(t,td,e);case"drop":return n&&il(t,e7,e)}};e.addEventListener(r,s),i.push(()=>{e.removeEventListener(r,s)})}}(e,this),null!=r&&e.classList.add(...r)}else this._window=null,this._updateTags.add(tq),n5(this);n7("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&t(38);let r=e;r._readOnly&&((r=rd(e))._selection=e._selection?e._selection.clone():null),P(this);
2let i=this._pendingEditorState,l=this._updateTags,s=void 0!==n?n.tag:null;null===i||i.isEmpty()||(null!=s&&l.add(s),n5(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&l.add(s),this._updating||n5(this)}parseEditorState(e,t){return function(e,t,n){let r=rf(),i=nJ,l=nj,s=nU,o=t._dirtyElements,a=t._dirtyLeaves,u=t._cloneNotNeeded,d=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,nJ=r,nj=!1,nU=t,rx=null;try{let i=t._nodes;n3(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=o,t._dirtyLeaves=a,t._cloneNotNeeded=u,t._dirtyType=d,nJ=i,nj=l,nU=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return n5(this),this.getEditorState().read(e,{editor:this})}update(e,t){this._updating?this._updates.push([e,t]):n8(this,e,t)}focus(e,t={}){let n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),re(this,()=>{var r,i;let l=nL(),s=rV();null!==l?l.dirty||rG(l.clone()):0!==s.getChildrenSize()&&("rootStart"===t.defaultSelection?s.selectStart():s.selectEnd()),r="focus",nq(),nZ()._updateTags.add(r),i=()=>{n.removeAttribute("autocapitalize"),e&&e()},nq(),nZ()._deferred.push(i)}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;null!==e&&e.blur();let t=ix(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,n7("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}rC.version="0.39.0+prod.esm";let rx=null,rS=1;function rN(e,n){let r=rT(e,n);return void 0===r&&t(30,n),r}function rT(e,t){return e._nodes.get(t)}let rv="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function rk(e){let t=document.activeElement;if(!iS(t))return!1;let n=t.nodeName;return ro(rU(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==rO(t))}function rb(e,t,n){let r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!rk(t)&&rM(t)===e}catch(e){return!1}}function rE(e){return e instanceof rC}function rM(e){let t=e;for(;null!=t;){let e=rO(t);if(rE(e))return e;t=ia(t)}return null}function rO(e){return e?e.__lexicalEditor:null}function rA(e){return nc(e)||e.isToken()}function rw(e){return rA(e)||e.isSegmented()}function rD(e){return iN(e)&&3===e.nodeType}function rP(e){return iN(e)&&9===e.nodeType}function rL(e){let t=e;for(;null!=t;){if(rD(t))return t;t=t.firstChild}return null}function rF(e,t,n){let r=S[t];if(null!==n&&(e&r)==(n&r))return e;let i=e^r;return"subscript"===t?i&=~S.superscript:"superscript"===t?i&=~S.subscript:"lowercase"===t?(i&=~S.uppercase,i&=~S.capitalize):"uppercase"===t?(i&=~S.lowercase,i&=~S.capitalize):"capitalize"===t&&(i&=~S.lowercase,i&=~S.uppercase),i}function rI(e,t){let n,r=(n=rx,rx=null,n);if(null!=(t=t||r&&r.__key))return void(e.__key=t);nq(),nX();let i=nZ(),l=nQ(),s=""+rS++;l._nodeMap.set(s,e),ri(e)?i._dirtyElements.set(s,!0):i._dirtyLeaves.add(s),i._cloneNotNeeded.add(s),i._dirtyType=1,e.__key=s}function rR(e){let t=e.getParent();if(null!==t){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),l=e.getNextSibling(),s=null!==l?l.__key:null,o=null!==i?i.__key:null,a=null!==i?i.getWritable():null,u=null!==l?l.getWritable():null;null===i&&(r.__first=s),null===l&&(r.__last=o),null!==a&&(a.__next=s),null!==u&&(u.__prev=o),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function rK(e){nX(),tH(e)&&t(323,e.__key,e.__type);let n=e.getLatest(),r=n.__parent,i=nQ(),l=nZ(),s=i._nodeMap,o=l._dirtyElements;null!==r&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;let e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(r,s,o);let a=n.__key;l._dirtyType=1,ri(e)?o.set(a,!0):l._dirtyLeaves.add(a)}function rB(e){nq();let t=nZ(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){let e=rW(n);null!==e&&e.getWritable()}if(null!==e){let t=rW(e);null!==t&&t.getWritable()}}}function rz(){return nG()?null:nZ()._compositionKey}function rW(e,t){let n=(t||nQ())._nodeMap.get(e);return void 0===n?null:n}function r$(e,t){let n=rJ(e,nZ());return void 0!==n?rW(n,t):null}function rJ(e,t){return e[`__lexicalKey_${t._key}`]}function rU(e,t){let n=e;for(;null!=n;){let e=r$(n,t);if(null!==e)return e;n=ia(n)}return null}function rj(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t,t}function rY(e){return e.read(()=>rV().getTextContent())}function rV(){return rH(nQ())}function rH(e){return e._nodeMap.get("root")}function rG(e){nq();let t=nQ();
2null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function rq(e){let t=nZ(),n=function(e,t){let n=e;for(;null!=n;){let e=rJ(n,t);if(void 0!==e)return e;n=ia(n)}return null}(e,t);return null===n?e===t.getRootElement()?rW("root"):null:rW(n)}function rX(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function rQ(e){let t=[],n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function rZ(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function r0(e){return rD(e)?e.nodeValue:null}function r1(e,t,n){let r=ix(ih(t));if(null===r)return;let i=r.anchorNode,{anchorOffset:l,focusOffset:s}=r;if(null!==i){let t=r0(i),r=rU(i);if(null!==t&&na(r)){if(t===_&&n){let e=n.length;t=n,l=e,s=e}null!==t&&r2(r,t,l,s,e)}}}function r2(e,t,n,r,i){let l=e;if(l.isAttached()&&(i||!l.isDirty())){let s=l.isComposing(),o=t;(s||i)&&t[t.length-1]===_&&(o=t.slice(0,-1));let d=l.getTextContent();if(i||o!==d){if(""===o){if(rB(null),a||u||h)l.remove();else{let e=nZ();setTimeout(()=>{e.update(()=>{l.isAttached()&&l.remove()})},20)}return}let t=l.getParent(),i=nF(),d=l.getTextContentSize(),f=rz(),c=l.getKey();if(l.isToken()||null!==f&&c===f&&!s||nm(i)&&(null!==t&&!t.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===e.__key&&0===i.anchor.offset&&!l.canInsertTextBefore()&&!s||i.focus.key===e.__key&&i.focus.offset===d&&!l.canInsertTextAfter()&&!s))return void l.markDirty();let g=nL();if(!nm(g)||null===n||null===r)return void r6(l,o,g);if(g.setTextNodeRange(l,n,l,r),l.isSegmented()){let e=no(l.getTextContent());l.replace(e),l=e}r6(l,o,g)}}}function r6(e,t,n){if(e.setTextContent(t),nm(n)){let t=e.getKey();for(let r of["anchor","focus"]){let i=n[r];"text"===i.type&&i.key===t&&(i.offset=iX(e,i.offset,"clamp"))}}}function r3(e,t,n){let r=t[n]||!1;return"any"===r||r===e[n]}function r4(e,t,n){return r3(e,n,"altKey")&&r3(e,n,"ctrlKey")&&r3(e,n,"shiftKey")&&r3(e,n,"metaKey")&&e.key.toLowerCase()===t.toLowerCase()}let r5={ctrlKey:!l,metaKey:l},r7={altKey:l,ctrlKey:!l};function r9(e){return"Backspace"===e.key}function r8(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;let i=e[t];if("string"==typeof i){let e=g(i);return n[t]=e,e}return i}function ie(e,n,r,i,l){if(0===r.size)return;let s=i.__type,o=i.__key,a=n.get(s);void 0===a&&t(33,s);let u=a.klass,d=e.get(u);void 0===d&&(d=new Map,e.set(u,d));let f=d.get(o),c="destroyed"===f&&"created"===l;(void 0===f||c)&&d.set(o,c?"updated":l)}function it(e,t,n){let r=e.getParent(),i=n,l=e;return null!==r&&(t&&0===n?(i=l.getIndexWithinParent(),l=r):t||n!==l.getChildrenSize()||(i=l.getIndexWithinParent()+1,l=r)),l.getChildAtIndex(t?i-1:i)}function ir(e,t){let n=e.offset;if("element"===e.type)return it(e.getNode(),t,n);{let r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return null===e?it(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function ii(e){let t=ih(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function il(e,t,n){return function(e,t,n){let r=rQ(e);for(let i=4;i>=0;i--)for(let l=0;l<r.length;l++){let s=r[l],o=s._commands.get(t);if(void 0!==o){let t=o[i];if(void 0!==t){let r=Array.from(t),i=r.length,l=!1;if(re(s,()=>{for(let t=0;t<i;t++)if(r[t](n,e))return void(l=!0)}),l)return l}}}return!1}(e,t,n)}function is(e){return!ru(e)&&!e.isLastChild()&&!e.isInline()}function io(e,n){let r=e._keyToDOMMap.get(n);return void 0===r&&t(75,n),r}function ia(e){let t=e.assignedSlot||e.parentElement;return iT(t)?t.host:t}function iu(e){return rP(e)?e:iS(e)?e.ownerDocument:null}function id(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function ic(e){let t=iu(e);return t?t.defaultView:null}function ih(e){let n=e._window;return null===n&&t(78),n}function ig(e){return ru(e)||ri(e)&&e.isShadowRoot()}function i_(e){let t=e.constructor.clone(e);return rI(t,null),t.afterCloneFrom(e),t}function ip(e){let n=nZ(),r=e.getType(),i=rT(n,r);void 0===i&&t(200,e.constructor.name,r);let{replace:l,replaceWithKlass:s}=i;
2if(null!==l){let n=l(e),i=n.constructor;return null!==s?n instanceof s||t(201,s.name,s.getType(),i.name,i.getType(),e.constructor.name,r):n instanceof e.constructor&&i!==e.constructor||t(202,i.name,i.getType(),e.constructor.name,r),n.__key===e.__key&&t(203,e.constructor.name,r,i.name,i.getType()),n}return e}function iy(e,n){!ru(e.getParent())||ri(n)||ro(n)||t(99)}function im(e){return(ro(e)||ri(e)&&!e.canBeEmpty())&&!e.isInline()}function iC(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let r=e.parentElement;null!==r&&r.removeChild(e)}function ix(e){return r?(e||window).getSelection():null}function iS(e){return iN(e)&&1===e.nodeType}function iN(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function iT(e){return iN(e)&&11===e.nodeType}function iv(e){let t=RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function ik(e){let t=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!==e.nodeName.match(t)}function ib(e){if(ro(e)&&!e.isInline())return!0;if(!ri(e)||ig(e))return!1;let t=e.getFirstChild(),n=null===t||t1(t)||na(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function iE(){return nZ()}let iM=new WeakMap,iO=new Map;function iA(e){if(!e._readOnly&&e.isEmpty())return iO;e._readOnly||t(192);let n=iM.get(e);return n||(n=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),iM.set(e,n)),n}function iw(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function iD(e,t){let n=Math.round((parseInt(e.style.paddingInlineStart,10)||0)/40);t.setIndent(n)}function iP(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==tG[t]}function iL(e){let n=E in e.prototype?e.prototype[E]():void 0,r=function(e){if(!(e===tG||e.prototype instanceof tG)){let n="<unknown>",r="<unknown>";try{n=e.getType()}catch(e){}try{rC.version&&(r=JSON.parse(rC.version))}catch(e){}t(290,e.name,n,r)}return e===rs||e===rr||e===tG}(e),i=!r&&iP(e,"getType")?e.getType():void 0,l,s=i;if(n)if(i)l=n[i];else for(let[e,t]of Object.entries(n))s=e,l=t;if(!r&&s&&(iP(e,"getType")||(e.getType=()=>s),iP(e,"clone")||(e.clone=t=>(rx=t,new e)),iP(e,"importJSON")||(e.importJSON=l&&l.$importJSON||(t=>(new e).updateFromJSON(t))),!iP(e,"importDOM")&&l)){let{importDOM:t}=l;t&&(e.importDOM=()=>t)}return{ownNodeConfig:l,ownNodeType:s}}let iF=(e,t)=>{let n=e;for(;null!=n&&!ru(n);){if(t(n))return n;n=n.getParent()}return null},iI={next:"previous",previous:"next"};class iR{origin;constructor(e){this.origin=e}[Symbol.iterator](){return i5({hasNext:iU,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return iG(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return iG(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,n,r="next"){let i=r===this.direction?n:Array.from(n).reverse(),l=this,s=this.getParentAtCaret(),o=new Map;for(let t=l.getAdjacentCaret();null!==t&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of i){if(o.size>0){let n=l.getNodeAtCaret();if(n)if(o.delete(n.getKey()),o.delete(e.getKey()),n.is(e)||l.origin.is(e));else{let t=e.getParent();t&&t.is(s)&&e.remove(),n.replace(e)}else null===n&&t(263,Array.from(o).join(" "))}else l.insert(e);l=iG(e,this.direction)}for(let e of o.values())e.remove();return this}}class iK extends iR{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:iQ(e,this.direction)}getParentCaret(e="root"){return iG(iz(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=iI[this.direction];return iG(this.getNodeAtCaret(),e)||iQ(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof iK&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}let iB={root:ru,shadowRoot:ig};
2function iz(e,t="root"){return iB[t](e)?null:e}class iW extends iR{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:iG(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return ri(this.origin)?iQ(this.origin,this.direction):null}getParentCaret(e="root"){return iG(iz(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=iI[this.direction];return iG(this.getNodeAtCaret(),e)||iQ(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof iW&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof iW||e instanceof i$)&&this.direction===e.direction&&this.origin.is(e.origin)}}class i$ extends iR{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:iq(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return iG(iz(this.getParentAtCaret(),e),this.direction)}getFlipped(){return iq(this.origin,iI[this.direction],this.offset)}isSamePointCaret(e){return e instanceof i$&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof iW||e instanceof i$)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return iG(this.origin,this.direction)}}function iJ(e){return e instanceof i$}function iU(e){return e instanceof iW}function ij(e){return e instanceof iK}let iY={next:class extends i${direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends i${direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},iV={next:class extends iW{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends iW{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},iH={next:class extends iK{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends iK{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function iG(e,t){return e?new iV[t](e):null}function iq(e,t,n){return e?new iY[t](e,iX(e,n)):null}function iX(e,t,r="error"){let i=e.getTextContentSize(),l="next"===t?i:"previous"===t?0:t;return(l<0||l>i)&&("clamp"!==r&&n(284,String(t),String(i),e.getKey()),l=l<0?0:i),l}function iQ(e,t){return ri(e)?new iH[t](e):null}function iZ(e){return e&&e.getChildCaret()||e}function i0(e){return e&&iZ(e.getAdjacentCaret())}class i1{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new i1(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return iJ(t)?function(e,t){let{direction:n,origin:r}=e;return new i2(e,iX(r,"focus"===t?iI[n]:n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[new i2(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){let t=iJ(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=iJ(n),i=t=>t.isSameNodeCaret(n)?null:i0(t)||t.getParentCaret(e);return i5({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class i2{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return iq(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function i6(e){return i4(e,iG(rV(),e.direction))}function i3(e){return i4(e,e)}function i4(e,n){return e.direction!==n.direction&&t(265),new i1(e,n,e.direction)}function i5(e){let{initial:t,hasNext:n,step:r,map:i}=e,l=t;return{[Symbol.iterator](){return this},next(){if(!n(l))return{done:!0,value:void 0};let e={done:!1,value:i(l)};return l=r(l),e}}}function i7(e,n){let r=le(e.origin,n.origin);switch(null===r&&t(275,e.origin.getKey(),n.origin.getKey()),r.type){case"same":{let t="text"===e.type,r="text"===n.type;return t&&r?Math.sign(e.offset-n.offset):e.type===n.type?0:t?-1:r?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;
2case"descendant":return"child"===n.type?1:-1;case"branch":return i9(r)}}function i9(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,l=t,s=n;for(;l&&s;l=l.getNextSibling(),s=s.getNextSibling()){if(l.__key===i)return -1;if(s.__key===r)return 1}return null===l?1:-1}function i8(e){return ri(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function le(e,n){if(e.is(n))return{commonAncestor:e,type:"same"};let r=new Map;for(let[t,n]=i8(e);t;n=t,t=t.getParent())r.set(t,n);for(let[i,l]=i8(n);i;l=i,i=i.getParent()){let s=r.get(i);if(void 0!==s)return null===s?(i.is(e)||t(276),{commonAncestor:i,type:"ancestor"}):null===l?(i.is(n)||t(277),{commonAncestor:i,type:"descendant"}):((ri(s)||s.is(e))&&(ri(l)||l.is(n))&&i.is(s.getParent())&&i.is(l.getParent())||t(278),{a:s,b:l,commonAncestor:i,type:"branch"})}return null}function lt(e,n){var r;let i,{type:l,key:s,offset:o}=e,a=(null===(i=rW(r=e.key))&&t(63,r),i);return"text"===l?(na(a)||t(266,a.getType(),s),iq(a,n,o)):(ri(a)||t(267,a.getType(),s),function(e,t,n){let r=iQ(e,"next");for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(null===e)break;r=e}return lf(r,n)}(a,e.offset,n))}function ln(e,n){let{origin:r,direction:i}=n,l="next"===i;iJ(n)?e.set(r.getKey(),n.offset,"text"):iU(n)?na(r)?e.set(r.getKey(),iX(r,i),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+ +!!l,"element"):(ij(n)&&ri(r)||t(268),e.set(r.getKey(),l?0:r.getChildrenSize(),"element"))}function lr(e){let t=nL(),n=nm(t)?t:nw();return li(n,e),rG(n),n}function li(e,t){ln(e.anchor,t.anchor),ln(e.focus,t.focus)}function ll(e){let{anchor:t,focus:n}=e,r=lt(t,"next"),i=lt(n,"next"),l=0>=i7(r,i)?"next":"previous";return i4(lf(r,l),lf(i,l))}function ls(e){let{direction:t,origin:n}=e,r=iG(n,iI[t]).getNodeAtCaret();return r?iG(r,t):iQ(n.getParentOrThrow(),t)}function lo(e,t="root"){let n=[e];for(let r=ij(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(ls(r));return n}function la(e){return!!e&&e.origin.isAttached()}function lu(e){let t=function(e){let t=e;for(;ij(t);){let e=i0(t);if(!ij(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(na(t.origin))return iJ(t)?t:iq(t.origin,n,n);let r=t.getAdjacentCaret();return iU(r)&&na(r.origin)?iq(r.origin,n,iI[n]):t}function ld(e){return iJ(e)&&e.offset!==iX(e.origin,e.direction)}function lf(e,t){return e.direction===t?e:e.getFlipped()}function lc(e,t){return e.direction===t?e:i4(lf(e.focus,t),lf(e.anchor,t))}function lh(e){let{origin:n,offset:r,direction:i}=e;if(r===iX(n,i))return e.getSiblingCaret();if(r===iX(n,iI[i]))return ls(e.getSiblingCaret());let[l]=n.splitText(r);return na(l)||t(281),lf(iG(l,"next"),i)}function lg(e,t){return!0}e.s(["$applyNodeReplacement",0,ip,"$caretFromPoint",0,lt,"$caretRangeFromSelection",0,ll,"$cloneWithProperties",0,iw,"$cloneWithPropertiesEphemeral",0,function(e){var t;return(t=iw(e))[tV]=!0,t},"$create",0,function(e){let t=iE();return nq(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass},"$createLineBreakNode",0,t0,"$createNodeSelection",0,nD,"$createParagraphNode",0,rp,"$createPoint",0,ng,"$createRangeSelection",0,nw,"$createTabNode",0,nf,"$createTextNode",0,no,"$extendCaretToRange",0,i6,"$findMatchingParent",0,iF,"$getAdjacentChildCaret",0,i0,"$getAdjacentNode",0,ir,"$getAdjacentSiblingOrParentSiblingCaret",0,function(e,t="root"){let n=0,r=e,i=i0(r);for(;null===i;){if(n--,!(i=r.getParentCaret(t)))return null;i=i0(r=i)}return i&&[i,n]},"$getCaretInDirection",0,lf,"$getCaretRange",0,i4,"$getCaretRangeInDirection",0,lc,"$getCharacterOffsets",0,nN,"$getChildCaret",0,iQ,"$getChildCaretOrSelf",0,iZ,"$getCollapsedCaretRange",0,i3,"$getEditor",0,iE,"$getNearestNodeFromDOMNode",0,rU,"$getNodeByKey",0,rW,"$getNodeFromDOMNode",0,r$,"$getPreviousSelection",0,nF,"$getRoot",0,rV,"$getSelection",0,nL,"$getSiblingCaret",0,iG,"$getState",0,I,"$getTextPointCaret",0,iq,"$hasAncestor",0,id,"$insertNodes",0,function(e){let t=nL()||nF();null===t&&(t=rV().selectEnd()),t.insertNodes(e)},"$isBlockElementNode",0,function(e){return ri(e)&&!e.isInline()},"$isChildCaret",0,ij,"$isDecoratorNode",0,ro,"$isEditorState",0,function(e){return e instanceof rc},"$isElementNode",0,ri,"$isExtendableTextPointCaret",0,ld,"$isLeafNode",0,function(e){return na(e)||t1(e)||ro(e)},"$isLineBreakNode",0,t1,"$isNodeSelection",0,nx,"$isParagraphNode",0,ry,"$isRangeSelection",0,nm,"$isRootNode",0,ru,"$isRootOrShadowRoot",0,ig,"$isSiblingCaret",0,iU,"$isTabNode",0,nc,"$isTextNode",0,na,"$isTextPointCaret",0,iJ,"$isTokenOrSegmented",0,rw,"$normalizeCaret",0,lu,"$normalizeSelection__EXPERIMENTAL",0,H,"$parseSerializedNode",0,function(e){return n3(e,nZ()._nodes)},"$rewindSiblingCaret",0,ls,"$selectAll",0,function(e){let t=rV();if(nm(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),H(e),e}{let e=t.select(0,t.getChildrenSize());return rG(H(e)),e}},"$setPointFromCaret",0,ln,"$setSelection",0,rG,"$setSelectionFromCaretRange",0,lr,"$setState",0,function(e,t,n){let r;if(nq(),"function"==typeof n){let i=e.getLatest(),l=I(i,t);if(r=n(l),t.isEqual(l,r))return i}else r=n;let i=e.getWritable();return K(i).updateFromKnown(t,r),i},"$splitAtPointCaretNext",0,function(e,{$copyElementNode:t=i_,$splitTextPointCaretNext:n=lh,rootMode:r="shadowRoot",$shouldSplit:i=lg}={}){if(iJ(e))return n(e);let l=e.getParentCaret(r);if(l){let{origin:n}=l;if(ij(e)&&(!n.canBeEmpty()||!i(n,"first")))return ls(l);let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||n.canBeEmpty()&&i(n,"last"))&&l.insert(t(n).splice(0,0,r))}return l},"ArtificialNode__DO_NOT_USE",0,rh,"CAN_REDO_COMMAND",0,to,"CAN_UNDO_COMMAND",0,ta,"CLEAR_EDITOR_COMMAND",0,tl,"CLEAR_HISTORY_COMMAND",0,ts,"CLICK_COMMAND",0,eO,"COLLABORATION_TAG",0,tX,"COMMAND_PRIORITY_CRITICAL",0,4,"COMMAND_PRIORITY_EDITOR",0,0,"COMMAND_PRIORITY_HIGH",0,3,"COMMAND_PRIORITY_LOW",0,1,"CONTROLLED_TEXT_INSERTION_COMMAND",0,eR,"COPY_COMMAND",0,tn,"CUT_COMMAND",0,tr,"DELETE_CHARACTER_COMMAND",0,eL,"DELET
2E_LINE_COMMAND",0,eW,"DELETE_WORD_COMMAND",0,ez,"DRAGOVER_COMMAND",0,te,"DRAGSTART_COMMAND",0,e8,"DROP_COMMAND",0,e7,"DecoratorNode",0,rs,"ElementNode",0,rr,"FORMAT_ELEMENT_COMMAND",0,e9,"FORMAT_TEXT_COMMAND",0,e$,"HISTORIC_TAG",0,"historic","HISTORY_MERGE_TAG",0,tq,"HISTORY_PUSH_TAG",0,"history-push","INDENT_CONTENT_COMMAND",0,e4,"INSERT_LINE_BREAK_COMMAND",0,eF,"INSERT_PARAGRAPH_COMMAND",0,eI,"INSERT_TAB_COMMAND",0,e3,"INTERNAL_$isBlock",0,ib,"KEY_ARROW_DOWN_COMMAND",0,eX,"KEY_ARROW_LEFT_COMMAND",0,eH,"KEY_ARROW_RIGHT_COMMAND",0,eY,"KEY_ARROW_UP_COMMAND",0,eq,"KEY_BACKSPACE_COMMAND",0,e0,"KEY_DELETE_COMMAND",0,e2,"KEY_DOWN_COMMAND",0,ej,"KEY_ENTER_COMMAND",0,eQ,"KEY_ESCAPE_COMMAND",0,e1,"KEY_SPACE_COMMAND",0,eZ,"KEY_TAB_COMMAND",0,e6,"LineBreakNode",0,tQ,"MOVE_TO_END",0,eV,"MOVE_TO_START",0,eG,"OUTDENT_CONTENT_COMMAND",0,e5,"PASTE_COMMAND",0,eK,"PASTE_TAG",0,"paste","ParagraphNode",0,rg,"REDO_COMMAND",0,eU,"REMOVE_TEXT_COMMAND",0,eB,"RootNode",0,ra,"SELECTION_INSERT_CLIPBOARD_NODES_COMMAND",0,eM,"SELECT_ALL_COMMAND",0,ti,"TabNode",0,nd,"TextNode",0,t8,"UNDO_COMMAND",0,eJ,"buildImportMap",0,function(e){return e},"configExtension",0,function(...e){return e},"createCommand",0,eb,"createEditor",0,function(e){var t,n;let r,i,l,s,o=e||{},a=nU,u=o.theme||{},d=void 0===e?a:o.parentEditor||null,f=o.disableEvents||!1,c=rf(),h=o.namespace||(null!==d?d._config.namespace:rZ()),g=o.editorState,_=[ra,t8,tQ,nd,rg,rh,...o.nodes||[]],{onError:p,html:y}=o,m=void 0===o.editable||o.editable;if(void 0===e&&null!==a)r=a._nodes;else{r=new Map;for(let e=0;e<_.length;e++){let t=_[e],n=null,i=null;if("function"!=typeof t){let e=t;t=e.replace,n=e.with,i=e.withKlass||null}iL(t);let l=t.getType(),s=function(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=iL(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof tG&&e!==tG?e:void 0}}return t}(t);r.set(l,{exportDOM:y&&y.export?y.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:i,sharedNodeState:function(e){let t=new Map,n=new Set;for(let r="function"==typeof e?e:e.replace;r.prototype&&void 0!==r.prototype.getType;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=iL(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;"stateConfig"in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}(_[e]),transforms:s})}}let C=new rC(c,d,r,{disableEvents:f,namespace:h,theme:u},p||console.error,(t=r,n=y?y.import:void 0,i=new Map,l=new Set,s=e=>{Object.keys(e).forEach(t=>{let n=i.get(t);void 0===n&&(n=[],i.set(t,n)),n.push(e[t])})},t.forEach(e=>{let t=e.klass.importDOM;if(null==t||l.has(t))return;l.add(t);let n=t.call(e.klass);null!==n&&s(n)}),n&&s(n),i),m,e);return void 0!==g&&(C._pendingEditorState=g,C._dirtyType=2),C.registerCommand(eA,tL,0),C.registerCommand(ew,tF,0),C.registerCommand(eD,tI,0),C.registerCommand(eP,tR,0),C.registerCommand(ej,tB,0),C},"createState",0,function(e,t){return new F(e,t)},"defineExtension",0,function(e){return e},"getDOMSelection",0,ix,"getDOMTextNode",0,rL,"getNearestEditorFromDOMNode",0,rM,"getRegisteredNode",0,rT,"getTextDirection",0,function(e){return C.test(e)?"rtl":x.test(e)?"ltr":null},"isBlockDomNode",0,ik,"isDOMDocumentNode",0,rP,"isDOMNode",0,iN,"isDocumentFragment",0,iT,"isHTMLAnchorElement",0,function(e){return iS(e)&&"A"===e.tagName},"isHTMLElement",0,iS,"isInlineDomNode",0,iv,"isSelectionCapturedInDecoratorInput",0,rk,"isSelectionWithinEditor",0,rb,"makeStepwiseIterator",0,i5,"safeCast",0,function(e){return e},"setNodeIndentFromDOM",0,iD,"shallowMergeConfig",0,function(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}])}]);
3
4//# debugId=89d8d900-86b9-3230-b125-33017c0bdb88

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.