PageSourceSearch

https://proj-schreiner-payload.vercel.app/_next/static/chunks/lexical-editor-1319d330a41bebbe.js

js proj-schreiner-payload.vercel.app collected 2026-10-03 07:33:32 UTC 235,905 bytes, 15 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1293],{13293:(e,t,n)=>{n.d(t,{G:()=>w});var r=n(69717),l=n(30889),i=n(32532),o=n(92749);let a=[];class u extends i.fGB{static getType(){return"mark"}static clone(e){return new u(e.__ids,e.__key)}static importDOM(){return null}static importJSON(e){return d().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIDs(e.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(e=a,t){super(t),this.__ids=e}createDOM(e){let t=document.createElement("mark");return(0,o.ZB)(t,e.theme.mark),this.__ids.length>1&&(0,o.ZB)(t,e.theme.markOverlap),t}updateDOM(e,t,n){let r=e.__ids,l=this.__ids,i=r.length,a=l.length,u=n.theme.markOverlap;return i!==a&&(1===i?2===a&&(0,o.ZB)(t,u):1===a&&(0,o.HE)(t,u)),!1}hasID(e){return this.getIDs().includes(e)}getIDs(){return Array.from(this.getLatest().__ids)}setIDs(e){let t=this.getWritable();return t.__ids=e,t}addID(e){let t=this.getWritable();return t.__ids.includes(e)?t:t.setIDs([...t.__ids,e])}deleteID(e){let t=this.getWritable(),n=t.__ids.indexOf(e);if(-1===n)return t;let r=Array.from(t.__ids);return r.splice(n,1),t.setIDs(r)}insertNewAfter(e,t=!0){let n=d(this.__ids);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!(0,i.I2P)(t)||"html"===n)return!1;let r=t.anchor,l=t.focus,o=r.getNode(),a=l.getNode(),u=t.isBackward()?r.offset-l.offset:l.offset-r.offset;return this.isParentOf(o)&&this.isParentOf(a)&&this.getTextContent().length===u}excludeFromCopy(e){return"clone"!==e}}function d(e=a){return(0,i.pTq)(new u(e))}var c=n(41747),f=n(12115),h=n(95155);let g=Object.freeze({"	":"\\t","\n":"\\n"}),p=RegExp(Object.keys(g).join("|"),"g"),m=Object.freeze({ancestorHasNextSibling:"|",ancestorIsLastChild:" ",hasNextSibling:"├",isLastChild:"└",selectedChar:"^",selectedLine:">"}),_=[e=>e.hasFormat("bold")&&"Bold",e=>e.hasFormat("code")&&"Code",e=>e.hasFormat("italic")&&"Italic",e=>e.hasFormat("strikethrough")&&"Strikethrough",e=>e.hasFormat("subscript")&&"Subscript",e=>e.hasFormat("superscript")&&"Superscript",e=>e.hasFormat("underline")&&"Underline",e=>e.hasFormat("highlight")&&"Highlight"],y=[e=>e.hasTextFormat("bold")&&"Bold",e=>e.hasTextFormat("code")&&"Code",e=>e.hasTextFormat("italic")&&"Italic",e=>e.hasTextFormat("strikethrough")&&"Strikethrough",e=>e.hasTextFormat("subscript")&&"Subscript",e=>e.hasTextFormat("superscript")&&"Superscript",e=>e.hasTextFormat("underline")&&"Underline",e=>e.hasTextFormat("highlight")&&"Highlight"],C=[e=>e.isDirectionless()&&"Directionless",e=>e.isUnmergeable()&&"Unmergeable"],S=[e=>e.isToken()&&"Token",e=>e.isSegmented()&&"Segmented"];function x(e,t=!1){let n=Object.entries(g).reduce((e,[t,n])=>e.replace(RegExp(t,"g"),String(n)),e);return t?n.replace(/[^\s]/g,"*"):n}function v(e){let t=_.map(t=>t(e)).filter(Boolean).join(", ").toLocaleLowerCase();return""!==t&&(t="format: "+t),t}let b=(0,f.forwardRef)(function({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:r,viewClassName:l,timeTravelPanelClassName:i,editorState:o,setEditorState:a,setEditorReadOnly:u,generateContent:d},c){let[g,p]=(0,f.useState)([]),[m,_]=(0,f.useState)(""),[y,C]=(0,f.useState)(!1),[S,x]=(0,f.useState)(!1),v=(0,f.useRef)(0),b=(0,f.useRef)(null),[w,T]=(0,f.useState)(!1),[k,N]=(0,f.useState)(!1),[E,F]=(0,f.useState)(!1),P=(0,f.useRef)(),A=(0,f.useRef)(0),O=(0,f.useCallback)(e=>{let t=++A.current;d(e).then(e=>{t===A.current&&_(e)}).catch(e=>{t===A.current&&_(`Error rendering tree: ${e.message}
2
3Stack:
4${e.stack}`)})},[d]);(0,f.useEffect)(()=>{!E&&o._nodeMap.size>1e3&&(N(!0),!E)||P.current!==o&&(P.current=o,O(S),y||p(e=>[...e,[Date.now(),o]]))},[o,O,S,E,y]);let L=g.length;return(0,f.useEffect)(()=>{if(w){let e,t=()=>{let n=v.current;if(n===L-1)return void T(!1);let r=g[n][0];e=setTimeout(()=>{v.current++;let e=v.current,n=b.current;null!==n&&(n.value=String(e)),a(g[e][1]),t()},g[n+1][0]-r)};return t(),()=>{clearTimeout(e)}}},[g,w,L,a]),(0,h.jsxs)("div",{className:l,children:[!E&&k?(0,h.jsxs)("div",{style:{padding:20},children:[(0,h.jsx)("span",{style:{marginRight:20},children:"Detected large EditorState, this can impact debugging performance."}),(0,h.jsx)("button",{onClick:()=>{F(!0)},style:{background:"transparent",border:"1px solid white",color:"white",cursor:"pointer",padding:5},children:"Show full tree"})]}):null,E?null:(0,h.jsx)("button",{onClick:()=>(O(!S),void x(!S)),className:e,type:"button",children:S?"Tree":"Export DOM"}),!y&&(E||!k)&&L>2&&(0,h.jsx)("button",{onClick:()=>{u(!0),v.current=L-1,C(!0)},className:t,type:"button",children:"Time Travel"}),(E||!k)&&(0,h.jsx)("pre",{ref:c,children:m}),y&&(E||!k)&&(0,h.jsxs)("div",{className:i,children:[(0,h.jsx)("button",{className:r,onClick:()=>{v.current===L-1&&(v.current=1),T(!w)},type:"button",children:w?"Pause":"Play"}),(0,h.jsx)("input",{className:n,ref:b,onChange:e=>{let t=Number(e.target.value),n=g[t];n&&(v.current=t,a(n[1]))},type:"range",min:"1",max:L-1}),(0,h.jsx)("button",{className:r,onClick:()=>{u(!1);let e=g.length-1;a(g[e][1]);let t=b.current;null!==t&&(t.value=String(e)),C(!1),T(!1)},type:"button",children:"Exit"})]})]})});function w({treeTypeButtonClassName:e,timeTravelButtonClassName:t,t
4imeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:a,timeTravelPanelClassName:d,viewClassName:g,editor:_,customPrintNode:w}){let T=f.createRef(),[k,N]=(0,f.useState)(_.getEditorState()),E=function(e){let[t,n]=(0,f.useState)([]);return(0,f.useEffect)(()=>(function(e,t){let n=new Set,r=0;for(let[l]of e._commands)n.add(e.registerCommand(l,e=>(t(t=>{let n=[...t];return n.push({index:r+=1,payload:e,type:l.type?l.type:"UNKNOWN"}),n.length>10&&n.shift(),n}),!1),i.da8));return()=>n.forEach(e=>e())})(e,n),[e]),(0,f.useMemo)(()=>t,[t])}(_);return(0,f.useEffect)(()=>(0,o.Sd)(_.registerUpdateListener(({editorState:e})=>{N(e)}),_.registerEditableListener(()=>{N(_.getEditorState())})),[_]),(0,f.useEffect)(()=>{let e=T.current;if(null!==e)return e.__lexicalEditor=_,()=>{e.__lexicalEditor=null}},[_,T]),(0,h.jsx)(b,{treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:a,viewClassName:g,timeTravelPanelClassName:d,setEditorReadOnly:e=>{let t=_.getRootElement();null!=t&&(t.contentEditable=e?"false":"true")},editorState:k,setEditorState:e=>_.setEditorState(e),generateContent:async function(e){return function(e,t,n,o,a=!1){let d=e.getEditorState(),f=e._config,h=e._compositionKey,g=e._editable;if(n){let t="";return d.read(()=>{t=function(e){let t=document.createElement("div");return t.innerHTML=e.trim(),function e(t,n){let r,l=Array(1+n++).join("  "),i=Array(n-1).join("  ");for(let o=0;o<t.children.length;o++)r=document.createTextNode("\n"+l),t.insertBefore(r,t.children[o]),e(t.children[o],n),t.lastElementChild===t.children[o]&&(r=document.createTextNode("\n"+i),t.appendChild(r));return t}(t,0).innerHTML}((0,r.g)(e))}),t}let _=" root\n",b=d.read(()=>{let e=(0,i.vJq)();return function e(t,n,r=[]){let l=t.getChildren(),o=l.length;l.forEach((t,l)=>{n(t,r.concat(l===o-1?m.isLastChild:m.hasNextSibling)),(0,i.ff4)(t)&&e(t,n,r.concat(l===o-1?m.ancestorIsLastChild:m.ancestorHasNextSibling))})}((0,i.NiT)(),(t,n)=>{let r=`(${t.getKey()})`,d=t.getType()||"",c=t.isSelected();_+=`${c?m.selectedLine:" "} ${n.join(" ")} ${r} ${d} ${function(e,t,n=!1){let r=t?t(e,n):void 0;if(void 0!==r&&r.length>0)return r;if((0,i.kFe)(e)){var o,a;let t,r,l=e.getTextContent(),i=0===l.length?"(empty)":`"${x(l,n)}"`,u=[v(e),(o=e,""!==(t=C.map(e=>e(o)).filter(Boolean).join(", ").toLocaleLowerCase())&&(t="detail: "+t),t),(a=e,""!==(r=S.map(e=>e(a)).filter(Boolean).join(", ").toLocaleLowerCase())&&(r="mode: "+r),r)].filter(Boolean).join(", ");return[i,0!==u.length?`{ ${u} }`:null].filter(Boolean).join(" ").trim()}if((0,l.FJ)(e)){let t,r,l,i=e.getURL(),o=0===i.length?"(empty)":`"${x(i,n)}"`,a=[(null!=(t=e.getTarget())&&(t="target: "+t),t),(null!=(r=e.getRel())&&(r="rel: "+r),r),(null!=(l=e.getTitle())&&(l="title: "+l),l)].filter(Boolean).join(", ");return[o,0!==a.length?`{ ${a} }`:null].filter(Boolean).join(" ").trim()}if(e instanceof u)return`ids: [ ${e.getIDs().join(", ")} ]`;if((0,i.bSg)(e)){let t,n=(""!==(t=y.map(t=>t(e)).filter(Boolean).join(", ").toLocaleLowerCase())&&(t="format: "+t),t);return(""!==n?`{ ${n} }`:"")+(e.__style?`(${e.__style})`:"")}return""}(t,o,a)}
5`,_+=function({indent:e,isSelected:t,node:n,nodeKeyDisplay:r,selection:l,typeDisplay:o}){if(!(0,i.kFe)(n)||!(0,i.I2P)(l)||!t||(0,i.ff4)(n))return"";let a=l.anchor,u=l.focus;if(""===n.getTextContent()||a.getNode()===l.focus.getNode()&&a.offset===u.offset)return"";let[d,c]=function(e,t){let n=t.getStartEndPoints();if((0,i.RTZ)(t)||null===n)return[-1,-1];let[r,l]=n,o=e.getTextContent(),a=o.length,u=-1,d=-1;if("text"===r.type&&"text"===l.type){let t=r.getNode(),n=l.getNode();t===n&&e===t&&r.offset!==l.offset?[u,d]=r.offset<l.offset?[r.offset,l.offset]:[l.offset,r.offset]:[u,d]=e===t?t.isBefore(n)?[r.offset,a]:[0,r.offset]:e===n?n.isBefore(t)?[l.offset,a]:[0,l.offset]:[0,a]}let c=(o.slice(0,u).match(p)||[]).length,f=(o.slice(u,d).match(p)||[]).length;return[u+c,d+c+f]}(n,l);if(d===c)return"";let f=e[e.length-1]===m.hasNextSibling?m.ancestorHasNextSibling:m.ancestorIsLastChild,h=[...e.slice(0,e.length-1),f],g=Array(d+1).fill(" "),_=Array(c-d).fill(m.selectedChar),y=o.length+2,C=Array(r.length+y).fill(" ");return[m.selectedLine,h.join(" "),[...C,...g,..._].join("")].join(" ")+"\n"}({indent:n,isSelected:c,node:t,nodeKeyDisplay:r,selection:e,typeDisplay:d})}),null===e?": null":(0,i.I2P)(e)?function(e){let t="",n=v(e);t+=`: range ${""!==n?`{ ${n} }`:""} ${""!==e.style?`{ style: ${e.style} } `:""}`;
5let r=e.anchor,l=e.focus,i=r.offset,o=l.offset;return t+`
6  ├ anchor { key: ${r.key}, offset: ${null===i?"null":i}, type: ${r.type} }
7  └ focus { key: ${l.key}, offset: ${null===o?"null":o}, type: ${l.type} }`}(e):(0,c.Ln)(e)?`: table
8  └ { table: ${e.tableKey}, anchorCell: ${e.anchor.key}, focusCell: ${e.focus.key} }`:(0,i.RTZ)(e)?`: node
9  └ [${Array.from(e._nodes).join(", ")}]`:""});if(_+="\n selection"+b,_+="\n\n commands:",t.length)for(let{index:e,type:n,payload:r}of t)_+=`
10  └ ${e}. { type: ${n}, payload: ${r instanceof Event?r.constructor.name:r} }`;else _+="\n  └ None dispatched.";let{version:w}=e.constructor;return _+=`
11
12 editor${w?` (v${w})`:""}:`,_+=`
13  └ namespace ${f.namespace}`,null!==h&&(_+=`
14  └ compositionKey ${h}`),_+=`
15  └ editable ${String(g)}`}(_,E,e,w)},ref:T})}},30889:(e,t,n)=>{n.d(t,{FJ:()=>d});var r=n(92749),l=n(32532);let i=new Set(["http:","https:","mailto:","sms:","tel:"]);class o extends l.fGB{static getType(){return"link"}static clone(e){return new o(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},n){super(n);let{target:r=null,rel:l=null,title:i=null}=t;this.__url=e,this.__target=r,this.__rel=l,this.__title=i}createDOM(e){let t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),(0,r.ZB)(t,e.theme.link),t}updateDOM(e,t,n){if((0,r.nY)(t)){let n=this.__url,r=this.__target,l=this.__rel,i=this.__title;n!==e.__url&&(t.href=n),r!==e.__target&&(r?t.target=r:t.removeAttribute("target")),l!==e.__rel&&(l?t.rel=l:t.removeAttribute("rel")),i!==e.__title&&(i?t.title=i:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:a,priority:1})}}static importJSON(e){return u().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){try{let t=new URL(e);if(!i.has(t.protocol))return"about:blank"}catch(e){}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=u(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!(0,l.I2P)(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function a(e){let t=null;if((0,r.nY)(e)){let n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=u(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function u(e="",t){return(0,l.pTq)(new o(e,t))}function d(e){return e instanceof o}class c extends o{constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new c(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return f().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=this.getParentOrThrow().insertNewAfter(e,t);if((0,l.ff4)(n)){let e=f(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function f(e="",t){return(0,l.pTq)(new c(e,t))}(0,l.guI)("TOGGLE_LINK_COMMAND")},31705:(e,t,n)=>{n.d(t,{G:()=>u});var r=n(94271),l=n(92749),i=n(32532);function o(e){e.undoStack=[],e.redoStack=[],e.current=null}var a=n(12115);function u({delay:e,externalHistoryState:t}){let[n]=(0,r.DF)();return function(e,t,n=1e3){let r=(0,a.useMemo)(()=>t||{current:null,redoStack:[],undoStack:[]},[t]);(0,a.useEffect)(()=>(function(e,t,n){let r,a,u=(r=Date.now(),a=0,(t,l,o,u,d,c)=>
15{let f=Date.now();if(c.has("historic"))return a=0,r=f,2;let h=function(e,t,n,r,l){if(null===e||0===n.size&&0===r.size&&!l)return 0;let o=t._selection,a=e._selection;if(l)return 1;if(!((0,i.I2P)(o)&&(0,i.I2P)(a)&&a.isCollapsed()&&o.isCollapsed()))return 0;let u=function(e,t,n){let r=e._nodeMap,l=[];for(let e of t){let t=r.get(e);void 0!==t&&l.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);void 0===n||(0,i.hVZ)(n)||l.push(n)}return l}(t,n,r);if(0===u.length)return 0;if(u.length>1){let n=t._nodeMap,r=n.get(o.anchor.key),l=n.get(a.anchor.key);return r&&l&&!e._nodeMap.has(r.__key)&&(0,i.kFe)(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}let d=u[0],c=e._nodeMap.get(d.__key);if(!(0,i.kFe)(c)||!(0,i.kFe)(d)||c.__mode!==d.__mode)return 0;let f=c.__text,h=d.__text;if(f===h)return 0;let g=o.anchor,p=a.anchor;if(g.key!==p.key||"text"!==g.type)return 0;let m=g.offset,_=p.offset,y=h.length-f.length;return 1===y&&_===m-1?2:-1===y&&_===m+1?3:4*(-1===y&&_===m)}(t,l,u,d,e.isComposing()),g=(()=>{let g=null===o||o.editor===e,p=c.has("history-push");if(!p&&g&&c.has("history-merge"))return 0;if(null===t)return 1;let m=l._selection;return u.size>0||d.size>0?!1===p&&0!==h&&h===a&&f<r+n&&g||1===u.size&&function(e,t,n){let r=t._nodeMap.get(e),l=n._nodeMap.get(e),o=t._selection,a=n._selection;return!((0,i.I2P)(o)&&(0,i.I2P)(a)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===a.anchor.type&&"text"===a.focus.type||!(0,i.kFe)(r)||!(0,i.kFe)(l)||r.__parent!==l.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>l.exportJSON()))}(Array.from(u)[0],t,l)?0:1:2*(null===m)})();return r=f,a=h,g});return(0,l.Sd)(e.registerCommand(i.ZKf,()=>((function(e,t){let n=t.redoStack,r=t.undoStack;if(0!==r.length){let l=t.current,o=r.pop();null!==l&&(n.push(l),e.dispatchCommand(i.WWb,!0)),0===r.length&&e.dispatchCommand(i.KfJ,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}})(e,t),!0),i.jZM),e.registerCommand(i.V30,()=>((function(e,t){let n=t.redoStack,r=t.undoStack;if(0!==n.length){let l=t.current;null!==l&&(r.push(l),e.dispatchCommand(i.KfJ,!0));let o=n.pop();0===n.length&&e.dispatchCommand(i.WWb,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}})(e,t),!0),i.jZM),e.registerCommand(i.SKc,()=>(o(t),!1),i.jZM),e.registerCommand(i.t5V,()=>(o(t),e.dispatchCommand(i.WWb,!1),e.dispatchCommand(i.KfJ,!1),!0),i.jZM),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:l,dirtyElements:o,tags:a})=>{let d=t.current,c=t.redoStack,f=t.undoStack,h=null===d?null:d.editorState;if(null!==d&&n===h)return;let g=u(r,n,d,l,o,a);if(1===g)0!==c.length&&(t.redoStack=[],e.dispatchCommand(i.WWb,!1)),null!==d&&(f.push({...d}),e.dispatchCommand(i.KfJ,!0));else if(2===g)return;t.current={editor:e,editorState:n}}))})(e,r,n),[n,e,r])}(n,t,e),null}},32532:(e,t,n)=>{function r(e,...t){let n=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;for(let n of(l.append("code",e),t))l.append("v",n);throw n.search=l.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.`)}n.d(t,{$7r:()=>to,$ey:()=>eD,$iu:()=>l7,A7V:()=>rn,AX0:()=>eq,AcJ:()=>ra,Ave:()=>l1,B$P:()=>r4,BEs:()=>lw,Bts:()=>lG,CaD:()=>H,Chh:()=>J,Cku:()=>ns,Csq:()=>it,Cyw:()=>n5,Ey8:()=>tV,FEN:()=>eO,GMe:()=>nU,GcU:()=>nR,Gew:()=>ll,H2A:()=>nE,HYn:()=>tt,Huu:()=>eG,I2H:()=>ts,I2P:()=>nr,I8X:()=>K,IlV:()=>lJ,IqF:()=>li,JAT:()=>le,JM3:()=>e$,K8K:()=>lp,KfJ:()=>ti,Kp7:()=>n7,LYZ:()=>r_,LZn:()=>b,MZu:()=>t5,MvL:()=>eE,NiT:()=>rR,OBE:()=>nC,OXk:()=>e0,OpE:()=>lI,PiT:()=>e2,Q$N:()=>eX,RTZ:()=>ni,RTo:()=>eV,Rb_:()=>rx,S1w:()=>nv,SKc:()=>tn,Sr4:()=>e3,TgX:()=>e5,UDz:()=>eH,V30:()=>eW,VSO:()=>te,WKo:()=>tJ,WWb:()=>tl,WgU:()=>ru,WuB:()=>eA,XKQ:()=>eL,YW5:()=>e1,Z$U:()=>rm,ZKf:()=>eJ,_On:()=>lm,a9V:()=>l_,bM3:()=>eM,bSg:()=>ro,bbF:()=>eZ,cmH:()=>lD,d8p:()=>eP,da8:()=>rd,dxY:()=>lT,e1k:()=>rQ,erb:()=>lj,ev7:()=>t9,fGB:()=>n2,fUS:()=>e7,ff4:()=>n4,gCZ:()=>eY,guI:()=>eN,hVZ:()=>n8,haT:()=>n9,hi0:()=>eR,i0_:()=>lS,ieJ:()=>rf,jG6:()=>rT,jZM:()=>rs,k1Q:()=>io,kFe:()=>t3,lJ7:()=>ri,lSZ:()=>l6,mB:()=>eK,mWO:()=>lH,n1P:()=>rK,nYP:()=>lf,nsf:()=>rA,oqR:()=>eF,pGK:()=>ie,pTq:()=>ls,pd8:()=>lk,peL:()=>lc,rN:()=>lM,rUs:()=>ny,riq:()=>e9,sTu:()=>t4,sWS:()=>lZ,sby:()=>lh,scG:()=>rC,sik:()=>e4,t5V:()=>tr,u5G:()=>e6,uTE:()=>n_,urt:()=>B,uwZ:()=>l$,vAA:()=>lg,vJq:()=>nx,viC:()=>eB,w$Z:()=>eQ,w3H:()=>ly,wH$:()=>tW,waI:()=>eI,wp6:()=>l2,xL4:()=>rM,xQ8:()=>l4,y68:()=>np,z8s:()=>t6});let l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,i=l&&"documentMode"in document?document.documentMode:null,o=l&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),a=l&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),u=!(!l||!("InputEvent"in window)||i)&&"getTargetRanges"in new window.InputEvent("input"),d=l&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),c=l&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,f=l&&/Android/.test(navigator.userAgent),h=l&&/^(?=.*Chrome).*/i.test(navigator.userAgent),g=l&&f&&h,p=l&&/AppleWeb
15Kit\/[\d.]+/.test(navigator.userAgent)&&!h;function m(...e){let t=[];for(let n of e)if(n&&"string"==typeof n)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}let _=d||c||p?"\xa0":"​",y=a?"\xa0":_,C="֑-߿יִ-﷽ﹰ-ﻼ",S="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",x=RegExp("^[^"+S+"]*["+C+"]"),v=RegExp("^[^"+C+"]*["+S+"]"),b={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},w={directionless:1,unmergeable:2},T={center:2,end:6,justify:4,left:1,right:3,start:5},k={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},N={normal:0,segmented:2,token:1},E={0:"normal",2:"segmented",1:"token"},F=!1,P=0;function A(e){P=e.timeStamp}function O(e,t,n){let r="BR"===e.nodeName,l=t.__lexicalLineBreak;return l&&(e===l||r&&e.previousSibling===l)||r&&void 0!==rL(e,n)}function L(e,t,n){F=!0;let r=performance.now()-P>100;try{nQ(e,()=>{let l=nx()||e.getEditorState().read(()=>{let e=nx();return null!==e?e.clone():null}),i=new Map,o=e.getRootElement(),u=e._editorState,d=e._blockCursorElement,c=!1,f="";for(let n=0;n<t.length;n++){let h=t[n],g=h.type,p=h.target,m=function(e,t,n,r){var l;for(let i=e;i&&(l=i,!0!==l.__lexicalUnmanaged);i=r8(i)){let e=rL(i,t);if(void 0!==e){let t=rA(e,n);if(t)return n5(t)||!lh(i)?void 0:[i,t]}else if(i===r)return[r,rB(n)]}}(p,e,u,o);if(!m)continue;let[_,y]=m;if("characterData"===g)r&&t3(y)&&rv(p)&&function(e,t,n){if(nr(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return rv(t)&&n.isAttached()}(l,p,y)&&function(e,t,n){let r=lc(lr(n)),l=null,i=null;null!==r&&r.anchorNode===e&&(l=r.anchorOffset,i=r.focusOffset);let o=e.nodeValue;null!==o&&rH(t,o,l,i,!1)}(p,y,e);else if("childList"===g){c=!0;let t=h.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],l=rO(r),i=r.parentNode;if(null!=i&&r!==d&&null===l&&!O(r,i,e)){if(a){let e=(lh(r)?r.innerText:null)||r.nodeValue;e&&(f+=e)}i.removeChild(r)}}let n=h.removedNodes,r=n.length;if(r>0){let t=0;for(let l=0;l<r;l++){let r=n[l];(O(r,p,e)||d===r)&&(p.appendChild(r),t++)}r!==t&&i.set(_,y)}}}if(i.size>0)for(let[t,n]of i)n.reconcileObservedMutation(t,e);let h=n.takeRecords();if(h.length>0){for(let t=0;t<h.length;t++){let n=h[t],r=n.addedNodes,l=n.target;for(let t=0;t<r.length;t++){let n=r[t],i=n.parentNode;null==i||"BR"!==n.nodeName||O(n,l,e)||i.removeChild(n)}}n.takeRecords()}null!==l&&(c&&rK(l),a&&r3(e)&&l.insertRawText(f))})}finally{F=!1}}function M(e){let t=e._observer;null!==t&&L(e,t.takeRecords(),t)}function I(e){0===P&&lr(e).addEventListener("textInput",A,!0),e._observer=new MutationObserver((t,n)=>{L(e,t,n)})}function D(e){return e}class R{constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||D).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}}function B(e,t){return new R(e,t)}function K(e,t,n="latest"){let r=("latest"===n?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function J(e,t,n){let r;if(nB(),"function"==typeof n){let l=e.getLatest(),i=K(l,t);if(r=n(i),t.isEqual(i,r))return l}else r=n;let l=e.getWritable();return $(l).updateFromKnown(t,r),l}class W{constructor(e,t=new Map,n,r=new Map,l){this.node=e,this.sharedConfigMap=t,this.unknownState=n,this.knownState=r;let i=void 0!==l?l:function(e,t,n){let r=n.size;if(t)for(let l in t){let t=e.get(l);t&&n.has(t)||r++}return r}(t,n,r);this.size=i}getValue(e){let t=this.knownState.get(e);if(void 0!==t)return t;this.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};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);return z(e)?{$:e}:{}}getWritable(e){var t;if(this.node===e)return this;let n=new Map(this.knownState),r=z(t=this.unknownState)&&{...t};if(r)for(let e of n.keys())delete r[e.key];return new W(e,this.sharedConfigMap,z(r),n,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedConfigMap.set(n,e);let{knownState:r,unknownState:l}=this;r.has(e)||l&&n in l||this.size++,r.set(e,t)}updateFromUnknown(e,t){let n=this.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={},e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n);this.unknownState=z(this.unknownState)}}function z(e){if(e)for(let t in e)return e}function $(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new W(t);return t.__state=n,n}function j(e,t){let n=e.__mode,r=e.__format,l=e.__style,i=t.__mode,o=t.__format,a=t.__style,u=e.__state,d=t.__state;return(null===n||n===i)&&(null===r||r===o)&&(null===l||l===a)&&(null===e.__state||u===d||function(e,t){if(e===t)return!0;
15if(e&&t&&e.size!==t.size)return!1;let n=new Set,r=(e,t)=>{for(let[r,l]of e.knownState){if(n.has(r.key))continue;n.add(r.key);let e=t?t.getValue(r):r.defaultValue;if(e!==l&&!r.isEqual(e,l))return!0}return!1},l=(e,t)=>{let{unknownState:r}=e,l=t?t.unknownState:void 0;if(r){for(let[e,t]of Object.entries(r))if(!n.has(e)&&(n.add(e),t!==(l?l[e]:void 0)))return!0}return!1};return!(e&&r(e,t)||t&&r(t,e)||e&&l(e,t)||t&&l(t,e))}(u,d))}function q(e,t){let n=e.mergeWithSibling(t),r=nW()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function U(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&t3(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){j(t,r)&&(r=q(t,r));break}t.remove()}for(;null!==(n=r.getNextSibling())&&t3(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){j(r,n)&&(r=q(r,n));break}n.remove()}}else r.remove()}function H(e){return Z(e.anchor),Z(e.focus),e}function Z(e){for(;"element"===e.type;){let t,n,r=e.getNode(),l=e.offset;if(l===r.getChildrenSize()?(t=r.getChildAtIndex(l-1),n=!0):(t=r.getChildAtIndex(l),n=!1),t3(t)){e.set(t.__key,n?t.getTextContentSize():0,"text",!0);break}if(!n4(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element",!0)}}let V,G,Y,X,Q,ee,et,en,er,el,ei="",eo="",es=null,ea="",eu="",ed=!1,ec=!1,ef=null;function eh(e,t){let n=et.get(e);if(null!==t){let n=ek(e);n.parentNode===t&&t.removeChild(n)}if(en.has(e)||G._keyToDOMMap.delete(e),n4(n)){let e=eb(n,et);eg(e,0,e.length-1,null)}void 0!==n&&r1(el,Y,X,n,"destroyed")}function eg(e,t,n,r){let l=t;for(;l<=n;++l){let t=e[l];void 0!==t&&eh(t,r)}}function ep(e,t){e.setProperty("text-align",t)}function em(e,t){let n=V.theme.indent;if("string"==typeof n){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}let r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||"40px";e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function e_(e,t){let n=e.style;0===t?ep(n,""):1===t?ep(n,"left"):2===t?ep(n,"center"):3===t?ep(n,"right"):4===t?ep(n,"justify"):5===t?ep(n,"start"):6===t&&ep(n,"end")}function ey(e,t){let n=en.get(e);void 0===n&&r(60);let l=n.createDOM(V,G);if(function(e,t,n){let r=n._keyToDOMMap;t[`__lexicalKey_${n._key}`]=e,r.set(e,t)}(e,l,G),t3(n)?l.setAttribute("data-lexical-text","true"):n5(n)&&l.setAttribute("data-lexical-decorator","true"),n4(n)){let e=n.__indent,t=n.__size;0!==e&&em(l,e),0!==t&&function(e,t,n,r){let l=eo;eo="",eC(e,n,0,t,n.getDOMSlot(r)),ev(n,r),eo=l}(eb(n,en),t-1,n,l);let r=n.__format;0!==r&&e_(l,r),n.isInline()||ex(null,n,l),r5(n)&&(ei+="\n\n",eu+="\n\n")}else{let t=n.getTextContent();if(n5(n)){let t=n.decorate(G,V);null!==t&&ew(e,t),l.contentEditable="false"}else t3(n)&&(n.isDirectionless()||(eo+=t));ei+=t,eu+=t}return null!==t&&t.insertChild(l),r1(el,Y,X,n,"created"),l}function eC(e,t,n,r,l){let i=ei;ei="";let o=n;for(;o<=r;++o){ey(e[o],l);let t=en.get(e[o]);null!==t&&t3(t)&&(null===es&&(es=t.getFormat()),""===ea&&(ea=t.getStyle()))}r5(t)&&(ei+="\n\n"),l.element.__lexicalTextContent=ei,ei=i+ei}function eS(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return tW(e)?"line-break":n5(e)&&e.isInline()?"decorator":null}return"empty"}return null}function ex(e,t,n){let r=eS(e,et),l=eS(t,en);r!==l&&t.getDOMSlot(n).setManagedLineBreak(l)}function ev(e,t){let n=t.__lexicalDirTextContent||"",r=t.__lexicalDir||"";if(n!==eo||r!==ef){var l;let n=""===eo,i=n?ef:(l=eo,x.test(l)?"rtl":v.test(l)?"ltr":null);if(i!==r){let l=t.classList,o=V.theme,a=null!==r?o[r]:void 0,u=null!==i?o[i]:void 0;if(void 0!==a){if("string"==typeof a){let e=m(a);a=o[r]=e}l.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==u){if("string"==typeof u){let e=m(u);u=o[i]=e}void 0!==u&&l.add(...u)}t.dir=i}ec||(e.getWritable().__dir=i)}ef=i,t.__lexicalDirTextContent=eo,t.__lexicalDir=i}}function eb(e,t){let n=[],l=e.__first;for(;null!==l;){let e=t.get(l);void 0===e&&r(101),n.push(l),l=e.__next}return n}function ew(e,t){let n=G._pendingDecorators,r=G._decorators;if(null===n){if(r[e]===t)return;n=rI(G)}n[e]=t}function eT(e){let t=e.nextSibling;return null!==t&&t===G._blockCursorElement&&(t=t.nextSibling),t}function ek(e){let t=er.get(e);return void 0===t&&r(75,e),t}function eN(e){return{}}let eE={},eF={},eP={},eA={},eO={},eL={},eM={},eI={},eD={},eR={},eB={},eK={},eJ={},eW={},ez={},e$={},ej={},eq={},eU={},eH={},eZ={},eV={},eG={},eY={},eX={},eQ={},e0={},e1={},e2={},e4={},e3={},e7={},e5={},e9={},e8={},e6={},te={},tt={},tn={},tr={},tl={},ti={},to={},ts={},ta={},tu=Object.freeze({}),td=[["keydown",function(e,t){if(tc=e.timeStamp,tf=e.key,t.isComposing())return;let{key:n,shiftKey:r,ctrlKey:l,metaKey:i,altKey:u}=e;if(!r7(t,ez,e)&&null!=n){if(tS&&rG(tf))return nQ(t,()=>{tP(t,tx)}),tS=!1,void(tx="");if(!rV(n)||l||i||u)if(rV(n)&&!u&&!r&&(l||i))r7(t,ej,e);else if(!rZ(n)||l||i||u)if(rZ(n)&&!u&&!r&&(l||i))r7(t,eU,e);else if("ArrowUp"!==n||l||i)if("ArrowDown"!==n||l||i)if("Enter"===n&&r)ty=!0,r7(t,eV,e);else if(" "===n)r7(t,eG,e);else if(o&&l&&"o"===n.toLowerCase())e.preventDefault(),ty=!0,r7(t,eO,!0);else if("Enter"!==n||r)if(o?!u&&!i&&(rG(n)||"h"===n.toLowerCase()&&l):!l&&!u&&!i&&rG(n))rG(n)?r7(t,eY,e):(e.preventDefault(),r7(t,eA,!0));else if("Escape"===n)r7(t,eX,e);else if(o?!(r||u||i)&&(rY(n)||"d"===n.toLowerCase()&&l):!l&&!u&&!i&&rY(n))rY(n)?r7(t,eQ,e):(e.preventDefault(),r7(t,eA,!1));else if(rG(n)&&(o?u:l))e.preventDefault(),r7(t,eR,!0);else if(rY(n)&&(o?u:l))e.preventDefault(),r7(t,eR,!1);else if(o&&i&&rG(n))e.preventDefault(),r7(t,eB,!0);else if(o&&i&&rY(n))e.preventDefault(),r7(t,eB,!1);else{var d,c,f,h,g,p,m,_;if("b"===n.toLowerCase()&&!u&&(d=i,c=l,o?d:c))e.preventDefault(),r7(t,eK,"bold");
15else{if("u"===n.toLowerCase()&&!u&&(f=i,h=l,o?f:h))e.preventDefault(),r7(t,eK,"underline");else{if("i"===n.toLowerCase()&&!u&&(g=i,p=l,o?g:p))e.preventDefault(),r7(t,eK,"italic");else if("Tab"!==n||u||l||i){if("z"===n.toLowerCase()&&!r&&(m=i,_=l,o?m:_))e.preventDefault(),r7(t,eJ,void 0);else if(o?"z"===n.toLowerCase()&&i&&r:"y"===n.toLowerCase()&&l||"z"===n.toLowerCase()&&l&&r)e.preventDefault(),r7(t,eW,void 0);else{let u=t._editorState._selection;null===u||nr(u)?!a&&rX(n,i,l)&&(e.preventDefault(),r7(t,tt,e)):!r&&"c"===n.toLowerCase()&&(o?i:l)?(e.preventDefault(),r7(t,e6,e)):!r&&"x"===n.toLowerCase()&&(o?i:l)?(e.preventDefault(),r7(t,te,e)):rX(n,i,l)&&(e.preventDefault(),r7(t,tt,e))}}else r7(t,e0,e)}}}else ty=!1,r7(t,eV,e);else r7(t,eZ,e);else r7(t,eH,e);else r7(t,eq,e);else r7(t,e$,e);(l||r||u||i)&&r7(t,ta,e)}}],["pointerdown",function(e,t){let n=e.target,r=e.pointerType;lg(n)&&"touch"!==r&&0===e.button&&nQ(t,()=>{n5(rM(n))||(t_=!0)})}],["compositionstart",function(e,t){nQ(t,()=>{let n=nx();if(nr(n)&&!t.isComposing()){let r=n.anchor,l=n.anchor.getNode();rF(r.key),(e.timeStamp<tc+30||"element"===r.type||!n.isCollapsed()||l.getFormat()!==n.format||t3(l)&&l.getStyle()!==n.style)&&r7(t,eM,y)}})}],["compositionend",function(e,t){a?tC=!0:!c&&(d||p)?(tS=!0,tx=e.data):nQ(t,()=>{tP(t,e.data)})}],["input",function(e,t){e.stopPropagation(),nQ(t,()=>{let n=nx(),r=e.data,l=tF(e);if(null!=r&&nr(n)&&tw(n,l,r,e.timeStamp,!1)){tC&&(tP(t,r),tC=!1);let l=n.anchor.getNode(),i=lc(lr(t));if(null===i)return;let o=n.isBackward(),f=o?n.anchor.offset:n.focus.offset,h=o?n.focus.offset:n.anchor.offset;u&&!n.isCollapsed()&&t3(l)&&null!==i.anchorNode&&l.getTextContent().slice(0,f)+r+l.getTextContent().slice(f+h)===rq(i.anchorNode)||r7(t,eM,r);let g=r.length;a&&g>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=g),d||c||p||!t.isComposing()||(tc=0,rF(null))}else rU(!1,t,null!==r?r:void 0),tC&&(tP(t,r||void 0),tC=!1);nB(),M(nW())},{event:e}),tg=null}],["click",function(e,t){nQ(t,()=>{let n=nx(),r=lc(lr(t)),l=nv();if(r){if(nr(n)){let t=n.anchor,i=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!n8(i)&&1===rR().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==l&&n.is(l))r.removeAllRanges(),n.dirty=!0;else if(3===e.detail&&!n.isCollapsed()&&i!==n.focus.getNode()){let e=function(e,t){let n=e;for(;n!==rR()&&null!=n;){if(t(n))return n;n=n.getParent()}return null}(i,e=>n4(e)&&!e.isInline());n4(e)&&e.select(0)}}else if("touch"===e.pointerType){let n=r.anchorNode;(lh(n)||rv(n))&&rK(nS(l,r,t,e))}}r7(t,eP,e)})}],["cut",tu],["copy",tu],["dragstart",tu],["dragover",tu],["dragend",tu],["paste",tu],["focus",tu],["blur",tu],["drop",tu]];u&&td.push(["beforeinput",(e,t)=>(function(e,t){let n=e.inputType,l=tF(e);"deleteCompositionText"===n||a&&r3(t)||"insertCompositionText"!==n&&nQ(t,()=>{var i;let o=nx();if("deleteContentBackward"===n){if(null===o){let e=nv();if(!nr(e))return;rK(e.clone())}if(nr(o)){let n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===tf&&i<tc+30&&t.isComposing()&&n){if(rF(null),tc=0,setTimeout(()=>{nQ(t,()=>{rF(null)})},30),nr(o)){let e=o.anchor.getNode();e.markDirty(),t3(e)||r(142),tE(o,e)}}else{rF(null),e.preventDefault();let r=o.anchor.getNode(),l=r.getTextContent(),i=r.canInsertTextAfter(),a=0===o.anchor.offset&&o.focus.offset===l.length,u=g&&n&&!a&&i;if(u&&o.isCollapsed()&&(u=!n5(r4(o.anchor,!0))),!u){r7(t,eA,!0);let e=nx();g&&nr(e)&&e.isCollapsed()&&(tv=e,setTimeout(()=>tv=null))}}return}}if(!nr(o))return;let a=e.data;null!==tg&&rU(!1,t,tg),o.dirty&&null===tg||!o.isCollapsed()||n8(o.anchor.getNode())||null===l||o.applyDOMRange(l),tg=null;let u=o.anchor,d=o.focus,f=u.getNode(),h=d.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":r7(t,eM,e);break;case"insertFromComposition":rF(null),r7(t,eM,e);break;case"insertLineBreak":rF(null),r7(t,eO,!1);break;case"insertParagraph":rF(null),ty&&!c?(ty=!1,r7(t,eO,!1)):r7(t,eL,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":r7(t,eI,e);break;case"deleteByComposition":(f!==h||n4(f)||n4(h)||!f.isToken()||!h.isToken())&&r7(t,eD,e);break;case"deleteByDrag":case"deleteByCut":r7(t,eD,e);break;case"deleteContent":r7(t,eA,!1);break;case"deleteWordBackward":r7(t,eR,!0);break;
15case"deleteWordForward":r7(t,eR,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":r7(t,eB,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":r7(t,eB,!1);break;case"formatStrikeThrough":r7(t,eK,"strikethrough");break;case"formatBold":r7(t,eK,"bold");break;case"formatItalic":r7(t,eK,"italic");break;case"formatUnderline":r7(t,eK,"underline");break;case"historyUndo":r7(t,eJ,void 0);break;case"historyRedo":r7(t,eW,void 0)}else{if("\n"===a)e.preventDefault(),r7(t,eO,!1);else if("\n\n"===a)e.preventDefault(),r7(t,eL,void 0);else if(null==a&&e.dataTransfer){let t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=a&&tw(o,l,a,e.timeStamp,!0)?(e.preventDefault(),r7(t,eM,a)):tg=a;th=e.timeStamp}})})(e,t)]);let tc=0,tf=null,th=0,tg=null,tp=new WeakMap,tm=!1,t_=!1,ty=!1,tC=!1,tS=!1,tx="",tv=null,tb=[0,"",0,"root",0];function tw(e,t,n,r,l){let i=e.anchor,o=e.focus,a=i.getNode(),d=nW(),c=lc(lr(d)),f=null!==c?c.anchorNode:null,h=i.key,g=d.getElementByKey(h),p=n.length;return h!==o.key||!t3(a)||(!l&&(!u||th<r+50)||a.isDirty()&&p<2||rz(n))&&i.offset!==o.offset&&!a.isComposing()||rx(a)||a.isDirty()&&p>1||(l||!u)&&null!==g&&!a.isComposing()&&f!==rb(g)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),l=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||l||function(e){let t=e.getPreviousSibling();return(t3(t)||n4(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||l)}(e,a)}function tT(e,t){return rv(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function tk(e,t,n){let{anchorNode:l,anchorOffset:i,focusNode:o,focusOffset:a}=e;tm&&(tm=!1,tT(l,i)&&tT(o,a)&&!tv)||nQ(t,()=>{if(!n)return void rK(null);if(!r_(t,l,o))return;let u=nx();if(tv&&nr(u)&&u.isCollapsed()){let e=u.anchor,t=tv.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&rK(u=tv.clone())}if(tv=null,nr(u)){let n=u.anchor,l=n.getNode();if(u.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(u.dirty=!0);let i=lr(t).event,o=i?i.timeStamp:performance.now(),[a,c,f,h,g]=tb,p=rR(),m=!1===t.isComposing()&&""===p.getTextContent();if(o<g+200&&n.offset===f&&n.key===h)tN(u,a,c);else if("text"===n.type)t3(l)||r(141),tE(u,l);else if("element"===n.type&&!m){var d;n4(l)||r(259);let e=n.getNode();e.isEmpty()?tN(u,(d=e).getTextFormat(),d.getTextStyle()):tN(u,0,"")}}else{let e=n.key,t=u.focus.key,r=u.getNodes(),l=r.length,o=u.isBackward(),d=o?a:i,c=o?i:a,f=o?t:e,h=o?e:t,g=2047,p=!1;for(let e=0;e<l;e++){let t=r[e],n=t.getTextContentSize();if(t3(t)&&0!==n&&(0!==e||t.__key!==f||d!==n)&&(e!==l-1||t.__key!==h||0!==c)&&(p=!0,0==(g&=t.getFormat())))break}u.format=p?g:0}}r7(t,eE,void 0)})}function tN(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function tE(e,t){tN(e,t.getFormat(),t.getStyle())}function tF(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return 0===t.length?null:t[0]}function tP(e,t){let n=e._compositionKey;if(rF(null),null!==n&&null!=t){if(""===t){let t=rA(n),r=rb(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&t3(t)&&rH(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){let t=nx();if(nr(t)){let n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void r7(e,eV,null)}}}rU(!0,e,t)}function tA(e){let t=e.__lexicalEventHandles;return void 0===t&&(e.__lexicalEventHandles=t=[]),t}let tO=new Map;function tL(e){let t=function(e){let t=ln(e);return t?t.getSelection():null}(e.target);if(null===t)return;let n=rC(t.anchorNode);if(null===n)return;t_&&(t_=!1,nQ(n,()=>{let r=nv(),l=t.anchorNode;(lh(l)||rv(l))&&rK(nS(r,t,n,e))}));let r=r$(n),l=r[r.length-1],i=l._key,o=tO.get(i),a=o||l;a!==n&&tk(t,a,!1),tk(t,n,!0),n!==l?tO.set(i,n):o&&tO.delete(i)}function tM(e){e._lexicalHandled=!0}function tI(e){return!0===e._lexicalHandled}function tD(e,t,n){nB();let r=e.__key,l=e.getParent();if(null===l)return;let i=function(e){let t=nx();if(!nr(t)||!n4(e))return t;let{anchor:n,focus:r}=t,l=n.getNode(),i=r.getNode();return lt(l,e)&&n.set(e.__key,0,"element"),lt(i,e)&&r.set(e.__key,0,"element"),t}(e),o=!1;
15if(nr(i)&&t){let t=i.anchor,n=i.focus;t.key===r&&(nT(t,e,l,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(nT(n,e,l,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else ni(i)&&t&&e.isSelected()&&e.selectPrevious();if(nr(i)&&t&&!o){let t=e.getIndexWithinParent();rN(e),nb(i,l,t,-1)}else rN(e);n||li(l)||l.canBeEmpty()||!l.isEmpty()||tD(l,t),t&&n8(l)&&l.isEmpty()&&l.selectEnd()}class tR{static getType(){r(64,this.name)}static clone(e){r(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),rk(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=rA(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){let t=e||nx();if(null==t)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(t3(this))return n;if(nr(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;let e=this.getParent();if(n5(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:rA(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(li(t))return n4(e)||e===this&&n5(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:rA(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:rA(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=n4(this)?this:this.getParent(),n=n4(e)?e:e.getParent(),r=t&&n?l0(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){let t=l0(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===lX(t):("same"!==t.type&&"ancestor"!==t.type&&r(279),!1)))}isParentOf(e){let t=l0(this,e);return null!==t&&"ancestor"===t.type}getNodesBetween(e){let t=this.isBefore(e),n=[],l=new Set,i=this;for(;null!==i;){let o=i.__key;if(l.has(o)||(l.add(o),n.push(i)),i===e)break;let a=n4(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==a){i=a;continue}let u=t?i.getNextSibling():i.getPreviousSibling();if(null!==u){i=u;continue}let d=i.getParentOrThrow();if(l.has(d.__key)||n.push(d),d===e)break;let c=null,f=d;do{if(null===f&&r(68),c=t?f.getNextSibling():f.getPreviousSibling(),null===(f=f.getParent()))break;null!==c||l.has(f.__key)||n.push(f)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){let e=nW()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){let e=rA(this.__key);return null===e&&r(113),e}getWritable(){nB();let e=nJ(),t=nW(),n=e._nodeMap,r=this.__key,l=this.getLatest(),i=t._cloneNotNeeded,o=nx();if(null!==o&&o.setCachedNodes(null),i.has(r))return rE(l),l;let a=lw(l);return i.add(r),rE(a),n.set(r,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){r(70)}updateDOM(e,t,n){r(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){r(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable();return(t||n.__state)&&$(e).updateFromJSON(t),n}(this,e.$)}static transform(){return null}remove(e){tD(this,!0,e)}replace(e,t){nB();let n=nx();null!==n&&(n=n.clone()),la(this,e);let l=this.getLatest(),i=this.__key,o=e.__key,a=e.getWritable(),u=this.getParentOrThrow().getWritable(),d=u.__size;rN(a);let c=l.getPreviousSibling(),f=l.getNextSibling(),h=l.__prev,g=l.__next,p=l.__parent;if((tD(l,!1,!0),null===c)?u.__first=o:c.getWritable().__next=o,(a.__prev=h,null===f)?u.__last=o:f.getWritable().__prev=o,a.__next=g,a.__parent=p,u.__size=d,t&&(n4(this)&&n4(a)||r(139),this.getChildren().forEac
15h(e=>{a.append(e)})),nr(n)){rK(n);let e=n.anchor,t=n.focus;e.key===i&&nt(e,a),t.key===i&&nt(t,a)}return rP()===i&&rF(o),a}insertAfter(e,t=!0){nB(),la(this,e);let n=this.getWritable(),r=e.getWritable(),l=r.getParent(),i=nx(),o=!1,a=!1;if(null!==l){let t=e.getIndexWithinParent();if(rN(r),nr(i)){let e=l.__key,n=i.anchor,r=i.focus;o="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}let u=this.getNextSibling(),d=this.getParentOrThrow().getWritable(),c=r.__key,f=n.__next;if(null===u?d.__last=c:u.getWritable().__prev=c,d.__size++,n.__next=c,r.__next=f,r.__prev=n.__key,r.__parent=n.__parent,t&&nr(i)){let e=this.getIndexWithinParent();nb(i,d,e+1);let t=d.__key;o&&i.anchor.set(t,e+2,"element"),a&&i.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){nB(),la(this,e);let n=this.getWritable(),r=e.getWritable(),l=r.__key;rN(r);let i=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),a=n.__prev,u=this.getIndexWithinParent();null===i?o.__first=l:i.getWritable().__next=l,o.__size++,n.__prev=l,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;let d=nx();return t&&nr(d)&&nb(d,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return ri()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){nB();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(n4(n))return n.select();if(!t3(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){nB();let n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(n4(n))return n.select(0,0);if(!t3(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}class tB extends tR{static getType(){return"linebreak"}static clone(e){return new tB(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(e){let t=e.parentElement;if(null!==t&&l_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&tz(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&tz(n))return!0}}return!1})(e)||function(e){let t=e.parentElement;if(null!==t&&l_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&tz(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&tz(r))return!0}return!1}(e)?null:{conversion:tK,priority:0}}}static importJSON(e){return tJ().updateFromJSON(e)}}function tK(e){return{node:tJ()}}function tJ(){return ls(new tB)}function tW(e){return e instanceof tB}function tz(e){return rv(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function t$(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function tj(e,t){return 1&t?"strong":2&t?"em":"span"}function tq(e,t,n,r,l){let i=r.classList,o=r0(l,"base");void 0!==o&&i.add(...o);let a=!1,u=8&t&&4&t;for(let e in void 0!==(o=r0(l,"underlineStrikethrough"))&&(8&n&&4&n?(a=!0,u||i.add(...o)):u&&i.remove(...o)),b){let r=b[e];if(void 0!==(o=r0(l,e)))if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&i.remove(...o);continue}t&r&&(!u||"underline"!==e)&&"strikethrough"!==e||i.add(...o)}else t&r&&i.remove(...o)}}function tU(e,t,n){let r=t.firstChild,l=n.isComposing(),i=e+(l?_:"");if(null==r)t.textContent=i;else{let e=r.nodeValue;if(e!==i)if(l||a){let[t,n,l]=function(e,t){let n=e.length,r=t.length,l=0,i=0;for(;l<n&&l<r&&e[l]===t[l];)l++;for(;i+l<n&&i+l<r&&e[n-i-1]===t[r-i-1];)i++;return[l,n-l-i,t.slice(l,r-i)]}(e,i);0!==n&&r.deleteData(t,n),r.insertData(t,l)}else r.nodeValue=i}}function tH(e,t,n,r,l,i){tU(l,e,t);let o=i.theme.text;void 0!==o&&tq(0,0,r,e,o)}function tZ(e,t){let n=document.createElement(t);return n.appendChild(e),n}class tV extends tR{static getType(){return"text"}static clone(e){return new tV(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return E[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===rP()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=b[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return rw(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=t$(0,n),l=tj(0,n),i=null===r?l:r,o=document.createElement(i),a=o;
15this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(a=document.createElement(l),o.appendChild(a)),tH(a,this,0,n,this.__text,e);let u=this.__style;return""!==u&&(o.style.cssText=u),o}updateDOM(e,t,n){let l=this.__text,i=e.__format,o=this.__format,a=t$(0,i),u=t$(0,o),d=tj(0,i),c=tj(0,o);if((null===a?d:a)!==(null===u?c:u))return!0;if(a===u&&d!==c){let e=t.firstChild;null==e&&r(48);let i=document.createElement(c);return tH(i,this,0,o,l,n),t.replaceChild(i,e),!1}let f=t;null!==u&&null!==a&&null==(f=t.firstChild)&&r(49),tU(l,f,this);let h=n.theme.text;void 0!==h&&i!==o&&tq(0,i,o,f,h);let g=e.__style,p=this.__style;return g!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:tQ,priority:0}),b:()=>({conversion:tY,priority:0}),code:()=>({conversion:t2,priority:0}),em:()=>({conversion:t2,priority:0}),i:()=>({conversion:t2,priority:0}),mark:()=>({conversion:t2,priority:0}),s:()=>({conversion:t2,priority:0}),span:()=>({conversion:tG,priority:0}),strong:()=>({conversion:t2,priority:0}),sub:()=>({conversion:t2,priority:0}),sup:()=>({conversion:t2,priority:0}),u:()=>({conversion:t2,priority:0})}}static importJSON(e){return t4().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}
15exportDOM(e){let{element:t}=super.exportDOM(e);return lh(t)||r(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=tZ(t,"b")),this.hasFormat("italic")&&(t=tZ(t,"i")),this.hasFormat("strikethrough")&&(t=tZ(t,"s")),this.hasFormat("underline")&&(t=tZ(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?b[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?w[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=rw(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=N[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){nB();let n=e,r=t,l=nx(),i=this.getTextContent(),o=this.__key;if("string"==typeof i){let e=i.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!nr(l))return nm(o,n,o,r,"text","text");{let e=rP();e!==l.anchor.key&&e!==l.focus.key||rF(o),l.setTextNodeRange(this,n,this,r)}return l}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let l=this.getWritable(),i=l.__text,o=n.length,a=e;a<0&&(a=o+a)<0&&(a=0);let u=nx();if(r&&nr(u)){let t=e+o;u.setTextNodeRange(l,t,l,t)}return l.__text=i.slice(0,a)+n+i.slice(a+t),l}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){let t;nB();let n=this.getLatest(),r=n.getTextContent();if(""===r)return[];let l=n.__key,i=rP(),o=r.length;e.sort((e,t)=>e-t),e.push(o);let a=[],u=e.length;for(let t=0,n=0;t<o&&n<=u;n++){let l=e[n];l>t&&(a.push(r.slice(t,l)),t=l)}let d=a.length;if(1===d)return[n];let c=a[0],f=n.getParent(),h=n.getFormat(),g=n.getStyle(),p=n.__detail,m=!1,_=null,y=null,C=nx();if(nr(C)){let[e,t]=C.isBackward()?[C.focus,C.anchor]:[C.anchor,C.focus];"text"===e.type&&e.key===l&&(_=e),"text"===t.type&&t.key===l&&(y=t)}n.isSegmented()?((t=t4(c)).__format=h,t.__style=g,t.__detail=p,m=!0):(t=n.getWritable()).__text=c;let S=[t];for(let e=1;e<d;e++){let t=t4(a[e]);t.__format=h,t.__style=g,t.__detail=p;let n=t.__key;i===l&&rF(n),S.push(t)}let x=_?_.offset:null,v=y?y.offset:null,b=0;for(let e of S){if(!_&&!y)break;let t=b+e.getTextContentSize();if(null!==_&&null!==x&&x<=t&&x>=b&&(_.set(e.getKey(),x-b,"text"),x<t&&(_=null)),null!==y&&null!==v&&v<=t&&v>=b){y.set(e.getKey(),v-b,"text");break}b=t}if(null!==f){let e=this.getPreviousSibling(),t=this.getNextSibling();null!==e&&rE(e),null!==t&&rE(t);let n=f.getWritable(),r=this.getIndexWithinParent();m?(n.splice(r,0,S),this.remove()):n.splice(r,1,S),nr(C)&&nb(C,f,r,d-1)}return S}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||r(50);let n=this.__key,l=e.__key,i=this.__text,o=i.length;rP()===l&&rF(n);let a=nx();if(nr(a)){let r=a.anchor,i=a.focus;null!==r&&r.key===l&&nk(r,t,n,e,o),null!==i&&i.key===l&&nk(i,t,n,e,o)}let u=e.__text,d=t?u+i:i+u;this.setTextContent(d);let c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function tG(e){return{forChild:t7(e.style),node:null}}function tY(e){let t="normal"===e.style.fontWeight;return{forChild:t7(e.style,t?void 0:"bold"),node:null}}let tX=new WeakMap;function tQ(e){null===e.parentElement&&r(129);let t=e.textContent||"";if(null!==function(e){let t,n=e.parentNode,r=[e];for(;null!==n&&void 0===(t=tX.get(n))&&!function(e){if(!lh(e))return!1;if("PRE"===e.nodeName)return!0;let t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}(n);)r.push(n),n=n.parentNode;let l=void 0===t?n:t;for(let e=0;e<r.length;e++)tX.set(r[e],l);return l}(e)){let e=t.split(/(\r?\n|\t)/),n=[],r=e.length;for(let t=0;t<r;t++){let r=e[t];"\n"===r||"\r\n"===r?n.push(tJ()):"	"===r?n.push(t9()):""!==r&&n.push(t4(r))}return{node:n}}if(""===(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," ")))return{node:null};if(" "===t[0]){let n=e,r=!0;for(;null!==n&&null!==(n=t0(n,!1));){let e=n.textContent||"";if(e.length>
150){/[ \t\n]$/.test(e)&&(t=t.slice(1)),r=!1;break}}r&&(t=t.slice(1))}if(" "===t[t.length-1]){let n=e,r=!0;for(;null!==n&&null!==(n=t0(n,!0));)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(t=t.slice(0,t.length-1))}return""===t?{node:null}:{node:t4(t)}}function t0(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(lh(n=e)){let e=n.style.display;if(""===e&&!lm(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(rv(n))return n;if("BR"===n.nodeName)return null}}let t1={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function t2(e){let t=t1[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:t7(e.style,t),node:null}}function t4(e=""){return ls(new tV(e))}function t3(e){return e instanceof tV}function t7(e,t){let n=e.fontWeight,r=e.textDecoration.split(" "),l="700"===n||"bold"===n,i=r.includes("line-through"),o="italic"===e.fontStyle,a=r.includes("underline"),u=e.verticalAlign;return e=>(t3(e)&&(l&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),o&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==u||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==u||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}class t5 extends tV{static getType(){return"tab"}static clone(e){return new t5(e.__key)}constructor(e){super("	",e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=r0(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return t9().updateFromJSON(e)}setTextContent(e){return"	"!==e&&""!==e&&r(126),super.setTextContent(e)}setDetail(e){return 2!==e&&r(127),this}setMode(e){return"normal"!==e&&r(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function t9(){return ls(new t5)}class t8{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>lY(l6(l1(this,"next")),l6(l1(e,"next")))}getNode(){let e=rA(this.key);return null===e&&r(20),e}set(e,t,n,r){let l=this._selection,i=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,nR()||(rP()===i&&rF(e),null!==l&&(l.setCachedNodes(null),l.dirty=!0)))}}function t6(e,t,n){return new t8(e,t,n)}function ne(e,t){let n=t.__key,r=e.offset,l="element";if(t3(t)){l="text";let e=t.getTextContentSize();r>e&&(r=e)}else if(!n4(t)){let e=t.getNextSibling();if(t3(e))n=e.__key,r=0,l="text";else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,l)}function nt(e,t){if(n4(t)){let n=t.getLastDescendant();n4(n)||t3(n)?ne(e,n):ne(e,t)}else ne(e,t)}class nn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ni(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 nn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t,n=this.getNodes(),r=n.length,l=n[r-1];if(t3(l))t=l.select();else{let e=l.getIndexWithinParent()+1;t=l.getParentOrThrow().select(e,e)}t.insertNodes(e);for(let e=0;e<r;e++)n[e].remove()}getNodes(){let e=this._cachedNodes;if(null!==e)return e;let t=this._nodes,n=[];for(let e of t){let t=rA(e);null!==t&&n.push(t)}return nR()||(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();
15if((nx()||nv())===this&&e[0]){let t=lJ(e[0],"next");l4(lV(t,t))}for(let t of e)t.remove()}}function nr(e){return e instanceof nl}class nl{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!nr(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(null!==e)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let l=new Set,i=new Set;for(let n of e)if(lD(n)){let{origin:e}=n;0===t.length?l.add(e):(i.add(e),t.push(e))}else{let{origin:e}=n;n4(e)&&i.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),lI(e.focus)&&n4(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=l$(e.focus.origin,"previous");lD(n)&&l.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=lj(n))l.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!n4(e)||i.has(e)||e.isEmpty()||l.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){let n=l6(e.anchor),r=l6(e.anchor.getFlipped()),l=e=>lM(e)?e.origin:e.getNodeAtCaret(),i=l(n)||l(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(i)}return t}(ir(l7(this),"next"));return nR()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){let e=this.getNodes();if(0===e.length)return"";let t=e[0],n=e[e.length-1],r=this.anchor,l=this.focus,i=r.isBefore(l),[o,a]=ns(this),u="",d=!0;for(let c=0;c<e.length;c++){let f=e[c];if(n4(f)&&!f.isInline())d||(u+="\n"),d=!f.isEmpty();else if(d=!1,t3(f)){let e=f.getTextContent();f===t?f===n?"element"===r.type&&"element"===l.type&&l.offset!==r.offset||(e=o<a?e.slice(o,a):e.slice(a,o)):e=i?e.slice(o):e.slice(a):f===n&&(e=i?e.slice(0,a):e.slice(0,o)),u+=e}else!n5(f)&&!tW(f)||f===n&&this.isCollapsed()||(u+=f.getTextContent())}return u}applyDOMRange(e){let t=nW(),n=t.getEditorState()._selection,r=ng(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;let[l,i]=r;this.anchor.set(l.key,l.offset,l.type,!0),this.focus.set(i.key,i.offset,i.type,!0),H(this)}clone(){let e=this.anchor,t=this.focus;return new nl(t6(e.key,e.offset,e.type),t6(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=rw(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=b[e];return!!(this.format&t)}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];"\n"===r||"\r\n"===r?n.push(tJ()):"	"===r?n.push(t9()):n.push(t4(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,l=this.format,i=this.style,o=t,a=n;!this.isCollapsed()&&n.isBefore(t)&&(o=n,a=t),"element"===o.type&&function(e,t,n,r){let l=e.getNode(),i=l.getChildAtIndex(e.offset),o=t4(),a=n8(l)?ri().append(o):o;o.setFormat(n),o.setStyle(r),null===i?l.append(a):i.insertBefore(a),e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}(o,a,l,i),"element"===a.type&&l2(a,l6(l1(a,"next")));let u=o.offset,d=a.offset,c=this.getNodes(),f=c.length,h=c[0];t3(h)||r(26);let g=h.getTextContent().length,p=h.getParentOrThrow(),m=c[f-1];if(1===f&&"element"===a.type&&(d=g,a.set(o.key,d,"text")),this.isCollapsed()&&u===g&&(h.isSegmented()||h.isToken()||!h.canInsertTextAfter()||!p.canInsertTextAfter()&&null===h.getNextSibling())){let t=h.getNextSibling();if(t3(t)&&t.canInsertTextBefore()&&!rx(t)||((t=t4()).setFormat(l),t.setStyle(i),p.canInsertTextAfter()?h.insertAfter(t):p.insertAfter(t)),t.select(0,0),h=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===u&&(h.isSegmented()||h.isToken()||!h.canInsertTextBefore()||!p.canInsertTextBefore()&&null===h.getPreviousSibling())){let t=h.getPreviousSibling();if(t3(t)&&!rx(t)||((t=t4()).setFormat(l),p.canInsertTextBefore()?h.insertBefore(t):p.insertBefore(t)),t.select(),h=t,""!==e)return void this.insertText(e)}else if(h.isSegmented()&&u!==g){let e=t4(h.getTextContent());e.setFormat(l),h.replace(e),h=e}else if(!this.isCollapsed()&&""!==e){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||n4(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),nh(this.anchor,this.focus,null),void this.insertText(e)}if(1===f){if(h.isToken()){let t=t4(e);return t.select(),void h.replace(t)}let t=h.getFormat(),n=h.getStyle();if(u!==d||t===l&&n===i){if(h instanceof t5){let t=t4(e);return t.setFormat(l),t.setStyle(i),t.select(),void h.replace(t)}}else{if(""!==h.getTextContent()){let t=t4(e);if(t.setFormat(l),t.setStyle(i),t.select(),0===u)h.insertBefore(t,!1);else{let[e]=h.splitText(u);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}h.setFormat(l),h.setStyle(i)}let r=d-u;""===(h=h.spliceText(u,r,e,!0)).getTextContent()?h.remove():"text"===this.anchor.type&&(h.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{let t=new Set([...h.getParentKeys(),...m.getParentKeys()]),n=n4(h)?h:h.getParentOrThrow(),r=n4(m)?m:m.getParentOrThrow(),l=m;if(!n.is(r)&&r.isInline())do l=r,r=r.getParentOrThrow();while(r.isInline());if("text"===a.type&&(0!==d||""===m.getTextContent())||"element"===a.type&&m.getIndexWithinParent()<d)if(t3(m)&&!m.isToken()&&d!==m.getTextContentSize()){if(m.isSegmented()){let e=t4(m.getTextContent());m.replace(e),m=e}n8(a.getNode())||"text"!==a.type||(m=m.spliceText(0,d,"")),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?m.remove():e.remove()}else t.add(m.__key);let i=r.getChildren(),o=new Set(c),p=n.is(r),_=n.isInline()&&null===h.getNextSibling()?n:h;for(let e=i.length-1;e>=0;e--){let t=i[e];if(t.is(h)||n4(t)&&t.isParentOf(h))break;t.isAttached()&&(!o.has(t)||t.is(l)?p||_.insertAfter(t,!1):t.remove())}if(!p){let e=r,n=null;for(;null!==e;){let r=e.getChildren(),l=r.length;(0===l||r[l-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(h.isToken())if(u===g)h.select();else{let t=t4(e);t.select(),h.replace(t)}else""===(h=h.spliceText(u,g-u,e,!0)).getTextContent()?h.remove():h.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<f;e++){let n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=nx()===this;l3(this,function(e,t="removeEmptySlices"){let n,l;if(e.isCollapsed())return e;let i="root",o="next",a=t,u=ir(e,o),d=l9(u.anchor,i),c=l9(u.focu
15s.getFlipped(),i),f=new Set,h=[];for(let e of u.iterNodeCarets(i))if(lD(e))f.add(e.origin.getKey());else if(lI(e)){let{origin:t}=e;n4(t)&&!f.has(t.getKey())||h.push(t)}for(let e of h)e.remove();for(let e of u.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),r=l5(lJ(t,o)),l=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===a||"token"===l&&0!==e.distance)r.remove();else if(0!==e.distance){a="removeEmptySlices";let t=e.removeTextSlice(),n=e.caret.origin;if("segmented"===l){let e=t.origin,n=t4(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());r.replaceOrInsert(n),t=lW(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(l8(e)){n=l6(e);break}for(let e of c)if(l8(e)){l=l6(e);break}let g=function(e,t,n){let r;if(!e||!t)return null;let l=e.getParentAtCaret(),i=t.getParentAtCaret();if(!l||!i)return null;let o=l.getParents().reverse();o.push(l);let a=i.getParents().reverse();a.push(i);let u=Math.min(o.length,a.length);for(r=0;r<u&&o[r]===a[r];r++);let d=(e,t)=>{let n;for(let l=r;l<e.length;l++){let r=e[l];if(li(r))return;!n&&t(r)&&(n=r)}return n},c=d(o,ly),f=c&&d(a,e=>n.has(e.getKey())&&ly(e));return c&&f?[c,f]:null}(n,l,f);if(g){let[e,t]=g;l$(e,"previous").splice(0,t.getChildren()),t.remove()}let p=[n,l,...d,...c].find(l8);if(p)return lZ(it(l6(p),e.direction));r(269,JSON.stringify(d.map(e=>e.origin.__key)))}(l7(this))),e&&nx()!==this&&rK(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void rF(null);let n=this.getNodes(),r=[];for(let e of n)t3(e)&&r.push(e);let l=t=>{n.forEach(n=>{if(n4(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},i=r.length;if(0===i)return this.toggleFormat(e),rF(null),void l(t);let o=this.anchor,a=this.focus,u=this.isBackward(),d=u?a:o,c=u?o:a,f=0,h=r[0],g="element"===d.type?0:d.offset;if("text"===d.type&&g===h.getTextContentSize()&&(f=1,h=r[1],g=0),null==h)return;let p=h.getFormatFlags(e,t);l(p);let m=i-1,_=r[m],y="text"===c.type?c.offset:_.getTextContentSize();if(h.is(_)){if(g===y)return;if(rx(h)||0===g&&y===h.getTextContentSize())h.setFormat(p);else{let e=h.splitText(g,y),t=0===g?e[0]:e[1];t.setFormat(p),"text"===d.type&&d.set(t.__key,0,"text"),"text"===c.type&&c.set(t.__key,y-g,"text")}return void(this.format=p)}0===g||rx(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);let C=_.getFormatFlags(e,p);y>0&&(y===_.getTextContentSize()||rx(_)||([_]=_.splitText(y)),_.setFormat(C));for(let t=f+1;t<m;t++){let n=r[t],l=n.getFormatFlags(e,C);n.setFormat(l)}"text"===d.type&&d.set(h.__key,g,"text"),"text"===c.type&&c.set(_.__key,y,"text"),this.format=p|C}insertNodes(e){var t;if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();let t=nx();return nr(t)||r(134),t.insertNodes(e)}let n=(this.isBackward()?this.focus:this.anchor).getNode(),l=lC(n,ly),i=e[e.length-1];if(n4(l)&&"__language"in l){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let t=nF(this);l.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(n4(e)||n5(e))&&!e.isInline())){n4(l)||r(211,n.constructor.name,n.getType());let t=nF(this);return l.splice(t,0,e),void i.selectEnd()}let o=function(e){let t=ri(),n=null;for(let r=0;r<e.length;r++){let l=e[r],i=tW(l);if(i||n5(l)&&l.isInline()||n4(l)&&l.isInline()||t3(l)||l.isParentRequired()){if(null===n&&(n=l.createParentElementNode(),t.append(n),i))continue;null!==n&&n.append(l)}else t.append(l),n=null}return t}(e),a=o.getLastDescendant(),u=o.getChildren(),d=n4(l)&&l.isEmpty()?null:this.insertParagraph(),c=u[u.length-1],f=u[0];n4(t=f)&&ly(t)&&!t.isEmpty()&&n4(l)&&(!l.isEmpty()||l.canMergeWhenEmpty())&&(n4(l)||r(211,n.constructor.name,n.getType()),l.append(...f.getChildren()),f=u[1]),f&&(null===l&&r(212,n.constructor.name,n.getType()),function(e,t,n){let l=t.getParentOrThrow().getLastChild(),i=t,o=[t];for(;i!==l;)i.getNextSibling()||r(140),o.push(i=i.getNextSibling());let a=e;for(let e of o)a=a.insertAfter(e)}(l,f));let h=lC(a,ly);d&&n4(h)&&(d.canMergeWhenEmpty()||ly(c))&&(h.append(...d.getChildren()),d.remove()),n4(l)&&l.isEmpty()&&l.remove(),a.selectEnd();let g=n4(l)?l.getLastChild():null;tW(g)&&h!==l&&g.remove()}insertParagraph(){if("root"===this.anchor.key){let e=ri();return rR().splice(this.anchor.offset,0,[e]),e.select(),e}let e=nF(this),t=lC(this.anchor.getNode(),ly);n4(t)||r(213);let n=t.getChildAtIndex(e),l=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...l),i.selectStart(),i):null}insertLineBreak(e){let t=tJ();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=t-1,r=this.anchor,l=this.focus,i=e[0],o=e[n],[a,u]=ns(this);if(0===t)return[];
15if(1===t){if(t3(i)&&!this.isCollapsed()){let e=a>u?u:a,t=i.splitText(e,a>u?a:u),n=0===e?t[0]:t[1];return null!=n?[n]:[]}return[i]}let d=r.isBefore(l);if(t3(i)){let t=d?a:u;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(t3(o)){let t=o.getTextContent().length,r=d?u:a;0===r?e.pop():r!==t&&([o]=o.splitText(r),e[n]=o)}return e}modify(e,t,n){var r;if(nP(this,e,t,n))return;let l="move"===e,i=nW(),o=lc(lr(i));if(!o)return;let a=i._blockCursorElement,u=i._rootElement,d=this.focus.getNode();if(null===u||null===a||!n4(d)||d.isInline()||d.canBeEmpty()||ld(a,i,u),this.dirty){let e=r9(i,this.anchor.key),t=r9(i,this.focus.key);"text"===this.anchor.type&&(e=rb(e)),"text"===this.focus.type&&(t=rb(t)),e&&t&&nN(o,e,this.anchor.offset,t,this.focus.offset)}if(r=t?"backward":"forward",o.modify(e,r,n),o.rangeCount>0){let e=o.getRangeAt(0),n=this.anchor.getNode(),r=n8(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t&&!li(t);)t=t.getParentOrThrow();return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!l){let n=this.getNodes(),l=[],i=!1;for(let e=0;e<n.length;e++){let t=n[e];lt(t,r)?l.push(t):i=!0}if(i&&l.length>0)if(t){let e=l[0];n4(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=l[l.length-1];n4(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}o.anchorNode===e.startContainer&&o.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,l=n.offset,i=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,l,i,!0)}(this)}}"lineboundary"===n&&nP(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&n4(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(n4(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=lH(l1(t,e?"previous":"next"));if(r.getTextSlices().every(e=>null===e||0===e.distance)){let e={type:"initial"};for(let t of r.iterNodeCarets("shadowRoot"))if(lD(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(n4(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=l6(t);l3(this,lV(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(lI(t)){if(n4(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(n5(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&n4(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=ny();e.add(t.origin.getKey()),rK(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){let{caret:t,block:n}=e;return l3(this,lV(!t.origin.isEmpty()&&n.isEmpty()?l5(lJ(n,t.direction)):r.anchor,t)),this.removeText()}}let l=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&na(this,t.getNode()))return}else{let r="text"===l.type?l.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){let t=l.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&0!==t)return void nd(r,e,t)}else if(null!==n&&n.isSegmented()){let l=t.offset,i=n.getTextContentSize();if(n.is(r)||e&&0!==l||!e&&l!==i)return void nd(n,e,l)}!function(e,t){let n=e.anchor,r=e.focus,l=n.getNode();if(l===r.getNode()&&"text"===n.type&&"text"===r.type){var i;let e=n.offset,o=r.offset,a=e<o,u=a?e:o,d=a?o:e,c=d-1;u===c||rz(i=l.getTextContent().slice(u,d))||nu(i)||(t?r.set(r.key,c,r.type):n.set(n.key,c,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){let e=this.anchor.getNode();e.isEmpty()&&n8(e.getParent())&&null===e.getPreviousSibling()&&na(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}
15deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ni(e){return e instanceof nn}function no(e){let t=e.offset;if("text"===e.type)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function ns(e){let t=e.getStartEndPoints();if(null===t)return[0,0];let[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[no(n),no(r)]}function na(e,t){for(let n=t;n;n=n.getParent()){if(n4(n)){if(n.collapseAtStart(e))return!0;if(li(n))break}if(n.getPreviousSibling())break}return!1}let nu=(()=>{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 nd(e,t,n){let r=e.getTextContent().split(/(?=\s)/g),l=r.length,i=0,o=0;for(let e=0;e<l;e++){let a=e===l-1;if(o=i,i+=r[e].length,t&&i===n||i>n||a){r.splice(e,1),a&&(o=void 0);break}}let a=r.join("").trim();""===a?e.remove():(e.setTextContent(a),e.select(o,o))}function nc(e,t,n,l){let i,o=t;if(lh(e)){let a=!1,u=e.childNodes,d=u.length,c=l._blockCursorElement;o===d&&(a=!0,o=d-1);let f=u[o],h=!1;if(f===c)f=u[o+1],h=!0;else if(null!==c){let n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&o--}if(t3(i=rJ(f)))o=rW(i,a);else{let u=rJ(e);if(null===u)return null;if(n4(u)){let d=l.getElementByKey(u.getKey());null===d&&r(214);let c=u.getDOMSlot(d);[u,o]=c.resolveChildIndex(u,d,e,t),n4(u)||r(215),a&&o>=u.getChildrenSize()&&(o=Math.max(0,u.getChildrenSize()-1));let f=u.getChildAtIndex(o);if(n4(f)&&function(e,t,n){let r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(f,0,n)){let e=a?f.getLastDescendant():f.getFirstDescendant();u=null===e||n4(f=e)?f:f.getParentOrThrow(),o=0}t3(f)?(i=f,u=null,o=rW(f,a)):f!==u&&a&&!h&&(n4(u)||r(216),o=Math.min(u.getChildrenSize(),o+1))}else{let n=u.getIndexWithinParent();o=0===t&&n5(u)&&rJ(e)===u?n:n+1,u=u.getParentOrThrow()}if(n4(u))return t6(u.__key,o,"element")}}else i=rJ(e);return t3(i)?t6(i.__key,o,"text"):null}function nf(e,t,n){let r=e.offset,l=e.getNode();if(0===r){let r=l.getPreviousSibling(),i=l.getParent();if(t){if((n||!t)&&null===r&&n4(i)&&i.isInline()){let t=i.getPreviousSibling();t3(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else n4(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):t3(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===l.getTextContent().length){let r=l.getNextSibling(),i=l.getParent();if(t&&n4(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&n4(i)&&i.isInline()&&!i.canInsertTextAfter()){let t=i.getNextSibling();t3(t)&&e.set(t.__key,0,"text")}}}function nh(e,t,n){if("text"===e.type&&"text"===t.type){let r=e.isBefore(t),l=e.is(t);nf(e,r,l),nf(t,!r,l),l&&t.set(e.key,e.offset,e.type);let i=nW();if(i.isComposing()&&i._compositionKey!==e.key&&nr(n)){let r=n.anchor,l=n.focus;e.set(r.key,r.offset,r.type,!0),t.set(l.key,l.offset,l.type,!0)}}}function ng(e,t,n,r,l,i){if(null===e||null===n||!r_(l,e,n))return null;let o=nc(e,t,nr(i)?i.anchor:null,l);if(null===o)return null;let a=nc(n,r,nr(i)?i.focus:null,l);if(null===a)return null;if("element"===o.type&&"element"===a.type){let t=rJ(e),r=rJ(n);if(n5(t)&&n5(r))return null}return nh(o,a,i),[o,a]}function np(e){return n4(e)&&!e.isInline()}function nm(e,t,n,r,l,i){let o=nJ(),a=new nl(t6(e,t,l),t6(n,r,i),0,"");return a.dirty=!0,o._selection=a,a}function n_(){return new nl(t6("root",0,"element"),t6("root",0,"element"),0,"")}function ny(){return new nn(new Set)}function nC(e,t){return nS(null,e,t,null)}function nS(e,t,n,r){let l,i,o,a,u=n._window;if(null===u)return null;let d=r||u.event,c=d?d.type:void 0,f="selectionchange"===c,h=!F&&(f||"beforeinput"===c||"compositionstart"===c||"compositionend"===c||"click"===c&&d&&3===d.detail||"drop"===c||void 0===c);if(nr(e)&&!h)return e.clone();if(null===t)return null;if(l=t.anchorNode,i=t.focusNode,o=t.anchorOffset,a=t.focusOffset,f&&nr(e)&&!r_(n,l,i))return e.clone();let g=ng(l,o,i,a,n,e);if(null===g)return null;let[p,m]=g;
15return new nl(p,m,nr(e)?e.format:0,nr(e)?e.style:"")}function nx(){return nJ()._selection}function nv(){return nW()._editorState._selection}function nb(e,t,n,r=1){let l=e.anchor,i=e.focus,o=l.getNode(),a=i.getNode();if(!t.is(o)&&!t.is(a))return;let u=t.__key;if(e.isCollapsed()){let t=l.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);l.set(u,n,"element"),i.set(u,n,"element"),nw(e)}}else{let o=e.isBackward(),a=o?i:l,d=a.getNode(),c=o?l:i,f=c.getNode();if(t.is(d)){let e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(u,Math.max(0,e+r),"element")}if(t.is(f)){let e=c.offset;(n<=e&&r>0||n<e&&r<0)&&c.set(u,Math.max(0,e+r),"element")}}nw(e)}function nw(e){let t=e.anchor,n=t.offset,r=e.focus,l=r.offset,i=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!n4(i))return;let e=i.getChildrenSize(),l=n>=e,o=l?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(t3(o)){let e=0;l&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),r.set(o.__key,e,"text")}}else{if(n4(i)){let e=i.getChildrenSize(),r=n>=e,l=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(t3(l)){let e=0;r&&(e=l.getTextContentSize()),t.set(l.__key,e,"text")}}if(n4(o)){let e=o.getChildrenSize(),t=l>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(l);if(t3(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function nT(e,t,n,r,l){let i=null,o=0,a=null;null!==r?(i=r.__key,t3(r)?(o=r.getTextContentSize(),a="text"):n4(r)&&(o=r.getChildrenSize(),a="element")):null!==l&&(i=l.__key,t3(l)?a="text":n4(l)&&(a="element")),null!==i&&null!==a?e.set(i,o,a):(-1===(o=t.getIndexWithinParent())&&(o=n.getChildrenSize()),e.set(n.__key,o,"element"))}function nk(e,t,n,r,l){"text"===e.type?e.set(n,e.offset+(t?0:l),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function nN(e,t,n,r,l){try{e.setBaseAndExtent(t,n,r,l)}catch(e){}}function nE(e){let t=nx()||nv();null===t&&(t=rR().selectEnd()),t.insertNodes(e)}function nF(e){let t=e;e.isCollapsed()||t.removeText();let n=nx();nr(n)&&(t=n),nr(t)||r(161);let l=t.anchor,i=l.getNode(),o=l.offset;for(;!ly(i);){let e=i;if([i,o]=function(e,t){let n=e.getParent();if(!n){let e=ri();return rR().append(e),e.select(),[rR(),0]}if(t3(e)){let r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];let l=+(0!==t);return[n,r[0].getIndexWithinParent()+l]}if(!n4(e)||0===t)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new nl(t6(e.__key,t,"element"),t6(e.__key,t,"element"),0,""),l=e.insertNewAfter(n);l&&l.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}(i,o),e.is(i))break}return o}function nP(e,t,n,r,l="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let i=l1(e.focus,n?"previous":"next"),o="lineboundary"===r,a="move"===t,u=i,d="decorators-and-blocks"===l;if(!ie(u)){for(let e of u){d=!1;let{origin:t}=e;if(!n5(t)||t.isIsolated()||(u=e,!o||!t.isInline()))break}if(d)for(let e of lH(i).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(lD(e))e.origin.isInline()||(u=e);else{if(n4(e.origin))continue;n5(e.origin)&&!e.origin.isInline()&&(u=e)}break}}if(u===i)return!1;if(a&&!o&&n5(u.origin)&&u.origin.isKeyboardSelectable()){let e=ny();return e.add(u.origin.getKey()),rK(e),!0}return u=l6(u),a&&l2(e.anchor,u),l2(e.focus,u),d||!o}let nA=null,nO=null,nL=!1,nM=!1,nI=0,nD={characterData:!0,childList:!0,subtree:!0};function nR(){return nL||null!==nA&&nA._readOnly}function nB(){nL&&r(13)}function nK(){nI>99&&r(14)}function nJ(){return null===nA&&r(195,nz()),nA}function nW(){return null===nO&&r(196,nz()),nO}function nz(){let e=0,t=new Set,n=rh.version;if("undefined"!=typeof window)for(let r of document.querySelectorAll("[contenteditable]")){let l=rS(r);if(ry(l))e++;else if(l){let e=String(l.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function n$(e,t,n){let l=t.__type,i=function(e,t){let n=e._nodes.get(t);return void 0===n&&r(30,t),n}(e,l),o=n.get(l);void 0===o&&(o=Array.from(i.transforms),n.set(l,o));let a=o.length;for(let e=0;e<a&&(o[e](t),t.isAttached());e++);}function nj(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function nq(e,t){if(!t)return;let n=e._updateTags,r=t;for(let e of(Array.isArray(t)||(r=[t]),r))n.add(e)}function nU(e){return nH(e,nW()._nodes)}function nH(e,t){let n=e.type,l=t.get(n);void 0===l&&r(17,n);let i=l.klass;e.type!==i.getType()&&r(18,i.name);let o=i.importJSON(e),a=e.children;if(n4(o)&&Array.isArray(a))for(let e=0;e<a.length;e++){let n=nH(a[e],t);o.append(n)}return o}
15function nZ(e,t,n){let r=nA,l=nL,i=nO;nA=t,nL=!0,nO=e;try{return n()}finally{nA=r,nL=l,nO=i}}function nV(e,t){let n=e._pendingEditorState,l=e._rootElement,i=e._headless||null===l;if(null===n)return;let o=e._editorState,a=o._selection,u=n._selection,d=0!==e._dirtyType,c=nA,f=nL,h=nO,g=e._updating,p=e._observer,_=null;if(e._pendingEditorState=null,e._editorState=n,!i&&d&&null!==p){nO=e,nA=n,nL=!1,e._updating=!0;try{let t=e._dirtyType,l=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),_=function(e,t,n,l,i,o){ei="",eu="",eo="",ed=2===l,ef=null,G=n,V=n._config,Y=n._nodes,X=G._listeners.mutation,Q=i,ee=o,et=e._nodeMap,en=t._nodeMap,ec=t._readOnly,er=new Map(n._keyToDOMMap);let a=new Map;return el=a,function e(t,n){let l=et.get(t),i=en.get(t);void 0!==l&&void 0!==i||r(61);let o=ed||ee.has(t)||Q.has(t),a=r9(G,t);if(l===i&&!o){if(n4(l)){let e=a.__lexicalTextContent;void 0!==e&&(ei+=e,eu+=e);let t=a.__lexicalDirTextContent;void 0!==t&&(eo+=t)}else{let e=l.getTextContent();t3(l)&&!l.isDirectionless()&&(eo+=e),eu+=e,ei+=e}return a}if(l!==i&&o&&r1(el,Y,X,i,"updated"),i.updateDOM(l,a,V)){let e=ey(t,null);return null===n&&r(62),n.replaceChild(e,a),eh(t,null),e}if(n4(l)&&n4(i)){let t=i.__indent;t!==l.__indent&&em(a,t);let n=i.__format;n!==l.__format&&e_(a,n),o&&(function(t,n,l){let i=eo;eo="",es=null,ea="",function(t,n,l){let i=ei,o=t.__size,a=n.__size;ei="";let u=l.element;if(1===o&&1===a){let r=t.__first,l=n.__first;if(r===l)e(r,u);else{let e=ek(r),t=ey(l,null);try{u.replaceChild(t,e)}catch(n){if("object"==typeof n&&null!=n)throw Error(`${n.toString()} Parent: ${u.tagName}, new child: {tag: ${t.tagName} key: ${l}}, old child: {tag: ${e.tagName}, key: ${r}}.`);throw n}eh(r,null)}let i=en.get(l);t3(i)&&(null===es&&(es=i.getFormat()),""===ea&&(ea=i.getStyle()))}else{let i=eb(t,et),d=eb(n,en);if(i.length!==o&&r(227),d.length!==a&&r(228),0===o)0!==a&&eC(d,n,0,a-1,l);else if(0===a){if(0!==o){let e=null==l.after&&null==l.before&&null==l.element.__lexicalLineBreak;eg(i,0,o-1,e?null:u),e&&(u.textContent="")}}else!function(t,n,r,l,i,o){let a=l-1,u=i-1,d,c,f=o.getFirstChild(),h=0,g=0;for(;h<=a&&g<=u;){let t=n[h],l=r[g];if(t===l)f=eT(e(l,o.element)),h++,g++;else{void 0===d&&(d=new Set(n)),void 0===c&&(c=new Set(r));let i=c.has(t),a=d.has(l);if(i)if(a){let t=r9(G,l);t===f?f=eT(e(l,o.element)):(o.withBefore(f).insertChild(t),e(l,o.element)),h++,g++}else ey(l,o.withBefore(f)),g++;else f=eT(ek(t)),eh(t,o.element),h++}let i=en.get(l);null!==i&&t3(i)&&(null===es&&(es=i.getFormat()),""===ea&&(ea=i.getStyle()))}let p=h>a,m=g>u;if(p&&!m){let e=r[u+1],n=void 0===e?null:G.getElementByKey(e);eC(r,t,g,u,o.withBefore(n))}else m&&!p&&eg(n,h,a,o.element)}(n,i,d,o,a,l)}r5(n)&&(ei+="\n\n"),u.__lexicalTextContent=ei,ei=i+ei}(t,n,n.getDOMSlot(l)),ev(n,l),null==es||es===n.__textFormat||ec||n.setTextFormat(es),""===ea||ea===n.__textStyle||ec||n.setTextStyle(ea),eo=i}(l,i,a),n8(i)||i.isInline()||ex(l,i,a)),r5(i)&&(ei+="\n\n",eu+="\n\n")}else{let e=i.getTextContent();if(n5(i)){let e=i.decorate(G,V);null!==e&&ew(t,e)}else t3(i)&&!i.isDirectionless()&&(eo+=e);ei+=e,eu+=e}if(!ec&&n8(i)&&i.__cachedText!==eu){let e=i.getWritable();e.__cachedText=eu,i=e}return a}("root",null),G=void 0,Y=void 0,Q=void 0,ee=void 0,et=void 0,en=void 0,V=void 0,er=void 0,el=void 0,a}(o,n,e,t,l,i)}catch(t){if(t instanceof Error&&e._onError(t),nM)throw t;return rc(e,null,l,n),I(e),e._dirtyType=2,nM=!0,nV(e,o),void(nM=!1)}finally{p.observe(l,nD),e._updating=g,nA=c,nL=f,nO=h}}n._readOnly||(n._readOnly=!0);let y=e._dirtyLeaves,C=e._dirtyElements,S=e._normalizedNodes,x=e._updateTags,v=e._deferred;d&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n,r=e._decorators,l=e._pendingDecorators||r,i=t._nodeMap;for(n in l)i.has(n)||(l===r&&(l=rI(e)),delete l[n])}(e,n);let b=i?null:lc(lr(e));if(e._editable&&null!==b&&(d||null===u||u.dirty)&&null!==l&&!x.has("skip-dom-selection")){nO=e,nA=n;try{if(null!==p&&p.disconnect(),d||null===u||u.dirty){let t=e._blockCursorElement;null!==t&&ld(t,e,l),function(e,t,n,r,l,i,o){let a=r.anchorNode,u=r.focusNode,d=r.anchorOffset,c=r.focusOffset,f=document.activeElement;if(l.has("collaboration")&&f!==i||null!==f&&rm(f))return;if(!nr(t))return null!==e&&r_(n,a,u)&&r.removeAllRanges();let h=t.anchor,g=t.focus,p=h.key,m=g.key,_=r9(n,p),y=r9(n,m),C=h.offset,S=g.offset,x=t.format,v=t.style,b=t.isCollapsed(),w=_,T=y,k=!1;if("text"===h.type){w=rb(_);let e=h.getNode();k=e.getFormat()!==x||e.getStyle()!==v}else nr(e)&&"text"===e.anchor.type&&(k=!0);if("text"===g.type&&(T=rb(y)),null!==w&&null!==T&&(b&&(null===e||k||nr(e)&&(e.format!==x||e.style!==v))&&(tb=[x,v,C,p,performance.now()]),d!==C||
15c!==S||a!==w||u!==T||"Range"===r.type&&b||(null!==f&&i.contains(f)||i.focus({preventScroll:!0}),"element"===h.type))){if(nN(r,w,C,T,S),!l.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==i&&i===document.activeElement){let e=nr(t)&&"element"===t.anchor.type?w.childNodes[C]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){let r=r6(n),l=ln(r);if(null===r||null===l)return;let{top:i,bottom:o}=t,a=0,u=0,d=n;for(;null!==d;){let t=d===r.body;if(t)a=0,u=lr(e).innerHeight;else{let e=d.getBoundingClientRect();a=e.top,u=e.bottom}let n=0;if(i<a?n=-(a-i):o>u&&(n=o-u),0!==n)if(t)l.scrollBy(0,n);else{let e=d.scrollTop;d.scrollTop+=n;let t=d.scrollTop-e;i-=t,o-=t}if(t)break;d=r8(d)}}(n,t,i)}}tm=!0}}(a,u,e,b,x,l)}!function(e,t,n){let r=e._blockCursorElement;if(nr(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){let l=n.anchor,i=l.getNode(),o=l.offset,a=!1,u=null;if(o===i.getChildrenSize())lu(i.getChildAtIndex(o-1))&&(a=!0);else{let t=i.getChildAtIndex(o);if(null!==t&&lu(t)){let n=t.getPreviousSibling();(null===n||lu(n))&&(a=!0,u=e.getElementByKey(t.__key))}}if(a){let n=e.getElementByKey(i.__key);return null===r&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;return void 0!==r&&("string"==typeof r&&(r=t.blockCursor=m(r)),void 0!==r&&n.classList.add(...r)),n}(e._config)),t.style.caretColor="transparent",null===u?n.appendChild(r):n.insertBefore(r,u)}}null!==r&&ld(r,e,t)}(e,l,u)}finally{null!==p&&p.observe(l,nD),nO=h,nA=c}}null!==_&&function(e,t,n,r,l){let i=Array.from(e._listeners.mutation),o=i.length;for(let e=0;e<o;e++){let[o,a]=i[e],u=t.get(a);void 0!==u&&o(u,{dirtyLeaves:r,prevEditorState:l,updateTags:n})}}(e,_,x,y,o),nr(u)||null===u||null!==a&&a.is(u)||e.dispatchCommand(eE,void 0);let w=e._pendingDecorators;null!==w&&(e._decorators=w,e._pendingDecorators=null,nG("decorator",e,!0,w)),function(e,t,n){let r=rD(t),l=rD(n);r!==l&&nG("textcontent",e,!0,l)}(e,t||o,n),nG("update",e,!0,{dirtyElements:C,dirtyLeaves:y,editorState:n,mutatedNodes:_,normalizedNodes:S,prevEditorState:t||o,tags:x}),function(e,t){if(e._deferred=[],0!==t.length){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,v),function(e){let t=e._updates;if(0!==t.length){let n=t.shift();if(n){let[t,r]=n;nX(e,t,r)}}}(e)}function nG(e,t,n,...r){let l=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=l}}function nY(e,t){let n=e._updates,l=t||!1;for(;0!==n.length;){let t=n.shift();if(t){let n,[i,o]=t;if(void 0!==o){if(n=o.onUpdate,o.skipTransforms&&(l=!0),o.discrete){let t=e._pendingEditorState;null===t&&r(191),t._flushSync=!0}n&&e._deferred.push(n),nq(e,o.tag)}i()}}return l}function nX(e,t,n){let l=e._updateTags,i,o=!1,a=!1;void 0!==n&&(i=n.onUpdate,nq(e,n.tag),o=n.skipTransforms||!1,a=n.discrete||!1),i&&e._deferred.push(i);let u=e._editorState,d=e._pendingEditorState,c=!1;(null===d||d._readOnly)&&(d=e._pendingEditorState=n6(d||u),c=!0),d._flushSync=a;let f=nA,h=nL,g=nO,p=e._updating;nA=d,nL=!1,e._updating=!0,nO=e;let m=e._headless||null===e.getRootElement();try{c&&(m?null!==u._selection&&(d._selection=u._selection.clone()):d._selection=function(e,t){let n=e.getEditorState()._selection,r=lc(lr(e));return nr(n)||null==n?nS(n,r,e,t):n.clone()}(e,n&&n.event||null));let l=e._compositionKey;t(),o=nY(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(nr(r)){let e,t=r.anchor,l=r.focus;if("text"===t.type&&(e=t.getNode()).selectionTransform(n,r),"text"===l.type){let t=l.getNode();e!==t&&t.selectionTransform(n,r)}}}(d,e),0!==e._dirtyType&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);t3(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&U(t)}}(d,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,l=e._nodeMap,i=rP(),o=new Map,a=n,u=a.size,d=r,c=d.size;
15for(;u>0||c>0;){if(u>0){for(let e of(t._dirtyLeaves=new Set,a)){let r=l.get(e);t3(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&U(r),void 0!==r&&nj(r,i)&&n$(t,r,o),n.add(e)}if((u=(a=t._dirtyLeaves).size)>0){nI++;continue}}for(let e of(t._dirtyLeaves=new Set,t._dirtyElements=new Map,d.delete("root")&&d.set("root",!0),d)){let n=e[0],a=e[1];if(r.set(n,a),!a)continue;let u=l.get(n);void 0!==u&&nj(u,i)&&n$(t,u,o)}u=(a=t._dirtyLeaves).size,c=(d=t._dirtyElements).size,nI++}t._dirtyLeaves=n,t._dirtyElements=r}(d,e),nY(e),function(e,t,n,r){let l=e._nodeMap,i=t._nodeMap,o=[];for(let[e]of r){let t=i.get(e);void 0!==t&&(t.isAttached()||(n4(t)&&function e(t,n,r,l,i,o){let a=t.getFirstChild();for(;null!==a;){let t=a.__key;a.__parent===n&&(n4(a)&&e(a,t,r,l,i,o),r.has(t)||o.delete(t),i.push(t)),a=a.getNextSibling()}}(t,e,l,i,o,r),l.has(e)||r.delete(e),o.push(e)))}for(let e of o)i.delete(e);for(let e of n){let t=i.get(e);void 0===t||t.isAttached()||(l.has(e)||n.delete(e),i.delete(e))}}(u,d,e._dirtyLeaves,e._dirtyElements)),l!==e._compositionKey&&(d._flushSync=!0);let i=d._selection;if(nr(i)){let e=d._nodeMap,t=i.anchor.key,n=i.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||r(19)}else ni(i)&&0===i._nodes.size&&(d._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=u,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void nV(e)}finally{nA=f,nL=h,nO=g,e._updating=p,nI=0}0!==e._dirtyType||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(d,e)?d._flushSync?(d._flushSync=!1,nV(e)):c&&rp(()=>{nV(e)}):(d._flushSync=!1,c&&(l.clear(),e._deferred=[],e._pendingEditorState=null))}function nQ(e,t,n){e._updating?nO===e?t():e._updates.push([t,n]):nX(e,t,n)}class n0{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new n0(this.element,e,this.after)}withAfter(e){return new n0(this.element,this.before,e)}withElement(e){return this.element===e?this:new n0(e,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return null!==t&&t.parentElement!==this.element&&r(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&r(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&r(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){null===e?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===e&&(c||d))}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,l=document.createElement("br");if(n.insertBefore(l,r),e){let e=document.createElement("img");e.setAttribute("data-lexical-linebreak","true"),e.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",e.alt="",n.insertBefore(e,l),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=l}getFirstChildOffset(){let e=0;for(let t=this.after;null!==t;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let l=n1(t,n);l.push(r);let i=n1(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<i.length;e++){let t=l[e],n=i[e];if(void 0===t||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}}function n1(e,t){let n=[],l=t;for(;l!==e&&null!==l;l=t.parentNode){let e=0;for(let t=l.previousSibling;null!==t;t=t.previousSibling)e++;n.push(e)}return l!==e&&r(225),n.reverse()}class n2 extends tR{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return k[this.getFormat()]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){let e=nW()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;null!==t;){if(t3(t)&&e.push(t),n4(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;n4(e);){let t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;n4(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 n4(e)&&e.getLastDescendant()||e||null}let r=t[e];return n4(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:rA(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&r(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:rA(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&r(96,this.__key),e}getChildAtIndex(e){let t,n,r=this.getChildrenSize();if(e<r/2){for(t=this.getFirstChild(),n=0;null!==t&&n<=e;){if(n===e)return t;t=t.getNextSibling(),n++}return null}for(t=this.getLastChild(),n=r-1;null!==t&&n>=e;){if(n===e)return t;t=t.getPreviousSibling(),n--}return null}getTextContent(){let e="",t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let l=t[r];e+=l.getTextContent(),n4(l)&&r!==n-1&&!l.isInline()&&(e+="\n\n")}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let l=t[r];e+=l.getTextContentSize(),n4(l)&&r!==n-1&&!l.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){let t=T[e];return!!(this.getFormat()&t)}return!1}hasTextFormat(e){let t=b[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return rw(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){nB();let n=nx(),r=e,l=t,i=this.getChildrenSize();if(!this.canBeEmpty()){if(0===e&&0===t){let e=this.getFirstChild();if(t3(e)||n4(e))return e.select(0,0)}else if((void 0===e||e===i)&&(void 0===t||t===i)){let e=this.getLastChild();if(t3(e)||n4(e))return e.select()}}void 0===r&&(r=i),void 0===l&&(l=i);let o=this.__key;
15return nr(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,l,"element"),n.dirty=!0,n):nm(o,r,o,l,"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?T[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){let l=n.length,i=this.getChildrenSize(),o=this.getWritable();e+t<=i||r(226,String(e),String(t),String(i));let a=o.__key,u=[],d=[],c=this.getChildAtIndex(e+t),f=null,h=i-t+l;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;rN(e.getWritable()),d.push(n),e=t}}let g=f;for(let e=0;e<l;e++){let t=n[e];null!==g&&t.is(g)&&(f=g=g.getPreviousSibling());let l=t.getWritable();l.__parent===a&&h--,rN(l);let i=t.__key;if(null===g)o.__first=i,l.__prev=null;else{let e=g.getWritable();e.__next=i,l.__prev=e.__key}t.__key===a&&r(76),l.__parent=a,u.push(i),g=t}if(e+t===i)null!==g&&(g.getWritable().__next=null,o.__last=g.__key);else if(null!==c){let e=c.getWritable();if(null!==g){let t=g.getWritable();e.__prev=g.__key,t.__next=c.__key}else e.__prev=null}if(o.__size=h,d.length){let e=nx();if(nr(e)){let t=new Set(d),n=new Set(u),{anchor:r,focus:l}=e;n3(r,t,n)&&nT(r,r.getNode(),this,f,c),n3(l,t,n)&&nT(l,l.getNode(),this,f,c),0!==h||this.canBeEmpty()||li(this)||this.remove()}}return o}getDOMSlot(e){return new n0(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(lh(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px");let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let l=t.getElementByKey(e.getKey());null!==l&&(null==r?(n.insertChild(l),r=l):r!==l&&n.replaceChild(l,r),r=r.nextSibling)}}}function n4(e){return e instanceof n2}function n3(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class n7 extends tR{decorate(e,t){r(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function n5(e){return e instanceof n7}class n9 extends n2{static getType(){return"root"}static clone(){return new n9}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){r(51)}getTextContent(){let e=this.__cachedText;return(nR()||0===nW()._dirtyType)&&null!==e?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)n4(e)||n5(e)||r(282);return super.splice(e,t,n)}static importJSON(e){return rR().updateFromJSON(e)}collapseAtStart(){return!0}}function n8(e){return e instanceof n9}function n6(e){return new rt(new Map(e._nodeMap))}function re(){return new rt(new Map([["root",new n9]]))}class rt{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return nZ(t&&t.editor||null,this,e)}clone(e){let t=new rt(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return nZ(null,this,()=>({root:function e(t){let n=t.exportJSON(),l=t.constructor;if(n.type!==l.getType()&&r(130,l.name),n4(t)){let i=n.children;Array.isArray(i)||r(59,l.name);let o=t.getChildren();for(let t=0;t<o.length;t++){let n=e(o[t]);i.push(n)}}return n}(rR())}))}}class rn extends n2{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class rr extends n2{static getType(){return"paragraph"}static clone(e){return new rr(e.__key)}createDOM(e){let t=document.createElement("p"),n=r0(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:rl,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(lh(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();t.style.textAlign=e}return{element:t}}static importJSON(e){return ri().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){let n=ri();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(0===e.length||t3(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function rl(e){let t=ri();return e.style&&(t.setFormat(e.style.textAlign),lT(e,t)),{node:t}}function ri(){return ls(new rr)}function ro(e){return e instanceof rr}let rs=0,ra=1,ru=3,rd=4;function rc(e,t,n,r){let l=e._keyToDOMMap;l.clear(),e._editorState=re(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let i=e._observer;null!==i&&(i.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",l.set("root",n))}function rf(e){let t,n=e||{},r=nO,l=n.theme||{},i=void 0===e?r:n.parentEditor||null,o=n.disableEvents||!1,a=re(),u=n.namespace||(null!==i?i._config.namespace:rj()),d=n.editorState,c=[n9,tV,tB,t5,rr,rn,...n.nodes||[]],{onError:f,html:h}=n,g=void 0===n.editable||n.editable;if(void 0===e&&null!==r)t=r._nodes;else{t=new Map;for(let e=0;e<c.length;e++){let n=c[e],r=null,l=null;if("function"!=typeof n){let e=n;n=e.replace,r=e.with,l=e.withKlass||null}let i=n.getType(),o=n.transform(),a=new Set;null!==o&&a.add(o),t.set(i,{exportDOM:h&&h.export?h.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:l,transforms:a})}}let p=new rh(a,i,t,{disableEvents:o,namespace:u,theme:l},f||console.error,function(e,t){let n=new Map,r=new Set,l=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])})};
15return e.forEach(e=>{let t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);let n=t.call(e.klass);null!==n&&l(n)}),t&&l(t),n}(t,h?h.import:void 0),g);return void 0!==d&&(p._pendingEditorState=d,p._dirtyType=2),p}class rh{constructor(e,t,n,r,l,i,o){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=rj(),this._onError=l,this._htmlConversions=i,this._editable=o,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&r(35);let l=this._commands;l.has(e)||l.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=l.get(e);void 0===i&&r(36,String(e));let o=i[n];return o.add(t),()=>{o.delete(t),i.every(e=>0===e.size)&&l.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,l=this._listeners.mutation;l.set(t,r);let i=n&&n.skipInitialization;return void 0!==i&&i||this.initializeMutationListener(t,r),()=>{l.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,r=lb(n).get(t.getType());if(!r)return;let l=new Map;for(let e of r.keys())l.set(e,"created");l.size>0&&e(l,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],l=n.replaceWithKlass;if(null!=l){let e=this.registerNodeTransformToKlass(l,t);r.push(e)}return function(e,t){let n=lb(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}0!==r.length&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=rA(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:"history-merge"}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return r7(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=r0(this._config.theme,"root"),l=this._pendingEditorState||this._editorState;if(this._rootElement=e,rc(this,t,e,l),null!==t&&(this._config.disableEvents||function(e){let t=e.ownerDocument,n=tp.get(t);void 0===n&&r(162);let l=n-1;l>=0||r(164),tp.set(t,l),0===l&&t.removeEventListener("selectionchange",tL);let i=rS(e);ry(i)?(!function(e){if(null!==e._parentEditor){let t=r$(e),n=t[t.length-1]._key;tO.get(n)===e&&tO.delete(n)}else tO.delete(e._key)}(i),e.__lexicalEditor=null):i&&r(198);let o=tA(e);for(let e=0;e<o.length;e++)o[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){let t=ln(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,I(this),this._updateTags.add("history-merge"),nV(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument,r=tp.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",tL),tp.set(n,(r||0)+1),e.__lexicalEditor=t;let l=tA(e);for(let n=0;n<td.length;n++){let[r,i]=td[n],o="function"==typeof i?e=>{tI(e)||(tM(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if(tI(e))return;tM(e);let n=t.isEditable();switch(r){case"cut":return n&&r7(t,te,e);case"copy":return r7(t,e6,e);case"paste":return n&&r7(t,eI,e);case"dragstart":return n&&r7(t,e5,e);case"dragover":return n&&r7(t,e9,e);case"dragend":return n&&r7(t,e8,e);case"focus":return n&&r7(t,to,e);case"blur":return n&&r7(t,ts,e);case"drop":return n&&r7(t,e3,e)}};e.addEventListener(r,o),l.push(()=>{e.removeEventListener(r,o)})}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add("history-merge"),nV(this);nG("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=n6(e))._selection=e._selection?e._selection.clone():null),M(this);
15let l=this._pendingEditorState,i=this._updateTags,o=void 0!==t?t.tag:null;null===l||l.isEmpty()||(null!=o&&i.add(o),nV(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&i.add(o),this._updating||nV(this)}parseEditorState(e,t){return function(e,t,n){let r=re(),l=nA,i=nL,o=nO,a=t._dirtyElements,u=t._dirtyLeaves,d=t._cloneNotNeeded,c=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,nA=r,nL=!1,nO=t;try{let l=t._nodes;nH(e.root,l),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=u,t._cloneNotNeeded=d,t._dirtyType=c,nA=l,nL=i,nO=o}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return nV(this),this.getEditorState().read(e,{editor:this})}update(e,t){this._updating?this._updates.push([e,t]):nX(this,e,t)}focus(e,t={}){let n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),nQ(this,()=>{var r;let l=nx(),i=rR();null!==l?l.dirty=!0:0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),le("focus"),r=()=>{n.removeAttribute("autocapitalize"),e&&e()},nB(),nW()._deferred.push(r)}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;null!==e&&e.blur();let t=lc(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,nG("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}rh.version="0.28.0+prod.esm";let rg=1,rp="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function rm(e){let t=document.activeElement;if(!lh(t))return!1;let n=t.nodeName;return n5(rM(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==rS(t))}function r_(e,t,n){let r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!rm(t)&&rC(t)===e}catch(e){return!1}}function ry(e){return e instanceof rh}function rC(e){let t=e;for(;null!=t;){let e=rS(t);if(ry(e))return e;t=r8(t)}return null}function rS(e){return e?e.__lexicalEditor:null}function rx(e){return e.isToken()||e.isSegmented()}
15function rv(e){return lg(e)&&3===e.nodeType}function rb(e){let t=e;for(;null!=t;){if(rv(t))return t;t=t.firstChild}return null}function rw(e,t,n){let r=b[t];if(null!==n&&(e&r)==(n&r))return e;let l=e^r;return"subscript"===t?l&=~b.superscript:"superscript"===t?l&=~b.subscript:"lowercase"===t?(l&=~b.uppercase,l&=~b.capitalize):"uppercase"===t?(l&=~b.lowercase,l&=~b.capitalize):"capitalize"===t&&(l&=~b.lowercase,l&=~b.uppercase),l}function rT(e){return t3(e)||tW(e)||n5(e)}function rk(e,t){if(null!=t)return void(e.__key=t);nB(),nK();let n=nW(),r=nJ(),l=""+rg++;r._nodeMap.set(l,e),n4(e)?n._dirtyElements.set(l,!0):n._dirtyLeaves.add(l),n._cloneNotNeeded.add(l),n._dirtyType=1,e.__key=l}function rN(e){let t=e.getParent();if(null!==t){let n=e.getWritable(),r=t.getWritable(),l=e.getPreviousSibling(),i=e.getNextSibling();if(null===l)if(null!==i){let e=i.getWritable();r.__first=i.__key,e.__prev=null}else r.__first=null;else{let e=l.getWritable();if(null!==i){let t=i.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===i)if(null!==l){let e=l.getWritable();r.__last=l.__key,e.__next=null}else r.__last=null;else{let e=i.getWritable();if(null!==l){let t=l.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function rE(e){nK();let t=e.getLatest(),n=t.__parent,r=nJ(),l=nW(),i=r._nodeMap,o=l._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;let e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,i,o);let a=t.__key;l._dirtyType=1,n4(e)?o.set(a,!0):l._dirtyLeaves.add(a)}function rF(e){nB();let t=nW(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){let e=rA(n);null!==e&&e.getWritable()}if(null!==e){let t=rA(e);null!==t&&t.getWritable()}}}function rP(){return nR()?null:nW()._compositionKey}function rA(e,t){let n=(t||nJ())._nodeMap.get(e);return void 0===n?null:n}function rO(e,t){let n=rL(e,nW());return void 0!==n?rA(n,t):null}function rL(e,t){return e[`__lexicalKey_${t._key}`]}function rM(e,t){let n=e;for(;null!=n;){let e=rO(n,t);if(null!==e)return e;n=r8(n)}return null}function rI(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t,t}function rD(e){return e.read(()=>rR().getTextContent())}function rR(){return rB(nJ())}function rB(e){return e._nodeMap.get("root")}function rK(e){nB();let t=nJ();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function rJ(e){let t=nW(),n=function(e,t){let n=e;for(;null!=n;){let e=rL(n,t);if(void 0!==e)return e;n=r8(n)}return null}(e,t);return null===n?e===t.getRootElement()?rA("root"):null:rA(n)}function rW(e,t){return t?e.getTextContentSize():0}function rz(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function r$(e){let t=[],n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function rj(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function rq(e){return rv(e)?e.nodeValue:null}function rU(e,t,n){let r=lc(lr(t));if(null===r)return;let l=r.anchorNode,{anchorOffset:i,focusOffset:o}=r;if(null!==l){let t=rq(l),r=rM(l);if(null!==t&&t3(r)){if(t===_&&n){let e=n.length;t=n,i=e,o=e}null!==t&&rH(r,t,i,o,e)}}}function rH(e,t,n,r,l){let i=e;if(i.isAttached()&&(l||!i.isDirty())){let o=i.isComposing(),a=t;(o||l)&&t[t.length-1]===_&&(a=t.slice(0,-1));let u=i.getTextContent();if(l||a!==u){if(""===a){if(rF(null),d||c||p)i.remove();else{let e=nW();setTimeout(()=>{e.update(()=>{i.isAttached()&&i.remove()})},20)}return}let t=i.getParent(),l=nv(),u=i.getTextContentSize(),f=rP(),h=i.getKey();if(i.isToken()||null!==f&&h===f&&!o||nr(l)&&(null!==t&&!t.canInsertTextBefore()&&0===l.anchor.offset||l.anchor.key===e.__key&&0===l.anchor.offset&&!i.canInsertTextBefore()&&!o||l.focus.key===e.__key&&l.focus.offset===u&&!i.canInsertTextAfter()&&!o))return void i.markDirty();let g=nx();if(!nr(g)||null===n||null===r)return void i.setTextContent(a);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){let e=t4(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function rZ(e){return"ArrowLeft"===e}function rV(e){return"ArrowRight"===e}function rG(e){return"Backspace"===e}function rY(e){return"Delete"===e}
15function rX(e,t,n){return"a"===e.toLowerCase()&&(o?t:n)}function rQ(e){let t=rR();if(nr(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),H(e),e}{let e=t.select(0,t.getChildrenSize());return rK(H(e)),e}}function r0(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;let l=e[t];if("string"==typeof l){let e=m(l);return n[t]=e,e}return l}function r1(e,t,n,l,i){if(0===n.size)return;let o=l.__type,a=l.__key,u=t.get(o);void 0===u&&r(33,o);let d=u.klass,c=e.get(d);void 0===c&&(c=new Map,e.set(d,c));let f=c.get(a),h="destroyed"===f&&"created"===i;(void 0===f||h)&&c.set(a,h?"updated":i)}function r2(e,t,n){let r=e.getParent(),l=n,i=e;return null!==r&&(t&&0===n?(l=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(l=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?l-1:l)}function r4(e,t){let n=e.offset;if("element"===e.type)return r2(e.getNode(),t,n);{let r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return null===e?r2(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function r3(e){let t=lr(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function r7(e,t,n){return function e(t,n,r){if(!1===t._updating||nO!==t){let l=!1;return t.update(()=>{l=e(t,n,r)}),l}let l=r$(t);for(let e=4;e>=0;e--)for(let i=0;i<l.length;i++){let o=l[i]._commands.get(n);if(void 0!==o){let n=o[e];if(void 0!==n){let e=Array.from(n),l=e.length;for(let n=0;n<l;n++)if(!0===e[n](r,t))return!0}}}return!1}(e,t,n)}function r5(e){return!n8(e)&&!e.isLastChild()&&!e.isInline()}function r9(e,t){let n=e._keyToDOMMap.get(t);return void 0===n&&r(75,t),n}function r8(e){let t=e.assignedSlot||e.parentElement;return lp(t)?t.host:t}function r6(e){return lg(e)&&9===e.nodeType?e:lh(e)?e.ownerDocument:null}function le(e){nB(),nW()._updateTags.add(e)}function lt(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function ln(e){let t=r6(e);return t?t.defaultView:null}function lr(e){let t=e._window;return null===t&&r(78),t}function ll(e){return n4(e)&&e.isInline()||n5(e)&&e.isInline()}function li(e){return n8(e)||n4(e)&&e.isShadowRoot()}function lo(e){let t=e.constructor.clone(e);return rk(t,null),t}function ls(e){let t=nW(),n=e.constructor.getType(),l=t._nodes.get(n);void 0===l&&r(200,e.constructor.name,n);let{replace:i,replaceWithKlass:o}=l;if(null!==i){let t=i(e),l=t.constructor;return null!==o?t instanceof o||r(201,o.name,o.getType(),l.name,l.getType(),e.constructor.name,n):t instanceof e.constructor&&l!==e.constructor||r(202,l.name,l.getType(),e.constructor.name,n),t.__key===e.__key&&r(203,e.constructor.name,n,l.name,l.getType()),t}return e}function la(e,t){!n8(e.getParent())||n4(t)||n5(t)||r(99)}function lu(e){return(n5(e)||n4(e)&&!e.canBeEmpty())&&!e.isInline()}function ld(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let r=e.parentElement;null!==r&&r.removeChild(e)}function lc(e){return l?(e||window).getSelection():null}function lf(e){return lh(e)&&"A"===e.tagName}function lh(e){return lg(e)&&1===e.nodeType}function lg(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function lp(e){return lg(e)&&11===e.nodeType}function lm(e){let t=RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function l_(e){let t=RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function ly(e){if(n5(e)&&!e.isInline())return!0;if(!n4(e)||li(e))return!1;let t=e.getFirstChild(),n=null===t||tW(t)||t3(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function lC(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function lS(){return nW()}let lx=new WeakMap,lv=new Map;function lb(e){if(!e._readOnly&&e.isEmpty())return lv;e._readOnly||r(192);let t=lx.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,l=t.get(e);l||(l=new Map,t.set(e,l)),l.set(n,r)}return t}(e),lx.set(e,t)),t}function lw(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}
15function lT(e,t){let n=(parseInt(e.style.paddingInlineStart,10)||0)/40;t.setIndent(n)}function lk(e){e.__lexicalUnmanaged=!0}let lN={next:"previous",previous:"next"};class lE{constructor(e){this.origin=e}[Symbol.iterator](){return lG({hasNext:lI,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return lJ(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return lJ(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 l=n===this.direction?t:Array.from(t).reverse(),i=this,o=this.getParentAtCaret(),a=new Map;for(let t=i.getAdjacentCaret();null!==t&&a.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();a.set(e.getKey(),e)}for(let e of l){if(a.size>0){let t=i.getNodeAtCaret();if(t)if(a.delete(t.getKey()),a.delete(e.getKey()),t.is(e)||i.origin.is(e));else{let n=e.getParent();n&&n.is(o)&&e.remove(),t.replace(e)}else null===t&&r(263,Array.from(a).join(" "))}else i.insert(e);i=lJ(e,this.direction)}for(let e of a.values())e.remove();return this}}class lF extends lE{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:l$(e,this.direction)}getParentCaret(e="root"){return lJ(lA(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=lN[this.direction];return lJ(this.getNodeAtCaret(),e)||l$(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof lF&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}let lP={root:n8,shadowRoot:li};function lA(e,t="root"){return lP[t](e)?null:e}class lO extends lE{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lJ(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return n4(this.origin)?l$(this.origin,this.direction):null}getParentCaret(e="root"){return lJ(lA(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=lN[this.direction];return lJ(this.getNodeAtCaret(),e)||l$(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof lO&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof lO||e instanceof lL)&&this.direction===e.direction&&this.origin.is(e.origin)}}class lL extends lE{type="text";constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lW(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return lJ(lA(this.getParentAtCaret(),e),this.direction)}getFlipped(){return lW(this.origin,lN[this.direction],this.offset)}isSamePointCaret(e){return e instanceof lL&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof lO||e instanceof lL)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return lJ(this.origin,this.direction)}}function lM(e){return e instanceof lL}function lI(e){return e instanceof lO}function lD(e){return e instanceof lF}let lR={next:class extends lL{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends lL{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},lB={next:class extends lO{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends lO{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},lK={next:class extends lF{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends lF{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function lJ(e,t){return e?new lB[t](e):null}function lW(e,t,n){return e?new lR[t](e,lz(e,n)):null}function lz(e,t){let n=e.getTextContentSize(),l="next"===t?n:"previous"===t?0:t;return l>
15=0&&l<=n||r(274,String(t),String(n)),l}function l$(e,t){return n4(e)?new lK[t](e):null}function lj(e){var t;return e&&((t=e.getAdjacentCaret())&&t.getChildCaret()||t)}class lq{type="node-caret-range";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 lq(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return lM(t)?function(e,t){let{direction:n,origin:r}=e;return new lU(e,lz(r,"focus"===t?lN[n]:n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[new lU(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){let t=lM(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=lM(n),l=t=>t.isSameNodeCaret(n)?null:lj(t)||t.getParentCaret(e);return lG({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:l(t),map:e=>e,step:l})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class lU{type="slice";constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),l=e.getTextContent();return lW(e.setTextContent(l.slice(0,n)+l.slice(r)),t,n)}}function lH(e){return lV(e,lJ(rR(),e.direction))}function lZ(e){return lV(e,e)}function lV(e,t){return e.direction!==t.direction&&r(265),new lq(e,t,e.direction)}function lG(e){let{initial:t,hasNext:n,step:r,map:l}=e,i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};let e={done:!1,value:l(i)};return i=r(i),e}}}function lY(e,t){let n=l0(e.origin,t.origin);switch(null===n&&r(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let n="text"===e.type,r="text"===t.type;return n&&r?Math.sign(e.offset-t.offset):e.type===t.type?0:n?-1:r?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 lX(n)}}function lX(e){let{a:t,b:n}=e,r=t.__key,l=n.__key,i=t,o=n;for(;i&&o;i=i.getNextSibling(),o=o.getNextSibling()){if(i.__key===l)return -1;if(o.__key===r)return 1}return null===i?1:-1}function lQ(e){return n4(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function l0(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[t,r]=lQ(e);t;r=t,t=t.getParent())n.set(t,r);for(let[l,i]=lQ(t);l;i=l,l=l.getParent()){let o=n.get(l);if(void 0!==o)return null===o?(l.is(e)||r(276),{commonAncestor:l,type:"ancestor"}):null===i?(l.is(t)||r(277),{commonAncestor:l,type:"descendant"}):((n4(o)||o.is(e))&&(n4(i)||i.is(t))&&l.is(o.getParent())&&l.is(i.getParent())||r(278),{a:o,b:i,commonAncestor:l,type:"branch"})}return null}function l1(e,t){let{type:n,key:l,offset:i}=e,o=function(e){let t=rA(e);return null===t&&r(63,e),t}(e.key);return"text"===n?(t3(o)||r(266,o.getType(),l),lW(o,t,i)):(n4(o)||r(267,o.getType(),l),function(e,t,n){let r=l$(e,"next");for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(null===e)break;r=e}return it(r,n)}(o,e.offset,t))}function l2(e,t){let{origin:n,direction:l}=t,i="next"===l;lM(t)?e.set(n.getKey(),t.offset,"text"):lI(t)?t3(n)?e.set(n.getKey(),lz(n,l),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,"element"):(lD(t)&&n4(n)||r(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function l4(e){let t=nx(),n=nr(t)?t:n_();return l3(n,e),rK(n),n}function l3(e,t){l2(e.anchor,t.anchor),l2(e.focus,t.focus)}function l7(e){let{anchor:t,focus:n}=e,r=l1(t,"next"),l=l1(n,"next"),i=0>=lY(r,l)?"next":"previous";return lV(it(r,i),it(l,i))}function l5(e){let{direction:t,origin:n}=e,r=lJ(n,lN[t]).getNodeAtCaret();return r?lJ(r,t):l$(n.getParentOrThrow(),t)}function l9(e,t="root"){let n=[e];for(let r=lD(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;
15r=r.getParentCaret(t))n.push(l5(r));return n}function l8(e){return!!e&&e.origin.isAttached()}function l6(e){let t=function(e){let t=e;for(;lD(t);){let e=lj(t);if(!lD(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(t3(t.origin))return lM(t)?t:lW(t.origin,n,n);let r=t.getAdjacentCaret();return lI(r)&&t3(r.origin)?lW(r.origin,n,lN[n]):t}function ie(e){return lM(e)&&e.offset!==lz(e.origin,e.direction)}function it(e,t){return e.direction===t?e:e.getFlipped()}function ir(e,t){return e.direction===t?e:lV(it(e.focus,t),it(e.anchor,t))}function il(e){let{origin:t,offset:n,direction:l}=e;if(n===lz(t,l))return e.getSiblingCaret();if(n===lz(t,lN[l]))return l5(e.getSiblingCaret());let[i]=t.splitText(n);return t3(i)||r(281),it(lJ(i,"next"),l)}function ii(e,t){return!0}function io(e,{$copyElementNode:t=lo,$splitTextPointCaretNext:n=il,rootMode:r="shadowRoot",$shouldSplit:l=ii}={}){if(lM(e))return n(e);let i=e.getParentCaret(r);if(i){let{origin:n}=i;if(lD(e)&&(!n.canBeEmpty()||!l(n,"first")))return l5(i);let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||n.canBeEmpty()&&l(n,"last"))&&i.insert(t(n).splice(0,0,r))}return i}},33811:(e,t,n)=>{n.d(t,{m:()=>a});var r=n(94271),l=n(92749),i=n(32532),o=n(12115);function a({maxIndent:e}){let[t]=(0,r.DF)();return(0,o.useEffect)(()=>(0,l.Sd)(t.registerCommand(i.OXk,e=>{let n=(0,i.vJq)();if(!(0,i.I2P)(n))return!1;e.preventDefault();let r=!function(e){let t=e.getNodes();if((0,l.zD)(t,e=>(0,i.y68)(e)&&e.canIndent()?e:null).length>0)return!0;let n=e.anchor,r=e.focus,o=r.isBefore(n)?r:n,a=o.getNode(),u=(0,l.mB)(a);if(u.canIndent()){let e=u.getKey(),t=(0,i.uTE)();if(t.anchor.set(e,0,"element"),t.focus.set(e,0,"element"),(t=(0,i.CaD)(t)).anchor.is(o))return!0}return!1}(n)?i.YW5:e.shiftKey?i.sik:i.PiT;return t.dispatchCommand(r,void 0)},i.jZM),t.registerCommand(i.PiT,()=>{if(null==e)return!1;let t=(0,i.vJq)();return!!(0,i.I2P)(t)&&Math.max(...t.getNodes().map(e=>(0,l.mB)(e).getIndent()))+1>=e},i.da8)),[t,e]),null}},33964:(e,t,n)=>{n.d(t,{n:()=>c});var r=n(94271),l=n(32532),i=n(12115),o=n(95155);let a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=a?i.useLayoutEffect:i.useEffect,d={tag:"history-merge"};function c({initialConfig:e,children:t}){let n=(0,i.useMemo)(()=>{let{theme:t,namespace:n,nodes:i,onError:o,editorState:u,html:c}=e,f=(0,r.Mx)(null,t),h=(0,l.ieJ)({editable:e.editable,html:c,namespace:n,nodes:i,onError:e=>o(e,h),theme:t});return function(e,t){if(null!==t){if(void 0===t)e.update(()=>{let t=(0,l.NiT)();if(t.isEmpty()){let n=(0,l.lJ7)();t.append(n);let r=a?document.activeElement:null;(null!==(0,l.vJq)()||null!==r&&r===e.getRootElement())&&n.select()}},d);else if(null!==t)switch(typeof t){case"string":{let n=e.parseEditorState(t);e.setEditorState(n,d);break}case"object":e.setEditorState(t,d);break;case"function":e.update(()=>{(0,l.NiT)().isEmpty()&&t(e)},d)}}}(h,u),[h,f]},[]);return u(()=>{let t=e.editable,[r]=n;r.setEditable(void 0===t||t)},[]),(0,o.jsx)(r.Gu.Provider,{value:n,children:t})}},36277:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(70893),l=n(94271),i=n(92749),o=n(32532),a=n(12115);function u(){let[e]=(0,l.DF)();return(0,a.useEffect)(()=>(0,i.Sd)(e.registerCommand(r.mJ,()=>((0,r.us)(e,"check"),!0),o.AcJ),e.registerCommand(o.bbF,t=>g(t,e,!1),o.AcJ),e.registerCommand(o.UDz,t=>g(t,e,!0),o.AcJ),e.registerCommand(o.Q$N,t=>{if(null!=h()){let t=e.getRootElement();return null!=t&&t.focus(),!0}return!1},o.AcJ),e.registerCommand(o.Huu,t=>{let n=h();return!(null==n||!e.isEditable())&&(e.update(()=>{let e=(0,o.xL4)(n);(0,r.Mz)(e)&&(t.preventDefault(),e.toggleChecked())}),!0)},o.AcJ),e.registerCommand(o.AX0,t=>e.getEditorState().read(()=>{let n=(0,o.vJq)();if((0,o.I2P)(n)&&n.isCollapsed()){let{anchor:l}=n,a="element"===l.type;if(a||0===l.offset){let n=l.getNode(),u=(0,i.Bt)(n,e=>(0,o.ff4)(e)&&!e.isInline());if((0,r.Mz)(u)){let l=u.getParent();if((0,r.HY)(l)&&"check"===l.getListType()&&(a||u.getFirstDescendant()===n)){let n=e.getElementByKey(u.__key);if(null!=n&&document.activeElement!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}),o.AcJ),e.registerRootListener((e,t)=>
15{null!==e&&(e.addEventListener("click",c),e.addEventListener("pointerdown",f)),null!==t&&(t.removeEventListener("click",c),t.removeEventListener("pointerdown",f))}))),null}function d(e,t){let n=e.target;if(!(0,i.sb)(n))return;let r=n.firstChild;if((0,i.sb)(r)&&("UL"===r.tagName||"OL"===r.tagName))return;let l=n.parentNode;if(!l||"check"!==l.__lexicalListType)return;let o=n.getBoundingClientRect(),a=e.pageX/(0,i.OV)(n);("rtl"===n.dir?a<o.right&&a>o.right-20:a>o.left&&a<o.left+20)&&t()}function c(e){d(e,()=>{if((0,i.sb)(e.target)){let t=e.target,n=(0,o.scG)(t);null!=n&&n.isEditable()&&n.update(()=>{let e=(0,o.xL4)(t);(0,r.Mz)(e)&&(t.focus(),e.toggleChecked())})}})}function f(e){d(e,()=>{e.preventDefault()})}function h(){let e=document.activeElement;return(0,i.sb)(e)&&"LI"===e.tagName&&null!=e.parentNode&&"check"===e.parentNode.__lexicalListType?e:null}function g(e,t,n){let l=h();return null!=l&&t.update(()=>{let i=(0,o.xL4)(l);if(!(0,r.Mz)(i))return;let a=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),l=e;for(;null==n&&(0,r.Mz)(l);)null!=(l=l.getParentOrThrow().getParent())&&(n=t?l.getPreviousSibling():l.getNextSibling());for(;(0,r.Mz)(n);){let e=t?n.getLastChild():n.getFirstChild();if(!(0,r.HY)(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(i,n);if(null!=a){a.selectStart();let n=t.getElementByKey(a.__key);null!=n&&(e.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}},40983:(e,t,n)=>{n.d(t,{Bi:()=>u,lW:()=>f,xg:()=>p});var r=n(69717),l=n(61731),i=n(92749),o=n(32532);function a(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.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 u(e,t,n){let i=e.getData("application/x-lexical-editor");if(i)try{let e=JSON.parse(i);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return d(n,function(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=(0,o.GMe)(r);(0,o.kFe)(i)&&(0,l.Xg)(i),t.push(i)}return t}(e.nodes),t)}catch(e){}let a=e.getData("text/html"),u=e.getData("text/plain");if(a&&u!==a)try{let e=(new DOMParser).parseFromString(window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(a):a,"text/html");return d(n,(0,r.d)(n,e),t)}catch(e){}let c=u||e.getData("text/uri-list");if(null!=c)if((0,o.I2P)(t)){let e=c.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){let n=(0,o.vJq)();if((0,o.I2P)(n)){let r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"	"===r?n.insertNodes([(0,o.ev7)()]):n.insertText(r)}}}else t.insertRawText(c)}function d(e,t,n){e.dispatchCommand(o.oqR,{nodes:t,selection:n})||n.insertNodes(t)}let c=null;async function f(e,t,n){if(null!==c)return!1;if(null!==t)return new Promise((r,l)=>{e.update(()=>{r(h(e,t,n))})});let r=e.getRootElement(),l=e._window||window,a=window.document,u=(0,o.peL)(l);if(null===r||null===u)return!1;let d=a.createElement("span");d.style.cssText="position: fixed; top: -1000px;",d.append(a.createTextNode("#")),r.append(d);let f=new Range;return f.setStart(d,0),f.setEnd(d,1),u.removeAllRanges(),u.addRange(f),new Promise((t,r)=>{let l=e.registerCommand(o.u5G,r=>((0,i.xj)(r,ClipboardEvent)&&(l(),null!==c&&(window.clearTimeout(c),c=null),t(h(e,r,n))),!0),o.da8);c=window.setTimeout(()=>{l(),c=null,t(!1)},50),a.execCommand("copy"),d.remove()})}function h(e,t,n){if(void 0===n){let t=(0,o.peL)(e._window);if(!t)return!1;let r=t.anchorNode,l=t.focusNode;if(null!==r&&null!==l&&!(0,o.LYZ)(e,r,l))return!1;let i=(0,o.vJq)();if(null===i)return!1;n=p(i)}t.preventDefault();let r=t.clipboardData;return null!==r&&(function(e,t){for(let n in t){let r=t[n];void 0!==r&&e.setData(n,r)}}(r,n),!0)}let g=[["text/html",function(e,t=(0,o.vJq)()){return null==t&&a(166),(0,o.I2P)(t)&&t.isCollapsed()||0===t.getNodes().length?"":(0,r.g)(e,t)}],["application/x-lexical-editor",function(e,t=(0,o.vJq)()){return null==t&&a(166),(0,o.I2P)(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){let n=[],r=(0,o.NiT)().getChildren();for(let i=0;i<r.length;i++)!function e(t,n,r,i=[]){let u=null===n||r.isSelected(n),d=(0,o.ff4)(r)&&r.excludeFromCopy("html"),c=r;if(null!==n){let e=(0,o.BEs)(r);c=e=(0,o.kFe)(e)&&null!==n?(0,l.SD)(n,e):e}let f=(0,o.ff4)(c)?c.getChildren():[],h=function(e){let t=e.exportJSON(),n=e.constructor;return t.type!==n.getType()&&a(58,n.name),(0,o.ff4)(e)&&(Array.isArray(t.children)||a(59,n.name)),t}(c);if((0,o.kFe)(c)){let e=c.__text;e.length>0?h.text=e:u=!1}for(let l=0;l<f.length;l++){let i=f[l],a=e(t,n,i,h.children);!u&&(0,o.ff4)(r)&&a&&r.extractWithChild(i,n,"clone")&&(u=!0)}if(u&&!d)i.push(h);else if(Array.isArray(h.children))for(let e=0;e<h.children.length;e++){let t=h.children[e];i.push(t)}return u}(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function p(e=(0,o.vJq)()){let t={"text/plain":e?e.getTextContent():""};if(e){let n=(0,o.i0_)();for(let[r,l]of g){let i=l(n,e);null!==i&&(t[r]=i)}}return t}},41747:(e,t,n)=>{n.d(t,{B9:()=>u,Ej:()=>eB,GA:()=>I,HA:()=>eE,Ln:()=>$,Ng:()=>g,O8:()=>P,RN:()=>C,TX:()=>eA,Xx:()=>h,Ze:()=>N,be:()=>B,cl:()=>q,cn:()=>er,ex:()=>O,hi:()=>eN,hx:()=>y,kC:()=>F,kN:()=>A,np:()=>f,nq:()=>eR,o5:()=>a,pA:()=>k,pK:()=>eP,py:()=>m,sJ:()=>T,tV:()=>R,xT:()=>eK,xp:()=>en,zC:()=>G,zp:()=>b});var r=n(92749),l=n(32532),i=n(40983);let o=/^(\d+(?:\.\d+)?)px$/,a={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class u extends l.fGB{static getType(){return"tablecell"}static clone(e){return new u(e.__headerState,e.__colSpan,e.__width,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign}static importDOM(){return{td:e=>({conversion:c,priority:0}),th:e=>({conversion:c,priority:0})}}static importJSON(e){return f().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan||1).setRowSpan(e.rowSpan||1).setWidth(e.width||void 0).setBackgroun
15dColor(e.backgroundColor||null).setVerticalAlign(e.verticalAlign||void 0)}constructor(e=a.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=document.createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),null!==this.__backgroundColor&&(t.style.backgroundColor=this.__backgroundColor),d(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),(0,r.ZB)(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if((0,l.sby)(t.element)){let e=t.element;e.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||"top",e.style.textAlign="start",null===this.__backgroundColor&&this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...d(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=a.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==a.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(e){return"middle"===e||"bottom"===e}function c(e){let t,n=e.nodeName.toLowerCase();o.test(e.style.width)&&(t=parseFloat(e.style.width));let r=f("th"===n?a.ROW:a.NO_STATUS,e.colSpan,t);r.__rowSpan=e.rowSpan;let i=e.style.backgroundColor;""!==i&&(r.__backgroundColor=i);let u=e.style.verticalAlign;d(u)&&(r.__verticalAlign=u);let c=e.style,h=(c&&c.textDecoration||"").split(" "),g="700"===c.fontWeight||"bold"===c.fontWeight,p=h.includes("line-through"),m="italic"===c.fontStyle,_=h.includes("underline");return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();(0,l.wH$)(e)&&1===n.getChildrenSize()&&e.remove()}};for(let i of e)(0,l.Gew)(i)||(0,l.kFe)(i)||(0,l.wH$)(i)?((0,l.kFe)(i)&&(g&&i.toggleFormat("bold"),p&&i.toggleFormat("strikethrough"),m&&i.toggleFormat("italic"),_&&i.toggleFormat("underline")),n?n.append(i):(n=(0,l.lJ7)().append(i),t.push(n))):(t.push(i),r(),n=null);return r(),0===t.length&&t.push((0,l.lJ7)()),t},node:r}}function f(e=a.NO_STATUS,t=1,n){return(0,l.pTq)(new u(e,t,n))}function h(e){return e instanceof u}let g=(0,l.guI)("INSERT_TABLE_COMMAND");function p(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.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.`)}class m extends l.fGB{static getType(){return"tablerow"}static clone(e){return new m(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:_,priority:0})}}static importJSON(e){return y().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...void 0===e?void 0:{height:e}}}createDOM(e){let t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),(0,r.ZB)(t,e.theme.tableRow),t}extractWithChild(e,t,n){return"html"===n}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function _(e){let t;return o.test(e.style.height)&&(t=parseFloat(e.style.height)),{after:e=>(0,r.cE)(e,h),node:y(t)}}function y(e){return(0,l.pTq)(new m(e))}function C(e){return e instanceof m}let S="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,x=S&&"documentMode"in document?document.documentMode:null,v=S&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function b(e){let t=(0,r.Bt)(e,e=>h(e));return h(t)?t:null}function w(e){let t=(0,r.Bt)(e,e=>C(e));if(C(t))return t;throw Error("Expected table cell to be inside of table row.")}function T(e){let t=(0,r.Bt)(e,e=>eA(e));if(eA(t))return t;throw Error("Expected table cell to be inside of table.")}function k(e){let t=w(e);return T(t).getChildren().findIndex(e=>e.is(t))}function N(e){return w(e).getChildren().findIndex(t=>t.is(e))}S&&"InputEvent"in window&&!x&&new window.InputEvent("input");let E=(e,t)=>e===a.BOTH||e===t?t:a.NO_STATUS;function F(e=!0){let t=(0,l.vJq)();(0,l.I2P)(t)||$(t)||p(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=B(n),[o,,u]=B(r),[d,c,h]=D(u,o,i),g=d[
150].length,{startRow:m}=h,{startRow:_}=c,S=null;if(e){let e=Math.max(_+o.__rowSpan,m+i.__rowSpan)-1,t=d[e],n=y();for(let r=0;r<g;r++){let{cell:i,startRow:o}=t[r];if(o+i.__rowSpan-1<=e){let e=E(t[r].cell.__headerState,a.COLUMN);n.append(f(e).append((0,l.lJ7)()))}else i.setRowSpan(i.__rowSpan+1)}let r=u.getChildAtIndex(e);C(r)||p(256),r.insertAfter(n),S=n}else{let e=Math.min(_,m),t=d[e],n=y();for(let r=0;r<g;r++){let{cell:i,startRow:o}=t[r];if(o===e){let e=E(t[r].cell.__headerState,a.COLUMN);n.append(f(e).append((0,l.lJ7)()))}else i.setRowSpan(i.__rowSpan+1)}let r=u.getChildAtIndex(e);C(r)||p(257),r.insertBefore(n),S=n}return S}function P(e=!0){let t=(0,l.vJq)();(0,l.I2P)(t)||$(t)||p(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=B(n),[o,,u]=B(r),[d,c,h]=D(u,o,i),g=d.length,m=e?Math.max(c.startColumn,h.startColumn):Math.min(c.startColumn,h.startColumn),_=e?m+o.__colSpan-1:m-1,y=u.getFirstChild();C(y)||p(120);let S=null;function x(e=a.NO_STATUS){let t=f(e).append((0,l.lJ7)());return null===S&&(S=t),t}let v=y;e:for(let e=0;e<g;e++){if(0!==e){let e=v.getNextSibling();C(e)||p(121),v=e}let t=d[e],n=E(t[_<0?0:_].cell.__headerState,a.ROW);if(_<0){M(v,x(n));continue}let{cell:r,startColumn:l,startRow:i}=t[_];if(l+r.__colSpan-1<=_){let l=r,o=i,a=_;for(;o!==e&&l.__rowSpan>1;){if(!((a-=r.__colSpan)>=0)){v.append(x(n));continue e}{let{cell:e,startRow:n}=t[a];l=e,o=n}}l.insertAfter(x(n))}else r.setColSpan(r.__colSpan+1)}null!==S&&L(S);let b=u.getColWidths();if(b){let e=[...b],t=_<0?0:_,n=e[t];e.splice(t,0,n),u.setColWidths(e)}return S}function A(){let e=(0,l.vJq)();(0,l.I2P)(e)||$(e)||p(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=B(t),[o]=B(n),[a,u,d]=D(i,r,o),{startRow:c}=u,{startRow:f}=d,h=f+o.__rowSpan-1;if(a.length===h-c+1)return void i.remove();let g=a[0].length,m=r.__rowSpan,_=a[h+1],y=i.getChildAtIndex(h+1);for(let e=h;e>=c;e--){for(let t=g-1;t>=0;t--){let{cell:n,startRow:r,startColumn:l}=a[e][t];if(l===t){if(e===c&&r<c){let e=c-r;n.setRowSpan(n.__rowSpan-Math.min(m,n.__rowSpan-e))}if(r>=c&&r+n.__rowSpan-1>h){n.setRowSpan(n.__rowSpan-(h-r+1)),null===y&&p(122);let l=null;for(let n=0;n<t;n++){let t=_[n],r=t.cell;t.startRow===e+1&&(l=r),r.__colSpan>1&&(n+=r.__colSpan-1)}null===l?M(y,n):l.insertAfter(n)}}}let t=i.getChildAtIndex(e);C(t)||p(206,String(e)),t.remove()}if(void 0!==_){let{cell:e}=_[0];L(e)}else{let{cell:e}=a[c-1][0];L(e)}}function O(){let e=(0,l.vJq)();(0,l.I2P)(e)||$(e)||p(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=B(t),[o]=B(n),[a,u,d]=D(i,r,o),{startColumn:c}=u,{startRow:f,startColumn:h}=d,g=Math.min(c,h),m=Math.max(c+r.__colSpan-1,h+o.__colSpan-1),_=m-g+1;if(a[0].length===m-g+1)return i.selectPrevious(),void i.remove();let y=a.length;for(let e=0;e<y;e++)for(let t=g;t<=m;t++){let{cell:n,startColumn:r}=a[e][t];if(r<g){if(t===g){let e=g-r;n.setColSpan(n.__colSpan-Math.min(_,n.__colSpan-e))}}else if(r+n.__colSpan-1>m){if(t===m){let e=m-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}let C=a[f],S=c>h?C[c+r.__colSpan]:C[h+o.__colSpan];if(void 0!==S){let{cell:e}=S;L(e)}else{let{cell:e}=h<c?C[h-1]:C[c-1];L(e)}let x=i.getColWidths();if(x){let e=[...x];e.splice(g,_),i.setColWidths(e)}}function L(e){let t=e.getFirstDescendant();null==t?e.selectStart():t.getParentOrThrow().selectStart()}function M(e,t){let n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function I(){let e=(0,l.vJq)();(0,l.I2P)(e)||$(e)||p(188);let[t,n,r]=B(e.anchor.getNode()),i=t.__colSpan,o=t.__rowSpan;if(1===i&&1===o)return;let[u,d]=D(r,t,t),{startColumn:c,startRow:h}=d,g=t.__headerState&a.COLUMN,m=Array.from({length:i},(e,t)=>{let n=g;for(let e=0;0!==n&&e<u.length;e++)n&=u[e][t+c].cell.__headerState;return n}),_=t.__headerState&a.ROW,y=Array.from({length:o},(e,t)=>{let n=_;for(let e=0;0!==n&&e<u[0].length;e++)n&=u[t+h][e].cell.__headerState;return n});if(i>1){for(let e=1;e<i;e++)t.insertAfter(f(m[e]|y[0]).append((0,l.lJ7)()));t.setColSpan(1)}if(o>1){let e;for(let t=1;t<o;t++){let r=h+t,o=u[r];C(e=(e||n).getNextSibling())||p(125);let a=null;for(let e=0;e<c;
15e++){let t=o[e],n=t.cell;t.startRow===r&&(a=n),n.__colSpan>1&&(e+=n.__colSpan-1)}if(null===a)for(let n=i-1;n>=0;n--)M(e,f(m[n]|y[t]).append((0,l.lJ7)()));else for(let e=i-1;e>=0;e--)a.insertAfter(f(m[e]|y[t]).append((0,l.lJ7)()))}t.setRowSpan(1)}}function D(e,t,n){let[r,l,i]=R(e,t,n);return null===l&&p(207),null===i&&p(208),[r,l,i]}function R(e,t,n){let r=[],l=null,i=null;function o(e){let t=r[e];return void 0===t&&(r[e]=t=[]),t}let a=e.getChildren();for(let e=0;e<a.length;e++){let r=a[e];C(r)||p(209);let u=o(e);for(let d=r.getFirstChild(),c=0;null!=d;d=d.getNextSibling()){for(h(d)||p(147);void 0!==u[c];)c++;let r={cell:d,startColumn:c,startRow:e},{__rowSpan:f,__colSpan:g}=d;for(let t=0;t<f&&!(e+t>=a.length);t++){let n=o(e+t);for(let e=0;e<g;e++)n[c+e]=r}null!==t&&null===l&&t.is(d)&&(l=r),null!==n&&null===i&&n.is(d)&&(i=r)}}return[r,l,i]}function B(e){let t;if(e instanceof u)t=e;else if("__type"in e){let n=(0,r.Bt)(e,h);h(n)||p(148),t=n}else{let n=(0,r.Bt)(e.getNode(),h);h(n)||p(148),t=n}let n=t.getParent();C(n)||p(149);let l=n.getParent();return eA(l)||p(210),[t,n,l]}function K(e,t,n){let r,l=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),o=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let t=0;t<e.length;t++)for(let n=0;n<e[0].length;n++){let u=e[t][n];if(!u)continue;let d=u.startColumn+u.cell.__colSpan-1,c=u.startRow+u.cell.__rowSpan-1,f=u.startColumn<=o&&d>=l,h=u.startRow<=a&&c>=i;if(f&&h){let e=Math.min(l,u.startColumn),t=Math.max(o,d),n=Math.min(i,u.startRow),f=Math.max(a,c);e===l&&t===o&&n===i&&f===a||(l=e,o=t,i=n,a=f,r=!0)}}}while(r);return{maxColumn:o,maxRow:a,minColumn:l,minRow:i}}function J(e){let[t,,n]=B(e),r=n.getChildren(),l=r.length,i=r[0].getChildren().length,o=Array(l);for(let e=0;e<l;e++)o[e]=Array(i);for(let e=0;e<l;e++){let n=r[e].getChildren(),l=0;for(let r=0;r<n.length;r++){for(;o[e][l];)l++;let i=n[r],a=i.__rowSpan||1,u=i.__colSpan||1;for(let t=0;t<a;t++)for(let n=0;n<u;n++)o[e+t][l+n]=i;if(t===i)return{colSpan:u,columnIndex:l,rowIndex:e,rowSpan:a};l+=u}}return null}function W(e){let[[t,n,l,i],[o,a,u,d]]=["anchor","focus"].map(t=>{let n=e[t].getNode(),l=(0,r.Bt)(n,h);h(l)||p(238,t,n.getKey(),n.getType());let i=l.getParent();C(i)||p(239,t);let o=i.getParent();return eA(o)||p(240,t),[n,l,i,o]});return i.is(d)||p(241),{anchorCell:n,anchorNode:t,anchorRow:l,anchorTable:i,focusCell:a,focusNode:o,focusRow:u,focusTable:d}}class z{constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){return"root"!==this.tableKey&&"root"!==this.anchor.key&&"element"===this.anchor.type&&"root"!==this.focus.key&&"element"===this.focus.type}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return $(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new z(this.tableKey,(0,l.z8s)(this.anchor.key,this.anchor.offset,this.anchor.type),(0,l.z8s)(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(h).forEach(e=>{let n=e.getFirstChild();(0,l.bSg)(n)&&(t|=n.getTextFormat())});let n=l.LZn[e];return!!(t&n)}insertNodes(e){let t=this.focus.getNode();(0,l.ff4)(t)||p(151),(0,l.CaD)(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=W(this),n=J(e);null===n&&p(153);let r=J(t);null===r&&p(155);let l=Math.min(n.columnIndex,r.columnIndex),i=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),o=Math.min(n.rowIndex,r.rowIndex),a=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(l,i),fromY:Math.min(o,a),toX:Math.max(l,i),toY:Math.max(o,a)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(null!==e)return e;let{anchorTable:t,anchorCell:n,focusCell:r}=W(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){let e=i.getParent();null==e&&p(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{let e=t.getParent();null==e&&p(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}let[o,a,u]=D(t,n,r),{minColumn:d,maxColumn:c,minRow:f,maxRow:h}=K(o,a,u),g=new Map([[t.getKey(),t]]),m=null;for(let e=f;e<=h;e++)for(let t=d;t<=c;t++){let{cell:n}=o[e][t],r=n.getParent();C(r)||p(160),r!==m&&(g.set(r.getKey(),r),m=r),g.has(n.getKey())||function(e,t){let n=[[e]];for(let e=n.at(-1);void 0!==e&&n.length>0;e=n.at(-1)){let r=e.pop();void 0===r?n.pop():!1!==t(r)&&(0,l.ff4)(r)&&n.push(r.getChildren())}}(n,e=>{g.set(e.getKey(),e)})}let _=Array.from(g.values());return(0,l.GcU)()||(this._cachedNodes=_),_}getTextContent(){let e=this.getNodes().filter(e=>h(e)),t="";for(let n=0;n<e.length;n++){let r=e[n],l=r.__parent,i=(e[n+1]||{}).__parent;t+=r.getTextContent()+(i!==l?"\n":"	")}return t}}function $(e){return e instanceof z}function j(){return new z("root",(0,l.z8s)("root",0,"element"),(0,l.z8s)("root",0,"element"))}function q(e,t=(0,l.i0_)()){let n=(0,l.nsf)(e);eA(n)||p(231,e);let r=G(n,t.getElementByKey(e));return null===r&&p(232,e),{tableElement:r,tableNode:n}}class U{constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(e
15=>e()),this.listenersToRemove.clear()}$lookup(){return q(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.getEditorState().read(()=>{let t=!1;for(let n=0;n<e.length;n++){let r=e[n].target.nodeName;if("TABLE"===r||"TBODY"===r||"THEAD"===r||"TR"===r){t=!0;break}}if(!t)return;let{tableNode:n,tableElement:r}=this.$lookup();this.table=ei(n,r)},{editor:this.editor})});this.editor.getEditorState().read(()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=ei(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){let e=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:t,tableElement:n}=this.$lookup();eo(e,ei(t,n),null),null!==(0,l.vJq)()&&((0,l.n1P)(null),e.dispatchCommand(l.MvL,void 0))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();(0,r.HE)(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();(0,r.ZB)(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(null!==e){e.tableKey!==this.tableNodeKey&&p(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),eo(t,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return null!==e&&(this.nextFocus=null),e}updateDOMSelection(){if(null!==this.anchorCell&&null!==this.focusCell){let e=(0,l.peL)(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,o=e.y;if(this.focusCell=e,this.isHighlightingCells||this.anchorX===i&&this.anchorY===o&&!t){if(i===this.focusX&&o===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=o,this.isHighlightingCells){let t=eb(r,e.elem);if(null!=this.tableSelection&&null!=this.anchorCellNodeKey&&null!==t)return this.focusCellNodeKey=t.getKey(),this.tableSelection=function(e,t,n){e.getKey(),t.getKey(),n.getKey();let r=(0,l.vJq)(),i=$(r)?r.clone():j();return i.set(e.getKey(),t.getKey(),n.getKey()),i}(r,this.$getAnchorTableCellOrThrow(),t),(0,l.n1P)(this.tableSelection),n.dispatchCommand(l.MvL,void 0),eo(n,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?(0,l.nsf)(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return null===e&&p(234),e}$getFocusTableCell(){return this.focusCellNodeKey?(0,l.nsf)(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return null===e&&p(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y;let{tableNode:t}=this.$lookup(),n=eb(t,e.elem);if(null!==n){let e=n.getKey();this.tableSelection=null!=this.tableSelection?this.tableSelection.clone():j(),this.anchorCellNodeKey=e}}$formatCells(e){let t=(0,l.vJq)();$(t)||p(236);let n=(0,l.uTE)(),r=n.anchor,i=n.focus,o=t.getNodes().filter(h);o.length>0||p(237);let a=o[0].getFirstChild(),u=(0,l.bSg)(a)?a.getFormatFlags(e,null):null;o.forEach(t=>{r.set(t.getKey(),0,"element"),i.set(t.getKey(),t.getChildrenSize(),"element"),n.formatText(e,u)}),(0,l.n1P)(t),this.editor.dispatchCommand(l.MvL,void 0)}$clearText(){let{editor:e}=this,t=(0,l.nsf)(this.tableNodeKey);if(!eA(t))throw Error("Expected TableNode.");let n=(0,l.vJq)();$(n)||p(253);let r=n.getNodes().filter(h);if(r.length===this.table.columns*this.table.rows){t.selectPrevious();let n=t.getParent();return t.remove(),void((0,l.hVZ)(n)&&n.isEmpty()&&e.dispatchCommand(l.XKQ,void 0))}
15r.forEach(e=>{if((0,l.ff4)(e)){let t=(0,l.lJ7)(),n=(0,l.sTu)();t.append(n),e.append(t),e.getChildren().forEach(e=>{e!==t&&e.remove()})}}),eo(e,this.table,null),(0,l.n1P)(null),e.dispatchCommand(l.MvL,void 0)}}let H="__lexicalTableSelection",Z=e=>!(1&~e.buttons);function V(e){return(0,l.sby)(e)&&"TABLE"===e.nodeName}function G(e,t){if(!t)return t;let n=V(t)?t:e.getDOMSlot(t).element;return"TABLE"!==n.nodeName&&p(245,t.nodeName),n}function Y(e){return e._window}function X(e,t){for(let n=t,r=null;null!==n;n=n.getParent()){if(e.is(n))return r;h(n)&&(r=n)}return null}let Q=[[l.bbF,"down"],[l.UDz,"up"],[l.AX0,"backward"],[l.JM3,"forward"]],ee=[l.hi0,l.viC,l.WuB],et=[l.gCZ,l.w$Z];function en(e){return e[H]||null}function er(e){let t=e;for(;null!=t;){let e=t.nodeName;if("TD"===e||"TH"===e){let e=t._cell;return void 0===e?null:e}t=t.parentNode}return null}function el(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;null!=r;r=r.parentNode){if(r===e)return n;let t=r.nodeName;"TD"!==t&&"TH"!==t||(n=r._cell||null)}return null}function ei(e,t){let n=[],r={columns:0,domRows:n,rows:0},l=G(e,t).querySelector("tr"),i=0,o=0;for(n.length=0;null!=l;){let e=l.nodeName;if("TD"===e||"TH"===e){let e={elem:l,hasBackgroundColor:""!==l.style.backgroundColor,highlighted:!1,x:i,y:o};l._cell=e;let t=n[o];void 0===t&&(t=n[o]=[]),t[i]=e}else{let e=l.firstChild;if(null!=e){l=e;continue}}let t=l.nextSibling;if(null!=t){i++,l=t;continue}let r=l.parentNode;if(null!=r){let e=r.nextSibling;if(null==e)break;o++,i=0,l=e}}return r.columns=i+1,r.rows=o+1,r}function eo(e,t,n){let r=new Set(n?n.getNodes():[]);es(t,(t,n)=>{let l=t.elem;r.has(n)?(t.highlighted=!0,ep(e,t)):(t.highlighted=!1,em(e,t),l.getAttribute("style")||l.removeAttribute("style"))})}function es(e,t){let{domRows:n}=e;for(let e=0;e<n.length;e++){let r=n[e];if(r)for(let n=0;n<r.length;n++){let i=r[n];if(!i)continue;let o=(0,l.xL4)(i.elem);null!==o&&t(i,o,{x:n,y:e})}}}function ea(e,t){t.$disableHighlightStyle(),es(t.table,t=>{t.highlighted=!0,ep(e,t)})}let eu=(e,t,n,r,l)=>{let i="forward"===l;switch(l){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?eg(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?eg(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return 0!==r?eg(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?eg(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function ed(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function ec([e,t]){return["minColumn"===e?"maxColumn":"minColumn","minRow"===t?"maxRow":"minRow"]}function ef(e,t,[n,r]){let l=t[r],i=e[l];void 0===i&&p(250,r,String(l));let o=t[n],a=i[o];return void 0===a&&p(250,n,String(o)),a}function eh(e,t){if((0,l.I2P)(e)||$(e)){let n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function eg(e,t){t?e.selectStart():e.selectEnd()}function ep(e,t){let n=t.elem,i=e._config.theme;h((0,l.xL4)(n))||p(131),(0,r.ZB)(n,i.tableCellSelected)}function em(e,t){let n=t.elem;h((0,l.xL4)(n))||p(131);let i=e._config.theme;(0,r.HE)(n,i.tableCellSelected)}function e_(e){let t=(0,r.Bt)(e,h);return h(t)?t:null}function ey(e){let t=(0,r.Bt)(e,eA);return eA(t)?t:null}function eC(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function eS(e,t,n){let r=(0,l.lJ7)();"first"===e?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function ex(e,t,n){let i=n.getParent();if(!i)return;let o=(0,l.peL)(Y(e));if(!o)return;let a=o.anchorNode,u=e.getElementByKey(i.getKey()),d=G(n,e.getElementByKey(n.getKey()));if(!a||!u||!d||!u.contains(a)||d.contains(a))return;let c=(0,r.Bt)(t.anchor.getNode(),e=>h(e));if(!c)return;let f=(0,r.Bt)(c,e=>eA(e));if(!eA(f)||!f.is(n))return;let[g,p]=D(n,c,c),m=g[0][0],_=g[g.length-1][g[0].length-1],{startRow:y,startColumn:C}=p,S=y===m.startRow&&C===m.startColumn,x=y===_.startRow&&C===_.startColumn;return S?"first":x?"last":void 0}function ev(e,t){let{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function eb(e,t,n){return X(e,(0,l.xL4)(t,n))}
15function ew(e,t,n){if(!t.theme.tableAlignment)return;let l=[],i=[];for(let e of["center","right"]){let r=t.theme.tableAlignment[e];r&&(e===n?i:l).push(r)}(0,r.HE)(e,...l),(0,r.ZB)(e,...i)}let eT=new WeakSet;function ek(e=(0,l.i0_)()){return eT.has(e)}function eN(e,t){t?eT.add(e):eT.delete(e)}class eE extends l.fGB{static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}static clone(e){return new eE(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}static importDOM(){return{table:e=>({conversion:eF,priority:1})}}static importJSON(e){return eP().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}constructor(e){super(e),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,n){return"html"===n}getDOMSlot(e){let t=V(e)?e:e.querySelector("table");return V(t)||p(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"))}createDOM(e,t){let n=document.createElement("table");this.__style&&(n.style.cssText=this.__style);let i=document.createElement("colgroup");if(n.appendChild(i),(0,l.pd8)(i),(0,r.ZB)(n,e.theme.table),this.updateTableElement(null,n,e),ek(t)){let t=document.createElement("div"),l=e.theme.tableScrollableWrapper;return l?(0,r.ZB)(t,l):t.style.cssText="overflow-x: auto;",t.appendChild(n),t}return n}updateTableElement(e,t,n){this.__style!==(e?e.__style:"")&&(t.style.cssText=this.__style),this.__rowStriping!==(!!e&&e.__rowStriping)&&(this.__rowStriping?((0,r.ZB)(t,n.theme.tableRowStriping),t.setAttribute("data-lexical-row-striping","true")):((0,r.HE)(t,n.theme.tableRowStriping),t.removeAttribute("data-lexical-row-striping"))),this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&(this.__frozenColumnCount>0?((0,r.ZB)(t,n.theme.tableFrozenColumn),t.setAttribute("data-lexical-frozen-column","true")):((0,r.HE)(t,n.theme.tableFrozenColumn),t.removeAttribute("data-lexical-frozen-column"))),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&(this.__frozenRowCount>0?((0,r.ZB)(t,n.theme.tableFrozenRow),t.setAttribute("data-lexical-frozen-row","true")):((0,r.HE)(t,n.theme.tableFrozenRow),t.removeAttribute("data-lexical-frozen-row"))),function(e,t,n,r){let l=e.querySelector("colgroup");if(!l)return;let i=[];for(let e=0;e<n;e++){let t=document.createElement("col"),n=r&&r[e];n&&(t.style.width=`${n}px`),i.push(t)}l.replaceChildren(...i)}(t,0,this.getColumnCount(),this.getColWidths()),ew(t,n,this.getFormatType())}updateDOM(e,t,n){return this.updateTableElement(e,this.getDOMSlot(t).element,n),!1}exportDOM(e){let t=super.exportDOM(e),{element:n}=t;return{after:n=>{if(t.after&&(n=t.after(n)),!V(n)&&(0,r.sb)(n)&&(n=n.querySelector("table")),!V(n))return null;ew(n,e._config,this.getFormatType());let[l]=R(this,null,null),i=new Map;for(let e of l)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let o=new Set;for(let e of n.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let t=e.getAttribute("data-temporary-table-cell-lexical-key");if(t){let n=i.get(t);if(e.removeAttribute("data-temporary-table-cell-lexical-key"),n){i.delete(t);for(let e=0;e<n.colSpan;e++)o.add(e+n.startColumn)}}}let a=n.querySelector(":scope > colgroup");if(a){let e=Array.from(n.querySelectorAll(":scope > colgroup > col")).filter((e,t)=>o.has(t));a.replaceChildren(...e)}let u=n.querySelectorAll(":scope > tr");if(u.length>0){let e=document.createElement("tbody");for(let t of u)e.appendChild(t);n.append(e)}return n},element:!V(n)&&(0,r.sb)(n)?n.querySelector("table"):n}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t<n;t++){let n=r[t];if(null!=n)for(let r=0;r<n.length;r++){let l=n[r];if(null==l)continue;let{elem:i}=l,o=eb(this,i);if(null!==o&&e.is(o))return{x:r,y:t}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,t,n){let{domRows:r}=n,l=r[t];if(null==l)return null;let i=l[e<l.length?e:l.length-1];return null==i?null:i}getDOMCellFromCordsOrThrow(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(!r)throw Error("Cell not found at cords.");return r}getCellNodeFromCords(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(null==r)return null;let i=(0,l.xL4)(r.elem);return h(i)?i:null}getCellNodeFromCordsOrThrow(e,t,n){let r=this.getCellNodeFromCords(e,t,n);if(!r)throw Error("Node at cords not TableCellNode.");return r}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!e)return 0;let t=0;
15return e.getChildren().forEach(e=>{h(e)&&(t+=e.getColSpan())}),t}}function eF(e){let t=eP();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0);let n=e.querySelector(":scope > colgroup");if(n){let e=[];for(let t of n.querySelectorAll(":scope > col")){let n=t.style.width||"";if(!o.test(n)&&(n=t.getAttribute("width")||"",!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return{after:e=>(0,r.cE)(e,C),node:t}}function eP(){return(0,l.pTq)(new eE)}function eA(e){return e instanceof eE}function eO({rows:e,columns:t,includeHeaders:n}){let i=(0,l.vJq)();if(!i||!(0,l.I2P)(i)||ey(i.anchor.getNode()))return!1;let o=function(e,t,n=!0){let r=eP();for(let i=0;i<e;i++){let e=y();for(let r=0;r<t;r++){let t=a.NO_STATUS;"object"==typeof n?(0===i&&n.rows&&(t|=a.ROW),0===r&&n.columns&&(t|=a.COLUMN)):n&&(0===i&&(t|=a.ROW),0===r&&(t|=a.COLUMN));let o=f(t),u=(0,l.lJ7)();u.append((0,l.sTu)()),o.append(u),e.append(o)}r.append(e)}return r}(Number(e),Number(t),n);(0,r.Pe)(o);let u=o.getFirstDescendant();return(0,l.kFe)(u)&&u.select(),!0}function eL(e){C(e.getParent())?e.isEmpty()&&e.append((0,l.lJ7)()):e.remove()}function eM(e){eA(e.getParent())?(0,r.vF)(e,h):e.remove()}function eI(e){(0,r.vF)(e,C);let[t]=R(e,null,null),n=t.reduce((e,t)=>Math.max(e,t.length),0),i=e.getChildren();for(let e=0;e<t.length;++e){let r=i[e];if(!r)continue;C(r)||p(254,r.constructor.name,r.getType());let o=t[e].reduce((e,t)=>t?1+e:e,0);if(o!==n)for(let e=o;e<n;++e){let e=f();e.append((0,l.lJ7)()),r.append(e)}}}function eD(e){if(e.detail<3||!(0,l.vAA)(e.target))return!1;let t=(0,l.xL4)(e.target);if(null===t)return!1;let n=(0,r.Bt)(t,e=>(0,l.ff4)(e)&&!e.isInline());return null!==n&&!!h(n.getParent())&&(n.select(0),!0)}function eR(e){return e.registerNodeTransform(u,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=B(e),[n]=D(t,e,e),l=n.length,i=n[0].length,o=t.getFirstChild();C(o)||p(175);let a=[];for(let e=0;e<l;e++){0!==e&&(C(o=o.getNextSibling())||p(175));let t=null;for(let l=0;l<i;l++){let i=n[e][l],u=i.cell;if(i.startRow===e&&i.startColumn===l)t=u,a.push(u);else if(u.getColSpan()>1||u.getRowSpan()>1){h(u)||p(176);let e=f(u.__headerState);null!==t?t.insertAfter(e):(0,r.K2)(o,e)}}}for(let e of a)e.setColSpan(1),e.setRowSpan(1)}})}function eB(e,t=!0){let n=new Map,o=(o,a,u)=>{let d=G(o,u),c=function(e,t,n,o){let a=n.getRootElement(),u=Y(n);null!==a&&null!==u||p(246);let d=new U(n,e.getKey()),c=G(e,t);null!==en(c)&&p(205),c[H]=d,d.listenersToRemove.add(()=>{en(c)===d&&delete c[H]});let f=t=>{if(d.pointerType=t.pointerType,0!==t.button||!(0,l.vAA)(t.target)||!u)return;let r=er(t.target);null!==r&&n.update(()=>{let n=(0,l.S1w)();if(v&&t.shiftKey&&eh(n,e)&&((0,l.I2P)(n)||$(n))){let l=n.anchor.getNode(),i=X(e,n.anchor.getNode());i?(d.$setAnchorCellForSelection(ev(d,i)),d.$setFocusCellForSelection(r),eC(t)):(e.isBefore(l)?e.selectStart():e.selectEnd()).anchor.set(n.anchor.key,n.anchor.offset,n.anchor.type)}else d.$setAnchorCellForSelection(r)}),(()=>{if(d.isSelecting)return;let e=()=>{d.isSelecting=!1,u.removeEventListener("pointerup",e),u.removeEventListener("pointermove",t)},t=r=>{if(!Z(r)&&d.isSelecting)return d.isSelecting=!1,u.removeEventListener("pointerup",e),void u.removeEventListener("pointermove",t);if(!(0,l.vAA)(r.target))return;let i=null,o=!(v||c.contains(r.target));if(o)i=el(c,r.target);else for(let e of document.elementsFromPoint(r.clientX,r.clientY))if(i=el(c,e))break;i&&(null===d.focusCell||i.elem!==d.focusCell.elem)&&(d.setNextFocus({focusCell:i,override:o}),n.dispatchCommand(l.MvL,void 0))};d.isSelecting=!0,u.addEventListener("pointerup",e,d.listenerOptions),u.addEventListener("pointermove",t,d.listenerOptions)})()};c.addEventListener("pointerdown",f,d.listenerOptions),d.listenersToRemove.add(()=>{c.removeEventListener("pointerdown",f)});let g=e=>{e.detail>=3&&(0,l.vAA)(e.target)&&null!==er(e.target)&&e.preventDefault()};c.addEventListener("mousedown",g,d.listenerOptions),d.listenersToRemove.add(()=>{c.removeEventListener("mousedown",g)});let m=e=>{let t=e.target;0===e.button&&(0,l.vAA)(t)&&n.update(()=>{let e=(0,l.vJq)();$(e)&&e.tableKey===d.tableNodeKey&&a.contains(t)&&d.$clearHighlight()})};for(let[t,i]of(u.addEventListener("pointerdown",m,d.listenerOptions),d.listenersToRemove.add(()=>{u.removeEventListener("pointerdown",m)}
15),Q))d.listenersToRemove.add(n.registerCommand(t,t=>(function e(t,n,i,o,a){if(("up"===i||"down"===i)&&function(e){let t=e.getRootElement();return!!t&&t.hasAttribute("aria-controls")&&"typeahead-menu"===t.getAttribute("aria-controls")}(t))return!1;let u=(0,l.vJq)();if(!eh(u,o)){if((0,l.I2P)(u)){if("backward"===i){if(u.focus.offset>0)return!1;let e=function(e){for(let t=e,n=e;null!==n;t=n,n=n.getParent())if((0,l.ff4)(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(u.focus.getNode());if(!e)return!1;let t=e.getPreviousSibling();return!!eA(t)&&(eC(n),n.shiftKey?u.focus.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent(),"element"):t.selectEnd(),!0)}if(n.shiftKey&&("up"===i||"down"===i)){let e=u.focus.getNode();if(!u.isCollapsed()&&("up"===i&&!u.isBackward()||"down"===i&&u.isBackward())){let t=(0,r.Bt)(e,e=>eA(e));if(h(t)&&(t=(0,r.Bt)(t,eA)),t!==o||!t)return!1;let a="down"===i?t.getNextSibling():t.getPreviousSibling();if(!a)return!1;let d=0;"up"===i&&(0,l.ff4)(a)&&(d=a.getChildrenSize());let c=a;"up"===i&&(0,l.ff4)(a)&&(c=a.getLastChild()||a,d=(0,l.kFe)(c)?c.getTextContentSize():0);let f=u.clone();return f.focus.set(c.getKey(),d,(0,l.kFe)(c)?"text":"element"),(0,l.n1P)(f),eC(n),!0}if((0,l.IqF)(e)){let e="up"===i?u.getNodes()[u.getNodes().length-1]:u.getNodes()[0];if(e&&null!==X(o,e)){let e=o.getFirstDescendant(),t=o.getLastDescendant();if(!e||!t)return!1;let[n]=B(e),[r]=B(t),l=o.getCordsFromCellNode(n,a.table),i=o.getCordsFromCellNode(r,a.table),u=o.getDOMCellFromCordsOrThrow(l.x,l.y,a.table),d=o.getDOMCellFromCordsOrThrow(i.x,i.y,a.table);return a.$setAnchorCellForSelection(u),a.$setFocusCellForSelection(d,!0),!0}return!1}{let t=(0,r.Bt)(e,e=>(0,l.ff4)(e)&&!e.isInline());if(h(t)&&(t=(0,r.Bt)(t,eA)),!t)return!1;let o="down"===i?t.getNextSibling():t.getPreviousSibling();if(eA(o)&&a.tableNodeKey===o.getKey()){let e=o.getFirstDescendant(),t=o.getLastDescendant();if(!e||!t)return!1;let[r]=B(e),[a]=B(t),d=u.clone();return d.focus.set(("up"===i?r:a).getKey(),"up"===i?0:a.getChildrenSize(),"element"),eC(n),(0,l.n1P)(d),!0}}}}return"down"===i&&ek(t)&&a.setShouldCheckSelection(),!1}if((0,l.I2P)(u)){if("backward"===i||"forward"===i)return function(e,t,n,i,o,a,u){let d=(0,l.Ave)(n.focus,o?"previous":"next");if((0,l.pGK)(d))return!1;let c=d;for(let e of(0,l.mWO)(d).iterNodeCarets("shadowRoot")){if(!(0,l.OpE)(e)||!(0,l.ff4)(e.origin))return!1;c=e}let f=c.getParentAtCaret();if(!h(f))return!1;let g=function(e){for(let t of(0,l.mWO)(e).iterNodeCarets("root")){let{origin:n}=t;if(h(n)){if((0,l.cmH)(t))return(0,l.uwZ)(n,e.direction)}else if(!C(n))break}return null}((0,l.IlV)(f,c.direction)),m=(0,r.Bt)(f,eA);if(!m||!m.is(a))return!1;let _=e.getElementByKey(f.getKey()),y=er(_);if(!_||!y)return!1;if(u.table=function(e,t){let n=e.getElementByKey(t.getKey());
15return null===n&&p(230),ei(t,n)}(e,m),g)if("extend"===i){let t=er(e.getElementByKey(g.origin.getKey()));if(!t)return!1;u.$setAnchorCellForSelection(y),u.$setFocusCellForSelection(t,!0)}else{let e=(0,l.lSZ)(g);(0,l.wp6)(n.anchor,e),(0,l.wp6)(n.focus,e)}else if("extend"===i)u.$setAnchorCellForSelection(y),u.$setFocusCellForSelection(y,!0);else{let e=function(e){let t=(0,l.erb)(e);return(0,l.cmH)(t)?(0,l.lSZ)(t):e}((0,l.IlV)(m,d.direction));(0,l.wp6)(n.anchor,e),(0,l.wp6)(n.focus,e)}return eC(t),!0}(t,n,u,n.shiftKey?"extend":"move","backward"===i,o,a);if(u.isCollapsed()){let d,{anchor:c,focus:f}=u,g=(0,r.Bt)(c.getNode(),h),p=(0,r.Bt)(f.getNode(),h);if(!h(g)||!g.is(p))return!1;let m=ey(g);if(m!==o&&null!=m){let r=G(m,t.getElementByKey(m.getKey()));if(null!=r)return a.table=ei(m,r),e(t,n,i,m,a)}let _=t.getElementByKey(g.__key),y=t.getElementByKey(c.key);if(null==y||null==_)return!1;if("element"===c.type)d=y.getBoundingClientRect();else{let e=(0,l.peL)(Y(t));if(null===e||0===e.rangeCount)return!1;d=e.getRangeAt(0).getBoundingClientRect()}let C="up"===i?g.getFirstChild():g.getLastChild();if(null==C)return!1;let S=t.getElementByKey(C.__key);if(null==S)return!1;let x=S.getBoundingClientRect();if("up"===i?x.top>d.top-d.height:d.bottom+d.height>x.bottom){eC(n);let e=o.getCordsFromCellNode(g,a.table);if(!n.shiftKey)return eu(a,o,e.x,e.y,i);{let t=o.getDOMCellFromCordsOrThrow(e.x,e.y,a.table);a.$setAnchorCellForSelection(t),a.$setFocusCellForSelection(t,!0)}return!0}}}else if($(u)){let{anchor:e,focus:l}=u,d=(0,r.Bt)(e.getNode(),h),c=(0,r.Bt)(l.getNode(),h),[f]=u.getNodes();eA(f)||p(251);let g=G(f,t.getElementByKey(f.getKey()));if(!h(d)||!h(c)||!eA(f)||null==g)return!1;a.$updateTableTableSelection(u);let m=ei(f,g),_=o.getCordsFromCellNode(d,m),y=o.getDOMCellFromCordsOrThrow(_.x,_.y,m);if(a.$setAnchorCellForSelection(y),eC(n),n.shiftKey){let[e,t,n]=D(o,d,c);return function(e,t,n,r,l){let i=K(t,n,r),{topSpan:o,leftSpan:a,bottomSpan:u,rightSpan:d}=function(e,t){let{minColumn:n,maxColumn:r,minRow:l,maxRow:i}=t,o=1,a=1,u=1,d=1,c=e[l],f=e[i];for(let e=n;e<=r;e++)o=Math.max(o,c[e].cell.__rowSpan),d=Math.max(d,f[e].cell.__rowSpan);for(let t=l;t<=i;t++)a=Math.max(a,e[t][n].cell.__colSpan),u=Math.max(u,e[t][r].cell.__colSpan);return{bottomSpan:d,leftSpan:a,rightSpan:u,topSpan:o}}(t,i),[c,f]=ec(function(e,t){let n=ed(e,t);return null===n&&p(249,t.cell.getKey()),n}(i,n)),h=i[c],g=i[f];"forward"===l?h+="maxColumn"===c?1:a:"backward"===l?h-="minColumn"===c?1:d:"down"===l?g+="maxRow"===f?1:o:"up"===l&&(g-="minRow"===f?1:u);let m=t[g];if(void 0===m)return!1;let _=m[h];if(void 0===_)return!1;let[y,C]=function(e,t,n){let r=K(e,t,n),l=ed(r,t);if(l)return[ef(e,r,l),ef(e,r,ec(l))];let i=ed(r,n);if(i)return[ef(e,r,ec(i)),ef(e,r,i)];let o=["minColumn","minRow"];return[ef(e,r,o),ef(e,r,ec(o))]}(t,n,_),S=ev(e,y.cell),x=ev(e,C.cell);return e.$setAnchorCellForSelection(S),e.$setFocusCellForSelection(x,!0),!0}(a,e,t,n,i)}return c.selectEnd(),!0}return!1})(n,t,i,e,d),l.WgU));d.listenersToRemove.add(n.registerCommand(l.Q$N,t=>{let n=(0,l.vJq)();if($(n)){let r=X(e,n.focus.getNode());if(null!==r)return eC(t),r.selectEnd(),!0}return!1},l.WgU));let _=t=>()=>{let n=(0,l.vJq)();if(!eh(n,e))return!1;if($(n))return d.$clearText(),!0;if((0,l.I2P)(n)){if(!h(X(e,n.anchor.getNode())))return!1;let i=n.anchor.getNode(),o=n.focus.getNode(),a=e.isParentOf(i),u=e.isParentOf(o);if(a&&!u||u&&!a)return d.$clearText(),!0;let c=(0,r.Bt)(n.anchor.getNode(),e=>(0,l.ff4)(e)),f=c&&(0,r.Bt)(c,e=>(0,l.ff4)(e)&&h(e.getParent()));if(!(0,l.ff4)(f)||!(0,l.ff4)(c))return!1;if(t===l.viC&&null===f.getPreviousSibling())return!0}return!1};for(let e of ee)d.listenersToRemove.add(n.registerCommand(e,_(e),l.da8));let y=t=>{let n=(0,l.vJq)();if(!$(n)&&!(0,l.I2P)(n))return!1;let r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){let t=r?"focus":"anchor",{key:l,offset:i,type:o}=n[t];return e[n[r?"anchor":"focus"].isBefore(n[t])?"selectPrevious":"selectNext"]()[t].set(l,i,o),!1}return!!eh(n,e)&&!!$(n)&&(t&&(t.preventDefault(),t.stopPropagation()),d.$clearText(),!0)};for(let e of et)d.listenersToRemove.add(n.registerCommand(e,y,l.da8));return d.listenersToRemove.add(n.registerCommand(l.VSO,e=>{let t=(0,l.vJq)();if(t){if(!$(t)&&!(0,l.I2P)(t))return!1;(0,i.lW)(n,(0,r.xj)(e,ClipboardEvent)?e:null,(0,i.xg)(t));let o=y(e);return(0,l.I2P)(t)?(t.removeText(),!0):o}return!1},l.da8)),d.listenersToRemove.add(n.registerCommand(l.mB,t=>{let n=(0,l.vJq)();if(!eh(n,e))return!1;if($(n))return d.$formatCells(t),!0;if((0,l.I2P)(n)){let e=(0,r.Bt)(n.anchor.getNode(),e=>h(e));h(e)}return!1},l.da8)),d.listenersToRemove.add(n.registerCommand(l.fUS,t=>{let n=(0,l.vJq)();if(!$(n)||!eh(n,e))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();if(!h(r)||!h(i))return!1;if(function(e,t){if($(e)){let n=e.anchor.getNode(),r=e.focus.getNode();if(t&&n&&r){let[e]=D(t,n,r);return n.getKey()===e[0][0].cell.getKey()&&r.getKey()===e[e.length-1].at(-1).cell.getKey()}}return!1}(n,e))return e.setFormat(t),!0;let[o,a,u]=D(e,r,i),d=Math.max(a.startRow+a.cell.__rowSpan-1,u.startRow+u.cell.__rowSpan-1),c=Math.max(a.startColumn+a.cell.__colSpan-1,u.startColumn+u.cell.__colSpan-1),f=Math.min(a.startRow,u.startRow),g=Math.min(a.startColumn,u.startColumn),p=new Set;for(let e=f;e<=d;e++)for(let n=g;n<=c;n++){let r=o[e][n].cell;if(p.has(r))continue;p.add(r),r.setFormat(t);let i=r.getChildren();for(let e=0;e<i.length;e++){let n=i[e];(0,l.ff4)(n)&&!n.isInline()&&n.setFormat(t)}}return!0},l.da8)),d.listenersToRemove.add(n.registerCommand(l.bM3,t=>{let i=(0,l.vJq)();if(!eh(i,e))return!1;if($(i))return d.$clearHighlight(),!1;if((0,l.I2P)(i)){let o=(0,r.Bt)(i.anchor.getNode(),e=>h(e));if(!h(o))return!1;if("string"==typeof t){let r=ex(n,i,e);if(r)return eS(r,e,[(0,l.sTu)(t)]),!0}}return!1},l.da8)),o&&d.listenersToRemove.add(n.registerCommand(l.OXk,t=>{let n=(0,l.vJq)();
15if(!(0,l.I2P)(n)||!n.isCollapsed()||!eh(n,e))return!1;let i=e_(n.anchor.getNode());return!(null===i||!e.is(ey(i)))&&(eC(t),function(e,t){let n="next"===t?"getNextSibling":"getPreviousSibling",i="next"===t?"getFirstChild":"getLastChild",o=e[n]();if((0,l.ff4)(o))return o.selectEnd();let a=(0,r.Bt)(e,C);null===a&&p(247);for(let e=a[n]();C(e);e=e[n]()){let t=e[i]();if((0,l.ff4)(t))return t.selectEnd()}let u=(0,r.Bt)(a,eA);null===u&&p(248),"next"===t?u.selectNext():u.selectPrevious()}(i,t.shiftKey?"previous":"next"),!0)},l.da8)),d.listenersToRemove.add(n.registerCommand(l.$7r,t=>e.isSelected(),l.WgU)),d.listenersToRemove.add(n.registerCommand(l.oqR,e=>{let{nodes:t,selection:n}=e,i=n.getStartEndPoints(),o=$(n),a=(0,l.I2P)(n)&&null!==(0,r.Bt)(n.anchor.getNode(),e=>h(e))&&null!==(0,r.Bt)(n.focus.getNode(),e=>h(e))||o;if(1!==t.length||!eA(t[0])||!a||null===i)return!1;let[u]=i,d=t[0],c=d.getChildren(),f=d.getFirstChildOrThrow().getChildrenSize(),g=d.getChildrenSize(),p=(0,r.Bt)(u.getNode(),e=>h(e)),m=p&&(0,r.Bt)(p,e=>C(e)),_=m&&(0,r.Bt)(m,e=>eA(e));if(!h(p)||!C(m)||!eA(_))return!1;let y=m.getIndexWithinParent(),S=Math.min(_.getChildrenSize()-1,y+g-1),x=p.getIndexWithinParent(),v=Math.min(m.getChildrenSize()-1,x+f-1),b=Math.min(x,v),w=Math.min(y,S),T=Math.max(x,v),k=Math.max(y,S),N=_.getChildren(),E=0;for(let e=w;e<=k;e++){let t=N[e];if(!C(t))return!1;let n=c[E];if(!C(n))return!1;let r=t.getChildren(),i=n.getChildren(),o=0;for(let e=b;e<=T;e++){let t=r[e];if(!h(t))return!1;let n=i[o];if(!h(n))return!1;let a=t.getChildren();
15n.getChildren().forEach(e=>{(0,l.kFe)(e)&&(0,l.lJ7)().append(e),t.append(e)}),a.forEach(e=>e.remove()),o++}E++}return!0},l.da8)),d.listenersToRemove.add(n.registerCommand(l.MvL,()=>{let t=(0,l.vJq)(),i=(0,l.S1w)(),o=d.getAndClearNextFocus();if(null!==o){let{focusCell:n}=o;if($(t)&&t.tableKey===d.tableNodeKey)return(n.x!==d.focusX||n.y!==d.focusY)&&(d.$setFocusCellForSelection(n),!0);if(n!==d.anchorCell&&eh(t,e))return d.$setFocusCellForSelection(n),!0}if(d.getAndClearShouldCheckSelection()&&(0,l.I2P)(i)&&(0,l.I2P)(t)&&t.isCollapsed()){let n=t.anchor.getNode(),l=e.getFirstChild(),i=e_(n);if(null!==i&&C(l)){let t=l.getFirstChild();if(h(t)&&e.is((0,r.Bt)(i,n=>n.is(e)||n.is(t))))return t.selectStart(),!0}}if((0,l.I2P)(t)){let{anchor:r,focus:o}=t,a=r.getNode(),u=o.getNode(),c=e_(a),f=e_(u),h=!(!c||!e.is(ey(c))),g=!(!f||!e.is(ey(f))),p=t.isBackward();if(h!==g){let r=t.clone();if(g){let[t]=D(e,f,f),n=t[0][0].cell,l=t[t.length-1].at(-1).cell;r.focus.set(p?n.getKey():l.getKey(),p?n.getChildrenSize():l.getChildrenSize(),"element")}else if(h){let[t]=D(e,c,c),n=t[0][0].cell,l=t[t.length-1].at(-1).cell;r.anchor.set(p?l.getKey():n.getKey(),p?l.getChildrenSize():0,"element")}(0,l.n1P)(r),ea(n,d)}else if(h&&g&&(c.is(f)||(d.$setAnchorCellForSelection(ev(d,c)),d.$setFocusCellForSelection(ev(d,f),!0)),"touch"===d.pointerType&&t.isCollapsed()&&(0,l.I2P)(i)&&i.isCollapsed())){let e=e_(i.anchor.getNode());e&&!e.is(f)&&(d.$setAnchorCellForSelection(ev(d,e)),d.$setFocusCellForSelection(ev(d,f),!0),d.pointerType=null)}}else if(t&&$(t)&&t.is(i)&&t.tableKey===e.getKey()){let r=(0,l.peL)(u);if(r&&r.anchorNode&&r.focusNode){let i=(0,l.xL4)(r.focusNode),o=i&&!e.isParentOf(i),a=(0,l.xL4)(r.anchorNode),u=a&&e.isParentOf(a);if(o&&u&&r.rangeCount>0){let i=(0,l.OBE)(r,n);i&&(i.anchor.set(e.getKey(),t.isBackward()?e.getChildrenSize():0,"element"),r.removeAllRanges(),(0,l.n1P)(i))}}}return t&&!t.is(i)&&($(t)||$(i))&&d.tableSelection&&!d.tableSelection.is(i)?$(t)&&t.tableKey===d.tableNodeKey?d.$updateTableTableSelection(t):!$(t)&&$(i)&&i.tableKey===d.tableNodeKey&&d.$updateTableTableSelection(null):d.hasHijackedSelectionStyles&&!e.isSelected()?(d.$enableHighlightStyle(),es(d.table,e=>{let t=e.elem;e.highlighted=!1,em(n,e),t.getAttribute("style")||t.removeAttribute("style")})):!d.hasHijackedSelectionStyles&&e.isSelected()&&ea(n,d),!1},l.da8)),d.listenersToRemove.add(n.registerCommand(l.XKQ,()=>{let t=(0,l.vJq)();if(!(0,l.I2P)(t)||!t.isCollapsed()||!eh(t,e))return!1;let r=ex(n,t,e);return!!r&&(eS(r,e),!0)},l.da8)),d}(o,d,e,t);n.set(a,[c,d])},a=e.registerMutationListener(eE,t=>{e.getEditorState().read(()=>{for(let[e,r]of t){let t=n.get(e);if("created"===r||"updated"===r){let{tableNode:r,tableElement:l}=q(e);void 0===t?o(r,e,l):l!==t[1]&&(t[0].removeListeners(),n.delete(e),o(r,e,l))}else"destroyed"===r&&void 0!==t&&(t[0].removeListeners(),n.delete(e))}},{editor:e})},{skipInitialization:!1});return()=>{for(let[,[e]]of(a(),n))e.removeListeners()}}function eK(e){return e.hasNodes([eE])||p(255),(0,r.Sd)(e.registerCommand(g,eO,l.jZM),e.registerCommand(l.oqR,({nodes:e,selection:t})=>!!(0,l.I2P)(t)&&null!==ey(t.anchor.getNode())&&e.some(eA),l.jZM),e.registerCommand(l.d8p,eD,l.jZM),e.registerNodeTransform(eE,eI),e.registerNodeTransform(m,eM),e.registerNodeTransform(u,eL))}},46037:(e,t,n)=>{n.d(t,{g:()=>u});var r=n(30889),l=n(94271),i=n(92749),o=n(32532),a=n(12115);function u({newTab:e=!0,disabled:t=!1}){let[n]=(0,l.DF)();return(0,a.useEffect)(()=>{let l=l=>{let a=l.target;if(!(0,o.vAA)(a))return;let u=(0,o.scG)(a);if(null===u)return;let d=null,c=null;if(u.update(()=>{let e=(0,o.xL4)(a);if(null!==e){let n=(0,i.Bt)(e,o.ff4);if(!t)if((0,r.FJ)(n))d=n.sanitizeUrl(n.getURL()),c=n.getTarget();else{let e=function(e,t){let n=e;for(;null!=n;){if(t(n))return n;n=n.parentNode}return null}(a,i.nY);null!==e&&(d=e.href,c=e.target)}}}),null===d||""===d)return;let f=n.getEditorState().read(o.vJq);if((0,o.I2P)(f)&&!f.isCollapsed())return void l.preventDefault();let h="auxclick"===l.type&&1===l.button;window.open(d,e||h||l.metaKey||l.ctrlKey||"_blank"===c?"_blank":"_self"),l.preventDefault()},a=e=>{1===e.button&&l(e)};return n.registerRootListener((e,t)=>
15{null!==t&&(t.removeEventListener("click",l),t.removeEventListener("mouseup",a)),null!==e&&(e.addEventListener("click",l),e.addEventListener("mouseup",a))})},[n,e,t]),null}},53219:(e,t,n)=>{n.d(t,{a:()=>f});var r=n(94271),l=n(12115),i=n(95155),o=n(81521),a=n(92749);let u="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect,d=(0,l.forwardRef)(function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:a,ariaExpanded:d,ariaInvalid:c,ariaLabel:f,ariaLabelledBy:h,ariaMultiline:g,ariaOwns:p,ariaRequired:m,autoCapitalize:_,className:y,id:C,role:S="textbox",spellCheck:x=!0,style:v,tabIndex:b,"data-testid":w,...T},k){let[N,E]=(0,l.useState)(e.isEditable()),F=(0,l.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),P=(0,l.useMemo)(()=>(function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}})(k,F),[F,k]);return u(()=>(E(e.isEditable()),e.registerEditableListener(e=>{E(e)})),[e]),(0,i.jsx)("div",{"aria-activedescendant":N?t:void 0,"aria-autocomplete":N?n:"none","aria-controls":N?r:void 0,"aria-describedby":o,...null!=a?{"aria-errormessage":a}:{},"aria-expanded":N&&"combobox"===S?!!d:void 0,...null!=c?{"aria-invalid":c}:{},"aria-label":f,"aria-labelledby":h,"aria-multiline":g,"aria-owns":N?p:void 0,"aria-readonly":!N||void 0,"aria-required":m,autoCapitalize:_,className:y,contentEditable:N,"data-testid":w,id:C,ref:P,role:N?S:void 0,spellCheck:x,style:v,tabIndex:b,...T})});function c(e){return e.getEditorState().read((0,o.yl)(e.isComposing()))}let f=(0,l.forwardRef)(function(e,t){let{placeholder:n,...l}=e,[o]=(0,r.DF)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d,{editor:o,...l,ref:t}),null!=n&&(0,i.jsx)(h,{editor:o,content:n})]})});function h({content:e,editor:t}){let n=function(e){let[t,n]=(0,l.useState)(()=>c(e));return u(()=>{function t(){n(c(e))}return t(),(0,a.Sd)(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,o]=(0,l.useState)(t.isEditable());if((0,l.useLayoutEffect)(()=>(o(t.isEditable()),t.registerEditableListener(e=>{o(e)})),[t]),!n)return null;let d=null;return"function"==typeof e?d=e(r):null!==e&&(d=e),null===d?null:(0,i.jsx)("div",{"aria-hidden":!0,children:d})}},54576:(e,t,n)=>{n.d(t,{d:()=>l});var r=n(32532);class l extends r.Kp7{constructor(e,t){super(t),this.__format=e||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(e){let t=this.getWritable();return t.__format=e,t}isInline(){return!1}}},58647:(e,t,n)=>{n.d(t,{a:()=>a});var r=n(94271),l=n(12115);let i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function o(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function a(){let[e]=(0,r.DF)(),t=(0,l.useMemo)(()=>o(e),[e,o]),[n,a]=(0,l.useState)(()=>t.initialValueFn()),u=(0,l.useRef)(n);return i(()=>{let{initialValueFn:e,subscribe:n}=t,r=e();return u.current!==r&&(u.current=r,a(r)),n(e=>{u.current=e,a(e)})},[t,o]),n}},61731:(e,t,n)=>{n.d(t,{Cb:()=>m,Nx:()=>d,Rk:()=>_,SD:()=>u,Vs:()=>f,Wh:()=>a,Xg:()=>c,zI:()=>g});var r=n(32532);function l(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let i=new Map;function o(e){let t={};if(!e)return t;for(let n of e.split(";"))if(""!==n){let[e,r]=n.split(/:([^]+)/);e&&r&&(t[e.trim()]=r.trim())}return t}function a(e){let t=i.get(e);return void 0===t&&(t=o(e),i.set(e,t)),t}function u(e,t){let n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){let[l,i]=n,o=e.isBackward(),a=l.getNode(),u=i.getNode(),d=t.is(a),c=t.is(u);
15if(d||c){let[n,l]=(0,r.Cku)(e),i=a.is(u),d=t.is(o?u:a),c=t.is(o?a:u),f,h=0;return i?(h=n>l?l:n,f=n>l?n:l):d?(h=o?l:n,f=void 0):c&&(h=0,f=o?n:l),t.__text=t.__text.slice(h,f),t}}return t}function d(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return(0,r.ff4)(t)||l(177),e.offset===t.getChildrenSize()}function c(e){let t=e.getStyle(),n=o(t);i.set(t,n)}function f(e){let t=(0,r.vJq)();if(!t)return;let n=new Map;if((0,r.I2P)(t))for(let e of(0,r.$iu)(t).getTextSlices())e&&n.set(e.caret.origin.getKey(),e.getSliceIndices());for(let l of t.getNodes()){if(!(0,r.kFe)(l)||!l.canHaveFormat())continue;let[t,i]=n.get(l.getKey())||[0,l.getTextContentSize()];i!==t&&e((0,r.Rb_)(l)||0===t&&i===l.getTextContentSize()?l:l.splitText(t,i)[+(0!==t)])}(0,r.I2P)(t)&&"text"===t.anchor.type&&"text"===t.focus.type&&t.anchor.key===t.focus.key&&function(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:r,offset:l,type:i}=t;t.set(n.key,n.offset,n.type),n.set(r,l,i)}}(t)}function h(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function g(e,t,n=h){if(null===e)return;let l=e.getStartEndPoints(),i=new Map,o=null;if(l){let[e,t]=l;(o=(0,r.uTE)()).anchor.set(e.key,e.offset,e.type),o.focus.set(t.key,t.offset,t.type);let n=y(e.getNode(),r.w3H),a=y(t.getNode(),r.w3H);(0,r.ff4)(n)&&i.set(n.getKey(),n),(0,r.ff4)(a)&&i.set(a.getKey(),a)}for(let t of e.getNodes())(0,r.ff4)(t)&&(0,r.w3H)(t)&&i.set(t.getKey(),t);for(let[e,r]of i){let l=t();n(r,l),r.replace(l,!0),o&&(e===o.anchor.key&&o.anchor.set(l.getKey(),o.anchor.offset,o.anchor.type),e===o.focus.key&&o.focus.set(l.getKey(),o.focus.offset,o.focus.type))}o&&e.is((0,r.vJq)())&&(0,r.n1P)(o)}function p(e){return e.getNode().isAttached()}function m(e,t){let n=(0,r.Ave)(e.focus,t?"previous":"next");if((0,r.pGK)(n))return!1;for(let e of(0,r.mWO)(n)){if((0,r.cmH)(e))return!e.origin.isInline();if(!(0,r.ff4)(e.origin)){if((0,r.Cyw)(e.origin))return!0;break}}return!1}function _(e,t,n){let l=function(e){let t=e.anchor.getNode();return"rtl"===((0,r.hVZ)(t)?t:t.getParentOrThrow()).getDirection()}(e);e.modify(t?"extend":"move",n?!l:l,"character")}function y(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}},62002:(e,t,n)=>{n.d(t,{Pi:()=>T,ZI:()=>P,dJ:()=>_,fi:()=>w,gA:()=>k,jL:()=>S,jd:()=>C,xi:()=>y});var r=n(40983),l=n(61731),i=n(92749),o=n(32532);function a(e,t){if(void 0!==document.caretRangeFromPoint){let n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){let n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}let u="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,d=u&&"documentMode"in document?document.documentMode:null,c=!(!u||!("InputEvent"in window)||d)&&"getTargetRanges"in new window.InputEvent("input"),f=u&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),h=u&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,g=u&&/^(?=.*Chrome).*/i.test(navigator.userAgent),p=u&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!g,m=(0,o.guI)("DRAG_DROP_PASTE_FILE");class _ extends o.fGB{static getType(){return"quote"}static clone(e){return new _(e.__key)}createDOM(e){let t=document.createElement("blockquote");return(0,i.ZB)(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:b,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,i.sb)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();t.style.textAlign=e;let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return y().updateFromJSON(e)}insertNewAfter(e,t){let n=(0,o.lJ7)(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){let e=(0,o.lJ7)();
15return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function y(){return(0,o.pTq)(new _)}function C(e){return e instanceof _}class S extends o.fGB{static getType(){return"heading"}static clone(e){return new S(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){let e=r[t];(0,i.ZB)(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:v,priority:0}),h2:e=>({conversion:v,priority:0}),h3:e=>({conversion:v,priority:0}),h4:e=>({conversion:v,priority:0}),h5:e=>({conversion:v,priority:0}),h6:e=>({conversion:v,priority:0}),p:e=>{let t=e.firstChild;return null!==t&&x(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>x(e)?{conversion:e=>({node:w("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,i.sb)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();t.style.textAlign=e;let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return w(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),l=r&&(!e||e.anchor.key!==r.getKey()||n!==r.getTextContentSize())&&e?w(this.getTag()):(0,o.lJ7)(),i=this.getDirection();if(l.setDirection(i),this.insertAfter(l,t),0===n&&!this.isEmpty()&&e){let e=(0,o.lJ7)();e.select(),this.replace(e,!0)}return l}collapseAtStart(){let e=this.isEmpty()?(0,o.lJ7)():w(this.getTag());
15return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function x(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function v(e){let t=e.nodeName.toLowerCase(),n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=w(t),null!==e.style&&((0,o.dxY)(e,n),n.setFormat(e.style.textAlign))),{node:n}}function b(e){let t=y();return null!==e.style&&(t.setFormat(e.style.textAlign),(0,o.dxY)(e,t)),{node:t}}function w(e="h1"){return(0,o.pTq)(new S(e))}function T(e){return e instanceof S}function k(e){let t=null;if((0,i.xj)(e,DragEvent)?t=e.dataTransfer:(0,i.xj)(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];let n=t.types,r=n.includes("Files"),l=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),l]}function N(e){let t=(0,o.vJq)();if(!(0,o.I2P)(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let l=r[t],a=l.getKey();if(n.has(a))continue;let u=(0,i.Bt)(l,e=>(0,o.ff4)(e)&&!e.isInline());if(null===u)continue;let d=u.getKey();u.canIndent()&&!n.has(d)&&(n.add(d),e(u))}return n.size>0}function E(e){let t=(0,o.xL4)(e);return(0,o.Cyw)(t)}function F(e){for(let t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function P(e){return(0,i.Sd)(e.registerCommand(o.d8p,e=>{let t=(0,o.vJq)();return!!(0,o.RTZ)(t)&&(t.clear(),!0)},0),e.registerCommand(o.WuB,e=>{let t=(0,o.vJq)();return(0,o.I2P)(t)?(t.deleteCharacter(e),!0):!!(0,o.RTZ)(t)&&(t.deleteNodes(),!0)},o.jZM),e.registerCommand(o.hi0,e=>{let t=(0,o.vJq)();return!!(0,o.I2P)(t)&&(t.deleteWord(e),!0)},o.jZM),e.registerCommand(o.viC,e=>{let t=(0,o.vJq)();return!!(0,o.I2P)(t)&&(t.deleteLine(e),!0)},o.jZM),e.registerCommand(o.bM3,t=>{let n=(0,o.vJq)();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;let l=t.dataTransfer;if(null!=l)(0,r.Bi)(l,n,e);else if((0,o.I2P)(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},o.jZM),e.registerCommand(o.$ey,()=>{let e=(0,o.vJq)();return!!(0,o.I2P)(e)&&(e.removeText(),!0)},o.jZM),e.registerCommand(o.mB,e=>{let t=(0,o.vJq)();return!!(0,o.I2P)(t)&&(t.formatText(e),!0)},o.jZM),e.registerCommand(o.fUS,e=>{let t=(0,o.vJq)();if(!(0,o.I2P)(t)&&!(0,o.RTZ)(t))return!1;for(let n of t.getNodes()){let t=(0,i.Bt)(n,e=>(0,o.ff4)(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},o.jZM),e.registerCommand(o.FEN,e=>{let t=(0,o.vJq)();return!!(0,o.I2P)(t)&&(t.insertLineBreak(e),!0)},o.jZM),e.registerCommand(o.XKQ,()=>{let e=(0,o.vJq)();return!!(0,o.I2P)(e)&&(e.insertParagraph(),!0)},o.jZM),e.registerCommand(o.YW5,()=>((0,o.H2A)([(0,o.ev7)()]),!0),o.jZM),e.registerCommand(o.PiT,()=>N(e=>{let t=e.getIndent();e.setIndent(t+1)}),o.jZM),e.registerCommand(o.sik,()=>N(e=>{let t=e.getIndent();t>0&&e.setIndent(t-1)}),o.jZM),e.registerCommand(o.UDz,e=>{let t=(0,o.vJq)();if((0,o.RTZ)(t)&&!E(e.target)){let e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if((0,o.I2P)(t)){let n=(0,o.B$P)(t.focus,!0);if(!e.shiftKey&&(0,o.Cyw)(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},o.jZM),e.registerCommand(o.bbF,e=>{let t=(0,o.vJq)();if((0,o.RTZ)(t)){let e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if((0,o.I2P)(t)){if(function(e){let t=e.focus;return"root"===t.key&&t.offset===(0,o.NiT)().getChildrenSize()}(t))return e.preventDefault(),!0;let n=(0,o.B$P)(t.focus,!1);if(!e.shiftKey&&(0,o.Cyw)(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},o.jZM),e.registerCommand(o.AX0,e=>{let t=(0,o.vJq)();if((0,o.RTZ)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!(0,o.I2P)(t))return!1;if((0,l.Cb)(t,!0)){let n=e.shiftKey;return e.preventDefault(),(0,l.Rk)(t,n,!0),!0}return!1},o.jZM),e.registerCommand(o.JM3,e=>{let t=(0,o.vJq)();if((0,o.RTZ)(t)&&!E(e.target)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!(0,o.I2P)(t))return!1;let n=e.shiftKey;return!!(0,l.Cb)(t,!1)&&(e.preventDefault(),(0,l.Rk)(t,n,!1),!0)},o.jZM),e.registerCommand(o.gCZ,t=>{if(E(t.target))return!1;let n=(0,o.vJq)();if((0,o.I2P)(n)){let{anchor:r}=n,l=r.getNode();if(n.isCollapsed()&&0===r.offset&&!(0,o.hVZ)(l)&&(0,i.mB)(l).getIndent()>0)return t.preventDefault(),e.dispatchCommand(o.sik,void 0);if(h&&"ko-KR"===navigator.language)return!1}else if(!(0,o.RTZ)(n))return!1;return t.preventDefault(),e.dispatchCommand(o.WuB,!0)},o.jZM),e.registerCommand(o.w$Z,t=>{if(E(t.target))return!1;let n=(0,o.vJq)();return!(!(0,o.I2P)(n)&&!(0,o.RTZ)(n))&&(t.preventDefault(),e.dispatchCommand(o.WuB,!1))},o.jZM),e.registerCommand(o.RTo,t=>{let n=(0,o.vJq)();if(!(0,o.I2P)(n))return!1;if(F(n),null!==t){if((h||f||p)&&c)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(o.FEN,!1)}return e.dispatchCommand(o.XKQ,void 0)},o.jZM),e.registerCommand(o.Q$N,()=>{let t=(0,o.vJq)();return!!(0,o.I2P)(t)&&(e.blur(),!0)},o.jZM),e.registerCommand(o.Sr4,t=>{let[,n]=k(t);if(n.length>0){let r=a(t.clientX,t.clientY);if(null!==r){let{offset:t,node:l}=r,i=(0,o.xL4)(l);if(null!==i){let e=(0,o.uTE)();if((0,o.kFe)(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{let t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}let n=(0,o.CaD)(e);(0,o.n1P)(n)}e.dispatchCommand(m,n)}return t.preventDefault(),!0}let r=(0,o.vJq)();return!!(0,o.I2P)(r)},o.jZM),e.registerCommand(o.TgX,e=>{let[t]=k(e),n=(0,o.vJq)();return!(t&&!(0,o.I2P)(n))},o.jZM),e.registerCommand(o.riq,e=>{let[t]=k(e),n=(0,o.vJq)();if(t&&!(0,o.I2P)(n))return!1;let r=a(e.clientX,e.clientY);if(null!==r){let t=(0,o.xL4)(r.node);(0,o.Cyw)(t)&&e.preventDefault()}return!0},o.jZM),e.registerCommand(o.HYn,()=>((0,o.e1k)(),!0),o.jZM),e.registerCommand(o.u5G,t=>((0,r.lW)(e,(0,i.xj)(t,ClipboardEvent)?t:null),!0),o.jZM),e.registerCommand(o.VSO,t=>((async function(e,t){await (0,r.lW)(t,(0,i.xj)(e,ClipboardEvent)?e:null),t.update(()=>{let e=(0,o.vJq)();
15(0,o.I2P)(e)?e.removeText():(0,o.RTZ)(e)&&e.getNodes().forEach(e=>e.remove())})})(t,e),!0),o.jZM),e.registerCommand(o.waI,t=>{let[,n,l]=k(t);return n.length>0&&!l?(e.dispatchCommand(m,n),!0):!((0,o.vAA)(t.target)&&(0,o.Z$U)(t.target))&&null!==(0,o.vJq)()&&(t.preventDefault(),e.update(()=>{let n=(0,o.vJq)(),l=(0,i.xj)(t,InputEvent)||(0,i.xj)(t,KeyboardEvent)?null:t.clipboardData;null!=l&&null!==n&&(0,r.Bi)(l,n,e)},{tag:"paste"}),!0)},o.jZM),e.registerCommand(o.Huu,e=>{let t=(0,o.vJq)();return(0,o.I2P)(t)&&F(t),!1},o.jZM),e.registerCommand(o.OXk,e=>{let t=(0,o.vJq)();return(0,o.I2P)(t)&&F(t),!1},o.jZM))}},62990:(e,t,n)=>{n.d(t,{$:()=>p});var r=n(94271),l=n(58647),i=n(81521),o=n(92749),a=n(12115),u=n(47650),d=n(95155),c=n(32532),f=n(62002);let h="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.useLayoutEffect:a.useEffect;function g(e){return e.getEditorState().read((0,i.yl)(e.isComposing()))}function p({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){var l;let[i]=(0,r.DF)(),g=function(e,t){let[n,r]=(0,a.useState)(()=>e.getDecorators());return h(()=>e.registerDecoratorListener(e=>{(0,u.flushSync)(()=>{r(e)})}),[e]),(0,a.useEffect)(()=>{r(e.getDecorators())},[e]),(0,a.useMemo)(()=>{let r=[],l=Object.keys(n);for(let i=0;i<l.length;i++){let o=l[i],c=(0,d.jsx)(t,{onError:t=>e._onError(t),children:(0,d.jsx)(a.Suspense,{fallback:null,children:n[o]})}),f=e.getElementByKey(o);null!==f&&r.push((0,u.createPortal)(c,f,o))}return r},[t,n,e])}(i,n);return h(()=>(0,o.Sd)((0,f.ZI)(l),function(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let l=n.data;if("string"==typeof l){let t;try{t=JSON.parse(l)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){let r=t.payload;if(r&&"makeChanges"===r.functionId){let t=r.args;if(t){let[r,l,i,o,a,u]=t;e.update(()=>{let e=(0,c.vJq)();if((0,c.I2P)(e)){let t=e.anchor,u=t.getNode(),d=0,f=0;if((0,c.kFe)(u)&&r>=0&&l>=0&&(d=r,f=r+l,e.setTextNodeRange(u,d,u,f)),d===f&&""===i||(e.insertRawText(i),u=t.getNode()),(0,c.kFe)(u)){d=o,f=o+a;let t=u.getTextContentSize();d=d>t?t:d,f=f>t?t:f,e.setTextNodeRange(u,d,u,f)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(l)),[l=i]),(0,d.jsxs)(d.Fragment,{children:[e,(0,d.jsx)(m,{content:t}),g]})}function m({content:e}){let[t]=(0,r.DF)(),n=function(e){let[t,n]=(0,a.useState)(()=>g(e));return h(()=>{function t(){n(g(e))}return t(),(0,o.Sd)(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),i=(0,l.a)();return n?"function"==typeof e?e(i):e:null}},64337:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(94271),l=n(41747),i=n(12115);
15function o({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:o=!1}){let[a]=(0,r.DF)();return(0,i.useEffect)(()=>{(0,l.hi)(a,o)},[a,o]),(0,i.useEffect)(()=>(0,l.xT)(a),[a]),(0,i.useEffect)(()=>(0,l.Ej)(a,n),[a,n]),(0,i.useEffect)(()=>{if(!e)return(0,l.nq)(a)},[a,e]),(0,i.useEffect)(()=>{if(!t)return a.registerNodeTransform(l.B9,e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)})},[a,t,e]),null}},69717:(e,t,n)=>{n.d(t,{d:()=>o,g:()=>a});var r=n(61731),l=n(92749),i=n(32532);function o(e,t){let n=t.body?t.body.childNodes:[],r=[],o=[];for(let t=0;t<n.length;t++){let a=n[t];if(!u.has(a.nodeName)){let t=function e(t,n,r,o,a=new Map,d){let c=[];if(u.has(t.nodeName))return c;let f=null,h=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),l=null;if(void 0!==r)for(let t of r){let n=t(e);null!==n&&(null===l||(l.priority||0)<=(n.priority||0))&&(l=n)}return null!==l?l.conversion:null}(t,n),g=h?h(t):null,p=null;if(null!==g){p=g.after;let e=g.node;if(null!==(f=Array.isArray(e)?e[e.length-1]:e)){for(let[,e]of a)if(!(f=e(f,d)))break;f&&c.push(...Array.isArray(e)?e:[f])}null!=g.forChild&&a.set(t.nodeName,g.forChild)}let m=t.childNodes,_=[],y=(null==f||!(0,i.IqF)(f))&&(null!=f&&(0,i.y68)(f)||o);for(let t=0;t<m.length;t++)_.push(...e(m[t],n,r,y,new Map(a),f));return null!=p&&(_=p(_)),(0,l.a9)(t)&&(_=function(e,t,n){let r=e.style.textAlign,l=[],o=[];for(let e=0;e<t.length;e++){let a=t[e];if((0,i.y68)(a))r&&!a.getFormat()&&a.setFormat(r),l.push(a);else if(o.push(a),e===t.length-1||e<t.length-1&&(0,i.y68)(t[e+1])){let e=n();e.setFormat(r),e.append(...o),l.push(e),o=[]}}return l}(t,_,y?()=>{let e=new i.A7V;return r.push(e),e}:i.lJ7)),null==f?_.length>0?c=c.concat(_):(0,l.a9)(t)&&null!=t.nextSibling&&null!=t.previousSibling&&(0,i._On)(t.nextSibling)&&(0,i._On)(t.previousSibling)&&(c=c.concat((0,i.WKo)())):(0,i.ff4)(f)&&f.append(..._),c}(a,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(let t of e)t.getNextSibling()instanceof i.A7V&&t.insertAfter((0,i.WKo)());for(let t of e){for(let e of t.getChildren())t.insertBefore(e);t.remove()}}(o),r}function a(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),o=(0,i.NiT)().getChildren();for(let a=0;a<o.length;a++)!function e(t,n,o,a=null){let u=null===a||n.isSelected(a),d=(0,i.ff4)(n)&&n.excludeFromCopy("html"),c=n;if(null!==a){let e=(0,i.BEs)(n);c=e=(0,i.kFe)(e)&&null!==a?(0,r.SD)(a,e):e}let f=(0,i.ff4)(c)?c.getChildren():[],h=t._nodes.get(c.getType()),{element:g,after:p}=h&&void 0!==h.exportDOM?h.exportDOM(t,c):c.exportDOM(t);if(!g)return!1;let m=document.createDocumentFragment();for(let r=0;r<f.length;r++){let l=f[r],o=e(t,l,m,a);!u&&(0,i.ff4)(n)&&o&&n.extractWithChild(l,a,"html")&&(u=!0)}if(u&&!d){if(((0,l.sb)(g)||(0,i.K8K)(g))&&g.append(m),o.append(g),p){let e=p.call(c,g);e&&((0,i.K8K)(g)?g.replaceChildren(e):g.replaceWith(e))}}else o.append(m);return u}(e,o[a],n,t);return n.innerHTML}let u=new Set(["STYLE","SCRIPT"])},70893:(e,t,n)=>{n.d(t,{DE:()=>F,HY:()=>P,Mz:()=>b,YW:()=>y,cz:()=>I,i:()=>v,mJ:()=>L,q7:()=>A,us:()=>D,v5:()=>w,x:()=>O});var r=n(92749),l=n(32532),i=n(61731);function o(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.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 a(e){let t=e.getParent();P(t)||o(40);let n=t;for(;null!==n;)P(n=n.getParent())&&(t=n);return t}function u(e){return b(e)&&P(e.getFirstChild())}function d(e){return v().append(e)}function c(e,t){return b(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function f(e){let t=(0,l.vJq)();if(null!==t){let n=t.getNodes();if((0,l.I2P)(t)){let r=t.getStartEndPoints();null===r&&o(143);let[i]=r,a=i.getNode(),u=a.getParent();if((0,l.IqF)(a)){let e=a.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=(0,l.lJ7)();a.append(e),n=e.select().getNodes()}}else if(c(a,n)){let t=F(e);if((0,l.IqF)(u)){a.replace(t);let e=v();(0,l.ff4)(a)&&(e.setFormat(a.getFormatType()),e.setIndent(a.getIndent())),t.append(e)}else if(b(a)){let e=a.getParentOrThrow();h(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(!(0,l.ff4)(i)||!i.isEmpty()||b(i)||r.has(i.getKey())){if((0,l.jG6)(i)){let t=i.getParent();for(;null!=t;){let n=t.getKey();if(P(t)){if(!r.has(n)){let l=F(e);h(l,t.getChildren()),t.replace(l),r.add(n)}break}{let i=t.getParent();if((0,l.IqF)(i)&&!r.has(n)){r.add(n),g(t,e);break}t=i}}}}else g(i,e)}}}function h(e,t){e.splice(e.getChildrenSize(),0,t)}function g(e,t){let n;if(P(e))return e;let r=e.getPreviousSibling(),l=e.getNextSibling(),i=v();
15if(h(i,e.getChildren()),P(r)&&t===r.getListType())r.append(i),P(l)&&t===l.getListType()&&(h(r,l.getChildren()),l.remove()),n=r;else if(P(l)&&t===l.getListType())l.getFirstChildOrThrow().insertBefore(i),n=l;else{let r=F(t);r.append(i),e.replace(r),n=r}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),n}function p(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&u(n)&&u(r)&&(p(n.getFirstChild(),r.getFirstChild()),r.remove());let l=t.getChildren();l.length>0&&e.append(...l),t.remove()}function m(...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 _(e,t,n){let r=(0,i.Wh)(t.__textStyle);for(let t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(let t in(0,i.Wh)(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}class y extends l.fGB{static getType(){return"listitem"}static clone(e){return new y(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){let t=document.createElement("li"),n=this.getParent();P(n)&&"check"===n.getListType()&&S(t,this,null),t.value=this.__value,C(t,e.theme,this);let r=this.__style;return r&&(t.style.cssText=r),_(t,this,null),t}updateDOM(e,t,n){let r=this.getParent();P(r)&&"check"===r.getListType()&&S(t,this,e),t.value=this.__value,C(t,n.theme,this);let l=e.__style,i=this.__style;return l!==i&&(""===i?t.removeAttribute("style"):t.style.cssText=i),_(t,this,e),!1}static transform(){return e=>{if(b(e)||o(144),null==e.__checked)return;let t=e.getParent();P(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:x,priority:0})}}static importJSON(e){return v().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config);t.style.textAlign=this.getFormatType();let n=this.getDirection();return n&&(t.dir=n),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if((0,l.ff4)(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(b(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!P(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=F(n.getListType()),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}
15return t&&((0,l.ff4)(e)||o(139),this.getChildren().forEach(t=>{e.append(t)})),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(P(n)||o(39),b(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){let l=F(n.getListType());r.forEach(e=>l.append(e)),e.insertAfter(l,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&u(t)&&u(n)&&(p(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=v().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let t=(0,l.lJ7)();this.getChildren().forEach(e=>t.append(e));let n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=b(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();let r=e.anchor,l=e.focus,i=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(i,r.offset,"element"),"element"===l.type&&l.getNode().is(this)&&l.set(i,l.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e,t=this.getLatest(),n=this.getParent();return P(n)&&(e=n.getListType()),"check"===e?!!t.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;b(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&o(117),(e=Math.floor(e))>=0||o(199);let t=this.getIndent();for(;t!==e;)t<e?(function(e){let t=new Set;if(u(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),l=e.getPreviousSibling();if(u(r)&&u(l)){let n=l.getFirstChild();if(P(n)){n.append(e);let l=r.getFirstChild();P(l)&&(h(n,l.getChildren()),r.remove(),t.add(r.getKey()))}}else if(u(r)){let t=r.getFirstChild();if(P(t)){let n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(u(l)){let t=l.getFirstChild();P(t)&&t.append(e)}else if(P(n)){let t=v().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),i=F(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(i),i.append(e),l?l.insertAfter(t):r?r.insertBefore(t):n.append(t)}}(this),t++):(function(e){if(u(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(P(n?n.getParent():void 0)&&b(n)&&P(t)){let r=t?t.getFirstChild():void 0,l=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(l))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=t.getListType(),l=v(),i=F(r);
15l.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let o=v(),a=F(r);o.append(a),h(a,e.getNextSiblings()),n.insertBefore(l),n.insertAfter(o),n.replace(e)}}}(this),t--);return this}canInsertAfter(e){return b(e)}canReplaceWith(e){return b(e)}canMergeWith(e){return b(e)||(0,l.bSg)(e)}extractWithChild(e,t){if(!(0,l.I2P)(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return F("bullet")}canMergeWhenEmpty(){return!0}}function C(e,t,n){let l,i=[],o=[],a=t.list,u=a?a.listitem:void 0;if(a&&a.nested&&(l=a.nested.listitem),void 0!==u&&i.push(...m(u)),a){let e=n.getParent(),t=P(e)&&"check"===e.getListType(),r=n.getChecked();t&&!r||o.push(a.listitemUnchecked),t&&r||o.push(a.listitemChecked),t&&i.push(r?a.listitemChecked:a.listitemUnchecked)}if(void 0!==l){let e=m(l);n.getChildren().some(e=>P(e))?i.push(...e):o.push(...e)}o.length>0&&(0,r.HE)(e,...o),i.length>0&&(0,r.ZB)(e,...i)}function S(e,t,n,r){P(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function x(e){if(e.classList.contains("task-list-item")){for(let n of e.children)if("INPUT"===n.tagName){var t;return"checkbox"!==(t=n).getAttribute("type")?{node:null}:{node:v(t.hasAttribute("checked"))}}}let n=e.getAttribute("aria-checked");return{node:v("true"===n||"false"!==n&&void 0)}}function v(e){return(0,l.pTq)(new y(void 0,e))}function b(e){return e instanceof y}class w extends l.fGB{static getType(){return"list"}static clone(e){return new w(e.__listType||E[e.__tag],e.__start,e.__key)}constructor(e="number",t=1,n){super(n);let r=E[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,T(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(T(t,n.theme,this),!1)}static transform(){return e=>{P(e)||o(163),function(e){let t=e.getNextSibling();P(t)&&e.getListType()===t.getListType()&&p(e,t)}(e),function(e){let t="check"!==e.getListType(),n=e.getStart();for(let r of e.getChildren())b(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),P(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:N,priority:0}),ul:()=>({conversion:N,priority:0})}}static importJSON(e){return F().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return(0,r.sb)(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];b(t)||(r===n&&(r=[...n]),r[e]=v().append(!(0,l.ff4)(t)||P(t)||t.isInline()?t:(0,l.sTu)(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return b(e)}}function T(e,t,n){let l=[],i=[],a=t.list;if(void 0!==a){let e,t=a[`${n.__tag}Depth`]||[],r=function(e){let t=1,n=e.getParent();for(;null!=n;){if(b(n)){let e=n.getParent();if(P(e)){t++,n=e.getParent();continue}o(40)}break}return t}(n)-1,u=r%t.length,d=t[u],c=a[n.__tag],f=a.nested,h=a.checklist;if(void 0!==f&&f.list&&(e=f.list),void 0!==c&&l.push(c),void 0!==h&&"check"===n.__listType&&l.push(h),void 0!==d){l.push(...m(d));for(let e=0;e<t.length;e++)e!==u&&i.push(n.__tag+e)}if(void 0!==e){let t=m(e);r>1?l.push(...t):i.push(...t)}}i.length>0&&(0,r.HE)(e,...i),l.length>0&&(0,r.ZB)(e,...l)}function k(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(b(r)){t.push(r);let e=r.getChildren();e.length>
151&&e.forEach(e=>{P(e)&&t.push(d(e))})}else t.push(d(r))}return t}function N(e){let t=e.nodeName.toLowerCase(),n=null;return"ol"===t?n=F("number",e.start):"ul"===t&&(n=!function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(let t of e.childNodes)if((0,r.sb)(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?F("bullet"):F("check")),{after:k,node:n}}let E={ol:"number",ul:"bullet"};function F(e="number",t=1){return(0,l.pTq)(new w(e,t))}function P(e){return e instanceof w}let A=(0,l.guI)("INSERT_UNORDERED_LIST_COMMAND"),O=(0,l.guI)("INSERT_ORDERED_LIST_COMMAND"),L=(0,l.guI)("INSERT_CHECK_LIST_COMMAND"),M=(0,l.guI)("REMOVE_LIST_COMMAND");function I(e){return(0,r.Sd)(e.registerCommand(O,()=>(f("number"),!0),l.AcJ),e.registerCommand(A,()=>(f("bullet"),!0),l.AcJ),e.registerCommand(M,()=>((function(){let e=(0,l.vJq)();if((0,l.I2P)(e)){let t=new Set,n=e.getNodes(),i=e.anchor.getNode();if(c(i,n))t.add(a(i));else for(let e=0;e<n.length;e++){let i=n[e];if((0,l.jG6)(i)){let e=(0,r.eu)(i,y);null!=e&&t.add(a(e))}}for(let n of t){let t=n;for(let r of function e(t){let n=[],r=t.getChildren().filter(b);for(let t=0;t<r.length;t++){let l=r[t],i=l.getFirstChild();P(i)?n=n.concat(e(i)):n.push(l)}return n}(n)){let n=(0,l.lJ7)().setTextStyle(e.style).setTextFormat(e.format);h(n,r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&(0,l.wp6)(e.anchor,(0,l.lSZ)((0,l.uwZ)(n,"next"))),r.__key===e.focus.key&&(0,l.wp6)(e.focus,(0,l.lSZ)((0,l.uwZ)(n,"next"))),r.remove()}n.remove()}}})(),!0),l.AcJ),e.registerCommand(l.XKQ,()=>(function(){let e,t=(0,l.vJq)();if(!(0,l.I2P)(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode();if(!b(n)||0!==n.getChildrenSize())return!1;let r=a(n),i=n.getParent();P(i)||o(40);let u=i.getParent();if((0,l.IqF)(u))e=(0,l.lJ7)(),r.insertAfter(e);else{if(!b(u))return!1;e=v(),u.insertAfter(e)}e.setTextStyle(t.style).setTextFormat(t.format).select();let d=n.getNextSiblings();if(d.length>0){let t=F(i.getListType());if(b(e)){let n=v();n.append(t),e.insertAfter(n)}else e.insertAfter(t);t.append(...d)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){let e=t.getParent();if(null==e||!b(e)&&!P(e))break;t=e}t.remove()}(n),!0})(),l.AcJ),e.registerNodeTransform(y,e=>{let t=e.getFirstChild();if(t){if((0,l.kFe)(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=(0,l.vJq)();(0,l.I2P)(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(l.Ey8,e=>{let t=e.getParent();if(b(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function D(e,t){e.update(()=>f(t))}},74765:(e,t,n)=>{n.d(t,{Q:()=>o});var r=n(70893),l=n(94271),i=n(12115);function o(){let[e]=(0,l.DF)();return(0,i.useEffect)(()=>{if(!e.hasNodes([r.v5,r.YW]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),(0,i.useEffect)(()=>(0,r.cz)(e),[e]),null}},76598:(e,t,n)=>{n.d(t,{R:()=>u});var r=n(12115),l=n(95155);function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var o={error:null},a=function(e){function t(){for(var t,n=arguments.length,r=Array(n),l=0;l<n;l++)r[l]=arguments[l];return(t=e.call.apply(e,[this].concat(r))||this).state=o,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=Array(n),l=0;l<n;l++)r[l]=arguments[l];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(o)},n.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},n.componentDidUpdate=function(e,t){var n,r,l,i,o=this.state.error,a=this.props.resetKeys;null!==o&&null!==t.error&&(void 0===(l=e.resetKeys)&&(l=[]),void 0===(i=a)&&(i=[]),l.length!==i.length||l.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,a),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,l=t.FallbackComponent,i=t.fallback;if(null!==e){var o={error:e,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(i))return i;if("function"==typeof n)return n(o);if(l)return r.createElement(l,o);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(r.Component);function u({children:e,onError:t}){return(0,l.jsx)(a,{fallback:(0,l.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}},81521:(e,t,n)=>{n.d(t,{yl:()=>l});var r=n(32532);function l(e){return()=>(function(e){if(!function(e,t=!0){if(e)return!1;let n=(0,r.NiT)().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;let t=(0,r.NiT)().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if((0,r.Cyw)(n))return!1;if((0,r.ff4)(n)){if(!(0,r.bSg)(n)||0!==n.__indent)return!1;let t=n.getChildren(),l=t.length;for(let n=0;n<l;n++){let n=t[e];if(!(0,r.kFe)(n))return!1}}}return!0})(e)}}
15,92749:(e,t,n)=>{n.d(t,{Bt:()=>p,HE:()=>f,K2:()=>S,OV:()=>v,Pe:()=>m,Sd:()=>d,ZB:()=>c,a9:()=>r.a9V,cE:()=>w,cj:()=>_,eu:()=>h,mB:()=>g,nY:()=>r.nYP,sb:()=>r.sby,vF:()=>b,xj:()=>y,zD:()=>C});var r=n(32532);function l(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.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.`)}n(61731);let i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,o=i&&"documentMode"in document?document.documentMode:null,a=(i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),i&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));function u(...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 d(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}i&&"InputEvent"in window&&!o&&new window.InputEvent("input"),i&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),i&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,i&&/Android/.test(navigator.userAgent),i&&/^(?=.*Chrome).*/i.test(navigator.userAgent);i&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function c(e,...t){let n=u(...t);n.length>0&&e.classList.add(...n)}function f(e,...t){let n=u(...t);n.length>0&&e.classList.remove(...n)}function h(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function g(e){let t=p(e,e=>(0,r.ff4)(e)&&!e.isInline());return(0,r.ff4)(t)||l(4,e.__key),t}let p=(e,t)=>{let n=e;for(;n!==(0,r.NiT)()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};function m(e){let t,n=(0,r.vJq)()||(0,r.S1w)();if((0,r.I2P)(n))t=(0,r.Ave)(n.focus,"next");else{if(null!=n){let e=n.getNodes(),l=e[e.length-1];l&&(t=(0,r.IlV)(l,"next"))}t=t||(0,r.uwZ)((0,r.NiT)(),"previous").getFlipped().insert((0,r.lJ7)())}let i=function(e,t,n){let i=(0,r.Csq)(t,"next");for(let e=i;e;e=(0,r.k1Q)(e,void 0))i=e;return(0,r.rN)(i)&&l(283),i.insert(e.isInline()?(0,r.lJ7)().append(e):e),(0,r.Csq)((0,r.IlV)(e.getLatest(),"next"),t.direction)}(e,t),o=(0,r.erb)(i),a=(0,r.cmH)(o)?(0,r.lSZ)(o):i;return(0,r.xQ8)((0,r.sWS)(a)),e.getLatest()}function _(e,t){let n=t();return e.replace(n),n.append(e),n}function y(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function C(e,t){let n=[];for(let r=0;r<e.length;r++){let l=t(e[r]);null!==l&&n.push(l)}return n}function S(e,t){(0,r.uwZ)(e,"next").insert(t)}let x=!(a||!i)&&void 0;function v(e){let t=1;if(function(){if(void 0===x){let e=document.createElement("div");e.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty("zoom","2"),x=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return x}())for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t}function b(e,t){return function e(t,n,l){let i=!1;for(let o of T(t))n(o)?null!==l&&l(o):(i=!0,(0,r.ff4)(o)&&e(o,n,l||(e=>o.insertAfter(e))),o.remove());return i}(e,t,null)}function w(e,t){let n=[],l=Array.from(e).reverse();for(let e=l.pop();void 0!==e;e=l.pop())if(t(e))n.push(e);else if((0,r.ff4)(e))for(let t of T(e))l.push(t);return n}function T(e){return function(e){return(0,r.Bts)({hasNext:r.OpE,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}((0,r.uwZ)(e,"previous"))}function k(e,t="root"){let n=0,r=e,l=s(r);for(;null===l;){if(n--,!(l=r.getParentCaret(t)))return null;l=s(r=l)}return l&&[l,n]}},94271:(e,t,n)=>{n.d(t,{DF:()=>o,Gu:()=>l,Mx:()=>i});var r=n(12115);let l=(0,r.createContext)(null);function i(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}function o(){let e=(0,r.useContext)(l);return null==e&&function(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let e of(r.append("code",8),t))r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${8}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}},96560:(e,t,n)=>{n.d(t,{D:()=>o});var r=n(94271),l=n(12115);let i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function o({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[l]=(0,r.DF)();return i(()=>
15{if(n)return l.registerUpdateListener(({editorState:r,dirtyElements:i,dirtyLeaves:o,prevEditorState:a,tags:u})=>{t&&0===i.size&&0===o.size||e&&u.has("history-merge")||a.isEmpty()||n(r,l,u)})},[l,e,t,n]),null}}}]);

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.