PageSourceSearch

https://www.birminghamhotel.com.au/_next/static/chunks/d77a8c9c-127608e3e25f9a45.js

js birminghamhotel.com.au collected 2026-10-08 08:40:04 UTC 168,396 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5107],{81300:(e,t,n)=>{let i;function r(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);n.search=i.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}n.d(t,{$7r:()=>t2,$Mp:()=>u,$c$:()=>nY,$ey:()=>tS,$iu:()=>r3,A$M:()=>oz,A6j:()=>tO,A7V:()=>rj,AX0:()=>tA,AcB:()=>s7,AcJ:()=>lh,Ap3:()=>nV,Ave:()=>rQ,B1s:()=>sC,BtT:()=>sh,Bts:()=>s5,CHU:()=>ob,CMH:()=>oL,CaD:()=>eS,Chh:()=>ea,Cku:()=>iM,Cyw:()=>rz,DTJ:()=>sN,DzG:()=>p,ELr:()=>om,Ey8:()=>n8,FAd:()=>y,FEN:()=>ty,Fb2:()=>sd,FfB:()=>o3,FtC:()=>lt,FyW:()=>lW,GMe:()=>rT,GRK:()=>rJ,GYG:()=>an,GbW:()=>oE,GcU:()=>rc,Gew:()=>oS,H1t:()=>ly,H2A:()=>i5,HEf:()=>ar,HYn:()=>tX,Hkj:()=>or,Htb:()=>iN,Huu:()=>tL,I2H:()=>t3,I2P:()=>iv,I8X:()=>es,IA$:()=>oR,IR1:()=>tg,IWk:()=>oI,IgX:()=>C,IlV:()=>sq,IqF:()=>ok,J61:()=>x,JAT:()=>oy,JM3:()=>tM,J_T:()=>rG,JjG:()=>lg,JqA:()=>n$,K6z:()=>nn,K8K:()=>oY,KfJ:()=>t1,KiH:()=>sf,Kp7:()=>rK,LYZ:()=>lD,LZn:()=>M,L_P:()=>nF,MK6:()=>ih,MSq:()=>o2,MZu:()=>id,Mgk:()=>oW,MvL:()=>tu,NEy:()=>i7,NG9:()=>r4,NZv:()=>r9,NiT:()=>l1,Nwr:()=>ao,OBE:()=>iq,OCP:()=>o4,OQi:()=>nq,OSq:()=>oD,OXk:()=>tR,OpE:()=>sU,P6U:()=>sZ,PiT:()=>t$,Pl0:()=>lA,Q$N:()=>tz,Q2o:()=>rp,R18:()=>tE,R3g:()=>oF,RB3:()=>rX,RML:()=>lo,RTZ:()=>ik,RTo:()=>tI,Rb_:()=>lK,RpX:()=>tD,S1w:()=>iX,S3D:()=>m,SKc:()=>tZ,Sdt:()=>al,Sr4:()=>tH,Sz2:()=>sn,T40:()=>nj,T8n:()=>sY,TJt:()=>s6,TQ:()=>oT,TSH:()=>su,Tc1:()=>at,TeU:()=>v,TgX:()=>tJ,U5P:()=>o9,UDz:()=>tF,Uax:()=>rm,Uqh:()=>lF,V30:()=>tw,VSO:()=>tG,WKo:()=>rq,WWb:()=>t0,WgU:()=>l_,WhU:()=>nQ,WmC:()=>oH,WuB:()=>tp,XI_:()=>nG,XKQ:()=>tm,XOU:()=>sS,YPs:()=>lz,YW5:()=>tW,YYn:()=>t6,YwR:()=>h,ZB7:()=>ai,ZKf:()=>tN,_On:()=>oX,_jw:()=>i8,a9V:()=>oQ,aT4:()=>f,bM3:()=>tx,bMH:()=>nH,bSg:()=>lf,bbF:()=>tP,bqM:()=>o$,brn:()=>n0,c_R:()=>lR,cmH:()=>sH,d8p:()=>td,dCx:()=>o_,da8:()=>lp,dxY:()=>se,e1k:()=>os,eku:()=>iA,erb:()=>sQ,ev7:()=>ic,ex6:()=>sv,exV:()=>sT,fD3:()=>ls,fGB:()=>rP,fUS:()=>tj,ff4:()=>rI,fwY:()=>nJ,gCZ:()=>tK,guI:()=>ta,h8o:()=>ae,hVL:()=>iw,hVZ:()=>rR,haT:()=>rB,hdR:()=>le,hi0:()=>tv,hkE:()=>tb,hpJ:()=>sz,i0_:()=>o1,iaR:()=>oJ,ieJ:()=>lS,jG6:()=>l$,jGx:()=>S,jOv:()=>rO,jZM:()=>lc,jj2:()=>oM,k1Q:()=>lr,kBm:()=>nK,kFe:()=>ia,lJ7:()=>lu,lSZ:()=>r7,lue:()=>lI,mB:()=>tk,mB$:()=>lB,mWO:()=>s3,mYE:()=>i6,n0X:()=>nU,n1P:()=>l3,nAs:()=>oK,nYP:()=>oj,nsf:()=>lq,o4q:()=>T,oqR:()=>tf,p1W:()=>nt,pGK:()=>r8,pJU:()=>lY,pTq:()=>oN,pd8:()=>si,peL:()=>oA,phO:()=>sc,pz6:()=>d,q3P:()=>st,qxK:()=>o,rN:()=>s$,rUs:()=>iV,rdQ:()=>ll,riq:()=>tV,sM8:()=>k,sTu:()=>is,sWS:()=>s4,sby:()=>oV,scG:()=>lP,sik:()=>tU,sne:()=>nZ,t5V:()=>tQ,u5G:()=>tY,uTE:()=>iJ,urt:()=>eo,uwZ:()=>sX,v0B:()=>rU,v39:()=>oU,vAA:()=>oq,vJq:()=>iG,vU2:()=>sb,viC:()=>tT,w$Z:()=>tB,w3H:()=>o0,wH$:()=>rY,waI:()=>tC,wb_:()=>lC,wp6:()=>r0,xKE:()=>nX,xL4:()=>lZ,xQ8:()=>r1,xyu:()=>lm,y68:()=>iH,yRe:()=>ne,z8s:()=>i_});let o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,s=o&&"documentMode"in document?document.documentMode:null,a=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),u=o&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),f=!(!o||!("InputEvent"in window)||s)&&"getTargetRanges"in new window.InputEvent("input"),d=o&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1),c=o&&/Android/.test(navigator.userAgent),h=o&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!c,g=o&&/^(?=.*Chrome).*/i.test(navigator.userAgent),_=o&&c&&g,p=o&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&a&&!g,y=1,m=2,x=4,C=8,S=16,v=32,T=64,k=128,b=h||d||p?"\xa0":"​",N=u?"\xa0":b,w="֑-߿יִ-﷽ﹰ-ﻼ",E="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",M=(RegExp("^[^"+E+"]*["+w+"]"),RegExp("^[^"+w+"]*["+E+"]"),{bold:1,capitalize:1024,code:16,highlight:k,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512}),O={directionless:1,unmergeable:2},A={center:2,end:6,justify:4,left:1,right:3,start:5},D={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},F={normal:0,segmented:2,token:1},P={0:"normal",2:"segmented",1:"token"},I=Symbol.for("@lexical/ctrlOrOtherKey"),L="$config";function K(){return o1()._blockCursorElement}function z(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-slot")}let B=p||d||h;function R(){let e=oz().createElement("img");for(let[t,n]of(e.setAttribute("data-lexical-decorator-boundary","true"),e.alt="",[["position","absolute"],["width","0px"],["height","0px"],["border","0px"],["margin","0px"],["padding","0p
1x"]]))e.style.setProperty(t,n,"important");return e}function W(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-decorator-boundary")}class ${element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new $(this.element,e,this.after)}withAfter(e){return new $(this.element,this.before,e)}withElement(e){return this.element===e?this:new $(e,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return null!==t&&t.parentElement!==this.element&&r(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&r(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&r(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&0===n?"before":"after";let i=U(e,this.element);if(null===i)return"after";let r=Array.prototype.indexOf.call(e.childNodes,i);if(r<0)return"after";if(t===e)return n<=r?"before":"after";let l=U(e,t);if(null===l)return"after";let o=Array.prototype.indexOf.call(e.childNodes,l);return o>=0&&o<=r?"before":"after"}getInsertionAnchor(){return this.before}}function U(e,t){let n=t;for(;null!==n&&n.parentNode!==e;)n=n.parentNode;return n}class H extends ${withBefore(e){return new H(this.element,e,this.after)}withAfter(e){return new H(this.element,this.before,e)}withElement(e){return this.element===e?this:new H(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor("trailing")}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;z(t);)e=t,t=t.nextSibling;W(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return null!==n&&n===K()?n:e}getDecoratorBoundaryAnchor(e){let t;if("leading"===e){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;z(t);)t=t.nextSibling}else null!==(t=this.before?this.before.previousSibling:this.element.lastChild)&&t===K()&&(t=t.previousSibling);return W(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(null!==n))if(null!==n)this.element.removeChild(n);else if("leading"===e){let e=this.getFirstChildAnchor();this.element.insertBefore(R(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(R(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=null===this.after?t.firstChild:this.after.nextSibling,i="empty"===e&&z(n)?null:e;t.__lexicalLastChildKind!==i&&((t.__lexicalLastChildKind=i,null===i)?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===i&&B))}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}let n=this.element,i=this.before||this.getDecoratorBoundaryAnchor("trailing"),r=oz().createElement("br");if(r.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(r,i),e){let e=oz().createElement("img");e.setAttribute("data-lexical-managed-linebreak","true"),e.style.setProperty("display","inline","important"),e.style.setProperty("border","0px","important"),e.style.setProperty("margin","0px","important"),e.alt="",n.insertBefore(e,r),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=r}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let i=this.element.firstChild;null!==i&&i!==e&&i!==t;i=i.nextSibling)n++;return n}resolveChildIndex(e,t,n,i){if(n===this.element){let t=this.getFirstChildOffset(),n=K(),r=this.element.childNodes,l=Math.min(i,r.length),o=0;for(let e=t;e<l;e++)r[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let r=j(t,n);r.push(i);let l=j(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<l.length;e++){let t=r[e],n=l[e];
1if(void 0===t||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}}function j(e,t){let n=[],i=t;for(;i!==e&&null!==i;i=i.parentNode){let e=0;for(let t=i.previousSibling;null!==t;t=t.previousSibling)e++;n.push(e)}return i!==e&&r(225),n.reverse()}try{i="0.50.0+prod.esm"}catch(e){}let J=i??'"<unknown>+source"';class V{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}function q(e,t=1e3){return e instanceof Y?e.clone():e.size<t?new Map(e):(new Y).init(new Map(e),void 0,e.size)}class Y{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,(new Y).init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return void 0!==this.get(e)}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return void 0!==t?t:this._old&&this._old.get(e)}get(e){let t=this.getWithTombstone(e);return null===t?void 0:t}shouldCompact(){return void 0!==this._nursery&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)null!==n?e.set(t,n):e.delete(t);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let i=this.getNursery();return null!=n||(this._size++,null===n&&i.delete(e)),i.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,null),this._size--),t}getOrInsert(e,t){let n=this.get(e);return void 0!==n?n:(this.set(e,t),t)}getOrInsertComputed(e,t){let n=this.get(e);if(void 0!==n)return n;let i=t(e);return this.set(e,i),i}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(t)for(let n of t){let t=n[0],i=e?e.get(t):void 0;null!==i&&(void 0!==i&&(n[1]=i),yield n)}if(e)for(let n of e)null===n[1]||t&&t.has(n[0])||(yield n)}forEach(e,t){for(let[n,i]of(void 0!==t&&(e=e.bind(t)),this.entries()))e(i,n,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function G(e,t,n,i,r,l){if(rI(e)){let o=e.getFirstChild();for(;null!==o;){let e=o.__key;o.__parent===t&&((rI(o)||sy(o)&&null!==o.__slots)&&G(o,e,n,i,r,l),n.has(e)||l.delete(e),r.push(e)),o=o.getNextSibling()}}for(let o of sy(e)&&null!==e.__slots?e.__slots.values():[]){let e=i.get(o);void 0!==e&&sm(e)&&e.__slotHost===t&&((rI(e)||sy(e)&&null!==e.__slots)&&G(e,o,n,i,r,l),n.has(o)||l.delete(o),r.push(o))}}let X=!1,Z=0;function Q(e){Z=e.timeStamp}function ee(e,t,n){let i="BR"===e.nodeName,r=t.__lexicalLineBreak;return r&&(e===r||i&&e.previousSibling===r)||i&&void 0!==lX(e,n)}function et(e,t,n){X=!0;let i=performance.now()-Z>100;try{rD(e,()=>{let r=iG()||e.read("latest",()=>{let e=iG();return null!==e?e.clone():null}),l=new Map,o=e._editorState,s=e._blockCursorElement,a=!1,f="";for(let n=0;n<t.length;n++){let d=t[n],c=d.type,h=d.target,g=function(e,t,n){for(let i=e;i&&!sr(i);i=o_(i)){let e=lX(i,t);if(void 0!==e){let t=lq(e,n);if(t)return rz(t)||!oV(i)?void 0:[i,t]}}}(h,e,o);if(!g)continue;let[_,p]=g;if("characterData"===c)i&&ia(p)&&lz(h)&&function(e,t,n){if(iv(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return lz(t)&&n.isAttached()}(r,h,p)&&function(e,t,n){let i=oA(oC(n)),r=i&&oW(i,n._rootElement),l=null,o=null;null!==r&&r.anchorNode===e&&(l=r.anchorOffset,o=r.focusOffset);let s=e.nodeValue;null!==s&&ot(t,s,l,o,!1)}(h,p,e);else if("childList"===c){a=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let i=t[n],r=lY(i),l=i.parentNode;if(!(null==l||i===s||null!==r||ee(i,l,e)||W(i)||e._slotsUsed&&oV(i)&&i.hasAttribute("data-lexical-slot")||sr(i))){if(u){let e=(oV(i)?i.innerText:null)||i.nodeValue;e&&(f+=e)}l.removeChild(i)}}let n=d.removedNodes,i=n.length;if(i>0){let t=0;for(let r=0;r<i;r++){let i=n[r];ee(i,h,e)||s===i?(h.appendChild(i),t++):W(i)&&t++}i!==t&&l.set(_,p)}}}if(l.size>0)for(let[t,n]of l)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],i=n.addedNodes,r=n.target;for(let t=0;t<i.length;t++){let n=i[t],l=n.parentNode;null==l||"BR"!==n.nodeName||ee(n,r,e)||l.removeChild(n)}}n.takeRecords()}null!==r&&(a&&l3(r),u&&oc(e)&&r.insertRawText(f))})}finally{X=!1}}function en(e){let t=e._observer;null!==t&&et(e,t.takeRecords(),t)}function ei(e){0===Z&&oC(e).addEventListener("textInput",Q,!0),e._observer=new MutationObserver((t,n)=>{et(e,t,n)})}let er="latest";class el{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||eg).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}}function eo(e,t){return new el(e,t)}function es(e,t,n=er){let i=(n===er?e.getLatest():e).__state;return i?i.getValue(t):t.defaultValue}function ea(e,t,n){let i;if(rh(),"function"==typeof n){let r=e.getLatest(),l=es(r,t);if(i=n(l),t.isEqual(l,i))return r}else i=n;let r=e.getWritable();return ed(r).updateFromKnown(t,i),r}let eu=new Set(["__proto__","constructor","prototype"]);class ef{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n,i=new Map,r){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=i;let{sharedConfigMap:l}=this.sharedNodeState,o=void 0!==r?r:function(e,t,n){let i=n.size;if(t)for(let r in t){let t=e.get(r);t&&n.has(t)||i++}return i}(l,n,i);this.size=o}getValue(e){let t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return eh(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:n}=this,i=new Map(this.knownState);return new ef(e,t,function(e,t,n){let i;if(n)for(let[r,l]of Object.entries(n)){if(eu.has(r))continue;let n=e.get(r);n?t.has(n)||t.set(n,n.parse(l)):(i=i||{})[r]=l}return i}(t.sharedConfigMap,i,n),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:i,unknownState:r}=this;i.has(e)||r&&n in r||(r&&(delete r[n],this.unknownState=eh(r)),this.size++),i.set(e,t)}updateFromUnknown(e,t){if(eu.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}}function ed(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new ef(t,ec(t));return t.__state=n,n}function ec(e){return e.__state?e.__state.sharedNodeState:lE(o1(),e.getType()).sharedNodeState}function eh(e){if(e)for(let t in e)return e}function eg(e){return e}function e_(e,t,n){for(let[i,r]of t.knownState){if(e.has(i.key))continue;e.add(i.key);let t=n?n.getValue(i):i.defaultValue;if(t!==r&&!i.isEqual(t,r))return!0}return!1}function ep(e,t,n){let{unknownState:i}=t,r=n?n.unknownState:void 0;if(i){for(let[t,n]of Object.entries(i))if(!e.has(t)&&(e.add(t),n!==(r?r[t]:void 0)))return!0}return!1}function ey(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function em(e,t){let n=e.__mode,i=e.__format,r=e.__style,l=t.__mode,o=t.__format,s=t.__style,a=e.__state,u=t.__state;return(null===n||n===l)&&(null===i||i===o)&&(null===r||r===s)&&(null===e.__state||a===u||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&e_(n,e,t)||t&&e_(n,t,e)||e&&ep(n,e,t)||t&&ep(n,t,e))}(a,u))}function ex(e,t){let n=e.mergeWithSibling(t),i=ry()._normalizedNodes;return i.add(e.__key),i.add(t.__key),n}function eC(e){let t,n,i=e;if(""!==i.__text||!i.isSimpleText()||i.isUnmergeable()){for(;null!==(t=i.getPreviousSibling())&&ia(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){em(t,i)&&(i=ex(t,i));break}t.remove()}for(;null!==(n=i.getNextSibling())&&ia(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){em(i,n)&&(i=ex(i,n));break}n.remove()}}else i.remove()}function eS(e){return ev(e.anchor),ev(e.focus),e}function ev(e){for(;"element"===e.type;){let t,n,i=e.getNode(),r=e.offset;if(r===i.getChildrenSize()?(t=i.getChildAtIndex(r-1),n=!0):(t=i.getChildAtIndex(r),n=!1),ia(t)){e.set(t.__key,n?t.getTextContentSize():0,"text",!0);break}if(!rI(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element",!0)}}let eT=Symbol.for("@lexical/CachedTextSize");function ek(e,t){return eR.read(()=>{let n=0,i=e;for(let e=0;e<t&&null!==i;e++){let l=eB.get(i);if(void 0===l&&r(345,i),rI(l)){let o=eW.get(i);if(void 0!==o&&rI(o)&&o.__parent!==l.__parent)n+=l.getTextContentSize();else{let e=e$.get(i),t=e&&e.__lexicalTextContent;"string"!=typeof t&&r(346,l.getType()),n+=t.length}e<t-1&&!l.isInline()&&(n+=2)}else{let e=l[eT];void 0===e&&r(347,l.getType(),i),n+=e}i=l.__next}return n},{editor:ew})}function eb(e){rI(e)||void 0===e[eT]&&(e[eT]=ia(e)?e.__text.length:e.getTextContentSize())}let eN,ew,eE,eM="",eO=null,eA=null,eD=null;function eF(){return{firstTextKey:eD,format:eO,style:eA}}function eP(e){null!==e.firstTextKey&&(eO=e.format,eA=e.style,eD=e.firstTextKey)}function eI(e){if(null!==eD)return;let t=e.__lexicalFirstTextKey;if(void 0===t&&r(348),null===t)return;let n=eW.get(t);ia(n)&&(eO=n.getFormat(),eA=n.getStyle(),eD=t)}let eL,eK,ez,eB,eR,eW,e$,eU,eH,ej,eJ=!1,eV=!1;function eq(e,t){let n=eB.get(e),i=eW.has(e);if(null!==t){let n=ts(e);n.parentNode===t&&t.removeChild(n)}if(!i){if(ew._keyToDOMMap.delete(e),rI(n)){let e=sg(n,eB);eY(e,0,e.length-1,null)}if(void 0!==n){for(let e of e3(n).values()){let t=e6(e);eq(e,null),null!==t&&t.remove()}of(eH,eE,eL,n,"destroyed")}}}function eY(e,t,n,i){for(let r=t;r<=n;++r){let t=e[r];void 0!==t&&eq(t,i)}}function eG(e,t){e.setProperty("text-align",t)}function eX(e,t){let n=eN.theme.indent;if("string"==typeof n){let i=e.classList.contains(n);t>0&&!i?e.classList.add(n):t<1&&i&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * var(--lexical-indent-base-value, 40px))`),oa(e,"class"),oa(e,"style")}function eZ(e,t){let n=e.style;0===t?eG(n,""):1===t?eG(n,"left"):2===t?eG(n,"center"):3===t?eG(n,"right"):4===t?eG(n,"justify"):5===t?eG(n,"start"):6===t&&eG(n,"end"),oa(e,"style")}function eQ(e,t){let n=function(e){let t=e.__dir;if(null!==t)return t;if(rR(e))return null;let n=e.getParent();return null===n||ok(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function e0(e){let t=oz().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function e1(e,t,n){t||"false"===e.contentEditable?function(e,t=o1()){let n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}(n,ew):n.removeAttribute("contenteditable")}function e2(e,t,n){let i=eM,r=eF();eM="";let l="",o=rz(e);for(let[i,r]of n){let n=e0(i);e1(t,o,n),t.appendChild(n),eM="";let s=eF();e7(r,o3(e,n,ew)),eP(s),e4(e,i,t,n),l+=eM}return eP(r),eM=i,l}function e3(e){return sy(e)&&null!==e.__slots?e.__slots:sp}function e4(e,t,n,i){let r=ej.$getSlotTargetElement(e,t,n,ew);null!==r&&(i.parentElement!==r&&r.appendChild(i),i.style.display="")}function e6(e){let t=e$.get(e);return void 0!==t?t.parentElement:null}function e5(e,t,n){let i=e3(e),r=e3(t);for(let[e,t]of i)if(!r.has(e)){let e=e6(t);eq(t,null),null!==e&&e.remove()}let l=eM,o=eF(),s="",a=null,u=rz(t);for(let[e,l]of r){let r=i.get(e),o=void 0!==r?e6(r):null;eM="";let f=eF();if(null===o){o=e0(e);let i=null;for(let e of n.children)if(!e.hasAttribute("data-lexical-slot")){i=e;break}n.insertBefore(o,i),e7(l,o3(t,o,ew))}else r===l?ti(l,o):(void 0!==r&&eq(r,o),e7(l,o3(t,o,ew)));if(eP(f),e1(n,u,o),e4(t,e,n,o),s+=eM,o.parentElement===n){let e=null===a?n.firstChild:a.nextSibling;e!==o&&n.insertBefore(o,e),a=o}}return eP(o),eM=l,s}function e7(e,t){let n=eW.get(e);if(void 0===n&&r(60),null!==t){let i=eB.get(e);if(void 0!==i){let r=e$.get(e);if(void 0!==r){let l=sm(i)?i.__slotHost:null,o=sm(n)?n.__slotHost:null,s=i.__parent!==n.__parent||l!==o,a=null!==o&&r.parentElement!==t.element;if(s||a)return t.insertChild(r),ti(e,t.element)}}}let i=ej.$createDOM(n,ew);if(function(e,t,n){let i=n._keyToDOMMap;lG(t,n,e),i.set(e,t)}(e,i,ew),ia(n)?i.setAttribute("data-lexical-text","true"):rz(n)&&(i.setAttribute("data-lexical-decorator","true"),si(i,{captureSelection:!0}
1)),rI(n)){let e=n.__indent,t=n.__size;eQ(i,n),0!==e&&eX(i,e);let r=e3(n),l=r.size>0?e2(n,i,r):"";if(0===t)i.__lexicalTextContent=l,i.__lexicalFirstTextKey=null,eM+=l,r.size>0&&(i.__lexicalSlotTextLength=l.length);else{let e=eM;if(e8(sg(n,eW),n,0,t-1,o3(n,i,ew)),""!==l){let t=i.__lexicalTextContent||"";i.__lexicalTextContent=l+t,eM=e+l+t}r.size>0&&(i.__lexicalSlotTextLength=l.length)}let o=n.__format;0!==o&&eZ(i,o),n.isInline()||(tt(null,n,i),te(n,i))}else{let t=n.getTextContent();if(rz(n)){let t=n.decorate(ew,eN);null!==t&&tr(e,t),i.contentEditable="false";let r=e3(n);r.size>0&&e2(n,i,r)}eM+=t}return null!==t&&t.insertChild(i),ej.$decorateDOM(n,null,i,ew),eb(n),of(eH,eE,eL,n,"created"),i}function e8(e,t,n,i,l){let o=eM,s=eF();eM="",eO=null,eA=null,eD=null;let a=n;for(;a<=i;++a){let t=eF();e7(e[a],l);let n=eW.get(e[a]);null!==n&&ia(n)?null===eO&&(eO=n.getFormat(),eA=n.getStyle(),eD=n.__key):rI(n)&&a<i&&!n.isInline()&&(eM+="\n\n"),eP(t)}let u=ew._keyToDOMMap.get(t.__key);void 0===u&&r(349,t.__key),u.__lexicalTextContent=eM,u.__lexicalFirstTextKey=eD,eM=o+eM,eP(s)}function e9(e,t){if(!e)return!1;let n=t.get(e);return rz(n)&&!n.isInline()}function te(e,t){let n=o3(e,t,ew);n.setDecoratorBoundaryAnchor("leading",e9(e.__first,eW)),n.setDecoratorBoundaryAnchor("trailing",e9(e.__last,eW))}function tt(e,t,n){let i=o3(t,n,ew),r=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return rY(e)?"line-break":rz(e)&&e.isInline()?"decorator":null}return"empty"}return null}(t,eW);i.setManagedLineBreak(r)}function tn(e,t,n){let i=t.__lexicalFirstTextKey;if(null!=i){let t=e.__key,r=i;for(;null!==r;){let e=eW.get(r);if(void 0===e){r=null;break}if(e.__parent===t)break;r=e.__parent}if(null!==r&&!n.has(r)){let e=eW.get(i);if(ia(e))return eO=e.getFormat(),void(eA=e.getStyle())}}t.__lexicalFirstTextKey=eD}function ti(e,t){let n=eB.get(e),i=eW.get(e);void 0!==n&&void 0!==i||r(61);let l=eJ||ez.has(e)||eK.has(e),o=og(ew,e);if(n===i&&!l){let e;if(rI(n)){let t=o.__lexicalTextContent;"string"!=typeof t&&r(355,n.getType()),e=t,eI(o)}else e=n.getTextContent();return eM+=e,o}if(n!==i&&l&&of(eH,eE,eL,i,"updated"),ej.$updateDOM(i,n,o,ew)){let n=e7(e,null);return null===t&&r(62),t.replaceChild(n,o),eq(e,null),n}if(rI(n)){rI(i)||r(334,e);let t=i.__indent;(eJ||t!==n.__indent)&&eX(o,t);let s=i.__format;(eJ||s!==n.__format)&&eZ(o,s);let a=l&&(e3(i).size>0||e3(n).size>0)?e5(n,i,o):"";if(l){let e=eM;if(function(e,t,n){eO=null,eA=null,eD=null,function(e,t,n){let i=eM,l=e.__size,o=t.__size;eM="";let s=n.element,a=ew._keyToDOMMap.get(t.__key);void 0===a&&r(351,t.__key);let u=o-l;if(!eJ&&1>=Math.abs(u)&&l>=4&&e.__first===t.__first&&(0!==u||!ew._cloneNotNeeded.has(e.__key))){let l=a.__lexicalTextContent,f=eU.get(e.__key);if(!eJ&&"string"==typeof l&&void 0!==f){let o=function(e,t){let n=t.size;if(0===n||n>=e.__size)return null;let i=e.__last,r=null,l=0;for(;null!==i&&l<n;){if(!t.has(i))return null;r=i;let e=eW.get(i);if(void 0===e)return null;i=e.__prev,l++}return l!==n||null!==i&&t.has(i)?null:r}(t,f);if(null!==o){let d=f.size;if(0===u){let e=ek(o,d),n=o,u=0;for(;null!==n&&u<d;){let e=eW.get(n);if(void 0===e)break;let t=eF();ti(n,s),ia(e)&&null===eO&&(eO=e.getFormat(),eA=e.getStyle(),eD=e.__key),eP(t),n=e.__next,u++}let c="";for(n=o,u=0;null!==n&&u<d;){let e,t=eW.get(n);if(void 0===t)break;if(rI(t)){let i=ew._keyToDOMMap.get(n),l=i&&i.__lexicalTextContent;"string"!=typeof l&&r(352,t.getType()),e=l}else e=t.getTextContent();c+=e,u<d-1&&rI(t)&&!t.isInline()&&(c+="\n\n"),n=t.__next,u++}let h=a.__lexicalSlotTextLength||0,g=h>0?l.slice(h):l,_=g.slice(0,g.length-e)+c;return a.__lexicalTextContent=_,eM=i+_,tn(t,a,f)}if(function(e,t,n,i,l,o,s,a){if(1!==a&&-1!==a||s!==(1===a?2:1))return!1;let u=s-a,f=e.__last;for(let e=0;e<u-1;e++){if(null===f)return!1;let e=eB.get(f);if(void 0===e)return!1;f=e.__prev}if(null===f)return!1;let d=eW.get(o),c=eB.get(f);if(void 0===d||void 0===c||d.__prev!==c.__prev)return!1;let h=[],g=o;for(let e=0;e<s;e++){if(null===g)return!1;h.push(g);let e=eW.get(g);g=e?e.__next:null}let _=[];g=f;for(let e=0;e<u;e++){if(null===g)return!1;_.push(g);let e=eB.get(g);g=e?e.__next:null}let p=new Set(_),y=new Set(h),m=[],x=0,C=0;for(;x<u&&C<s;)if(h[C]===_[x])m.push({key:h[C],kind:"reconcile"}),x++,C++;else if(y.has(_[x])){if(p.has(h[C]))return!1;m.push({key:h[C],kind:"create",nextIndex:C}),C++}else m.push({key:_[x],kind:"destroy"}),x++;for(;x<u;)m.push({key:_[x++],kind:"destroy"});for(;C<s;)m.push({key:h[C],kind:"create",nextIndex:C}),C++;let S=ek(f,u);for(let e of m){let t=eF();if("reconcile"===e.kind)ti(e.key,n.element);else if("destroy"===e.kind)eq(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<s;n++){let e=ew._keyToDOMMap.get(h[n]);if(void 0!==e){t=e;break}}e7(e.key,n.withBefore(t??n.before))}if("destroy"!==e.kind){let t=eW.get(e.key);t&&ia(t)&&null===eO&&(eO=t.getFormat(),eA=t.getStyle(),eD=t.__key)}eP(t)}let v="";for(let e=0;e<s;e++){let t,n=eW.get(h[e]);if(void 0===n)return!1;if(rI(n)){let i=ew._keyToDOMMap.get(h[e]),l=i&&i.__lexicalTextContent;"string"!=typeof l&&r(350,n.getType()),t=l}else t=n.getTextContent();v+=t,e<s-1&&rI(n)&&!n.isInline()&&(v+="\n\n")}let T=i.__lexicalSlotTextLength||0,k=T>0?l.slice(T):l;return i.__lexicalTextContent=k.slice(0,k.length-S)+v,!0}(e,0,n,a,l,o,d,u)){let e=a.__lexicalTextContent;return"string"!=typeof e&&r(353),eM=i+e,tn(t,a,f)}}}if(0===u){let t=e.__first,n=0;for(;null!==t;){let e=eW.get(t);if(void 0===e)break;let i=eJ||ez.has(t)||eK.has(t),l=eF();if(i)ti(t,s);else{let n,i;if(rI(e)){let l=(i=e$.get(t))&&i.__lexicalTextContent;"string"!=typeof l&&r(354,e.getType()),n=l}else n=e.getTextContent();eM+=n,void 0!==i&&eI(i)}
1ia(e)?null===eO&&(eO=e.getFormat(),eA=e.getStyle(),eD=e.__key):rI(e)&&n<o-1&&!e.isInline()&&(eM+="\n\n"),eP(l),t=e.__next,n++}return a.__lexicalTextContent=eM,a.__lexicalFirstTextKey=eD,eM=i+eM}}if(1===l&&1===o){let i=e.__first,r=t.__first;if(i===r)ti(i,s);else{let e=ts(i),t=e7(r,null);try{e.parentNode===s?s.replaceChild(t,e):n.insertChild(t)}catch(n){if("object"==typeof n&&null!=n)throw Error(`${n.toString()} Parent: ${s.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${i}}.`);throw n}eq(i,null)}let l=eW.get(r);ia(l)&&null===eO&&(eO=l.getFormat(),eA=l.getStyle(),eD=l.__key)}else{let i=sg(e,eB),a=sg(t,eW);if(i.length!==l&&r(227),a.length!==o&&r(228),0===l)0!==o&&e8(a,t,0,o-1,n);else if(0===o){if(0!==l){let e=null==n.after&&null==n.before&&0===e3(t).size&&null==n.element.__lexicalLineBreak;eY(i,0,l-1,e?null:s),e&&(s.textContent="")}}else!function(e,t,n,i,r,l){let o=i-1,s=r-1,a,u,f=l.getFirstChild(),d=0,c=0;for(;d<=o&&c<=s;){let e=t[d],i=n[c],r=eF();if(e===i)f=tl(ti(i,l.element)),d++,c++;else{if(void 0===u&&(u=to(n,c)),void 0===a)a=to(t,d);else if(!a.has(e)){d++,eP(r);continue}if(!u.has(e)){f=tl(ts(e)),eq(e,l.element),d++,a.delete(e),eP(r);continue}if(a.has(i)){let e=og(ew,i);e!==f&&l.withBefore(f??l.before).insertChild(e),f=tl(ti(i,l.element)),d++,c++}else e7(i,l.withBefore(f??l.before)),c++}let o=eW.get(i);null!==o&&ia(o)?null===eO&&(eO=o.getFormat(),eA=o.getStyle(),eD=o.__key):rI(o)&&c<=s&&!o.isInline()&&(eM+="\n\n"),eP(r)}let h=d>o,g=c>s;if(h&&!g){let t=n[s+1],i=void 0===t?null:ew.getElementByKey(t);e8(n,e,c,s,l.withBefore(i??l.before))}else g&&!h&&eY(t,d,o,l.element)}(t,i,a,l,o,n)}a.__lexicalTextContent=eM,a.__lexicalFirstTextKey=eD,eM=i+eM}(e,t,o3(t,n,ew)),ok(t)||(null==eO||eO===t.__textFormat||eV||t.setTextFormat(eO),null==eA||eA===t.__textStyle||eV||t.setTextStyle(eA))}(n,i,o),i.isInline()||(rR(i)||tt(0,i,o),te(i,o)),""!==a){let t=o.__lexicalTextContent||"";o.__lexicalTextContent=a+t,eM=e+a+t,o.__lexicalSlotTextLength=a.length}else(e3(i).size>0||e3(n).size>0)&&(o.__lexicalSlotTextLength=0)}else{let e=o.__lexicalTextContent;"string"!=typeof e&&r(356,n.getType()),eM+=e,eI(o)}if((eJ||i.__dir!==n.__dir||i.__parent!==n.__parent)&&(eQ(o,i),rR(i)&&!eJ))for(let e of i.getChildren())rI(e)&&eQ(og(ew,e.getKey()),e)}else{let t=i.getTextContent();if(rz(i)){let t=i.decorate(ew,eN);null!==t&&tr(e,t),l&&(e3(i).size>0||e3(n).size>0)&&e5(n,i,o)}eM+=t}if(!eV&&rR(i)){let e=i.getLatest();if(e.__cachedText!==eM){let t=e.getWritable();t.__cachedText=eM,i=t}}return ej.$decorateDOM(i,n,o,ew),eb(i),o}function tr(e,t){let n=ew._pendingDecorators,i=ew._decorators;if(null===n){if(i[e]===t)return;n=lQ(ew)}n[e]=t}function tl(e){let t=e.nextSibling;return null!==t&&t===ew._blockCursorElement&&(t=t.nextSibling),t}function to(e,t){let n=new Set;for(let i=t;i<e.length;i++)n.add(e[i]);return n}function ts(e){let t=e$.get(e);return void 0===t&&r(75,e),t}function ta(e){return{type:e}}let tu=ta("SELECTION_CHANGE_COMMAND"),tf=ta("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),td=ta("CLICK_COMMAND"),tc=ta("BEFORE_INPUT_COMMAND"),th=ta("INPUT_COMMAND"),tg=ta("COMPOSITION_START_COMMAND"),t_=ta("COMPOSITION_END_COMMAND"),tp=ta("DELETE_CHARACTER_COMMAND"),ty=ta("INSERT_LINE_BREAK_COMMAND"),tm=ta("INSERT_PARAGRAPH_COMMAND"),tx=ta("CONTROLLED_TEXT_INSERTION_COMMAND"),tC=ta("PASTE_COMMAND"),tS=ta("REMOVE_TEXT_COMMAND"),tv=ta("DELETE_WORD_COMMAND"),tT=ta("DELETE_LINE_COMMAND"),tk=ta("FORMAT_TEXT_COMMAND"),tb=ta("SET_TEXT_FORMAT_COMMAND"),tN=ta("UNDO_COMMAND"),tw=ta("REDO_COMMAND"),tE=ta("KEYDOWN_COMMAND"),tM=ta("KEY_ARROW_RIGHT_COMMAND"),tO=ta("MOVE_TO_END"),tA=ta("KEY_ARROW_LEFT_COMMAND"),tD=ta("MOVE_TO_START"),tF=ta("KEY_ARROW_UP_COMMAND"),tP=ta("KEY_ARROW_DOWN_COMMAND"),tI=ta("KEY_ENTER_COMMAND"),tL=ta("KEY_SPACE_COMMAND"),tK=ta("KEY_BACKSPACE_COMMAND"),tz=ta("KEY_ESCAPE_COMMAND"),tB=ta("KEY_DELETE_COMMAND"),tR=ta("KEY_TAB_COMMAND"),tW=ta("INSERT_TAB_COMMAND"),t$=ta("INDENT_CONTENT_COMMAND"),tU=ta("OUTDENT_CONTENT_COMMAND"),tH=ta("DROP_COMMAND"),tj=ta("FORMAT_ELEMENT_COMMAND"),tJ=ta("DRAGSTART_COMMAND"),tV=ta("DRAGOVER_COMMAND"),tq=ta("DRAGEND_COMMAND"),tY=ta("COPY_COMMAND"),tG
1=ta("CUT_COMMAND"),tX=ta("SELECT_ALL_COMMAND"),tZ=ta("CLEAR_EDITOR_COMMAND"),tQ=ta("CLEAR_HISTORY_COMMAND"),t0=ta("CAN_REDO_COMMAND"),t1=ta("CAN_UNDO_COMMAND"),t2=ta("FOCUS_COMMAND"),t3=ta("BLUR_COMMAND"),t4=ta("KEY_MODIFIER_COMMAND"),t6={[I]:"metaKey",ctrlKey:!a,metaKey:a},t5={[I]:"altKey",altKey:a,ctrlKey:!a},t7=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function t8(e,t,n){let i=e.get(t);i?i.push(n):e.set(t,[n])}class t9{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||r(399);let i=t.toLowerCase();for(let r of function(e){let t=[0];for(let[n,i]of t7){let r=e[n]||!1;"any"===r?t=t.concat(t.map(e=>e|i)):r&&(t=t.map(e=>e|i))}return t}(n))t8(this.byKey,`${r}:${i}`,e),1===t.length&&(/[0-9]/.test(t)?t8(this.byCode,`${r}:Digit${t}`,e):/[a-z]/.test(i)&&t8(this.byCode,`${r}:Key${i.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,i]of t7)e[n]&&(t|=i);return t}(e),i=this.byKey.get(`${n}:${t.toLowerCase()}`),r=i?i.slice():[];if(this.byCode.size>0&&!(1===t.length&&127>=t.charCodeAt(0))){let t=this.byCode.get(`${n}:${e.code}`);t&&r.push(...t)}return r}match(e){return this.matches(e)[0]}}function ne(e){let t=new t9;for(let n of e)t.add(n);return t}function nt(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,i){let r=t.get(n);void 0===r&&(r={dispose:e(n,i),holders:new Set},t.set(n,r));let l=()=>{let e=t.get(n);e&&e.holders.delete(l)&&0===e.holders.size&&(t.delete(n),e.dispose())};return r.holders.add(l),l}}}function nn(e,t,n,i){return e.addEventListener(t,n,i),e.removeEventListener.bind(e,t,n,i)}let ni=Object.freeze({}),nr=[["keydown",function(e,t){let n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,"Backspace"!==e.key&&n_(n),t.isComposing()||oh(t,tE,e)}],["pointerdown",function(e,t){let n=oH(e),i=e.pointerType;oq(n)&&"touch"!==i&&"pen"!==i&&0===e.button&&rD(t,()=>{sl(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){oh(t,tg,e)}],["compositionend",function(e,t){let n=t._inputState;u?n.compositionPhase="ending-firefox":!d&&(h||p)?(n.compositionPhase="ending-safari",n.compositionEndData=e.data):oh(t,t_,e)}],["input",function(e,t){e.stopPropagation();let n=t._inputState;n_(n),rD(t,()=>{ny(e,t)||t.dispatchCommand(th,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){rD(t,()=>{let n=iG(),i=oA(oC(t)),r=iX();if(i){if(iv(n)){let e=n.anchor,t=e.getNode();"element"===e.type&&0===e.offset&&n.isCollapsed()&&!rR(t)&&1===l1().getChildrenSize()&&t.getTopLevelElementOrThrow().isEmpty()&&null!==r&&n.is(r)&&(i.removeAllRanges(),n.dirty=!0)}else if("touch"===e.pointerType||"pen"===e.pointerType){let n=oW(i,t._rootElement).anchorNode;(oV(n)||lz(n))&&l3(iY(r,i,t,e))}}if(u&&null!==i&&0===i.rangeCount){let n=t._rootElement;if(null!==n&&e.target===n){let l=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(oV(t)){let n=t.getBoundingClientRect();if(l<=(n.top+n.bottom)/2){o=e;break}}}i.setBaseAndExtent(n,o,n,o);let s=iY(r,i,t,e);null!==s?l3(s):i.removeAllRanges()}}oh(t,td,e)})}],["cut",ni],["copy",ni],["dragstart",ni],["dragover",ni],["dragend",ni],["paste",ni],["focus",ni],["blur",ni],["drop",ni]];f&&nr.push(["beforeinput",(e,t)=>(function(e,t){let n=e.inputType;"deleteCompositionText"===n||u&&oc(t)||"insertCompositionText"!==n&&rD(t,()=>{ny(e,t)||oh(t,tc,e)},{event:e})})(e,t)]);let nl=new WeakMap,no=new WeakMap,ns=nt(e=>(e.addEventListener("selectionchange",nD),()=>e.removeEventListener("selectionchange",nD)));function na(e,t,n,i,r,l){let o,s=e.anchor,a=e.focus,u=s.getNode(),d=ry();if(void 0!==l)o=l;else{let e=oA(oC(d));o=null!==e?oW(e,d._rootElement):null}let c=null!==o?o.anchorNode:null,h=s.key,g=d.getElementByKey(h),_=n.length;return h!==a.key||!ia(u)||(!r&&(!f||d._inputState.lastBeforeInputInsertTextTimeStamp<i+50)||u.isDirty()&&_<2||l5(n))&&s.offset!==a.offset&&!u.isComposing()||lK(u)||u.isDirty()&&_>1||(r||!f)&&null!==g&&!u.isComposing()&&c!==o4(u,g,d)||null!==o&&null!==t&&(!t.collapsed||t.startContainer!==o.anchorNode||t.startOffset!==o.anchorOffset)||!u.isComposing()&&(u.getFormat()!==e.format||u.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;
1if(!e.isCollapsed())return!1;let n=e.anchor.offset,i=t.getParentOrThrow(),r=lL(t);return 0===n?!t.canInsertTextBefore()||!i.canInsertTextBefore()&&!t.isComposing()||r||function(e){let t=e.getPreviousSibling();return(ia(t)||rI(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!i.canInsertTextAfter()&&!t.isComposing()||r)}(e,u)}function nu(e,t){return lz(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function nf(e,t,n){let{anchorNode:i,anchorOffset:l,focusNode:o,focusOffset:s}=oW(e,t._rootElement),a=t._inputState;if(a.isSelectionChangeFromDOMUpdate){a.isSelectionChangeFromDOMUpdate=!1;let e=a.selectionChangeFromDOMUpdatePoints;if(a.selectionChangeFromDOMUpdatePoints=null,nu(i,l)&&nu(o,s)&&!a.postDeleteSelectionToRestore&&(null===e||e.anchorNode===i&&e.anchorOffset===l&&e.focusNode===o&&e.focusOffset===s))return}rD(t,()=>{if(!n)return void l3(null);if(!lD(t,i,o))return;let u=iG();if(a.postDeleteSelectionToRestore&&iv(u)&&u.isCollapsed()){let e=u.anchor,t=a.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&l3(u=a.postDeleteSelectionToRestore.clone())}if(a.postDeleteSelectionToRestore=null,iv(u)){let n=u.anchor,d=n.getNode();if(u.isCollapsed()){"Range"===e.type&&i===o&&(u.dirty=!0);let l=oC(t).event,s=l?l.timeStamp:performance.now(),{format:c,style:h,offset:g,key:_,timeStamp:p}=a.collapsedSelectionFormat,y=l1(),m=!1===t.isComposing()&&""===y.getTextContent();if(s<p+200&&n.offset===g&&n.key===_)nd(u,c,h);else if("text"===n.type)ia(d)||r(141),nc(u,d);else if("element"===n.type&&!m){var f;rI(d)||r(259);let e=n.getNode();e.isEmpty()?nd(u,(f=e).getTextFormat(),f.getTextStyle()):nd(u,u.format,"")}}else{let e=n.key,t=u.focus.key,i=u.getNodes(),r=i.length,o=u.isBackward(),a=o?s:l,f=o?l:s,d=o?t:e,c=o?e:t,h=2047,g=!1;for(let e=0;e<r;e++){let t=i[e],n=t.getTextContentSize();if(ia(t)&&0!==n&&(0!==e||t.__key!==d||a!==n)&&(e!==r-1||t.__key!==c||0!==f)&&(g=!0,0==(h&=t.getFormat())))break}u.format=g?h:0}}oh(t,tu)})}function nd(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function nc(e,t){nd(e,t.getFormat(),t.getStyle())}function nh(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return 0===t.length?null:t[0]}function ng(e){let{lastKeyCode:t}=ry()._inputState;if(null==e||e.length<=1||null==t)return;let n=1===t.length?t:"Enter"===t?"\n":"Tab"===t?"	":null;if(!n)return;let i=iG();if(!iv(i)||!i.isCollapsed())return;let r=i.anchor.getNode();if(!ia(r))return;let{offset:l}=i.anchor;if(r.getTextContentSize()===l){let e=r.getNextSibling();if("\n"===n){if(d)return;if(rY(e))e.selectEnd();else if(!e){let e=sh(r,iH),t=e&&e.getNextSibling();rI(t)&&t.selectStart()}}else"	"===n?ih(e)&&e.selectEnd():ia(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else r.getTextContent()[l]===n&&r.select(l+1,l+1)}function n_(e){e.isInsertTextAfterHandledSelectionCommand=!1,null!==e.handledSelectionCommandTimeoutId&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function np(e){n_(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>n_(e),0)}function ny(e,t){let n=oH(e);if(oV(n)&&sl(n,t))return!0;let i=t.getRootElement();if(null===i)return!1;let r=oU(i.ownerDocument);return null!==r&&i.contains(r)&&sl(r,t)}function nm(e){var t;let n=e.inputType,i=nh(e),l=ry(),o=l._inputState,s=iG();if("insertText"===n&&e.data&&o.isInsertTextAfterHandledSelectionCommand){if(n_(o),e.preventDefault(),iv(s)&&!s.isCollapsed()){let e=s.isBackward()?s.anchor:s.focus;s.anchor.set(e.key,e.offset,e.type),s.focus.set(e.key,e.offset,e.type)}return!0}if("deleteContentBackward"===n){if(null===s){let e=iX();if(!iv(e))return!0;l3(e.clone())}if(iv(s)){let n=s.anchor.key===s.focus.key;if(t=e.timeStamp,"MediaLast"===o.lastKeyCode&&t<o.lastKeyDownTimeStamp+30&&l.isComposing()&&n){if(lJ(null),o.lastKeyDownTimeStamp=0,setTimeout(()=>{rD(l,()=>{lJ(null)})},30),iv(s)){let e=s.anchor.getNode();e.markDirty(),ia(e)||r(142),nc(s,e)}}else{if(lJ(null),d&&null!==i&&!i.collapsed&&(s.applyDOMRange(i),!s.isCollapsed()))return e.preventDefault(),s.removeText(),!0;e.preventDefault();let t=s.anchor.getNode(),r=t.getTextContent(),a=t.canInsertTextAfter(),u=0===s.anchor.offset&&s.focus.offset===r.length,f=_&&n&&!u&&a;if(f&&s.isCollapsed()&&(f=!rz(function(e,t){let n=e.offset;if("element"===e.type)return od(e.getNode(),t,n);{let i=e.getNode();if(t&&0===n||!t&&n===i.getTextContentSize()){let e=t?i.getPreviousSibling():i.getNextSibling();return null===e?od(i.getParentOrThrow(),t,i.getIndexWithinParent()+ +!t):e}}return null}(s.anchor,!0))),!f){oh(l,tp,!0);let e=iG();_&&iv(e)&&e.isCollapsed()&&(o.postDeleteSelectionToRestore=e,setTimeout(()=>
1o.postDeleteSelectionToRestore=null))}}return!0}}if(!iv(s))return"historyUndo"!==n&&"historyRedo"!==n||(e.preventDefault(),oh(l,"historyUndo"===n?tN:tw)),!0;let a=e.data;null!==o.unprocessedBeforeInputData&&oe(!1,l,o.unprocessedBeforeInputData),s.dirty&&null===o.unprocessedBeforeInputData||!s.isCollapsed()||rR(s.anchor.getNode())||null===i||s.applyDOMRange(i),o.unprocessedBeforeInputData=null;let u=s.anchor,f=s.focus,c=u.getNode(),h=f.getNode();if("insertText"===n||"insertTranspose"===n){if("\n"===a)e.preventDefault(),oh(l,ty,!1);else if("\n\n"===a)e.preventDefault(),oh(l,tm);else if(null==a&&e.dataTransfer){let t=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(t)}else null!=a&&na(s,i,a,e.timeStamp,!0)?(e.preventDefault(),oh(l,tx,a),ng(a)):o.unprocessedBeforeInputData=a;return o.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":oh(l,tx,e),ng((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let t=o.hadOrphanedCompositionEvents;o.hadOrphanedCompositionEvents=!1;let n=l._compositionKey;lJ(null),t||oh(l,tx,e),nv(n);break}case"insertLineBreak":lJ(null),oh(l,ty,!1);break;case"insertParagraph":lJ(null),o.isInsertLineBreak&&!d?(o.isInsertLineBreak=!1,oh(l,ty,!1)):oh(l,tm);break;case"insertFromPaste":case"insertFromPasteAsQuotation":oh(l,tC,e);break;case"deleteByComposition":(c!==h||rI(c)||rI(h)||!lL(c)||!lL(h))&&oh(l,tS,e);break;case"deleteByDrag":oy(nG),oh(l,tS,e);break;case"deleteByCut":oh(l,tS,e);break;case"deleteContent":oh(l,tp,!1);break;case"deleteWordBackward":oh(l,tv,!0);break;
1case"deleteWordForward":oh(l,tv,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":oh(l,tT,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":oh(l,tT,!1);break;case"formatStrikeThrough":oh(l,tk,"strikethrough");break;case"formatBold":oh(l,tk,"bold");break;case"formatItalic":oh(l,tk,"italic");break;case"formatUnderline":oh(l,tk,"underline");break;case"historyUndo":oh(l,tN);break;case"historyRedo":oh(l,tw)}return!0}function nx(e){let t=ry(),n=t._inputState,i=iG(),r=e.data,l=nh(e),o=!1;if(null!=r&&iv(i)){let s=oA(oC(t)),a=null!==s?oW(s,t._rootElement):null,d="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&!t.isComposing();d&&(n.hadOrphanedCompositionEvents=!0);let c=i.anchor.getNode(),h="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&t.isComposing()&&ia(c)&&lK(c);if(!d&&!h&&na(i,l,r,e.timeStamp,!1,a)){if(o=!0,"ending-firefox"===n.compositionPhase){let e=nT(t,r);if(n.compositionPhase="idle",e)return oy(nZ),l4(),!0}let l=i.anchor.getNode();if(null===s||null===a)return!0;let d=i.isBackward(),c=d?i.anchor.offset:i.focus.offset,h=d?i.focus.offset:i.anchor.offset;f&&!i.isCollapsed()&&ia(l)&&null!==a.anchorNode&&l.getTextContent().slice(0,c)+r+l.getTextContent().slice(c+h)===l9(a.anchorNode)||oh(t,tx,r);let g=r.length;u&&g>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(i.anchor.offset-=g,i._cachedNodes=null,i._cachedIsBackward=null),_&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,lJ(null))}}return o||(oe(!1,t,null!==r?r:void 0),"ending-firefox"===n.compositionPhase&&(nT(t,r||void 0),oy(nZ),n.compositionPhase="idle")),l4(),!0}function nC(e){let t=ry(),n=t._inputState,i=iG();if(iv(i)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;let r=i.anchor,l=i.anchor.getNode();if(lJ(r.key),oy(nX),e.timeStamp<n.lastKeyDownTimeStamp+30||"element"===r.type||!i.isCollapsed()||!_&&(l.getFormat()!==i.format||ia(l)&&l.getStyle()!==i.style)||ia(l)&&(lK(l)||0===r.offset&&!l.canInsertTextBefore()||r.offset===l.getTextContentSize()&&!l.canInsertTextAfter())){oh(t,tx,N);let e=iG();iv(e)&&lJ(e.anchor.key)}}return!0}function nS(e){let t=ry();return t._inputState.compositionPhase="idle",nT(t,e.data),oy(nZ),!0}function nv(e){if(null===e)return;let t=lq(e);if(!ia(t)||"text"===t.getType()||lK(t)||!t.isAttached())return;let n=iG(),i=iv(n)&&n.anchor.key===e?n.anchor.offset:null,r=is(t.getTextContent());if(r.setFormat(t.getFormat()),r.setStyle(t.getStyle()),t.replace(r),null!==i){let e=Math.min(i,r.getTextContentSize());r.select(e,e)}}function nT(e,t){let n=e._compositionKey;if(lJ(null),null!==n&&null!=t){if(""===t){let t=lq(n),i=e.getElementByKey(n),r=null!==i&&ia(t)?o4(t,i,e):null;if(null!==r&&null!==r.nodeValue&&ia(t)){let n=oA(oC(e)),i=n&&oW(n,e._rootElement),l=null,o=null;null!==i&&i.anchorNode===r&&(l=i.anchorOffset,o=i.focusOffset),ot(t,r.nodeValue,l,o,!0)}return nv(n),!1}if("\n"===t[t.length-1]){let t=iG();if(iv(t)||ik(t)){if(iv(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return oh(e,tI,null),nv(n),!1}}let i=lq(n);if(null!==i&&ia(i)&&lK(i)){i.markDirty();let e=iG(),r=i.getTextContentSize(),l=iv(e)&&e.anchor.key===n?e.anchor.offset:r;return i.select(l,l).insertText(t),!0}}return oe(!0,e,t),nv(n),!1}let nk={altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:"any"},nb={ctrlKey:!0},nN={metaKey:!0},nw={shiftKey:"any"},nE={...nw,altKey:"any"};function nM(e){let t=ry(),n=t._inputState;if(null==e.key)return!0;if("ending-safari"===n.compositionPhase){let i="Backspace"===e.key;if(i&&rD(t,()=>{nT(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",i)return!0}let i=t._keyDownShortcuts;null===i&&(t._keyDownShortcuts=i=ne(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{oh(t,n,e)}}),t=(e,t,n,i)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),oh(t,n,i)}}),n=(e,t)=>({key:"Enter",modifiers:e,onMatch:(e,n)=>{n._inputState.isInsertLineBreak=t,oh(n,tI,e)}}),i=(e,t)=>({key:e,modifiers:t6,onMatch:(e,n)=>{let i=n._editorState._selection;null===i||iv(i)||(e.preventDefault(),oh(n,t,e))}});return[e("ArrowRight",nw,tM),e("ArrowLeft",nw,tA),e("ArrowUp",nE,tF),e("ArrowDown",nE,tP),n({...nk,shiftKey:!0},!0),n({...nk,shiftKey:!1},!1),e(" ",nk,tL),{key:"Backspace",modifiers:nw,onMatch:(e,t)=>{oh(t,tK,e)&&np(t._inputState)}},e("Escape",nk,tz),e("Delete",{},tB),t("Backspace",t5,tv,!0),t("Delete",t5,tv,!1),t("b",t6,tk,"bold"),t("u",t6,tk,"underline"),t("i",t6,tk,"italic"),e("Tab",nw,tR),t("z",t6,tN,void 0),t("z",{...t6,shift
1Key:!0},tw,void 0),...a?[{key:"o",modifiers:nb,onMatch:(e,t)=>{e.preventDefault(),t._inputState.isInsertLineBreak=!0,oh(t,ty,!0)}},e("ArrowLeft",{metaKey:!0,...nw},tD),e("ArrowRight",{metaKey:!0,...nw},tO),t("h",nb,tp,!0),t("d",nb,tp,!1),t("Backspace",nN,tT,!0),t("Delete",nN,tT,!1),t("k",nb,tT,!1)]:[e("Home",nw,tD),e("End",nw,tO),t("y",nb,tw,void 0)],{key:"a",modifiers:t6,onMatch:(e,t)=>{e.preventDefault(),oh(t,tX,e)&&np(t._inputState)}},i("c",tY),i("x",tG)]}()));let r=i.match(e);return r&&r.onMatch(e,t),(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)&&t.dispatchCommand(t4,e),!0}function nO(e){let t=e.__lexicalEventHandles;return void 0===t&&(e.__lexicalEventHandles=t=[]),t}let nA=new Map;function nD(e){let t=oD(e.target);if(null===t)return;let n=op(e.target),i=null,r=null,l=null!==n?no.get(n):void 0;if(null!==n){if(void 0!==l){let e=l.editors,n=l.hasShadowEditor;if(void 0===n){for(let t of(n=!1,e))if(null!==t._rootElement&&oF(t._rootElement.getRootNode())){n=!0;break}l.hasShadowEditor=n}if(n){let n=null,l=null;for(let o of e){let e=o._rootElement;if(null===e)continue;let s=oW(t,e).anchorNode;if(null!==s&&lP(s)===o){if(oF(e.getRootNode())){i=o,r=s;break}null===n&&(n=o,l=s)}}null===i&&null!==n&&(i=n,r=l)}else{let e=t.anchorNode;null===e||oV(e)&&null!==e.shadowRoot||null!==(i=lP(e))&&(r=e)}}if(null===i){let e=oU(n);i=null!==e?lP(e):null}}if(null===i)return;if(i._inputState.isSelectionChangeFromMouseDown){if(void 0!==l)for(let e of l.editors)e._inputState.isSelectionChangeFromMouseDown=!1;rD(i,()=>{let n=iX(),l=r??oW(t,i._rootElement).anchorNode;(oV(l)||lz(l))&&l3(iY(n,t,i,e))})}let o=l7(i),s=o[o.length-1],a=s._key,u=nA.get(a),f=u||s;f!==i&&nf(t,f,!1),nf(t,i,!0),i!==s?nA.set(a,i):u&&nA.delete(a)}function nF(e){e._lexicalHandled=!0}function nP(e){return!0===e._lexicalHandled}let nI=()=>{};function nL(e,t,n){rh();let i=e.__key,l=e.getParent();if(null===l)return void(null!==sx(e)&&r(367,i,String(sx(e))));let o=function(e){let t=iG();if(!iv(t)||!rI(e))return t;let{anchor:n,focus:i}=t,r=n.getNode(),l=i.getNode();return om(r,e)&&n.set(e.__key,0,"element"),om(l,e)&&i.set(e.__key,0,"element"),t}(e),s=!1;if(iv(o)&&t){let t=o.anchor,n=o.focus;t.key===i&&(i1(t,e,l,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===i&&(i1(n,e,l,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else ik(o)&&t&&e.isSelected()&&e.selectPrevious();if(iv(o)&&t&&!s&&iZ(o,l)){let t=e.getIndexWithinParent();lH(e),iQ(o,l,t,-1)}else lH(e);n||ok(l)||l.canBeEmpty()||!l.isEmpty()||nL(l,t),t&&o&&rR(l)&&l.isEmpty()&&l.selectEnd()}function nK(e){return e}let nz=Symbol.for("ephemeral");function nB(e){return e[nz]||!1}let nR={configurable:!0,enumerable:!1,value:void 0,writable:!0};class nW{__type;__key;__parent;__prev;__next;__state;[eT];static getType(){let{ownNodeType:e}=su(this);return void 0===e&&r(64,this.name),e}static clone(e){r(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||s_(this.constructor);return Object.assign(t,{extends:n}),"string"==typeof e&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",nR),Object.defineProperty(this,eT,nR),lU(this,e)}getType(){return this.__type}isInline(){r(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;let t=lq(e);if(null===t)break;e=null!==t.__parent?t.__parent:sx(t)}return!1}isSelected(e){let t=e||iG();if(null==t)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(ia(this))return n;if(iv(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;let e=this.getParent();if(rz(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(null===e)return -1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return -1}getParent(){let e=this.getLatest().__parent;return null===e?null:lq(e)}getParentOrThrow(){let e=this.getParent();return null===e&&r(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){let t=e.getParent();if(ok(t)||null!==sx(e))return rI(e)||e===this&&rz(e)||r(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return null===e&&r(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return null===e?null:lq(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return null===e?null:lq(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=rI(this)?this:this.getParent(),n=rI(e)?e:e.getParent(),i=t&&n?ae(t,n):null;return i?i.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){let t=ae(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===s8(t):("same"!==t.type&&"ancestor"!==t.type&&r(279),!1)))}isParentOf(e){return om(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],i=new Set,l=this;for(;null!==l;){let o=l.__key;
1if(i.has(o)||(i.add(o),n.push(l)),l===e)break;let s=rI(l)?t?l.getFirstChild():l.getLastChild():null;if(null!==s){l=s;continue}let a=t?l.getNextSibling():l.getPreviousSibling();if(null!==a){l=a;continue}let u=l.getParentOrThrow();if(i.has(u.__key)||n.push(u),u===e)break;let f=null,d=u;do{if(null===d&&r(68),f=t?d.getNextSibling():d.getPreviousSibling(),null===(d=d.getParent()))break;null!==f||i.has(d.__key)||n.push(d)}while(null===f);l=f}return t||n.reverse(),n}isDirty(){let e=ry()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(nB(this))return this;let e=lq(this.__key);return null===e&&r(113),e}getWritable(){if(nB(this))return this;rh();let e=r_(),t=ry(),n=e._nodeMap,i=this.__key,r=this.getLatest(),l=t._cloneNotNeeded,o=iG();if(null!==o&&o.setCachedNodes(null),l.has(i))return lj(r),r;let s=o8(r);return l.add(i),lj(s),n.set(i,s),s}getTextContent(){return sD(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){r(70)}updateDOM(e,t,n){r(71)}getDOMSlot(e){return new $(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){r(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),i=t.$,r=i;for(let e of ec(n).flatKeys)e in t&&(void 0!==r&&r!==i||(r={...i}),r[e]=t[e]);return(n.__state||r)&&ed(e).updateFromJSON(r),n}(this,e)}static transform(){return null}remove(e){nL(this,!0,e)}replace(e,t){rh();let n=iG();null!==n&&(n=n.clone()),ow(this,e);let i=this.getLatest(),l=this.__key,o=sC(i);null!==o&&r(400,l,i.getType(),o.getKey(),o.getType());let s=e.__key,a=e.getWritable(),u=this.getParentOrThrow().getWritable(),f=u.__size,d=a.getParent(),c=null!==d&&iv(n)&&iZ(n,d),h=c?a.getIndexWithinParent():-1;lH(a),c&&null!==d&&iv(n)&&iQ(n,d,h,-1);let g=i.getPreviousSibling(),_=i.getNextSibling(),p=i.__prev,y=i.__next,m=i.__parent;(nL(i,!1,!0),null===g)?u.__first=s:g.getWritable().__next=s,(a.__prev=p,null===_)?u.__last=s:_.getWritable().__prev=s,a.__next=y,a.__parent=m,u.__size=null!==d&&d.is(u)?f-1:f;let x=0;if(t&&(rI(this)&&rI(a)||r(139),x=a.getChildrenSize(),a.splice(x,0,this.getChildren())),iv(n)){l3(n);let e=n.anchor,i=n.focus;e.key===l&&(t&&"element"===e.type?e.set(a.__key,x+e.offset,"element"):iy(e,a)),i.key===l&&(t&&"element"===i.type?i.set(a.__key,x+i.offset,"element"):iy(i,a))}return lV()===l&&lJ(s),a}insertAfter(e,t=!0){rh(),ow(this,e);let n=this.getWritable(),i=e.getWritable();this.getParentOrThrow();let r=i.getParent(),l=iG(),o=!1,s=!1,a=-1;if(null!==r&&t&&iv(l)&&iZ(l,r)){let t=r.__key,n=l.anchor,i=l.focus;a=e.getIndexWithinParent(),o="element"===n.type&&n.key===t&&n.offset===a+1,s="element"===i.type&&i.key===t&&i.offset===a+1}lH(i),-1!==a&&null!==r&&iv(l)&&iQ(l,r,a,-1);let u=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),d=i.__key,c=n.__next;if(null===u?f.__last=d:u.getWritable().__prev=d,f.__size++,n.__next=d,i.__next=c,i.__prev=n.__key,i.__parent=n.__parent,t&&iv(l)){let e=f.__key;if(o||s||iZ(l,f)){let t=this.getIndexWithinParent();iQ(l,f,t+1),o&&l.anchor.set(e,t+2,"element"),s&&l.focus.set(e,t+2,"element")}}return e}insertBefore(e,t=!0){rh(),ow(this,e);let n=this.getWritable(),i=e.getWritable();this.getParentOrThrow();let r=i.__key,l=iG(),o=i.getParent(),s=null!==o&&t&&iv(l)&&iZ(l,o),a=s?i.getIndexWithinParent():-1;lH(i),s&&null!==o&&iv(l)&&iQ(l,o,a,-1);let u=this.getPreviousSibling(),f=this.getParentOrThrow().getWritable(),d=n.__prev,c=t&&iv(l)&&iZ(l,f),h=c?this.getIndexWithinParent():-1;return null===u?f.__first=r:u.getWritable().__next=r,f.__size++,n.__prev=r,i.__prev=d,i.__next=n.__key,i.__parent=n.__parent,c&&iv(l)&&iQ(l,f,h),e}isParentRequired(){return!1}createParentElementNode(){return lu()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){rh();let n=sC(this);if(null!==n)return n.selectPrevious(e,t);let i=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===i)return r.select(0,0);if(rI(i))return i.select();if(!ia(i)){let e=i.getIndexWithinParent()+1;return r.select(e,e)}return i.select(e,t)}selectNext(e,t){rh();let n=sC(this);if(null!==n)return n.selectNext(e,t);let i=this.getNextSibling(),r=this.getParentOrThrow();if(null===i)return r.select();if(rI(i))return i.select(0,0);if(!ia(i)){let e=i.getIndexWithinParent();return r.select(e,e)}return i.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function n$(e){return e instanceof nW}let nU="historic",nH="history-push",nj="history-merge",nJ="paste",nV="cut",nq="skip-scroll-into-view",nY="skip-dom-selection",nG="skip-selection-focus",nX="composition-start",nZ="composition-end";function nQ(e){let t={};if(!e)return t;let n="",i="",r=null,l=!1,o=!1,s=!1,a=0,u=e.length,f=-1;for(let d=0;d<u;d++){let u=e[d];if(l)"*"===u&&"/"===e[d+1]&&(l=!1,d++);else if(o)-1===f&&(f=d),o=!1;else if(null===r)if("/"!==u||"*"!==e[d+1])if('"'!==u&&"'"!==u)if("("!==u)if(")"!==u)if(s||":"
1!==u||0!==a){if(";"===u&&0===a){-1!==f&&(s?i+=e.slice(f,d):n+=e.slice(f,d),f=-1);let r=n.trim(),l=i.trim();""!==r&&""!==l&&(t[r]=l),n="",i="",s=!1;continue}-1===f&&(f=d)}else -1!==f&&(n+=e.slice(f,d),f=-1),s=!0;else -1===f&&(f=d),a=Math.max(0,a-1);else -1===f&&(f=d),a++;else -1===f&&(f=d),r=u;else -1!==f&&(s?i+=e.slice(f,d):n+=e.slice(f,d),f=-1),l=!0,d++;else -1===f&&(f=d),"\\"===u?o=!0:u===r&&(r=null)}-1!==f&&(s?i+=e.slice(f,u):n+=e.slice(f,u));let d=n.trim(),c=i.trim();return""!==d&&""!==c&&(t[d]=c),t}function n0(e,t,n=""){if(t===n)return;let i=nQ(n),r=nQ(t);for(let t in r)delete i[t],function(e,t,n){let i=n.trimEnd(),r=i.length-10;r>=0&&"!important"===i.slice(r).toLowerCase()?e.setProperty(t,i.slice(0,r).trim(),"important"):e.setProperty(t,n,"")}(e,t,r[t]);for(let t in i)e.removeProperty(t)}function n1(e,t){return 16&t?"code":t&k?"mark":32&t?"sub":64&t?"sup":null}function n2(e,t){return 1&t?"strong":2&t?"em":"span"}function n3(e,t,n,i,r){let l=i.classList,o=ou(r,"base");void 0!==o&&l.add(...o);let s=!1,a=8&t&&4&t;for(let e in void 0!==(o=ou(r,"underlineStrikethrough"))&&(8&n&&4&n?(s=!0,a||l.add(...o)):a&&l.remove(...o)),M){let i=M[e];if(void 0!==(o=ou(r,e)))if(n&i){if(s&&("underline"===e||"strikethrough"===e)){t&i&&l.remove(...o);continue}(0==(t&i)||a&&"underline"===e||"strikethrough"===e)&&l.add(...o)}else t&i&&l.remove(...o)}oa(i,"class")}function n4(e,t,n){let i=n.isComposing(),r=e+(i?b:""),l=o1(),o=o2(l).$getDOMSlot(n,t,l),s=o.getFirstChild();if(null===s||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(oz().createTextNode(r));let a=s.nodeValue;if(a!==r)if(i||u){let[e,t,n]=function(e,t){let n=e.length,i=t.length,r=0,l=0;for(;r<n&&r<i&&e[r]===t[r];)r++;for(;l+r<n&&l+r<i&&e[n-l-1]===t[i-l-1];)l++;return[r,n-r-l,t.slice(r,i-l)]}(a,r);0!==t&&s.deleteData(e,t),s.insertData(e,n)}else s.nodeValue=r}function n6(e,t,n,i,r,l){n4(r,e,t);let o=l.theme.text;void 0!==o&&n3(0,0,i,e,o)}function n5(e,t){let n=oz().createElement(t);return n.appendChild(e),n}function n7(e){return null!=e&&!0===e.__isInlineFormattable}class n8 extends nW{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:ii,priority:0}),b:()=>({conversion:ie,priority:0}),code:()=>({conversion:io,priority:0}),em:()=>({conversion:io,priority:0}),i:()=>({conversion:io,priority:0}),mark:()=>({conversion:io,priority:0}),s:()=>({conversion:io,priority:0}),span:()=>({conversion:n9,priority:0}),strong:()=>({conversion:io,priority:0}),sub:()=>({conversion:io,priority:0}),sup:()=>({conversion:io,priority:0}),u:()=>({conversion:io,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return P[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===lV()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=M[e];return 0!=(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return lW(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,i=n1(0,n),r=n2(0,n),l=null===i?r:i,o=oz().createElement(l),s=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==i&&(s=oz().createElement(r),o.appendChild(s)),n6(s,this,0,n,this.__text,e);let a=this.__style;return""!==a&&n0(o.style,a),o}updateDOM(e,t,n){let i=this.__text,l=e.__format,o=this.__format,s=n1(0,l),a=n1(0,o),u=n2(0,l),f=n2(0,o);if((null===s?u:s)!==(null===a?f:a))return!0;if(s===a&&u!==f){let e=t.firstChild;null==e&&r(48);let l=oz().createElement(f);return n6(l,this,0,o,i,n),t.replaceChild(l,e),!1}let d=t;null!==a&&null!==s&&null==(d=t.firstChild)&&r(49),n4(i,d,this);let c=n.theme.text;void 0!==c&&l!==o&&n3(0,l,o,d,c);let h=e.__style,g=this.__style;return h!==g&&(n0(t.style,g,h),oa(t,"style")),!1}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}
1exportDOM(e){let{element:t}=super.exportDOM(e);return oV(t)||r(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=n5(t,"b")),this.hasFormat("italic")&&(t=n5(t,"i")),this.hasFormat("strikethrough")&&(t=n5(t,"s")),this.hasFormat("underline")&&(t=n5(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format="string"==typeof e?M[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?O[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=lW(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=F[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){rh();let n=e,i=t,r=iG(),l=this.getTextContent(),o=this.__key;if("string"==typeof l){let e=l.length;void 0===n&&(n=e),void 0===i&&(i=e)}else n=0,i=0;if(!iv(r))return ij(o,n,o,i,"text","text");{let e=lV();e!==r.anchor.key&&e!==r.focus.key||lJ(o),r.setTextNodeRange(this,n,this,i)}return r}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,i){let r=this.getWritable(),l=r.__text,o=n.length,s=e;s<0&&(s=o+s)<0&&(s=0);let a=iG();if(i&&iv(a)){let t=e+o;a.setTextNodeRange(r,t,r,t)}return r.__text=l.slice(0,s)+n+l.slice(s+t),r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){let t;rh();let n=this.getLatest(),i=n.getTextContent();if(""===i)return[];let r=n.__key,l=lV(),o=i.length;e.sort((e,t)=>e-t),e.push(o);let s=[],a=e.length;for(let t=0,n=0;t<o&&n<=a;n++){let r=e[n];r>t&&(s.push(i.slice(t,r)),t=r)}let u=s.length;if(1===u)return[n];let f=s[0],d=n.getParent(),c=n.getFormat(),h=n.getStyle(),g=n.__detail,_=!1,p=null,y=null,m=iG();if(iv(m)){let[e,t]=m.isBackward()?[m.focus,m.anchor]:[m.anchor,m.focus];"text"===e.type&&e.key===r&&(p=e),"text"===t.type&&t.key===r&&(y=t)}n.isSegmented()?((t=is(f)).__format=c,t.__style=h,t.__detail=g,t.__state=ey(n,t),_=!0):t=n.setTextContent(f);let x=[t];for(let e=1;e<u;e++){let t=is(s[e]);t.__format=c,t.__style=h,t.__detail=g,t.__state=ey(n,t);let i=t.__key;l===r&&lJ(i),x.push(t)}let C=p?p.offset:null,S=y?y.offset:null,v=0;for(let e of x){if(!p&&!y)break;let t=v+e.getTextContentSize();if(null!==p&&null!==C&&C<=t&&C>=v&&(p.set(e.getKey(),C-v,"text"),C<t&&(p=null)),null!==y&&null!==S&&S<=t&&S>=v){y.set(e.getKey(),S-v,"text");break}v=t}if(null!==d){let e=this.getPreviousSibling(),t=this.getNextSibling();null!==e&&lj(e),null!==t&&lj(t);let n=d.getWritable(),i=this.getIndexWithinParent();_?(n.splice(i,0,x),this.remove()):n.splice(i,1,x),iv(m)&&iQ(m,d,i,u-1)}return x}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||r(50);let n=this.__key,i=e.__key,l=this.__text,o=l.length;lV()===i&&lJ(n);let s=iG();if(iv(s)){let r=s.anchor,l=s.focus;null!==r&&r.key===i&&i2(r,t,n,e,o),null!==l&&l.key===i&&i2(l,t,n,e,o)}let a=e.__text,u=t?a+l:l+a;this.setTextContent(u);let f=this.getWritable();return e.remove(),f}isTextEntity(){return!1}}function n9(e){return{forChild:iu(e.style),node:null}}function ie(e){let t="normal"===e.style.fontWeight;return{forChild:iu(e.style,t?void 0:"bold"),node:null}}let it=new WeakMap;function ii(e){null===e.parentElement&&r(129);let t=e.textContent||"";if(null!==function(e){let t,n=e.parentNode,i=[e];for(;null!==n&&void 0===(t=it.get(n))&&!function(e){if(!oV(e))return!1;if("PRE"===e.nodeName)return!0;let t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}(n);)i.push(n),n=n.parentNode;let r=void 0===t?n:t;for(let e=0;e<i.length;e++)it.set(i[e],r);return r}(e))return{node:i8(t)};if(""===(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," ")))return{node:null};if(" "===t[0]){let n=e,i=!0;for(;null!==n&&null!==(n=ir(n,!1));){let e=n.textContent||"";if(e.length>
10){/[ \t\n]$/.test(e)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(" "===t[t.length-1]){let n=e,i=!0;for(;null!==n&&null!==(n=ir(n,!0));)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return""===t?{node:null}:{node:is(t)}}function ir(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){let e=n.parentElement;if(null===e)return null;n=e}if(oV(n=e)){let e=n.style.display;if(""===e&&!oX(n)||""!==e&&!e.startsWith("inline"))return null}let i=n;for(;null!==(i=t?n.firstChild:n.lastChild);)n=i;if(lz(n))return n;if("BR"===n.nodeName)return null}}let il={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function io(e){let t=il[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:iu(e.style,t),node:null}}function is(e=""){return oN(new n8(e))}function ia(e){return e instanceof n8}function iu(e,t){let n=e.fontWeight,i=e.textDecoration.split(" "),r="700"===n||"bold"===n,l=i.includes("line-through"),o="italic"===e.fontStyle,s=i.includes("underline"),a=e.verticalAlign,u=e.textTransform;return e=>((ia(e)||n7(e))&&(r&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),o&&!e.hasFormat("italic")&&e.toggleFormat("italic"),s&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==a||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==a||e.hasFormat("superscript")||e.toggleFormat("superscript"),"lowercase"!==u&&"uppercase"!==u&&"capitalize"!==u||e.hasFormat(u)||e.toggleFormat(u),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}class id extends n8{$config(){return this.config("tab",{extends:n8})}constructor(e){super("	",e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=ou(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent("	")}spliceText(e,t,n,i){return""===n&&0===t||"	"===n&&1===t||r(286),this}setDetail(e){return 2!==e&&r(127),this}setMode(e){return"normal"!==e&&r(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function ic(){return oN(new id)}function ih(e){return e instanceof id}class ig{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:0>s7(r7(rQ(this,"next")),r7(rQ(e,"next")))}getNode(){let e=lq(this.key);return null===e&&r(20),e}set(e,t,n,i){let r=this._selection,l=this.key;i&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,rc()||(lV()===l&&lJ(e),null!==r&&(r.setCachedNodes(null),iv(r)&&(r._cachedIsBackward=null),r.dirty=!0)))}}function i_(e,t,n){return new ig(e,t,n)}function ip(e,t){let n=t.__key,i=e.offset,r="element";if(ia(t)){r="text";let e=t.getTextContentSize();i>e&&(i=e)}else if(!rI(t)){let e=t.getNextSibling();if(ia(e))n=e.__key,i=0,r="text";else{let e=t.getParent();e&&(n=e.__key,i=t.getIndexWithinParent()+1)}}e.set(n,i,r)}function iy(e,t){if(rI(t)){let n=t.getLastDescendant();rI(n)||ia(n)?ip(e,n):ip(e,t)}else ip(e,t)}function im(e,t,n,i){let r=e.getNode(),l=r.getChildAtIndex(e.offset),o=is();if(o.setFormat(n),o.setStyle(i),lf(l))l.splice(0,0,[o]);else if(null!==l){let e=ok(r)?lu().append(o):o;l.insertBefore(e)}else if(ok(r)){let e=r.getLastChild();rI(e)&&!e.isInline()&&e.isEmpty()?e.append(o):r.append(lu().append(o))}else r.append(o);e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}function ix(e,t,n,i){let l=e.anchor.getNode();ia(l)||r(398);let o=e.anchor.offset,s=is(t);s.setFormat(n),s.setStyle(i);let a=l.getParentOrThrow();if(0===o)a.isInline()&&!l.__prev?a.insertBefore(s):l.insertBefore(s,!1);else if(o===l.getTextContentSize())a.isInline()&&!l.__next?a.insertAfter(s):l.insertAfter(s,!1);else{let[e]=l.splitText(o);e.insertAfter(s,!1)}""===l.getTextContent()&&l.isAttached()&&l.remove(),s.selectEnd(),s.isComposing()&&"text"===e.anchor.type&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}class iC{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ik(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new iC(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t,n=this.getNodes().filter(e=>null===sx(e)),i=n.length;if(0===i)return;let r=n[i-1];if(ia(r))t=r.select();else{let e=r.getIndexWithinParent()+1;t=r.getParentOrThrow().select(e,e)}
1t.insertNodes(e);for(let e=0;e<i;e++)n[e].remove()}getNodes(){let e=this._cachedNodes;if(null!==e)return e;let t=this._nodes,n=[];for(let e of t){let t=lq(e);null!==t&&n.push(t)}return rc()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>null===sx(e));if((iG()||iX())===this&&e[0]){let t=sq(e[0],"next");r1(s6(t,t))}for(let t of e)t.remove();iS()}}function iS(){let e=l1();if(e.isEmpty()){let t=lu();e.append(t),t.select()}}function iv(e){return e instanceof iT}class iT{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!iv(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(null!==e)return e;let t=function(e){let t=[],[n,i]=e.getTextSlices();n&&t.push(n.caret.origin);let r=new Set,l=new Set;for(let n of e)if(sH(n)){let{origin:e}=n;0===t.length?r.add(e):(l.add(e),t.push(e))}else{let{origin:e}=n;rI(e)&&l.has(e)||t.push(e)}if(i&&t.push(i.caret.origin),sU(e.focus)&&rI(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=sX(e.focus.origin,"previous");sH(n)&&r.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=sQ(n))r.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!rI(e)||l.has(e)||e.isEmpty()||r.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){let n=r7(e.anchor),i=r7(e.anchor.getFlipped()),r=e=>s$(e)?e.origin:e.getNodeAtCaret(),l=r(n)||r(i)||(e.anchor.getNodeAtCaret()?n.origin:i.origin);t.push(l)}return t}(r9(r3(this),"next"));return rc()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,i){return this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,i,"text"),this}getTextContent(){let e=this.getNodes();if(0===e.length)return"";let t=e[0],n=e[e.length-1],i=this.anchor,r=this.focus,l=i.isBefore(r),[o,s]=iM(this),a="",u=!0;for(let f=0;f<e.length;f++){let d=e[f];if(rI(d)&&!d.isInline()){u||(a+="\n");let e="";for(let t of sb(d)){let n=sN(d,t);null!==n&&(e+=n.getTextContent())}""!==e?(a+=e,u=!1):u=!d.isEmpty()}else if(u=!1,ia(d)){let e=d.getTextContent();d===t?d===n?"element"===i.type&&"element"===r.type&&r.offset!==i.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=l?e.slice(o):e.slice(s):d===n&&(e=l?e.slice(0,s):e.slice(0,o)),a+=e}else!rz(d)&&!rY(d)||d===n&&this.isCollapsed()||(a+=d.getTextContent())}return a}applyDOMRange(e){let t=ry(),n=t.getEditorState()._selection,i=iU(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===i)return;let[r,l,o]=i;this.anchor.set(r.key,r.offset,r.type,!0),this.focus.set(l.key,l.offset,l.type,!0),o&&(this.dirty=!0),eS(this)}clone(){let e=this.anchor,t=this.focus;return new iT(i_(e.key,e.offset,e.type),i_(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=lW(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=M[e];return 0!=(this.format&t)}insertRawText(e){this.insertNodes(i8(e))}insertText(e){let t=this.format,n=this.style;if(!this.isCollapsed()){let i=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(ia(i)&&(t=i.getFormat(),n=i.getStyle()),this.removeText(),this.format=t,this.style=n,""===e)return;if(null===lV())return"element"===this.anchor.type&&im(this.anchor,this.focus,t,n),void ix(this,e,t,n)}"element"===this.anchor.type&&im(this.anchor,this.focus,t,n);let i=this.anchor.getNode();ia(i)||r(398);let l=this.anchor.offset,o=i.getParentOrThrow(),s=i.getTextContentSize();if(lK(i)||0===l&&(!i.canInsertTextBefore()||!o.canInsertTextBefore()&&!i.__prev)||l===s&&(!i.canInsertTextAfter()||!o.canInsertTextAfter()&&!i.__next)){if(i.isSegmented()&&0!==l&&l!==s){if(null!==lV())i.setMode("normal").setFormat(t).setStyle(n);else{let e=is(i.getTextContent());e.setFormat(t),e.setStyle(n);let r=iG()===this;i.replace(e),this.setTextNodeRange(e,l,e,l),r&&iG()!==this&&l3(this)}return void(""!==e&&this.insertText(e))}if(""===e)return;if(0===l){let r=i.getPreviousSibling();if(ia(r)&&r.canInsertTextAfter()&&!lK(r))r.select();else{let e=is();e.setFormat(t),e.setStyle(n),o.canInsertTextBefore()?i.insertBefore(e):o.insertBefore(e),e.select()}return void this.insertText(e)}if(l===s){let r=i.getNextSibling();if(ia(r)&&r.canInsertTextBefore()&&!lK(r))r.select(0,0);else{let e=is();e.setFormat(t),e.setStyle(n),o.canInsertTextAfter()?i.insertAfter(e):o.insertAfter(e),e.select(0,0)}return void this.insertText(e)}let r=is(e);return r.setFormat(t),r.setStyle(n),i.replace(r),void r.select()}if(""===e)return;let a=o.isInline()&&0===l&&!i.__prev,u=o.isInline()&&l===s&&!i.__next,f=i.getFormat()!==t||i.getStyle()!==n;if(a||u||f){if(""!==i.getTextContent()||a||u)return void ix(this,e,t,n);i.setFormat(t),i.setStyle(n)}i.spliceText(l,0,e,!0),i.isComposing()&&"text"===this.anchor.type&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=iG()===this,t=this.anchor.key;r2(this,function(e,t="removeEmptySlices"){let n,i;if(e.isCollapsed())return e;let l="root",o="next",s=t,a=r9(e,o),u=a.anchor.origin;for(;null!==u&&!ok(u);)u=u.getParent();let f=rI(u)?u.getFirstChild():null,d=r6(a.anchor,l),c=r6(a.focus.getFlipped(),l),h=new Set,g=[];for(let e of a.iterNodeCarets(l))if(sH(e))h.add(e.origin.getKey());else if(sU(e)){let{origin:t}=e;rI(t)&&!h.has(t.getKey())||g.push(t)}let _=new Set;for(let e of g){let t=e.getParent();null===t||h.has(t.getKey())||_.add(t),lH(e)}for(let e of _)!e.canBeEmpty()&&!ok(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),i=r4(sq(t,o)),r=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===s||"token"===r&&0!==e.distance)i.remove();else if(0!==e.distance){s="removeEmptySlices";let t=e.removeTextSlice(),n=e.caret.origin;if("segmented"===r){let e=t.origin,n=is(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());i.replaceOrInsert(n),t=sY(n,o,t.offset)}n.is(d[0].origin)&&(d[0]=t),n.is(c[0].origin)&&(c[0]=t.getFlipped())}}for(let e of d)if(r5(e)){n=r7(e);break}for(let e of c)if(r5(e)){i=r7(e);break}let p=function(e,t,n){let i;if(!e||!t)return null;let r=e.getParentAtCaret(),l=t.getParentAtCaret();if(!r||!l)return null;let o=r.getParents().reverse();o.push(r);let s=l.getParents().reverse();s.push(l);let a=Math.min(o.length,s.length);for(i=0;i<a&&o[i]===s[i];i++);let u=(e,t)=>
1{let n;for(let r=i;r<e.length;r++){let i=e[r];if(ok(i))return;!n&&t(i)&&(n=i)}return n},f=u(o,o0),d=f&&u(s,e=>n.has(e.getKey())&&o0(e));return d&&sb(d).length>0?null:f&&d?[f,d]:null}(n,i,h);if(p){let[e,t]=p;sX(e,"previous").splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(i){let e=function(e){if(sH(e)){let t=e.origin;if(o0(t))return t}else{let t=e.getParentAtCaret();if(t&&o0(t))return t}return null}(i),t=e&&e.getParent(),n=e&&e.getParents().findLast(oT);if(e&&t&&!rR(t)&&e.isEmpty()&&h.has(e.getKey())&&0===sb(e).length&&(!n||h.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!rR(n)&&n.isEmpty();){let e=n.getParent();if(e&&rR(e)&&1>=e.getChildrenSize())break;let t=n;n=e,t.remove(!0)}}}null===l2(u,f)&&l2(l1(),null);let y=[n,i,...d,...c].find(r5);if(y)return s4(s2(r7(y),e.direction));r(269,JSON.stringify(d.map(e=>e.origin.__key)))}(r3(this))),this.isCollapsed()&&function(e,t){let n=e.anchor;if(n.key===t)return;let i=n.getNode(),r=0,l="";ia(i)?(r=i.getFormat(),l=i.getStyle()):rI(i)&&(r=i.getTextFormat(),l=i.getTextStyle()),e.format===r&&e.style===l||(e.format=r,e.style=l,e.dirty=!0)}(this,t),e&&iG()!==this&&l3(this)}formatText(e,t=null){iw(this,e,t)}insertNodes(e){var t;if(0===e.length)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if("element"===this.anchor.type&&rI(n)&&n.isShadowRoot()&&null!==sx(n)){let t=n.getFirstChild()??n.append(lu()).getFirstChild();if(null!==t&&!rI(t)){let e=lu();t.insertBefore(e),t=e}if(null!==t){t.selectStart();let n=iG();return iv(n)||r(369),n.insertNodes(e)}}if("element"===this.anchor.type&&ok(n)){let t=rn(e),i=t.getLastDescendant();return n.splice(this.anchor.offset,0,t.getChildren()),void(null!==i&&i.selectEnd())}let i=this.isBackward()?this.focus:this.anchor,l=i.getNode(),o=sh(l,o0),s=e[e.length-1];if(rI(o)&&"__language"in o){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let[,t]=re(this);o.splice(t,0,e),s.selectEnd()}return}if(!e.some(e=>(rI(e)||rz(e))&&!e.isInline())){rI(o)||r(211,l.constructor.name,l.getType());let[t,n]=re(this,!0);return(rI(t)?t:o).splice(n,0,e),void s.selectEnd()}if(rI(o)&&null!==sx(o)){let[,t]=re(this),n=i9(e);o.splice(t,0,n);let i=n[n.length-1];return void(void 0!==i?i.selectEnd():o.select(t,t))}if(null===o){let t=rn(e),n=t.getLastDescendant(),i=rQ(this.anchor,"next");for(let e of t.getChildren())i=ll(e,i);return void(null!==n&&n.selectEnd())}if(rI(o)&&!o.isParentRequired()&&!ok(o.getParentOrThrow())){let[,t]=re(this),n=i9(e);o.splice(t,0,n);let i=n[n.length-1];return void(void 0!==i?i.selectEnd():o.select(t,t))}let a=rn(e),u=a.getLastDescendant(),f=a.getChildren(),d=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return"element"===e.type&&rI(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;null!==e&&!o0(e)&&!ok(e);e=e.getParent()){let t=e.getPreviousSibling();if(null!==t)return t}return null}(e);return rY(t)&&rY(t.getPreviousSibling())}(i),c=rI(o)&&o.isEmpty()?null:this.insertParagraph();c&&!o.isAttached()&&(o=sh(l=this.anchor.getNode(),o0));let h=f[f.length-1],g=f[0];t=g,d||!rI(t)||!o0(t)||t.isEmpty()||!rI(o)||o.isEmpty()&&!o.canMergeWhenEmpty()||(rI(o)||r(211,l.constructor.name,l.getType()),o.append(...g.getChildren()),g=f[1]),g&&(null===o&&r(212,l.constructor.name,l.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),i=t,l=[t];for(;i!==n;)i.getNextSibling()||r(140),l.push(i=i.getNextSibling());let o=e;for(let e of l)o=o.insertAfter(e)}(o,g));let _=sh(u,o0),p=u.selectEnd();c&&(rI(_)&&(c.canMergeWhenEmpty()||o0(h))?(_.append(...c.getChildren()),c.remove()):c.isEmpty()&&c.remove()),rI(o)&&o.isEmpty()&&o.remove();let y=rI(o)?o.getLastChild():null;rY(y)&&_!==o&&y.remove();let m=r7(rQ(p.anchor,"next"));r0(p.anchor,m),r0(p.focus,m)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if("element"===this.anchor.type&&ok(e)){let t=lu();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=re(this),n=sh(this.anchor.getNode(),o0);if(null!==n&&null!==sx(n))return null;rI(n)||r(213);let i=n.getChildAtIndex(t),l=i?[i,...i.getNextSiblings()]:[],o=n.insertNewAfter(this,!1);return o?(o.append(...l),o.selectStart(),o):null}insertLineBreak(e){let t=rq();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],i=e[t-1],[r,l]=iM(this),o=this.isBackward(),[s,a]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=o?[l,r]:[r,l];if(0===t)return[];if(1===t){if(ia(n)&&!this.isCollapsed()){let e=n.splitText(u,f),t=0===u?e[0]:e[1];return t?(s.set(t.getKey(),0,"text"),a.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(ia(n)&&(u===n.getTextContentSize()?e.shift():0!==u&&([,n]=n.splitText(u),e[0]=n,s.set(n.getKey(),0,"text"))),ia(i)){let t=i.getTextContent().length;0===f?e.pop():f!==t&&([i]=i.splitText(f),e[e.length-1]=i,a.set(i.getKey(),i.getTextContentSize(),"text"))}return e}
1modify(e,t,n){if(ri(this,e,t,n))return;let i="move"===e,r=ry(),l=oA(oC(r));if(!l)return;let o=r._blockCursorElement,s=r._rootElement,a=this.focus.getNode();null===s||null===o||!rI(a)||a.isInline()||a.canBeEmpty()||oO(o,r,s);let u=og(r,this.focus.key),f=u;if("text"===this.focus.type&&(f=ia(a)?o4(a,u,r):null),this.dirty){let e=og(r,this.anchor.key),t=e;if("text"===this.anchor.type){let n=this.anchor.getNode();t=ia(n)?o4(n,e,r):null}t&&f&&i3(l,t,this.anchor.offset,f,this.focus.offset)}if("character"===n&&ia(a)&&a.isUnmergeable()&&(t?0===this.focus.offset:this.focus.offset===a.getTextContentSize())){let e=sq(a,t?"previous":"next").getNodeAtCaret();if(ia(e)){if(!i){let n=e.getTextContentSize();return t?this.focus.set(e.__key,n-1,"text"):this.focus.set(e.__key,1,"text"),void(this.dirty=!0)}{let n=r.getElementByKey(e.getKey()),i=n?o4(e,n,r):null;if(i){let e=t?i.length:0;i3(l,i,e,i,e)}}}}if(iF(l,e,t?"backward":"forward",n,s),l.rangeCount>0){let e=oB(l,r._rootElement),n=e||l.getRangeAt(0),o=this.anchor.getNode(),s=rR(o)?o:ov(o);this.applyDOMRange(n),this.dirty=!0,i||(iP(this,t,s),(e?"backward"!==l.direction:l.anchorNode===n.startContainer&&l.anchorOffset===n.startOffset)||iD(this))}"lineboundary"===n&&ri(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&rI(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(rI(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=rI(n)?n.getNextSibling():null;if(!(rI(n)&&n.isEmpty()&&rI(e)&&e.isShadowRoot()))return}let i=rQ(t,e?"previous":"next"),r=s3(i);if(r.getTextSlices().every(e=>null===e||0===e.distance)){if("element"===t.type){let e=i.getNodeAtCaret();if(rI(e)&&oM(e)){let t=e.getParent();e.remove();let n=l2(t,e);return void(null!==n&&n.selectStart())}}let e={type:"initial"};for(let t of r.iterNodeCarets("shadowRoot"))if(sH(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(rI(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=r7(t);r2(this,s6(e,e)),r.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(sU(t)){if(rI(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(rz(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&rI(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=iV();e.add(t.origin.getKey()),l3(e)}else{let e=t.origin,n=e.getParent();e.remove();let i=l2(n,e);null!==i&&i.selectStart()}return}if(rY(t.origin))return void t.origin.remove();break}}if("merge-block"===e.type){let{caret:t,block:n}=e;if(sb(n).length>0)return;return t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(r2(this,s6(!t.origin.isEmpty()&&n.isEmpty()?r4(sq(n,t.direction)):r.anchor,t)),this.removeText())}for(let e=t.getNode();null!==e;){if(null!==sx(e))return;if(rI(e)&&e.isShadowRoot())break;e=e.getParent()}}let l=this.focus;if(iI(this,e,"character"),this.isCollapsed()){if(e&&0===t.offset&&iO(this,t.getNode()))return}else{let i="text"===l.type?l.getNode():null;if(n="text"===t.type?t.getNode():null,null!==i&&i.isSegmented()){let t=l.offset,r=i.getTextContentSize();if(i.is(n)||e&&t!==r||!e&&0!==t)return void iK(i,e,t)}else if(null!==n&&n.isSegmented()){let r=t.offset,l=n.getTextContentSize();if(n.is(i)||e&&0!==r||!e&&r!==l)return void iK(n,e,r)}!function(e,t){let n=e.anchor,i=e.focus,r=n.getNode();if(r===i.getNode()&&"text"===n.type&&"text"===i.type){var l;let e=n.offset,o=i.offset,s=e<o,a=s?e:o,u=s?o:e,f=u-1;a===f||l5(l=r.getTextContent().slice(a,u))||iL(l)||(t?i.set(i.key,f,i.type):n.set(n.key,f,n.type))}}(this,e)}}if(t||iA(this),this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){let e=this.anchor.getNode();e.isEmpty()&&rR(e.getParent())&&null===e.getPreviousSibling()&&iO(this,e),iS()}}deleteLine(e){let t=this.isCollapsed(),n=iR(this.anchor);if(null!==n&&rz(sC(n)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);(this.isCollapsed()&&iI(this,e,"lineboundary"),this.isCollapsed())?this.deleteCharacter(e):sh(this.anchor.getNode(),o0)!==sh(this.focus.getNode(),o0)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):(t||iA(this),this.removeText())}deleteWord(e){let t=this.isCollapsed();
1if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;iI(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):(t||iA(this),this.removeText())}isBackward(){let e=this._cachedIsBackward;if(null!==e)return e;let t=this.focus.isBefore(this.anchor);return rc()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function ik(e){return e instanceof iC}function ib(e,t){if(ik(e)){for(let n of e.getNodes())n7(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void lJ(null);let n=[];for(let i of e.getNodes())ia(i)?n.push(i):rI(i)?i.setTextFormat(t(i.getTextFormat())):n7(i)&&i.setFormat(t(i.getFormat()));let i=n.length;if(0===i)return e.setFormat(t(e.format)),void lJ(null);let r=e.anchor,l=e.focus,o=e.isBackward(),s=o?l:r,a=o?r:l,u=0,f=n[0],d="element"===s.type?0:s.offset;if("text"===s.type&&d===f.getTextContentSize()&&(u=1,f=n[1],d=0),null==f)return;let c=i-1,h=n[c],g="text"===a.type?a.offset:h.getTextContentSize();if(f.is(h)){if(d===g)return;let n=t(f.getFormat());if(lK(f)||0===d&&g===f.getTextContentSize())f.setFormat(n);else{let e=f.splitText(d,g),t=0===d?e[0]:e[1];t.setFormat(n),"text"===s.type&&s.set(t.__key,0,"text"),"text"===a.type&&a.set(t.__key,g-d,"text")}return void(e.format=n)}0===d||lK(f)||([,f]=f.splitText(d),d=0);let _=t(f.getFormat());f.setFormat(_);let p=t(h.getFormat());g>0&&(g===h.getTextContentSize()||lK(h)||([h]=h.splitText(g)),h.setFormat(p));for(let e=u+1;e<c;e++){let i=n[e];i.setFormat(t(i.getFormat()))}"text"===s.type&&s.set(f.__key,d,"text"),"text"===a.type&&a.set(h.__key,g,"text"),e.format=_|p}function iN(e,t){let n=[];for(let[e,i]of Object.entries(t))"boolean"==typeof i&&n.push([e,i]);0!==n.length&&ib(e,e=>{for(let[t,i]of n)e=lW(e,t,i?M[t]:0);return e})}function iw(e,t,n=null){let i=null===n&&iv(e)?lW(e.format,t,null):n;ib(e,e=>lW(e,t,i))}function iE(e){let t=e.offset;if("text"===e.type)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function iM(e){let t=e.getStartEndPoints();if(null===t)return[0,0];let[n,i]=t;return"element"===n.type&&"element"===i.type&&n.key===i.key&&n.offset===i.offset?[0,0]:[iE(n),iE(i)]}function iO(e,t){for(let n=t;n;n=n.getParent()){if(rI(n)){if(n.collapseAtStart(e))return!0;if(ok(n))break}if(n.getPreviousSibling())break}return!1}function iA(e){let t=l1();!t.isEmpty()&&lo(t,e)&&(e.anchor.set(t.getKey(),0,"element"),e.focus.set(t.getKey(),t.getChildrenSize(),"element"))}function iD(e){let t=e.focus,n=e.anchor,i=n.key,r=n.offset,l=n.type;n.set(t.key,t.offset,t.type,!0),t.set(i,r,l,!0)}function iF(e,t,n,i,r){let l="character"===i?oW(e,r):null,o=l&&l.focusNode,s=l?l.focusOffset:0;if(e.modify(t,n,i),null===l||null===o||3!==o.nodeType||("backward"===n?!(s>0):"forward"!==n||!(s<o.length)))return;let a=oW(e,r);a.focusNode===o&&a.focusOffset===s&&e.modify(t,n,i)}function iP(e,t,n){let i=e.getNodes(),r=i.filter(e=>om(e,n));if(0===r.length||r.length===i.length)return!1;let l=t?r[0]:r[r.length-1],o=rI(l)?l:l.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function iI(e,t,n){if(ri(e,"extend",t,n))return;let i=ry(),r=oA(oC(i));if(!r||"function"!=typeof r.modify)return;let l=i._blockCursorElement,o=i._rootElement,s=e.anchor,a=e.focus.getNode();null===o||null===l||!rI(a)||a.isInline()||a.canBeEmpty()||oO(l,i,o);let u=e=>{let t=e.getNode(),n=i.getElementByKey(e.key);return null!==n&&"text"===e.type&&ia(t)?o4(t,n,i):n},f=s.getNode(),d=u(s);if(null===d)return;let c=s.offset,h=e.isCollapsed(),g=e.focus,_=h?d:u(g);if(null===_)return;let p=g.offset;if(i3(r,_,p,_,p),iF(r,"move",t?"backward":"forward",n,o),0===r.rangeCount)return;let y=oB(r,o)||r.getRangeAt(0),m=y.startContainer,x=y.startOffset;if(h&&"character"===n&&"text"===s.type&&ia(f)&&f.isUnmergeable()&&c===(t?0:f.getTextContentSize())){let n=sq(f,t?"previous":"next").getNodeAtCaret();if(ia(n)){let i=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,i,"text"),void(e.dirty=!0)}}if(h&&"character"===n&&"text"===s.type){let n=t?0:f.getTextContentSize(),i=m===d?x:c!==n?n:-1;if(i>=0)return void(i!==c&&(e.focus.set(s.key,i,"text"),e.dirty=!0))}let[C,S,v,T]=t?[m,x,d,c]:[d,c,m,x],k=rR(f)?f:ov(f);e.applyDOMRange({collapsed:!1,endContainer:v,endOffset:T,startContainer:C,startOffset:S}),e.dirty=!0,!iP(e,t,k)&&t&&iD(e),"lineboundary"===n&&ri(e,"extend",t,n,"decorators")}let iL=(()=>{try{let e=RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("\uD83D\uDC4D"))return t}catch(e){}return()=>!1})();function iK(e,t,n){let i=e.getTextContent().split(/(?=\s)/g),r=i.length,l=0,o=0;for(let e=0;e<r;e++){let s=e===r-1;if(o=l,l+=i[e].length,t&&l===n||l>n||s){i.splice(e,1),s&&(o=void 0);break}}let s=i.join("").trim();""===s?e.remove():(e.setTextContent(s),e.select(o,o))}
1function iz(e,t,n,i){let l,o=t,s=!1;if(oV(e)){let a=!1,u=e.childNodes,f=u.length,d=i._blockCursorElement;o===f&&f>0&&(a=!0,o=f-1),void 0!==lX(e,i)||sl(e,i)||(s=!0);let c=u[o],h=!1;if(c===d)c=u[o+1],h=!0;else if(null!==d){let n=d.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,d)&&o--}if(ia(l=l6(c)))o=sG(l,a?"next":"previous");else{let u=l6(e);if(null===u)return null;if(rI(u)){let s=i.getElementByKey(u.getKey());null===s&&r(214);let f=o3(u,s,i);[u,o]=f.resolveChildIndex(u,s,e,t),rI(u)||r(215),a&&o>=u.getChildrenSize()&&(o=Math.max(0,u.getChildrenSize()-1));let d=u.getChildAtIndex(o);if(rI(d)&&function(e,t,n){let i=e.getParent();return null===n||null===i||!i.canBeEmpty()||i!==n.getNode()}(d,0,n)){let e=a?d.getLastDescendant():d.getFirstDescendant();u=null===e||rI(d=e)?d:d.getParentOrThrow(),o=0}ia(d)?(l=d,u=null,o=sG(d,a?"next":"previous")):d!==u&&a&&!h&&(rI(u)||r(216),o=Math.min(u.getChildrenSize(),o+1))}else{let n=sC(u),r=null!==n?n:u,l=r.getIndexWithinParent(),s=i.getElementByKey(u.getKey()),a="after";if(null!==s&&l6(e)===u){let n=o3(u,s,i);n.element!==s?a=n.resolveLeafPosition(s,e,t):0===t&&rz(u)&&(a="before")}o="before"===a?l:l+1,u=r.getParentOrThrow()}if(rI(u))return[i_(u.__key,o,"element"),s]}}else l=l6(e);return ia(l)?[i_(l.__key,sG(l,o,"clamp"),"text"),s]:null}function iB(e,t,n){let i=e.offset,r=e.getNode();if(0===i){let i=r.getPreviousSibling(),l=r.getParent();if(t){if((n||!t)&&null===i&&rI(l)&&l.isInline()){let t=l.getPreviousSibling();ia(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else rI(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):ia(i)&&!r.isUnmergeable()&&e.set(i.__key,i.getTextContent().length,"text")}else if(i===r.getTextContent().length){let i=r.getNextSibling(),l=r.getParent();if(t&&rI(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&null===i&&rI(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){let t=l.getNextSibling();ia(t)&&e.set(t.__key,0,"text")}}}function iR(e){let t=lq(e.key);return null===t?null:sv(t)}function iW(e,t,n){let i=iR(e),r=iR(t);if(i===r||null!==i&&null!==r&&i.is(r))return!1;let l=n(i,r);if(null!==i)return rI(i)?t.set(i.getKey(),l?i.getChildrenSize():0,"element"):t.set(i.getKey(),l?i.getTextContentSize():0,"text"),!0;let o=sC(r);if(null===o)return!1;let s=o.getParent();if(null===s)return!1;let a=o.getIndexWithinParent();return t.set(s.getKey(),l?a+1:a,"element"),!0}function i$(e){let t=iW(e.anchor,e.focus,(t,n)=>(function(e,t,n,i){if(null!==n&&null!==i){let e=sC(n),t=sC(i);if(null!==e&&e.is(t)){for(let t of sk(e).values()){if(t===n.getKey())break;if(t===i.getKey())return!1}return!0}return null===e||null===t||e.isBefore(t)}if(null!==n){let e=sC(n),i=lq(t.key);return null===e||null===i||!(!e.is(i)&&!e.isParentOf(i))||e.isBefore(i)}let r=sC(i),l=lq(e.key);return null!==r&&null!==l&&!r.is(l)&&!r.isParentOf(l)&&l.isBefore(r)})(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function iU(e,t,n,i,r,l){if(null===e||null===n||!lD(r,e,n))return null;let o=iz(e,t,iv(l)?l.anchor:null,r);if(null===o)return null;let s=iz(n,i,iv(l)?l.focus:null,r);if(null===s)return null;let[a,u]=o,[f,d]=s;if("element"===a.type&&"element"===f.type){let t=l6(e),i=l6(n);if(rz(t)&&rz(i))return null}let c=r._slotsUsed&&iW(a,f,()=>0!=(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING));return function(e,t){if("text"===e.type&&"text"===t.type){let n=e.isBefore(t),i=e.is(t);iB(e,n,i),iB(t,!n,i),i&&t.set(e.key,e.offset,e.type)}}(a,f),[a,f,u||d||c]}function iH(e){return rI(e)&&!e.isInline()}function ij(e,t,n,i,r,l){let o=r_(),s=new iT(i_(e,t,r),i_(n,i,l),0,"");return s.dirty=!0,o._selection=s,s}function iJ(){return new iT(i_("root",0,"element"),i_("root",0,"element"),0,"")}function iV(){return new iC(new Set)}function iq(e,t){return iY(null,e,t,null)}function iY(e,t,n,i){let r,l,o,s,a=n._window;if(null===a)return null;let u=i||a.event,f=u?u.type:void 0,d="selectionchange"===f,c=!X&&(d||"beforeinput"===f||"compositionstart"===f||"compositionend"===f||"click"===f&&u&&3===u.detail||"drop"===f||void 0===f);if(iv(e)&&!c)return e.clone();{if(null===t)return null;let i=oW(t,n._rootElement);
1if(r=i.anchorNode,l=i.focusNode,o=i.anchorOffset,s=i.focusOffset,(d||void 0===f)&&iv(e)&&!lD(n,r,l))return e.clone()}let h=iU(r,o,l,s,n,e);if(null===h)return null;let[g,_,p]=h,y=0,m="";if(iv(e)){let t=e.anchor;if(g.key===t.key)y=e.format,m=e.style;else{let e=g.getNode();ia(e)?(y=e.getFormat(),m=e.getStyle()):rI(e)&&(y=e.getTextFormat(),m=e.getTextStyle())}}let x=new iT(g,_,y,m);return p&&(x.dirty=!0),x}function iG(){return r_()._selection}function iX(){return ry()._editorState._selection}function iZ(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function iQ(e,t,n,i=1){if(!iZ(e,t))return;let r=e.anchor,l=e.focus,o=t.__key;if(e.isCollapsed()){let t=r.offset;if(n<=t&&i>0||n<t&&i<0){let n=Math.max(0,t+i);r.set(o,n,"element"),l.set(o,n,"element"),i0(e)}}else{let s=e.isBackward(),a=s?l:r,u=a.getNode(),f=s?r:l,d=f.getNode();if(t.is(u)){let e=a.offset;(n<=e&&i>0||n<e&&i<0)&&a.set(o,Math.max(0,e+i),"element")}if(t.is(d)){let e=f.offset;(n<=e&&i>0||n<e&&i<0)&&f.set(o,Math.max(0,e+i),"element")}}i0(e)}function i0(e){let t=e.anchor,n=t.offset,i=e.focus,r=i.offset,l=t.getNode(),o=i.getNode();if(e.isCollapsed()){if(!rI(l))return;let e=l.getChildrenSize(),r=n>=e,o=r?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(ia(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),i.set(o.__key,e,"text")}return}if(rI(l)){let e=l.getChildrenSize(),i=n>=e,r=i?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(ia(r)){let e=0;i&&(e=r.getTextContentSize()),t.set(r.__key,e,"text")}}if(rI(o)){let e=o.getChildrenSize(),t=r>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(r);if(ia(n)){let e=0;t&&(e=n.getTextContentSize()),i.set(n.__key,e,"text")}}}function i1(e,t,n,i,r){let l=null,o=0,s=null;null!==i?(l=i.__key,ia(i)?(o=i.getTextContentSize(),s="text"):rI(i)&&(o=i.getChildrenSize(),s="element")):null!==r&&(l=r.__key,ia(r)?s="text":rI(r)&&(s="element")),null!==l&&null!==s?e.set(l,o,s):(-1===(o=t.getIndexWithinParent())&&(o=n.getChildrenSize()),e.set(n.__key,o,"element"))}function i2(e,t,n,i,r){"text"===e.type?e.set(n,e.offset+(t?0:r),"text"):e.offset>i.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function i3(e,t,n,i,r){try{e.setBaseAndExtent(t,n,i,r)}catch(e){}}function i4(e,t,n){let i=og(e,t.getKey());if(rI(t)){let r=o3(t,i,e);return[r.element,n+r.getFirstChildOffset()]}return[i,n]}function i6(e,t,n,i,r,l){let o,s=l.getRootNode(),a=lB(s)||oF(s)?oU(s):null;if(r.has("collaboration")&&a!==l||null!==a&&lA(a,a))return;let f=oW(i,l);if(!iv(t))return void(null!==e&&lD(n,f.anchorNode,f.focusNode)&&i.removeAllRanges());let d=t.anchor,c=t.focus,h=d.getNode(),g=c.getNode(),[_,p]=i4(n,h,d.offset),[y,m]=i4(n,g,c.offset),x=t.format,C=t.style,S=t.isCollapsed(),v=_,T=y,k=!1;if("text"===d.type?(v=ia(h)?o4(h,_,n):null,k=h.getFormat()!==x||h.getStyle()!==C):iv(e)&&"text"===e.anchor.type&&(k=!0),"text"===c.type&&(T=ia(g)?o4(g,y,n):null),null!==v&&null!==T){if(S&&(null===e||k||iv(e)&&(e.format!==x||e.style!==C))&&(b=d.key,N=performance.now(),n._inputState.collapsedSelectionFormat={format:x,key:b,offset:p,style:C,timeStamp:N}),("Range"!==i.type||!S)&&f.anchorOffset===p&&f.focusOffset===m&&f.anchorNode===v&&f.focusNode===T){if(null===a||!l.contains(a)){let e=null!==a?lP(a):null;null!==e&&e!==n||r.has(nG)||l.focus({preventScroll:!0})}if("element"!==d.type)return}if(i3(i,v,p,T,m),u&&t.isCollapsed()&&null!==l&&!r.has(nG)){let e=o$(l);if(null===e||!l.contains(e)){let e=oU(l.ownerDocument),t=null!==e?lP(e):null;null!==t&&t!==n||l.focus({preventScroll:!0})}}if(!r.has(nq)&&t.isCollapsed()&&null!==l&&l===o$(l)){let e=iv(t)&&"element"===t.anchor.type?v.childNodes[p]||null:(void 0===o&&(o=oR(i,l)),o);if(null!==e){let t;if(lz(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){let i=op(n),r=ox(i);if(null===i||null===r)return;let l=n.getBoundingClientRect();if(t.bottom<l.top)return;let{top:o,bottom:s}=t,a=0,u=0,f=n;for(;null!==f;){let t=f===i.body;if(t){let t=r.visualViewport;if(t){let e=t.offsetTop;a=e,u=e+t.height}else a=0,u=oC(e).innerHeight;let n=r.getComputedStyle(i.documentElement),l=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);
1isFinite(l)&&(a+=l),isFinite(o)&&(u-=o)}else{let e=f===n?l:f.getBoundingClientRect();a=e.top,u=e.bottom}let d=0;if(o<a?d=-(a-o):s>u&&(d=s-u),0!==d)if(t)r.scrollBy(0,d);else{let e=f.scrollTop;f.scrollTop+=d;let t=f.scrollTop-e;o-=t,s-=t}if(t)break;f=o_(f)}}(n,t,l)}}var b,N,w=v,E=T;let s=n._inputState;s.isSelectionChangeFromDOMUpdate=!0,s.selectionChangeFromDOMUpdatePoints=void 0!==w&&void 0!==p&&void 0!==E&&void 0!==m?{anchorNode:w,anchorOffset:p,focusNode:E,focusOffset:m}:null}}function i5(e){let t=iG()||iX();null===t&&(t=l1().selectEnd()),t.insertNodes(e)}function i7(e,t){for(let n of e.split(/(\r?\n|\t)/))"\n"===n||"\r\n"===n?t.linebreak():"	"===n?t.tab():""!==n&&t.text(n)}function i8(e){let t=[];return i7(e,{linebreak:()=>t.push(rq()),tab:()=>t.push(ic()),text:e=>t.push(is(e))}),t}function i9(e){let t=[];for(let n of e)rY(n)||(!rI(n)&&!rz(n)||n.isInline()?t.push(n):rI(n)&&t.push(...i9(n.getChildren())));return t}function re(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let i=iG();iv(i)&&(n=i),iv(n)||r(161);let l=n.anchor,o=l.getNode(),s=l.offset;for(;!o0(o)&&null===sx(o);){let e=o;if([o,s]=function(e,t,n=!1){let i=e.getParent();if(!i){let e=lu();return l1().append(e),e.select(),[l1(),0]}if(ia(e)){let n=e.splitText(t);if(0===n.length)return[i,e.getIndexWithinParent()];let r=+(0!==t);return[i,n[0].getIndexWithinParent()+r]}if(!rI(e)||0===t)return[i,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let i=new iT(i_(e.__key,t,"element"),i_(e.__key,t,"element"),0,""),l=e.insertNewAfter(i);if(l)l.append(r,...r.getNextSiblings());else if(n)return[e,t]}return[i,e.getIndexWithinParent()+1]}(o,s,t),e.is(o))break}return[o,s]}function rt(e){return rY(e)||oS(e)||ia(e)||e.isParentRequired()}function rn(e){let t=lu(),n=null;for(let i=0;i<e.length;i++){let r=e[i];if(rt(r)){if(null===n){n=r.createParentElementNode(),t.append(n);let l=e[i+1];if(rY(r)&&(void 0===l||!rt(l)))continue}n.append(r)}else t.append(r),n=null}return t}function ri(e,t,n,i,r="decorators-and-blocks"){if("move"===t&&"character"===i&&!e.isCollapsed()){let[t,i]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return i.set(t.key,t.offset,t.type),!0}let l=rQ(e.focus,n?"previous":"next"),o="lineboundary"===i,s="move"===t,a=l,u="decorators-and-blocks"===r,f=!1;if(!r8(a)){for(let e of a){u=!1;let{origin:t}=e;if(rz(t)){if(t.isIsolated()){f=!0;break}if(a=e,o&&t.isInline())continue}break}if(f)return!0;if(u)for(let e of s3(l).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(sH(e))e.origin.isInline()||(a=e);else{if(rI(e.origin))continue;rz(e.origin)&&!e.origin.isInline()&&(a=e)}break}}if(a===l)return!1;if(s&&!o&&rz(a.origin)&&a.origin.isKeyboardSelectable()){let e=iV();return e.add(a.origin.getKey()),l3(e),!0}return a=r7(a),s&&r0(e.anchor,a),r0(e.focus,a),u||!o}let rr=null,rl=null,ro=!1,rs=!1,ra=!1,ru=new Set,rf=0,rd={characterData:!0,childList:!0,subtree:!0};function rc(){return ro||null!==rr&&rr._readOnly}function rh(){ro&&r(13)}function rg(){rf>99&&r(14)}function r_(){return null===rr&&r(195,rx()),rr}function rp(e){null!==r_()&&null===rl&&(rl=e),rl!==e&&l(378)}function ry(){return null===rl&&r(337,rx()),rl}function rm(){ry()._dirtyType=2}function rx(){let e=0,t=new Set,n=lk.version;if("undefined"!=typeof window)for(let i of oL(document)){let r=lI(i);if(lF(r))e++;else if(r){let e=String(r.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let i=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(i+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),i}function rC(e,t,n){let i=t.__type,r=lE(e,i),l=n.get(i);void 0===l&&(l=Array.from(r.transforms),n.set(i,l));let o=l.length;for(let e=0;e<o&&(l[e](t),t.isAttached());e++);}function rS(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function rv(e,t){if(!t)return;let n=e._updateTags,i=t;for(let e of(Array.isArray(t)||(i=[t]),i))n.add(e)}function rT(e){return rk(e,ry()._nodes)}function rk(e,t){let n=e.type,i=t.get(n);void 0===i&&r(17,n);let l=i.klass;e.type!==l.getType()&&r(18,l.name);let o=l.importJSON(e),s=e.children;if(rI(o)&&Array.isArray(s))for(let e=0;e<s.length;e++){let n=rk(s[e],t);o.append(n)}
1let a=e.$slots;if(a)for(let e in sy(o)||r(379,l.name),a)!function(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t||r(373,t);let i=e.getLatest();if(null!==i.__slots&&i.__slots.get(t)===n.getLatest().__key)return;(!rI(n)&&!rz(n)||n.isInline())&&r(374,n.__key);let l=e.getWritable(),o=sM(l),s=o.get(t);void 0!==s&&function(e){let t=lq(e);if(null===t)return;let n=t.getWritable();sm(n)||r(377,e),n.__slotHost=null,n.remove()}(s);let a=n.getWritable(),u=sC(a);if(null!==u){let e=sS(a);null!==e&&sM(u.getWritable()).delete(e),a.__slotHost=null}lH(a),a.__slotHost=l.__key,o.set(t,a.__key),function(e){let t=e.__slots;if(null===t||t.size<2)return;let n=function(e){let t=sO.get(e);if(void 0===t){let n=function(e){for(let{ownNodeConfig:t}of sf(e)){let e=t&&t.slots;if(e)return e}return sA}(e),i=new Map;for(let t of n)sw.includes(t)&&r(371,e.name,t),i.has(t)&&r(372,e.name,t),i.set(t,i.size);t=i,sO.set(e,t)}return t}(e.constructor),i=null,l=!0;for(let e of t.keys()){if(null!==i&&sF(i,e,n)>0){l=!1;break}i=e}if(l)return;let o=Array.from(t).sort(([e],[t])=>sF(e,t,n));for(let[e,n]of(t.clear(),o))t.set(e,n)}(l),ry()._slotsUsed=!0,r_()._slotsUsed=!0}(o,e,rk(a[e],t));return o}function rb(e,t,n){let i=rr,r=ro,l=rl;rr=t,ro=!0,rl=e;try{return n()}finally{rr=i,ro=r,rl=l}}function rN(e,t){let n=ra;ra=!0;try{!function(e,t){let n=e._pendingEditorState,i=e._rootElement,r=e._headless||null===i;if(null===n)return!e._updating&&e._deferred.length>0&&rE(e,e._deferred);let l=e._editorState,o=l._selection,s=n._selection,a=0!==e._dirtyType,u=rr,f=ro,d=rl,c=e._updating,h=e._observer,g=null;if(e._pendingEditorState=null,e._editorState=n,!r&&a&&null!==h){rl=e,rr=n,ro=!1,e._updating=!0;try{let t=e._dirtyType,i=e._dirtyElements,r=e._dirtyLeaves;h.disconnect(),g=function(e,t,n,i,r,l){eM="",eO=null,eA=null,eD=null,eJ=2===i,ew=n,eN=n._config,ej=n._config.dom||lC,eE=n._nodes,eL=ew._listeners.mutation,eK=r,ez=l,eB=e._nodeMap,eR=e,eW=t._nodeMap,eV=t._readOnly,e$=q(n._keyToDOMMap),eU=function(){let e=new Map,t=t=>{for(let n of t){let t=eW.get(n);if(void 0===t)continue;let i=t.__parent;if(null===i)continue;let r=e.get(i);void 0===r&&(r=new Set,e.set(i,r)),r.add(n)}};return t(eK.keys()),t(ez),e}();let o=new Map;return eH=o,ti("root",null),ew=void 0,eE=void 0,eK=void 0,ez=void 0,eB=void 0,eR=void 0,eW=void 0,eN=void 0,e$=void 0,eU=void 0,eH=void 0,ej=lC,o}(l,n,e,t,i,r)}catch(t){if(t instanceof Error&&e._onError(t),rs)throw t;return lx(e,null,i,n),ei(e),e._dirtyType=2,rs=!0,rN(e,l),void(rs=!1)}finally{h.observe(i,rd),e._updating=c,rr=u,ro=f,rl=d}}n._readOnly||(n._readOnly=!0);let _=e._dirtyLeaves,p=e._dirtyElements,y=e._normalizedNodes,m=e._updateTags;a&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set,function(e,t){let n,i=e._decorators,r=e._pendingDecorators||i,l=t._nodeMap;for(n in r)l.has(n)||(r===i&&(r=lQ(e)),delete r[n])}(e,n);let x=r?null:oA(oC(e));if(e._editable&&null!==x&&(a||null===s||s.dirty||!s.is(o))&&null!==i&&!m.has(nY)){rl=e,rr=n;try{if(null!==h&&h.disconnect(),a||null===s||s.dirty){let t=e._blockCursorElement;null!==t&&oO(t,e,i),i6(o,s,e,x,m,i)}!function(e,t,n){let i=e._blockCursorElement;if(iv(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(o$(t))){let r=n.anchor,l=r.getNode(),o=r.offset,s=!1,a=null;if(o===l.getChildrenSize())oM(l.getChildAtIndex(o-1))&&(s=!0);else{let t=l.getChildAtIndex(o);null!==t&&oM(t)&&(s=!0,a=e.getElementByKey(t.__key))}if(s){let n=o3(l,e.getElementByKey(l.__key),e).element;return null===i&&(e._blockCursorElement=i=function(e){let t=e.theme,n=oz().createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let i=t.blockCursor;return void 0!==i&&("string"==typeof i&&(i=t.blockCursor=an(i)),void 0!==i&&n.classList.add(...i)),n}(e._config)),t.style.caretColor="transparent",null===a?n.appendChild(i):n.insertBefore(i,a)}}null!==i&&oO(i,e,t)}(e,i,s)}finally{null!==h&&h.observe(i,rd),rl=d,rr=u}}null!==g&&function(e,t,n,i,r){let l=Array.from(e._listeners.mutation),o=l.length;for(let e=0;e<o;e++){let[o,s]=l[e];for(let e of s){let l=t.get(e);void 0!==l&&o(l,{dirtyLeaves:i,prevEditorState:r,updateTags:n})}}}(e,g,m,_,l),iv(s)||null===s||null!==o&&o.is(s)||e.dispatchCommand(tu);let C=e._pendingDecorators;null!==C&&(e._decorators=C,e._pendingDecorators=null,rw("decorator",e,!0,C)),function(e,t,n){let i=l0(t),r=l0(n);i!==r&&rw("textcontent",e,!0,r)}(e,t||l,n),rw("update",e,!0,{dirtyElements:p,dirtyLeaves:_,editorState:n,mutatedNodes:g,normalizedNodes:y,prevEditorState:t||l,tags:m}),c||rE(e,e._deferred),function(e){let t=e._updates;if(0===t.length)return e._cascadeCount=0;
1if(ru.has(e)||(ru.add(e),setTimeout(()=>{ru.delete(e),e._cascadeCount=0},0)),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,e._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${e._config.namespace}`));let n=t.shift();if(n){let[t,i]=n;rA(e,t,i)}}(e)}(e,t)}finally{ra=n}}function rw(e,t,n,...i){let r=t._updating;t._updating=n;try{let n=t._listeners[e];for(let[e,t]of Array.from(n)){t&&t();let r=e(...i),l="function"==typeof r?r:void 0;n.has(e)?n.set(e,l):l&&l()}}finally{t._updating=r}}function rE(e,t){if(e._deferred=[],0!==t.length){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function rM(e,t){let n=e._updates,i=t||!1;for(;0!==n.length;){let t=n.shift();if(t){let n,[l,o]=t,s=e._pendingEditorState;void 0!==o&&(n=o.onUpdate,o.skipTransforms&&(i=!0),o.discrete&&(null===s&&r(191),s._flushSync=!0),n&&e._deferred.push(n),rv(e,o.tag)),null==s?rA(e,l,o):l()}}return i}function rO(){let e=r_();rh(),e._flushSync=!0}function rA(e,t,n){let i=e._updateTags,l,o=!1,s=!1;void 0!==n&&(l=n.onUpdate,rv(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),l&&e._deferred.push(l);let a=e._editorState,u=e._pendingEditorState,f=!1;(null===u||u._readOnly)&&(u=e._pendingEditorState=rW(u||a),f=!0),u._flushSync=s;let d=rr,c=ro,h=rl,g=e._updating;rr=u,ro=!1,e._updating=!0,rl=e;let _=e._headless||null===e.getRootElement();lb=null;try{f&&(_?null!==a._selection&&(u._selection=a._selection.clone()):u._selection=function(e,t){let n=e.getEditorState()._selection,i=oA(oC(e));return iv(n)||null==n?iY(n,i,e,t):n.clone()}(e,n&&n.event||null));let i=e._compositionKey;t(),o=rM(e,o),function(e,t){let n=t.getEditorState()._selection,i=e._selection;if(iv(i)){let e,t=i.anchor,r=i.focus;if("text"===t.type&&(e=t.getNode()).selectionTransform(n,i),"text"===r.type){let t=r.getNode();e!==t&&t.selectionTransform(n,i)}}}(u,e),0!==e._dirtyType&&(o?function(e,t){let n=t._dirtyLeaves,i=e._nodeMap;for(let e of n){let t=i.get(e);ia(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&eC(t)}}(u,e):function(e,t){let n=t._dirtyLeaves,i=t._dirtyElements,r=e._nodeMap,l=lV(),o=new Map,s=n,a=s.size,u=i,f=u.size;for(;a>0||f>0;){if(a>0){for(let e of(t._dirtyLeaves=new Set,s)){let i=r.get(e);ia(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&eC(i),void 0!==i&&rS(i,l)&&rC(t,i,o),n.add(e)}if((a=(s=t._dirtyLeaves).size)>0){rf++;continue}}for(let e of(t._dirtyLeaves=new Set,t._dirtyElements=new Map,u.delete("root")&&u.set("root",!0),u)){let n=e[0],s=e[1];if(i.set(n,s),!s)continue;let a=r.get(n);void 0!==a&&rS(a,l)&&rC(t,a,o)}a=(s=t._dirtyLeaves).size,f=(u=t._dirtyElements).size,rf++}t._dirtyLeaves=n,t._dirtyElements=i}(u,e),rM(e),function(e,t,n,i){let r=e._nodeMap,l=t._nodeMap,o=[];for(let[e]of i){let t=l.get(e);void 0!==t&&(t.isAttached()||(rI(t)&&G(t,e,r,l,o,i),r.has(e)||i.delete(e),o.push(e)))}for(let e of n){let t=l.get(e);void 0===t||t.isAttached()||(sy(t)&&null!==t.__slots&&G(t,e,r,l,o,n),r.has(e)||n.delete(e),o.push(e))}for(let e of o)l.delete(e);let s=ry(),a=s._compositionKey;null===a||l.has(a)||(s._compositionKey=null)}(a,u,e._dirtyLeaves,e._dirtyElements)),i!==e._compositionKey&&(u._flushSync=!0);let l=u._selection;if(iv(l)){e._slotsUsed&&i$(l);let t=u._nodeMap,n=l.anchor.key,i=l.focus.key;void 0!==t.get(n)&&void 0!==t.get(i)||r(19)}else ik(l)&&0===l._nodes.size&&(u._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void rN(e)}finally{rr=d,ro=c,rl=h,e._updating=g,rf=0}0!==e._dirtyType||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,i=e._selection;if(null!==i){if(i.dirty||!i.is(n))return!0}else if(null!==n)return!0;return!1}(u,e)?u._flushSync?(u._flushSync=!1,rN(e)):f&&lO(()=>{rN(e)}):(u._flushSync=!1,f&&(i.clear(),e._deferred=[],e._pendingEditorState=null))}function rD(e,t,n){rl===e&&void 0===n?rc()?rA(e,t,n):t():rA(e,t,n)}function rF(e){if(ok(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}class rP extends nW{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:rF,extends:nW})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&r(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return D[this.getFormat()]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()&&0===sb(this).length}isDirty(){let e=ry()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){let e=[];for(let t of sb(this)){let n=sN(this,t);if(rI(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;null!==t;){if(ia(t)&&e.push(t),rI(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;rI(e);){let t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;rI(e);){let t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return rI(e)&&e.getLastDescendant()||e||null}let i=t[e];return rI(i)&&i.getFirstDescendant()||i||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:lq(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&r(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:lq(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&r(96,this.__key),e}getChildAtIndex(e){let t,n,i=this.getChildrenSize();if(e<i/2){for(t=this.getFirstChild(),n=0;null!==t&&n<=e;){if(n===e)return t;t=t.getNextSibling(),n++}return null}for(t=this.getLastChild(),n=i-1;null!==t&&n>=e;){if(n===e)return t;t=t.getPreviousSibling(),n--}return null}getTextContent(){let e=sD(this),t=this.getChildren(),n=t.length;for(let i=0;i<n;i++){let r=t[i];e+=r.getTextContent(),rI(r)&&i!==n-1&&!r.isInline()&&(e+="\n\n")}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of sb(e)){let i=sN(e,n);null!==i&&(t+=i.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let i=0;i<n;i++){let r=t[i];e+=r.getTextContentSize(),rI(r)&&i!==n-1&&!r.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){let t=A[e];return 0!=(this.getFormat()&t)}return!1}hasTextFormat(e){let t=M[e];return 0!=(this.getTextFormat()&t)}getFormatFlags(e,t){return lW(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){rh();let n=iG(),i=e,r=t,l=this.getChildrenSize();if(!this.canBeEmpty()){if(0===e&&0===t){let e=this.getFirstChild();if(ia(e)||rI(e))return e.select(0,0)}else if((void 0===e||e===l)&&(void 0===t||t===l)){let e=this.getLastChild();if(ia(e)||rI(e))return e.select()}}void 0===i&&(i=l),void 0===r&&(r=l);let o=this.__key;
1return iv(n)?(n.anchor.set(o,i,"element"),n.focus.set(o,r,"element"),n.dirty=!0,n):ij(o,i,o,r,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e&&A[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){nB(this)&&r(324,this.__key,this.__type);let i=this.getChildrenSize(),l=this.getWritable();for(let l of(e+t<=i||r(226,String(e),String(t),String(i)),n));let o=l.__key,s=[],a=[],u=this.getChildAtIndex(e+t),f=null,d=i-t+n.length;if(0!==e)if(e===i)f=this.getLastChild();else{let t=this.getChildAtIndex(e);null!==t&&(f=t.getPreviousSibling())}if(t>0){let e=null===f?this.getFirstChild():f.getNextSibling();for(let n=0;n<t;n++){null===e&&r(100);let t=e.getNextSibling(),n=e.__key;lH(e.getWritable()),a.push(n),e=t}}let c=f;for(let e of n){null!==c&&e.is(c)&&(f=c=c.getPreviousSibling()),null!==u&&e.is(u)&&(u=u.getNextSibling());let t=e.getWritable();t.__parent===o&&d--,lH(t);let n=e.__key;if(null===c)l.__first=n,t.__prev=null;else{let e=c.getWritable();e.__next=n,t.__prev=e.__key}e.__key===o&&r(76),t.__parent=o,s.push(n),c=e}if(null===u)null!==c&&(c.getWritable().__next=null,l.__last=c.__key);else{let e=u.getWritable();if(null!==c){let t=c.getWritable();e.__prev=c.__key,t.__next=u.__key}else e.__prev=null}if(l.__size=d,a.length){let e=iG();if(iv(e)){let t=new Set(a),n=new Set(s),{anchor:i,focus:r}=e;rL(i,t,n)&&i1(i,i.getNode(),this,f,u),rL(r,t,n)&&i1(r,r.getNode(),this,f,u),0!==d||this.canBeEmpty()||ok(this)||this.remove()}}return l}getDOMSlot(e){return new H(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(oV(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px",t.setAttribute("data-lexical-indent",String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0===t&&""===n||ok(this)||this.getChildren().some(ia)||(0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=o3(this,e,t),i=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let r=t.getElementByKey(e.getKey());null!==r&&(null==i?(n.insertChild(r),i=r):i!==r&&n.replaceChild(r,i),i=i.nextSibling)}}}function rI(e){return e instanceof rP}function rL(e,t,n){let i=e.getNode();for(;i;){let e=i.__key;if(t.has(e)&&!n.has(e))return!0;i=i.getParent()}return!1}class rK extends nW{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&r(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function rz(e){return e instanceof rK}class rB extends rP{__cachedText;$config(){return this.config("root",{extends:rP})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){r(51)}getTextContent(){let e=this.__cachedText;return null!==e&&(rc()||0===ry()._dirtyType)?e:super.getTextContent()}remove(){r(52)}replace(e){r(53)}insertBefore(e){r(54)}insertAfter(e){r(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)rI(e)||rz(e)||r(282);return super.splice(e,t,n)}static importJSON(e){return l1().updateFromJSON(e)}collapseAtStart(){return!0}}function rR(e){return e instanceof rB}function rW(e){return new rH(q(e._nodeMap),null,e._slotsUsed)}function r$(){return new rH(new Map([["root",new rB]]),null,!1)}function rU(e){return e instanceof rH}class rH{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&null===this._selection}read(e,t){return rb(t&&t.editor||null,this,e)}clone(e){let t=new rH(this._nodeMap,void 0===e?this._selection:e,this._slotsUsed);return t._readOnly=!0,t._parsed=this._parsed,t}toJSON(){return rb(null,this,()=>({root:function e(t){let n=t.exportJSON(),i=t.constructor;if(n.type!==i.getType()&&r(130,i.name),rI(t)){let l=n.children;Array.isArray(l)||r(59,i.name);let o=t.getChildren();for(let t=0;t<o.length;t++){let n=e(o[t]);l.push(n)}}let l=sb(t);if(l.length>0){let o={};for(let n of l){let l=sN(t,n);null===l&&r(366,i.name,n),o[n]=e(l)}n.$slots=o}return n}(l1())}))}}class rj extends rP{$config(){return this.config("artificial",{extends:rP})}createDOM(e){return oz().createElement("div")}}class rJ extends nW{$config(){return this.config("linebreak",{importDOM:{br:e=>rG(e)||rX(e)?null:{conversion:rV,priority:0}}})}getTextContent(){return"\n"}createDOM(){return oz().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function rV(e){return{node:rq()}}function rq(){return oN(new rJ)}function rY(e){return e instanceof rJ}function rG(e){let t=e.parentElement;if(null!==t&&oQ(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&rZ(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&rZ(n))return!0}}return!1}function rX(e){let t=e.parentElement;if(null!==t&&oQ(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&rZ(n))return!1;let i=t.lastChild;if(i===e||i.previousSibling===e&&rZ(i))return!0}return!1}function rZ(e){return lz(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function rQ(e,t){let{type:n,key:i,offset:l}=e,o=oE(e.key);return"text"===n?(ia(o)||r(266,o.getType(),i),sY(o,t,l)):(rI(o)||r(267,o.getType(),i),le(o,e.offset,t))}function r0(e,t){let{origin:n,direction:i}=t,l="next"===i;s$(t)?e.set(n.getKey(),t.offset,"text"):sU(t)?ia(n)?e.set(n.getKey(),sG(n,i),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!l,"element"):(sH(t)&&rI(n)||r(268),e.set(n.getKey(),l?0:n.getChildrenSize(),"element"))}function r1(e){let t=iG(),n=iv(t)?t:iJ();return r2(n,e),l3(n),n}function r2(e,t){r0(e.anchor,t.anchor),r0(e.focus,t.focus)}function r3(e){let{anchor:t,focus:n}=e,i=rQ(t,"next"),r=rQ(n,"next"),l=0>=s7(i,r)?"next":"previous";return s6(s2(i,l),s2(r,l))}function r4(e){let{direction:t,origin:n}=e,i=sq(n,sP[t]).getNodeAtCaret();return i?sq(i,t):sX(n.getParentOrThrow(),t)}function r6(e,t="root"){let n=[e];for(let i=sH(e)?e.getParentCaret(t):e.getSiblingCaret();null!==i;i=i.getParentCaret(t))n.push(r4(i));return n}function r5(e){return!!e&&e.origin.isAttached()}function r7(e){let t=function(e){let t=e;for(;sH(t);){let e=sQ(t);if(!sH(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(ia(t.origin))return s$(t)?t:sY(t.origin,n,n);let i=t.getAdjacentCaret();return sU(i)&&ia(i.origin)?sY(i.origin,n,sP[n]):t}function r8(e){return s$(e)&&e.offset!==sG(e.origin,e.direction)}function r9(e,t){return e.direction===t?e:s6(s2(e.focus,t),s2(e.anchor,t))}function le(e,t,n){let i=sX(e,"next");for(let e=0;e<t;e++){let e=i.getAdjacentCaret();if(null===e)break;i=e}return s2(i,n)}function lt(e,t="root"){let n=0,i=e,r=sQ(i);for(;null===r;){if(n--,!(r=i.getParentCaret(t)))return null;r=sQ(i=r)}return r&&[r,n]}function ln(e){let{origin:t,offset:n,direction:i}=e;if(n===sG(t,i))return e.getSiblingCaret();if(n===sG(t,sP[i]))return r4(e.getSiblingCaret());let[l]=t.splitText(n);return ia(l)||r(281),s2(sq(l,"next"),i)}function li(e,t){return!0}function lr(e,{$copyElementNode:t=ob,$splitTextPointCaretNext:n=ln,rootMode:i="shadowRoot",$shouldSplit:r=li,removeEmptyDestination:l=!1}={}){if(s$(e))return n(e);let o=e.getParentCaret(i);if(o){let{origin:n}=o;if(sH(e)){let e=r4(o);if(l&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!r(n,"first"))return e}let i=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(i.length>0||!l&&n.canBeEmpty()&&r(n,"last"))&&o.insert(t(n).splice(0,0,i))}return o}function ll(e,t,n){let i=s2(t,"next");s$(i)&&(0===i.offset?i=sq(i.origin,"previous").getFlipped():i.offset===i.origin.getTextContentSize()&&(i=sq(i.origin,"next"))),i.origin.is(e)&&(sU(i)||r(342,e.getKey(),e.getType()),i=r4(i)),(e.is(i.getNodeAtCaret())||e.is(i.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=i;e;e=lr(e,n))i=e;return s$(i)&&r(283),i.insert(e.isInline()?lu().append(e):e),s2(sq(e.getLatest(),"next"),t.direction)}
1function lo(e,t){let n=r9(iv(t)?r3(t):t,"next"),i=sv(n.anchor.origin),r=sv(e.getLatest());if(null===i?null!==r:!i.is(r))return!1;let l=r7(sX(e,"next")),o=s2(r7(sX(e,"previous")),"next");return 0>=s7(n.anchor,l)&&s7(n.focus,o)>=0}class ls extends rP{$config(){return this.config("paragraph",{extends:rP,importDOM:{p:()=>({conversion:la,priority:0})}})}createDOM(e){let t=oz().createElement("p"),n=ou(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(oV(t)){this.isEmpty()&&t.append(oz().createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(){let e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){let t=this.getChildren().find(ia);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}extractWithChild(e,t,n){if(!iv(t)||""===this.getFormatType()&&0===this.getIndent()&&""===this.getStyle())return!1;if(lo(this,t)){let e=this.getTextContent();return""!==e&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=lu();n.setTextFormat(e.format),n.setTextStyle(e.style);let i=this.getDirection();return n.setDirection(i),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>ia(e)&&!/\S/.test(e.getTextContent()))){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function la(e){let t=lu();if(sn(t,e),se(e,t),""===t.getFormatType()){let n=e.getAttribute("align");n&&n&&n in A&&t.setFormat(n)}return st(t,e),{node:t}}function lu(){return oN(new ls)}function lf(e){return e instanceof ls}function ld(e){console.warn(e)}let lc=0,lh=1,lg=2,l_=3,lp=4,ly=-8,lm=-4;function lx(e,t,n,i,r){let l=e._keyToDOMMap;l.clear(),e._editorState=r$(),e._pendingEditorState=i,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,r&&r.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,null!==e._inputState.handledSelectionCommandTimeoutId&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;null!==o&&(o.disconnect(),e._observer=null),null!==t&&(t.textContent="",function(e,t){let n=`__lexicalKey_${t._key}`;delete e[n]}(t,e)),null!==n&&(n.textContent="",l.set("root",n),lG(n,e,"root"))}let lC={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,i)=>{},$exportDOM:(e,t)=>{let n=lM(t,e.getType());return n&&void 0!==n.exportDOM?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,i,r)=>rI(e)&&e.extractWithChild(t,n,i),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,i)=>null,$shouldExclude:(e,t,n)=>rI(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,i)=>e.updateDOM(t,n,i._config)};function lS(e){let t,n=e||{},i=rl,l=n.theme||{},o=void 0===e?i:n.parentEditor||null,s=n.disableEvents||!1,a=r$(),u=n.namespace||(null!==o?o._config.namespace:l8()),f=n.editorState,d=[rB,n8,rJ,id,ls,rj,...n.nodes||[]],{onError:c,onWarn:h,html:g}=n,_=void 0===n.editable||n.editable;if(void 0===e&&null!==i)t=i._nodes;else{t=new Map;for(let e=0;e<d.length;e++){let i=d[e],l=null,o=null;if(i&&"object"==typeof i){let e=i;i=e.replace,l=e.with,o=e.withKlass||null}if("function"!=typeof i||!i.prototype||!(i===nW||i.prototype instanceof nW)){let t="<unknown>";try{t=JSON.parse(J)}catch(e){}
1r(365,String(e-d.length+(n.nodes?n.nodes.length:0)),"function"==typeof i?`${i.name}${"function"==typeof i.getType?` (type ${String(i.getType())})`:""}`:String(i),String(t))}su(i);let s=i.getType(),a=function(e){let t=new Set,n=new Set;for(let{klass:i,ownNodeConfig:r}of sf(e)){let e=i.transform;if(!n.has(e)){n.add(e);let r=i.transform();r&&t.add(r)}if(r){let e=r.$transform;e&&t.add(e)}}return t}(i);t.set(s,{exportDOM:g&&g.export?g.export.get(i):void 0,klass:i,replace:l,replaceWithKlass:o,sharedNodeState:function(e){let t=new Map,n=new Set;for(let{ownNodeConfig:i}of sf("function"==typeof e?e:e.replace))if(i&&i.stateConfigs)for(let e of i.stateConfigs){let i;"stateConfig"in e?(i=e.stateConfig,e.flat&&n.add(i.key)):i=e,t.set(i.key,i)}return{flatKeys:n,sharedConfigMap:t}}(d[e]),transforms:a})}}let p=new lk(a,o,t,{disableEvents:s,dom:{...lC,...e&&e.dom},namespace:u,theme:l},c||console.error,h||ld,function(e,t){let n=new Map,i=new Set,r=e=>{Object.keys(e).forEach(t=>{let i=n.get(t);void 0===i&&(i=[],n.set(t,i)),i.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(null==t||i.has(t))return;i.add(t);let n=t.call(e.klass);null!==n&&r(n)}),t&&r(t),n}(t,g?g.import:void 0),_,e);return void 0!==f&&(p._pendingEditorState=f,p._dirtyType=2),p.registerCommand(tc,nm,lc),p.registerCommand(th,nx,lc),p.registerCommand(tg,nC,lc),p.registerCommand(t_,nS,lc),p.registerCommand(tE,nM,lc),p}function lv(e,t){let n=e.get(t);e.delete(t),n&&n()}function lT(e,t,n){return e.set(t,n),lv.bind(null,e,t)}class lk{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_createEditorArgs;constructor(e,t,n,i,r,l,o,s,a){this._createEditorArgs=a,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Y,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=i,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=l8(),this._onError=r,this._onWarn=l,this._htmlConversions=o,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null}}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){return lT(this._listeners.update,e)}registerEditableListener(e){return lT(this._listeners.editable,e)}registerDecoratorListener(e){return lT(this._listeners.decorator,e)}registerTextContentListener(e){return lT(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return al(lT(t,e,e(this._rootElement,null)||void 0),()=>(function(e,t,n){let i=e.get(t);i&&i(),e.set(t,t(...n)||void 0)})(t,e,[null,this._rootElement]))}registerCommand(e,t,n){void 0===n&&r(35);let i=this._commands;i.has(e)||i.set(e,[new V,new V,new V,new V,new V]);let l=i.get(e);void 0===l&&r(36,String(e));let o=7&n,s=l[o];return o!==n?s.addFront(t):s.addBack(t),()=>{s.delete(t),l.every(e=>0===e.size)&&i.delete(e)}}registerMutationListener(e,t,n){let i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,r=this._listeners.mutation,l=r.get(t);void 0===l&&(l=new Set,r.set(t,l)),l.add(i);let o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(t,i),()=>{l.delete(i),0===l.size&&r.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return void 0===t&&r(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,i=o7(n).get(t.getType());if(!i)return;let r=new Map;for(let e of i.keys())r.set(e,"created");r.size>0&&e(r,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),i=[n],r=n.replaceWithKlass;if(null!=r){let e=this.registerNodeTransformToKlass(r,t);i.push(e)}return function(e,t){let n=o7(e.getEditorState()),i=[];for(let e of t){let t=n.get(e);t&&i.push(t)}0!==i.length&&e.update(()=>{for(let e of i)for(let t of e.keys()){let e=lq(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:nj}:void 0)}(this,i.map(e=>e.klass.getType())),()=>
1{i.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return oh(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=ou(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,lx(this,t,e,i,{preserveUpdateQueue:!0}),null!==t&&(this._config.disableEvents||function(e){let t=nl.get(e);if(void 0===t)return nI();let n=no.get(t);if(void 0===n)return nI();nl.delete(e);let i=lI(e);lF(i)?(!function(e){if(null!==e._parentEditor){let t=l7(e),n=t[t.length-1]._key;nA.get(n)===e&&nA.delete(n)}else nA.delete(e._key)}(i),n.editors.delete(i),n.hasShadowEditor=void 0,e.__lexicalEditor=null):i&&r(198);let l=nO(e);for(let e=0;e<l.length;e++)l[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){let t=ox(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,ei(this),this._updateTags.add(nj),rN(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;nl.set(e,n);let i=no.get(n);void 0===i&&(i={editors:new Set,hasShadowEditor:void 0},no.set(n,i)),i.editors.add(t),i.hasShadowEditor=void 0,e.__lexicalEditor=t;let r=nO(e);r.push(ns.register(n));for(let n=0;n<nr.length;n++){let[i,l]=nr[n],o="function"==typeof l?e=>{nP(e)||(nF(e),(t.isEditable()||"click"===i)&&l(e,t))}:e=>{if(nP(e))return;nF(e);let n=t.isEditable();switch(i){case"cut":return n&&oh(t,tG,e);case"copy":return oh(t,tY,e);case"paste":return n&&oh(t,tC,e);case"dragstart":return n&&oh(t,tJ,e);case"dragover":return n&&oh(t,tV,e);case"dragend":return n&&oh(t,tq,e);case"focus":return n&&oh(t,t2,e);case"blur":return n&&oh(t,t3,e);case"drop":return n&&oh(t,tH,e)}};r.push(nn(e,i,o))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(nj),rN(this);rw("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&r(38);let n=e;n._readOnly&&((n=rW(e))._selection=e._selection?e._selection.clone():null),en(this);let i=this._pendingEditorState,l=void 0!==t?t.tag:null;null===i||i.isEmpty()||(null!=l&&this._updateTags.add(l),rN(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,rD(this,()=>{if(l&&this._updateTags.add(l),e._parsed)for(let[e,t]of n._nodeMap.entries())rI(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let i=r$(),r=rr,l=ro,o=rl,s=t._dirtyElements,a=t._dirtyLeaves,u=t._cloneNotNeeded,f=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,rr=i,ro=!1,rl=t,lb=null;try{let r=t._nodes;rk(e.root,r),n&&n(),i._readOnly=!0,i._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=a,t._cloneNotNeeded=u,t._dirtyType=f,rr=r,ro=l,rl=o}return i}("string"==typeof e?JSON.parse(e):e,this,t)}read(...e){let[t,n]=1===e.length?["force-commit",e[0]]:e;return"force-commit"===t&&rN(this),("pending"===t?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){this._updating?this._updates.push([e,t]):rA(this,e,t)}focus(e,t={}){let n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),rD(this,()=>{var i;let r=iG(),l=l1();null!==r?r.dirty||l3(r.clone()):0!==l.getChildrenSize()&&("rootStart"===t.defaultSelection?l.selectStart():l.selectEnd()),oy("focus"),i=()=>{n.removeAttribute("autocapitalize"),e&&e()},rh(),ry()._deferred.push(i)}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;null!==e&&e.blur();let t=oA(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,rw("editable",this,!0,e),this._slotsUsed&&this.update(()=>rm()))}toJSON(){return{editorState:this._editorState.toJSON()}}}lk.version=J;let lb=null,lN=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),lw=1;function lE(e,t){let n=lM(e,t);return void 0===n&&r(30,t),n}function lM(e,t){return e._nodes.get(t)}let lO="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function lA(e,t){let n=void 0!==t?t:(()=>{let t=e.getRootNode();
1return lB(t)||oF(t)?oU(t):null})();if(!oV(n)||n.hasAttribute("data-lexical-slot"))return!1;let i=lZ(n),r=n.nodeName;return n$(i)&&("INPUT"===r||"TEXTAREA"===r||"true"===n.contentEditable&&null==lI(n))}function lD(e,t,n){let i=e.getRootElement();if(!i)return!1;try{if(!t||!i.contains(t)||!i.contains(n))return!1}catch(e){return!1}return lP(t)===e&&e.read("latest",()=>!lA(t))}function lF(e){return e instanceof lk}function lP(e){let t=e;for(;null!=t;){let e=lI(t);if(lF(e))return e;t=o_(t)}return null}function lI(e){return e?e.__lexicalEditor:null}function lL(e){return ih(e)||e.isToken()}function lK(e){return lL(e)||e.isSegmented()}function lz(e){return oq(e)&&3===e.nodeType}function lB(e){return oq(e)&&9===e.nodeType}function lR(e){let t=e;for(;null!=t;){if(lz(t))return t;t=t.firstChild}return null}function lW(e,t,n){let i=M[t];if(null!==n&&(e&i)==(n&i))return e;let r=e^i;return"subscript"===t?r&=~M.superscript:"superscript"===t?r&=~M.subscript:"lowercase"===t?(r&=~M.uppercase,r&=~M.capitalize):"uppercase"===t?(r&=~M.lowercase,r&=~M.capitalize):"capitalize"===t&&(r&=~M.lowercase,r&=~M.uppercase),r}function l$(e){return ia(e)||rY(e)||rz(e)}function lU(e,t){let n=function(){let e=lb;return lb=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);rh(),rg();let i=ry(),r=r_(),l=""+lw++;r._nodeMap.set(l,e),rI(e)?i._dirtyElements.set(l,!0):i._dirtyLeaves.add(l),i._cloneNotNeeded.add(l),0===i._dirtyType&&(i._dirtyType=1),e.__key=l}function lH(e){null!==sx(e)&&r(380,e.__key,String(sx(e)));let t=e.getParent();if(null!==t){let n=e.getWritable(),i=t.getWritable(),r=e.getPreviousSibling(),l=e.getNextSibling(),o=null!==l?l.__key:null,s=null!==r?r.__key:null,a=null!==r?r.getWritable():null,u=null!==l?l.getWritable():null;null===r&&(i.__first=o),null===l&&(i.__last=s),null!==a&&(a.__next=o),null!==u&&(u.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,i.__size--}}function lj(e){rg(),nB(e)&&r(323,e.__key,e.__type);let t=e.getLatest(),n=null!==t.__parent?t.__parent:sm(t)?t.__slotHost:null,i=r_(),l=ry(),o=i._nodeMap,s=l._dirtyElements;null!==n&&function(e,t,n){let i=e;for(;null!==i;){if(n.has(i))return;let e=t.get(i);if(void 0===e)break;n.set(i,!1),i=null!==e.__parent?e.__parent:sm(e)?e.__slotHost:null}}(n,o,s);let a=t.__key;0===l._dirtyType&&(l._dirtyType=1),rI(e)?s.set(a,!0):l._dirtyLeaves.add(a)}function lJ(e){rh();let t=ry(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){let e=lq(n);null!==e&&e.getWritable()}if(null!==e){let t=lq(e);null!==t&&t.getWritable()}}}function lV(){return rc()?null:ry()._compositionKey}function lq(e,t){let n=(t||r_())._nodeMap.get(e);return void 0===n?null:n}function lY(e,t){let n=lX(e,ry());return void 0!==n?lq(n,t):null}function lG(e,t,n){e[`__lexicalKey_${t._key}`]=n}function lX(e,t){return e[`__lexicalKey_${t._key}`]}function lZ(e,t){let n=e;for(;null!=n;){let e=lY(n,t);if(null!==e)return e;n=o_(n)}return null}function lQ(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t,t}function l0(e){return e.read(()=>l1().getTextContent())}function l1(){return r_()._nodeMap.get("root")}function l2(e,t){if(!(ok(e)&&e.isAttached()&&e.isEmpty()&&(rR(e)||null!==t&&o0(t))))return null;let n=lu();return e.append(n),n}function l3(e){rh();let t=r_();null!==e&&(e.dirty=!0,e.setCachedNodes(null),iv(e)&&ry()._slotsUsed&&i$(e)),t._selection=e}function l4(){rh(),en(ry())}function l6(e){let t=function(e,t){let n=e;for(;null!=n;){let e=lX(n,t);if(void 0!==e)return e;n=o_(n)}return null}(e,ry());return null===t?null:lq(t)}function l5(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function l7(e){let t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function l8(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function l9(e){return lz(e)?e.nodeValue:null}function oe(e,t,n){let i=oA(oC(t));if(null===i)return;let r=oW(i,t._rootElement),l=r.anchorNode,{anchorOffset:o,focusOffset:s}=r;if(null!==l){let t=l9(l),i=lZ(l);if(null!==t&&ia(i)){if((t===b||t===N)&&n){let e=n.length;t=n,o=e,s=e}null!==t&&ot(i,t,o,s,e)}}}function ot(e,t,n,i,r){let l=e;if(l.isAttached()&&(r||!l.isDirty())){let o=l.isComposing();if(l.isToken()&&o)return;let s=t;if((o||r)&&(t.endsWith(b)&&(s=t.slice(0,-b.length)),r)){let e;for(;-1!==(e=s.indexOf(N));)s=s.slice(0,e)+s.slice(e+N.length),null!==n&&n>e&&(n=Math.max(e,n-N.length)),null!==i&&i>e&&(i=Math.max(e,i-N.length))}let a=l.getTextContent();if(r||s!==a){let t=iG();if(""===s){if(lJ(null),h||d||p)l.remove();else{let e=ry();on(l,"",t),setTimeout(()=>{e.update(()=>{l.isAttached()&&""===l.getTextContent()&&l.remove()})},20)}return}let r=l.getParent(),a=iX(),u=l.getTextContentSize(),f=lV(),c=l.getKey();if(l.isToken()&&!o||null!==f&&c===f&&!o||iv(a)&&(null!==r&&!r.canInsertTextBefore()&&0===a.anchor.offset||a.anch
1or.key===e.__key&&0===a.anchor.offset&&!l.canInsertTextBefore()&&!o||a.focus.key===e.__key&&a.focus.offset===u&&!l.canInsertTextAfter()&&!o))return void l.markDirty();if(!iv(t)||null===n||null===i)return void on(l,s,t);if(t.setTextNodeRange(l,n,l,i),l.isSegmented()){let e=is(l.getTextContent());l.replace(e),l=e}on(l,s,t)}}}function on(e,t,n){if(e.setTextContent(t),iv(n)){let t=e.getKey(),i=!1;for(let r of["anchor","focus"]){let l=n[r];"text"===l.type&&l.key===t&&(l.offset=sG(e,l.offset,"clamp"),i=!0)}i&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function oi(e,t,n){let i=t[n]||!1;return"any"===i||i===e[n]}function or(e,t,n){if(!(oi(e,n,"altKey")&&oi(e,n,"ctrlKey")&&oi(e,n,"shiftKey")&&oi(e,n,"metaKey")))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||1===e.key.length&&127>=e.key.charCodeAt(0))return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;let i="Key"+t.toUpperCase();return e.code===i}function ol(e){let t=e;for(;null!==t;){let e=t.getParent();if(null===e)break;if(rR(e))return t;t=e}return null}function oo(e,t){let{anchor:n,focus:i}=e,r=n.key,l=n.offset,o=n.type,s=i.key,a=i.offset,u=i.type;if(eS(e),!rR(t))return e;let f=ol(n.getNode());return rI(f)&&f.isShadowRoot()&&f.is(ol(i.getNode()))&&(n.set(r,l,o),i.set(s,a,u)),e}function os(e){let t=l1();if(iv(e)){let t=e.anchor,n=e.focus,i=t.getNode();if(rR(i))return t.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),oo(e,i),e;let r=i.getTopLevelElementOrThrow(),l=r.getParent();return null===l?rI(r)&&(t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),oo(e,r)):(t.set(l.getKey(),0,"element"),n.set(l.getKey(),l.getChildrenSize(),"element"),oo(e,l)),e}{let e=t.select(0,t.getChildrenSize());return l3(oo(e,t)),e}}function oa(e,t){""===e.getAttribute(t)&&e.removeAttribute(t)}function ou(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,i=n[t];if(void 0!==i)return i;let r=e[t];if("string"==typeof r){let e=an(r);return n[t]=e,e}return r}function of(e,t,n,i,l){if(0===n.size)return;let o=i.__type,s=i.__key,a=t.get(o);void 0===a&&r(33,o);let u=a.klass,f=e.get(u);void 0===f&&(f=new Map,e.set(u,f));let d=f.get(s),c="destroyed"===d&&"created"===l;(void 0===d||c)&&f.set(s,c?"updated":l)}function od(e,t,n){let i=e.getParent(),r=n,l=e;return null!==i&&(t&&0===n?(r=l.getIndexWithinParent(),l=i):t||n!==l.getChildrenSize()||(r=l.getIndexWithinParent()+1,l=i)),l.getChildAtIndex(t?r-1:r)}function oc(e){let t=oC(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function oh(e,t,...n){return function e(t,n,i,r){let l,o=l7(t);if(!ra)for(let e=0;e<o.length;e++)o[e]._updating||(o[e]._cascadeCount=0);for(let e=4;e>=0;e--)for(let t=0;t<o.length;t++){let s=o[t];if(t>0&&s._updating){l=s;break}let a=s._commands.get(n);if(void 0!==a){let t=a[e];if(t.size>0){let e=!1;if(rD(s,()=>{for(let n of t)if(n(i,r))return void(e=!0)}),e)return e}}}return l&&l.update(()=>{e(l,n,i,r)}),!1}(e,t,n[0],e)}function og(e,t){let n=e._keyToDOMMap.get(t);return void 0===n&&r(75,t),n}function o_(e){let t=e.assignedSlot||e.parentElement;if(null!==t)return t;let n=e.parentNode;return oF(n)?n.host:null}function op(e){return lB(e)?e:oV(e)?e.ownerDocument:null}function oy(e){rh(),ry()._updateTags.add(e)}function om(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function ox(e){let t=op(e);return t?t.defaultView:null}function oC(e){let t=e._window;return null===t&&r(78),t}function oS(e){return rI(e)&&e.isInline()||rz(e)&&e.isInline()}function ov(e){let t=e.getLatest();for(;null!==t&&!(null!==sx(t)&&rI(t));){let e=t.getParentOrThrow();if(ok(e))return e;t=e}return t}function oT(e){return rI(e)&&e.isShadowRoot()}function ok(e){return rR(e)||oT(e)}function ob(e,t=!1){let n=e.constructor.clone(e,lN);return lU(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function oN(e){let t=ry(),n=e.getType(),i=lM(t,n);void 0===i&&r(200,e.constructor.name,n);let{replace:l,replaceWithKlass:o}=i;if(null!==l){let t=l(e),i=t.constructor;return null!==o?t instanceof o||r(201,o.name,o.getType(),i.name,i.getType(),e.constructor.name,n):t instanceof e.constructor&&i!==e.constructor||r(202,i.name,i.getType(),e.constructor.name,n),t.__key===e.__key&&r(203,e.constructor.name,n,i.name,i.getType()),t}return e}function ow(e,t){!rR(e.getParent())||rI(t)||rz(t)||r(99)}function oE(e){let t=lq(e);return null===t&&r(63,e),t}function oM(e){if(!e||e.isInline())return!1;if(rz(e))return!0;
1if(rI(e)){if(e.isShadowRoot()){let t=e.getParent();return!(rI(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function oO(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let i=e.parentElement;null!==i&&i.removeChild(e)}function oA(e){return o?(e||window).getSelection():null}function oD(e){let t=ox(e);return t?t.getSelection():null}function oF(e){return oY(e)&&"host"in e}let oP=[];function oI(e){let t=e.getRootNode();if(t===e||!oF(t))return oP;let n=[t],i=t.host;for(;;){let e=i.getRootNode();if(e===i||!oF(e))break;n.push(e),i=e.host}return n}function*oL(e){let t,n=[e];for(;t=n.pop();){let e;yield*t.querySelectorAll('[data-lexical-editor="true"]');let i=(lB(t)?t:t.ownerDocument).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e=i.nextNode();)e.shadowRoot&&n.push(e.shadowRoot)}}function oK(e){return null!==e?e.ownerDocument:document}function oz(){let e=rl;return oK(null!==e?e._rootElement:null)}function oB(e,t){if(null===t||"function"!=typeof e.getComposedRanges)return null;let n=oI(t);if(0===n.length)return null;let i=e.getComposedRanges;try{let t=i.call(e,{shadowRoots:n})[0];if(void 0!==t)return t}catch(e){}try{let t=i.apply(e,n)[0];if(void 0!==t)return t}catch(e){}return null}function oR(e,t){let n=oB(e,t);if(null!==n){let e=function(e){let t=e.startContainer.ownerDocument;if(null===t)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch(e){return null}}(n);if(null!==e)return e}return e.rangeCount>0?e.getRangeAt(0):null}function oW(e,t){let n=oB(e,t);return null===n?e:function(e,t){let{startContainer:n,startOffset:i,endContainer:r,endOffset:l}=e;return"backward"===t?{anchorNode:r,anchorOffset:l,direction:t,focusNode:n,focusOffset:i}:{anchorNode:n,anchorOffset:i,direction:t,focusNode:r,focusOffset:l}}(n,e.direction)}function o$(e){let t=e.getRootNode();return lB(t)||oF(t)?t.activeElement:null}function oU(e){let t=e.activeElement;for(;null!==t&&null!==t.shadowRoot;){let e=t.shadowRoot.activeElement;if(null===e)break;t=e}return t}function oH(e){let t=e.target;if(null!==t&&oV(t)&&null!==t.shadowRoot&&"function"==typeof e.composedPath){let t=e.composedPath();if(t.length>0)return t[0]}return t}function oj(e){return oV(e)&&"A"===e.tagName}function oJ(e){return oV(e)&&"TR"===e.tagName}function oV(e){return oq(e)&&1===e.nodeType}function oq(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function oY(e){return oq(e)&&11===e.nodeType}let oG=/^(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;function oX(e){return!(!oV(e)||!e.style.display.startsWith("inline"))||oG.test(e.nodeName)}let oZ=/^(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;function oQ(e){return(!oV(e)||!e.style.display.startsWith("inline"))&&oZ.test(e.nodeName)}function o0(e){if(rz(e)&&!e.isInline())return!0;if(!rI(e)||ok(e))return!1;let t=e.getFirstChild(),n=null===t||rY(t)||ia(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function o1(){return ry()}function o2(e=o1()){return e._config.dom||lC}function o3(e,t,n=o1()){let i=o2(n).$getDOMSlot(e,t,n);return rI(e)&&(i instanceof H||r(344,e.getKey(),e.getType())),i}function o4(e,t,n=o1()){return lR(o3(e,t,n).element)}let o6=new WeakMap,o5=new Map;function o7(e){if(!e._readOnly&&e.isEmpty())return o5;e._readOnly||r(192);let t=o6.get(e);return t||(t=function(e){let t=new Map;for(let[n,i]of e._nodeMap){let e=i.__type,r=t.get(e);r||(r=new Map,t.set(e,r)),r.set(n,i)}return t}(e),o6.set(e,t)),t}function o8(e){let t=e.constructor.clone(e,lN);return t.afterCloneFrom(e),t}function o9(e){var t;return(t=o8(e))[nz]=!0,t}function se(e,t){let n=e.getAttribute("data-lexical-indent");if(null!==n){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let i=Math.round((parseInt(e.style.paddingInlineStart,10)||0)/40);t.setIndent(i)}function st(e,t){let n=t.getAttribute("dir");return"ltr"===n||"rtl"===n?e.setDirection(n):e}function sn(e,t){let n=t.style.textAlign;return n&&n in A?e.setFormat(n):e}function si(e,t){e.__lexicalUnmanaged=!0,t&&void 0!==t.captureSelection&&(e.__lexicalCapturedSelection=t.captureSelection)}function sr(e){return!0===e.__lexicalUnmanaged}function sl(e,t){let n=e;for(;null!=n;){if(!0===n.__lexicalCapturedSelection)return!0;
1if(oV(n)&&n.hasAttribute("data-lexical-slot")||void 0!==lX(n,t))break;n=o_(n)}return!1}function so(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==nW[t]}let ss=new WeakMap,sa=Symbol("lexical.synthesizedGetType");function su(e){let t=ss.get(e);if(t)return t;let n=null!=e.prototype&&L in e.prototype?e.prototype[L]():void 0,i=function(e){if(!(e===nW||e.prototype instanceof nW)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(e){}try{lk.version&&(n=JSON.parse(lk.version))}catch(e){}r(290,e.name,t,n)}return e===rK||e===rP||e===nW}(e),l=!i&&so(e,"getType")?e.getType:void 0,o=!l||sa in l?void 0:l.call(e),s,a=o;if(n)if(o)s=n[o];else{for(let[e,t]of Object.entries(n))a=e,s=t;if(!s)for(let e of Object.getOwnPropertySymbols(n)){let t=n[e];if(t){s=t;break}}}if(!i&&a){if(!so(e,"getType")){let t=function(){return this!==e?nW.getType.call(this):a};t[sa]=!0,e.getType=t}if(so(e,"clone")||(e.clone=(t,n)=>{lb=t;let i=new e;return n!==lN&&i.afterCloneFrom(t),i}),so(e,"importJSON")||(e.importJSON=s&&s.$importJSON||(t=>sc(e).updateFromJSON(t))),!so(e,"importDOM")&&s){let{importDOM:t}=s;t&&(e.importDOM=()=>t)}}let u={klass:e,ownNodeConfig:s,ownNodeType:a};return ss.set(e,u),u}function*sf(e){for(let t=e;t&&(t===nW||n$(t.prototype));){let e=su(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||s_(t)}}function sd(e){let t=new Map,n=new Map;for(let i of e){let{ownNodeType:e}=su(i);e&&(n.set(e,i),t.set(e,new Set))}for(let[e,i]of n)for(let{ownNodeType:n}of sf(i)){let i=n&&t.get(n);i&&i.add(e)}return t}function sc(e){let t=o1();rh();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),i=new n.klass;return null===n.replace?i:oN(i)}let sh=(e,t)=>{let n=e;for(;null!=n&&!rR(n);){if(t(n))return n;n=n.getParent()}return null};function sg(e,t){let n=[],i=e.__first;for(;null!==i;){let e=null===t?lq(i):t.get(i);null==e&&r(174),n.push(i),i=e.__next}return n}function s_(e){let t=Object.getPrototypeOf(e);if("function"==typeof t&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}let sp=new Map;function sy(e){return rI(e)||rz(e)}function sm(e){return rI(e)||rz(e)}function sx(e){let t=e.getLatest();return sm(t)?t.__slotHost:null}function sC(e){let t=sx(e);if(null===t)return null;let n=lq(t);return rI(n)||rz(n)||r(370),n}function sS(e){let t=sC(e);if(null===t)return null;let n=e.getLatest().__key;for(let[e,i]of sk(t))if(i===n)return e;return null}function sv(e){let t=e.getLatest();for(;null!==t;){if(null!==sx(t))return t;t=t.getParent()}return null}function sT(e){if(null===e)return null;let t=iv(e)?e.anchor.getNode():e.getNodes()[0]??null;return null===t?null:sv(t)}function sk(e){let t=e.getLatest();return sy(t)&&null!==t.__slots?t.__slots:sp}function sb(e){return Array.from(sk(e).keys())}function sN(e,t){let n=sk(e).get(t);return void 0===n?null:lq(n)}let sw=["__proto__","constructor","prototype"],sE=Symbol("slotMapOwner");function sM(e){let t=e.__slots;return null!==t&&t[sE]===e||((t=new Map(t))[sE]=e,e.__slots=t),t}let sO=new WeakMap,sA=[];function sD(e){let t="";for(let n of sb(e)){let i=sN(e,n);null!==i&&(t+=i.getTextContent())}return t}function sF(e,t,n){let i=n.get(e),r=n.get(t);return void 0!==i?void 0!==r?i-r:-1:void 0!==r?1:e<t?-1:+(e>t)}let sP={next:"previous",previous:"next"};class sI{origin;constructor(e){this.origin=e}[Symbol.iterator](){return s5({hasNext:sU,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return sq(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return sq(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){let i=n===this.direction?t:Array.from(t).reverse(),l=this,o=this.getParentAtCaret(),s=new Map;for(let t=l.getAdjacentCaret();null!==t&&s.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();s.set(e.getKey(),e)}for(let e of i){if(s.size>0){let t=l.getNodeAtCaret();if(t)if(s.delete(t.getKey()),s.delete(e.getKey()),t.is(e)||l.origin.is(e));else{let n=e.getParent();n&&n.is(o)&&e.remove(),t.replace(e)}else null===t&&r(263,Array.from(s).join(" "))}else l.insert(e);l=sq(e,this.direction)}for(let e of s.values())e.remove();return this}}class sL extends sI{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:sX(e,this.direction)}getParentCaret(e="root"){return sq(sB(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=sP[this.direction];return sq(this.getNodeAtCaret(),e)||sX(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof sL&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}let sK={root:rR,shadowRoot:ok};function sz(e){return sP[e]}function sB(e,t="root"){return null===e||sK[t](e)?null:null===sx(e)?e:null}class sR extends sI{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:sq(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return rI(this.origin)?sX(this.origin,this.direction):null}getParentCaret(e="root"){return sq(sB(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=sP[this.direction];return sq(this.getNodeAtCaret(),e)||sX(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof sR&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof sR||e instanceof sW)&&this.direction===e.direction&&this.origin.is(e.origin)}}class sW extends sI{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:sY(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return sq(sB(this.getParentAtCaret(),e),this.direction)}getFlipped(){return sY(this.origin,sP[this.direction],this.offset)}isSamePointCaret(e){return e instanceof sW&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof sR||e instanceof sW)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return sq(this.origin,this.direction)}}function s$(e){return e instanceof sW}function sU(e){return e instanceof sR}function sH(e){return e instanceof sL}let sj={next:class extends sW{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends sW{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},sJ={next:class extends sR{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends sR{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},sV={next:class extends sL{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends sL{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function sq(e,t){return e?new sJ[t](e):null}function sY(e,t,n){return e?new sj[t](e,sG(e,n)):null}function sG(e,t,n="error"){let i=e.getTextContentSize(),r="next"===t?i:"previous"===t?0:t;return(r<0||r>
1i)&&("clamp"!==n&&l(284,String(t),String(i),e.getKey()),r=r<0?0:i),r}function sX(e,t){return rI(e)?new sV[t](e):null}function sZ(e){return e&&e.getChildCaret()||e}function sQ(e){return e&&sZ(e.getAdjacentCaret())}class s0{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new s0(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return s$(t)?function(e,t){let{direction:n,origin:i}=e;return new s1(e,sG(i,"focus"===t?sP[n]:n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){let{caret:e}=t,{caret:i}=n;if(e.isSameNodeCaret(i))return[new s1(e,i.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){let t=s$(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),i=s$(n),r=t=>t.isSameNodeCaret(n)?null:sQ(t)||t.getParentCaret(e);return s5({hasNext:e=>null!==e&&!(i&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:r(t),map:e=>e,step:r})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class s1{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,i]=this.getSliceIndices(),r=e.getTextContent();return sY(e.setTextContent(r.slice(0,n)+r.slice(i)),t,n)}}function s2(e,t){return e.direction===t?e:e.getFlipped()}function s3(e){return s6(e,s2(sX(l1(),sP[e.direction]),e.direction))}function s4(e){return s6(e,e)}function s6(e,t){return e.direction!==t.direction&&r(265),new s0(e,t,e.direction)}function s5(e){let{initial:t,hasNext:n,step:i,map:r}=e,l=t;return{[Symbol.iterator](){return this},next(){if(!n(l))return{done:!0,value:void 0};let e={done:!1,value:r(l)};return l=i(l),e}}}function s7(e,t){let n=ae(e.origin,t.origin);switch(null===n&&r(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let n="text"===e.type,i="text"===t.type;return n&&i?Math.sign(e.offset-t.offset):e.type===t.type?0:n?-1:i?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;case"descendant":return"child"===t.type?1:-1;case"branch":return s8(n)}}function s8(e){let{a:t,b:n}=e,i=t.__key,r=n.__key,l=t,o=n;for(;l&&o;l=l.getNextSibling(),o=o.getNextSibling()){if(l.__key===r)return -1;if(o.__key===i)return 1}return null===l?1:-1}function s9(e){return rI(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function ae(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[t,i]=s9(e);t;i=t,t=t.getParent())n.set(t,i);for(let[i,l]=s9(t);i;l=i,i=i.getParent()){let o=n.get(i);if(void 0!==o)return null===o?(i.is(e)||r(276),{commonAncestor:i,type:"ancestor"}):null===l?(i.is(t)||r(277),{commonAncestor:i,type:"descendant"}):((rI(o)||o.is(e))&&(rI(l)||l.is(t))&&i.is(o.getParent())&&i.is(l.getParent())||r(278),{a:o,b:l,commonAncestor:i,type:"branch"})}return null}function at(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function an(...e){let t=[];for(let n of e)if(n&&"string"==typeof n)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function ai(e,...t){let n=an(...t);n.length>0&&e.classList.add(...n)}function ar(e,...t){let n=an(...t);n.length>0&&e.classList.remove(...n)}function al(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ao(e,t,n){return al(...Object.entries(t).map(([t,i])=>nn(e,t,i,n)))}}}]);

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