/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ function t(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const e="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,n=e&&"documentMode"in document?document.documentMode:null,r=e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),i=e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),s=!(!e||!("InputEvent"in window)||n)&&"getTargetRanges"in new window.InputEvent("input"),o=e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),l=e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,c=e&&/Android/.test(navigator.userAgent),a=e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),u=e&&c&&a,f=e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!a;function d(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}const h=1,g=3,_=9,p=11,y=0,m=1,x=2,C=0,S=1,v=2,k=1,T=2,N=4,b=8,w=16,E=32,O=64,M=128,A=1792|(112|(3|N|b)|M),P=1,D=2,F=3,L=4,I=5,K=6,z=o||l||f?" ":"​",B="\n\n",R=i?" ":z,W={bold:1,capitalize:1024,code:16,highlight:M,italic:2,lowercase:256,strikethrough:N,subscript:32,superscript:64,underline:b,uppercase:512},J={directionless:1,unmergeable:2},$={center:D,end:K,justify:L,left:P,right:F,start:I},j={[D]:"center",[K]:"end",[L]:"justify",[P]:"left",[F]:"right",[I]:"start"},U={normal:0,segmented:2,token:1},V={[C]:"normal",[v]:"segmented",[S]:"token"},Y="$",H="$config";function q(t,e,n,r,i,s){let o=t.getFirstChild();for(;null!==o;){const t=o.__key;o.__parent===e&&(hi(o)&&q(o,t,n,r,i,s),n.has(t)||s.delete(t),i.push(t)),o=o.getNextSibling()}}const G=100;let X=!1,Q=0;function Z(t){Q=t.timeStamp}function tt(t,e,n){const r="BR"===t.nodeName,i=e.__lexicalLineBreak;return i&&(t===i||r&&t.previousSibling===i)||r&&void 0!==ys(t,n)}function et(t,e,n){const r=ho(no(n));let i=null,s=null;null!==r&&r.anchorNode===t&&(i=r.anchorOffset,s=r.focusOffset);const o=t.nodeValue;null!==o&&Ms(e,o,i,s,!1)}function nt(t,e,n){if(ar(t)){const e=t.anchor.getNode();if(e.is(n)&&t.format!==e.getFormat())return!1}return ss(e)&&n.isAttached()}function rt(t,e,n,r){for(let i=t;i&&!Ao(i);i=qs(i)){const t=ys(i,e);if(void 0!==t){const e=_s(t,n);if(e)return pi(e)||!yo(i)?void 0:[i,e]}else if(i===r)return[r,vs(n)]}}function it(t,e,n){X=!0;const r=performance.now()-Q>G;try{ai(t,(()=>{const s=wr()||function(t){return t.getEditorState().read((()=>{const t=wr();return null!==t?t.clone():null}))}(t),o=new Map,l=t.getRootElement(),c=t._editorState,a=t._blockCursorElement;let u=!1,f="";for(let n=0;n0){let e=0;for(let i=0;i0)for(const[e,n]of o)n.reconcileObservedMutation(e,t);const d=n.takeRecords();if(d.length>0){for(let e=0;e{it(t,e,n)}))}class lt{constructor(t,e){this.key=t,this.parse=e.parse.bind(e),this.unparse=(e.unparse||yt).bind(e),this.isEqual=(e.isEqual||Object.is).bind(e),this.defaultValue=this.parse(void 0)}}function ct(t,e){return new lt(t,e)}function at(t,e,n="latest"){const r=("latest"===n?t.getLatest():t).__state;return r?r.getValue(e):e.defaultValue}function ut(t,e,n){const r=at(t,n,"direct"),i=at(e,n,"direct");return n.isEqual(r,i)?null:[r,i]}function ft(t,e,n){let r;if(Yr(),"function"==typeof n){const i=t.getLatest(),s=at(i,e);if(r=n(s),e.isEqual(s,r))return i}else r=n;const i=t.getWritable();return gt(i).updateFromKnown(e,r),i}function dt(t){const e=new Map,n=new Set;for(let r="function"==typeof t?t:t.replace;r.prototype&&void 0!==r.prototype.getType;r=Object.getPrototypeOf(r)){const{ownNodeConfig:t}=Do(r);if(t&&t.stateConfigs)for(const r of t.stateConfigs){let t;"stateConfig"in r?(t=r.stateConfig,r.flat&&n.add(t.key)):t=r,e.set(t.key,t)}}return{flatKeys:n,sharedConfigMap:e}}class ht{constructor(t,e,n=void 0,r=new Map,i=void 0){this.node=t,this.sharedNodeState=e,this.unknownState=n,this.knownState=r;const{sharedConfigMap:s}=this.sharedNodeState,o=void 0!==i?i:function(t,e,n){let r=n.size;if(e)for(const i in e){const e=t.get(i);e&&n.has(e)||r++}return r}(s,n,r);this.size=o}getValue(t){const e=this.knownState.get(t);if(void 0!==e)return e;this.sharedNodeState.sharedConfigMap.set(t.key,t);let n=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const e=this.unknownState[t.key];void 0!==e&&(n=t.parse(e)),this.updateFromKnown(t,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},e={};for(const[e,n]of this.knownState)e.isEqual(n,e.defaultValue)?delete t[e.key]:t[e.key]=e.unparse(n);for(const n of this.sharedNodeState.flatKeys)n in t&&(e[n]=t[n],delete t[n]);return pt(t)&&(e.$=t),e}getWritable(t){if(this.node===t)return this;const{sharedNodeState:e,unknownState:n}=this,r=new Map(this.knownState);return new ht(t,e,function(t,e,n){let r;if(n)for(const[i,s]of Object.entries(n)){const n=t.get(i);n?e.has(n)||e.set(n,n.parse(s)):(r=r||{},r[i]=s)}return r}(e.sharedConfigMap,r,n),r,this.size)}updateFromKnown(t,e){const n=t.key;this.sharedNodeState.sharedConfigMap.set(n,t);const{knownState:r,unknownState:i}=this;r.has(t)||i&&n in i||(i&&(delete i[n],this.unknownState=pt(i)),this.size++),r.set(t,e)}updateFromUnknown(t,e){const n=this.sharedNodeState.sharedConfigMap.get(t);n?this.updateFromKnown(n,n.parse(e)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=e)}updateFromJSON(t){const{knownState:e}=this;for(const t of e.keys())e.set(t,t.defaultValue);if(this.size=e.size,this.unknownState=void 0,t)for(const[e,n]of Object.entries(t))this.updateFromUnknown(e,n)}}function gt(t){const e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new ht(e,_t(e));return e.__state=n,n}function _t(t){return t.__state?t.__state.sharedNodeState:Hi(To(),t.getType()).sharedNodeState}function pt(t){if(t)for(const e in t)return t}function yt(t){return t}function mt(t,e,n){for(const[r,i]of e.knownState){if(t.has(r.key))continue;t.add(r.key);const e=n?n.getValue(r):r.defaultValue;if(e!==i&&!r.isEqual(e,i))return!0}return!1}function xt(t,e,n){const{unknownState:r}=e,i=n?n.unknownState:void 0;if(r)for(const[e,n]of Object.entries(r)){if(t.has(e))continue;t.add(e);if(n!==(i?i[e]:void 0))return!0}return!1}function Ct(t,e){const n=t.__state;return n&&n.node===t?n.getWritable(e):n}function St(t,e){const n=t.__mode,r=t.__format,i=t.__style,s=e.__mode,o=e.__format,l=e.__style,c=t.__state,a=e.__state;return(null===n||n===s)&&(null===r||r===o)&&(null===i||i===l)&&(null===t.__state||c===a||function(t,e){if(t===e)return!0;if(t&&e&&t.size!==e.size)return!1;const n=new Set;return!(t&&mt(n,t,e)||e&&mt(n,e,t)||t&&xt(n,t,e)||e&&xt(n,e,t))}(c,a))}function vt(t,e){const n=t.mergeWithSibling(e),r=Gr()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function kt(t){let e,n,r=t;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(e=r.getPreviousSibling())&&Zn(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(""!==e.__text){if(St(e,r)){r=vt(e,r);break}break}e.remove()}for(;null!==(n=r.getNextSibling())&&Zn(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(St(r,n)){r=vt(r,n);break}break}n.remove()}}else r.remove()}function Tt(t){return Nt(t.anchor),Nt(t.focus),t}function Nt(t){for(;"element"===t.type;){const e=t.getNode(),n=t.offset;let r,i;if(n===e.getChildrenSize()?(r=e.getChildAtIndex(n-1),i=!0):(r=e.getChildAtIndex(n),i=!1),Zn(r)){t.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!hi(r))break;t.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let bt,wt,Et,Ot,Mt,At,Pt,Dt,Ft,Lt,It="",Kt=null,zt="",Bt="",Rt=!1,Wt=!1;function Jt(t,e){const n=Pt.get(t);if(null!==e){const n=se(t);n.parentNode===e&&e.removeChild(n)}if(Dt.has(t)||wt._keyToDOMMap.delete(t),hi(n)){const t=te(n,Pt);$t(t,0,t.length-1,null)}void 0!==n&&Ws(Lt,Et,Ot,n,"destroyed")}function $t(t,e,n,r){let i=e;for(;i<=n;++i){const e=t[i];void 0!==e&&Jt(e,r)}}function jt(t,e){t.setProperty("text-align",e)}const Ut="40px";function Vt(t,e){const n=bt.theme.indent;if("string"==typeof n){const r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}const r=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||Ut;t.style.setProperty("padding-inline-start",0===e?"":`calc(${e} * ${r})`)}function Yt(t,e){const n=t.style;0===e?jt(n,""):e===P?jt(n,"left"):e===D?jt(n,"center"):e===F?jt(n,"right"):e===L?jt(n,"justify"):e===I?jt(n,"start"):e===K&&jt(n,"end")}function Ht(t,e){const n=function(t){const e=t.__dir;if(null!==e)return e;if(mi(t))return null;const n=t.getParentOrThrow();return mi(n)&&null===n.__dir?"auto":null}(e);null!==n?t.dir=n:t.removeAttribute("dir")}function qt(e,n){const r=Dt.get(e);void 0===r&&t(60);const i=r.createDOM(bt,wt);if(function(t,e,n){const r=n._keyToDOMMap;(function(t,e,n){const r=`__lexicalKey_${e._key}`;t[r]=n})(e,n,t),r.set(t,e)}(e,i,wt),Zn(r)?i.setAttribute("data-lexical-text","true"):pi(r)&&i.setAttribute("data-lexical-decorator","true"),hi(r)){const t=r.__indent,e=r.__size;if(Ht(i,r),0!==t&&Vt(i,t),0!==e){const t=e-1;Gt(te(r,Dt),r,0,t,r.getDOMSlot(i))}const n=r.__format;0!==n&&Yt(i,n),r.isInline()||Qt(null,r,i),Ys(r)&&(It+=B,Bt+=B)}else{const t=r.getTextContent();if(pi(r)){const t=r.decorate(wt,bt);null!==t&&ne(e,t),i.contentEditable="false"}It+=t,Bt+=t}return null!==n&&n.insertChild(i),Ws(Lt,Et,Ot,r,"created"),i}function Gt(t,e,n,r,i){const s=It;It="";let o=n;for(;o<=r;++o){qt(t[o],i);const e=Dt.get(t[o]);null!==e&&Zn(e)&&(null===Kt&&(Kt=e.getFormat()),""===zt&&(zt=e.getStyle()))}Ys(e)&&(It+=B);i.element.__lexicalTextContent=It,It=s+It}function Xt(t,e){if(t){const n=t.__last;if(n){const t=e.get(n);if(t)return Ln(t)?"line-break":pi(t)&&t.isInline()?"decorator":null}return"empty"}return null}function Qt(t,e,n){const r=Xt(t,Pt),i=Xt(e,Dt);r!==i&&e.getDOMSlot(n).setManagedLineBreak(i)}function Zt(e,n,r){var i;Kt=null,zt="",function(e,n,r){const i=It,s=e.__size,o=n.__size;It="";const l=r.element;if(1===s&&1===o){const t=e.__first,r=n.__first;if(t===r)ee(t,l);else{const e=se(t),n=qt(r,null);try{l.replaceChild(n,e)}catch(i){if("object"==typeof i&&null!=i){const s=`${i.toString()} Parent: ${l.tagName}, new child: {tag: ${n.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${t}}.`;throw new Error(s)}throw i}Jt(t,null)}const i=Dt.get(r);Zn(i)&&(null===Kt&&(Kt=i.getFormat()),""===zt&&(zt=i.getStyle()))}else{const i=te(e,Pt),c=te(n,Dt);if(i.length!==s&&t(227),c.length!==o&&t(228),0===s)0!==o&&Gt(c,n,0,o-1,r);else if(0===o){if(0!==s){const t=null==r.after&&null==r.before&&null==r.element.__lexicalLineBreak;$t(i,0,s-1,t?null:l),t&&(l.textContent="")}}else!function(t,e,n,r,i,s){const o=r-1,l=i-1;let c,a,u=s.getFirstChild(),f=0,d=0;for(;f<=o&&d<=l;){const t=e[f],r=n[d];if(t===r)u=re(ee(r,s.element)),f++,d++;else{void 0===c&&(c=new Set(e)),void 0===a&&(a=new Set(n));const i=a.has(t),o=c.has(r);if(i)if(o){const t=Hs(wt,r);t===u?u=re(ee(r,s.element)):(s.withBefore(u).insertChild(t),ee(r,s.element)),f++,d++}else qt(r,s.withBefore(u)),d++;else u=re(se(t)),Jt(t,s.element),f++}const i=Dt.get(r);null!==i&&Zn(i)&&(null===Kt&&(Kt=i.getFormat()),""===zt&&(zt=i.getStyle()))}const h=f>o,g=d>l;if(h&&!g){const e=n[l+1],r=void 0===e?null:wt.getElementByKey(e);Gt(n,t,d,l,s.withBefore(r))}else g&&!h&&$t(e,f,o,s.element)}(n,i,c,s,o,r)}Ys(n)&&(It+=B);l.__lexicalTextContent=It,It=i+It}(e,n,n.getDOMSlot(r)),i=n,null==Kt||Kt===i.__textFormat||Wt||i.setTextFormat(Kt),function(t){""===zt||zt===t.__textStyle||Wt||t.setTextStyle(zt)}(n)}function te(e,n){const r=[];let i=e.__first;for(;null!==i;){const e=n.get(i);void 0===e&&t(101),r.push(i),i=e.__next}return r}function ee(e,n){const r=Pt.get(e);let i=Dt.get(e);void 0!==r&&void 0!==i||t(61);const s=Rt||At.has(e)||Mt.has(e),o=Hs(wt,e);if(r===i&&!s){if(hi(r)){const t=o.__lexicalTextContent;void 0!==t&&(It+=t,Bt+=t)}else{const t=r.getTextContent();Bt+=t,It+=t}return o}if(r!==i&&s&&Ws(Lt,Et,Ot,i,"updated"),i.updateDOM(r,o,bt)){const r=qt(e,null);return null===n&&t(62),n.replaceChild(r,o),Jt(e,null),r}if(hi(r)&&hi(i)){const t=i.__indent;(Rt||t!==r.__indent)&&Vt(o,t);const e=i.__format;if((Rt||e!==r.__format)&&Yt(o,e),s&&(Zt(r,i,o),mi(i)||i.isInline()||Qt(r,i,o)),Ys(i)&&(It+=B,Bt+=B),(Rt||i.__dir!==r.__dir)&&(Ht(o,i),mi(i)&&!Rt))for(const t of i.getChildren())if(hi(t)){Ht(Hs(wt,t.getKey()),t)}}else{const t=i.getTextContent();if(pi(i)){const t=i.decorate(wt,bt);null!==t&&ne(e,t)}It+=t,Bt+=t}if(!Wt&&mi(i)&&i.__cachedText!==Bt){const t=i.getWritable();t.__cachedText=Bt,i=t}return o}function ne(t,e){let n=wt._pendingDecorators;const r=wt._decorators;if(null===n){if(r[t]===e)return;n=xs(wt)}n[t]=e}function re(t){let e=t.nextSibling;return null!==e&&e===wt._blockCursorElement&&(e=e.nextSibling),e}function ie(t,e,n,r,i,s){It="",Bt="",Rt=r===x,wt=n,bt=n._config,Et=n._nodes,Ot=wt._listeners.mutation,Mt=i,At=s,Pt=t._nodeMap,Dt=e._nodeMap,Wt=e._readOnly,Ft=new Map(n._keyToDOMMap);const o=new Map;return Lt=o,ee("root",null),wt=void 0,Et=void 0,Mt=void 0,At=void 0,Pt=void 0,Dt=void 0,bt=void 0,Ft=void 0,Lt=void 0,o}function se(e){const n=Ft.get(e);return void 0===n&&t(75,e),n}function oe(t){return{type:t}}const le=oe("SELECTION_CHANGE_COMMAND"),ce=oe("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),ae=oe("CLICK_COMMAND"),ue=oe("DELETE_CHARACTER_COMMAND"),fe=oe("INSERT_LINE_BREAK_COMMAND"),de=oe("INSERT_PARAGRAPH_COMMAND"),he=oe("CONTROLLED_TEXT_INSERTION_COMMAND"),ge=oe("PASTE_COMMAND"),_e=oe("REMOVE_TEXT_COMMAND"),pe=oe("DELETE_WORD_COMMAND"),ye=oe("DELETE_LINE_COMMAND"),me=oe("FORMAT_TEXT_COMMAND"),xe=oe("UNDO_COMMAND"),Ce=oe("REDO_COMMAND"),Se=oe("KEYDOWN_COMMAND"),ve=oe("KEY_ARROW_RIGHT_COMMAND"),ke=oe("MOVE_TO_END"),Te=oe("KEY_ARROW_LEFT_COMMAND"),Ne=oe("MOVE_TO_START"),be=oe("KEY_ARROW_UP_COMMAND"),we=oe("KEY_ARROW_DOWN_COMMAND"),Ee=oe("KEY_ENTER_COMMAND"),Oe=oe("KEY_SPACE_COMMAND"),Me=oe("KEY_BACKSPACE_COMMAND"),Ae=oe("KEY_ESCAPE_COMMAND"),Pe=oe("KEY_DELETE_COMMAND"),De=oe("KEY_TAB_COMMAND"),Fe=oe("INSERT_TAB_COMMAND"),Le=oe("INDENT_CONTENT_COMMAND"),Ie=oe("OUTDENT_CONTENT_COMMAND"),Ke=oe("DROP_COMMAND"),ze=oe("FORMAT_ELEMENT_COMMAND"),Be=oe("DRAGSTART_COMMAND"),Re=oe("DRAGOVER_COMMAND"),We=oe("DRAGEND_COMMAND"),Je=oe("COPY_COMMAND"),$e=oe("CUT_COMMAND"),je=oe("SELECT_ALL_COMMAND"),Ue=oe("CLEAR_EDITOR_COMMAND"),Ve=oe("CLEAR_HISTORY_COMMAND"),Ye=oe("CAN_REDO_COMMAND"),He=oe("CAN_UNDO_COMMAND"),qe=oe("FOCUS_COMMAND"),Ge=oe("BLUR_COMMAND"),Xe=oe("KEY_MODIFIER_COMMAND"),Qe=Object.freeze({}),Ze=30,tn=[["keydown",function(t,e){if(en=t.timeStamp,nn=t.key,e.isComposing())return;if(Vs(e,Se,t))return;if(null==t.key)return;if(fn&&Ks(t))return ai(e,(()=>{Sn(e,dn)})),fn=!1,void(dn="");if(function(t){return Fs(t,"ArrowRight",{shiftKey:"any"})}(t))Vs(e,ve,t);else if(function(t){return Fs(t,"ArrowRight",Ls)}(t))Vs(e,ke,t);else if(function(t){return Fs(t,"ArrowLeft",{shiftKey:"any"})}(t))Vs(e,Te,t);else if(function(t){return Fs(t,"ArrowLeft",Ls)}(t))Vs(e,Ne,t);else if(function(t){return Fs(t,"ArrowUp",{altKey:"any",shiftKey:"any"})}(t))Vs(e,be,t);else if(function(t){return Fs(t,"ArrowDown",{altKey:"any",shiftKey:"any"})}(t))Vs(e,we,t);else if(function(t){return Fs(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(t))an=!0,Vs(e,Ee,t);else if(function(t){return" "===t.key}(t))Vs(e,Oe,t);else if(function(t){return r&&Fs(t,"o",{ctrlKey:!0})}(t))t.preventDefault(),an=!0,Vs(e,fe,!0);else if(function(t){return Fs(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(t))an=!1,Vs(e,Ee,t);else if(function(t){return Fs(t,"Backspace",{shiftKey:"any"})||r&&Fs(t,"h",{ctrlKey:!0})}(t))Ks(t)?Vs(e,Me,t):(t.preventDefault(),Vs(e,ue,!0));else if(function(t){return"Escape"===t.key}(t))Vs(e,Ae,t);else if(function(t){return Fs(t,"Delete",{})||r&&Fs(t,"d",{ctrlKey:!0})}(t))!function(t){return"Delete"===t.key}(t)?(t.preventDefault(),Vs(e,ue,!1)):Vs(e,Pe,t);else if(function(t){return Fs(t,"Backspace",Is)}(t))t.preventDefault(),Vs(e,pe,!0);else if(function(t){return Fs(t,"Delete",Is)}(t))t.preventDefault(),Vs(e,pe,!1);else if(function(t){return r&&Fs(t,"Backspace",{metaKey:!0})}(t))t.preventDefault(),Vs(e,ye,!0);else if(function(t){return r&&(Fs(t,"Delete",{metaKey:!0})||Fs(t,"k",{ctrlKey:!0}))}(t))t.preventDefault(),Vs(e,ye,!1);else if(function(t){return Fs(t,"b",Ls)}(t))t.preventDefault(),Vs(e,me,"bold");else if(function(t){return Fs(t,"u",Ls)}(t))t.preventDefault(),Vs(e,me,"underline");else if(function(t){return Fs(t,"i",Ls)}(t))t.preventDefault(),Vs(e,me,"italic");else if(function(t){return Fs(t,"Tab",{shiftKey:"any"})}(t))Vs(e,De,t);else if(function(t){return Fs(t,"z",Ls)}(t))t.preventDefault(),Vs(e,xe,void 0);else if(function(t){if(r)return Fs(t,"z",{metaKey:!0,shiftKey:!0});return Fs(t,"y",{ctrlKey:!0})||Fs(t,"z",{ctrlKey:!0,shiftKey:!0})}(t))t.preventDefault(),Vs(e,Ce,void 0);else{const n=e._editorState._selection;null===n||ar(n)?zs(t)&&(t.preventDefault(),Vs(e,je,t)):!function(t){return Fs(t,"c",Ls)}(t)?!function(t){return Fs(t,"x",Ls)}(t)?zs(t)&&(t.preventDefault(),Vs(e,je,t)):(t.preventDefault(),Vs(e,$e,t)):(t.preventDefault(),Vs(e,Je,t))}(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(t)&&Vs(e,Xe,t)}],["pointerdown",function(t,e){const n=t.target,r=t.pointerType;mo(n)&&"touch"!==r&&"pen"!==r&&0===t.button&&ai(e,(()=>{Xi(n)||(cn=!0)}))}],["compositionstart",function(t,e){ai(e,(()=>{const n=wr();if(ar(n)&&!e.isComposing()){const r=n.anchor,i=n.anchor.getNode();hs(r.key),(t.timeStamp{Sn(e,t.data)})):(fn=!0,dn=t.data)}],["input",function(t,e){t.stopPropagation(),ai(e,(()=>{if(yo(t.target)&&Xi(t.target))return;const n=wr(),r=t.data,c=Cn(t);if(null!=r&&ar(n)&&_n(n,c,r,t.timeStamp,!1)){un&&(Sn(e,r),un=!1);const c=n.anchor.getNode(),a=ho(no(e));if(null===a)return;const u=n.isBackward(),d=u?n.anchor.offset:n.focus.offset,h=u?n.focus.offset:n.anchor.offset;s&&!n.isCollapsed()&&Zn(c)&&null!==a.anchorNode&&c.getTextContent().slice(0,d)+r+c.getTextContent().slice(d+h)===Es(a.anchorNode)||Vs(e,he,r);const g=r.length;i&&g>1&&"insertCompositionText"===t.inputType&&!e.isComposing()&&(n.anchor.offset-=g),o||l||f||!e.isComposing()||(en=0,hs(null))}else{Os(!1,e,null!==r?r:void 0),un&&(Sn(e,r||void 0),un=!1)}!function(){Yr();const t=Gr();st(t)}()}),{event:t}),sn=null}],["click",function(t,e){ai(e,(()=>{const n=wr(),r=ho(no(e)),i=Er();if(r)if(ar(n)){const e=n.anchor,s=e.getNode();if("element"===e.type&&0===e.offset&&n.isCollapsed()&&!mi(s)&&1===Ss().getChildrenSize()&&s.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===t.detail&&!n.isCollapsed()){if(s!==n.focus.getNode()){const t=function(t,e){let n=t;for(;n!==Ss()&&null!=n;){if(e(n))return n;n=n.getParent()}return null}(s,(t=>hi(t)&&!t.isInline()));hi(t)&&t.select(0)}}}else if("touch"===t.pointerType||"pen"===t.pointerType){const n=r.anchorNode;if(yo(n)||ss(n)){ks(br(i,r,e,t))}}Vs(e,ae,t)}))}],["cut",Qe],["copy",Qe],["dragstart",Qe],["dragover",Qe],["dragend",Qe],["paste",Qe],["focus",Qe],["blur",Qe],["drop",Qe]];s&&tn.push(["beforeinput",(e,n)=>function(e,n){const r=e.inputType,s=Cn(e);if("deleteCompositionText"===r||i&&Us(n))return;if("insertCompositionText"===r)return;ai(n,(()=>{const i=wr();if("deleteContentBackward"===r){if(null===i){const t=Er();if(!ar(t))return;ks(t.clone())}if(ar(i)){const r=i.anchor.key===i.focus.key;if(o=e.timeStamp,"MediaLast"===nn&&o{ai(n,(()=>{hs(null)}))}),Ze),ar(i)){const e=i.anchor.getNode();e.markDirty(),Zn(e)||t(142),xn(i,e)}}else{hs(null),e.preventDefault();const t=i.anchor.getNode(),s=t.getTextContent(),o=t.canInsertTextAfter(),l=0===i.anchor.offset&&i.focus.offset===s.length;let c=u&&r&&!l&&o;if(c&&i.isCollapsed()&&(c=!pi(js(i.anchor,!0))),!c){Vs(n,ue,!0);const t=wr();u&&ar(t)&&t.isCollapsed()&&(hn=t,setTimeout((()=>hn=null)))}}return}}var o;if(!ar(i))return;const c=e.data;null!==sn&&Os(!1,n,sn),i.dirty&&null===sn||!i.isCollapsed()||mi(i.anchor.getNode())||null===s||i.applyDOMRange(s),sn=null;const a=i.anchor,f=i.focus,d=a.getNode(),h=f.getNode();if("insertText"!==r&&"insertTranspose"!==r)switch(e.preventDefault(),r){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Vs(n,he,e);break;case"insertFromComposition":hs(null),Vs(n,he,e);break;case"insertLineBreak":hs(null),Vs(n,fe,!1);break;case"insertParagraph":hs(null),an&&!l?(an=!1,Vs(n,fe,!1)):Vs(n,de,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Vs(n,ge,e);break;case"deleteByComposition":(function(t,e){return t!==e||hi(t)||hi(e)||!rs(t)||!rs(e)})(d,h)&&Vs(n,_e,e);break;case"deleteByDrag":case"deleteByCut":Vs(n,_e,e);break;case"deleteContent":Vs(n,ue,!1);break;case"deleteWordBackward":Vs(n,pe,!0);break;case"deleteWordForward":Vs(n,pe,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Vs(n,ye,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Vs(n,ye,!1);break;case"formatStrikeThrough":Vs(n,me,"strikethrough");break;case"formatBold":Vs(n,me,"bold");break;case"formatItalic":Vs(n,me,"italic");break;case"formatUnderline":Vs(n,me,"underline");break;case"historyUndo":Vs(n,xe,void 0);break;case"historyRedo":Vs(n,Ce,void 0)}else{if("\n"===c)e.preventDefault(),Vs(n,fe,!1);else if(c===B)e.preventDefault(),Vs(n,de,void 0);else if(null==c&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(t)}else null!=c&&_n(i,s,c,e.timeStamp,!0)?(e.preventDefault(),Vs(n,he,c)):sn=c;rn=e.timeStamp}}))}(e,n)]);let en=0,nn=null,rn=0,sn=null;const on=new WeakMap;let ln=!1,cn=!1,an=!1,un=!1,fn=!1,dn="",hn=null,gn=[0,"",0,"root",0];function _n(t,e,n,r,i){const o=t.anchor,l=t.focus,c=o.getNode(),a=Gr(),u=ho(no(a)),f=null!==u?u.anchorNode:null,d=o.key,h=a.getElementByKey(d),g=n.length;return d!==l.key||!Zn(c)||(!i&&(!s||rn1||(i||!s)&&null!==h&&!c.isComposing()&&f!==ls(h)||null!==u&&null!==e&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||c.getFormat()!==t.format||c.getStyle()!==t.style||function(t,e){if(e.isSegmented())return!0;if(!t.isCollapsed())return!1;const n=t.anchor.offset,r=e.getParentOrThrow(),i=rs(e);return 0===n?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(t){const e=t.getPreviousSibling();return(Zn(e)||hi(e)&&e.isInline())&&!e.canInsertTextAfter()}(e):n===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}(t,c)}function pn(t,e){return ss(t)&&null!==t.nodeValue&&0!==e&&e!==t.nodeValue.length}function yn(e,n,r){const{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:l}=e;ln&&(ln=!1,pn(i,s)&&pn(o,l)&&!hn)||ai(n,(()=>{if(!r)return void ks(null);if(!Zi(n,i,o))return;let c=wr();if(hn&&ar(c)&&c.isCollapsed()){const t=c.anchor,e=hn.anchor;(t.key===e.key&&t.offset===e.offset+1||1===t.offset&&e.getNode().is(t.getNode().getPreviousSibling()))&&(c=hn.clone(),ks(c))}if(hn=null,ar(c)){const r=c.anchor,i=r.getNode();if(c.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(c.dirty=!0);const s=no(n).event,o=s?s.timeStamp:performance.now(),[l,a,u,f,d]=gn,h=Ss(),g=!1===n.isComposing()&&""===h.getTextContent();if(o{const r=Er(),i=e.anchorNode;if(yo(i)||ss(i)){ks(br(r,e,n,t))}})));const r=bs(n),i=r[r.length-1],s=i._key,o=kn.get(s),l=o||i;l!==n&&yn(e,l,!1),yn(e,n,!0),n!==i?kn.set(s,n):o&&kn.delete(s)}function Nn(t){t._lexicalHandled=!0}function bn(t){return!0===t._lexicalHandled}const wn=()=>{};function En(e){const n=e.ownerDocument,r=on.get(n);if(void 0===r)return void wn();const i=r-1;i>=0||t(164),on.set(n,i),0===i&&n.removeEventListener("selectionchange",Tn);const s=ns(e);ts(s)?(!function(t){if(null!==t._parentEditor){const e=bs(t),n=e[e.length-1]._key;kn.get(n)===t&&kn.delete(n)}else kn.delete(t._key)}(s),e.__lexicalEditor=null):s&&t(198);const o=vn(e);for(let t=0;tt.__key===this.__key));if(Zn(this))return n;if(ar(e)&&"element"===e.anchor.type&&"element"===e.focus.type){if(e.isCollapsed())return!1;const t=this.getParent();if(pi(this)&&this.isInline()&&t){const n=e.isBackward()?e.focus:e.anchor;if(t.is(n.getNode())&&n.offset===t.getChildrenSize()&&this.is(t.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(null===t)return-1;let e=t.getFirstChild(),n=0;for(;null!==e;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return null===t?null:_s(t)}getParentOrThrow(){const e=this.getParent();return null===e&&t(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const n=e.getParent();if(so(n))return hi(e)||e===this&&pi(e)||t(194),e;e=n}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&t(67,this.__key),e}getParents(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e),e=e.getParent();return t}getParentKeys(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e.__key),e=e.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return null===t?null:_s(t)}getPreviousSiblings(){const t=[],e=this.getParent();if(null===e)return t;let n=e.getFirstChild();for(;null!==n&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return null===t?null:_s(t)}getNextSiblings(){const t=[];let e=this.getNextSibling();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){const e=hi(this)?this:this.getParent(),n=hi(t)?t:t.getParent(),r=e&&n?gl(e,n):null;return r?r.commonAncestor:null}is(t){return null!=t&&this.__key===t.__key}isBefore(e){const n=gl(this,e);return null!==n&&("descendant"===n.type||("branch"===n.type?-1===fl(n):("same"!==n.type&&"ancestor"!==n.type&&t(279),!1)))}isParentOf(t){const e=gl(this,t);return null!==e&&"ancestor"===e.type}getNodesBetween(e){const n=this.isBefore(e),r=[],i=new Set;let s=this;for(;null!==s;){const o=s.__key;if(i.has(o)||(i.add(o),r.push(s)),s===e)break;const l=hi(s)?n?s.getFirstChild():s.getLastChild():null;if(null!==l){s=l;continue}const c=n?s.getNextSibling():s.getPreviousSibling();if(null!==c){s=c;continue}const a=s.getParentOrThrow();if(i.has(a.__key)||r.push(a),a===e)break;let u=null,f=a;do{if(null===f&&t(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),null===f)break;null!==u||i.has(f.__key)||r.push(f)}while(null===u);s=u}return n||r.reverse(),r}isDirty(){const t=Gr()._dirtyLeaves;return null!==t&&t.has(this.__key)}getLatest(){const e=_s(this.__key);return null===e&&t(113),e}getWritable(){Yr();const t=qr(),e=Gr(),n=t._nodeMap,r=this.__key,i=this.getLatest(),s=e._cloneNotNeeded,o=wr();if(null!==o&&o.setCachedNodes(null),s.has(r))return ds(i),i;const l=Eo(i);return s.add(r),ds(l),n.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){t(70)}updateDOM(e,n,r){t(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(e){t(18,this.name)}updateFromJSON(t){return function(t,e){const n=t.getWritable(),r=e.$;let i=r;for(const t of _t(n).flatKeys)t in e&&(void 0!==i&&i!==r||(i={...r}),i[t]=e[t]);return(n.__state||i)&>(t).updateFromJSON(i),n}(this,t)}static transform(){return null}remove(t){On(this,!0,t)}replace(e,n){Yr();let r=wr();null!==r&&(r=r.clone()),co(this,e);const i=this.getLatest(),s=this.__key,o=e.__key,l=e.getWritable(),c=this.getParentOrThrow().getWritable(),a=c.__size;fs(l);const u=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,h=i.__next,g=i.__parent;if(On(i,!1,!0),null===u)c.__first=o;else{u.getWritable().__next=o}if(l.__prev=d,null===f)c.__last=o;else{f.getWritable().__prev=o}if(l.__next=h,l.__parent=g,c.__size=a,n&&(hi(this)&&hi(l)||t(139),this.getChildren().forEach((t=>{l.append(t)}))),ar(r)){ks(r);const t=r.anchor,e=r.focus;t.key===s&&lr(t,l),e.key===s&&lr(e,l)}return gs()===s&&hs(o),l}insertAfter(t,e=!0){Yr(),co(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.getParent(),s=wr();let o=!1,l=!1;if(null!==i){const e=t.getIndexWithinParent();if(fs(r),ar(s)){const t=i.__key,n=s.anchor,r=s.focus;o="element"===n.type&&n.key===t&&n.offset===e+1,l="element"===r.type&&r.key===t&&r.offset===e+1}}const c=this.getNextSibling(),a=this.getParentOrThrow().getWritable(),u=r.__key,f=n.__next;if(null===c)a.__last=u;else{c.getWritable().__prev=u}if(a.__size++,n.__next=u,r.__next=f,r.__prev=n.__key,r.__parent=n.__parent,e&&ar(s)){const t=this.getIndexWithinParent();Or(s,a,t+1);const e=a.__key;o&&s.anchor.set(e,t+2,"element"),l&&s.focus.set(e,t+2,"element")}return t}insertBefore(t,e=!0){Yr(),co(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.__key;fs(r);const s=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),l=n.__prev,c=this.getIndexWithinParent();if(null===s)o.__first=i;else{s.getWritable().__next=i}o.__size++,n.__prev=i,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const a=wr();if(e&&ar(a)){Or(a,this.getParentOrThrow(),c)}return t}isParentRequired(){return!1}createParentElementNode(){return Fi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){Yr();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(hi(n))return n.select();if(!Zn(n)){const t=n.getIndexWithinParent()+1;return r.select(t,t)}return n.select(t,e)}selectNext(t,e){Yr();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(hi(n))return n.select(0,0);if(!Zn(n)){const t=n.getIndexWithinParent();return r.select(t,t)}return n.select(t,e)}markDirty(){this.getWritable()}reconcileObservedMutation(t,e){this.markDirty()}}class Pn extends An{static getType(){return"linebreak"}static clone(t){return new Pn(t.__key)}constructor(t){super(t)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>function(t){const e=t.parentElement;if(null!==e&&So(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&In(n)){const n=e.lastChild;if(n===t||n.previousSibling===t&&In(n))return!0}}return!1}(t)||function(t){const e=t.parentElement;if(null!==e&&So(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&In(n))return!1;const r=e.lastChild;if(r===t||r.previousSibling===t&&In(r))return!0}return!1}(t)?null:{conversion:Dn,priority:0}}}static importJSON(t){return Fn().updateFromJSON(t)}}function Dn(t){return{node:Fn()}}function Fn(){return lo(new Pn)}function Ln(t){return t instanceof Pn}function In(t){return ss(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function Kn(t,e){return 16&e?"code":e&M?"mark":32&e?"sub":64&e?"sup":null}function zn(t,e){return 1&e?"strong":2&e?"em":"span"}function Bn(t,e,n,r,i){const s=r.classList;let o=Rs(i,"base");void 0!==o&&s.add(...o),o=Rs(i,"underlineStrikethrough");let l=!1;const c=e&b&&e&N;void 0!==o&&(n&b&&n&N?(l=!0,c||s.add(...o)):c&&s.remove(...o));for(const t in W){const r=W[t];if(o=Rs(i,t),void 0!==o)if(n&r){if(l&&("underline"===t||"strikethrough"===t)){e&r&&s.remove(...o);continue}e&r&&(!c||"underline"!==t)&&"strikethrough"!==t||s.add(...o)}else e&r&&s.remove(...o)}}function Rn(t,e,n){const r=e.firstChild,s=n.isComposing(),o=t+(s?z:"");if(null==r)e.textContent=o;else{const t=r.nodeValue;if(t!==o)if(s||i){const[e,n,i]=function(t,e){const n=t.length,r=e.length;let i=0,s=0;for(;i({conversion:Hn,priority:0}),b:()=>({conversion:Un,priority:0}),code:()=>({conversion:Xn,priority:0}),em:()=>({conversion:Xn,priority:0}),i:()=>({conversion:Xn,priority:0}),mark:()=>({conversion:Xn,priority:0}),s:()=>({conversion:Xn,priority:0}),span:()=>({conversion:jn,priority:0}),strong:()=>({conversion:Xn,priority:0}),sub:()=>({conversion:Xn,priority:0}),sup:()=>({conversion:Xn,priority:0}),u:()=>({conversion:Xn,priority:0})}}static importJSON(t){return Qn().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(e){let{element:n}=super.exportDOM(e);return yo(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=Jn(n,"b")),this.hasFormat("italic")&&(n=Jn(n,"i")),this.hasFormat("strikethrough")&&(n=Jn(n,"s")),this.hasFormat("underline")&&(n=Jn(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,e){}setFormat(t){const e=this.getWritable();return e.__format="string"==typeof t?W[t]:t,e}setDetail(t){const e=this.getWritable();return e.__detail="string"==typeof t?J[t]:t,e}setStyle(t){const e=this.getWritable();return e.__style=t,e}toggleFormat(t){const e=cs(this.getFormat(),t,null);return this.setFormat(e)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const e=U[t];if(this.__mode===e)return this;const n=this.getWritable();return n.__mode=e,n}setTextContent(t){if(this.__text===t)return this;const e=this.getWritable();return e.__text=t,e}select(t,e){Yr();let n=t,r=e;const i=wr(),s=this.getTextContent(),o=this.__key;if("string"==typeof s){const t=s.length;void 0===n&&(n=t),void 0===r&&(r=t)}else n=0,r=0;if(!ar(i))return vr(o,n,o,r,"text","text");{const t=gs();t!==i.anchor.key&&t!==i.focus.key||hs(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,e,n,r){const i=this.getWritable(),s=i.__text,o=n.length;let l=t;l<0&&(l=o+l,l<0&&(l=0));const c=wr();if(r&&ar(c)){const e=t+o;c.setTextNodeRange(i,e,i,e)}const a=s.slice(0,l)+n+s.slice(l+e);return i.__text=a,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){Yr();const e=this.getLatest(),n=e.getTextContent();if(""===n)return[];const r=e.__key,i=gs(),s=n.length;t.sort(((t,e)=>t-e)),t.push(s);const o=[],l=t.length;for(let e=0,r=0;ee&&(o.push(n.slice(e,i)),e=i)}const c=o.length;if(1===c)return[e];const a=o[0],u=e.getParent();let f;const d=e.getFormat(),h=e.getStyle(),g=e.__detail;let _=!1,p=null,y=null;const m=wr();if(ar(m)){const[t,e]=m.isBackward()?[m.focus,m.anchor]:[m.anchor,m.focus];"text"===t.type&&t.key===r&&(p=t),"text"===e.type&&e.key===r&&(y=e)}e.isSegmented()?(f=Qn(a),f.__format=d,f.__style=h,f.__detail=g,f.__state=Ct(e,f),_=!0):f=e.setTextContent(a);const x=[f];for(let t=1;t=v&&(p.set(t.getKey(),C-v,"text"),C=v){y.set(t.getKey(),S-v,"text");break}v=e}if(null!==u){!function(t){const e=t.getPreviousSibling(),n=t.getNextSibling();null!==e&&ds(e);null!==n&&ds(n)}(this);const t=u.getWritable(),e=this.getIndexWithinParent();_?(t.splice(e,0,x),this.remove()):t.splice(e,1,x),ar(m)&&Or(m,u,e,c-1)}return x}mergeWithSibling(e){const n=e===this.getPreviousSibling();n||e===this.getNextSibling()||t(50);const r=this.__key,i=e.__key,s=this.__text,o=s.length;gs()===i&&hs(r);const l=wr();if(ar(l)){const t=l.anchor,s=l.focus;null!==t&&t.key===i&&Pr(t,n,r,e,o),null!==s&&s.key===i&&Pr(s,n,r,e,o)}const c=e.__text,a=n?c+s:s+c;this.setTextContent(a);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function jn(t){return{forChild:tr(t.style),node:null}}function Un(t){const e=t,n="normal"===e.style.fontWeight;return{forChild:tr(e.style,n?void 0:"bold"),node:null}}const Vn=new WeakMap;function Yn(t){if(!yo(t))return!1;if("PRE"===t.nodeName)return!0;const e=t.style.whiteSpace;return"string"==typeof e&&e.startsWith("pre")}function Hn(e){const n=e;null===e.parentElement&&t(129);let r=n.textContent||"";if(null!==function(t){let e,n=t.parentNode;const r=[t];for(;null!==n&&void 0===(e=Vn.get(n))&&!Yn(n);)r.push(n),n=n.parentNode;const i=void 0===e?n:e;for(let t=0;t0){/[ \t\n]$/.test(n)&&(r=r.slice(1)),e=!1;break}}e&&(r=r.slice(1))}if(" "===r[r.length-1]){let t=n,e=!0;for(;null!==t&&null!==(t=qn(t,!0));){if((t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){e=!1;break}}e&&(r=r.slice(0,r.length-1))}return""===r?{node:null}:{node:Qn(r)}}function qn(t,e){let n=t;for(;;){let t;for(;null===(t=e?n.nextSibling:n.previousSibling);){const t=n.parentElement;if(null===t)return null;n=t}if(n=t,yo(n)){const t=n.style.display;if(""===t&&!Co(n)||""!==t&&!t.startsWith("inline"))return null}let r=n;for(;null!==(r=e?n.firstChild:n.lastChild);)n=r;if(ss(n))return n;if("BR"===n.nodeName)return null}}const Gn={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Xn(t){const e=Gn[t.nodeName.toLowerCase()];return void 0===e?{node:null}:{forChild:tr(t.style,e),node:null}}function Qn(t=""){return lo(new $n(t))}function Zn(t){return t instanceof $n}function tr(t,e){const n=t.fontWeight,r=t.textDecoration.split(" "),i="700"===n||"bold"===n,s=r.includes("line-through"),o="italic"===t.fontStyle,l=r.includes("underline"),c=t.verticalAlign;return t=>Zn(t)?(i&&!t.hasFormat("bold")&&t.toggleFormat("bold"),s&&!t.hasFormat("strikethrough")&&t.toggleFormat("strikethrough"),o&&!t.hasFormat("italic")&&t.toggleFormat("italic"),l&&!t.hasFormat("underline")&&t.toggleFormat("underline"),"sub"!==c||t.hasFormat("subscript")||t.toggleFormat("subscript"),"super"!==c||t.hasFormat("superscript")||t.toggleFormat("superscript"),e&&!t.hasFormat(e)&&t.toggleFormat(e),t):t}class er extends $n{static getType(){return"tab"}static clone(t){return new er(t.__key)}constructor(t){super("\t",t),this.__detail=2}static importDOM(){return null}createDOM(t){const e=super.createDOM(t),n=Rs(t.theme,"tab");if(void 0!==n){e.classList.add(...n)}return e}static importJSON(t){return nr().updateFromJSON(t)}setTextContent(e){return"\t"!==e&&""!==e&&t(126),super.setTextContent("\t")}spliceText(e,n,r,i){return""===r&&0===n||"\t"===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 nr(){return lo(new er)}function rr(t){return t instanceof er}class ir{constructor(t,e,n){this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){if(this.key===t.key)return this.offsett&&(r=t)}else if(!hi(e)){const t=e.getNextSibling();if(Zn(t))n=t.__key,r=0,i="text";else{const t=e.getParent();t&&(n=t.__key,r=e.getIndexWithinParent()+1)}}t.set(n,r,i)}function lr(t,e){if(hi(e)){const n=e.getLastDescendant();hi(n)||Zn(n)?or(t,n):or(t,e)}else or(t,e)}class cr{constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!fr(t))return!1;const e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every((t=>n.has(t)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new cr(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const e=this.getNodes(),n=e.length,r=e[n-1];let i;if(Zn(r))i=r.select();else{const t=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(t,t)}i.insertNodes(t);for(let t=0;t1;){const t=e[e.length-1];if(!hi(t)||s.has(t)||t.isEmpty()||i.has(t))break;e.pop()}if(0===e.length&&t.isCollapsed()){const n=Tl(t.anchor),r=Tl(t.anchor.getFlipped()),i=t=>$o(t)?t.origin:t.getNodeAtCaret(),s=i(n)||i(r)||(t.anchor.getNodeAtCaret()?n.origin:r.origin);e.push(s)}return e}(wl(xl(this),"next"));return Vr()||(this._cachedNodes=e),e}setTextNodeRange(t,e,n,r){this.anchor.set(t.__key,e,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){const t=this.getNodes();if(0===t.length)return"";const e=t[0],n=t[t.length-1],r=this.anchor,i=this.focus,s=r.isBefore(i),[o,l]=hr(this);let c="",a=!0;for(let u=0;u=0;t--){const e=s[t];if(e.is(d)||hi(e)&&e.isParentOf(d))break;e.isAttached()&&(!o.has(e)||e.is(i)?g||p.insertAfter(e,!1):e.remove())}if(!g){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(rs(d))if(c===h)d.select();else{const t=Qn(e);t.select(),d.replace(t)}else d=d.spliceText(c,h-c,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e{n.forEach((n=>{if(hi(n)){const r=n.getFormatFlags(t,e);n.setTextFormat(r)}}))},s=r.length;if(0===s)return this.toggleFormat(t),hs(null),void i(e);const o=this.anchor,l=this.focus,c=this.isBackward(),a=c?l:o,u=c?o:l;let f=0,d=r[0],h="element"===a.type?0:a.offset;if("text"===a.type&&h===d.getTextContentSize()&&(f=1,d=r[1],h=0),null==d)return;const g=d.getFormatFlags(t,e);i(g);const _=s-1;let p=r[_];const y="text"===u.type?u.offset:p.getTextContentSize();if(d.is(p)){if(h===y)return;if(is(d)||0===h&&y===d.getTextContentSize())d.setFormat(g);else{const t=d.splitText(h,y),e=0===h?t[0]:t[1];e.setFormat(g),"text"===a.type&&a.set(e.__key,0,"text"),"text"===u.type&&u.set(e.__key,y-h,"text")}return void(this.format=g)}0===h||is(d)||([,d]=d.splitText(h),h=0),d.setFormat(g);const m=p.getFormatFlags(t,g);y>0&&(y===p.getTextContentSize()||is(p)||([p]=p.splitText(y)),p.setFormat(m));for(let e=f+1;e<_;e++){const n=r[e],i=n.getFormatFlags(t,m);n.setFormat(i)}"text"===a.type&&a.set(d.__key,h,"text"),"text"===u.type&&u.set(p.__key,y,"text"),this.format=g|m}insertNodes(e){if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const n=wr();return ar(n)||t(134),n.insertNodes(e)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=ko(n,vo),i=e[e.length-1];if(hi(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=Kr(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some((t=>(hi(t)||pi(t))&&!t.isInline()))){hi(r)||t(211,n.constructor.name,n.getType());const s=Kr(this);return r.splice(s,0,e),void i.selectEnd()}const s=function(t){const e=Fi();let n=null;for(let r=0;rc?c:l,e=l>c?l:c,n=s.splitText(t,e),r=0===t?n[0]:n[1];return null!=r?[r]:[]}return[s]}const a=r.isBefore(i);if(Zn(s)){const e=a?l:c;e===s.getTextContentSize()?t.shift():0!==e&&([,s]=s.splitText(e),t[0]=s)}if(Zn(o)){const e=o.getTextContent().length,r=a?c:l;0===r?t.pop():r!==e&&([o]=o.splitText(r),t[n]=o)}return t}modify(t,e,n){if(Br(this,t,e,n))return;const r="move"===t,i=Gr(),s=ho(no(i));if(!s)return;const o=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(null===l||null===o||!hi(c)||c.isInline()||c.canBeEmpty()||fo(o,i,l),this.dirty){let t=Hs(i,this.anchor.key),e=Hs(i,this.focus.key);"text"===this.anchor.type&&(t=ls(t)),"text"===this.focus.type&&(e=ls(e)),t&&e&&Dr(s,t,this.anchor.offset,e,this.focus.offset)}if(function(t,e,n,r){t.modify(e,n,r)}(s,t,e?"backward":"forward",n),s.rangeCount>0){const t=s.getRangeAt(0),n=this.anchor.getNode(),i=mi(n)?n:io(n);if(this.applyDOMRange(t),this.dirty=!0,!r){const n=this.getNodes(),r=[];let o=!1;for(let t=0;t0)if(e){const t=r[0];hi(t)?t.selectStart():t.getParentOrThrow().selectStart()}else{const t=r[r.length-1];hi(t)?t.selectEnd():t.getParentOrThrow().selectEnd()}s.anchorNode===t.startContainer&&s.anchorOffset===t.startOffset||function(t){const e=t.focus,n=t.anchor,r=n.key,i=n.offset,s=n.type;n.set(e.key,e.offset,e.type,!0),e.set(r,i,s,!0)}(this)}}"lineboundary"===n&&Br(this,t,e,n,"decorators")}forwardDeletion(t,e,n){if(!n&&("element"===t.type&&hi(e)&&t.offset===e.getChildrenSize()||"text"===t.type&&t.offset===e.getTextContentSize())){const t=e.getParent(),n=e.getNextSibling()||(null===t?null:t.getNextSibling());if(hi(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(t){const e=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let n=e.getNode();if(this.forwardDeletion(e,n,t))return;const r=ol(_l(e,t?"previous":"next"));if(r.getTextSlices().every((t=>null===t||0===t.distance))){let t={type:"initial"};for(const e of r.iterNodeCarets("shadowRoot"))if(Vo(e))if(e.origin.isInline());else{if(e.origin.isShadowRoot()){if("merge-block"===t.type)break;if(hi(r.anchor.origin)&&r.anchor.origin.isEmpty()){const t=Tl(e);ml(this,cl(t,t)),r.anchor.origin.remove()}return}"merge-next-block"!==t.type&&"merge-block"!==t.type||(t={block:t.block,caret:e,type:"merge-block"})}else{if("merge-block"===t.type)break;if(Uo(e)){if(hi(e.origin)){if(e.origin.isInline()){if(!e.origin.isParentOf(r.anchor.origin))break}else t={block:e.origin,type:"merge-next-block"};continue}if(pi(e.origin)){if(e.origin.isIsolated());else if("merge-next-block"===t.type&&(e.origin.isKeyboardSelectable()||!e.origin.isInline())&&hi(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const t=Tr();t.add(e.origin.getKey()),ks(t)}else e.origin.remove();return}break}}if("merge-block"===t.type){const{caret:e,block:n}=t;return ml(this,cl(!e.origin.isEmpty()&&n.isEmpty()?Cl(Go(n,e.direction)):r.anchor,e)),this.removeText()}}const i=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&0===e.offset&&gr(this,e.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===e.type?e.getNode():null,null!==r&&r.isSegmented()){const e=i.offset,s=r.getTextContentSize();if(r.is(n)||t&&e!==s||!t&&0!==e)return void pr(r,t,e)}else if(null!==n&&n.isSegmented()){const i=e.offset,s=n.getTextContentSize();if(n.is(r)||t&&0!==i||!t&&i!==s)return void pr(n,t,i)}!function(t,e){const n=t.anchor,r=t.focus,i=n.getNode(),s=r.getNode();if(i===s&&"text"===n.type&&"text"===r.type){const t=n.offset,s=r.offset,o=t{try{const t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch(t){}return()=>!1})();function pr(t,e,n){const r=t,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,l=0;for(let t=0;tn||r){i.splice(t,1),r&&(l=void 0);break}}const c=i.join("").trim();""===c?r.remove():(r.setTextContent(c),r.select(l,l))}function yr(e,n,r,i){let s,o=n;if(yo(e)){let l=!1;const c=e.childNodes,a=c.length,u=i._blockCursorElement;o===a&&(l=!0,o=a-1);let f=c[o],d=!1;if(f===u)f=c[o+1],d=!0;else if(null!==u){const t=u.parentNode;if(e===t){n>Array.prototype.indexOf.call(t.children,u)&&o--}}if(s=Ts(f),Zn(s))o=Qo(s,l?"next":"previous");else{let c=Ts(e);if(null===c)return null;if(hi(c)){const a=i.getElementByKey(c.getKey());null===a&&t(214);const u=c.getDOMSlot(a);[c,o]=u.resolveChildIndex(c,a,e,n),hi(c)||t(215),l&&o>=c.getChildrenSize()&&(o=Math.max(0,c.getChildrenSize()-1));let f=c.getChildAtIndex(o);if(hi(f)&&function(t,e,n){const r=t.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(f,0,r)){const t=l?f.getLastDescendant():f.getFirstDescendant();null===t?c=f:(f=t,c=hi(f)?f:f.getParentOrThrow()),o=0}Zn(f)?(s=f,c=null,o=Qo(f,l?"next":"previous")):f!==c&&l&&!d&&(hi(c)||t(216),o=Math.min(c.getChildrenSize(),o+1))}else{const t=c.getIndexWithinParent();o=0===n&&pi(c)&&Ts(e)===c?t:t+1,c=c.getParentOrThrow()}if(hi(c))return sr(c.__key,o,"element")}}else s=Ts(e);return Zn(s)?sr(s.__key,Qo(s,o,"clamp"),"text"):null}function mr(t,e,n){const r=t.offset,i=t.getNode();if(0===r){const r=i.getPreviousSibling(),s=i.getParent();if(e){if((n||!e)&&null===r&&hi(s)&&s.isInline()){const e=s.getPreviousSibling();Zn(e)&&t.set(e.__key,e.getTextContent().length,"text")}}else hi(r)&&!n&&r.isInline()?t.set(r.__key,r.getChildrenSize(),"element"):Zn(r)&&t.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),s=i.getParent();if(e&&hi(r)&&r.isInline())t.set(r.__key,0,"element");else if((n||e)&&null===r&&hi(s)&&s.isInline()&&!s.canInsertTextAfter()){const e=s.getNextSibling();Zn(e)&&t.set(e.__key,0,"text")}}}function xr(t,e,n){if("text"===t.type&&"text"===e.type){const r=t.isBefore(e),i=t.is(e);mr(t,r,i),mr(e,!r,i),i&&e.set(t.key,t.offset,t.type);const s=Gr();if(s.isComposing()&&s._compositionKey!==t.key&&ar(n)){const r=n.anchor,i=n.focus;t.set(r.key,r.offset,r.type,!0),e.set(i.key,i.offset,i.type,!0)}}}function Cr(t,e,n,r,i,s){if(null===t||null===n||!Zi(i,t,n))return null;const o=yr(t,e,ar(s)?s.anchor:null,i);if(null===o)return null;const l=yr(n,r,ar(s)?s.focus:null,i);if(null===l)return null;if("element"===o.type&&"element"===l.type){const e=Ts(t),r=Ts(n);if(pi(e)&&pi(r))return null}return xr(o,l,s),[o,l]}function Sr(t){return hi(t)&&!t.isInline()}function vr(t,e,n,r,i,s){const o=qr(),l=new ur(sr(t,e,i),sr(n,r,s),0,"");return l.dirty=!0,o._selection=l,l}function kr(){const t=sr("root",0,"element"),e=sr("root",0,"element");return new ur(t,e,0,"")}function Tr(){return new cr(new Set)}function Nr(t,e){return br(null,t,e,null)}function br(t,e,n,r){const i=n._window;if(null===i)return null;const s=r||i.event,o=s?s.type:void 0,l="selectionchange"===o,c=!X&&(l||"beforeinput"===o||"compositionstart"===o||"compositionend"===o||"click"===o&&s&&3===s.detail||"drop"===o||void 0===o);let a,u,f,d;if(ar(t)&&!c)return t.clone();if(null===e)return null;if(a=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&ar(t)&&!Zi(n,a,u))return t.clone();const h=Cr(a,f,u,d,n,t);if(null===h)return null;const[g,_]=h;return new ur(g,_,ar(t)?t.format:0,ar(t)?t.style:"")}function wr(){return qr()._selection}function Er(){return Gr()._editorState._selection}function Or(t,e,n,r=1){const i=t.anchor,s=t.focus,o=i.getNode(),l=s.getNode();if(!e.is(o)&&!e.is(l))return;const c=e.__key;if(t.isCollapsed()){const e=i.offset;if(n<=e&&r>0||n0||n0||n=t,o=i?s.getChildAtIndex(t-1):s.getChildAtIndex(n);if(Zn(o)){let t=0;i&&(t=o.getTextContentSize()),e.set(o.__key,t,"text"),r.set(o.__key,t,"text")}}else{if(hi(s)){const t=s.getChildrenSize(),r=n>=t,i=r?s.getChildAtIndex(t-1):s.getChildAtIndex(n);if(Zn(i)){let t=0;r&&(t=i.getTextContentSize()),e.set(i.__key,t,"text")}}if(hi(o)){const t=o.getChildrenSize(),e=i>=t,n=e?o.getChildAtIndex(t-1):o.getChildAtIndex(i);if(Zn(n)){let t=0;e&&(t=n.getTextContentSize()),r.set(n.__key,t,"text")}}}}function Ar(t,e,n,r,i){let s=null,o=0,l=null;null!==r?(s=r.__key,Zn(r)?(o=r.getTextContentSize(),l="text"):hi(r)&&(o=r.getChildrenSize(),l="element")):null!==i&&(s=i.__key,Zn(i)?l="text":hi(i)&&(l="element")),null!==s&&null!==l?t.set(s,o,l):(o=e.getIndexWithinParent(),-1===o&&(o=n.getChildrenSize()),t.set(n.__key,o,"element"))}function Pr(t,e,n,r,i){"text"===t.type?t.set(n,t.offset+(e?0:i),"text"):t.offset>r.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function Dr(t,e,n,r,i){try{t.setBaseAndExtent(e,n,r,i)}catch(t){}}function Fr(t,e,n,r,i,s,o){const l=r.anchorNode,c=r.focusNode,a=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has(wi)&&f!==s||null!==f&&Qi(f))return;if(!ar(e))return void(null!==t&&Zi(n,l,c)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,_=h.key,p=Hs(n,g),y=Hs(n,_),m=d.offset,x=h.offset,C=e.format,S=e.style,v=e.isCollapsed();let k=p,T=y,N=!1;if("text"===d.type){k=ls(p);const t=d.getNode();N=t.getFormat()!==C||t.getStyle()!==S}else ar(t)&&"text"===t.anchor.type&&(N=!0);var b,w,E,O,M;if(("text"===h.type&&(T=ls(y)),null!==k&&null!==T)&&(v&&(null===t||N||ar(t)&&(t.format!==C||t.style!==S))&&(b=C,w=S,E=m,O=g,M=performance.now(),gn=[b,w,E,O,M]),a!==m||u!==x||l!==k||c!==T||"Range"===r.type&&v||(null!==f&&s.contains(f)||s.focus({preventScroll:!0}),"element"===d.type))){if(Dr(r,k,m,T,x),!i.has(Oi)&&e.isCollapsed()&&null!==s&&s===document.activeElement){const t=ar(e)&&"element"===e.anchor.type?k.childNodes[m]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==t){let e;if(t instanceof Text){const n=document.createRange();n.selectNode(t),e=n.getBoundingClientRect()}else e=t.getBoundingClientRect();!function(t,e,n){const r=Gs(n),i=eo(r);if(null===r||null===i)return;let{top:s,bottom:o}=e,l=0,c=0,a=n;for(;null!==a;){const e=a===r.body;if(e)l=0,c=no(t).innerHeight;else{const t=a.getBoundingClientRect();l=t.top,c=t.bottom}let n=0;if(sc&&(n=o-c),0!==n)if(e)i.scrollBy(0,n);else{const t=a.scrollTop;a.scrollTop+=n;const e=a.scrollTop-t;s-=e,o-=e}if(e)break;a=qs(a)}}(n,e,s)}}ln=!0}}function Lr(t){let e=wr()||Er();null===e&&(e=Ss().selectEnd()),e.insertNodes(t)}function Ir(){const t=wr();return null===t?"":t.getTextContent()}function Kr(e){let n=e;e.isCollapsed()||n.removeText();const r=wr();ar(r)&&(n=r),ar(n)||t(161);const i=n.anchor;let s=i.getNode(),o=i.offset;for(;!vo(s);){const t=s;if([s,o]=zr(s,o),t.is(s))break}return o}function zr(t,e){const n=t.getParent();if(!n){const t=Fi();return Ss().append(t),t.select(),[Ss(),0]}if(Zn(t)){const r=t.splitText(e);if(0===r.length)return[n,t.getIndexWithinParent()];const i=0===e?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!hi(t)||0===e)return[n,t.getIndexWithinParent()];const r=t.getChildAtIndex(e);if(r){const n=new ur(sr(t.__key,e,"element"),sr(t.__key,e,"element"),0,""),i=t.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function Br(t,e,n,r,i="decorators-and-blocks"){if("move"===e&&"character"===r&&!t.isCollapsed()){const[e,r]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return r.set(e.key,e.offset,e.type),!0}const s=_l(t.focus,n?"previous":"next"),o="lineboundary"===r,l="move"===e;let c=s,a="decorators-and-blocks"===i;if(!Nl(c)){for(const t of c){a=!1;const{origin:e}=t;if(!pi(e)||e.isIsolated()||(c=t,!o||!e.isInline()))break}if(a)for(const t of ol(s).iterNodeCarets("extend"===e?"shadowRoot":"root")){if(Vo(t))t.origin.isInline()||(c=t);else{if(hi(t.origin))continue;pi(t.origin)&&!t.origin.isInline()&&(c=t)}break}}if(c===s)return!1;if(l&&!o&&pi(c.origin)&&c.origin.isKeyboardSelectable()){const t=Tr();return t.add(c.origin.getKey()),ks(t),!0}return c=Tl(c),l&&pl(t.anchor,c),pl(t.focus,c),a||!o}let Rr=null,Wr=null,Jr=!1,$r=!1,jr=0;const Ur={characterData:!0,childList:!0,subtree:!0};function Vr(){return Jr||null!==Rr&&Rr._readOnly}function Yr(){Jr&&t(13)}function Hr(){jr>99&&t(14)}function qr(){return null===Rr&&t(195,Xr()),Rr}function Gr(){return null===Wr&&t(196,Xr()),Wr}function Xr(){let t=0;const e=new Set,n=$i.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=ns(r);if(ts(i))t++;else if(i){let t=String(i.constructor.version||"<0.17.1");t===n&&(t+=" (separately built, likely a bundler configuration issue)"),e.add(t)}}let r=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Qr(){return Wr}function Zr(t,e,n){const r=e.__type,i=Hi(t,r);let s=n.get(r);void 0===s&&(s=Array.from(i.transforms),n.set(r,s));const o=s.length;for(let t=0;t0||u>0;){if(c>0){e._dirtyLeaves=new Set;for(const t of l){const r=i.get(t);Zn(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&kt(r),void 0!==r&&ti(r,s)&&Zr(e,r,o),n.add(t)}if(l=e._dirtyLeaves,c=l.size,c>0){jr++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map,a.delete("root")&&a.set("root",!0);for(const t of a){const n=t[0],l=t[1];if(r.set(n,l),!l)continue;const c=i.get(n);void 0!==c&&ti(c,s)&&Zr(e,c,o)}l=e._dirtyLeaves,c=l.size,a=e._dirtyElements,u=a.size,jr++}e._dirtyLeaves=n,e._dirtyElements=r}(a,e),li(e),function(t,e,n,r){const i=t._nodeMap,s=e._nodeMap,o=[];for(const[t]of r){const e=s.get(t);void 0!==e&&(e.isAttached()||(hi(e)&&q(e,t,i,s,o,r),i.has(t)||r.delete(t),o.push(t)))}for(const t of o)s.delete(t);for(const t of n){const e=s.get(t);void 0===e||e.isAttached()||(i.has(t)||n.delete(t),s.delete(t))}}(c,a,e._dirtyLeaves,e._dirtyElements));i!==e._compositionKey&&(a._flushSync=!0);const s=a._selection;if(ar(s)){const e=a._nodeMap,n=s.anchor.key,r=s.focus.key;void 0!==e.get(n)&&void 0!==e.get(r)||t(19)}else fr(s)&&0===s._nodes.size&&(a._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=c,e._dirtyType=x,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void si(e)}finally{Rr=f,Jr=d,Wr=h,e._updating=g,jr=0}const p=e._dirtyType!==y||e._deferred.length>0||function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(a,e);p?a._flushSync?(a._flushSync=!1,si(e)):u&&Gi((()=>{si(e)})):(a._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null))}function ai(t,e,n){Wr===t&&void 0===n?e():ci(t,e,n)}class ui{constructor(t,e,n){this.element=t,this.before=e||null,this.after=n||null}withBefore(t){return new ui(this.element,t,this.after)}withAfter(t){return new ui(this.element,this.before,t)}withElement(t){return this.element===t?this:new ui(t,this.before,this.after)}insertChild(e){const 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(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(null===t)this.removeManagedLineBreak();else{const e="decorator"===t&&(l||o);this.insertManagedLineBreak(e)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const e=this.element,n="IMG"===t.nodeName?t.nextSibling:null;n&&e.removeChild(n),e.removeChild(t),e.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const e=this.getManagedLineBreak();if(e){if(t===("IMG"===e.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=document.createElement("br");if(n.insertBefore(i,r),t){const t=document.createElement("img");t.setAttribute("data-lexical-linebreak","true"),t.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",t.alt="",n.insertBefore(t,i),n.__lexicalLineBreak=t}else n.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let e=this.after;null!==e;e=e.previousSibling)t++;return t}resolveChildIndex(t,e,n,r){if(n===this.element){const e=this.getFirstChildOffset();return[t,Math.min(e+t.getChildrenSize(),Math.max(e,r))]}const i=fi(e,n);i.push(r);const s=fi(e,this.element);let o=t.getIndexWithinParent();for(let t=0;tn){o+=1;break}}return[t.getParentOrThrow(),o]}}function fi(e,n){const r=[];let i=n;for(;i!==e&&null!==i;i=i.parentNode){let t=0;for(let e=i.previousSibling;null!==e;e=e.previousSibling)t++;r.push(t)}return i!==e&&t(225),r.reverse()}class di extends An{constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return j[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getChildrenKeys(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e.__key),e=e.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const t=Gr()._dirtyElements;return null!==t&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),e=this.getParentOrThrow().getLastChild();return null!==e&&e.is(t)}getAllTextNodes(){const t=[];let e=this.getFirstChild();for(;null!==e;){if(Zn(e)&&t.push(e),hi(e)){const n=e.getAllTextNodes();t.push(...n)}e=e.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;hi(t);){const e=t.getFirstChild();if(null===e)break;t=e}return t}getLastDescendant(){let t=this.getLastChild();for(;hi(t);){const e=t.getLastChild();if(null===e)break;t=e}return t}getDescendantByIndex(t){const e=this.getChildren(),n=e.length;if(t>=n){const t=e[n-1];return hi(t)&&t.getLastDescendant()||t||null}const r=e[t];return hi(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const t=this.getLatest().__first;return null===t?null:_s(t)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&t(45,this.__key),e}getLastChild(){const t=this.getLatest().__last;return null===t?null:_s(t)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&t(96,this.__key),e}getChildAtIndex(t){const e=this.getChildrenSize();let n,r;if(t=t;){if(r===t)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let t="";const e=this.getChildren(),n=e.length;for(let r=0;rt.remove())),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const e=this.getWritable();return e.__dir=t,e}setFormat(t){return this.getWritable().__format=""!==t?$[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const e=this.getWritable();return e.__textFormat=t,e}setTextStyle(t){const e=this.getWritable();return e.__textStyle=t,e}setIndent(t){return this.getWritable().__indent=t,this}splice(e,n,r){const i=r.length,s=this.getChildrenSize(),o=this.getWritable();e+n<=s||t(226,String(e),String(n),String(s));const l=o.__key,c=[],a=[],u=this.getChildAtIndex(e+n);let f=null,d=s-n+i;if(0!==e)if(e===s)f=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(f=t.getPreviousSibling())}if(n>0){let e=null===f?this.getFirstChild():f.getNextSibling();for(let r=0;r0&&(e.style.paddingInlineStart=40*t+"px");const n=this.getDirection();n&&(e.dir=n)}return{element:e}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},e=this.getTextFormat(),n=this.getTextStyle();return 0!==e&&(t.textFormat=e),""!==n&&(t.textStyle=n),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,e){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,e,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,e){const n=this.getDOMSlot(t);let r=n.getFirstChild();for(let t=this.getFirstChild();t;t=t.getNextSibling()){const i=e.getElementByKey(t.getKey());null!==i&&(null==r?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}}function hi(t){return t instanceof di}function gi(t,e,n){let r=t.getNode();for(;r;){const t=r.__key;if(e.has(t)&&!n.has(t))return!0;r=r.getParent()}return!1}class _i extends An{decorate(e,n){t(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function pi(t){return t instanceof _i}class yi extends di{static getType(){return"root"}static clone(){return new yi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){t(51)}getTextContent(){const t=this.__cachedText;return!Vr()&&Gr()._dirtyType!==y||null===t?super.getTextContent():t}remove(){t(52)}replace(e){t(53)}insertBefore(e){t(54)}insertAfter(e){t(55)}updateDOM(t,e){return!1}splice(e,n,r){for(const e of r)hi(e)||pi(e)||t(282);return super.splice(e,n,r)}static importJSON(t){return Ss().updateFromJSON(t)}collapseAtStart(){return!0}}function mi(t){return t instanceof yi}function xi(t){return new vi(new Map(t._nodeMap))}function Ci(){return new vi(new Map([["root",new yi]]))}function Si(e){const n=e.exportJSON(),r=e.constructor;if(n.type!==r.getType()&&t(130,r.name),hi(e)){const i=n.children;Array.isArray(i)||t(59,r.name);const s=e.getChildren();for(let t=0;t({root:Si(Ss())})))}}const ki="historic",Ti="history-push",Ni="history-merge",bi="paste",wi="collaboration",Ei="skip-collab",Oi="skip-scroll-into-view",Mi="skip-dom-selection";class Ai extends di{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Pi extends di{static getType(){return"paragraph"}static clone(t){return new Pi(t.__key)}createDOM(t){const e=document.createElement("p"),n=Rs(t.theme,"paragraph");if(void 0!==n){e.classList.add(...n)}return e}updateDOM(t,e,n){return!1}static importDOM(){return{p:t=>({conversion:Di,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(yo(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t)}return{element:e}}static importJSON(t){return Fi().updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(t,e){const n=Fi();n.setTextFormat(t.format),n.setTextStyle(t.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,e),n}collapseAtStart(){const t=this.getChildren();if(0===t.length||Zn(t[0])&&""===t[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Di(t){const e=Fi();return t.style&&(e.setFormat(t.style.textAlign),Oo(t,e)),{node:e}}function Fi(){return lo(new Pi)}function Li(t){return t instanceof Pi}const Ii=0,Ki=1,zi=2,Bi=3,Ri=4;function Wi(t,e,n,r){const i=t._keyToDOMMap;i.clear(),t._editorState=Ci(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=y,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null;const s=t._observer;null!==s&&(s.disconnect(),t._observer=null),null!==e&&(e.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function Ji(t){const e=t||{},n=Qr(),r=e.theme||{},i=void 0===t?n:e.parentEditor||null,s=e.disableEvents||!1,o=Ci(),l=e.namespace||(null!==i?i._config.namespace:ws()),c=e.editorState,a=[yi,$n,Pn,er,Pi,Ai,...e.nodes||[]],{onError:u,html:f}=e,d=void 0===e.editable||e.editable;let h;if(void 0===t&&null!==n)h=n._nodes;else{h=new Map;for(let t=0;t{Object.keys(t).forEach((e=>{let r=n.get(e);void 0===r&&(r=[],n.set(e,r)),r.push(t[e])}))};return t.forEach((t=>{const e=t.klass.importDOM;if(null==e||r.has(e))return;r.add(e);const n=e.call(t.klass);null!==n&&i(n)})),e&&i(e),n}(h,f?f.import:void 0),d,t);return void 0!==c&&(g._pendingEditorState=c,g._dirtyType=x),g}class $i{constructor(t,e,n,r,i,s,o,l){this._createEditorArgs=l,this._parentEditor=e,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=y,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=ws(),this._onError=i,this._htmlConversions=s,this._editable=o,this._headless=null!==e&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(t){const e=this._listeners.update;return e.add(t),()=>{e.delete(t)}}registerEditableListener(t){const e=this._listeners.editable;return e.add(t),()=>{e.delete(t)}}registerDecoratorListener(t){const e=this._listeners.decorator;return e.add(t),()=>{e.delete(t)}}registerTextContentListener(t){const e=this._listeners.textcontent;return e.add(t),()=>{e.delete(t)}}registerRootListener(t){const e=this._listeners.root;return t(this._rootElement,null),e.add(t),()=>{t(null,this._rootElement),e.delete(t)}}registerCommand(e,n,r){void 0===r&&t(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=i.get(e);void 0===s&&t(36,String(e));const o=s[r];return o.add(n),()=>{o.delete(n),s.every((t=>0===t.size))&&i.delete(e)}}registerMutationListener(t,e,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(e);void 0===s&&(s=new Set,i.set(e,s)),s.add(r);const o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(e,r),()=>{s.delete(r),0===s.size&&i.delete(e)}}getRegisteredNode(e){const n=this._nodes.get(e.getType());return void 0===n&&t(37,e.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){const n=this._editorState,r=wo(n).get(e.getType());if(!r)return;const i=new Map;for(const t of r.keys())i.set(t,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){const n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){const n=this.registerNodeTransformToKlass(t,e),r=[n],i=n.replaceWithKlass;if(null!=i){const t=this.registerNodeTransformToKlass(i,e);r.push(t)}return function(t,e){const n=wo(t.getEditorState()),r=[];for(const t of e){const e=n.get(t);e&&r.push(e)}if(0===r.length)return;t.update((()=>{for(const t of r)for(const e of t.keys()){const t=_s(e);t&&t.markDirty()}}),null===t._pendingEditorState?{tag:Ni}:void 0)}(this,r.map((t=>t.klass.getType()))),()=>{r.forEach((t=>t.transforms.delete(e)))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return Vs(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const e=this._rootElement;if(t!==e){const n=Rs(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,Wi(this,e,t,r),null!==e&&(this._config.disableEvents||En(e),null!=n&&e.classList.remove(...n)),null!==t){const e=eo(t),r=t.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=e,this._dirtyType=x,ot(this),this._updateTags.add(Ni),si(this),this._config.disableEvents||function(t,e){const n=t.ownerDocument,r=on.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Tn),on.set(n,(r||0)+1),t.__lexicalEditor=e;const i=vn(t);for(let n=0;n{bn(t)||(Nn(t),(e.isEditable()||"click"===r)&&s(t,e))}:t=>{if(bn(t))return;Nn(t);const n=e.isEditable();switch(r){case"cut":return n&&Vs(e,$e,t);case"copy":return Vs(e,Je,t);case"paste":return n&&Vs(e,ge,t);case"dragstart":return n&&Vs(e,Be,t);case"dragover":return n&&Vs(e,Re,t);case"dragend":return n&&Vs(e,We,t);case"focus":return n&&Vs(e,qe,t);case"blur":return n&&Vs(e,Ge,t);case"drop":return n&&Vs(e,Ke,t)}};t.addEventListener(r,o),i.push((()=>{t.removeEventListener(r,o)}))}}(t,this),null!=n&&t.classList.add(...n)}else this._window=null,this._updateTags.add(Ni),si(this);oi("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&t(38);let r=e;r._readOnly&&(r=xi(e),r._selection=e._selection?e._selection.clone():null),st(this);const i=this._pendingEditorState,s=this._updateTags,o=void 0!==n?n.tag:null;null===i||i.isEmpty()||(null!=o&&s.add(o),si(this)),this._pendingEditorState=r,this._dirtyType=x,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&s.add(o),this._updating||si(this)}parseEditorState(t,e){return function(t,e,n){const r=Ci(),i=Rr,s=Jr,o=Wr,l=e._dirtyElements,c=e._dirtyLeaves,a=e._cloneNotNeeded,u=e._dirtyType;e._dirtyElements=new Map,e._dirtyLeaves=new Set,e._cloneNotNeeded=new Set,e._dirtyType=0,Rr=r,Jr=!1,Wr=e,Ui(null);try{const i=e._nodes;ri(t.root,i),n&&n(),r._readOnly=!0}catch(t){t instanceof Error&&e._onError(t)}finally{e._dirtyElements=l,e._dirtyLeaves=c,e._cloneNotNeeded=a,e._dirtyType=u,Rr=i,Jr=s,Wr=o}return r}("string"==typeof t?JSON.parse(t):t,this,e)}read(t){return si(this),this.getEditorState().read(t,{editor:this})}update(t,e){!function(t,e,n){t._updating?t._updates.push([e,n]):ci(t,e,n)}(this,t,e)}focus(t,e={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),ai(this,(()=>{const r=wr(),i=Ss();null!==r?r.dirty||ks(r.clone()):0!==i.getChildrenSize()&&("rootStart"===e.defaultSelection?i.selectStart():i.selectEnd()),Qs("focus"),Zs((()=>{n.removeAttribute("autocapitalize"),t&&t()}))})),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;null!==t&&t.blur();const e=ho(this._window);null!==e&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,oi("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}$i.version="0.35.0+prod.esm";let ji=null;function Ui(t){ji=t}let Vi=1;function Yi(){Vi=1}function Hi(e,n){const r=qi(e,n);return void 0===r&&t(30,n),r}function qi(t,e){return t._nodes.get(e)}const Gi="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)};function Xi(t){return pi(ms(t))}function Qi(t){const e=document.activeElement;if(!yo(e))return!1;const n=e.nodeName;return pi(ms(t))&&("INPUT"===n||"TEXTAREA"===n||"true"===e.contentEditable&&null==ns(e))}function Zi(t,e,n){const r=t.getRootElement();try{return null!==r&&r.contains(e)&&r.contains(n)&&null!==e&&!Qi(e)&&es(e)===t}catch(t){return!1}}function ts(t){return t instanceof $i}function es(t){let e=t;for(;null!=e;){const t=ns(e);if(ts(t))return t;e=qs(e)}return null}function ns(t){return t?t.__lexicalEditor:null}function rs(t){return rr(t)||t.isToken()}function is(t){return rs(t)||t.isSegmented()}function ss(t){return mo(t)&&t.nodeType===g}function os(t){return mo(t)&&t.nodeType===_}function ls(t){let e=t;for(;null!=e;){if(ss(e))return e;e=e.firstChild}return null}function cs(t,e,n){const r=W[e];if(null!==n&&(t&r)==(n&r))return t;let i=t^r;return"subscript"===e?i&=~W.superscript:"superscript"===e?i&=~W.subscript:"lowercase"===e?(i&=~W.uppercase,i&=~W.capitalize):"uppercase"===e?(i&=~W.lowercase,i&=~W.capitalize):"capitalize"===e&&(i&=~W.lowercase,i&=~W.uppercase),i}function as(t){return Zn(t)||Ln(t)||pi(t)}function us(t,e){const n=function(){const t=ji;return ji=null,t}();if(null!=(e=e||n&&n.__key))return void(t.__key=e);Yr(),Hr();const r=Gr(),i=qr(),s=""+Vi++;i._nodeMap.set(s,t),hi(t)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=m,t.__key=s}function fs(t){const e=t.getParent();if(null!==e){const n=t.getWritable(),r=e.getWritable(),i=t.getPreviousSibling(),s=t.getNextSibling(),o=null!==s?s.__key:null,l=null!==i?i.__key:null,c=null!==i?i.getWritable():null,a=null!==s?s.getWritable():null;null===i&&(r.__first=o),null===s&&(r.__last=l),null!==c&&(c.__next=o),null!==a&&(a.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function ds(t){Hr();const e=t.getLatest(),n=e.__parent,r=qr(),i=Gr(),s=r._nodeMap,o=i._dirtyElements;null!==n&&function(t,e,n){let r=t;for(;null!==r;){if(n.has(r))return;const t=e.get(r);if(void 0===t)break;n.set(r,!1),r=t.__parent}}(n,s,o);const l=e.__key;i._dirtyType=m,hi(t)?o.set(l,!0):i._dirtyLeaves.add(l)}function hs(t){Yr();const e=Gr(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,null!==n){const t=_s(n);null!==t&&t.getWritable()}if(null!==t){const e=_s(t);null!==e&&e.getWritable()}}}function gs(){if(Vr())return null;return Gr()._compositionKey}function _s(t,e){const n=(e||qr())._nodeMap.get(t);return void 0===n?null:n}function ps(t,e){const n=ys(t,Gr());return void 0!==n?_s(n,e):null}function ys(t,e){return t[`__lexicalKey_${e._key}`]}function ms(t,e){let n=t;for(;null!=n;){const t=ps(n,e);if(null!==t)return t;n=qs(n)}return null}function xs(t){const e=t._decorators,n=Object.assign({},e);return t._pendingDecorators=n,n}function Cs(t){return t.read((()=>Ss().getTextContent()))}function Ss(){return vs(qr())}function vs(t){return t._nodeMap.get("root")}function ks(t){Yr();const e=qr();null!==t&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function Ts(t){const e=Gr(),n=function(t,e){let n=t;for(;null!=n;){const t=ys(n,e);if(void 0!==t)return t;n=qs(n)}return null}(t,e);if(null===n){return t===e.getRootElement()?_s("root"):null}return _s(n)}function Ns(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function bs(t){const e=[];let n=t;for(;null!==n;)e.push(n),n=n._parentEditor;return e}function ws(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Es(t){return ss(t)?t.nodeValue:null}function Os(t,e,n){const r=ho(no(e));if(null===r)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(null!==i){let e=Es(i);const r=ms(i);if(null!==e&&Zn(r)){if(e===z&&n){const t=n.length;e=n,s=t,o=t}null!==e&&Ms(r,e,s,o,t)}}}function Ms(t,e,n,r,i){let s=t;if(s.isAttached()&&(i||!s.isDirty())){const c=s.isComposing();let a=e;(c||i)&&e[e.length-1]===z&&(a=e.slice(0,-1));const u=s.getTextContent();if(i||a!==u){if(""===a){if(hs(null),o||l||f)s.remove();else{const t=Gr();setTimeout((()=>{t.update((()=>{s.isAttached()&&s.remove()}))}),20)}return}const e=s.getParent(),i=Er(),u=s.getTextContentSize(),d=gs(),h=s.getKey();if(s.isToken()||null!==d&&h===d&&!c||ar(i)&&(null!==e&&!e.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===t.__key&&0===i.anchor.offset&&!s.canInsertTextBefore()&&!c||i.focus.key===t.__key&&i.focus.offset===u&&!s.canInsertTextAfter()&&!c))return void s.markDirty();const g=wr();if(!ar(g)||null===n||null===r)return void As(s,a,g);if(g.setTextNodeRange(s,n,s,r),s.isSegmented()){const t=Qn(s.getTextContent());s.replace(t),s=t}As(s,a,g)}}}function As(t,e,n){if(t.setTextContent(e),ar(n)){const e=t.getKey();for(const r of["anchor","focus"]){const i=n[r];"text"===i.type&&i.key===e&&(i.offset=Qo(t,i.offset,"clamp"))}}}function Ps(t,e,n){const r=e[n]||!1;return"any"===r||r===t[n]}function Ds(t,e){return Ps(t,e,"altKey")&&Ps(t,e,"ctrlKey")&&Ps(t,e,"shiftKey")&&Ps(t,e,"metaKey")}function Fs(t,e,n){return Ds(t,n)&&t.key.toLowerCase()===e.toLowerCase()}const Ls={ctrlKey:!r,metaKey:r},Is={altKey:r,ctrlKey:!r};function Ks(t){return"Backspace"===t.key}function zs(t){return Fs(t,"a",Ls)}function Bs(t){const e=Ss();if(ar(t)){const e=t.anchor,n=t.focus,r=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),Tt(t),t}{const t=e.select(0,e.getChildrenSize());return ks(Tt(t)),t}}function Rs(t,e){void 0===t.__lexicalClassNameCache&&(t.__lexicalClassNameCache={});const n=t.__lexicalClassNameCache,r=n[e];if(void 0!==r)return r;const i=t[e];if("string"==typeof i){const t=d(i);return n[e]=t,t}return i}function Ws(e,n,r,i,s){if(0===r.size)return;const o=i.__type,l=i.__key,c=n.get(o);void 0===c&&t(33,o);const a=c.klass;let u=e.get(a);void 0===u&&(u=new Map,e.set(a,u));const f=u.get(l),d="destroyed"===f&&"created"===s;(void 0===f||d)&&u.set(l,d?"updated":s)}function Js(t){const e=t.getType(),n=qr();if(n._readOnly){const t=wo(n).get(e);return t?Array.from(t.values()):[]}const r=n._nodeMap,i=[];for(const[,n]of r)n instanceof t&&n.__type===e&&n.isAttached()&&i.push(n);return i}function $s(t,e,n){const r=t.getParent();let i=n,s=t;return null!==r&&(e&&0===n?(i=s.getIndexWithinParent(),s=r):e||n!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function js(t,e){const n=t.offset;if("element"===t.type){return $s(t.getNode(),e,n)}{const r=t.getNode();if(e&&0===n||!e&&n===r.getTextContentSize()){const t=e?r.getPreviousSibling():r.getNextSibling();return null===t?$s(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):t}}return null}function Us(t){const e=no(t).event,n=e&&e.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Vs(t,e,n){return function(t,e,n){const r=bs(t);for(let i=4;i>=0;i--)for(let s=0;s{for(let e=0;e{const n=e.getParentOrThrow(),s=so(n),o=e!==r||s?oo(e):e;if(s)return hi(e)&&hi(o)||t(133),e.insertAfter(o),[e,o,o];{const[t,r,s]=i(n),l=e.getNextSiblings();return s.append(o,...l),[t,r,o]}},[s,o]=i(r);return[s,o]}function po(t){return yo(t)&&"A"===t.tagName}function yo(t){return mo(t)&&t.nodeType===h}function mo(t){return"object"==typeof t&&null!==t&&"nodeType"in t&&"number"==typeof t.nodeType}function xo(t){return mo(t)&&t.nodeType===p}function Co(t){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==t.nodeName.match(e)}function So(t){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==t.nodeName.match(e)}function vo(t){if(pi(t)&&!t.isInline())return!0;if(!hi(t)||so(t))return!1;const e=t.getFirstChild(),n=null===e||Ln(e)||Zn(e)||e.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&n}function ko(t,e){let n=t;for(;null!==n&&null!==n.getParent()&&!e(n);)n=n.getParentOrThrow();return e(n)?n:null}function To(){return Gr()}const No=new WeakMap,bo=new Map;function wo(e){if(!e._readOnly&&e.isEmpty())return bo;e._readOnly||t(192);let n=No.get(e);return n||(n=function(t){const e=new Map;for(const[n,r]of t._nodeMap){const t=r.__type;let i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)}return e}(e),No.set(e,n)),n}function Eo(t){const e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function Oo(t,e){const n=parseInt(t.style.paddingInlineStart,10)||0,r=Math.round(n/40);e.setIndent(r)}function Mo(t){t.__lexicalUnmanaged=!0}function Ao(t){return!0===t.__lexicalUnmanaged}function Po(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(t,e)&&t[e]!==An[e]}function Do(t){const e=H in t.prototype?t.prototype[H]():void 0,n=function(t){return t===_i||t===di||t===An}(t),r=!n&&Po(t,"getType")?t.getType():void 0;let i,s=r;if(e)if(r)i=e[r];else for(const[t,n]of Object.entries(e))s=t,i=n;if(!n&&s&&(Po(t,"getType")||(t.getType=()=>s),Po(t,"clone")||(t.clone=e=>(Ui(e),new t)),Po(t,"importJSON")||(t.importJSON=i&&i.$importJSON||(e=>(new t).updateFromJSON(e))),!Po(t,"importDOM")&&i)){const{importDOM:e}=i;e&&(t.importDOM=()=>e)}return{ownNodeConfig:i,ownNodeType:s}}function Fo(t){const e=To();Yr();return new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(t)).klass)}const Lo={next:"previous",previous:"next"};class Io{constructor(t){this.origin=t}[Symbol.iterator](){return al({hasNext:Uo,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Go(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Go(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,e){const n=this.getNodeAtCaret();return t.is(this.origin)||t.is(n)||(null===n?this.insert(t):n.replace(t,e)),this}splice(e,n,r="next"){const i=r===this.direction?n:Array.from(n).reverse();let s=this;const o=this.getParentAtCaret(),l=new Map;for(let t=s.getAdjacentCaret();null!==t&&l.size0){const n=s.getNodeAtCaret();if(n)if(l.delete(n.getKey()),l.delete(e.getKey()),n.is(e)||s.origin.is(e));else{const t=e.getParent();t&&t.is(o)&&e.remove(),n.replace(e)}else null===n&&t(263,Array.from(l).join(" "))}else s.insert(e);s=Go(e,this.direction)}for(const t of l.values())t.remove();return this}}class Ko extends Io{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:tl(t,this.direction)}getParentCaret(t="root"){return Go(Ro(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Bo(this.direction);return Go(this.getNodeAtCaret(),t)||tl(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Ko&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const zo={root:mi,shadowRoot:so};function Bo(t){return Lo[t]}function Ro(t,e="root"){return zo[e](t)?null:t}class Wo extends Io{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Go(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return hi(this.origin)?tl(this.origin,this.direction):null}getParentCaret(t="root"){return Go(Ro(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Bo(this.direction);return Go(this.getNodeAtCaret(),t)||tl(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Wo&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Wo||t instanceof Jo)&&this.direction===t.direction&&this.origin.is(t.origin)}}class Jo extends Io{type="text";constructor(t,e){super(t),this.offset=e}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Xo(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Go(Ro(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Xo(this.origin,Bo(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Jo&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Wo||t instanceof Jo)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Go(this.origin,this.direction)}}function $o(t){return t instanceof Jo}function jo(t){return t instanceof Io}function Uo(t){return t instanceof Wo}function Vo(t){return t instanceof Ko}const Yo={next:class extends Jo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Jo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Ho={next:class extends Wo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Wo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},qo={next:class extends Ko{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends Ko{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function Go(t,e){return t?new Ho[e](t):null}function Xo(t,e,n){return t?new Yo[e](t,Qo(t,n)):null}function Qo(t,e,n="error"){const r=t.getTextContentSize();let i="next"===e?r:"previous"===e?0:e;return(i<0||i>r)&&("clamp"!==n&&function(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);n.search=r.toString(),console.warn(`Minified Lexical warning #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(284,String(e),String(r),t.getKey()),i=i<0?0:r),i}function Zo(t,e){return new il(t,e)}function tl(t,e){return hi(t)?new qo[e](t):null}function el(t){return t&&t.getChildCaret()||t}function nl(t){return t&&el(t.getAdjacentCaret())}class rl{type="node-caret-range";constructor(t,e,n){this.anchor=t,this.focus=e,this.direction=n}getLatest(){const t=this.anchor.getLatest(),e=this.focus.getLatest();return t===this.anchor&&e===this.focus?this:new rl(t,e,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=t=>{const e=this[t].getLatest();return $o(e)?function(t,e){const{direction:n,origin:r}=t,i=Qo(r,"focus"===e?Bo(n):n);return Zo(t,i-t.offset)}(e,t):null},e=t("anchor"),n=t("focus");if(e&&n){const{caret:t}=e,{caret:r}=n;if(t.isSameNodeCaret(r))return[Zo(t,r.offset-t.offset),null]}return[e,n]}iterNodeCarets(t="root"){const e=$o(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=$o(n),i=e=>e.isSameNodeCaret(n)?null:nl(e)||e.getParentCaret(t);return al({hasNext:t=>null!==t&&!(r&&n.isSameNodeCaret(t)),initial:e.isSameNodeCaret(n)?null:i(e),map:t=>t,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class il{type="slice";constructor(t,e){this.caret=t,this.distance=e}getSliceIndices(){const{distance:t,caret:{offset:e}}=this,n=e+t;return n{let n;for(let r=c;rn.has(t.getKey())&&vo(t)));return u&&f?[u,f]:null}(f,d,a);if(h){const[t,e]=h;tl(t,"previous").splice(0,e.getChildren()),e.remove()}const g=[f,d,...l,...c].find(vl);if(g){return ll(bl(Tl(g),e.direction))}t(269,JSON.stringify(l.map((t=>t.origin.__key))))}function Tl(t){const e=function(t){let e=t;for(;Vo(e);){const t=nl(e);if(!Vo(t))break;e=t}return e}(t.getLatest()),{direction:n}=e;if(Zn(e.origin))return $o(e)?e:Xo(e.origin,n,n);const r=e.getAdjacentCaret();return Uo(r)&&Zn(r.origin)?Xo(r.origin,n,Bo(n)):e}function Nl(t){return $o(t)&&t.offset!==Qo(t.origin,t.direction)}function bl(t,e){return t.direction===e?t:t.getFlipped()}function wl(t,e){return t.direction===e?t:cl(bl(t.focus,e),bl(t.anchor,e))}function El(t,e,n){let r=tl(t,"next");for(let t=0;t0||n.canBeEmpty()&&i(n,"last"))&&s.insert(e(n).splice(0,0,r))}return s}export{Qs as $addUpdateTag,lo as $applyNodeReplacement,_l as $caretFromPoint,xl as $caretRangeFromSelection,Eo as $cloneWithProperties,ul as $comparePointCaretNext,oo as $copyNode,Fo as $create,Fn as $createLineBreakNode,Tr as $createNodeSelection,Fi as $createParagraphNode,sr as $createPoint,kr as $createRangeSelection,Nr as $createRangeSelectionFromDom,nr as $createTabNode,Qn as $createTextNode,ol as $extendCaretToRange,nl as $getAdjacentChildCaret,js as $getAdjacentNode,Ol as $getAdjacentSiblingOrParentSiblingCaret,bl as $getCaretInDirection,cl as $getCaretRange,wl as $getCaretRangeInDirection,hr as $getCharacterOffsets,tl as $getChildCaret,El as $getChildCaretAtIndex,el as $getChildCaretOrSelf,ll as $getCollapsedCaretRange,gl as $getCommonAncestor,fl as $getCommonAncestorResultBranchOrder,To as $getEditor,ms as $getNearestNodeFromDOMNode,io as $getNearestRootOrShadowRoot,_s as $getNodeByKey,ao as $getNodeByKeyOrThrow,Er as $getPreviousSelection,Ss as $getRoot,wr as $getSelection,Go as $getSiblingCaret,at as $getState,ut as $getStateChange,Ir as $getTextContent,Qo as $getTextNodeOffset,Xo as $getTextPointCaret,Zo as $getTextPointCaretSlice,gt as $getWritableNodeState,to as $hasAncestor,Xs as $hasUpdateTag,Lr as $insertNodes,Sr as $isBlockElementNode,Vo as $isChildCaret,pi as $isDecoratorNode,hi as $isElementNode,Nl as $isExtendableTextPointCaret,ro as $isInlineElementOrDecoratorNode,as as $isLeafNode,Ln as $isLineBreakNode,jo as $isNodeCaret,fr as $isNodeSelection,Li as $isParagraphNode,ar as $isRangeSelection,mi as $isRootNode,so as $isRootOrShadowRoot,Uo as $isSiblingCaret,rr as $isTabNode,Zn as $isTextNode,$o as $isTextPointCaret,sl as $isTextPointCaretSlice,is as $isTokenOrSegmented,rs as $isTokenOrTab,Js as $nodesOfType,Tl as $normalizeCaret,Tt as $normalizeSelection__EXPERIMENTAL,Zs as $onUpdate,ni as $parseSerializedNode,kl as $removeTextFromCaretRange,Cl as $rewindSiblingCaret,Bs as $selectAll,hs as $setCompositionKey,pl as $setPointFromCaret,ks as $setSelection,yl as $setSelectionFromCaretRange,ft as $setState,Pl as $splitAtPointCaretNext,_o as $splitNode,ml as $updateRangeSelectionFromCaretRange,Ai as ArtificialNode__DO_NOT_USE,Ge as BLUR_COMMAND,Ye as CAN_REDO_COMMAND,He as CAN_UNDO_COMMAND,Ue as CLEAR_EDITOR_COMMAND,Ve as CLEAR_HISTORY_COMMAND,ae as CLICK_COMMAND,wi as COLLABORATION_TAG,Ri as COMMAND_PRIORITY_CRITICAL,Ii as COMMAND_PRIORITY_EDITOR,Bi as COMMAND_PRIORITY_HIGH,Ki as COMMAND_PRIORITY_LOW,zi as COMMAND_PRIORITY_NORMAL,he as CONTROLLED_TEXT_INSERTION_COMMAND,Je as COPY_COMMAND,$e as CUT_COMMAND,ue as DELETE_CHARACTER_COMMAND,ye as DELETE_LINE_COMMAND,pe as DELETE_WORD_COMMAND,We as DRAGEND_COMMAND,Re as DRAGOVER_COMMAND,Be as DRAGSTART_COMMAND,Ke as DROP_COMMAND,_i as DecoratorNode,di as ElementNode,qe as FOCUS_COMMAND,ze as FORMAT_ELEMENT_COMMAND,me as FORMAT_TEXT_COMMAND,ki as HISTORIC_TAG,Ni as HISTORY_MERGE_TAG,Ti as HISTORY_PUSH_TAG,Le as INDENT_CONTENT_COMMAND,fe as INSERT_LINE_BREAK_COMMAND,de as INSERT_PARAGRAPH_COMMAND,Fe as INSERT_TAB_COMMAND,vo as INTERNAL_$isBlock,A as IS_ALL_FORMATTING,k as IS_BOLD,w as IS_CODE,M as IS_HIGHLIGHT,T as IS_ITALIC,N as IS_STRIKETHROUGH,E as IS_SUBSCRIPT,O as IS_SUPERSCRIPT,b as IS_UNDERLINE,we as KEY_ARROW_DOWN_COMMAND,Te as KEY_ARROW_LEFT_COMMAND,ve as KEY_ARROW_RIGHT_COMMAND,be as KEY_ARROW_UP_COMMAND,Me as KEY_BACKSPACE_COMMAND,Pe as KEY_DELETE_COMMAND,Se as KEY_DOWN_COMMAND,Ee as KEY_ENTER_COMMAND,Ae as KEY_ESCAPE_COMMAND,Xe as KEY_MODIFIER_COMMAND,Oe as KEY_SPACE_COMMAND,De as KEY_TAB_COMMAND,Pn as LineBreakNode,ke as MOVE_TO_END,Ne as MOVE_TO_START,Y as NODE_STATE_KEY,Ie as OUTDENT_CONTENT_COMMAND,ge as PASTE_COMMAND,bi as PASTE_TAG,Pi as ParagraphNode,Ce as REDO_COMMAND,_e as REMOVE_TEXT_COMMAND,yi as RootNode,le as SELECTION_CHANGE_COMMAND,ce as SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,je as SELECT_ALL_COMMAND,Ei as SKIP_COLLAB_TAG,Mi as SKIP_DOM_SELECTION_TAG,Oi as SKIP_SCROLL_INTO_VIEW_TAG,W as TEXT_TYPE_TO_FORMAT,er as TabNode,$n as TextNode,xe as UNDO_COMMAND,Mn as buildImportMap,oe as createCommand,Ji as createEditor,dt as createSharedNodeState,ct as createState,Bo as flipDirection,Gs as getDOMOwnerDocument,ho as getDOMSelection,go as getDOMSelectionFromTarget,ls as getDOMTextNode,ns as getEditorPropertyFromDOMNode,es as getNearestEditorFromDOMNode,qi as getRegisteredNode,Hi as getRegisteredNodeOrThrow,Do as getStaticNodeConfig,So as isBlockDomNode,Vr as isCurrentlyReadOnlyMode,os as isDOMDocumentNode,mo as isDOMNode,ss as isDOMTextNode,Ao as isDOMUnmanaged,xo as isDocumentFragment,Fs as isExactShortcutMatch,po as isHTMLAnchorElement,yo as isHTMLElement,Co as isInlineDomNode,ts as isLexicalEditor,Ds as isModifierMatch,Qi as isSelectionCapturedInDecoratorInput,Zi as isSelectionWithinEditor,al as makeStepwiseIterator,fs as removeFromParent,Yi as resetRandomKey,Mo as setDOMUnmanaged,Oo as setNodeIndentFromDOM};